public inbox for gsl-discuss@sourceware.org
 help / color / mirror / Atom feed
* Complex matrices
@ 2002-12-31  9:55 Dr. David Kirkby
  2002-03-05 14:08 ` Dr. David Kirkby
  2002-12-31  9:55 ` Eugene Eremin
  0 siblings, 2 replies; 6+ messages in thread
From: Dr. David Kirkby @ 2002-12-31  9:55 UTC (permalink / raw)
  To: gsl discussion list

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

^ permalink raw reply	[flat|nested] 6+ messages in thread
* complex matrices
@ 2003-05-27  8:53 Travis R Miller
  2003-05-28 15:06 ` Brian Gough
  0 siblings, 1 reply; 6+ messages in thread
From: Travis R Miller @ 2003-05-27  8:53 UTC (permalink / raw)
  To: gsl-discuss

Your manual covers none of the functions usable for complex matrices. 
Either how one sets their values or performs various operations on
them.  There is a hint of a function for performing LU decomposition on
such a matrix in the linear algebra chapter, but there is nothing more. 
Some help would be great.  Here is a bit of code that returns a
segmentation fault.  Perhaps you can explain what is wrong

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<gsl/gsl_rng.h>
#include<gsl/gsl_matrix_complex_double.h>

int main(void)
{
  const gsl_rng_type *T;
  gsl_rng *r;
  gsl_matrix_complex *m;
  gsl_complex x;
  int i, j;
  double u;

  gsl_matrix_complex_alloc(4,4);

  gsl_rng_env_setup();
  T = gsl_rng_default;
  r = gsl_rng_alloc(T);

  for(i=0; i<4; i++) {
    for(j=0; j<4; j++) {
      u = gsl_rng_uniform(r);
      printf("%.5f\n", u);
      x.dat[0] = u;
      u = gsl_rng_uniform(r);
      printf("%.5f\n", u);
      x.dat[1] = u;
      gsl_matrix_complex_set(m, i, j, x);
    }
  }

  gsl_rng_free(r);

  return 1;
}



Thank you for your time,
Travis

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-05-28 15:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-31  9:55 Complex matrices Dr. David Kirkby
2002-03-05 14:08 ` Dr. David Kirkby
2002-12-31  9:55 ` Eugene Eremin
2002-03-06  0:39   ` Eugene Eremin
2003-05-27  8:53 complex matrices Travis R Miller
2003-05-28 15:06 ` Brian Gough

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).