UniLowerMatrix.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_ADAPTORS_UNILOWERMATRIX_H_
36 #define _BLAZE_MATH_ADAPTORS_UNILOWERMATRIX_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
55 #include <blaze/math/Forward.h>
56 #include <blaze/math/Functions.h>
59 #include <blaze/math/shims/IsOne.h>
80 #include <blaze/util/Assert.h>
81 #include <blaze/util/EnableIf.h>
83 #include <blaze/util/Unused.h>
85 
86 
87 namespace blaze {
88 
89 //=================================================================================================
90 //
91 // UNILOWERMATRIX OPERATORS
92 //
93 //=================================================================================================
94 
95 //*************************************************************************************************
98 template< typename MT, bool SO, bool DF >
99 inline void reset( UniLowerMatrix<MT,SO,DF>& m );
100 
101 template< typename MT, bool SO, bool DF >
102 inline void reset( UniLowerMatrix<MT,SO,DF>& m, size_t i );
103 
104 template< typename MT, bool SO, bool DF >
105 inline void clear( UniLowerMatrix<MT,SO,DF>& m );
106 
107 template< typename MT, bool SO, bool DF >
108 inline bool isDefault( const UniLowerMatrix<MT,SO,DF>& m );
109 
110 template< typename MT, bool SO, bool DF >
111 inline bool isIntact( const UniLowerMatrix<MT,SO,DF>& m );
112 
113 template< typename MT, bool SO, bool DF >
114 inline void swap( UniLowerMatrix<MT,SO,DF>& a, UniLowerMatrix<MT,SO,DF>& b ) /* throw() */;
116 //*************************************************************************************************
117 
118 
119 //*************************************************************************************************
126 template< typename MT // Type of the adapted matrix
127  , bool SO // Storage order of the adapted matrix
128  , bool DF > // Density flag
130 {
131  m.reset();
132 }
133 //*************************************************************************************************
134 
135 
136 //*************************************************************************************************
149 template< typename MT // Type of the adapted matrix
150  , bool SO // Storage order of the adapted matrix
151  , bool DF > // Density flag
152 inline void reset( UniLowerMatrix<MT,SO,DF>& m, size_t i )
153 {
154  m.reset( i );
155 }
156 //*************************************************************************************************
157 
158 
159 //*************************************************************************************************
166 template< typename MT // Type of the adapted matrix
167  , bool SO // Storage order of the adapted matrix
168  , bool DF > // Density flag
170 {
171  m.clear();
172 }
173 //*************************************************************************************************
174 
175 
176 //*************************************************************************************************
186 template< typename MT // Type of the adapted matrix
187  , bool SO // Storage order of the adapted matrix
188  , bool DF > // Density flag
189 inline bool isDefault_backend( const UniLowerMatrix<MT,SO,DF>& m, TrueType )
190 {
191  return ( m.rows() == 0UL );
192 }
194 //*************************************************************************************************
195 
196 
197 //*************************************************************************************************
207 template< typename MT // Type of the adapted matrix
208  , bool SO // Storage order of the adapted matrix
209  , bool DF > // Density flag
210 inline bool isDefault_backend( const UniLowerMatrix<MT,SO,DF>& m, FalseType )
211 {
212  return isIdentity( m );
213 }
215 //*************************************************************************************************
216 
217 
218 //*************************************************************************************************
237 template< typename MT // Type of the adapted matrix
238  , bool SO // Storage order of the adapted matrix
239  , bool DF > // Density flag
240 inline bool isDefault( const UniLowerMatrix<MT,SO,DF>& m )
241 {
242  return isDefault_backend( m, typename IsResizable<MT>::Type() );
243 }
244 //*************************************************************************************************
245 
246 
247 //*************************************************************************************************
268 template< typename MT // Type of the adapted matrix
269  , bool SO // Storage order of the adapted matrix
270  , bool DF > // Density flag
271 inline bool isIntact( const UniLowerMatrix<MT,SO,DF>& m )
272 {
273  return m.isIntact();
274 }
275 //*************************************************************************************************
276 
277 
278 //*************************************************************************************************
287 template< typename MT // Type of the adapted matrix
288  , bool SO // Storage order of the adapted matrix
289  , bool DF > // Density flag
290 inline void swap( UniLowerMatrix<MT,SO,DF>& a, UniLowerMatrix<MT,SO,DF>& b ) /* throw() */
291 {
292  a.swap( b );
293 }
294 //*************************************************************************************************
295 
296 
297 //*************************************************************************************************
311 template< typename MT // Type of the dense matrix
312  , bool SO > // Storage order of the dense matrix
313 inline void invert2x2( UniLowerMatrix<MT,SO,true>& m )
314 {
316 
317  BLAZE_INTERNAL_ASSERT( m.rows() == 2UL, "Invalid number of rows detected" );
318  BLAZE_INTERNAL_ASSERT( m.columns() == 2UL, "Invalid number of columns detected" );
319 
320  typedef typename MT::ElementType ET;
321 
322  typename DerestrictTrait<MT>::Type A( derestrict( m ) );
323 
324  A(1,0) = -A(1,0);
325 
326  BLAZE_INTERNAL_ASSERT( isIntact( m ), "Broken invariant detected" );
327 }
329 //*************************************************************************************************
330 
331 
332 //*************************************************************************************************
346 template< typename MT // Type of the dense matrix
347  , bool SO > // Storage order of the dense matrix
348 inline void invert3x3( UniLowerMatrix<MT,SO,true>& m )
349 {
351 
352  BLAZE_INTERNAL_ASSERT( m.rows() == 3UL, "Invalid number of rows detected" );
353  BLAZE_INTERNAL_ASSERT( m.columns() == 3UL, "Invalid number of columns detected" );
354 
355  typedef typename MT::ElementType ET;
356 
357  const StaticMatrix<ET,3UL,3UL,SO> A( m );
358  typename DerestrictTrait<MT>::Type B( derestrict( m ) );
359 
360  B(1,0) = - A(1,0);
361  B(2,0) = A(1,0)*A(2,1) - A(2,0);
362  B(2,1) = - A(2,1);
363 
364  BLAZE_INTERNAL_ASSERT( isIntact( m ), "Broken invariant detected" );
365 }
367 //*************************************************************************************************
368 
369 
370 //*************************************************************************************************
384 template< typename MT // Type of the dense matrix
385  , bool SO > // Storage order of the dense matrix
386 inline void invert4x4( UniLowerMatrix<MT,SO,true>& m )
387 {
389 
390  BLAZE_INTERNAL_ASSERT( m.rows() == 4UL, "Invalid number of rows detected" );
391  BLAZE_INTERNAL_ASSERT( m.columns() == 4UL, "Invalid number of columns detected" );
392 
393  typedef typename MT::ElementType ET;
394 
395  const StaticMatrix<ET,4UL,4UL,SO> A( m );
396  typename DerestrictTrait<MT>::Type B( derestrict( m ) );
397 
398  const ET tmp( A(2,1)*A(3,2) - A(3,1) );
399 
400  B(1,0) = - A(1,0);
401  B(2,0) = A(1,0)*A(2,1) - A(2,0);
402  B(3,0) = A(2,0)*A(3,2) - A(3,0) - A(1,0)*tmp;
403  B(2,1) = - A(2,1);
404  B(3,1) = tmp;
405  B(3,2) = - A(3,2);
406 
407  BLAZE_INTERNAL_ASSERT( isIntact( m ), "Broken invariant detected" );
408 }
410 //*************************************************************************************************
411 
412 
413 //*************************************************************************************************
427 template< typename MT // Type of the dense matrix
428  , bool SO > // Storage order of the dense matrix
429 inline void invert5x5( UniLowerMatrix<MT,SO,true>& m )
430 {
432 
433  BLAZE_INTERNAL_ASSERT( m.rows() == 5UL, "Invalid number of rows detected" );
434  BLAZE_INTERNAL_ASSERT( m.columns() == 5UL, "Invalid number of columns detected" );
435 
436  typedef typename MT::ElementType ET;
437 
438  const StaticMatrix<ET,5UL,5UL,SO> A( m );
439  typename DerestrictTrait<MT>::Type B( derestrict( m ) );
440 
441  const ET tmp1( A(3,2)*A(4,3) - A(4,2) );
442  const ET tmp2( A(2,1)*A(3,2) - A(3,1) );
443  const ET tmp3( A(2,1)*tmp1 - A(3,1)*A(4,3) + A(4,1) );
444 
445  B(1,0) = - A(1,0);
446  B(2,0) = A(1,0)*A(2,1) - A(2,0);
447  B(3,0) = - A(1,0)*tmp2 + A(2,0)*A(3,2) - A(3,0);
448  B(4,0) = A(1,0)*tmp3 - A(2,0)*tmp1 + A(3,0)*A(4,3) - A(4,0);
449  B(2,1) = - A(2,1);
450  B(3,1) = tmp2;
451  B(4,1) = - tmp3;
452  B(3,2) = - A(3,2);
453  B(4,2) = A(4,3)*A(3,2) - A(4,2);
454  B(4,3) = - A(4,3);
455 
456  BLAZE_INTERNAL_ASSERT( isIntact( m ), "Broken invariant detected" );
457 }
459 //*************************************************************************************************
460 
461 
462 //*************************************************************************************************
476 template< typename MT // Type of the dense matrix
477  , bool SO > // Storage order of the dense matrix
478 inline void invert6x6( UniLowerMatrix<MT,SO,true>& m )
479 {
481 
482  BLAZE_INTERNAL_ASSERT( m.rows() == 6UL, "Invalid number of rows detected" );
483  BLAZE_INTERNAL_ASSERT( m.columns() == 6UL, "Invalid number of columns detected" );
484 
485  typedef typename MT::ElementType ET;
486 
487  const StaticMatrix<ET,6UL,6UL,SO> A( m );
488  typename DerestrictTrait<MT>::Type B( derestrict( m ) );
489 
490  const ET tmp1( A(4,3)*A(5,4) - A(5,3) );
491  const ET tmp2( A(3,2)*A(4,3) - A(4,2) );
492  const ET tmp3( A(3,2)*tmp1 - A(4,2)*A(5,4) + A(5,2) );
493  const ET tmp4( A(2,1)*A(3,2) - A(3,1) );
494  const ET tmp5( A(2,1)*tmp2 - A(3,1)*A(4,3) + A(4,1) );
495  const ET tmp6( A(2,1)*tmp3 - A(3,1)*tmp1 + A(4,1)*A(5,4) - A(5,1) );
496 
497  B(1,0) = - A(1,0);
498  B(2,0) = A(1,0)*A(2,1) - A(2,0);
499  B(3,0) = - A(1,0)*tmp4 + A(2,0)*A(3,2) - A(3,0);
500  B(4,0) = A(1,0)*tmp5 - A(2,0)*tmp2 + A(3,0)*A(4,3) - A(4,0);
501  B(5,0) = - A(1,0)*tmp6 + A(2,0)*tmp3 - A(3,0)*tmp1 + A(4,0)*A(5,4) - A(5,0);
502  B(2,1) = - A(2,1);
503  B(3,1) = tmp4;
504  B(4,1) = - tmp5;
505  B(5,1) = tmp6;
506  B(3,2) = - A(3,2);
507  B(4,2) = tmp2;
508  B(5,2) = - tmp3;
509  B(4,3) = A(5,3)*A(4,5) - A(4,3);
510  B(5,3) = A(5,4)*A(4,3) - A(5,3);
511  B(5,4) = A(5,3)*A(3,4) - A(5,4);
512 
513  BLAZE_INTERNAL_ASSERT( isIntact( m ), "Broken invariant detected" );
514 }
516 //*************************************************************************************************
517 
518 
519 //*************************************************************************************************
540 template< typename MT // Type of the dense matrix
541  , bool SO > // Storage order of the dense matrix
542 inline void invertByDefault( UniLowerMatrix<MT,SO,true>& m )
543 {
544  invertByLU( m );
545 }
547 //*************************************************************************************************
548 
549 
550 //*************************************************************************************************
570 template< typename MT // Type of the dense matrix
571  , bool SO > // Storage order of the dense matrix
572 inline void invertByLU( UniLowerMatrix<MT,SO,true>& m )
573 {
575 
576  typename DerestrictTrait<MT>::Type A( derestrict( ~m ) );
577 
578  trtri( A, 'L', 'U' );
579 
580  BLAZE_INTERNAL_ASSERT( isIntact( m ), "Broken invariant detected" );
581 }
583 //*************************************************************************************************
584 
585 
586 //*************************************************************************************************
603 template< typename MT // Type of the dense matrix
604  , bool SO > // Storage order of the dense matrix
605 inline void invertByLDLT( UniLowerMatrix<MT,SO,true>& m )
606 {
607  invertByLLH( m );
608 }
610 //*************************************************************************************************
611 
612 
613 //*************************************************************************************************
630 template< typename MT // Type of the dense matrix
631  , bool SO > // Storage order of the dense matrix
632 inline void invertByLDLH( UniLowerMatrix<MT,SO,true>& m )
633 {
634  invertByLLH( m );
635 }
637 //*************************************************************************************************
638 
639 
640 //*************************************************************************************************
654 template< typename MT // Type of the dense matrix
655  , bool SO > // Storage order of the dense matrix
656 inline void invertByLLH( UniLowerMatrix<MT,SO,true>& m )
657 {
659 
660  BLAZE_INTERNAL_ASSERT( isIdentity( ~m ), "Violation of preconditions detected" );
661 
662  UNUSED_PARAMETER( m );
663 }
665 //*************************************************************************************************
666 
667 
668 //*************************************************************************************************
687 template< typename MT1, bool SO1, typename MT2, typename MT3, typename MT4, bool SO2 >
688 inline void lu( const UniLowerMatrix<MT1,SO1,true>& A, DenseMatrix<MT2,SO1>& L,
689  DenseMatrix<MT3,SO1>& U, Matrix<MT4,SO2>& P )
690 {
692 
697 
702 
703  typedef typename MT3::ElementType ET3;
704  typedef typename MT4::ElementType ET4;
705 
706  const size_t n( (~A).rows() );
707 
708  typename DerestrictTrait<MT3>::Type U2( derestrict( ~U ) );
709 
710  (~L) = A;
711 
712  resize( ~U, n, n );
713  reset( U2 );
714 
715  resize( ~P, n, n );
716  reset( ~P );
717 
718  for( size_t i=0UL; i<n; ++i ) {
719  U2(i,i) = ET3(1);
720  (~P)(i,i) = ET4(1);
721  }
722 }
724 //*************************************************************************************************
725 
726 
727 //*************************************************************************************************
743 template< typename MT // Type of the adapted matrix
744  , bool SO // Storage order of the adapted matrix
745  , bool DF // Density flag
746  , typename VT > // Type of the right-hand side dense vector
747 inline bool tryAssign( const UniLowerMatrix<MT,SO,DF>& lhs,
748  const DenseVector<VT,false>& rhs, size_t row, size_t column )
749 {
751 
752  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
753  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
754  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.rows() - row, "Invalid number of rows" );
755 
756  UNUSED_PARAMETER( lhs );
757 
758  if( column < row )
759  return true;
760 
761  const bool containsDiagonal( column < row + (~rhs).size() );
762  const size_t iend( min( column - row, (~rhs).size() ) );
763 
764  for( size_t i=0UL; i<iend; ++i ) {
765  if( !isDefault( (~rhs)[i] ) )
766  return false;
767  }
768 
769  if( containsDiagonal && !isOne( (~rhs)[iend] ) )
770  return false;
771 
772  return true;
773 }
775 //*************************************************************************************************
776 
777 
778 //*************************************************************************************************
794 template< typename MT // Type of the adapted matrix
795  , bool SO // Storage order of the adapted matrix
796  , bool DF // Density flag
797  , typename VT > // Type of the right-hand side dense vector
798 inline bool tryAssign( const UniLowerMatrix<MT,SO,DF>& lhs,
799  const DenseVector<VT,true>& rhs, size_t row, size_t column )
800 {
802 
803  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
804  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
805  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.columns() - column, "Invalid number of columns" );
806 
807  UNUSED_PARAMETER( lhs );
808 
809  if( row >= column + (~rhs).size() )
810  return true;
811 
812  const bool containsDiagonal( row >= column );
813  const size_t ibegin( ( !containsDiagonal )?( 0UL ):( row - column + 1UL ) );
814 
815  if( containsDiagonal && !isOne( (~rhs)[row-column] ) )
816  return false;
817 
818  for( size_t i=ibegin; i<(~rhs).size(); ++i ) {
819  if( !isDefault( (~rhs)[i] ) )
820  return false;
821  }
822 
823  return true;
824 }
826 //*************************************************************************************************
827 
828 
829 //*************************************************************************************************
845 template< typename MT // Type of the adapted matrix
846  , bool SO // Storage order of the adapted matrix
847  , bool DF // Density flag
848  , typename VT > // Type of the right-hand side sparse vector
849 inline bool tryAssign( const UniLowerMatrix<MT,SO,DF>& lhs,
850  const SparseVector<VT,false>& rhs, size_t row, size_t column )
851 {
853 
854  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
855  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
856  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.rows() - row, "Invalid number of rows" );
857 
858  UNUSED_PARAMETER( lhs );
859 
860  typedef typename VT::ConstIterator RhsIterator;
861 
862  if( column < row )
863  return true;
864 
865  const bool containsDiagonal( column < row + (~rhs).size() );
866  const size_t index( column - row );
867  const RhsIterator last( (~rhs).lowerBound( index ) );
868 
869  if( containsDiagonal ) {
870  if( last == (~rhs).end() || last->index() != index || !isOne( last->value() ) )
871  return false;
872  }
873 
874  for( RhsIterator element=(~rhs).begin(); element!=last; ++element ) {
875  if( !isDefault( element->value() ) )
876  return false;
877  }
878 
879  return true;
880 }
882 //*************************************************************************************************
883 
884 
885 //*************************************************************************************************
901 template< typename MT // Type of the adapted matrix
902  , bool SO // Storage order of the adapted matrix
903  , bool DF // Density flag
904  , typename VT > // Type of the right-hand side sparse vector
905 inline bool tryAssign( const UniLowerMatrix<MT,SO,DF>& lhs,
906  const SparseVector<VT,true>& rhs, size_t row, size_t column )
907 {
909 
910  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
911  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
912  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.columns() - column, "Invalid number of columns" );
913 
914  UNUSED_PARAMETER( lhs );
915 
916  typedef typename VT::ConstIterator RhsIterator;
917 
918  if( row >= column + (~rhs).size() )
919  return true;
920 
921  const bool containsDiagonal( row >= column );
922  const size_t index( ( containsDiagonal )?( row - column ):( 0UL ) );
923  const RhsIterator last( (~rhs).end() );
924  RhsIterator element( (~rhs).lowerBound( index ) );
925 
926  if( containsDiagonal ) {
927  if( element == last || element->index() != index || !isOne( element->value() ) )
928  return false;
929  ++element;
930  }
931 
932  for( ; element!=last; ++element ) {
933  if( !isDefault( element->value() ) )
934  return false;
935  }
936 
937  return true;
938 }
940 //*************************************************************************************************
941 
942 
943 //*************************************************************************************************
959 template< typename MT1 // Type of the adapted matrix
960  , bool SO // Storage order of the adapted matrix
961  , bool DF // Density flag
962  , typename MT2 > // Type of the right-hand side dense matrix
963 inline bool tryAssign( const UniLowerMatrix<MT1,SO,DF>& lhs,
964  const DenseMatrix<MT2,false>& rhs, size_t row, size_t column )
965 {
967 
968  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
969  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
970  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
971  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
972 
973  UNUSED_PARAMETER( lhs );
974 
975  const size_t M( (~rhs).rows() );
976  const size_t N( (~rhs).columns() );
977 
978  if( row + 1UL >= column + N )
979  return true;
980 
981  const size_t iend( min( column + N - row, M ) );
982 
983  for( size_t i=0UL; i<iend; ++i )
984  {
985  const bool containsDiagonal( row + i >= column );
986 
987  if( containsDiagonal && !isOne( (~rhs)(i,row+i-column) ) )
988  return false;
989 
990  const size_t jbegin( ( containsDiagonal )?( row + i - column + 1UL ):( 0UL ) );
991 
992  for( size_t j=jbegin; j<N; ++j ) {
993  if( !isDefault( (~rhs)(i,j) ) )
994  return false;
995  }
996  }
997 
998  return true;
999 }
1001 //*************************************************************************************************
1002 
1003 
1004 //*************************************************************************************************
1020 template< typename MT1 // Type of the adapted matrix
1021  , bool SO // Storage order of the adapted matrix
1022  , bool DF // Density flag
1023  , typename MT2 > // Type of the right-hand side dense matrix
1024 inline bool tryAssign( const UniLowerMatrix<MT1,SO,DF>& lhs,
1025  const DenseMatrix<MT2,true>& rhs, size_t row, size_t column )
1026 {
1028 
1029  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1030  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1031  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
1032  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
1033 
1034  UNUSED_PARAMETER( lhs );
1035 
1036  const size_t M( (~rhs).rows() );
1037  const size_t N( (~rhs).columns() );
1038 
1039  if( row + 1UL >= column + N )
1040  return true;
1041 
1042  const size_t jbegin( ( row < column )?( 0UL ):( row - column ) );
1043 
1044  for( size_t j=jbegin; j<N; ++j )
1045  {
1046  const size_t iend( min( column + j - row, M ) );
1047 
1048  for( size_t i=0UL; i<iend; ++i ) {
1049  if( !isDefault( (~rhs)(i,j) ) )
1050  return false;
1051  }
1052 
1053  const bool containsDiagonal( column + j < row + M );
1054 
1055  if( containsDiagonal && !isOne( (~rhs)(iend,j) ) )
1056  return false;
1057  }
1058 
1059  return true;
1060 }
1062 //*************************************************************************************************
1063 
1064 
1065 //*************************************************************************************************
1081 template< typename MT1 // Type of the adapted matrix
1082  , bool SO // Storage order of the adapted matrix
1083  , bool DF // Density flag
1084  , typename MT2 > // Type of the right-hand side sparse matrix
1085 inline bool tryAssign( const UniLowerMatrix<MT1,SO,DF>& lhs,
1086  const SparseMatrix<MT2,false>& rhs, size_t row, size_t column )
1087 {
1089 
1090  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1091  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1092  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
1093  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
1094 
1095  UNUSED_PARAMETER( lhs );
1096 
1097  typedef typename MT2::ConstIterator RhsIterator;
1098 
1099  const size_t M( (~rhs).rows() );
1100  const size_t N( (~rhs).columns() );
1101 
1102  if( row + 1UL >= column + N )
1103  return true;
1104 
1105  const size_t iend( min( column + N - row, M ) );
1106 
1107  for( size_t i=0UL; i<iend; ++i )
1108  {
1109  const bool containsDiagonal( row + i >= column );
1110  const size_t index( ( containsDiagonal )?( row + i - column ):( 0UL ) );
1111 
1112  const RhsIterator last( (~rhs).end(i) );
1113  RhsIterator element( (~rhs).lowerBound( i, index ) );
1114 
1115  if( containsDiagonal ) {
1116  if( element == last || ( element->index() != index ) || !isOne( element->value() ) )
1117  return false;
1118  ++element;
1119  }
1120 
1121  for( ; element!=last; ++element ) {
1122  if( !isDefault( element->value() ) )
1123  return false;
1124  }
1125  }
1126 
1127  return true;
1128 }
1130 //*************************************************************************************************
1131 
1132 
1133 //*************************************************************************************************
1149 template< typename MT1 // Type of the adapted matrix
1150  , bool SO // Storage order of the adapted matrix
1151  , bool DF // Density flag
1152  , typename MT2 > // Type of the right-hand side sparse matrix
1153 inline bool tryAssign( const UniLowerMatrix<MT1,SO,DF>& lhs,
1154  const SparseMatrix<MT2,true>& rhs, size_t row, size_t column )
1155 {
1157 
1158  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1159  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1160  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
1161  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
1162 
1163  UNUSED_PARAMETER( lhs );
1164 
1165  typedef typename MT2::ConstIterator RhsIterator;
1166 
1167  const size_t M( (~rhs).rows() );
1168  const size_t N( (~rhs).columns() );
1169 
1170  if( row + 1UL >= column + N )
1171  return true;
1172 
1173  const size_t jbegin( ( row < column )?( 0UL ):( row - column ) );
1174 
1175  for( size_t j=jbegin; j<N; ++j )
1176  {
1177  const bool containsDiagonal( column + j < row + M );
1178 
1179  const size_t index( column + j - row );
1180  const RhsIterator last( (~rhs).lowerBound( min( index, M ), j ) );
1181 
1182  if( containsDiagonal ) {
1183  if( last == (~rhs).end(j) || ( last->index() != index ) || !isOne( last->value() ) )
1184  return false;
1185  }
1186 
1187  for( RhsIterator element=(~rhs).begin(j); element!=last; ++element ) {
1188  if( !isDefault( element->value() ) )
1189  return false;
1190  }
1191  }
1192 
1193  return true;
1194 }
1196 //*************************************************************************************************
1197 
1198 
1199 //*************************************************************************************************
1216 template< typename MT // Type of the adapted matrix
1217  , bool SO // Storage order of the adapted matrix
1218  , bool DF // Density flag
1219  , typename VT > // Type of the right-hand side dense vector
1220 inline bool tryAddAssign( const UniLowerMatrix<MT,SO,DF>& lhs,
1221  const DenseVector<VT,false>& rhs, size_t row, size_t column )
1222 {
1224 
1225  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1226  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1227  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.rows() - row, "Invalid number of rows" );
1228 
1229  UNUSED_PARAMETER( lhs );
1230 
1231  if( column < row )
1232  return true;
1233 
1234  const size_t iend( min( column - row + 1UL, (~rhs).size() ) );
1235 
1236  for( size_t i=0UL; i<iend; ++i ) {
1237  if( !isDefault( (~rhs)[i] ) )
1238  return false;
1239  }
1240 
1241  return true;
1242 }
1244 //*************************************************************************************************
1245 
1246 
1247 //*************************************************************************************************
1264 template< typename MT // Type of the adapted matrix
1265  , bool SO // Storage order of the adapted matrix
1266  , bool DF // Density flag
1267  , typename VT > // Type of the right-hand side dense vector
1268 inline bool tryAddAssign( const UniLowerMatrix<MT,SO,DF>& lhs,
1269  const DenseVector<VT,true>& rhs, size_t row, size_t column )
1270 {
1272 
1273  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1274  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1275  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.columns() - column, "Invalid number of columns" );
1276 
1277  UNUSED_PARAMETER( lhs );
1278 
1279  const size_t ibegin( ( row <= column )?( 0UL ):( row - column ) );
1280 
1281  for( size_t i=ibegin; i<(~rhs).size(); ++i ) {
1282  if( !isDefault( (~rhs)[i] ) )
1283  return false;
1284  }
1285 
1286  return true;
1287 }
1289 //*************************************************************************************************
1290 
1291 
1292 //*************************************************************************************************
1309 template< typename MT // Type of the adapted matrix
1310  , bool SO // Storage order of the adapted matrix
1311  , bool DF // Density flag
1312  , typename VT > // Type of the right-hand side sparse vector
1313 inline bool tryAddAssign( const UniLowerMatrix<MT,SO,DF>& lhs,
1314  const SparseVector<VT,false>& rhs, size_t row, size_t column )
1315 {
1317 
1318  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1319  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1320  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.rows() - row, "Invalid number of rows" );
1321 
1322  UNUSED_PARAMETER( lhs );
1323 
1324  typedef typename VT::ConstIterator RhsIterator;
1325 
1326  if( column < row )
1327  return true;
1328 
1329  const RhsIterator last( (~rhs).lowerBound( column - row + 1UL ) );
1330 
1331  for( RhsIterator element=(~rhs).begin(); element!=last; ++element ) {
1332  if( !isDefault( element->value() ) )
1333  return false;
1334  }
1335 
1336  return true;
1337 }
1339 //*************************************************************************************************
1340 
1341 
1342 //*************************************************************************************************
1359 template< typename MT // Type of the adapted matrix
1360  , bool SO // Storage order of the adapted matrix
1361  , bool DF // Density flag
1362  , typename VT > // Type of the right-hand side sparse vector
1363 inline bool tryAddAssign( const UniLowerMatrix<MT,SO,DF>& lhs,
1364  const SparseVector<VT,true>& rhs, size_t row, size_t column )
1365 {
1367 
1368  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1369  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1370  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.columns() - column, "Invalid number of columns" );
1371 
1372  UNUSED_PARAMETER( lhs );
1373 
1374  typedef typename VT::ConstIterator RhsIterator;
1375 
1376  const RhsIterator last( (~rhs).end() );
1377  RhsIterator element( (~rhs).lowerBound( ( row <= column )?( 0UL ):( row - column ) ) );
1378 
1379  for( ; element!=last; ++element ) {
1380  if( !isDefault( element->value() ) )
1381  return false;
1382  }
1383 
1384  return true;
1385 }
1387 //*************************************************************************************************
1388 
1389 
1390 //*************************************************************************************************
1407 template< typename MT1 // Type of the adapted matrix
1408  , bool SO // Storage order of the adapted matrix
1409  , bool DF // Density flag
1410  , typename MT2 > // Type of the right-hand side dense matrix
1411 inline bool tryAddAssign( const UniLowerMatrix<MT1,SO,DF>& lhs,
1412  const DenseMatrix<MT2,false>& rhs, size_t row, size_t column )
1413 {
1415 
1416  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1417  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1418  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
1419  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
1420 
1421  UNUSED_PARAMETER( lhs );
1422 
1423  const size_t M( (~rhs).rows() );
1424  const size_t N( (~rhs).columns() );
1425 
1426  if( row + 1UL >= column + N )
1427  return true;
1428 
1429  const size_t iend( min( column + N - row, M ) );
1430 
1431  for( size_t i=0UL; i<iend; ++i )
1432  {
1433  const bool containsDiagonal( row + i >= column );
1434  const size_t jbegin( ( containsDiagonal )?( row + i - column ):( 0UL ) );
1435 
1436  for( size_t j=jbegin; j<N; ++j ) {
1437  if( !isDefault( (~rhs)(i,j) ) )
1438  return false;
1439  }
1440  }
1441 
1442  return true;
1443 }
1445 //*************************************************************************************************
1446 
1447 
1448 //*************************************************************************************************
1465 template< typename MT1 // Type of the adapted matrix
1466  , bool SO // Storage order of the adapted matrix
1467  , bool DF // Density flag
1468  , typename MT2 > // Type of the right-hand side dense matrix
1469 inline bool tryAddAssign( const UniLowerMatrix<MT1,SO,DF>& lhs,
1470  const DenseMatrix<MT2,true>& rhs, size_t row, size_t column )
1471 {
1473 
1474  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1475  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1476  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
1477  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
1478 
1479  UNUSED_PARAMETER( lhs );
1480 
1481  const size_t M( (~rhs).rows() );
1482  const size_t N( (~rhs).columns() );
1483 
1484  if( row + 1UL >= column + N )
1485  return true;
1486 
1487  const size_t jbegin( ( row <= column )?( 0UL ):( row - column ) );
1488 
1489  for( size_t j=jbegin; j<N; ++j )
1490  {
1491  const size_t iend( min( column + j - row + 1UL, M ) );
1492 
1493  for( size_t i=0UL; i<iend; ++i ) {
1494  if( !isDefault( (~rhs)(i,j) ) )
1495  return false;
1496  }
1497  }
1498 
1499  return true;
1500 }
1502 //*************************************************************************************************
1503 
1504 
1505 //*************************************************************************************************
1522 template< typename MT1 // Type of the adapted matrix
1523  , bool SO // Storage order of the adapted matrix
1524  , bool DF // Density flag
1525  , typename MT2 > // Type of the right-hand side sparse matrix
1526 inline bool tryAddAssign( const UniLowerMatrix<MT1,SO,DF>& lhs,
1527  const SparseMatrix<MT2,false>& rhs, size_t row, size_t column )
1528 {
1530 
1531  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1532  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1533  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
1534  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
1535 
1536  UNUSED_PARAMETER( lhs );
1537 
1538  typedef typename MT2::ConstIterator RhsIterator;
1539 
1540  const size_t M( (~rhs).rows() );
1541  const size_t N( (~rhs).columns() );
1542 
1543  if( row + 1UL >= column + N )
1544  return true;
1545 
1546  const size_t iend( min( column + N - row, M ) );
1547 
1548  for( size_t i=0UL; i<iend; ++i )
1549  {
1550  const bool containsDiagonal( row + i >= column );
1551  const size_t index( ( containsDiagonal )?( row + i - column ):( 0UL ) );
1552 
1553  const RhsIterator last( (~rhs).end(i) );
1554  RhsIterator element( (~rhs).lowerBound( i, index ) );
1555 
1556  for( ; element!=last; ++element ) {
1557  if( !isDefault( element->value() ) )
1558  return false;
1559  }
1560  }
1561 
1562  return true;
1563 }
1565 //*************************************************************************************************
1566 
1567 
1568 //*************************************************************************************************
1585 template< typename MT1 // Type of the adapted matrix
1586  , bool SO // Storage order of the adapted matrix
1587  , bool DF // Density flag
1588  , typename MT2 > // Type of the right-hand side sparse matrix
1589 inline bool tryAddAssign( const UniLowerMatrix<MT1,SO,DF>& lhs,
1590  const SparseMatrix<MT2,true>& rhs, size_t row, size_t column )
1591 {
1593 
1594  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1595  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1596  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
1597  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
1598 
1599  UNUSED_PARAMETER( lhs );
1600 
1601  typedef typename MT2::ConstIterator RhsIterator;
1602 
1603  const size_t M( (~rhs).rows() );
1604  const size_t N( (~rhs).columns() );
1605 
1606  if( row + 1UL >= column + N )
1607  return true;
1608 
1609  const size_t jbegin( ( row < column )?( 0UL ):( row - column ) );
1610 
1611  for( size_t j=jbegin; j<N; ++j )
1612  {
1613  const size_t index( column + j - row + 1UL );
1614  const RhsIterator last( (~rhs).lowerBound( min( index, M ), j ) );
1615 
1616  for( RhsIterator element=(~rhs).begin(j); element!=last; ++element ) {
1617  if( !isDefault( element->value() ) )
1618  return false;
1619  }
1620  }
1621 
1622  return true;
1623 }
1625 //*************************************************************************************************
1626 
1627 
1628 //*************************************************************************************************
1645 template< typename MT // Type of the adapted matrix
1646  , bool SO // Storage order of the adapted matrix
1647  , bool DF // Density flag
1648  , typename VT // Type of the right-hand side vector
1649  , bool TF > // Transpose flag of the right-hand side vector
1650 inline bool trySubAssign( const UniLowerMatrix<MT,SO,DF>& lhs,
1651  const Vector<VT,TF>& rhs, size_t row, size_t column )
1652 {
1653  return tryAddAssign( lhs, ~rhs, row, column );
1654 }
1656 //*************************************************************************************************
1657 
1658 
1659 //*************************************************************************************************
1676 template< typename MT1 // Type of the adapted matrix
1677  , bool SO1 // Storage order of the adapted matrix
1678  , bool DF // Density flag
1679  , typename MT2 // Type of the right-hand side matrix
1680  , bool SO2 > // Storage order of the right-hand side matrix
1681 inline bool trySubAssign( const UniLowerMatrix<MT1,SO1,DF>& lhs,
1682  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
1683 {
1684  return tryAddAssign( lhs, ~rhs, row, column );
1685 }
1687 //*************************************************************************************************
1688 
1689 
1690 //*************************************************************************************************
1707 template< typename MT // Type of the adapted matrix
1708  , bool SO // Storage order of the adapted matrix
1709  , bool DF // Density flag
1710  , typename VT > // Type of the right-hand side vector
1711 inline bool tryMultAssign( const UniLowerMatrix<MT,SO,DF>& lhs,
1712  const Vector<VT,false>& rhs, size_t row, size_t column )
1713 {
1715 
1716  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1717  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1718  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.rows() - row, "Invalid number of rows" );
1719 
1720  UNUSED_PARAMETER( lhs );
1721 
1722  return ( column < row || (~rhs).size() <= column - row || isOne( (~rhs)[column-row] ) );
1723 }
1725 //*************************************************************************************************
1726 
1727 
1728 //*************************************************************************************************
1745 template< typename MT // Type of the adapted matrix
1746  , bool SO // Storage order of the adapted matrix
1747  , bool DF // Density flag
1748  , typename VT > // Type of the right-hand side vector
1749 inline bool tryMultAssign( const UniLowerMatrix<MT,SO,DF>& lhs,
1750  const Vector<VT,true>& rhs, size_t row, size_t column )
1751 {
1753 
1754  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1755  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1756  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.columns() - column, "Invalid number of columns" );
1757 
1758  UNUSED_PARAMETER( lhs );
1759 
1760  return ( row < column || (~rhs).size() <= row - column || isOne( (~rhs)[row-column] ) );
1761 }
1763 //*************************************************************************************************
1764 
1765 
1766 //*************************************************************************************************
1780 template< typename MT // Type of the adapted matrix
1781  , bool SO // Storage order of the adapted matrix
1782  , bool DF > // Density flag
1783 inline MT& derestrict( UniLowerMatrix<MT,SO,DF>& m )
1784 {
1785  return m.matrix_;
1786 }
1788 //*************************************************************************************************
1789 
1790 
1791 
1792 
1793 //=================================================================================================
1794 //
1795 // ROWS SPECIALIZATIONS
1796 //
1797 //=================================================================================================
1798 
1799 //*************************************************************************************************
1801 template< typename MT, bool SO, bool DF >
1802 struct Rows< UniLowerMatrix<MT,SO,DF> > : public Rows<MT>
1803 {};
1805 //*************************************************************************************************
1806 
1807 
1808 
1809 
1810 //=================================================================================================
1811 //
1812 // COLUMNS SPECIALIZATIONS
1813 //
1814 //=================================================================================================
1815 
1816 //*************************************************************************************************
1818 template< typename MT, bool SO, bool DF >
1819 struct Columns< UniLowerMatrix<MT,SO,DF> > : public Columns<MT>
1820 {};
1822 //*************************************************************************************************
1823 
1824 
1825 
1826 
1827 //=================================================================================================
1828 //
1829 // ISSQUARE SPECIALIZATIONS
1830 //
1831 //=================================================================================================
1832 
1833 //*************************************************************************************************
1835 template< typename MT, bool SO, bool DF >
1836 struct IsSquare< UniLowerMatrix<MT,SO,DF> > : public IsTrue<true>
1837 {};
1839 //*************************************************************************************************
1840 
1841 
1842 
1843 
1844 //=================================================================================================
1845 //
1846 // ISUNILOWER SPECIALIZATIONS
1847 //
1848 //=================================================================================================
1849 
1850 //*************************************************************************************************
1852 template< typename MT, bool SO, bool DF >
1853 struct IsUniLower< UniLowerMatrix<MT,SO,DF> > : public IsTrue<true>
1854 {};
1856 //*************************************************************************************************
1857 
1858 
1859 
1860 
1861 //=================================================================================================
1862 //
1863 // ISADAPTOR SPECIALIZATIONS
1864 //
1865 //=================================================================================================
1866 
1867 //*************************************************************************************************
1869 template< typename MT, bool SO, bool DF >
1870 struct IsAdaptor< UniLowerMatrix<MT,SO,DF> > : public IsTrue<true>
1871 {};
1873 //*************************************************************************************************
1874 
1875 
1876 
1877 
1878 //=================================================================================================
1879 //
1880 // ISRESTRICTED SPECIALIZATIONS
1881 //
1882 //=================================================================================================
1883 
1884 //*************************************************************************************************
1886 template< typename MT, bool SO, bool DF >
1887 struct IsRestricted< UniLowerMatrix<MT,SO,DF> > : public IsTrue<true>
1888 {};
1890 //*************************************************************************************************
1891 
1892 
1893 
1894 
1895 //=================================================================================================
1896 //
1897 // HASCONSTDATAACCESS SPECIALIZATIONS
1898 //
1899 //=================================================================================================
1900 
1901 //*************************************************************************************************
1903 template< typename MT, bool SO >
1904 struct HasConstDataAccess< UniLowerMatrix<MT,SO,true> > : public IsTrue<true>
1905 {};
1907 //*************************************************************************************************
1908 
1909 
1910 
1911 
1912 //=================================================================================================
1913 //
1914 // ISALIGNED SPECIALIZATIONS
1915 //
1916 //=================================================================================================
1917 
1918 //*************************************************************************************************
1920 template< typename MT, bool SO, bool DF >
1921 struct IsAligned< UniLowerMatrix<MT,SO,DF> > : public IsTrue< IsAligned<MT>::value >
1922 {};
1924 //*************************************************************************************************
1925 
1926 
1927 
1928 
1929 //=================================================================================================
1930 //
1931 // ISPADDED SPECIALIZATIONS
1932 //
1933 //=================================================================================================
1934 
1935 //*************************************************************************************************
1937 template< typename MT, bool SO, bool DF >
1938 struct IsPadded< UniLowerMatrix<MT,SO,DF> > : public IsTrue< IsPadded<MT>::value >
1939 {};
1941 //*************************************************************************************************
1942 
1943 
1944 
1945 
1946 //=================================================================================================
1947 //
1948 // ISRESIZABLE SPECIALIZATIONS
1949 //
1950 //=================================================================================================
1951 
1952 //*************************************************************************************************
1954 template< typename MT, bool SO, bool DF >
1955 struct IsResizable< UniLowerMatrix<MT,SO,DF> > : public IsTrue< IsResizable<MT>::value >
1956 {};
1958 //*************************************************************************************************
1959 
1960 
1961 
1962 
1963 //=================================================================================================
1964 //
1965 // REMOVEADAPTOR SPECIALIZATIONS
1966 //
1967 //=================================================================================================
1968 
1969 //*************************************************************************************************
1971 template< typename MT, bool SO, bool DF >
1972 struct RemoveAdaptor< UniLowerMatrix<MT,SO,DF> >
1973 {
1974  typedef MT Type;
1975 };
1977 //*************************************************************************************************
1978 
1979 
1980 
1981 
1982 //=================================================================================================
1983 //
1984 // DERESTRICTTRAIT SPECIALIZATIONS
1985 //
1986 //=================================================================================================
1987 
1988 //*************************************************************************************************
1990 template< typename MT, bool SO, bool DF >
1991 struct DerestrictTrait< UniLowerMatrix<MT,SO,DF> >
1992 {
1993  typedef MT& Type;
1994 };
1996 //*************************************************************************************************
1997 
1998 
1999 
2000 
2001 //=================================================================================================
2002 //
2003 // ADDTRAIT SPECIALIZATIONS
2004 //
2005 //=================================================================================================
2006 
2007 //*************************************************************************************************
2009 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
2010 struct AddTrait< UniLowerMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
2011 {
2012  typedef typename AddTrait< MT, StaticMatrix<T,M,N,SO2> >::Type Type;
2013 };
2014 
2015 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
2016 struct AddTrait< StaticMatrix<T,M,N,SO1>, UniLowerMatrix<MT,SO2,DF> >
2017 {
2018  typedef typename AddTrait< StaticMatrix<T,M,N,SO1>, MT >::Type Type;
2019 };
2020 
2021 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
2022 struct AddTrait< UniLowerMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
2023 {
2024  typedef typename AddTrait< MT, HybridMatrix<T,M,N,SO2> >::Type Type;
2025 };
2026 
2027 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
2028 struct AddTrait< HybridMatrix<T,M,N,SO1>, UniLowerMatrix<MT,SO2,DF> >
2029 {
2030  typedef typename AddTrait< HybridMatrix<T,M,N,SO1>, MT >::Type Type;
2031 };
2032 
2033 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
2034 struct AddTrait< UniLowerMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
2035 {
2036  typedef typename AddTrait< MT, DynamicMatrix<T,SO2> >::Type Type;
2037 };
2038 
2039 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
2040 struct AddTrait< DynamicMatrix<T,SO1>, UniLowerMatrix<MT,SO2,DF> >
2041 {
2042  typedef typename AddTrait< DynamicMatrix<T,SO1>, MT >::Type Type;
2043 };
2044 
2045 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
2046 struct AddTrait< UniLowerMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
2047 {
2048  typedef typename AddTrait< MT, CustomMatrix<T,AF,PF,SO2> >::Type Type;
2049 };
2050 
2051 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
2052 struct AddTrait< CustomMatrix<T,AF,PF,SO1>, UniLowerMatrix<MT,SO2,DF> >
2053 {
2054  typedef typename AddTrait< CustomMatrix<T,AF,PF,SO1>, MT >::Type Type;
2055 };
2056 
2057 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
2058 struct AddTrait< UniLowerMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
2059 {
2060  typedef typename AddTrait< MT, CompressedMatrix<T,SO2> >::Type Type;
2061 };
2062 
2063 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
2064 struct AddTrait< CompressedMatrix<T,SO1>, UniLowerMatrix<MT,SO2,DF> >
2065 {
2066  typedef typename AddTrait< CompressedMatrix<T,SO1>, MT >::Type Type;
2067 };
2068 
2069 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
2070 struct AddTrait< UniLowerMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
2071 {
2072  typedef typename AddTrait<MT1,MT2>::Type Type;
2073 };
2074 
2075 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
2076 struct AddTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, UniLowerMatrix<MT2,SO2,DF2> >
2077 {
2078  typedef typename AddTrait<MT1,MT2>::Type Type;
2079 };
2080 
2081 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2082 struct AddTrait< UniLowerMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
2083 {
2084  typedef typename AddTrait<MT1,MT2>::Type Type;
2085 };
2086 
2087 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2088 struct AddTrait< HermitianMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
2089 {
2090  typedef typename AddTrait<MT1,MT2>::Type Type;
2091 };
2092 
2093 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2094 struct AddTrait< UniLowerMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
2095 {
2096  typedef LowerMatrix< typename AddTrait<MT1,MT2>::Type > Type;
2097 };
2098 
2099 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2100 struct AddTrait< LowerMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
2101 {
2102  typedef LowerMatrix< typename AddTrait<MT1,MT2>::Type > Type;
2103 };
2104 
2105 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2106 struct AddTrait< UniLowerMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
2107 {
2108  typedef LowerMatrix< typename AddTrait<MT1,MT2>::Type > Type;
2109 };
2111 //*************************************************************************************************
2112 
2113 
2114 
2115 
2116 //=================================================================================================
2117 //
2118 // SUBTRAIT SPECIALIZATIONS
2119 //
2120 //=================================================================================================
2121 
2122 //*************************************************************************************************
2124 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
2125 struct SubTrait< UniLowerMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
2126 {
2127  typedef typename SubTrait< MT, StaticMatrix<T,M,N,SO2> >::Type Type;
2128 };
2129 
2130 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
2131 struct SubTrait< StaticMatrix<T,M,N,SO1>, UniLowerMatrix<MT,SO2,DF> >
2132 {
2133  typedef typename SubTrait< StaticMatrix<T,M,N,SO1>, MT >::Type Type;
2134 };
2135 
2136 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
2137 struct SubTrait< UniLowerMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
2138 {
2139  typedef typename SubTrait< MT, HybridMatrix<T,M,N,SO2> >::Type Type;
2140 };
2141 
2142 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
2143 struct SubTrait< HybridMatrix<T,M,N,SO1>, UniLowerMatrix<MT,SO2,DF> >
2144 {
2145  typedef typename SubTrait< HybridMatrix<T,M,N,SO1>, MT >::Type Type;
2146 };
2147 
2148 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
2149 struct SubTrait< UniLowerMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
2150 {
2151  typedef typename SubTrait< MT, DynamicMatrix<T,SO2> >::Type Type;
2152 };
2153 
2154 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
2155 struct SubTrait< DynamicMatrix<T,SO1>, UniLowerMatrix<MT,SO2,DF> >
2156 {
2157  typedef typename SubTrait< DynamicMatrix<T,SO1>, MT >::Type Type;
2158 };
2159 
2160 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
2161 struct SubTrait< UniLowerMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
2162 {
2163  typedef typename SubTrait< MT, CustomMatrix<T,AF,PF,SO2> >::Type Type;
2164 };
2165 
2166 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
2167 struct SubTrait< CustomMatrix<T,AF,PF,SO1>, UniLowerMatrix<MT,SO2,DF> >
2168 {
2169  typedef typename SubTrait< CustomMatrix<T,AF,PF,SO1>, MT >::Type Type;
2170 };
2171 
2172 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
2173 struct SubTrait< UniLowerMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
2174 {
2175  typedef typename SubTrait< MT, CompressedMatrix<T,SO2> >::Type Type;
2176 };
2177 
2178 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
2179 struct SubTrait< CompressedMatrix<T,SO1>, UniLowerMatrix<MT,SO2,DF> >
2180 {
2181  typedef typename SubTrait< CompressedMatrix<T,SO1>, MT >::Type Type;
2182 };
2183 
2184 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
2185 struct SubTrait< UniLowerMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
2186 {
2187  typedef typename SubTrait<MT1,MT2>::Type Type;
2188 };
2189 
2190 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
2191 struct SubTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, UniLowerMatrix<MT2,SO2,DF2> >
2192 {
2193  typedef typename SubTrait<MT1,MT2>::Type Type;
2194 };
2195 
2196 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2197 struct SubTrait< UniLowerMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
2198 {
2199  typedef typename SubTrait<MT1,MT2>::Type Type;
2200 };
2201 
2202 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2203 struct SubTrait< HermitianMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
2204 {
2205  typedef typename SubTrait<MT1,MT2>::Type Type;
2206 };
2207 
2208 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2209 struct SubTrait< UniLowerMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
2210 {
2211  typedef LowerMatrix< typename SubTrait<MT1,MT2>::Type > Type;
2212 };
2213 
2214 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2215 struct SubTrait< LowerMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
2216 {
2217  typedef LowerMatrix< typename SubTrait<MT1,MT2>::Type > Type;
2218 };
2219 
2220 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2221 struct SubTrait< UniLowerMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
2222 {
2223  typedef LowerMatrix< typename SubTrait<MT1,MT2>::Type > Type;
2224 };
2226 //*************************************************************************************************
2227 
2228 
2229 
2230 
2231 //=================================================================================================
2232 //
2233 // MULTTRAIT SPECIALIZATIONS
2234 //
2235 //=================================================================================================
2236 
2237 //*************************************************************************************************
2239 template< typename MT, bool SO, bool DF, typename T >
2240 struct MultTrait< UniLowerMatrix<MT,SO,DF>, T, typename EnableIf< IsNumeric<T> >::Type >
2241 {
2242  typedef LowerMatrix< typename MultTrait<MT,T>::Type > Type;
2243 };
2244 
2245 template< typename T, typename MT, bool SO, bool DF >
2246 struct MultTrait< T, UniLowerMatrix<MT,SO,DF>, typename EnableIf< IsNumeric<T> >::Type >
2247 {
2248  typedef LowerMatrix< typename MultTrait<T,MT>::Type > Type;
2249 };
2250 
2251 template< typename MT, bool SO, bool DF, typename T, size_t N >
2252 struct MultTrait< UniLowerMatrix<MT,SO,DF>, StaticVector<T,N,false> >
2253 {
2254  typedef typename MultTrait< MT, StaticVector<T,N,false> >::Type Type;
2255 };
2256 
2257 template< typename T, size_t N, typename MT, bool SO, bool DF >
2258 struct MultTrait< StaticVector<T,N,true>, UniLowerMatrix<MT,SO,DF> >
2259 {
2260  typedef typename MultTrait< StaticVector<T,N,true>, MT >::Type Type;
2261 };
2262 
2263 template< typename MT, bool SO, bool DF, typename T, size_t N >
2264 struct MultTrait< UniLowerMatrix<MT,SO,DF>, HybridVector<T,N,false> >
2265 {
2266  typedef typename MultTrait< MT, HybridVector<T,N,false> >::Type Type;
2267 };
2268 
2269 template< typename T, size_t N, typename MT, bool SO, bool DF >
2270 struct MultTrait< HybridVector<T,N,true>, UniLowerMatrix<MT,SO,DF> >
2271 {
2272  typedef typename MultTrait< HybridVector<T,N,true>, MT >::Type Type;
2273 };
2274 
2275 template< typename MT, bool SO, bool DF, typename T >
2276 struct MultTrait< UniLowerMatrix<MT,SO,DF>, DynamicVector<T,false> >
2277 {
2278  typedef typename MultTrait< MT, DynamicVector<T,false> >::Type Type;
2279 };
2280 
2281 template< typename T, typename MT, bool SO, bool DF >
2282 struct MultTrait< DynamicVector<T,true>, UniLowerMatrix<MT,SO,DF> >
2283 {
2284  typedef typename MultTrait< DynamicVector<T,true>, MT >::Type Type;
2285 };
2286 
2287 template< typename MT, bool SO, bool DF, typename T, bool AF, bool PF >
2288 struct MultTrait< UniLowerMatrix<MT,SO,DF>, CustomVector<T,AF,PF,false> >
2289 {
2290  typedef typename MultTrait< MT, CustomVector<T,AF,PF,false> >::Type Type;
2291 };
2292 
2293 template< typename T, bool AF, bool PF, typename MT, bool SO, bool DF >
2294 struct MultTrait< CustomVector<T,AF,PF,true>, UniLowerMatrix<MT,SO,DF> >
2295 {
2296  typedef typename MultTrait< CustomVector<T,AF,PF,true>, MT >::Type Type;
2297 };
2298 
2299 template< typename MT, bool SO, bool DF, typename T >
2300 struct MultTrait< UniLowerMatrix<MT,SO,DF>, CompressedVector<T,false> >
2301 {
2302  typedef typename MultTrait< MT, CompressedVector<T,false> >::Type Type;
2303 };
2304 
2305 template< typename T, typename MT, bool SO, bool DF >
2306 struct MultTrait< CompressedVector<T,true>, UniLowerMatrix<MT,SO,DF> >
2307 {
2308  typedef typename MultTrait< CompressedVector<T,true>, MT >::Type Type;
2309 };
2310 
2311 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
2312 struct MultTrait< UniLowerMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
2313 {
2314  typedef typename MultTrait< MT, StaticMatrix<T,M,N,SO2> >::Type Type;
2315 };
2316 
2317 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
2318 struct MultTrait< StaticMatrix<T,M,N,SO1>, UniLowerMatrix<MT,SO2,DF> >
2319 {
2320  typedef typename MultTrait< StaticMatrix<T,M,N,SO1>, MT >::Type Type;
2321 };
2322 
2323 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
2324 struct MultTrait< UniLowerMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
2325 {
2326  typedef typename MultTrait< MT, HybridMatrix<T,M,N,SO2> >::Type Type;
2327 };
2328 
2329 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
2330 struct MultTrait< HybridMatrix<T,M,N,SO1>, UniLowerMatrix<MT,SO2,DF> >
2331 {
2332  typedef typename MultTrait< HybridMatrix<T,M,N,SO1>, MT >::Type Type;
2333 };
2334 
2335 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
2336 struct MultTrait< UniLowerMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
2337 {
2338  typedef typename MultTrait< MT, DynamicMatrix<T,SO2> >::Type Type;
2339 };
2340 
2341 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
2342 struct MultTrait< DynamicMatrix<T,SO1>, UniLowerMatrix<MT,SO2,DF> >
2343 {
2344  typedef typename MultTrait< DynamicMatrix<T,SO1>, MT >::Type Type;
2345 };
2346 
2347 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
2348 struct MultTrait< UniLowerMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
2349 {
2350  typedef typename MultTrait< MT, CustomMatrix<T,AF,PF,SO2> >::Type Type;
2351 };
2352 
2353 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
2354 struct MultTrait< CustomMatrix<T,AF,PF,SO1>, UniLowerMatrix<MT,SO2,DF> >
2355 {
2356  typedef typename MultTrait< CustomMatrix<T,AF,PF,SO1>, MT >::Type Type;
2357 };
2358 
2359 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
2360 struct MultTrait< UniLowerMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
2361 {
2362  typedef typename MultTrait< MT, CompressedMatrix<T,SO2> >::Type Type;
2363 };
2364 
2365 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
2366 struct MultTrait< CompressedMatrix<T,SO1>, UniLowerMatrix<MT,SO2,DF> >
2367 {
2368  typedef typename MultTrait< CompressedMatrix<T,SO1>, MT >::Type Type;
2369 };
2370 
2371 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
2372 struct MultTrait< UniLowerMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
2373 {
2374  typedef typename MultTrait<MT1,MT2>::Type Type;
2375 };
2376 
2377 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
2378 struct MultTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, UniLowerMatrix<MT2,SO2,DF2> >
2379 {
2380  typedef typename MultTrait<MT1,MT2>::Type Type;
2381 };
2382 
2383 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2384 struct MultTrait< UniLowerMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
2385 {
2386  typedef typename MultTrait<MT1,MT2>::Type Type;
2387 };
2388 
2389 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2390 struct MultTrait< HermitianMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
2391 {
2392  typedef typename MultTrait<MT1,MT2>::Type Type;
2393 };
2394 
2395 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2396 struct MultTrait< UniLowerMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
2397 {
2398  typedef LowerMatrix< typename MultTrait<MT1,MT2>::Type > Type;
2399 };
2400 
2401 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2402 struct MultTrait< LowerMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
2403 {
2404  typedef LowerMatrix< typename MultTrait<MT1,MT2>::Type > Type;
2405 };
2406 
2407 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2408 struct MultTrait< UniLowerMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
2409 {
2410  typedef UniLowerMatrix< typename MultTrait<MT1,MT2>::Type > Type;
2411 };
2413 //*************************************************************************************************
2414 
2415 
2416 
2417 
2418 //=================================================================================================
2419 //
2420 // DIVTRAIT SPECIALIZATIONS
2421 //
2422 //=================================================================================================
2423 
2424 //*************************************************************************************************
2426 template< typename MT, bool SO, bool DF, typename T >
2427 struct DivTrait< UniLowerMatrix<MT,SO,DF>, T, typename EnableIf< IsNumeric<T> >::Type >
2428 {
2429  typedef LowerMatrix< typename DivTrait<MT,T>::Type > Type;
2430 };
2432 //*************************************************************************************************
2433 
2434 
2435 
2436 
2437 //=================================================================================================
2438 //
2439 // MATHTRAIT SPECIALIZATIONS
2440 //
2441 //=================================================================================================
2442 
2443 //*************************************************************************************************
2445 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2446 struct MathTrait< UniLowerMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
2447 {
2448  typedef UniLowerMatrix< typename MathTrait<MT1,MT2>::HighType > HighType;
2449  typedef UniLowerMatrix< typename MathTrait<MT1,MT2>::LowType > LowType;
2450 };
2452 //*************************************************************************************************
2453 
2454 
2455 
2456 
2457 //=================================================================================================
2458 //
2459 // SUBMATRIXTRAIT SPECIALIZATIONS
2460 //
2461 //=================================================================================================
2462 
2463 //*************************************************************************************************
2465 template< typename MT, bool SO, bool DF >
2466 struct SubmatrixTrait< UniLowerMatrix<MT,SO,DF> >
2467 {
2468  typedef typename SubmatrixTrait<MT>::Type Type;
2469 };
2471 //*************************************************************************************************
2472 
2473 
2474 
2475 
2476 //=================================================================================================
2477 //
2478 // ROWTRAIT SPECIALIZATIONS
2479 //
2480 //=================================================================================================
2481 
2482 //*************************************************************************************************
2484 template< typename MT, bool SO, bool DF >
2485 struct RowTrait< UniLowerMatrix<MT,SO,DF> >
2486 {
2487  typedef typename RowTrait<MT>::Type Type;
2488 };
2490 //*************************************************************************************************
2491 
2492 
2493 
2494 
2495 //=================================================================================================
2496 //
2497 // COLUMNTRAIT SPECIALIZATIONS
2498 //
2499 //=================================================================================================
2500 
2501 //*************************************************************************************************
2503 template< typename MT, bool SO, bool DF >
2504 struct ColumnTrait< UniLowerMatrix<MT,SO,DF> >
2505 {
2506  typedef typename ColumnTrait<MT>::Type Type;
2507 };
2509 //*************************************************************************************************
2510 
2511 } // namespace blaze
2512 
2513 #endif
bool isOne(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is 1.
Definition: DiagonalProxy.h:609
Header file for mathematical functions.
void trtri(char uplo, char diag, int n, float *A, int lda, int *info)
LAPACK kernel for the inversion of the given dense triangular single precision column-major matrix...
Definition: trtri.h:133
Header file for the Rows type trait.
Header file for the UNUSED_PARAMETER function template.
Header file for the subtraction trait.
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:252
Header file for the row trait.
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:250
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:507
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix)
Returns the current number of rows of the matrix.
Definition: Matrix.h:308
DisableIf< Or< IsComputation< MT >, IsTransExpr< MT > >, typename ColumnExprTrait< MT >::Type >::Type column(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific column of the given matrix.
Definition: Column.h:107
void UNUSED_PARAMETER(const T1 &)
Suppression of unused parameter warnings.
Definition: Unused.h:81
#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:118
Constraint on the data type.
Header file for the IsUniLower type trait.
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:547
Constraint on the data type.
Header file for the IsSquare type trait.
UniLowerMatrix specialization for sparse matrices.
Header file for the multiplication trait.
Header file for the implementation of the base template of the LowerMatrix.
Header file for the LAPACK triangular matrix inversion functions (trtri)
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:2592
const MT::ElementType min(const DenseMatrix< MT, SO > &dm)
Returns the smallest element of the dense matrix.
Definition: DenseMatrix.h:1682
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:217
Header file for the Columns type trait.
Header file for the implementation of a fixed-size matrix.
Header file for the IsAligned type trait.
#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:118
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:187
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:532
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2586
Constraint on the data type.
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:527
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.
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 > >, typename RowExprTrait< MT >::Type >::Type row(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific row of the given matrix.
Definition: Row.h:107
#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:116
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:118
Header file for the column trait.
Header file for the isDefault shim.
#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:79
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:118
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b)
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:256
Header file for the mathematical trait.
boost::false_type FalseType
Type/value traits base class.The FalseType class is used as base class for type traits and value trai...
Definition: FalseType.h:61
UniLowerMatrix specialization for dense matrices.
Header file for the IsTrue value trait.
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix)
Returns the current number of columns of the matrix.
Definition: Matrix.h:324
Matrix adapter for lower unitriangular matrices.
Definition: Forward.h:53
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:237
#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:116
boost::true_type TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: TrueType.h:61
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
bool isIdentity(const DenseMatrix< MT, SO > &dm)
Checks if the give dense matrix is an identity matrix.
Definition: DenseMatrix.h:1605
Header file for the implementation of the base template of the UniLowerMatrix.