Skip to content

Commit

Permalink
remove useless const's from *ArrayDim2, typo, some whitespaces
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@25438 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
rfranke committed Apr 8, 2015
1 parent 6e9befc commit c556049
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions SimulationRuntime/cpp/Include/Core/Math/Array.h
Expand Up @@ -39,7 +39,7 @@ template<class T>class BaseArray
throw ModelicaSimulationError(MODEL_ARRAY_FUNCTION,"Wrong virtual Array operator call");
};

virtual T& operator()(const unsigned int i, const unsigned int j)
virtual T& operator()(unsigned int i, unsigned int j)
{
throw ModelicaSimulationError(MODEL_ARRAY_FUNCTION,"Wrong virtual Array operator call");
};
Expand Down Expand Up @@ -437,7 +437,8 @@ template<std::size_t size>class StatArrayDim1<string,size> : public BaseArray<st
};


template<typename T ,std::size_t size1,std::size_t size2,bool fotran = false>class StatArrayDim2 : public BaseArray<T>
template<typename T, std::size_t size1, std::size_t size2, bool fortran = false>
class StatArrayDim2 : public BaseArray<T>
{

public:
Expand Down Expand Up @@ -526,19 +527,19 @@ template<typename T ,std::size_t size1,std::size_t size2,bool fotran = false>cla
return _array_data[size2*(idx[0] - 1) + idx[1] - 1]; //row wise order
};

inline virtual T& operator()(const unsigned int i, const unsigned int j)
inline virtual T& operator()(unsigned int i, unsigned int j)
{
if(fotran)
return _array_data[size1*(j - 1) + i - 1]; //column wise order
else
return _array_data[size2*(i - 1) + j - 1]; //row wise order
if (fortran)
return _array_data[size1*(j - 1) + i - 1]; //column wise order
else
return _array_data[size2*(i - 1) + j - 1]; //row wise order
}
inline virtual const T& operator()(const unsigned int i, const unsigned int j) const
inline virtual const T& operator()(unsigned int i, unsigned int j) const
{
if(fotran)
return _array_data[size1*(j - 1) + i - 1];//column wise order
if (fortran)
return _array_data[size1*(j - 1) + i - 1]; //column wise order
else
return _array_data[size2*(i - 1) + j - 1];//row wise order
return _array_data[size2*(i - 1) + j - 1]; //row wise order
}


Expand Down Expand Up @@ -724,11 +725,11 @@ class StatArrayDim2<string,size1,size2> : public BaseArray<string>
return _array_data[size2*(idx[0] - 1) + idx[1] - 1]; //row wise order
};

inline virtual string& operator()(const unsigned int i, const unsigned int j)
inline virtual string& operator()(unsigned int i, unsigned int j)
{
return _array_data[size2*(i - 1) + j - 1]; //row wise order
}
inline virtual const string& operator()(const unsigned int i, const unsigned int j) const
inline virtual const string& operator()(unsigned int i, unsigned int j) const
{
return _array_data[size2*(i - 1) + j - 1];//row wise order
}
Expand Down Expand Up @@ -1445,7 +1446,7 @@ template<typename T >class DynArrayDim2 : public BaseArray<T>
{
return _multi_array[idx[0]][idx[1]];
};
inline virtual T& operator()(const unsigned int i, const unsigned int j)
inline virtual T& operator()(unsigned int i, unsigned int j)
{
return _multi_array[i][j];
}
Expand Down

0 comments on commit c556049

Please sign in to comment.