From: Gross, S. <SG...@sj...> - 2007-06-19 21:36:21
|
Is there a way to create a 2d-view of a 1d array? Let's say you've got a 1d array (a vector) with values {1, 2, 3, 4, 5}. =20 Now you want to express it as a 1-by-5 matrix of values [ 1 2 3 4 5 ]. =20 You can copy it easily enough: =20 =3D=3D=3D=3D=3D blitz::Array<double, 1> f(5); f =3D 1, 2, 3, 4, 5; blitz::Array<double, 2> m(1, 5); m(1, blitz::Range::all()) =3D f; =3D=3D=3D=3D=3D =20 But I want to create a *view* of the underlying 1d array. =20 Is there a way to this? =20 Thanks, --Steve |