|
ePDF
1.1.0
A QED evolution library
|
Go to the documentation of this file.
23 Matrix(
int const& Lines = 0,
int const& Columns = 0, std::vector<T>
const& Entries = {}):
30 throw std::runtime_error(
"[Matrix::Matrix]: the size of the input vector does not match the size of the matrix.");
34 void SetElement(
int const& i,
int const& j, T
const& value)
37 throw std::runtime_error(
"[Matrix::SetElement]: line index out of range.");
40 throw std::runtime_error(
"[Matrix::SetElement]: column index out of range.");
49 throw std::runtime_error(
"[Matrix::GetElement]: line index out of range.");
52 throw std::runtime_error(
"[Matrix::GetElement]: column index out of range.");
94 throw std::runtime_error(
"[Matrix::operator +=]: Lines or Columns don't match adding the two matrices.");
96 const std::vector<T> v = term.
GetVector();
97 for (
int i = 0; i <
_Lines; i++)
107 throw std::runtime_error(
"[Matrix::operator -=]: Lines or Columns don't match adding the two matrices.");
109 const std::vector<T> v = term.
GetVector();
110 for (
int i = 0; i <
_Lines; i++)
124 throw std::runtime_error(
"[Matrix::operator *=]: Lines or Columns don't match multiplying the two matrices.");
126 const std::vector<T> v = term.
GetVector();
127 std::vector<T> out(l1 * c2, 0.);
128 for (
int i = 0; i < l1; i++)
129 for (
int j = 0; j < c2; j++)
130 for (
int k = 0; k < c1; k++)
131 out[i * c2 + j] +=
_Matrix[i * c1 + k] * v[k * c2 + j];
142 for (
int i = 0; i <
_Lines; i++)
151 for (
int i = 0; i <
_Lines; i++)
160 for (
int i = 0; i <
_Lines; i++)
169 for (
int i = 0; i <
_Lines; i++)
185 std::ostream&
operator << (std::ostream& os,
Matrix<std::complex<double>>
const& m);
std::vector< T > _Matrix
Definition: matrix.h:178
Matrix< T > operator-(Matrix< T > lhs, Matrix< T > const &rhs)
Definition: matrix.h:196
Matrix(int const &Lines=0, int const &Columns=0, std::vector< T > const &Entries={})
Definition: matrix.h:23
T GetElement(int const &i, int const &j) const
Definition: matrix.h:46
Matrix< T > operator/=(T const &coef)
Definition: matrix.h:149
Matrix< T > operator/(Matrix< T > lhs, T const &rhs)
Definition: matrix.h:224
int GetColumns() const
Definition: matrix.h:70
int GetLines() const
Definition: matrix.h:64
Matrix< T > operator*=(Matrix< T > const &term)
Definition: matrix.h:117
int _Lines
Definition: matrix.h:176
std::vector< T > GetVector() const
Definition: matrix.h:76
Matrix< T > operator*(Matrix< T > lhs, Matrix< T > const &rhs)
Definition: matrix.h:203
void SetElement(int const &i, int const &j, T const &value)
Definition: matrix.h:34
friend std::ostream & operator<<(std::ostream &os, Matrix< Y > const &sg)
std::ostream & operator<<(std::ostream &os, Matrix< std::complex< double >> const &m)
Matrix< T > operator-=(Matrix< T > const &term)
Definition: matrix.h:104
int _Columns
Definition: matrix.h:177
T operator()(int const &i, int const &j) const
Definition: matrix.h:58
Matrix< T > operator+(Matrix< T > lhs, Matrix< T > const &rhs)
Definition: matrix.h:189
Matrix< T > operator=(Matrix< T > const &term)
Definition: matrix.h:82
Matrix< T > operator+=(Matrix< T > const &term)
Definition: matrix.h:91