Initializing vector elements - GNU Scientific Library -- Reference Manual
Description: GNU Scientific Library -- Reference Manual

Next: Reading and writing vectors, Previous: Accessing vector elements, Up: Vectors

#### 8.3.3 Initializing vector elements

— Function: void gsl_vector_set_all (gsl_vector * v, double x)

> This function sets all the elements of the vector v to the value x.

— Function: void gsl_vector_set_zero (gsl_vector * v)

> This function sets all the elements of the vector v to zero.

— Function: int gsl_vector_set_basis (gsl_vector * v, size_t i)

> This function makes a basis vector by setting all the elements of the vector v to zero except for the i-th element which is set to one.

The GNU Scientific Library - a free numerical library licensed under the GNU GPL
Back to the GNU Scientific Library Homepage