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 );
76 //*************************************************************************************************
77 
78 
79 //*************************************************************************************************
93 template< typename MT1 // Type of the left-hand side dense matrix
94  , bool SO1 // Storage order of the left-hand side dense matrix
95  , typename MT2 // Type of the right-hand side matrix
96  , bool SO2 > // Storage order of the right-hand side matrix
97 inline EnableIf_< IsDenseMatrix<MT1> >
99 {
101 
102  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == (~rhs).rows() , "Invalid number of rows" );
103  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == (~rhs).columns(), "Invalid number of columns" );
104 
105  assign( ~lhs, ~rhs );
106 }
107 //*************************************************************************************************
108 
109 
110 //*************************************************************************************************
124 template< typename MT1 // Type of the left-hand side dense matrix
125  , bool SO1 // Storage order of the left-hand side dense matrix
126  , typename MT2 // Type of the right-hand side matrix
127  , bool SO2 > // Storage order of the right-hand side matrix
128 inline EnableIf_< IsDenseMatrix<MT1> >
130 {
132 
133  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == (~rhs).rows() , "Invalid number of rows" );
134  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == (~rhs).columns(), "Invalid number of columns" );
135 
136  addAssign( ~lhs, ~rhs );
137 }
138 //*************************************************************************************************
139 
140 
141 //*************************************************************************************************
155 template< typename MT1 // Type of the left-hand side dense matrix
156  , bool SO1 // Storage order of the left-hand side dense matrix
157  , typename MT2 // Type of the right-hand side matrix
158  , bool SO2 > // Storage order of the right-hand side matrix
159 inline EnableIf_< IsDenseMatrix<MT1> >
161 {
163 
164  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == (~rhs).rows() , "Invalid number of rows" );
165  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == (~rhs).columns(), "Invalid number of columns" );
166 
167  subAssign( ~lhs, ~rhs );
168 }
169 //*************************************************************************************************
170 
171 
172 
173 
174 //=================================================================================================
175 //
176 // COMPILE TIME CONSTRAINT
177 //
178 //=================================================================================================
179 
180 //*************************************************************************************************
182 namespace {
183 
186 
187 }
189 //*************************************************************************************************
190 
191 } // namespace blaze
192 
193 #endif
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:160
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:129
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:98
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:330
#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.
Base class for matrices.The Matrix class is a base class for all dense and sparse matrix classes with...
Definition: Forward.h:89
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:314
#define BLAZE_OPENMP_PARALLEL_MODE
Compilation switch for the OpenMP parallelization.This compilation switch enables/disables the OpenMP...
Definition: SMP.h:67
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:157
#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 FunctionTrace class.