vector_view vector::create_vector_view ( const gsl_vector_view &  other ) [static]

Function to create a vector view.

In addition to creating vectors from slices of blocks it is also possible to slice vectors and create vector views. For example, a subvector of another vector can be described with a view, or two views can be made which provide access to the even and odd elements of a vector. A vector view is a temporary object, stored on the stack, which can be used to operate on a subset of vector elements. Vector views can be defined for both constant and non-constant vectors, using separate types that preserve constness. A vector view has the type gsl_vector_view and a constant vector view has the type gsl_vector_const_view. In both cases the elements of the view can be accessed as a gsl_vector using the vector component of the view object. A pointer to a vector of type gsl_vector (or const gsl_vector) can be obtained by taking the address of this component with the & operator. The new vector is only a view of the block underlying the original vector, v. The block containing the elements of v is not owned by the new vector. When the new vector goes out of scope the original vector v and its block will continue to exist. The original memory can only be deallocated by freeing the original vector. Of course, the original vector should not be deallocated while the new vector is still in use. These functions return a vector view of a subvector of another vector v. vector.

 All Classes Files Functions Variables Typedefs Friends Defines