35#ifndef _BLAZE_MATH_EXPRESSIONS_SMATSMATEQUALEXPR_H_
36#define _BLAZE_MATH_EXPRESSIONS_SMATSMATEQUALEXPR_H_
75inline bool equal(
const SparseMatrix<MT1,false>& lhs,
const SparseMatrix<MT2,false>& rhs )
77 using CT1 = CompositeType_t<MT1>;
78 using CT2 = CompositeType_t<MT2>;
81 if( (*lhs).rows() != (*rhs).rows() || (*lhs).columns() != (*rhs).columns() )
90 for(
size_t i=0UL; i<A.rows(); ++i )
92 const auto lend( A.end(i) );
93 const auto rend( B.end(i) );
95 auto lelem( A.begin(i) );
96 auto relem( B.begin(i) );
98 while( lelem != lend && relem != rend )
100 if( lelem->index() < relem->index() ) {
101 if( !isDefault<RF>( lelem->value() ) )
105 else if( lelem->index() > relem->index() ) {
106 if( !isDefault<RF>( relem->value() ) )
110 else if( !equal<RF>( lelem->value(), relem->value() ) ) {
119 while( lelem != lend ) {
120 if( !isDefault<RF>( lelem->value() ) )
125 while( relem != rend ) {
126 if( !isDefault<RF>( relem->value() ) )
154inline bool equal(
const SparseMatrix<MT1,true>& lhs,
const SparseMatrix<MT2,true>& rhs )
156 using CT1 = CompositeType_t<MT1>;
157 using CT2 = CompositeType_t<MT2>;
160 if( (*lhs).rows() != (*rhs).rows() || (*lhs).columns() != (*rhs).columns() )
169 for(
size_t j=0UL; j<A.columns(); ++j )
171 const auto lend( A.end(j) );
172 const auto rend( B.end(j) );
174 auto lelem( A.begin(j) );
175 auto relem( B.begin(j) );
177 while( lelem != lend && relem != rend )
179 if( lelem->index() < relem->index() ) {
180 if( !isDefault<RF>( lelem->value() ) )
184 else if( lelem->index() > relem->index() ) {
185 if( !isDefault<RF>( relem->value() ) )
189 else if( !equal<RF>( lelem->value(), relem->value() ) ) {
198 while( lelem != lend ) {
199 if( !isDefault<RF>( lelem->value() ) )
204 while( relem != rend ) {
205 if( !isDefault<RF>( relem->value() ) )
234inline bool equal(
const SparseMatrix<MT1,SO>& lhs,
const SparseMatrix<MT2,!SO>& rhs )
236 const OppositeType_t<MT2> tmp( *rhs );
237 return equal<RF>( *lhs, tmp );
251template<
typename MT1
257 return equal<relaxed>( lhs, rhs );
270template<
typename MT1
276 return !equal<relaxed>( lhs, rhs );
Header file for auxiliary alias declarations.
Header file for the isDefault shim.
Header file for the relaxation flag enumeration.
Base class for sparse matrices.
Definition: SparseMatrix.h:77
Header file for the SparseMatrix base class.
RelaxationFlag
Relaxation flag for strict or relaxed semantics.
Definition: RelaxationFlag.h:66
bool operator!=(const SparseMatrix< MT1, SO1 > &lhs, const SparseMatrix< MT2, SO2 > &rhs)
Inequality operator for the comparison of two sparse matrices.
Definition: SMatSMatEqualExpr.h:274
bool operator==(const SparseMatrix< MT1, SO1 > &lhs, const SparseMatrix< MT2, SO2 > &rhs)
Equality operator for the comparison of two sparse matrices.
Definition: SMatSMatEqualExpr.h:255
bool equal(const SharedValue< T1 > &lhs, const SharedValue< T2 > &rhs)
Equality check for a two shared values.
Definition: SharedValue.h:343
Header file for the equal shim.
Header file for basic type definitions.