Menu

#5 add slice capability to vectors

open
nobody
5
2007-07-19
2007-07-19
No

I'm running into the following case.

Vector<double,2> a,b;
Vector<double,3> c;

b = a - c;

This won't compile because the sizes are different.

It would be nice if we could do something like:
slice_array<double> subvector& = c[slice(0,2,1)];
b = a - subvector;

Like we can do std::valarray.

That would prevent from creating another object to copy the subset of the vector.

Unless there is a better way?

Thanks,
Alexis

Discussion


Log in to post a comment.