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 
43 #include <blaze/math/Aliases.h>
54 #include <blaze/math/Exception.h>
55 #include <blaze/math/Forward.h>
94 #include <blaze/util/Assert.h>
95 #include <blaze/util/EnableIf.h>
96 #include <blaze/util/TrueType.h>
99 #include <blaze/util/Unused.h>
100 
101 
102 namespace blaze {
103 
104 //=================================================================================================
105 //
106 // DIAGONALMATRIX OPERATORS
107 //
108 //=================================================================================================
109 
110 //*************************************************************************************************
113 template< typename MT, bool SO, bool DF >
114 inline void reset( DiagonalMatrix<MT,SO,DF>& m );
115 
116 template< typename MT, bool SO, bool DF >
117 inline void reset( DiagonalMatrix<MT,SO,DF>& m, size_t i );
118 
119 template< typename MT, bool SO, bool DF >
120 inline void clear( DiagonalMatrix<MT,SO,DF>& m );
121 
122 template< bool RF, typename MT, bool SO, bool DF >
123 inline bool isDefault( const DiagonalMatrix<MT,SO,DF>& m );
124 
125 template< typename MT, bool SO, bool DF >
126 inline bool isIntact( const DiagonalMatrix<MT,SO,DF>& m );
127 
128 template< typename MT, bool SO, bool DF >
129 inline void swap( DiagonalMatrix<MT,SO,DF>& a, DiagonalMatrix<MT,SO,DF>& b ) noexcept;
131 //*************************************************************************************************
132 
133 
134 //*************************************************************************************************
141 template< typename MT // Type of the adapted matrix
142  , bool SO // Storage order of the adapted matrix
143  , bool DF > // Density flag
145 {
146  m.reset();
147 }
148 //*************************************************************************************************
149 
150 
151 //*************************************************************************************************
164 template< typename MT // Type of the adapted matrix
165  , bool SO // Storage order of the adapted matrix
166  , bool DF > // Density flag
167 inline void reset( DiagonalMatrix<MT,SO,DF>& m, size_t i )
168 {
169  m.reset( i );
170 }
171 //*************************************************************************************************
172 
173 
174 //*************************************************************************************************
181 template< typename MT // Type of the adapted matrix
182  , bool SO // Storage order of the adapted matrix
183  , bool DF > // Density flag
185 {
186  m.clear();
187 }
188 //*************************************************************************************************
189 
190 
191 //*************************************************************************************************
219 template< bool RF // Relaxation flag
220  , typename MT // Type of the adapted matrix
221  , bool SO // Storage order of the adapted matrix
222  , bool DF > // Density flag
223 inline bool isDefault( const DiagonalMatrix<MT,SO,DF>& m )
224 {
225  return isDefault<RF>( m.matrix_ );
226 }
227 //*************************************************************************************************
228 
229 
230 //*************************************************************************************************
251 template< typename MT // Type of the adapted matrix
252  , bool SO // Storage order of the adapted matrix
253  , bool DF > // Density flag
254 inline bool isIntact( const DiagonalMatrix<MT,SO,DF>& m )
255 {
256  return m.isIntact();
257 }
258 //*************************************************************************************************
259 
260 
261 //*************************************************************************************************
269 template< typename MT // Type of the adapted matrix
270  , bool SO // Storage order of the adapted matrix
271  , bool DF > // Density flag
273 {
274  a.swap( b );
275 }
276 //*************************************************************************************************
277 
278 
279 //*************************************************************************************************
302 template< InversionFlag IF // Inversion algorithm
303  , typename MT // Type of the dense matrix
304  , bool SO > // Storage order of the dense matrix
305 inline void invert( DiagonalMatrix<MT,SO,true>& m )
306 {
308 
309  if( IF == asUniLower || IF == asUniUpper ) {
310  BLAZE_INTERNAL_ASSERT( isIdentity( m ), "Violation of preconditions detected" );
311  return;
312  }
313 
314  invert<asDiagonal>( derestrict( m ) );
315 
316  BLAZE_INTERNAL_ASSERT( isIntact( m ), "Broken invariant detected" );
317 }
319 //*************************************************************************************************
320 
321 
322 //*************************************************************************************************
341 template< typename MT1, bool SO1, typename MT2, typename MT3, typename MT4, bool SO2 >
342 inline void lu( const DiagonalMatrix<MT1,SO1,true>& A, DenseMatrix<MT2,SO1>& L,
344 {
346 
351 
356 
357  using ET3 = ElementType_<MT3>;
358  using ET4 = ElementType_<MT4>;
359 
360  const size_t n( (~A).rows() );
361 
362  decltype(auto) U2( derestrict( ~U ) );
363 
364  (~L) = A;
365 
366  resize( ~U, n, n );
367  reset( U2 );
368 
369  resize( ~P, n, n );
370  reset( ~P );
371 
372  for( size_t i=0UL; i<n; ++i ) {
373  U2(i,i) = ET3(1);
374  (~P)(i,i) = ET4(1);
375  }
376 }
378 //*************************************************************************************************
379 
380 
381 //*************************************************************************************************
397 template< typename MT // Type of the adapted matrix
398  , bool SO // Storage order of the adapted matrix
399  , bool DF // Density flag
400  , typename ET > // Type of the element
401 inline bool trySet( const DiagonalMatrix<MT,SO,DF>& mat, size_t i, size_t j, const ET& value )
402 {
403  BLAZE_INTERNAL_ASSERT( i < (~mat).rows(), "Invalid row access index" );
404  BLAZE_INTERNAL_ASSERT( j < (~mat).columns(), "Invalid column access index" );
405 
406  UNUSED_PARAMETER( mat );
407 
408  return ( i == j || isDefault( value ) );
409 }
411 //*************************************************************************************************
412 
413 
414 //*************************************************************************************************
430 template< typename MT // Type of the adapted matrix
431  , bool SO // Storage order of the adapted matrix
432  , bool DF // Density flag
433  , typename ET > // Type of the element
434 inline bool tryAdd( const DiagonalMatrix<MT,SO,DF>& mat, size_t i, size_t j, const ET& value )
435 {
436  return trySet( mat, i, j, value );
437 }
439 //*************************************************************************************************
440 
441 
442 //*************************************************************************************************
458 template< typename MT // Type of the adapted matrix
459  , bool SO // Storage order of the adapted matrix
460  , bool DF // Density flag
461  , typename ET > // Type of the element
462 inline bool trySub( const DiagonalMatrix<MT,SO,DF>& mat, size_t i, size_t j, const ET& value )
463 {
464  return trySet( mat, i, j, value );
465 }
467 //*************************************************************************************************
468 
469 
470 //*************************************************************************************************
486 template< typename MT // Type of the adapted matrix
487  , bool SO // Storage order of the adapted matrix
488  , bool DF // Density flag
489  , typename VT > // Type of the right-hand side dense vector
490 inline bool tryAssign( const DiagonalMatrix<MT,SO,DF>& lhs,
491  const DenseVector<VT,false>& rhs, size_t row, size_t column )
492 {
494 
495  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
496  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
497  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
498 
499  UNUSED_PARAMETER( lhs );
500 
501  const size_t index( ( column <= row )?( 0UL ):( column - row ) );
502 
503  for( size_t i=0UL; i<index; ++i ) {
504  if( !isDefault( (~rhs)[i] ) )
505  return false;
506  }
507 
508  for( size_t i=index+1UL; i<(~rhs).size(); ++i ) {
509  if( !isDefault( (~rhs)[i] ) )
510  return false;
511  }
512 
513  return true;
514 }
516 //*************************************************************************************************
517 
518 
519 //*************************************************************************************************
535 template< typename MT // Type of the adapted matrix
536  , bool SO // Storage order of the adapted matrix
537  , bool DF // Density flag
538  , typename VT > // Type of the right-hand side dense vector
539 inline bool tryAssign( const DiagonalMatrix<MT,SO,DF>& lhs,
540  const DenseVector<VT,true>& rhs, size_t row, size_t column )
541 {
543 
544  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
545  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
546  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
547 
548  UNUSED_PARAMETER( lhs );
549 
550  const size_t index( ( row <= column )?( 0UL ):( row - column ) );
551 
552  for( size_t i=0UL; i<index; ++i ) {
553  if( !isDefault( (~rhs)[i] ) )
554  return false;
555  }
556 
557  for( size_t i=index+1UL; i<(~rhs).size(); ++i ) {
558  if( !isDefault( (~rhs)[i] ) )
559  return false;
560  }
561 
562  return true;
563 }
565 //*************************************************************************************************
566 
567 
568 //*************************************************************************************************
586 template< typename MT // Type of the adapted matrix
587  , bool SO // Storage order of the adapted matrix
588  , bool DF // Density flag
589  , typename VT // Type of the right-hand side dense vector
590  , bool TF > // Transpose flag of the right-hand side dense vector
591 inline bool tryAssign( const DiagonalMatrix<MT,SO,DF>& lhs, const DenseVector<VT,TF>& rhs,
592  ptrdiff_t band, size_t row, size_t column )
593 {
595 
596  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
597  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
598  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
599 
600  UNUSED_PARAMETER( lhs, row, column );
601 
602  if( band != 0L ) {
603  for( size_t i=0UL; i<(~rhs).size(); ++i ) {
604  if( !isDefault( (~rhs)[i] ) )
605  return false;
606  }
607  }
608 
609  return true;
610 }
612 //*************************************************************************************************
613 
614 
615 //*************************************************************************************************
631 template< typename MT // Type of the adapted matrix
632  , bool SO // Storage order of the adapted matrix
633  , bool DF // Density flag
634  , typename VT > // Type of the right-hand side sparse vector
635 inline bool tryAssign( const DiagonalMatrix<MT,SO,DF>& lhs,
636  const SparseVector<VT,false>& rhs, size_t row, size_t column )
637 {
639 
640  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
641  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
642  BLAZE_INTERNAL_ASSERT( row + (~rhs).size() <= lhs.rows(), "Invalid number of rows" );
643 
644  UNUSED_PARAMETER( lhs );
645 
646  using RhsIterator = typename VT::ConstIterator;
647 
648  const size_t index( column - row );
649 
650  for( RhsIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element ) {
651  if( element->index() != index && !isDefault( element->value() ) )
652  return false;
653  }
654 
655  return true;
656 }
658 //*************************************************************************************************
659 
660 
661 //*************************************************************************************************
677 template< typename MT // Type of the adapted matrix
678  , bool SO // Storage order of the adapted matrix
679  , bool DF // Density flag
680  , typename VT > // Type of the right-hand side sparse vector
681 inline bool tryAssign( const DiagonalMatrix<MT,SO,DF>& lhs,
682  const SparseVector<VT,true>& rhs, size_t row, size_t column )
683 {
685 
686  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
687  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
688  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
689 
690  UNUSED_PARAMETER( lhs );
691 
692  using RhsIterator = typename VT::ConstIterator;
693 
694  const size_t index( row - column );
695 
696  for( RhsIterator element=(~rhs).begin(); element!=(~rhs).end(); ++element ) {
697  if( element->index() != index && !isDefault( element->value() ) )
698  return false;
699  }
700 
701  return true;
702 }
704 //*************************************************************************************************
705 
706 
707 //*************************************************************************************************
725 template< typename MT // Type of the adapted matrix
726  , bool SO // Storage order of the adapted matrix
727  , bool DF // Density flag
728  , typename VT // Type of the right-hand side sparse vector
729  , bool TF > // Transpose flag of the right-hand side sparse vector
730 inline bool tryAssign( const DiagonalMatrix<MT,SO,DF>& lhs, const SparseVector<VT,TF>& rhs,
731  ptrdiff_t band, size_t row, size_t column )
732 {
734 
735  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
736  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
737  BLAZE_INTERNAL_ASSERT( column + (~rhs).size() <= lhs.columns(), "Invalid number of columns" );
738 
739  UNUSED_PARAMETER( lhs, row, column );
740 
741  if( band != 0L ) {
742  for( const auto& element : ~rhs ) {
743  if( !isDefault( element.value() ) )
744  return false;
745  }
746  }
747 
748  return true;
749 }
751 //*************************************************************************************************
752 
753 
754 //*************************************************************************************************
770 template< typename MT1 // Type of the adapted matrix
771  , bool SO // Storage order of the adapted matrix
772  , bool DF // Density flag
773  , typename MT2 > // Type of the right-hand side dense matrix
774 inline bool tryAssign( const DiagonalMatrix<MT1,SO,DF>& lhs,
775  const DenseMatrix<MT2,false>& rhs, size_t row, size_t column )
776 {
778 
779  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
780  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
781  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
782  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
783 
784  UNUSED_PARAMETER( lhs );
785 
786  const size_t M( (~rhs).rows() );
787  const size_t N( (~rhs).columns() );
788 
789  for( size_t i=0UL; i<M; ++i ) {
790  for( size_t j=0UL; j<N; ++j ) {
791  if( ( row + i != column + j ) && !isDefault( (~rhs)(i,j) ) )
792  return false;
793  }
794  }
795 
796  return true;
797 }
799 //*************************************************************************************************
800 
801 
802 //*************************************************************************************************
818 template< typename MT1 // Type of the adapted matrix
819  , bool SO // Storage order of the adapted matrix
820  , bool DF // Density flag
821  , typename MT2 > // Type of the right-hand side dense matrix
822 inline bool tryAssign( const DiagonalMatrix<MT1,SO,DF>& lhs,
823  const DenseMatrix<MT2,true>& rhs, size_t row, size_t column )
824 {
826 
827  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
828  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
829  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
830  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
831 
832  UNUSED_PARAMETER( lhs );
833 
834  const size_t M( (~rhs).rows() );
835  const size_t N( (~rhs).columns() );
836 
837  for( size_t j=0UL; j<N; ++j ) {
838  for( size_t i=0UL; i<M; ++i ) {
839  if( ( column + j != row + i ) && !isDefault( (~rhs)(i,j) ) )
840  return false;
841  }
842  }
843 
844  return true;
845 }
847 //*************************************************************************************************
848 
849 
850 //*************************************************************************************************
866 template< typename MT1 // Type of the adapted matrix
867  , bool SO // Storage order of the adapted matrix
868  , bool DF // Density flag
869  , typename MT2 > // Type of the right-hand side sparse matrix
870 inline bool tryAssign( const DiagonalMatrix<MT1,SO,DF>& lhs,
871  const SparseMatrix<MT2,false>& rhs, size_t row, size_t column )
872 {
874 
875  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
876  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
877  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
878  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
879 
880  UNUSED_PARAMETER( lhs );
881 
882  using RhsIterator = typename MT2::ConstIterator;
883 
884  const size_t M( (~rhs).rows() );
885 
886  for( size_t i=0UL; i<M; ++i ) {
887  for( RhsIterator element=(~rhs).begin(i); element!=(~rhs).end(i); ++element ) {
888  if( ( row + i != column + element->index() ) && !isDefault( element->value() ) )
889  return false;
890  }
891  }
892 
893  return true;
894 }
896 //*************************************************************************************************
897 
898 
899 //*************************************************************************************************
915 template< typename MT1 // Type of the adapted matrix
916  , bool SO // Storage order of the adapted matrix
917  , bool DF // Density flag
918  , typename MT2 > // Type of the right-hand side sparse matrix
919 inline bool tryAssign( const DiagonalMatrix<MT1,SO,DF>& lhs,
920  const SparseMatrix<MT2,true>& rhs, size_t row, size_t column )
921 {
923 
924  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
925  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
926  BLAZE_INTERNAL_ASSERT( row + (~rhs).rows() <= lhs.rows(), "Invalid number of rows" );
927  BLAZE_INTERNAL_ASSERT( column + (~rhs).columns() <= lhs.columns(), "Invalid number of columns" );
928 
929  UNUSED_PARAMETER( lhs );
930 
931  using RhsIterator = typename MT2::ConstIterator;
932 
933  const size_t N( (~rhs).columns() );
934 
935  for( size_t j=0UL; j<N; ++j ) {
936  for( RhsIterator element=(~rhs).begin(j); element!=(~rhs).end(j); ++element ) {
937  if( ( column + j != row + element->index() ) && !isDefault( element->value() ) )
938  return false;
939  }
940  }
941 
942  return true;
943 }
945 //*************************************************************************************************
946 
947 
948 //*************************************************************************************************
964 template< typename MT // Type of the adapted matrix
965  , bool SO // Storage order of the adapted matrix
966  , bool DF // Density flag
967  , typename VT // Type of the right-hand side vector
968  , bool TF > // Transpose flag of the right-hand side vector
969 inline bool tryAddAssign( const DiagonalMatrix<MT,SO,DF>& lhs,
970  const Vector<VT,TF>& rhs, size_t row, size_t column )
971 {
972  return tryAssign( lhs, ~rhs, row, column );
973 }
975 //*************************************************************************************************
976 
977 
978 //*************************************************************************************************
996 template< typename MT // Type of the adapted matrix
997  , bool SO // Storage order of the adapted matrix
998  , bool DF // Density flag
999  , typename VT // Type of the right-hand side vector
1000  , bool TF > // Transpose flag of the right-hand side vector
1001 inline bool tryAddAssign( const DiagonalMatrix<MT,SO,DF>& lhs, const Vector<VT,TF>& rhs,
1002  ptrdiff_t band, size_t row, size_t column )
1003 {
1004  return tryAssign( lhs, ~rhs, band, row, column );
1005 }
1007 //*************************************************************************************************
1008 
1009 
1010 //*************************************************************************************************
1026 template< typename MT1 // Type of the adapted matrix
1027  , bool SO1 // Storage order of the adapted matrix
1028  , bool DF // Density flag
1029  , typename MT2 // Type of the right-hand side matrix
1030  , bool SO2 > // Storage order of the right-hand side matrix
1031 inline bool tryAddAssign( const DiagonalMatrix<MT1,SO1,DF>& lhs,
1032  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
1033 {
1034  return tryAssign( lhs, ~rhs, row, column );
1035 }
1037 //*************************************************************************************************
1038 
1039 
1040 //*************************************************************************************************
1057 template< typename MT // Type of the adapted matrix
1058  , bool SO // Storage order of the adapted matrix
1059  , bool DF // Density flag
1060  , typename VT // Type of the right-hand side vector
1061  , bool TF > // Transpose flag of the right-hand side vector
1062 inline bool trySubAssign( const DiagonalMatrix<MT,SO,DF>& lhs,
1063  const Vector<VT,TF>& rhs, size_t row, size_t column )
1064 {
1065  return tryAssign( lhs, ~rhs, row, column );
1066 }
1068 //*************************************************************************************************
1069 
1070 
1071 //*************************************************************************************************
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, const Vector<VT,TF>& rhs,
1095  ptrdiff_t band, size_t row, size_t column )
1096 {
1097  return tryAssign( lhs, ~rhs, band, 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 // SIZE SPECIALIZATIONS
1165 //
1166 //=================================================================================================
1167 
1168 //*************************************************************************************************
1170 template< typename MT, bool SO, bool DF >
1171 struct Size< DiagonalMatrix<MT,SO,DF>, 0UL >
1172  : public Size<MT,0UL>
1173 {};
1174 
1175 template< typename MT, bool SO, bool DF >
1176 struct Size< DiagonalMatrix<MT,SO,DF>, 1UL >
1177  : public Size<MT,1UL>
1178 {};
1180 //*************************************************************************************************
1181 
1182 
1183 
1184 
1185 //=================================================================================================
1186 //
1187 // ISSQUARE SPECIALIZATIONS
1188 //
1189 //=================================================================================================
1190 
1191 //*************************************************************************************************
1193 template< typename MT, bool SO, bool DF >
1194 struct IsSquare< DiagonalMatrix<MT,SO,DF> >
1195  : public TrueType
1196 {};
1198 //*************************************************************************************************
1199 
1200 
1201 
1202 
1203 //=================================================================================================
1204 //
1205 // ISSYMMETRIC SPECIALIZATIONS
1206 //
1207 //=================================================================================================
1208 
1209 //*************************************************************************************************
1211 template< typename MT, bool SO, bool DF >
1212 struct IsSymmetric< DiagonalMatrix<MT,SO,DF> >
1213  : public TrueType
1214 {};
1216 //*************************************************************************************************
1217 
1218 
1219 
1220 
1221 //=================================================================================================
1222 //
1223 // ISHERMITIAN SPECIALIZATIONS
1224 //
1225 //=================================================================================================
1226 
1227 //*************************************************************************************************
1229 template< typename MT, bool SO, bool DF >
1230 struct IsHermitian< DiagonalMatrix<MT,SO,DF> >
1231  : public IsBuiltin< ElementType_<MT> >
1232 {};
1234 //*************************************************************************************************
1235 
1236 
1237 
1238 
1239 //=================================================================================================
1240 //
1241 // ISLOWER SPECIALIZATIONS
1242 //
1243 //=================================================================================================
1244 
1245 //*************************************************************************************************
1247 template< typename MT, bool SO, bool DF >
1248 struct IsLower< DiagonalMatrix<MT,SO,DF> >
1249  : public TrueType
1250 {};
1252 //*************************************************************************************************
1253 
1254 
1255 
1256 
1257 //=================================================================================================
1258 //
1259 // ISUPPER SPECIALIZATIONS
1260 //
1261 //=================================================================================================
1262 
1263 //*************************************************************************************************
1265 template< typename MT, bool SO, bool DF >
1266 struct IsUpper< DiagonalMatrix<MT,SO,DF> >
1267  : public TrueType
1268 {};
1270 //*************************************************************************************************
1271 
1272 
1273 
1274 
1275 //=================================================================================================
1276 //
1277 // ISADAPTOR SPECIALIZATIONS
1278 //
1279 //=================================================================================================
1280 
1281 //*************************************************************************************************
1283 template< typename MT, bool SO, bool DF >
1284 struct IsAdaptor< DiagonalMatrix<MT,SO,DF> >
1285  : public TrueType
1286 {};
1288 //*************************************************************************************************
1289 
1290 
1291 
1292 
1293 //=================================================================================================
1294 //
1295 // ISRESTRICTED SPECIALIZATIONS
1296 //
1297 //=================================================================================================
1298 
1299 //*************************************************************************************************
1301 template< typename MT, bool SO, bool DF >
1302 struct IsRestricted< DiagonalMatrix<MT,SO,DF> >
1303  : public TrueType
1304 {};
1306 //*************************************************************************************************
1307 
1308 
1309 
1310 
1311 //=================================================================================================
1312 //
1313 // HASCONSTDATAACCESS SPECIALIZATIONS
1314 //
1315 //=================================================================================================
1316 
1317 //*************************************************************************************************
1319 template< typename MT, bool SO >
1320 struct HasConstDataAccess< DiagonalMatrix<MT,SO,true> >
1321  : public TrueType
1322 {};
1324 //*************************************************************************************************
1325 
1326 
1327 
1328 
1329 //=================================================================================================
1330 //
1331 // ISALIGNED SPECIALIZATIONS
1332 //
1333 //=================================================================================================
1334 
1335 //*************************************************************************************************
1337 template< typename MT, bool SO, bool DF >
1338 struct IsAligned< DiagonalMatrix<MT,SO,DF> >
1339  : public IsAligned<MT>
1340 {};
1342 //*************************************************************************************************
1343 
1344 
1345 
1346 
1347 //=================================================================================================
1348 //
1349 // ISCONTIGUOUS SPECIALIZATIONS
1350 //
1351 //=================================================================================================
1352 
1353 //*************************************************************************************************
1355 template< typename MT, bool SO, bool DF >
1356 struct IsContiguous< DiagonalMatrix<MT,SO,DF> >
1357  : public IsContiguous<MT>
1358 {};
1360 //*************************************************************************************************
1361 
1362 
1363 
1364 
1365 //=================================================================================================
1366 //
1367 // ISPADDED SPECIALIZATIONS
1368 //
1369 //=================================================================================================
1370 
1371 //*************************************************************************************************
1373 template< typename MT, bool SO, bool DF >
1374 struct IsPadded< DiagonalMatrix<MT,SO,DF> >
1375  : public IsPadded<MT>
1376 {};
1378 //*************************************************************************************************
1379 
1380 
1381 
1382 
1383 //=================================================================================================
1384 //
1385 // ISRESIZABLE SPECIALIZATIONS
1386 //
1387 //=================================================================================================
1388 
1389 //*************************************************************************************************
1391 template< typename MT, bool SO, bool DF >
1392 struct IsResizable< DiagonalMatrix<MT,SO,DF> >
1393  : public IsResizable<MT>
1394 {};
1396 //*************************************************************************************************
1397 
1398 
1399 
1400 
1401 //=================================================================================================
1402 //
1403 // ISSHRINKABLE SPECIALIZATIONS
1404 //
1405 //=================================================================================================
1406 
1407 //*************************************************************************************************
1409 template< typename MT, bool SO, bool DF >
1410 struct IsShrinkable< DiagonalMatrix<MT,SO,DF> >
1411  : public IsShrinkable<MT>
1412 {};
1414 //*************************************************************************************************
1415 
1416 
1417 
1418 
1419 //=================================================================================================
1420 //
1421 // REMOVEADAPTOR SPECIALIZATIONS
1422 //
1423 //=================================================================================================
1424 
1425 //*************************************************************************************************
1427 template< typename MT, bool SO, bool DF >
1428 struct RemoveAdaptor< DiagonalMatrix<MT,SO,DF> >
1429 {
1430  using Type = MT;
1431 };
1433 //*************************************************************************************************
1434 
1435 
1436 
1437 
1438 //=================================================================================================
1439 //
1440 // ADDTRAIT SPECIALIZATIONS
1441 //
1442 //=================================================================================================
1443 
1444 //*************************************************************************************************
1446 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1447 struct AddTrait< DiagonalMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
1448 {
1450 };
1451 
1452 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1453 struct AddTrait< StaticMatrix<T,M,N,SO1>, DiagonalMatrix<MT,SO2,DF> >
1454 {
1455  using Type = AddTrait_< StaticMatrix<T,M,N,SO1>, MT >;
1456 };
1457 
1458 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1459 struct AddTrait< DiagonalMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
1460 {
1462 };
1463 
1464 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1465 struct AddTrait< HybridMatrix<T,M,N,SO1>, DiagonalMatrix<MT,SO2,DF> >
1466 {
1467  using Type = AddTrait_< HybridMatrix<T,M,N,SO1>, MT >;
1468 };
1469 
1470 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1471 struct AddTrait< DiagonalMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
1472 {
1473  using Type = AddTrait_< MT, DynamicMatrix<T,SO2> >;
1474 };
1475 
1476 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1477 struct AddTrait< DynamicMatrix<T,SO1>, DiagonalMatrix<MT,SO2,DF> >
1478 {
1479  using Type = AddTrait_< DynamicMatrix<T,SO1>, MT >;
1480 };
1481 
1482 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
1483 struct AddTrait< DiagonalMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
1484 {
1486 };
1487 
1488 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
1489 struct AddTrait< CustomMatrix<T,AF,PF,SO1>, DiagonalMatrix<MT,SO2,DF> >
1490 {
1491  using Type = AddTrait_< CustomMatrix<T,AF,PF,SO1>, MT >;
1492 };
1493 
1494 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1495 struct AddTrait< DiagonalMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
1496 {
1498 };
1499 
1500 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1501 struct AddTrait< CompressedMatrix<T,SO1>, DiagonalMatrix<MT,SO2,DF> >
1502 {
1503  using Type = AddTrait_< CompressedMatrix<T,SO1>, MT >;
1504 };
1505 
1506 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1507 struct AddTrait< DiagonalMatrix<MT,SO1,DF>, IdentityMatrix<T,SO2> >
1508 {
1510 };
1511 
1512 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1513 struct AddTrait< IdentityMatrix<T,SO1>, DiagonalMatrix<MT,SO2,DF> >
1514 {
1516 };
1517 
1518 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
1519 struct AddTrait< DiagonalMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
1520 {
1521  using Type = SymmetricMatrix< AddTrait_<MT1,MT2> >;
1522 };
1523 
1524 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
1525 struct AddTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, DiagonalMatrix<MT2,SO2,DF2> >
1526 {
1527  using Type = SymmetricMatrix< AddTrait_<MT1,MT2> >;
1528 };
1529 
1530 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1531 struct AddTrait< DiagonalMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1532 {
1533  using Type = If_< IsBuiltin< ElementType_<MT2> >
1535  , AddTrait_<MT1,MT2> >;
1536 };
1537 
1538 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1539 struct AddTrait< HermitianMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
1540 {
1541  using Type = If_< IsBuiltin< ElementType_<MT1> >
1543  , AddTrait_<MT1,MT2> >;
1544 };
1545 
1546 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1547 struct AddTrait< DiagonalMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
1548 {
1549  using Type = LowerMatrix< AddTrait_<MT1,MT2> >;
1550 };
1551 
1552 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1553 struct AddTrait< LowerMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
1554 {
1555  using Type = LowerMatrix< AddTrait_<MT1,MT2> >;
1556 };
1557 
1558 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1559 struct AddTrait< DiagonalMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
1560 {
1561  using Type = LowerMatrix< AddTrait_<MT1,MT2> >;
1562 };
1563 
1564 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1565 struct AddTrait< UniLowerMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
1566 {
1567  using Type = LowerMatrix< AddTrait_<MT1,MT2> >;
1568 };
1569 
1570 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1571 struct AddTrait< DiagonalMatrix<MT1,SO1,DF1>, StrictlyLowerMatrix<MT2,SO2,DF2> >
1572 {
1573  using Type = LowerMatrix< AddTrait_<MT1,MT2> >;
1574 };
1575 
1576 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1577 struct AddTrait< StrictlyLowerMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
1578 {
1579  using Type = LowerMatrix< AddTrait_<MT1,MT2> >;
1580 };
1581 
1582 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1583 struct AddTrait< DiagonalMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1584 {
1585  using Type = UpperMatrix< AddTrait_<MT1,MT2> >;
1586 };
1587 
1588 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1589 struct AddTrait< UpperMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
1590 {
1591  using Type = UpperMatrix< AddTrait_<MT1,MT2> >;
1592 };
1593 
1594 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1595 struct AddTrait< DiagonalMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
1596 {
1597  using Type = UpperMatrix< AddTrait_<MT1,MT2> >;
1598 };
1599 
1600 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1601 struct AddTrait< UniUpperMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
1602 {
1603  using Type = UpperMatrix< AddTrait_<MT1,MT2> >;
1604 };
1605 
1606 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1607 struct AddTrait< DiagonalMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1608 {
1609  using Type = UpperMatrix< AddTrait_<MT1,MT2> >;
1610 };
1611 
1612 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1613 struct AddTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
1614 {
1615  using Type = UpperMatrix< AddTrait_<MT1,MT2> >;
1616 };
1617 
1618 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1619 struct AddTrait< DiagonalMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
1620 {
1621  using Type = DiagonalMatrix< AddTrait_<MT1,MT2> >;
1622 };
1624 //*************************************************************************************************
1625 
1626 
1627 
1628 
1629 //=================================================================================================
1630 //
1631 // SUBTRAIT SPECIALIZATIONS
1632 //
1633 //=================================================================================================
1634 
1635 //*************************************************************************************************
1637 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1638 struct SubTrait< DiagonalMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
1639 {
1641 };
1642 
1643 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1644 struct SubTrait< StaticMatrix<T,M,N,SO1>, DiagonalMatrix<MT,SO2,DF> >
1645 {
1646  using Type = SubTrait_< StaticMatrix<T,M,N,SO1>, MT >;
1647 };
1648 
1649 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1650 struct SubTrait< DiagonalMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
1651 {
1653 };
1654 
1655 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1656 struct SubTrait< HybridMatrix<T,M,N,SO1>, DiagonalMatrix<MT,SO2,DF> >
1657 {
1658  using Type = SubTrait_< HybridMatrix<T,M,N,SO1>, MT >;
1659 };
1660 
1661 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1662 struct SubTrait< DiagonalMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
1663 {
1664  using Type = SubTrait_< MT, DynamicMatrix<T,SO2> >;
1665 };
1666 
1667 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1668 struct SubTrait< DynamicMatrix<T,SO1>, DiagonalMatrix<MT,SO2,DF> >
1669 {
1670  using Type = SubTrait_< DynamicMatrix<T,SO1>, MT >;
1671 };
1672 
1673 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
1674 struct SubTrait< DiagonalMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
1675 {
1677 };
1678 
1679 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
1680 struct SubTrait< CustomMatrix<T,AF,PF,SO1>, DiagonalMatrix<MT,SO2,DF> >
1681 {
1682  using Type = SubTrait_< CustomMatrix<T,AF,PF,SO1>, MT >;
1683 };
1684 
1685 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1686 struct SubTrait< DiagonalMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
1687 {
1689 };
1690 
1691 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1692 struct SubTrait< CompressedMatrix<T,SO1>, DiagonalMatrix<MT,SO2,DF> >
1693 {
1694  using Type = SubTrait_< CompressedMatrix<T,SO1>, MT >;
1695 };
1696 
1697 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1698 struct SubTrait< DiagonalMatrix<MT,SO1,DF>, IdentityMatrix<T,SO2> >
1699 {
1701 };
1702 
1703 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1704 struct SubTrait< IdentityMatrix<T,SO1>, DiagonalMatrix<MT,SO2,DF> >
1705 {
1707 };
1708 
1709 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
1710 struct SubTrait< DiagonalMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
1711 {
1712  using Type = SymmetricMatrix< SubTrait_<MT1,MT2> >;
1713 };
1714 
1715 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
1716 struct SubTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, DiagonalMatrix<MT2,SO2,DF2> >
1717 {
1718  using Type = SymmetricMatrix< SubTrait_<MT1,MT2> >;
1719 };
1720 
1721 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1722 struct SubTrait< DiagonalMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1723 {
1724  using Type = If_< IsBuiltin< ElementType_<MT2> >
1726  , SubTrait_<MT1,MT2> >;
1727 };
1728 
1729 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1730 struct SubTrait< HermitianMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
1731 {
1732  using Type = If_< IsBuiltin< ElementType_<MT1> >
1734  , SubTrait_<MT1,MT2> >;
1735 };
1736 
1737 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1738 struct SubTrait< DiagonalMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
1739 {
1740  using Type = LowerMatrix< SubTrait_<MT1,MT2> >;
1741 };
1742 
1743 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1744 struct SubTrait< LowerMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
1745 {
1746  using Type = LowerMatrix< SubTrait_<MT1,MT2> >;
1747 };
1748 
1749 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1750 struct SubTrait< DiagonalMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
1751 {
1752  using Type = LowerMatrix< SubTrait_<MT1,MT2> >;
1753 };
1754 
1755 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1756 struct SubTrait< UniLowerMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
1757 {
1758  using Type = LowerMatrix< SubTrait_<MT1,MT2> >;
1759 };
1760 
1761 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1762 struct SubTrait< DiagonalMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1763 {
1764  using Type = UpperMatrix< SubTrait_<MT1,MT2> >;
1765 };
1766 
1767 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1768 struct SubTrait< UpperMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
1769 {
1770  using Type = UpperMatrix< SubTrait_<MT1,MT2> >;
1771 };
1772 
1773 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1774 struct SubTrait< DiagonalMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
1775 {
1776  using Type = UpperMatrix< SubTrait_<MT1,MT2> >;
1777 };
1778 
1779 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1780 struct SubTrait< UniUpperMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
1781 {
1782  using Type = UpperMatrix< SubTrait_<MT1,MT2> >;
1783 };
1784 
1785 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1786 struct SubTrait< DiagonalMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1787 {
1788  using Type = UpperMatrix< SubTrait_<MT1,MT2> >;
1789 };
1790 
1791 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1792 struct SubTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
1793 {
1794  using Type = UpperMatrix< SubTrait_<MT1,MT2> >;
1795 };
1796 
1797 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1798 struct SubTrait< DiagonalMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
1799 {
1800  using Type = DiagonalMatrix< SubTrait_<MT1,MT2> >;
1801 };
1803 //*************************************************************************************************
1804 
1805 
1806 
1807 
1808 //=================================================================================================
1809 //
1810 // SCHURTRAIT SPECIALIZATIONS
1811 //
1812 //=================================================================================================
1813 
1814 //*************************************************************************************************
1816 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1817 struct SchurTrait< DiagonalMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
1818 {
1820 };
1821 
1822 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1823 struct SchurTrait< StaticMatrix<T,M,N,SO1>, DiagonalMatrix<MT,SO2,DF> >
1824 {
1826 };
1827 
1828 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1829 struct SchurTrait< DiagonalMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
1830 {
1832 };
1833 
1834 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1835 struct SchurTrait< HybridMatrix<T,M,N,SO1>, DiagonalMatrix<MT,SO2,DF> >
1836 {
1838 };
1839 
1840 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1841 struct SchurTrait< DiagonalMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
1842 {
1844 };
1845 
1846 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1847 struct SchurTrait< DynamicMatrix<T,SO1>, DiagonalMatrix<MT,SO2,DF> >
1848 {
1850 };
1851 
1852 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
1853 struct SchurTrait< DiagonalMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
1854 {
1856 };
1857 
1858 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
1859 struct SchurTrait< CustomMatrix<T,AF,PF,SO1>, DiagonalMatrix<MT,SO2,DF> >
1860 {
1862 };
1863 
1864 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1865 struct SchurTrait< DiagonalMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
1866 {
1868 };
1869 
1870 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1871 struct SchurTrait< CompressedMatrix<T,SO1>, DiagonalMatrix<MT,SO2,DF> >
1872 {
1874 };
1875 
1876 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1877 struct SchurTrait< DiagonalMatrix<MT,SO1,DF>, IdentityMatrix<T,SO2> >
1878 {
1880 };
1881 
1882 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1883 struct SchurTrait< IdentityMatrix<T,SO1>, DiagonalMatrix<MT,SO2,DF> >
1884 {
1886 };
1887 
1888 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
1889 struct SchurTrait< DiagonalMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
1890 {
1891  using Type = DiagonalMatrix< SchurTrait_<MT1,MT2> >;
1892 };
1893 
1894 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
1895 struct SchurTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, DiagonalMatrix<MT2,SO2,DF2> >
1896 {
1897  using Type = DiagonalMatrix< SchurTrait_<MT1,MT2> >;
1898 };
1899 
1900 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1901 struct SchurTrait< DiagonalMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1902 {
1903  using Type = DiagonalMatrix< SchurTrait_<MT1,MT2> >;
1904 };
1905 
1906 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1907 struct SchurTrait< HermitianMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
1908 {
1909  using Type = DiagonalMatrix< SchurTrait_<MT1,MT2> >;
1910 };
1911 
1912 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1913 struct SchurTrait< DiagonalMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
1914 {
1915  using Type = DiagonalMatrix< SchurTrait_<MT1,MT2> >;
1916 };
1917 
1918 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1919 struct SchurTrait< LowerMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
1920 {
1921  using Type = DiagonalMatrix< SchurTrait_<MT1,MT2> >;
1922 };
1923 
1924 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1925 struct SchurTrait< DiagonalMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
1926 {
1927  using Type = DiagonalMatrix< SchurTrait_<MT1,MT2> >;
1928 };
1929 
1930 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1931 struct SchurTrait< UniLowerMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
1932 {
1933  using Type = DiagonalMatrix< SchurTrait_<MT1,MT2> >;
1934 };
1935 
1936 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1937 struct SchurTrait< DiagonalMatrix<MT1,SO1,DF1>, StrictlyLowerMatrix<MT2,SO2,DF2> >
1938 {
1939  using Type = DiagonalMatrix< SchurTrait_<MT1,MT2> >;
1940 };
1941 
1942 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1943 struct SchurTrait< StrictlyLowerMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
1944 {
1945  using Type = DiagonalMatrix< SchurTrait_<MT1,MT2> >;
1946 };
1947 
1948 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1949 struct SchurTrait< DiagonalMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1950 {
1951  using Type = DiagonalMatrix< SchurTrait_<MT1,MT2> >;
1952 };
1953 
1954 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1955 struct SchurTrait< UpperMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
1956 {
1957  using Type = DiagonalMatrix< SchurTrait_<MT1,MT2> >;
1958 };
1959 
1960 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1961 struct SchurTrait< DiagonalMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
1962 {
1963  using Type = DiagonalMatrix< SchurTrait_<MT1,MT2> >;
1964 };
1965 
1966 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1967 struct SchurTrait< UniUpperMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
1968 {
1969  using Type = DiagonalMatrix< SchurTrait_<MT1,MT2> >;
1970 };
1971 
1972 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1973 struct SchurTrait< DiagonalMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1974 {
1975  using Type = DiagonalMatrix< SchurTrait_<MT1,MT2> >;
1976 };
1977 
1978 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1979 struct SchurTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
1980 {
1981  using Type = DiagonalMatrix< SchurTrait_<MT1,MT2> >;
1982 };
1983 
1984 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1985 struct SchurTrait< DiagonalMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
1986 {
1987  using Type = DiagonalMatrix< SchurTrait_<MT1,MT2> >;
1988 };
1990 //*************************************************************************************************
1991 
1992 
1993 
1994 
1995 //=================================================================================================
1996 //
1997 // MULTTRAIT SPECIALIZATIONS
1998 //
1999 //=================================================================================================
2000 
2001 //*************************************************************************************************
2003 template< typename MT, bool SO, bool DF, typename T >
2004 struct MultTrait< DiagonalMatrix<MT,SO,DF>, T, EnableIf_< IsNumeric<T> > >
2005 {
2006  using Type = DiagonalMatrix< MultTrait_<MT,T> >;
2007 };
2008 
2009 template< typename T, typename MT, bool SO, bool DF >
2010 struct MultTrait< T, DiagonalMatrix<MT,SO,DF>, EnableIf_< IsNumeric<T> > >
2011 {
2012  using Type = DiagonalMatrix< MultTrait_<T,MT> >;
2013 };
2014 
2015 template< typename MT, bool SO, bool DF, typename T, size_t N >
2016 struct MultTrait< DiagonalMatrix<MT,SO,DF>, StaticVector<T,N,false> >
2017 {
2019 };
2020 
2021 template< typename T, size_t N, typename MT, bool SO, bool DF >
2022 struct MultTrait< StaticVector<T,N,true>, DiagonalMatrix<MT,SO,DF> >
2023 {
2024  using Type = MultTrait_< StaticVector<T,N,true>, MT >;
2025 };
2026 
2027 template< typename MT, bool SO, bool DF, typename T, size_t N >
2028 struct MultTrait< DiagonalMatrix<MT,SO,DF>, HybridVector<T,N,false> >
2029 {
2031 };
2032 
2033 template< typename T, size_t N, typename MT, bool SO, bool DF >
2034 struct MultTrait< HybridVector<T,N,true>, DiagonalMatrix<MT,SO,DF> >
2035 {
2036  using Type = MultTrait_< HybridVector<T,N,true>, MT >;
2037 };
2038 
2039 template< typename MT, bool SO, bool DF, typename T >
2040 struct MultTrait< DiagonalMatrix<MT,SO,DF>, DynamicVector<T,false> >
2041 {
2043 };
2044 
2045 template< typename T, typename MT, bool SO, bool DF >
2046 struct MultTrait< DynamicVector<T,true>, DiagonalMatrix<MT,SO,DF> >
2047 {
2048  using Type = MultTrait_< DynamicVector<T,true>, MT >;
2049 };
2050 
2051 template< typename MT, bool SO, bool DF, typename T, bool AF, bool PF >
2052 struct MultTrait< DiagonalMatrix<MT,SO,DF>, CustomVector<T,AF,PF,false> >
2053 {
2055 };
2056 
2057 template< typename T, bool AF, bool PF, typename MT, bool SO, bool DF >
2058 struct MultTrait< CustomVector<T,AF,PF,true>, DiagonalMatrix<MT,SO,DF> >
2059 {
2060  using Type = MultTrait_< CustomVector<T,AF,PF,true>, MT >;
2061 };
2062 
2063 template< typename MT, bool SO, bool DF, typename T >
2064 struct MultTrait< DiagonalMatrix<MT,SO,DF>, CompressedVector<T,false> >
2065 {
2067 };
2068 
2069 template< typename T, typename MT, bool SO, bool DF >
2070 struct MultTrait< CompressedVector<T,true>, DiagonalMatrix<MT,SO,DF> >
2071 {
2072  using Type = MultTrait_< CompressedVector<T,true>, MT >;
2073 };
2074 
2075 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
2076 struct MultTrait< DiagonalMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
2077 {
2079 };
2080 
2081 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
2082 struct MultTrait< StaticMatrix<T,M,N,SO1>, DiagonalMatrix<MT,SO2,DF> >
2083 {
2084  using Type = MultTrait_< StaticMatrix<T,M,N,SO1>, MT >;
2085 };
2086 
2087 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
2088 struct MultTrait< DiagonalMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
2089 {
2091 };
2092 
2093 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
2094 struct MultTrait< HybridMatrix<T,M,N,SO1>, DiagonalMatrix<MT,SO2,DF> >
2095 {
2096  using Type = MultTrait_< HybridMatrix<T,M,N,SO1>, MT >;
2097 };
2098 
2099 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
2100 struct MultTrait< DiagonalMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
2101 {
2102  using Type = MultTrait_< MT, DynamicMatrix<T,SO2> >;
2103 };
2104 
2105 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
2106 struct MultTrait< DynamicMatrix<T,SO1>, DiagonalMatrix<MT,SO2,DF> >
2107 {
2108  using Type = MultTrait_< DynamicMatrix<T,SO1>, MT >;
2109 };
2110 
2111 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
2112 struct MultTrait< DiagonalMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
2113 {
2115 };
2116 
2117 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
2118 struct MultTrait< CustomMatrix<T,AF,PF,SO1>, DiagonalMatrix<MT,SO2,DF> >
2119 {
2120  using Type = MultTrait_< CustomMatrix<T,AF,PF,SO1>, MT >;
2121 };
2122 
2123 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
2124 struct MultTrait< DiagonalMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
2125 {
2127 };
2128 
2129 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
2130 struct MultTrait< CompressedMatrix<T,SO1>, DiagonalMatrix<MT,SO2,DF> >
2131 {
2132  using Type = MultTrait_< CompressedMatrix<T,SO1>, MT >;
2133 };
2134 
2135 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
2136 struct MultTrait< DiagonalMatrix<MT,SO1,DF>, IdentityMatrix<T,SO2> >
2137 {
2139 };
2140 
2141 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
2142 struct MultTrait< IdentityMatrix<T,SO1>, DiagonalMatrix<MT,SO2,DF> >
2143 {
2145 };
2146 
2147 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
2148 struct MultTrait< DiagonalMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
2149 {
2150  using Type = MultTrait_<MT1,MT2>;
2151 };
2152 
2153 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
2154 struct MultTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, DiagonalMatrix<MT2,SO2,DF2> >
2155 {
2156  using Type = MultTrait_<MT1,MT2>;
2157 };
2158 
2159 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2160 struct MultTrait< DiagonalMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
2161 {
2162  using Type = MultTrait_<MT1,MT2>;
2163 };
2164 
2165 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2166 struct MultTrait< HermitianMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
2167 {
2168  using Type = MultTrait_<MT1,MT2>;
2169 };
2170 
2171 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2172 struct MultTrait< DiagonalMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
2173 {
2174  using Type = LowerMatrix< MultTrait_<MT1,MT2> >;
2175 };
2176 
2177 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2178 struct MultTrait< LowerMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
2179 {
2180  using Type = LowerMatrix< MultTrait_<MT1,MT2> >;
2181 };
2182 
2183 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2184 struct MultTrait< DiagonalMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
2185 {
2186  using Type = LowerMatrix< MultTrait_<MT1,MT2> >;
2187 };
2188 
2189 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2190 struct MultTrait< UniLowerMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
2191 {
2192  using Type = LowerMatrix< MultTrait_<MT1,MT2> >;
2193 };
2194 
2195 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2196 struct MultTrait< DiagonalMatrix<MT1,SO1,DF1>, StrictlyLowerMatrix<MT2,SO2,DF2> >
2197 {
2199 };
2200 
2201 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2202 struct MultTrait< StrictlyLowerMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
2203 {
2205 };
2206 
2207 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2208 struct MultTrait< DiagonalMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
2209 {
2210  using Type = UpperMatrix< MultTrait_<MT1,MT2> >;
2211 };
2212 
2213 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2214 struct MultTrait< UpperMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
2215 {
2216  using Type = UpperMatrix< MultTrait_<MT1,MT2> >;
2217 };
2218 
2219 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2220 struct MultTrait< DiagonalMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
2221 {
2222  using Type = UpperMatrix< MultTrait_<MT1,MT2> >;
2223 };
2224 
2225 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2226 struct MultTrait< UniUpperMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
2227 {
2228  using Type = UpperMatrix< MultTrait_<MT1,MT2> >;
2229 };
2230 
2231 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2232 struct MultTrait< DiagonalMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
2233 {
2235 };
2236 
2237 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2238 struct MultTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
2239 {
2241 };
2242 
2243 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2244 struct MultTrait< DiagonalMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
2245 {
2246  using Type = DiagonalMatrix< MultTrait_<MT1,MT2> >;
2247 };
2249 //*************************************************************************************************
2250 
2251 
2252 
2253 
2254 //=================================================================================================
2255 //
2256 // DIVTRAIT SPECIALIZATIONS
2257 //
2258 //=================================================================================================
2259 
2260 //*************************************************************************************************
2262 template< typename MT, bool SO, bool DF, typename T >
2263 struct DivTrait< DiagonalMatrix<MT,SO,DF>, T, EnableIf_< IsNumeric<T> > >
2264 {
2265  using Type = DiagonalMatrix< DivTrait_<MT,T> >;
2266 };
2268 //*************************************************************************************************
2269 
2270 
2271 
2272 
2273 //=================================================================================================
2274 //
2275 // UNARYMAPTRAIT SPECIALIZATIONS
2276 //
2277 //=================================================================================================
2278 
2279 //*************************************************************************************************
2281 template< typename MT, bool SO, bool DF >
2282 struct UnaryMapTrait< DiagonalMatrix<MT,SO,DF>, Abs >
2283 {
2285 };
2286 
2287 template< typename MT, bool SO, bool DF >
2288 struct UnaryMapTrait< DiagonalMatrix<MT,SO,DF>, Floor >
2289 {
2291 };
2292 
2293 template< typename MT, bool SO, bool DF >
2294 struct UnaryMapTrait< DiagonalMatrix<MT,SO,DF>, Ceil >
2295 {
2297 };
2298 
2299 template< typename MT, bool SO, bool DF >
2300 struct UnaryMapTrait< DiagonalMatrix<MT,SO,DF>, Trunc >
2301 {
2303 };
2304 
2305 template< typename MT, bool SO, bool DF >
2306 struct UnaryMapTrait< DiagonalMatrix<MT,SO,DF>, Round >
2307 {
2309 };
2310 
2311 template< typename MT, bool SO, bool DF >
2312 struct UnaryMapTrait< DiagonalMatrix<MT,SO,DF>, Conj >
2313 {
2315 };
2316 
2317 template< typename MT, bool SO, bool DF >
2318 struct UnaryMapTrait< DiagonalMatrix<MT,SO,DF>, Real >
2319 {
2321 };
2322 
2323 template< typename MT, bool SO, bool DF >
2324 struct UnaryMapTrait< DiagonalMatrix<MT,SO,DF>, Imag >
2325 {
2327 };
2328 
2329 template< typename MT, bool SO, bool DF >
2330 struct UnaryMapTrait< DiagonalMatrix<MT,SO,DF>, Sqrt >
2331 {
2333 };
2334 
2335 template< typename MT, bool SO, bool DF >
2336 struct UnaryMapTrait< DiagonalMatrix<MT,SO,DF>, Cbrt >
2337 {
2339 };
2340 
2341 template< typename MT, bool SO, bool DF >
2342 struct UnaryMapTrait< DiagonalMatrix<MT,SO,DF>, Sin >
2343 {
2345 };
2346 
2347 template< typename MT, bool SO, bool DF >
2348 struct UnaryMapTrait< DiagonalMatrix<MT,SO,DF>, Asin >
2349 {
2351 };
2352 
2353 template< typename MT, bool SO, bool DF >
2354 struct UnaryMapTrait< DiagonalMatrix<MT,SO,DF>, Sinh >
2355 {
2357 };
2358 
2359 template< typename MT, bool SO, bool DF >
2360 struct UnaryMapTrait< DiagonalMatrix<MT,SO,DF>, Asinh >
2361 {
2363 };
2364 
2365 template< typename MT, bool SO, bool DF >
2366 struct UnaryMapTrait< DiagonalMatrix<MT,SO,DF>, Tan >
2367 {
2369 };
2370 
2371 template< typename MT, bool SO, bool DF >
2372 struct UnaryMapTrait< DiagonalMatrix<MT,SO,DF>, Atan >
2373 {
2375 };
2376 
2377 template< typename MT, bool SO, bool DF >
2378 struct UnaryMapTrait< DiagonalMatrix<MT,SO,DF>, Tanh >
2379 {
2381 };
2382 
2383 template< typename MT, bool SO, bool DF >
2384 struct UnaryMapTrait< DiagonalMatrix<MT,SO,DF>, Atanh >
2385 {
2387 };
2388 
2389 template< typename MT, bool SO, bool DF >
2390 struct UnaryMapTrait< DiagonalMatrix<MT,SO,DF>, Erf >
2391 {
2393 };
2395 //*************************************************************************************************
2396 
2397 
2398 
2399 
2400 //=================================================================================================
2401 //
2402 // BINARYMAPTRAIT SPECIALIZATIONS
2403 //
2404 //=================================================================================================
2405 
2406 //*************************************************************************************************
2408 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
2409 struct BinaryMapTrait< DiagonalMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF>, Min >
2410 {
2412 };
2413 
2414 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
2415 struct BinaryMapTrait< DiagonalMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF>, Max >
2416 {
2418 };
2419 
2420 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
2421 struct BinaryMapTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, DiagonalMatrix<MT2,SO2,DF2>, Min >
2422 {
2424 };
2425 
2426 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
2427 struct BinaryMapTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, DiagonalMatrix<MT2,SO2,DF2>, Max >
2428 {
2430 };
2431 
2432 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2433 struct BinaryMapTrait< DiagonalMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2>, Min >
2434 {
2436 };
2437 
2438 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2439 struct BinaryMapTrait< DiagonalMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2>, Max >
2440 {
2442 };
2443 
2444 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2445 struct BinaryMapTrait< HermitianMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2>, Min >
2446 {
2448 };
2449 
2450 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2451 struct BinaryMapTrait< HermitianMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2>, Max >
2452 {
2454 };
2455 
2456 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2457 struct BinaryMapTrait< DiagonalMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2>, Min >
2458 {
2460 };
2461 
2462 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2463 struct BinaryMapTrait< DiagonalMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2>, Max >
2464 {
2466 };
2467 
2468 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2469 struct BinaryMapTrait< LowerMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2>, Min >
2470 {
2472 };
2473 
2474 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2475 struct BinaryMapTrait< LowerMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2>, Max >
2476 {
2478 };
2479 
2480 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2481 struct BinaryMapTrait< DiagonalMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2>, Min >
2482 {
2484 };
2485 
2486 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2487 struct BinaryMapTrait< DiagonalMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2>, Max >
2488 {
2490 };
2491 
2492 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2493 struct BinaryMapTrait< UniLowerMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2>, Min >
2494 {
2496 };
2497 
2498 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2499 struct BinaryMapTrait< UniLowerMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2>, Max >
2500 {
2502 };
2503 
2504 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2505 struct BinaryMapTrait< DiagonalMatrix<MT1,SO1,DF1>, StrictlyLowerMatrix<MT2,SO2,DF2>, Min >
2506 {
2508 };
2509 
2510 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2511 struct BinaryMapTrait< DiagonalMatrix<MT1,SO1,DF1>, StrictlyLowerMatrix<MT2,SO2,DF2>, Max >
2512 {
2514 };
2515 
2516 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2517 struct BinaryMapTrait< StrictlyLowerMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2>, Min >
2518 {
2520 };
2521 
2522 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2523 struct BinaryMapTrait< StrictlyLowerMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2>, Max >
2524 {
2526 };
2527 
2528 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2529 struct BinaryMapTrait< DiagonalMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2>, Min >
2530 {
2532 };
2533 
2534 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2535 struct BinaryMapTrait< DiagonalMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2>, Max >
2536 {
2538 };
2539 
2540 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2541 struct BinaryMapTrait< UpperMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2>, Min >
2542 {
2544 };
2545 
2546 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2547 struct BinaryMapTrait< UpperMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2>, Max >
2548 {
2550 };
2551 
2552 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2553 struct BinaryMapTrait< DiagonalMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2>, Min >
2554 {
2556 };
2557 
2558 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2559 struct BinaryMapTrait< DiagonalMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2>, Max >
2560 {
2562 };
2563 
2564 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2565 struct BinaryMapTrait< UniUpperMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2>, Min >
2566 {
2568 };
2569 
2570 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2571 struct BinaryMapTrait< UniUpperMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2>, Max >
2572 {
2574 };
2575 
2576 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2577 struct BinaryMapTrait< DiagonalMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2>, Min >
2578 {
2580 };
2581 
2582 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2583 struct BinaryMapTrait< DiagonalMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2>, Max >
2584 {
2586 };
2587 
2588 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2589 struct BinaryMapTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2>, Min >
2590 {
2592 };
2593 
2594 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2595 struct BinaryMapTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2>, Max >
2596 {
2598 };
2599 
2600 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2601 struct BinaryMapTrait< DiagonalMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2>, Min >
2602 {
2604 };
2605 
2606 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2607 struct BinaryMapTrait< DiagonalMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2>, Max >
2608 {
2610 };
2612 //*************************************************************************************************
2613 
2614 
2615 
2616 
2617 //=================================================================================================
2618 //
2619 // DECLSYMTRAIT SPECIALIZATIONS
2620 //
2621 //=================================================================================================
2622 
2623 //*************************************************************************************************
2625 template< typename MT, bool SO, bool DF >
2626 struct DeclSymTrait< DiagonalMatrix<MT,SO,DF> >
2627 {
2628  using Type = DiagonalMatrix<MT,SO,DF>;
2629 };
2631 //*************************************************************************************************
2632 
2633 
2634 
2635 
2636 //=================================================================================================
2637 //
2638 // DECLHERMTRAIT SPECIALIZATIONS
2639 //
2640 //=================================================================================================
2641 
2642 //*************************************************************************************************
2644 template< typename MT, bool SO, bool DF >
2645 struct DeclHermTrait< DiagonalMatrix<MT,SO,DF> >
2646 {
2647  using Type = HermitianMatrix<MT,SO,DF>;
2648 };
2650 //*************************************************************************************************
2651 
2652 
2653 
2654 
2655 //=================================================================================================
2656 //
2657 // DECLLOWTRAIT SPECIALIZATIONS
2658 //
2659 //=================================================================================================
2660 
2661 //*************************************************************************************************
2663 template< typename MT, bool SO, bool DF >
2664 struct DeclLowTrait< DiagonalMatrix<MT,SO,DF> >
2665 {
2666  using Type = DiagonalMatrix<MT,SO,DF>;
2667 };
2669 //*************************************************************************************************
2670 
2671 
2672 
2673 
2674 //=================================================================================================
2675 //
2676 // DECLUPPTRAIT SPECIALIZATIONS
2677 //
2678 //=================================================================================================
2679 
2680 //*************************************************************************************************
2682 template< typename MT, bool SO, bool DF >
2683 struct DeclUppTrait< DiagonalMatrix<MT,SO,DF> >
2684 {
2685  using Type = DiagonalMatrix<MT,SO,DF>;
2686 };
2688 //*************************************************************************************************
2689 
2690 
2691 
2692 
2693 //=================================================================================================
2694 //
2695 // DECLDIAGTRAIT SPECIALIZATIONS
2696 //
2697 //=================================================================================================
2698 
2699 //*************************************************************************************************
2701 template< typename MT, bool SO, bool DF >
2702 struct DeclDiagTrait< DiagonalMatrix<MT,SO,DF> >
2703 {
2704  using Type = DiagonalMatrix<MT,SO,DF>;
2705 };
2707 //*************************************************************************************************
2708 
2709 
2710 
2711 
2712 //=================================================================================================
2713 //
2714 // HIGHTYPE SPECIALIZATIONS
2715 //
2716 //=================================================================================================
2717 
2718 //*************************************************************************************************
2720 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2721 struct HighType< DiagonalMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
2722 {
2724 };
2726 //*************************************************************************************************
2727 
2728 
2729 
2730 
2731 //=================================================================================================
2732 //
2733 // LOWTYPE SPECIALIZATIONS
2734 //
2735 //=================================================================================================
2736 
2737 //*************************************************************************************************
2739 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2740 struct LowType< DiagonalMatrix<MT1,SO1,DF1>, DiagonalMatrix<MT2,SO2,DF2> >
2741 {
2743 };
2745 //*************************************************************************************************
2746 
2747 
2748 
2749 
2750 //=================================================================================================
2751 //
2752 // SUBMATRIXTRAIT SPECIALIZATIONS
2753 //
2754 //=================================================================================================
2755 
2756 //*************************************************************************************************
2758 template< typename MT, bool SO, bool DF, size_t... CSAs >
2759 struct SubmatrixTrait< DiagonalMatrix<MT,SO,DF>, CSAs... >
2760 {
2761  using Type = SubmatrixTrait_<MT,CSAs...>;
2762 };
2764 //*************************************************************************************************
2765 
2766 
2767 
2768 
2769 //=================================================================================================
2770 //
2771 // ROWTRAIT SPECIALIZATIONS
2772 //
2773 //=================================================================================================
2774 
2775 //*************************************************************************************************
2777 template< typename MT, bool SO, bool DF, size_t... CRAs >
2778 struct RowTrait< DiagonalMatrix<MT,SO,DF>, CRAs... >
2779 {
2780  using Type = RowTrait_<MT,CRAs...>;
2781 };
2783 //*************************************************************************************************
2784 
2785 
2786 
2787 
2788 //=================================================================================================
2789 //
2790 // ROWSTRAIT SPECIALIZATIONS
2791 //
2792 //=================================================================================================
2793 
2794 //*************************************************************************************************
2796 template< typename MT, bool SO, bool DF, size_t... CRAs >
2797 struct RowsTrait< DiagonalMatrix<MT,SO,DF>, CRAs... >
2798 {
2799  using Type = RowsTrait_<MT,CRAs...>;
2800 };
2802 //*************************************************************************************************
2803 
2804 
2805 
2806 
2807 //=================================================================================================
2808 //
2809 // COLUMNTRAIT SPECIALIZATIONS
2810 //
2811 //=================================================================================================
2812 
2813 //*************************************************************************************************
2815 template< typename MT, bool SO, bool DF, size_t... CCAs >
2816 struct ColumnTrait< DiagonalMatrix<MT,SO,DF>, CCAs... >
2817 {
2818  using Type = ColumnTrait_<MT,CCAs...>;
2819 };
2821 //*************************************************************************************************
2822 
2823 
2824 
2825 
2826 //=================================================================================================
2827 //
2828 // COLUMNSTRAIT SPECIALIZATIONS
2829 //
2830 //=================================================================================================
2831 
2832 //*************************************************************************************************
2834 template< typename MT, bool SO, bool DF, size_t... CCAs >
2835 struct ColumnsTrait< DiagonalMatrix<MT,SO,DF>, CCAs... >
2836 {
2837  using Type = ColumnsTrait_<MT,CCAs...>;
2838 };
2840 //*************************************************************************************************
2841 
2842 
2843 
2844 
2845 //=================================================================================================
2846 //
2847 // BANDTRAIT SPECIALIZATIONS
2848 //
2849 //=================================================================================================
2850 
2851 //*************************************************************************************************
2853 template< typename MT, bool SO, bool DF, ptrdiff_t... CBAs >
2854 struct BandTrait< DiagonalMatrix<MT,SO,DF>, CBAs... >
2855 {
2856  using Type = BandTrait_<MT,CBAs...>;
2857 };
2859 //*************************************************************************************************
2860 
2861 } // namespace blaze
2862 
2863 #endif
Pointer difference type of the Blaze library.
Header file for auxiliary alias declarations.
decltype(auto) column(Matrix< MT, SO > &matrix, RCAs... args)
Creating a view on a specific column of the given matrix.
Definition: Column.h:131
Header file for the decldiag trait.
Header file for the Schur product trait.
Compile time check for low-level access to constant data.This type trait tests whether the given data...
Definition: HasConstDataAccess.h:75
Header file for the UNUSED_PARAMETER function template.
Header file for the subtraction trait.
Header file for the row trait.
Header file for the declherm trait.
Base template for the SubmatrixTrait class.
Definition: SubmatrixTrait.h:109
Flag for the inversion of a upper unitriangular matrix.
Definition: InversionFlag.h:114
Base template for the ColumnTrait class.
Definition: ColumnTrait.h:108
Flag for the inversion of a lower unitriangular matrix.
Definition: InversionFlag.h:112
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector) noexcept
Returns the current size/dimension of the vector.
Definition: Vector.h:265
Base template for the DeclUppTrait class.
Definition: DeclUppTrait.h:113
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:71
Matrix adapter for lower triangular matrices.
Definition: BaseTemplate.h:553
Header file for the dense matrix inversion flags.
Base template for the SchurTrait class.
Definition: SchurTrait.h:112
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:364
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:588
Compile time check for lower triangular matrices.This type trait tests whether or not the given templ...
Definition: IsLower.h:87
#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:81
Matrix adapter for symmetric matrices.
Definition: BaseTemplate.h:608
typename MultTrait< T1, T2 >::Type MultTrait_
Auxiliary alias declaration for the MultTrait class template.The MultTrait_ alias declaration provide...
Definition: MultTrait.h:291
Compile time check for upper triangular matrices.This type trait tests whether or not the given templ...
Definition: IsUpper.h:87
typename SubmatrixTrait< MT, CSAs... >::Type SubmatrixTrait_
Auxiliary alias declaration for the SubmatrixTrait type trait.The SubmatrixTrait_ alias declaration p...
Definition: SubmatrixTrait.h:145
Constraint on the data type.
typename RowTrait< MT, CRAs... >::Type RowTrait_
Auxiliary alias declaration for the RowTrait type trait.The RowTrait_ alias declaration provides a co...
Definition: RowTrait.h:145
Base template for the RowsTrait class.
Definition: RowsTrait.h:109
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:80
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:129
Header file for the band trait.
bool isIdentity(const DenseMatrix< MT, SO > &dm)
Checks if the give dense matrix is an identity matrix.
Definition: DenseMatrix.h:1827
Constraint on the data type.
Compile time check for data types with restricted data access.This type trait tests whether the given...
Definition: IsRestricted.h:82
Header file for the IsSquare type trait.
Compile time check for the alignment of data types.This type trait tests whether the given data type ...
Definition: IsAligned.h:87
void invert(const HermitianProxy< MT > &proxy)
In-place inversion of the represented element.
Definition: HermitianProxy.h:772
Base template for the RowTrait class.
Definition: RowTrait.h:109
Compile time check for the memory layout of data types.This type trait tests whether the given data t...
Definition: IsContiguous.h:86
Constraint on the data type.
typename ColumnTrait< MT, CCAs... >::Type ColumnTrait_
Auxiliary alias declaration for the ColumnTrait type trait.The ColumnTrait_ alias declaration provide...
Definition: ColumnTrait.h:144
Header file for the LowType type trait.
Base template for the HighType type trait.
Definition: HighType.h:133
Header file for the multiplication trait.
Header file for the unary map trait.
Header file for the IsSymmetric type trait.
typename ColumnsTrait< MT, CCAs... >::Type ColumnsTrait_
Auxiliary alias declaration for the ColumnsTrait type trait.The ColumnsTrait_ alias declaration provi...
Definition: ColumnsTrait.h:145
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Matrix adapter for strictly upper triangular matrices.
Definition: BaseTemplate.h:558
Header file for the IsShrinkable type trait.
Header file for all forward declarations of the math module.
Compile time check for data types with padding.This type trait tests whether the given data type empl...
Definition: IsPadded.h:76
Header file for the decllow trait.
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:221
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3085
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:76
DiagonalMatrix specialization for dense matrices.
Header file for the IsLower type trait.
Compile time check for square matrices.This type trait tests whether or not the given template parame...
Definition: IsSquare.h:88
Header file for the IsAligned type trait.
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:506
Base template for the DeclSymTrait class.
Definition: DeclSymTrait.h:113
Compile time check for symmetric matrices.This type trait tests whether or not the given template par...
Definition: IsSymmetric.h:85
Header file for the exception macros of the math module.
#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:81
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:714
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:430
Header file for the RemoveAdaptor type trait.
Constraint on the data type.
Matrix adapter for upper triangular matrices.
Definition: BaseTemplate.h:553
Compile time check for adaptors.This type trait tests whether the given template parameter is an adap...
Definition: IsAdaptor.h:88
typename BandTrait< MT, CBAs... >::Type BandTrait_
Auxiliary alias declaration for the BandTrait type trait.The BandTrait_ alias declaration provides a ...
Definition: BandTrait.h:145
Header file for the EnableIf class template.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:608
Header file for the IsPadded type trait.
Header file for the IsAdaptor type trait.
decltype(auto) band(Matrix< MT, SO > &matrix, RBAs... args)
Creating a view on a specific band of the given matrix.
Definition: Band.h:134
typename RowsTrait< MT, CRAs... >::Type RowsTrait_
Auxiliary alias declaration for the RowsTrait type trait.The RowsTrait_ alias declaration provides a ...
Definition: RowsTrait.h:145
Compile time check for shrinkable data types.This type trait tests whether the given data type is a s...
Definition: IsShrinkable.h:75
Constraint on the data type.
Header file for the IsNumeric type trait.
Base template for the LowType type trait.
Definition: LowType.h:133
Header file for the HasConstDataAccess type trait.
Compile time check for resizable data types.This type trait tests whether the given data type is a re...
Definition: IsResizable.h:75
Header file for the declupp trait.
#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:79
Header file for the binary map trait.
Header file for run time assertion macros.
Base template for the AddTrait class.
Definition: AddTrait.h:119
Base template for the DeclHermTrait class.
Definition: DeclHermTrait.h:113
Base template for the MultTrait class.
Definition: MultTrait.h:119
Header file for the addition trait.
Header file for the division trait.
Header file for the submatrix trait.
Constraint on the data type.
Header file for the IsContiguous type trait.
Header file for the columns trait.
typename If< T1, T2, T3 >::Type If_
Auxiliary alias declaration for the If class template.The If_ alias declaration provides a convenient...
Definition: If.h:154
decltype(auto) row(Matrix< MT, SO > &, RRAs...)
Creating a view on a specific row of the given matrix.
Definition: Row.h:131
#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:81
Header file for the declsym trait.
Matrix adapter for strictly lower triangular matrices.
Definition: BaseTemplate.h:558
Matrix adapter for Hermitian matrices.
Definition: BaseTemplate.h:611
Header file for the column trait.
Header file for the isDefault shim.
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b) noexcept
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:272
Compile time check for Hermitian matrices.This type trait tests whether or not the given template par...
Definition: IsHermitian.h:85
Compile time check for built-in data types.This type trait tests whether or not the given template pa...
Definition: IsBuiltin.h:75
Base class for matrices.The Matrix class is a base class for all dense and sparse matrix classes with...
Definition: Forward.h:101
#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:61
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:81
Base template for the DivTrait class.
Definition: DivTrait.h:120
Header file for the rows trait.
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:490
Header file for the implementation of the base template of the DiagonalMatrix.
Base template for the DeclLowTrait class.
Definition: DeclLowTrait.h:113
Removal of top level adaptor types.In case the given type is an adaptor type (SymmetricMatrix, LowerMatrix, UpperMatrix, ...), the RemoveAdaptor type trait removes the adaptor and extracts the contained general matrix type. Else the given type is returned as is. Note that cv-qualifiers are preserved.
Definition: RemoveAdaptor.h:76
Base template for the ColumnsTrait class.
Definition: ColumnsTrait.h:109
Base class for N-dimensional vectors.The Vector class is a base class for all arbitrarily sized (N-di...
Definition: Forward.h:177
Header file for the IsBuiltin type trait.
typename SubTrait< T1, T2 >::Type SubTrait_
Auxiliary alias declaration for the SubTrait class template.The SubTrait_ alias declaration provides ...
Definition: SubTrait.h:291
Compile time evaluation of the size of vectors and matrices.The Size type trait evaluates the size of...
Definition: Size.h:80
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:130
Header file for the isDivisor shim.
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:254
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:628
#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:79
Base template for the SubTrait class.
Definition: SubTrait.h:119
Matrix adapter for diagonal matrices.
Definition: BaseTemplate.h:560
Header file for the IsUpper type trait.
void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
Header file for the IsHermitian type trait.
Base template for the DeclDiagTrait class.
Definition: DeclDiagTrait.h:113
Base template for the BinaryMapTrait class.
Definition: BinaryMapTrait.h:97
Header file for the IsResizable type trait.
Header file for the IsRestricted type trait.
Base template for the UnaryMapTrait class.
Definition: UnaryMapTrait.h:95
Header file for the Size type trait.
typename AddTrait< T1, T2 >::Type AddTrait_
Auxiliary alias declaration for the AddTrait class template.The AddTrait_ alias declaration provides ...
Definition: AddTrait.h:291
InversionFlag
Inversion flag.The InversionFlag type enumeration represents the different types of matrix inversion ...
Definition: InversionFlag.h:101
#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
DiagonalMatrix specialization for sparse matrices.
Header file for the HighType type trait.
Header file for the TrueType type/value trait base class.
Base template for the BandTrait class.
Definition: BandTrait.h:109