13 #if !defined(KRATOS_AMATRIX_INTERFACE_H_INCLUDED )
14 #define KRATOS_AMATRIX_INTERFACE_H_INCLUDED
38 template <
typename TDataType, std::
size_t TSize1, std::
size_t TSize2>
39 class Matrix :
public AMatrix::MatrixExpression<Matrix<TDataType, TSize1, TSize2>,
40 AMatrix::row_major_access>,
41 public AMatrix::MatrixStorage<TDataType, TSize1, TSize2> {
44 using base_type = AMatrix::MatrixStorage<TDataType, TSize1, TSize2>;
47 using base_type::size;
48 using base_type::size1;
49 using base_type::size2;
52 using iterator = AMatrix::RandomAccessIterator<TDataType>;
67 explicit Matrix(std::size_t TheSize1, std::size_t TheSize2)
77 template <
typename TExpressionType, std::
size_t TCategory>
78 Matrix(AMatrix::MatrixExpression<TExpressionType, TCategory>
const& Other)
81 template <
typename TExpressionType>
82 Matrix(AMatrix::MatrixExpression<TExpressionType, AMatrix::row_major_access>
const& Other)
88 explicit Matrix(std::initializer_list<TDataType> InitialValues)
91 template <
typename TExpressionType, std::
size_t TCategory>
93 AMatrix::MatrixExpression<TExpressionType, TCategory>
const& Other) {
99 template <
typename TExpressionType>
101 AMatrix::MatrixExpression<TExpressionType, AMatrix::row_major_access>
const& Other) {
128 if( First.size1() != Second.size1() ||
129 First.size2() != Second.size2()) {
133 for (std::size_t
i = 0;
i < First.size();
i++)
134 if (First._data[
i] != Second._data[
i])
139 template <
typename TExpressionType, std::
size_t TCategory>
141 AMatrix::MatrixExpression<TExpressionType, TCategory>
const& Other) {
143 this->expression().size1() != Other.expression().size1() || this->expression().size2() != Other.expression().size2())
144 <<
"Size mismatch in Matrix operator+=" << std::endl
145 <<
"LHS has size (" << this->expression().size1() <<
"," << this->expression().size2() <<
"), RHS has size ("
146 << Other.expression().size1() <<
"," << Other.expression().size2() <<
")." << std::endl;
150 for (std::size_t
i = 0;
i < size1();
i++)
151 for (std::size_t
j = 0;
j < size2();
j++)
152 at(
i,
j) += Other.expression()(
i,
j);
157 template <
typename TExpressionType>
159 AMatrix::MatrixExpression<TExpressionType, AMatrix::row_major_access>
const& Other) {
161 this->expression().size1() != Other.expression().size1() || this->expression().size2() != Other.expression().size2())
162 <<
"Size mismatch in Matrix operator+=" << std::endl
163 <<
"LHS has size (" << this->expression().size1() <<
"," << this->expression().size2() <<
"), RHS has size ("
164 << Other.expression().size1() <<
"," << Other.expression().size2() <<
")." << std::endl;
166 for (std::size_t
i = 0;
i < size();
i++)
167 at(
i) += Other.expression()[
i];
172 template <
typename TExpressionType, std::
size_t TCategory>
174 AMatrix::MatrixExpression<TExpressionType, TCategory>
const& Other) {
176 this->expression().size1() != Other.expression().size1() || this->expression().size2() != Other.expression().size2())
177 <<
"Size mismatch in Matrix operator-=" << std::endl
178 <<
"LHS has size (" << this->expression().size1() <<
"," << this->expression().size2() <<
"), RHS has size ("
179 << Other.expression().size1() <<
"," << Other.expression().size2() <<
")." << std::endl;
183 for (std::size_t
i = 0;
i < size1();
i++)
184 for (std::size_t
j = 0;
j < size2();
j++)
185 at(
i,
j) -= Other.expression()(
i,
j);
190 template <
typename TExpressionType>
192 AMatrix::MatrixExpression<TExpressionType, AMatrix::row_major_access>
const& Other) {
194 this->expression().size1() != Other.expression().size1() || this->expression().size2() != Other.expression().size2())
195 <<
"Size mismatch in Matrix operator-=" << std::endl
196 <<
"LHS has size (" << this->expression().size1() <<
"," << this->expression().size2() <<
"), RHS has size ("
197 << Other.expression().size1() <<
"," << Other.expression().size2() <<
")." << std::endl;
199 for (std::size_t
i = 0;
i < size();
i++)
200 at(
i) -= Other.expression()[
i];
206 for (std::size_t
i = 0;
i < size();
i++)
213 auto inverse_of_value = 1.00 / TheValue;
214 for (std::size_t
i = 0;
i < size();
i++)
215 at(
i) *= inverse_of_value;
220 AMatrix::MatrixUnaryMinusExpression<Matrix>
operator-()
const {
221 return AMatrix::MatrixUnaryMinusExpression<Matrix>(*
this);
224 void resize(std::size_t NewSize1, std::size_t NewSize2,
bool preserve = 0){
227 base_type::resize(NewSize1,NewSize2);
230 void resize(std::size_t NewSize,
bool preserve = 0){
232 base_type::resize(NewSize);
235 void resize(std::size_t NewSize, TDataType
const& TheValue){
236 base_type::resize(NewSize);
237 for (std::size_t
i = 0;
i < size();
i++)
249 template <
typename TExpressionType>
251 AMatrix::MatrixExpression<TExpressionType, AMatrix::row_major_access>
const& Other)
254 for (std::size_t
i = 0;
i < size(); ++
i) {
255 result += at(
i) * Other.expression()[
i];
265 auto the_norm =
norm();
266 if (the_norm > std::numeric_limits<data_type>::epsilon()) {
267 const auto norm_inverse = 1.0 / the_norm;
268 for (std::size_t
i = 0;
i < size(); ++
i) {
269 at(
i) *= norm_inverse;
276 AMatrix::TransposeMatrix<const Matrix<TDataType, TSize1, TSize2>>
transpose()
const {
277 return AMatrix::TransposeMatrix<const Matrix<TDataType, TSize1, TSize2>>(*this);
280 AMatrix::TransposeMatrix<Matrix<TDataType, TSize1, TSize2>>
transpose() {
281 return AMatrix::TransposeMatrix<Matrix<TDataType, TSize1, TSize2>>(*this);
285 for (std::size_t
i = 0;
i < size();
i++)
290 base_type::swap(Other);
295 bool check1 = ((From <=
data()) && (
data() < To));
296 bool check2 = ((From < end_pointer) && (end_pointer < To));
297 bool check3 = ((From >
data()) && (To <= end_pointer));
299 return (check1 || check2 || check3);
303 for (std::size_t
i = 0;
i < size();
i++)
309 KRATOS_ERROR_IF(size1() != size2()) <<
"fill_identity is only supported for square matrices." << std::endl;
311 const std::size_t next_diagonal = size1() + 1;
312 for (std::size_t
i = 0;
i < size();
i += next_diagonal)
319 template <
typename TDataType, std::
size_t TSize1, std::
size_t TSize2>
322 return !(First == Second);
328 template <
typename TExpressionType, std::
size_t TCategory>
330 AMatrix::MatrixExpression<TExpressionType, TCategory>
const& TheMatrix) {
331 TExpressionType
const& the_expression = TheMatrix.expression();
332 if ((the_expression.size1() == 1) || (the_expression.size2() == 1)) {
333 const std::size_t size = the_expression.size();
334 rOStream <<
"[" << size <<
"](";
336 rOStream << the_expression[0];
337 for (std::size_t
i = 1;
i < size;
i++) {
338 rOStream <<
"," << the_expression[
i];
344 const std::size_t size2 = the_expression.size2();
345 rOStream <<
"[" << the_expression.size1() <<
"," << the_expression.size2() <<
"](";
346 if (the_expression.size1() > 0) {
349 rOStream << the_expression(0, 0);
350 for (std::size_t
j = 1;
j < size2;
j++) {
351 rOStream <<
"," << the_expression(0,
j);
355 for (std::size_t
i = 1;
i < the_expression.size1();
i++) {
358 rOStream << the_expression(
i, 0);
359 for (std::size_t
j = 1;
j < size2;
j++) {
360 rOStream <<
"," << the_expression(
i,
j);
372 template <
typename TDataType, std::
size_t TSize1, std::
size_t TSize2>
394 TheMatrix.
resize(size1, size2);
399 for (std::size_t
i = 0;
i < size1;
i++) {
407 for (std::size_t
j = 0;
j < size2;
j++) {
412 rIStream >> TheMatrix(
i,
j);
428 template <
typename TDataType, std::
size_t TSize1>
450 for (std::size_t
i = 0;
i < size1;
i++) {
455 rIStream >> TheMatrix[
i];
484 template <
typename T> T&
noalias(T& TheMatrix){
return TheMatrix;}
486 template <
typename T> AMatrix::TransposeMatrix<const T>
trans(
const T& TheMatrix){
return AMatrix::TransposeMatrix<const T>(TheMatrix);}
488 template <
typename T> AMatrix::TransposeMatrix<T>
trans(T& TheMatrix){
return AMatrix::TransposeMatrix<T>(TheMatrix); }
490 template <
typename TExpressionType>
using vector_expression = AMatrix::MatrixExpression<TExpressionType,AMatrix::row_major_access>;
492 template <
typename TExpressionType>
using MatrixRow = AMatrix::MatrixRow<TExpressionType>;
495 template <
typename TDataType>
497 :
public AMatrix::MatrixExpression<KratosZeroMatrix<TDataType>, AMatrix::row_major_access> {
515 inline TDataType
operator[](std::size_t
i)
const {
return TDataType(); }
517 inline std::size_t
size1()
const {
return _size1; }
518 inline std::size_t
size2()
const {
return _size2; }
520 inline std::size_t
size()
const {
return _size1 * _size2; }
528 template <
typename TDataType>
530 :
public AMatrix::MatrixExpression<KratosZeroVector<TDataType>, AMatrix::row_major_access> {
547 inline TDataType
operator[](std::size_t
i)
const {
return TDataType(); }
549 inline std::size_t
size1()
const {
return _size1; }
550 inline std::size_t
size2()
const {
return 1; }
552 inline std::size_t
size()
const {
return _size1; }
566 template <
typename TExpression1Type,
typename TExpression2Type,
567 std::size_t TCategory1, std::size_t TCategory2>
568 AMatrix::MatrixProductExpression<TExpression1Type, TExpression2Type>
prod(
569 AMatrix::MatrixExpression<TExpression1Type, TCategory1>
const& First,
570 AMatrix::MatrixExpression<TExpression2Type, TCategory2>
const& Second) {
572 <<
"Size mismatch in AMatrix prod." << std::endl
573 <<
"Argument sizes are (" << First.expression().size1() <<
"," << First.expression().size2() <<
") and ("
574 << Second.expression().size1() <<
"," << Second.expression().size2() <<
")." << std::endl;
576 return AMatrix::MatrixProductExpression<TExpression1Type, TExpression2Type>(
577 First.expression(), Second.expression());
580 template <
typename TExpression1Type,
typename TExpression2Type,
581 std::size_t TCategory1, std::size_t TCategory2>
582 AMatrix::VectorOuterProductExpression<TExpression1Type, TExpression2Type>
outer_prod(
583 AMatrix::MatrixExpression<TExpression1Type, TCategory1>
const& First,
584 AMatrix::MatrixExpression<TExpression2Type, TCategory2>
const& Second) {
586 return AMatrix::VectorOuterProductExpression<TExpression1Type, TExpression2Type>(
587 First.expression(), Second.expression());
590 template <
typename TExpression1Type,
typename TExpression2Type,
591 std::size_t TCategory1, std::size_t TCategory2>
593 AMatrix::MatrixExpression<TExpression1Type, TCategory1>
const& First,
594 AMatrix::MatrixExpression<TExpression2Type, TCategory2>
const& Second) {
596 <<
"Size mismatch in AMatrix inner_prod." << std::endl
597 <<
"Argument sizes are " << First.expression().size() <<
" and "
598 << Second.expression().size() <<
"." << std::endl
599 <<
"Both vectors should have the same size." << std::endl;
601 using data_type =
typename TExpression1Type::data_type;
602 auto& the_expression1 = First.expression();
603 auto& the_expression2 = Second.expression();
604 data_type result = data_type();
605 for (std::size_t
i = 0;
i < the_expression1.size(); ++
i) {
606 result += the_expression1[
i] * the_expression2[
i];
612 template <
typename TExpressionType, std::
size_t TCategory>
613 typename TExpressionType::data_type
norm_1(
614 AMatrix::MatrixExpression<TExpressionType, TCategory>
const& TheExpression) {
615 using data_type =
typename TExpressionType::data_type;
616 auto& the_expression = TheExpression.expression();
617 data_type result = data_type();
618 for (std::size_t
i = 0;
i < the_expression.size(); ++
i) {
619 result += std::abs(the_expression[
i]);
624 template <
typename TExpressionType, std::
size_t TCategory>
625 typename TExpressionType::data_type
norm_2(
626 AMatrix::MatrixExpression<TExpressionType, TCategory>
const& TheExpression) {
627 using data_type =
typename TExpressionType::data_type;
628 auto& the_expression = TheExpression.expression();
629 data_type result = data_type();
630 for (std::size_t
i = 0;
i < the_expression.size(); ++
i) {
631 result += the_expression[
i] * the_expression[
i];
633 return std::sqrt(result);
636 template <
typename TExpressionType, std::
size_t TCategory>
637 AMatrix::MatrixColumn<const TExpressionType>
column(
638 AMatrix::MatrixExpression<TExpressionType, TCategory>
const& TheExpression, std::size_t ColumnIndex) {
639 return AMatrix::MatrixColumn<const TExpressionType>(TheExpression.expression(), ColumnIndex);
642 template <
typename TExpressionType, std::
size_t TCategory>
643 AMatrix::MatrixColumn<TExpressionType>
column(
644 AMatrix::MatrixExpression<TExpressionType, TCategory>& TheExpression, std::size_t ColumnIndex) {
645 return AMatrix::MatrixColumn<TExpressionType>(TheExpression.expression(), ColumnIndex);
648 template <
typename TExpressionType, std::
size_t TCategory>
649 AMatrix::MatrixRow<const TExpressionType>
row(
650 AMatrix::MatrixExpression<TExpressionType, TCategory>
const& TheExpression, std::size_t RowIndex) {
651 return AMatrix::MatrixRow<const TExpressionType>(TheExpression.expression(), RowIndex);
655 template <
typename TExpressionType, std::
size_t TCategory>
656 AMatrix::MatrixRow<TExpressionType>
row(
657 AMatrix::MatrixExpression<TExpressionType, TCategory>& TheExpression, std::size_t RowIndex) {
658 return AMatrix::MatrixRow<TExpressionType>(TheExpression.expression(), RowIndex);
661 template <
typename TExpressionType, std::
size_t TCategory>
662 AMatrix::SubVector<const TExpressionType>
subrange(
663 AMatrix::MatrixExpression<TExpressionType, TCategory>
const& TheExpression, std::size_t From, std::size_t To) {
664 return AMatrix::SubVector<const TExpressionType>(TheExpression.expression(), From,To - From);
667 template <
typename TExpressionType, std::
size_t TCategory>
669 AMatrix::MatrixExpression<TExpressionType, TCategory>& TheExpression, std::size_t From, std::size_t To) {
670 return AMatrix::SubVector<TExpressionType>(TheExpression.expression(), From,To - From);
674 template <
typename TExpressionType, std::
size_t TCategory>
675 typename TExpressionType::data_type
sum(
676 AMatrix::MatrixExpression<TExpressionType, TCategory>
const& TheExpression) {
677 using data_type =
typename TExpressionType::data_type;
678 auto& the_expression = TheExpression.expression();
679 data_type result = data_type();
680 for (std::size_t
i = 0;
i < the_expression.size(); ++
i) {
681 result += the_expression[
i];
686 template <
typename TExpressionType, std::
size_t TCategory>
688 AMatrix::MatrixExpression<TExpressionType, TCategory>
const& TheExpression) {
689 using data_type =
typename TExpressionType::data_type;
690 auto& the_expression = TheExpression.expression();
691 data_type result = data_type();
692 for (std::size_t
i = 0;
i < the_expression.size(); ++
i) {
693 result += the_expression[
i] * the_expression[
i];
695 return std::sqrt(result);
699 template <
typename TDataType>
701 :
public AMatrix::MatrixExpression<scalar_matrix<TDataType>, AMatrix::row_major_access> {
704 const TDataType _value;
712 : _size1(
Size1), _size2(
Size2), _value(Value) {}
718 inline TDataType
operator[](std::size_t
i)
const {
return _value; }
720 inline std::size_t
size1()
const {
return _size1; }
721 inline std::size_t
size2()
const {
return _size2; }
731 template <
typename TExpressionType,
typename TIndicesVectorType>
732 class PermutationMatrix :
public AMatrix::MatrixExpression<PermutationMatrix<TExpressionType, TIndicesVectorType>, AMatrix::unordered_access> {
733 TExpressionType& _original_expression;
734 TIndicesVectorType
const& _permutation_indices_i;
735 TIndicesVectorType
const& _permutation_indices_j;
742 : _original_expression(Original),
743 _permutation_indices_i(PermutaionIndices),
744 _permutation_indices_j(PermutaionIndices) {}
746 PermutationMatrix(TExpressionType& Original, TIndicesVectorType
const& PermutaionIndicesI, TIndicesVectorType
const& PermutaionIndicesJ)
747 : _original_expression(Original),
748 _permutation_indices_i(PermutaionIndicesI),
749 _permutation_indices_j(PermutaionIndicesJ) {}
752 return _original_expression(_permutation_indices_i[
i], _permutation_indices_j[
j]);
756 return _original_expression(_permutation_indices_i[
i], _permutation_indices_j[
j]);
760 inline std::size_t
size1()
const {
return _permutation_indices_i.size(); }
761 inline std::size_t
size2()
const {
return _permutation_indices_j.size(); }
764 return _original_expression.check_aliasing(From, To);
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
Definition: amatrix_interface.h:41
TDataType & operator()(std::size_t i)
Definition: amatrix_interface.h:122
void resize(std::size_t NewSize, TDataType const &TheValue)
Definition: amatrix_interface.h:235
void swap(Matrix &Other)
Definition: amatrix_interface.h:289
AMatrix::TransposeMatrix< Matrix< TDataType, TSize1, TSize2 > > transpose()
Definition: amatrix_interface.h:280
Matrix()
Definition: amatrix_interface.h:65
TDataType data_type
Definition: amatrix_interface.h:43
data_type dot(AMatrix::MatrixExpression< TExpressionType, AMatrix::row_major_access > const &Other) const
Definition: amatrix_interface.h:250
data_type norm() const
Definition: amatrix_interface.h:262
AMatrix::TransposeMatrix< const Matrix< TDataType, TSize1, TSize2 > > transpose() const
Definition: amatrix_interface.h:276
void resize(std::size_t NewSize1, std::size_t NewSize2, bool preserve=0)
Definition: amatrix_interface.h:224
Matrix & operator-=(AMatrix::MatrixExpression< TExpressionType, TCategory > const &Other)
Definition: amatrix_interface.h:173
Matrix(std::size_t TheSize)
Definition: amatrix_interface.h:70
Matrix & operator+=(AMatrix::MatrixExpression< TExpressionType, AMatrix::row_major_access > const &Other)
Definition: amatrix_interface.h:158
Matrix & operator=(AMatrix::MatrixExpression< TExpressionType, TCategory > const &Other)
Definition: amatrix_interface.h:92
TDataType * pointer
Definition: amatrix_interface.h:62
bool check_aliasing(const data_type *From, const data_type *To) const
Definition: amatrix_interface.h:293
std::size_t difference_type
Definition: amatrix_interface.h:58
Matrix & operator=(AMatrix::MatrixExpression< TExpressionType, AMatrix::row_major_access > const &Other)
Definition: amatrix_interface.h:100
Matrix & operator*=(data_type TheValue)
Definition: amatrix_interface.h:205
iterator end()
Definition: amatrix_interface.h:243
Matrix(Matrix const &Other)
Definition: amatrix_interface.h:73
void fill(data_type const &value)
Definition: amatrix_interface.h:302
TDataType * const_pointer
Definition: amatrix_interface.h:61
Matrix & noalias()
Definition: amatrix_interface.h:274
AMatrix::RandomAccessIterator< TDataType > iterator
Definition: amatrix_interface.h:52
Matrix(AMatrix::MatrixExpression< TExpressionType, TCategory > const &Other)
Definition: amatrix_interface.h:78
void fill_identity()
Definition: amatrix_interface.h:308
Matrix(std::size_t TheSize1, std::size_t TheSize2)
Definition: amatrix_interface.h:67
TDataType & reference
Definition: amatrix_interface.h:60
const_iterator end() const
Definition: amatrix_interface.h:247
Matrix(AMatrix::MatrixExpression< TExpressionType, AMatrix::row_major_access > const &Other)
Definition: amatrix_interface.h:82
void normalize()
Definition: amatrix_interface.h:264
void clear()
Definition: amatrix_interface.h:284
void resize(std::size_t NewSize, bool preserve=0)
Definition: amatrix_interface.h:230
TDataType const & operator()(std::size_t i) const
Definition: amatrix_interface.h:124
iterator begin()
Definition: amatrix_interface.h:241
Matrix & operator+=(AMatrix::MatrixExpression< TExpressionType, TCategory > const &Other)
Definition: amatrix_interface.h:140
AMatrix::MatrixUnaryMinusExpression< Matrix > operator-() const
Definition: amatrix_interface.h:220
AMatrix::MatrixStorage< TDataType, TSize1, TSize2 > base_type
Definition: amatrix_interface.h:44
Matrix & operator/=(data_type TheValue)
Definition: amatrix_interface.h:212
const_iterator begin() const
Definition: amatrix_interface.h:245
data_type squared_norm() const
Definition: amatrix_interface.h:260
TDataType value_type
Definition: amatrix_interface.h:56
AMatrix::RandomAccessIterator< const TDataType > const_iterator
Definition: amatrix_interface.h:53
const TDataType & const_reference
Definition: amatrix_interface.h:59
Matrix & operator=(Matrix const &Other)
Definition: amatrix_interface.h:112
friend bool operator==(Matrix const &First, Matrix const &Second)
Definition: amatrix_interface.h:126
Matrix & operator=(Matrix &&Other)
Definition: amatrix_interface.h:117
Matrix(std::initializer_list< TDataType > InitialValues)
Definition: amatrix_interface.h:88
Matrix & operator-=(AMatrix::MatrixExpression< TExpressionType, AMatrix::row_major_access > const &Other)
Definition: amatrix_interface.h:191
std::size_t size_type
Definition: amatrix_interface.h:57
Matrix(Matrix &&Other)
Definition: amatrix_interface.h:75
Definition: amatrix_interface.h:497
TDataType operator[](std::size_t i) const
Definition: amatrix_interface.h:515
std::size_t size1() const
Definition: amatrix_interface.h:517
std::size_t size2() const
Definition: amatrix_interface.h:518
bool check_aliasing(const data_type *From, const data_type *To) const
Definition: amatrix_interface.h:522
TDataType data_type
Definition: amatrix_interface.h:502
KratosZeroMatrix()=delete
std::size_t size() const
Definition: amatrix_interface.h:520
KratosZeroMatrix(std::size_t Size1, std::size_t Size2)
Definition: amatrix_interface.h:508
TDataType operator()(std::size_t i, std::size_t j) const
Definition: amatrix_interface.h:511
KratosZeroMatrix(std::size_t Size)=delete
Definition: amatrix_interface.h:530
bool check_aliasing(const data_type *From, const data_type *To) const
Definition: amatrix_interface.h:554
TDataType data_type
Definition: amatrix_interface.h:534
std::size_t size1() const
Definition: amatrix_interface.h:549
TDataType operator[](std::size_t i) const
Definition: amatrix_interface.h:547
TDataType operator()(std::size_t i, std::size_t j) const
Definition: amatrix_interface.h:543
KratosZeroVector(std::size_t Size)
Definition: amatrix_interface.h:538
KratosZeroVector(std::size_t Size1, std::size_t Size2)=delete
KratosZeroVector()=delete
std::size_t size2() const
Definition: amatrix_interface.h:550
std::size_t size() const
Definition: amatrix_interface.h:552
Definition: amatrix_interface.h:732
std::size_t size1() const
Definition: amatrix_interface.h:760
data_type & operator()(std::size_t i, std::size_t j)
Definition: amatrix_interface.h:755
typename TExpressionType::data_type data_type
Definition: amatrix_interface.h:737
data_type const & operator()(std::size_t i, std::size_t j) const
Definition: amatrix_interface.h:751
PermutationMatrix(TExpressionType &Original, TIndicesVectorType const &PermutaionIndices)
Definition: amatrix_interface.h:741
std::size_t size2() const
Definition: amatrix_interface.h:761
bool check_aliasing(const data_type *From, const data_type *To) const
Definition: amatrix_interface.h:763
typename TExpressionType::data_type value_type
Definition: amatrix_interface.h:738
std::size_t size() const
Definition: amatrix_interface.h:759
PermutationMatrix()=delete
PermutationMatrix(TExpressionType &Original, TIndicesVectorType const &PermutaionIndicesI, TIndicesVectorType const &PermutaionIndicesJ)
Definition: amatrix_interface.h:746
Definition: amatrix_interface.h:701
TDataType operator[](std::size_t i) const
Definition: amatrix_interface.h:718
std::size_t size2() const
Definition: amatrix_interface.h:721
TDataType data_type
Definition: amatrix_interface.h:707
std::size_t size1() const
Definition: amatrix_interface.h:720
scalar_matrix(std::size_t Size1, std::size_t Size2, TDataType const &Value)
Definition: amatrix_interface.h:711
TDataType operator()(std::size_t i, std::size_t j) const
Definition: amatrix_interface.h:714
bool check_aliasing(const data_type *From, const data_type *To) const
Definition: amatrix_interface.h:723
#define KRATOS_ERROR_IF(conditional)
Definition: exception.h:162
#define KRATOS_DEBUG_ERROR_IF(conditional)
Definition: exception.h:171
#define KRATOS_DEBUG_CHECK(IsTrue)
Definition: checks.h:214
std::istream & operator>>(std::istream &rIStream, Matrix< TDataType, TSize1, TSize2 > &TheMatrix)
Definition: amatrix_interface.h:373
std::ostream & operator<<(std::ostream &rOStream, AMatrix::MatrixExpression< TExpressionType, TCategory > const &TheMatrix)
Definition: amatrix_interface.h:329
bool operator!=(Matrix< TDataType, TSize1, TSize2 > const &First, Matrix< TDataType, TSize1, TSize2 > const &Second)
Definition: amatrix_interface.h:320
TSpaceType::IndexType Size1(TSpaceType &dummy, typename TSpaceType::MatrixType const &rM)
Definition: add_strategies_to_python.cpp:117
TSpaceType::IndexType Size2(TSpaceType &dummy, typename TSpaceType::MatrixType const &rM)
Definition: add_strategies_to_python.cpp:123
TSpaceType::IndexType Size(TSpaceType &dummy, typename TSpaceType::VectorType const &rV)
Definition: add_strategies_to_python.cpp:111
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
TExpressionType::data_type norm_2(AMatrix::MatrixExpression< TExpressionType, TCategory > const &TheExpression)
Definition: amatrix_interface.h:625
Kratos::PeriodicInterfaceProcess Process operator(std::istream &rIStream, PeriodicInterfaceProcess &rThis)
input stream function
AMatrix::IdentityMatrix< double > IdentityMatrix
Definition: amatrix_interface.h:564
TExpressionType::data_type norm_1(AMatrix::MatrixExpression< TExpressionType, TCategory > const &TheExpression)
Definition: amatrix_interface.h:613
AMatrix::MatrixRow< TExpressionType > MatrixRow
Definition: amatrix_interface.h:492
AMatrix::MatrixProductExpression< TExpression1Type, TExpression2Type > prod(AMatrix::MatrixExpression< TExpression1Type, TCategory1 > const &First, AMatrix::MatrixExpression< TExpression2Type, TCategory2 > const &Second)
Definition: amatrix_interface.h:568
TExpression1Type::data_type inner_prod(AMatrix::MatrixExpression< TExpression1Type, TCategory1 > const &First, AMatrix::MatrixExpression< TExpression2Type, TCategory2 > const &Second)
Definition: amatrix_interface.h:592
TExpressionType::data_type sum(AMatrix::MatrixExpression< TExpressionType, TCategory > const &TheExpression)
Definition: amatrix_interface.h:675
AMatrix::VectorOuterProductExpression< TExpression1Type, TExpression2Type > outer_prod(AMatrix::MatrixExpression< TExpression1Type, TCategory1 > const &First, AMatrix::MatrixExpression< TExpression2Type, TCategory2 > const &Second)
Definition: amatrix_interface.h:582
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
AMatrix::MatrixRow< const TExpressionType > row(AMatrix::MatrixExpression< TExpressionType, TCategory > const &TheExpression, std::size_t RowIndex)
Definition: amatrix_interface.h:649
AMatrix::MatrixExpression< TExpressionType, AMatrix::row_major_access > vector_expression
Definition: amatrix_interface.h:490
AMatrix::TransposeMatrix< const T > trans(const T &TheMatrix)
Definition: amatrix_interface.h:486
AMatrix::MatrixColumn< const TExpressionType > column(AMatrix::MatrixExpression< TExpressionType, TCategory > const &TheExpression, std::size_t ColumnIndex)
Definition: amatrix_interface.h:637
TExpressionType::data_type norm_frobenius(AMatrix::MatrixExpression< TExpressionType, TCategory > const &TheExpression)
Definition: amatrix_interface.h:687
AMatrix::SubVector< const TExpressionType > subrange(AMatrix::MatrixExpression< TExpressionType, TCategory > const &TheExpression, std::size_t From, std::size_t To)
Definition: amatrix_interface.h:662
c
Definition: generate_weakly_compressible_navier_stokes_element.py:108
data
Definition: mesh_to_mdpa_converter.py:59
int j
Definition: quadrature.py:648
integer i
Definition: TensorModule.f:17