aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/SparseLU/SparseLU.h
diff options
context:
space:
mode:
authorGravatar Desire NUENTSA <desire.nuentsa_wakam@inria.fr>2013-07-16 15:56:05 +0200
committerGravatar Desire NUENTSA <desire.nuentsa_wakam@inria.fr>2013-07-16 15:56:05 +0200
commitcfd7f9b84a27d9b88a525560a5d7ee847bc8c507 (patch)
tree1ab04fee55cb48480c39d13b28d38cb66708b163 /Eigen/src/SparseLU/SparseLU.h
parent3e094af410caed08f4ef0fdf3c08df579dfd5337 (diff)
avoid unneeded const_cast
Diffstat (limited to 'Eigen/src/SparseLU/SparseLU.h')
-rw-r--r--Eigen/src/SparseLU/SparseLU.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/Eigen/src/SparseLU/SparseLU.h b/Eigen/src/SparseLU/SparseLU.h
index a024b2e16..503942b84 100644
--- a/Eigen/src/SparseLU/SparseLU.h
+++ b/Eigen/src/SparseLU/SparseLU.h
@@ -377,12 +377,13 @@ void SparseLU<MatrixType, OrderingType>::analyzePattern(const MatrixType& mat)
if (m_perm_c.size()) {
m_mat.uncompress(); //NOTE: The effect of this command is only to create the InnerNonzeros pointers. FIXME : This vector is filled but not subsequently used.
//Then, permute only the column pointers
- Index * outerIndexPtr;
- if (mat.isCompressed()) outerIndexPtr = const_cast<Index *>(mat.outerIndexPtr());
+ const Index * outerIndexPtr;
+ if (mat.isCompressed()) outerIndexPtr = mat.outerIndexPtr();
else
{
- outerIndexPtr = new Index[mat.cols()+1];
- for(Index i = 0; i <= mat.cols(); i++) outerIndexPtr[i] = m_mat.outerIndexPtr()[i];
+ Index *outerIndexPtr_t = new Index[mat.cols()+1];
+ for(Index i = 0; i <= mat.cols(); i++) outerIndexPtr_t[i] = m_mat.outerIndexPtr()[i];
+ outerIndexPtr = outerIndexPtr_t;
}
for (Index i = 0; i < mat.cols(); i++)
{
@@ -461,12 +462,13 @@ void SparseLU<MatrixType, OrderingType>::factorize(const MatrixType& matrix)
{
m_mat.uncompress(); //NOTE: The effect of this command is only to create the InnerNonzeros pointers.
//Then, permute only the column pointers
- Index * outerIndexPtr;
- if (matrix.isCompressed()) outerIndexPtr = const_cast<Index *>(matrix.outerIndexPtr());
+ const Index * outerIndexPtr;
+ if (matrix.isCompressed()) outerIndexPtr = matrix.outerIndexPtr();
else
{
- outerIndexPtr = new Index[matrix.cols()+1];
- for(Index i = 0; i <= matrix.cols(); i++) outerIndexPtr[i] = m_mat.outerIndexPtr()[i];
+ Index* outerIndexPtr_t = new Index[matrix.cols()+1];
+ for(Index i = 0; i <= matrix.cols(); i++) outerIndexPtr_t[i] = m_mat.outerIndexPtr()[i];
+ outerIndexPtr = outerIndexPtr_t;
}
for (Index i = 0; i < matrix.cols(); i++)
{