fix a number of compiler errors and warnings with gcc 4.3. There was a missing

#include<algorithm> so I'm not sure how it compiled at all for you :)
This commit is contained in:
Benoit Jacob
2008-08-22 01:19:53 +00:00
parent db628c6ad7
commit a814ebe180
7 changed files with 12 additions and 5 deletions

View File

@@ -71,7 +71,7 @@ class HashMatrix : public SparseMatrixBase<HashMatrix<_Scalar, _Flags> >
public:
inline void startFill(int reserveSize = 1000) {}
inline void startFill(int /*reserveSize = 1000 --- currenty unused, don't generate a warning*/) {}
inline Scalar& fill(int row, int col) { return coeffRef(row, col); }

View File

@@ -51,6 +51,7 @@ template<typename Scalar> class SparseArray
resize(other.size());
memcpy(m_values, other.m_values, m_size * sizeof(Scalar));
memcpy(m_indices, other.m_indices, m_size * sizeof(int));
return *this;
}
void swap(SparseArray& other)

View File

@@ -213,8 +213,8 @@ class SparseMatrix : public SparseMatrixBase<SparseMatrix<_Scalar, _Flags> >
for (int j=0; j<=m_outerSize; ++j)
m_outerIndex[j] = other.m_outerIndex[j];
m_data = other.m_data;
return *this;
}
return *this;
}
template<typename OtherDerived>

View File

@@ -73,8 +73,10 @@ class SparseMatrixBase : public MatrixBase<Derived>
{
Scalar v = it.value();
if (v!=Scalar(0))
{
if (OtherDerived::Flags & RowMajorBit) temp.fill(j,it.index()) = v;
else temp.fill(it.index(),j) = v;
}
}
}
temp.endFill();
@@ -100,8 +102,10 @@ class SparseMatrixBase : public MatrixBase<Derived>
{
Scalar v = it.value();
if (v!=Scalar(0))
{
if (RowMajor) derived().fill(j,it.index()) = v;
else derived().fill(it.index(),j) = v;
}
}
}
derived().endFill();