DiagonalMatrix.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_ADAPTORS_DIAGONALMATRIX_H_
36 #define _BLAZE_MATH_ADAPTORS_DIAGONALMATRIX_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
57 #include <blaze/math/Forward.h>
84 #include <blaze/util/Assert.h>
85 #include <blaze/util/EnableIf.h>
86 #include <blaze/util/Exception.h>
89 #include <blaze/util/Unused.h>
91 
92 
93 namespace blaze {
94 
95 //=================================================================================================
96 //
97 // DIAGONALMATRIX OPERATORS
98 //
99 //=================================================================================================
100 
101 //*************************************************************************************************
104 template< typename MT, bool SO, bool DF >
105 inline void reset( DiagonalMatrix<MT,SO,DF>& m );
106 
107 template< typename MT, bool SO, bool DF >
108 inline void reset( DiagonalMatrix<MT,SO,DF>& m, size_t i );
109 
110 template< typename MT, bool SO, bool DF >
111 inline void clear( DiagonalMatrix<MT,SO,DF>& m );
112 
113 template< typename MT, bool SO, bool DF >
114 inline bool isDefault( const DiagonalMatrix<MT,SO,DF>& m );
115 
116 template< typename MT, bool SO, bool DF >
117 inline bool isIntact( const DiagonalMatrix<MT,SO,DF>& m );
118 
119 template< typename MT, bool SO, bool DF >
120 inline void swap( DiagonalMatrix<MT,SO,DF>& a, DiagonalMatrix<MT,SO,DF>& b ) /* throw() */;
122 //*************************************************************************************************
123 
124 
125 //*************************************************************************************************
132 template< typename MT // Type of the adapted matrix
133  , bool SO // Storage order of the adapted matrix
134  , bool DF > // Density flag
136 {
137  m.reset();
138 }
139 //*************************************************************************************************
140 
141 
142 //*************************************************************************************************
155 template< typename MT // Type of the adapted matrix
156  , bool SO // Storage order of the adapted matrix
157  , bool DF > // Density flag
158 inline void reset( DiagonalMatrix<MT,SO,DF>& m, size_t i )
159 {
160  m.reset( i );
161 }
162 //*************************************************************************************************
163 
164 
165 //*************************************************************************************************
172 template< typename MT // Type of the adapted matrix
173  , bool SO // Storage order of the adapted matrix
174  , bool DF > // Density flag
176 {
177  m.clear();
178 }
179 //*************************************************************************************************
180 
181 
182 //*************************************************************************************************
203 template< typename MT // Type of the adapted matrix
204  , bool SO // Storage order of the adapted matrix
205  , bool DF > // Density flag
206 inline bool isDefault( const DiagonalMatrix<MT,SO,DF>& m )
207 {
208  return isDefault( m.matrix_ );
209 }
210 //*************************************************************************************************
211 
212 
213 //*************************************************************************************************
234 template< typename MT // Type of the adapted matrix
235  , bool SO // Storage order of the adapted matrix
236  , bool DF > // Density flag
237 inline bool isIntact( const DiagonalMatrix<MT,SO,DF>& m )
238 {
239  return m.isIntact();
240 }
241 //*************************************************************************************************
242 
243 
244 //*************************************************************************************************
253 template< typename MT // Type of the adapted matrix
254  , bool SO // Storage order of the adapted matrix
255  , bool DF > // Density flag
256 inline void swap( DiagonalMatrix<MT,SO,DF>& a, DiagonalMatrix<MT,SO,DF>& b ) /* throw() */
257 {
258  a.swap( b );
259 }
260 //*************************************************************************************************
261 
262 
263 //*************************************************************************************************
279 template< typename MT // Type of the dense matrix
280  , bool SO > // Storage order of the dense matrix
281 inline void invert2x2( DiagonalMatrix<MT,SO,true>& m )
282 {
284 
285  BLAZE_INTERNAL_ASSERT( m.rows() == 2UL, "Invalid number of rows detected" );
286  BLAZE_INTERNAL_ASSERT( m.columns() == 2UL, "Invalid number of columns detected" );
287 
288  typedef typename MT::ElementType ET;
289 
290  typename DerestrictTrait<MT>::Type A( derestrict( m ) );
291 
292  const ET det( A(0,0) * A(1,1) );
293 
294  if( isDefault( det ) ) {
295  BLAZE_THROW_INVALID_ARGUMENT( "Inversion of singular matrix failed" );
296  }
297 
298  const ET idet( ET(1) / det );
299  const ET a11( A(0,0) * idet );
300 
301  A(0,0) = A(1,1) * idet;
302  A(1,1) = a11;
303 
304  BLAZE_INTERNAL_ASSERT( isIntact( m ), "Broken invariant detected" );
305 }
307 //*************************************************************************************************
308 
309 
310 //*************************************************************************************************
326 template< typename MT // Type of the dense matrix
327  , bool SO > // Storage order of the dense matrix
328 inline void invert3x3( DiagonalMatrix<MT,SO,true>& m )
329 {
331 
332  BLAZE_INTERNAL_ASSERT( m.rows() == 3UL, "Invalid number of rows detected" );
333  BLAZE_INTERNAL_ASSERT( m.columns() == 3UL, "Invalid number of columns detected" );
334 
335  typedef typename MT::ElementType ET;
336 
337  typename DerestrictTrait<MT>::Type A( derestrict( m ) );
338 
339  const ET tmp1( A(0,0)*A(1,1) );
340  const ET tmp2( A(0,0)*A(2,2) );
341 
342  const ET det( tmp1*A(2,2) );
343 
344  if( isDefault( det ) ) {
345  BLAZE_THROW_INVALID_ARGUMENT( "Inversion of singular matrix failed" );
346  }
347 
348  const ET idet( ET(1) / det );
349 
350  A(0,0) = A(1,1)*A(2,2)*idet;
351  A(1,1) = tmp2*idet;
352  A(2,2) = tmp1*idet;
353 
354  BLAZE_INTERNAL_ASSERT( isIntact( m ), "Broken invariant detected" );
355 }
357 //*************************************************************************************************
358 
359 
360 //*************************************************************************************************
376 template< typename MT // Type of the dense matrix
377  , bool SO > // Storage order of the dense matrix
378 inline void invert4x4( DiagonalMatrix<MT,SO,true>& m )
379 {
381 
382  BLAZE_INTERNAL_ASSERT( m.rows() == 4UL, "Invalid number of rows detected" );
383  BLAZE_INTERNAL_ASSERT( m.columns() == 4UL, "Invalid number of columns detected" );
384 
385  typedef typename MT::ElementType ET;
386 
387  typename DerestrictTrait<MT>::Type A( derestrict( m ) );
388 
389  const ET tmp1( A(2,2)*A(3,3) );
390  const ET tmp2( A(0,0)*A(1,1) );
391  const ET tmp3( A(0,0)*tmp1 );
392  const ET tmp4( A(2,2)*tmp2 );
393 
394  const ET det( tmp1 * tmp2 );
395 
396  if( isDefault( det ) ) {
397  BLAZE_THROW_INVALID_ARGUMENT( "Inversion of singular matrix failed" );
398  }
399 
400  const ET idet( ET(1) / det );
401 
402  A(0,0) = A(1,1)*tmp1*idet;
403  A(1,1) = tmp3*idet;
404  A(2,2) = A(3,3)*tmp2*idet;
405  A(3,3) = tmp4*idet;
406 
407  BLAZE_INTERNAL_ASSERT( isIntact( m ), "Broken invariant detected" );
408 }
410 //*************************************************************************************************
411 
412 
413 //*************************************************************************************************
429 template< typename MT // Type of the dense matrix
430  , bool SO > // Storage order of the dense matrix
431 inline void invert5x5( DiagonalMatrix<MT,SO,true>& m )
432 {
434 
435  BLAZE_INTERNAL_ASSERT( m.rows() == 5UL, "Invalid number of rows detected" );
436  BLAZE_INTERNAL_ASSERT( m.columns() == 5UL, "Invalid number of columns detected" );
437 
438  typedef typename MT::ElementType ET;
439 
440  typename DerestrictTrait<MT>::Type A( derestrict( m ) );
441 
442  const ET tmp1( A(0,0)*A(1,1) );
443  const ET tmp2( A(3,3)*A(4,4) );
444  const ET tmp3( A(0,0)*tmp2 );
445  const ET tmp4( tmp1*A(2,2) );
446  const ET tmp5( tmp4*A(3,3) );
447 
448  const ET det( tmp2*tmp4 );
449 
450  if( isDefault( det ) ) {
451  BLAZE_THROW_INVALID_ARGUMENT( "Inversion of singular matrix failed" );
452  }
453 
454  const ET idet( ET(1) / det );
455 
456  A(0,0) = A(1,1)*A(2,2)*tmp2*idet;
457  A(1,1) = A(2,2)*tmp3*idet;
458  A(2,2) = tmp1*tmp2*idet;
459  A(3,3) = tmp4*A(4,4)*idet;
460  A(4,4) = tmp5*idet;
461 
462  BLAZE_INTERNAL_ASSERT( isIntact( m ), "Broken invariant detected" );
463 }
465 //*************************************************************************************************
466 
467 
468 //*************************************************************************************************
484 template< typename MT // Type of the dense matrix
485  , bool SO > // Storage order of the dense matrix
486 inline void invert6x6( DiagonalMatrix<MT,SO,true>& m )
487 {
489 
490  BLAZE_INTERNAL_ASSERT( m.rows() == 6UL, "Invalid number of rows detected" );
491  BLAZE_INTERNAL_ASSERT( m.columns() == 6UL, "Invalid number of columns detected" );
492 
493  typedef typename MT::ElementType ET;
494 
495  typename DerestrictTrait<MT>::Type A( derestrict( m ) );
496 
497  const ET tmp1( A(0,0)*A(1,1) );
498  const ET tmp2( A(3,3)*A(4,4) );
499  const ET tmp3( tmp1*A(2,2) );
500  const ET tmp4( tmp2*A(5,5) );
501  const ET tmp5( A(0,0)*tmp4 );
502  const ET tmp6( tmp3*A(3,3) );
503 
504  const ET det( tmp3*tmp4 );
505 
506  if( isDefault( det ) ) {
507  BLAZE_THROW_INVALID_ARGUMENT( "Inversion of singular matrix failed" );
508  }
509 
510  const ET idet( ET(1) / det );
511 
512  A(0,0) = A(1,1)*A(2,2)*tmp4*idet;
513  A(1,1) = tmp5*A(2,2)*idet;
514  A(2,2) = tmp1*tmp4*idet;
515  A(3,3) = tmp3*A(4,4)*A(5,5)*idet;
516  A(4,4) = tmp6*A(5,5)*idet;
517  A(5,5) = tmp2*tmp3*idet;
518 
519  BLAZE_INTERNAL_ASSERT( isIntact( m ), "Broken invariant detected" );
520 }
522 //*************************************************************************************************
523 
524 
525 //*************************************************************************************************
545 template< InversionFlag IF // Inversion algorithm
546  , typename MT // Type of the adapted matrix
547  , bool SO > // Storage order of the adapted matrix
548 inline void invertNxN( DiagonalMatrix<MT,SO,true>& m )
549 {
551 
552  MT& A( derestrict( m ) );
553 
554  for( size_t i=0UL; i<A.rows(); ++i )
555  {
556  if( isDefault( A(i,i) ) ) {
557  BLAZE_THROW_INVALID_ARGUMENT( "Inversion of singular matrix failed" );
558  }
559 
560  invert( A(i,i) );
561  }
562 
563  BLAZE_INTERNAL_ASSERT( isIntact( m ), "Broken invariant detected" );
564 }
566 //*************************************************************************************************
567 
568 
569 //*************************************************************************************************
588 template< typename MT1, bool SO1, typename MT2, typename MT3, typename MT4, bool SO2 >
589 inline void lu( const DiagonalMatrix<MT1,SO1,true>& A, DenseMatrix<MT2,SO1>& L,
590  DenseMatrix<MT3,SO1>& U, Matrix<MT4,SO2>& P )
591 {
593 
598 
603 
604  typedef typename MT3::ElementType ET3;
605  typedef typename MT4::ElementType ET4;
606 
607  const size_t n( (~A).rows() );
608 
609  typename DerestrictTrait<MT3>::Type U2( derestrict( ~U ) );
610 
611  (~L) = A;
612 
613  resize( ~U, n, n );
614  reset( U2 );
615 
616  resize( ~P, n, n );
617  reset( ~P );
618 
619  for( size_t i=0UL; i<n; ++i ) {
620  U2(i,i) = ET3(1);
621  (~P)(i,i) = ET4(1);
622  }
623 }
625 //*************************************************************************************************
626 
627 
628 //*************************************************************************************************
644 template< typename MT // Type of the adapted matrix
645  , bool SO // Storage order of the adapted matrix
646  , bool DF // Density flag
647  , typename VT > // Type of the right-hand side dense vector
648 inline bool tryAssign( const DiagonalMatrix<MT,SO,DF>& lhs,
649  const DenseVector<VT,false>& rhs, size_t row, size_t column )
650 {
652 
653  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
654  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
655  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.rows() - row, "Invalid number of rows" );
656 
657  UNUSED_PARAMETER( lhs );
658 
659  const size_t index( ( column <= row )?( 0UL ):( column - row ) );
660 
661  for( size_t i=0UL; i<index; ++i ) {
662  if( !isDefault( (~rhs)[i] ) )
663  return false;
664  }
665 
666  for( size_t i=index+1UL; i<(~rhs).size(); ++i ) {
667  if( !isDefault( (~rhs)[i] ) )
668  return false;
669  }
670 
671  return true;
672 }
674 //*************************************************************************************************
675 
676 
677 //*************************************************************************************************
693 template< typename MT // Type of the adapted matrix
694  , bool SO // Storage order of the adapted matrix
695  , bool DF // Density flag
696  , typename VT > // Type of the right-hand side dense vector
697 inline bool tryAssign( const DiagonalMatrix<MT,SO,DF>& lhs,
698  const DenseVector<VT,true>& rhs, size_t row, size_t column )
699 {
701 
702  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
703  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
704  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.columns() - column, "Invalid number of columns" );
705 
706  UNUSED_PARAMETER( lhs );
707 
708  const size_t index( ( row <= column )?( 0UL ):( row - column ) );
709 
710  for( size_t i=0UL; i<index; ++i ) {
711  if( !isDefault( (~rhs)[i] ) )
712  return false;
713  }
714 
715  for( size_t i=index+1UL; i<(~rhs).size(); ++i ) {
716  if( !isDefault( (~rhs)[i] ) )
717  return false;
718  }
719 
720  return true;
721 }
723 //*************************************************************************************************
724 
725 
726 //*************************************************************************************************
742 template< typename MT // Type of the adapted matrix
743  , bool SO // Storage order of the adapted matrix
744  , bool DF // Density flag
745  , typename VT > // Type of the right-hand side sparse vector
746 inline bool tryAssign( const DiagonalMatrix<MT,SO,DF>& lhs,
747  const SparseVector<VT,false>& rhs, size_t row, size_t column )
748 {
750 
751  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
752  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
753  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.rows() - row, "Invalid number of rows" );
754 
755  UNUSED_PARAMETER( lhs );
756 
757  typedef typename VT::ConstIterator RhsIterator;
758 
759  const size_t index( column - row );
760 
761  for( RhsIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element ) {
762  if( element->index() != index && !isDefault( element->value() ) )
763  return false;
764  }
765 
766  return true;
767 }
769 //*************************************************************************************************
770 
771 
772 //*************************************************************************************************
788 template< typename MT // Type of the adapted matrix
789  , bool SO // Storage order of the adapted matrix
790  , bool DF // Density flag
791  , typename VT > // Type of the right-hand side sparse vector
792 inline bool tryAssign( const DiagonalMatrix<MT,SO,DF>& lhs,
793  const SparseVector<VT,true>& rhs, size_t row, size_t column )
794 {
796 
797  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
798  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
799  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.columns() - column, "Invalid number of columns" );
800 
801  UNUSED_PARAMETER( lhs );
802 
803  typedef typename VT::ConstIterator RhsIterator;
804 
805  const size_t index( row - column );
806 
807  for( RhsIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element ) {
808  if( element->index() != index && !isDefault( element->value() ) )
809  return false;
810  }
811 
812  return true;
813 }
815 //*************************************************************************************************
816 
817 
818 //*************************************************************************************************
834 template< typename MT1 // Type of the adapted matrix
835  , bool SO // Storage order of the adapted matrix
836  , bool DF // Density flag
837  , typename MT2 > // Type of the right-hand side dense matrix
838 inline bool tryAssign( const DiagonalMatrix<MT1,SO,DF>& lhs,
839  const DenseMatrix<MT2,false>& rhs, size_t row, size_t column )
840 {
842 
843  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
844  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
845  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
846  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
847 
848  UNUSED_PARAMETER( lhs );
849 
850  const size_t M( (~rhs).rows() );
851  const size_t N( (~rhs).columns() );
852 
853  for( size_t i=0UL; i<M; ++i ) {
854  for( size_t j=0UL; j<N; ++j ) {
855  if( ( row + i != column + j ) && !isDefault( (~rhs)(i,j) ) )
856  return false;
857  }
858  }
859 
860  return true;
861 }
863 //*************************************************************************************************
864 
865 
866 //*************************************************************************************************
882 template< typename MT1 // Type of the adapted matrix
883  , bool SO // Storage order of the adapted matrix
884  , bool DF // Density flag
885  , typename MT2 > // Type of the right-hand side dense matrix
886 inline bool tryAssign( const DiagonalMatrix<MT1,SO,DF>& lhs,
887  const DenseMatrix<MT2,true>& rhs, size_t row, size_t column )
888 {
890 
891  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
892  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
893  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
894  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
895 
896  UNUSED_PARAMETER( lhs );
897 
898  const size_t M( (~rhs).rows() );
899  const size_t N( (~rhs).columns() );
900 
901  for( size_t j=0UL; j<N; ++j ) {
902  for( size_t i=0UL; i<M; ++i ) {
903  if( ( column + j != row + i ) && !isDefault( (~rhs)(i,j) ) )
904  return false;
905  }
906  }
907 
908  return true;
909 }
911 //*************************************************************************************************
912 
913 
914 //*************************************************************************************************
930 template< typename MT1 // Type of the adapted matrix
931  , bool SO // Storage order of the adapted matrix
932  , bool DF // Density flag
933  , typename MT2 > // Type of the right-hand side sparse matrix
934 inline bool tryAssign( const DiagonalMatrix<MT1,SO,DF>& lhs,
935  const SparseMatrix<MT2,false>& rhs, size_t row, size_t column )
936 {
938 
939  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
940  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
941  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
942  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
943 
944  UNUSED_PARAMETER( lhs );
945 
946  typedef typename MT2::ConstIterator RhsIterator;
947 
948  const size_t M( (~rhs).rows() );
949 
950  for( size_t i=0UL; i<M; ++i ) {
951  for( RhsIterator element=(~rhs).begin(i); element!=(~rhs).end(i); ++element ) {
952  if( ( row + i != column + element->index() ) && !isDefault( element->value() ) )
953  return false;
954  }
955  }
956 
957  return true;
958 }
960 //*************************************************************************************************
961 
962 
963 //*************************************************************************************************
979 template< typename MT1 // Type of the adapted matrix
980  , bool SO // Storage order of the adapted matrix
981  , bool DF // Density flag
982  , typename MT2 > // Type of the right-hand side sparse matrix
983 inline bool tryAssign( const DiagonalMatrix<MT1,SO,DF>& lhs,
984  const SparseMatrix<MT2,true>& rhs, size_t row, size_t column )
985 {
987 
988  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
989  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
990  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
991  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
992 
993  UNUSED_PARAMETER( lhs );
994 
995  typedef typename MT2::ConstIterator RhsIterator;
996 
997  const size_t N( (~rhs).columns() );
998 
999  for( size_t j=0UL; j<N; ++j ) {
1000  for( RhsIterator element=(~rhs).begin(j); element!=(~rhs).end(j); ++element ) {
1001  if( ( column + j != row + element->index() ) && !isDefault( element->value() ) )
1002  return false;
1003  }
1004  }
1005 
1006  return true;
1007 }
1009 //*************************************************************************************************
1010 
1011 
1012 //*************************************************************************************************
1028 template< typename MT // Type of the adapted matrix
1029  , bool SO // Storage order of the adapted matrix
1030  , bool DF // Density flag
1031  , typename VT // Type of the right-hand side vector
1032  , bool TF > // Transpose flag of the right-hand side vector
1033 inline bool tryAddAssign( const DiagonalMatrix<MT,SO,DF>& lhs,
1034  const Vector<VT,TF>& rhs, size_t row, size_t column )
1035 {
1036  return tryAssign( lhs, ~rhs, row, column );
1037 }
1039 //*************************************************************************************************
1040 
1041 
1042 //*************************************************************************************************
1058 template< typename MT1 // Type of the adapted matrix
1059  , bool SO1 // Storage order of the adapted matrix
1060  , bool DF // Density flag
1061  , typename MT2 // Type of the right-hand side matrix
1062  , bool SO2 > // Storage order of the right-hand side matrix
1063 inline bool tryAddAssign( const DiagonalMatrix<MT1,SO1,DF>& lhs,
1064  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
1065 {
1066  return tryAssign( lhs, ~rhs, row, column );
1067 }
1069 //*************************************************************************************************
1070 
1071 
1072 //*************************************************************************************************
1089 template< typename MT // Type of the adapted matrix
1090  , bool SO // Storage order of the adapted matrix
1091  , bool DF // Density flag
1092  , typename VT // Type of the right-hand side vector
1093  , bool TF > // Transpose flag of the right-hand side vector
1094 inline bool trySubAssign( const DiagonalMatrix<MT,SO,DF>& lhs,
1095  const Vector<VT,TF>& rhs, size_t row, size_t column )
1096 {
1097  return tryAssign( lhs, ~rhs, row, column );
1098 }
1100 //*************************************************************************************************
1101 
1102 
1103 //*************************************************************************************************
1120 template< typename MT1 // Type of the adapted matrix
1121  , bool SO1 // Storage order of the adapted matrix
1122  , bool DF // Density flag
1123  , typename MT2 // Type of the right-hand side matrix
1124  , bool SO2 > // Storage order of the right-hand side matrix
1125 inline bool trySubAssign( const DiagonalMatrix<MT1,SO1,DF>& lhs,
1126  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
1127 {
1128  return tryAssign( lhs, ~rhs, row, column );
1129 }
1131 //*************************************************************************************************
1132 
1133 
1134 //*************************************************************************************************
1149 template< typename MT // Type of the adapted matrix
1150  , bool SO // Storage order of the adapted matrix
1151  , bool DF > // Density flag
1152 inline MT& derestrict( DiagonalMatrix<MT,SO,DF>& m )
1153 {
1154  return m.matrix_;
1155 }
1157 //*************************************************************************************************
1158 
1159 
1160 
1161 
1162 //=================================================================================================
1163 //
1164 // ROWS SPECIALIZATIONS
1165 //
1166 //=================================================================================================
1167 
1168 //*************************************************************************************************
1170 template< typename MT, bool SO, bool DF >
1171 struct Rows< DiagonalMatrix<MT,SO,DF> > : public Rows<MT>
1172 {};
1174 //*************************************************************************************************
1175 
1176 
1177 
1178 
1179 //=================================================================================================
1180 //
1181 // COLUMNS SPECIALIZATIONS
1182 //
1183 //=================================================================================================
1184 
1185 //*************************************************************************************************
1187 template< typename MT, bool SO, bool DF >
1188 struct Columns< DiagonalMatrix<MT,SO,DF> > : public Columns<MT>
1189 {};
1191 //*************************************************************************************************
1192 
1193 
1194 
1195 
1196 //=================================================================================================
1197 //
1198 // ISSQUARE SPECIALIZATIONS
1199 //
1200 //=================================================================================================
1201 
1202 //*************************************************************************************************
1204 template< typename MT, bool SO, bool DF >
1205 struct IsSquare< DiagonalMatrix<MT,SO,DF> > : public IsTrue<true>
1206 {};
1208 //*************************************************************************************************
1209 
1210 
1211 
1212 
1213 //=================================================================================================
1214 //
1215 // ISSYMMETRIC SPECIALIZATIONS
1216 //
1217 //=================================================================================================
1218 
1219 //*************************************************************************************************
1221 template< typename MT, bool SO, bool DF >
1222 struct IsSymmetric< DiagonalMatrix<MT,SO,DF> > : public IsTrue<true>
1223 {};
1225 //*************************************************************************************************
1226 
1227 
1228 
1229 
1230 //=================================================================================================
1231 //
1232 // ISHERMITIAN SPECIALIZATIONS
1233 //
1234 //=================================================================================================
1235 
1236 //*************************************************************************************************
1238 template< typename MT, bool SO, bool DF >
1239 struct IsHermitian< DiagonalMatrix<MT,SO,DF> >
1240  : public IsTrue< IsBuiltin<typename MT::ElementType>::value >
1241 {};
1243 //*************************************************************************************************
1244 
1245 
1246 
1247 
1248 //=================================================================================================
1249 //
1250 // ISLOWER SPECIALIZATIONS
1251 //
1252 //=================================================================================================
1253 
1254 //*************************************************************************************************
1256 template< typename MT, bool SO, bool DF >
1257 struct IsLower< DiagonalMatrix<MT,SO,DF> > : public IsTrue<true>
1258 {};
1260 //*************************************************************************************************
1261 
1262 
1263 
1264 
1265 //=================================================================================================
1266 //
1267 // ISUPPER SPECIALIZATIONS
1268 //
1269 //=================================================================================================
1270 
1271 //*************************************************************************************************
1273 template< typename MT, bool SO, bool DF >
1274 struct IsUpper< DiagonalMatrix<MT,SO,DF> > : public IsTrue<true>
1275 {};
1277 //*************************************************************************************************
1278 
1279 
1280 
1281 
1282 //=================================================================================================
1283 //
1284 // ISADAPTOR SPECIALIZATIONS
1285 //
1286 //=================================================================================================
1287 
1288 //*************************************************************************************************
1290 template< typename MT, bool SO, bool DF >
1291 struct IsAdaptor< DiagonalMatrix<MT,SO,DF> > : public IsTrue<true>
1292 {};
1294 //*************************************************************************************************
1295 
1296 
1297 
1298 
1299 //=================================================================================================
1300 //
1301 // ISRESTRICTED SPECIALIZATIONS
1302 //
1303 //=================================================================================================
1304 
1305 //*************************************************************************************************
1307 template< typename MT, bool SO, bool DF >
1308 struct IsRestricted< DiagonalMatrix<MT,SO,DF> > : public IsTrue<true>
1309 {};
1311 //*************************************************************************************************
1312 
1313 
1314 
1315 
1316 //=================================================================================================
1317 //
1318 // HASCONSTDATAACCESS SPECIALIZATIONS
1319 //
1320 //=================================================================================================
1321 
1322 //*************************************************************************************************
1324 template< typename MT, bool SO >
1325 struct HasConstDataAccess< DiagonalMatrix<MT,SO,true> > : public IsTrue<true>
1326 {};
1328 //*************************************************************************************************
1329 
1330 
1331 
1332 
1333 //=================================================================================================
1334 //
1335 // ISALIGNED SPECIALIZATIONS
1336 //
1337 //=================================================================================================
1338 
1339 //*************************************************************************************************
1341 template< typename MT, bool SO, bool DF >
1342 struct IsAligned< DiagonalMatrix<MT,SO,DF> > : public IsTrue< IsAligned<MT>::value >
1343 {};
1345 //*************************************************************************************************
1346 
1347 
1348 
1349 
1350 //=================================================================================================
1351 //
1352 // ISPADDED SPECIALIZATIONS
1353 //
1354 //=================================================================================================
1355 
1356 //*************************************************************************************************
1358 template< typename MT, bool SO, bool DF >
1359 struct IsPadded< DiagonalMatrix<MT,SO,DF> > : public IsTrue< IsPadded<MT>::value >
1360 {};
1362 //*************************************************************************************************
1363 
1364 
1365 
1366 
1367 //=================================================================================================
1368 //
1369 // ISRESIZABLE SPECIALIZATIONS
1370 //
1371 //=================================================================================================
1372 
1373 //*************************************************************************************************
1375 template< typename MT, bool SO, bool DF >
1376 struct IsResizable< DiagonalMatrix<MT,SO,DF> > : public IsTrue< IsResizable<MT>::value >
1377 {};
1379 //*************************************************************************************************
1380 
1381 
1382 
1383 
1384 //=================================================================================================
1385 //
1386 // REMOVEADAPTOR SPECIALIZATIONS
1387 //
1388 //=================================================================================================
1389 
1390 //*************************************************************************************************
1392 template< typename MT, bool SO, bool DF >
1393 struct RemoveAdaptor< DiagonalMatrix<MT,SO,DF> >
1394 {
1395  typedef MT Type;
1396 };
1398 //*************************************************************************************************
1399 
1400 
1401 
1402 
1403 //=================================================================================================
1404 //
1405 // DERESTRICTTRAIT SPECIALIZATIONS
1406 //
1407 //=================================================================================================
1408 
1409 //*************************************************************************************************
1411 template< typename MT, bool SO, bool DF >
1412 struct DerestrictTrait< DiagonalMatrix<MT,SO,DF> >
1413 {
1414  typedef MT& Type;
1415 };
1417 //*************************************************************************************************
1418 
1419 
1420 
1421 
1422 //=================================================================================================
1423 //
1424 // ADDTRAIT SPECIALIZATIONS
1425 //
1426 //=================================================================================================
1427 
1428 //*************************************************************************************************
1430 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1431 struct AddTrait< DiagonalMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
1432 {
1433  typedef typename AddTrait< MT, StaticMatrix<T,M,N,SO2> >::Type Type;
1434 };
1435 
1436 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1437 struct AddTrait< StaticMatrix<T,M,N,SO1>, DiagonalMatrix<MT,SO2,DF> >
1438 {
1439  typedef typename AddTrait< StaticMatrix<T,M,N,SO1>, MT >::Type Type;
1440 };
1441 
1442 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1443 struct AddTrait< DiagonalMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
1444 {
1445  typedef typename AddTrait< MT, HybridMatrix<T,M,N,SO2> >::Type Type;
1446 };
1447 
1448 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1449 struct AddTrait< HybridMatrix<T,M,N,SO1>, DiagonalMatrix<MT,SO2,DF> >
1450 {
1451  typedef typename AddTrait< HybridMatrix<T,M,N,SO1>, MT >::Type Type;
1452 };
1453 
1454 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1455 struct AddTrait< DiagonalMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
1456 {
1457  typedef typename AddTrait< MT, DynamicMatrix<T,SO2> >::Type Type;
1458 };
1459 
1460 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1461 struct AddTrait< DynamicMatrix<T,SO1>, DiagonalMatrix<MT,SO2,DF> >
1462 {
1463  typedef typename AddTrait< DynamicMatrix<T,SO1>, MT >::Type Type;
1464 };
1465 
1466 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
1467 struct AddTrait< DiagonalMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
1468 {
1469  typedef typename AddTrait< MT, CustomMatrix<T,AF,PF,SO2> >::Type Type;
1470 };
1471 
1472 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
1473 struct AddTrait< CustomMatrix<T,AF,PF,SO1>, DiagonalMatrix<MT,SO2,DF> >
1474 {
1475  typedef typename AddTrait< CustomMatrix<T,AF,PF,SO1>, MT >::Type Type;
1476 };
1477 
1478 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1479 struct AddTrait< DiagonalMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
1480 {
1481  typedef typename AddTrait< MT, CompressedMatrix<T,SO2> >::Type Type;
1482 };
1483 
1484 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1485 struct AddTrait< CompressedMatrix<T,SO1>, DiagonalMatrix<MT,SO2,DF> >
1486 {
1487  typedef typename AddTrait< CompressedMatrix<T,SO1>, MT >::Type Type;
1488 };
1489 
1490 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
1491 struct AddTrait< DiagonalMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
1492 {
1493  typedef typename AddTrait<MT1,MT2>::Type Type;
1494 };
1495 
1496 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
1497 struct AddTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, DiagonalMatrix<MT2,SO2,DF2> >
1498 {
1499  typedef typename AddTrait<MT1,MT2>::Type Type;
1500 };
1501 
1502 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1503 struct AddTrait< DiagonalMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1504 {
1505  typedef typename AddTrait<MT1,MT2>::Type Type;
1506 };
1507 
1508 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1509 struct AddTrait< HermitianMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
1510 {
1511  typedef typename AddTrait<MT1,MT2>::Type Type;
1512 };
1513 
1514 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1515 struct AddTrait< DiagonalMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
1516 {
1517  typedef LowerMatrix< typename AddTrait<MT1,MT2>::Type > Type;
1518 };
1519 
1520 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1521 struct AddTrait< LowerMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
1522 {
1523  typedef LowerMatrix< typename AddTrait<MT1,MT2>::Type > Type;
1524 };
1525 
1526 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1527 struct AddTrait< DiagonalMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
1528 {
1529  typedef LowerMatrix< typename AddTrait<MT1,MT2>::Type > Type;
1530 };
1531 
1532 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1533 struct AddTrait< UniLowerMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
1534 {
1535  typedef LowerMatrix< typename AddTrait<MT1,MT2>::Type > Type;
1536 };
1537 
1538 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1539 struct AddTrait< DiagonalMatrix<MT1,SO1,DF1>, StrictlyLowerMatrix<MT2,SO2,DF2> >
1540 {
1541  typedef LowerMatrix< typename AddTrait<MT1,MT2>::Type > Type;
1542 };
1543 
1544 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1545 struct AddTrait< StrictlyLowerMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
1546 {
1547  typedef LowerMatrix< typename AddTrait<MT1,MT2>::Type > Type;
1548 };
1549 
1550 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1551 struct AddTrait< DiagonalMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1552 {
1553  typedef UpperMatrix< typename AddTrait<MT1,MT2>::Type > Type;
1554 };
1555 
1556 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1557 struct AddTrait< UpperMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
1558 {
1559  typedef UpperMatrix< typename AddTrait<MT1,MT2>::Type > Type;
1560 };
1561 
1562 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1563 struct AddTrait< DiagonalMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
1564 {
1565  typedef UpperMatrix< typename AddTrait<MT1,MT2>::Type > Type;
1566 };
1567 
1568 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1569 struct AddTrait< UniUpperMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
1570 {
1571  typedef UpperMatrix< typename AddTrait<MT1,MT2>::Type > Type;
1572 };
1573 
1574 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1575 struct AddTrait< DiagonalMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1576 {
1577  typedef UpperMatrix< typename AddTrait<MT1,MT2>::Type > Type;
1578 };
1579 
1580 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1581 struct AddTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
1582 {
1583  typedef UpperMatrix< typename AddTrait<MT1,MT2>::Type > Type;
1584 };
1585 
1586 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1587 struct AddTrait< DiagonalMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
1588 {
1589  typedef DiagonalMatrix< typename AddTrait<MT1,MT2>::Type > Type;
1590 };
1592 //*************************************************************************************************
1593 
1594 
1595 
1596 
1597 //=================================================================================================
1598 //
1599 // SUBTRAIT SPECIALIZATIONS
1600 //
1601 //=================================================================================================
1602 
1603 //*************************************************************************************************
1605 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1606 struct SubTrait< DiagonalMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
1607 {
1608  typedef typename SubTrait< MT, StaticMatrix<T,M,N,SO2> >::Type Type;
1609 };
1610 
1611 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1612 struct SubTrait< StaticMatrix<T,M,N,SO1>, DiagonalMatrix<MT,SO2,DF> >
1613 {
1614  typedef typename SubTrait< StaticMatrix<T,M,N,SO1>, MT >::Type Type;
1615 };
1616 
1617 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1618 struct SubTrait< DiagonalMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
1619 {
1620  typedef typename SubTrait< MT, HybridMatrix<T,M,N,SO2> >::Type Type;
1621 };
1622 
1623 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1624 struct SubTrait< HybridMatrix<T,M,N,SO1>, DiagonalMatrix<MT,SO2,DF> >
1625 {
1626  typedef typename SubTrait< HybridMatrix<T,M,N,SO1>, MT >::Type Type;
1627 };
1628 
1629 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1630 struct SubTrait< DiagonalMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
1631 {
1632  typedef typename SubTrait< MT, DynamicMatrix<T,SO2> >::Type Type;
1633 };
1634 
1635 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1636 struct SubTrait< DynamicMatrix<T,SO1>, DiagonalMatrix<MT,SO2,DF> >
1637 {
1638  typedef typename SubTrait< DynamicMatrix<T,SO1>, MT >::Type Type;
1639 };
1640 
1641 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
1642 struct SubTrait< DiagonalMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
1643 {
1644  typedef typename SubTrait< MT, CustomMatrix<T,AF,PF,SO2> >::Type Type;
1645 };
1646 
1647 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
1648 struct SubTrait< CustomMatrix<T,AF,PF,SO1>, DiagonalMatrix<MT,SO2,DF> >
1649 {
1650  typedef typename SubTrait< CustomMatrix<T,AF,PF,SO1>, MT >::Type Type;
1651 };
1652 
1653 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1654 struct SubTrait< DiagonalMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
1655 {
1656  typedef typename SubTrait< MT, CompressedMatrix<T,SO2> >::Type Type;
1657 };
1658 
1659 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1660 struct SubTrait< CompressedMatrix<T,SO1>, DiagonalMatrix<MT,SO2,DF> >
1661 {
1662  typedef typename SubTrait< CompressedMatrix<T,SO1>, MT >::Type Type;
1663 };
1664 
1665 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
1666 struct SubTrait< DiagonalMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
1667 {
1668  typedef typename SubTrait<MT1,MT2>::Type Type;
1669 };
1670 
1671 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
1672 struct SubTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, DiagonalMatrix<MT2,SO2,DF2> >
1673 {
1674  typedef typename SubTrait<MT1,MT2>::Type Type;
1675 };
1676 
1677 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1678 struct SubTrait< DiagonalMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1679 {
1680  typedef typename SubTrait<MT1,MT2>::Type Type;
1681 };
1682 
1683 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1684 struct SubTrait< HermitianMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
1685 {
1686  typedef typename SubTrait<MT1,MT2>::Type Type;
1687 };
1688 
1689 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1690 struct SubTrait< DiagonalMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
1691 {
1692  typedef LowerMatrix< typename SubTrait<MT1,MT2>::Type > Type;
1693 };
1694 
1695 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1696 struct SubTrait< LowerMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
1697 {
1698  typedef LowerMatrix< typename SubTrait<MT1,MT2>::Type > Type;
1699 };
1700 
1701 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1702 struct SubTrait< DiagonalMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
1703 {
1704  typedef LowerMatrix< typename SubTrait<MT1,MT2>::Type > Type;
1705 };
1706 
1707 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1708 struct SubTrait< UniLowerMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
1709 {
1710  typedef LowerMatrix< typename SubTrait<MT1,MT2>::Type > Type;
1711 };
1712 
1713 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1714 struct SubTrait< DiagonalMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1715 {
1716  typedef UpperMatrix< typename SubTrait<MT1,MT2>::Type > Type;
1717 };
1718 
1719 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1720 struct SubTrait< UpperMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
1721 {
1722  typedef UpperMatrix< typename SubTrait<MT1,MT2>::Type > Type;
1723 };
1724 
1725 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1726 struct SubTrait< DiagonalMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
1727 {
1728  typedef UpperMatrix< typename SubTrait<MT1,MT2>::Type > Type;
1729 };
1730 
1731 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1732 struct SubTrait< UniUpperMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
1733 {
1734  typedef UpperMatrix< typename SubTrait<MT1,MT2>::Type > Type;
1735 };
1736 
1737 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1738 struct SubTrait< DiagonalMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1739 {
1740  typedef UpperMatrix< typename SubTrait<MT1,MT2>::Type > Type;
1741 };
1742 
1743 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1744 struct SubTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
1745 {
1746  typedef UpperMatrix< typename SubTrait<MT1,MT2>::Type > Type;
1747 };
1748 
1749 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1750 struct SubTrait< DiagonalMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
1751 {
1752  typedef DiagonalMatrix< typename SubTrait<MT1,MT2>::Type > Type;
1753 };
1755 //*************************************************************************************************
1756 
1757 
1758 
1759 
1760 //=================================================================================================
1761 //
1762 // MULTTRAIT SPECIALIZATIONS
1763 //
1764 //=================================================================================================
1765 
1766 //*************************************************************************************************
1768 template< typename MT, bool SO, bool DF, typename T >
1769 struct MultTrait< DiagonalMatrix<MT,SO,DF>, T, typename EnableIf< IsNumeric<T> >::Type >
1770 {
1771  typedef DiagonalMatrix< typename MultTrait<MT,T>::Type > Type;
1772 };
1773 
1774 template< typename T, typename MT, bool SO, bool DF >
1775 struct MultTrait< T, DiagonalMatrix<MT,SO,DF>, typename EnableIf< IsNumeric<T> >::Type >
1776 {
1777  typedef DiagonalMatrix< typename MultTrait<T,MT>::Type > Type;
1778 };
1779 
1780 template< typename MT, bool SO, bool DF, typename T, size_t N >
1781 struct MultTrait< DiagonalMatrix<MT,SO,DF>, StaticVector<T,N,false> >
1782 {
1783  typedef typename MultTrait< MT, StaticVector<T,N,false> >::Type Type;
1784 };
1785 
1786 template< typename T, size_t N, typename MT, bool SO, bool DF >
1787 struct MultTrait< StaticVector<T,N,true>, DiagonalMatrix<MT,SO,DF> >
1788 {
1789  typedef typename MultTrait< StaticVector<T,N,true>, MT >::Type Type;
1790 };
1791 
1792 template< typename MT, bool SO, bool DF, typename T, size_t N >
1793 struct MultTrait< DiagonalMatrix<MT,SO,DF>, HybridVector<T,N,false> >
1794 {
1795  typedef typename MultTrait< MT, HybridVector<T,N,false> >::Type Type;
1796 };
1797 
1798 template< typename T, size_t N, typename MT, bool SO, bool DF >
1799 struct MultTrait< HybridVector<T,N,true>, DiagonalMatrix<MT,SO,DF> >
1800 {
1801  typedef typename MultTrait< HybridVector<T,N,true>, MT >::Type Type;
1802 };
1803 
1804 template< typename MT, bool SO, bool DF, typename T >
1805 struct MultTrait< DiagonalMatrix<MT,SO,DF>, DynamicVector<T,false> >
1806 {
1807  typedef typename MultTrait< MT, DynamicVector<T,false> >::Type Type;
1808 };
1809 
1810 template< typename T, typename MT, bool SO, bool DF >
1811 struct MultTrait< DynamicVector<T,true>, DiagonalMatrix<MT,SO,DF> >
1812 {
1813  typedef typename MultTrait< DynamicVector<T,true>, MT >::Type Type;
1814 };
1815 
1816 template< typename MT, bool SO, bool DF, typename T, bool AF, bool PF >
1817 struct MultTrait< DiagonalMatrix<MT,SO,DF>, CustomVector<T,AF,PF,false> >
1818 {
1819  typedef typename MultTrait< MT, CustomVector<T,AF,PF,false> >::Type Type;
1820 };
1821 
1822 template< typename T, bool AF, bool PF, typename MT, bool SO, bool DF >
1823 struct MultTrait< CustomVector<T,AF,PF,true>, DiagonalMatrix<MT,SO,DF> >
1824 {
1825  typedef typename MultTrait< CustomVector<T,AF,PF,true>, MT >::Type Type;
1826 };
1827 
1828 template< typename MT, bool SO, bool DF, typename T >
1829 struct MultTrait< DiagonalMatrix<MT,SO,DF>, CompressedVector<T,false> >
1830 {
1831  typedef typename MultTrait< MT, CompressedVector<T,false> >::Type Type;
1832 };
1833 
1834 template< typename T, typename MT, bool SO, bool DF >
1835 struct MultTrait< CompressedVector<T,true>, DiagonalMatrix<MT,SO,DF> >
1836 {
1837  typedef typename MultTrait< CompressedVector<T,true>, MT >::Type Type;
1838 };
1839 
1840 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1841 struct MultTrait< DiagonalMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
1842 {
1843  typedef typename MultTrait< MT, StaticMatrix<T,M,N,SO2> >::Type Type;
1844 };
1845 
1846 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1847 struct MultTrait< StaticMatrix<T,M,N,SO1>, DiagonalMatrix<MT,SO2,DF> >
1848 {
1849  typedef typename MultTrait< StaticMatrix<T,M,N,SO1>, MT >::Type Type;
1850 };
1851 
1852 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1853 struct MultTrait< DiagonalMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
1854 {
1855  typedef typename MultTrait< MT, HybridMatrix<T,M,N,SO2> >::Type Type;
1856 };
1857 
1858 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1859 struct MultTrait< HybridMatrix<T,M,N,SO1>, DiagonalMatrix<MT,SO2,DF> >
1860 {
1861  typedef typename MultTrait< HybridMatrix<T,M,N,SO1>, MT >::Type Type;
1862 };
1863 
1864 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1865 struct MultTrait< DiagonalMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
1866 {
1867  typedef typename MultTrait< MT, DynamicMatrix<T,SO2> >::Type Type;
1868 };
1869 
1870 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1871 struct MultTrait< DynamicMatrix<T,SO1>, DiagonalMatrix<MT,SO2,DF> >
1872 {
1873  typedef typename MultTrait< DynamicMatrix<T,SO1>, MT >::Type Type;
1874 };
1875 
1876 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
1877 struct MultTrait< DiagonalMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
1878 {
1879  typedef typename MultTrait< MT, CustomMatrix<T,AF,PF,SO2> >::Type Type;
1880 };
1881 
1882 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
1883 struct MultTrait< CustomMatrix<T,AF,PF,SO1>, DiagonalMatrix<MT,SO2,DF> >
1884 {
1885  typedef typename MultTrait< CustomMatrix<T,AF,PF,SO1>, MT >::Type Type;
1886 };
1887 
1888 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1889 struct MultTrait< DiagonalMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
1890 {
1891  typedef typename MultTrait< MT, CompressedMatrix<T,SO2> >::Type Type;
1892 };
1893 
1894 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1895 struct MultTrait< CompressedMatrix<T,SO1>, DiagonalMatrix<MT,SO2,DF> >
1896 {
1897  typedef typename MultTrait< CompressedMatrix<T,SO1>, MT >::Type Type;
1898 };
1899 
1900 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
1901 struct MultTrait< DiagonalMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
1902 {
1903  typedef typename MultTrait<MT1,MT2>::Type Type;
1904 };
1905 
1906 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
1907 struct MultTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, DiagonalMatrix<MT2,SO2,DF2> >
1908 {
1909  typedef typename MultTrait<MT1,MT2>::Type Type;
1910 };
1911 
1912 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1913 struct MultTrait< DiagonalMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1914 {
1915  typedef typename MultTrait<MT1,MT2>::Type Type;
1916 };
1917 
1918 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1919 struct MultTrait< HermitianMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
1920 {
1921  typedef typename MultTrait<MT1,MT2>::Type Type;
1922 };
1923 
1924 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1925 struct MultTrait< DiagonalMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
1926 {
1927  typedef LowerMatrix< typename MultTrait<MT1,MT2>::Type > Type;
1928 };
1929 
1930 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1931 struct MultTrait< LowerMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
1932 {
1933  typedef LowerMatrix< typename MultTrait<MT1,MT2>::Type > Type;
1934 };
1935 
1936 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1937 struct MultTrait< DiagonalMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
1938 {
1939  typedef LowerMatrix< typename MultTrait<MT1,MT2>::Type > Type;
1940 };
1941 
1942 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1943 struct MultTrait< UniLowerMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
1944 {
1945  typedef LowerMatrix< typename MultTrait<MT1,MT2>::Type > Type;
1946 };
1947 
1948 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1949 struct MultTrait< DiagonalMatrix<MT1,SO1,DF1>, StrictlyLowerMatrix<MT2,SO2,DF2> >
1950 {
1951  typedef StrictlyLowerMatrix< typename MultTrait<MT1,MT2>::Type > Type;
1952 };
1953 
1954 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1955 struct MultTrait< StrictlyLowerMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
1956 {
1957  typedef StrictlyLowerMatrix< typename MultTrait<MT1,MT2>::Type > Type;
1958 };
1959 
1960 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1961 struct MultTrait< DiagonalMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1962 {
1963  typedef UpperMatrix< typename MultTrait<MT1,MT2>::Type > Type;
1964 };
1965 
1966 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1967 struct MultTrait< UpperMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
1968 {
1969  typedef UpperMatrix< typename MultTrait<MT1,MT2>::Type > Type;
1970 };
1971 
1972 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1973 struct MultTrait< DiagonalMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
1974 {
1975  typedef UpperMatrix< typename MultTrait<MT1,MT2>::Type > Type;
1976 };
1977 
1978 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1979 struct MultTrait< UniUpperMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
1980 {
1981  typedef UpperMatrix< typename MultTrait<MT1,MT2>::Type > Type;
1982 };
1983 
1984 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1985 struct MultTrait< DiagonalMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1986 {
1987  typedef StrictlyUpperMatrix< typename MultTrait<MT1,MT2>::Type > Type;
1988 };
1989 
1990 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1991 struct MultTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
1992 {
1993  typedef StrictlyUpperMatrix< typename MultTrait<MT1,MT2>::Type > Type;
1994 };
1995 
1996 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1997 struct MultTrait< DiagonalMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
1998 {
1999  typedef DiagonalMatrix< typename MultTrait<MT1,MT2>::Type > Type;
2000 };
2002 //*************************************************************************************************
2003 
2004 
2005 
2006 
2007 //=================================================================================================
2008 //
2009 // DIVTRAIT SPECIALIZATIONS
2010 //
2011 //=================================================================================================
2012 
2013 //*************************************************************************************************
2015 template< typename MT, bool SO, bool DF, typename T >
2016 struct DivTrait< DiagonalMatrix<MT,SO,DF>, T, typename EnableIf< IsNumeric<T> >::Type >
2017 {
2018  typedef DiagonalMatrix< typename DivTrait<MT,T>::Type > Type;
2019 };
2021 //*************************************************************************************************
2022 
2023 
2024 
2025 
2026 //=================================================================================================
2027 //
2028 // MATHTRAIT SPECIALIZATIONS
2029 //
2030 //=================================================================================================
2031 
2032 //*************************************************************************************************
2034 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2035 struct MathTrait< DiagonalMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
2036 {
2037  typedef DiagonalMatrix< typename MathTrait<MT1,MT2>::HighType > HighType;
2038  typedef DiagonalMatrix< typename MathTrait<MT1,MT2>::LowType > LowType;
2039 };
2041 //*************************************************************************************************
2042 
2043 
2044 
2045 
2046 //=================================================================================================
2047 //
2048 // SUBMATRIXTRAIT SPECIALIZATIONS
2049 //
2050 //=================================================================================================
2051 
2052 //*************************************************************************************************
2054 template< typename MT, bool SO, bool DF >
2055 struct SubmatrixTrait< DiagonalMatrix<MT,SO,DF> >
2056 {
2057  typedef typename SubmatrixTrait<MT>::Type Type;
2058 };
2060 //*************************************************************************************************
2061 
2062 
2063 
2064 
2065 //=================================================================================================
2066 //
2067 // ROWTRAIT SPECIALIZATIONS
2068 //
2069 //=================================================================================================
2070 
2071 //*************************************************************************************************
2073 template< typename MT, bool SO, bool DF >
2074 struct RowTrait< DiagonalMatrix<MT,SO,DF> >
2075 {
2076  typedef typename RowTrait<MT>::Type Type;
2077 };
2079 //*************************************************************************************************
2080 
2081 
2082 
2083 
2084 //=================================================================================================
2085 //
2086 // COLUMNTRAIT SPECIALIZATIONS
2087 //
2088 //=================================================================================================
2089 
2090 //*************************************************************************************************
2092 template< typename MT, bool SO, bool DF >
2093 struct ColumnTrait< DiagonalMatrix<MT,SO,DF> >
2094 {
2095  typedef typename ColumnTrait<MT>::Type Type;
2096 };
2098 //*************************************************************************************************
2099 
2100 } // namespace blaze
2101 
2102 #endif
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exceptionThis macro encapsulates the default way of...
Definition: Exception.h:187
Header file for the Rows type trait.
Header file for the UNUSED_PARAMETER function template.
Header file for the subtraction trait.
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:252
Header file for the row trait.
BLAZE_ALWAYS_INLINE MT::Iterator end(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:250
Header file for the implementation of the base template of the DiagonalMatrix.
Header file for the dense matrix inversion flags.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:507
MT::ElementType det(const DenseMatrix< MT, SO > &dm)
Computation of the determinant of the given dense square matrix.
Definition: DMatDetExpr.h:382
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix)
Returns the current number of rows of the matrix.
Definition: Matrix.h:308
DisableIf< Or< IsComputation< MT >, IsTransExpr< MT > >, typename ColumnExprTrait< MT >::Type >::Type column(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific column of the given matrix.
Definition: Column.h:107
void UNUSED_PARAMETER(const T1 &)
Suppression of unused parameter warnings.
Definition: Unused.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UNITRIANGULAR_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a lower or upper unitriangular matrix ty...
Definition: UniTriangular.h:118
Header file for the invert shim.
Constraint on the data type.
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:547
Constraint on the data type.
Header file for the implementation of the base template of the UpperMatrix.
Header file for the IsSquare type trait.
void invert(const HermitianProxy< MT > &proxy)
In-place inversion of the represented element.
Definition: HermitianProxy.h:767
Header file for the multiplication trait.
Header file for the IsSymmetric type trait.
Header file for the implementation of the base template of the LowerMatrix.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for all forward declarations of the math module.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2592
void lu(const DenseMatrix< MT1, SO1 > &A, DenseMatrix< MT2, SO1 > &L, DenseMatrix< MT3, SO1 > &U, Matrix< MT4, SO2 > &P)
LU decomposition of the given dense matrix.
Definition: LU.h:217
Header file for the Columns type trait.
Header file for the IsLower type trait.
Header file for the IsAligned type trait.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UPPER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a upper triangular matrix type...
Definition: Upper.h:118
BLAZE_ALWAYS_INLINE MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:187
BLAZE_ALWAYS_INLINE void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:532
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2586
Constraint on the data type.
Header file for the RemoveAdaptor type trait.
Constraint on the data type.
Header file for the EnableIf class template.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:527
Header file for the IsPadded type trait.
Header file for the IsAdaptor type trait.
Header file for the implementation of the base template of the StrictlyUpperMatrix.
InversionFlag
Inversion flag.The InversionFlag type enumeration represents the different types of matrix inversion ...
Definition: InversionFlag.h:76
Header file for the DerestrictTrait class template.
Constraint on the data type.
Header file for the IsNumeric type trait.
Header file for the HasConstDataAccess type trait.
DisableIf< Or< IsComputation< MT >, IsTransExpr< MT > >, typename RowExprTrait< MT >::Type >::Type row(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific row of the given matrix.
Definition: Row.h:107
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a symmetric matrix type, a compilation error is created.
Definition: Symmetric.h:116
DiagonalMatrix specialization for sparse matrices.
Header file for run time assertion macros.
Header file for the addition trait.
Header file for the division trait.
Header file for the submatrix trait.
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_LOWER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a lower triangular matrix type...
Definition: Lower.h:118
Header file for the column trait.
Header file for the isDefault shim.
#define BLAZE_CONSTRAINT_MUST_BE_BLAS_COMPATIBLE_TYPE(T)
Constraint on the data type.In case the given data type T is not a BLAS compatible data type (i...
Definition: BlasCompatible.h:79
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.In case the given data type T requires an intermediate evaluation within ...
Definition: RequiresEvaluation.h:118
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b)
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:256
Header file for the mathematical trait.
DiagonalMatrix specialization for dense matrices.
Header file for the IsBuiltin type trait.
Header file for the IsTrue value trait.
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix)
Returns the current number of columns of the matrix.
Definition: Matrix.h:324
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:237
#define BLAZE_CONSTRAINT_MUST_NOT_BE_HERMITIAN_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is an Hermitian matrix type, a compilation error is created.
Definition: Hermitian.h:116
Matrix adapter for diagonal matrices.
Definition: BaseTemplate.h:556
Header file for the IsUpper type trait.
Header file for exception macros.
Header file for the IsHermitian type trait.
Header file for the IsResizable type trait.
Header file for the IsRestricted type trait.
Header file for the implementation of the base template of the StrictlyLowerMatrix.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101