help-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-gsl] How to use std complex vectors and gsl matrix complex in one


From: Madan Pande
Subject: [Help-gsl] How to use std complex vectors and gsl matrix complex in one code
Date: Wed, 28 Aug 2019 08:41:20 +0530

Hi,
        I am working on a code which already uses std::<vector> complex in
2D and 3D forms.
I am working on adding more functionalities to this code, but using
gsl_matrix_complex or gsl_vector_complex. I believe this would make life
easier for researchers in application development.
2.  I am using C++-11 on ubuntu 18.04.2, along with gsl_lib 2.6 (laos
gslcblas). I must confess that I have only used gsl lib for over 2 months,
so I still a maverick in gsl.
3. I wish to know if there is a simpler way to transfer data of each
element of a gsl_matrix_complex to std::<vector>complex (2D or 3D) ...The
pseudo code could be:

typedef std::vector< std::complex<double> > complexVector_t;
typedef std::vector<complexVector_t> complex2DVector_t;

complex2Dvector_t A;
gsl_vector_complex B;
gsl_matrix_complex C; // this would use blas for matrix vector or matrix
matrix ops

 size_t i,j;
for ( i=0; i < maxi; i++)
     {
      for ( j=0; j < maxjj; j++)
          {
              A[i][j] = B[i][j]; //would be found Invalid
              // if one goes by real and imag parts, one could have either
a long code
              // or l-value required error
          }
      }

Can anyone suggest a simple solution please...

With Thanks in Advance,

Warm Regards,
madan


reply via email to

[Prev in Thread] Current Thread [Next in Thread]