Blaze 3.9
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>
55#include <blaze/math/Forward.h>
108#include <blaze/util/Assert.h>
109#include <blaze/util/EnableIf.h>
112
113
114namespace blaze {
115
116//=================================================================================================
117//
118// LOWERMATRIX OPERATORS
119//
120//=================================================================================================
121
122//*************************************************************************************************
125template< RelaxationFlag RF, typename MT, bool SO, bool DF >
126bool isDefault( const LowerMatrix<MT,SO,DF>& m );
127
128template< typename MT, bool SO, bool DF >
129bool isIntact( const LowerMatrix<MT,SO,DF>& m );
130
131template< typename MT, bool SO, bool DF >
132void swap( LowerMatrix<MT,SO,DF>& a, LowerMatrix<MT,SO,DF>& b ) noexcept;
134//*************************************************************************************************
135
136
137//*************************************************************************************************
165template< RelaxationFlag RF // Relaxation flag
166 , typename MT // Type of the adapted matrix
167 , bool SO // Storage order of the adapted matrix
168 , bool DF > // Density flag
169inline bool isDefault( const LowerMatrix<MT,SO,DF>& m )
170{
171 if( Size_v<MT,0UL> == DefaultSize_v )
172 return m.rows() == 0UL;
173 else return isStrictlyUpper<RF>( m );
174}
175//*************************************************************************************************
176
177
178//*************************************************************************************************
199template< typename MT // Type of the adapted matrix
200 , bool SO // Storage order of the adapted matrix
201 , bool DF > // Density flag
202inline bool isIntact( const LowerMatrix<MT,SO,DF>& m )
203{
204 return m.isIntact();
205}
206//*************************************************************************************************
207
208
209//*************************************************************************************************
217template< typename MT // Type of the adapted matrix
218 , bool SO // Storage order of the adapted matrix
219 , bool DF > // Density flag
221{
222 a.swap( b );
223}
224//*************************************************************************************************
225
226
227//*************************************************************************************************
250template< InversionFlag IF // Inversion algorithm
251 , typename MT // Type of the dense matrix
252 , bool SO > // Storage order of the dense matrix
253inline void invert( LowerMatrix<MT,SO,true>& m )
254{
256
257 if( IF == asUniUpper ) {
258 BLAZE_INTERNAL_ASSERT( isIdentity( m ), "Violation of preconditions detected" );
259 return;
260 }
261
262 constexpr InversionFlag flag( ( IF == byLU || IF == asGeneral || IF == asLower )
263 ? ( asLower )
264 : ( ( IF == asUniLower )
265 ?( asUniLower )
266 :( asDiagonal ) ) );
267
268 invert<flag>( derestrict( m ) );
269
270 BLAZE_INTERNAL_ASSERT( isIntact( m ), "Broken invariant detected" );
271}
273//*************************************************************************************************
274
275
276//*************************************************************************************************
295template< typename MT1, bool SO1, typename MT2, typename MT3, typename MT4, bool SO2 >
296inline void lu( const LowerMatrix<MT1,SO1,true>& A, DenseMatrix<MT2,SO1>& L,
297 DenseMatrix<MT3,SO1>& U, Matrix<MT4,SO2>& P )
298{
300
305
310
311 using ET3 = ElementType_t<MT3>;
312 using ET4 = ElementType_t<MT4>;
313
314 const size_t n( (*A).rows() );
315
316 decltype(auto) U2( derestrict( *U ) );
317
318 (*L) = A;
319
320 resize( *U, n, n );
321 reset( U2 );
322
323 resize( *P, n, n );
324 reset( *P );
325
326 for( size_t i=0UL; i<n; ++i ) {
327 U2(i,i) = ET3(1);
328 (*P)(i,i) = ET4(1);
329 }
330}
332//*************************************************************************************************
333
334
335//*************************************************************************************************
351template< typename MT // Type of the adapted matrix
352 , bool SO // Storage order of the adapted matrix
353 , bool DF // Density flag
354 , typename ET > // Type of the element
355inline bool trySet( const LowerMatrix<MT,SO,DF>& mat, size_t i, size_t j, const ET& value )
356{
357 BLAZE_INTERNAL_ASSERT( i < (*mat).rows(), "Invalid row access index" );
358 BLAZE_INTERNAL_ASSERT( j < (*mat).columns(), "Invalid column access index" );
359
360 MAYBE_UNUSED( mat );
361
362 return ( i >= j || isDefault( value ) );
363}
365//*************************************************************************************************
366
367
368//*************************************************************************************************
386template< typename MT // Type of the adapted matrix
387 , bool SO // Storage order of the adapted matrix
388 , bool DF // Density flag
389 , typename ET > // Type of the element
391 trySet( const LowerMatrix<MT,SO,DF>& mat, size_t row, size_t column, size_t m, size_t n, const ET& value )
392{
393 BLAZE_INTERNAL_ASSERT( row <= (*mat).rows(), "Invalid row access index" );
394 BLAZE_INTERNAL_ASSERT( column <= (*mat).columns(), "Invalid column access index" );
395 BLAZE_INTERNAL_ASSERT( row + m <= (*mat).rows(), "Invalid number of rows" );
396 BLAZE_INTERNAL_ASSERT( column + n <= (*mat).columns(), "Invalid number of columns" );
397
398 MAYBE_UNUSED( mat );
399
400 return ( m == 0UL ) ||
401 ( n == 0UL ) ||
402 ( row + 1UL >= column + n ) ||
403 isDefault( value );
404}
406//*************************************************************************************************
407
408
409//*************************************************************************************************
425template< typename MT // Type of the adapted matrix
426 , bool SO // Storage order of the adapted matrix
427 , bool DF // Density flag
428 , typename ET > // Type of the element
429inline bool tryAdd( const LowerMatrix<MT,SO,DF>& mat, size_t i, size_t j, const ET& value )
430{
431 return trySet( mat, i, j, value );
432}
434//*************************************************************************************************
435
436
437//*************************************************************************************************
455template< typename MT // Type of the adapted matrix
456 , bool SO // Storage order of the adapted matrix
457 , bool DF // Density flag
458 , typename ET > // Type of the element
460 tryAdd( const LowerMatrix<MT,SO,DF>& mat, size_t row, size_t column, size_t m, size_t n, const ET& value )
461{
462 return trySet( mat, row, column, m, n, value );
463}
465//*************************************************************************************************
466
467
468//*************************************************************************************************
484template< typename MT // Type of the adapted matrix
485 , bool SO // Storage order of the adapted matrix
486 , bool DF // Density flag
487 , typename ET > // Type of the element
488inline bool trySub( const LowerMatrix<MT,SO,DF>& mat, size_t i, size_t j, const ET& value )
489{
490 return trySet( mat, i, j, value );
491}
493//*************************************************************************************************
494
495
496//*************************************************************************************************
514template< typename MT // Type of the adapted matrix
515 , bool SO // Storage order of the adapted matrix
516 , bool DF // Density flag
517 , typename ET > // Type of the element
519 trySub( const LowerMatrix<MT,SO,DF>& mat, size_t row, size_t column, size_t m, size_t n, const ET& value )
520{
521 return trySet( mat, row, column, m, n, value );
522}
524//*************************************************************************************************
525
526
527//*************************************************************************************************
543template< typename MT // Type of the adapted matrix
544 , bool SO // Storage order of the adapted matrix
545 , bool DF // Density flag
546 , typename ET > // Type of the element
547inline bool tryBitor( const LowerMatrix<MT,SO,DF>& mat, size_t i, size_t j, const ET& value )
548{
549 return trySet( mat, i, j, value );
550}
552//*************************************************************************************************
553
554
555//*************************************************************************************************
573template< typename MT // Type of the adapted matrix
574 , bool SO // Storage order of the adapted matrix
575 , bool DF // Density flag
576 , typename ET > // Type of the element
578 tryBitor( const LowerMatrix<MT,SO,DF>& mat, size_t row, size_t column, size_t m, size_t n, const ET& value )
579{
580 return trySet( mat, row, column, m, n, value );
581}
583//*************************************************************************************************
584
585
586//*************************************************************************************************
602template< typename MT // Type of the adapted matrix
603 , bool SO // Storage order of the adapted matrix
604 , bool DF // Density flag
605 , typename ET > // Type of the element
606inline bool tryBitxor( const LowerMatrix<MT,SO,DF>& mat, size_t i, size_t j, const ET& value )
607{
608 return tryAdd( mat, i, j, value );
609}
611//*************************************************************************************************
612
613
614//*************************************************************************************************
632template< typename MT // Type of the adapted matrix
633 , bool SO // Storage order of the adapted matrix
634 , bool DF // Density flag
635 , typename ET > // Type of the element
637 tryBitxor( const LowerMatrix<MT,SO,DF>& mat, size_t row, size_t column, size_t m, size_t n, const ET& value )
638{
639 return tryAdd( mat, row, column, m, n, value );
640}
642//*************************************************************************************************
643
644
645//*************************************************************************************************
661template< typename MT // Type of the adapted matrix
662 , bool SO // Storage order of the adapted matrix
663 , bool DF // Density flag
664 , typename VT > // Type of the right-hand side dense vector
665inline bool tryAssign( const LowerMatrix<MT,SO,DF>& lhs,
666 const DenseVector<VT,false>& rhs, size_t row, size_t column )
667{
669
670 BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
671 BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
672 BLAZE_INTERNAL_ASSERT( row + (*rhs).size() <= lhs.rows(), "Invalid number of rows" );
673
674 MAYBE_UNUSED( lhs );
675
676 if( column <= row )
677 return true;
678
679 const size_t iend( min( column - row, (*rhs).size() ) );
680
681 for( size_t i=0UL; i<iend; ++i ) {
682 if( !isDefault( (*rhs)[i] ) )
683 return false;
684 }
685
686 return true;
687}
689//*************************************************************************************************
690
691
692//*************************************************************************************************
708template< typename MT // Type of the adapted matrix
709 , bool SO // Storage order of the adapted matrix
710 , bool DF // Density flag
711 , typename VT > // Type of the right-hand side dense vector
712inline bool tryAssign( const LowerMatrix<MT,SO,DF>& lhs,
713 const DenseVector<VT,true>& rhs, size_t row, size_t column )
714{
716
717 BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
718 BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
719 BLAZE_INTERNAL_ASSERT( column + (*rhs).size() <= lhs.columns(), "Invalid number of columns" );
720
721 MAYBE_UNUSED( lhs );
722
723 const size_t ibegin( ( row < column )?( 0UL ):( row - column + 1UL ) );
724
725 for( size_t i=ibegin; i<(*rhs).size(); ++i ) {
726 if( !isDefault( (*rhs)[i] ) )
727 return false;
728 }
729
730 return true;
731}
733//*************************************************************************************************
734
735
736//*************************************************************************************************
754template< typename MT // Type of the adapted matrix
755 , bool SO // Storage order of the adapted matrix
756 , bool DF // Density flag
757 , typename VT // Type of the right-hand side dense vector
758 , bool TF > // Transpose flag of the right-hand side dense vector
759inline bool tryAssign( const LowerMatrix<MT,SO,DF>& lhs, const DenseVector<VT,TF>& rhs,
760 ptrdiff_t band, size_t row, size_t column )
761{
763
764 BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
765 BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
766 BLAZE_INTERNAL_ASSERT( row + (*rhs).size() <= lhs.rows(), "Invalid number of rows" );
767 BLAZE_INTERNAL_ASSERT( column + (*rhs).size() <= lhs.columns(), "Invalid number of columns" );
768
769 MAYBE_UNUSED( lhs, row, column );
770
771 if( band > 0L ) {
772 for( size_t i=0UL; i<(*rhs).size(); ++i ) {
773 if( !isDefault( (*rhs)[i] ) )
774 return false;
775 }
776 }
777
778 return true;
779}
781//*************************************************************************************************
782
783
784//*************************************************************************************************
800template< typename MT // Type of the adapted matrix
801 , bool SO // Storage order of the adapted matrix
802 , bool DF // Density flag
803 , typename VT > // Type of the right-hand side sparse vector
804inline bool tryAssign( const LowerMatrix<MT,SO,DF>& lhs,
805 const SparseVector<VT,false>& rhs, size_t row, size_t column )
806{
808
809 BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
810 BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
811 BLAZE_INTERNAL_ASSERT( row + (*rhs).size() <= lhs.rows(), "Invalid number of rows" );
812
813 MAYBE_UNUSED( lhs );
814
815 if( column <= row )
816 return true;
817
818 const auto last( (*rhs).lowerBound( column - row ) );
819
820 for( auto element=(*rhs).begin(); element!=last; ++element ) {
821 if( !isDefault( element->value() ) )
822 return false;
823 }
824
825 return true;
826}
828//*************************************************************************************************
829
830
831//*************************************************************************************************
847template< typename MT // Type of the adapted matrix
848 , bool SO // Storage order of the adapted matrix
849 , bool DF // Density flag
850 , typename VT > // Type of the right-hand side sparse vector
851inline bool tryAssign( const LowerMatrix<MT,SO,DF>& lhs,
852 const SparseVector<VT,true>& rhs, size_t row, size_t column )
853{
855
856 BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
857 BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
858 BLAZE_INTERNAL_ASSERT( column + (*rhs).size() <= lhs.columns(), "Invalid number of columns" );
859
860 MAYBE_UNUSED( lhs );
861
862 const auto last( (*rhs).end() );
863 auto element( (*rhs).lowerBound( ( row < column )?( 0UL ):( row - column + 1UL ) ) );
864
865 for( ; element!=last; ++element ) {
866 if( !isDefault( element->value() ) )
867 return false;
868 }
869
870 return true;
871}
873//*************************************************************************************************
874
875
876//*************************************************************************************************
894template< typename MT // Type of the adapted matrix
895 , bool SO // Storage order of the adapted matrix
896 , bool DF // Density flag
897 , typename VT // Type of the right-hand side sparse vector
898 , bool TF > // Transpose flag of the right-hand side sparse vector
899inline bool tryAssign( const LowerMatrix<MT,SO,DF>& lhs, const SparseVector<VT,TF>& rhs,
900 ptrdiff_t band, size_t row, size_t column )
901{
903
904 BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
905 BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
906 BLAZE_INTERNAL_ASSERT( row + (*rhs).size() <= lhs.rows(), "Invalid number of rows" );
907 BLAZE_INTERNAL_ASSERT( column + (*rhs).size() <= lhs.columns(), "Invalid number of columns" );
908
909 MAYBE_UNUSED( lhs, row, column );
910
911 if( band > 0L ) {
912 for( const auto& element : *rhs ) {
913 if( !isDefault( element.value() ) )
914 return false;
915 }
916 }
917
918 return true;
919}
921//*************************************************************************************************
922
923
924//*************************************************************************************************
940template< typename MT1 // Type of the adapted matrix
941 , bool SO // Storage order of the adapted matrix
942 , bool DF // Density flag
943 , typename MT2 > // Type of the right-hand side dense matrix
944inline bool tryAssign( const LowerMatrix<MT1,SO,DF>& lhs,
945 const DenseMatrix<MT2,false>& rhs, size_t row, size_t column )
946{
948
949 BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
950 BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
951 BLAZE_INTERNAL_ASSERT( row + (*rhs).rows() <= lhs.rows(), "Invalid number of rows" );
952 BLAZE_INTERNAL_ASSERT( column + (*rhs).columns() <= lhs.columns(), "Invalid number of columns" );
953
954 MAYBE_UNUSED( lhs );
955
956 const size_t M( (*rhs).rows() );
957 const size_t N( (*rhs).columns() );
958
959 if( row + 1UL >= column + N )
960 return true;
961
962 const size_t iend( min( column + N - row - 1UL, M ) );
963
964 for( size_t i=0UL; i<iend; ++i )
965 {
966 const bool containsDiagonal( row + i >= column );
967 const size_t jbegin( ( containsDiagonal )?( row + i - column + 1UL ):( 0UL ) );
968
969 for( size_t j=jbegin; j<N; ++j ) {
970 if( !isDefault( (*rhs)(i,j) ) )
971 return false;
972 }
973 }
974
975 return true;
976}
978//*************************************************************************************************
979
980
981//*************************************************************************************************
997template< typename MT1 // Type of the adapted matrix
998 , bool SO // Storage order of the adapted matrix
999 , bool DF // Density flag
1000 , typename MT2 > // Type of the right-hand side dense matrix
1001inline bool tryAssign( const LowerMatrix<MT1,SO,DF>& lhs,
1002 const DenseMatrix<MT2,true>& rhs, size_t row, size_t column )
1003{
1005
1006 BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1007 BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1008 BLAZE_INTERNAL_ASSERT( row + (*rhs).rows() <= lhs.rows(), "Invalid number of rows" );
1009 BLAZE_INTERNAL_ASSERT( column + (*rhs).columns() <= lhs.columns(), "Invalid number of columns" );
1010
1011 MAYBE_UNUSED( lhs );
1012
1013 const size_t M( (*rhs).rows() );
1014 const size_t N( (*rhs).columns() );
1015
1016 if( row + 1UL >= column + N )
1017 return true;
1018
1019 const size_t jbegin( ( row < column )?( 0UL ):( row - column + 1UL ) );
1020
1021 for( size_t j=jbegin; j<N; ++j )
1022 {
1023 const size_t iend( min( column + j - row, M ) );
1024
1025 for( size_t i=0UL; i<iend; ++i ) {
1026 if( !isDefault( (*rhs)(i,j) ) )
1027 return false;
1028 }
1029 }
1030
1031 return true;
1032}
1034//*************************************************************************************************
1035
1036
1037//*************************************************************************************************
1053template< typename MT1 // Type of the adapted matrix
1054 , bool SO // Storage order of the adapted matrix
1055 , bool DF // Density flag
1056 , typename MT2 > // Type of the right-hand side sparse matrix
1057inline bool tryAssign( const LowerMatrix<MT1,SO,DF>& lhs,
1058 const SparseMatrix<MT2,false>& 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( row + (*rhs).rows() <= lhs.rows(), "Invalid number of rows" );
1065 BLAZE_INTERNAL_ASSERT( column + (*rhs).columns() <= lhs.columns(), "Invalid number of columns" );
1066
1067 MAYBE_UNUSED( lhs );
1068
1069 const size_t M( (*rhs).rows() );
1070 const size_t N( (*rhs).columns() );
1071
1072 if( row + 1UL >= column + N )
1073 return true;
1074
1075 const size_t iend( min( column + N - row - 1UL, M ) );
1076
1077 for( size_t i=0UL; i<iend; ++i )
1078 {
1079 const bool containsDiagonal( row + i >= column );
1080 const size_t index( ( containsDiagonal )?( row + i - column + 1UL ):( 0UL ) );
1081
1082 const auto last( (*rhs).end(i) );
1083 auto element( (*rhs).lowerBound( i, index ) );
1084
1085 for( ; element!=last; ++element ) {
1086 if( !isDefault( element->value() ) )
1087 return false;
1088 }
1089 }
1090
1091 return true;
1092}
1094//*************************************************************************************************
1095
1096
1097//*************************************************************************************************
1113template< typename MT1 // Type of the adapted matrix
1114 , bool SO // Storage order of the adapted matrix
1115 , bool DF // Density flag
1116 , typename MT2 > // Type of the right-hand side sparse matrix
1117inline bool tryAssign( const LowerMatrix<MT1,SO,DF>& lhs,
1118 const SparseMatrix<MT2,true>& rhs, size_t row, size_t column )
1119{
1121
1122 BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1123 BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1124 BLAZE_INTERNAL_ASSERT( row + (*rhs).rows() <= lhs.rows(), "Invalid number of rows" );
1125 BLAZE_INTERNAL_ASSERT( column + (*rhs).columns() <= lhs.columns(), "Invalid number of columns" );
1126
1127 MAYBE_UNUSED( lhs );
1128
1129 const size_t M( (*rhs).rows() );
1130 const size_t N( (*rhs).columns() );
1131
1132 if( row + 1UL >= column + N )
1133 return true;
1134
1135 const size_t jbegin( ( row < column )?( 0UL ):( row - column + 1UL ) );
1136
1137 for( size_t j=jbegin; j<N; ++j )
1138 {
1139 const size_t index( column + j - row );
1140 const auto last( (*rhs).lowerBound( min( index, M ), j ) );
1141
1142 for( auto element=(*rhs).begin(j); element!=last; ++element ) {
1143 if( !isDefault( element->value() ) )
1144 return false;
1145 }
1146 }
1147
1148 return true;
1149}
1151//*************************************************************************************************
1152
1153
1154//*************************************************************************************************
1170template< typename MT // Type of the adapted matrix
1171 , bool SO // Storage order of the adapted matrix
1172 , bool DF // Density flag
1173 , typename VT // Type of the right-hand side vector
1174 , bool TF > // Transpose flag of the right-hand side vector
1175inline bool tryAddAssign( const LowerMatrix<MT,SO,DF>& lhs,
1176 const Vector<VT,TF>& rhs, size_t row, size_t column )
1177{
1178 return tryAssign( lhs, *rhs, row, column );
1179}
1181//*************************************************************************************************
1182
1183
1184//*************************************************************************************************
1202template< typename MT // Type of the adapted matrix
1203 , bool SO // Storage order of the adapted matrix
1204 , bool DF // Density flag
1205 , typename VT // Type of the right-hand side vector
1206 , bool TF > // Transpose flag of the right-hand side vector
1207inline bool tryAddAssign( const LowerMatrix<MT,SO,DF>& lhs, const Vector<VT,TF>& rhs,
1208 ptrdiff_t band, size_t row, size_t column )
1209{
1210 return tryAssign( lhs, *rhs, band, row, column );
1211}
1213//*************************************************************************************************
1214
1215
1216//*************************************************************************************************
1232template< typename MT1 // Type of the adapted matrix
1233 , bool SO1 // Storage order of the adapted matrix
1234 , bool DF // Density flag
1235 , typename MT2 // Type of the right-hand side matrix
1236 , bool SO2 > // Storage order of the right-hand side matrix
1237inline bool tryAddAssign( const LowerMatrix<MT1,SO1,DF>& lhs,
1238 const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
1239{
1240 return tryAssign( lhs, *rhs, row, column );
1241}
1243//*************************************************************************************************
1244
1245
1246//*************************************************************************************************
1262template< typename MT // Type of the adapted matrix
1263 , bool SO // Storage order of the adapted matrix
1264 , bool DF // Density flag
1265 , typename VT // Type of the right-hand side vector
1266 , bool TF > // Transpose flag of the right-hand side vector
1267inline bool trySubAssign( const LowerMatrix<MT,SO,DF>& lhs,
1268 const Vector<VT,TF>& rhs, size_t row, size_t column )
1269{
1270 return tryAssign( lhs, *rhs, row, column );
1271}
1273//*************************************************************************************************
1274
1275
1276//*************************************************************************************************
1294template< typename MT // Type of the adapted matrix
1295 , bool SO // Storage order of the adapted matrix
1296 , bool DF // Density flag
1297 , typename VT // Type of the right-hand side vector
1298 , bool TF > // Transpose flag of the right-hand side vector
1299inline bool trySubAssign( const LowerMatrix<MT,SO,DF>& lhs, const Vector<VT,TF>& rhs,
1300 ptrdiff_t band, size_t row, size_t column )
1301{
1302 return tryAssign( lhs, *rhs, band, row, column );
1303}
1305//*************************************************************************************************
1306
1307
1308//*************************************************************************************************
1324template< typename MT1 // Type of the adapted matrix
1325 , bool SO1 // Storage order of the adapted matrix
1326 , bool DF // Density flag
1327 , typename MT2 // Type of the right-hand side matrix
1328 , bool SO2 > // Storage order of the right-hand side matrix
1329inline bool trySubAssign( const LowerMatrix<MT1,SO1,DF>& lhs,
1330 const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
1331{
1332 return tryAssign( lhs, *rhs, row, column );
1333}
1335//*************************************************************************************************
1336
1337
1338//*************************************************************************************************
1355template< typename MT // Type of the adapted matrix
1356 , bool SO // Storage order of the adapted matrix
1357 , bool DF // Density flag
1358 , typename VT // Type of the right-hand side vector
1359 , bool TF > // Transpose flag of the right-hand side vector
1360inline bool tryBitorAssign( const LowerMatrix<MT,SO,DF>& lhs,
1361 const Vector<VT,TF>& rhs, size_t row, size_t column )
1362{
1363 return tryAssign( lhs, *rhs, row, column );
1364}
1366//*************************************************************************************************
1367
1368
1369//*************************************************************************************************
1386template< typename MT // Type of the adapted matrix
1387 , bool SO // Storage order of the adapted matrix
1388 , bool DF // Density flag
1389 , typename VT // Type of the right-hand side vector
1390 , bool TF > // Transpose flag of the right-hand side vector
1391inline bool tryBitorAssign( const LowerMatrix<MT,SO,DF>& lhs, const Vector<VT,TF>& rhs,
1392 ptrdiff_t band, size_t row, size_t column )
1393{
1394 return tryAssign( lhs, *rhs, band, row, column );
1395}
1397//*************************************************************************************************
1398
1399
1400//*************************************************************************************************
1416template< typename MT1 // Type of the adapted matrix
1417 , bool SO1 // Storage order of the adapted matrix
1418 , bool DF // Density flag
1419 , typename MT2 // Type of the right-hand side matrix
1420 , bool SO2 > // Storage order of the right-hand side matrix
1421inline bool tryBitorAssign( const LowerMatrix<MT1,SO1,DF>& lhs,
1422 const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
1423{
1424 return tryAssign( lhs, *rhs, row, column );
1425}
1427//*************************************************************************************************
1428
1429
1430//*************************************************************************************************
1447template< typename MT // Type of the adapted matrix
1448 , bool SO // Storage order of the adapted matrix
1449 , bool DF // Density flag
1450 , typename VT // Type of the right-hand side vector
1451 , bool TF > // Transpose flag of the right-hand side vector
1452inline bool tryBitxorAssign( const LowerMatrix<MT,SO,DF>& lhs,
1453 const Vector<VT,TF>& rhs, size_t row, size_t column )
1454{
1455 return tryAssign( lhs, *rhs, row, column );
1456}
1458//*************************************************************************************************
1459
1460
1461//*************************************************************************************************
1478template< typename MT // Type of the adapted matrix
1479 , bool SO // Storage order of the adapted matrix
1480 , bool DF // Density flag
1481 , typename VT // Type of the right-hand side vector
1482 , bool TF > // Transpose flag of the right-hand side vector
1483inline bool tryBitxorAssign( const LowerMatrix<MT,SO,DF>& lhs, const Vector<VT,TF>& rhs,
1484 ptrdiff_t band, size_t row, size_t column )
1485{
1486 return tryAssign( lhs, *rhs, band, row, column );
1487}
1489//*************************************************************************************************
1490
1491
1492//*************************************************************************************************
1508template< typename MT1 // Type of the adapted matrix
1509 , bool SO1 // Storage order of the adapted matrix
1510 , bool DF // Density flag
1511 , typename MT2 // Type of the right-hand side matrix
1512 , bool SO2 > // Storage order of the right-hand side matrix
1513inline bool tryBitxorAssign( const LowerMatrix<MT1,SO1,DF>& lhs,
1514 const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
1515{
1516 return tryAssign( lhs, *rhs, row, column );
1517}
1519//*************************************************************************************************
1520
1521
1522//*************************************************************************************************
1536template< typename MT // Type of the adapted matrix
1537 , bool SO // Storage order of the adapted matrix
1538 , bool DF > // Density flag
1539inline MT& derestrict( LowerMatrix<MT,SO,DF>& m )
1540{
1541 return m.matrix_;
1542}
1544//*************************************************************************************************
1545
1546
1547
1548
1549//=================================================================================================
1550//
1551// SIZE SPECIALIZATIONS
1552//
1553//=================================================================================================
1554
1555//*************************************************************************************************
1557template< typename MT, bool SO, bool DF >
1558struct Size< LowerMatrix<MT,SO,DF>, 0UL >
1559 : public Size<MT,0UL>
1560{};
1561
1562template< typename MT, bool SO, bool DF >
1563struct Size< LowerMatrix<MT,SO,DF>, 1UL >
1564 : public Size<MT,1UL>
1565{};
1567//*************************************************************************************************
1568
1569
1570
1571
1572//=================================================================================================
1573//
1574// MAXSIZE SPECIALIZATIONS
1575//
1576//=================================================================================================
1577
1578//*************************************************************************************************
1580template< typename MT, bool SO, bool DF >
1581struct MaxSize< LowerMatrix<MT,SO,DF>, 0UL >
1582 : public MaxSize<MT,0UL>
1583{};
1584
1585template< typename MT, bool SO, bool DF >
1586struct MaxSize< LowerMatrix<MT,SO,DF>, 1UL >
1587 : public MaxSize<MT,1UL>
1588{};
1590//*************************************************************************************************
1591
1592
1593
1594
1595//=================================================================================================
1596//
1597// ISSQUARE SPECIALIZATIONS
1598//
1599//=================================================================================================
1600
1601//*************************************************************************************************
1603template< typename MT, bool SO, bool DF >
1604struct IsSquare< LowerMatrix<MT,SO,DF> >
1605 : public TrueType
1606{};
1608//*************************************************************************************************
1609
1610
1611
1612
1613//=================================================================================================
1614//
1615// ISUNIFORM SPECIALIZATIONS
1616//
1617//=================================================================================================
1618
1619//*************************************************************************************************
1621template< typename MT, bool SO, bool DF >
1622struct IsUniform< LowerMatrix<MT,SO,DF> >
1623 : public IsUniform<MT>
1624{};
1626//*************************************************************************************************
1627
1628
1629
1630
1631//=================================================================================================
1632//
1633// ISSYMMETRIC SPECIALIZATIONS
1634//
1635//=================================================================================================
1636
1637//*************************************************************************************************
1639template< typename MT, bool SO, bool DF >
1640struct IsSymmetric< LowerMatrix<MT,SO,DF> >
1641 : public IsZero<MT>
1642{};
1644//*************************************************************************************************
1645
1646
1647
1648
1649//=================================================================================================
1650//
1651// ISHERMITIAN SPECIALIZATIONS
1652//
1653//=================================================================================================
1654
1655//*************************************************************************************************
1657template< typename MT, bool SO, bool DF >
1658struct IsHermitian< LowerMatrix<MT,SO,DF> >
1659 : public IsZero<MT>
1660{};
1662//*************************************************************************************************
1663
1664
1665
1666
1667//=================================================================================================
1668//
1669// ISLOWER SPECIALIZATIONS
1670//
1671//=================================================================================================
1672
1673//*************************************************************************************************
1675template< typename MT, bool SO, bool DF >
1676struct IsLower< LowerMatrix<MT,SO,DF> >
1677 : public TrueType
1678{};
1680//*************************************************************************************************
1681
1682
1683
1684
1685//=================================================================================================
1686//
1687// ISSTRICTLYLOWER SPECIALIZATIONS
1688//
1689//=================================================================================================
1690
1691//*************************************************************************************************
1693template< typename MT, bool SO, bool DF >
1694struct IsStrictlyLower< LowerMatrix<MT,SO,DF> >
1695 : public IsZero<MT>
1696{};
1698//*************************************************************************************************
1699
1700
1701
1702
1703//=================================================================================================
1704//
1705// ISSTRICTLYUPPER SPECIALIZATIONS
1706//
1707//=================================================================================================
1708
1709//*************************************************************************************************
1711template< typename MT, bool SO, bool DF >
1712struct IsStrictlyUpper< LowerMatrix<MT,SO,DF> >
1713 : public IsZero<MT>
1714{};
1716//*************************************************************************************************
1717
1718
1719
1720
1721//=================================================================================================
1722//
1723// ISADAPTOR SPECIALIZATIONS
1724//
1725//=================================================================================================
1726
1727//*************************************************************************************************
1729template< typename MT, bool SO, bool DF >
1730struct IsAdaptor< LowerMatrix<MT,SO,DF> >
1731 : public TrueType
1732{};
1734//*************************************************************************************************
1735
1736
1737
1738
1739//=================================================================================================
1740//
1741// ISRESTRICTED SPECIALIZATIONS
1742//
1743//=================================================================================================
1744
1745//*************************************************************************************************
1747template< typename MT, bool SO, bool DF >
1748struct IsRestricted< LowerMatrix<MT,SO,DF> >
1749 : public TrueType
1750{};
1752//*************************************************************************************************
1753
1754
1755
1756
1757//=================================================================================================
1758//
1759// HASCONSTDATAACCESS SPECIALIZATIONS
1760//
1761//=================================================================================================
1762
1763//*************************************************************************************************
1765template< typename MT, bool SO >
1766struct HasConstDataAccess< LowerMatrix<MT,SO,true> >
1767 : public TrueType
1768{};
1770//*************************************************************************************************
1771
1772
1773
1774
1775//=================================================================================================
1776//
1777// ISALIGNED SPECIALIZATIONS
1778//
1779//=================================================================================================
1780
1781//*************************************************************************************************
1783template< typename MT, bool SO, bool DF >
1784struct IsAligned< LowerMatrix<MT,SO,DF> >
1785 : public IsAligned<MT>
1786{};
1788//*************************************************************************************************
1789
1790
1791
1792
1793//=================================================================================================
1794//
1795// ISCONTIGUOUS SPECIALIZATIONS
1796//
1797//=================================================================================================
1798
1799//*************************************************************************************************
1801template< typename MT, bool SO, bool DF >
1802struct IsContiguous< LowerMatrix<MT,SO,DF> >
1803 : public IsContiguous<MT>
1804{};
1806//*************************************************************************************************
1807
1808
1809
1810
1811//=================================================================================================
1812//
1813// ISPADDED SPECIALIZATIONS
1814//
1815//=================================================================================================
1816
1817//*************************************************************************************************
1819template< typename MT, bool SO, bool DF >
1820struct IsPadded< LowerMatrix<MT,SO,DF> >
1821 : public IsPadded<MT>
1822{};
1824//*************************************************************************************************
1825
1826
1827
1828
1829//=================================================================================================
1830//
1831// REMOVEADAPTOR SPECIALIZATIONS
1832//
1833//=================================================================================================
1834
1835//*************************************************************************************************
1837template< typename MT, bool SO, bool DF >
1838struct RemoveAdaptor< LowerMatrix<MT,SO,DF> >
1839{
1840 using Type = MT;
1841};
1843//*************************************************************************************************
1844
1845
1846
1847
1848//=================================================================================================
1849//
1850// ADDTRAIT SPECIALIZATIONS
1851//
1852//=================================================================================================
1853
1854//*************************************************************************************************
1856template< typename T1, typename T2 >
1857struct AddTraitEval1< T1, T2
1858 , EnableIf_t< IsMatrix_v<T1> &&
1859 IsMatrix_v<T2> &&
1860 ( ( IsLower_v<T1> && IsLower_v<T2> ) ||
1861 ( IsLower_v<T1> && IsDiagonal_v<T2> ) ||
1862 ( IsDiagonal_v<T1> && IsLower_v<T2> ) ) &&
1863 !( IsUniLower_v<T1> && IsStrictlyLower_v<T2> ) &&
1864 !( IsStrictlyLower_v<T1> && ( IsUniLower_v<T2> || IsStrictlyLower_v<T2> ) ) &&
1865 !( IsDiagonal_v<T1> && IsDiagonal_v<T2> ) &&
1866 !( IsUniform_v<T1> && IsUniform_v<T2> ) &&
1867 !( IsZero_v<T1> || IsZero_v<T2> ) > >
1868{
1869 using Type = LowerMatrix< typename AddTraitEval2<T1,T2>::Type >;
1870};
1872//*************************************************************************************************
1873
1874
1875
1876
1877//=================================================================================================
1878//
1879// SUBTRAIT SPECIALIZATIONS
1880//
1881//=================================================================================================
1882
1883//*************************************************************************************************
1885template< typename T1, typename T2 >
1886struct SubTraitEval1< T1, T2
1887 , EnableIf_t< IsMatrix_v<T1> &&
1888 IsMatrix_v<T2> &&
1889 ( ( IsLower_v<T1> && IsLower_v<T2> ) ||
1890 ( IsLower_v<T1> && IsDiagonal_v<T2> ) ||
1891 ( IsDiagonal_v<T1> && IsLower_v<T2> ) ) &&
1892 !( IsUniLower_v<T1> && IsStrictlyLower_v<T2> ) &&
1893 !( IsUniLower_v<T1> && IsUniLower_v<T2> ) &&
1894 !( IsStrictlyLower_v<T1> && IsStrictlyLower_v<T2> ) &&
1895 !( IsDiagonal_v<T1> && IsDiagonal_v<T2> ) &&
1896 !( IsZero_v<T1> || IsZero_v<T2> ) > >
1897{
1898 using Type = LowerMatrix< typename SubTraitEval2<T1,T2>::Type >;
1899};
1901//*************************************************************************************************
1902
1903
1904
1905
1906//=================================================================================================
1907//
1908// SCHURTRAIT SPECIALIZATIONS
1909//
1910//=================================================================================================
1911
1912//*************************************************************************************************
1914template< typename T1, typename T2 >
1915struct SchurTraitEval1< T1, T2
1916 , EnableIf_t< IsMatrix_v<T1> &&
1917 IsMatrix_v<T2> &&
1918 ( ( IsLower_v<T1> && !IsUpper_v<T2> ) ||
1919 ( !IsUpper_v<T1> && IsLower_v<T2> ) ) &&
1920 !( IsUniLower_v<T1> && IsUniLower_v<T2> ) &&
1921 !( IsStrictlyLower_v<T1> || IsStrictlyLower_v<T2> ) &&
1922 !( IsDiagonal_v<T1> || IsDiagonal_v<T2> ) &&
1923 !( IsZero_v<T1> || IsZero_v<T2> ) > >
1924{
1925 using Type = LowerMatrix< typename SchurTraitEval2<T1,T2>::Type >;
1926};
1928//*************************************************************************************************
1929
1930
1931
1932
1933//=================================================================================================
1934//
1935// MULTTRAIT SPECIALIZATIONS
1936//
1937//=================================================================================================
1938
1939//*************************************************************************************************
1941template< typename T1, typename T2 >
1942struct MultTraitEval1< T1, T2
1943 , EnableIf_t< IsMatrix_v<T1> &&
1944 IsScalar_v<T2> &&
1945 ( IsLower_v<T1> && !IsStrictlyLower_v<T1> &&
1946 !IsDiagonal_v<T1> && !IsUniform_v<T1> ) > >
1947{
1948 using Type = LowerMatrix< typename MultTraitEval2<T1,T2>::Type >;
1949};
1950
1951template< typename T1, typename T2 >
1952struct MultTraitEval1< T1, T2
1953 , EnableIf_t< IsScalar_v<T1> &&
1954 IsMatrix_v<T2> &&
1955 ( IsLower_v<T2> && !IsStrictlyLower_v<T2> &&
1956 !IsDiagonal_v<T2> && !IsUniform_v<T2> ) > >
1957{
1958 using Type = LowerMatrix< typename MultTraitEval2<T1,T2>::Type >;
1959};
1960
1961template< typename T1, typename T2 >
1962struct MultTraitEval1< T1, T2
1963 , EnableIf_t< IsMatrix_v<T1> &&
1964 IsMatrix_v<T2> &&
1965 ( IsLower_v<T1> && IsLower_v<T2> ) &&
1966 !( IsUniLower_v<T1> && IsUniLower_v<T2> ) &&
1967 !( IsStrictlyLower_v<T1> && IsLower_v<T2> ) &&
1968 !( IsLower_v<T1> && IsStrictlyLower_v<T2> ) &&
1969 !( IsDiagonal_v<T1> && IsDiagonal_v<T2> ) &&
1970 !( IsIdentity_v<T1> || IsIdentity_v<T2> ) &&
1971 !( IsZero_v<T1> || IsZero_v<T2> ) > >
1972{
1973 using Type = LowerMatrix< typename MultTraitEval2<T1,T2>::Type >;
1974};
1976//*************************************************************************************************
1977
1978
1979
1980
1981//=================================================================================================
1982//
1983// KRONTRAIT SPECIALIZATIONS
1984//
1985//=================================================================================================
1986
1987//*************************************************************************************************
1989template< typename T1, typename T2 >
1990struct KronTraitEval1< T1, T2
1991 , EnableIf_t< IsMatrix_v<T1> &&
1992 IsMatrix_v<T2> &&
1993 ( IsLower_v<T1> && IsLower_v<T2> ) &&
1994 !( IsUniLower_v<T1> && IsUniLower_v<T2> ) &&
1995 !( IsStrictlyLower_v<T1> || IsStrictlyLower_v<T2> ) &&
1996 !( IsDiagonal_v<T1> && IsDiagonal_v<T2> ) &&
1997 !( IsZero_v<T1> || IsZero_v<T2> ) > >
1998{
1999 using Type = LowerMatrix< typename KronTraitEval2<T1,T2>::Type >;
2000};
2002//*************************************************************************************************
2003
2004
2005
2006
2007//=================================================================================================
2008//
2009// DIVTRAIT SPECIALIZATIONS
2010//
2011//=================================================================================================
2012
2013//*************************************************************************************************
2015template< typename T1, typename T2 >
2016struct DivTraitEval1< T1, T2
2017 , EnableIf_t< IsLower_v<T1> &&
2018 !IsStrictlyLower_v<T1> &&
2019 !IsDiagonal_v<T1> &&
2020 IsScalar_v<T2> > >
2021{
2022 using Type = LowerMatrix< typename DivTraitEval2<T1,T2>::Type >;
2023};
2025//*************************************************************************************************
2026
2027
2028
2029
2030//=================================================================================================
2031//
2032// MAPTRAIT SPECIALIZATIONS
2033//
2034//=================================================================================================
2035
2036//*************************************************************************************************
2038template< typename T, typename OP >
2039struct UnaryMapTraitEval1< T, OP
2040 , EnableIf_t< YieldsLower_v<OP,T> &&
2041 !YieldsUniLower_v<OP,T> &&
2042 !YieldsStrictlyLower_v<OP,T> &&
2043 !YieldsDiagonal_v<OP,T> > >
2044{
2045 using Type = LowerMatrix< typename UnaryMapTraitEval2<T,OP>::Type, StorageOrder_v<T> >;
2046};
2048//*************************************************************************************************
2049
2050
2051//*************************************************************************************************
2053template< typename T1, typename T2, typename OP >
2054struct BinaryMapTraitEval1< T1, T2, OP
2055 , EnableIf_t< YieldsLower_v<OP,T1,T2> &&
2056 !YieldsUniLower_v<OP,T1,T2> &&
2057 !YieldsStrictlyLower_v<OP,T1,T2> &&
2058 !YieldsDiagonal_v<OP,T1,T2> > >
2059{
2060 using Type = LowerMatrix< typename BinaryMapTraitEval2<T1,T2,OP>::Type >;
2061};
2063//*************************************************************************************************
2064
2065
2066
2067
2068//=================================================================================================
2069//
2070// DECLSYMTRAIT SPECIALIZATIONS
2071//
2072//=================================================================================================
2073
2074//*************************************************************************************************
2076template< typename MT, bool SO, bool DF >
2077struct DeclSymTrait< LowerMatrix<MT,SO,DF> >
2078{
2079 using Type = DiagonalMatrix<MT,SO,DF>;
2080};
2082//*************************************************************************************************
2083
2084
2085
2086
2087//=================================================================================================
2088//
2089// DECLHERMTRAIT SPECIALIZATIONS
2090//
2091//=================================================================================================
2092
2093//*************************************************************************************************
2095template< typename MT, bool SO, bool DF >
2096struct DeclHermTrait< LowerMatrix<MT,SO,DF> >
2097{
2098 using Type = HermitianMatrix<MT,SO,DF>;
2099};
2101//*************************************************************************************************
2102
2103
2104
2105
2106//=================================================================================================
2107//
2108// DECLLOWTRAIT SPECIALIZATIONS
2109//
2110//=================================================================================================
2111
2112//*************************************************************************************************
2114template< typename MT, bool SO, bool DF >
2115struct DeclLowTrait< LowerMatrix<MT,SO,DF> >
2116{
2117 using Type = LowerMatrix<MT,SO,DF>;
2118};
2120//*************************************************************************************************
2121
2122
2123
2124
2125//=================================================================================================
2126//
2127// DECLUNILOWTRAIT SPECIALIZATIONS
2128//
2129//=================================================================================================
2130
2131//*************************************************************************************************
2133template< typename MT, bool SO, bool DF >
2134struct DeclUniLowTrait< LowerMatrix<MT,SO,DF> >
2135{
2136 using Type = UniLowerMatrix<MT,SO,DF>;
2137};
2139//*************************************************************************************************
2140
2141
2142
2143
2144//=================================================================================================
2145//
2146// DECLSTRLOWTRAIT SPECIALIZATIONS
2147//
2148//=================================================================================================
2149
2150//*************************************************************************************************
2152template< typename MT, bool SO, bool DF >
2153struct DeclStrLowTrait< LowerMatrix<MT,SO,DF> >
2154{
2155 using Type = StrictlyLowerMatrix<MT,SO,DF>;
2156};
2158//*************************************************************************************************
2159
2160
2161
2162
2163//=================================================================================================
2164//
2165// DECLUPPTRAIT SPECIALIZATIONS
2166//
2167//=================================================================================================
2168
2169//*************************************************************************************************
2171template< typename MT, bool SO, bool DF >
2172struct DeclUppTrait< LowerMatrix<MT,SO,DF> >
2173{
2174 using Type = DiagonalMatrix<MT,SO,DF>;
2175};
2177//*************************************************************************************************
2178
2179
2180
2181
2182//=================================================================================================
2183//
2184// DECLUNIUPPTRAIT SPECIALIZATIONS
2185//
2186//=================================================================================================
2187
2188//*************************************************************************************************
2190template< typename MT, bool SO, bool DF >
2191struct DeclUniUppTrait< LowerMatrix<MT,SO,DF> >
2192{
2193 using Type = IdentityMatrix< ElementType_t<MT>, SO >;
2194};
2196//*************************************************************************************************
2197
2198
2199
2200
2201//=================================================================================================
2202//
2203// DECLSTRUPPTRAIT SPECIALIZATIONS
2204//
2205//=================================================================================================
2206
2207//*************************************************************************************************
2209template< typename MT, bool SO, bool DF >
2210struct DeclStrUppTrait< LowerMatrix<MT,SO,DF> >
2211{
2212 using Type = ZeroMatrix< ElementType_t<MT>, SO >;
2213};
2215//*************************************************************************************************
2216
2217
2218
2219
2220//=================================================================================================
2221//
2222// DECLDIAGTRAIT SPECIALIZATIONS
2223//
2224//=================================================================================================
2225
2226//*************************************************************************************************
2228template< typename MT, bool SO, bool DF >
2229struct DeclDiagTrait< LowerMatrix<MT,SO,DF> >
2230{
2231 using Type = DiagonalMatrix<MT,SO,DF>;
2232};
2234//*************************************************************************************************
2235
2236
2237
2238
2239//=================================================================================================
2240//
2241// HIGHTYPE SPECIALIZATIONS
2242//
2243//=================================================================================================
2244
2245//*************************************************************************************************
2247template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2248struct HighType< LowerMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
2249{
2250 using Type = LowerMatrix< typename HighType<MT1,MT2>::Type >;
2251};
2253//*************************************************************************************************
2254
2255
2256
2257
2258//=================================================================================================
2259//
2260// LOWTYPE SPECIALIZATIONS
2261//
2262//=================================================================================================
2263
2264//*************************************************************************************************
2266template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2267struct LowType< LowerMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
2268{
2269 using Type = LowerMatrix< typename LowType<MT1,MT2>::Type >;
2270};
2272//*************************************************************************************************
2273
2274
2275
2276
2277//=================================================================================================
2278//
2279// SUBMATRIXTRAIT SPECIALIZATIONS
2280//
2281//=================================================================================================
2282
2283//*************************************************************************************************
2285template< typename MT, size_t I, size_t N >
2286struct SubmatrixTraitEval1< MT, I, I, N, N
2287 , EnableIf_t< I != inf && N != inf &&
2288 IsLower_v<MT> &&
2289 !IsUniLower_v<MT> &&
2290 !IsStrictlyLower_v<MT> &&
2291 !IsDiagonal_v<MT> &&
2292 !IsUniform_v<MT> &&
2293 !IsZero_v<MT> > >
2294{
2295 using Type = LowerMatrix< typename SubmatrixTraitEval2<MT,I,I,N,N>::Type >;
2296};
2298//*************************************************************************************************
2299
2300} // namespace blaze
2301
2302#endif
Header file for the addition trait.
Header file for auxiliary alias declarations.
Header file for run time assertion macros.
Constraint on the data type.
Header file for the decldiag trait.
Header file for the declherm trait.
Header file for the decllow trait.
Header file for the declstrlow trait.
Header file for the declstrupp trait.
Header file for the declsym trait.
Header file for the declunilow trait.
Header file for the decluniupp trait.
Header file for the declupp trait.
Header file for the division trait.
Header file for the EnableIf class template.
Header file for the HasConstDataAccess type trait.
Constraint on the data type.
Header file for the HighType type trait.
Header file for the IntegralConstant class template.
Header file for the dense matrix inversion flags.
Header file for the IsAdaptor type trait.
Header file for the IsAligned type trait.
Header file for the IsContiguous type trait.
Header file for the isDefault shim.
Header file for the IsDiagonal type trait.
Header file for the isDivisor shim.
Header file for the IsHermitian type trait.
Header file for the IsIdentity type trait.
Header file for the IsLower type trait.
Header file for the IsMatrix type trait.
Header file for the IsPadded type trait.
Header file for the IsRestricted type trait.
Header file for the IsScalar type trait.
Header file for the IsSquare type trait.
Header file for the IsStrictlyLower type trait.
Header file for the IsStrictlyUpper type trait.
Header file for the IsSymmetric type trait.
Header file for the IsUniLower type trait.
Header file for the IsUniform type trait.
Header file for the IsUpper type trait.
Header file for the Kron product trait.
Header file for the LowType type trait.
Constraint on the data type.
Header file for the map trait.
Header file for the MaxSize type trait.
Header file for the MAYBE_UNUSED function template.
Header file for the multiplication trait.
Header file for the relaxation flag enumeration.
Header file for the RemoveAdaptor type trait.
Header file for the Schur product trait.
Header file for the subtraction trait.
Header file for the submatrix trait.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Header file for the YieldsDiagonal type trait.
Header file for the YieldsLower type trait.
Header file for the YieldsStrictlyLower type trait.
Header file for the YieldsUniLower type trait.
Header file for the implementation of the base template of the LowerMatrix.
LowerMatrix specialization for dense matrices.
LowerMatrix specialization for sparse matrices.
Matrix adapter for lower triangular matrices.
Definition: BaseTemplate.h:558
Pointer difference type of the Blaze library.
Constraint on the data type.
decltype(auto) band(Matrix< MT, SO > &matrix, RBAs... args)
Creating a view on a specific band of the given matrix.
Definition: Band.h:140
decltype(auto) column(Matrix< MT, SO > &matrix, RCAs... args)
Creating a view on a specific column of the given matrix.
Definition: Column.h:137
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:222
decltype(auto) min(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise minimum of the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1339
bool isIdentity(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is an identity matrix.
Definition: DenseMatrix.h:2561
void invert(const HermitianProxy< MT > &proxy)
In-place inversion of the represented element.
Definition: HermitianProxy.h:693
bool isIntact(const LowerMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given lower matrix are intact.
Definition: LowerMatrix.h:202
bool isDefault(const LowerMatrix< MT, SO, DF > &m)
Returns whether the given lower matrix is in default state.
Definition: LowerMatrix.h:169
void swap(LowerMatrix< MT, SO, DF > &a, LowerMatrix< MT, SO, DF > &b) noexcept
Swapping the contents of two matrices.
Definition: LowerMatrix.h:220
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Symmetric.h:79
#define BLAZE_CONSTRAINT_MUST_BE_BLAS_COMPATIBLE_TYPE(T)
Constraint on the data type.
Definition: BLASCompatible.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.
Definition: RequiresEvaluation.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_HERMITIAN_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Hermitian.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UPPER_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Upper.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_LOWER_MATRIX_TYPE(T)
Constraint on the data type.
Definition: Lower.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UNITRIANGULAR_MATRIX_TYPE(T)
Constraint on the data type.
Definition: UniTriangular.h:81
constexpr bool IsScalar_v
Auxiliary variable template for the IsScalar type trait.
Definition: IsScalar.h:104
constexpr ptrdiff_t DefaultSize_v
Default size of the Size type trait.
Definition: Size.h:72
constexpr bool IsMatrix_v
Auxiliary variable template for the IsMatrix type trait.
Definition: IsMatrix.h:124
constexpr bool YieldsLower_v
Auxiliary variable template for the YieldsLower type trait.
Definition: YieldsLower.h:126
constexpr bool IsLower_v
Auxiliary variable template for the IsLower type trait.
Definition: IsLower.h:175
RelaxationFlag
Relaxation flag for strict or relaxed semantics.
Definition: RelaxationFlag.h:66
constexpr Infinity inf
Global Infinity instance.
Definition: Infinity.h:1080
InversionFlag
Inversion flag.
Definition: InversionFlag.h:102
@ asUniLower
Flag for the inversion of a lower unitriangular matrix.
Definition: InversionFlag.h:112
@ asLower
Flag for the inversion of a lower triangular matrix.
Definition: InversionFlag.h:111
@ asUniUpper
Flag for the inversion of a upper unitriangular matrix.
Definition: InversionFlag.h:114
@ asDiagonal
Flag for the inversion of a diagonal matrix.
Definition: InversionFlag.h:115
@ byLU
Flag for the LU-based matrix inversion.
Definition: InversionFlag.h:103
@ asGeneral
Flag for the inversion of a general matrix (same as byLU).
Definition: InversionFlag.h:108
constexpr void reset(Matrix< MT, SO > &matrix)
Resetting the given matrix.
Definition: Matrix.h:806
void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:1108
decltype(auto) row(Matrix< MT, SO > &, RRAs...)
Creating a view on a specific row of the given matrix.
Definition: Row.h:137
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.
Definition: Assert.h:101
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
BoolConstant< true > TrueType
Type traits base class.
Definition: IntegralConstant.h:132
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.
Definition: EnableIf.h:138
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition: MaybeUnused.h:81
Header file for the exception macros of the math module.
Header file for all forward declarations of the math module.
Header file for the Size type trait.
Header file for the StorageOrder type trait.
Header file for the IsZero type trait.
Header file for the generic min algorithm.