Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Matrix multiplication in GSL-GNU

Kindly tell me the function of matrix multiplication in GSL library. I have searched a lot but I am not be able to fine it. If any one know about that function kindly answer. Thanks in advance.

like image 848
Siddiqui Avatar asked Jan 07 '10 12:01

Siddiqui


People also ask

How to get the-th element of a matrix in GSL?

More precisely, the element accessed by the function gsl_matrix_get (m,i,j) and gsl_matrix_set (m,i,j,x) is: where tda is the physical row-length of the matrix. This function returns the -th element of a matrix m.

How does the GSL_matrix_alloc () function work?

If the matrix was created using gsl_matrix_alloc () then the block underlying the matrix will also be deallocated. If the matrix has been created from another object then the memory is still owned by that object and will not be deallocated. The functions for accessing the elements of a matrix use the same range checking system as vectors.

What is the difference between GSL_matrix_const_diagonal () and GSL ()?

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.

What is the structure of a GSL_matrix?

The gsl_matrix structure is very simple and looks like this: Matrices are stored in row-major order, meaning that each row of elements forms a contiguous block in memory. This is the standard “C-language ordering” of two-dimensional arrays. Note that Fortran stores arrays in column-major order. The number of rows is size1 .


1 Answers

I think you'll want to use the gemm family of functions, such as gsl_blas_sgemm(). Just set the scalars to one and the added matrix to zero. An example is here.

like image 181
mrkj Avatar answered Sep 18 '22 22:09

mrkj