35#ifndef _BLAZE_MATH_EXPRESSIONS_SMATTSMATSCHUREXPR_H_
36#define _BLAZE_MATH_EXPRESSIONS_SMATTSMATSCHUREXPR_H_
99 :
public SchurExpr< SparseMatrix< SMatTSMatSchurExpr<MT1,MT2>, false > >
132 template<
typename T1,
typename T2 >
133 static constexpr bool UseSymmetricKernel_v =
207 if( i >=
lhs_.rows() ) {
210 if( j >=
lhs_.columns() ) {
222 inline size_t rows() const noexcept {
233 return lhs_.columns();
284 template<
typename T >
285 inline bool canAlias(
const T* alias )
const noexcept {
286 return (
lhs_.canAlias( alias ) ||
rhs_.canAlias( alias ) );
296 template<
typename T >
297 inline bool isAliased(
const T* alias )
const noexcept {
298 return (
lhs_.isAliased( alias ) ||
rhs_.isAliased( alias ) );
321 template<
typename MT >
343 assign( *lhs, A % B );
361 template<
typename MT >
385 assign( *lhs, A % B );
403 template<
typename MT >
404 friend inline auto assign( SparseMatrix<MT,false>& lhs,
const SMatTSMatSchurExpr& rhs )
416 const OppositeType_t<RT2> B(
serial( rhs.rhs_ ) );
425 assign( *lhs, A % B );
443 template<
typename MT >
444 friend inline auto assign( SparseMatrix<MT,true>& lhs,
const SMatTSMatSchurExpr& rhs )
455 const OppositeType_t<RT1> A(
serial( rhs.lhs_ ) );
467 assign( *lhs, A % B );
485 template<
typename MT >
494 assign( *lhs, rhs.lhs_ %
trans( rhs.rhs_ ) );
512 template<
typename MT >
523 assign( *lhs,
trans( rhs.lhs_ ) % rhs.rhs_ );
541 template<
typename MT >
542 friend inline auto addAssign( DenseMatrix<MT,false>& lhs,
const SMatTSMatSchurExpr& rhs )
554 const OppositeType_t<RT2> B(
serial( rhs.rhs_ ) );
563 addAssign( *lhs, A % B );
581 template<
typename MT >
582 friend inline auto addAssign( DenseMatrix<MT,true>& lhs,
const SMatTSMatSchurExpr& rhs )
593 const OppositeType_t<RT1> A(
serial( rhs.lhs_ ) );
605 addAssign( *lhs, A % B );
623 template<
typename MT >
632 addAssign( *lhs, rhs.lhs_ %
trans( rhs.rhs_ ) );
650 template<
typename MT >
661 addAssign( *lhs,
trans( rhs.lhs_ ) % rhs.rhs_ );
683 template<
typename MT >
684 friend inline auto subAssign( DenseMatrix<MT,false>& lhs,
const SMatTSMatSchurExpr& rhs )
696 const OppositeType_t<RT2> B(
serial( rhs.rhs_ ) );
705 subAssign( *lhs, A % B );
723 template<
typename MT >
724 friend inline auto subAssign( DenseMatrix<MT,true>& lhs,
const SMatTSMatSchurExpr& rhs )
735 const OppositeType_t<RT1> A(
serial( rhs.lhs_ ) );
747 subAssign( *lhs, A % B );
765 template<
typename MT >
774 subAssign( *lhs, rhs.lhs_ %
trans( rhs.rhs_ ) );
792 template<
typename MT >
803 subAssign( *lhs,
trans( rhs.lhs_ ) % rhs.rhs_ );
825 template<
typename MT >
826 friend inline auto schurAssign( DenseMatrix<MT,false>& lhs,
const SMatTSMatSchurExpr& rhs )
838 const OppositeType_t<RT2> B(
serial( rhs.rhs_ ) );
847 schurAssign( *lhs, A % B );
865 template<
typename MT >
866 friend inline auto schurAssign( DenseMatrix<MT,true>& lhs,
const SMatTSMatSchurExpr& rhs )
877 const OppositeType_t<RT1> A(
serial( rhs.lhs_ ) );
889 schurAssign( *lhs, A % B );
907 template<
typename MT >
908 friend inline auto schurAssign( Matrix<MT,false>& lhs,
const SMatTSMatSchurExpr& rhs )
916 schurAssign( *lhs, rhs.lhs_ %
trans( rhs.rhs_ ) );
934 template<
typename MT >
945 schurAssign( *lhs,
trans( rhs.lhs_ ) % rhs.rhs_ );
995 template<
typename MT
1058template<
typename MT1
1095template<
typename MT1
1099inline decltype(
auto)
1114 return ReturnType( (*lhs).rows() );
1134template<
typename MT1
1141inline decltype(
auto)
1156 return ReturnType( (*lhs).rows(), (*lhs).columns() );
1191template<
typename MT1
1193inline decltype(
auto)
1198 if( (*lhs).rows() != (*rhs).rows() || (*lhs).columns() != (*rhs).columns() ) {
1202 return smattsmatschur( *lhs, *rhs );
Header file for auxiliary alias declarations.
typename T::ReturnType ReturnType_t
Alias declaration for nested ReturnType type definitions.
Definition Aliases.h:470
typename T::OppositeType OppositeType_t
Alias declaration for nested OppositeType type definitions.
Definition Aliases.h:310
typename T::CompositeType CompositeType_t
Alias declaration for nested CompositeType type definitions.
Definition Aliases.h:110
typename T::TransposeType TransposeType_t
Alias declaration for nested TransposeType type definitions.
Definition Aliases.h:550
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.
Definition Aliases.h:190
typename T::ResultType ResultType_t
Alias declaration for nested ResultType type definitions.
Definition Aliases.h:450
Header file for run time assertion macros.
Constraints on the storage order of matrix types.
Header file for the EnableIf class template.
Header file for the function trace functionality.
Constraint on the data type.
Header file for the If class template.
Header file for the IntegralConstant class template.
Header file for the IsExpression type trait class.
Header file for the IsLower type trait.
Header file for the IsStrictlyLower type trait.
Header file for the IsStrictlyUpper type trait.
Header file for the IsSymmetric type trait.
Header file for the IsTemporary type trait class.
Header file for the IsUniLower type trait.
Header file for the IsUniUpper type trait.
Header file for the IsUpper type trait.
Header file for the MAYBE_UNUSED function template.
Constraints on the storage order of matrix types.
Header file for the Schur product trait.
Constraint on the data type.
Constraint on the data type.
Base class for dense matrices.
Definition DenseMatrix.h:82
Expression object for sparse matrix-transpose sparse matrix Schur product.
Definition SMatTSMatSchurExpr.h:101
ReturnType_t< MT1 > RN1
Return type of the left-hand side sparse matrix expression.
Definition SMatTSMatSchurExpr.h:106
SMatTSMatSchurExpr(const MT1 &lhs, const MT2 &rhs) noexcept
Constructor for the SMatTSMatSchurExpr class.
Definition SMatTSMatSchurExpr.h:175
RightOperand rhs_
Right-hand side sparse matrix of the Schur product expression.
Definition SMatTSMatSchurExpr.h:305
ElementType_t< ResultType > ElementType
Resulting element type.
Definition SMatTSMatSchurExpr.h:149
ReturnType at(size_t i, size_t j) const
Checked access to the matrix elements.
Definition SMatTSMatSchurExpr.h:206
If_t< IsExpression_v< MT1 >, const MT1, const MT1 & > LeftOperand
Composite type of the left-hand side sparse matrix expression.
Definition SMatTSMatSchurExpr.h:158
ResultType_t< MT2 > RT2
Result type of the right-hand side sparse matrix expression.
Definition SMatTSMatSchurExpr.h:105
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row.
Definition SMatTSMatSchurExpr.h:253
decltype(std::declval< RN1 >() *std::declval< RN2 >()) ExprReturnType
Expression return type for the subscript operator.
Definition SMatTSMatSchurExpr.h:122
size_t rows() const noexcept
Returns the current number of rows of the matrix.
Definition SMatTSMatSchurExpr.h:222
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition SMatTSMatSchurExpr.h:297
If_t< IsExpression_v< MT2 >, const MT2, const MT2 & > RightOperand
Composite type of the right-hand side sparse matrix expression.
Definition SMatTSMatSchurExpr.h:161
ReturnType_t< MT2 > RN2
Return type of the right-hand side sparse matrix expression.
Definition SMatTSMatSchurExpr.h:107
const ResultType CompositeType
Data type for composite expression templates.
Definition SMatTSMatSchurExpr.h:155
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition SMatTSMatSchurExpr.h:191
OppositeType_t< ResultType > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition SMatTSMatSchurExpr.h:147
LeftOperand lhs_
Left-hand side sparse matrix of the Schur product expression.
Definition SMatTSMatSchurExpr.h:304
TransposeType_t< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition SMatTSMatSchurExpr.h:148
ResultType_t< MT1 > RT1
Result type of the left-hand side sparse matrix expression.
Definition SMatTSMatSchurExpr.h:104
LeftOperand leftOperand() const noexcept
Returns the left-hand side sparse matrix operand.
Definition SMatTSMatSchurExpr.h:263
size_t columns() const noexcept
Returns the current number of columns of the matrix.
Definition SMatTSMatSchurExpr.h:232
SchurTrait_t< RT1, RT2 > ResultType
Result type for expression template evaluations.
Definition SMatTSMatSchurExpr.h:146
static constexpr bool smpAssignable
Compilation switch for the expression template assignment strategy.
Definition SMatTSMatSchurExpr.h:166
const If_t< returnExpr, ExprReturnType, ElementType > ReturnType
Return type for expression template evaluations.
Definition SMatTSMatSchurExpr.h:152
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition SMatTSMatSchurExpr.h:285
CompositeType_t< MT2 > CT2
Composite type of the right-hand side sparse matrix expression.
Definition SMatTSMatSchurExpr.h:109
CompositeType_t< MT1 > CT1
Composite type of the left-hand side sparse matrix expression.
Definition SMatTSMatSchurExpr.h:108
SMatTSMatSchurExpr< MT1, MT2 > This
Type of this SMatTSMatSchurExpr instance.
Definition SMatTSMatSchurExpr.h:141
RightOperand rightOperand() const noexcept
Returns the right-hand side transpose sparse matrix operand.
Definition SMatTSMatSchurExpr.h:273
static constexpr bool returnExpr
Compilation switch for the selection of the subscript operator return type.
Definition SMatTSMatSchurExpr.h:119
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition SMatTSMatSchurExpr.h:242
SchurExpr< SparseMatrix< This, false > > BaseType
Base type of this SMatTSMatSchurExpr instance.
Definition SMatTSMatSchurExpr.h:144
Base class for sparse matrices.
Definition SparseMatrix.h:77
Constraint on the data type.
Constraint on the data type.
Header file for the Computation base class.
Header file for the SchurExpr base class.
Header file for the SparseMatrix base class.
decltype(auto) min(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise minimum of the dense matrices lhs and rhs.
Definition DMatDMatMapExpr.h:1339
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition DMatTransExpr.h:766
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition DMatSerialExpr.h:812
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.
Definition Symmetric.h:79
#define BLAZE_CONSTRAINT_MUST_BE_ROW_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.
Definition RowMajorMatrix.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_BE_ZERO_TYPE(T)
Constraint on the data type.
Definition Zero.h:81
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE(T)
Constraint on the data type.
Definition SparseMatrix.h:61
#define BLAZE_CONSTRAINT_MUST_BE_IDENTITY_MATRIX_TYPE(T)
Constraint on the data type.
Definition Identity.h:60
#define BLAZE_CONSTRAINT_MUST_FORM_VALID_SCHUREXPR(T1, T2)
Constraint on the data type.
Definition SchurExpr.h:103
#define BLAZE_CONSTRAINT_MUST_BE_COLUMN_MAJOR_MATRIX_TYPE(T)
Constraint on the data type.
Definition ColumnMajorMatrix.h:61
#define BLAZE_CONSTRAINT_MUST_BE_ZERO_TYPE(T)
Constraint on the data type.
Definition Zero.h:61
typename SchurTrait< T1, T2 >::Type SchurTrait_t
Auxiliary alias declaration for the SchurTrait class template.
Definition SchurTrait.h:137
constexpr bool IsStrictlyUpper_v
Auxiliary variable template for the IsStrictlyUpper type trait.
Definition IsStrictlyUpper.h:173
constexpr bool IsSymmetric_v
Auxiliary variable template for the IsSymmetric type trait.
Definition IsSymmetric.h:172
constexpr bool IsUniUpper_v
Auxiliary variable template for the IsUniUpper type trait.
Definition IsUniUpper.h:173
constexpr bool IsStrictlyLower_v
Auxiliary variable template for the IsStrictlyLower type trait.
Definition IsStrictlyLower.h:173
constexpr bool IsUpper_v
Auxiliary variable template for the IsUpper type trait.
Definition IsUpper.h:175
constexpr bool StorageOrder_v
Auxiliary variable template for the StorageOrder type trait.
Definition StorageOrder.h:93
constexpr bool IsZero_v
Auxiliary variable template for the IsZero type trait.
Definition IsZero.h:166
constexpr bool IsTemporary_v
Auxiliary variable template for the IsTemporary type trait.
Definition IsTemporary.h:88
constexpr bool IsLower_v
Auxiliary variable template for the IsLower type trait.
Definition IsLower.h:175
constexpr bool IsUniLower_v
Auxiliary variable template for the IsUniLower type trait.
Definition IsUniLower.h:173
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.
Definition Assert.h:101
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
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition MaybeUnused.h:81
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.
Definition EnableIf.h:138
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.
Definition Exception.h:331
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.
Definition Exception.h:235
#define BLAZE_FUNCTION_TRACE
Function trace macro.
Definition FunctionTrace.h:94
typename If< Condition >::template Type< T1, T2 > If_t
Auxiliary alias template for the If class template.
Definition If.h:108
typename EnableIf<!Condition, T >::Type DisableIf_t
Auxiliary type for the EnableIf class template.
Definition EnableIf.h:175
Header file for the exception macros of the math module.
Header file for all forward declarations for expression class templates.
Header file for all forward declarations for sparse vectors and matrices.
Header file for the StorageOrder type trait.
Header file for the serial shim.
Base class for all compute expression templates.
Definition Computation.h:68
Base class for all Schur product expression templates.
Definition SchurExpr.h:68
Header file for the IsZero type trait.
Header file for basic type definitions.
Header file for the generic min algorithm.