Commit 3c6c3bef authored by Heng Liu's avatar Heng Liu

fix compile error with GMM-5.3

parent ba9a60b5
Pipeline #12218 failed with stages
in 6 minutes and 57 seconds
......@@ -50,7 +50,10 @@ namespace COMISO_GMM
//== IMPLEMENTATION ==========================================================
// cf. issue #3 - gmm5.2 compat
template <typename T>
using linalg_traits = typename gmm::linalg_traits<typename std::remove_const<typename std::remove_reference<T>::type>::type>;
//-----------------------------------------------------------------------------
......@@ -377,8 +380,8 @@ void eliminate_var( const unsigned int _j,
//sw1.start();
typedef typename gmm::linalg_traits< gmm::col_matrix< SVT > >::const_sub_col_type ColT;
typedef typename gmm::linalg_traits<ColT>::const_iterator CIter;
typedef typename linalg_traits< gmm::col_matrix< SVT > >::const_sub_col_type ColT;
typedef typename linalg_traits<ColT>::const_iterator CIter;
unsigned int m = gmm::mat_nrows( _A );
unsigned int n = gmm::mat_ncols( _A );
......@@ -424,7 +427,7 @@ void eliminate_var( const unsigned int _j,
CIter it = gmm::vect_const_begin(col);
CIter ite = gmm::vect_const_end(col);
// compute new index
unsigned int i_new = i;
if( i>_j) --i_new;
......@@ -445,7 +448,7 @@ void eliminate_var( const unsigned int _j,
*/
//sw1.start();
typedef typename gmm::linalg_traits<SVT>::const_iterator SIter;
typedef typename linalg_traits<SVT>::const_iterator SIter;
for ( unsigned int i=0; i<m; ++i )
{
......@@ -580,8 +583,8 @@ void eliminate_vars( const std::vector<IntegerT>& _evar,
VectorT& _rhs )
{
std::cerr << __FUNCTION__ << std::endl;
typedef typename gmm::linalg_traits<MatrixT>::const_sub_col_type ColT;
typedef typename gmm::linalg_traits<ColT>::const_iterator CIter;
typedef typename linalg_traits<MatrixT>::const_sub_col_type ColT;
typedef typename linalg_traits<ColT>::const_iterator CIter;
// unsigned int m = gmm::mat_nrows( _A);
unsigned int n = gmm::mat_ncols( _A );
......@@ -746,7 +749,7 @@ void eliminate_vars( const std::vector<IntegerT>& _evar,
template<class IntegerT, class IntegerT2>
void eliminate_vars_idx( const std::vector<IntegerT >& _evar,
std::vector<IntegerT2>& _idx,
IntegerT2 _dummy,
IntegerT2 _dummy,
IntegerT2 _range )
{
// sort input
......@@ -902,8 +905,8 @@ void regularize_hack( MatrixT& _mat, double _v )
template<class MatrixT, class VectorT>
int gauss_seidel_local( MatrixT& _A, VectorT& _x, VectorT& _rhs, std::vector<unsigned int> _idxs, int _max_iter, double _tolerance )
{
typedef typename gmm::linalg_traits<MatrixT>::const_sub_col_type ColT;
typedef typename gmm::linalg_traits<ColT>::const_iterator CIter;
typedef typename linalg_traits<MatrixT>::const_sub_col_type ColT;
typedef typename linalg_traits<ColT>::const_iterator CIter;
double t2 = _tolerance*_tolerance;
......@@ -1009,10 +1012,10 @@ void factored_to_quadratic( MatrixT& _F, MatrixT2& _Q, VectorT& _rhs)
gmm::resize(Q, n - 1, n - 1);
_rhs.resize(n - 1);
PROGRESS_TICK;
gmm::copy(Q, _Q);
gmm::copy(Q, _Q);
}
//-----------------------------------------------------------------------------
......@@ -1021,16 +1024,16 @@ void factored_to_quadratic_rhs_only( MatrixT& _F, VectorT& _rhs)
{
unsigned int m = gmm::mat_nrows(_F);
unsigned int n = gmm::mat_ncols(_F);
gmm::resize(_rhs, n);
// compute quadratic matrix
MatrixT Q(n,n);
gmm::mult(gmm::transposed(_F),_F,Q);
// extract rhs
gmm::copy( gmm::scaled(gmm::mat_const_row( Q, n - 1),-1.0), _rhs);
_rhs.resize( n - 1);
}
......@@ -1043,7 +1046,7 @@ template<class MatrixT>
void inspect_matrix( const MatrixT& _A)
{
typedef typename MatrixT::value_type VType;
int m = gmm::mat_nrows(_A);
int n = gmm::mat_ncols(_A);
......@@ -1079,12 +1082,12 @@ void inspect_matrix( const MatrixT& _A)
int n_nan = 0;
int n_inf = 0;
// inspect elements
for(int i=0; i<n; ++i)
{
typedef typename gmm::linalg_traits< gmm::col_matrix< gmm::wsvector<VType> > >::const_sub_col_type ColT;
typedef typename gmm::linalg_traits<ColT>::const_iterator CIter;
typedef typename linalg_traits< gmm::col_matrix< gmm::wsvector<VType> > >::const_sub_col_type ColT;
typedef typename linalg_traits<ColT>::const_iterator CIter;
ColT col = mat_const_col( Acol, i );
CIter it = gmm::vect_const_begin( col );
......
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