20 MapType::const_iterator mapIter = m_map.find(name);
23 if (mapIter == m_map.end())
27 if (newList.size() > 1)
29 if (m_numValues > 1 && newList.size() != m_numValues)
32 <<
"' to StaticParameterMap: It contains " 33 << newList.size() <<
"values (should be " 36 else if (m_numValues == 1)
38 m_numValues = newList.size();
49 MapType::const_iterator mapIter = m_map.find(name);
51 if (mapIter != m_map.end())
53 return mapIter->second;
56 throw std::range_error(
"'" + name +
"' does not exist in InputStaticParameterMap");
61 if (m_map.empty() || m_numValues == 1)
67 MapType localMap = m_map;
71 std::vector<ValueType> temp;
73 for (
size_t i = 0; i < m_numValues; ++i)
79 MapType::const_iterator foundPair = localMap.find(name);
83 if (foundPair != localMap.end())
87 const ValueType& list = foundPair->second;
91 for (
size_t i = 0; i < list.size(); ++i)
93 temp[i].push_back(list[i]);
100 for (MapType::const_iterator mapIter = localMap.begin(); mapIter != localMap.end();
103 if (!name.empty() && name == mapIter->first)
113 for (
size_t i = 0; i < list.size(); ++i)
115 temp[i].push_back(list[i]);
122 std::sort(temp.begin(), temp.end());
127 MapType::iterator foundPair = localMap.find(name);
129 if (foundPair != localMap.end())
139 for (
size_t j = 0; j < temp.size(); ++j)
141 list.push_back(temp[j][i]);
149 for (MapType::iterator mapIter = localMap.begin(); mapIter != localMap.end(); ++mapIter)
151 if (!name.empty() && name == mapIter->first)
163 for (
size_t j = 0; j < temp.size(); ++j)
165 list.push_back(temp[j][i]);
std::pair< KeyType, ValueType > StaticParameterType
Type of a variable, consisting of name and value list.
ModelBase::StaticParameterValuesType ValueType
Type of the map value.
void Add(const std::string &name, const ValueType &newList)
Adds the given value list under the given variable name if the name doesn't exist already...
void Clear()
Resets the map, so it's empty.
const ValueType & Get(const std::string &name) const
Returns the values of the given variable name.
#define mitkThrowException(classname)
Class-specific exception for modelfits.
void Sort(const std::string &name="")
Sorts the values of the given variable name in ascending order. The values of all other variables wil...