aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/SparseQR/SparseQR.h
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2015-02-16 13:19:05 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2015-02-16 13:19:05 +0100
commitaa6c516ec17fb44dff85b1abf3a1b05d58d3bc01 (patch)
treecd0b6ce4d023ff6734beecc167749d00f301c017 /Eigen/src/SparseQR/SparseQR.h
parentfc202bab398ed9b78ef8452f8e4ef35e233965f6 (diff)
Fix many long to int conversion warnings:
- fix usage of Index (API) versus StorageIndex (when multiple indexes are stored) - use StorageIndex(val) when the input has already been check - use internal::convert_index<StorageIndex>(val) when val is potentially unsafe (directly comes from user input)
Diffstat (limited to 'Eigen/src/SparseQR/SparseQR.h')
-rw-r--r--Eigen/src/SparseQR/SparseQR.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/Eigen/src/SparseQR/SparseQR.h b/Eigen/src/SparseQR/SparseQR.h
index 920b884e5..ce4a70454 100644
--- a/Eigen/src/SparseQR/SparseQR.h
+++ b/Eigen/src/SparseQR/SparseQR.h
@@ -296,7 +296,7 @@ void SparseQR<MatrixType,OrderingType>::analyzePattern(const MatrixType& mat)
if (!m_perm_c.size())
{
m_perm_c.resize(n);
- m_perm_c.indices().setLinSpaced(n, 0,n-1);
+ m_perm_c.indices().setLinSpaced(n, 0,StorageIndex(n-1));
}
// Compute the column elimination tree of the permuted matrix
@@ -327,8 +327,8 @@ void SparseQR<MatrixType,OrderingType>::factorize(const MatrixType& mat)
using std::abs;
eigen_assert(m_analysisIsok && "analyzePattern() should be called before this step");
- StorageIndex m = mat.rows();
- StorageIndex n = mat.cols();
+ StorageIndex m = StorageIndex(mat.rows());
+ StorageIndex n = StorageIndex(mat.cols());
StorageIndex diagSize = (std::min)(m,n);
IndexVector mark((std::max)(m,n)); mark.setConstant(-1); // Record the visited nodes
IndexVector Ridx(n), Qidx(m); // Store temporarily the row indexes for the current column of R and Q
@@ -406,7 +406,7 @@ void SparseQR<MatrixType,OrderingType>::factorize(const MatrixType& mat)
for (typename QRMatrixType::InnerIterator itp(m_pmat, col); itp || !found_diag; ++itp)
{
StorageIndex curIdx = nonzeroCol;
- if(itp) curIdx = itp.row();
+ if(itp) curIdx = StorageIndex(itp.row());
if(curIdx == nonzeroCol) found_diag = true;
// Get the nonzeros indexes of the current column of R
@@ -467,7 +467,7 @@ void SparseQR<MatrixType,OrderingType>::factorize(const MatrixType& mat)
{
for (typename QRMatrixType::InnerIterator itq(m_Q, curIdx); itq; ++itq)
{
- StorageIndex iQ = itq.row();
+ StorageIndex iQ = StorageIndex(itq.row());
if (mark(iQ) != col)
{
Qidx(nzcolQ++) = iQ; // Add this row to the pattern of Q,