Next: Copying matrices, Previous: Matrix views, Up: Matrices [Index]
In general there are two ways to access an object, by reference or by copying. The functions described in this section create vector views which allow access to a row or column of a matrix by reference. Modifying elements of the view is equivalent to modifying the matrix, since both the vector view and the matrix point to the same memory block.
These functions return a vector view of the i-th row of the matrix
m. The data
pointer of the new vector is set to null if
i is out of range.
The function gsl_vector_const_row
is equivalent to
gsl_matrix_row
but can be used for matrices which are declared
const
.
These functions return a vector view of the j-th column of the
matrix m. The data
pointer of the new vector is set to
null if j is out of range.
The function gsl_vector_const_column
is equivalent to
gsl_matrix_column
but can be used for matrices which are declared
const
.
These functions return a vector view of the i-th row of the matrix
m beginning at offset elements past the first column and
containing n elements. The data
pointer of the new vector
is set to null if i, offset, or n are out of range.
The function gsl_vector_const_subrow
is equivalent to
gsl_matrix_subrow
but can be used for matrices which are declared
const
.
These functions return a vector view of the j-th column of the matrix
m beginning at offset elements past the first row and
containing n elements. The data
pointer of the new vector
is set to null if j, offset, or n are out of range.
The function gsl_vector_const_subcolumn
is equivalent to
gsl_matrix_subcolumn
but can be used for matrices which are declared
const
.
These functions return a vector view of the diagonal of the matrix m. The matrix m is not required to be square. For a rectangular matrix the length of the diagonal is the same as the smaller dimension of the matrix.
The function gsl_matrix_const_diagonal
is equivalent to
gsl_matrix_diagonal
but can be used for matrices which are
declared const
.
These functions return a vector view of the k-th subdiagonal of the matrix m. The matrix m is not required to be square. The diagonal of the matrix corresponds to k = 0.
The function gsl_matrix_const_subdiagonal
is equivalent to
gsl_matrix_subdiagonal
but can be used for matrices which are
declared const
.
These functions return a vector view of the k-th superdiagonal of the matrix m. The matrix m is not required to be square. The diagonal of the matrix corresponds to k = 0.
The function gsl_matrix_const_superdiagonal
is equivalent to
gsl_matrix_superdiagonal
but can be used for matrices which are
declared const
.
Next: Copying matrices, Previous: Matrix views, Up: Matrices [Index]