gslcpp
Modern-C++ Wrapper for GSL
|
Go to the documentation of this file.
7 #include <gsl/gsl_complex.h>
18 template<
typename A>
struct complex;
22 template<>
struct complex<
double>:
public std::complex<
double> {
23 using P= std::complex<
double>;
28 complex(gsl_complex
const &z): P(GSL_REAL(z), GSL_IMAG(z)) {}
36 operator gsl_complex &() {
return *(gsl_complex *)
this; }
40 operator gsl_complex
const &()
const {
return *(gsl_complex
const *)
this; }
45 template<>
struct complex<
float>:
public std::complex<
float> {
46 using P= std::complex<
float>;
51 complex(gsl_complex_float
const &z): P(GSL_REAL(z), GSL_IMAG(z)) {}
59 operator gsl_complex_float &() {
return *(gsl_complex_float *)
this; }
64 return *(gsl_complex_float
const *)
this;
70 template<>
struct complex<
long double>:
public std::complex<
long double> {
71 using P= std::complex<
long double>;
76 complex(gsl_complex_long_double
const &z): P(GSL_REAL(z), GSL_IMAG(z)) {}
85 return *(gsl_complex_long_double *)
this;
90 operator gsl_complex_long_double
const &()
const {
91 return *(gsl_complex_long_double
const *)
this;
operator gsl_complex_float const &() const
Convert to gsl_complex.
operator gsl_complex_long_double &()
Convert to gsl_complex.
complex(P const &z)
Construct from instance of parent's type.
complex(gsl_complex_float const &z)
Construct from gsl_complex.
operator gsl_complex_long_double const &() const
Convert to gsl_complex.
operator gsl_complex &()
Convert to gsl_complex.
complex(gsl_complex_long_double const &z)
Construct from gsl_complex.
complex(P const &z)
Construct from instance of parent's type.
complex(P const &z)
Construct from instance of parent's type.
operator gsl_complex_float &()
Convert to gsl_complex.
complex(gsl_complex const &z)
Construct from gsl_complex.
Namespace for C++-interface to GSL.
operator gsl_complex const &() const
Convert to gsl_complex.