Commit 77a83d0c authored by Andreas Fabri's avatar Andreas Fabri

int -> std::size_t

parent a5a1857b
......@@ -50,7 +50,7 @@ solve(NProblemInterface* _problem,
//----------------------------------------------
// 2. setup constraints
//----------------------------------------------
int n = _problem->n_unknowns();
std::size_t n = _problem->n_unknowns();
gmm::row_matrix< gmm::wsvector< double > > C(_constraints.size(), n+1);
int n_constraints = 0;
......
......@@ -34,7 +34,7 @@ std::vector<double>& FiniteElementProblem::x()
}
int FiniteElementProblem::n_unknowns()
std::size_t FiniteElementProblem::n_unknowns()
{
return n_;
}
......
......@@ -226,7 +226,7 @@ public:
std::vector<double>& x();
// problem definition
virtual int n_unknowns ( );
virtual std::size_t n_unknowns ( );
virtual void initial_x ( double* _x );
......
......@@ -66,7 +66,7 @@ eval_term(const unsigned int _i)
//-----------------------------------------------------------------------------
int
std::size_t
LeastSquaresProblem::
n_unknowns ( )
{
......
......@@ -57,7 +57,7 @@ public:
std::vector<double>& x() {return x_;}
// problem definition
virtual int n_unknowns ( );
virtual std::size_t n_unknowns ( );
virtual void initial_x ( double* _x );
virtual double eval_f ( const double* _x );
virtual void eval_gradient( const double* _x, double* _g);
......
......@@ -8,7 +8,7 @@
namespace COMISO {
LinearProblem::LinearProblem (unsigned int _dimension)
LinearProblem::LinearProblem (std::size_t _dimension)
{
// resize and zero elements
coeffs_.resize(_dimension,0.0);
......@@ -19,7 +19,7 @@ LinearProblem::~LinearProblem()
{
}
int LinearProblem::n_unknowns()
std::size_t LinearProblem::n_unknowns()
{
return coeffs_.size();
}
......
......@@ -43,13 +43,13 @@ class COMISODLLEXPORT LinearProblem : public NProblemInterface
public:
/// Default constructor
LinearProblem (unsigned int _dimension = 0);
LinearProblem (std::size_t _dimension = 0);
/// Destructor
virtual ~LinearProblem();
// problem definition
virtual int n_unknowns();
virtual std::size_t n_unknowns();
virtual void initial_x(double* _x);
......
......@@ -26,7 +26,7 @@ NPTiming::NPTiming(NProblemInterface* _base) : base_(_base) {start_timing();}
/// Destructor
NPTiming::~NPTiming() {}
int NPTiming::n_unknowns ()
std::size_t NPTiming::n_unknowns ()
{
return base_->n_unknowns();
}
......
......@@ -42,7 +42,7 @@ public:
/// Destructor
~NPTiming();
virtual int n_unknowns ();
virtual std::size_t n_unknowns ();
virtual void initial_x( double* _x );
......
......@@ -59,7 +59,7 @@ public:
virtual ~NProblemInterface();
// problem definition
virtual int n_unknowns ( ) = 0;
virtual std::size_t n_unknowns ( ) = 0;
virtual void initial_x ( double* _x ) = 0;
virtual double eval_f ( const double* _x ) = 0;
virtual void eval_gradient( const double* _x, double* _g) = 0;
......
......@@ -593,6 +593,7 @@ make_constraints_independent_reordering(
// Base::StopWatch sw;
// number of variables
// AF: Why is n_vars signed? Can it be zero? Later we subtract 1
int n_vars = gmm::mat_ncols(_constraints);
// TODO Check: HZ added 14.08.09
......@@ -857,10 +858,10 @@ update_constraint_gcd( RMatrixT& _constraints,
for( ; row_it!=row_end; ++row_it)
{
int cur_j = row_it.index();
gmm::size_type cur_j = row_it.index();
_constraints(_row_i, cur_j) = (*row_it)/i_gcd;
}
int elim_coeff = abs(_constraints(_row_i, _elim_j));
gmm::size_type elim_coeff = abs(_constraints(_row_i, _elim_j));
DEB_error_if( elim_coeff != 1, "elimination coefficient " << elim_coeff
<< " will (most probably) NOT lead to an integer solution!")
return true;
......
......@@ -766,7 +766,7 @@ void gmm_to_eigen( const gmm::csc_matrix<GMM_RealT,0>& _G, EIGEN_MatrixT& _E)
CIter it = gmm::vect_const_begin( col );
CIter ite = gmm::vect_const_end( col );
for ( ; it!=ite; ++it )
triplets.push_back( Triplet( it.index(), i, *it));
triplets.push_back( Triplet( static_cast<int>(it.index()), i, *it));
}
......
......@@ -60,7 +60,7 @@ gauss_seidel_local( typename gmm::csc_matrix<Real>& _A,
res_i += ( *it ) * _x[it.index()];
x_i_new -= ( *it ) * _x[it.index()];
if( it.index() != cur_i)
i_temp.push_back( it.index() );
i_temp.push_back( static_cast<int>(it.index()) );
else
diag = *it;
}
......@@ -135,7 +135,7 @@ gauss_seidel_local2( typename gmm::csc_matrix<Real>& _A,
res_i += ( *it ) * _x[it.index()];
x_i_new -= ( *it ) * _x[it.index()];
if( it.index() != cur_i)
i_temp.push_back( it.index() );
i_temp.push_back( static_cast<int>(it.index()) );
else
diag = *it;
}
......
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