22 #ifndef _BLAZE_MATH_DENSEMATRIX_H_
23 #define _BLAZE_MATH_DENSEMATRIX_H_
94 template<
typename T1,
typename T2 >
95 inline bool operator==(
const DenseMatrix<T1,false>& lhs,
const DenseMatrix<T2,false>& rhs );
97 template<
typename T1,
typename T2 >
98 inline bool operator==(
const DenseMatrix<T1,true>& lhs,
const DenseMatrix<T2,true>& rhs );
100 template<
typename T1,
typename T2,
bool SO >
101 inline bool operator==(
const DenseMatrix<T1,SO>& lhs,
const DenseMatrix<T2,!SO>& rhs );
103 template<
typename T1,
typename T2,
bool SO >
104 inline bool operator==(
const DenseMatrix<T1,SO>& lhs,
const SparseMatrix<T2,false>& rhs );
106 template<
typename T1,
typename T2,
bool SO >
107 inline bool operator==(
const DenseMatrix<T1,SO>& lhs,
const SparseMatrix<T2,true>& rhs );
109 template<
typename T1,
bool SO1,
typename T2,
bool SO2 >
110 inline bool operator==(
const SparseMatrix<T1,SO1>& lhs,
const DenseMatrix<T2,SO2>& rhs );
112 template<
typename T1,
typename T2 >
113 inline typename EnableIf< IsNumeric<T2>,
bool >::Type
114 operator==(
const DenseMatrix<T1,false>& mat, T2 scalar );
116 template<
typename T1,
typename T2 >
117 inline typename EnableIf< IsNumeric<T2>,
bool >::Type
118 operator==(
const DenseMatrix<T1,true>& mat, T2 scalar );
120 template<
typename T1,
typename T2,
bool SO >
121 inline typename EnableIf< IsNumeric<T2>,
bool >::Type
122 operator==( T1 scalar,
const DenseMatrix<T2,SO>& mat );
124 template<
typename T1,
bool SO1,
typename T2,
bool SO2 >
125 inline bool operator!=(
const DenseMatrix<T1,SO1>& lhs,
const DenseMatrix<T2,SO2>& rhs );
127 template<
typename T1,
bool SO1,
typename T2,
bool SO2 >
128 inline bool operator!=(
const DenseMatrix<T1,SO1>& lhs,
const SparseMatrix<T2,SO2>& rhs );
130 template<
typename T1,
bool SO1,
typename T2,
bool SO2 >
131 inline bool operator!=(
const SparseMatrix<T1,SO1>& lhs,
const DenseMatrix<T2,SO2>& rhs );
133 template<
typename T1,
typename T2,
bool SO >
134 inline typename EnableIf< IsNumeric<T2>,
bool >::Type
135 operator!=(
const DenseMatrix<T1,SO>& mat, T2 scalar );
137 template<
typename T1,
typename T2,
bool SO >
138 inline typename EnableIf< IsNumeric<T2>,
bool >::Type
139 operator!=( T1 scalar,
const DenseMatrix<T2,SO>& mat );
152 template<
typename T1
156 typedef typename T1::CompositeType CT1;
157 typedef typename T2::CompositeType CT2;
169 for(
size_t i=0; i<A.rows(); ++i ) {
170 for(
size_t j=0; j<A.columns(); ++j ) {
171 if( !
equal( A(i,j), B(i,j) ) )
return false;
188 template<
typename T1
192 typedef typename T1::CompositeType CT1;
193 typedef typename T2::CompositeType CT2;
205 for(
size_t j=0; j<A.columns(); ++j ) {
206 for(
size_t i=0; i<A.rows(); ++i ) {
207 if( !
equal( A(i,j), B(i,j) ) )
return false;
224 template<
typename T1
229 typedef typename T1::CompositeType CT1;
230 typedef typename T2::CompositeType CT2;
242 const size_t rows ( A.rows() );
243 const size_t columns( A.columns() );
244 const size_t block ( 16 );
246 for(
size_t ii=0; ii<
rows; ii+=block ) {
247 const size_t iend( ( rows < ii+block )?( rows ):( ii+block ) );
248 for(
size_t jj=0; jj<
columns; jj+=block ) {
249 const size_t jend( ( columns < jj+block )?( columns ):( jj+block ) );
250 for(
size_t i=ii; i<iend; ++i ) {
251 for(
size_t j=jj; j<jend; ++j ) {
252 if( !
equal( A(i,j), B(i,j) ) )
return false;
271 template<
typename T1
276 typedef typename T1::CompositeType CT1;
277 typedef typename T2::CompositeType CT2;
292 for(
size_t i=0; i<B.rows(); ++i ) {
294 for( ConstIterator element=B.begin(i); element!=B.end(i); ++element, ++j ) {
295 for( ; j<element->index(); ++j ) {
298 if( !
equal( element->value(), A(i,j) ) )
return false;
300 for( ; j<A.columns(); ++j ) {
318 template<
typename T1
323 typedef typename T1::CompositeType CT1;
324 typedef typename T2::CompositeType CT2;
339 for(
size_t j=0; j<B.columns(); ++j ) {
341 for( ConstIterator element=B.begin(j); element!=B.end(j); ++element, ++i ) {
342 for( ; i<element->index(); ++i ) {
345 if( !
equal( element->value(), A(i,j) ) )
return false;
347 for( ; i<A.rows(); ++i ) {
365 template<
typename T1
371 return ( rhs == lhs );
388 template<
typename T1
390 inline typename EnableIf< IsNumeric<T2>,
bool >::Type
393 typedef typename T1::CompositeType CT1;
400 for(
size_t i=0; i<A.rows(); ++i ) {
401 for(
size_t j=0; j<A.columns(); ++j ) {
402 if( !
equal( A(i,j), scalar ) )
return false;
423 template<
typename T1
425 inline typename EnableIf< IsNumeric<T2>,
bool >::Type
428 typedef typename T1::CompositeType CT1;
435 for(
size_t j=0; j<A.columns(); ++j ) {
436 for(
size_t i=0; i<A.rows(); ++i ) {
437 if( !
equal( A(i,j), scalar ) )
return false;
458 template<
typename T1
461 inline typename EnableIf< IsNumeric<T1>,
bool >::Type
464 return ( mat == scalar );
477 template<
typename T1
483 return !( lhs == rhs );
496 template<
typename T1
502 return !( lhs == rhs );
515 template<
typename T1
521 return !( rhs == lhs );
538 template<
typename T1
541 inline typename EnableIf< IsNumeric<T2>,
bool >::Type
544 return !( mat == scalar );
561 template<
typename T1
564 inline typename EnableIf< IsNumeric<T1>,
bool >::Type
567 return !( mat == scalar );