thanks. i would think too that subrange as a copy is less efficient.

On 8/7/07, e r <erwann.rogard@gmail.com > wrote:
hi,

it appears that subrange of a const vector& will achieve read--only

subrange(copy, 0,1);//where copy is a const vector&

however, i am unable to assign it i.e. it is a temporary object so that
in comparing

1. call subrange(copy,0,1) N times
VS.
2. a) create vr1(orig,range(0,1)) and b) call vr1 N times //where orig
is -unfortunately- not a const

i would think that 1. allocates some memory each time it is called
whereas 2. does not, hence is 1. slower. correct?

e r wrote:
> hi all,
>
> i'm wondering how/if i can create vector proxies of a const vector e.g.
>
> typedef boost::numeric::ublas::vector<double> vector_double;
> typedef boost::numeric::ublas::range range;
> typedef boost::numeric::ublas::vector_range<vector_double > vector_range;
>
> vector_double orig(6);
> const vector_double& copy = orig;
> vector_range vr1(orig,range(0,1));
> vector_range vr2(copy,range(0,1));//error: no matching function
>
>
> thanks much!
>
> e.
>

_______________________________________________
ublas mailing list
ublas@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/ublas