|
Ublas : |
From: Erik.Ramsay_at_[hidden]
Date: 2006-02-16 06:00:38
Thanks for the help...
Yes, I have BOOST_UBLAS_USE_INDEXED_ITERATOR explicitly defined...
-----Original Message-----
From: ublas-bounces_at_[hidden] [mailto:ublas-bounces_at_[hidden]]
On Behalf Of Vardan Akopian
Sent: Wednesday, February 15, 2006 11:02 PM
To: ublas mailing list
Subject: Re: [ublas] Question on the ublas::matrix
Hi Erik,
On 2/15/06, Ramsay, Erik GOSS <Erik.Ramsay_at_[hidden]> wrote:
>
> Hi,
>
> I have the following test function:
>
>
>
> void Test()
>
> {
>
> boost::numeric::ublas::matrix<double> NewJ(32,32);
>
> boost::numeric::ublas::matrix<double>::iterator1
> itrNewJColumn = NewJ.begin1();
>
> itrNewJColumn[2];
>
> }
>
> I would like access different columns of "NewJ" through the use of column
> iterators. However, when I try to compile this code, I get a compile
> error:
>
> include\boost\numeric\ublas\iterator.hpp(1619) : error
> C2679: binary '+' : no operator found which takes a right-hand operand
> of type
> 'boost::numeric::ublas::indexed_iterator1<C,IC>::difference_type'
> (or there is no acceptable conversion)
It's strange that it's using the indexed_iterators as opposed to the normal
iterators. Do you have BOOST_UBLAS_USE_INDEXED_ITERATOR defined explicitly
somewhere (I think it's disabled by default).
The second thing, is that I think there is a bug in iterator.hpp, where the
indexed_iterators are dfined. indexed_iterators are derived from
random_access_iterator_base<IC, I, T, D>, where D is the difference type.
But for some reason indexed_iterators pass a reference type as D. For
example on lines 1553-1560 we have:
template<class C, class IC>
class indexed_iterator1:
public container_reference<C>,
public random_access_iterator_base<IC,
indexed_iterator1<C, IC>,
typename C::value_type,
typename C::reference> {
so here D=C::reference, which in our case would be double& .
Would anyone more familiar with (indexed) iterators check this?
-Vardan
>
> What am I doing wrong or what am I missing.
>
> I'm compiling with the VC7 compiler. I'm using version 1.32 of Boost.
>
> Thanks for any help.
>
>
> _______________________________________________
> ublas mailing list
> ublas_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/ublas
>
>
>
_______________________________________________
ublas mailing list
ublas_at_[hidden]
http://lists.boost.org/mailman/listinfo.cgi/ublas
****************************************************************************
**************
****************************************************************************
**************
Goss ... Innovation for Business
NOTICE: This e-mail and any attachment(s) may contain confidential and
proprietary information of Goss International Corporation and/or its
subsidiaries and may be legally privileged. This e-mail is intended solely
for the addressee. If you are not the addressee, dissemination, copying or
other use of this e-mail or any of its content is strictly prohibited and
may be unlawful. If you are not the intended recipient please inform the
sender immediately and destroy the e-mail and any copies. All liability for
viruses is excluded to the fullest extent permitted by law. Any views
expressed in this message are those of the individual sender. No contract
may be construed by this e-mail.