LowerMatrix.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_ADAPTORS_LOWERMATRIX_H_
36 #define _BLAZE_MATH_ADAPTORS_LOWERMATRIX_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>
89 #include <blaze/util/Assert.h>
90 #include <blaze/util/EnableIf.h>
92 #include <blaze/util/TrueType.h>
94 #include <blaze/util/Unused.h>
95 
96 
97 namespace blaze {
98 
99 //=================================================================================================
100 //
101 // LOWERMATRIX OPERATORS
102 //
103 //=================================================================================================
104 
105 //*************************************************************************************************
108 template< typename MT, bool SO, bool DF >
109 inline void reset( LowerMatrix<MT,SO,DF>& m );
110 
111 template< typename MT, bool SO, bool DF >
112 inline void reset( LowerMatrix<MT,SO,DF>& m, size_t i );
113 
114 template< typename MT, bool SO, bool DF >
115 inline void clear( LowerMatrix<MT,SO,DF>& m );
116 
117 template< bool RF, typename MT, bool SO, bool DF >
118 inline bool isDefault( const LowerMatrix<MT,SO,DF>& m );
119 
120 template< typename MT, bool SO, bool DF >
121 inline bool isIntact( const LowerMatrix<MT,SO,DF>& m );
122 
123 template< typename MT, bool SO, bool DF >
124 inline void swap( LowerMatrix<MT,SO,DF>& a, LowerMatrix<MT,SO,DF>& b ) noexcept;
126 //*************************************************************************************************
127 
128 
129 //*************************************************************************************************
136 template< typename MT // Type of the adapted matrix
137  , bool SO // Storage order of the adapted matrix
138  , bool DF > // Density flag
139 inline void reset( LowerMatrix<MT,SO,DF>& m )
140 {
141  m.reset();
142 }
143 //*************************************************************************************************
144 
145 
146 //*************************************************************************************************
159 template< typename MT // Type of the adapted matrix
160  , bool SO // Storage order of the adapted matrix
161  , bool DF > // Density flag
162 inline void reset( LowerMatrix<MT,SO,DF>& m, size_t i )
163 {
164  m.reset( i );
165 }
166 //*************************************************************************************************
167 
168 
169 //*************************************************************************************************
176 template< typename MT // Type of the adapted matrix
177  , bool SO // Storage order of the adapted matrix
178  , bool DF > // Density flag
179 inline void clear( LowerMatrix<MT,SO,DF>& m )
180 {
181  m.clear();
182 }
183 //*************************************************************************************************
184 
185 
186 //*************************************************************************************************
214 template< bool RF // Relaxation flag
215  , typename MT // Type of the adapted matrix
216  , bool SO // Storage order of the adapted matrix
217  , bool DF > // Density flag
218 inline bool isDefault( const LowerMatrix<MT,SO,DF>& m )
219 {
220  return isDefault<RF>( m.matrix_ );
221 }
222 //*************************************************************************************************
223 
224 
225 //*************************************************************************************************
246 template< typename MT // Type of the adapted matrix
247  , bool SO // Storage order of the adapted matrix
248  , bool DF > // Density flag
249 inline bool isIntact( const LowerMatrix<MT,SO,DF>& m )
250 {
251  return m.isIntact();
252 }
253 //*************************************************************************************************
254 
255 
256 //*************************************************************************************************
264 template< typename MT // Type of the adapted matrix
265  , bool SO // Storage order of the adapted matrix
266  , bool DF > // Density flag
267 inline void swap( LowerMatrix<MT,SO,DF>& a, LowerMatrix<MT,SO,DF>& b ) noexcept
268 {
269  a.swap( b );
270 }
271 //*************************************************************************************************
272 
273 
274 //*************************************************************************************************
297 template< InversionFlag IF // Inversion algorithm
298  , typename MT // Type of the dense matrix
299  , bool SO > // Storage order of the dense matrix
300 inline void invert( LowerMatrix<MT,SO,true>& m )
301 {
303 
304  if( IF == asUniUpper ) {
305  BLAZE_INTERNAL_ASSERT( isIdentity( m ), "Violation of preconditions detected" );
306  return;
307  }
308 
309  constexpr InversionFlag flag( ( IF == byLU || IF == asGeneral || IF == asLower )
310  ? ( asLower )
311  : ( ( IF == asUniLower )
312  ?( asUniLower )
313  :( asDiagonal ) ) );
314 
315  invert<flag>( derestrict( m ) );
316 
317  BLAZE_INTERNAL_ASSERT( isIntact( m ), "Broken invariant detected" );
318 }
320 //*************************************************************************************************
321 
322 
323 //*************************************************************************************************
342 template< typename MT1, bool SO1, typename MT2, typename MT3, typename MT4, bool SO2 >
343 inline void lu( const LowerMatrix<MT1,SO1,true>& A, DenseMatrix<MT2,SO1>& L,
345 {
347 
352 
357 
358  using ET3 = ElementType_<MT3>;
359  using ET4 = ElementType_<MT4>;
360 
361  const size_t n( (~A).rows() );
362 
363  decltype(auto) U2( derestrict( ~U ) );
364 
365  (~L) = A;
366 
367  resize( ~U, n, n );
368  reset( U2 );
369 
370  resize( ~P, n, n );
371  reset( ~P );
372 
373  for( size_t i=0UL; i<n; ++i ) {
374  U2(i,i) = ET3(1);
375  (~P)(i,i) = ET4(1);
376  }
377 }
379 //*************************************************************************************************
380 
381 
382 //*************************************************************************************************
398 template< typename MT // Type of the adapted matrix
399  , bool SO // Storage order of the adapted matrix
400  , bool DF // Density flag
401  , typename VT > // Type of the right-hand side dense vector
402 inline bool tryAssign( const LowerMatrix<MT,SO,DF>& lhs,
403  const DenseVector<VT,false>& rhs, size_t row, size_t column )
404 {
406 
407  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
408  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
409  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.rows() - row, "Invalid number of rows" );
410 
411  UNUSED_PARAMETER( lhs );
412 
413  if( column <= row )
414  return true;
415 
416  const size_t iend( min( column - row, (~rhs).size() ) );
417 
418  for( size_t i=0UL; i<iend; ++i ) {
419  if( !isDefault( (~rhs)[i] ) )
420  return false;
421  }
422 
423  return true;
424 }
426 //*************************************************************************************************
427 
428 
429 //*************************************************************************************************
445 template< typename MT // Type of the adapted matrix
446  , bool SO // Storage order of the adapted matrix
447  , bool DF // Density flag
448  , typename VT > // Type of the right-hand side dense vector
449 inline bool tryAssign( const LowerMatrix<MT,SO,DF>& lhs,
450  const DenseVector<VT,true>& rhs, size_t row, size_t column )
451 {
453 
454  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
455  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
456  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.columns() - column, "Invalid number of columns" );
457 
458  UNUSED_PARAMETER( lhs );
459 
460  const size_t ibegin( ( row < column )?( 0UL ):( row - column + 1UL ) );
461 
462  for( size_t i=ibegin; i<(~rhs).size(); ++i ) {
463  if( !isDefault( (~rhs)[i] ) )
464  return false;
465  }
466 
467  return true;
468 }
470 //*************************************************************************************************
471 
472 
473 //*************************************************************************************************
489 template< typename MT // Type of the adapted matrix
490  , bool SO // Storage order of the adapted matrix
491  , bool DF // Density flag
492  , typename VT > // Type of the right-hand side sparse vector
493 inline bool tryAssign( const LowerMatrix<MT,SO,DF>& lhs,
494  const SparseVector<VT,false>& rhs, size_t row, size_t column )
495 {
497 
498  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
499  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
500  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.rows() - row, "Invalid number of rows" );
501 
502  UNUSED_PARAMETER( lhs );
503 
504  using RhsIterator = typename VT::ConstIterator;
505 
506  if( column <= row )
507  return true;
508 
509  const RhsIterator last( (~rhs).lowerBound( column - row ) );
510 
511  for( RhsIterator element=(~rhs).begin(); element!=last; ++element ) {
512  if( !isDefault( element->value() ) )
513  return false;
514  }
515 
516  return true;
517 }
519 //*************************************************************************************************
520 
521 
522 //*************************************************************************************************
538 template< typename MT // Type of the adapted matrix
539  , bool SO // Storage order of the adapted matrix
540  , bool DF // Density flag
541  , typename VT > // Type of the right-hand side sparse vector
542 inline bool tryAssign( const LowerMatrix<MT,SO,DF>& lhs,
543  const SparseVector<VT,true>& rhs, size_t row, size_t column )
544 {
546 
547  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
548  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
549  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.columns() - column, "Invalid number of columns" );
550 
551  UNUSED_PARAMETER( lhs );
552 
553  using RhsIterator = typename VT::ConstIterator;
554 
555  const RhsIterator last( (~rhs).end() );
556  RhsIterator element( (~rhs).lowerBound( ( row < column )?( 0UL ):( row - column + 1UL ) ) );
557 
558  for( ; element!=last; ++element ) {
559  if( !isDefault( element->value() ) )
560  return false;
561  }
562 
563  return true;
564 }
566 //*************************************************************************************************
567 
568 
569 //*************************************************************************************************
585 template< typename MT1 // Type of the adapted matrix
586  , bool SO // Storage order of the adapted matrix
587  , bool DF // Density flag
588  , typename MT2 > // Type of the right-hand side dense matrix
589 inline bool tryAssign( const LowerMatrix<MT1,SO,DF>& lhs,
590  const DenseMatrix<MT2,false>& rhs, size_t row, size_t column )
591 {
593 
594  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
595  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
596  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
597  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
598 
599  UNUSED_PARAMETER( lhs );
600 
601  const size_t M( (~rhs).rows() );
602  const size_t N( (~rhs).columns() );
603 
604  if( row + 1UL >= column + N )
605  return true;
606 
607  const size_t iend( min( column + N - row - 1UL, M ) );
608 
609  for( size_t i=0UL; i<iend; ++i )
610  {
611  const bool containsDiagonal( row + i >= column );
612  const size_t jbegin( ( containsDiagonal )?( row + i - column + 1UL ):( 0UL ) );
613 
614  for( size_t j=jbegin; j<N; ++j ) {
615  if( !isDefault( (~rhs)(i,j) ) )
616  return false;
617  }
618  }
619 
620  return true;
621 }
623 //*************************************************************************************************
624 
625 
626 //*************************************************************************************************
642 template< typename MT1 // Type of the adapted matrix
643  , bool SO // Storage order of the adapted matrix
644  , bool DF // Density flag
645  , typename MT2 > // Type of the right-hand side dense matrix
646 inline bool tryAssign( const LowerMatrix<MT1,SO,DF>& lhs,
647  const DenseMatrix<MT2,true>& rhs, size_t row, size_t column )
648 {
650 
651  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
652  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
653  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
654  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
655 
656  UNUSED_PARAMETER( lhs );
657 
658  const size_t M( (~rhs).rows() );
659  const size_t N( (~rhs).columns() );
660 
661  if( row + 1UL >= column + N )
662  return true;
663 
664  const size_t jbegin( ( row < column )?( 0UL ):( row - column + 1UL ) );
665 
666  for( size_t j=jbegin; j<N; ++j )
667  {
668  const size_t iend( min( column + j - row, M ) );
669 
670  for( size_t i=0UL; i<iend; ++i ) {
671  if( !isDefault( (~rhs)(i,j) ) )
672  return false;
673  }
674  }
675 
676  return true;
677 }
679 //*************************************************************************************************
680 
681 
682 //*************************************************************************************************
698 template< typename MT1 // Type of the adapted matrix
699  , bool SO // Storage order of the adapted matrix
700  , bool DF // Density flag
701  , typename MT2 > // Type of the right-hand side sparse matrix
702 inline bool tryAssign( const LowerMatrix<MT1,SO,DF>& lhs,
703  const SparseMatrix<MT2,false>& rhs, size_t row, size_t column )
704 {
706 
707  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
708  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
709  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
710  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
711 
712  UNUSED_PARAMETER( lhs );
713 
714  using RhsIterator = typename MT2::ConstIterator;
715 
716  const size_t M( (~rhs).rows() );
717  const size_t N( (~rhs).columns() );
718 
719  if( row + 1UL >= column + N )
720  return true;
721 
722  const size_t iend( min( column + N - row - 1UL, M ) );
723 
724  for( size_t i=0UL; i<iend; ++i )
725  {
726  const bool containsDiagonal( row + i >= column );
727  const size_t index( ( containsDiagonal )?( row + i - column + 1UL ):( 0UL ) );
728 
729  const RhsIterator last( (~rhs).end(i) );
730  RhsIterator element( (~rhs).lowerBound( i, index ) );
731 
732  for( ; element!=last; ++element ) {
733  if( !isDefault( element->value() ) )
734  return false;
735  }
736  }
737 
738  return true;
739 }
741 //*************************************************************************************************
742 
743 
744 //*************************************************************************************************
760 template< typename MT1 // Type of the adapted matrix
761  , bool SO // Storage order of the adapted matrix
762  , bool DF // Density flag
763  , typename MT2 > // Type of the right-hand side sparse matrix
764 inline bool tryAssign( const LowerMatrix<MT1,SO,DF>& lhs,
765  const SparseMatrix<MT2,true>& rhs, size_t row, size_t column )
766 {
768 
769  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
770  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
771  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
772  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
773 
774  UNUSED_PARAMETER( lhs );
775 
776  using RhsIterator = typename MT2::ConstIterator;
777 
778  const size_t M( (~rhs).rows() );
779  const size_t N( (~rhs).columns() );
780 
781  if( row + 1UL >= column + N )
782  return true;
783 
784  const size_t jbegin( ( row < column )?( 0UL ):( row - column + 1UL ) );
785 
786  for( size_t j=jbegin; j<N; ++j )
787  {
788  const size_t index( column + j - row );
789  const RhsIterator last( (~rhs).lowerBound( min( index, M ), j ) );
790 
791  for( RhsIterator element=(~rhs).begin(j); element!=last; ++element ) {
792  if( !isDefault( element->value() ) )
793  return false;
794  }
795  }
796 
797  return true;
798 }
800 //*************************************************************************************************
801 
802 
803 //*************************************************************************************************
819 template< typename MT // Type of the adapted matrix
820  , bool SO // Storage order of the adapted matrix
821  , bool DF // Density flag
822  , typename VT // Type of the right-hand side vector
823  , bool TF > // Transpose flag of the right-hand side vector
824 inline bool tryAddAssign( const LowerMatrix<MT,SO,DF>& lhs,
825  const Vector<VT,TF>& rhs, size_t row, size_t column )
826 {
827  return tryAssign( lhs, ~rhs, row, column );
828 }
830 //*************************************************************************************************
831 
832 
833 //*************************************************************************************************
849 template< typename MT1 // Type of the adapted matrix
850  , bool SO1 // Storage order of the adapted matrix
851  , bool DF // Density flag
852  , typename MT2 // Type of the right-hand side matrix
853  , bool SO2 > // Storage order of the right-hand side matrix
854 inline bool tryAddAssign( const LowerMatrix<MT1,SO1,DF>& lhs,
855  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
856 {
857  return tryAssign( lhs, ~rhs, row, column );
858 }
860 //*************************************************************************************************
861 
862 
863 //*************************************************************************************************
879 template< typename MT // Type of the adapted matrix
880  , bool SO // Storage order of the adapted matrix
881  , bool DF // Density flag
882  , typename VT // Type of the right-hand side vector
883  , bool TF > // Transpose flag of the right-hand side vector
884 inline bool trySubAssign( const LowerMatrix<MT,SO,DF>& lhs,
885  const Vector<VT,TF>& rhs, size_t row, size_t column )
886 {
887  return tryAssign( lhs, ~rhs, row, column );
888 }
890 //*************************************************************************************************
891 
892 
893 //*************************************************************************************************
909 template< typename MT1 // Type of the adapted matrix
910  , bool SO1 // Storage order of the adapted matrix
911  , bool DF // Density flag
912  , typename MT2 // Type of the right-hand side matrix
913  , bool SO2 > // Storage order of the right-hand side matrix
914 inline bool trySubAssign( const LowerMatrix<MT1,SO1,DF>& lhs,
915  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
916 {
917  return tryAssign( lhs, ~rhs, row, column );
918 }
920 //*************************************************************************************************
921 
922 
923 //*************************************************************************************************
937 template< typename MT // Type of the adapted matrix
938  , bool SO // Storage order of the adapted matrix
939  , bool DF > // Density flag
940 inline MT& derestrict( LowerMatrix<MT,SO,DF>& m )
941 {
942  return m.matrix_;
943 }
945 //*************************************************************************************************
946 
947 
948 
949 
950 //=================================================================================================
951 //
952 // ROWS SPECIALIZATIONS
953 //
954 //=================================================================================================
955 
956 //*************************************************************************************************
958 template< typename MT, bool SO, bool DF >
959 struct Rows< LowerMatrix<MT,SO,DF> >
960  : public Rows<MT>
961 {};
963 //*************************************************************************************************
964 
965 
966 
967 
968 //=================================================================================================
969 //
970 // COLUMNS SPECIALIZATIONS
971 //
972 //=================================================================================================
973 
974 //*************************************************************************************************
976 template< typename MT, bool SO, bool DF >
977 struct Columns< LowerMatrix<MT,SO,DF> >
978  : public Columns<MT>
979 {};
981 //*************************************************************************************************
982 
983 
984 
985 
986 //=================================================================================================
987 //
988 // ISSQUARE SPECIALIZATIONS
989 //
990 //=================================================================================================
991 
992 //*************************************************************************************************
994 template< typename MT, bool SO, bool DF >
995 struct IsSquare< LowerMatrix<MT,SO,DF> >
996  : public TrueType
997 {};
999 //*************************************************************************************************
1000 
1001 
1002 
1003 
1004 //=================================================================================================
1005 //
1006 // ISLOWER SPECIALIZATIONS
1007 //
1008 //=================================================================================================
1009 
1010 //*************************************************************************************************
1012 template< typename MT, bool SO, bool DF >
1013 struct IsLower< LowerMatrix<MT,SO,DF> >
1014  : public TrueType
1015 {};
1017 //*************************************************************************************************
1018 
1019 
1020 
1021 
1022 //=================================================================================================
1023 //
1024 // ISADAPTOR SPECIALIZATIONS
1025 //
1026 //=================================================================================================
1027 
1028 //*************************************************************************************************
1030 template< typename MT, bool SO, bool DF >
1031 struct IsAdaptor< LowerMatrix<MT,SO,DF> >
1032  : public TrueType
1033 {};
1035 //*************************************************************************************************
1036 
1037 
1038 
1039 
1040 //=================================================================================================
1041 //
1042 // ISRESTRICTED SPECIALIZATIONS
1043 //
1044 //=================================================================================================
1045 
1046 //*************************************************************************************************
1048 template< typename MT, bool SO, bool DF >
1049 struct IsRestricted< LowerMatrix<MT,SO,DF> >
1050  : public TrueType
1051 {};
1053 //*************************************************************************************************
1054 
1055 
1056 
1057 
1058 //=================================================================================================
1059 //
1060 // HASCONSTDATAACCESS SPECIALIZATIONS
1061 //
1062 //=================================================================================================
1063 
1064 //*************************************************************************************************
1066 template< typename MT, bool SO >
1067 struct HasConstDataAccess< LowerMatrix<MT,SO,true> >
1068  : public TrueType
1069 {};
1071 //*************************************************************************************************
1072 
1073 
1074 
1075 
1076 //=================================================================================================
1077 //
1078 // ISALIGNED SPECIALIZATIONS
1079 //
1080 //=================================================================================================
1081 
1082 //*************************************************************************************************
1084 template< typename MT, bool SO, bool DF >
1085 struct IsAligned< LowerMatrix<MT,SO,DF> >
1086  : public BoolConstant< IsAligned<MT>::value >
1087 {};
1089 //*************************************************************************************************
1090 
1091 
1092 
1093 
1094 //=================================================================================================
1095 //
1096 // ISPADDED SPECIALIZATIONS
1097 //
1098 //=================================================================================================
1099 
1100 //*************************************************************************************************
1102 template< typename MT, bool SO, bool DF >
1103 struct IsPadded< LowerMatrix<MT,SO,DF> >
1104  : public BoolConstant< IsPadded<MT>::value >
1105 {};
1107 //*************************************************************************************************
1108 
1109 
1110 
1111 
1112 //=================================================================================================
1113 //
1114 // ISRESIZABLE SPECIALIZATIONS
1115 //
1116 //=================================================================================================
1117 
1118 //*************************************************************************************************
1120 template< typename MT, bool SO, bool DF >
1121 struct IsResizable< LowerMatrix<MT,SO,DF> >
1122  : public BoolConstant< IsResizable<MT>::value >
1123 {};
1125 //*************************************************************************************************
1126 
1127 
1128 
1129 
1130 //=================================================================================================
1131 //
1132 // ISSHRINKABLE SPECIALIZATIONS
1133 //
1134 //=================================================================================================
1135 
1136 //*************************************************************************************************
1138 template< typename MT, bool SO, bool DF >
1139 struct IsShrinkable< LowerMatrix<MT,SO,DF> >
1140  : public BoolConstant< IsShrinkable<MT>::value >
1141 {};
1143 //*************************************************************************************************
1144 
1145 
1146 
1147 
1148 //=================================================================================================
1149 //
1150 // REMOVEADAPTOR SPECIALIZATIONS
1151 //
1152 //=================================================================================================
1153 
1154 //*************************************************************************************************
1156 template< typename MT, bool SO, bool DF >
1157 struct RemoveAdaptor< LowerMatrix<MT,SO,DF> >
1158 {
1159  using Type = MT;
1160 };
1162 //*************************************************************************************************
1163 
1164 
1165 
1166 
1167 //=================================================================================================
1168 //
1169 // ADDTRAIT SPECIALIZATIONS
1170 //
1171 //=================================================================================================
1172 
1173 //*************************************************************************************************
1175 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1176 struct AddTrait< LowerMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
1177 {
1179 };
1180 
1181 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1182 struct AddTrait< StaticMatrix<T,M,N,SO1>, LowerMatrix<MT,SO2,DF> >
1183 {
1184  using Type = AddTrait_< StaticMatrix<T,M,N,SO1>, MT >;
1185 };
1186 
1187 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1188 struct AddTrait< LowerMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
1189 {
1191 };
1192 
1193 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1194 struct AddTrait< HybridMatrix<T,M,N,SO1>, LowerMatrix<MT,SO2,DF> >
1195 {
1196  using Type = AddTrait_< HybridMatrix<T,M,N,SO1>, MT >;
1197 };
1198 
1199 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1200 struct AddTrait< LowerMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
1201 {
1202  using Type = AddTrait_< MT, DynamicMatrix<T,SO2> >;
1203 };
1204 
1205 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1206 struct AddTrait< DynamicMatrix<T,SO1>, LowerMatrix<MT,SO2,DF> >
1207 {
1208  using Type = AddTrait_< DynamicMatrix<T,SO1>, MT >;
1209 };
1210 
1211 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
1212 struct AddTrait< LowerMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
1213 {
1215 };
1216 
1217 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
1218 struct AddTrait< CustomMatrix<T,AF,PF,SO1>, LowerMatrix<MT,SO2,DF> >
1219 {
1220  using Type = AddTrait_< CustomMatrix<T,AF,PF,SO1>, MT >;
1221 };
1222 
1223 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1224 struct AddTrait< LowerMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
1225 {
1227 };
1228 
1229 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1230 struct AddTrait< CompressedMatrix<T,SO1>, LowerMatrix<MT,SO2,DF> >
1231 {
1232  using Type = AddTrait_< CompressedMatrix<T,SO1>, MT >;
1233 };
1234 
1235 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1236 struct AddTrait< LowerMatrix<MT,SO1,DF>, IdentityMatrix<T,SO2> >
1237 {
1239 };
1240 
1241 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1242 struct AddTrait< IdentityMatrix<T,SO1>, LowerMatrix<MT,SO2,DF> >
1243 {
1244  using Type = LowerMatrix< AddTrait_< IdentityMatrix<T,SO1>, MT > >;
1245 };
1246 
1247 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
1248 struct AddTrait< LowerMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
1249 {
1250  using Type = AddTrait_<MT1,MT2>;
1251 };
1252 
1253 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
1254 struct AddTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, LowerMatrix<MT2,SO2,DF2> >
1255 {
1256  using Type = AddTrait_<MT1,MT2>;
1257 };
1258 
1259 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1260 struct AddTrait< LowerMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1261 {
1262  using Type = AddTrait_<MT1,MT2>;
1263 };
1264 
1265 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1266 struct AddTrait< HermitianMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
1267 {
1268  using Type = AddTrait_<MT1,MT2>;
1269 };
1270 
1271 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1272 struct AddTrait< LowerMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
1273 {
1274  using Type = LowerMatrix< AddTrait_<MT1,MT2> >;
1275 };
1277 //*************************************************************************************************
1278 
1279 
1280 
1281 
1282 //=================================================================================================
1283 //
1284 // SUBTRAIT SPECIALIZATIONS
1285 //
1286 //=================================================================================================
1287 
1288 //*************************************************************************************************
1290 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1291 struct SubTrait< LowerMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
1292 {
1294 };
1295 
1296 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1297 struct SubTrait< StaticMatrix<T,M,N,SO1>, LowerMatrix<MT,SO2,DF> >
1298 {
1299  using Type = SubTrait_< StaticMatrix<T,M,N,SO1>, MT >;
1300 };
1301 
1302 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1303 struct SubTrait< LowerMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
1304 {
1306 };
1307 
1308 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1309 struct SubTrait< HybridMatrix<T,M,N,SO1>, LowerMatrix<MT,SO2,DF> >
1310 {
1311  using Type = SubTrait_< HybridMatrix<T,M,N,SO1>, MT >;
1312 };
1313 
1314 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1315 struct SubTrait< LowerMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
1316 {
1317  using Type = SubTrait_< MT, DynamicMatrix<T,SO2> >;
1318 };
1319 
1320 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1321 struct SubTrait< DynamicMatrix<T,SO1>, LowerMatrix<MT,SO2,DF> >
1322 {
1323  using Type = SubTrait_< DynamicMatrix<T,SO1>, MT >;
1324 };
1325 
1326 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
1327 struct SubTrait< LowerMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
1328 {
1330 };
1331 
1332 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
1333 struct SubTrait< CustomMatrix<T,AF,PF,SO1>, LowerMatrix<MT,SO2,DF> >
1334 {
1335  using Type = SubTrait_< CustomMatrix<T,AF,PF,SO1>, MT >;
1336 };
1337 
1338 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1339 struct SubTrait< LowerMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
1340 {
1342 };
1343 
1344 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1345 struct SubTrait< CompressedMatrix<T,SO1>, LowerMatrix<MT,SO2,DF> >
1346 {
1347  using Type = SubTrait_< CompressedMatrix<T,SO1>, MT >;
1348 };
1349 
1350 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1351 struct SubTrait< LowerMatrix<MT,SO1,DF>, IdentityMatrix<T,SO2> >
1352 {
1354 };
1355 
1356 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1357 struct SubTrait< IdentityMatrix<T,SO1>, LowerMatrix<MT,SO2,DF> >
1358 {
1359  using Type = LowerMatrix< SubTrait_< IdentityMatrix<T,SO1>, MT > >;
1360 };
1361 
1362 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
1363 struct SubTrait< LowerMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
1364 {
1365  using Type = SubTrait_<MT1,MT2>;
1366 };
1367 
1368 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
1369 struct SubTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, LowerMatrix<MT2,SO2,DF2> >
1370 {
1371  using Type = SubTrait_<MT1,MT2>;
1372 };
1373 
1374 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1375 struct SubTrait< LowerMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1376 {
1377  using Type = SubTrait_<MT1,MT2>;
1378 };
1379 
1380 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1381 struct SubTrait< HermitianMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
1382 {
1383  using Type = SubTrait_<MT1,MT2>;
1384 };
1385 
1386 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1387 struct SubTrait< LowerMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
1388 {
1389  using Type = LowerMatrix< SubTrait_<MT1,MT2> >;
1390 };
1392 //*************************************************************************************************
1393 
1394 
1395 
1396 
1397 //=================================================================================================
1398 //
1399 // SCHURTRAIT SPECIALIZATIONS
1400 //
1401 //=================================================================================================
1402 
1403 //*************************************************************************************************
1405 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1406 struct SchurTrait< LowerMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
1407 {
1409 };
1410 
1411 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1412 struct SchurTrait< StaticMatrix<T,M,N,SO1>, LowerMatrix<MT,SO2,DF> >
1413 {
1415 };
1416 
1417 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1418 struct SchurTrait< LowerMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
1419 {
1421 };
1422 
1423 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1424 struct SchurTrait< HybridMatrix<T,M,N,SO1>, LowerMatrix<MT,SO2,DF> >
1425 {
1427 };
1428 
1429 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1430 struct SchurTrait< LowerMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
1431 {
1433 };
1434 
1435 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1436 struct SchurTrait< DynamicMatrix<T,SO1>, LowerMatrix<MT,SO2,DF> >
1437 {
1439 };
1440 
1441 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
1442 struct SchurTrait< LowerMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
1443 {
1445 };
1446 
1447 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
1448 struct SchurTrait< CustomMatrix<T,AF,PF,SO1>, LowerMatrix<MT,SO2,DF> >
1449 {
1451 };
1452 
1453 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1454 struct SchurTrait< LowerMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
1455 {
1457 };
1458 
1459 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1460 struct SchurTrait< CompressedMatrix<T,SO1>, LowerMatrix<MT,SO2,DF> >
1461 {
1463 };
1464 
1465 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1466 struct SchurTrait< LowerMatrix<MT,SO1,DF>, IdentityMatrix<T,SO2> >
1467 {
1469 };
1470 
1471 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1472 struct SchurTrait< IdentityMatrix<T,SO1>, LowerMatrix<MT,SO2,DF> >
1473 {
1475 };
1476 
1477 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
1478 struct SchurTrait< LowerMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
1479 {
1480  using Type = LowerMatrix< SchurTrait_<MT1,MT2> >;
1481 };
1482 
1483 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
1484 struct SchurTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, LowerMatrix<MT2,SO2,DF2> >
1485 {
1486  using Type = LowerMatrix< SchurTrait_<MT1,MT2> >;
1487 };
1488 
1489 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1490 struct SchurTrait< LowerMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1491 {
1492  using Type = LowerMatrix< SchurTrait_<MT1,MT2> >;
1493 };
1494 
1495 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1496 struct SchurTrait< HermitianMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
1497 {
1498  using Type = LowerMatrix< SchurTrait_<MT1,MT2> >;
1499 };
1500 
1501 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1502 struct SchurTrait< LowerMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
1503 {
1504  using Type = LowerMatrix< SchurTrait_<MT1,MT2> >;
1505 };
1507 //*************************************************************************************************
1508 
1509 
1510 
1511 
1512 //=================================================================================================
1513 //
1514 // MULTTRAIT SPECIALIZATIONS
1515 //
1516 //=================================================================================================
1517 
1518 //*************************************************************************************************
1520 template< typename MT, bool SO, bool DF, typename T >
1521 struct MultTrait< LowerMatrix<MT,SO,DF>, T, EnableIf_< IsNumeric<T> > >
1522 {
1523  using Type = LowerMatrix< MultTrait_<MT,T> >;
1524 };
1525 
1526 template< typename T, typename MT, bool SO, bool DF >
1527 struct MultTrait< T, LowerMatrix<MT,SO,DF>, EnableIf_< IsNumeric<T> > >
1528 {
1529  using Type = LowerMatrix< MultTrait_<T,MT> >;
1530 };
1531 
1532 template< typename MT, bool SO, bool DF, typename T, size_t N >
1533 struct MultTrait< LowerMatrix<MT,SO,DF>, StaticVector<T,N,false> >
1534 {
1536 };
1537 
1538 template< typename T, size_t N, typename MT, bool SO, bool DF >
1539 struct MultTrait< StaticVector<T,N,true>, LowerMatrix<MT,SO,DF> >
1540 {
1541  using Type = MultTrait_< StaticVector<T,N,true>, MT >;
1542 };
1543 
1544 template< typename MT, bool SO, bool DF, typename T, size_t N >
1545 struct MultTrait< LowerMatrix<MT,SO,DF>, HybridVector<T,N,false> >
1546 {
1548 };
1549 
1550 template< typename T, size_t N, typename MT, bool SO, bool DF >
1551 struct MultTrait< HybridVector<T,N,true>, LowerMatrix<MT,SO,DF> >
1552 {
1553  using Type = MultTrait_< HybridVector<T,N,true>, MT >;
1554 };
1555 
1556 template< typename MT, bool SO, bool DF, typename T >
1557 struct MultTrait< LowerMatrix<MT,SO,DF>, DynamicVector<T,false> >
1558 {
1560 };
1561 
1562 template< typename T, typename MT, bool SO, bool DF >
1563 struct MultTrait< DynamicVector<T,true>, LowerMatrix<MT,SO,DF> >
1564 {
1565  using Type = MultTrait_< DynamicVector<T,true>, MT >;
1566 };
1567 
1568 template< typename MT, bool SO, bool DF, typename T, bool AF, bool PF >
1569 struct MultTrait< LowerMatrix<MT,SO,DF>, CustomVector<T,AF,PF,false> >
1570 {
1572 };
1573 
1574 template< typename T, bool AF, bool PF, typename MT, bool SO, bool DF >
1575 struct MultTrait< CustomVector<T,AF,PF,true>, LowerMatrix<MT,SO,DF> >
1576 {
1577  using Type = MultTrait_< CustomVector<T,AF,PF,true>, MT >;
1578 };
1579 
1580 template< typename MT, bool SO, bool DF, typename T >
1581 struct MultTrait< LowerMatrix<MT,SO,DF>, CompressedVector<T,false> >
1582 {
1584 };
1585 
1586 template< typename T, typename MT, bool SO, bool DF >
1587 struct MultTrait< CompressedVector<T,true>, LowerMatrix<MT,SO,DF> >
1588 {
1589  using Type = MultTrait_< CompressedVector<T,true>, MT >;
1590 };
1591 
1592 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1593 struct MultTrait< LowerMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
1594 {
1596 };
1597 
1598 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1599 struct MultTrait< StaticMatrix<T,M,N,SO1>, LowerMatrix<MT,SO2,DF> >
1600 {
1601  using Type = MultTrait_< StaticMatrix<T,M,N,SO1>, MT >;
1602 };
1603 
1604 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1605 struct MultTrait< LowerMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
1606 {
1608 };
1609 
1610 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1611 struct MultTrait< HybridMatrix<T,M,N,SO1>, LowerMatrix<MT,SO2,DF> >
1612 {
1613  using Type = MultTrait_< HybridMatrix<T,M,N,SO1>, MT >;
1614 };
1615 
1616 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1617 struct MultTrait< LowerMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
1618 {
1619  using Type = MultTrait_< MT, DynamicMatrix<T,SO2> >;
1620 };
1621 
1622 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1623 struct MultTrait< DynamicMatrix<T,SO1>, LowerMatrix<MT,SO2,DF> >
1624 {
1625  using Type = MultTrait_< DynamicMatrix<T,SO1>, MT >;
1626 };
1627 
1628 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
1629 struct MultTrait< LowerMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
1630 {
1632 };
1633 
1634 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
1635 struct MultTrait< CustomMatrix<T,AF,PF,SO1>, LowerMatrix<MT,SO2,DF> >
1636 {
1637  using Type = MultTrait_< CustomMatrix<T,AF,PF,SO1>, MT >;
1638 };
1639 
1640 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1641 struct MultTrait< LowerMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
1642 {
1644 };
1645 
1646 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1647 struct MultTrait< CompressedMatrix<T,SO1>, LowerMatrix<MT,SO2,DF> >
1648 {
1649  using Type = MultTrait_< CompressedMatrix<T,SO1>, MT >;
1650 };
1651 
1652 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1653 struct MultTrait< LowerMatrix<MT,SO1,DF>, IdentityMatrix<T,SO2> >
1654 {
1656 };
1657 
1658 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1659 struct MultTrait< IdentityMatrix<T,SO1>, LowerMatrix<MT,SO2,DF> >
1660 {
1662 };
1663 
1664 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
1665 struct MultTrait< LowerMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
1666 {
1667  using Type = MultTrait_<MT1,MT2>;
1668 };
1669 
1670 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
1671 struct MultTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, LowerMatrix<MT2,SO2,DF2> >
1672 {
1673  using Type = MultTrait_<MT1,MT2>;
1674 };
1675 
1676 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1677 struct MultTrait< LowerMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1678 {
1679  using Type = MultTrait_<MT1,MT2>;
1680 };
1681 
1682 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1683 struct MultTrait< HermitianMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
1684 {
1685  using Type = MultTrait_<MT1,MT2>;
1686 };
1687 
1688 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1689 struct MultTrait< LowerMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
1690 {
1691  using Type = LowerMatrix< MultTrait_<MT1,MT2> >;
1692 };
1694 //*************************************************************************************************
1695 
1696 
1697 
1698 
1699 //=================================================================================================
1700 //
1701 // DIVTRAIT SPECIALIZATIONS
1702 //
1703 //=================================================================================================
1704 
1705 //*************************************************************************************************
1707 template< typename MT, bool SO, bool DF, typename T >
1708 struct DivTrait< LowerMatrix<MT,SO,DF>, T, EnableIf_< IsNumeric<T> > >
1709 {
1710  using Type = LowerMatrix< DivTrait_<MT,T> >;
1711 };
1713 //*************************************************************************************************
1714 
1715 
1716 
1717 
1718 //=================================================================================================
1719 //
1720 // UNARYMAPTRAIT SPECIALIZATIONS
1721 //
1722 //=================================================================================================
1723 
1724 //*************************************************************************************************
1726 template< typename MT, bool SO, bool DF >
1727 struct UnaryMapTrait< LowerMatrix<MT,SO,DF>, Abs >
1728 {
1729  using Type = LowerMatrix< UnaryMapTrait_<MT,Abs> >;
1730 };
1731 
1732 template< typename MT, bool SO, bool DF >
1733 struct UnaryMapTrait< LowerMatrix<MT,SO,DF>, Floor >
1734 {
1736 };
1737 
1738 template< typename MT, bool SO, bool DF >
1739 struct UnaryMapTrait< LowerMatrix<MT,SO,DF>, Ceil >
1740 {
1741  using Type = LowerMatrix< UnaryMapTrait_<MT,Ceil> >;
1742 };
1743 
1744 template< typename MT, bool SO, bool DF >
1745 struct UnaryMapTrait< LowerMatrix<MT,SO,DF>, Trunc >
1746 {
1748 };
1749 
1750 template< typename MT, bool SO, bool DF >
1751 struct UnaryMapTrait< LowerMatrix<MT,SO,DF>, Round >
1752 {
1754 };
1755 
1756 template< typename MT, bool SO, bool DF >
1757 struct UnaryMapTrait< LowerMatrix<MT,SO,DF>, Conj >
1758 {
1759  using Type = LowerMatrix< UnaryMapTrait_<MT,Conj> >;
1760 };
1761 
1762 template< typename MT, bool SO, bool DF >
1763 struct UnaryMapTrait< LowerMatrix<MT,SO,DF>, Real >
1764 {
1765  using Type = LowerMatrix< UnaryMapTrait_<MT,Real> >;
1766 };
1767 
1768 template< typename MT, bool SO, bool DF >
1769 struct UnaryMapTrait< LowerMatrix<MT,SO,DF>, Imag >
1770 {
1771  using Type = LowerMatrix< UnaryMapTrait_<MT,Imag> >;
1772 };
1773 
1774 template< typename MT, bool SO, bool DF >
1775 struct UnaryMapTrait< LowerMatrix<MT,SO,DF>, Sqrt >
1776 {
1777  using Type = LowerMatrix< UnaryMapTrait_<MT,Sqrt> >;
1778 };
1779 
1780 template< typename MT, bool SO, bool DF >
1781 struct UnaryMapTrait< LowerMatrix<MT,SO,DF>, Cbrt >
1782 {
1783  using Type = LowerMatrix< UnaryMapTrait_<MT,Cbrt> >;
1784 };
1785 
1786 template< typename MT, bool SO, bool DF >
1787 struct UnaryMapTrait< LowerMatrix<MT,SO,DF>, Sin >
1788 {
1789  using Type = LowerMatrix< UnaryMapTrait_<MT,Sin> >;
1790 };
1791 
1792 template< typename MT, bool SO, bool DF >
1793 struct UnaryMapTrait< LowerMatrix<MT,SO,DF>, Asin >
1794 {
1795  using Type = LowerMatrix< UnaryMapTrait_<MT,Asin> >;
1796 };
1797 
1798 template< typename MT, bool SO, bool DF >
1799 struct UnaryMapTrait< LowerMatrix<MT,SO,DF>, Sinh >
1800 {
1801  using Type = LowerMatrix< UnaryMapTrait_<MT,Sinh> >;
1802 };
1803 
1804 template< typename MT, bool SO, bool DF >
1805 struct UnaryMapTrait< LowerMatrix<MT,SO,DF>, Asinh >
1806 {
1808 };
1809 
1810 template< typename MT, bool SO, bool DF >
1811 struct UnaryMapTrait< LowerMatrix<MT,SO,DF>, Tan >
1812 {
1813  using Type = LowerMatrix< UnaryMapTrait_<MT,Tan> >;
1814 };
1815 
1816 template< typename MT, bool SO, bool DF >
1817 struct UnaryMapTrait< LowerMatrix<MT,SO,DF>, Atan >
1818 {
1819  using Type = LowerMatrix< UnaryMapTrait_<MT,Atan> >;
1820 };
1821 
1822 template< typename MT, bool SO, bool DF >
1823 struct UnaryMapTrait< LowerMatrix<MT,SO,DF>, Tanh >
1824 {
1825  using Type = LowerMatrix< UnaryMapTrait_<MT,Tanh> >;
1826 };
1827 
1828 template< typename MT, bool SO, bool DF >
1829 struct UnaryMapTrait< LowerMatrix<MT,SO,DF>, Atanh >
1830 {
1832 };
1833 
1834 template< typename MT, bool SO, bool DF >
1835 struct UnaryMapTrait< LowerMatrix<MT,SO,DF>, Erf >
1836 {
1837  using Type = LowerMatrix< UnaryMapTrait_<MT,Erf> >;
1838 };
1840 //*************************************************************************************************
1841 
1842 
1843 
1844 
1845 //=================================================================================================
1846 //
1847 // BINARYMAPTRAIT SPECIALIZATIONS
1848 //
1849 //=================================================================================================
1850 
1851 //*************************************************************************************************
1853 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1854 struct BinaryMapTrait< LowerMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2>, Min >
1855 {
1857 };
1858 
1859 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1860 struct BinaryMapTrait< LowerMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2>, Max >
1861 {
1863 };
1865 //*************************************************************************************************
1866 
1867 
1868 
1869 
1870 //=================================================================================================
1871 //
1872 // DECLSYMTRAIT SPECIALIZATIONS
1873 //
1874 //=================================================================================================
1875 
1876 //*************************************************************************************************
1878 template< typename MT, bool SO, bool DF >
1879 struct DeclSymTrait< LowerMatrix<MT,SO,DF> >
1880 {
1881  using Type = DiagonalMatrix<MT>;
1882 };
1884 //*************************************************************************************************
1885 
1886 
1887 
1888 
1889 //=================================================================================================
1890 //
1891 // DECLHERMTRAIT SPECIALIZATIONS
1892 //
1893 //=================================================================================================
1894 
1895 //*************************************************************************************************
1897 template< typename MT, bool SO, bool DF >
1898 struct DeclHermTrait< LowerMatrix<MT,SO,DF> >
1899 {
1900  using Type = HermitianMatrix<MT>;
1901 };
1903 //*************************************************************************************************
1904 
1905 
1906 
1907 
1908 //=================================================================================================
1909 //
1910 // DECLLOWTRAIT SPECIALIZATIONS
1911 //
1912 //=================================================================================================
1913 
1914 //*************************************************************************************************
1916 template< typename MT, bool SO, bool DF >
1917 struct DeclLowTrait< LowerMatrix<MT,SO,DF> >
1918 {
1919  using Type = LowerMatrix<MT,SO,DF>;
1920 };
1922 //*************************************************************************************************
1923 
1924 
1925 
1926 
1927 //=================================================================================================
1928 //
1929 // DECLUPPTRAIT SPECIALIZATIONS
1930 //
1931 //=================================================================================================
1932 
1933 //*************************************************************************************************
1935 template< typename MT, bool SO, bool DF >
1936 struct DeclUppTrait< LowerMatrix<MT,SO,DF> >
1937 {
1938  using Type = DiagonalMatrix<MT,SO,DF>;
1939 };
1941 //*************************************************************************************************
1942 
1943 
1944 
1945 
1946 //=================================================================================================
1947 //
1948 // DECLDIAGTRAIT SPECIALIZATIONS
1949 //
1950 //=================================================================================================
1951 
1952 //*************************************************************************************************
1954 template< typename MT, bool SO, bool DF >
1955 struct DeclDiagTrait< LowerMatrix<MT,SO,DF> >
1956 {
1957  using Type = DiagonalMatrix<MT,SO,DF>;
1958 };
1960 //*************************************************************************************************
1961 
1962 
1963 
1964 
1965 //=================================================================================================
1966 //
1967 // HIGHTYPE SPECIALIZATIONS
1968 //
1969 //=================================================================================================
1970 
1971 //*************************************************************************************************
1973 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1974 struct HighType< LowerMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
1975 {
1977 };
1979 //*************************************************************************************************
1980 
1981 
1982 
1983 
1984 //=================================================================================================
1985 //
1986 // LOWTYPE SPECIALIZATIONS
1987 //
1988 //=================================================================================================
1989 
1990 //*************************************************************************************************
1992 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1993 struct LowType< LowerMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
1994 {
1996 };
1998 //*************************************************************************************************
1999 
2000 
2001 
2002 
2003 //=================================================================================================
2004 //
2005 // SUBMATRIXTRAIT SPECIALIZATIONS
2006 //
2007 //=================================================================================================
2008 
2009 //*************************************************************************************************
2011 template< typename MT, bool SO, bool DF >
2012 struct SubmatrixTrait< LowerMatrix<MT,SO,DF> >
2013 {
2014  using Type = SubmatrixTrait_<MT>;
2015 };
2017 //*************************************************************************************************
2018 
2019 
2020 
2021 
2022 //=================================================================================================
2023 //
2024 // ROWTRAIT SPECIALIZATIONS
2025 //
2026 //=================================================================================================
2027 
2028 //*************************************************************************************************
2030 template< typename MT, bool SO, bool DF >
2031 struct RowTrait< LowerMatrix<MT,SO,DF> >
2032 {
2033  using Type = RowTrait_<MT>;
2034 };
2036 //*************************************************************************************************
2037 
2038 
2039 
2040 
2041 //=================================================================================================
2042 //
2043 // COLUMNTRAIT SPECIALIZATIONS
2044 //
2045 //=================================================================================================
2046 
2047 //*************************************************************************************************
2049 template< typename MT, bool SO, bool DF >
2050 struct ColumnTrait< LowerMatrix<MT,SO,DF> >
2051 {
2052  using Type = ColumnTrait_<MT>;
2053 };
2055 //*************************************************************************************************
2056 
2057 } // namespace blaze
2058 
2059 #endif
Header file for auxiliary alias declarations.
Headerfile for the generic min algorithm.
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 Rows type trait.
Header file for the UNUSED_PARAMETER function template.
Header file for the subtraction trait.
Flag for the inversion of a diagonal matrix.
Definition: InversionFlag.h:115
Flag for the inversion of a general matrix (same as byLU).
Definition: InversionFlag.h:108
Header file for the row trait.
Header file for the declherm trait.
Base template for the SubmatrixTrait class.
Definition: SubmatrixTrait.h:128
Flag for the inversion of a upper unitriangular matrix.
Definition: InversionFlag.h:114
Base template for the ColumnTrait class.
Definition: ColumnTrait.h:127
Flag for the inversion of a lower unitriangular matrix.
Definition: InversionFlag.h:112
typename RowTrait< MT >::Type RowTrait_
Auxiliary alias declaration for the RowTrait type trait.The RowTrait_ alias declaration provides a co...
Definition: RowTrait.h:162
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:133
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:124
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:198
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:560
const ElementType_< MT > min(const DenseMatrix< MT, SO > &dm)
Returns the smallest element of the dense matrix.
Definition: DenseMatrix.h:1762
Compile time check for lower triangular matrices.This type trait tests whether or not the given templ...
Definition: IsLower.h:88
#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
typename MultTrait< T1, T2 >::Type MultTrait_
Auxiliary alias declaration for the MultTrait class template.The MultTrait_ alias declaration provide...
Definition: MultTrait.h:250
Column< MT > column(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific column of the given matrix.
Definition: Column.h:124
Constraint on the data type.
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:78
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:129
bool isIdentity(const DenseMatrix< MT, SO > &dm)
Checks if the give dense matrix is an identity matrix.
Definition: DenseMatrix.h:1686
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.
Row< MT > row(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific row of the given matrix.
Definition: Row.h:124
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:127
Constraint on the data type.
Header file for the LowType type trait.
Flag for the inversion of a lower triangular matrix.
Definition: InversionFlag.h:111
Base template for the HighType type trait.
Definition: HighType.h:133
Header file for the multiplication trait.
Header file for the unary map trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Flag for the LU-based matrix inversion.
Definition: InversionFlag.h:103
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:219
Header file for the Columns type trait.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3087
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:70
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:340
Base template for the DeclSymTrait class.
Definition: DeclSymTrait.h:134
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:548
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:264
Header file for the RemoveAdaptor type trait.
Constraint on the data type.
Compile time check for adaptors.This type trait tests whether the given template parameter is an adap...
Definition: IsAdaptor.h:88
Header file for the EnableIf class template.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:580
Header file for the IsPadded type trait.
Header file for the IsAdaptor type trait.
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:139
Base template for the DeclHermTrait class.
Definition: DeclHermTrait.h:134
Base template for the MultTrait class.
Definition: MultTrait.h:139
Header file for the addition trait.
Header file for the division trait.
Header file for the submatrix trait.
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_LOWER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a lower triangular matrix type...
Definition: Lower.h:81
Header file for the declsym trait.
Matrix adapter for Hermitian matrices.
Definition: BaseTemplate.h:614
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:270
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
typename SubmatrixTrait< MT >::Type SubmatrixTrait_
Auxiliary alias declaration for the SubmatrixTrait type trait.The SubmatrixTrait_ alias declaration p...
Definition: SubmatrixTrait.h:163
Base template for the DivTrait class.
Definition: DivTrait.h:139
typename ColumnTrait< MT >::Type ColumnTrait_
Auxiliary alias declaration for the ColumnTrait type trait.The ColumnTrait_ alias declaration provide...
Definition: ColumnTrait.h:162
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:324
Base template for the DeclLowTrait class.
Definition: DeclLowTrait.h:133
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 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 implementation of the base template of the LowerMatrix.
typename SubTrait< T1, T2 >::Type SubTrait_
Auxiliary alias declaration for the SubTrait class template.The SubTrait_ alias declaration provides ...
Definition: SubTrait.h:250
LowerMatrix specialization for sparse matrices.
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.
Header file for the IntegralConstant class template.
Compile time evaluation of the number of columns of a matrix.The Columns type trait evaluates the num...
Definition: Columns.h:75
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:252
Compile time evaluation of the number of rows of a matrix.The Rows type trait evaluates the number of...
Definition: Rows.h:75
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:600
#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:139
Matrix adapter for diagonal matrices.
Definition: BaseTemplate.h:560
void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
Base template for the DeclDiagTrait class.
Definition: DeclDiagTrait.h:133
Base template for the BinaryMapTrait class.
Definition: BinaryMapTrait.h:119
Header file for the IsResizable type trait.
Header file for the IsRestricted type trait.
Base template for the UnaryMapTrait class.
Definition: UnaryMapTrait.h:117
typename AddTrait< T1, T2 >::Type AddTrait_
Auxiliary alias declaration for the AddTrait class template.The AddTrait_ alias declaration provides ...
Definition: AddTrait.h:250
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
LowerMatrix specialization for dense matrices.
Header file for the HighType type trait.
Header file for the TrueType type/value trait base class.