Пример #1
0
std::vector<Quantity> OSQuantityVector::quantities() const {
  QuantityVector result;
  for (double value : values()) {
    result.push_back(Quantity(value,units()));
  }
  return result;
}
TEST_F(UnitsFixture,OSQuantityVector_Profiling_Construction_QuantityVectorBaseCase) {
  for (unsigned i = 0, n = 100; i < n; ++i) {
    DoubleVector vals = toStandardVector(randVector(0.0,1.0,8760u));
    Unit u = createSIForce();
    QuantityVector result;
    BOOST_FOREACH(double val,vals) {
      result.push_back(Quantity(val,u));
    }
  }
Пример #3
0
std::vector<Quantity> OSArgument::domainAsQuantity() const {
  if (!hasDomain()) {
    LOG_AND_THROW("No domain set for OSArgument '" << name() << "'.");
  }
  QuantityVector result;
  for (const QVariant& value : m_domain) {
    result.push_back(value.value<openstudio::Quantity>());
  }
  return result;
}