| 850 | } |
| 851 | |
| 852 | AnyMap SolutionArray::getAuxiliary(int loc) |
| 853 | { |
| 854 | setLoc(loc); |
| 855 | AnyMap out; |
| 856 | for (const auto& [key, extra] : *m_extra) { |
| 857 | if (extra.is<void>()) { |
| 858 | out[key] = extra; |
| 859 | } else if (extra.isVector<long int>()) { |
| 860 | out[key] = extra.asVector<long int>()[m_loc]; |
| 861 | } else if (extra.isVector<double>()) { |
| 862 | out[key] = extra.asVector<double>()[m_loc]; |
| 863 | } else if (extra.isVector<string>()) { |
| 864 | out[key] = extra.asVector<string>()[m_loc]; |
| 865 | } else if (extra.isVector<vector<long int>>()) { |
| 866 | out[key] = extra.asVector<vector<long int>>()[m_loc]; |
| 867 | } else if (extra.isVector<vector<double>>()) { |
| 868 | out[key] = extra.asVector<vector<double>>()[m_loc]; |
| 869 | } else if (extra.isVector<vector<string>>()) { |
| 870 | out[key] = extra.asVector<vector<string>>()[m_loc]; |
| 871 | } else { |
| 872 | throw NotImplementedError("SolutionArray::getAuxiliary", |
| 873 | "Unable to retrieve data for component '{}' with type '{}'.", |
| 874 | key, extra.type_str()); |
| 875 | } |
| 876 | } |
| 877 | return out; |
| 878 | } |
| 879 | |
| 880 | void SolutionArray::setAuxiliary(int loc, const AnyMap& data) |
| 881 | { |