This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

initializing diagonal matrix with some vector


David Necas wrote:

> I often need to initialize a diagonal matrix from a vector.
> I think that a function for such an initialization
> could be generally useful.

I believe that the GSL includes a function

gsl_vector_view gsl_matrix_diagonal(gsl_matrix* m);

which you can use to obtain a reference
to the diagonal elements of a matrix.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]