Commit 54dc54db authored by Max Lyon's avatar Max Lyon

Merge branch 'Fix_warnings-GF' into warning_fixes

parents d4bbe377 cf02a697
......@@ -150,7 +150,7 @@ bool solve_impl(
DEB_warning_if(!_problem->constant_gradient(), 1,
"CBCSolver received a problem with non-constant gradient!");
const int n_rows = _constraints.size(); // Constraints #
const size_t n_rows = _constraints.size(); // Constraints #
const int n_cols = _problem->n_unknowns(); // Unknowns #
// expand the variable types from discrete mtrx array
......
......@@ -340,7 +340,7 @@ void cholmod_to_eigen( const cholmod_sparse& _AC, MatrixT& _A)
typedef Eigen::Triplet< Scalar > Triplet;
size_t nzmax( _AC.nzmax);
std::cerr << __FUNCTION__ << " row " << _AC.nrow << " col " << _AC.ncol << " stype " << _AC.stype << std::endl;
_A = MatrixT(_AC.nrow, _AC.ncol);
_A = MatrixT((int)_AC.nrow, (int)_AC.ncol);
std::vector< Triplet > triplets;
triplets.reserve(nzmax);
......@@ -365,7 +365,7 @@ void cholmod_to_eigen( const cholmod_sparse& _AC, MatrixT& _A)
for(SuiteSparse_long i=0; i<(SuiteSparse_long)_AC.ncol; ++i)
for(SuiteSparse_long j= P[i]; j< P[i+1]; ++j)
//_A( I[j], i) += X[j]; // += really needed?
triplets.push_back( Triplet( I[j], i, X[j]));
triplets.push_back(Triplet((int)I[j], (int)i, X[j]));
}
else
{
......@@ -374,7 +374,7 @@ void cholmod_to_eigen( const cholmod_sparse& _AC, MatrixT& _A)
for(int i=0; i<(int)_AC.ncol; ++i)
for(int j= P[i]; j< P[i+1]; ++j)
triplets.push_back( Triplet( I[j], i, X[j]));
triplets.push_back(Triplet((int)I[j], (int)i, X[j]));
//_A( I[j], i) += X[j];
}
......@@ -391,11 +391,11 @@ void cholmod_to_eigen( const cholmod_sparse& _AC, MatrixT& _A)
for(SuiteSparse_long j=P[i]; j<P[i+1]; ++j)
{
//_A(I[j], i) += X[j];
triplets.push_back( Triplet( I[j], i, X[j]));
triplets.push_back(Triplet((int)I[j], (int)i, X[j]));
// add up symmetric part
if( I[j] != i)
triplets.push_back( Triplet( i, I[j], X[j]));
triplets.push_back(Triplet((int)i, (int)I[j], X[j]));
//_A(i,I[j]) += X[j];
}
}
......
......@@ -211,7 +211,7 @@ factorize_system_eigen( const Eigen_MatrixT& _A, Eigen_MatrixT& _Q, Eigen_Matrix
cholmod_sparse *Q, *R;
// SuiteSparse_long *P = new SuiteSparse_long[n];
SuiteSparse_long *P;
double rank = SuiteSparseQR<double>(ordering_, tolerance_, econ, AC, &Q, &R, &P, mp_cholmodCommon);
int rank = (int)SuiteSparseQR<double>(ordering_, tolerance_, econ, AC, &Q, &R, &P, mp_cholmodCommon);
std::cerr << "factorization finished" << std::endl;
std::cerr << "rank: " << rank << std::endl;
cholmod_print_sparse(Q, "Q", mp_cholmodCommon);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment