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

Next: Reading and writing matrices, Previous: Accessing matrix elements, Up: Matrices

#### 8.4.3 Initializing matrix elements

— Function: void gsl_matrix_set_all (gsl_matrix * m, double x)

> This function sets all the elements of the matrix m to the value x.

— Function: void gsl_matrix_set_zero (gsl_matrix * m)

> This function sets all the elements of the matrix m to zero.

— Function: void gsl_matrix_set_identity (gsl_matrix * m)

> This function sets the elements of the matrix m to the corresponding elements of the identity matrix, m(i,j) = \delta(i,j), i.e. a unit diagonal with all off-diagonal elements zero. This applies to both square and rectangular matrices.

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