ENH: improvements, modernization of matrix containers (#1220)

- add iterators, begin/end, empty() methods for STL behaviour.
  Use standard algorithms where possible
     * std::fill, std::copy
     * std::min_element, std::max_element

- access methods consistent with other OpenFOAM containers:
     * data(), cdata(), uniform()

- Use ListPolicy to impose output line breaks

- Can recover matrix storage for re-use elsewhere.
  For example, to populate values with 2D i-j addressing and later
  release it as flat linear storage.

- construct/assign moveable

- added minMax() function for Matrix

- additional inplace +=, -=, *=, /= operations

- add named methods at() and rowData() to Matrix.
  Allows a better distinction between linear and row-based addressing

- low-level matrix solve on List/UList instead of Field
This commit is contained in:
Mark Olesen
2019-05-22 12:18:31 +01:00
committed by Andrew Heather
parent f8a70115fd
commit 061eb53fb5
20 changed files with 1121 additions and 730 deletions

View File

@ -84,20 +84,20 @@ inline Foam::RectangularMatrix<Type>::RectangularMatrix
(
const label m,
const label n,
const Type& t
const Type& val
)
:
Matrix<RectangularMatrix<Type>, Type>(m, n, t)
Matrix<RectangularMatrix<Type>, Type>(m, n, val)
{}
template<class Type>
inline Foam::RectangularMatrix<Type>::RectangularMatrix
(
const SquareMatrix<Type>& SM
const SquareMatrix<Type>& mat
)
:
Matrix<RectangularMatrix<Type>, Type>(SM)
Matrix<RectangularMatrix<Type>, Type>(mat)
{}
@ -125,6 +125,13 @@ void Foam::RectangularMatrix<Type>::operator=(const zero)
}
template<class Type>
void Foam::RectangularMatrix<Type>::operator=(const Type& val)
{
Matrix<RectangularMatrix<Type>, Type>::operator=(val);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam