This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
initializing diagonal matrix with some vector
- From: Edwin Robert Tisdale <E dot Robert dot Tisdale at jpl dot nasa dot gov>
- To: gsl-discuss at sources dot redhat dot com
- Date: Wed, 01 May 2002 20:27:05 -0400
- Subject: initializing diagonal matrix with some vector
- Organization: Jet Propulsion Laboratory
- Reply-to: E dot Robert dot Tisdale at jpl dot nasa dot gov
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.