Blaze 3.9
MatInvExpr.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_EXPRESSIONS_MATINVEXPR_H_
36#define _BLAZE_MATH_EXPRESSIONS_MATINVEXPR_H_
37
38
39//*************************************************************************************************
40// Includes
41//*************************************************************************************************
42
48
49
50namespace blaze {
51
52//=================================================================================================
53//
54// CLASS DEFINITION
55//
56//=================================================================================================
57
58//*************************************************************************************************
69template< typename MT > // Matrix base type of the expression
71 : public Expression<MT>
72{};
73//*************************************************************************************************
74
75
76
77
78//=================================================================================================
79//
80// GLOBAL RESTRUCTURING FUNCTIONS
81//
82//=================================================================================================
83
84//*************************************************************************************************
98template< typename MT // Matrix base type of the left-hand side expression
99 , typename VT > // Type of the right-hand side dense vector
100inline decltype(auto)
101 operator*( const MatInvExpr<MT>& mat, const DenseVector<VT,false>& vec )
102{
104
105 return solve( (*mat).operand(), *vec );
106}
108//*************************************************************************************************
109
110
111//*************************************************************************************************
125template< typename VT // Type of the left-hand side dense vector
126 , typename MT > // Matrix base type of the right-hand side expression
127inline decltype(auto)
128 operator*( const DenseVector<VT,true>& vec, const MatInvExpr<MT>& mat )
129{
131
132 return solve( trans( (*mat).operand() ), *vec );
133}
135//*************************************************************************************************
136
137
138//*************************************************************************************************
152template< typename MT1 // Matrix base type of the left-hand side expression
153 , typename MT2 // Type of the right-hand side dense matrix
154 , bool SO // Storage order of the right-hand side dense matrix
155 , DisableIf_t< IsMatScalarMultExpr_v<MT2> >* = nullptr >
156inline decltype(auto)
157 operator*( const MatInvExpr<MT1>& lhs, const DenseMatrix<MT2,SO>& rhs )
158{
160
161 return solve( (*lhs).operand(), *rhs );
162}
164//*************************************************************************************************
165
166
167//*************************************************************************************************
181template< typename MT1 // Type of the left-hand side dense matrix
182 , bool SO // Storage order of the left-hand side dense matrix
183 , typename MT2 // Matrix base type of the right-hand side expression
184 , DisableIf_t< IsMatScalarMultExpr_v<MT1> >* = nullptr >
185inline decltype(auto)
186 operator*( const DenseMatrix<MT1,SO>& lhs, const MatInvExpr<MT2>& rhs )
187{
189
190 return trans( solve( trans( (*rhs).operand() ), trans( *lhs ) ) );
191}
193//*************************************************************************************************
194
195
196//*************************************************************************************************
216template< typename MT > // Matrix base type of the expression
217inline decltype(auto) inv( const MatInvExpr<MT>& matrix )
218{
220
221 return matrix.operand();
222}
224//*************************************************************************************************
225
226
227//*************************************************************************************************
244template< typename MT > // Matrix base type of the expression
245inline decltype(auto) det( const MatInvExpr<MT>& matrix )
246{
248
249 return inv( det( (*matrix).operand() ) );
250}
252//*************************************************************************************************
253
254} // namespace blaze
255
256#endif
Header file for the function trace functionality.
Header file for the invert shim.
Header file for the IsMatScalarMultExpr type trait class.
Base class for N-dimensional dense vectors.
Definition: DenseVector.h:77
Header file for the Expression base class.
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:766
void solve(const DenseMatrix< MT, SO > &A, DenseVector< VT1, TF1 > &x, const DenseVector< VT2, TF2 > &b)
Solving the given linear system of equations ( ).
Definition: LSE.h:6343
ElementType_t< MT > det(const DenseMatrix< MT, SO > &dm)
Computation of the determinant of the given dense square matrix.
Definition: DMatDetExpr.h:384
decltype(auto) inv(const DenseMatrix< MT, SO > &dm)
Calculation of the inverse of the given dense matrix.
Definition: DMatInvExpr.h:405
#define BLAZE_FUNCTION_TRACE
Function trace macro.
Definition: FunctionTrace.h:94
Header file for all forward declarations for expression class templates.
Base class for all expression templates.
Definition: Expression.h:60
Base class for all matrix inversion expression templates.
Definition: MatInvExpr.h:72