27 typedef typename Realtype<F>::type
r_type;
29 typedef typename Cmplxtype<F>::type
c_type;
31 typedef typename std::conditional<std::is_same<typename Realtype<F>::type, F>::value ,
32 typename Realtype<F>::type,
typename Cmplxtype<F>::type >
::type d_type;
68 void zeros() { entries_.zeros(); }
71 operator F*() {
return (F*)entries_; }
80 template<
class H,
class I>
83 virtual std::ostream&
info(std::ostream&
os)
const;
90 template<
typename H,
typename I>
93 template<
typename H,
typename I>
98 template<
typename H,
typename I>
110 for (
uint i = 0; i < this->dimX(); ++i)
115 template<
typename H,
typename I>
121 for (
uint i = 0; i < this->dimX(); ++i)
126 template<
class H,
class I>
130 for (
uint j = 0; j < this->dimX(); ++j)
141 template <
typename F>
145 typedef typename Realtype<F>::type
r_type;
147 typedef typename Cmplxtype<F>::type
c_type;
164 virtual std::ostream&
info(std::ostream&
os)
const;
168 template <
typename H,
typename I>
174 template <
typename F>
182 template <
typename F>
188 template <
typename F>
189 template <
typename H,
typename I>
192 const uint n = this->dimX();
201 for(
uint i = 0; i < n; i++) {
202 F& d = inverse_(i,i);
203 for(
uint j = 0; j < n; j++) {
204 const H val =
mX(i,j);
virtual F & operator()(const uint i, const uint j)
Returns and allows access to entry with indices i and j.
virtual void operator()(const Function< c_type > &fncY, Function< c_type > &fncX)
Cmplxtype< F >::type c_type
Complex type of data type.
virtual F operator()(const uint i, const uint j) const
Returns entry with indices i and j.
DiagonalMatrix(const Space< G > &spc)
Constructor. Creates a diagonal matrix with all entries set to 0.
DiagonalMatrix(const Space< G > &spc, const Array< F > entries)
virtual void transpMult(const Vector< r_type > &fncY, Vector< F > &fncX)
Computes fncX = AT fncY where A is this matrix.
DiagonalMatrix(const Matrix< F > &matrix)
void addInto(Matrix< H > &dest, const I fact)
virtual void operator()(const Function< r_type > &fncY, Function< F > &fncX)
Computes fncX = A(fncY) where A is this matrix.
void zeros()
Fills the matrix diagonals with zeros.
Realtype< F >::type r_type
Real type of data type.
DiagonalMatrix< F > & operator=(F c)
Assignement operator.
std::conditional< std::is_same< typenameRealtype< F >::type, F >::value, typenameRealtype< F >::type, typenameCmplxtype< F >::type >::type d_type
Data type, depending if F is real or complex.
DiagonalMatrix< F > & operator+=(const Matrix< F > &d)
Addition operator.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
Realtype< F >::type r_type
Real type of data type.
void operator()(const Matrix< c_type > &mX, Matrix< c_type > &mY)
Application method to complex matrices.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
Cmplxtype< F >::type c_type
Real type of data type.
void operator()(const Matrix< r_type > &mX, Matrix< F > &mY)
Application method to real matrices.
DiagonalSolver(const DiagonalMatrix< F > &m)
F type
Type of data, e.g. matrix entries.
virtual void operator()()
#define conceptsAssert(cond, exc)
Set< F > makeSet(uint n, const F &first,...)