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>
82 #include <blaze/util/Assert.h>
83 #include <blaze/util/EnableIf.h>
85 #include <blaze/util/TrueType.h>
87 #include <blaze/util/Unused.h>
88 
89 
90 namespace blaze {
91 
92 //=================================================================================================
93 //
94 // UNIUPPERMATRIX OPERATORS
95 //
96 //=================================================================================================
97 
98 //*************************************************************************************************
101 template< typename MT, bool SO, bool DF >
102 inline void reset( UniUpperMatrix<MT,SO,DF>& m );
103 
104 template< typename MT, bool SO, bool DF >
105 inline void reset( UniUpperMatrix<MT,SO,DF>& m, size_t i );
106 
107 template< typename MT, bool SO, bool DF >
108 inline void clear( UniUpperMatrix<MT,SO,DF>& m );
109 
110 template< typename MT, bool SO, bool DF >
111 inline bool isDefault( const UniUpperMatrix<MT,SO,DF>& m );
112 
113 template< typename MT, bool SO, bool DF >
114 inline bool isIntact( const UniUpperMatrix<MT,SO,DF>& m );
115 
116 template< typename MT, bool SO, bool DF >
117 inline void swap( UniUpperMatrix<MT,SO,DF>& a, UniUpperMatrix<MT,SO,DF>& b ) noexcept;
119 //*************************************************************************************************
120 
121 
122 //*************************************************************************************************
129 template< typename MT // Type of the adapted matrix
130  , bool SO // Storage order of the adapted matrix
131  , bool DF > // Density flag
133 {
134  m.reset();
135 }
136 //*************************************************************************************************
137 
138 
139 //*************************************************************************************************
152 template< typename MT // Type of the adapted matrix
153  , bool SO // Storage order of the adapted matrix
154  , bool DF > // Density flag
155 inline void reset( UniUpperMatrix<MT,SO,DF>& m, size_t i )
156 {
157  m.reset( i );
158 }
159 //*************************************************************************************************
160 
161 
162 //*************************************************************************************************
169 template< typename MT // Type of the adapted matrix
170  , bool SO // Storage order of the adapted matrix
171  , bool DF > // Density flag
173 {
174  m.clear();
175 }
176 //*************************************************************************************************
177 
178 
179 //*************************************************************************************************
189 template< typename MT // Type of the adapted matrix
190  , bool SO // Storage order of the adapted matrix
191  , bool DF > // Density flag
192 inline bool isDefault_backend( const UniUpperMatrix<MT,SO,DF>& m, TrueType )
193 {
194  return ( m.rows() == 0UL );
195 }
197 //*************************************************************************************************
198 
199 
200 //*************************************************************************************************
210 template< typename MT // Type of the adapted matrix
211  , bool SO // Storage order of the adapted matrix
212  , bool DF > // Density flag
213 inline bool isDefault_backend( const UniUpperMatrix<MT,SO,DF>& m, FalseType )
214 {
215  return isIdentity( m );
216 }
218 //*************************************************************************************************
219 
220 
221 //*************************************************************************************************
242 template< typename MT // Type of the adapted matrix
243  , bool SO // Storage order of the adapted matrix
244  , bool DF > // Density flag
245 inline bool isIntact( const UniUpperMatrix<MT,SO,DF>& m )
246 {
247  return m.isIntact();
248 }
249 //*************************************************************************************************
250 
251 
252 //*************************************************************************************************
272 template< typename MT // Type of the adapted matrix
273  , bool SO // Storage order of the adapted matrix
274  , bool DF > // Density flag
275 inline bool isDefault( const UniUpperMatrix<MT,SO,DF>& m )
276 {
277  return isDefault_backend( m, typename IsResizable<MT>::Type() );
278 }
279 //*************************************************************************************************
280 
281 
282 //*************************************************************************************************
290 template< typename MT // Type of the adapted matrix
291  , bool SO // Storage order of the adapted matrix
292  , bool DF > // Density flag
294 {
295  a.swap( b );
296 }
297 //*************************************************************************************************
298 
299 
300 //*************************************************************************************************
323 template< InversionFlag IF // Inversion algorithm
324  , typename MT // Type of the dense matrix
325  , bool SO > // Storage order of the dense matrix
326 inline void invert( UniUpperMatrix<MT,SO,true>& m )
327 {
329 
330  if( IF == asLower || IF == asUniLower ) {
331  BLAZE_INTERNAL_ASSERT( isIdentity( m ), "Violation of preconditions detected" );
332  return;
333  }
334 
335  constexpr InversionFlag flag( ( IF == byLU || IF == asGeneral || IF == asUpper || IF == asUniUpper)
336  ? ( asUniUpper )
337  : ( asDiagonal ) );
338 
339  invert<flag>( derestrict( m ) );
340 
341  BLAZE_INTERNAL_ASSERT( isIntact( m ), "Broken invariant detected" );
342 }
344 //*************************************************************************************************
345 
346 
347 //*************************************************************************************************
366 template< typename MT1, bool SO1, typename MT2, typename MT3, typename MT4, bool SO2 >
367 inline void lu( const UniUpperMatrix<MT1,SO1,true>& A, DenseMatrix<MT2,SO1>& L,
368  DenseMatrix<MT3,SO1>& U, Matrix<MT4,SO2>& P )
369 {
371 
376 
381 
382  typedef ElementType_<MT2> ET2;
383  typedef ElementType_<MT4> ET4;
384 
385  const size_t n( (~A).rows() );
386 
387  DerestrictTrait_<MT2> L2( derestrict( ~L ) );
388 
389  (~U) = A;
390 
391  resize( ~L, n, n );
392  reset( L2 );
393 
394  resize( ~P, n, n );
395  reset( ~P );
396 
397  for( size_t i=0UL; i<n; ++i ) {
398  L2(i,i) = ET2(1);
399  (~P)(i,i) = ET4(1);
400  }
401 }
403 //*************************************************************************************************
404 
405 
406 //*************************************************************************************************
422 template< typename MT // Type of the adapted matrix
423  , bool SO // Storage order of the adapted matrix
424  , bool DF // Density flag
425  , typename VT > // Type of the right-hand side dense vector
426 inline bool tryAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
427  const DenseVector<VT,false>& rhs, size_t row, size_t column )
428 {
430 
431  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
432  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
433  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.rows() - row, "Invalid number of rows" );
434 
435  UNUSED_PARAMETER( lhs );
436 
437  if( column >= row + (~rhs).size() )
438  return true;
439 
440  const bool containsDiagonal( column >= row );
441  const size_t ibegin( ( !containsDiagonal )?( 0UL ):( column - row + 1UL ) );
442 
443  if( containsDiagonal && !isOne( (~rhs)[column-row] ) )
444  return false;
445 
446  for( size_t i=ibegin; i<(~rhs).size(); ++i ) {
447  if( !isDefault( (~rhs)[i] ) )
448  return false;
449  }
450 
451  return true;
452 }
454 //*************************************************************************************************
455 
456 
457 //*************************************************************************************************
473 template< typename MT // Type of the adapted matrix
474  , bool SO // Storage order of the adapted matrix
475  , bool DF // Density flag
476  , typename VT > // Type of the right-hand side dense vector
477 inline bool tryAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
478  const DenseVector<VT,true>& rhs, size_t row, size_t column )
479 {
481 
482  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
483  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
484  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.columns() - column, "Invalid number of columns" );
485 
486  UNUSED_PARAMETER( lhs );
487 
488  if( row < column )
489  return true;
490 
491  const bool containsDiagonal( row < column + (~rhs).size() );
492  const size_t iend( min( row - column, (~rhs).size() ) );
493 
494  for( size_t i=0UL; i<iend; ++i ) {
495  if( !isDefault( (~rhs)[i] ) )
496  return false;
497  }
498 
499  if( containsDiagonal && !isOne( (~rhs)[iend] ) )
500  return false;
501 
502  return true;
503 }
505 //*************************************************************************************************
506 
507 
508 //*************************************************************************************************
524 template< typename MT // Type of the adapted matrix
525  , bool SO // Storage order of the adapted matrix
526  , bool DF // Density flag
527  , typename VT > // Type of the right-hand side sparse vector
528 inline bool tryAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
529  const SparseVector<VT,false>& rhs, size_t row, size_t column )
530 {
532 
533  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
534  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
535  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.rows() - row, "Invalid number of rows" );
536 
537  UNUSED_PARAMETER( lhs );
538 
539  typedef typename VT::ConstIterator RhsIterator;
540 
541  if( column >= row + (~rhs).size() )
542  return true;
543 
544  const bool containsDiagonal( column >= row );
545  const size_t index( ( containsDiagonal )?( column - row ):( 0UL ) );
546  const RhsIterator last( (~rhs).end() );
547  RhsIterator element( (~rhs).lowerBound( index ) );
548 
549  if( containsDiagonal ) {
550  if( element == last || element->index() != index || !isOne( element->value() ) )
551  return false;
552  ++element;
553  }
554 
555  for( ; element!=last; ++element ) {
556  if( !isDefault( element->value() ) )
557  return false;
558  }
559 
560  return true;
561 }
563 //*************************************************************************************************
564 
565 
566 //*************************************************************************************************
582 template< typename MT // Type of the adapted matrix
583  , bool SO // Storage order of the adapted matrix
584  , bool DF // Density flag
585  , typename VT > // Type of the right-hand side sparse vector
586 inline bool tryAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
587  const SparseVector<VT,true>& rhs, size_t row, size_t column )
588 {
590 
591  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
592  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
593  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.columns() - column, "Invalid number of columns" );
594 
595  UNUSED_PARAMETER( lhs );
596 
597  typedef typename VT::ConstIterator RhsIterator;
598 
599  if( row < column )
600  return true;
601 
602  const bool containsDiagonal( row < column + (~rhs).size() );
603  const size_t index( row - column );
604  const RhsIterator last( (~rhs).lowerBound( index ) );
605 
606  if( containsDiagonal ) {
607  if( last == (~rhs).end() || last->index() != index || !isOne( last->value() ) )
608  return false;
609  }
610 
611  for( RhsIterator element=(~rhs).begin(); element!=last; ++element ) {
612  if( !isDefault( element->value() ) )
613  return false;
614  }
615 
616  return true;
617 }
619 //*************************************************************************************************
620 
621 
622 //*************************************************************************************************
638 template< typename MT1 // Type of the adapted matrix
639  , bool SO // Storage order of the adapted matrix
640  , bool DF // Density flag
641  , typename MT2 > // Type of the right-hand side dense matrix
642 inline bool tryAssign( const UniUpperMatrix<MT1,SO,DF>& lhs,
643  const DenseMatrix<MT2,false>& rhs, size_t row, size_t column )
644 {
646 
647  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
648  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
649  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
650  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
651 
652  UNUSED_PARAMETER( lhs );
653 
654  const size_t M( (~rhs).rows() );
655  const size_t N( (~rhs).columns() );
656 
657  if( column + 1UL >= row + M )
658  return true;
659 
660  const size_t ibegin( ( column < row )?( 0UL ):( column - row ) );
661 
662  for( size_t i=ibegin; i<M; ++i )
663  {
664  const size_t jend( min( row + i - column, N ) );
665 
666  for( size_t j=0UL; j<jend; ++j ) {
667  if( !isDefault( (~rhs)(i,j) ) )
668  return false;
669  }
670 
671  const bool containsDiagonal( row + i < column + N );
672 
673  if( containsDiagonal && !isOne( (~rhs)(i,jend) ) )
674  return false;
675  }
676 
677  return true;
678 }
680 //*************************************************************************************************
681 
682 
683 //*************************************************************************************************
699 template< typename MT1 // Type of the adapted matrix
700  , bool SO // Storage order of the adapted matrix
701  , bool DF // Density flag
702  , typename MT2 > // Type of the right-hand side dense matrix
703 inline bool tryAssign( const UniUpperMatrix<MT1,SO,DF>& lhs,
704  const DenseMatrix<MT2,true>& rhs, size_t row, size_t column )
705 {
707 
708  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
709  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
710  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
711  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
712 
713  UNUSED_PARAMETER( lhs );
714 
715  const size_t M( (~rhs).rows() );
716  const size_t N( (~rhs).columns() );
717 
718  if( column + 1UL >= row + M )
719  return true;
720 
721  const size_t jend( min( row + M - column, N ) );
722 
723  for( size_t j=0UL; j<jend; ++j )
724  {
725  const bool containsDiagonal( column + j >= row );
726 
727  if( containsDiagonal && !isOne( (~rhs)(column+j-row,j) ) )
728  return false;
729 
730  const size_t ibegin( ( containsDiagonal )?( column + j - row + 1UL ):( 0UL ) );
731 
732  for( size_t i=ibegin; i<M; ++i ) {
733  if( !isDefault( (~rhs)(i,j) ) )
734  return false;
735  }
736  }
737 
738  return true;
739 }
741 //*************************************************************************************************
742 
743 
744 //*************************************************************************************************
760 template< typename MT1 // Type of the adapted matrix
761  , bool SO // Storage order of the adapted matrix
762  , bool DF // Density flag
763  , typename MT2 > // Type of the right-hand side sparse matrix
764 inline bool tryAssign( const UniUpperMatrix<MT1,SO,DF>& lhs,
765  const SparseMatrix<MT2,false>& rhs, size_t row, size_t column )
766 {
768 
769  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
770  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
771  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
772  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
773 
774  UNUSED_PARAMETER( lhs );
775 
776  typedef typename MT2::ConstIterator RhsIterator;
777 
778  const size_t M( (~rhs).rows() );
779  const size_t N( (~rhs).columns() );
780 
781  if( column + 1UL >= row + M )
782  return true;
783 
784  const size_t ibegin( ( column < row )?( 0UL ):( column - row ) );
785 
786  for( size_t i=ibegin; i<M; ++i )
787  {
788  const bool containsDiagonal( row + i < column + N );
789 
790  const size_t index( row + i - column );
791  const RhsIterator last( (~rhs).lowerBound( i, min( index, N ) ) );
792 
793  if( containsDiagonal ) {
794  if( last == (~rhs).end(i) || ( last->index() != index ) || !isOne( last->value() ) )
795  return false;
796  }
797 
798  for( RhsIterator element=(~rhs).begin(i); element!=last; ++element ) {
799  if( !isDefault( element->value() ) )
800  return false;
801  }
802  }
803 
804  return true;
805 }
807 //*************************************************************************************************
808 
809 
810 //*************************************************************************************************
826 template< typename MT1 // Type of the adapted matrix
827  , bool SO // Storage order of the adapted matrix
828  , bool DF // Density flag
829  , typename MT2 > // Type of the right-hand side sparse matrix
830 inline bool tryAssign( const UniUpperMatrix<MT1,SO,DF>& lhs,
831  const SparseMatrix<MT2,true>& rhs, size_t row, size_t column )
832 {
834 
835  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
836  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
837  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
838  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
839 
840  UNUSED_PARAMETER( lhs );
841 
842  typedef typename MT2::ConstIterator RhsIterator;
843 
844  const size_t M( (~rhs).rows() );
845  const size_t N( (~rhs).columns() );
846 
847  if( column + 1UL >= row + M )
848  return true;
849 
850  const size_t jend( min( row + M - column, N ) );
851 
852  for( size_t j=0UL; j<jend; ++j )
853  {
854  const bool containsDiagonal( column + j >= row );
855  const size_t index( ( containsDiagonal )?( column + j - row ):( 0UL ) );
856 
857  const RhsIterator last( (~rhs).end(j) );
858  RhsIterator element( (~rhs).lowerBound( index, j ) );
859 
860  if( containsDiagonal ) {
861  if( element == last || ( element->index() != index ) || !isOne( element->value() ) )
862  return false;
863  ++element;
864  }
865 
866  for( ; element!=last; ++element ) {
867  if( !isDefault( element->value() ) )
868  return false;
869  }
870  }
871 
872  return true;
873 }
875 //*************************************************************************************************
876 
877 
878 //*************************************************************************************************
895 template< typename MT // Type of the adapted matrix
896  , bool SO // Storage order of the adapted matrix
897  , bool DF // Density flag
898  , typename VT > // Type of the right-hand side dense vector
899 inline bool tryAddAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
900  const DenseVector<VT,false>& rhs, 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( (~rhs).size() <= lhs.rows() - row, "Invalid number of rows" );
907 
908  UNUSED_PARAMETER( lhs );
909 
910  const size_t ibegin( ( column <= row )?( 0UL ):( column - row ) );
911 
912  for( size_t i=ibegin; i<(~rhs).size(); ++i ) {
913  if( !isDefault( (~rhs)[i] ) )
914  return false;
915  }
916 
917  return true;
918 }
920 //*************************************************************************************************
921 
922 
923 //*************************************************************************************************
940 template< typename MT // Type of the adapted matrix
941  , bool SO // Storage order of the adapted matrix
942  , bool DF // Density flag
943  , typename VT > // Type of the right-hand side dense vector
944 inline bool tryAddAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
945  const DenseVector<VT,true>& 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( (~rhs).size() <= lhs.columns() - column, "Invalid number of columns" );
952 
953  UNUSED_PARAMETER( lhs );
954 
955  if( row < column )
956  return true;
957 
958  const size_t iend( min( row - column + 1UL, (~rhs).size() ) );
959 
960  for( size_t i=0UL; i<iend; ++i ) {
961  if( !isDefault( (~rhs)[i] ) )
962  return false;
963  }
964 
965  return true;
966 }
968 //*************************************************************************************************
969 
970 
971 //*************************************************************************************************
988 template< typename MT // Type of the adapted matrix
989  , bool SO // Storage order of the adapted matrix
990  , bool DF // Density flag
991  , typename VT > // Type of the right-hand side sparse vector
992 inline bool tryAddAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
993  const SparseVector<VT,false>& rhs, size_t row, size_t column )
994 {
996 
997  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
998  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
999  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.rows() - row, "Invalid number of rows" );
1000 
1001  UNUSED_PARAMETER( lhs );
1002 
1003  typedef typename VT::ConstIterator RhsIterator;
1004 
1005  const RhsIterator last( (~rhs).end() );
1006  RhsIterator element( (~rhs).lowerBound( ( column <= row )?( 0UL ):( column - row ) ) );
1007 
1008  for( ; element!=last; ++element ) {
1009  if( !isDefault( element->value() ) )
1010  return false;
1011  }
1012 
1013  return true;
1014 }
1016 //*************************************************************************************************
1017 
1018 
1019 //*************************************************************************************************
1036 template< typename MT // Type of the adapted matrix
1037  , bool SO // Storage order of the adapted matrix
1038  , bool DF // Density flag
1039  , typename VT > // Type of the right-hand side sparse vector
1040 inline bool tryAddAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
1041  const SparseVector<VT,true>& rhs, size_t row, size_t column )
1042 {
1044 
1045  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1046  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1047  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.columns() - column, "Invalid number of columns" );
1048 
1049  UNUSED_PARAMETER( lhs );
1050 
1051  typedef typename VT::ConstIterator RhsIterator;
1052 
1053  if( row < column )
1054  return true;
1055 
1056  const RhsIterator last( (~rhs).lowerBound( row - column + 1UL ) );
1057 
1058  for( RhsIterator element=(~rhs).begin(); element!=last; ++element ) {
1059  if( !isDefault( element->value() ) )
1060  return false;
1061  }
1062 
1063  return true;
1064 }
1066 //*************************************************************************************************
1067 
1068 
1069 //*************************************************************************************************
1086 template< typename MT1 // Type of the adapted matrix
1087  , bool SO // Storage order of the adapted matrix
1088  , bool DF // Density flag
1089  , typename MT2 > // Type of the right-hand side dense matrix
1090 inline bool tryAddAssign( const UniUpperMatrix<MT1,SO,DF>& lhs,
1091  const DenseMatrix<MT2,false>& rhs, size_t row, size_t column )
1092 {
1094 
1095  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1096  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1097  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
1098  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
1099 
1100  UNUSED_PARAMETER( lhs );
1101 
1102  const size_t M( (~rhs).rows() );
1103  const size_t N( (~rhs).columns() );
1104 
1105  if( column + 1UL >= row + M )
1106  return true;
1107 
1108  const size_t ibegin( ( column <= row )?( 0UL ):( column - row ) );
1109 
1110  for( size_t i=ibegin; i<M; ++i )
1111  {
1112  const size_t jend( min( row + i - column + 1UL, N ) );
1113 
1114  for( size_t j=0UL; j<jend; ++j ) {
1115  if( !isDefault( (~rhs)(i,j) ) )
1116  return false;
1117  }
1118  }
1119 
1120  return true;
1121 }
1123 //*************************************************************************************************
1124 
1125 
1126 //*************************************************************************************************
1143 template< typename MT1 // Type of the adapted matrix
1144  , bool SO // Storage order of the adapted matrix
1145  , bool DF // Density flag
1146  , typename MT2 > // Type of the right-hand side dense matrix
1147 inline bool tryAddAssign( const UniUpperMatrix<MT1,SO,DF>& lhs,
1148  const DenseMatrix<MT2,true>& rhs, size_t row, size_t column )
1149 {
1151 
1152  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1153  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1154  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
1155  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
1156 
1157  UNUSED_PARAMETER( lhs );
1158 
1159  const size_t M( (~rhs).rows() );
1160  const size_t N( (~rhs).columns() );
1161 
1162  if( column + 1UL >= row + M )
1163  return true;
1164 
1165  const size_t jend( min( row + M - column, N ) );
1166 
1167  for( size_t j=0UL; j<jend; ++j )
1168  {
1169  const bool containsDiagonal( column + j >= row );
1170  const size_t ibegin( ( containsDiagonal )?( column + j - row ):( 0UL ) );
1171 
1172  for( size_t i=ibegin; i<M; ++i ) {
1173  if( !isDefault( (~rhs)(i,j) ) )
1174  return false;
1175  }
1176  }
1177 
1178  return true;
1179 }
1181 //*************************************************************************************************
1182 
1183 
1184 //*************************************************************************************************
1201 template< typename MT1 // Type of the adapted matrix
1202  , bool SO // Storage order of the adapted matrix
1203  , bool DF // Density flag
1204  , typename MT2 > // Type of the right-hand side sparse matrix
1205 inline bool tryAddAssign( const UniUpperMatrix<MT1,SO,DF>& lhs,
1206  const SparseMatrix<MT2,false>& rhs, size_t row, size_t column )
1207 {
1209 
1210  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1211  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1212  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
1213  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
1214 
1215  UNUSED_PARAMETER( lhs );
1216 
1217  typedef typename MT2::ConstIterator RhsIterator;
1218 
1219  const size_t M( (~rhs).rows() );
1220  const size_t N( (~rhs).columns() );
1221 
1222  if( column + 1UL >= row + M )
1223  return true;
1224 
1225  const size_t ibegin( ( column < row )?( 0UL ):( column - row ) );
1226 
1227  for( size_t i=ibegin; i<M; ++i )
1228  {
1229  const size_t index( row + i - column + 1UL );
1230  const RhsIterator last( (~rhs).lowerBound( i, min( index, N ) ) );
1231 
1232  for( RhsIterator element=(~rhs).begin(i); element!=last; ++element ) {
1233  if( !isDefault( element->value() ) )
1234  return false;
1235  }
1236  }
1237 
1238  return true;
1239 }
1241 //*************************************************************************************************
1242 
1243 
1244 //*************************************************************************************************
1261 template< typename MT1 // Type of the adapted matrix
1262  , bool SO // Storage order of the adapted matrix
1263  , bool DF // Density flag
1264  , typename MT2 > // Type of the right-hand side sparse matrix
1265 inline bool tryAddAssign( const UniUpperMatrix<MT1,SO,DF>& lhs,
1266  const SparseMatrix<MT2,true>& rhs, size_t row, size_t column )
1267 {
1269 
1270  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1271  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1272  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
1273  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
1274 
1275  UNUSED_PARAMETER( lhs );
1276 
1277  typedef typename MT2::ConstIterator RhsIterator;
1278 
1279  const size_t M( (~rhs).rows() );
1280  const size_t N( (~rhs).columns() );
1281 
1282  if( column + 1UL >= row + M )
1283  return true;
1284 
1285  const size_t jend( min( row + M - column, N ) );
1286 
1287  for( size_t j=0UL; j<jend; ++j )
1288  {
1289  const bool containsDiagonal( column + j >= row );
1290  const size_t index( ( containsDiagonal )?( column + j - row ):( 0UL ) );
1291 
1292  const RhsIterator last( (~rhs).end(j) );
1293  RhsIterator element( (~rhs).lowerBound( index, j ) );
1294 
1295  for( ; element!=last; ++element ) {
1296  if( !isDefault( element->value() ) )
1297  return false;
1298  }
1299  }
1300 
1301  return true;
1302 }
1304 //*************************************************************************************************
1305 
1306 
1307 //*************************************************************************************************
1324 template< typename MT // Type of the adapted matrix
1325  , bool SO // Storage order of the adapted matrix
1326  , bool DF // Density flag
1327  , typename VT // Type of the right-hand side vector
1328  , bool TF > // Transpose flag of the right-hand side vector
1329 inline bool trySubAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
1330  const Vector<VT,TF>& rhs, size_t row, size_t column )
1331 {
1332  return tryAddAssign( lhs, ~rhs, row, column );
1333 }
1335 //*************************************************************************************************
1336 
1337 
1338 //*************************************************************************************************
1355 template< typename MT1 // Type of the adapted matrix
1356  , bool SO1 // Storage order of the adapted matrix
1357  , bool DF // Density flag
1358  , typename MT2 // Type of the right-hand side matrix
1359  , bool SO2 > // Storage order of the right-hand side matrix
1360 inline bool trySubAssign( const UniUpperMatrix<MT1,SO1,DF>& lhs,
1361  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
1362 {
1363  return tryAddAssign( lhs, ~rhs, row, column );
1364 }
1366 //*************************************************************************************************
1367 
1368 
1369 //*************************************************************************************************
1386 template< 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 inline bool tryMultAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
1391  const Vector<VT,false>& rhs, size_t row, size_t column )
1392 {
1394 
1395  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1396  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1397  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.rows() - row, "Invalid number of rows" );
1398 
1399  UNUSED_PARAMETER( lhs );
1400 
1401  return ( column < row || (~rhs).size() <= column - row || isOne( (~rhs)[column-row] ) );
1402 }
1404 //*************************************************************************************************
1405 
1406 
1407 //*************************************************************************************************
1424 template< typename MT // Type of the adapted matrix
1425  , bool SO // Storage order of the adapted matrix
1426  , bool DF // Density flag
1427  , typename VT > // Type of the right-hand side vector
1428 inline bool tryMultAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
1429  const Vector<VT,true>& rhs, size_t row, size_t column )
1430 {
1432 
1433  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1434  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1435  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.columns() - column, "Invalid number of columns" );
1436 
1437  UNUSED_PARAMETER( lhs );
1438 
1439  return ( row < column || (~rhs).size() <= row - column || isOne( (~rhs)[row-column] ) );
1440 }
1442 //*************************************************************************************************
1443 
1444 
1445 //*************************************************************************************************
1461 template< typename MT // Type of the adapted matrix
1462  , bool SO // Storage order of the adapted matrix
1463  , bool DF // Density flag
1464  , typename VT // Type of the right-hand side vector
1465  , bool TF > // Transpose flag of the right-hand side vector
1466 inline bool tryDivAssign( const UniUpperMatrix<MT,SO,DF>& lhs,
1467  const Vector<VT,TF>& rhs, size_t row, size_t column )
1468 {
1469  return tryMultAssign( lhs, ~rhs, row, column );
1470 }
1472 //*************************************************************************************************
1473 
1474 
1475 //*************************************************************************************************
1489 template< typename MT // Type of the adapted matrix
1490  , bool SO // Storage order of the adapted matrix
1491  , bool DF > // Density flag
1492 inline MT& derestrict( UniUpperMatrix<MT,SO,DF>& m )
1493 {
1494  return m.matrix_;
1495 }
1497 //*************************************************************************************************
1498 
1499 
1500 
1501 
1502 //=================================================================================================
1503 //
1504 // ROWS SPECIALIZATIONS
1505 //
1506 //=================================================================================================
1507 
1508 //*************************************************************************************************
1510 template< typename MT, bool SO, bool DF >
1511 struct Rows< UniUpperMatrix<MT,SO,DF> > : public Rows<MT>
1512 {};
1514 //*************************************************************************************************
1515 
1516 
1517 
1518 
1519 //=================================================================================================
1520 //
1521 // COLUMNS SPECIALIZATIONS
1522 //
1523 //=================================================================================================
1524 
1525 //*************************************************************************************************
1527 template< typename MT, bool SO, bool DF >
1528 struct Columns< UniUpperMatrix<MT,SO,DF> > : public Columns<MT>
1529 {};
1531 //*************************************************************************************************
1532 
1533 
1534 
1535 
1536 //=================================================================================================
1537 //
1538 // ISSQUARE SPECIALIZATIONS
1539 //
1540 //=================================================================================================
1541 
1542 //*************************************************************************************************
1544 template< typename MT, bool SO, bool DF >
1545 struct IsSquare< UniUpperMatrix<MT,SO,DF> > : public TrueType
1546 {};
1548 //*************************************************************************************************
1549 
1550 
1551 
1552 
1553 //=================================================================================================
1554 //
1555 // ISUNIUPPER SPECIALIZATIONS
1556 //
1557 //=================================================================================================
1558 
1559 //*************************************************************************************************
1561 template< typename MT, bool SO, bool DF >
1562 struct IsUniUpper< UniUpperMatrix<MT,SO,DF> > : public TrueType
1563 {};
1565 //*************************************************************************************************
1566 
1567 
1568 
1569 
1570 //=================================================================================================
1571 //
1572 // ISADAPTOR SPECIALIZATIONS
1573 //
1574 //=================================================================================================
1575 
1576 //*************************************************************************************************
1578 template< typename MT, bool SO, bool DF >
1579 struct IsAdaptor< UniUpperMatrix<MT,SO,DF> > : public TrueType
1580 {};
1582 //*************************************************************************************************
1583 
1584 
1585 
1586 
1587 //=================================================================================================
1588 //
1589 // ISRESTRICTED SPECIALIZATIONS
1590 //
1591 //=================================================================================================
1592 
1593 //*************************************************************************************************
1595 template< typename MT, bool SO, bool DF >
1596 struct IsRestricted< UniUpperMatrix<MT,SO,DF> > : public TrueType
1597 {};
1599 //*************************************************************************************************
1600 
1601 
1602 
1603 
1604 //=================================================================================================
1605 //
1606 // HASCONSTDATAACCESS SPECIALIZATIONS
1607 //
1608 //=================================================================================================
1609 
1610 //*************************************************************************************************
1612 template< typename MT, bool SO >
1613 struct HasConstDataAccess< UniUpperMatrix<MT,SO,true> > : public TrueType
1614 {};
1616 //*************************************************************************************************
1617 
1618 
1619 
1620 
1621 //=================================================================================================
1622 //
1623 // ISALIGNED SPECIALIZATIONS
1624 //
1625 //=================================================================================================
1626 
1627 //*************************************************************************************************
1629 template< typename MT, bool SO, bool DF >
1630 struct IsAligned< UniUpperMatrix<MT,SO,DF> > : public BoolConstant< IsAligned<MT>::value >
1631 {};
1633 //*************************************************************************************************
1634 
1635 
1636 
1637 
1638 //=================================================================================================
1639 //
1640 // ISPADDED SPECIALIZATIONS
1641 //
1642 //=================================================================================================
1643 
1644 //*************************************************************************************************
1646 template< typename MT, bool SO, bool DF >
1647 struct IsPadded< UniUpperMatrix<MT,SO,DF> > : public BoolConstant< IsPadded<MT>::value >
1648 {};
1650 //*************************************************************************************************
1651 
1652 
1653 
1654 
1655 //=================================================================================================
1656 //
1657 // ISRESIZABLE SPECIALIZATIONS
1658 //
1659 //=================================================================================================
1660 
1661 //*************************************************************************************************
1663 template< typename MT, bool SO, bool DF >
1664 struct IsResizable< UniUpperMatrix<MT,SO,DF> > : public BoolConstant< IsResizable<MT>::value >
1665 {};
1667 //*************************************************************************************************
1668 
1669 
1670 
1671 
1672 //=================================================================================================
1673 //
1674 // REMOVEADAPTOR SPECIALIZATIONS
1675 //
1676 //=================================================================================================
1677 
1678 //*************************************************************************************************
1680 template< typename MT, bool SO, bool DF >
1681 struct RemoveAdaptor< UniUpperMatrix<MT,SO,DF> >
1682 {
1683  using Type = MT;
1684 };
1686 //*************************************************************************************************
1687 
1688 
1689 
1690 
1691 //=================================================================================================
1692 //
1693 // DERESTRICTTRAIT SPECIALIZATIONS
1694 //
1695 //=================================================================================================
1696 
1697 //*************************************************************************************************
1699 template< typename MT, bool SO, bool DF >
1700 struct DerestrictTrait< UniUpperMatrix<MT,SO,DF> >
1701 {
1702  using Type = MT&;
1703 };
1705 //*************************************************************************************************
1706 
1707 
1708 
1709 
1710 //=================================================================================================
1711 //
1712 // ADDTRAIT SPECIALIZATIONS
1713 //
1714 //=================================================================================================
1715 
1716 //*************************************************************************************************
1718 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1719 struct AddTrait< UniUpperMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
1720 {
1721  using Type = AddTrait_< MT, StaticMatrix<T,M,N,SO2> >;
1722 };
1723 
1724 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1725 struct AddTrait< StaticMatrix<T,M,N,SO1>, UniUpperMatrix<MT,SO2,DF> >
1726 {
1727  using Type = AddTrait_< StaticMatrix<T,M,N,SO1>, MT >;
1728 };
1729 
1730 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1731 struct AddTrait< UniUpperMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
1732 {
1733  using Type = AddTrait_< MT, HybridMatrix<T,M,N,SO2> >;
1734 };
1735 
1736 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1737 struct AddTrait< HybridMatrix<T,M,N,SO1>, UniUpperMatrix<MT,SO2,DF> >
1738 {
1739  using Type = AddTrait_< HybridMatrix<T,M,N,SO1>, MT >;
1740 };
1741 
1742 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1743 struct AddTrait< UniUpperMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
1744 {
1745  using Type = AddTrait_< MT, DynamicMatrix<T,SO2> >;
1746 };
1747 
1748 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1749 struct AddTrait< DynamicMatrix<T,SO1>, UniUpperMatrix<MT,SO2,DF> >
1750 {
1751  using Type = AddTrait_< DynamicMatrix<T,SO1>, MT >;
1752 };
1753 
1754 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
1755 struct AddTrait< UniUpperMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
1756 {
1757  using Type = AddTrait_< MT, CustomMatrix<T,AF,PF,SO2> >;
1758 };
1759 
1760 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
1761 struct AddTrait< CustomMatrix<T,AF,PF,SO1>, UniUpperMatrix<MT,SO2,DF> >
1762 {
1763  using Type = AddTrait_< CustomMatrix<T,AF,PF,SO1>, MT >;
1764 };
1765 
1766 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1767 struct AddTrait< UniUpperMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
1768 {
1769  using Type = AddTrait_< MT, CompressedMatrix<T,SO2> >;
1770 };
1771 
1772 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1773 struct AddTrait< CompressedMatrix<T,SO1>, UniUpperMatrix<MT,SO2,DF> >
1774 {
1775  using Type = AddTrait_< CompressedMatrix<T,SO1>, MT >;
1776 };
1777 
1778 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
1779 struct AddTrait< UniUpperMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
1780 {
1781  using Type = AddTrait_<MT1,MT2>;
1782 };
1783 
1784 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
1785 struct AddTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, UniUpperMatrix<MT2,SO2,DF2> >
1786 {
1787  using Type = AddTrait_<MT1,MT2>;
1788 };
1789 
1790 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1791 struct AddTrait< UniUpperMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1792 {
1793  using Type = AddTrait_<MT1,MT2>;
1794 };
1795 
1796 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1797 struct AddTrait< HermitianMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
1798 {
1799  using Type = AddTrait_<MT1,MT2>;
1800 };
1801 
1802 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1803 struct AddTrait< UniUpperMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
1804 {
1805  using Type = AddTrait_<MT1,MT2>;
1806 };
1807 
1808 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1809 struct AddTrait< LowerMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
1810 {
1811  using Type = AddTrait_<MT1,MT2>;
1812 };
1813 
1814 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1815 struct AddTrait< UniUpperMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
1816 {
1817  using Type = AddTrait_<MT1,MT2>;
1818 };
1819 
1820 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1821 struct AddTrait< UniLowerMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
1822 {
1823  using Type = AddTrait_<MT1,MT2>;
1824 };
1825 
1826 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1827 struct AddTrait< UniUpperMatrix<MT1,SO1,DF1>, StrictlyLowerMatrix<MT2,SO2,DF2> >
1828 {
1829  using Type = AddTrait_<MT1,MT2>;
1830 };
1831 
1832 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1833 struct AddTrait< StrictlyLowerMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
1834 {
1835  using Type = AddTrait_<MT1,MT2>;
1836 };
1837 
1838 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1839 struct AddTrait< UniUpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1840 {
1841  using Type = UpperMatrix< AddTrait_<MT1,MT2> >;
1842 };
1843 
1844 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1845 struct AddTrait< UpperMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
1846 {
1847  using Type = UpperMatrix< AddTrait_<MT1,MT2> >;
1848 };
1849 
1850 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1851 struct AddTrait< UniUpperMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
1852 {
1853  using Type = UpperMatrix< AddTrait_<MT1,MT2> >;
1854 };
1856 //*************************************************************************************************
1857 
1858 
1859 
1860 
1861 //=================================================================================================
1862 //
1863 // SUBTRAIT SPECIALIZATIONS
1864 //
1865 //=================================================================================================
1866 
1867 //*************************************************************************************************
1869 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1870 struct SubTrait< UniUpperMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
1871 {
1872  using Type = SubTrait_< MT, StaticMatrix<T,M,N,SO2> >;
1873 };
1874 
1875 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1876 struct SubTrait< StaticMatrix<T,M,N,SO1>, UniUpperMatrix<MT,SO2,DF> >
1877 {
1878  using Type = SubTrait_< StaticMatrix<T,M,N,SO1>, MT >;
1879 };
1880 
1881 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1882 struct SubTrait< UniUpperMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
1883 {
1884  using Type = SubTrait_< MT, HybridMatrix<T,M,N,SO2> >;
1885 };
1886 
1887 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1888 struct SubTrait< HybridMatrix<T,M,N,SO1>, UniUpperMatrix<MT,SO2,DF> >
1889 {
1890  using Type = SubTrait_< HybridMatrix<T,M,N,SO1>, MT >;
1891 };
1892 
1893 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1894 struct SubTrait< UniUpperMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
1895 {
1896  using Type = SubTrait_< MT, DynamicMatrix<T,SO2> >;
1897 };
1898 
1899 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1900 struct SubTrait< DynamicMatrix<T,SO1>, UniUpperMatrix<MT,SO2,DF> >
1901 {
1902  using Type = SubTrait_< DynamicMatrix<T,SO1>, MT >;
1903 };
1904 
1905 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
1906 struct SubTrait< UniUpperMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
1907 {
1908  using Type = SubTrait_< MT, CustomMatrix<T,AF,PF,SO2> >;
1909 };
1910 
1911 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
1912 struct SubTrait< CustomMatrix<T,AF,PF,SO1>, UniUpperMatrix<MT,SO2,DF> >
1913 {
1914  using Type = SubTrait_< CustomMatrix<T,AF,PF,SO1>, MT >;
1915 };
1916 
1917 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1918 struct SubTrait< UniUpperMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
1919 {
1920  using Type = SubTrait_< MT, CompressedMatrix<T,SO2> >;
1921 };
1922 
1923 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1924 struct SubTrait< CompressedMatrix<T,SO1>, UniUpperMatrix<MT,SO2,DF> >
1925 {
1926  using Type = SubTrait_< CompressedMatrix<T,SO1>, MT >;
1927 };
1928 
1929 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
1930 struct SubTrait< UniUpperMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
1931 {
1932  using Type = SubTrait_<MT1,MT2>;
1933 };
1934 
1935 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
1936 struct SubTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, UniUpperMatrix<MT2,SO2,DF2> >
1937 {
1938  using Type = SubTrait_<MT1,MT2>;
1939 };
1940 
1941 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1942 struct SubTrait< UniUpperMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1943 {
1944  using Type = SubTrait_<MT1,MT2>;
1945 };
1946 
1947 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1948 struct SubTrait< HermitianMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
1949 {
1950  using Type = SubTrait_<MT1,MT2>;
1951 };
1952 
1953 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1954 struct SubTrait< UniUpperMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
1955 {
1956  using Type = SubTrait_<MT1,MT2>;
1957 };
1958 
1959 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1960 struct SubTrait< LowerMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
1961 {
1962  using Type = SubTrait_<MT1,MT2>;
1963 };
1964 
1965 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1966 struct SubTrait< UniUpperMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
1967 {
1968  using Type = SubTrait_<MT1,MT2>;
1969 };
1970 
1971 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1972 struct SubTrait< UniLowerMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
1973 {
1974  using Type = SubTrait_<MT1,MT2>;
1975 };
1976 
1977 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1978 struct SubTrait< UniUpperMatrix<MT1,SO1,DF1>, StrictlyLowerMatrix<MT2,SO2,DF2> >
1979 {
1980  using Type = SubTrait_<MT1,MT2>;
1981 };
1982 
1983 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1984 struct SubTrait< StrictlyLowerMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
1985 {
1986  using Type = SubTrait_<MT1,MT2>;
1987 };
1988 
1989 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1990 struct SubTrait< UniUpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1991 {
1992  using Type = UpperMatrix< SubTrait_<MT1,MT2> >;
1993 };
1994 
1995 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1996 struct SubTrait< UpperMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
1997 {
1998  using Type = UpperMatrix< SubTrait_<MT1,MT2> >;
1999 };
2000 
2001 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2002 struct SubTrait< UniUpperMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
2003 {
2004  using Type = UpperMatrix< SubTrait_<MT1,MT2> >;
2005 };
2007 //*************************************************************************************************
2008 
2009 
2010 
2011 
2012 //=================================================================================================
2013 //
2014 // MULTTRAIT SPECIALIZATIONS
2015 //
2016 //=================================================================================================
2017 
2018 //*************************************************************************************************
2020 template< typename MT, bool SO, bool DF, typename T >
2021 struct MultTrait< UniUpperMatrix<MT,SO,DF>, T, EnableIf_< IsNumeric<T> > >
2022 {
2023  using Type = UpperMatrix< MultTrait_<MT,T> >;
2024 };
2025 
2026 template< typename T, typename MT, bool SO, bool DF >
2027 struct MultTrait< T, UniUpperMatrix<MT,SO,DF>, EnableIf_< IsNumeric<T> > >
2028 {
2029  using Type = UpperMatrix< MultTrait_<T,MT> >;
2030 };
2031 
2032 template< typename MT, bool SO, bool DF, typename T, size_t N >
2033 struct MultTrait< UniUpperMatrix<MT,SO,DF>, StaticVector<T,N,false> >
2034 {
2035  using Type = MultTrait_< MT, StaticVector<T,N,false> >;
2036 };
2037 
2038 template< typename T, size_t N, typename MT, bool SO, bool DF >
2039 struct MultTrait< StaticVector<T,N,true>, UniUpperMatrix<MT,SO,DF> >
2040 {
2041  using Type = MultTrait_< StaticVector<T,N,true>, MT >;
2042 };
2043 
2044 template< typename MT, bool SO, bool DF, typename T, size_t N >
2045 struct MultTrait< UniUpperMatrix<MT,SO,DF>, HybridVector<T,N,false> >
2046 {
2047  using Type = MultTrait_< MT, HybridVector<T,N,false> >;
2048 };
2049 
2050 template< typename T, size_t N, typename MT, bool SO, bool DF >
2051 struct MultTrait< HybridVector<T,N,true>, UniUpperMatrix<MT,SO,DF> >
2052 {
2053  using Type = MultTrait_< HybridVector<T,N,true>, MT >;
2054 };
2055 
2056 template< typename MT, bool SO, bool DF, typename T >
2057 struct MultTrait< UniUpperMatrix<MT,SO,DF>, DynamicVector<T,false> >
2058 {
2059  using Type = MultTrait_< MT, DynamicVector<T,false> >;
2060 };
2061 
2062 template< typename T, typename MT, bool SO, bool DF >
2063 struct MultTrait< DynamicVector<T,true>, UniUpperMatrix<MT,SO,DF> >
2064 {
2065  using Type = MultTrait_< DynamicVector<T,true>, MT >;
2066 };
2067 
2068 template< typename MT, bool SO, bool DF, typename T, bool AF, bool PF >
2069 struct MultTrait< UniUpperMatrix<MT,SO,DF>, CustomVector<T,AF,PF,false> >
2070 {
2071  using Type = MultTrait_< MT, CustomVector<T,AF,PF,false> >;
2072 };
2073 
2074 template< typename T, bool AF, bool PF, typename MT, bool SO, bool DF >
2075 struct MultTrait< CustomVector<T,AF,PF,true>, UniUpperMatrix<MT,SO,DF> >
2076 {
2077  using Type = MultTrait_< CustomVector<T,AF,PF,true>, MT >;
2078 };
2079 
2080 template< typename MT, bool SO, bool DF, typename T >
2081 struct MultTrait< UniUpperMatrix<MT,SO,DF>, CompressedVector<T,false> >
2082 {
2083  using Type = MultTrait_< MT, CompressedVector<T,false> >;
2084 };
2085 
2086 template< typename T, typename MT, bool SO, bool DF >
2087 struct MultTrait< CompressedVector<T,true>, UniUpperMatrix<MT,SO,DF> >
2088 {
2089  using Type = MultTrait_< CompressedVector<T,true>, MT >;
2090 };
2091 
2092 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
2093 struct MultTrait< UniUpperMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
2094 {
2095  using Type = MultTrait_< MT, StaticMatrix<T,M,N,SO2> >;
2096 };
2097 
2098 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
2099 struct MultTrait< StaticMatrix<T,M,N,SO1>, UniUpperMatrix<MT,SO2,DF> >
2100 {
2101  using Type = MultTrait_< StaticMatrix<T,M,N,SO1>, MT >;
2102 };
2103 
2104 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
2105 struct MultTrait< UniUpperMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
2106 {
2107  using Type = MultTrait_< MT, HybridMatrix<T,M,N,SO2> >;
2108 };
2109 
2110 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
2111 struct MultTrait< HybridMatrix<T,M,N,SO1>, UniUpperMatrix<MT,SO2,DF> >
2112 {
2113  using Type = MultTrait_< HybridMatrix<T,M,N,SO1>, MT >;
2114 };
2115 
2116 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
2117 struct MultTrait< UniUpperMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
2118 {
2119  using Type = MultTrait_< MT, DynamicMatrix<T,SO2> >;
2120 };
2121 
2122 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
2123 struct MultTrait< DynamicMatrix<T,SO1>, UniUpperMatrix<MT,SO2,DF> >
2124 {
2125  using Type = MultTrait_< DynamicMatrix<T,SO1>, MT >;
2126 };
2127 
2128 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
2129 struct MultTrait< UniUpperMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
2130 {
2131  using Type = MultTrait_< MT, CustomMatrix<T,AF,PF,SO2> >;
2132 };
2133 
2134 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
2135 struct MultTrait< CustomMatrix<T,AF,PF,SO1>, UniUpperMatrix<MT,SO2,DF> >
2136 {
2137  using Type = MultTrait_< CustomMatrix<T,AF,PF,SO1>, MT >;
2138 };
2139 
2140 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
2141 struct MultTrait< UniUpperMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
2142 {
2143  using Type = MultTrait_< MT, CompressedMatrix<T,SO2> >;
2144 };
2145 
2146 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
2147 struct MultTrait< CompressedMatrix<T,SO1>, UniUpperMatrix<MT,SO2,DF> >
2148 {
2149  using Type = MultTrait_< CompressedMatrix<T,SO1>, MT >;
2150 };
2151 
2152 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
2153 struct MultTrait< UniUpperMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
2154 {
2155  using Type = MultTrait_<MT1,MT2>;
2156 };
2157 
2158 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
2159 struct MultTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, UniUpperMatrix<MT2,SO2,DF2> >
2160 {
2161  using Type = MultTrait_<MT1,MT2>;
2162 };
2163 
2164 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2165 struct MultTrait< UniUpperMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
2166 {
2167  using Type = MultTrait_<MT1,MT2>;
2168 };
2169 
2170 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2171 struct MultTrait< HermitianMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
2172 {
2173  using Type = MultTrait_<MT1,MT2>;
2174 };
2175 
2176 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2177 struct MultTrait< UniUpperMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
2178 {
2179  using Type = MultTrait_<MT1,MT2>;
2180 };
2181 
2182 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2183 struct MultTrait< LowerMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
2184 {
2185  using Type = MultTrait_<MT1,MT2>;
2186 };
2187 
2188 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2189 struct MultTrait< UniUpperMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
2190 {
2191  using Type = MultTrait_<MT1,MT2>;
2192 };
2193 
2194 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2195 struct MultTrait< UniLowerMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
2196 {
2197  using Type = MultTrait_<MT1,MT2>;
2198 };
2199 
2200 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2201 struct MultTrait< UniUpperMatrix<MT1,SO1,DF1>, StrictlyLowerMatrix<MT2,SO2,DF2> >
2202 {
2203  using Type = MultTrait_<MT1,MT2>;
2204 };
2205 
2206 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2207 struct MultTrait< StrictlyLowerMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
2208 {
2209  using Type = MultTrait_<MT1,MT2>;
2210 };
2211 
2212 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2213 struct MultTrait< UniUpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
2214 {
2215  using Type = UpperMatrix< MultTrait_<MT1,MT2> >;
2216 };
2217 
2218 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2219 struct MultTrait< UpperMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
2220 {
2221  using Type = UpperMatrix< MultTrait_<MT1,MT2> >;
2222 };
2223 
2224 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2225 struct MultTrait< UniUpperMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
2226 {
2227  using Type = UniUpperMatrix< MultTrait_<MT1,MT2> >;
2228 };
2230 //*************************************************************************************************
2231 
2232 
2233 
2234 
2235 //=================================================================================================
2236 //
2237 // DIVTRAIT SPECIALIZATIONS
2238 //
2239 //=================================================================================================
2240 
2241 //*************************************************************************************************
2243 template< typename MT, bool SO, bool DF, typename T >
2244 struct DivTrait< UniUpperMatrix<MT,SO,DF>, T, EnableIf_< IsNumeric<T> > >
2245 {
2246  using Type = UpperMatrix< DivTrait_<MT,T> >;
2247 };
2249 //*************************************************************************************************
2250 
2251 
2252 
2253 
2254 //=================================================================================================
2255 //
2256 // FOREACHTRAIT SPECIALIZATIONS
2257 //
2258 //=================================================================================================
2259 
2260 //*************************************************************************************************
2262 template< typename MT, bool SO, bool DF, typename ET >
2263 struct ForEachTrait< UniUpperMatrix<MT,SO,DF>, Pow<ET> >
2264 {
2265  using Type = UniUpperMatrix< ForEachTrait_< MT, Pow<ET> > >;
2266 };
2268 //*************************************************************************************************
2269 
2270 
2271 
2272 
2273 //=================================================================================================
2274 //
2275 // MATHTRAIT SPECIALIZATIONS
2276 //
2277 //=================================================================================================
2278 
2279 //*************************************************************************************************
2281 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2282 struct MathTrait< UniUpperMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
2283 {
2284  using HighType = UniUpperMatrix< typename MathTrait<MT1,MT2>::HighType >;
2285  using LowType = UniUpperMatrix< typename MathTrait<MT1,MT2>::LowType >;
2286 };
2288 //*************************************************************************************************
2289 
2290 
2291 
2292 
2293 //=================================================================================================
2294 //
2295 // SUBMATRIXTRAIT SPECIALIZATIONS
2296 //
2297 //=================================================================================================
2298 
2299 //*************************************************************************************************
2301 template< typename MT, bool SO, bool DF >
2302 struct SubmatrixTrait< UniUpperMatrix<MT,SO,DF> >
2303 {
2304  using Type = SubmatrixTrait_<MT>;
2305 };
2307 //*************************************************************************************************
2308 
2309 
2310 
2311 
2312 //=================================================================================================
2313 //
2314 // ROWTRAIT SPECIALIZATIONS
2315 //
2316 //=================================================================================================
2317 
2318 //*************************************************************************************************
2320 template< typename MT, bool SO, bool DF >
2321 struct RowTrait< UniUpperMatrix<MT,SO,DF> >
2322 {
2323  using Type = RowTrait_<MT>;
2324 };
2326 //*************************************************************************************************
2327 
2328 
2329 
2330 
2331 //=================================================================================================
2332 //
2333 // COLUMNTRAIT SPECIALIZATIONS
2334 //
2335 //=================================================================================================
2336 
2337 //*************************************************************************************************
2339 template< typename MT, bool SO, bool DF >
2340 struct ColumnTrait< UniUpperMatrix<MT,SO,DF> >
2341 {
2342  using Type = ColumnTrait_<MT>;
2343 };
2345 //*************************************************************************************************
2346 
2347 } // namespace blaze
2348 
2349 #endif
BoolConstant< false > FalseType
Type/value traits base class.The FalseType class is used as base class for type traits and value trai...
Definition: FalseType.h:61
bool isOne(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is 1.
Definition: DiagonalProxy.h:635
Header file for auxiliary alias declarations.
Header file for mathematical functions.
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.
Header file for the row trait.
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector) noexcept
Returns the current size/dimension of the vector.
Definition: Vector.h:258
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:188
Flag for the inversion of a diagonal matrix.
Definition: InversionFlag.h:115
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:533
Flag for the inversion of a general matrix (same as byLU).
Definition: InversionFlag.h:108
Flag for the inversion of a upper unitriangular matrix.
Definition: InversionFlag.h:114
const ElementType_< MT > min(const DenseMatrix< MT, SO > &dm)
Returns the smallest element of the dense matrix.
Definition: DenseMatrix.h:1669
#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
BoolConstant< true > TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: TrueType.h:61
Flag for the inversion of a upper triangular matrix.
Definition: InversionFlag.h:113
Constraint on the data type.
DisableIf_< Or< IsComputation< MT >, IsTransExpr< 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:126
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:573
Constraint on the data type.
Header file for the IsSquare type trait.
void invert(const HermitianProxy< MT > &proxy)
In-place inversion of the represented element.
Definition: HermitianProxy.h:741
Constraint on the data type.
Flag for the LU-based matrix inversion.
Definition: InversionFlag.h:103
Header file for the multiplication trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for all forward declarations of the math module.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2647
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.
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:330
#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:538
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:254
Header file for the RemoveAdaptor type trait.
Constraint on the data type.
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.
InversionFlag
Inversion flag.The InversionFlag type enumeration represents the different types of matrix inversion ...
Definition: InversionFlag.h:101
Header file for the DerestrictTrait class template.
Flag for the inversion of a lower triangular matrix.
Definition: InversionFlag.h:111
Constraint on the data type.
Header file for the IsNumeric type trait.
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
DisableIf_< Or< IsComputation< MT >, IsTransExpr< 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:126
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.
Header file for the addition trait.
Header file for the division trait.
Header file for the submatrix trait.
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_LOWER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a lower triangular matrix type...
Definition: Lower.h:81
Header file for the 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:258
#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
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.The BoolConstant class template represents ...
Definition: IntegralConstant.h:100
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:223
Header file for the mathematical trait.
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:314
Header file for the for-each trait.
UniUpperMatrix specialization for dense matrices.
Header file for the IntegralConstant class template.
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:240
#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
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.
Flag for the inversion of a lower unitriangular matrix.
Definition: InversionFlag.h:112
Header file for the IsResizable type trait.
Header file for the IsRestricted type trait.
#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 TrueType type/value trait base class.
bool isIdentity(const DenseMatrix< MT, SO > &dm)
Checks if the give dense matrix is an identity matrix.
Definition: DenseMatrix.h:1593