InvCbrt.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_SHIMS_INVCBRT_H_
36 #define _BLAZE_MATH_SHIMS_INVCBRT_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
44 #include <blaze/math/shims/Cbrt.h>
45 #include <blaze/util/Assert.h>
46 #include <blaze/util/EnableIf.h>
48 
49 
50 namespace blaze {
51 
52 //=================================================================================================
53 //
54 // INVCBRT SHIM
55 //
56 //=================================================================================================
57 
58 //*************************************************************************************************
68 template< typename T, typename = EnableIf_< IsBuiltin<T> > >
69 inline auto invcbrt( T a ) noexcept -> decltype( inv( cbrt( a ) ) )
70 {
71  BLAZE_USER_ASSERT( abs( a ) != T(0), "Invalid built-in value detected" );
72 
73  return inv( cbrt( a ) );
74 }
75 //*************************************************************************************************
76 
77 } // namespace blaze
78 
79 #endif
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_USER_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERT flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:117
Header file for the invert shim.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
decltype(auto) cbrt(const DenseMatrix< MT, SO > &dm)
Computes the cubic root of each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1512
decltype(auto) inv(const DenseMatrix< MT, SO > &dm)
Calculation of the inverse of the given dense matrix.
Definition: DMatInvExpr.h:423
Header file for the EnableIf class template.
decltype(auto) abs(const DenseMatrix< MT, SO > &dm)
Applies the abs() function to each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1176
Header file for run time assertion macros.
Header file for the cbrt shim.
decltype(auto) invcbrt(const DenseMatrix< MT, SO > &dm)
Computes the inverse cubic root of each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1544
Header file for the IsBuiltin type trait.