UpperMatrix.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_ADAPTORS_UPPERMATRIX_H_
36 #define _BLAZE_MATH_ADAPTORS_UPPERMATRIX_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
54 #include <blaze/math/Forward.h>
55 #include <blaze/math/Functions.h>
79 #include <blaze/util/Assert.h>
80 #include <blaze/util/EnableIf.h>
81 #include <blaze/util/Exception.h>
83 #include <blaze/util/Unused.h>
85 
86 
87 namespace blaze {
88 
89 //=================================================================================================
90 //
91 // UPPERMATRIX OPERATORS
92 //
93 //=================================================================================================
94 
95 //*************************************************************************************************
98 template< typename MT, bool SO, bool DF >
99 inline void reset( UpperMatrix<MT,SO,DF>& m );
100 
101 template< typename MT, bool SO, bool DF >
102 inline void reset( UpperMatrix<MT,SO,DF>& m, size_t i );
103 
104 template< typename MT, bool SO, bool DF >
105 inline void clear( UpperMatrix<MT,SO,DF>& m );
106 
107 template< typename MT, bool SO, bool DF >
108 inline bool isDefault( const UpperMatrix<MT,SO,DF>& m );
109 
110 template< typename MT, bool SO, bool DF >
111 inline bool isIntact( const UpperMatrix<MT,SO,DF>& m );
112 
113 template< typename MT, bool SO, bool DF >
114 inline void swap( UpperMatrix<MT,SO,DF>& a, UpperMatrix<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
129 inline void reset( UpperMatrix<MT,SO,DF>& m )
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( UpperMatrix<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
169 inline void clear( UpperMatrix<MT,SO,DF>& m )
170 {
171  m.clear();
172 }
173 //*************************************************************************************************
174 
175 
176 //*************************************************************************************************
197 template< typename MT // Type of the adapted matrix
198  , bool SO // Storage order of the adapted matrix
199  , bool DF > // Density flag
200 inline bool isDefault( const UpperMatrix<MT,SO,DF>& m )
201 {
202  return isDefault( m.matrix_ );
203 }
204 //*************************************************************************************************
205 
206 
207 //*************************************************************************************************
228 template< typename MT // Type of the adapted matrix
229  , bool SO // Storage order of the adapted matrix
230  , bool DF > // Density flag
231 inline bool isIntact( const UpperMatrix<MT,SO,DF>& m )
232 {
233  return m.isIntact();
234 }
235 //*************************************************************************************************
236 
237 
238 //*************************************************************************************************
247 template< typename MT // Type of the adapted matrix
248  , bool SO // Storage order of the adapted matrix
249  , bool DF > // Density flag
250 inline void swap( UpperMatrix<MT,SO,DF>& a, UpperMatrix<MT,SO,DF>& b ) /* throw() */
251 {
252  a.swap( b );
253 }
254 //*************************************************************************************************
255 
256 
257 //*************************************************************************************************
273 template< typename MT // Type of the dense matrix
274  , bool SO > // Storage order of the dense matrix
275 inline void invert2x2( UpperMatrix<MT,SO,true>& m )
276 {
278 
279  BLAZE_INTERNAL_ASSERT( m.rows() == 2UL, "Invalid number of rows detected" );
280  BLAZE_INTERNAL_ASSERT( m.columns() == 2UL, "Invalid number of columns detected" );
281 
282  typedef typename MT::ElementType ET;
283 
284  typename DerestrictTrait<MT>::Type A( derestrict( m ) );
285 
286  const ET det( A(0,0) * A(1,1) );
287 
288  if( isDefault( det ) ) {
289  BLAZE_THROW_INVALID_ARGUMENT( "Inversion of singular matrix failed" );
290  }
291 
292  const ET idet( ET(1) / det );
293  const ET a11( A(0,0) * idet );
294 
295  A(0,0) = A(1,1) * idet;
296  A(0,1) = -A(0,1) * idet;
297  A(1,1) = a11;
298 
299  BLAZE_INTERNAL_ASSERT( isIntact( m ), "Broken invariant detected" );
300 }
302 //*************************************************************************************************
303 
304 
305 //*************************************************************************************************
321 template< typename MT // Type of the dense matrix
322  , bool SO > // Storage order of the dense matrix
323 inline void invert3x3( UpperMatrix<MT,SO,true>& m )
324 {
326 
327  BLAZE_INTERNAL_ASSERT( m.rows() == 3UL, "Invalid number of rows detected" );
328  BLAZE_INTERNAL_ASSERT( m.columns() == 3UL, "Invalid number of columns detected" );
329 
330  typedef typename MT::ElementType ET;
331 
332  const StaticMatrix<ET,3UL,3UL,SO> A( m );
333  typename DerestrictTrait<MT>::Type B( derestrict( m ) );
334 
335  const ET tmp( A(1,1)*A(2,2) );
336  const ET det( A(0,0)*tmp );
337 
338  if( isDefault( det ) ) {
339  BLAZE_THROW_INVALID_ARGUMENT( "Inversion of singular matrix failed" );
340  }
341 
342  B(0,0) = tmp;
343  B(0,1) = - A(0,1)*A(2,2);
344  B(1,1) = A(0,0)*A(2,2);
345  B(0,2) = A(0,1)*A(1,2) - A(0,2)*A(1,1);
346  B(1,2) = - A(0,0)*A(1,2);
347  B(2,2) = A(0,0)*A(1,1);
348 
349  B /= det;
350 
351  BLAZE_INTERNAL_ASSERT( isIntact( m ), "Broken invariant detected" );
352 }
354 //*************************************************************************************************
355 
356 
357 //*************************************************************************************************
373 template< typename MT // Type of the dense matrix
374  , bool SO > // Storage order of the dense matrix
375 inline void invert4x4( UpperMatrix<MT,SO,true>& m )
376 {
378 
379  BLAZE_INTERNAL_ASSERT( m.rows() == 4UL, "Invalid number of rows detected" );
380  BLAZE_INTERNAL_ASSERT( m.columns() == 4UL, "Invalid number of columns detected" );
381 
382  typedef typename MT::ElementType ET;
383 
384  const StaticMatrix<ET,4UL,4UL,SO> A( m );
385  typename DerestrictTrait<MT>::Type B( derestrict( m ) );
386 
387  ET tmp1( A(2,2)*A(3,3) );
388  ET tmp2( A(0,1)*A(1,2) - A(0,2)*A(1,1) );
389  ET tmp3( A(0,0)*A(1,2) );
390  ET tmp4( A(0,0)*A(1,1) );
391 
392  const ET det( A(0,0)*A(1,1)*tmp1 );
393 
394  if( isDefault( det ) ) {
395  BLAZE_THROW_INVALID_ARGUMENT( "Inversion of singular matrix failed" );
396  }
397 
398  B(0,0) = A(1,1)*tmp1;
399  B(0,1) = - A(0,1)*tmp1;
400  B(1,1) = A(0,0)*tmp1;
401  B(0,2) = A(3,3)*tmp2;
402  B(1,2) = - A(3,3)*tmp3;
403  B(2,2) = A(3,3)*tmp4;
404  B(0,3) = A(2,2)*( A(0,1)*A(1,3) - A(0,3)*A(1,1) ) - A(2,3)*tmp2;
405  B(1,3) = A(2,3)*tmp3 - A(2,2)*A(0,0)*A(1,3);
406  B(2,3) = - A(2,3)*tmp4;
407  B(3,3) = A(2,2)*tmp4;
408 
409  B /= det;
410 
411  BLAZE_INTERNAL_ASSERT( isIntact( m ), "Broken invariant detected" );
412 }
414 //*************************************************************************************************
415 
416 
417 //*************************************************************************************************
433 template< typename MT // Type of the dense matrix
434  , bool SO > // Storage order of the dense matrix
435 inline void invert5x5( UpperMatrix<MT,SO,true>& m )
436 {
438 
439  BLAZE_INTERNAL_ASSERT( m.rows() == 5UL, "Invalid number of rows detected" );
440  BLAZE_INTERNAL_ASSERT( m.columns() == 5UL, "Invalid number of columns detected" );
441 
442  typedef typename MT::ElementType ET;
443 
444  const StaticMatrix<ET,5UL,5UL,SO> A( m );
445  typename DerestrictTrait<MT>::Type B( derestrict( m ) );
446 
447  const ET tmp1( A(3,3)*A(4,4) );
448  const ET tmp2( A(0,1)*A(1,2) - A(0,2)*A(1,1) );
449  const ET tmp3( A(0,0)*A(1,2) );
450  const ET tmp4( A(0,0)*A(1,1) );
451 
452  const ET tmp5 ( A(2,2)*tmp1 );
453  const ET tmp6 ( A(1,2)*tmp1 );
454  const ET tmp7 ( A(1,1)*tmp1 );
455  const ET tmp8 ( A(2,3)*tmp2 - A(2,2)*( A(0,1)*A(1,3) - A(0,3)*A(1,1) ) );
456  const ET tmp9 ( A(2,3)*tmp3 - A(2,2)*A(0,0)*A(1,3) );
457  const ET tmp10( A(2,3)*tmp4 );
458  const ET tmp11( A(2,2)*tmp4 );
459 
460  B(0,0) = A(1,1)*tmp5;
461  B(0,1) = - A(0,1)*tmp5;
462  B(1,1) = A(0,0)*tmp5;
463  B(0,2) = A(0,1)*tmp6 - A(0,2)*tmp7;
464  B(1,2) = - A(0,0)*tmp6;
465  B(2,2) = A(0,0)*tmp7;
466  B(0,3) = - A(4,4)*tmp8;
467  B(1,3) = A(4,4)*tmp9;
468  B(2,3) = - A(4,4)*tmp10;
469  B(3,3) = A(4,4)*tmp11;
470  B(0,4) = A(3,4)*tmp8 - A(3,3)*( A(2,4)*tmp2 - A(2,2)*( A(0,1)*A(1,4) - A(0,4)*A(1,1) ) );
471  B(1,4) = A(3,3)*( A(2,4)*tmp3 - A(2,2)*A(0,0)*A(1,4) ) - A(3,4)*tmp9;
472  B(2,4) = A(3,4)*tmp10 - A(3,3)*A(2,4)*tmp4;
473  B(3,4) = - A(3,4)*tmp11;
474  B(4,4) = A(3,3)*tmp11;
475 
476  const ET det( A(0,0) * B(0,0) );
477 
478  if( isDefault( det ) ) {
479  BLAZE_THROW_INVALID_ARGUMENT( "Inversion of singular matrix failed" );
480  }
481 
482  B /= det;
483 
484  BLAZE_INTERNAL_ASSERT( isIntact( m ), "Broken invariant detected" );
485 }
487 //*************************************************************************************************
488 
489 
490 //*************************************************************************************************
506 template< typename MT // Type of the dense matrix
507  , bool SO > // Storage order of the dense matrix
508 inline void invert6x6( UpperMatrix<MT,SO,true>& m )
509 {
511 
512  BLAZE_INTERNAL_ASSERT( m.rows() == 6UL, "Invalid number of rows detected" );
513  BLAZE_INTERNAL_ASSERT( m.columns() == 6UL, "Invalid number of columns detected" );
514 
515  typedef typename MT::ElementType ET;
516 
517  const StaticMatrix<ET,6UL,6UL,SO> A( m );
518  typename DerestrictTrait<MT>::Type B( derestrict( m ) );
519 
520  const ET tmp1( A(0,1)*A(1,2) - A(0,2)*A(1,1) );
521  const ET tmp2( A(0,0)*A(1,2) );
522  const ET tmp3( A(0,0)*A(1,1) );
523 
524  const ET tmp4( A(3,3)*A(4,4)*A(5,5) );
525  const ET tmp5( A(2,3)*tmp1 - A(2,2)*( A(0,1)*A(1,3) - A(0,3)*A(1,1) ) );
526  const ET tmp6( A(2,3)*tmp2 - A(0,0)*A(1,3)*A(2,2) );
527  const ET tmp7( A(2,3)*tmp3 );
528  const ET tmp8( A(2,2)*tmp3 );
529 
530  const ET tmp9 ( A(2,2)*tmp4 );
531  const ET tmp10( A(1,2)*tmp4 );
532  const ET tmp11( A(1,1)*tmp4 );
533  const ET tmp12( A(3,3)*( A(2,4)*tmp1 - A(2,2)*( A(0,1)*A(1,4) - A(0,4)*A(1,1) ) ) - A(3,4)*tmp5 );
534  const ET tmp13( A(3,3)*( A(2,4)*tmp2 - A(0,0)*A(1,4)*A(2,2) ) - A(3,4)*tmp6 );
535  const ET tmp14( A(3,3)*A(2,4)*tmp3 - A(3,4)*tmp7 );
536  const ET tmp15( - A(3,4)*tmp8 );
537  const ET tmp16( - A(3,3)*tmp8 );
538 
539  B(0,0) = A(1,1)*tmp9;
540  B(0,1) = - A(0,1)*tmp9;
541  B(1,1) = A(0,0)*tmp9;
542  B(0,2) = A(0,1)*tmp10 - A(0,2)*tmp11;
543  B(1,2) = - A(0,0)*tmp10;
544  B(2,2) = A(0,0)*tmp11;
545  B(0,3) = - A(5,5)*A(4,4)*tmp5;
546  B(1,3) = A(5,5)*A(4,4)*tmp6;
547  B(2,3) = - A(5,5)*A(4,4)*tmp7;
548  B(3,3) = A(5,5)*A(4,4)*tmp8;
549  B(0,4) = - A(5,5)*tmp12;
550  B(1,4) = A(5,5)*tmp13;
551  B(2,4) = - A(5,5)*tmp14;
552  B(3,4) = A(5,5)*tmp15;
553  B(4,4) = - A(5,5)*tmp16;
554  B(0,5) = - A(4,4)*( A(3,3)*( A(2,5)*tmp1 - A(2,2)*( A(0,1)*A(1,5) - A(0,5)*A(1,1) ) ) - A(3,5)*tmp5 ) + A(4,5)*tmp12;
555  B(1,5) = A(4,4)*( A(3,3)*( A(2,5)*tmp2 - A(0,0)*A(1,5)*A(2,2) ) - A(3,5)*tmp6 ) - A(4,5)*tmp13;
556  B(2,5) = - A(4,4)*( A(3,3)*A(2,5)*tmp3 - A(3,5)*tmp7 ) + A(4,5)*tmp14;
557  B(3,5) = - A(4,4)*A(3,5)*tmp8 - A(4,5)*tmp15;
558  B(4,5) = A(4,5)*tmp16;
559  B(5,5) = - A(4,4)*tmp16;
560 
561  const ET det( A(0,0)*B(0,0) );
562 
563  if( isDefault( det ) ) {
564  BLAZE_THROW_INVALID_ARGUMENT( "Inversion of singular matrix failed" );
565  }
566 
567  B /= det;
568 
569  BLAZE_INTERNAL_ASSERT( isIntact( m ), "Broken invariant detected" );
570 }
572 //*************************************************************************************************
573 
574 
575 //*************************************************************************************************
598 template< typename MT // Type of the dense matrix
599  , bool SO > // Storage order of the dense matrix
600 inline void invertByDefault( UpperMatrix<MT,SO,true>& m )
601 {
602  invertByLU( m );
603 }
605 //*************************************************************************************************
606 
607 
608 //*************************************************************************************************
631 template< typename MT // Type of the dense matrix
632  , bool SO > // Storage order of the dense matrix
633 inline void invertByLU( UpperMatrix<MT,SO,true>& m )
634 {
636 
637  typename DerestrictTrait<MT>::Type A( derestrict( ~m ) );
638 
639  trtri( A, 'U', 'N' );
640 }
642 //*************************************************************************************************
643 
644 
645 //*************************************************************************************************
668 template< typename MT // Type of the dense matrix
669  , bool SO > // Storage order of the dense matrix
670 inline void invertByLDLT( UpperMatrix<MT,SO,true>& m )
671 {
672  invertByLLH( m );
673 }
675 //*************************************************************************************************
676 
677 
678 //*************************************************************************************************
701 template< typename MT // Type of the dense matrix
702  , bool SO > // Storage order of the dense matrix
703 inline void invertByLDLH( UpperMatrix<MT,SO,true>& m )
704 {
705  invertByLLH( m );
706 }
708 //*************************************************************************************************
709 
710 
711 //*************************************************************************************************
731 template< typename MT // Type of the dense matrix
732  , bool SO > // Storage order of the dense matrix
733 inline void invertByLLH( UpperMatrix<MT,SO,true>& m )
734 {
736 
737  BLAZE_INTERNAL_ASSERT( isDiagonal( ~m ), "Violation of preconditions detected" );
738 
739  typename DerestrictTrait<MT>::Type A( derestrict( ~m ) );
740 
741  for( size_t i=0UL; i<A.rows(); ++i )
742  {
743  if( isDefault( A(i,i) ) ) {
744  BLAZE_THROW_INVALID_ARGUMENT( "Inversion of singular matrix failed" );
745  }
746 
747  invert( A(i,i) );
748  }
749 }
751 //*************************************************************************************************
752 
753 
754 //*************************************************************************************************
773 template< typename MT1, bool SO1, typename MT2, typename MT3, typename MT4, bool SO2 >
774 inline void lu( const UpperMatrix<MT1,SO1,true>& A, DenseMatrix<MT2,SO1>& L,
775  DenseMatrix<MT3,SO1>& U, Matrix<MT4,SO2>& P )
776 {
778 
783 
788 
789  typedef typename MT2::ElementType ET2;
790  typedef typename MT4::ElementType ET4;
791 
792  const size_t n( (~A).rows() );
793 
794  typename DerestrictTrait<MT2>::Type L2( derestrict( ~L ) );
795 
796  (~U) = A;
797 
798  resize( ~L, n, n );
799  reset( L2 );
800 
801  resize( ~P, n, n );
802  reset( ~P );
803 
804  for( size_t i=0UL; i<n; ++i ) {
805  L2(i,i) = ET2(1);
806  (~P)(i,i) = ET4(1);
807  }
808 }
810 //*************************************************************************************************
811 
812 
813 //*************************************************************************************************
829 template< typename MT // Type of the adapted matrix
830  , bool SO // Storage order of the adapted matrix
831  , bool DF // Density flag
832  , typename VT > // Type of the right-hand side dense vector
833 inline bool tryAssign( const UpperMatrix<MT,SO,DF>& lhs,
834  const DenseVector<VT,false>& rhs, size_t row, size_t column )
835 {
837 
838  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
839  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
840  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.rows() - row, "Invalid number of rows" );
841 
842  UNUSED_PARAMETER( lhs );
843 
844  const size_t ibegin( ( column < row )?( 0UL ):( column - row + 1UL ) );
845 
846  for( size_t i=ibegin; i<(~rhs).size(); ++i ) {
847  if( !isDefault( (~rhs)[i] ) )
848  return false;
849  }
850 
851  return true;
852 }
854 //*************************************************************************************************
855 
856 
857 //*************************************************************************************************
873 template< typename MT // Type of the adapted matrix
874  , bool SO // Storage order of the adapted matrix
875  , bool DF // Density flag
876  , typename VT > // Type of the right-hand side dense vector
877 inline bool tryAssign( const UpperMatrix<MT,SO,DF>& lhs,
878  const DenseVector<VT,true>& rhs, size_t row, size_t column )
879 {
881 
882  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
883  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
884  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.columns() - column, "Invalid number of columns" );
885 
886  UNUSED_PARAMETER( lhs );
887 
888  if( row <= column )
889  return true;
890 
891  const size_t iend( min( row - column, (~rhs).size() ) );
892 
893  for( size_t i=0UL; i<iend; ++i ) {
894  if( !isDefault( (~rhs)[i] ) )
895  return false;
896  }
897 
898  return true;
899 }
901 //*************************************************************************************************
902 
903 
904 //*************************************************************************************************
920 template< typename MT // Type of the adapted matrix
921  , bool SO // Storage order of the adapted matrix
922  , bool DF // Density flag
923  , typename VT > // Type of the right-hand side sparse vector
924 inline bool tryAssign( const UpperMatrix<MT,SO,DF>& lhs,
925  const SparseVector<VT,false>& rhs, size_t row, size_t column )
926 {
928 
929  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
930  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
931  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.rows() - row, "Invalid number of rows" );
932 
933  UNUSED_PARAMETER( lhs );
934 
935  typedef typename VT::ConstIterator RhsIterator;
936 
937  const RhsIterator last( (~rhs).end() );
938  RhsIterator element( (~rhs).lowerBound( ( column < row )?( 0UL ):( column - row + 1UL ) ) );
939 
940  for( ; element!=last; ++element ) {
941  if( !isDefault( element->value() ) )
942  return false;
943  }
944 
945  return true;
946 }
948 //*************************************************************************************************
949 
950 
951 //*************************************************************************************************
967 template< typename MT // Type of the adapted matrix
968  , bool SO // Storage order of the adapted matrix
969  , bool DF // Density flag
970  , typename VT > // Type of the right-hand side sparse vector
971 inline bool tryAssign( const UpperMatrix<MT,SO,DF>& lhs,
972  const SparseVector<VT,true>& rhs, size_t row, size_t column )
973 {
975 
976  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
977  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
978  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.columns() - column, "Invalid number of columns" );
979 
980  UNUSED_PARAMETER( lhs );
981 
982  typedef typename VT::ConstIterator RhsIterator;
983 
984  if( row <= column )
985  return true;
986 
987  const RhsIterator last( (~rhs).lowerBound( row - column ) );
988 
989  for( RhsIterator element=(~rhs).begin(); element!=last; ++element ) {
990  if( !isDefault( element->value() ) )
991  return false;
992  }
993 
994  return true;
995 }
997 //*************************************************************************************************
998 
999 
1000 //*************************************************************************************************
1016 template< typename MT1 // Type of the adapted matrix
1017  , bool SO // Storage order of the adapted matrix
1018  , bool DF // Density flag
1019  , typename MT2 > // Type of the right-hand side dense matrix
1020 inline bool tryAssign( const UpperMatrix<MT1,SO,DF>& lhs,
1021  const DenseMatrix<MT2,false>& rhs, size_t row, size_t column )
1022 {
1024 
1025  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1026  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1027  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
1028  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
1029 
1030  UNUSED_PARAMETER( lhs );
1031 
1032  const size_t M( (~rhs).rows() );
1033  const size_t N( (~rhs).columns() );
1034 
1035  if( column + 1UL >= row + M )
1036  return true;
1037 
1038  const size_t ibegin( ( column < row )?( 0UL ):( column - row + 1UL ) );
1039 
1040  for( size_t i=ibegin; i<M; ++i )
1041  {
1042  const size_t jend( min( row + i - column, N ) );
1043 
1044  for( size_t j=0UL; j<jend; ++j ) {
1045  if( !isDefault( (~rhs)(i,j) ) )
1046  return false;
1047  }
1048  }
1049 
1050  return true;
1051 }
1053 //*************************************************************************************************
1054 
1055 
1056 //*************************************************************************************************
1072 template< typename MT1 // Type of the adapted matrix
1073  , bool SO // Storage order of the adapted matrix
1074  , bool DF // Density flag
1075  , typename MT2 > // Type of the right-hand side dense matrix
1076 inline bool tryAssign( const UpperMatrix<MT1,SO,DF>& lhs,
1077  const DenseMatrix<MT2,true>& rhs, size_t row, size_t column )
1078 {
1080 
1081  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1082  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1083  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
1084  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
1085 
1086  UNUSED_PARAMETER( lhs );
1087 
1088  const size_t M( (~rhs).rows() );
1089  const size_t N( (~rhs).columns() );
1090 
1091  if( column + 1UL >= row + M )
1092  return true;
1093 
1094  const size_t jend( min( row + M - column - 1UL, N ) );
1095 
1096  for( size_t j=0UL; j<jend; ++j )
1097  {
1098  const bool containsDiagonal( column + j >= row );
1099  const size_t ibegin( ( containsDiagonal )?( column + j - row + 1UL ):( 0UL ) );
1100 
1101  for( size_t i=ibegin; i<M; ++i ) {
1102  if( !isDefault( (~rhs)(i,j) ) )
1103  return false;
1104  }
1105  }
1106 
1107  return true;
1108 }
1110 //*************************************************************************************************
1111 
1112 
1113 //*************************************************************************************************
1129 template< typename MT1 // Type of the adapted matrix
1130  , bool SO // Storage order of the adapted matrix
1131  , bool DF // Density flag
1132  , typename MT2 > // Type of the right-hand side sparse matrix
1133 inline bool tryAssign( const UpperMatrix<MT1,SO,DF>& lhs,
1134  const SparseMatrix<MT2,false>& rhs, size_t row, size_t column )
1135 {
1137 
1138  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1139  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1140  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
1141  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
1142 
1143  UNUSED_PARAMETER( lhs );
1144 
1145  typedef typename MT2::ConstIterator RhsIterator;
1146 
1147  const size_t M( (~rhs).rows() );
1148  const size_t N( (~rhs).columns() );
1149 
1150  if( column + 1UL >= row + M )
1151  return true;
1152 
1153  const size_t ibegin( ( column < row )?( 0UL ):( column - row + 1UL ) );
1154 
1155  for( size_t i=ibegin; i<M; ++i )
1156  {
1157  const size_t index( row + i - column );
1158  const RhsIterator last( (~rhs).lowerBound( i, min( index, N ) ) );
1159 
1160  for( RhsIterator element=(~rhs).begin(i); element!=last; ++element ) {
1161  if( !isDefault( element->value() ) )
1162  return false;
1163  }
1164  }
1165 
1166  return true;
1167 }
1169 //*************************************************************************************************
1170 
1171 
1172 //*************************************************************************************************
1188 template< typename MT1 // Type of the adapted matrix
1189  , bool SO // Storage order of the adapted matrix
1190  , bool DF // Density flag
1191  , typename MT2 > // Type of the right-hand side sparse matrix
1192 inline bool tryAssign( const UpperMatrix<MT1,SO,DF>& lhs,
1193  const SparseMatrix<MT2,true>& rhs, size_t row, size_t column )
1194 {
1196 
1197  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
1198  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
1199  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
1200  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
1201 
1202  UNUSED_PARAMETER( lhs );
1203 
1204  typedef typename MT2::ConstIterator RhsIterator;
1205 
1206  const size_t M( (~rhs).rows() );
1207  const size_t N( (~rhs).columns() );
1208 
1209  if( column + 1UL >= row + M )
1210  return true;
1211 
1212  const size_t jend( min( row + M - column - 1UL, N ) );
1213 
1214  for( size_t j=0UL; j<jend; ++j )
1215  {
1216  const bool containsDiagonal( column + j >= row );
1217  const size_t index( ( containsDiagonal )?( column + j - row + 1UL ):( 0UL ) );
1218 
1219  const RhsIterator last( (~rhs).end(j) );
1220  RhsIterator element( (~rhs).lowerBound( index, j ) );
1221 
1222  for( ; element!=last; ++element ) {
1223  if( !isDefault( element->value() ) )
1224  return false;
1225  }
1226  }
1227 
1228  return true;
1229 }
1231 //*************************************************************************************************
1232 
1233 
1234 //*************************************************************************************************
1250 template< typename MT // Type of the adapted matrix
1251  , bool SO // Storage order of the adapted matrix
1252  , bool DF // Density flag
1253  , typename VT // Type of the right-hand side vector
1254  , bool TF > // Transpose flag of the right-hand side vector
1255 inline bool tryAddAssign( const UpperMatrix<MT,SO,DF>& lhs,
1256  const Vector<VT,TF>& rhs, size_t row, size_t column )
1257 {
1258  return tryAssign( lhs, ~rhs, row, column );
1259 }
1261 //*************************************************************************************************
1262 
1263 
1264 //*************************************************************************************************
1280 template< typename MT1 // Type of the adapted matrix
1281  , bool SO1 // Storage order of the adapted matrix
1282  , bool DF // Density flag
1283  , typename MT2 // Type of the right-hand side matrix
1284  , bool SO2 > // Storage order of the right-hand side matrix
1285 inline bool tryAddAssign( const UpperMatrix<MT1,SO1,DF>& lhs,
1286  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
1287 {
1288  return tryAssign( lhs, ~rhs, row, column );
1289 }
1291 //*************************************************************************************************
1292 
1293 
1294 //*************************************************************************************************
1310 template< typename MT // Type of the adapted matrix
1311  , bool SO // Storage order of the adapted matrix
1312  , bool DF // Density flag
1313  , typename VT // Type of the right-hand side vector
1314  , bool TF > // Transpose flag of the right-hand side vector
1315 inline bool trySubAssign( const UpperMatrix<MT,SO,DF>& lhs,
1316  const Vector<VT,TF>& rhs, size_t row, size_t column )
1317 {
1318  return tryAssign( lhs, ~rhs, row, column );
1319 }
1321 //*************************************************************************************************
1322 
1323 
1324 //*************************************************************************************************
1340 template< typename MT1 // Type of the adapted matrix
1341  , bool SO1 // Storage order of the adapted matrix
1342  , bool DF // Density flag
1343  , typename MT2 // Type of the right-hand side matrix
1344  , bool SO2 > // Storage order of the right-hand side matrix
1345 inline bool trySubAssign( const UpperMatrix<MT1,SO1,DF>& lhs,
1346  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
1347 {
1348  return tryAssign( lhs, ~rhs, row, column );
1349 }
1351 //*************************************************************************************************
1352 
1353 
1354 //*************************************************************************************************
1368 template< typename MT // Type of the adapted matrix
1369  , bool SO // Storage order of the adapted matrix
1370  , bool DF > // Density flag
1371 inline MT& derestrict( UpperMatrix<MT,SO,DF>& m )
1372 {
1373  return m.matrix_;
1374 }
1376 //*************************************************************************************************
1377 
1378 
1379 
1380 
1381 //=================================================================================================
1382 //
1383 // ROWS SPECIALIZATIONS
1384 //
1385 //=================================================================================================
1386 
1387 //*************************************************************************************************
1389 template< typename MT, bool SO, bool DF >
1390 struct Rows< UpperMatrix<MT,SO,DF> > : public Rows<MT>
1391 {};
1393 //*************************************************************************************************
1394 
1395 
1396 
1397 
1398 //=================================================================================================
1399 //
1400 // COLUMNS SPECIALIZATIONS
1401 //
1402 //=================================================================================================
1403 
1404 //*************************************************************************************************
1406 template< typename MT, bool SO, bool DF >
1407 struct Columns< UpperMatrix<MT,SO,DF> > : public Columns<MT>
1408 {};
1410 //*************************************************************************************************
1411 
1412 
1413 
1414 
1415 //=================================================================================================
1416 //
1417 // ISSQUARE SPECIALIZATIONS
1418 //
1419 //=================================================================================================
1420 
1421 //*************************************************************************************************
1423 template< typename MT, bool SO, bool DF >
1424 struct IsSquare< UpperMatrix<MT,SO,DF> > : public IsTrue<true>
1425 {};
1427 //*************************************************************************************************
1428 
1429 
1430 
1431 
1432 //=================================================================================================
1433 //
1434 // ISUPPER SPECIALIZATIONS
1435 //
1436 //=================================================================================================
1437 
1438 //*************************************************************************************************
1440 template< typename MT, bool SO, bool DF >
1441 struct IsUpper< UpperMatrix<MT,SO,DF> > : public IsTrue<true>
1442 {};
1444 //*************************************************************************************************
1445 
1446 
1447 
1448 
1449 //=================================================================================================
1450 //
1451 // ISADAPTOR SPECIALIZATIONS
1452 //
1453 //=================================================================================================
1454 
1455 //*************************************************************************************************
1457 template< typename MT, bool SO, bool DF >
1458 struct IsAdaptor< UpperMatrix<MT,SO,DF> > : public IsTrue<true>
1459 {};
1461 //*************************************************************************************************
1462 
1463 
1464 
1465 
1466 //=================================================================================================
1467 //
1468 // ISRESTRICTED SPECIALIZATIONS
1469 //
1470 //=================================================================================================
1471 
1472 //*************************************************************************************************
1474 template< typename MT, bool SO, bool DF >
1475 struct IsRestricted< UpperMatrix<MT,SO,DF> > : public IsTrue<true>
1476 {};
1478 //*************************************************************************************************
1479 
1480 
1481 
1482 
1483 //=================================================================================================
1484 //
1485 // HASCONSTDATAACCESS SPECIALIZATIONS
1486 //
1487 //=================================================================================================
1488 
1489 //*************************************************************************************************
1491 template< typename MT, bool SO >
1492 struct HasConstDataAccess< UpperMatrix<MT,SO,true> > : public IsTrue<true>
1493 {};
1495 //*************************************************************************************************
1496 
1497 
1498 
1499 
1500 //=================================================================================================
1501 //
1502 // ISALIGNED SPECIALIZATIONS
1503 //
1504 //=================================================================================================
1505 
1506 //*************************************************************************************************
1508 template< typename MT, bool SO, bool DF >
1509 struct IsAligned< UpperMatrix<MT,SO,DF> > : public IsTrue< IsAligned<MT>::value >
1510 {};
1512 //*************************************************************************************************
1513 
1514 
1515 
1516 
1517 //=================================================================================================
1518 //
1519 // ISPADDED SPECIALIZATIONS
1520 //
1521 //=================================================================================================
1522 
1523 //*************************************************************************************************
1525 template< typename MT, bool SO, bool DF >
1526 struct IsPadded< UpperMatrix<MT,SO,DF> > : public IsTrue< IsPadded<MT>::value >
1527 {};
1529 //*************************************************************************************************
1530 
1531 
1532 
1533 
1534 //=================================================================================================
1535 //
1536 // ISRESIZABLE SPECIALIZATIONS
1537 //
1538 //=================================================================================================
1539 
1540 //*************************************************************************************************
1542 template< typename MT, bool SO, bool DF >
1543 struct IsResizable< UpperMatrix<MT,SO,DF> > : public IsTrue< IsResizable<MT>::value >
1544 {};
1546 //*************************************************************************************************
1547 
1548 
1549 
1550 
1551 //=================================================================================================
1552 //
1553 // REMOVEADAPTOR SPECIALIZATIONS
1554 //
1555 //=================================================================================================
1556 
1557 //*************************************************************************************************
1559 template< typename MT, bool SO, bool DF >
1560 struct RemoveAdaptor< UpperMatrix<MT,SO,DF> >
1561 {
1562  typedef MT Type;
1563 };
1565 //*************************************************************************************************
1566 
1567 
1568 
1569 
1570 //=================================================================================================
1571 //
1572 // DERESTRICTTRAIT SPECIALIZATIONS
1573 //
1574 //=================================================================================================
1575 
1576 //*************************************************************************************************
1578 template< typename MT, bool SO, bool DF >
1579 struct DerestrictTrait< UpperMatrix<MT,SO,DF> >
1580 {
1581  typedef MT& Type;
1582 };
1584 //*************************************************************************************************
1585 
1586 
1587 
1588 
1589 //=================================================================================================
1590 //
1591 // ADDTRAIT SPECIALIZATIONS
1592 //
1593 //=================================================================================================
1594 
1595 //*************************************************************************************************
1597 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1598 struct AddTrait< UpperMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
1599 {
1600  typedef typename AddTrait< MT, StaticMatrix<T,M,N,SO2> >::Type Type;
1601 };
1602 
1603 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1604 struct AddTrait< StaticMatrix<T,M,N,SO1>, UpperMatrix<MT,SO2,DF> >
1605 {
1606  typedef typename AddTrait< StaticMatrix<T,M,N,SO1>, MT >::Type Type;
1607 };
1608 
1609 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1610 struct AddTrait< UpperMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
1611 {
1612  typedef typename AddTrait< MT, HybridMatrix<T,M,N,SO2> >::Type Type;
1613 };
1614 
1615 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1616 struct AddTrait< HybridMatrix<T,M,N,SO1>, UpperMatrix<MT,SO2,DF> >
1617 {
1618  typedef typename AddTrait< HybridMatrix<T,M,N,SO1>, MT >::Type Type;
1619 };
1620 
1621 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1622 struct AddTrait< UpperMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
1623 {
1624  typedef typename AddTrait< MT, DynamicMatrix<T,SO2> >::Type Type;
1625 };
1626 
1627 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1628 struct AddTrait< DynamicMatrix<T,SO1>, UpperMatrix<MT,SO2,DF> >
1629 {
1630  typedef typename AddTrait< DynamicMatrix<T,SO1>, MT >::Type Type;
1631 };
1632 
1633 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
1634 struct AddTrait< UpperMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
1635 {
1636  typedef typename AddTrait< MT, CustomMatrix<T,AF,PF,SO2> >::Type Type;
1637 };
1638 
1639 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
1640 struct AddTrait< CustomMatrix<T,AF,PF,SO1>, UpperMatrix<MT,SO2,DF> >
1641 {
1642  typedef typename AddTrait< CustomMatrix<T,AF,PF,SO1>, MT >::Type Type;
1643 };
1644 
1645 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1646 struct AddTrait< UpperMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
1647 {
1648  typedef typename AddTrait< MT, CompressedMatrix<T,SO2> >::Type Type;
1649 };
1650 
1651 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1652 struct AddTrait< CompressedMatrix<T,SO1>, UpperMatrix<MT,SO2,DF> >
1653 {
1654  typedef typename AddTrait< CompressedMatrix<T,SO1>, MT >::Type Type;
1655 };
1656 
1657 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
1658 struct AddTrait< UpperMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
1659 {
1660  typedef typename AddTrait<MT1,MT2>::Type Type;
1661 };
1662 
1663 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
1664 struct AddTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, UpperMatrix<MT2,SO2,DF2> >
1665 {
1666  typedef typename AddTrait<MT1,MT2>::Type Type;
1667 };
1668 
1669 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1670 struct AddTrait< UpperMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1671 {
1672  typedef typename AddTrait<MT1,MT2>::Type Type;
1673 };
1674 
1675 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1676 struct AddTrait< HermitianMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1677 {
1678  typedef typename AddTrait<MT1,MT2>::Type Type;
1679 };
1680 
1681 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1682 struct AddTrait< UpperMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
1683 {
1684  typedef typename AddTrait<MT1,MT2>::Type Type;
1685 };
1686 
1687 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1688 struct AddTrait< LowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1689 {
1690  typedef typename AddTrait<MT1,MT2>::Type Type;
1691 };
1692 
1693 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1694 struct AddTrait< UpperMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
1695 {
1696  typedef typename AddTrait<MT1,MT2>::Type Type;
1697 };
1698 
1699 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1700 struct AddTrait< UniLowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1701 {
1702  typedef typename AddTrait<MT1,MT2>::Type Type;
1703 };
1704 
1705 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1706 struct AddTrait< UpperMatrix<MT1,SO1,DF1>, StrictlyLowerMatrix<MT2,SO2,DF2> >
1707 {
1708  typedef typename AddTrait<MT1,MT2>::Type Type;
1709 };
1710 
1711 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1712 struct AddTrait< StrictlyLowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1713 {
1714  typedef typename AddTrait<MT1,MT2>::Type Type;
1715 };
1716 
1717 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1718 struct AddTrait< UpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1719 {
1720  typedef UpperMatrix< typename AddTrait<MT1,MT2>::Type > Type;
1721 };
1723 //*************************************************************************************************
1724 
1725 
1726 
1727 
1728 //=================================================================================================
1729 //
1730 // SUBTRAIT SPECIALIZATIONS
1731 //
1732 //=================================================================================================
1733 
1734 //*************************************************************************************************
1736 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1737 struct SubTrait< UpperMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
1738 {
1739  typedef typename SubTrait< MT, StaticMatrix<T,M,N,SO2> >::Type Type;
1740 };
1741 
1742 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1743 struct SubTrait< StaticMatrix<T,M,N,SO1>, UpperMatrix<MT,SO2,DF> >
1744 {
1745  typedef typename SubTrait< StaticMatrix<T,M,N,SO1>, MT >::Type Type;
1746 };
1747 
1748 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1749 struct SubTrait< UpperMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
1750 {
1751  typedef typename SubTrait< MT, HybridMatrix<T,M,N,SO2> >::Type Type;
1752 };
1753 
1754 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1755 struct SubTrait< HybridMatrix<T,M,N,SO1>, UpperMatrix<MT,SO2,DF> >
1756 {
1757  typedef typename SubTrait< HybridMatrix<T,M,N,SO1>, MT >::Type Type;
1758 };
1759 
1760 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1761 struct SubTrait< UpperMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
1762 {
1763  typedef typename SubTrait< MT, DynamicMatrix<T,SO2> >::Type Type;
1764 };
1765 
1766 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1767 struct SubTrait< DynamicMatrix<T,SO1>, UpperMatrix<MT,SO2,DF> >
1768 {
1769  typedef typename SubTrait< DynamicMatrix<T,SO1>, MT >::Type Type;
1770 };
1771 
1772 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
1773 struct SubTrait< UpperMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
1774 {
1775  typedef typename SubTrait< MT, CustomMatrix<T,AF,PF,SO2> >::Type Type;
1776 };
1777 
1778 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
1779 struct SubTrait< CustomMatrix<T,AF,PF,SO1>, UpperMatrix<MT,SO2,DF> >
1780 {
1781  typedef typename SubTrait< CustomMatrix<T,AF,PF,SO1>, MT >::Type Type;
1782 };
1783 
1784 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1785 struct SubTrait< UpperMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
1786 {
1787  typedef typename SubTrait< MT, CompressedMatrix<T,SO2> >::Type Type;
1788 };
1789 
1790 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1791 struct SubTrait< CompressedMatrix<T,SO1>, UpperMatrix<MT,SO2,DF> >
1792 {
1793  typedef typename SubTrait< CompressedMatrix<T,SO1>, MT >::Type Type;
1794 };
1795 
1796 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
1797 struct SubTrait< UpperMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
1798 {
1799  typedef typename SubTrait<MT1,MT2>::Type Type;
1800 };
1801 
1802 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
1803 struct SubTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, UpperMatrix<MT2,SO2,DF2> >
1804 {
1805  typedef typename SubTrait<MT1,MT2>::Type Type;
1806 };
1807 
1808 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1809 struct SubTrait< UpperMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1810 {
1811  typedef typename SubTrait<MT1,MT2>::Type Type;
1812 };
1813 
1814 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1815 struct SubTrait< HermitianMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1816 {
1817  typedef typename SubTrait<MT1,MT2>::Type Type;
1818 };
1819 
1820 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1821 struct SubTrait< UpperMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
1822 {
1823  typedef typename SubTrait<MT1,MT2>::Type Type;
1824 };
1825 
1826 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1827 struct SubTrait< LowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1828 {
1829  typedef typename SubTrait<MT1,MT2>::Type Type;
1830 };
1831 
1832 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1833 struct SubTrait< UpperMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
1834 {
1835  typedef typename SubTrait<MT1,MT2>::Type Type;
1836 };
1837 
1838 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1839 struct SubTrait< UniLowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1840 {
1841  typedef typename SubTrait<MT1,MT2>::Type Type;
1842 };
1843 
1844 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1845 struct SubTrait< UpperMatrix<MT1,SO1,DF1>, StrictlyLowerMatrix<MT2,SO2,DF2> >
1846 {
1847  typedef typename SubTrait<MT1,MT2>::Type Type;
1848 };
1849 
1850 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1851 struct SubTrait< StrictlyLowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1852 {
1853  typedef typename SubTrait<MT1,MT2>::Type Type;
1854 };
1855 
1856 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1857 struct SubTrait< UpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1858 {
1859  typedef UpperMatrix< typename SubTrait<MT1,MT2>::Type > Type;
1860 };
1862 //*************************************************************************************************
1863 
1864 
1865 
1866 
1867 //=================================================================================================
1868 //
1869 // MULTTRAIT SPECIALIZATIONS
1870 //
1871 //=================================================================================================
1872 
1873 //*************************************************************************************************
1875 template< typename MT, bool SO, bool DF, typename T >
1876 struct MultTrait< UpperMatrix<MT,SO,DF>, T, typename EnableIf< IsNumeric<T> >::Type >
1877 {
1878  typedef UpperMatrix< typename MultTrait<MT,T>::Type > Type;
1879 };
1880 
1881 template< typename T, typename MT, bool SO, bool DF >
1882 struct MultTrait< T, UpperMatrix<MT,SO,DF>, typename EnableIf< IsNumeric<T> >::Type >
1883 {
1884  typedef UpperMatrix< typename MultTrait<T,MT>::Type > Type;
1885 };
1886 
1887 template< typename MT, bool SO, bool DF, typename T, size_t N >
1888 struct MultTrait< UpperMatrix<MT,SO,DF>, StaticVector<T,N,false> >
1889 {
1890  typedef typename MultTrait< MT, StaticVector<T,N,false> >::Type Type;
1891 };
1892 
1893 template< typename T, size_t N, typename MT, bool SO, bool DF >
1894 struct MultTrait< StaticVector<T,N,true>, UpperMatrix<MT,SO,DF> >
1895 {
1896  typedef typename MultTrait< StaticVector<T,N,true>, MT >::Type Type;
1897 };
1898 
1899 template< typename MT, bool SO, bool DF, typename T, size_t N >
1900 struct MultTrait< UpperMatrix<MT,SO,DF>, HybridVector<T,N,false> >
1901 {
1902  typedef typename MultTrait< MT, HybridVector<T,N,false> >::Type Type;
1903 };
1904 
1905 template< typename T, size_t N, typename MT, bool SO, bool DF >
1906 struct MultTrait< HybridVector<T,N,true>, UpperMatrix<MT,SO,DF> >
1907 {
1908  typedef typename MultTrait< HybridVector<T,N,true>, MT >::Type Type;
1909 };
1910 
1911 template< typename MT, bool SO, bool DF, typename T >
1912 struct MultTrait< UpperMatrix<MT,SO,DF>, DynamicVector<T,false> >
1913 {
1914  typedef typename MultTrait< MT, DynamicVector<T,false> >::Type Type;
1915 };
1916 
1917 template< typename T, typename MT, bool SO, bool DF >
1918 struct MultTrait< DynamicVector<T,true>, UpperMatrix<MT,SO,DF> >
1919 {
1920  typedef typename MultTrait< DynamicVector<T,true>, MT >::Type Type;
1921 };
1922 
1923 template< typename MT, bool SO, bool DF, typename T, bool AF, bool PF >
1924 struct MultTrait< UpperMatrix<MT,SO,DF>, CustomVector<T,AF,PF,false> >
1925 {
1926  typedef typename MultTrait< MT, CustomVector<T,AF,PF,false> >::Type Type;
1927 };
1928 
1929 template< typename T, bool AF, bool PF, typename MT, bool SO, bool DF >
1930 struct MultTrait< CustomVector<T,AF,PF,true>, UpperMatrix<MT,SO,DF> >
1931 {
1932  typedef typename MultTrait< CustomVector<T,AF,PF,true>, MT >::Type Type;
1933 };
1934 
1935 template< typename MT, bool SO, bool DF, typename T >
1936 struct MultTrait< UpperMatrix<MT,SO,DF>, CompressedVector<T,false> >
1937 {
1938  typedef typename MultTrait< MT, CompressedVector<T,false> >::Type Type;
1939 };
1940 
1941 template< typename T, typename MT, bool SO, bool DF >
1942 struct MultTrait< CompressedVector<T,true>, UpperMatrix<MT,SO,DF> >
1943 {
1944  typedef typename MultTrait< CompressedVector<T,true>, MT >::Type Type;
1945 };
1946 
1947 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1948 struct MultTrait< UpperMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
1949 {
1950  typedef typename MultTrait< MT, StaticMatrix<T,M,N,SO2> >::Type Type;
1951 };
1952 
1953 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1954 struct MultTrait< StaticMatrix<T,M,N,SO1>, UpperMatrix<MT,SO2,DF> >
1955 {
1956  typedef typename MultTrait< StaticMatrix<T,M,N,SO1>, MT >::Type Type;
1957 };
1958 
1959 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1960 struct MultTrait< UpperMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
1961 {
1962  typedef typename MultTrait< MT, HybridMatrix<T,M,N,SO2> >::Type Type;
1963 };
1964 
1965 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1966 struct MultTrait< HybridMatrix<T,M,N,SO1>, UpperMatrix<MT,SO2,DF> >
1967 {
1968  typedef typename MultTrait< HybridMatrix<T,M,N,SO1>, MT >::Type Type;
1969 };
1970 
1971 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1972 struct MultTrait< UpperMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
1973 {
1974  typedef typename MultTrait< MT, DynamicMatrix<T,SO2> >::Type Type;
1975 };
1976 
1977 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1978 struct MultTrait< DynamicMatrix<T,SO1>, UpperMatrix<MT,SO2,DF> >
1979 {
1980  typedef typename MultTrait< DynamicMatrix<T,SO1>, MT >::Type Type;
1981 };
1982 
1983 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
1984 struct MultTrait< UpperMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
1985 {
1986  typedef typename MultTrait< MT, CustomMatrix<T,AF,PF,SO2> >::Type Type;
1987 };
1988 
1989 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
1990 struct MultTrait< CustomMatrix<T,AF,PF,SO1>, UpperMatrix<MT,SO2,DF> >
1991 {
1992  typedef typename MultTrait< CustomMatrix<T,AF,PF,SO1>, MT >::Type Type;
1993 };
1994 
1995 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1996 struct MultTrait< UpperMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
1997 {
1998  typedef typename MultTrait< MT, CompressedMatrix<T,SO2> >::Type Type;
1999 };
2000 
2001 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
2002 struct MultTrait< CompressedMatrix<T,SO1>, UpperMatrix<MT,SO2,DF> >
2003 {
2004  typedef typename MultTrait< CompressedMatrix<T,SO1>, MT >::Type Type;
2005 };
2006 
2007 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
2008 struct MultTrait< UpperMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
2009 {
2010  typedef typename MultTrait<MT1,MT2>::Type Type;
2011 };
2012 
2013 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
2014 struct MultTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, UpperMatrix<MT2,SO2,DF2> >
2015 {
2016  typedef typename MultTrait<MT1,MT2>::Type Type;
2017 };
2018 
2019 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2020 struct MultTrait< UpperMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
2021 {
2022  typedef typename MultTrait<MT1,MT2>::Type Type;
2023 };
2024 
2025 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2026 struct MultTrait< HermitianMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
2027 {
2028  typedef typename MultTrait<MT1,MT2>::Type Type;
2029 };
2030 
2031 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2032 struct MultTrait< UpperMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
2033 {
2034  typedef typename MultTrait<MT1,MT2>::Type Type;
2035 };
2036 
2037 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2038 struct MultTrait< LowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
2039 {
2040  typedef typename MultTrait<MT1,MT2>::Type Type;
2041 };
2042 
2043 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2044 struct MultTrait< UpperMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
2045 {
2046  typedef typename MultTrait<MT1,MT2>::Type Type;
2047 };
2048 
2049 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2050 struct MultTrait< UniLowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
2051 {
2052  typedef typename MultTrait<MT1,MT2>::Type Type;
2053 };
2054 
2055 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2056 struct MultTrait< UpperMatrix<MT1,SO1,DF1>, StrictlyLowerMatrix<MT2,SO2,DF2> >
2057 {
2058  typedef typename MultTrait<MT1,MT2>::Type Type;
2059 };
2060 
2061 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2062 struct MultTrait< StrictlyLowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
2063 {
2064  typedef typename MultTrait<MT1,MT2>::Type Type;
2065 };
2066 
2067 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2068 struct MultTrait< UpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
2069 {
2070  typedef UpperMatrix< typename MultTrait<MT1,MT2>::Type > Type;
2071 };
2073 //*************************************************************************************************
2074 
2075 
2076 
2077 
2078 //=================================================================================================
2079 //
2080 // DIVTRAIT SPECIALIZATIONS
2081 //
2082 //=================================================================================================
2083 
2084 //*************************************************************************************************
2086 template< typename MT, bool SO, bool DF, typename T >
2087 struct DivTrait< UpperMatrix<MT,SO,DF>, T, typename EnableIf< IsNumeric<T> >::Type >
2088 {
2089  typedef UpperMatrix< typename DivTrait<MT,T>::Type > Type;
2090 };
2092 //*************************************************************************************************
2093 
2094 
2095 
2096 
2097 //=================================================================================================
2098 //
2099 // MATHTRAIT SPECIALIZATIONS
2100 //
2101 //=================================================================================================
2102 
2103 //*************************************************************************************************
2105 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
2106 struct MathTrait< UpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
2107 {
2108  typedef UpperMatrix< typename MathTrait<MT1,MT2>::HighType > HighType;
2109  typedef UpperMatrix< typename MathTrait<MT1,MT2>::LowType > LowType;
2110 };
2112 //*************************************************************************************************
2113 
2114 
2115 
2116 
2117 //=================================================================================================
2118 //
2119 // SUBMATRIXTRAIT SPECIALIZATIONS
2120 //
2121 //=================================================================================================
2122 
2123 //*************************************************************************************************
2125 template< typename MT, bool SO, bool DF >
2126 struct SubmatrixTrait< UpperMatrix<MT,SO,DF> >
2127 {
2128  typedef typename SubmatrixTrait<MT>::Type Type;
2129 };
2131 //*************************************************************************************************
2132 
2133 
2134 
2135 
2136 //=================================================================================================
2137 //
2138 // ROWTRAIT SPECIALIZATIONS
2139 //
2140 //=================================================================================================
2141 
2142 //*************************************************************************************************
2144 template< typename MT, bool SO, bool DF >
2145 struct RowTrait< UpperMatrix<MT,SO,DF> >
2146 {
2147  typedef typename RowTrait<MT>::Type Type;
2148 };
2150 //*************************************************************************************************
2151 
2152 
2153 
2154 
2155 //=================================================================================================
2156 //
2157 // COLUMNTRAIT SPECIALIZATIONS
2158 //
2159 //=================================================================================================
2160 
2161 //*************************************************************************************************
2163 template< typename MT, bool SO, bool DF >
2164 struct ColumnTrait< UpperMatrix<MT,SO,DF> >
2165 {
2166  typedef typename ColumnTrait<MT>::Type Type;
2167 };
2169 //*************************************************************************************************
2170 
2171 } // namespace blaze
2172 
2173 #endif
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exceptionThis macro encapsulates the default way of...
Definition: Exception.h:187
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
bool isDiagonal(const DenseMatrix< MT, SO > &dm)
Checks if the give dense matrix is diagonal.
Definition: DenseMatrix.h:1511
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
MT::ElementType det(const DenseMatrix< MT, SO > &dm)
Computation of the determinant of the given dense square matrix.
Definition: DMatDetExpr.h:382
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
Header file for the invert shim.
Constraint on the data type.
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 implementation of the base template of the UpperMatrix.
Header file for the IsSquare type trait.
void invert(const HermitianProxy< MT > &proxy)
In-place inversion of the represented element.
Definition: HermitianProxy.h:767
Header file for the multiplication trait.
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.
UpperMatrix specialization for dense matrices.
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.
Matrix adapter for upper triangular matrices.
Definition: Forward.h:55
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 DerestrictTrait class template.
Constraint on the data type.
Header file for the IsNumeric type trait.
Header file for the HasConstDataAccess type trait.
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.
UpperMatrix specialization for sparse matrices.
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.
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
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
Header file for the IsUpper type trait.
Header file for exception macros.
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