Blaze  3.6
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 
45 #include <blaze/system/SMP.h>
46 #include <blaze/util/Assert.h>
47 #include <blaze/util/EnableIf.h>
50 
51 
52 namespace blaze {
53 
54 //=================================================================================================
55 //
56 // GLOBAL FUNCTIONS
57 //
58 //=================================================================================================
59 
60 //*************************************************************************************************
63 template< typename MT1, bool SO1, typename MT2, bool SO2 >
64 auto smpAssign( Matrix<MT1,SO1>& lhs, const Matrix<MT2,SO2>& rhs )
65  -> EnableIf_t< IsDenseMatrix_v<MT1> >;
66 
67 template< typename MT1, bool SO1, typename MT2, bool SO2 >
68 auto smpAddAssign( Matrix<MT1,SO1>& lhs, const Matrix<MT2,SO2>& rhs )
69  -> EnableIf_t< IsDenseMatrix_v<MT1> >;
70 
71 template< typename MT1, bool SO1, typename MT2, bool SO2 >
72 auto smpSubAssign( Matrix<MT1,SO1>& lhs, const Matrix<MT2,SO2>& rhs )
73  -> EnableIf_t< IsDenseMatrix_v<MT1> >;
74 
75 template< typename MT1, bool SO1, typename MT2, bool SO2 >
76 auto smpSchurAssign( Matrix<MT1,SO1>& lhs, const Matrix<MT2,SO2>& rhs )
77  -> EnableIf_t< IsDenseMatrix_v<MT1> >;
79 //*************************************************************************************************
80 
81 
82 //*************************************************************************************************
96 template< typename MT1 // Type of the left-hand side dense matrix
97  , bool SO1 // Storage order of the left-hand side dense matrix
98  , typename MT2 // Type of the right-hand side matrix
99  , bool SO2 > // Storage order of the right-hand side matrix
100 inline auto smpAssign( Matrix<MT1,SO1>& lhs, const Matrix<MT2,SO2>& rhs )
102 {
104 
105  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == (~rhs).rows() , "Invalid number of rows" );
106  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == (~rhs).columns(), "Invalid number of columns" );
107 
108  assign( ~lhs, ~rhs );
109 }
110 //*************************************************************************************************
111 
112 
113 //*************************************************************************************************
127 template< typename MT1 // Type of the left-hand side dense matrix
128  , bool SO1 // Storage order of the left-hand side dense matrix
129  , typename MT2 // Type of the right-hand side matrix
130  , bool SO2 > // Storage order of the right-hand side matrix
131 inline auto smpAddAssign( Matrix<MT1,SO1>& lhs, const Matrix<MT2,SO2>& rhs )
133 {
135 
136  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == (~rhs).rows() , "Invalid number of rows" );
137  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == (~rhs).columns(), "Invalid number of columns" );
138 
139  addAssign( ~lhs, ~rhs );
140 }
141 //*************************************************************************************************
142 
143 
144 //*************************************************************************************************
158 template< typename MT1 // Type of the left-hand side dense matrix
159  , bool SO1 // Storage order of the left-hand side dense matrix
160  , typename MT2 // Type of the right-hand side matrix
161  , bool SO2 > // Storage order of the right-hand side matrix
162 inline auto smpSubAssign( Matrix<MT1,SO1>& lhs, const Matrix<MT2,SO2>& rhs )
164 {
166 
167  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == (~rhs).rows() , "Invalid number of rows" );
168  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == (~rhs).columns(), "Invalid number of columns" );
169 
170  subAssign( ~lhs, ~rhs );
171 }
172 //*************************************************************************************************
173 
174 
175 //*************************************************************************************************
190 template< typename MT1 // Type of the left-hand side dense matrix
191  , bool SO1 // Storage order of the left-hand side dense matrix
192  , typename MT2 // Type of the right-hand side matrix
193  , bool SO2 > // Storage order of the right-hand side matrix
194 inline auto smpSchurAssign( Matrix<MT1,SO1>& lhs, const Matrix<MT2,SO2>& rhs )
196 {
198 
199  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == (~rhs).rows() , "Invalid number of rows" );
200  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == (~rhs).columns(), "Invalid number of columns" );
201 
202  schurAssign( ~lhs, ~rhs );
203 }
204 //*************************************************************************************************
205 
206 
207 
208 
209 //=================================================================================================
210 //
211 // COMPILE TIME CONSTRAINT
212 //
213 //=================================================================================================
214 
215 //*************************************************************************************************
217 namespace {
218 
223 
224 }
226 //*************************************************************************************************
227 
228 } // namespace blaze
229 
230 #endif
#define BLAZE_BOOST_THREADS_PARALLEL_MODE
Compilation switch for the Boost parallelization.This compilation switch enables/disables the paralle...
Definition: SMP.h:152
constexpr size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:514
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.The EnableIf_t alias declaration provides a convenient...
Definition: EnableIf.h:138
#define BLAZE_HPX_PARALLEL_MODE
Compilation switch for the HPX parallelization.This compilation switch enables/disables the paralleli...
Definition: SMP.h:96
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Compile time assertion.
System settings for the shared-memory parallelization.
#define BLAZE_CPP_THREADS_PARALLEL_MODE
Compilation switch for the C++11 parallelization.This compilation switch enables/disables the paralle...
Definition: SMP.h:124
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.
auto smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:131
#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:114
auto smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:100
auto smpSchurAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP Schur product assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:194
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:498
auto smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:162
#define BLAZE_OPENMP_PARALLEL_MODE
Compilation switch for the OpenMP parallelization.This compilation switch enables/disables the OpenMP...
Definition: SMP.h:68
#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,...
Definition: Assert.h:101
Header file for the function trace functionality.