84 MatrixArray(
size_t numRows,
size_t numCols = 1,
size_t numPages = 1);
110 MatrixArray(
size_t numRows,
size_t numCols,
const std::valarray<T>& values);
118 MatrixArray(
size_t numRows,
size_t numCols, std::valarray<T>&& values);
127 MatrixArray(
size_t numRows,
size_t numCols,
size_t numPages,
const std::valarray<T>& values);
136 MatrixArray(
size_t numRows,
size_t numCols,
size_t numPages, std::valarray<T>&& values);
227 template <
bool EnableBool =
true,
228 typename = std::enable_if_t<(std::is_same_v<T, std::complex<double>> && EnableBool)>>
MatrixArray class inherits ValArray class and provides additional interfaces to ValArray which enable...
MatrixArray(size_t numRows, size_t numCols, const std::valarray< T > &values)
Constructor creates a single matrix of numRows and numCols, and uses std::valarray<T> values to initi...
MatrixArray< T > HermitianTranspose() const
Function that performs the Hermitian transpose of this MatrixArray and returns a new matrix that is t...
static MatrixArray< T > IdentityMatrix(const MatrixArray &likeme)
Function produces an identity MatrixArray with the same size as the input MatrixArray.
MatrixArray operator*(const T &rhs) const
Element-wise multiplication with a scalar value.
MatrixArray(const std::vector< T > &values)
Constructor creates a single array of values.size () elements and 1 column, and uses std::vector<T> v...
MatrixArray operator-() const
unary operator- definition for MatrixArray<T>.
MatrixArray Determinant() const
This operator calculates a vector o determinants, one for each page.
static MatrixArray< T > IdentityMatrix(const size_t size, const size_t pages=1)
Function produces an identity MatrixArray with the specified size.
static MatrixArray< T > JoinPages(const std::vector< MatrixArray< T > > &pages)
Function joins multiple pages into a single MatrixArray.
MatrixArray(size_t numRows, size_t numCols, std::valarray< T > &&values)
Constructor creates a single matrix of numRows and numCols, and moves std::valarray<T> values to init...
MatrixArray Transpose() const
This operator interprets the 3D array as an array of matrices, and performs a linear algebra operatio...
MatrixArray< T > MakeNCopies(size_t nCopies) const
Function that copies the current 1-page matrix into a new matrix with n copies of the original matrix...
MatrixArray operator*(const MatrixArray< T > &rhs) const
Page-wise matrix multiplication.
MatrixArray operator-(const MatrixArray< T > &rhs) const
binary operator- definition for MatrixArray<T>.
MatrixArray< T > ExtractPage(size_t page) const
Function extracts a page from a MatrixArray.
MatrixArray(size_t numRows, size_t numCols, size_t numPages, std::valarray< T > &&values)
Constructor creates the array of numPages matrices of numRows x numCols dimensions,...
MatrixArray(size_t numRows, size_t numCols, size_t numPages, const std::valarray< T > &values)
Constructor creates the array of numPages matrices of numRows x numCols dimensions,...
MatrixArray MultiplyByLeftAndRightMatrix(const MatrixArray< T > &lMatrix, const MatrixArray< T > &rMatrix) const
Multiply each matrix in the array by the left and the right matrix.
MatrixArray(const std::valarray< T > &values)
Constructor creates a single array of values.size () elements and 1 column, and uses std::valarray<T>...
MatrixArray FrobeniusNorm() const
This operator calculates a vector of Frobenius norm, one for each page.
MatrixArray operator+(const MatrixArray< T > &rhs) const
operator+ definition for MatrixArray<T>.
MatrixArray(std::valarray< T > &&values)
Constructor creates a single array of values.size () elements and 1 column, and moves std::valarray<T...
MatrixArray(size_t numRows, size_t numCols=1, size_t numPages=1)
Constructor "pages" number of matrices that are of size "numRows"x"numCols", and are initialized with...
T * GetPagePtr(size_t pageIndex)
Get a data pointer to a specific 2D array for use in linear algebra libraries.
void AssertEqualDims(const ValArray< T > &rhs) const
Function that asserts if the dimensions of lhs and rhs ValArray are not equal and prints a message wi...
size_t m_numCols
The size of the second dimension, i.e., the number of columns of each 2D array.
std::valarray< T > m_values
The data values.
size_t m_numRows
The size of the first dimension, i.e., the number of rows of each 2D array.
bool EqualDims(const ValArray< T > &rhs) const
Checks whether rhs and lhs ValArray objects have the same dimensions.
size_t m_numPages
The size of the third dimension, i.e., the number of 2D arrays.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
MatrixArray< double > DoubleMatrixArray
Create an alias for MatrixArray using double type.
MatrixArray< int > IntMatrixArray
Create an alias for MatrixArray using int type.
MatrixArray< std::complex< double > > ComplexMatrixArray
Create an alias for MatrixArray using complex type.