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]

Re: Complex matrices



----- Original Message -----
From: "Dr. David Kirkby" <drkirkby@ntlworld.com>
To: "gsl discussion list" <gsl-discuss@sources.redhat.com>
Sent: Wednesday, March 06, 2002 1:08 AM
Subject: Complex matrices


> Hi,
> I'm trying to solve an equation of the form:
> [V]=[I].[Z], where V is a vector that is known, Z is square matrix that is
known
> and I is unknown. V, I and Z are all complex.
>
> I can't seem to find any routines in gsl for complex matrices - plenty for
> complex numbers and plenty for matrices. Am I missing something?? It seems
like
> quite a standard thing.
>
> My square matrix Z is symmetrical (i.e. Zxy=Zyx). Can I use this to my
> advantage? The matrix is not sparse.
> --
> Dr. David Kirkby PhD,
> email: drkirkby@ntlworld.com
> web page: http://www.david-kirkby.co.uk/
> Amateur radio callsign: G8WRB
>

Try this

Ax=b

//allocate memory for matrix

gsl_matrix_complex* A_matrix = gsl_matrix_complex_alloc(size,size);

gsl_vector_complex* B_vector = gsl_vector_complex_alloc(size);

gsl_vector_complex* X_vector = gsl_vector_complex_alloc(size);



//initilaze matrix A

gsl_matrix_complex_set(A_matrix,0,0 .............................



//solve system the LU methods

int s;

gsl_permutation * p = gsl_permutation_alloc (size);

gsl_linalg_complex_LU_decomp (A_matrix, p, &s);

gsl_linalg_complex_LU_solve (A_matrix, p, B_vector, X_vector);

//free memory after solve system

gsl_permutation_free(p);




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