DenseVector.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_SMP_DEFAULT_DENSEVECTOR_H_
36 #define _BLAZE_MATH_SMP_DEFAULT_DENSEVECTOR_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 VT1, bool TF1, typename VT2, bool TF2 >
64 auto smpAssign( Vector<VT1,TF1>& lhs, const Vector<VT2,TF2>& rhs )
65  -> EnableIf_t< IsDenseVector_v<VT1> >;
66 
67 template< typename VT1, bool TF1, typename VT2, bool TF2 >
68 auto smpAddAssign( Vector<VT1,TF1>& lhs, const Vector<VT2,TF2>& rhs )
69  -> EnableIf_t< IsDenseVector_v<VT1> >;
70 
71 template< typename VT1, bool TF1, typename VT2, bool TF2 >
72 auto smpSubAssign( Vector<VT1,TF1>& lhs, const Vector<VT2,TF2>& rhs )
73  -> EnableIf_t< IsDenseVector_v<VT1> >;
74 
75 template< typename VT1, bool TF1, typename VT2, bool TF2 >
76 auto smpMultAssign( Vector<VT1,TF1>& lhs, const Vector<VT2,TF2>& rhs )
77  -> EnableIf_t< IsDenseVector_v<VT1> >;
78 
79 template< typename VT1, bool TF1, typename VT2, bool TF2 >
80 auto smpDivAssign( Vector<VT1,TF1>& lhs, const Vector<VT2,TF2>& rhs )
81  -> EnableIf_t< IsDenseVector_v<VT1> >;
83 //*************************************************************************************************
84 
85 
86 //*************************************************************************************************
100 template< typename VT1 // Type of the left-hand side dense vector
101  , bool TF1 // Transpose flag of the left-hand side dense vector
102  , typename VT2 // Type of the right-hand side vector
103  , bool TF2 > // Transpose flag of the right-hand side vector
104 inline auto smpAssign( Vector<VT1,TF1>& lhs, const Vector<VT2,TF2>& rhs )
106 {
108 
109  BLAZE_INTERNAL_ASSERT( (~lhs).size() == (~rhs).size(), "Invalid vector sizes" );
110  assign( ~lhs, ~rhs );
111 }
112 //*************************************************************************************************
113 
114 
115 //*************************************************************************************************
129 template< typename VT1 // Type of the left-hand side dense vector
130  , bool TF1 // Transpose flag of the left-hand side dense vector
131  , typename VT2 // Type of the right-hand side vector
132  , bool TF2 > // Transpose flag of the right-hand side vector
133 inline auto smpAddAssign( Vector<VT1,TF1>& lhs, const Vector<VT2,TF2>& rhs )
135 {
137 
138  BLAZE_INTERNAL_ASSERT( (~lhs).size() == (~rhs).size(), "Invalid vector sizes" );
139  addAssign( ~lhs, ~rhs );
140 }
141 //*************************************************************************************************
142 
143 
144 //*************************************************************************************************
158 template< typename VT1 // Type of the left-hand side dense vector
159  , bool TF1 // Transpose flag of the left-hand side dense vector
160  , typename VT2 // Type of the right-hand side vector
161  , bool TF2 > // Transpose flag of the right-hand side vector
162 inline auto smpSubAssign( Vector<VT1,TF1>& lhs, const Vector<VT2,TF2>& rhs )
164 {
166 
167  BLAZE_INTERNAL_ASSERT( (~lhs).size() == (~rhs).size(), "Invalid vector sizes" );
168  subAssign( ~lhs, ~rhs );
169 }
170 //*************************************************************************************************
171 
172 
173 //*************************************************************************************************
187 template< typename VT1 // Type of the left-hand side dense vector
188  , bool TF1 // Transpose flag of the left-hand side dense vector
189  , typename VT2 // Type of the right-hand side vector
190  , bool TF2 > // Transpose flag of the right-hand side vector
191 inline auto smpMultAssign( Vector<VT1,TF1>& lhs, const Vector<VT2,TF2>& rhs )
193 {
195 
196  BLAZE_INTERNAL_ASSERT( (~lhs).size() == (~rhs).size(), "Invalid vector sizes" );
197  multAssign( ~lhs, ~rhs );
198 }
199 //*************************************************************************************************
200 
201 
202 //*************************************************************************************************
216 template< typename VT1 // Type of the left-hand side dense vector
217  , bool TF1 // Transpose flag of the left-hand side dense vector
218  , typename VT2 // Type of the right-hand side vector
219  , bool TF2 > // Transpose flag of the right-hand side vector
220 inline auto smpDivAssign( Vector<VT1,TF1>& lhs, const Vector<VT2,TF2>& rhs )
222 {
224 
225  BLAZE_INTERNAL_ASSERT( (~lhs).size() == (~rhs).size(), "Invalid vector sizes" );
226  divAssign( ~lhs, ~rhs );
227 }
228 //*************************************************************************************************
229 
230 
231 
232 
233 //=================================================================================================
234 //
235 // COMPILE TIME CONSTRAINT
236 //
237 //=================================================================================================
238 
239 //*************************************************************************************************
241 namespace {
242 
247 
248 }
250 //*************************************************************************************************
251 
252 } // namespace blaze
253 
254 #endif
#define BLAZE_BOOST_THREADS_PARALLEL_MODE
Compilation switch for the Boost parallelization.This compilation switch enables/disables the paralle...
Definition: SMP.h:152
auto smpDivAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs) -> EnableIf_t< IsDenseVector_v< VT1 > >
Default implementation of the SMP division assignment of a vector to a dense vector.
Definition: DenseVector.h:220
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 EnableIf class template.
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
constexpr size_t size(const Matrix< MT, SO > &matrix) noexcept
Returns the total number of elements of the matrix.
Definition: Matrix.h:530
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
Header file for the IsDenseVector type trait.
Base class for N-dimensional vectors.The Vector class is a base class for all arbitrarily sized (N-di...
Definition: Forward.h:186
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
Header file for the Vector CRTP base class.
#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
auto smpMultAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs) -> EnableIf_t< IsDenseVector_v< VT1 > >
Default implementation of the SMP multiplication assignment of a vector to a dense vector...
Definition: DenseVector.h:191
Header file for the function trace functionality.