Boost logo

Ublas :

From: Nico Galoppo (nico_at_[hidden])
Date: 2006-10-13 00:14:50


Hi all,

I got storage_adaptors.hpp, which I think is a great idea for read-only adapters
to in-memory data. Unfortunately, I can't get it to work with axpy_prod (even
though it works with prod):

// this fails
axpy_prod(A, ublas::make_vector_from_pointer(n, reinterpret_cast<real_type const
*>(&core_v_minus[0])), b_lambda, false);

// this works
//b_lambda = prod(actor.Jc, v_t(n, a_t(n, reinterpret_cast<real_type const
*>(&core_v_minus[0]))));

Here's the compiler output, where I think that the first few lines are
essential, caused in vector_norm_1::apply(). If requested, I'll send the rest of
the compiler error output too, but I don't want to spam the list.

Thanks,

--nico

====================================================================================

1>d:\dev\boost\boost\numeric\ublas\functional.hpp(405) : error C3892: 't' : you
cannot assign to a variable that is const
1> d:\dev\boost\boost\numeric\ublas\vector_expression.hpp(1460) : see
reference to function template instantiation 'const double
boost::numeric::ublas::vector_norm_1<T>::apply<boost::numeric::ublas::vector_reference<E>>(const
boost::numeric::ublas::vector_expression<boost::numeric::ublas::vector_reference<E>>
&)' being compiled
1> with
1> [
1> T=const double,
1> E=const boost::numeric::ublas::vector<const double,a_t>
1> ]
1> d:\dev\boost\boost\numeric\ublas\vector_expression.hpp(1458) : while
compiling class template member function 'const double
boost::numeric::ublas::vector_scalar_unary<E,F>::evaluate(boost::numeric::ublas::dense_random_access_iterator_tag)
const'
1> with
1> [
1> E=boost::numeric::ublas::vector<const double,a_t>,
1> F=boost::numeric::ublas::vector_norm_1<const double>
1> ]
1> d:\dev\boost\boost\numeric\ublas\vector_expression.hpp(1517) : see
reference to class template instantiation
'boost::numeric::ublas::vector_scalar_unary<E,F>' being compiled
1> with
1> [
1> E=boost::numeric::ublas::vector<const double,a_t>,
1> F=boost::numeric::ublas::vector_norm_1<const double>
1> ]
1> d:\dev\boost\boost\numeric\ublas\operation.hpp(84) : see reference to
function template instantiation 'const double
boost::numeric::ublas::norm_1<C>(const
boost::numeric::ublas::vector_expression<E> &)' being compiled
1> with
1> [
1> C=boost::numeric::ublas::vector<const double,a_t>,
1> E=boost::numeric::ublas::vector<const double,a_t>
1> ]
1> d:\dev\hybrid\hybrid\articulated\character_constraint_solver.h(133) :
see reference to function template instantiation 'V
&boost::numeric::ublas::axpy_prod<boost::numeric::ublas::vector<T>,double,boost::numeric::ublas::row_major,boost::numeric::ublas::unbounded_array<size_t>,boost::numeric::ublas::unbounded_array<T>,C>(const
boost::numeric::ublas::compressed_matrix<T> &,const
boost::numeric::ublas::vector_expression<E> &,V &,bool)' being compiled
1> with
1> [
1> V=boost::numeric::ublas::vector<double>,
1> T=double,
1> C=boost::numeric::ublas::vector<const double,a_t>,
1> E=boost::numeric::ublas::vector<const double,a_t>
1> ]

-- 
nico galoppo von borries     |  address: 119 fidelity st., carrboro
comp. graphics phd. student  |           north carolina, 27510 USA
UNC, chapel hill             |  phone: +1 (919) 962-1898 (office)
                              |         +1 (919) 942-4388 (home)
                              |  email: nico at cs dot unc dot edu
                              |  homepage: http://www.ngaloppo.org