All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SparseVector.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_SMP_DEFAULT_SPARSEVECTOR_H_
36 #define _BLAZE_MATH_SMP_DEFAULT_SPARSEVECTOR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
45 #include <blaze/util/Assert.h>
48 
49 
50 namespace blaze {
51 
52 //=================================================================================================
53 //
54 // GLOBAL FUNCTIONS
55 //
56 //=================================================================================================
57 
58 //*************************************************************************************************
61 template< typename VT1, bool TF1, typename VT2, bool TF2 >
62 inline void smpAssign( SparseVector<VT1,TF1>& lhs, const Vector<VT2,TF2>& rhs );
63 
64 template< typename VT1, bool TF1, typename VT2, bool TF2 >
65 inline void smpAddAssign( SparseVector<VT1,TF1>& lhs, const Vector<VT2,TF2>& rhs );
66 
67 template< typename VT1, bool TF1, typename VT2, bool TF2 >
68 inline void smpSubAssign( SparseVector<VT1,TF1>& lhs, const Vector<VT2,TF2>& rhs );
69 
70 template< typename VT1, bool TF1, typename VT2, bool TF2 >
71 inline void smpMultAssign( SparseVector<VT1,TF1>& lhs, const Vector<VT2,TF2>& rhs );
73 //*************************************************************************************************
74 
75 
76 //*************************************************************************************************
90 template< typename VT1 // Type of the left-hand side sparse vector
91  , bool TF1 // Transpose flag of the left-hand side sparse vector
92  , typename VT2 // Type of the right-hand side vector
93  , bool TF2 > // Transpose flag of the right-hand side vector
94 inline void smpAssign( SparseVector<VT1,TF1>& lhs, const Vector<VT2,TF2>& rhs )
95 {
97 
98  BLAZE_INTERNAL_ASSERT( (~lhs).size() == (~rhs).size(), "Invalid vector sizes" );
99  assign( ~lhs, ~rhs );
100 }
101 //*************************************************************************************************
102 
103 
104 //*************************************************************************************************
118 template< typename VT1 // Type of the left-hand side sparse vector
119  , bool TF1 // Transpose flag of the left-hand side sparse vector
120  , typename VT2 // Type of the right-hand side vector
121  , bool TF2 > // Transpose flag of the right-hand side vector
122 inline void smpAddAssign( SparseVector<VT1,TF1>& lhs, const Vector<VT2,TF2>& rhs )
123 {
125 
126  BLAZE_INTERNAL_ASSERT( (~lhs).size() == (~rhs).size(), "Invalid vector sizes" );
127  addAssign( ~lhs, ~rhs );
128 }
129 //*************************************************************************************************
130 
131 
132 //*************************************************************************************************
147 template< typename VT1 // Type of the left-hand side sparse vector
148  , bool TF1 // Transpose flag of the left-hand side sparse vector
149  , typename VT2 // Type of the right-hand side vector
150  , bool TF2 > // Transpose flag of the right-hand side vector
151 inline void smpSubAssign( SparseVector<VT1,TF1>& lhs, const Vector<VT2,TF2>& rhs )
152 {
154 
155  BLAZE_INTERNAL_ASSERT( (~lhs).size() == (~rhs).size(), "Invalid vector sizes" );
156  subAssign( ~lhs, ~rhs );
157 }
158 //*************************************************************************************************
159 
160 
161 //*************************************************************************************************
176 template< typename VT1 // Type of the left-hand side sparse vector
177  , bool TF1 // Transpose flag of the left-hand side sparse vector
178  , typename VT2 // Type of the right-hand side vector
179  , bool TF2 > // Transpose flag of the right-hand side vector
180 inline void smpMultAssign( SparseVector<VT1,TF1>& lhs, const Vector<VT2,TF2>& rhs )
181 {
183 
184  BLAZE_INTERNAL_ASSERT( (~lhs).size() == (~rhs).size(), "Invalid vector sizes" );
185  multAssign( ~lhs, ~rhs );
186 }
187 //*************************************************************************************************
188 
189 } // namespace blaze
190 
191 #endif
Header file for the SparseVector base class.
void smpSubAssign(DenseMatrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:152
void smpMultAssign(DenseVector< 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:179
void smpAddAssign(DenseMatrix< 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:122
Compile time assertion.
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:271
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:361
void smpAssign(DenseMatrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:92
Header file for run time assertion macros.
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:301
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:331
Base class for N-dimensional vectors.The Vector class is a base class for all arbitrarily sized (N-di...
Definition: Forward.h:151
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:108
#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
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.