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 
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 VT1, bool TF1, typename VT2, bool TF2 >
65 inline EnableIf_< IsDenseVector<VT1> >
66  smpAssign( Vector<VT1,TF1>& lhs, const Vector<VT2,TF2>& rhs );
67 
68 template< typename VT1, bool TF1, typename VT2, bool TF2 >
69 inline EnableIf_< IsDenseVector<VT1> >
70  smpAddAssign( Vector<VT1,TF1>& lhs, const Vector<VT2,TF2>& rhs );
71 
72 template< typename VT1, bool TF1, typename VT2, bool TF2 >
73 inline EnableIf_< IsDenseVector<VT1> >
74  smpSubAssign( Vector<VT1,TF1>& lhs, const Vector<VT2,TF2>& rhs );
75 
76 template< typename VT1, bool TF1, typename VT2, bool TF2 >
77 inline EnableIf_< IsDenseVector<VT1> >
78  smpMultAssign( Vector<VT1,TF1>& lhs, const Vector<VT2,TF2>& rhs );
79 
80 template< typename VT1, bool TF1, typename VT2, bool TF2 >
81 inline EnableIf_< IsDenseVector<VT1> >
82  smpDivAssign( Vector<VT1,TF1>& lhs, const Vector<VT2,TF2>& rhs );
84 //*************************************************************************************************
85 
86 
87 //*************************************************************************************************
101 template< typename VT1 // Type of the left-hand side dense vector
102  , bool TF1 // Transpose flag of the left-hand side dense vector
103  , typename VT2 // Type of the right-hand side vector
104  , bool TF2 > // Transpose flag of the right-hand side vector
105 inline EnableIf_< IsDenseVector<VT1> >
107 {
109 
110  BLAZE_INTERNAL_ASSERT( (~lhs).size() == (~rhs).size(), "Invalid vector sizes" );
111  assign( ~lhs, ~rhs );
112 }
113 //*************************************************************************************************
114 
115 
116 //*************************************************************************************************
130 template< typename VT1 // Type of the left-hand side dense vector
131  , bool TF1 // Transpose flag of the left-hand side dense vector
132  , typename VT2 // Type of the right-hand side vector
133  , bool TF2 > // Transpose flag of the right-hand side vector
134 inline EnableIf_< IsDenseVector<VT1> >
136 {
138 
139  BLAZE_INTERNAL_ASSERT( (~lhs).size() == (~rhs).size(), "Invalid vector sizes" );
140  addAssign( ~lhs, ~rhs );
141 }
142 //*************************************************************************************************
143 
144 
145 //*************************************************************************************************
159 template< typename VT1 // Type of the left-hand side dense vector
160  , bool TF1 // Transpose flag of the left-hand side dense vector
161  , typename VT2 // Type of the right-hand side vector
162  , bool TF2 > // Transpose flag of the right-hand side vector
163 inline EnableIf_< IsDenseVector<VT1> >
165 {
167 
168  BLAZE_INTERNAL_ASSERT( (~lhs).size() == (~rhs).size(), "Invalid vector sizes" );
169  subAssign( ~lhs, ~rhs );
170 }
171 //*************************************************************************************************
172 
173 
174 //*************************************************************************************************
188 template< typename VT1 // Type of the left-hand side dense vector
189  , bool TF1 // Transpose flag of the left-hand side dense vector
190  , typename VT2 // Type of the right-hand side vector
191  , bool TF2 > // Transpose flag of the right-hand side vector
192 inline EnableIf_< IsDenseVector<VT1> >
194 {
196 
197  BLAZE_INTERNAL_ASSERT( (~lhs).size() == (~rhs).size(), "Invalid vector sizes" );
198  multAssign( ~lhs, ~rhs );
199 }
200 //*************************************************************************************************
201 
202 
203 //*************************************************************************************************
217 template< typename VT1 // Type of the left-hand side dense vector
218  , bool TF1 // Transpose flag of the left-hand side dense vector
219  , typename VT2 // Type of the right-hand side vector
220  , bool TF2 > // Transpose flag of the right-hand side vector
221 inline EnableIf_< IsDenseVector<VT1> >
223 {
225 
226  BLAZE_INTERNAL_ASSERT( (~lhs).size() == (~rhs).size(), "Invalid vector sizes" );
227  divAssign( ~lhs, ~rhs );
228 }
229 //*************************************************************************************************
230 
231 
232 
233 
234 //=================================================================================================
235 //
236 // COMPILE TIME CONSTRAINT
237 //
238 //=================================================================================================
239 
240 //*************************************************************************************************
242 namespace {
243 
246 
247 }
249 //*************************************************************************************************
250 
251 } // namespace blaze
252 
253 #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
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector) noexcept
Returns the current size/dimension of the vector.
Definition: Vector.h:258
EnableIf_< IsDenseVector< VT1 > > smpMultAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs)
Default implementation of the SMP multiplication assignment of a vector to a dense vector...
Definition: DenseVector.h:193
Header file for the DenseVector base class.
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
#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 EnableIf class template.
Header file for run time assertion macros.
EnableIf_< IsDenseVector< VT1 > > smpDivAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs)
Default implementation of the SMP division assignment of a vector to a dense vector.
Definition: DenseVector.h:222
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:154
#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
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
Header file for the FunctionTrace class.