5#ifndef DUNE_DENSEMATRIX_HH
6#define DUNE_DENSEMATRIX_HH
60 template<
class DenseMatrix,
class RHS >
67 template<
class DenseMatrix,
class RHS >
71 template<
class DenseMatrix,
class RHS >
76 constexpr static void apply (
DenseMatrix &denseMatrix,
const RHS &rhs )
83 template<
class DenseMatrix,
class RHS >
84 requires Std::indirectly_copyable<
85 decltype(std::begin(*std::declval<typename RHS::const_iterator>())),
86 decltype(std::begin(*std::declval<typename DenseMatrix::iterator>()))>
87 class DenseMatrixAssigner<DenseMatrix, RHS>
90 constexpr static void apply ( DenseMatrix &denseMatrix,
const RHS &rhs )
94 typename DenseMatrix::iterator tIt = std::begin(denseMatrix);
95 typename RHS::const_iterator sIt = std::begin(rhs);
96 for(; sIt != std::end(rhs); ++tIt, ++sIt)
97 std::copy(std::begin(*sIt), std::end(*sIt), std::begin(*tIt));
105 template<
class DenseMatrix,
class RHS >
107 :
public Impl::DenseMatrixAssigner< DenseMatrix, RHS >
114 template<
class DenseMatrix,
class RHS >
115 std::true_type hasDenseMatrixAssigner ( DenseMatrix &,
const RHS &,
decltype( Dune::DenseMatrixAssigner< DenseMatrix, RHS >::apply( std::declval< DenseMatrix & >(), std::declval< const RHS & >() ) ) * =
nullptr );
117 std::false_type hasDenseMatrixAssigner ( ... );
121 template<
class DenseMatrix,
class RHS >
122 struct HasDenseMatrixAssigner
123 :
public decltype( Impl::hasDenseMatrixAssigner( std::declval< DenseMatrix & >(), std::declval< const RHS & >() ) )
143 template<
typename MAT>
149 constexpr MAT & asImp() {
return static_cast<MAT&
>(*this); }
150 constexpr const MAT & asImp()
const {
return static_cast<const MAT&
>(*this); }
196 return asImp().mat_access(i);
201 return asImp().mat_access(i);
218 typedef typename std::remove_reference<row_reference>::type::Iterator
ColIterator;
253 typedef typename std::remove_reference<const_row_reference>::type::ConstIterator
ConstColIterator;
283 template< class RHS, class = std::enable_if_t< HasDenseMatrixAssigner< MAT, RHS >::value > >
293 template <
class Other>
306 using idx_type =
typename decltype(result)
::size_type;
308 for (idx_type i = 0; i <
rows(); ++i)
309 for (idx_type j = 0; j <
cols(); ++j)
310 result[i][j] = - asImp()[i][j];
316 template <
class Other>
342 template <
class Other>
347 (*
this)[ i ].axpy( a, x[ i ] );
352 template <
class Other>
357 if ((*
this)[i]!=x[i])
362 template <
class Other>
372 template<
class X,
class Y>
373 constexpr void mv (
const X& x, Y& y)
const
375 auto&& xx = Impl::asVector(x);
376 auto&& yy = Impl::asVector(y);
384 yy[i] = y_field_type(0);
386 yy[i] += (*
this)[i][j] * xx[j];
391 template<
class X,
class Y >
392 constexpr void mtv (
const X &x, Y &y )
const
394 auto&& xx = Impl::asVector(x);
395 auto&& yy = Impl::asVector(y);
403 yy[i] = y_field_type(0);
405 yy[i] += (*
this)[j][i] * xx[j];
410 template<
class X,
class Y>
411 constexpr void umv (
const X& x, Y& y)
const
413 auto&& xx = Impl::asVector(x);
414 auto&& yy = Impl::asVector(y);
419 yy[i] += (*
this)[i][j] * xx[j];
423 template<
class X,
class Y>
424 constexpr void umtv (
const X& x, Y& y)
const
426 auto&& xx = Impl::asVector(x);
427 auto&& yy = Impl::asVector(y);
432 yy[j] += (*
this)[i][j]*xx[i];
436 template<
class X,
class Y>
437 constexpr void umhv (
const X& x, Y& y)
const
439 auto&& xx = Impl::asVector(x);
440 auto&& yy = Impl::asVector(y);
449 template<
class X,
class Y>
450 constexpr void mmv (
const X& x, Y& y)
const
452 auto&& xx = Impl::asVector(x);
453 auto&& yy = Impl::asVector(y);
458 yy[i] -= (*
this)[i][j] * xx[j];
462 template<
class X,
class Y>
463 constexpr void mmtv (
const X& x, Y& y)
const
465 auto&& xx = Impl::asVector(x);
466 auto&& yy = Impl::asVector(y);
471 yy[j] -= (*
this)[i][j]*xx[i];
475 template<
class X,
class Y>
476 constexpr void mmhv (
const X& x, Y& y)
const
478 auto&& xx = Impl::asVector(x);
479 auto&& yy = Impl::asVector(y);
488 template<
class X,
class Y>
490 const X& x, Y& y)
const
492 auto&& xx = Impl::asVector(x);
493 auto&& yy = Impl::asVector(y);
498 yy[i] += alpha * (*
this)[i][j] * xx[j];
502 template<
class X,
class Y>
504 const X& x, Y& y)
const
506 auto&& xx = Impl::asVector(x);
507 auto&& yy = Impl::asVector(y);
512 yy[j] += alpha*(*
this)[i][j]*xx[i];
516 template<
class X,
class Y>
518 const X& x, Y& y)
const
520 auto&& xx = Impl::asVector(x);
521 auto&& yy = Impl::asVector(y);
536 for (
size_type i=0; i<
rows(); ++i) sum += (*
this)[i].two_norm2();
537 return fvmeta::sqrt(sum);
544 for (
size_type i=0; i<
rows(); ++i) sum += (*
this)[i].two_norm2();
550 typename std::enable_if<!HasNaN<vt>::value,
int>
::type = 0>
556 for (
auto const &x : *
this) {
565 typename std::enable_if<!HasNaN<vt>::value,
int>
::type = 0>
571 for (
auto const &x : *
this) {
580 typename std::enable_if<HasNaN<vt>::value,
int>
::type = 0>
587 for (
auto const &x : *
this) {
592 return norm * (is_nan / is_nan);
597 typename std::enable_if<HasNaN<vt>::value,
int>
::type = 0>
604 for (
auto const &x : *
this) {
609 return norm * (is_nan / is_nan);
618 template <
class V1,
class V2>
619 void solve (V1& x,
const V2& b,
bool doPivoting =
true)
const;
631 template<
typename M2>
642 (*
this)[i][j] +=
M[i][k]*C[k][j];
649 template<
typename M2>
660 (*
this)[i][j] += C[i][k]*
M[k][j];
676 C[i][j] +=
M[i][k]*(*
this)[k][j];
684 FieldMatrix<K,rows,l> rightmultiplyany (
const FieldMatrix<K,cols,l>&
M)
const
686 FieldMatrix<K,rows,l> C;
692 C[i][j] += (*
this)[i][k]*
M[k][j];
716 return asImp().mat_rows();
722 return asImp().mat_cols();
740 ElimPivot(std::vector<simd_index_type> & pivot);
742 void swap(std::size_t i, simd_index_type j);
745 void operator()(
const T&,
int,
int)
748 std::vector<simd_index_type> & pivot_;
756 void swap(std::size_t i, simd_index_type j);
758 void operator()(
const typename V::field_type& factor,
int k,
int i);
765 ElimDet(field_type& sign) : sign_(
sign)
768 void swap(std::size_t i, simd_index_type j)
771 Simd::cond(simd_index_type(i) == j, field_type(1), field_type(-1));
774 void operator()(
const field_type&,
int,
int)
820 template<
class Func,
class Mask>
822 Mask &nonsingularLanes,
bool throwEarly,
bool doPivoting);
826 template<
typename MAT>
830 for(
typename std::vector<size_type>::size_type i=0; i < pivot_.size(); ++i)
834 template<
typename MAT>
835 void DenseMatrix<MAT>::ElimPivot::swap(std::size_t i, simd_index_type j)
841 template<
typename MAT>
847 template<
typename MAT>
859 template<
typename MAT>
864 (*rhs_)[k] -= factor*(*rhs_)[i];
867 template<
typename MAT>
868 template<
typename Func,
class Mask>
871 bool throwEarly,
bool doPivoting)
879 for (size_type i=0; i<A.rows(); i++)
881 real_type pivmax = fvmeta::absreal(A[i][i]);
886 simd_index_type imax=i;
887 for (size_type k=i+1; k<A.rows(); k++)
889 auto abs = fvmeta::absreal(A[k][i]);
892 imax =
Simd::cond(mask, simd_index_type(k), imax);
895 for (size_type j=0; j<A.rows(); j++)
905 for(std::size_t l = 0; l <
Simd::lanes(A[i][j]); ++l)
913 nonsingularLanes = nonsingularLanes && (pivmax !=
real_type(0));
924 for (size_type k=i+1; k<A.rows(); k++)
930 for (size_type j=i+1; j<A.rows(); j++)
931 A[k][j] -= factor*A[i][j];
937 template<
typename MAT>
938 template <
class V1,
class V2>
948#ifdef DUNE_FMatrix_WITH_CHECKING
953 x[0] = b[0]/(*this)[0][0];
956 else if (rows()==2) {
958 field_type detinv = (*this)[0][0]*(*this)[1][1]-(*this)[0][1]*(*this)[1][0];
959#ifdef DUNE_FMatrix_WITH_CHECKING
966 x[0] = detinv*((*this)[1][1]*b[0]-(*this)[0][1]*b[1]);
967 x[1] = detinv*((*this)[0][0]*b[1]-(*this)[1][0]*b[0]);
970 else if (rows()==3) {
973#ifdef DUNE_FMatrix_WITH_CHECKING
979 x[0] = (b[0]*(*this)[1][1]*(*this)[2][2] - b[0]*(*this)[2][1]*(*this)[1][2]
980 - b[1] *(*this)[0][1]*(*this)[2][2] + b[1]*(*this)[2][1]*(*this)[0][2]
981 + b[2] *(*this)[0][1]*(*this)[1][2] - b[2]*(*this)[1][1]*(*this)[0][2]) / d;
983 x[1] = ((*this)[0][0]*b[1]*(*this)[2][2] - (*this)[0][0]*b[2]*(*this)[1][2]
984 - (*this)[1][0] *b[0]*(*this)[2][2] + (*this)[1][0]*b[2]*(*this)[0][2]
985 + (*this)[2][0] *b[0]*(*this)[1][2] - (*this)[2][0]*b[1]*(*this)[0][2]) / d;
987 x[2] = ((*this)[0][0]*(*this)[1][1]*b[2] - (*this)[0][0]*(*this)[2][1]*b[1]
988 - (*this)[1][0] *(*this)[0][1]*b[2] + (*this)[1][0]*(*this)[2][1]*b[0]
989 + (*this)[2][0] *(*this)[0][1]*b[1] - (*this)[2][0]*(*this)[1][1]*b[0]) / d;
999 nonsingularLanes(
true);
1004 for(
int i=rows()-1; i>=0; i--) {
1005 for (size_type j=i+1; j<rows(); j++)
1006 rhs[i] -= A[i][j]*x[j];
1007 x[i] = rhs[i]/A[i][i];
1012 template<
typename MAT>
1024#ifdef DUNE_FMatrix_WITH_CHECKING
1029 (*this)[0][0] =
real_type( 1 ) / (*this)[0][0];
1032 else if (rows()==2) {
1034 field_type detinv = (*this)[0][0]*(*this)[1][1]-(*this)[0][1]*(*this)[1][0];
1035#ifdef DUNE_FMatrix_WITH_CHECKING
1043 (*this)[0][0] = (*this)[1][1]*detinv;
1044 (*this)[0][1] = -(*this)[0][1]*detinv;
1045 (*this)[1][0] = -(*this)[1][0]*detinv;
1046 (*this)[1][1] = temp*detinv;
1053 K t4 = (*this)[0][0] * (*this)[1][1];
1054 K t6 = (*this)[0][0] * (*this)[1][2];
1055 K t8 = (*this)[0][1] * (*this)[1][0];
1056 K t10 = (*this)[0][2] * (*this)[1][0];
1057 K t12 = (*this)[0][1] * (*this)[2][0];
1058 K t14 = (*this)[0][2] * (*this)[2][0];
1060 K det = (t4*(*this)[2][2]-t6*(*this)[2][1]-t8*(*this)[2][2]+
1061 t10*(*this)[2][1]+t12*(*this)[1][2]-t14*(*this)[1][1]);
1064 K matrix01 = (*this)[0][1];
1065 K matrix00 = (*this)[0][0];
1066 K matrix10 = (*this)[1][0];
1067 K matrix11 = (*this)[1][1];
1069 (*this)[0][0] = ((*this)[1][1] * (*this)[2][2] - (*this)[1][2] * (*this)[2][1])*t17;
1070 (*this)[0][1] = -((*this)[0][1] * (*this)[2][2] - (*this)[0][2] * (*this)[2][1])*t17;
1071 (*this)[0][2] = (matrix01 * (*this)[1][2] - (*this)[0][2] * (*this)[1][1])*t17;
1072 (*this)[1][0] = -((*this)[1][0] * (*this)[2][2] - (*this)[1][2] * (*this)[2][0])*t17;
1073 (*this)[1][1] = (matrix00 * (*this)[2][2] - t14) * t17;
1074 (*this)[1][2] = -(t6-t10) * t17;
1075 (*this)[2][0] = (matrix10 * (*this)[2][1] - matrix11 * (*this)[2][0]) * t17;
1076 (*this)[2][1] = -(matrix00 * (*this)[2][1] - t12) * t17;
1077 (*this)[2][2] = (t4-t8) * t17;
1083 std::vector<simd_index_type> pivot(rows());
1085 nonsingularLanes(
true);
1093 for(size_type i=0; i<rows(); ++i)
1097 for (size_type i=0; i<rows(); i++)
1098 for (size_type j=0; j<i; j++)
1099 for (size_type k=0; k<rows(); k++)
1100 (*
this)[i][k] -= L[i][j]*(*this)[j][k];
1103 for (size_type i=rows(); i>0;) {
1105 for (size_type k=0; k<rows(); k++) {
1106 for (size_type j=i+1; j<rows(); j++)
1107 (*
this)[i][k] -= U[i][j]*(*this)[j][k];
1108 (*this)[i][k] /= U[i][i];
1112 for(size_type i=rows(); i>0; ) {
1114 for(std::size_t l = 0; l <
Simd::lanes((*
this)[0][0]); ++l)
1118 for(size_type j=0; j<rows(); ++j)
1127 template<
typename MAT>
1136 return (*
this)[0][0];
1139 return (*
this)[0][0]*(*this)[1][1] - (*this)[0][1]*(*this)[1][0];
1143 field_type t4 = (*this)[0][0] * (*this)[1][1];
1144 field_type t6 = (*this)[0][0] * (*this)[1][2];
1145 field_type t8 = (*this)[0][1] * (*this)[1][0];
1146 field_type t10 = (*this)[0][2] * (*this)[1][0];
1147 field_type t12 = (*this)[0][1] * (*this)[2][0];
1148 field_type t14 = (*this)[0][2] * (*this)[2][0];
1150 return (t4*(*
this)[2][2]-t6*(*
this)[2][1]-t8*(*
this)[2][2]+
1151 t10*(*
this)[2][1]+t12*(*
this)[1][2]-t14*(*
this)[1][1]);
1158 nonsingularLanes(
true);
1163 for (size_type i = 0; i < rows(); ++i)
1173 template <
typename MAT,
typename V1,
typename V2>
1180 for(size_type i=0; i<matrix.
rows(); ++i)
1183 for(size_type j=0; j<matrix.
cols(); ++j)
1185 ret[i] += matrix[i][j]*x[j];
1192 template <
typename K,
int rows,
int cols>
1197 for(size_type i=0; i<cols(); ++i)
1200 for(size_type j=0; j<rows(); ++j)
1201 ret[i] += matrix[j][i]*x[j];
1206 template <
typename K,
int rows,
int cols>
1207 static inline FieldVector<K,rows> mult(
const FieldMatrix<K,rows,cols> &matrix,
const FieldVector<K,cols> & x)
1209 FieldVector<K,rows> ret;
1215 template <
typename K,
int rows,
int cols>
1216 static inline FieldVector<K,cols> multTransposed(
const FieldMatrix<K,rows,cols> &matrix,
const FieldVector<K,rows> & x)
1218 FieldVector<K,cols> ret;
1219 multAssignTransposed( matrix, x, ret );
1227 template<
typename MAT>
1231 s << a[i] << std::endl;
Traits for type conversions and type information.
Implements a scalar vector view wrapper around an existing scalar.
Various precision settings for calculations with FieldMatrix and FieldVector.
Some useful basic math stuff.
Implements a vector constructed from a given type representing a field and a compile-time given size.
A few common exception classes.
A free function to provide the demangled class name of a given object or type as a string.
Macro for wrapping boundary checks.
#define DUNE_ASSERT_BOUNDS(cond)
If DUNE_CHECK_BOUNDS is defined: check if condition cond holds; otherwise, do nothing.
Definition boundschecking.hh:30
typename AutonomousValueType< T >::type AutonomousValue
Type free of internal references that T can be converted to.
Definition typetraits.hh:566
std::ostream & operator<<(std::ostream &s, const bigunsignedint< k > &x)
Definition bigunsignedint.hh:301
#define DUNE_THROW(E,...)
Definition exceptions.hh:314
bool anyTrue(const Mask &mask)
Whether any entry is true.
Definition simd/interface.hh:429
V cond(M &&mask, const V &ifTrue, const V &ifFalse)
Like the ?: operator.
Definition simd/interface.hh:386
bool allTrue(const Mask &mask)
Whether all entries are true.
Definition simd/interface.hh:439
typename Overloads::ScalarType< std::decay_t< V > >::type Scalar
Element type of some SIMD type.
Definition simd/interface.hh:235
Rebind< bool, V > Mask
Mask type type of some SIMD type.
Definition simd/interface.hh:289
typename Overloads::RebindType< std::decay_t< S >, std::decay_t< V > >::type Rebind
Construct SIMD type with different scalar type.
Definition simd/interface.hh:252
constexpr std::size_t lanes()
Number of lanes in a SIMD type.
Definition simd/interface.hh:305
decltype(auto) lane(std::size_t l, V &&v)
Extract an element of a SIMD type.
Definition simd/interface.hh:324
Mask< V > mask(ADLTag< 0, std::is_same< V, Mask< V > >::value >, const V &v)
implements Simd::mask()
Definition defaults.hh:153
Dune namespace
Definition alignedallocator.hh:13
constexpr int sign(const T &val)
Return the sign of the value.
Definition math.hh:162
void swap(T &v1, T &v2, bool mask)
Definition simd.hh:472
constexpr K conjugateComplex(const K &x)
compute conjugate complex of x
Definition math.hh:146
Definition densematrix.hh:1170
static void multAssign(const DenseMatrix< MAT > &matrix, const DenseVector< V1 > &x, DenseVector< V2 > &ret)
calculates ret = matrix * x
Definition densematrix.hh:1174
constexpr T abs(T t)
Definition cmath.hh:27
Whether this type acts as a scalar in the context of (hierarchically blocked) containers.
Definition typetraits.hh:194
A dense n x m matrix.
Definition densematrix.hh:145
ConstIterator const_iterator
typedef for stl compliant access
Definition densematrix.hh:249
constexpr derived_type & operator+=(const DenseMatrix< Other > &x)
vector space addition
Definition densematrix.hh:294
constexpr Iterator beforeBegin()
Definition densematrix.hh:241
constexpr void umhv(const X &x, Y &y) const
y += A^H x
Definition densematrix.hh:437
constexpr derived_type & operator*=(const field_type &k)
vector space multiplication with scalar
Definition densematrix.hh:326
constexpr void usmhv(const typename FieldTraits< Y >::field_type &alpha, const X &x, Y &y) const
y += alpha A^H x
Definition densematrix.hh:517
constexpr derived_type & operator-=(const DenseMatrix< Other > &x)
vector space subtraction
Definition densematrix.hh:317
void solve(V1 &x, const V2 &b, bool doPivoting=true) const
Solve system A x = b.
Traits::value_type field_type
export the type representing the field
Definition densematrix.hh:165
constexpr ConstIterator beforeEnd() const
Definition densematrix.hh:269
constexpr bool operator!=(const DenseMatrix< Other > &x) const
Binary matrix incomparison.
Definition densematrix.hh:363
constexpr derived_type & axpy(const field_type &a, const DenseMatrix< Other > &x)
vector space axpy operation (*this += a x)
Definition densematrix.hh:343
std::remove_reference< const_row_reference >::type::ConstIterator ConstColIterator
rename the iterators for easier access
Definition densematrix.hh:253
void invert(bool doPivoting=true)
Compute inverse.
constexpr void usmtv(const typename FieldTraits< Y >::field_type &alpha, const X &x, Y &y) const
y += alpha A^T x
Definition densematrix.hh:503
static void luDecomposition(DenseMatrix< MAT > &A, Func func, Mask &nonsingularLanes, bool throwEarly, bool doPivoting)
do an LU-Decomposition on matrix A
Traits::value_type block_type
export the type representing the components
Definition densematrix.hh:168
constexpr size_type cols() const
number of columns
Definition densematrix.hh:720
constexpr size_type size() const
size method (number of rows)
Definition densematrix.hh:205
constexpr size_type M() const
Definition densematrix.hh:708
constexpr void mmhv(const X &x, Y &y) const
y -= A^H x
Definition densematrix.hh:476
MAT & rightmultiply(const DenseMatrix< M2 > &M)
Multiplies M from the right to this matrix.
Definition densematrix.hh:650
constexpr Iterator beforeEnd()
Definition densematrix.hh:234
constexpr ConstIterator beforeBegin() const
Definition densematrix.hh:276
constexpr FieldTraits< value_type >::real_type frobenius_norm() const
frobenius norm: sqrt(sum over squared values of entries)
Definition densematrix.hh:533
Traits::value_type value_type
export the type representing the field
Definition densematrix.hh:162
constexpr Iterator end()
end iterator
Definition densematrix.hh:227
constexpr derived_type & operator/=(const field_type &k)
vector space division by scalar
Definition densematrix.hh:334
constexpr derived_type operator-() const
Matrix negation.
Definition densematrix.hh:303
constexpr size_type rows() const
number of rows
Definition densematrix.hh:714
constexpr void mv(const X &x, Y &y) const
y = A x
Definition densematrix.hh:373
MAT & leftmultiply(const DenseMatrix< M2 > &M)
Multiplies M from the left to this matrix.
Definition densematrix.hh:632
constexpr void mtv(const X &x, Y &y) const
y = A^T x
Definition densematrix.hh:392
constexpr FieldTraits< vt >::real_type infinity_norm() const
infinity norm (row sum norm, how to generalize for blocks?)
Definition densematrix.hh:551
constexpr row_reference operator[](size_type i)
random access
Definition densematrix.hh:194
constexpr void umv(const X &x, Y &y) const
y += A x
Definition densematrix.hh:411
Traits::derived_type derived_type
type of derived matrix class
Definition densematrix.hh:159
constexpr bool exists(size_type i, size_type j) const
return true when (i,j) is in pattern
Definition densematrix.hh:728
constexpr void usmv(const typename FieldTraits< Y >::field_type &alpha, const X &x, Y &y) const
y += alpha A x
Definition densematrix.hh:489
Iterator RowIterator
rename the iterators for easier access
Definition densematrix.hh:216
static constexpr int blocklevel
Definition densematrix.hh:183
constexpr ConstIterator begin() const
begin iterator
Definition densematrix.hh:256
constexpr void umtv(const X &x, Y &y) const
y += A^T x
Definition densematrix.hh:424
DenseIterator< const DenseMatrix, const row_type, const_row_reference > ConstIterator
Iterator class for sequential access.
Definition densematrix.hh:247
constexpr void mmtv(const X &x, Y &y) const
y -= A^T x
Definition densematrix.hh:463
constexpr ConstIterator end() const
end iterator
Definition densematrix.hh:262
constexpr FieldTraits< value_type >::real_type frobenius_norm2() const
square of frobenius norm, need for block recursion
Definition densematrix.hh:541
Traits::row_type row_type
The type used to represent a row (must fulfill the Dune::DenseVector interface).
Definition densematrix.hh:174
constexpr size_type N() const
Definition densematrix.hh:702
constexpr bool operator==(const DenseMatrix< Other > &x) const
Binary matrix comparison.
Definition densematrix.hh:353
Traits::size_type size_type
The type used for the index access and size operation.
Definition densematrix.hh:171
Traits::const_row_reference const_row_reference
The type used to represent a reference to a constant row (usually const row_type &).
Definition densematrix.hh:180
std::remove_reference< row_reference >::type::Iterator ColIterator
rename the iterators for easier access
Definition densematrix.hh:218
Traits::row_reference row_reference
The type used to represent a reference to a row (usually row_type &).
Definition densematrix.hh:177
friend class DenseMatrix
Definition densematrix.hh:153
constexpr void mmv(const X &x, Y &y) const
y -= A x
Definition densematrix.hh:450
Iterator iterator
typedef for stl compliant access
Definition densematrix.hh:214
constexpr FieldTraits< vt >::real_type infinity_norm_real() const
simplified infinity norm (uses Manhattan norm for complex values)
Definition densematrix.hh:566
ConstIterator ConstRowIterator
rename the iterators for easier access
Definition densematrix.hh:251
constexpr Iterator begin()
begin iterator
Definition densematrix.hh:221
constexpr derived_type & operator=(const RHS &rhs)
Definition densematrix.hh:284
DenseIterator< DenseMatrix, row_type, row_reference > Iterator
Iterator class for sequential access.
Definition densematrix.hh:212
field_type determinant(bool doPivoting=true) const
calculates the determinant of this matrix
const FieldTraits< typenameDenseMatVecTraits< M >::value_type >::real_type real_type
Definition densematrix.hh:36
const FieldTraits< typenameDenseMatVecTraits< M >::value_type >::field_type field_type
Definition densematrix.hh:35
A dense n x m matrix.
Definition fmatrix.hh:117
Base::size_type size_type
Definition fmatrix.hh:128
vector space out of a tensor product of fields.
Definition fvector.hh:97
you have to specialize this structure for any type that should be assignable to a DenseMatrix
Definition densematrix.hh:61
Error thrown if operations of a FieldMatrix fail.
Definition densematrix.hh:131
Interface for a class of dense vectors over a given field.
Definition densevector.hh:244
constexpr size_type size() const
size method
Definition densevector.hh:351
Generic iterator class for dense vector and matrix implementations.
Definition densevector.hh:132
Default exception class for mathematical errors.
Definition exceptions.hh:335
T field_type
export the type representing the field
Definition ftraits.hh:28
T real_type
export the type representing the real type of the field
Definition ftraits.hh:30
Definition matvectraits.hh:31
static ctype absolute_limit()
return threshold to declare matrix singular
Definition precision.hh:28
Include file for users of the SIMD abstraction layer.