UniLowerMatrix.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_ADAPTORS_UNILOWERMATRIX_H_
36 #define _BLAZE_MATH_ADAPTORS_UNILOWERMATRIX_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <blaze/math/Aliases.h>
54 #include <blaze/math/Forward.h>
57 #include <blaze/math/shims/IsOne.h>
88 #include <blaze/util/Assert.h>
89 #include <blaze/util/EnableIf.h>
91 #include <blaze/util/TrueType.h>
93 #include <blaze/util/Unused.h>
94 
95 
96 namespace blaze {
97 
98 //=================================================================================================
99 //
100 // UNILOWERMATRIX OPERATORS
101 //
102 //=================================================================================================
103 
104 //*************************************************************************************************
107 template< typename MT, bool SO, bool DF >
108 inline void reset( UniLowerMatrix<MT,SO,DF>& m );
109 
110 template< typename MT, bool SO, bool DF >
111 inline void reset( UniLowerMatrix<MT,SO,DF>& m, size_t i );
112 
113 template< typename MT, bool SO, bool DF >
114 inline void clear( UniLowerMatrix<MT,SO,DF>& m );
115 
116 template< bool RF, typename MT, bool SO, bool DF >
117 inline bool isDefault( const UniLowerMatrix<MT,SO,DF>& m );
118 
119 template< typename MT, bool SO, bool DF >
120 inline bool isIntact( const UniLowerMatrix<MT,SO,DF>& m );
121 
122 template< typename MT, bool SO, bool DF >
123 inline void swap( UniLowerMatrix<MT,SO,DF>& a, UniLowerMatrix<MT,SO,DF>& b ) noexcept;
125 //*************************************************************************************************
126 
127 
128 //*************************************************************************************************
135 template< typename MT // Type of the adapted matrix
136  , bool SO // Storage order of the adapted matrix
137  , bool DF > // Density flag
139 {
140  m.reset();
141 }
142 //*************************************************************************************************
143 
144 
145 //*************************************************************************************************
158 template< typename MT // Type of the adapted matrix
159  , bool SO // Storage order of the adapted matrix
160  , bool DF > // Density flag
161 inline void reset( UniLowerMatrix<MT,SO,DF>& m, size_t i )
162 {
163  m.reset( i );
164 }
165 //*************************************************************************************************
166 
167 
168 //*************************************************************************************************
175 template< typename MT // Type of the adapted matrix
176  , bool SO // Storage order of the adapted matrix
177  , bool DF > // Density flag
179 {
180  m.clear();
181 }
182 //*************************************************************************************************
183 
184 
185 //*************************************************************************************************
195 template< bool RF // Relaxation flag
196  , typename MT // Type of the adapted matrix
197  , bool SO // Storage order of the adapted matrix
198  , bool DF > // Density flag
199 inline bool isDefault_backend( const UniLowerMatrix<MT,SO,DF>& m, TrueType )
200 {
201  return ( m.rows() == 0UL );
202 }
204 //*************************************************************************************************
205 
206 
207 //*************************************************************************************************
217 template< bool RF // Relaxation flag
218  , typename MT // Type of the adapted matrix
219  , bool SO // Storage order of the adapted matrix
220  , bool DF > // Density flag
221 inline bool isDefault_backend( const UniLowerMatrix<MT,SO,DF>& m, FalseType )
222 {
223  return isIdentity<RF>( m );
224 }
226 //*************************************************************************************************
227 
228 
229 //*************************************************************************************************
255 template< bool RF // Relaxation flag
256  , typename MT // Type of the adapted matrix
257  , bool SO // Storage order of the adapted matrix
258  , bool DF > // Density flag
259 inline bool isDefault( const UniLowerMatrix<MT,SO,DF>& m )
260 {
261  return isDefault_backend<RF>( m, typename IsResizable<MT>::Type() );
262 }
263 //*************************************************************************************************
264 
265 
266 //*************************************************************************************************
287 template< typename MT // Type of the adapted matrix
288  , bool SO // Storage order of the adapted matrix
289  , bool DF > // Density flag
290 inline bool isIntact( const UniLowerMatrix<MT,SO,DF>& m )
291 {
292  return m.isIntact();
293 }
294 //*************************************************************************************************
295 
296 
297 //*************************************************************************************************
305 template< typename MT // Type of the adapted matrix
306  , bool SO // Storage order of the adapted matrix
307  , bool DF > // Density flag
309 {
310  a.swap( b );
311 }
312 //*************************************************************************************************
313 
314 
315 //*************************************************************************************************
338 template< InversionFlag IF // Inversion algorithm
339  , typename MT // Type of the dense matrix
340  , bool SO > // Storage order of the dense matrix
341 inline void invert( UniLowerMatrix<MT,SO,true>& m )
342 {
344 
345  if( IF == asUpper || IF == asUniUpper ) {
346  BLAZE_INTERNAL_ASSERT( isIdentity( m ), "Violation of preconditions detected" );
347  return;
348  }
349 
350  constexpr InversionFlag flag( ( IF == byLU || IF == asGeneral || IF == asLower || IF == asUniLower )
351  ? ( asUniLower )
352  : ( asDiagonal ) );
353 
354  invert<flag>( derestrict( m ) );
355 
356  BLAZE_INTERNAL_ASSERT( isIntact( m ), "Broken invariant detected" );
357 }
359 //*************************************************************************************************
360 
361 
362 //*************************************************************************************************
381 template< typename MT1, bool SO1, typename MT2, typename MT3, typename MT4, bool SO2 >
382 inline void lu( const UniLowerMatrix<MT1,SO1,true>& A, DenseMatrix<MT2,SO1>& L,
384 {
386 
391 
396 
397  using ET3 = ElementType_<MT3>;
398  using ET4 = ElementType_<MT4>;
399 
400  const size_t n( (~A).rows() );
401 
402  decltype(auto) U2( derestrict( ~U ) );
403 
404  (~L) = A;
405 
406  resize( ~U, n, n );
407  reset( U2 );
408 
409  resize( ~P, n, n );
410  reset( ~P );
411 
412  for( size_t i=0UL; i<n; ++i ) {
413  U2(i,i) = ET3(1);
414  (~P)(i,i) = ET4(1);
415  }
416 }
418 //*************************************************************************************************
419 
420 
421 //*************************************************************************************************
437 template< typename MT // Type of the adapted matrix
438  , bool SO // Storage order of the adapted matrix
439  , bool DF // Density flag
440  , typename VT > // Type of the right-hand side dense vector
441 inline bool tryAssign( const UniLowerMatrix<MT,SO,DF>& lhs,
442  const DenseVector<VT,false>& rhs, size_t row, size_t column )
443 {
445 
446  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
447  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
448  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.rows() - row, "Invalid number of rows" );
449 
450  UNUSED_PARAMETER( lhs );
451 
452  if( column < row )
453  return true;
454 
455  const bool containsDiagonal( column < row + (~rhs).size() );
456  const size_t iend( min( column - row, (~rhs).size() ) );
457 
458  for( size_t i=0UL; i<iend; ++i ) {
459  if( !isDefault( (~rhs)[i] ) )
460  return false;
461  }
462 
463  if( containsDiagonal && !isOne( (~rhs)[iend] ) )
464  return false;
465 
466  return true;
467 }
469 //*************************************************************************************************
470 
471 
472 //*************************************************************************************************
488 template< typename MT // Type of the adapted matrix
489  , bool SO // Storage order of the adapted matrix
490  , bool DF // Density flag
491  , typename VT > // Type of the right-hand side dense vector
492 inline bool tryAssign( const UniLowerMatrix<MT,SO,DF>& lhs,
493  const DenseVector<VT,true>& rhs, size_t row, size_t column )
494 {
496 
497  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
498  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
499  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.columns() - column, "Invalid number of columns" );
500 
501  UNUSED_PARAMETER( lhs );
502 
503  if( row >= column + (~rhs).size() )
504  return true;
505 
506  const bool containsDiagonal( row >= column );
507  const size_t ibegin( ( !containsDiagonal )?( 0UL ):( row - column + 1UL ) );
508 
509  if( containsDiagonal && !isOne( (~rhs)[row-column] ) )
510  return false;
511 
512  for( size_t i=ibegin; i<(~rhs).size(); ++i ) {
513  if( !isDefault( (~rhs)[i] ) )
514  return false;
515  }
516 
517  return true;
518 }
520 //*************************************************************************************************
521 
522 
523 //*************************************************************************************************
539 template< typename MT // Type of the adapted matrix
540  , bool SO // Storage order of the adapted matrix
541  , bool DF // Density flag
542  , typename VT > // Type of the right-hand side sparse vector
543 inline bool tryAssign( const UniLowerMatrix<MT,SO,DF>& lhs,
544  const SparseVector<VT,false>& rhs, size_t row, size_t column )
545 {
547 
548  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
549  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
550  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.rows() - row, "Invalid number of rows" );
551 
552  UNUSED_PARAMETER( lhs );
553 
554  using RhsIterator = typename VT::ConstIterator;
555 
556  if( column < row )
557  return true;
558 
559  const bool containsDiagonal( column < row + (~rhs).size() );
560  const size_t index( column - row );
561  const RhsIterator last( (~rhs).lowerBound( index ) );
562 
563  if( containsDiagonal ) {
564  if( last == (~rhs).end() || last->index() != index || !isOne( last->value() ) )
565  return false;
566  }
567 
568  for( RhsIterator element=(~rhs).begin(); element!=last; ++element ) {
569  if( !isDefault( element->value() ) )
570  return false;
571  }
572 
573  return true;
574 }
576 //*************************************************************************************************
577 
578 
579 //*************************************************************************************************
595 template< typename MT // Type of the adapted matrix
596  , bool SO // Storage order of the adapted matrix
597  , bool DF // Density flag
598  , typename VT > // Type of the right-hand side sparse vector
599 inline bool tryAssign( const UniLowerMatrix<MT,SO,DF>& lhs,
600  const SparseVector<VT,true>& rhs, size_t row, size_t column )
601 {
603 
604  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
605  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
606  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.columns() - column, "Invalid number of columns" );
607 
608  UNUSED_PARAMETER( lhs );
609 
610  using RhsIterator = typename VT::ConstIterator;
611 
612  if( row >= column + (~rhs).size() )
613  return true;
614 
615  const bool containsDiagonal( row >= column );
616  const size_t index( ( containsDiagonal )?( row - column ):( 0UL ) );
617  const RhsIterator last( (~rhs).end() );
618  RhsIterator element( (~rhs).lowerBound( index ) );
619 
620  if( containsDiagonal ) {
621  if( element == last || element->index() != index || !isOne( element->value() ) )
622  return false;
623  ++element;
624  }
625 
626  for( ; element!=last; ++element ) {
627  if( !isDefault( element->value() ) )
628  return false;
629  }
630 
631  return true;
632 }
634 //*************************************************************************************************
635 
636 
637 //*************************************************************************************************
653 template< typename MT1 // Type of the adapted matrix
654  , bool SO // Storage order of the adapted matrix
655  , bool DF // Density flag
656  , typename MT2 > // Type of the right-hand side dense matrix
657 inline bool tryAssign( const UniLowerMatrix<MT1,SO,DF>& lhs,
658  const DenseMatrix<MT2,false>& rhs, size_t row, size_t column )
659 {
661 
662  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
663  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
664  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
665  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
666 
667  UNUSED_PARAMETER( lhs );
668 
669  const size_t M( (~rhs).rows() );
670  const size_t N( (~rhs).columns() );
671 
672  if( row + 1UL >= column + N )
673  return true;
674 
675  const size_t iend( min( column + N - row, M ) );
676 
677  for( size_t i=0UL; i<iend; ++i )
678  {
679  const bool containsDiagonal( row + i >= column );
680 
681  if( containsDiagonal && !isOne( (~rhs)(i,row+i-column) ) )
682  return false;
683 
684  const size_t jbegin( ( containsDiagonal )?( row + i - column + 1UL ):( 0UL ) );
685 
686  for( size_t j=jbegin; j<N; ++j ) {
687  if( !isDefault( (~rhs)(i,j) ) )
688  return false;
689  }
690  }
691 
692  return true;
693 }
695 //*************************************************************************************************
696 
697 
698 //*************************************************************************************************
714 template< typename MT1 // Type of the adapted matrix
715  , bool SO // Storage order of the adapted matrix
716  , bool DF // Density flag
717  , typename MT2 > // Type of the right-hand side dense matrix
718 inline bool tryAssign( const UniLowerMatrix<MT1,SO,DF>& lhs,
719  const DenseMatrix<MT2,true>& rhs, size_t row, size_t column )
720 {
722 
723  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
724  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
725  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
726  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
727 
728  UNUSED_PARAMETER( lhs );
729 
730  const size_t M( (~rhs).rows() );
731  const size_t N( (~rhs).columns() );
732 
733  if( row + 1UL >= column + N )
734  return true;
735 
736  const size_t jbegin( ( row < column )?( 0UL ):( row - column ) );
737 
738  for( size_t j=jbegin; j<N; ++j )
739  {
740  const size_t iend( min( column + j - row, M ) );
741 
742  for( size_t i=0UL; i<iend; ++i ) {
743  if( !isDefault( (~rhs)(i,j) ) )
744  return false;
745  }
746 
747  const bool containsDiagonal( column + j < row + M );
748 
749  if( containsDiagonal && !isOne( (~rhs)(iend,j) ) )
750  return false;
751  }
752 
753  return true;
754 }
756 //*************************************************************************************************
757 
758 
759 //*************************************************************************************************
775 template< typename MT1 // Type of the adapted matrix
776  , bool SO // Storage order of the adapted matrix
777  , bool DF // Density flag
778  , typename MT2 > // Type of the right-hand side sparse matrix
779 inline bool tryAssign( const UniLowerMatrix<MT1,SO,DF>& lhs,
780  const SparseMatrix<MT2,false>& rhs, size_t row, size_t column )
781 {
783 
784  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
785  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
786  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
787  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
788 
789  UNUSED_PARAMETER( lhs );
790 
791  using RhsIterator = typename MT2::ConstIterator;
792 
793  const size_t M( (~rhs).rows() );
794  const size_t N( (~rhs).columns() );
795 
796  if( row + 1UL >= column + N )
797  return true;
798 
799  const size_t iend( min( column + N - row, M ) );
800 
801  for( size_t i=0UL; i<iend; ++i )
802  {
803  const bool containsDiagonal( row + i >= column );
804  const size_t index( ( containsDiagonal )?( row + i - column ):( 0UL ) );
805 
806  const RhsIterator last( (~rhs).end(i) );
807  RhsIterator element( (~rhs).lowerBound( i, index ) );
808 
809  if( containsDiagonal ) {
810  if( element == last || ( element->index() != index ) || !isOne( element->value() ) )
811  return false;
812  ++element;
813  }
814 
815  for( ; element!=last; ++element ) {
816  if( !isDefault( element->value() ) )
817  return false;
818  }
819  }
820 
821  return true;
822 }
824 //*************************************************************************************************
825 
826 
827 //*************************************************************************************************
843 template< typename MT1 // Type of the adapted matrix
844  , bool SO // Storage order of the adapted matrix
845  , bool DF // Density flag
846  , typename MT2 > // Type of the right-hand side sparse matrix
847 inline bool tryAssign( const UniLowerMatrix<MT1,SO,DF>& lhs,
848  const SparseMatrix<MT2,true>& rhs, size_t row, size_t column )
849 {
851 
852  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
853  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
854  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
855  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
856 
857  UNUSED_PARAMETER( lhs );
858 
859  using RhsIterator = typename MT2::ConstIterator;
860 
861  const size_t M( (~rhs).rows() );
862  const size_t N( (~rhs).columns() );
863 
864  if( row + 1UL >= column + N )
865  return true;
866 
867  const size_t jbegin( ( row < column )?( 0UL ):( row - column ) );
868 
869  for( size_t j=jbegin; j<N; ++j )
870  {
871  const bool containsDiagonal( column + j < row + M );
872 
873  const size_t index( column + j - row );
874  const RhsIterator last( (~rhs).lowerBound( min( index, M ), j ) );
875 
876  if( containsDiagonal ) {
877  if( last == (~rhs).end(j) || ( last->index() != index ) || !isOne( last->value() ) )
878  return false;
879  }
880 
881  for( RhsIterator element=(~rhs).begin(j); element!=last; ++element ) {
882  if( !isDefault( element->value() ) )
883  return false;
884  }
885  }
886 
887  return true;
888 }
890 //*************************************************************************************************
891 
892 
893 //*************************************************************************************************
910 template< typename MT // Type of the adapted matrix
911  , bool SO // Storage order of the adapted matrix
912  , bool DF // Density flag
913  , typename VT > // Type of the right-hand side dense vector
914 inline bool tryAddAssign( const UniLowerMatrix<MT,SO,DF>& lhs,
915  const DenseVector<VT,false>& rhs, size_t row, size_t column )
916 {
918 
919  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
920  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
921  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.rows() - row, "Invalid number of rows" );
922 
923  UNUSED_PARAMETER( lhs );
924 
925  if( column < row )
926  return true;
927 
928  const size_t iend( min( column - row + 1UL, (~rhs).size() ) );
929 
930  for( size_t i=0UL; i<iend; ++i ) {
931  if( !isDefault( (~rhs)[i] ) )
932  return false;
933  }
934 
935  return true;
936 }
938 //*************************************************************************************************
939 
940 
941 //*************************************************************************************************
958 template< typename MT // Type of the adapted matrix
959  , bool SO // Storage order of the adapted matrix
960  , bool DF // Density flag
961  , typename VT > // Type of the right-hand side dense vector
962 inline bool tryAddAssign( const UniLowerMatrix<MT,SO,DF>& lhs,
963  const DenseVector<VT,true>& rhs, size_t row, size_t column )
964 {
966 
967  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
968  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
969  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.columns() - column, "Invalid number of columns" );
970 
971  UNUSED_PARAMETER( lhs );
972 
973  const size_t ibegin( ( row <= column )?( 0UL ):( row - column ) );
974 
975  for( size_t i=ibegin; i<(~rhs).size(); ++i ) {
976  if( !isDefault( (~rhs)[i] ) )
977  return false;
978  }
979 
980  return true;
981 }
983 //*************************************************************************************************
984 
985 
986 //*************************************************************************************************
1003 template< typename MT // Type of the adapted matrix
1004  , bool SO // Storage order of the adapted matrix
1005  , bool DF // Density flag
1006  , typename VT > // Type of the right-hand side sparse vector
1007 inline bool tryAddAssign( const UniLowerMatrix<MT,SO,DF>& lhs,
1008  const SparseVector<VT,false>& rhs, size_t row, size_t column )
1009 {
1011 
1012  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1013  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1014  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.rows() - row, "Invalid number of rows" );
1015 
1016  UNUSED_PARAMETER( lhs );
1017 
1018  using RhsIterator = typename VT::ConstIterator;
1019 
1020  if( column < row )
1021  return true;
1022 
1023  const RhsIterator last( (~rhs).lowerBound( column - row + 1UL ) );
1024 
1025  for( RhsIterator element=(~rhs).begin(); element!=last; ++element ) {
1026  if( !isDefault( element->value() ) )
1027  return false;
1028  }
1029 
1030  return true;
1031 }
1033 //*************************************************************************************************
1034 
1035 
1036 //*************************************************************************************************
1053 template< typename MT // Type of the adapted matrix
1054  , bool SO // Storage order of the adapted matrix
1055  , bool DF // Density flag
1056  , typename VT > // Type of the right-hand side sparse vector
1057 inline bool tryAddAssign( const UniLowerMatrix<MT,SO,DF>& lhs,
1058  const SparseVector<VT,true>& rhs, size_t row, size_t column )
1059 {
1061 
1062  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1063  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1064  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.columns() - column, "Invalid number of columns" );
1065 
1066  UNUSED_PARAMETER( lhs );
1067 
1068  using RhsIterator = typename VT::ConstIterator;
1069 
1070  const RhsIterator last( (~rhs).end() );
1071  RhsIterator element( (~rhs).lowerBound( ( row <= column )?( 0UL ):( row - column ) ) );
1072 
1073  for( ; element!=last; ++element ) {
1074  if( !isDefault( element->value() ) )
1075  return false;
1076  }
1077 
1078  return true;
1079 }
1081 //*************************************************************************************************
1082 
1083 
1084 //*************************************************************************************************
1101 template< typename MT1 // Type of the adapted matrix
1102  , bool SO // Storage order of the adapted matrix
1103  , bool DF // Density flag
1104  , typename MT2 > // Type of the right-hand side dense matrix
1105 inline bool tryAddAssign( const UniLowerMatrix<MT1,SO,DF>& lhs,
1106  const DenseMatrix<MT2,false>& rhs, size_t row, size_t column )
1107 {
1109 
1110  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1111  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1112  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
1113  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
1114 
1115  UNUSED_PARAMETER( lhs );
1116 
1117  const size_t M( (~rhs).rows() );
1118  const size_t N( (~rhs).columns() );
1119 
1120  if( row + 1UL >= column + N )
1121  return true;
1122 
1123  const size_t iend( min( column + N - row, M ) );
1124 
1125  for( size_t i=0UL; i<iend; ++i )
1126  {
1127  const bool containsDiagonal( row + i >= column );
1128  const size_t jbegin( ( containsDiagonal )?( row + i - column ):( 0UL ) );
1129 
1130  for( size_t j=jbegin; j<N; ++j ) {
1131  if( !isDefault( (~rhs)(i,j) ) )
1132  return false;
1133  }
1134  }
1135 
1136  return true;
1137 }
1139 //*************************************************************************************************
1140 
1141 
1142 //*************************************************************************************************
1159 template< typename MT1 // Type of the adapted matrix
1160  , bool SO // Storage order of the adapted matrix
1161  , bool DF // Density flag
1162  , typename MT2 > // Type of the right-hand side dense matrix
1163 inline bool tryAddAssign( const UniLowerMatrix<MT1,SO,DF>& lhs,
1164  const DenseMatrix<MT2,true>& rhs, size_t row, size_t column )
1165 {
1167 
1168  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1169  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1170  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
1171  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
1172 
1173  UNUSED_PARAMETER( lhs );
1174 
1175  const size_t M( (~rhs).rows() );
1176  const size_t N( (~rhs).columns() );
1177 
1178  if( row + 1UL >= column + N )
1179  return true;
1180 
1181  const size_t jbegin( ( row <= column )?( 0UL ):( row - column ) );
1182 
1183  for( size_t j=jbegin; j<N; ++j )
1184  {
1185  const size_t iend( min( column + j - row + 1UL, M ) );
1186 
1187  for( size_t i=0UL; i<iend; ++i ) {
1188  if( !isDefault( (~rhs)(i,j) ) )
1189  return false;
1190  }
1191  }
1192 
1193  return true;
1194 }
1196 //*************************************************************************************************
1197 
1198 
1199 //*************************************************************************************************
1216 template< typename MT1 // Type of the adapted matrix
1217  , bool SO // Storage order of the adapted matrix
1218  , bool DF // Density flag
1219  , typename MT2 > // Type of the right-hand side sparse matrix
1220 inline bool tryAddAssign( const UniLowerMatrix<MT1,SO,DF>& lhs,
1221  const SparseMatrix<MT2,false>& rhs, size_t row, size_t column )
1222 {
1224 
1225  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1226  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1227  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
1228  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
1229 
1230  UNUSED_PARAMETER( lhs );
1231 
1232  using RhsIterator = typename MT2::ConstIterator;
1233 
1234  const size_t M( (~rhs).rows() );
1235  const size_t N( (~rhs).columns() );
1236 
1237  if( row + 1UL >= column + N )
1238  return true;
1239 
1240  const size_t iend( min( column + N - row, M ) );
1241 
1242  for( size_t i=0UL; i<iend; ++i )
1243  {
1244  const bool containsDiagonal( row + i >= column );
1245  const size_t index( ( containsDiagonal )?( row + i - column ):( 0UL ) );
1246 
1247  const RhsIterator last( (~rhs).end(i) );
1248  RhsIterator element( (~rhs).lowerBound( i, index ) );
1249 
1250  for( ; element!=last; ++element ) {
1251  if( !isDefault( element->value() ) )
1252  return false;
1253  }
1254  }
1255 
1256  return true;
1257 }
1259 //*************************************************************************************************
1260 
1261 
1262 //*************************************************************************************************
1279 template< typename MT1 // Type of the adapted matrix
1280  , bool SO // Storage order of the adapted matrix
1281  , bool DF // Density flag
1282  , typename MT2 > // Type of the right-hand side sparse matrix
1283 inline bool tryAddAssign( const UniLowerMatrix<MT1,SO,DF>& lhs,
1284  const SparseMatrix<MT2,true>& rhs, size_t row, size_t column )
1285 {
1287 
1288  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1289  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1290  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
1291  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
1292 
1293  UNUSED_PARAMETER( lhs );
1294 
1295  using RhsIterator = typename MT2::ConstIterator;
1296 
1297  const size_t M( (~rhs).rows() );
1298  const size_t N( (~rhs).columns() );
1299 
1300  if( row + 1UL >= column + N )
1301  return true;
1302 
1303  const size_t jbegin( ( row < column )?( 0UL ):( row - column ) );
1304 
1305  for( size_t j=jbegin; j<N; ++j )
1306  {
1307  const size_t index( column + j - row + 1UL );
1308  const RhsIterator last( (~rhs).lowerBound( min( index, M ), j ) );
1309 
1310  for( RhsIterator element=(~rhs).begin(j); element!=last; ++element ) {
1311  if( !isDefault( element->value() ) )
1312  return false;
1313  }
1314  }
1315 
1316  return true;
1317 }
1319 //*************************************************************************************************
1320 
1321 
1322 //*************************************************************************************************
1339 template< typename MT // Type of the adapted matrix
1340  , bool SO // Storage order of the adapted matrix
1341  , bool DF // Density flag
1342  , typename VT // Type of the right-hand side vector
1343  , bool TF > // Transpose flag of the right-hand side vector
1344 inline bool trySubAssign( const UniLowerMatrix<MT,SO,DF>& lhs,
1345  const Vector<VT,TF>& rhs, size_t row, size_t column )
1346 {
1347  return tryAddAssign( lhs, ~rhs, row, column );
1348 }
1350 //*************************************************************************************************
1351 
1352 
1353 //*************************************************************************************************
1370 template< typename MT1 // Type of the adapted matrix
1371  , bool SO1 // Storage order of the adapted matrix
1372  , bool DF // Density flag
1373  , typename MT2 // Type of the right-hand side matrix
1374  , bool SO2 > // Storage order of the right-hand side matrix
1375 inline bool trySubAssign( const UniLowerMatrix<MT1,SO1,DF>& lhs,
1376  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
1377 {
1378  return tryAddAssign( lhs, ~rhs, row, column );
1379 }
1381 //*************************************************************************************************
1382 
1383 
1384 //*************************************************************************************************
1401 template< typename MT // Type of the adapted matrix
1402  , bool SO // Storage order of the adapted matrix
1403  , bool DF // Density flag
1404  , typename VT > // Type of the right-hand side vector
1405 inline bool tryMultAssign( const UniLowerMatrix<MT,SO,DF>& lhs,
1406  const Vector<VT,false>& rhs, size_t row, size_t column )
1407 {
1409 
1410  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1411  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1412  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.rows() - row, "Invalid number of rows" );
1413 
1414  UNUSED_PARAMETER( lhs );
1415 
1416  return ( column < row || (~rhs).size() <= column - row || isOne( (~rhs)[column-row] ) );
1417 }
1419 //*************************************************************************************************
1420 
1421 
1422 //*************************************************************************************************
1439 template< typename MT // Type of the adapted matrix
1440  , bool SO // Storage order of the adapted matrix
1441  , bool DF // Density flag
1442  , typename VT > // Type of the right-hand side vector
1443 inline bool tryMultAssign( const UniLowerMatrix<MT,SO,DF>& lhs,
1444  const Vector<VT,true>& rhs, size_t row, size_t column )
1445 {
1447 
1448  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1449  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1450  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.columns() - column, "Invalid number of columns" );
1451 
1452  UNUSED_PARAMETER( lhs );
1453 
1454  return ( row < column || (~rhs).size() <= row - column || isOne( (~rhs)[row-column] ) );
1455 }
1457 //*************************************************************************************************
1458 
1459 
1460 //*************************************************************************************************
1477 template< typename MT1 // Type of the adapted matrix
1478  , bool SO1 // Storage order of the adapted matrix
1479  , bool DF // Density flag
1480  , typename MT2 // Type of the right-hand side matrix
1481  , bool SO2 > // Storage order of the right-hand side matrix
1482 inline bool trySchurAssign( const UniLowerMatrix<MT1,SO1,DF>& lhs,
1483  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
1484 {
1486 
1487  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1488  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1489  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
1490  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
1491 
1492  UNUSED_PARAMETER( lhs );
1493 
1494  const size_t M( (~rhs).rows() );
1495  const size_t N( (~rhs).columns() );
1496 
1497  if( ( row + 1UL >= column + N ) || ( column + 1UL >= row + M ) )
1498  return true;
1499 
1500  size_t i( row < column ? column - row : 0UL );
1501  size_t j( column < row ? row - column : 0UL );
1502 
1503  for( ; i<M && j<N; ++i, ++j )
1504  {
1505  if( !isOne( (~rhs)(i,j) ) )
1506  return false;
1507  }
1508 
1509  return true;
1510 }
1512 //*************************************************************************************************
1513 
1514 
1515 //*************************************************************************************************
1531 template< typename MT // Type of the adapted matrix
1532  , bool SO // Storage order of the adapted matrix
1533  , bool DF // Density flag
1534  , typename VT // Type of the right-hand side vector
1535  , bool TF > // Transpose flag of the right-hand side vector
1536 inline bool tryDivAssign( const UniLowerMatrix<MT,SO,DF>& lhs,
1537  const Vector<VT,TF>& rhs, size_t row, size_t column )
1538 {
1539  return tryMultAssign( lhs, ~rhs, row, column );
1540 }
1542 //*************************************************************************************************
1543 
1544 
1545 //*************************************************************************************************
1559 template< typename MT // Type of the adapted matrix
1560  , bool SO // Storage order of the adapted matrix
1561  , bool DF > // Density flag
1562 inline MT& derestrict( UniLowerMatrix<MT,SO,DF>& m )
1563 {
1564  return m.matrix_;
1565 }
1567 //*************************************************************************************************
1568 
1569 
1570 
1571 
1572 //=================================================================================================
1573 //
1574 // ROWS SPECIALIZATIONS
1575 //
1576 //=================================================================================================
1577 
1578 //*************************************************************************************************
1580 template< typename MT, bool SO, bool DF >
1581 struct Rows< UniLowerMatrix<MT,SO,DF> >
1582  : public Rows<MT>
1583 {};
1585 //*************************************************************************************************
1586 
1587 
1588 
1589 
1590 //=================================================================================================
1591 //
1592 // COLUMNS SPECIALIZATIONS
1593 //
1594 //=================================================================================================
1595 
1596 //*************************************************************************************************
1598 template< typename MT, bool SO, bool DF >
1599 struct Columns< UniLowerMatrix<MT,SO,DF> >
1600  : public Columns<MT>
1601 {};
1603 //*************************************************************************************************
1604 
1605 
1606 
1607 
1608 //=================================================================================================
1609 //
1610 // ISSQUARE SPECIALIZATIONS
1611 //
1612 //=================================================================================================
1613 
1614 //*************************************************************************************************
1616 template< typename MT, bool SO, bool DF >
1617 struct IsSquare< UniLowerMatrix<MT,SO,DF> >
1618  : public TrueType
1619 {};
1621 //*************************************************************************************************
1622 
1623 
1624 
1625 
1626 //=================================================================================================
1627 //
1628 // ISUNILOWER SPECIALIZATIONS
1629 //
1630 //=================================================================================================
1631 
1632 //*************************************************************************************************
1634 template< typename MT, bool SO, bool DF >
1635 struct IsUniLower< UniLowerMatrix<MT,SO,DF> >
1636  : public TrueType
1637 {};
1639 //*************************************************************************************************
1640 
1641 
1642 
1643 
1644 //=================================================================================================
1645 //
1646 // ISADAPTOR SPECIALIZATIONS
1647 //
1648 //=================================================================================================
1649 
1650 //*************************************************************************************************
1652 template< typename MT, bool SO, bool DF >
1653 struct IsAdaptor< UniLowerMatrix<MT,SO,DF> >
1654  : public TrueType
1655 {};
1657 //*************************************************************************************************
1658 
1659 
1660 
1661 
1662 //=================================================================================================
1663 //
1664 // ISRESTRICTED SPECIALIZATIONS
1665 //
1666 //=================================================================================================
1667 
1668 //*************************************************************************************************
1670 template< typename MT, bool SO, bool DF >
1671 struct IsRestricted< UniLowerMatrix<MT,SO,DF> >
1672  : public TrueType
1673 {};
1675 //*************************************************************************************************
1676 
1677 
1678 
1679 
1680 //=================================================================================================
1681 //
1682 // HASCONSTDATAACCESS SPECIALIZATIONS
1683 //
1684 //=================================================================================================
1685 
1686 //*************************************************************************************************
1688 template< typename MT, bool SO >
1689 struct HasConstDataAccess< UniLowerMatrix<MT,SO,true> >
1690  : public TrueType
1691 {};
1693 //*************************************************************************************************
1694 
1695 
1696 
1697 
1698 //=================================================================================================
1699 //
1700 // ISALIGNED SPECIALIZATIONS
1701 //
1702 //=================================================================================================
1703 
1704 //*************************************************************************************************
1706 template< typename MT, bool SO, bool DF >
1707 struct IsAligned< UniLowerMatrix<MT,SO,DF> >
1708  : public BoolConstant< IsAligned<MT>::value >
1709 {};
1711 //*************************************************************************************************
1712 
1713 
1714 
1715 
1716 //=================================================================================================
1717 //
1718 // ISPADDED SPECIALIZATIONS
1719 //
1720 //=================================================================================================
1721 
1722 //*************************************************************************************************
1724 template< typename MT, bool SO, bool DF >
1725 struct IsPadded< UniLowerMatrix<MT,SO,DF> >
1726  : public BoolConstant< IsPadded<MT>::value >
1727 {};
1729 //*************************************************************************************************
1730 
1731 
1732 
1733 
1734 //=================================================================================================
1735 //
1736 // ISRESIZABLE SPECIALIZATIONS
1737 //
1738 //=================================================================================================
1739 
1740 //*************************************************************************************************
1742 template< typename MT, bool SO, bool DF >
1743 struct IsResizable< UniLowerMatrix<MT,SO,DF> >
1744  : public BoolConstant< IsResizable<MT>::value >
1745 {};
1747 //*************************************************************************************************
1748 
1749 
1750 
1751 
1752 //=================================================================================================
1753 //
1754 // ISSHRINKABLE SPECIALIZATIONS
1755 //
1756 //=================================================================================================
1757 
1758 //*************************************************************************************************
1760 template< typename MT, bool SO, bool DF >
1761 struct IsShrinkable< UniLowerMatrix<MT,SO,DF> >
1762  : public BoolConstant< IsShrinkable<MT>::value >
1763 {};
1765 //*************************************************************************************************
1766 
1767 
1768 
1769 
1770 //=================================================================================================
1771 //
1772 // REMOVEADAPTOR SPECIALIZATIONS
1773 //
1774 //=================================================================================================
1775 
1776 //*************************************************************************************************
1778 template< typename MT, bool SO, bool DF >
1779 struct RemoveAdaptor< UniLowerMatrix<MT,SO,DF> >
1780 {
1781  using Type = MT;
1782 };
1784 //*************************************************************************************************
1785 
1786 
1787 
1788 
1789 //=================================================================================================
1790 //
1791 // ADDTRAIT SPECIALIZATIONS
1792 //
1793 //=================================================================================================
1794 
1795 //*************************************************************************************************
1797 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1798 struct AddTrait< UniLowerMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
1799 {
1801 };
1802 
1803 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1804 struct AddTrait< StaticMatrix<T,M,N,SO1>, UniLowerMatrix<MT,SO2,DF> >
1805 {
1806  using Type = AddTrait_< StaticMatrix<T,M,N,SO1>, MT >;
1807 };
1808 
1809 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1810 struct AddTrait< UniLowerMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
1811 {
1813 };
1814 
1815 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1816 struct AddTrait< HybridMatrix<T,M,N,SO1>, UniLowerMatrix<MT,SO2,DF> >
1817 {
1818  using Type = AddTrait_< HybridMatrix<T,M,N,SO1>, MT >;
1819 };
1820 
1821 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1822 struct AddTrait< UniLowerMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
1823 {
1824  using Type = AddTrait_< MT, DynamicMatrix<T,SO2> >;
1825 };
1826 
1827 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1828 struct AddTrait< DynamicMatrix<T,SO1>, UniLowerMatrix<MT,SO2,DF> >
1829 {
1830  using Type = AddTrait_< DynamicMatrix<T,SO1>, MT >;
1831 };
1832 
1833 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
1834 struct AddTrait< UniLowerMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
1835 {
1837 };
1838 
1839 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
1840 struct AddTrait< CustomMatrix<T,AF,PF,SO1>, UniLowerMatrix<MT,SO2,DF> >
1841 {
1842  using Type = AddTrait_< CustomMatrix<T,AF,PF,SO1>, MT >;
1843 };
1844 
1845 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1846 struct AddTrait< UniLowerMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
1847 {
1849 };
1850 
1851 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1852 struct AddTrait< CompressedMatrix<T,SO1>, UniLowerMatrix<MT,SO2,DF> >
1853 {
1854  using Type = AddTrait_< CompressedMatrix<T,SO1>, MT >;
1855 };
1856 
1857 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1858 struct AddTrait< UniLowerMatrix<MT,SO1,DF>, IdentityMatrix<T,SO2> >
1859 {
1861 };
1862 
1863 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1864 struct AddTrait< IdentityMatrix<T,SO1>, UniLowerMatrix<MT,SO2,DF> >
1865 {
1866  using Type = LowerMatrix< AddTrait_< IdentityMatrix<T,SO1>, MT > >;
1867 };
1868 
1869 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
1870 struct AddTrait< UniLowerMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
1871 {
1872  using Type = AddTrait_<MT1,MT2>;
1873 };
1874 
1875 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
1876 struct AddTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, UniLowerMatrix<MT2,SO2,DF2> >
1877 {
1878  using Type = AddTrait_<MT1,MT2>;
1879 };
1880 
1881 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1882 struct AddTrait< UniLowerMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1883 {
1884  using Type = AddTrait_<MT1,MT2>;
1885 };
1886 
1887 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1888 struct AddTrait< HermitianMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
1889 {
1890  using Type = AddTrait_<MT1,MT2>;
1891 };
1892 
1893 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1894 struct AddTrait< UniLowerMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
1895 {
1896  using Type = LowerMatrix< AddTrait_<MT1,MT2> >;
1897 };
1898 
1899 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1900 struct AddTrait< LowerMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
1901 {
1902  using Type = LowerMatrix< AddTrait_<MT1,MT2> >;
1903 };
1904 
1905 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1906 struct AddTrait< UniLowerMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
1907 {
1908  using Type = LowerMatrix< AddTrait_<MT1,MT2> >;
1909 };
1911 //*************************************************************************************************
1912 
1913 
1914 
1915 
1916 //=================================================================================================
1917 //
1918 // SUBTRAIT SPECIALIZATIONS
1919 //
1920 //=================================================================================================
1921 
1922 //*************************************************************************************************
1924 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1925 struct SubTrait< UniLowerMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
1926 {
1928 };
1929 
1930 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1931 struct SubTrait< StaticMatrix<T,M,N,SO1>, UniLowerMatrix<MT,SO2,DF> >
1932 {
1933  using Type = SubTrait_< StaticMatrix<T,M,N,SO1>, MT >;
1934 };
1935 
1936 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1937 struct SubTrait< UniLowerMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
1938 {
1940 };
1941 
1942 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1943 struct SubTrait< HybridMatrix<T,M,N,SO1>, UniLowerMatrix<MT,SO2,DF> >
1944 {
1945  using Type = SubTrait_< HybridMatrix<T,M,N,SO1>, MT >;
1946 };
1947 
1948 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1949 struct SubTrait< UniLowerMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
1950 {
1951  using Type = SubTrait_< MT, DynamicMatrix<T,SO2> >;
1952 };
1953 
1954 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1955 struct SubTrait< DynamicMatrix<T,SO1>, UniLowerMatrix<MT,SO2,DF> >
1956 {
1957  using Type = SubTrait_< DynamicMatrix<T,SO1>, MT >;
1958 };
1959 
1960 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
1961 struct SubTrait< UniLowerMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
1962 {
1964 };
1965 
1966 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
1967 struct SubTrait< CustomMatrix<T,AF,PF,SO1>, UniLowerMatrix<MT,SO2,DF> >
1968 {
1969  using Type = SubTrait_< CustomMatrix<T,AF,PF,SO1>, MT >;
1970 };
1971 
1972 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1973 struct SubTrait< UniLowerMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
1974 {
1976 };
1977 
1978 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1979 struct SubTrait< CompressedMatrix<T,SO1>, UniLowerMatrix<MT,SO2,DF> >
1980 {
1981  using Type = SubTrait_< CompressedMatrix<T,SO1>, MT >;
1982 };
1983 
1984 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1985 struct SubTrait< UniLowerMatrix<MT,SO1,DF>, IdentityMatrix<T,SO2> >
1986 {
1988 };
1989 
1990 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1991 struct SubTrait< IdentityMatrix<T,SO1>, UniLowerMatrix<MT,SO2,DF> >
1992 {
1994 };
1995 
1996 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
1997 struct SubTrait< UniLowerMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
1998 {
1999  using Type = SubTrait_<MT1,MT2>;
2000 };
2001 
2002 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
2003 struct SubTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, UniLowerMatrix<MT2,SO2,DF2> >
2004 {
2005  using Type = SubTrait_<MT1,MT2>;
2006 };
2007 
2008 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2009 struct SubTrait< UniLowerMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
2010 {
2011  using Type = SubTrait_<MT1,MT2>;
2012 };
2013 
2014 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2015 struct SubTrait< HermitianMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
2016 {
2017  using Type = SubTrait_<MT1,MT2>;
2018 };
2019 
2020 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2021 struct SubTrait< UniLowerMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
2022 {
2023  using Type = LowerMatrix< SubTrait_<MT1,MT2> >;
2024 };
2025 
2026 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2027 struct SubTrait< LowerMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
2028 {
2029  using Type = LowerMatrix< SubTrait_<MT1,MT2> >;
2030 };
2031 
2032 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2033 struct SubTrait< UniLowerMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
2034 {
2035  using Type = LowerMatrix< SubTrait_<MT1,MT2> >;
2036 };
2038 //*************************************************************************************************
2039 
2040 
2041 
2042 
2043 //=================================================================================================
2044 //
2045 // SCHURTRAIT SPECIALIZATIONS
2046 //
2047 //=================================================================================================
2048 
2049 //*************************************************************************************************
2051 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
2052 struct SchurTrait< UniLowerMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
2053 {
2055 };
2056 
2057 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
2058 struct SchurTrait< StaticMatrix<T,M,N,SO1>, UniLowerMatrix<MT,SO2,DF> >
2059 {
2061 };
2062 
2063 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
2064 struct SchurTrait< UniLowerMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
2065 {
2067 };
2068 
2069 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
2070 struct SchurTrait< HybridMatrix<T,M,N,SO1>, UniLowerMatrix<MT,SO2,DF> >
2071 {
2073 };
2074 
2075 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
2076 struct SchurTrait< UniLowerMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
2077 {
2079 };
2080 
2081 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
2082 struct SchurTrait< DynamicMatrix<T,SO1>, UniLowerMatrix<MT,SO2,DF> >
2083 {
2085 };
2086 
2087 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
2088 struct SchurTrait< UniLowerMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
2089 {
2091 };
2092 
2093 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
2094 struct SchurTrait< CustomMatrix<T,AF,PF,SO1>, UniLowerMatrix<MT,SO2,DF> >
2095 {
2097 };
2098 
2099 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
2100 struct SchurTrait< UniLowerMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
2101 {
2103 };
2104 
2105 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
2106 struct SchurTrait< CompressedMatrix<T,SO1>, UniLowerMatrix<MT,SO2,DF> >
2107 {
2109 };
2110 
2111 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
2112 struct SchurTrait< UniLowerMatrix<MT,SO1,DF>, IdentityMatrix<T,SO2> >
2113 {
2114  using Type = IdentityMatrix< MultTrait_< ElementType_<MT>, T >, SO2 >;
2115 };
2116 
2117 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
2118 struct SchurTrait< IdentityMatrix<T,SO1>, UniLowerMatrix<MT,SO2,DF> >
2119 {
2121 };
2122 
2123 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
2124 struct SchurTrait< UniLowerMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
2125 {
2126  using Type = LowerMatrix< SchurTrait_<MT1,MT2> >;
2127 };
2128 
2129 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
2130 struct SchurTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, UniLowerMatrix<MT2,SO2,DF2> >
2131 {
2132  using Type = LowerMatrix< SchurTrait_<MT1,MT2> >;
2133 };
2134 
2135 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2136 struct SchurTrait< UniLowerMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
2137 {
2138  using Type = LowerMatrix< SchurTrait_<MT1,MT2> >;
2139 };
2140 
2141 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2142 struct SchurTrait< HermitianMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
2143 {
2144  using Type = LowerMatrix< SchurTrait_<MT1,MT2> >;
2145 };
2146 
2147 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2148 struct SchurTrait< UniLowerMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
2149 {
2150  using Type = LowerMatrix< SchurTrait_<MT1,MT2> >;
2151 };
2152 
2153 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2154 struct SchurTrait< LowerMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
2155 {
2156  using Type = LowerMatrix< SchurTrait_<MT1,MT2> >;
2157 };
2158 
2159 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2160 struct SchurTrait< UniLowerMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
2161 {
2162  using Type = UniLowerMatrix< SchurTrait_<MT1,MT2> >;
2163 };
2165 //*************************************************************************************************
2166 
2167 
2168 
2169 
2170 //=================================================================================================
2171 //
2172 // MULTTRAIT SPECIALIZATIONS
2173 //
2174 //=================================================================================================
2175 
2176 //*************************************************************************************************
2178 template< typename MT, bool SO, bool DF, typename T >
2179 struct MultTrait< UniLowerMatrix<MT,SO,DF>, T, EnableIf_< IsNumeric<T> > >
2180 {
2181  using Type = LowerMatrix< MultTrait_<MT,T> >;
2182 };
2183 
2184 template< typename T, typename MT, bool SO, bool DF >
2185 struct MultTrait< T, UniLowerMatrix<MT,SO,DF>, EnableIf_< IsNumeric<T> > >
2186 {
2187  using Type = LowerMatrix< MultTrait_<T,MT> >;
2188 };
2189 
2190 template< typename MT, bool SO, bool DF, typename T, size_t N >
2191 struct MultTrait< UniLowerMatrix<MT,SO,DF>, StaticVector<T,N,false> >
2192 {
2194 };
2195 
2196 template< typename T, size_t N, typename MT, bool SO, bool DF >
2197 struct MultTrait< StaticVector<T,N,true>, UniLowerMatrix<MT,SO,DF> >
2198 {
2199  using Type = MultTrait_< StaticVector<T,N,true>, MT >;
2200 };
2201 
2202 template< typename MT, bool SO, bool DF, typename T, size_t N >
2203 struct MultTrait< UniLowerMatrix<MT,SO,DF>, HybridVector<T,N,false> >
2204 {
2206 };
2207 
2208 template< typename T, size_t N, typename MT, bool SO, bool DF >
2209 struct MultTrait< HybridVector<T,N,true>, UniLowerMatrix<MT,SO,DF> >
2210 {
2211  using Type = MultTrait_< HybridVector<T,N,true>, MT >;
2212 };
2213 
2214 template< typename MT, bool SO, bool DF, typename T >
2215 struct MultTrait< UniLowerMatrix<MT,SO,DF>, DynamicVector<T,false> >
2216 {
2218 };
2219 
2220 template< typename T, typename MT, bool SO, bool DF >
2221 struct MultTrait< DynamicVector<T,true>, UniLowerMatrix<MT,SO,DF> >
2222 {
2223  using Type = MultTrait_< DynamicVector<T,true>, MT >;
2224 };
2225 
2226 template< typename MT, bool SO, bool DF, typename T, bool AF, bool PF >
2227 struct MultTrait< UniLowerMatrix<MT,SO,DF>, CustomVector<T,AF,PF,false> >
2228 {
2230 };
2231 
2232 template< typename T, bool AF, bool PF, typename MT, bool SO, bool DF >
2233 struct MultTrait< CustomVector<T,AF,PF,true>, UniLowerMatrix<MT,SO,DF> >
2234 {
2235  using Type = MultTrait_< CustomVector<T,AF,PF,true>, MT >;
2236 };
2237 
2238 template< typename MT, bool SO, bool DF, typename T >
2239 struct MultTrait< UniLowerMatrix<MT,SO,DF>, CompressedVector<T,false> >
2240 {
2242 };
2243 
2244 template< typename T, typename MT, bool SO, bool DF >
2245 struct MultTrait< CompressedVector<T,true>, UniLowerMatrix<MT,SO,DF> >
2246 {
2247  using Type = MultTrait_< CompressedVector<T,true>, MT >;
2248 };
2249 
2250 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
2251 struct MultTrait< UniLowerMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
2252 {
2254 };
2255 
2256 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
2257 struct MultTrait< StaticMatrix<T,M,N,SO1>, UniLowerMatrix<MT,SO2,DF> >
2258 {
2259  using Type = MultTrait_< StaticMatrix<T,M,N,SO1>, MT >;
2260 };
2261 
2262 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
2263 struct MultTrait< UniLowerMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
2264 {
2266 };
2267 
2268 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
2269 struct MultTrait< HybridMatrix<T,M,N,SO1>, UniLowerMatrix<MT,SO2,DF> >
2270 {
2271  using Type = MultTrait_< HybridMatrix<T,M,N,SO1>, MT >;
2272 };
2273 
2274 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
2275 struct MultTrait< UniLowerMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
2276 {
2277  using Type = MultTrait_< MT, DynamicMatrix<T,SO2> >;
2278 };
2279 
2280 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
2281 struct MultTrait< DynamicMatrix<T,SO1>, UniLowerMatrix<MT,SO2,DF> >
2282 {
2283  using Type = MultTrait_< DynamicMatrix<T,SO1>, MT >;
2284 };
2285 
2286 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
2287 struct MultTrait< UniLowerMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
2288 {
2290 };
2291 
2292 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
2293 struct MultTrait< CustomMatrix<T,AF,PF,SO1>, UniLowerMatrix<MT,SO2,DF> >
2294 {
2295  using Type = MultTrait_< CustomMatrix<T,AF,PF,SO1>, MT >;
2296 };
2297 
2298 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
2299 struct MultTrait< UniLowerMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
2300 {
2302 };
2303 
2304 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
2305 struct MultTrait< CompressedMatrix<T,SO1>, UniLowerMatrix<MT,SO2,DF> >
2306 {
2307  using Type = MultTrait_< CompressedMatrix<T,SO1>, MT >;
2308 };
2309 
2310 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
2311 struct MultTrait< UniLowerMatrix<MT,SO1,DF>, IdentityMatrix<T,SO2> >
2312 {
2314 };
2315 
2316 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
2317 struct MultTrait< IdentityMatrix<T,SO1>, UniLowerMatrix<MT,SO2,DF> >
2318 {
2320 };
2321 
2322 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
2323 struct MultTrait< UniLowerMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
2324 {
2325  using Type = MultTrait_<MT1,MT2>;
2326 };
2327 
2328 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
2329 struct MultTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, UniLowerMatrix<MT2,SO2,DF2> >
2330 {
2331  using Type = MultTrait_<MT1,MT2>;
2332 };
2333 
2334 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2335 struct MultTrait< UniLowerMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
2336 {
2337  using Type = MultTrait_<MT1,MT2>;
2338 };
2339 
2340 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2341 struct MultTrait< HermitianMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
2342 {
2343  using Type = MultTrait_<MT1,MT2>;
2344 };
2345 
2346 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2347 struct MultTrait< UniLowerMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
2348 {
2349  using Type = LowerMatrix< MultTrait_<MT1,MT2> >;
2350 };
2351 
2352 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2353 struct MultTrait< LowerMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
2354 {
2355  using Type = LowerMatrix< MultTrait_<MT1,MT2> >;
2356 };
2357 
2358 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2359 struct MultTrait< UniLowerMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
2360 {
2361  using Type = UniLowerMatrix< MultTrait_<MT1,MT2> >;
2362 };
2364 //*************************************************************************************************
2365 
2366 
2367 
2368 
2369 //=================================================================================================
2370 //
2371 // DIVTRAIT SPECIALIZATIONS
2372 //
2373 //=================================================================================================
2374 
2375 //*************************************************************************************************
2377 template< typename MT, bool SO, bool DF, typename T >
2378 struct DivTrait< UniLowerMatrix<MT,SO,DF>, T, EnableIf_< IsNumeric<T> > >
2379 {
2380  using Type = LowerMatrix< DivTrait_<MT,T> >;
2381 };
2383 //*************************************************************************************************
2384 
2385 
2386 
2387 
2388 //=================================================================================================
2389 //
2390 // UNARYMAPTRAIT SPECIALIZATIONS
2391 //
2392 //=================================================================================================
2393 
2394 //*************************************************************************************************
2396 template< typename MT, bool SO, bool DF >
2397 struct UnaryMapTrait< UniLowerMatrix<MT,SO,DF>, Abs >
2398 {
2400 };
2401 
2402 template< typename MT, bool SO, bool DF >
2403 struct UnaryMapTrait< UniLowerMatrix<MT,SO,DF>, Floor >
2404 {
2406 };
2407 
2408 template< typename MT, bool SO, bool DF >
2409 struct UnaryMapTrait< UniLowerMatrix<MT,SO,DF>, Ceil >
2410 {
2412 };
2413 
2414 template< typename MT, bool SO, bool DF >
2415 struct UnaryMapTrait< UniLowerMatrix<MT,SO,DF>, Trunc >
2416 {
2418 };
2419 
2420 template< typename MT, bool SO, bool DF >
2421 struct UnaryMapTrait< UniLowerMatrix<MT,SO,DF>, Round >
2422 {
2424 };
2425 
2426 template< typename MT, bool SO, bool DF >
2427 struct UnaryMapTrait< UniLowerMatrix<MT,SO,DF>, Conj >
2428 {
2430 };
2431 
2432 template< typename MT, bool SO, bool DF >
2433 struct UnaryMapTrait< UniLowerMatrix<MT,SO,DF>, Real >
2434 {
2436 };
2437 
2438 template< typename MT, bool SO, bool DF >
2439 struct UnaryMapTrait< UniLowerMatrix<MT,SO,DF>, Sqrt >
2440 {
2442 };
2443 
2444 template< typename MT, bool SO, bool DF >
2445 struct UnaryMapTrait< UniLowerMatrix<MT,SO,DF>, Cbrt >
2446 {
2448 };
2449 
2450 template< typename MT, bool SO, bool DF, typename ET >
2451 struct UnaryMapTrait< UniLowerMatrix<MT,SO,DF>, Pow<ET> >
2452 {
2454 };
2456 //*************************************************************************************************
2457 
2458 
2459 
2460 
2461 //=================================================================================================
2462 //
2463 // BINARYMAPTRAIT SPECIALIZATIONS
2464 //
2465 //=================================================================================================
2466 
2467 //*************************************************************************************************
2469 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2470 struct BinaryMapTrait< UniLowerMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2>, Min >
2471 {
2473 };
2474 
2475 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2476 struct BinaryMapTrait< UniLowerMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2>, Max >
2477 {
2479 };
2480 
2481 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2482 struct BinaryMapTrait< LowerMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2>, Min >
2483 {
2485 };
2486 
2487 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2488 struct BinaryMapTrait< LowerMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2>, Max >
2489 {
2491 };
2492 
2493 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2494 struct BinaryMapTrait< UniLowerMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2>, Min >
2495 {
2497 };
2498 
2499 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2500 struct BinaryMapTrait< UniLowerMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2>, Max >
2501 {
2503 };
2505 //*************************************************************************************************
2506 
2507 
2508 
2509 
2510 //=================================================================================================
2511 //
2512 // DECLSYMTRAIT SPECIALIZATIONS
2513 //
2514 //=================================================================================================
2515 
2516 //*************************************************************************************************
2518 template< typename MT, bool SO, bool DF >
2519 struct DeclSymTrait< UniLowerMatrix<MT,SO,DF> >
2520 {
2521  using Type = IdentityMatrix< ElementType_<MT>, SO >;
2522 };
2524 //*************************************************************************************************
2525 
2526 
2527 
2528 
2529 //=================================================================================================
2530 //
2531 // DECLHERMTRAIT SPECIALIZATIONS
2532 //
2533 //=================================================================================================
2534 
2535 //*************************************************************************************************
2537 template< typename MT, bool SO, bool DF >
2538 struct DeclHermTrait< UniLowerMatrix<MT,SO,DF> >
2539 {
2540  using Type = IdentityMatrix< ElementType_<MT>, SO >;
2541 };
2543 //*************************************************************************************************
2544 
2545 
2546 
2547 
2548 //=================================================================================================
2549 //
2550 // DECLLOWTRAIT SPECIALIZATIONS
2551 //
2552 //=================================================================================================
2553 
2554 //*************************************************************************************************
2556 template< typename MT, bool SO, bool DF >
2557 struct DeclLowTrait< UniLowerMatrix<MT,SO,DF> >
2558 {
2559  using Type = UniLowerMatrix<MT,SO,DF>;
2560 };
2562 //*************************************************************************************************
2563 
2564 
2565 
2566 
2567 //=================================================================================================
2568 //
2569 // DECLUPPTRAIT SPECIALIZATIONS
2570 //
2571 //=================================================================================================
2572 
2573 //*************************************************************************************************
2575 template< typename MT, bool SO, bool DF >
2576 struct DeclUppTrait< UniLowerMatrix<MT,SO,DF> >
2577 {
2578  using Type = IdentityMatrix< ElementType_<MT>, SO >;
2579 };
2581 //*************************************************************************************************
2582 
2583 
2584 
2585 
2586 //=================================================================================================
2587 //
2588 // DECLDIAGTRAIT SPECIALIZATIONS
2589 //
2590 //=================================================================================================
2591 
2592 //*************************************************************************************************
2594 template< typename MT, bool SO, bool DF >
2595 struct DeclDiagTrait< UniLowerMatrix<MT,SO,DF> >
2596 {
2597  using Type = IdentityMatrix< ElementType_<MT>, SO >;
2598 };
2600 //*************************************************************************************************
2601 
2602 
2603 
2604 
2605 //=================================================================================================
2606 //
2607 // HIGHTYPE SPECIALIZATIONS
2608 //
2609 //=================================================================================================
2610 
2611 //*************************************************************************************************
2613 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2614 struct HighType< UniLowerMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
2615 {
2617 };
2619 //*************************************************************************************************
2620 
2621 
2622 
2623 
2624 //=================================================================================================
2625 //
2626 // LOWTYPE SPECIALIZATIONS
2627 //
2628 //=================================================================================================
2629 
2630 //*************************************************************************************************
2632 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2633 struct LowType< UniLowerMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
2634 {
2636 };
2638 //*************************************************************************************************
2639 
2640 
2641 
2642 
2643 //=================================================================================================
2644 //
2645 // SUBMATRIXTRAIT SPECIALIZATIONS
2646 //
2647 //=================================================================================================
2648 
2649 //*************************************************************************************************
2651 template< typename MT, bool SO, bool DF >
2652 struct SubmatrixTrait< UniLowerMatrix<MT,SO,DF> >
2653 {
2654  using Type = SubmatrixTrait_<MT>;
2655 };
2657 //*************************************************************************************************
2658 
2659 
2660 
2661 
2662 //=================================================================================================
2663 //
2664 // ROWTRAIT SPECIALIZATIONS
2665 //
2666 //=================================================================================================
2667 
2668 //*************************************************************************************************
2670 template< typename MT, bool SO, bool DF >
2671 struct RowTrait< UniLowerMatrix<MT,SO,DF> >
2672 {
2673  using Type = RowTrait_<MT>;
2674 };
2676 //*************************************************************************************************
2677 
2678 
2679 
2680 
2681 //=================================================================================================
2682 //
2683 // COLUMNTRAIT SPECIALIZATIONS
2684 //
2685 //=================================================================================================
2686 
2687 //*************************************************************************************************
2689 template< typename MT, bool SO, bool DF >
2690 struct ColumnTrait< UniLowerMatrix<MT,SO,DF> >
2691 {
2692  using Type = ColumnTrait_<MT>;
2693 };
2695 //*************************************************************************************************
2696 
2697 } // namespace blaze
2698 
2699 #endif
Header file for the implementation of the base template of the UniLowerMatrix.
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
#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.
Header file for the IsUniLower type trait.
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
Flag for the inversion of a upper triangular matrix.
Definition: InversionFlag.h:113
Constraint on the data type.
Efficient implementation of an identity matrix.The IdentityMatrix class template is the representati...
Definition: Forward.h:49
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.
UniLowerMatrix specialization for dense matrices.
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
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
#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
UniLowerMatrix specialization for sparse matrices.
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.
Header file for the isOne shim.
Compile time check for lower unitriangular matrices.This type trait tests whether or not the given te...
Definition: IsUniLower.h:86
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 strictly lower triangular matrices.
Definition: BaseTemplate.h:558
bool isOne(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is 1.
Definition: DiagonalProxy.h:662
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
typename SubTrait< T1, T2 >::Type SubTrait_
Auxiliary alias declaration for the SubTrait class template.The SubTrait_ alias declaration provides ...
Definition: SubTrait.h:250
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 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
Matrix adapter for lower unitriangular matrices.
Definition: BaseTemplate.h:577
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
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
Header file for the HighType type trait.
Header file for the TrueType type/value trait base class.