| 805 | } |
| 806 | |
| 807 | boost::optional<double> TableMultiVariableLookup_Impl::yValue(const std::vector<double>& xValues) const { |
| 808 | boost::optional<double> result; |
| 809 | |
| 810 | std::vector<TableMultiVariableLookupPoint> t_points = points(); |
| 811 | for (const TableMultiVariableLookupPoint& pt : t_points) { |
| 812 | std::vector<double> t_c = pt.x(); |
| 813 | if (xValuesEqual(t_c, xValues)) { |
| 814 | result = pt.y(); |
| 815 | break; |
| 816 | } |
| 817 | } |
| 818 | |
| 819 | return result; |
| 820 | } |
| 821 | |
| 822 | bool TableMultiVariableLookup_Impl::setPoints(const std::vector<TableMultiVariableLookupPoint>& points) { |
| 823 | // We first check that ALL points have the right number of independent variables, before we do anything destructive such as clearing the points |