Blaze 3.9
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
52namespace blaze {
53
54//=================================================================================================
55//
56// GLOBAL FUNCTIONS
57//
58//=================================================================================================
59
60//*************************************************************************************************
63template< typename MT1, bool SO1, typename MT2, bool SO2 >
64auto smpAssign( Matrix<MT1,SO1>& lhs, const Matrix<MT2,SO2>& rhs )
65 -> EnableIf_t< IsDenseMatrix_v<MT1> >;
66
67template< typename MT1, bool SO1, typename MT2, bool SO2 >
68auto smpAddAssign( Matrix<MT1,SO1>& lhs, const Matrix<MT2,SO2>& rhs )
69 -> EnableIf_t< IsDenseMatrix_v<MT1> >;
70
71template< typename MT1, bool SO1, typename MT2, bool SO2 >
72auto smpSubAssign( Matrix<MT1,SO1>& lhs, const Matrix<MT2,SO2>& rhs )
73 -> EnableIf_t< IsDenseMatrix_v<MT1> >;
74
75template< typename MT1, bool SO1, typename MT2, bool SO2 >
76auto smpSchurAssign( Matrix<MT1,SO1>& lhs, const Matrix<MT2,SO2>& rhs )
77 -> EnableIf_t< IsDenseMatrix_v<MT1> >;
79//*************************************************************************************************
80
81
82//*************************************************************************************************
96template< 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
100inline 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//*************************************************************************************************
127template< 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
131inline 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//*************************************************************************************************
158template< 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
162inline 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//*************************************************************************************************
190template< 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
194inline 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//*************************************************************************************************
217namespace {
218
223
224}
226//*************************************************************************************************
227
228} // namespace blaze
229
230#endif
Header file for run time assertion macros.
Header file for the EnableIf class template.
Header file for the function trace functionality.
Header file for the IsDenseMatrix type trait.
Compile time assertion.
Base class for matrices.
Definition: Matrix.h:85
Header file for the Matrix base class.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.
Definition: Assert.h:101
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
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
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_STATIC_ASSERT(expr)
Compile time assertion macro.
Definition: StaticAssert.h:112
#define BLAZE_CPP_THREADS_PARALLEL_MODE
Compilation switch for the C++11 parallelization.
Definition: SMP.h:124
#define BLAZE_HPX_PARALLEL_MODE
Compilation switch for the HPX parallelization.
Definition: SMP.h:96
#define BLAZE_OPENMP_PARALLEL_MODE
Compilation switch for the OpenMP parallelization.
Definition: SMP.h:68
#define BLAZE_BOOST_THREADS_PARALLEL_MODE
Compilation switch for the Boost parallelization.
Definition: SMP.h:152
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.
Definition: EnableIf.h:138
#define BLAZE_FUNCTION_TRACE
Function trace macro.
Definition: FunctionTrace.h:94
System settings for the shared-memory parallelization.