MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / points

Method points

src/model/TableMultiVariableLookup.cpp:712–739  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

710 }
711
712 std::vector<TableMultiVariableLookupPoint> TableMultiVariableLookup_Impl::points() const {
713 std::vector<TableMultiVariableLookupPoint> result;
714
715 int t_numberofIndependentVariables = numberofIndependentVariables();
716
717 std::vector<IdfExtensibleGroup> groups = extensibleGroups();
718 int numberOfPoints = groups.size() / (t_numberofIndependentVariables + 1);
719
720 for (int iPoint = 0; iPoint != numberOfPoints; ++iPoint) {
721 std::vector<double> xValues(t_numberofIndependentVariables);
722 for (int i = 0; i != t_numberofIndependentVariables; ++i) {
723 IdfExtensibleGroup g = groups[iPoint * (t_numberofIndependentVariables + 1) + i];
724 boost::optional<double> d = g.getDouble(OS_Table_MultiVariableLookupExtensibleFields::Data);
725 OS_ASSERT(d);
726 xValues[i] = d.get();
727 }
728
729 IdfExtensibleGroup g = groups[iPoint * (t_numberofIndependentVariables + 1) + t_numberofIndependentVariables];
730 boost::optional<double> d = g.getDouble(OS_Table_MultiVariableLookupExtensibleFields::Data);
731 OS_ASSERT(d);
732 double yValue = d.get();
733
734 TableMultiVariableLookupPoint point(xValues, yValue);
735 result.push_back(point);
736 }
737
738 return result;
739 }
740
741 // Helper function for printTable
742 std::string centered(const std::string& original, int targetSize) {

Callers 2

printTableMethod · 0.95
TEST_FFunction · 0.45

Calls 4

sizeMethod · 0.45
getDoubleMethod · 0.45
getMethod · 0.45
push_backMethod · 0.45

Tested by 1

TEST_FFunction · 0.36