UniUpperMatrix.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_ADAPTORS_UNIUPPERMATRIX_H_
36 #define _BLAZE_MATH_ADAPTORS_UNIUPPERMATRIX_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <blaze/math/Aliases.h>
56 #include <blaze/math/Forward.h>
57 #include <blaze/math/Functions.h>
60 #include <blaze/math/shims/IsOne.h>
83 #include <blaze/util/Assert.h>
84 #include <blaze/util/EnableIf.h>
86 #include <blaze/util/TrueType.h>
88 #include <blaze/util/Unused.h>
89 
90 
91 namespace blaze {
92 
93 //=================================================================================================
94 //
95 // UNIUPPERMATRIX OPERATORS
96 //
97 //=================================================================================================
98 
99 //*************************************************************************************************
102 template< typename MT, bool SO, bool DF >
103 inline void reset( UniUpperMatrix<MT,SO,DF>& m );
104 
105 template< typename MT, bool SO, bool DF >
106 inline void reset( UniUpperMatrix<MT,SO,DF>& m, size_t i );
107 
108 template< typename MT, bool SO, bool DF >
109 inline void clear( UniUpperMatrix<MT,SO,DF>& m );
110 
111 template< bool RF, typename MT, bool SO, bool DF >
112 inline bool isDefault( const UniUpperMatrix<MT,SO,DF>& m );
113 
114 template< typename MT, bool SO, bool DF >
115 inline bool isIntact( const UniUpperMatrix<MT,SO,DF>& m );
116 
117 template< typename MT, bool SO, bool DF >
118 inline void swap( UniUpperMatrix<MT,SO,DF>& a, UniUpperMatrix<MT,SO,DF>& b ) noexcept;
120 //*************************************************************************************************
121 
122 
123 //*************************************************************************************************
130 template< typename MT // Type of the adapted matrix
131  , bool SO // Storage order of the adapted matrix
132  , bool DF > // Density flag
134 {
135  m.reset();
136 }
137 //*************************************************************************************************
138 
139 
140 //*************************************************************************************************
153 template< typename MT // Type of the adapted matrix
154  , bool SO // Storage order of the adapted matrix
155  , bool DF > // Density flag
156 inline void reset( UniUpperMatrix<MT,SO,DF>& m, size_t i )
157 {
158  m.reset( i );
159 }
160 //*************************************************************************************************
161 
162 
163 //*************************************************************************************************
170 template< typename MT // Type of the adapted matrix
171  , bool SO // Storage order of the adapted matrix
172  , bool DF > // Density flag
174 {
175  m.clear();
176 }
177 //*************************************************************************************************
178 
179 
180 //*************************************************************************************************
190 template< bool RF // Relaxation flag
191  , typename MT // Type of the adapted matrix
192  , bool SO // Storage order of the adapted matrix
193  , bool DF > // Density flag
194 inline bool isDefault_backend( const UniUpperMatrix<MT,SO,DF>& m, TrueType )
195 {
196  return ( m.rows() == 0UL );
197 }
199 //*************************************************************************************************
200 
201 
202 //*************************************************************************************************
212 template< bool RF // Relaxation flag
213  , typename MT // Type of the adapted matrix
214  , bool SO // Storage order of the adapted matrix
215  , bool DF > // Density flag
216 inline bool isDefault_backend( const UniUpperMatrix<MT,SO,DF>& m, FalseType )
217 {
218  return isIdentity<RF>( m );
219 }
221 //*************************************************************************************************
222 
223 
224 //*************************************************************************************************
251 template< bool RF // Relaxation flag
252  , typename MT // Type of the adapted matrix
253  , bool SO // Storage order of the adapted matrix
254  , bool DF > // Density flag
255 inline bool isDefault( const UniUpperMatrix<MT,SO,DF>& m )
256 {
257  return isDefault_backend<RF>( m, typename IsResizable<MT>::Type() );
258 }
259 //*************************************************************************************************
260 
261 
262 //*************************************************************************************************
283 template< typename MT // Type of the adapted matrix
284  , bool SO // Storage order of the adapted matrix
285  , bool DF > // Density flag
286 inline bool isIntact( const UniUpperMatrix<MT,SO,DF>& m )
287 {
288  return m.isIntact();
289 }
290 //*************************************************************************************************
291 
292 
293 //*************************************************************************************************
301 template< typename MT // Type of the adapted matrix
302  , bool SO // Storage order of the adapted matrix
303  , bool DF > // Density flag
305 {
306  a.swap( b );
307 }
308 //*************************************************************************************************
309 
310 
311 //*************************************************************************************************
334 template< InversionFlag IF // Inversion algorithm
335  , typename MT // Type of the dense matrix
336  , bool SO > // Storage order of the dense matrix
337 inline void invert( UniUpperMatrix<MT,SO,true>& m )
338 {
340 
341  if( IF == asLower || IF == asUniLower ) {
342  BLAZE_INTERNAL_ASSERT( isIdentity( m ), "Violation of preconditions detected" );
343  return;
344  }
345 
346  constexpr InversionFlag flag( ( IF == byLU || IF == asGeneral || IF == asUpper || IF == asUniUpper)
347  ? ( asUniUpper )
348  : ( asDiagonal ) );
349 
350  invert<flag>( derestrict( m ) );
351 
352  BLAZE_INTERNAL_ASSERT( isIntact( m ), "Broken invariant detected" );
353 }
355 //*************************************************************************************************
356 
357 
358 //*************************************************************************************************
377 template< typename MT1, bool SO1, typename MT2, typename MT3, typename MT4, bool SO2 >
378 inline void lu( const UniUpperMatrix<MT1,SO1,true>& A, DenseMatrix<MT2,SO1>& L,
380 {
382 
387 
392 
393  typedef ElementType_<MT2> ET2;
394  typedef ElementType_<MT4> ET4;
395 
396  const size_t n( (~A).rows() );
397 
398  DerestrictTrait_<MT2> L2( derestrict( ~L ) );
399 
400  (~U) = A;
401 
402  resize( ~L, n, n );
403  reset( L2 );
404 
405  resize( ~P, n, n );
406  reset( ~P );
407 
408  for( size_t i=0UL; i<n; ++i ) {
409  L2(i,i) = ET2(1);
410  (~P)(i,i) = ET4(1);
411  }
412 }
414 //*************************************************************************************************
415 
416 
417 //*************************************************************************************************
433 template< typename MT // Type of the adapted matrix
434  , bool SO // Storage order of the adapted matrix
435  , bool DF // Density flag
436  , typename VT > // Type of the right-hand side dense vector
437 inline bool tryAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
438  const DenseVector<VT,false>& rhs, size_t row, size_t column )
439 {
441 
442  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
443  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
444  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.rows() - row, "Invalid number of rows" );
445 
446  UNUSED_PARAMETER( lhs );
447 
448  if( column >= row + (~rhs).size() )
449  return true;
450 
451  const bool containsDiagonal( column >= row );
452  const size_t ibegin( ( !containsDiagonal )?( 0UL ):( column - row + 1UL ) );
453 
454  if( containsDiagonal && !isOne( (~rhs)[column-row] ) )
455  return false;
456 
457  for( size_t i=ibegin; i<(~rhs).size(); ++i ) {
458  if( !isDefault( (~rhs)[i] ) )
459  return false;
460  }
461 
462  return true;
463 }
465 //*************************************************************************************************
466 
467 
468 //*************************************************************************************************
484 template< typename MT // Type of the adapted matrix
485  , bool SO // Storage order of the adapted matrix
486  , bool DF // Density flag
487  , typename VT > // Type of the right-hand side dense vector
488 inline bool tryAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
489  const DenseVector<VT,true>& rhs, size_t row, size_t column )
490 {
492 
493  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
494  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
495  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.columns() - column, "Invalid number of columns" );
496 
497  UNUSED_PARAMETER( lhs );
498 
499  if( row < column )
500  return true;
501 
502  const bool containsDiagonal( row < column + (~rhs).size() );
503  const size_t iend( min( row - column, (~rhs).size() ) );
504 
505  for( size_t i=0UL; i<iend; ++i ) {
506  if( !isDefault( (~rhs)[i] ) )
507  return false;
508  }
509 
510  if( containsDiagonal && !isOne( (~rhs)[iend] ) )
511  return false;
512 
513  return true;
514 }
516 //*************************************************************************************************
517 
518 
519 //*************************************************************************************************
535 template< typename MT // Type of the adapted matrix
536  , bool SO // Storage order of the adapted matrix
537  , bool DF // Density flag
538  , typename VT > // Type of the right-hand side sparse vector
539 inline bool tryAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
540  const SparseVector<VT,false>& rhs, size_t row, size_t column )
541 {
543 
544  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
545  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
546  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.rows() - row, "Invalid number of rows" );
547 
548  UNUSED_PARAMETER( lhs );
549 
550  typedef typename VT::ConstIterator RhsIterator;
551 
552  if( column >= row + (~rhs).size() )
553  return true;
554 
555  const bool containsDiagonal( column >= row );
556  const size_t index( ( containsDiagonal )?( column - row ):( 0UL ) );
557  const RhsIterator last( (~rhs).end() );
558  RhsIterator element( (~rhs).lowerBound( index ) );
559 
560  if( containsDiagonal ) {
561  if( element == last || element->index() != index || !isOne( element->value() ) )
562  return false;
563  ++element;
564  }
565 
566  for( ; element!=last; ++element ) {
567  if( !isDefault( element->value() ) )
568  return false;
569  }
570 
571  return true;
572 }
574 //*************************************************************************************************
575 
576 
577 //*************************************************************************************************
593 template< typename MT // Type of the adapted matrix
594  , bool SO // Storage order of the adapted matrix
595  , bool DF // Density flag
596  , typename VT > // Type of the right-hand side sparse vector
597 inline bool tryAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
598  const SparseVector<VT,true>& rhs, size_t row, size_t column )
599 {
601 
602  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
603  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
604  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.columns() - column, "Invalid number of columns" );
605 
606  UNUSED_PARAMETER( lhs );
607 
608  typedef typename VT::ConstIterator RhsIterator;
609 
610  if( row < column )
611  return true;
612 
613  const bool containsDiagonal( row < column + (~rhs).size() );
614  const size_t index( row - column );
615  const RhsIterator last( (~rhs).lowerBound( index ) );
616 
617  if( containsDiagonal ) {
618  if( last == (~rhs).end() || last->index() != index || !isOne( last->value() ) )
619  return false;
620  }
621 
622  for( RhsIterator element=(~rhs).begin(); element!=last; ++element ) {
623  if( !isDefault( element->value() ) )
624  return false;
625  }
626 
627  return true;
628 }
630 //*************************************************************************************************
631 
632 
633 //*************************************************************************************************
649 template< typename MT1 // Type of the adapted matrix
650  , bool SO // Storage order of the adapted matrix
651  , bool DF // Density flag
652  , typename MT2 > // Type of the right-hand side dense matrix
653 inline bool tryAssign( const UniUpperMatrix<MT1,SO,DF>& lhs,
654  const DenseMatrix<MT2,false>& rhs, size_t row, size_t column )
655 {
657 
658  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
659  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
660  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
661  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
662 
663  UNUSED_PARAMETER( lhs );
664 
665  const size_t M( (~rhs).rows() );
666  const size_t N( (~rhs).columns() );
667 
668  if( column + 1UL >= row + M )
669  return true;
670 
671  const size_t ibegin( ( column < row )?( 0UL ):( column - row ) );
672 
673  for( size_t i=ibegin; i<M; ++i )
674  {
675  const size_t jend( min( row + i - column, N ) );
676 
677  for( size_t j=0UL; j<jend; ++j ) {
678  if( !isDefault( (~rhs)(i,j) ) )
679  return false;
680  }
681 
682  const bool containsDiagonal( row + i < column + N );
683 
684  if( containsDiagonal && !isOne( (~rhs)(i,jend) ) )
685  return false;
686  }
687 
688  return true;
689 }
691 //*************************************************************************************************
692 
693 
694 //*************************************************************************************************
710 template< typename MT1 // Type of the adapted matrix
711  , bool SO // Storage order of the adapted matrix
712  , bool DF // Density flag
713  , typename MT2 > // Type of the right-hand side dense matrix
714 inline bool tryAssign( const UniUpperMatrix<MT1,SO,DF>& lhs,
715  const DenseMatrix<MT2,true>& rhs, size_t row, size_t column )
716 {
718 
719  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
720  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
721  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
722  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
723 
724  UNUSED_PARAMETER( lhs );
725 
726  const size_t M( (~rhs).rows() );
727  const size_t N( (~rhs).columns() );
728 
729  if( column + 1UL >= row + M )
730  return true;
731 
732  const size_t jend( min( row + M - column, N ) );
733 
734  for( size_t j=0UL; j<jend; ++j )
735  {
736  const bool containsDiagonal( column + j >= row );
737 
738  if( containsDiagonal && !isOne( (~rhs)(column+j-row,j) ) )
739  return false;
740 
741  const size_t ibegin( ( containsDiagonal )?( column + j - row + 1UL ):( 0UL ) );
742 
743  for( size_t i=ibegin; i<M; ++i ) {
744  if( !isDefault( (~rhs)(i,j) ) )
745  return false;
746  }
747  }
748 
749  return true;
750 }
752 //*************************************************************************************************
753 
754 
755 //*************************************************************************************************
771 template< typename MT1 // Type of the adapted matrix
772  , bool SO // Storage order of the adapted matrix
773  , bool DF // Density flag
774  , typename MT2 > // Type of the right-hand side sparse matrix
775 inline bool tryAssign( const UniUpperMatrix<MT1,SO,DF>& lhs,
776  const SparseMatrix<MT2,false>& rhs, size_t row, size_t column )
777 {
779 
780  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
781  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
782  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
783  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
784 
785  UNUSED_PARAMETER( lhs );
786 
787  typedef typename MT2::ConstIterator RhsIterator;
788 
789  const size_t M( (~rhs).rows() );
790  const size_t N( (~rhs).columns() );
791 
792  if( column + 1UL >= row + M )
793  return true;
794 
795  const size_t ibegin( ( column < row )?( 0UL ):( column - row ) );
796 
797  for( size_t i=ibegin; i<M; ++i )
798  {
799  const bool containsDiagonal( row + i < column + N );
800 
801  const size_t index( row + i - column );
802  const RhsIterator last( (~rhs).lowerBound( i, min( index, N ) ) );
803 
804  if( containsDiagonal ) {
805  if( last == (~rhs).end(i) || ( last->index() != index ) || !isOne( last->value() ) )
806  return false;
807  }
808 
809  for( RhsIterator element=(~rhs).begin(i); element!=last; ++element ) {
810  if( !isDefault( element->value() ) )
811  return false;
812  }
813  }
814 
815  return true;
816 }
818 //*************************************************************************************************
819 
820 
821 //*************************************************************************************************
837 template< typename MT1 // Type of the adapted matrix
838  , bool SO // Storage order of the adapted matrix
839  , bool DF // Density flag
840  , typename MT2 > // Type of the right-hand side sparse matrix
841 inline bool tryAssign( const UniUpperMatrix<MT1,SO,DF>& lhs,
842  const SparseMatrix<MT2,true>& rhs, size_t row, size_t column )
843 {
845 
846  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
847  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
848  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
849  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
850 
851  UNUSED_PARAMETER( lhs );
852 
853  typedef typename MT2::ConstIterator RhsIterator;
854 
855  const size_t M( (~rhs).rows() );
856  const size_t N( (~rhs).columns() );
857 
858  if( column + 1UL >= row + M )
859  return true;
860 
861  const size_t jend( min( row + M - column, N ) );
862 
863  for( size_t j=0UL; j<jend; ++j )
864  {
865  const bool containsDiagonal( column + j >= row );
866  const size_t index( ( containsDiagonal )?( column + j - row ):( 0UL ) );
867 
868  const RhsIterator last( (~rhs).end(j) );
869  RhsIterator element( (~rhs).lowerBound( index, j ) );
870 
871  if( containsDiagonal ) {
872  if( element == last || ( element->index() != index ) || !isOne( element->value() ) )
873  return false;
874  ++element;
875  }
876 
877  for( ; element!=last; ++element ) {
878  if( !isDefault( element->value() ) )
879  return false;
880  }
881  }
882 
883  return true;
884 }
886 //*************************************************************************************************
887 
888 
889 //*************************************************************************************************
906 template< typename MT // Type of the adapted matrix
907  , bool SO // Storage order of the adapted matrix
908  , bool DF // Density flag
909  , typename VT > // Type of the right-hand side dense vector
910 inline bool tryAddAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
911  const DenseVector<VT,false>& rhs, size_t row, size_t column )
912 {
914 
915  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
916  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
917  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.rows() - row, "Invalid number of rows" );
918 
919  UNUSED_PARAMETER( lhs );
920 
921  const size_t ibegin( ( column <= row )?( 0UL ):( column - row ) );
922 
923  for( size_t i=ibegin; i<(~rhs).size(); ++i ) {
924  if( !isDefault( (~rhs)[i] ) )
925  return false;
926  }
927 
928  return true;
929 }
931 //*************************************************************************************************
932 
933 
934 //*************************************************************************************************
951 template< typename MT // Type of the adapted matrix
952  , bool SO // Storage order of the adapted matrix
953  , bool DF // Density flag
954  , typename VT > // Type of the right-hand side dense vector
955 inline bool tryAddAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
956  const DenseVector<VT,true>& rhs, size_t row, size_t column )
957 {
959 
960  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
961  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
962  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.columns() - column, "Invalid number of columns" );
963 
964  UNUSED_PARAMETER( lhs );
965 
966  if( row < column )
967  return true;
968 
969  const size_t iend( min( row - column + 1UL, (~rhs).size() ) );
970 
971  for( size_t i=0UL; i<iend; ++i ) {
972  if( !isDefault( (~rhs)[i] ) )
973  return false;
974  }
975 
976  return true;
977 }
979 //*************************************************************************************************
980 
981 
982 //*************************************************************************************************
999 template< typename MT // Type of the adapted matrix
1000  , bool SO // Storage order of the adapted matrix
1001  , bool DF // Density flag
1002  , typename VT > // Type of the right-hand side sparse vector
1003 inline bool tryAddAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
1004  const SparseVector<VT,false>& rhs, size_t row, size_t column )
1005 {
1007 
1008  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1009  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1010  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.rows() - row, "Invalid number of rows" );
1011 
1012  UNUSED_PARAMETER( lhs );
1013 
1014  typedef typename VT::ConstIterator RhsIterator;
1015 
1016  const RhsIterator last( (~rhs).end() );
1017  RhsIterator element( (~rhs).lowerBound( ( column <= row )?( 0UL ):( column - row ) ) );
1018 
1019  for( ; element!=last; ++element ) {
1020  if( !isDefault( element->value() ) )
1021  return false;
1022  }
1023 
1024  return true;
1025 }
1027 //*************************************************************************************************
1028 
1029 
1030 //*************************************************************************************************
1047 template< typename MT // Type of the adapted matrix
1048  , bool SO // Storage order of the adapted matrix
1049  , bool DF // Density flag
1050  , typename VT > // Type of the right-hand side sparse vector
1051 inline bool tryAddAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
1052  const SparseVector<VT,true>& rhs, size_t row, size_t column )
1053 {
1055 
1056  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1057  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1058  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.columns() - column, "Invalid number of columns" );
1059 
1060  UNUSED_PARAMETER( lhs );
1061 
1062  typedef typename VT::ConstIterator RhsIterator;
1063 
1064  if( row < column )
1065  return true;
1066 
1067  const RhsIterator last( (~rhs).lowerBound( row - column + 1UL ) );
1068 
1069  for( RhsIterator element=(~rhs).begin(); element!=last; ++element ) {
1070  if( !isDefault( element->value() ) )
1071  return false;
1072  }
1073 
1074  return true;
1075 }
1077 //*************************************************************************************************
1078 
1079 
1080 //*************************************************************************************************
1097 template< typename MT1 // Type of the adapted matrix
1098  , bool SO // Storage order of the adapted matrix
1099  , bool DF // Density flag
1100  , typename MT2 > // Type of the right-hand side dense matrix
1101 inline bool tryAddAssign( const UniUpperMatrix<MT1,SO,DF>& lhs,
1102  const DenseMatrix<MT2,false>& rhs, size_t row, size_t column )
1103 {
1105 
1106  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1107  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1108  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
1109  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
1110 
1111  UNUSED_PARAMETER( lhs );
1112 
1113  const size_t M( (~rhs).rows() );
1114  const size_t N( (~rhs).columns() );
1115 
1116  if( column + 1UL >= row + M )
1117  return true;
1118 
1119  const size_t ibegin( ( column <= row )?( 0UL ):( column - row ) );
1120 
1121  for( size_t i=ibegin; i<M; ++i )
1122  {
1123  const size_t jend( min( row + i - column + 1UL, N ) );
1124 
1125  for( size_t j=0UL; j<jend; ++j ) {
1126  if( !isDefault( (~rhs)(i,j) ) )
1127  return false;
1128  }
1129  }
1130 
1131  return true;
1132 }
1134 //*************************************************************************************************
1135 
1136 
1137 //*************************************************************************************************
1154 template< typename MT1 // Type of the adapted matrix
1155  , bool SO // Storage order of the adapted matrix
1156  , bool DF // Density flag
1157  , typename MT2 > // Type of the right-hand side dense matrix
1158 inline bool tryAddAssign( const UniUpperMatrix<MT1,SO,DF>& lhs,
1159  const DenseMatrix<MT2,true>& rhs, size_t row, size_t column )
1160 {
1162 
1163  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1164  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1165  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
1166  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
1167 
1168  UNUSED_PARAMETER( lhs );
1169 
1170  const size_t M( (~rhs).rows() );
1171  const size_t N( (~rhs).columns() );
1172 
1173  if( column + 1UL >= row + M )
1174  return true;
1175 
1176  const size_t jend( min( row + M - column, N ) );
1177 
1178  for( size_t j=0UL; j<jend; ++j )
1179  {
1180  const bool containsDiagonal( column + j >= row );
1181  const size_t ibegin( ( containsDiagonal )?( column + j - row ):( 0UL ) );
1182 
1183  for( size_t i=ibegin; i<M; ++i ) {
1184  if( !isDefault( (~rhs)(i,j) ) )
1185  return false;
1186  }
1187  }
1188 
1189  return true;
1190 }
1192 //*************************************************************************************************
1193 
1194 
1195 //*************************************************************************************************
1212 template< typename MT1 // Type of the adapted matrix
1213  , bool SO // Storage order of the adapted matrix
1214  , bool DF // Density flag
1215  , typename MT2 > // Type of the right-hand side sparse matrix
1216 inline bool tryAddAssign( const UniUpperMatrix<MT1,SO,DF>& lhs,
1217  const SparseMatrix<MT2,false>& rhs, size_t row, size_t column )
1218 {
1220 
1221  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1222  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1223  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
1224  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
1225 
1226  UNUSED_PARAMETER( lhs );
1227 
1228  typedef typename MT2::ConstIterator RhsIterator;
1229 
1230  const size_t M( (~rhs).rows() );
1231  const size_t N( (~rhs).columns() );
1232 
1233  if( column + 1UL >= row + M )
1234  return true;
1235 
1236  const size_t ibegin( ( column < row )?( 0UL ):( column - row ) );
1237 
1238  for( size_t i=ibegin; i<M; ++i )
1239  {
1240  const size_t index( row + i - column + 1UL );
1241  const RhsIterator last( (~rhs).lowerBound( i, min( index, N ) ) );
1242 
1243  for( RhsIterator element=(~rhs).begin(i); element!=last; ++element ) {
1244  if( !isDefault( element->value() ) )
1245  return false;
1246  }
1247  }
1248 
1249  return true;
1250 }
1252 //*************************************************************************************************
1253 
1254 
1255 //*************************************************************************************************
1272 template< typename MT1 // Type of the adapted matrix
1273  , bool SO // Storage order of the adapted matrix
1274  , bool DF // Density flag
1275  , typename MT2 > // Type of the right-hand side sparse matrix
1276 inline bool tryAddAssign( const UniUpperMatrix<MT1,SO,DF>& lhs,
1277  const SparseMatrix<MT2,true>& rhs, size_t row, size_t column )
1278 {
1280 
1281  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1282  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1283  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
1284  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
1285 
1286  UNUSED_PARAMETER( lhs );
1287 
1288  typedef typename MT2::ConstIterator RhsIterator;
1289 
1290  const size_t M( (~rhs).rows() );
1291  const size_t N( (~rhs).columns() );
1292 
1293  if( column + 1UL >= row + M )
1294  return true;
1295 
1296  const size_t jend( min( row + M - column, N ) );
1297 
1298  for( size_t j=0UL; j<jend; ++j )
1299  {
1300  const bool containsDiagonal( column + j >= row );
1301  const size_t index( ( containsDiagonal )?( column + j - row ):( 0UL ) );
1302 
1303  const RhsIterator last( (~rhs).end(j) );
1304  RhsIterator element( (~rhs).lowerBound( index, j ) );
1305 
1306  for( ; element!=last; ++element ) {
1307  if( !isDefault( element->value() ) )
1308  return false;
1309  }
1310  }
1311 
1312  return true;
1313 }
1315 //*************************************************************************************************
1316 
1317 
1318 //*************************************************************************************************
1335 template< typename MT // Type of the adapted matrix
1336  , bool SO // Storage order of the adapted matrix
1337  , bool DF // Density flag
1338  , typename VT // Type of the right-hand side vector
1339  , bool TF > // Transpose flag of the right-hand side vector
1340 inline bool trySubAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
1341  const Vector<VT,TF>& rhs, size_t row, size_t column )
1342 {
1343  return tryAddAssign( lhs, ~rhs, row, column );
1344 }
1346 //*************************************************************************************************
1347 
1348 
1349 //*************************************************************************************************
1366 template< typename MT1 // Type of the adapted matrix
1367  , bool SO1 // Storage order of the adapted matrix
1368  , bool DF // Density flag
1369  , typename MT2 // Type of the right-hand side matrix
1370  , bool SO2 > // Storage order of the right-hand side matrix
1371 inline bool trySubAssign( const UniUpperMatrix<MT1,SO1,DF>& lhs,
1372  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
1373 {
1374  return tryAddAssign( lhs, ~rhs, row, column );
1375 }
1377 //*************************************************************************************************
1378 
1379 
1380 //*************************************************************************************************
1397 template< typename MT // Type of the adapted matrix
1398  , bool SO // Storage order of the adapted matrix
1399  , bool DF // Density flag
1400  , typename VT > // Type of the right-hand side vector
1401 inline bool tryMultAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
1402  const Vector<VT,false>& rhs, size_t row, size_t column )
1403 {
1405 
1406  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1407  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1408  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.rows() - row, "Invalid number of rows" );
1409 
1410  UNUSED_PARAMETER( lhs );
1411 
1412  return ( column < row || (~rhs).size() <= column - row || isOne( (~rhs)[column-row] ) );
1413 }
1415 //*************************************************************************************************
1416 
1417 
1418 //*************************************************************************************************
1435 template< typename MT // Type of the adapted matrix
1436  , bool SO // Storage order of the adapted matrix
1437  , bool DF // Density flag
1438  , typename VT > // Type of the right-hand side vector
1439 inline bool tryMultAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
1440  const Vector<VT,true>& rhs, size_t row, size_t column )
1441 {
1443 
1444  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1445  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1446  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.columns() - column, "Invalid number of columns" );
1447 
1448  UNUSED_PARAMETER( lhs );
1449 
1450  return ( row < column || (~rhs).size() <= row - column || isOne( (~rhs)[row-column] ) );
1451 }
1453 //*************************************************************************************************
1454 
1455 
1456 //*************************************************************************************************
1472 template< typename MT // Type of the adapted matrix
1473  , bool SO // Storage order of the adapted matrix
1474  , bool DF // Density flag
1475  , typename VT // Type of the right-hand side vector
1476  , bool TF > // Transpose flag of the right-hand side vector
1477 inline bool tryDivAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
1478  const Vector<VT,TF>& rhs, size_t row, size_t column )
1479 {
1480  return tryMultAssign( lhs, ~rhs, row, column );
1481 }
1483 //*************************************************************************************************
1484 
1485 
1486 //*************************************************************************************************
1500 template< typename MT // Type of the adapted matrix
1501  , bool SO // Storage order of the adapted matrix
1502  , bool DF > // Density flag
1503 inline MT& derestrict( UniUpperMatrix<MT,SO,DF>& m )
1504 {
1505  return m.matrix_;
1506 }
1508 //*************************************************************************************************
1509 
1510 
1511 
1512 
1513 //=================================================================================================
1514 //
1515 // ROWS SPECIALIZATIONS
1516 //
1517 //=================================================================================================
1518 
1519 //*************************************************************************************************
1521 template< typename MT, bool SO, bool DF >
1522 struct Rows< UniUpperMatrix<MT,SO,DF> > : public Rows<MT>
1523 {};
1525 //*************************************************************************************************
1526 
1527 
1528 
1529 
1530 //=================================================================================================
1531 //
1532 // COLUMNS SPECIALIZATIONS
1533 //
1534 //=================================================================================================
1535 
1536 //*************************************************************************************************
1538 template< typename MT, bool SO, bool DF >
1539 struct Columns< UniUpperMatrix<MT,SO,DF> > : public Columns<MT>
1540 {};
1542 //*************************************************************************************************
1543 
1544 
1545 
1546 
1547 //=================================================================================================
1548 //
1549 // ISSQUARE SPECIALIZATIONS
1550 //
1551 //=================================================================================================
1552 
1553 //*************************************************************************************************
1555 template< typename MT, bool SO, bool DF >
1556 struct IsSquare< UniUpperMatrix<MT,SO,DF> > : public TrueType
1557 {};
1559 //*************************************************************************************************
1560 
1561 
1562 
1563 
1564 //=================================================================================================
1565 //
1566 // ISUNIUPPER SPECIALIZATIONS
1567 //
1568 //=================================================================================================
1569 
1570 //*************************************************************************************************
1572 template< typename MT, bool SO, bool DF >
1573 struct IsUniUpper< UniUpperMatrix<MT,SO,DF> > : public TrueType
1574 {};
1576 //*************************************************************************************************
1577 
1578 
1579 
1580 
1581 //=================================================================================================
1582 //
1583 // ISADAPTOR SPECIALIZATIONS
1584 //
1585 //=================================================================================================
1586 
1587 //*************************************************************************************************
1589 template< typename MT, bool SO, bool DF >
1590 struct IsAdaptor< UniUpperMatrix<MT,SO,DF> > : public TrueType
1591 {};
1593 //*************************************************************************************************
1594 
1595 
1596 
1597 
1598 //=================================================================================================
1599 //
1600 // ISRESTRICTED SPECIALIZATIONS
1601 //
1602 //=================================================================================================
1603 
1604 //*************************************************************************************************
1606 template< typename MT, bool SO, bool DF >
1607 struct IsRestricted< UniUpperMatrix<MT,SO,DF> > : public TrueType
1608 {};
1610 //*************************************************************************************************
1611 
1612 
1613 
1614 
1615 //=================================================================================================
1616 //
1617 // HASCONSTDATAACCESS SPECIALIZATIONS
1618 //
1619 //=================================================================================================
1620 
1621 //*************************************************************************************************
1623 template< typename MT, bool SO >
1624 struct HasConstDataAccess< UniUpperMatrix<MT,SO,true> > : public TrueType
1625 {};
1627 //*************************************************************************************************
1628 
1629 
1630 
1631 
1632 //=================================================================================================
1633 //
1634 // ISALIGNED SPECIALIZATIONS
1635 //
1636 //=================================================================================================
1637 
1638 //*************************************************************************************************
1640 template< typename MT, bool SO, bool DF >
1641 struct IsAligned< UniUpperMatrix<MT,SO,DF> > : public BoolConstant< IsAligned<MT>::value >
1642 {};
1644 //*************************************************************************************************
1645 
1646 
1647 
1648 
1649 //=================================================================================================
1650 //
1651 // ISPADDED SPECIALIZATIONS
1652 //
1653 //=================================================================================================
1654 
1655 //*************************************************************************************************
1657 template< typename MT, bool SO, bool DF >
1658 struct IsPadded< UniUpperMatrix<MT,SO,DF> > : public BoolConstant< IsPadded<MT>::value >
1659 {};
1661 //*************************************************************************************************
1662 
1663 
1664 
1665 
1666 //=================================================================================================
1667 //
1668 // ISRESIZABLE SPECIALIZATIONS
1669 //
1670 //=================================================================================================
1671 
1672 //*************************************************************************************************
1674 template< typename MT, bool SO, bool DF >
1675 struct IsResizable< UniUpperMatrix<MT,SO,DF> > : public BoolConstant< IsResizable<MT>::value >
1676 {};
1678 //*************************************************************************************************
1679 
1680 
1681 
1682 
1683 //=================================================================================================
1684 //
1685 // REMOVEADAPTOR SPECIALIZATIONS
1686 //
1687 //=================================================================================================
1688 
1689 //*************************************************************************************************
1691 template< typename MT, bool SO, bool DF >
1692 struct RemoveAdaptor< UniUpperMatrix<MT,SO,DF> >
1693 {
1694  using Type = MT;
1695 };
1697 //*************************************************************************************************
1698 
1699 
1700 
1701 
1702 //=================================================================================================
1703 //
1704 // DERESTRICTTRAIT SPECIALIZATIONS
1705 //
1706 //=================================================================================================
1707 
1708 //*************************************************************************************************
1710 template< typename MT, bool SO, bool DF >
1711 struct DerestrictTrait< UniUpperMatrix<MT,SO,DF> >
1712 {
1713  using Type = MT&;
1714 };
1716 //*************************************************************************************************
1717 
1718 
1719 
1720 
1721 //=================================================================================================
1722 //
1723 // ADDTRAIT SPECIALIZATIONS
1724 //
1725 //=================================================================================================
1726 
1727 //*************************************************************************************************
1729 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1730 struct AddTrait< UniUpperMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
1731 {
1733 };
1734 
1735 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1736 struct AddTrait< StaticMatrix<T,M,N,SO1>, UniUpperMatrix<MT,SO2,DF> >
1737 {
1738  using Type = AddTrait_< StaticMatrix<T,M,N,SO1>, MT >;
1739 };
1740 
1741 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1742 struct AddTrait< UniUpperMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
1743 {
1745 };
1746 
1747 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1748 struct AddTrait< HybridMatrix<T,M,N,SO1>, UniUpperMatrix<MT,SO2,DF> >
1749 {
1750  using Type = AddTrait_< HybridMatrix<T,M,N,SO1>, MT >;
1751 };
1752 
1753 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1754 struct AddTrait< UniUpperMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
1755 {
1756  using Type = AddTrait_< MT, DynamicMatrix<T,SO2> >;
1757 };
1758 
1759 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1760 struct AddTrait< DynamicMatrix<T,SO1>, UniUpperMatrix<MT,SO2,DF> >
1761 {
1762  using Type = AddTrait_< DynamicMatrix<T,SO1>, MT >;
1763 };
1764 
1765 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
1766 struct AddTrait< UniUpperMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
1767 {
1769 };
1770 
1771 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
1772 struct AddTrait< CustomMatrix<T,AF,PF,SO1>, UniUpperMatrix<MT,SO2,DF> >
1773 {
1774  using Type = AddTrait_< CustomMatrix<T,AF,PF,SO1>, MT >;
1775 };
1776 
1777 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1778 struct AddTrait< UniUpperMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
1779 {
1781 };
1782 
1783 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1784 struct AddTrait< CompressedMatrix<T,SO1>, UniUpperMatrix<MT,SO2,DF> >
1785 {
1786  using Type = AddTrait_< CompressedMatrix<T,SO1>, MT >;
1787 };
1788 
1789 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
1790 struct AddTrait< UniUpperMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
1791 {
1792  using Type = AddTrait_<MT1,MT2>;
1793 };
1794 
1795 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
1796 struct AddTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, UniUpperMatrix<MT2,SO2,DF2> >
1797 {
1798  using Type = AddTrait_<MT1,MT2>;
1799 };
1800 
1801 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1802 struct AddTrait< UniUpperMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1803 {
1804  using Type = AddTrait_<MT1,MT2>;
1805 };
1806 
1807 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1808 struct AddTrait< HermitianMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
1809 {
1810  using Type = AddTrait_<MT1,MT2>;
1811 };
1812 
1813 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1814 struct AddTrait< UniUpperMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
1815 {
1816  using Type = AddTrait_<MT1,MT2>;
1817 };
1818 
1819 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1820 struct AddTrait< LowerMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
1821 {
1822  using Type = AddTrait_<MT1,MT2>;
1823 };
1824 
1825 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1826 struct AddTrait< UniUpperMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
1827 {
1828  using Type = AddTrait_<MT1,MT2>;
1829 };
1830 
1831 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1832 struct AddTrait< UniLowerMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
1833 {
1834  using Type = AddTrait_<MT1,MT2>;
1835 };
1836 
1837 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1838 struct AddTrait< UniUpperMatrix<MT1,SO1,DF1>, StrictlyLowerMatrix<MT2,SO2,DF2> >
1839 {
1840  using Type = AddTrait_<MT1,MT2>;
1841 };
1842 
1843 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1844 struct AddTrait< StrictlyLowerMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
1845 {
1846  using Type = AddTrait_<MT1,MT2>;
1847 };
1848 
1849 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1850 struct AddTrait< UniUpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1851 {
1852  using Type = UpperMatrix< AddTrait_<MT1,MT2> >;
1853 };
1854 
1855 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1856 struct AddTrait< UpperMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
1857 {
1858  using Type = UpperMatrix< AddTrait_<MT1,MT2> >;
1859 };
1860 
1861 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1862 struct AddTrait< UniUpperMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
1863 {
1864  using Type = UpperMatrix< AddTrait_<MT1,MT2> >;
1865 };
1867 //*************************************************************************************************
1868 
1869 
1870 
1871 
1872 //=================================================================================================
1873 //
1874 // SUBTRAIT SPECIALIZATIONS
1875 //
1876 //=================================================================================================
1877 
1878 //*************************************************************************************************
1880 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1881 struct SubTrait< UniUpperMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
1882 {
1884 };
1885 
1886 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1887 struct SubTrait< StaticMatrix<T,M,N,SO1>, UniUpperMatrix<MT,SO2,DF> >
1888 {
1889  using Type = SubTrait_< StaticMatrix<T,M,N,SO1>, MT >;
1890 };
1891 
1892 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1893 struct SubTrait< UniUpperMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
1894 {
1896 };
1897 
1898 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1899 struct SubTrait< HybridMatrix<T,M,N,SO1>, UniUpperMatrix<MT,SO2,DF> >
1900 {
1901  using Type = SubTrait_< HybridMatrix<T,M,N,SO1>, MT >;
1902 };
1903 
1904 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1905 struct SubTrait< UniUpperMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
1906 {
1907  using Type = SubTrait_< MT, DynamicMatrix<T,SO2> >;
1908 };
1909 
1910 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1911 struct SubTrait< DynamicMatrix<T,SO1>, UniUpperMatrix<MT,SO2,DF> >
1912 {
1913  using Type = SubTrait_< DynamicMatrix<T,SO1>, MT >;
1914 };
1915 
1916 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
1917 struct SubTrait< UniUpperMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
1918 {
1920 };
1921 
1922 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
1923 struct SubTrait< CustomMatrix<T,AF,PF,SO1>, UniUpperMatrix<MT,SO2,DF> >
1924 {
1925  using Type = SubTrait_< CustomMatrix<T,AF,PF,SO1>, MT >;
1926 };
1927 
1928 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1929 struct SubTrait< UniUpperMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
1930 {
1932 };
1933 
1934 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1935 struct SubTrait< CompressedMatrix<T,SO1>, UniUpperMatrix<MT,SO2,DF> >
1936 {
1937  using Type = SubTrait_< CompressedMatrix<T,SO1>, MT >;
1938 };
1939 
1940 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
1941 struct SubTrait< UniUpperMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
1942 {
1943  using Type = SubTrait_<MT1,MT2>;
1944 };
1945 
1946 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
1947 struct SubTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, UniUpperMatrix<MT2,SO2,DF2> >
1948 {
1949  using Type = SubTrait_<MT1,MT2>;
1950 };
1951 
1952 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1953 struct SubTrait< UniUpperMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1954 {
1955  using Type = SubTrait_<MT1,MT2>;
1956 };
1957 
1958 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1959 struct SubTrait< HermitianMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
1960 {
1961  using Type = SubTrait_<MT1,MT2>;
1962 };
1963 
1964 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1965 struct SubTrait< UniUpperMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
1966 {
1967  using Type = SubTrait_<MT1,MT2>;
1968 };
1969 
1970 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1971 struct SubTrait< LowerMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
1972 {
1973  using Type = SubTrait_<MT1,MT2>;
1974 };
1975 
1976 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1977 struct SubTrait< UniUpperMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
1978 {
1979  using Type = SubTrait_<MT1,MT2>;
1980 };
1981 
1982 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1983 struct SubTrait< UniLowerMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
1984 {
1985  using Type = SubTrait_<MT1,MT2>;
1986 };
1987 
1988 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1989 struct SubTrait< UniUpperMatrix<MT1,SO1,DF1>, StrictlyLowerMatrix<MT2,SO2,DF2> >
1990 {
1991  using Type = SubTrait_<MT1,MT2>;
1992 };
1993 
1994 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1995 struct SubTrait< StrictlyLowerMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
1996 {
1997  using Type = SubTrait_<MT1,MT2>;
1998 };
1999 
2000 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2001 struct SubTrait< UniUpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
2002 {
2003  using Type = UpperMatrix< SubTrait_<MT1,MT2> >;
2004 };
2005 
2006 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2007 struct SubTrait< UpperMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
2008 {
2009  using Type = UpperMatrix< SubTrait_<MT1,MT2> >;
2010 };
2011 
2012 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2013 struct SubTrait< UniUpperMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
2014 {
2015  using Type = UpperMatrix< SubTrait_<MT1,MT2> >;
2016 };
2018 //*************************************************************************************************
2019 
2020 
2021 
2022 
2023 //=================================================================================================
2024 //
2025 // MULTTRAIT SPECIALIZATIONS
2026 //
2027 //=================================================================================================
2028 
2029 //*************************************************************************************************
2031 template< typename MT, bool SO, bool DF, typename T >
2032 struct MultTrait< UniUpperMatrix<MT,SO,DF>, T, EnableIf_< IsNumeric<T> > >
2033 {
2034  using Type = UpperMatrix< MultTrait_<MT,T> >;
2035 };
2036 
2037 template< typename T, typename MT, bool SO, bool DF >
2038 struct MultTrait< T, UniUpperMatrix<MT,SO,DF>, EnableIf_< IsNumeric<T> > >
2039 {
2040  using Type = UpperMatrix< MultTrait_<T,MT> >;
2041 };
2042 
2043 template< typename MT, bool SO, bool DF, typename T, size_t N >
2044 struct MultTrait< UniUpperMatrix<MT,SO,DF>, StaticVector<T,N,false> >
2045 {
2047 };
2048 
2049 template< typename T, size_t N, typename MT, bool SO, bool DF >
2050 struct MultTrait< StaticVector<T,N,true>, UniUpperMatrix<MT,SO,DF> >
2051 {
2052  using Type = MultTrait_< StaticVector<T,N,true>, MT >;
2053 };
2054 
2055 template< typename MT, bool SO, bool DF, typename T, size_t N >
2056 struct MultTrait< UniUpperMatrix<MT,SO,DF>, HybridVector<T,N,false> >
2057 {
2059 };
2060 
2061 template< typename T, size_t N, typename MT, bool SO, bool DF >
2062 struct MultTrait< HybridVector<T,N,true>, UniUpperMatrix<MT,SO,DF> >
2063 {
2064  using Type = MultTrait_< HybridVector<T,N,true>, MT >;
2065 };
2066 
2067 template< typename MT, bool SO, bool DF, typename T >
2068 struct MultTrait< UniUpperMatrix<MT,SO,DF>, DynamicVector<T,false> >
2069 {
2071 };
2072 
2073 template< typename T, typename MT, bool SO, bool DF >
2074 struct MultTrait< DynamicVector<T,true>, UniUpperMatrix<MT,SO,DF> >
2075 {
2076  using Type = MultTrait_< DynamicVector<T,true>, MT >;
2077 };
2078 
2079 template< typename MT, bool SO, bool DF, typename T, bool AF, bool PF >
2080 struct MultTrait< UniUpperMatrix<MT,SO,DF>, CustomVector<T,AF,PF,false> >
2081 {
2083 };
2084 
2085 template< typename T, bool AF, bool PF, typename MT, bool SO, bool DF >
2086 struct MultTrait< CustomVector<T,AF,PF,true>, UniUpperMatrix<MT,SO,DF> >
2087 {
2088  using Type = MultTrait_< CustomVector<T,AF,PF,true>, MT >;
2089 };
2090 
2091 template< typename MT, bool SO, bool DF, typename T >
2092 struct MultTrait< UniUpperMatrix<MT,SO,DF>, CompressedVector<T,false> >
2093 {
2095 };
2096 
2097 template< typename T, typename MT, bool SO, bool DF >
2098 struct MultTrait< CompressedVector<T,true>, UniUpperMatrix<MT,SO,DF> >
2099 {
2100  using Type = MultTrait_< CompressedVector<T,true>, MT >;
2101 };
2102 
2103 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
2104 struct MultTrait< UniUpperMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
2105 {
2107 };
2108 
2109 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
2110 struct MultTrait< StaticMatrix<T,M,N,SO1>, UniUpperMatrix<MT,SO2,DF> >
2111 {
2112  using Type = MultTrait_< StaticMatrix<T,M,N,SO1>, MT >;
2113 };
2114 
2115 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
2116 struct MultTrait< UniUpperMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
2117 {
2119 };
2120 
2121 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
2122 struct MultTrait< HybridMatrix<T,M,N,SO1>, UniUpperMatrix<MT,SO2,DF> >
2123 {
2124  using Type = MultTrait_< HybridMatrix<T,M,N,SO1>, MT >;
2125 };
2126 
2127 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
2128 struct MultTrait< UniUpperMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
2129 {
2130  using Type = MultTrait_< MT, DynamicMatrix<T,SO2> >;
2131 };
2132 
2133 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
2134 struct MultTrait< DynamicMatrix<T,SO1>, UniUpperMatrix<MT,SO2,DF> >
2135 {
2136  using Type = MultTrait_< DynamicMatrix<T,SO1>, MT >;
2137 };
2138 
2139 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
2140 struct MultTrait< UniUpperMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
2141 {
2143 };
2144 
2145 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
2146 struct MultTrait< CustomMatrix<T,AF,PF,SO1>, UniUpperMatrix<MT,SO2,DF> >
2147 {
2148  using Type = MultTrait_< CustomMatrix<T,AF,PF,SO1>, MT >;
2149 };
2150 
2151 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
2152 struct MultTrait< UniUpperMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
2153 {
2155 };
2156 
2157 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
2158 struct MultTrait< CompressedMatrix<T,SO1>, UniUpperMatrix<MT,SO2,DF> >
2159 {
2160  using Type = MultTrait_< CompressedMatrix<T,SO1>, MT >;
2161 };
2162 
2163 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
2164 struct MultTrait< UniUpperMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
2165 {
2166  using Type = MultTrait_<MT1,MT2>;
2167 };
2168 
2169 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
2170 struct MultTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, UniUpperMatrix<MT2,SO2,DF2> >
2171 {
2172  using Type = MultTrait_<MT1,MT2>;
2173 };
2174 
2175 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2176 struct MultTrait< UniUpperMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
2177 {
2178  using Type = MultTrait_<MT1,MT2>;
2179 };
2180 
2181 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2182 struct MultTrait< HermitianMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
2183 {
2184  using Type = MultTrait_<MT1,MT2>;
2185 };
2186 
2187 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2188 struct MultTrait< UniUpperMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
2189 {
2190  using Type = MultTrait_<MT1,MT2>;
2191 };
2192 
2193 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2194 struct MultTrait< LowerMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
2195 {
2196  using Type = MultTrait_<MT1,MT2>;
2197 };
2198 
2199 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2200 struct MultTrait< UniUpperMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
2201 {
2202  using Type = MultTrait_<MT1,MT2>;
2203 };
2204 
2205 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2206 struct MultTrait< UniLowerMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
2207 {
2208  using Type = MultTrait_<MT1,MT2>;
2209 };
2210 
2211 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2212 struct MultTrait< UniUpperMatrix<MT1,SO1,DF1>, StrictlyLowerMatrix<MT2,SO2,DF2> >
2213 {
2214  using Type = MultTrait_<MT1,MT2>;
2215 };
2216 
2217 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2218 struct MultTrait< StrictlyLowerMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
2219 {
2220  using Type = MultTrait_<MT1,MT2>;
2221 };
2222 
2223 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2224 struct MultTrait< UniUpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
2225 {
2226  using Type = UpperMatrix< MultTrait_<MT1,MT2> >;
2227 };
2228 
2229 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2230 struct MultTrait< UpperMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
2231 {
2232  using Type = UpperMatrix< MultTrait_<MT1,MT2> >;
2233 };
2234 
2235 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2236 struct MultTrait< UniUpperMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
2237 {
2238  using Type = UniUpperMatrix< MultTrait_<MT1,MT2> >;
2239 };
2241 //*************************************************************************************************
2242 
2243 
2244 
2245 
2246 //=================================================================================================
2247 //
2248 // DIVTRAIT SPECIALIZATIONS
2249 //
2250 //=================================================================================================
2251 
2252 //*************************************************************************************************
2254 template< typename MT, bool SO, bool DF, typename T >
2255 struct DivTrait< UniUpperMatrix<MT,SO,DF>, T, EnableIf_< IsNumeric<T> > >
2256 {
2257  using Type = UpperMatrix< DivTrait_<MT,T> >;
2258 };
2260 //*************************************************************************************************
2261 
2262 
2263 
2264 
2265 //=================================================================================================
2266 //
2267 // FOREACHTRAIT SPECIALIZATIONS
2268 //
2269 //=================================================================================================
2270 
2271 //*************************************************************************************************
2273 template< typename MT, bool SO, bool DF, typename ET >
2274 struct ForEachTrait< UniUpperMatrix<MT,SO,DF>, Pow<ET> >
2275 {
2277 };
2279 //*************************************************************************************************
2280 
2281 
2282 
2283 
2284 //=================================================================================================
2285 //
2286 // HIGHTYPE SPECIALIZATIONS
2287 //
2288 //=================================================================================================
2289 
2290 //*************************************************************************************************
2292 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2293 struct HighType< UniUpperMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
2294 {
2296 };
2298 //*************************************************************************************************
2299 
2300 
2301 
2302 
2303 //=================================================================================================
2304 //
2305 // LOWTYPE SPECIALIZATIONS
2306 //
2307 //=================================================================================================
2308 
2309 //*************************************************************************************************
2311 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2312 struct LowType< UniUpperMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
2313 {
2315 };
2317 //*************************************************************************************************
2318 
2319 
2320 
2321 
2322 //=================================================================================================
2323 //
2324 // SUBMATRIXTRAIT SPECIALIZATIONS
2325 //
2326 //=================================================================================================
2327 
2328 //*************************************************************************************************
2330 template< typename MT, bool SO, bool DF >
2331 struct SubmatrixTrait< UniUpperMatrix<MT,SO,DF> >
2332 {
2333  using Type = SubmatrixTrait_<MT>;
2334 };
2336 //*************************************************************************************************
2337 
2338 
2339 
2340 
2341 //=================================================================================================
2342 //
2343 // ROWTRAIT SPECIALIZATIONS
2344 //
2345 //=================================================================================================
2346 
2347 //*************************************************************************************************
2349 template< typename MT, bool SO, bool DF >
2350 struct RowTrait< UniUpperMatrix<MT,SO,DF> >
2351 {
2352  using Type = RowTrait_<MT>;
2353 };
2355 //*************************************************************************************************
2356 
2357 
2358 
2359 
2360 //=================================================================================================
2361 //
2362 // COLUMNTRAIT SPECIALIZATIONS
2363 //
2364 //=================================================================================================
2365 
2366 //*************************************************************************************************
2368 template< typename MT, bool SO, bool DF >
2369 struct ColumnTrait< UniUpperMatrix<MT,SO,DF> >
2370 {
2371  using Type = ColumnTrait_<MT>;
2372 };
2374 //*************************************************************************************************
2375 
2376 } // namespace blaze
2377 
2378 #endif
Header file for auxiliary alias declarations.
Header file for mathematical functions.
typename DerestrictTrait< T >::Type DerestrictTrait_
Auxiliary alias declaration for the DerestrictTrait type trait.The DerestrictTrait_ alias declaration...
Definition: DerestrictTrait.h:110
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 IsUniUpper type trait.
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.
Base template for the SubmatrixTrait class.
Definition: SubmatrixTrait.h:118
Flag for the inversion of a upper unitriangular matrix.
Definition: InversionFlag.h:114
Base template for the ColumnTrait class.
Definition: ColumnTrait.h:117
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:152
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector) noexcept
Returns the current size/dimension of the vector.
Definition: Vector.h:261
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:71
Header file for the dense matrix inversion flags.
UniUpperMatrix specialization for sparse matrices.
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:194
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:533
const ElementType_< MT > min(const DenseMatrix< MT, SO > &dm)
Returns the smallest element of the dense matrix.
Definition: DenseMatrix.h:1755
#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:245
Constraint on the data type.
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:71
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:119
bool isIdentity(const DenseMatrix< MT, SO > &dm)
Checks if the give dense matrix is an identity matrix.
Definition: DenseMatrix.h:1679
Constraint on the data type.
Compile time check for data types with restricted data access.This type trait tests whether the given...
Definition: IsRestricted.h:82
Header file for the IsSquare type trait.
Compile time check for the alignment of data types.This type trait tests whether the given data type ...
Definition: IsAligned.h:87
void invert(const HermitianProxy< MT > &proxy)
In-place inversion of the represented element.
Definition: HermitianProxy.h:741
Base template for the RowTrait class.
Definition: RowTrait.h:117
Compile time check for upper unitriangular matrices.This type trait tests whether or not the given te...
Definition: IsUniUpper.h:86
Flag for the inversion of a upper triangular matrix.
Definition: InversionFlag.h:113
Constraint on the data type.
Header file for the LowType type trait.
Flag for the inversion of a lower triangular matrix.
Definition: InversionFlag.h:111
Base template for the HighType type trait.
Definition: HighType.h:133
Header file for the multiplication trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Flag for the LU-based matrix inversion.
Definition: InversionFlag.h:103
Base template for the ForEachTrait class.The ForEachTrait class template offers the possibility to se...
Definition: ForEachTrait.h:79
Header file for all forward declarations of the math module.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2939
Compile time check for data types with padding.This type trait tests whether the given data type empl...
Definition: IsPadded.h:76
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.
Header file for the implementation of a fixed-size matrix.
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:336
DisableIf_< Or< IsComputation< MT >, IsTransExpr< MT >, IsDeclExpr< MT > >, RowExprTrait_< MT > > row(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific row of the given matrix.
Definition: Row.h:128
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UPPER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a upper triangular matrix type...
Definition: Upper.h:81
BLAZE_ALWAYS_INLINE void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:544
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:260
Header file for the RemoveAdaptor type trait.
Constraint on the data type.
Matrix adapter for upper triangular matrices.
Definition: Forward.h:55
Compile time check for adaptors.This type trait tests whether the given template parameter is an adap...
Definition: IsAdaptor.h:88
DisableIf_< Or< IsComputation< MT >, IsTransExpr< MT >, IsDeclExpr< MT > >, ColumnExprTrait_< MT > > column(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific column of the given matrix.
Definition: Column.h:128
Header file for the EnableIf class template.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:553
Header file for the IsPadded type trait.
Header file for the IsAdaptor type trait.
Header file for the isOne shim.
Header file for the DerestrictTrait class template.
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
Matrix adapter for upper unitriangular matrices.
Definition: Forward.h:54
#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 run time assertion macros.
Base template for the AddTrait class.
Definition: AddTrait.h:143
Base template for the MultTrait class.
Definition: MultTrait.h:143
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
bool isOne(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is 1.
Definition: DiagonalProxy.h:635
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:267
Base class for matrices.The Matrix class is a base class for all dense and sparse matrix classes with...
Definition: Forward.h:94
#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:153
Evaluation of the return type of the derestrict function.Via this type trait it is possible to evalua...
Definition: DerestrictTrait.h:73
Base template for the DivTrait class.
Definition: DivTrait.h:143
typename ColumnTrait< MT >::Type ColumnTrait_
Auxiliary alias declaration for the ColumnTrait type trait.The ColumnTrait_ alias declaration provide...
Definition: ColumnTrait.h:152
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:320
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:164
typename SubTrait< T1, T2 >::Type SubTrait_
Auxiliary alias declaration for the SubTrait class template.The SubTrait_ alias declaration provides ...
Definition: SubTrait.h:245
Header file for the for-each trait.
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:120
UniUpperMatrix specialization for dense matrices.
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:76
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:249
Compile time evaluation of the number of rows of a matrix.The Rows type trait evaluates the number of...
Definition: Rows.h:76
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:573
#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:143
void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
Header file for the implementation of the base template of the UpperMatrix.
Header file for the IsResizable type trait.
Header file for the IsRestricted type trait.
typename AddTrait< T1, T2 >::Type AddTrait_
Auxiliary alias declaration for the AddTrait class template.The AddTrait_ alias declaration provides ...
Definition: AddTrait.h:245
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 implementation of the base template of the UniUpperMatrix.
Header file for the HighType type trait.
Header file for the TrueType type/value trait base class.