a Code for the Combination of Indirect and Direct Constraints on High Energy Physics Models Logo
gslpp_matrix_complex.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 HEPfit Collaboration
3  *
4  *
5  * For the licensing terms see doc/COPYING.
6  */
7 
8 #include <math.h>
9 #ifndef __GSL_BLAS_H__
10 #include <gsl/gsl_blas.h>
11 #endif
12 #ifndef __GSL_LINALG_H__
13 #include <gsl/gsl_linalg.h>
14 #endif
15 #ifndef __GSL_EIGEN_H__
16 #include <gsl/gsl_eigen.h>
17 #endif
18 #ifndef GSLPP_MATRIX_COMPLEX_H
19 #include "gslpp_matrix_complex.h"
20 #endif
21 
22 namespace gslpp {
23 
25  matrix<complex>::matrix(const size_t& size_i, const size_t& size_j, const complex& z)
26  {
27  _matrix = gsl_matrix_complex_alloc(size_i, size_j);
28  gsl_matrix_complex_set_all(_matrix, z.as_gsl_type());
29  }
30 
31  matrix<complex>::matrix(const size_t& size_i, const complex& z)
32  {
33  _matrix = gsl_matrix_complex_alloc(size_i, size_i);
34  gsl_matrix_complex_set_all(_matrix, z.as_gsl_type());
35  }
36 
37  matrix<complex>::matrix(const size_t& size_i, const size_t& size_j, const double& a)
38  {
39  complex z(a);
40  _matrix = gsl_matrix_complex_alloc(size_i, size_j);
41  gsl_matrix_complex_set_all(_matrix, z.as_gsl_type());
42  }
43 
44  matrix<complex>::matrix(const size_t& size_i, const double& a)
45  {
46  complex z(a);
47  _matrix = gsl_matrix_complex_alloc(size_i, size_i);
48  gsl_matrix_complex_set_all(_matrix, z.as_gsl_type());
49  }
50 
53  {
54  _matrix = gsl_matrix_complex_alloc(m.size_i(), m.size_j());
55  gsl_matrix_complex_memcpy(_matrix, m.as_gsl_type_ptr());
56  }
57 
59  {
60  size_t i, j, size_i, size_j;
61  size_i = m.size_i();
62  size_j = m.size_j();
63  _matrix = gsl_matrix_complex_alloc(size_i, size_j);
64  for (i = 0; i < size_i; ++i)
65  for (j = 0; j < size_j; ++j)
66  gsl_matrix_complex_set(_matrix, i, j, m(i, j) + 0. * complex::i());
67  }
68 
70  {
71  size_t i, size = v.size();
72  complex z(0, 0, false);
73  _matrix = gsl_matrix_complex_alloc(size, size);
74  gsl_matrix_complex_set_all(_matrix, z.as_gsl_type());
75  for (i = 0; i < size; ++i)
76  gsl_matrix_complex_set(_matrix, i, i, v(i));
77  }
78 
80  {
81  size_t i, size = v.size();
82  complex z(0, 0, false);
83  _matrix = gsl_matrix_complex_alloc(size, size);
84  gsl_matrix_complex_set_all(_matrix, z.as_gsl_type());
85  for (i = 0; i < size; ++i)
86  gsl_matrix_complex_set(_matrix, i, i, v(i) + 0. * complex::i());
87  }
88 
89  matrix<complex>::matrix(const gsl_matrix_complex& m)
90  {
91  _matrix = gsl_matrix_complex_alloc(m.size1, m.size2);
92  gsl_matrix_complex_memcpy(_matrix, &m);
93  }
94 
95  matrix<complex>::matrix(const gsl_matrix_complex* m)
96  {
97  _matrix = gsl_matrix_complex_alloc(m->size1, m->size2);
98  gsl_matrix_complex_memcpy(_matrix, m);
99  }
100 
103  {
104  gsl_matrix_complex_free(_matrix);
105  }
106 
108  const complex matrix<complex>::operator()(const size_t& i, const size_t& j) const
109  {
110  gsl_complex *x = gsl_matrix_complex_ptr(_matrix, i, j);
111  return complex(x);
112  }
113 
115  // complex& matrix<complex>::operator()(const size_t& i, const size_t& j)
116  // {
117  // gsl_complex *x = gsl_matrix_complex_ptr(_matrix, i, j);
118  // return complex(x);
119  // }
120 
123  {
124  gsl_matrix_complex_set_zero(_matrix);
125  }
126 
128  {
129  if (size_i() == m.size_i() && size_j() == m.size_j())
130  gsl_matrix_complex_memcpy(_matrix, m.as_gsl_type_ptr());
131  else
132  {
133  std::cout << "\n ** Wrong size assign in matrix<complex> operator =" << std::endl;
134  exit(EXIT_FAILURE);
135  }
136  return *this;
137  }
138 
140  void matrix<complex>::assign(const size_t& i, const size_t& j, const complex& z)
141  {
142  gsl_complex *x = gsl_matrix_complex_ptr(_matrix, i, j);
143  *x = z.as_gsl_type();
144  }
145 
146  void matrix<complex>::assign(const size_t& i, const size_t& j, const double& a)
147  {
148  gsl_complex *x = gsl_matrix_complex_ptr(_matrix, i, j);
149  *x = complex(a).as_gsl_type();
150  }
151 
152  void matrix<complex>::assignre(const size_t& i, const size_t& j, const double& a)
153  {
154  gsl_complex *x = gsl_matrix_complex_ptr(_matrix, i, j);
155  GSL_SET_REAL(x, a);
156  }
157 
158  void matrix<complex>::assignim(const size_t& i, const size_t& j, const double& a)
159  {
160  gsl_complex *x = gsl_matrix_complex_ptr(_matrix, i, j);
161  GSL_SET_IMAG(x, a);
162  }
163 
165  void matrix<complex>::assign(const size_t& i, const size_t& j, const matrix<complex>& z)
166  {
167  size_t ki, kj;
168  gsl_complex *x;
169  if (i + z.size_i() <= size_i() && j + z.size_j() <= size_j())
170  for (ki = i; ki < i + z.size_i(); ki++)
171  for (kj = j; kj < j + z.size_j(); kj++)
172  {
173  x = gsl_matrix_complex_ptr(_matrix, ki, kj);
174  *x = z(ki - i, kj - j).as_gsl_type();
175  } else
176  {
177  std::cout << "\n ** Wrong size assign in matrix<complex> assign submatrix" << std::endl;
178  exit(EXIT_FAILURE);
179  }
180  }
181 
182  void matrix<complex>::assign(const size_t& i, const size_t& j, const matrix<double>& a)
183  {
184  matrix<complex> z(a);
185  assign(i, j, z);
186  }
187 
189  size_t matrix<complex>::size_i() const
190  {
191  return _matrix->size1;
192  }
193 
194  size_t matrix<complex>::size_j() const
195  {
196  return _matrix->size2;
197  }
198 
199  size_t matrix<complex>::size() const
200  {
201  if (_matrix->size1 == _matrix->size2)
202  return _matrix->size2;
203  else
204  {
205  std::cout << "\n ** Non square matrix" << std::endl;
206  exit(EXIT_FAILURE);
207  }
208  }
209 
212  {
213  return matrix<double>::Id(size) * (1. + 0. * complex::i());
214  }
215 
218  {
219  matrix<complex> m1(size_j(), size_i(), 0.);
220  if (gsl_matrix_complex_transpose_memcpy(m1.as_gsl_type_ptr(), _matrix))
221  {
222  std::cout << "\n ** Error in matrix<complex> transpose" << std::endl;
223  exit(EXIT_FAILURE);
224  }
225  return m1;
226  }
227 
230  {
231  matrix<complex> m1(*this);
232  gsl_complex z1, z2;
233 
234  GSL_SET_COMPLEX(&z1, 1., 0.);
235  GSL_SET_COMPLEX(&z2, 0., 0.);
236 
237  if (gsl_blas_zgemm(CblasConjTrans, CblasNoTrans, z1, _matrix,
238  Id(size_j()).as_gsl_type_ptr(), z2, m1.as_gsl_type_ptr()) != 0)
239  {
240  std::cout << "\n ** Error in matrix<complex> conjugate" << std::endl;
241  exit(EXIT_FAILURE);
242  }
243 
244  return m1;
245  }
246 
249  {
250  matrix<complex> m1(_matrix);
251  matrix<complex> m2(_matrix);
252  int signum;
253  gsl_permutation *p;
254 
255  if (size_j() != size_i())
256  {
257  std::cout << "\n ** Size mismatch in matrix<complex> inverse" << std::endl;
258  exit(EXIT_FAILURE);
259  }
260 
261  if ((p = gsl_permutation_alloc(size_i())) == NULL)
262  {
263  std::cout << "\n ** Error in matrix<complex> inverse" << std::endl;
264  exit(EXIT_FAILURE);
265  }
266 
267  if (gsl_linalg_complex_LU_decomp(m1.as_gsl_type_ptr(), p, &signum))
268  {
269  std::cout << "\n ** Error in matrix<complex> inverse" << std::endl;
270  gsl_permutation_free(p);
271  exit(EXIT_FAILURE);
272  }
273 
274  if (gsl_linalg_complex_LU_invert(m1.as_gsl_type_ptr(), p,
275  m2.as_gsl_type_ptr()))
276  {
277  std::cout << "\n ** Error in matrix<complex> inverse" << std::endl;
278  gsl_permutation_free(p);
279  exit(EXIT_FAILURE);
280  }
281  gsl_permutation_free(p);
282  return m2;
283  }
284 
288  {
289  matrix<complex> m1(_matrix);
290  int signum;
291  gsl_permutation *p;
292 
293  if (size_j() != size_i())
294  {
295  std::cout << "\n ** Size mismatch in bool isSingular" << std::endl;
296  exit(EXIT_FAILURE);
297  }
298 
299  if ((p = gsl_permutation_alloc(size_i())) == NULL)
300  {
301  std::cout << "\n ** Error in bool isSingular" << std::endl;
302  exit(EXIT_FAILURE);
303  }
304 
305  if (gsl_linalg_complex_LU_decomp(m1.as_gsl_type_ptr(), p, &signum))
306  {
307  std::cout << "\n ** Error in bool isSingular" << std::endl;
308  gsl_permutation_free(p);
309  exit(EXIT_FAILURE);
310  }
311 
312  size_t i, n = m1.size_i();
313 
314  for (i = 0; i < n; i++) {
315  gsl_complex u = gsl_matrix_complex_get(m1.as_gsl_type_ptr(), i, i);
316  if (GSL_REAL(u) == 0 && GSL_IMAG(u) == 0) return 1;
317  }
318  return 0;
319  }
320 
323  {
324  matrix<double> res(size_i(), size_j());
325  for (size_t i = 0; i < size_i(); i++)
326  {
327  gsl_vector_complex_view tmp = gsl_matrix_complex_row(_matrix, i);
328  gsl_vector_view tmpd = gsl_vector_complex_real(&tmp.vector);
329  gsl_matrix_set_row(res.as_gsl_type_ptr(), i, &tmpd.vector);
330  }
331  return res;
332  }
333 
336  {
337  matrix<double> res(size_i(), size_j());
338  for (size_t i = 0; i < size_i(); i++)
339  {
340  gsl_vector_complex_view tmp = gsl_matrix_complex_row(_matrix, i);
341  gsl_vector_view tmpd = gsl_vector_complex_imag(&tmp.vector);
342  gsl_matrix_set_row(res.as_gsl_type_ptr(), i, &tmpd.vector);
343  }
344  return res;
345  }
346 
348  {
349  matrix<complex> m(*this);
350 
351  gsl_eigen_hermv_workspace *ws;
352 
353  ws = gsl_eigen_hermv_alloc(size_i());
354 
355  gsl_eigen_hermv(m.as_gsl_type_ptr(), S.as_gsl_type_ptr(), U.as_gsl_type_ptr(), ws);
356 
357  gsl_eigen_hermv_sort(S.as_gsl_type_ptr(), U.as_gsl_type_ptr(),
358  GSL_EIGEN_SORT_VAL_ASC);
359 
360  gsl_eigen_hermv_free(ws);
361  }
362 
364  vector<double> &S) const
365  {
366  size_t i;
367  matrix<complex> m(*this);
368  vector<complex> v1(size_i(), 0.);
369 
370  m = (*this) * hconjugate();
371  m.eigensystem(U, S);
372  m = hconjugate()*(*this);
373  m.eigensystem(V, S);
374  m = U.hconjugate()*(*this) * V;
375  for (i = 0; i < m.size_i(); i++)
376  {
377  v1.assign(i, complex(1., -m(i, i).arg(), true));
378  S(i) = m(i, i).abs();
379  }
380  V = V * matrix<complex>(v1);
381  }
382 
384  gsl_matrix_complex* matrix<complex>::as_gsl_type_ptr() const
385  {
386  return _matrix;
387  }
388 
389  gsl_matrix_complex& matrix<complex>::as_gsl_type()
390  {
391  return const_cast<gsl_matrix_complex&> (*_matrix);
392  }
393 
394  const gsl_matrix_complex& matrix<complex>::as_gsl_type() const
395  {
396  return const_cast<gsl_matrix_complex&> (*_matrix);
397  }
398 
399  // bool matrix<complex>::is_equal(const matrix<complex>& m1, const matrix<complex>& m2){
400  // return gsl_matrix_complex_equal(m1.as_gsl_type_ptr(),m2.as_gsl_type_ptr());
401  // }
402 
405  {
406  matrix<complex> m1(_matrix);
407  gsl_complex z1;
408  GSL_SET_COMPLEX(&z1, -1., 0.);
409  if (gsl_matrix_complex_scale(m1.as_gsl_type_ptr(), z1))
410  {
411  std::cout << "\n ** Error in matrix<complex> unary -" << std::endl;
412  exit(EXIT_FAILURE);
413  }
414  return m1;
415  }
416 
419  {
420  matrix<complex> m1(_matrix);
421  if (gsl_matrix_complex_add(m1.as_gsl_type_ptr(), m.as_gsl_type_ptr()))
422  {
423  std::cout << "\n ** Error in matrix<complex> +" << std::endl;
424  exit(EXIT_FAILURE);
425  }
426  return m1;
427  }
428 
431  {
432  matrix<complex> m1(_matrix);
433  matrix<complex> m2 = -m;
434  if (gsl_matrix_complex_add(m1.as_gsl_type_ptr(), m2.as_gsl_type_ptr()))
435  {
436  std::cout << "\n ** Error in matrix<complex> +" << std::endl;
437  exit(EXIT_FAILURE);
438  }
439  return m1;
440  }
441 
444  {
445  matrix<complex> m1(_matrix);
446  gsl_complex z1, z2;
447 
448  if (size_j() != m.size_i())
449  {
450  std::cout << "\n ** Size mismatch in matrix<complex> *" << std::endl;
451  exit(EXIT_FAILURE);
452  }
453  GSL_SET_COMPLEX(&z1, 1., 0.);
454  GSL_SET_COMPLEX(&z2, 0., 0.);
455  if (gsl_blas_zgemm(CblasNoTrans, CblasNoTrans, z1, _matrix,
456  m.as_gsl_type_ptr(), z2, m1.as_gsl_type_ptr()))
457  {
458  std::cout << "\n ** Error in matrix<complex> *" << std::endl;
459  exit(EXIT_FAILURE);
460  }
461  return m1;
462  }
463 
466  {
467  matrix<complex> m1(_matrix);
468  matrix<complex> m2(m);
469  if (gsl_matrix_complex_add(m1.as_gsl_type_ptr(), m2.as_gsl_type_ptr()))
470  {
471  std::cout << "\n ** Error in matrix<complex> +" << std::endl;
472  exit(EXIT_FAILURE);
473  }
474  return m1;
475  }
476 
479  {
480  matrix<complex> m1(_matrix);
481  matrix<complex> m2(-m);
482  if (gsl_matrix_complex_add(m1.as_gsl_type_ptr(), m2.as_gsl_type_ptr()))
483  {
484  std::cout << "\n ** Error in matrix<complex> +" << std::endl;
485  exit(EXIT_FAILURE);
486  }
487  return m1;
488  }
489 
492  {
493  matrix<complex> m1(m);
494  return *this * m1;
495  }
496 
499  {
500  gsl_complex z1, z2;
501  vector<complex> v1(size_i(), 0.);
502 
503  if (size_j() != v.size())
504  {
505  std::cout << "\n ** Size mismatch in matrix<complex> * (vector complex)"
506  << std::endl;
507  exit(EXIT_FAILURE);
508  }
509  GSL_SET_COMPLEX(&z1, 1., 0.);
510  GSL_SET_COMPLEX(&z2, 0., 0.);
511  if (gsl_blas_zgemv(CblasNoTrans, z1, _matrix, v.as_gsl_type_ptr(),
512  z2, v1.as_gsl_type_ptr()))
513  {
514  std::cout << "\n ** Error in matrix<complex> * (vector complex)"
515  << std::endl;
516  exit(EXIT_FAILURE);
517  }
518  return v1;
519  }
520 
523  {
524  vector<complex> v1(v);
525  return *this * v1;
526  }
527 
530  {
531  *this = *this +m;
532  return *this;
533  }
534 
537  {
538  *this = *this -m;
539  return *this;
540  }
541 
544  {
545  if (!((size_i() == size_j()) && (size_i() == m.size_i()) &&
546  (size_j() == m.size_j())))
547  {
548  std::cout << "\n ** Size mismatch in matrix<complex> *= (matrix)"
549  << std::endl;
550  exit(EXIT_FAILURE);
551  }
552  *this = *this * m;
553  return *this;
554  }
555 
558  {
559  matrix<complex> m1(_matrix);
560  if (gsl_matrix_complex_add_constant(m1.as_gsl_type_ptr(), z.as_gsl_type()))
561  {
562  std::cout << "\n ** Error in matrix<complex> + (complex)" << std::endl;
563  exit(EXIT_FAILURE);
564  }
565  return m1;
566  }
567 
570  {
571  matrix<complex> m1(_matrix);
572  if (gsl_matrix_complex_add_constant(m1.as_gsl_type_ptr(), (-z).as_gsl_type()))
573  {
574  std::cout << "\n ** Error in matrix<complex> - (complex)" << std::endl;
575  exit(EXIT_FAILURE);
576  }
577  return m1;
578  }
579 
582  {
583  matrix<complex> m1(_matrix);
584  if (gsl_matrix_complex_scale(m1.as_gsl_type_ptr(), z.as_gsl_type()))
585  {
586  std::cout << "\n ** Error in matrix<complex> * (complex)" << std::endl;
587  exit(EXIT_FAILURE);
588  }
589  return m1;
590  }
591 
594  {
595  matrix<complex> m1(_matrix);
596  if (gsl_matrix_complex_scale(m1.as_gsl_type_ptr(), z.inverse().as_gsl_type()))
597  {
598  std::cout << "\n ** Error in matrix<complex> / (complex)" << std::endl;
599  exit(EXIT_FAILURE);
600  }
601  return m1;
602  }
603 
606  {
607  *this = *this +z;
608  return *this;
609  }
610 
613  {
614  *this = *this -z;
615  return *this;
616  }
617 
620  {
621  *this = *this * z;
622  return *this;
623  }
624 
627  {
628  *this = *this / z;
629  return *this;
630  }
631 
634  {
635  complex z(a);
636  return *this +z;
637  }
638 
641  {
642  complex z(a);
643  return *this -z;
644  }
645 
648  {
649  complex z(a);
650  return *this * z;
651  }
652 
655  {
656  complex z(a);
657  return *this / z;
658  }
659 
662  {
663  *this = *this +a;
664  return *this;
665  }
666 
669  {
670  *this = *this -a;
671  return *this;
672  }
673 
676  {
677  *this = *this * a;
678  return *this;
679  }
680 
683  {
684  *this = *this / a;
685  return *this;
686  }
687 
690  {
691  if (a.size_i() != size_i() || a.size_j() != size_j())
692  {
693  std::cout << "\n Error in matrix<complex>::operator== (matrix): cannot compare matrices of different size" << std::endl;
694  exit(EXIT_FAILURE);
695  }
696  for (size_t i = 0; i < size_i(); i++)
697  for (size_t j = 0; j < size_j(); j++)
698  if (a(i, j) != (*this)(i, j)) return (false);
699  return (true);
700  }
701 
703  std::ostream& operator<<(std::ostream& output, const matrix<complex>& m)
704  {
705  size_t i, j;
706  for (i = 0; i < m.size_i(); i++)
707  {
708  output << std::endl;
709  output << "\t(";
710  for (j = 0; j < m.size_j() - 1; j++)
711  output << m(i, j) << ",";
712  output << m(i, j) << ")";
713  }
714  return output;
715  }
716 
718  {
719  return m2 + m1;
720  }
721 
723  {
724  return -m2 + m1;
725  }
726 
728  {
729  return m + z;
730  }
731 
733  {
734  return -m + z;
735  }
736 
738  {
739  return m * z;
740  }
741 
743  {
744  return m.transpose() * v;
745  }
746 
748  {
749  return m.transpose() * v;
750  }
751 
752  matrix<complex> operator+(const double& a, const matrix<complex> m)
753  {
754  return m + a;
755  }
756 
757  matrix<complex> operator-(const double& a, const matrix<complex> m)
758  {
759  return -m + a;
760  }
761 
762  matrix<complex> operator*(const double& a, const matrix<complex> m)
763  {
764  return m * a;
765  }
766 }
gslpp::matrix< complex >::as_gsl_type
gsl_matrix_complex & as_gsl_type()
Definition: gslpp_matrix_complex.cpp:389
gslpp::vector< double >::size
size_t size() const
Definition: gslpp_vector_double.cpp:88
gslpp::matrix< complex >::hconjugate
matrix< complex > hconjugate() const
Definition: gslpp_matrix_complex.cpp:229
gslpp::vector< complex >
A class for constructing and defining operations on complex vectors.
Definition: gslpp_vector_complex.h:33
gslpp::matrix< double >
A class for constructing and defining operations on real matrices.
Definition: gslpp_matrix_double.h:48
gslpp_matrix_complex.h
gslpp::matrix< double >::size_j
size_t size_j() const
Definition: gslpp_matrix_double.cpp:137
gslpp::complex
A class for defining operations on and functions of complex numbers.
Definition: gslpp_complex.h:35
gslpp::matrix< double >::as_gsl_type_ptr
gsl_matrix * as_gsl_type_ptr() const
Definition: gslpp_matrix_double.cpp:295
gslpp::vector< complex >::assign
void assign(const size_t &i, const complex &z)
Definition: gslpp_vector_complex.cpp:104
gslpp::matrix
A base class for defining operations on matrices, both real and complex.
Definition: gslpp_matrix_base.h:21
gslpp::operator+
complex operator+(const double &x1, const complex &z2)
Definition: gslpp_complex.cpp:302
gslpp::matrix< complex >::size_j
size_t size_j() const
Definition: gslpp_matrix_complex.cpp:194
gslpp::matrix< complex >::size_i
size_t size_i() const
Definition: gslpp_matrix_complex.cpp:189
gslpp::vector< complex >::as_gsl_type_ptr
gsl_vector_complex * as_gsl_type_ptr() const
Definition: gslpp_vector_complex.cpp:155
gslpp::matrix< complex >::transpose
matrix< complex > transpose() const
Definition: gslpp_matrix_complex.cpp:217
gslpp::matrix< complex >::eigensystem
void eigensystem(matrix< complex > &U, vector< double > &S) const
Definition: gslpp_matrix_complex.cpp:347
gslpp::complex::i
static const complex & i()
Definition: gslpp_complex.cpp:154
gslpp::matrix< double >::size_i
size_t size_i() const
Definition: gslpp_matrix_double.cpp:132
gslpp::matrix< complex >::as_gsl_type_ptr
gsl_matrix_complex * as_gsl_type_ptr() const
Definition: gslpp_matrix_complex.cpp:384
gslpp::vector< double >
A class for constructing and defining operations on real vectors.
Definition: gslpp_vector_double.h:33
gslpp::operator-
matrix< complex > operator-(const double &a, const matrix< complex > m)
Definition: gslpp_matrix_complex.cpp:757
S
A class for the form factor in .
Definition: MVllObservables.h:1436
gslpp::operator/
complex operator/(const double &x1, const complex &z2)
Definition: gslpp_complex.cpp:320
gslpp::operator<<
std::ostream & operator<<(std::ostream &output, const complex &z)
Definition: gslpp_complex.cpp:143
gslpp::operator+
matrix< complex > operator+(const double &a, const matrix< complex > m)
Definition: gslpp_matrix_complex.cpp:752
gslpp::operator*
matrix< complex > operator*(const double &a, const matrix< complex > m)
Definition: gslpp_matrix_complex.cpp:762
gslpp::operator*
complex operator*(const double &x1, const complex &z2)
Definition: gslpp_complex.cpp:314
gslpp::complex::as_gsl_type
gsl_complex & as_gsl_type()
Definition: gslpp_complex.cpp:123
gslpp::complex::inverse
complex inverse() const
Definition: gslpp_complex.cpp:294
gslpp
Complex number, vector and matrix manipulation using GSL.
Definition: gslpp_complex.cpp:16
gslpp::vector< complex >::size
size_t size() const
Definition: gslpp_vector_complex.cpp:117
gslpp::matrix< complex >
A class for constructing and defining operations on complex matrices.
Definition: gslpp_matrix_complex.h:45
gslpp::operator-
complex operator-(const double &x1, const complex &z2)
Definition: gslpp_complex.cpp:308