Blaze
3.9
Toggle main menu visibility
Loading...
Searching...
No Matches
blaze
math
smp
default
SparseMatrix.h
Go to the documentation of this file.
1
//=================================================================================================
33
//=================================================================================================
34
35
#ifndef _BLAZE_MATH_SMP_DEFAULT_SPARSEMATRIX_H_
36
#define _BLAZE_MATH_SMP_DEFAULT_SPARSEMATRIX_H_
37
38
39
//*************************************************************************************************
40
// Includes
41
//*************************************************************************************************
42
43
#include <
blaze/math/expressions/Matrix.h
>
44
#include <
blaze/math/typetraits/IsSparseMatrix.h
>
45
#include <
blaze/util/Assert.h
>
46
#include <
blaze/util/EnableIf.h
>
47
#include <
blaze/util/FunctionTrace.h
>
48
49
50
namespace
blaze {
51
52
//=================================================================================================
53
//
54
// GLOBAL FUNCTIONS
55
//
56
//=================================================================================================
57
58
//*************************************************************************************************
61
template
<
typename
MT1,
bool
SO1,
typename
MT2,
bool
SO2 >
62
auto
smpAssign
(
Matrix<MT1,SO1>
& lhs,
const
Matrix<MT2,SO2>
& rhs )
63
->
EnableIf_t< IsSparseMatrix_v<MT1>
>;
64
65
template
<
typename
MT1,
bool
SO1,
typename
MT2,
bool
SO2 >
66
auto
smpAddAssign
(
Matrix<MT1,SO1>
& lhs,
const
Matrix<MT2,SO2>
& rhs )
67
->
EnableIf_t< IsSparseMatrix_v<MT1>
>;
68
69
template
<
typename
MT1,
bool
SO1,
typename
MT2,
bool
SO2 >
70
auto
smpSubAssign
(
Matrix<MT1,SO1>
& lhs,
const
Matrix<MT2,SO2>
& rhs )
71
->
EnableIf_t< IsSparseMatrix_v<MT1>
>;
72
73
template
<
typename
MT1,
bool
SO1,
typename
MT2,
bool
SO2 >
74
auto
smpSchurAssign
(
Matrix<MT1,SO1>
& lhs,
const
Matrix<MT2,SO2>
& rhs )
75
->
EnableIf_t< IsSparseMatrix_v<MT1>
>;
77
//*************************************************************************************************
78
79
80
//*************************************************************************************************
94
template
<
typename
MT1
// Type of the left-hand side sparse matrix
95
,
bool
SO1
// Storage order of the left-hand side sparse matrix
96
,
typename
MT2
// Type of the right-hand side matrix
97
,
bool
SO2 >
// Storage order of the right-hand side matrix
98
inline
auto
smpAssign
(
Matrix<MT1,SO1>
& lhs,
const
Matrix<MT2,SO2>
& rhs )
99
->
EnableIf_t< IsSparseMatrix_v<MT1>
>
100
{
101
BLAZE_FUNCTION_TRACE
;
102
103
BLAZE_INTERNAL_ASSERT
( (*lhs).rows() == (*rhs).rows() ,
"Invalid number of rows"
);
104
BLAZE_INTERNAL_ASSERT
( (*lhs).columns() == (*rhs).columns(),
"Invalid number of columns"
);
105
106
assign( *lhs, *rhs );
107
}
108
//*************************************************************************************************
109
110
111
//*************************************************************************************************
125
template
<
typename
MT1
// Type of the left-hand side sparse matrix
126
,
bool
SO1
// Storage order of the left-hand side sparse matrix
127
,
typename
MT2
// Type of the right-hand side matrix
128
,
bool
SO2 >
// Storage order of the right-hand side matrix
129
inline
auto
smpAddAssign
(
Matrix<MT1,SO1>
& lhs,
const
Matrix<MT2,SO2>
& rhs )
130
->
EnableIf_t< IsSparseMatrix_v<MT1>
>
131
{
132
BLAZE_FUNCTION_TRACE
;
133
134
BLAZE_INTERNAL_ASSERT
( (*lhs).rows() == (*rhs).rows() ,
"Invalid number of rows"
);
135
BLAZE_INTERNAL_ASSERT
( (*lhs).columns() == (*rhs).columns(),
"Invalid number of columns"
);
136
137
addAssign( *lhs, *rhs );
138
}
139
//*************************************************************************************************
140
141
142
//*************************************************************************************************
156
template
<
typename
MT1
// Type of the left-hand side sparse matrix
157
,
bool
SO1
// Storage order of the left-hand side sparse matrix
158
,
typename
MT2
// Type of the right-hand side matrix
159
,
bool
SO2 >
// Storage order of the right-hand side matrix
160
inline
auto
smpSubAssign
(
Matrix<MT1,SO1>
& lhs,
const
Matrix<MT2,SO2>
& rhs )
161
->
EnableIf_t< IsSparseMatrix_v<MT1>
>
162
{
163
BLAZE_FUNCTION_TRACE
;
164
165
BLAZE_INTERNAL_ASSERT
( (*lhs).rows() == (*rhs).rows() ,
"Invalid number of rows"
);
166
BLAZE_INTERNAL_ASSERT
( (*lhs).columns() == (*rhs).columns(),
"Invalid number of columns"
);
167
168
subAssign( *lhs, *rhs );
169
}
170
//*************************************************************************************************
171
172
173
//*************************************************************************************************
188
template
<
typename
MT1
// Type of the left-hand side sparse matrix
189
,
bool
SO1
// Storage order of the left-hand side sparse matrix
190
,
typename
MT2
// Type of the right-hand side matrix
191
,
bool
SO2 >
// Storage order of the right-hand side matrix
192
inline
auto
smpSchurAssign
(
Matrix<MT1,SO1>
& lhs,
const
Matrix<MT2,SO2>
& rhs )
193
->
EnableIf_t< IsSparseMatrix_v<MT1>
>
194
{
195
BLAZE_FUNCTION_TRACE
;
196
197
BLAZE_INTERNAL_ASSERT
( (*lhs).rows() == (*rhs).rows() ,
"Invalid number of rows"
);
198
BLAZE_INTERNAL_ASSERT
( (*lhs).columns() == (*rhs).columns(),
"Invalid number of columns"
);
199
200
schurAssign( *lhs, *rhs );
201
}
202
//*************************************************************************************************
203
204
}
// namespace blaze
205
206
#endif
Assert.h
Header file for run time assertion macros.
EnableIf.h
Header file for the EnableIf class template.
FunctionTrace.h
Header file for the function trace functionality.
IsSparseMatrix.h
Header file for the IsSparseMatrix type trait.
blaze::Matrix
Base class for matrices.
Definition
Matrix.h:85
Matrix.h
Header file for the Matrix base class.
BLAZE_INTERNAL_ASSERT
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.
Definition
Assert.h:101
blaze::smpSubAssign
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
blaze::smpAssign
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
blaze::smpSchurAssign
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
blaze::smpAddAssign
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
blaze::EnableIf_t
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.
Definition
EnableIf.h:138
BLAZE_FUNCTION_TRACE
#define BLAZE_FUNCTION_TRACE
Function trace macro.
Definition
FunctionTrace.h:94
Generated by
1.18.0