Boost logo

Boost :

From: Kresimir Fresl (fresl_at_[hidden])
Date: 2002-01-20 11:54:53


jhrwalter wrote:

> Kresimir Fresl <fresl_at_g...> wrote:

>>>> Why ublas uses `non-standard' names `reference_type', [...]
>>>> instead of almost standard `reference', [...] ?

>>> To differentiate types and variables ;-) It's time to change them
>>> to standard conforming names.

>> I can try,

> This would be very helpful [...]

> The major change as far as I see is replacing (const_)
> reference_type with (const_)reference and (const_)pointer_type with
> (const_)pointer. This should work with simple 'search and replace'.

Done. Changed files are in the attached zip file (ublas.zip).

I partially tested them: I tried to compile test1.
I used g++ version 3.0.3 with -DUSE_GCC.

I think that the problems that I encountered are not caused by
type name changes, because they also apear with your original
files. (Looking back, I think that I never before tried to compile all
tests ;O)

With test11.cpp there were no problems.

Both in test12.cpp and in test13.cpp, when USE_BOUNDED_ARRAY
and USE_VECTOR_OF_VECTOR are defined, `bad_alloc' exception
is thrown.

Combination USE_MATRIX and USE_STD_VECTOR can not be
compiled. I attached compete error message for `float'
(file std_vec_error); for `double' and `complex<>' error messages
are similar. In short, problem is conversion from `const float* const' to
`float*' in g++'s header stl_iterator.h, which is triggered from
`matrix<>::iterator1.

Other combinations of #defines in test12 and test13 can be compiled
and executed.

Sincerely,

fres

PS. I will not be in Zagreb for next few days, but when I return, I
will try other tests.


/usr/include/g++-v3/bits/stl_iterator.h: In constructor
   `std::__normal_iterator<_Iterator, _Container>::__normal_iterator(const
   std::__normal_iterator<_Iter, _Container>&) [with _Iter = const float*,
   _Iterator = float*, _Container = std::vector<float, std::allocator<float>
>]':
/home/krcko/include/boost/numeric/ublas/matrix.h:1497: instantiated from `size_t numerics::matrix<T, F, A>::iterator1::index1() const [with T = float, F = numerics::row_major<numerics::forward, numerics::forward>, A = std::vector<float, std::allocator<float> >]'
/home/krcko/include/boost/numeric/ublas/matrix.h:1477: instantiated from `numerics::matrix<T, F, A>::iterator2 numerics::matrix<T, F, A>::iterator1::begin() const [with T = float, F = numerics::row_major<numerics::forward, numerics::forward>, A = std::vector<float, std::allocator<float> >]'
/home/krcko/include/boost/numeric/ublas/matrix.h:539: instantiated from `void numerics::matrix_assign<F>::iterating_assign(M&, const numerics::matrix_expression<E2>&) [with M = numerics::matrix<float, numerics::row_major<numerics::forward, numerics::forward>, std::vector<float, std::allocator<float> > >, E = numerics::vector_matrix_binary<const numerics::vector_const_reference<const numerics::vector<float, numerics::forward, std::vector<float, std::allocator<float> > > >, const numerics::vector_const_reference<const numerics::vector<float, numerics::forward, std::vector<float, std::allocator<float> > > >, numerics::scalar_multiplies<float, float> >, F = numerics::scalar_assign<float, float>]'
/home/krcko/include/boost/numeric/ublas/matrix.h:572: instantiated from `void numerics::matrix_assign<F>::operator()(M&, const numerics::matrix_expression<E2>&, numerics::dense_tag) [with M = numerics::matrix<float, numerics::row_major<numerics::forward, numerics::forward>, std::vector<float, std::allocator<float> > >, E = numerics::vector_matrix_binary<const numerics::vector_const_reference<const numerics::vector<float, numerics::forward, std::vector<float, std::allocator<float> > > >, const numerics::vector_const_reference<const numerics::vector<float, numerics::forward, std::vector<float, std::allocator<float> > > >, numerics::scalar_multiplies<float, float> >, F = numerics::scalar_assign<float, float>]'
/home/krcko/include/boost/numeric/ublas/matrix.h:870: instantiated from `void numerics::matrix_assign<F>::operator()(M&, const numerics::matrix_expression<E2>&) [with M = numerics::matrix<float, numerics::row_major<numerics::forward, numerics::forward>, std::vector<float, std::allocator<float> > >, E = numerics::vector_matrix_binary<const numerics::vector_const_reference<const numerics::vector<float, numerics::forward, std::vector<float, std::allocator<float> > > >, const numerics::vector_const_reference<const numerics::vector<float, numerics::forward, std::vector<float, std::allocator<float> > > >, numerics::scalar_multiplies<float, float> >, F = numerics::scalar_assign<float, float>]'
/home/krcko/include/boost/numeric/ublas/matrix.h:1065: instantiated from `numerics::matrix<T, F, A>::matrix(const numerics::matrix_expression<E1>&) [with AE = numerics::vector_matrix_binary<const numerics::vector_const_reference<const numerics::vector<float, numerics::forward, std::vector<float, std::allocator<float> > > >, const numerics::vector_const_reference<const numerics::vector<float, numerics::forward, std::vector<float, std::allocator<float> > > >, numerics::scalar_multiplies<float, float> >, T = float, F = numerics::row_major<numerics::forward, numerics::forward>, A = std::vector<float, std::allocator<float> >]'
/home/krcko/include/boost/numeric/ublas/matrix.h:1158: instantiated from `numerics::matrix<T, F, A>& numerics::matrix<T, F, A>::operator=(const numerics::matrix_expression<E1>&) [with AE = numerics::vector_matrix_binary<const numerics::vector_const_reference<const numerics::vector<float, numerics::forward, std::vector<float, std::allocator<float> > > >, const numerics::vector_const_reference<const numerics::vector<float, numerics::forward, std::vector<float, std::allocator<float> > > >, numerics::scalar_multiplies<float, float> >, T = float, F = numerics::row_major<numerics::forward, numerics::forward>, A = std::vector<float, std::allocator<float> >]'
test12.cpp:47: instantiated from `void test_my_matrix_vector<V, M, N>::operator()(VP&, VP&, MP&) const [with VP = numerics::vector<float, numerics::forward, std::vector<float, std::allocator<float> > >, MP = numerics::matrix<float, numerics::row_major<numerics::forward, numerics::forward>, std::vector<float, std::allocator<float> > >, V = numerics::vector<float, numerics::forward, std::vector<float, std::allocator<float> > >, M = numerics::matrix<float, numerics::row_major<numerics::forward, numerics::forward>, std::vector<float, std::allocator<float> > >, int N = 3]'
test12.cpp:70: instantiated from `void test_my_matrix_vector<V, M, N>::operator()() const [with V = numerics::vector<float, numerics::forward, std::vector<float, std::allocator<float> > >, M = numerics::matrix<float, numerics::row_major<numerics::forward, numerics::forward>, std::vector<float, std::allocator<float> > >, int N = 3]'
test12.cpp:139: instantiated from here
/usr/include/g++-v3/bits/stl_iterator.h:474: cannot convert `const float*
   const' to `float*' in initialization



Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk