All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DenseMatrix.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_DENSE_DENSEMATRIX_H_
36 #define _BLAZE_MATH_DENSE_DENSEMATRIX_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
45 #include <blaze/math/Functions.h>
46 #include <blaze/math/shims/Equal.h>
48 #include <blaze/math/shims/IsNaN.h>
55 #include <blaze/util/Assert.h>
56 #include <blaze/util/EnableIf.h>
57 #include <blaze/util/mpl/If.h>
58 #include <blaze/util/Types.h>
61 
62 
63 namespace blaze {
64 
65 //=================================================================================================
66 //
67 // GLOBAL OPERATORS
68 //
69 //=================================================================================================
70 
71 //*************************************************************************************************
74 template< typename T1, typename T2 >
75 inline bool operator==( const DenseMatrix<T1,false>& lhs, const DenseMatrix<T2,false>& rhs );
76 
77 template< typename T1, typename T2 >
78 inline bool operator==( const DenseMatrix<T1,true>& lhs, const DenseMatrix<T2,true>& rhs );
79 
80 template< typename T1, typename T2, bool SO >
81 inline bool operator==( const DenseMatrix<T1,SO>& lhs, const DenseMatrix<T2,!SO>& rhs );
82 
83 template< typename T1, typename T2, bool SO >
84 inline bool operator==( const DenseMatrix<T1,SO>& lhs, const SparseMatrix<T2,false>& rhs );
85 
86 template< typename T1, typename T2, bool SO >
87 inline bool operator==( const DenseMatrix<T1,SO>& lhs, const SparseMatrix<T2,true>& rhs );
88 
89 template< typename T1, bool SO1, typename T2, bool SO2 >
90 inline bool operator==( const SparseMatrix<T1,SO1>& lhs, const DenseMatrix<T2,SO2>& rhs );
91 
92 template< typename T1, typename T2 >
93 inline typename EnableIf< IsNumeric<T2>, bool >::Type
94  operator==( const DenseMatrix<T1,false>& mat, T2 scalar );
95 
96 template< typename T1, typename T2 >
97 inline typename EnableIf< IsNumeric<T2>, bool >::Type
98  operator==( const DenseMatrix<T1,true>& mat, T2 scalar );
99 
100 template< typename T1, typename T2, bool SO >
101 inline typename EnableIf< IsNumeric<T2>, bool >::Type
102  operator==( T1 scalar, const DenseMatrix<T2,SO>& mat );
103 
104 template< typename T1, bool SO1, typename T2, bool SO2 >
105 inline bool operator!=( const DenseMatrix<T1,SO1>& lhs, const DenseMatrix<T2,SO2>& rhs );
106 
107 template< typename T1, bool SO1, typename T2, bool SO2 >
108 inline bool operator!=( const DenseMatrix<T1,SO1>& lhs, const SparseMatrix<T2,SO2>& rhs );
109 
110 template< typename T1, bool SO1, typename T2, bool SO2 >
111 inline bool operator!=( const SparseMatrix<T1,SO1>& lhs, const DenseMatrix<T2,SO2>& rhs );
112 
113 template< typename T1, typename T2, bool SO >
114 inline typename EnableIf< IsNumeric<T2>, bool >::Type
115  operator!=( const DenseMatrix<T1,SO>& mat, T2 scalar );
116 
117 template< typename T1, typename T2, bool SO >
118 inline typename EnableIf< IsNumeric<T2>, bool >::Type
119  operator!=( T1 scalar, const DenseMatrix<T2,SO>& mat );
121 //*************************************************************************************************
122 
123 
124 //*************************************************************************************************
132 template< typename T1 // Type of the left-hand side dense matrix
133  , typename T2 > // Type of the right-hand side dense matrix
134 inline bool operator==( const DenseMatrix<T1,false>& lhs, const DenseMatrix<T2,false>& rhs )
135 {
136  typedef typename T1::CompositeType CT1;
137  typedef typename T2::CompositeType CT2;
138 
139  // Early exit in case the matrix sizes don't match
140  if( (~lhs).rows() != (~rhs).rows() || (~lhs).columns() != (~rhs).columns() )
141  return false;
142 
143  // Evaluation of the two dense matrix operands
144  CT1 A( ~lhs );
145  CT2 B( ~rhs );
146 
147  // In order to compare the two matrices, the data values of the lower-order data
148  // type are converted to the higher-order data type within the equal function.
149  for( size_t i=0; i<A.rows(); ++i ) {
150  for( size_t j=0; j<A.columns(); ++j ) {
151  if( !equal( A(i,j), B(i,j) ) ) return false;
152  }
153  }
154 
155  return true;
156 }
157 //*************************************************************************************************
158 
159 
160 //*************************************************************************************************
168 template< typename T1 // Type of the left-hand side dense matrix
169  , typename T2 > // Type of the right-hand side dense matrix
170 inline bool operator==( const DenseMatrix<T1,true>& lhs, const DenseMatrix<T2,true>& rhs )
171 {
172  typedef typename T1::CompositeType CT1;
173  typedef typename T2::CompositeType CT2;
174 
175  // Early exit in case the matrix sizes don't match
176  if( (~lhs).rows() != (~rhs).rows() || (~lhs).columns() != (~rhs).columns() )
177  return false;
178 
179  // Evaluation of the two dense matrix operands
180  CT1 A( ~lhs );
181  CT2 B( ~rhs );
182 
183  // In order to compare the two matrices, the data values of the lower-order data
184  // type are converted to the higher-order data type within the equal function.
185  for( size_t j=0; j<A.columns(); ++j ) {
186  for( size_t i=0; i<A.rows(); ++i ) {
187  if( !equal( A(i,j), B(i,j) ) ) return false;
188  }
189  }
190 
191  return true;
192 }
193 //*************************************************************************************************
194 
195 
196 //*************************************************************************************************
204 template< typename T1 // Type of the left-hand side dense matrix
205  , typename T2 // Type of the right-hand side dense matrix
206  , bool SO > // Storage order
207 inline bool operator==( const DenseMatrix<T1,SO>& lhs, const DenseMatrix<T2,!SO>& rhs )
208 {
209  typedef typename T1::CompositeType CT1;
210  typedef typename T2::CompositeType CT2;
211 
212  // Early exit in case the matrix sizes don't match
213  if( (~lhs).rows() != (~rhs).rows() || (~lhs).columns() != (~rhs).columns() )
214  return false;
215 
216  // Evaluation of the two dense matrix operands
217  CT1 A( ~lhs );
218  CT2 B( ~rhs );
219 
220  // In order to compare the two matrices, the data values of the lower-order data
221  // type are converted to the higher-order data type within the equal function.
222  const size_t rows ( A.rows() );
223  const size_t columns( A.columns() );
224  const size_t block ( 16 );
225 
226  for( size_t ii=0; ii<rows; ii+=block ) {
227  const size_t iend( ( rows < ii+block )?( rows ):( ii+block ) );
228  for( size_t jj=0; jj<columns; jj+=block ) {
229  const size_t jend( ( columns < jj+block )?( columns ):( jj+block ) );
230  for( size_t i=ii; i<iend; ++i ) {
231  for( size_t j=jj; j<jend; ++j ) {
232  if( !equal( A(i,j), B(i,j) ) ) return false;
233  }
234  }
235  }
236  }
237 
238  return true;
239 }
240 //*************************************************************************************************
241 
242 
243 //*************************************************************************************************
251 template< typename T1 // Type of the left-hand side dense matrix
252  , typename T2 // Type of the right-hand side sparse matrix
253  , bool SO > // Storage order of the left-hand side dense matrix
254 inline bool operator==( const DenseMatrix<T1,SO>& lhs, const SparseMatrix<T2,false>& rhs )
255 {
256  typedef typename T1::CompositeType CT1;
257  typedef typename T2::CompositeType CT2;
259 
260  // Early exit in case the matrix sizes don't match
261  if( (~lhs).rows() != (~rhs).rows() || (~lhs).columns() != (~rhs).columns() )
262  return false;
263 
264  // Evaluation of the dense matrix and sparse matrix operand
265  CT1 A( ~lhs );
266  CT2 B( ~rhs );
267 
268  // In order to compare the two matrices, the data values of the lower-order data
269  // type are converted to the higher-order data type within the equal function.
270  size_t j( 0 );
271 
272  for( size_t i=0; i<B.rows(); ++i ) {
273  j = 0;
274  for( ConstIterator element=B.begin(i); element!=B.end(i); ++element, ++j ) {
275  for( ; j<element->index(); ++j ) {
276  if( !isDefault( A(i,j) ) ) return false;
277  }
278  if( !equal( element->value(), A(i,j) ) ) return false;
279  }
280  for( ; j<A.columns(); ++j ) {
281  if( !isDefault( A(i,j) ) ) return false;
282  }
283  }
284 
285  return true;
286 }
287 //*************************************************************************************************
288 
289 
290 //*************************************************************************************************
298 template< typename T1 // Type of the left-hand side dense matrix
299  , typename T2 // Type of the right-hand side sparse matrix
300  , bool SO > // Storage order of the left-hand side dense matrix
301 inline bool operator==( const DenseMatrix<T1,SO>& lhs, const SparseMatrix<T2,true>& rhs )
302 {
303  typedef typename T1::CompositeType CT1;
304  typedef typename T2::CompositeType CT2;
306 
307  // Early exit in case the matrix sizes don't match
308  if( (~lhs).rows() != (~rhs).rows() || (~lhs).columns() != (~rhs).columns() )
309  return false;
310 
311  // Evaluation of the dense matrix and sparse matrix operand
312  CT1 A( ~lhs );
313  CT2 B( ~rhs );
314 
315  // In order to compare the two matrices, the data values of the lower-order data
316  // type are converted to the higher-order data type within the equal function.
317  size_t i( 0 );
318 
319  for( size_t j=0; j<B.columns(); ++j ) {
320  i = 0;
321  for( ConstIterator element=B.begin(j); element!=B.end(j); ++element, ++i ) {
322  for( ; i<element->index(); ++i ) {
323  if( !isDefault( A(i,j) ) ) return false;
324  }
325  if( !equal( element->value(), A(i,j) ) ) return false;
326  }
327  for( ; i<A.rows(); ++i ) {
328  if( !isDefault( A(i,j) ) ) return false;
329  }
330  }
331 
332  return true;
333 }
334 //*************************************************************************************************
335 
336 
337 //*************************************************************************************************
345 template< typename T1 // Type of the left-hand side sparse matrix
346  , bool SO1 // Storage order of the left-hand side sparse matrix
347  , typename T2 // Type of the right-hand side dense matrix
348  , bool SO2 > // Storage order of the right-hand side sparse matrix
349 inline bool operator==( const SparseMatrix<T1,SO1>& lhs, const DenseMatrix<T2,SO2>& rhs )
350 {
351  return ( rhs == lhs );
352 }
353 //*************************************************************************************************
354 
355 
356 //*************************************************************************************************
368 template< typename T1 // Type of the left-hand side dense matrix
369  , typename T2 > // Type of the right-hand side scalar
370 inline typename EnableIf< IsNumeric<T2>, bool >::Type
371  operator==( const DenseMatrix<T1,false>& mat, T2 scalar )
372 {
373  typedef typename T1::CompositeType CT1;
374 
375  // Evaluation of the dense matrix operand
376  CT1 A( ~mat );
377 
378  // In order to compare the matrix and the scalar value, the data values of the lower-order
379  // data type are converted to the higher-order data type within the equal function.
380  for( size_t i=0; i<A.rows(); ++i ) {
381  for( size_t j=0; j<A.columns(); ++j ) {
382  if( !equal( A(i,j), scalar ) ) return false;
383  }
384  }
385 
386  return true;
387 }
388 //*************************************************************************************************
389 
390 
391 //*************************************************************************************************
403 template< typename T1 // Type of the left-hand side dense matrix
404  , typename T2 > // Type of the right-hand side scalar
405 inline typename EnableIf< IsNumeric<T2>, bool >::Type
406  operator==( const DenseMatrix<T1,true>& mat, T2 scalar )
407 {
408  typedef typename T1::CompositeType CT1;
409 
410  // Evaluation of the dense matrix operand
411  CT1 A( ~mat );
412 
413  // In order to compare the matrix and the scalar value, the data values of the lower-order
414  // data type are converted to the higher-order data type within the equal function.
415  for( size_t j=0; j<A.columns(); ++j ) {
416  for( size_t i=0; i<A.rows(); ++i ) {
417  if( !equal( A(i,j), scalar ) ) return false;
418  }
419  }
420 
421  return true;
422 }
423 //*************************************************************************************************
424 
425 
426 //*************************************************************************************************
438 template< typename T1 // Type of the left-hand side scalar
439  , typename T2 // Type of the right-hand side dense matrix
440  , bool SO > // Storage order
441 inline typename EnableIf< IsNumeric<T1>, bool >::Type
442  operator==( T1 scalar, const DenseMatrix<T2,SO>& mat )
443 {
444  return ( mat == scalar );
445 }
446 //*************************************************************************************************
447 
448 
449 //*************************************************************************************************
457 template< typename T1 // Type of the left-hand side dense matrix
458  , bool SO1 // Storage order of the left-hand side dense matrix
459  , typename T2 // Type of the right-hand side dense matrix
460  , bool SO2 > // Storage order of the right-hand side dense matrix
461 inline bool operator!=( const DenseMatrix<T1,SO1>& lhs, const DenseMatrix<T2,SO2>& rhs )
462 {
463  return !( lhs == rhs );
464 }
465 //*************************************************************************************************
466 
467 
468 //*************************************************************************************************
476 template< typename T1 // Type of the left-hand side dense matrix
477  , bool SO1 // Storage order of the left-hand side dense matrix
478  , typename T2 // Type of the right-hand side sparse matrix
479  , bool SO2 > // Storage order of the right-hand side sparse matrix
480 inline bool operator!=( const DenseMatrix<T1,SO1>& lhs, const SparseMatrix<T2,SO2>& rhs )
481 {
482  return !( lhs == rhs );
483 }
484 //*************************************************************************************************
485 
486 
487 //*************************************************************************************************
495 template< typename T1 // Type of the left-hand side sparse matrix
496  , bool SO1 // Storage order of the left-hand side sparse matrix
497  , typename T2 // Type of the right-hand side dense matrix
498  , bool SO2 > // Storage order right-hand side dense matrix
499 inline bool operator!=( const SparseMatrix<T1,SO1>& lhs, const DenseMatrix<T2,SO2>& rhs )
500 {
501  return !( rhs == lhs );
502 }
503 //*************************************************************************************************
504 
505 
506 //*************************************************************************************************
518 template< typename T1 // Type of the left-hand side dense matrix
519  , typename T2 // Type of the right-hand side scalar
520  , bool SO > // Storage order
521 inline typename EnableIf< IsNumeric<T2>, bool >::Type
522  operator!=( const DenseMatrix<T1,SO>& mat, T2 scalar )
523 {
524  return !( mat == scalar );
525 }
526 //*************************************************************************************************
527 
528 
529 //*************************************************************************************************
541 template< typename T1 // Type of the left-hand side scalar
542  , typename T2 // Type of the right-hand side dense matrix
543  , bool SO > // Storage order
544 inline typename EnableIf< IsNumeric<T1>, bool >::Type
545  operator!=( T1 scalar, const DenseMatrix<T2,SO>& mat )
546 {
547  return !( mat == scalar );
548 }
549 //*************************************************************************************************
550 
551 
552 
553 
554 //=================================================================================================
555 //
556 // GLOBAL FUNCTIONS
557 //
558 //=================================================================================================
559 
560 //*************************************************************************************************
563 template< typename MT, bool SO >
564 bool isnan( const DenseMatrix<MT,SO>& dm );
565 
566 template< typename MT, bool SO >
567 bool isDiagonal( const DenseMatrix<MT,SO>& dm );
568 
569 template< typename MT, bool SO >
570 bool isSymmetric( const DenseMatrix<MT,SO>& dm );
571 
572 template< typename MT, bool SO >
573 bool isLower( const DenseMatrix<MT,SO>& dm );
574 
575 template< typename MT, bool SO >
576 bool isUpper( const DenseMatrix<MT,SO>& dm );
577 
578 template< typename MT, bool SO >
579 const typename MT::ElementType min( const DenseMatrix<MT,SO>& dm );
580 
581 template< typename MT, bool SO >
582 const typename MT::ElementType max( const DenseMatrix<MT,SO>& dm );
584 //*************************************************************************************************
585 
586 
587 //*************************************************************************************************
607 template< typename MT // Type of the dense matrix
608  , bool SO > // Storage order
609 bool isnan( const DenseMatrix<MT,SO>& dm )
610 {
611  typedef typename MT::CompositeType CT;
612 
613  CT A( ~dm ); // Evaluation of the dense matrix operand
614 
615  if( SO == rowMajor ) {
616  for( size_t i=0UL; i<A.rows(); ++i ) {
617  for( size_t j=0UL; j<A.columns(); ++j )
618  if( isnan( A(i,j) ) ) return true;
619  }
620  }
621  else {
622  for( size_t j=0UL; j<A.columns(); ++j ) {
623  for( size_t i=0UL; i<A.rows(); ++i )
624  if( isnan( A(i,j) ) ) return true;
625  }
626  }
627 
628  return false;
629 }
630 //*************************************************************************************************
631 
632 
633 //*************************************************************************************************
669 template< typename MT // Type of the dense matrix
670  , bool SO > // Storage order
672 {
673  // Early exit in case the matrix is not square
674  if( !isSquare( ~dm ) )
675  return false;
676 
677  // Evaluation of the dense matrix operand
678  typename MT::CompositeType A( ~dm );
679 
680  // Run time evaluation whether the matrix is diagonal
681  if( SO == rowMajor ) {
682  for( size_t i=1UL; i<A.rows(); ++i ) {
683  for( size_t j=0UL; j<i; ++j ) {
684  if( !isDefault( A(i,j) ) || !isDefault( A(j,i) ) )
685  return false;
686  }
687  }
688  }
689  else {
690  for( size_t j=1UL; j<A.columns(); ++j ) {
691  for( size_t i=0UL; i<j; ++i ) {
692  if( !isDefault( A(i,j) ) || !isDefault( A(j,i) ) )
693  return false;
694  }
695  }
696  }
697 
698  return true;
699 }
700 //*************************************************************************************************
701 
702 
703 //*************************************************************************************************
729 template< typename MT // Type of the dense matrix
730  , bool SO > // Storage order
732 {
733  typedef typename MT::CompositeType CT;
734 
736  return true;
737 
738  if( !isSquare( ~dm ) )
739  return false;
740 
741  if( (~dm).rows() < 2UL )
742  return true;
743 
745  return false;
746 
747  CT A( ~dm ); // Evaluation of the dense matrix operand
748 
749  if( SO == rowMajor ) {
750  for( size_t i=1UL; i<A.rows(); ++i ) {
751  for( size_t j=0UL; j<i; ++j ) {
752  if( !equal( A(i,j), A(j,i) ) )
753  return false;
754  }
755  }
756  }
757  else {
758  for( size_t j=1UL; j<A.columns(); ++j ) {
759  for( size_t i=0UL; i<j; ++i ) {
760  if( !equal( A(i,j), A(j,i) ) )
761  return false;
762  }
763  }
764  }
765 
766  return true;
767 }
768 //*************************************************************************************************
769 
770 
771 //*************************************************************************************************
807 template< typename MT // Type of the dense matrix
808  , bool SO > // Storage order
809 bool isLower( const DenseMatrix<MT,SO>& dm )
810 {
811  typedef typename MT::ResultType RT;
812  typedef typename MT::ReturnType RN;
813  typedef typename MT::CompositeType CT;
814  typedef typename If< IsExpression<RN>, const RT, CT >::Type Tmp;
815 
816  if( IsLower<MT>::value )
817  return true;
818 
819  if( !isSquare( ~dm ) )
820  return false;
821 
822  if( (~dm).rows() < 2UL )
823  return true;
824 
826  return false;
827 
828  Tmp A( ~dm ); // Evaluation of the dense matrix operand
829 
830  if( SO == rowMajor ) {
831  for( size_t i=0UL; i<A.rows()-1UL; ++i ) {
832  for( size_t j=i+1UL; j<A.columns(); ++j ) {
833  if( !isDefault( A(i,j) ) )
834  return false;
835  }
836  }
837  }
838  else {
839  for( size_t j=1UL; j<A.columns(); ++j ) {
840  for( size_t i=0UL; i<j; ++i ) {
841  if( !isDefault( A(i,j) ) )
842  return false;
843  }
844  }
845  }
846 
847  return true;
848 }
849 //*************************************************************************************************
850 
851 
852 //*************************************************************************************************
888 template< typename MT // Type of the dense matrix
889  , bool SO > // Storage order
890 bool isUpper( const DenseMatrix<MT,SO>& dm )
891 {
892  typedef typename MT::ResultType RT;
893  typedef typename MT::ReturnType RN;
894  typedef typename MT::CompositeType CT;
895  typedef typename If< IsExpression<RN>, const RT, CT >::Type Tmp;
896 
897  if( IsUpper<MT>::value )
898  return true;
899 
900  if( !isSquare( ~dm ) )
901  return false;
902 
903  if( (~dm).rows() < 2UL )
904  return true;
905 
907  return false;
908 
909  Tmp A( ~dm ); // Evaluation of the dense matrix operand
910 
911  if( SO == rowMajor ) {
912  for( size_t i=1UL; i<A.rows(); ++i ) {
913  for( size_t j=0UL; j<i; ++j ) {
914  if( !isDefault( A(i,j) ) )
915  return false;
916  }
917  }
918  }
919  else {
920  for( size_t j=0UL; j<A.columns()-1UL; ++j ) {
921  for( size_t i=j+1UL; i<A.rows(); ++i ) {
922  if( !isDefault( A(i,j) ) )
923  return false;
924  }
925  }
926  }
927 
928  return true;
929 }
930 //*************************************************************************************************
931 
932 
933 //*************************************************************************************************
945 template< typename MT // Type of the dense matrix
946  , bool SO > // Storage order
947 const typename MT::ElementType min( const DenseMatrix<MT,SO>& dm )
948 {
949  using blaze::min;
950 
951  typedef typename MT::ElementType ET;
952  typedef typename MT::CompositeType CT;
953 
954  CT A( ~dm ); // Evaluation of the dense matrix operand
955 
956  if( A.rows() == 0UL || A.columns() == 0UL ) return ET();
957 
958  ET minimum( A(0,0) );
959 
960  if( SO == rowMajor ) {
961  for( size_t j=1UL; j<A.columns(); ++j )
962  minimum = min( minimum, A(0UL,j) );
963  for( size_t i=1UL; i<A.rows(); ++i )
964  for( size_t j=0UL; j<A.columns(); ++j )
965  minimum = min( minimum, A(i,j) );
966  }
967  else {
968  for( size_t i=1UL; i<A.rows(); ++i )
969  minimum = min( minimum, A(i,0UL) );
970  for( size_t j=1UL; j<A.columns(); ++j )
971  for( size_t i=0UL; i<A.rows(); ++i )
972  minimum = min( minimum, A(i,j) );
973  }
974 
975  return minimum;
976 }
977 //*************************************************************************************************
978 
979 
980 //*************************************************************************************************
992 template< typename MT // Type of the dense matrix
993  , bool SO > // Transpose flag
994 const typename MT::ElementType max( const DenseMatrix<MT,SO>& dm )
995 {
996  using blaze::max;
997 
998  typedef typename MT::ElementType ET;
999  typedef typename MT::CompositeType CT;
1000 
1001  CT A( ~dm ); // Evaluation of the dense matrix operand
1002 
1003  if( A.rows() == 0UL || A.columns() == 0UL ) return ET();
1004 
1005  ET maximum( A(0,0) );
1006 
1007  if( SO == rowMajor ) {
1008  for( size_t j=1UL; j<A.columns(); ++j )
1009  maximum = max( maximum, A(0UL,j) );
1010  for( size_t i=1UL; i<A.rows(); ++i )
1011  for( size_t j=0UL; j<A.columns(); ++j )
1012  maximum = max( maximum, A(i,j) );
1013  }
1014  else {
1015  for( size_t i=1UL; i<A.rows(); ++i )
1016  maximum = max( maximum, A(i,0UL) );
1017  for( size_t j=1UL; j<A.columns(); ++j )
1018  for( size_t i=0UL; i<A.rows(); ++i )
1019  maximum = max( maximum, A(i,j) );
1020  }
1021 
1022  return maximum;
1023 }
1024 //*************************************************************************************************
1025 
1026 } // namespace blaze
1027 
1028 #endif
Header file for the isnan shim.
const MT::ElementType max(const DenseMatrix< MT, SO > &dm)
Returns the largest element of the dense matrix.
Definition: DenseMatrix.h:994
Header file for mathematical functions.
bool isDiagonal(const DenseMatrix< MT, SO > &dm)
Checks if the give dense matrix is diagonal.
Definition: DenseMatrix.h:671
Compile time type selection.The If class template selects one of the two given types T2 and T3 depend...
Definition: If.h:112
BLAZE_ALWAYS_INLINE bool isSquare(const Matrix< MT, SO > &matrix)
Checks if the given matrix is a square matrix.
Definition: Matrix.h:902
bool isSymmetric(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is symmetric.
Definition: DenseMatrix.h:731
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2478
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix)
Returns the current number of rows of the matrix.
Definition: Matrix.h:316
Compile time check for lower triangular matrices.This type trait tests whether or not the given templ...
Definition: IsLower.h:85
bool isnan(const DenseMatrix< MT, SO > &dm)
Checks the given dense matrix for not-a-number elements.
Definition: DenseMatrix.h:609
Compile time check for upper triangular matrices.This type trait tests whether or not the given templ...
Definition: IsUpper.h:85
bool isLower(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a lower triangular matrix.
Definition: DenseMatrix.h:809
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:70
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:107
Header file for the SparseMatrix base class.
Header file for the IsSquare type trait.
Header file for the matrix storage order types.
Header file for the IsSymmetric type trait.
Header file for the If class template.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2482
const MT::ElementType min(const DenseMatrix< MT, SO > &dm)
Returns the smallest element of the dense matrix.
Definition: DenseMatrix.h:947
Header file for the DenseMatrix base class.
Header file for the IsLower type trait.
Header file for the equal shim.
bool isUpper(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is an upper triangular matrix.
Definition: DenseMatrix.h:890
Compile time check for symmetric matrices.This type trait tests whether or not the given template par...
Definition: IsSymmetric.h:85
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2476
Header file for the EnableIf class template.
Header file for the IsNumeric type trait.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2477
Removal of reference modifiers.The RemoveCV type trait removes any reference modifiers from the given...
Definition: RemoveReference.h:69
Header file for run time assertion macros.
bool equal(const T1 &a, const T2 &b)
Generic equality check.
Definition: Equal.h:376
Header file for the isDefault shim.
BLAZE_ALWAYS_INLINE bool isDefault(const NonNumericProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: NonNumericProxy.h:874
Header file for the RemoveReference type trait.
const bool rowMajor
Storage order flag for row-major matrices.
Definition: StorageOrder.h:71
bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value. ...
Definition: Accuracy.h:249
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2473
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix)
Returns the current number of columns of the matrix.
Definition: Matrix.h:332
bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:289
Header file for basic type definitions.
Header file for the IsUpper type trait.
Header file for the IsExpression type trait class.