Message: 1
Date: Mon, 20 May 2013 17:49:30 +0100 (BST)
From: gsermaid <
linuxfever@yahoo.gr>
To: "
ublas@lists.boost.org"
<
ublas@lists.boost.org>
Subject: [ublas] Support for more general ranges
Message-ID:
??? <
1369068570.74879.YahooMailNeo@web172106.mail.ir2.yahoo.com>
Content-Type: text/plain; charset="iso-8859-1"
Hi all,
I would like to ask if there is any way to create a vector
proxy based on a general range of indices. For example, if
I have
a vector
vector<unsigned> x(4);
x <<= 1,2,3,4;
and a vector of indices?
vector<size_t> k(2);
k <<= 0,3;
I would like to be able to create a vector proxy as
follows
vector_proxy<unsigned> mysubvector(x, k);
with the property that
mysubvector[i] = x[k[i]].
I know I can create a simple new class which provides this
functionality but ideally I also want to have
all the useful iterator functionality and mathematical
operations supported by a typical ublas vector. Is this
currently supported? If not, is there an easy way to?
implement it and have all the functionality that ublas
offer? Finally, do you think something like this could be
included in future versions?
Regards,
Giorgos
-------------- next part --------------
HTML attachment scrubbed and removed
------------------------------
Message: 2
Date: 20 May 2013 18:51:54 +0200
From: "oswin krause" <
oswin.krause@ruhr-uni-bochum.de>
To:
ublas@lists.boost.org
Subject: Re: [ublas] Support for more general ranges
Message-ID: <
519A54AA.9020907@ruhr-uni-bochum.de>
Content-Type: text/plain; charset="iso-8859-1";
Format="flowed"
Hi,
take a look at vector_indirect.
On 20.05.2013 18:49, gsermaid wrote:
> Hi all,
>
> I would like to ask if there is any way to create a
vector proxy based
> on a general range of indices. For example, if I have
> a vector
>
> vector<unsigned> x(4);
> x <<= 1,2,3,4;
>
> and a vector of indices
>
> vector<size_t> k(2);
> k <<= 0,3;
>
> I would like to be able to create a vector proxy as
follows
>
> vector_proxy<unsigned> mysubvector(x, k);
>
> with the property that
>
> mysubvector[i] = x[k[i]].
>
> I know I can create a simple new class which provides
this
> functionality but ideally I also want to have
> all the useful iterator functionality and
mathematical operations
> supported by a typical ublas vector. Is this
currently supported? If
> not, is there an easy way to
> implement it and have all the functionality that
ublas offer? Finally,
> do you think something like this could be included in
future versions?
>
> Regards,
> Giorgos
>
>
> _______________________________________________
> ublas mailing list
>
ublas@lists.boost.org
>
http://lists.boost.org/mailman/listinfo.cgi/ublas
> Sent to:
Oswin.Krause@ruhr-uni-bochum.de
-------------- next part --------------
HTML attachment scrubbed and removed
------------------------------
Subject: Digest Footer
_______________________________________________
ublas mailing list
ublas@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/ublas
------------------------------
End of ublas Digest, Vol 102, Issue 11
**************************************
-------------- next part --------------
HTML attachment scrubbed and removed
------------------------------
Subject: Digest Footer
_______________________________________________
ublas mailing list
ublas@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/ublas
------------------------------
End of ublas Digest, Vol 102, Issue 12
**************************************