All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 typename EnableIf< IsDenseVector<VT1> >::Type
66  smpAssign( Vector<VT1,TF1>& lhs, const Vector<VT2,TF2>& rhs );
67 
68 template< typename VT1, bool TF1, typename VT2, bool TF2 >
69 inline typename EnableIf< IsDenseVector<VT1> >::Type
70  smpAddAssign( Vector<VT1,TF1>& lhs, const Vector<VT2,TF2>& rhs );
71 
72 template< typename VT1, bool TF1, typename VT2, bool TF2 >
73 inline typename EnableIf< IsDenseVector<VT1> >::Type
74  smpSubAssign( Vector<VT1,TF1>& lhs, const Vector<VT2,TF2>& rhs );
75 
76 template< typename VT1, bool TF1, typename VT2, bool TF2 >
77 inline typename EnableIf< IsDenseVector<VT1> >::Type
78  smpMultAssign( Vector<VT1,TF1>& lhs, const Vector<VT2,TF2>& rhs );
80 //*************************************************************************************************
81 
82 
83 //*************************************************************************************************
97 template< typename VT1 // Type of the left-hand side dense vector
98  , bool TF1 // Transpose flag of the left-hand side dense vector
99  , typename VT2 // Type of the right-hand side vector
100  , bool TF2 > // Transpose flag of the right-hand side vector
101 inline typename EnableIf< IsDenseVector<VT1> >::Type
103 {
105 
106  BLAZE_INTERNAL_ASSERT( (~lhs).size() == (~rhs).size(), "Invalid vector sizes" );
107  assign( ~lhs, ~rhs );
108 }
109 //*************************************************************************************************
110 
111 
112 //*************************************************************************************************
126 template< typename VT1 // Type of the left-hand side dense vector
127  , bool TF1 // Transpose flag of the left-hand side dense vector
128  , typename VT2 // Type of the right-hand side vector
129  , bool TF2 > // Transpose flag of the right-hand side vector
130 inline typename EnableIf< IsDenseVector<VT1> >::Type
132 {
134 
135  BLAZE_INTERNAL_ASSERT( (~lhs).size() == (~rhs).size(), "Invalid vector sizes" );
136  addAssign( ~lhs, ~rhs );
137 }
138 //*************************************************************************************************
139 
140 
141 //*************************************************************************************************
155 template< typename VT1 // Type of the left-hand side dense vector
156  , bool TF1 // Transpose flag of the left-hand side dense vector
157  , typename VT2 // Type of the right-hand side vector
158  , bool TF2 > // Transpose flag of the right-hand side vector
159 inline typename EnableIf< IsDenseVector<VT1> >::Type
161 {
163 
164  BLAZE_INTERNAL_ASSERT( (~lhs).size() == (~rhs).size(), "Invalid vector sizes" );
165  subAssign( ~lhs, ~rhs );
166 }
167 //*************************************************************************************************
168 
169 
170 //*************************************************************************************************
184 template< typename VT1 // Type of the left-hand side dense vector
185  , bool TF1 // Transpose flag of the left-hand side dense vector
186  , typename VT2 // Type of the right-hand side vector
187  , bool TF2 > // Transpose flag of the right-hand side vector
188 inline typename EnableIf< IsDenseVector<VT1> >::Type
190 {
192 
193  BLAZE_INTERNAL_ASSERT( (~lhs).size() == (~rhs).size(), "Invalid vector sizes" );
194  multAssign( ~lhs, ~rhs );
195 }
196 //*************************************************************************************************
197 
198 
199 
200 
201 //=================================================================================================
202 //
203 // COMPILE TIME CONSTRAINT
204 //
205 //=================================================================================================
206 
207 //*************************************************************************************************
209 namespace {
210 
213 
214 }
216 //*************************************************************************************************
217 
218 } // namespace blaze
219 
220 #endif
BLAZE_ALWAYS_INLINE void multAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the multiplication assignment of a matrix to a matrix.
Definition: Matrix.h:879
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:258
Header file for the DenseVector base class.
Compile time assertion.
System settings for the shared-memory parallelization.
BLAZE_ALWAYS_INLINE void assign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the assignment of a matrix to a matrix.
Definition: Matrix.h:635
#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.
EnableIf< IsDenseMatrix< MT1 > >::Type 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
Header file for run time assertion macros.
EnableIf< IsDenseMatrix< MT1 > >::Type 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
BLAZE_ALWAYS_INLINE void addAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the addition assignment of a matrix to a matrix.
Definition: Matrix.h:742
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:151
#define BLAZE_OPENMP_PARALLEL_MODE
Compilation switch for the OpenMP parallelization.This compilation switch enables/disables the OpenMP...
Definition: SMP.h:67
EnableIf< IsDenseMatrix< MT1 > >::Type 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
#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:143
EnableIf< IsDenseVector< VT1 > >::Type 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:189
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.
BLAZE_ALWAYS_INLINE void subAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the subtraction assignment of a matrix to matrix.
Definition: Matrix.h:849