DenseMatrix.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_SMP_DEFAULT_DENSEMATRIX_H_
36 #define _BLAZE_MATH_SMP_DEFAULT_DENSEMATRIX_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
46 #include <blaze/system/SMP.h>
47 #include <blaze/util/Assert.h>
48 #include <blaze/util/EnableIf.h>
51 
52 
53 namespace blaze {
54 
55 //=================================================================================================
56 //
57 // GLOBAL FUNCTIONS
58 //
59 //=================================================================================================
60 
61 //*************************************************************************************************
64 template< typename MT1, bool SO1, typename MT2, bool SO2 >
65 inline EnableIf_< IsDenseMatrix<MT1> >
66  smpAssign( Matrix<MT1,SO1>& lhs, const Matrix<MT2,SO2>& rhs );
67 
68 template< typename MT1, bool SO1, typename MT2, bool SO2 >
69 inline EnableIf_< IsDenseMatrix<MT1> >
70  smpAddAssign( Matrix<MT1,SO1>& lhs, const Matrix<MT2,SO2>& rhs );
71 
72 template< typename MT1, bool SO1, typename MT2, bool SO2 >
73 inline EnableIf_< IsDenseMatrix<MT1> >
74  smpSubAssign( Matrix<MT1,SO1>& lhs, const Matrix<MT2,SO2>& rhs );
75 
76 template< typename MT1, bool SO1, typename MT2, bool SO2 >
77 inline EnableIf_< IsDenseMatrix<MT1> >
78  smpSchurAssign( Matrix<MT1,SO1>& lhs, const Matrix<MT2,SO2>& rhs );
80 //*************************************************************************************************
81 
82 
83 //*************************************************************************************************
97 template< typename MT1 // Type of the left-hand side dense matrix
98  , bool SO1 // Storage order of the left-hand side dense matrix
99  , typename MT2 // Type of the right-hand side matrix
100  , bool SO2 > // Storage order of the right-hand side matrix
101 inline EnableIf_< IsDenseMatrix<MT1> >
103 {
105 
106  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == (~rhs).rows() , "Invalid number of rows" );
107  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == (~rhs).columns(), "Invalid number of columns" );
108 
109  assign( ~lhs, ~rhs );
110 }
111 //*************************************************************************************************
112 
113 
114 //*************************************************************************************************
128 template< typename MT1 // Type of the left-hand side dense matrix
129  , bool SO1 // Storage order of the left-hand side dense matrix
130  , typename MT2 // Type of the right-hand side matrix
131  , bool SO2 > // Storage order of the right-hand side matrix
134 {
136 
137  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == (~rhs).rows() , "Invalid number of rows" );
138  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == (~rhs).columns(), "Invalid number of columns" );
139 
140  addAssign( ~lhs, ~rhs );
141 }
142 //*************************************************************************************************
143 
144 
145 //*************************************************************************************************
159 template< typename MT1 // Type of the left-hand side dense matrix
160  , bool SO1 // Storage order of the left-hand side dense matrix
161  , typename MT2 // Type of the right-hand side matrix
162  , bool SO2 > // Storage order of the right-hand side matrix
165 {
167 
168  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == (~rhs).rows() , "Invalid number of rows" );
169  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == (~rhs).columns(), "Invalid number of columns" );
170 
171  subAssign( ~lhs, ~rhs );
172 }
173 //*************************************************************************************************
174 
175 
176 //*************************************************************************************************
191 template< typename MT1 // Type of the left-hand side dense matrix
192  , bool SO1 // Storage order of the left-hand side dense matrix
193  , typename MT2 // Type of the right-hand side matrix
194  , bool SO2 > // Storage order of the right-hand side matrix
197 {
199 
200  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == (~rhs).rows() , "Invalid number of rows" );
201  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == (~rhs).columns(), "Invalid number of columns" );
202 
203  schurAssign( ~lhs, ~rhs );
204 }
205 //*************************************************************************************************
206 
207 
208 
209 
210 //=================================================================================================
211 //
212 // COMPILE TIME CONSTRAINT
213 //
214 //=================================================================================================
215 
216 //*************************************************************************************************
218 namespace {
219 
222 
223 }
225 //*************************************************************************************************
226 
227 } // namespace blaze
228 
229 #endif
EnableIf_< IsDenseMatrix< MT1 > > smpSchurAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP Schur product assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:196
EnableIf_< IsDenseMatrix< MT1 > > smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:164
EnableIf_< IsDenseMatrix< MT1 > > smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:133
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Compile time assertion.
System settings for the shared-memory parallelization.
EnableIf_< IsDenseMatrix< MT1 > > smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:102
Header file for the DenseMatrix base class.
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:340
#define BLAZE_CPP_THREADS_PARALLEL_MODE
Compilation switch for the C++11 parallelization.This compilation switch enables/disables the paralle...
Definition: SMP.h:95
Header file for the IsDenseMatrix type trait.
Header file for the EnableIf class template.
Header file for the Matrix base class.
Header file for run time assertion macros.
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:94
Base class for matrices.The Matrix class is a base class for all dense and sparse matrix classes with...
Definition: Forward.h:101
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:224
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:324
#define BLAZE_OPENMP_PARALLEL_MODE
Compilation switch for the OpenMP parallelization.This compilation switch enables/disables the OpenMP...
Definition: SMP.h:67
#define BLAZE_STATIC_ASSERT(expr)
Compile time assertion macro.In case of an invalid compile time expression, a compilation error is cr...
Definition: StaticAssert.h:112
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
Header file for the function trace functionality.