3 #ifndef DUNE_DENSEMATRIX_HH 4 #define DUNE_DENSEMATRIX_HH 45 static typename V::size_type size(
const V & v) {
return v.size(); }
48 template<
class K,
int N>
52 static typename V::size_type size(
const V & v)
78 template<
class DenseMatrix,
class RHS >
85 template<
class DenseMatrix,
class RHS,
class =
void >
89 template<
class DenseMatrix,
class RHS >
96 std::fill( denseMatrix.
begin(), denseMatrix.
end(),
static_cast< field_type
>( rhs ) );
100 template<
class DenseMatrix,
class RHS >
102 && std::is_convertible< typename RHS::const_iterator::value_type, typename DenseMatrix::iterator::value_type >::value > >
110 typename RHS::const_iterator sIt = std::begin(rhs);
111 for(; sIt != std::end(rhs); ++tIt, ++sIt)
112 std::copy(std::begin(*sIt), std::end(*sIt), std::begin(*tIt));
120 template<
class DenseMatrix,
class RHS >
122 :
public Impl::DenseMatrixAssigner< DenseMatrix, RHS >
129 template<
class DenseMatrix,
class RHS >
132 std::false_type hasDenseMatrixAssigner ( ... );
136 template<
class DenseMatrix,
class RHS >
137 struct HasDenseMatrixAssigner
138 :
public decltype( Impl::hasDenseMatrixAssigner( std::declval< DenseMatrix & >(), std::declval< const RHS & >() ) )
141 #endif // #ifndef DOXYGEN 158 template<
typename MAT>
164 MAT & asImp() {
return static_cast<MAT&
>(*this); }
165 const MAT & asImp()
const {
return static_cast<const MAT&
>(*this); }
212 row_reference operator[] ( size_type i )
214 return asImp().mat_access(i);
217 const_row_reference operator[] ( size_type i )
const 219 return asImp().mat_access(i);
236 typedef typename std::remove_reference<row_reference>::type::Iterator
ColIterator;
241 return Iterator(*
this,0);
247 return Iterator(*
this,rows());
254 return Iterator(*
this,rows()-1);
261 return Iterator(*
this,-1);
271 typedef typename std::remove_reference<const_row_reference>::type::ConstIterator
ConstColIterator;
276 return ConstIterator(*
this,0);
280 ConstIterator
end ()
const 282 return ConstIterator(*
this,rows());
289 return ConstIterator(*
this,rows()-1);
296 return ConstIterator(*
this,-1);
301 template< class RHS, class = std::enable_if_t< HasDenseMatrixAssigner< MAT, RHS >::value > >
302 derived_type &operator= (
const RHS &rhs )
311 template <
class Other>
315 for (size_type i=0; i<rows(); i++)
321 template <
class Other>
325 for (size_type i=0; i<rows(); i++)
331 derived_type &operator*= (
const field_type& k)
333 for (size_type i=0; i<rows(); i++)
339 derived_type &operator/= (
const field_type& k)
341 for (size_type i=0; i<rows(); i++)
347 template <
class Other>
351 for( size_type i = 0; i < rows(); ++i )
352 (*
this)[ i ].axpy( k, y[ i ] );
357 template <
class Other>
361 for (size_type i=0; i<rows(); i++)
362 if ((*
this)[i]!=y[i])
367 template <
class Other>
377 template<
class X,
class Y>
378 void mv (
const X& x, Y& y)
const 385 for (size_type i=0; i<rows(); ++i)
388 for (size_type j=0; j<cols(); j++)
389 y[i] += (*
this)[i][j] * x[j];
394 template<
class X,
class Y >
395 void mtv (
const X &x, Y &y )
const 402 for(size_type i = 0; i < cols(); ++i)
405 for(size_type j = 0; j < rows(); ++j)
406 y[i] += (*
this)[j][i] * x[j];
411 template<
class X,
class Y>
412 void umv (
const X& x, Y& y)
const 416 for (size_type i=0; i<rows(); i++)
417 for (size_type j=0; j<cols(); j++)
418 y[i] += (*
this)[i][j] * x[j];
422 template<
class X,
class Y>
423 void umtv (
const X& x, Y& y)
const 427 for (size_type i=0; i<rows(); i++)
428 for (size_type j=0; j<cols(); j++)
429 y[j] += (*
this)[i][j]*x[i];
433 template<
class X,
class Y>
434 void umhv (
const X& x, Y& y)
const 438 for (size_type i=0; i<rows(); i++)
439 for (size_type j=0; j<cols(); j++)
444 template<
class X,
class Y>
445 void mmv (
const X& x, Y& y)
const 449 for (size_type i=0; i<rows(); i++)
450 for (size_type j=0; j<cols(); j++)
451 y[i] -= (*
this)[i][j] * x[j];
455 template<
class X,
class Y>
456 void mmtv (
const X& x, Y& y)
const 460 for (size_type i=0; i<rows(); i++)
461 for (size_type j=0; j<cols(); j++)
462 y[j] -= (*
this)[i][j]*x[i];
466 template<
class X,
class Y>
467 void mmhv (
const X& x, Y& y)
const 471 for (size_type i=0; i<rows(); i++)
472 for (size_type j=0; j<cols(); j++)
477 template<
class X,
class Y>
479 const X& x, Y& y)
const 483 for (size_type i=0; i<rows(); i++)
484 for (size_type j=0; j<cols(); j++)
485 y[i] += alpha * (*
this)[i][j] * x[j];
489 template<
class X,
class Y>
491 const X& x, Y& y)
const 495 for (size_type i=0; i<rows(); i++)
496 for (size_type j=0; j<cols(); j++)
497 y[j] += alpha*(*
this)[i][j]*x[i];
501 template<
class X,
class Y>
503 const X& x, Y& y)
const 507 for (size_type i=0; i<rows(); i++)
508 for (size_type j=0; j<cols(); j++)
518 for (size_type i=0; i<rows(); ++i) sum += (*
this)[i].two_norm2();
519 return fvmeta::sqrt(sum);
526 for (size_type i=0; i<rows(); ++i) sum += (*
this)[i].two_norm2();
531 template <
typename vt = value_type,
532 typename std::enable_if<!has_nan<vt>::value,
int>::type = 0>
538 for (
auto const &x : *
this) {
546 template <
typename vt = value_type,
547 typename std::enable_if<!has_nan<vt>::value,
int>::type = 0>
553 for (
auto const &x : *
this) {
561 template <
typename vt = value_type,
562 typename std::enable_if<has_nan<vt>::value,
int>::type = 0>
569 for (
auto const &x : *
this) {
579 template <
typename vt = value_type,
580 typename std::enable_if<has_nan<vt>::value,
int>::type = 0>
587 for (
auto const &x : *
this) {
603 void solve (V& x,
const V& b)
const;
612 field_type determinant ()
const;
615 template<
typename M2>
622 for (size_type i=0; i<rows(); i++)
623 for (size_type j=0; j<cols(); j++) {
625 for (size_type k=0; k<rows(); k++)
626 (*
this)[i][j] += M[i][k]*C[k][j];
633 template<
typename M2>
640 for (size_type i=0; i<rows(); i++)
641 for (size_type j=0; j<cols(); j++) {
643 for (size_type k=0; k<cols(); k++)
644 (*
this)[i][j] += C[i][k]*M[k][j];
656 for (size_type i=0; i<l; i++) {
657 for (size_type j=0; j<cols(); j++) {
659 for (size_type k=0; k<rows(); k++)
660 C[i][j] += M[i][k]*(*
this)[k][j];
672 for (size_type i=0; i<rows(); i++) {
673 for (size_type j=0; j<l; j++) {
675 for (size_type k=0; k<cols(); k++)
676 C[i][j] += (*
this)[i][k]*M[k][j];
700 return asImp().mat_rows();
706 return asImp().mat_cols();
712 bool exists (size_type i, size_type j)
const 726 ElimPivot(std::vector<simd_index_type> & pivot);
728 void swap(std::size_t i, simd_index_type j);
731 void operator()(
const T&,
int,
int)
734 std::vector<simd_index_type> & pivot_;
742 void swap(std::size_t i, simd_index_type j);
744 void operator()(
const typename V::field_type& factor,
int k,
int i);
751 ElimDet(field_type&
sign) : sign_(sign)
754 void swap(std::size_t i, simd_index_type j)
759 void operator()(
const field_type&,
int,
int)
804 template<
class Func,
class Mask>
806 Mask &nonsingularLanes,
bool throwEarly)
const;
810 template<
typename MAT>
814 typedef typename std::vector<size_type>::size_type
size_type;
815 for(size_type i=0; i < pivot_.size(); ++i) pivot_[i]=i;
818 template<
typename MAT>
824 template<
typename MAT>
830 template<
typename MAT>
837 for(std::size_t l = 0; l <
lanes(j); ++l)
842 template<
typename MAT>
847 (*rhs_)[k] -= factor*(*rhs_)[i];
850 template<
typename MAT>
851 template<
typename Func,
class Mask>
854 bool throwEarly)
const 864 real_type singthres =
871 real_type pivmax = fvmeta::absreal(A[i][i]);
872 auto do_pivot = pivmax<pivthres;
875 if (
any_true(do_pivot && nonsingularLanes))
878 simd_index_type imax=i;
881 auto abs = fvmeta::absreal(A[k][i]);
882 auto mask = abs > pivmax && do_pivot;
883 pivmax =
cond(mask, abs, pivmax);
884 imax =
cond(mask, simd_index_type(k), imax);
887 if (
any_true(imax != i && nonsingularLanes)) {
898 for(std::size_t l = 0; l <
lanes(A[i][j]); ++l)
906 nonsingularLanes = nonsingularLanes && !(pivmax<singthres);
924 A[k][j] -= factor*A[i][j];
930 template<
typename MAT>
940 #ifdef DUNE_FMatrix_WITH_CHECKING 941 if (
any_true(fvmeta::absreal((*
this)[0][0])
945 x[0] = b[0]/(*this)[0][0];
948 else if (rows()==2) {
950 field_type detinv = (*this)[0][0]*(*this)[1][1]-(*this)[0][1]*(*this)[1][0];
951 #ifdef DUNE_FMatrix_WITH_CHECKING 952 if (
any_true(fvmeta::absreal(detinv)
958 x[0] = detinv*((*this)[1][1]*b[0]-(*this)[0][1]*b[1]);
959 x[1] = detinv*((*this)[0][0]*b[1]-(*this)[1][0]*b[0]);
962 else if (rows()==3) {
965 #ifdef DUNE_FMatrix_WITH_CHECKING 970 x[0] = (b[0]*(*this)[1][1]*(*this)[2][2] - b[0]*(*this)[2][1]*(*this)[1][2]
971 - b[1] *(*this)[0][1]*(*this)[2][2] + b[1]*(*this)[2][1]*(*this)[0][2]
972 + b[2] *(*this)[0][1]*(*this)[1][2] - b[2]*(*this)[1][1]*(*this)[0][2]) / d;
974 x[1] = ((*this)[0][0]*b[1]*(*this)[2][2] - (*this)[0][0]*b[2]*(*this)[1][2]
975 - (*this)[1][0] *b[0]*(*this)[2][2] + (*this)[1][0]*b[2]*(*this)[0][2]
976 + (*this)[2][0] *b[0]*(*this)[1][2] - (*this)[2][0]*b[1]*(*this)[0][2]) / d;
978 x[2] = ((*this)[0][0]*(*this)[1][1]*b[2] - (*this)[0][0]*(*this)[2][1]*b[1]
979 - (*this)[1][0] *(*this)[0][1]*b[2] + (*this)[1][0]*(*this)[2][1]*b[0]
980 + (*this)[2][0] *(*this)[0][1]*b[1] - (*this)[2][0]*(*this)[1][1]*b[0]) / d;
990 nonsingularLanes(
true);
992 luDecomposition(A, elim, nonsingularLanes,
true);
995 for(
int i=rows()-1; i>=0; i--) {
997 rhs[i] -= A[i][j]*x[j];
998 x[i] = rhs[i]/A[i][i];
1003 template<
typename MAT>
1012 #ifdef DUNE_FMatrix_WITH_CHECKING 1013 if (
any_true(fvmeta::absreal((*
this)[0][0])
1017 (*this)[0][0] =
field_type( 1 ) / (*this)[0][0];
1020 else if (rows()==2) {
1022 field_type detinv = (*this)[0][0]*(*this)[1][1]-(*this)[0][1]*(*this)[1][0];
1023 #ifdef DUNE_FMatrix_WITH_CHECKING 1024 if (
any_true(fvmeta::absreal(detinv)
1031 (*this)[0][0] = (*this)[1][1]*detinv;
1032 (*this)[0][1] = -(*this)[0][1]*detinv;
1033 (*this)[1][0] = -(*this)[1][0]*detinv;
1034 (*this)[1][1] = temp*detinv;
1041 K t4 = (*this)[0][0] * (*this)[1][1];
1042 K t6 = (*this)[0][0] * (*this)[1][2];
1043 K t8 = (*this)[0][1] * (*this)[1][0];
1044 K t10 = (*this)[0][2] * (*this)[1][0];
1045 K t12 = (*this)[0][1] * (*this)[2][0];
1046 K t14 = (*this)[0][2] * (*this)[2][0];
1048 K det = (t4*(*this)[2][2]-t6*(*this)[2][1]-t8*(*this)[2][2]+
1049 t10*(*this)[2][1]+t12*(*this)[1][2]-t14*(*this)[1][1]);
1052 K matrix01 = (*this)[0][1];
1053 K matrix00 = (*this)[0][0];
1054 K matrix10 = (*this)[1][0];
1055 K matrix11 = (*this)[1][1];
1057 (*this)[0][0] = ((*this)[1][1] * (*this)[2][2] - (*this)[1][2] * (*this)[2][1])*t17;
1058 (*this)[0][1] = -((*this)[0][1] * (*this)[2][2] - (*this)[0][2] * (*this)[2][1])*t17;
1059 (*this)[0][2] = (matrix01 * (*this)[1][2] - (*this)[0][2] * (*this)[1][1])*t17;
1060 (*this)[1][0] = -((*this)[1][0] * (*this)[2][2] - (*this)[1][2] * (*this)[2][0])*t17;
1061 (*this)[1][1] = (matrix00 * (*this)[2][2] - t14) * t17;
1062 (*this)[1][2] = -(t6-t10) * t17;
1063 (*this)[2][0] = (matrix10 * (*this)[2][1] - matrix11 * (*this)[2][0]) * t17;
1064 (*this)[2][1] = -(matrix00 * (*this)[2][1] - t12) * t17;
1065 (*this)[2][2] = (t4-t8) * t17;
1070 std::vector<simd_index_type> pivot(rows());
1072 nonsingularLanes(
true);
1073 luDecomposition(A, ElimPivot(pivot), nonsingularLanes,
true);
1087 (*
this)[i][k] -= L[i][j]*(*this)[j][k];
1094 (*
this)[i][k] -= U[i][j]*(*this)[j][k];
1095 (*this)[i][k] /= U[i][i];
1101 for(std::size_t l = 0; l <
lanes((*
this)[0][0]); ++l)
1103 std::size_t pi =
lane(l, pivot[i]);
1107 lane(l, (*
this)[j][ i]));
1114 template<
typename MAT>
1123 return (*
this)[0][0];
1126 return (*
this)[0][0]*(*this)[1][1] - (*this)[0][1]*(*this)[1][0];
1130 field_type t4 = (*this)[0][0] * (*this)[1][1];
1131 field_type t6 = (*this)[0][0] * (*this)[1][2];
1132 field_type t8 = (*this)[0][1] * (*this)[1][0];
1133 field_type t10 = (*this)[0][2] * (*this)[1][0];
1134 field_type t12 = (*this)[0][1] * (*this)[2][0];
1135 field_type t14 = (*this)[0][2] * (*this)[2][0];
1137 return (t4*(*
this)[2][2]-t6*(*
this)[2][1]-t8*(*
this)[2][2]+
1138 t10*(*
this)[2][1]+t12*(*
this)[1][2]-t14*(*
this)[1][1]);
1145 nonsingularLanes(
true);
1147 luDecomposition(A, ElimDet(det), nonsingularLanes,
false);
1157 namespace DenseMatrixHelp {
1160 template <
typename MAT,
typename V1,
typename V2>
1167 for(size_type i=0; i<matrix.
rows(); ++i)
1170 for(size_type j=0; j<matrix.
cols(); ++j)
1172 ret[i] += matrix[i][j]*x[j];
1178 template <
typename K,
int rows,
int cols>
1184 for(size_type i=0; i<cols(); ++i)
1187 for(size_type j=0; j<rows(); ++j)
1188 ret[i] += matrix[j][i]*x[j];
1193 template <
typename K,
int rows,
int cols>
1202 template <
typename K,
int rows,
int cols>
1214 template<
typename MAT>
1215 std::ostream& operator<< (std::ostream& s, const DenseMatrix<MAT>& a)
1218 s << a[i] << std::endl;
std::size_t lanes(const T &)
get the number of lanes of a simd vector (scalar version)
Definition: simd.hh:336
static void multAssign(const DenseMatrix< MAT > &matrix, const DenseVector< V1 > &x, DenseVector< V2 > &ret)
calculates ret = matrix * x
Definition: densematrix.hh:1161
#define DUNE_UNUSED_PARAMETER(parm)
A macro to mark intentionally unused function parameters with.
Definition: unused.hh:25
void solve(V &x, const V &b) const
Solve system A x = b.
T real_type
export the type representing the real type of the field
Definition: ftraits.hh:28
void swap(T &v1, T &v2, bool mask)
Definition: simd.hh:446
Construct a matrix with a dynamic size.
Definition: dynmatrix.hh:29
A dense n x m matrix.
Definition: densematrix.hh:39
ConstIterator beforeBegin() const
Definition: densematrix.hh:294
Iterator begin()
begin iterator
Definition: densematrix.hh:239
Iterator beforeEnd()
Definition: densematrix.hh:252
Iterator end()
end iterator
Definition: densematrix.hh:245
void assign(T &dst, const T &src, bool mask)
masked Simd assignment (scalar version)
Definition: simd.hh:421
MAT & rightmultiply(const DenseMatrix< M2 > &M)
Multiplies M from the right to this matrix.
Definition: densematrix.hh:634
Iterator beforeBegin()
Definition: densematrix.hh:259
size_type size() const
size method
Definition: densevector.hh:297
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:192
void mmv(const X &x, Y &y) const
y -= A x
Definition: densematrix.hh:445
Error thrown if operations of a FieldMatrix fail.
Definition: densematrix.hh:146
Definition of the DUNE_UNUSED macro for the case that config.h is not available.
void mtv(const X &x, Y &y) const
y = A^T x
Definition: densematrix.hh:395
bool exists(size_type i, size_type j) const
return true when (i,j) is in pattern
Definition: densematrix.hh:712
Macro for wrapping boundary checks.
ConstIterator end() const
end iterator
Definition: densematrix.hh:280
bool any_true(const AlignedNumber< bool, align > &val)
Definition: debugalign.hh:403
derived_type & axpy(const field_type &k, const DenseMatrix< Other > &y)
vector space axpy operation (*this += k y)
Definition: densematrix.hh:348
DenseIterator< const DenseMatrix, const row_type, const_row_reference > ConstIterator
Iterator class for sequential access.
Definition: densematrix.hh:265
K conjugateComplex(const K &x)
compute conjugate complex of x
Definition: math.hh:105
Generic iterator class for dense vector and matrix implementations.
Definition: densevector.hh:126
Some useful basic math stuff.
EnableIfInterOperable< T1, T2, bool >::type operator==(const ForwardIteratorFacade< T1, V1, R1, D > &lhs, const ForwardIteratorFacade< T2, V2, R2, D > &rhs)
Checks for equality.
Definition: iteratorfacades.hh:233
Precisions for calculations with FieldMatrix and FieldVector.
Definition: precision.hh:23
void mv(const X &x, Y &y) const
y = A x
Definition: densematrix.hh:378
T lane(std::size_t l, const T &v)
access a lane of a simd vector (scalar version)
Definition: simd.hh:340
Default exception class for mathematical errors.
Definition: exceptions.hh:239
static FieldVector< K, cols > multTransposed(const FieldMatrix< K, rows, cols > &matrix, const FieldVector< K, rows > &x)
calculates ret = matrix^T * x
Definition: fmatrix.hh:505
decltype(auto) apply(F &&f, ArgTuple &&args)
Apply function with arguments given as tuple.
Definition: apply.hh:58
int sign(const T &val)
Return the sign of the value.
Definition: math.hh:121
FieldTraits< value_type >::real_type frobenius_norm() const
frobenius norm: sqrt(sum over squared values of entries)
Definition: densematrix.hh:515
DenseIterator< DenseMatrix, row_type, row_reference > Iterator
Iterator class for sequential access.
Definition: densematrix.hh:230
A free function to provide the demangled class name of a given object or type as a string...
void umhv(const X &x, Y &y) const
y += A^H x
Definition: densematrix.hh:434
std::remove_reference< const_row_reference >::type::ConstIterator ConstColIterator
rename the iterators for easier access
Definition: densematrix.hh:271
void invert()
Compute inverse.
field_type determinant() const
calculates the determinant of this matrix
EnableIfInterOperable< T1, T2, bool >::type operator!=(const ForwardIteratorFacade< T1, V1, R1, D > &lhs, const ForwardIteratorFacade< T2, V2, R2, D > &rhs)
Checks for inequality.
Definition: iteratorfacades.hh:255
K value_type
Definition: dynmatrix.hh:42
you have to specialize this structure for any type that should be assignable to a DenseMatrix ...
Definition: densematrix.hh:79
size_type size() const
size method (number of rows)
Definition: densematrix.hh:223
FieldTraits< vt >::real_type infinity_norm_real() const
simplified infinity norm (uses Manhattan norm for complex values)
Definition: densematrix.hh:548
FieldTraits< value_type >::real_type frobenius_norm2() const
square of frobenius norm, need for block recursion
Definition: densematrix.hh:523
#define DUNE_ASSERT_BOUNDS(cond)
If DUNE_CHECK_BOUNDS is defined: check if condition cond holds; otherwise, do nothing.
Definition: boundschecking.hh:28
vector space out of a tensor product of fields.
Definition: densematrix.hh:40
void mmhv(const X &x, Y &y) const
y -= A^H x
Definition: densematrix.hh:467
A few common exception classes.
ConstIterator beforeEnd() const
Definition: densematrix.hh:287
Dune namespace.
Definition: alignedallocator.hh:9
typename SimdScalarTypeTraits< T >::type SimdScalar
Definition: simd.hh:188
bool all_true(const AlignedNumber< bool, align > &val)
Definition: debugalign.hh:409
void usmhv(const typename FieldTraits< Y >::field_type &alpha, const X &x, Y &y) const
y += alpha A^H x
Definition: densematrix.hh:502
const FieldTraits< typename DenseMatVecTraits< M >::value_type >::field_type field_type
Definition: densematrix.hh:31
typename SimdMaskTypeTraits< V >::type SimdMask
A simd vector of truth values corresponding to a simd vector V.
Definition: simd.hh:244
Definition: ftraits.hh:23
Interface for a class of dense vectors over a given field.
Definition: densevector.hh:19
Definition: matvectraits.hh:29
void mmtv(const X &x, Y &y) const
y -= A^T x
Definition: densematrix.hh:456
void usmv(const typename FieldTraits< Y >::field_type &alpha, const X &x, Y &y) const
y += alpha A x
Definition: densematrix.hh:478
static FieldVector< K, rows > mult(const FieldMatrix< K, rows, cols > &matrix, const FieldVector< K, cols > &x)
calculates ret = matrix * x
Definition: fmatrix.hh:496
Traits::row_type row_type
The type used to represent a row (must fulfill the Dune::DenseVector interface)
Definition: densematrix.hh:186
container_type::size_type size_type
Definition: dynmatrix.hh:43
Implements a vector constructed from a given type representing a field and a compile-time given size...
void umtv(const X &x, Y &y) const
y += A^T x
Definition: densematrix.hh:423
void usmtv(const typename FieldTraits< Y >::field_type &alpha, const X &x, Y &y) const
y += alpha A^T x
Definition: densematrix.hh:490
size_type N() const
number of rows
Definition: densematrix.hh:686
typename SimdIndexTypeTraits< V >::type SimdIndex
An simd vector of indices corresponding to a simd vector V.
Definition: simd.hh:220
T field_type
export the type representing the field
Definition: ftraits.hh:26
FieldTraits< vt >::real_type infinity_norm() const
infinity norm (row sum norm, how to generalize for blocks?)
Definition: densematrix.hh:533
Traits::row_reference row_reference
The type used to represent a reference to a row (usually row_type &)
Definition: densematrix.hh:189
MAT & leftmultiply(const DenseMatrix< M2 > &M)
Multiplies M from the left to this matrix.
Definition: densematrix.hh:616
static void multAssignTransposed(const FieldMatrix< K, rows, cols > &matrix, const FieldVector< K, rows > &x, FieldVector< K, cols > &ret)
calculates ret = matrix^T * x
Definition: fmatrix.hh:482
Base::size_type size_type
Definition: fmatrix.hh:81
Traits::value_type block_type
export the type representing the components
Definition: densematrix.hh:180
size_type cols() const
number of columns
Definition: densematrix.hh:704
ConstIterator begin() const
begin iterator
Definition: densematrix.hh:274
Various precision settings for calculations with FieldMatrix and FieldVector.
Traits::size_type size_type
The type used for the index access and size operation.
Definition: densematrix.hh:183
Iterator RowIterator
rename the iterators for easier access
Definition: densematrix.hh:234
const T1 cond(bool b, const T1 &v1, const T2 &v2)
conditional evaluate
Definition: conditional.hh:26
const FieldTraits< typename DenseMatVecTraits< M >::value_type >::real_type real_type
Definition: densematrix.hh:32
Traits for type conversions and type information.
std::remove_reference< row_reference >::type::Iterator ColIterator
rename the iterators for easier access
Definition: densematrix.hh:236
ConstIterator ConstRowIterator
rename the iterators for easier access
Definition: densematrix.hh:269
Traits::derived_type derived_type
type of derived matrix class
Definition: densematrix.hh:171
#define DUNE_THROW(E, m)
Definition: exceptions.hh:216
Traits::value_type field_type
export the type representing the field
Definition: densematrix.hh:177
void umv(const X &x, Y &y) const
y += A x
Definition: densematrix.hh:412
ConstIterator const_iterator
typedef for stl compliant access
Definition: densematrix.hh:267
size_type M() const
number of columns
Definition: densematrix.hh:692
Iterator iterator
typedef for stl compliant access
Definition: densematrix.hh:232
Traits::value_type value_type
export the type representing the field
Definition: densematrix.hh:174
size_type rows() const
number of rows
Definition: densematrix.hh:698
A dense n x m matrix.
Definition: densematrix.hh:26