InvExprTrait.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_TRAITS_INVEXPRTRAIT_H_
36 #define _BLAZE_MATH_TRAITS_INVEXPRTRAIT_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <utility>
46 #include <blaze/util/InvalidType.h>
47 #include <blaze/util/mpl/And.h>
48 #include <blaze/util/mpl/If.h>
49 #include <blaze/util/mpl/Or.h>
53 
54 
55 namespace blaze {
56 
57 //=================================================================================================
58 //
59 // CLASS DEFINITION
60 //
61 //=================================================================================================
62 
63 //*************************************************************************************************
73 template< typename T > // Type of the inversion operand
75 {
76  private:
77  //**struct Failure******************************************************************************
79  struct Failure { using Type = INVALID_TYPE; };
81  //**********************************************************************************************
82 
83  //**struct Result*******************************************************************************
85  struct Result { using Type = decltype( inv( std::declval<T>() ) ); };
87  //**********************************************************************************************
88 
89  //**struct Result*******************************************************************************
91  using Tmp = RemoveReference_<T>;
93  //**********************************************************************************************
94 
95  public:
96  //**********************************************************************************************
98  using Type = typename If_< Or< IsDenseMatrix<Tmp>
101  , Result
102  , Failure >::Type;
104  //**********************************************************************************************
105 };
106 //*************************************************************************************************
107 
108 
109 //*************************************************************************************************
122 template< typename T > // Type of the inversion operand
124 //*************************************************************************************************
125 
126 } // namespace blaze
127 
128 #endif
Evaluation of the return type of an inversion expression.Via this type trait it is possible to evalua...
Definition: InvExprTrait.h:74
Header file for the And class template.
Header file for the UnderlyingElement type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for the If class template.
Header file for the IsFloatingPoint type trait.
Header file for the Or class template.
decltype(auto) inv(const DenseMatrix< MT, SO > &dm)
Calculation of the inverse of the given dense matrix.
Definition: DMatInvExpr.h:426
typename RemoveReference< T >::Type RemoveReference_
Auxiliary alias declaration for the RemoveReference type trait.The RemoveReference_ alias declaration...
Definition: RemoveReference.h:95
Compile time check for floating point data types.This type trait tests whether or not the given templ...
Definition: IsFloatingPoint.h:75
Header file for the IsDenseMatrix type trait.
Utility type for generic codes.
typename If< T1, T2, T3 >::Type If_
Auxiliary alias declaration for the If class template.The If_ alias declaration provides a convenient...
Definition: If.h:154
Header file for the RemoveReference type trait.
typename InvExprTrait< T >::Type InvExprTrait_
Auxiliary alias declaration for the InvExprTrait class template.The InvExprTrait_ alias declaration p...
Definition: InvExprTrait.h:123
Header file for the IsComplex type trait.
Compile time logical and evaluation.The And alias declaration performs at compile time a logical and ...
Definition: And.h:76