Skip to content
Snippets Groups Projects
Commit 59953edf authored by Emmanuel Christophe's avatar Emmanuel Christophe
Browse files

BUG: const correctness + style

parent 3a52a0c9
No related branches found
No related tags found
No related merge requests found
......@@ -37,15 +37,15 @@ class CBAMI
{
public:
typedef typename std::vector<TOutput> VectorType;
typedef typename VectorType::iterator IteratorType;
typedef typename std::vector<VectorType> VectorOfVectorType;
typedef typename std::vector<TOutput> VectorType;
typedef typename VectorType::iterator IteratorType;
typedef typename std::vector<VectorType> VectorOfVectorType;
typedef typename VectorOfVectorType::iterator VecOfVecIteratorType;
CBAMI() {};
virtual ~CBAMI() {};
inline TOutput operator()( const TInput1 & itA,
const TInput2 & itB)
const TInput2 & itB) const
{
double epsilon = 0.01;
VectorType vecA;
......@@ -67,7 +67,7 @@ public:
protected:
inline void normalizeInPlace(VectorType vx)
inline void normalizeInPlace(VectorType vx) const
{
TOutput Ex = 0.0;
......@@ -76,7 +76,7 @@ protected:
for ( itx = vx.begin(); itx < vx.end(); ++itx)
{
Ex += static_cast<TOutput>(*itx);
Ex += static_cast<TOutput>(*itx);
}
Ex /= (vx.size());
......@@ -85,7 +85,7 @@ protected:
for ( itx = vx.begin(); itx < vx.end(); ++itx)
{
Vx += static_cast<TOutput>(vcl_pow(static_cast<double>((*itx)-Ex),2));
Vx += static_cast<TOutput>(vcl_pow(static_cast<double>((*itx)-Ex),2));
}
Vx /= (vx.size());
......@@ -97,7 +97,7 @@ protected:
}
inline TOutput Exyc(VectorType vx, VectorType vy)
inline TOutput Exyc(VectorType vx, VectorType vy) const
{
TOutput Exy = 0.0;
......@@ -111,7 +111,7 @@ protected:
{
//Ex += (*itx);
//Ey += (*ity);
Exy += (*itx)*(*ity);
Exy += (*itx)*(*ity);
}
......@@ -122,7 +122,7 @@ protected:
return Exy-Ex*Ey;
}
inline TOutput Exyztc(VectorType vx, VectorType vy, VectorType vz, VectorType vt)
inline TOutput Exyztc(VectorType vx, VectorType vy, VectorType vz, VectorType vt) const
{
TOutput Exyzt = 0.0;
......@@ -206,14 +206,14 @@ protected:
return result;
}
inline TOutput Rxy(VectorType va, VectorType vb)
inline TOutput Rxy(VectorType va, VectorType vb) const
{
return Exyc(va, vb);
}
inline TOutput Qxijkl(VectorType va, VectorType vb, VectorType vc, VectorType vd)
inline TOutput Qxijkl(VectorType va, VectorType vb, VectorType vc, VectorType vd) const
{
// IteratorType ita;
// IteratorType itb;
......@@ -236,7 +236,7 @@ protected:
}
inline TOutput PhiMI(VectorType v1, VectorType v2)
inline TOutput PhiMI(VectorType v1, VectorType v2) const
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment