Peano
Loading...
Searching...
No Matches
MatrixOperations.h
Go to the documentation of this file.
1// This file is part of the Peano project. For conditions of distribution and
2// use, please see the copyright notice at www.peano-framework.org
3#pragma once
4
5
6#include "tarch/la/Matrix.h"
7#include "tarch/la/Vector.h"
8
9#include <sstream>
10#include <cmath>
11
12namespace tarch {
13 namespace la {
17 template<int Rows, int Cols, typename Scalar>
18 Scalar sum (const Matrix<Rows,Cols,Scalar>& matrix);
19
20
21 template<int Rows, int Cols, typename Scalar>
23
27 template<int Rows, typename Scalar>
29
33 template<int Rows, typename Scalar>
35
39 template<int Rows, int Cols, typename Scalar>
40 Vector<Cols,Scalar> row(const Matrix<Rows,Cols,Scalar>& matrix, int whichRow);
41
45 template<int Rows, int Cols, typename Scalar>
46 Vector<Rows,Scalar> col(const Matrix<Rows,Cols,Scalar>& matrix, int whichColumn);
47
61 template<int Rows, int Cols, typename Scalar>
63 const Matrix<Rows,Cols,Scalar>& matrix
64 );
65
66 template<int Rows, int Cols, typename Scalar>
67 Scalar frobeniusNorm(
68 const Matrix<Rows,Cols,Scalar>& matrix
69 );
70
74 template<int Rows, int Cols, typename Scalar>
75 Scalar elementMax(
76 const Matrix<Rows,Cols,Scalar>& matrix
77 );
78 }
79}
80
81
82
83template<int Rows, int Cols, typename Scalar>
84std::ostream& operator<<(std::ostream& os, const tarch::la::Matrix<Rows,Cols,Scalar>& matrix);
85
86
88
std::ostream & operator<<(std::ostream &os, const tarch::la::Matrix< Rows, Cols, Scalar > &matrix)
Static (i.e.
Definition Matrix.h:42
DynamicMatrix transpose(const DynamicMatrix &matrix)
Scalar sum(const Matrix< Rows, Cols, Scalar > &matrix)
Computes the sum of all entries of the matrix.
Vector< Rows, Scalar > col(const Matrix< Rows, Cols, Scalar > &matrix, int whichColumn)
Extract row from matrix.
Vector< Rows, Scalar > diag(const Matrix< Rows, Rows, Scalar > &matrix)
Extract diagonal vector from matrix.
static Matrix< Rows, Rows, Scalar > identity()
Returns the identity matrix.
Vector< Size, Scalar > invertEntries(const Vector< Size, Scalar > &vector)
Vector< Cols, Scalar > row(const Matrix< Rows, Cols, Scalar > &matrix, int whichRow)
Extract row from matrix.
Have to include this header, as I need access to the SYCL_EXTERNAL keyword.
Definition accelerator.h:19
Simple vector class.
Definition Vector.h:150