a Code for the Combination of Indirect and Direct Constraints on High Energy Physics Models Logo
gslpp_matrix_double.h
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 #ifndef GSLPP_MATRIX_DOUBLE_H
9 #define GSLPP_MATRIX_DOUBLE_H
10 #include <iostream>
11 #ifndef __GSL_MATRIX_DOUBLE_H__
12 #include <gsl/gsl_matrix_double.h>
13 #endif
14 #ifndef GSLPP_COMPLEX_H
15 #ifndef __GSL_MATRIX_DOUBLE_H__
16 #include <gsl/gsl_matrix_double.h>
17 #endif
18 #include "gslpp_complex.h"
19 #endif
20 #ifndef GSLPP_VECTOR_BASE_H
21 #include "gslpp_vector_base.h"
22 #endif
23 #ifndef GSLPP_VECTOR_DOUBLE_H
24 #include "gslpp_vector_double.h"
25 #endif
26 #ifndef GSLPP_VECTOR_COMPLEX_H
27 #include "gslpp_vector_complex.h"
28 #endif
29 #ifndef GSLPP_MATRIX_BASE_H
30 #include "gslpp_matrix_base.h"
31 #endif
32 #ifndef GSLPP_MATRIX_COMPLEX_H
33 #include "gslpp_matrix_complex.h"
34 #endif
35 
36 namespace gslpp
37 {
47  template <>
48  class matrix<double>
49  {
50  gsl_matrix *_matrix;
51 
52  public:
54  matrix(const size_t& size_i, const size_t& size_j, const double& a);
55  matrix(const size_t& size_i, const double& a);
57  matrix(const matrix<double>& m);
58  matrix(const gsl_matrix& m);
59  matrix(const gsl_matrix* m);
60  matrix(const vector<double>& v);
62  ~matrix();
64  double operator()(const size_t& i, const size_t& j) const;
66  double& operator()(const size_t& i, const size_t& j);
68  void reset();
69  matrix<double>& operator=(const matrix<double>& m);
70  matrix<double>& operator=(double a);
71  void assign(const size_t& i, const size_t& j, const double& a);
72  void assign(const size_t& i, const size_t& j, const matrix<double>& a);
74  size_t size_i() const;
75  size_t size_j() const;
76  size_t size() const;
78  static matrix<double> Id(size_t size);
80  matrix<double> transpose() const;
82  matrix<double> inverse();
84  bool isSingular();
86  double determinant();
88  void eigensystem(matrix<complex> &U, vector<complex> &S);
90  gsl_matrix* as_gsl_type_ptr() const;
91  gsl_matrix& as_gsl_type();
92  const gsl_matrix& as_gsl_type() const;
94  //bool is_equal(const matrix<double>& m1, const matrix<double>& m2);
95 
97  matrix<double> operator-() const;
99  matrix<double> operator+(const matrix<double>& m) const;
101  matrix<double> operator-(const matrix<double>& m) const;
103  matrix<double> operator*(const matrix<double>& m) const;
104  matrix<complex> operator*(const matrix<complex>& m) const;
106  vector<double> operator*(const vector<double>& v) const;
108  vector<complex> operator*(const vector<complex>& v) const;
110  matrix<double>& operator+=(const matrix<double>& m);
112  matrix<double>& operator-=(const matrix<double>& m);
114  matrix<double>& operator*=(const matrix<double>& m);
116  matrix<double> operator+(const double& a) const;
118  matrix<double> operator-(const double& a) const;
120  matrix<double> operator*(const double& a) const;
122  matrix<double> operator/(const double& a) const;
124  matrix<double>& operator+=(const double& a);
126  matrix<double>& operator-=(const double& a);
128  matrix<double>& operator*=(const double& a);
130  matrix<double>& operator/=(const double& a);
132  matrix<complex> operator+(const complex& z) const;
134  matrix<complex> operator-(const complex& z) const;
136  matrix<complex> operator*(const complex& z) const;
138  matrix<complex> operator/(const complex& z) const;
140  bool operator==(const matrix<double>& a) const;
141  bool operator!=(const matrix<double>& a) const
142  {
143  return(!(*this == a));
144  }
145 
147  friend std::ostream& operator<<(std::ostream& output, const matrix<double>& m);
157  friend matrix<double> operator+(const double& a, matrix<double> m);
158 
165  friend matrix<double> operator-(const double& a, matrix<double> m);
166 
173  friend matrix<double> operator*(const double& a, matrix<double> m);
174 
182 
190 
197  friend matrix<complex> operator+(const complex& z, matrix<double> m);
198 
205  friend matrix<complex> operator-(const complex& z, matrix<double> m);
206 
213  friend matrix<complex> operator*(const complex& z, matrix<double> m);
216  };
217 
218 }
219 
220 #endif
gslpp::matrix< double >::_matrix
gsl_matrix * _matrix
Definition: gslpp_matrix_double.h:50
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::complex
A class for defining operations on and functions of complex numbers.
Definition: gslpp_complex.h:35
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_vector_complex.h
gslpp::vector< double >
A class for constructing and defining operations on real vectors.
Definition: gslpp_vector_double.h:33
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::matrix< double >::operator!=
bool operator!=(const matrix< double > &a) const
Definition: gslpp_matrix_double.h:141
gslpp::operator<<
std::ostream & operator<<(std::ostream &output, const complex &z)
Definition: gslpp_complex.cpp:143
gslpp_matrix_base.h
gslpp_complex.h
gslpp::operator*
complex operator*(const double &x1, const complex &z2)
Definition: gslpp_complex.cpp:314
gslpp_vector_base.h
gslpp
Complex number, vector and matrix manipulation using GSL.
Definition: gslpp_complex.cpp:16
gslpp_vector_double.h
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