| 786 | } |
| 787 | |
| 788 | std::vector<double> TableMultiVariableLookup_Impl::xValues(int xIndex) const { |
| 789 | std::vector<double> result; |
| 790 | |
| 791 | if (xIndex >= numberofIndependentVariables()) { |
| 792 | return result; |
| 793 | } |
| 794 | |
| 795 | std::vector<TableMultiVariableLookupPoint> t_points = points(); |
| 796 | for (const TableMultiVariableLookupPoint& pt : t_points) { |
| 797 | std::vector<double> xValues = pt.x(); |
| 798 | result.push_back(xValues[xIndex]); |
| 799 | } |
| 800 | |
| 801 | std::sort(result.begin(), result.end()); |
| 802 | result.erase(std::unique(result.begin(), result.end()), result.end()); |
| 803 | |
| 804 | return result; |
| 805 | } |
| 806 | |
| 807 | boost::optional<double> TableMultiVariableLookup_Impl::yValue(const std::vector<double>& xValues) const { |
| 808 | boost::optional<double> result; |