Для общей информации я использую boost 1.46. С момента появления этой версии в ublas lib не было никаких изменений.
Я использую gcc
версию 4.6 для компиляции.
Так что теперь моя проблема. У меня есть очень простой класс, который должен соответствовать классу буст-матрицы для самоопределяемого интерфейса. Класс выглядит так:
template< typename TYPE >
class BoostCoordinateMatrix: public MatrixInterface<TYPE> ,
public boost::numeric::ublas::coordinate_matrix<TYPE> {
public:
BoostCoordinateMatrix() :
boost::numeric::ublas::coordinate_matrix<TYPE>() {
}
BoostCoordinateMatrix(int rows, int columns) :
boost::numeric::ublas::coordinate_matrix<TYPE>(rows, columns) {
}
int rows() const {
return this->size1();
}
int columns() const {
return this->size2();
}
virtual void set(int row, int column, TYPE value) {
(*this)(row, column) = value;
}
TYPE& operator()(int i, int j) {
return this->boost::numeric::ublas::coordinate_matrix<TYPE>::operator()(
i, j).ref();
}
TYPE operator()(int i, int j) const {
return this->boost::numeric::ublas::coordinate_matrix<TYPE>::operator()(
i, j);
}
};
При компиляции этого класса я получаю ошибку компилятора для обоих операторов (int i, int j):
. / Inc / boost_coordinate_matrix.h: 38: 15: создается из «TYPE BoostCoordinateMatrix :: operator () (int, int) const [with TYPE = double]»
./inc/flow_field_matrix_free_interface_impl.h:697:1: создан здесь
/usr/include/c++/4.6/bits/stl_tempbuf.h:257:6: ошибка: неверная инициализация неконстантной ссылки типа 'boost :: numeric :: ublas :: index_triple, boost :: numeric :: ublas: : unbounded_array, boost :: numeric :: ublas :: unbounded_array>>> & 'из значения типа' boost :: numeric :: ublas :: indexed_iterator, boost :: numeric :: ublas :: unbounded_array, boost :: numeric :: ublas :: unbounded_array>>, std :: random_access_iterator_tag> :: reference {он же boost :: numeric :: ublas :: index_triple, boost :: numeric :: ublas :: unbounded_array, boost :: numeric :: ublas :: unbounded_array>>>} '
/usr/include/c++/4.6/bits/stl_tempbuf.h:232:5: ошибка: при передаче аргумента 3 'void std :: __ uninitialized_construct_buf (_ForwardIterator, _ForwardIterator, _Tp &) [with _ForwardIterator = boost :: numeric :: ublas :: index_triple, boost :: numeric :: ublas :: unbounded_array, boost :: numeric :: ublas :: unbounded_array>>> *, _Tp = boost :: numeric :: ublas :: index_triple, boost :: numeric :: ublas :: unbounded_array, boost :: numeric :: ublas :: unbounded_array>>>] '
Надеюсь, кто-нибудь может мне помочь.