Commit e8380725 authored by Heng Liu's avatar Heng Liu

fix compile error with GMM-5.3

parent 3c6c3bef
Pipeline #12220 failed with stages
in 7 minutes and 30 seconds
......@@ -49,11 +49,6 @@ namespace COMISO {
//== 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>;
template<class RMatrixT, class CMatrixT, class VectorT, class VectorIT >
void
ConstrainedSolver::solve_const(const RMatrixT& _constraints,
......@@ -296,10 +291,10 @@ ConstrainedSolver::resolve(
gmm::size_type m = gmm::mat_nrows(_B);
gmm::size_type n = gmm::mat_ncols(_B);
typedef typename linalg_traits<RMatrixT>::const_sub_row_type CRowT;
typedef typename linalg_traits<RMatrixT>::sub_row_type RowT;
typedef typename linalg_traits<CRowT>::const_iterator RIter;
typedef typename linalg_traits<CRowT>::value_type VecValT;
typedef typename COMISO_GMM::linalg_traits<RMatrixT>::const_sub_row_type CRowT;
typedef typename COMISO_GMM::linalg_traits<RMatrixT>::sub_row_type RowT;
typedef typename COMISO_GMM::linalg_traits<CRowT>::const_iterator RIter;
typedef typename COMISO_GMM::linalg_traits<CRowT>::value_type VecValT;
gmm::resize(rhs, n - 1);
gmm::clear(rhs);
......@@ -441,9 +436,9 @@ ConstrainedSolver::make_constraints_independent(
// if not found for integers with value +-1
// and finally take the smallest integer variable
typedef typename linalg_traits<RMatrixT>::const_sub_row_type CRowT;
typedef typename linalg_traits<RMatrixT>::sub_row_type RowT;
typedef typename linalg_traits<CRowT>::const_iterator RIter;
typedef typename COMISO_GMM::linalg_traits<RMatrixT>::const_sub_row_type CRowT;
typedef typename COMISO_GMM::linalg_traits<RMatrixT>::sub_row_type RowT;
typedef typename COMISO_GMM::linalg_traits<CRowT>::const_iterator RIter;
// get current condition row
CRowT row = gmm::mat_const_row(_constraints, i);
......@@ -551,8 +546,8 @@ ConstrainedSolver::make_constraints_independent(
CVector col = constraints_c.col(elim_j);
// iterate over column
typename linalg_traits<CVector>::const_iterator c_it = gmm::vect_const_begin(col);
typename linalg_traits<CVector>::const_iterator c_end = gmm::vect_const_end(col);
typename COMISO_GMM::linalg_traits<CVector>::const_iterator c_it = gmm::vect_const_begin(col);
typename COMISO_GMM::linalg_traits<CVector>::const_iterator c_end = gmm::vect_const_end(col);
for (; c_it != c_end; ++c_it)
{
......@@ -655,9 +650,9 @@ ConstrainedSolver::make_constraints_independent_reordering(
// if not found for integers with value +-1
// and finally take the smallest integer variable
typedef typename linalg_traits<RMatrixT>::const_sub_row_type CRowT;
typedef typename linalg_traits<RMatrixT>::sub_row_type RowT;
typedef typename linalg_traits<CRowT>::const_iterator RIter;
typedef typename COMISO_GMM::linalg_traits<RMatrixT>::const_sub_row_type CRowT;
typedef typename COMISO_GMM::linalg_traits<RMatrixT>::sub_row_type RowT;
typedef typename COMISO_GMM::linalg_traits<CRowT>::const_iterator RIter;
// get current condition row
CRowT row = gmm::mat_const_row(_constraints, i);
......@@ -764,8 +759,8 @@ ConstrainedSolver::make_constraints_independent_reordering(
CVector col = constraints_c.col(elim_j);
// iterate over column
typename linalg_traits<CVector>::const_iterator c_it = gmm::vect_const_begin(col);
typename linalg_traits<CVector>::const_iterator c_end = gmm::vect_const_end(col);
typename COMISO_GMM::linalg_traits<CVector>::const_iterator c_it = gmm::vect_const_begin(col);
typename COMISO_GMM::linalg_traits<CVector>::const_iterator c_end = gmm::vect_const_end(col);
for (; c_it != c_end; ++c_it)
{
......@@ -852,8 +847,8 @@ ConstrainedSolver::update_constraint_gcd(RMatrixT& _constraints,
return false;
// divide by gcd
typedef typename linalg_traits<RMatrixT>::const_sub_row_type CRowT;
typedef typename linalg_traits<CRowT>::const_iterator RIter;
typedef typename COMISO_GMM::linalg_traits<RMatrixT>::const_sub_row_type CRowT;
typedef typename COMISO_GMM::linalg_traits<CRowT>::const_iterator RIter;
// get current constraint row
RIter row_it = gmm::vect_const_begin(gmm::mat_const_row(_constraints, _row_i));
......@@ -906,8 +901,8 @@ ConstrainedSolver::eliminate_constraints(
SVector3T col = _Bcol.col(cur_j);
// iterate over column
typename linalg_traits<SVector3T>::const_iterator c_it = gmm::vect_const_begin(col);
typename linalg_traits<SVector3T>::const_iterator c_end = gmm::vect_const_end(col);
typename COMISO_GMM::linalg_traits<SVector3T>::const_iterator c_it = gmm::vect_const_begin(col);
typename COMISO_GMM::linalg_traits<SVector3T>::const_iterator c_end = gmm::vect_const_end(col);
for (; c_it != c_end; ++c_it)
add_row(c_it.index(), -(*c_it) / cur_val, gmm::mat_row(_constraints, i), _Bcol);
......@@ -970,8 +965,8 @@ ConstrainedSolver::eliminate_constraints(
Base::StopWatch sw;
sw.start();
// define iterator on matrix A and on constraints C
typedef typename linalg_traits<SVector2T>::const_iterator AIter;
typedef typename linalg_traits<SVector1T>::const_iterator CIter;
typedef typename COMISO_GMM::linalg_traits<SVector2T>::const_iterator AIter;
typedef typename COMISO_GMM::linalg_traits<SVector1T>::const_iterator CIter;
// store variable indices to be eliminated
std::vector<int> elim_varids;
......@@ -1115,7 +1110,7 @@ ConstrainedSolver::add_row(gmm::size_type _row_i,
RowT _row,
MatrixT& _mat)
{
typedef typename linalg_traits<RowT>::const_iterator RIter;
typedef typename COMISO_GMM::linalg_traits<RowT>::const_iterator RIter;
RIter r_it = gmm::vect_const_begin(_row);
RIter r_end = gmm::vect_const_end(_row);
......@@ -1135,7 +1130,7 @@ ConstrainedSolver::add_row_simultaneously(gmm::size_type _row_i,
RMatrixT& _rmat,
CMatrixT& _cmat)
{
typedef typename linalg_traits<RowT>::const_iterator RIter;
typedef typename COMISO_GMM::linalg_traits<RowT>::const_iterator RIter;
RIter r_it = gmm::vect_const_begin(_row);
RIter r_end = gmm::vect_const_end(_row);
......@@ -1349,8 +1344,8 @@ ConstrainedSolver::verify_constrained_system(
double _eps)
{
DEB_enter_func;
typedef typename linalg_traits<RMatrixT>::const_sub_row_type RowT;
typedef typename linalg_traits<RowT>::const_iterator RIter;
typedef typename COMISO_GMM::linalg_traits<RMatrixT>::const_sub_row_type RowT;
typedef typename COMISO_GMM::linalg_traits<RowT>::const_iterator RIter;
VectorT Ax(_x.size());
gmm::mult(_A, _x, Ax);
......
......@@ -56,6 +56,11 @@ namespace COMISO_GMM
*/
// 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>;
//== FUNCTION DEFINITION ======================================================
/** @name Variable elimination
......
......@@ -50,10 +50,6 @@ 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>;
//-----------------------------------------------------------------------------
......
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