StrictlyUpperMatrix.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_ADAPTORS_STRICTLYUPPERMATRIX_H_
36 #define _BLAZE_MATH_ADAPTORS_STRICTLYUPPERMATRIX_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
49 #include <blaze/math/Forward.h>
50 #include <blaze/math/Functions.h>
72 #include <blaze/util/Assert.h>
73 #include <blaze/util/EnableIf.h>
75 #include <blaze/util/Unused.h>
77 
78 
79 namespace blaze {
80 
81 //=================================================================================================
82 //
83 // STRICTLYUPPERMATRIX OPERATORS
84 //
85 //=================================================================================================
86 
87 //*************************************************************************************************
90 template< typename MT, bool SO, bool DF >
91 inline void reset( StrictlyUpperMatrix<MT,SO,DF>& m );
92 
93 template< typename MT, bool SO, bool DF >
94 inline void reset( StrictlyUpperMatrix<MT,SO,DF>& m, size_t i );
95 
96 template< typename MT, bool SO, bool DF >
97 inline void clear( StrictlyUpperMatrix<MT,SO,DF>& m );
98 
99 template< typename MT, bool SO, bool DF >
100 inline bool isDefault( const StrictlyUpperMatrix<MT,SO,DF>& m );
101 
102 template< typename MT, bool SO, bool DF >
103 inline bool isIntact( const StrictlyUpperMatrix<MT,SO,DF>& m );
104 
105 template< typename MT, bool SO, bool DF >
106 inline void swap( StrictlyUpperMatrix<MT,SO,DF>& a, StrictlyUpperMatrix<MT,SO,DF>& b ) /* throw() */;
108 //*************************************************************************************************
109 
110 
111 //*************************************************************************************************
118 template< typename MT // Type of the adapted matrix
119  , bool SO // Storage order of the adapted matrix
120  , bool DF > // Density flag
122 {
123  m.reset();
124 }
125 //*************************************************************************************************
126 
127 
128 //*************************************************************************************************
141 template< typename MT // Type of the adapted matrix
142  , bool SO // Storage order of the adapted matrix
143  , bool DF > // Density flag
144 inline void reset( StrictlyUpperMatrix<MT,SO,DF>& m, size_t i )
145 {
146  m.reset( i );
147 }
148 //*************************************************************************************************
149 
150 
151 //*************************************************************************************************
158 template< typename MT // Type of the adapted matrix
159  , bool SO // Storage order of the adapted matrix
160  , bool DF > // Density flag
162 {
163  m.clear();
164 }
165 //*************************************************************************************************
166 
167 
168 //*************************************************************************************************
179 template< typename MT // Type of the adapted matrix
180  , bool SO // Storage order of the adapted matrix
181  , bool DF > // Density flag
182 inline bool isDefault_backend( const StrictlyUpperMatrix<MT,SO,DF>& m, TrueType )
183 {
184  return ( m.rows() == 0UL );
185 }
187 //*************************************************************************************************
188 
189 
190 //*************************************************************************************************
201 template< typename MT // Type of the adapted matrix
202  , bool SO // Storage order of the adapted matrix
203  , bool DF > // Density flag
204 inline bool isDefault_backend( const StrictlyUpperMatrix<MT,SO,DF>& m, FalseType )
205 {
206  return isIdentity( m );
207 }
209 //*************************************************************************************************
210 
211 
212 //*************************************************************************************************
232 template< typename MT // Type of the adapted matrix
233  , bool SO // Storage order of the adapted matrix
234  , bool DF > // Density flag
236 {
237  return isDefault_backend( m, typename IsResizable<MT>::Type() );
238 }
239 //*************************************************************************************************
240 
241 
242 //*************************************************************************************************
263 template< typename MT // Type of the adapted matrix
264  , bool SO // Storage order of the adapted matrix
265  , bool DF > // Density flag
267 {
268  return m.isIntact();
269 }
270 //*************************************************************************************************
271 
272 
273 //*************************************************************************************************
282 template< typename MT // Type of the adapted matrix
283  , bool SO // Storage order of the adapted matrix
284  , bool DF > // Density flag
286 {
287  a.swap( b );
288 }
289 //*************************************************************************************************
290 
291 
292 //*************************************************************************************************
309 template< typename MT // Type of the adapted matrix
310  , bool SO // Storage order of the adapted matrix
311  , bool DF // Density flag
312  , typename VT > // Type of the right-hand side dense vector
313 inline bool tryAssign( const StrictlyUpperMatrix<MT,SO,DF>& lhs,
314  const DenseVector<VT,false>& rhs, size_t row, size_t column )
315 {
317 
318  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
319  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
320  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.rows() - row, "Invalid number of rows" );
321 
322  UNUSED_PARAMETER( lhs );
323 
324  const size_t ibegin( ( column <= row )?( 0UL ):( column - row ) );
325 
326  for( size_t i=ibegin; i<(~rhs).size(); ++i ) {
327  if( !isDefault( (~rhs)[i] ) )
328  return false;
329  }
330 
331  return true;
332 }
334 //*************************************************************************************************
335 
336 
337 //*************************************************************************************************
354 template< typename MT // Type of the adapted matrix
355  , bool SO // Storage order of the adapted matrix
356  , bool DF // Density flag
357  , typename VT > // Type of the right-hand side dense vector
358 inline bool tryAssign( const StrictlyUpperMatrix<MT,SO,DF>& lhs,
359  const DenseVector<VT,true>& rhs, size_t row, size_t column )
360 {
362 
363  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
364  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
365  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.columns() - column, "Invalid number of columns" );
366 
367  UNUSED_PARAMETER( lhs );
368 
369  if( row < column )
370  return true;
371 
372  const size_t iend( min( row - column + 1UL, (~rhs).size() ) );
373 
374  for( size_t i=0UL; i<iend; ++i ) {
375  if( !isDefault( (~rhs)[i] ) )
376  return false;
377  }
378 
379  return true;
380 }
382 //*************************************************************************************************
383 
384 
385 //*************************************************************************************************
402 template< typename MT // Type of the adapted matrix
403  , bool SO // Storage order of the adapted matrix
404  , bool DF // Density flag
405  , typename VT > // Type of the right-hand side sparse vector
406 inline bool tryAssign( const StrictlyUpperMatrix<MT,SO,DF>& lhs,
407  const SparseVector<VT,false>& rhs, size_t row, size_t column )
408 {
410 
411  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
412  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
413  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.rows() - row, "Invalid number of rows" );
414 
415  UNUSED_PARAMETER( lhs );
416 
417  typedef typename VT::ConstIterator RhsIterator;
418 
419  const RhsIterator last( (~rhs).end() );
420  RhsIterator element( (~rhs).lowerBound( ( column <= row )?( 0UL ):( column - row ) ) );
421 
422  for( ; element!=last; ++element ) {
423  if( !isDefault( element->value() ) )
424  return false;
425  }
426 
427  return true;
428 }
430 //*************************************************************************************************
431 
432 
433 //*************************************************************************************************
450 template< typename MT // Type of the adapted matrix
451  , bool SO // Storage order of the adapted matrix
452  , bool DF // Density flag
453  , typename VT > // Type of the right-hand side sparse vector
454 inline bool tryAssign( const StrictlyUpperMatrix<MT,SO,DF>& lhs,
455  const SparseVector<VT,true>& rhs, size_t row, size_t column )
456 {
458 
459  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
460  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
461  BLAZE_INTERNAL_ASSERT( (~rhs).size() <= lhs.columns() - column, "Invalid number of columns" );
462 
463  UNUSED_PARAMETER( lhs );
464 
465  typedef typename VT::ConstIterator RhsIterator;
466 
467  if( row < column )
468  return true;
469 
470  const RhsIterator last( (~rhs).lowerBound( row - column + 1UL ) );
471 
472  for( RhsIterator element=(~rhs).begin(); element!=last; ++element ) {
473  if( !isDefault( element->value() ) )
474  return false;
475  }
476 
477  return true;
478 }
480 //*************************************************************************************************
481 
482 
483 //*************************************************************************************************
500 template< typename MT1 // Type of the adapted matrix
501  , bool SO // Storage order of the adapted matrix
502  , bool DF // Density flag
503  , typename MT2 > // Type of the right-hand side dense matrix
504 inline bool tryAssign( const StrictlyUpperMatrix<MT1,SO,DF>& lhs,
505  const DenseMatrix<MT2,false>& rhs, size_t row, size_t column )
506 {
508 
509  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
510  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
511  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
512  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
513 
514  UNUSED_PARAMETER( lhs );
515 
516  const size_t M( (~rhs).rows() );
517  const size_t N( (~rhs).columns() );
518 
519  if( column + 1UL >= row + M )
520  return true;
521 
522  const size_t ibegin( ( column <= row )?( 0UL ):( column - row ) );
523 
524  for( size_t i=ibegin; i<M; ++i )
525  {
526  const size_t jend( min( row + i - column + 1UL, N ) );
527 
528  for( size_t j=0UL; j<jend; ++j ) {
529  if( !isDefault( (~rhs)(i,j) ) )
530  return false;
531  }
532  }
533 
534  return true;
535 }
537 //*************************************************************************************************
538 
539 
540 //*************************************************************************************************
557 template< typename MT1 // Type of the adapted matrix
558  , bool SO // Storage order of the adapted matrix
559  , bool DF // Density flag
560  , typename MT2 > // Type of the right-hand side dense matrix
561 inline bool tryAssign( const StrictlyUpperMatrix<MT1,SO,DF>& lhs,
562  const DenseMatrix<MT2,true>& rhs, size_t row, size_t column )
563 {
565 
566  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
567  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
568  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
569  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
570 
571  UNUSED_PARAMETER( lhs );
572 
573  const size_t M( (~rhs).rows() );
574  const size_t N( (~rhs).columns() );
575 
576  if( column + 1UL >= row + M )
577  return true;
578 
579  const size_t jend( min( row + M - column, N ) );
580 
581  for( size_t j=0UL; j<jend; ++j )
582  {
583  const bool containsDiagonal( column + j >= row );
584  const size_t ibegin( ( containsDiagonal )?( column + j - row ):( 0UL ) );
585 
586  for( size_t i=ibegin; i<M; ++i ) {
587  if( !isDefault( (~rhs)(i,j) ) )
588  return false;
589  }
590  }
591 
592  return true;
593 }
595 //*************************************************************************************************
596 
597 
598 //*************************************************************************************************
615 template< typename MT1 // Type of the adapted matrix
616  , bool SO // Storage order of the adapted matrix
617  , bool DF // Density flag
618  , typename MT2 > // Type of the right-hand side sparse matrix
619 inline bool tryAssign( const StrictlyUpperMatrix<MT1,SO,DF>& lhs,
620  const SparseMatrix<MT2,false>& rhs, size_t row, size_t column )
621 {
623 
624  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
625  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
626  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
627  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
628 
629  UNUSED_PARAMETER( lhs );
630 
631  typedef typename MT2::ConstIterator RhsIterator;
632 
633  const size_t M( (~rhs).rows() );
634  const size_t N( (~rhs).columns() );
635 
636  if( column + 1UL >= row + M )
637  return true;
638 
639  const size_t ibegin( ( column < row )?( 0UL ):( column - row ) );
640 
641  for( size_t i=ibegin; i<M; ++i )
642  {
643  const size_t index( row + i - column + 1UL );
644  const RhsIterator last( (~rhs).lowerBound( i, min( index, N ) ) );
645 
646  for( RhsIterator element=(~rhs).begin(i); element!=last; ++element ) {
647  if( !isDefault( element->value() ) )
648  return false;
649  }
650  }
651 
652  return true;
653 }
655 //*************************************************************************************************
656 
657 
658 //*************************************************************************************************
675 template< typename MT1 // Type of the adapted matrix
676  , bool SO // Storage order of the adapted matrix
677  , bool DF // Density flag
678  , typename MT2 > // Type of the right-hand side sparse matrix
679 inline bool tryAssign( const StrictlyUpperMatrix<MT1,SO,DF>& lhs,
680  const SparseMatrix<MT2,true>& rhs, size_t row, size_t column )
681 {
683 
684  BLAZE_INTERNAL_ASSERT( row <= lhs.rows(), "Invalid row access index" );
685  BLAZE_INTERNAL_ASSERT( column <= lhs.columns(), "Invalid column access index" );
686  BLAZE_INTERNAL_ASSERT( (~rhs).rows() <= lhs.rows() - row, "Invalid number of rows" );
687  BLAZE_INTERNAL_ASSERT( (~rhs).columns() <= lhs.columns() - column, "Invalid number of columns" );
688 
689  UNUSED_PARAMETER( lhs );
690 
691  typedef typename MT2::ConstIterator RhsIterator;
692 
693  const size_t M( (~rhs).rows() );
694  const size_t N( (~rhs).columns() );
695 
696  if( column + 1UL >= row + M )
697  return true;
698 
699  const size_t jend( min( row + M - column, N ) );
700 
701  for( size_t j=0UL; j<jend; ++j )
702  {
703  const bool containsDiagonal( column + j >= row );
704  const size_t index( ( containsDiagonal )?( column + j - row ):( 0UL ) );
705 
706  const RhsIterator last( (~rhs).end(j) );
707  RhsIterator element( (~rhs).lowerBound( index, j ) );
708 
709  for( ; element!=last; ++element ) {
710  if( !isDefault( element->value() ) )
711  return false;
712  }
713  }
714 
715  return true;
716 }
718 //*************************************************************************************************
719 
720 
721 //*************************************************************************************************
738 template< typename MT // Type of the adapted matrix
739  , bool SO // Storage order of the adapted matrix
740  , bool DF // Density flag
741  , typename VT // Type of the right-hand side vector
742  , bool TF > // Transpose flag of the right-hand side vector
743 inline bool tryAddAssign( const StrictlyUpperMatrix<MT,SO,DF>& lhs,
744  const Vector<VT,TF>& rhs, size_t row, size_t column )
745 {
746  return tryAssign( lhs, ~rhs, row, column );
747 }
749 //*************************************************************************************************
750 
751 
752 //*************************************************************************************************
769 template< typename MT1 // Type of the adapted matrix
770  , bool SO1 // Storage order of the adapted matrix
771  , bool DF // Density flag
772  , typename MT2 // Type of the right-hand side matrix
773  , bool SO2 > // Storage order of the right-hand side matrix
774 inline bool tryAddAssign( const StrictlyUpperMatrix<MT1,SO1,DF>& lhs,
775  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
776 {
777  return tryAssign( lhs, ~rhs, row, column );
778 }
780 //*************************************************************************************************
781 
782 
783 //*************************************************************************************************
800 template< typename MT // Type of the adapted matrix
801  , bool SO // Storage order of the adapted matrix
802  , bool DF // Density flag
803  , typename VT // Type of the right-hand side vector
804  , bool TF > // Transpose flag of the right-hand side vector
805 inline bool trySubAssign( const StrictlyUpperMatrix<MT,SO,DF>& lhs,
806  const Vector<VT,TF>& rhs, size_t row, size_t column )
807 {
808  return tryAssign( lhs, ~rhs, row, column );
809 }
811 //*************************************************************************************************
812 
813 
814 //*************************************************************************************************
831 template< typename MT1 // Type of the adapted matrix
832  , bool SO1 // Storage order of the adapted matrix
833  , bool DF // Density flag
834  , typename MT2 // Type of the right-hand side matrix
835  , bool SO2 > // Storage order of the right-hand side matrix
836 inline bool trySubAssign( const StrictlyUpperMatrix<MT1,SO1,DF>& lhs,
837  const Matrix<MT2,SO2>& rhs, size_t row, size_t column )
838 {
839  return tryAssign( lhs, ~rhs, row, column );
840 }
842 //*************************************************************************************************
843 
844 
845 //*************************************************************************************************
859 template< typename MT // Type of the adapted matrix
860  , bool SO // Storage order of the adapted matrix
861  , bool DF > // Density flag
862 inline MT& derestrict( StrictlyUpperMatrix<MT,SO,DF>& m )
863 {
864  return m.matrix_;
865 }
867 //*************************************************************************************************
868 
869 
870 
871 
872 //=================================================================================================
873 //
874 // ROWS SPECIALIZATIONS
875 //
876 //=================================================================================================
877 
878 //*************************************************************************************************
880 template< typename MT, bool SO, bool DF >
881 struct Rows< StrictlyUpperMatrix<MT,SO,DF> > : public Rows<MT>
882 {};
884 //*************************************************************************************************
885 
886 
887 
888 
889 //=================================================================================================
890 //
891 // COLUMNS SPECIALIZATIONS
892 //
893 //=================================================================================================
894 
895 //*************************************************************************************************
897 template< typename MT, bool SO, bool DF >
898 struct Columns< StrictlyUpperMatrix<MT,SO,DF> > : public Columns<MT>
899 {};
901 //*************************************************************************************************
902 
903 
904 
905 
906 //=================================================================================================
907 //
908 // ISSQUARE SPECIALIZATIONS
909 //
910 //=================================================================================================
911 
912 //*************************************************************************************************
914 template< typename MT, bool SO, bool DF >
915 struct IsSquare< StrictlyUpperMatrix<MT,SO,DF> > : public IsTrue<true>
916 {};
918 //*************************************************************************************************
919 
920 
921 
922 
923 //=================================================================================================
924 //
925 // ISSTRICTLYUPPER SPECIALIZATIONS
926 //
927 //=================================================================================================
928 
929 //*************************************************************************************************
931 template< typename MT, bool SO, bool DF >
932 struct IsStrictlyUpper< StrictlyUpperMatrix<MT,SO,DF> > : public IsTrue<true>
933 {};
935 //*************************************************************************************************
936 
937 
938 
939 
940 //=================================================================================================
941 //
942 // ISADAPTOR SPECIALIZATIONS
943 //
944 //=================================================================================================
945 
946 //*************************************************************************************************
948 template< typename MT, bool SO, bool DF >
949 struct IsAdaptor< StrictlyUpperMatrix<MT,SO,DF> > : public IsTrue<true>
950 {};
952 //*************************************************************************************************
953 
954 
955 
956 
957 //=================================================================================================
958 //
959 // ISRESTRICTED SPECIALIZATIONS
960 //
961 //=================================================================================================
962 
963 //*************************************************************************************************
965 template< typename MT, bool SO, bool DF >
966 struct IsRestricted< StrictlyUpperMatrix<MT,SO,DF> > : public IsTrue<true>
967 {};
969 //*************************************************************************************************
970 
971 
972 
973 
974 //=================================================================================================
975 //
976 // HASCONSTDATAACCESS SPECIALIZATIONS
977 //
978 //=================================================================================================
979 
980 //*************************************************************************************************
982 template< typename MT, bool SO >
983 struct HasConstDataAccess< StrictlyUpperMatrix<MT,SO,true> > : public IsTrue<true>
984 {};
986 //*************************************************************************************************
987 
988 
989 
990 
991 //=================================================================================================
992 //
993 // ISALIGNED SPECIALIZATIONS
994 //
995 //=================================================================================================
996 
997 //*************************************************************************************************
999 template< typename MT, bool SO, bool DF >
1000 struct IsAligned< StrictlyUpperMatrix<MT,SO,DF> > : public IsTrue< IsAligned<MT>::value >
1001 {};
1003 //*************************************************************************************************
1004 
1005 
1006 
1007 
1008 //=================================================================================================
1009 //
1010 // ISPADDED SPECIALIZATIONS
1011 //
1012 //=================================================================================================
1013 
1014 //*************************************************************************************************
1016 template< typename MT, bool SO, bool DF >
1017 struct IsPadded< StrictlyUpperMatrix<MT,SO,DF> > : public IsTrue< IsPadded<MT>::value >
1018 {};
1020 //*************************************************************************************************
1021 
1022 
1023 
1024 
1025 //=================================================================================================
1026 //
1027 // ISRESIZABLE SPECIALIZATIONS
1028 //
1029 //=================================================================================================
1030 
1031 //*************************************************************************************************
1033 template< typename MT, bool SO, bool DF >
1034 struct IsResizable< StrictlyUpperMatrix<MT,SO,DF> > : public IsTrue< IsResizable<MT>::value >
1035 {};
1037 //*************************************************************************************************
1038 
1039 
1040 
1041 
1042 //=================================================================================================
1043 //
1044 // REMOVEADAPTOR SPECIALIZATIONS
1045 //
1046 //=================================================================================================
1047 
1048 //*************************************************************************************************
1050 template< typename MT, bool SO, bool DF >
1051 struct RemoveAdaptor< StrictlyUpperMatrix<MT,SO,DF> >
1052 {
1053  typedef MT Type;
1054 };
1056 //*************************************************************************************************
1057 
1058 
1059 
1060 
1061 //=================================================================================================
1062 //
1063 // DERESTRICTTRAIT SPECIALIZATIONS
1064 //
1065 //=================================================================================================
1066 
1067 //*************************************************************************************************
1069 template< typename MT, bool SO, bool DF >
1070 struct DerestrictTrait< StrictlyUpperMatrix<MT,SO,DF> >
1071 {
1072  typedef MT& Type;
1073 };
1075 //*************************************************************************************************
1076 
1077 
1078 
1079 
1080 //=================================================================================================
1081 //
1082 // ADDTRAIT SPECIALIZATIONS
1083 //
1084 //=================================================================================================
1085 
1086 //*************************************************************************************************
1088 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1089 struct AddTrait< StrictlyUpperMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
1090 {
1091  typedef typename AddTrait< MT, StaticMatrix<T,M,N,SO2> >::Type Type;
1092 };
1093 
1094 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1095 struct AddTrait< StaticMatrix<T,M,N,SO1>, StrictlyUpperMatrix<MT,SO2,DF> >
1096 {
1097  typedef typename AddTrait< StaticMatrix<T,M,N,SO1>, MT >::Type Type;
1098 };
1099 
1100 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1101 struct AddTrait< StrictlyUpperMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
1102 {
1103  typedef typename AddTrait< MT, HybridMatrix<T,M,N,SO2> >::Type Type;
1104 };
1105 
1106 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1107 struct AddTrait< HybridMatrix<T,M,N,SO1>, StrictlyUpperMatrix<MT,SO2,DF> >
1108 {
1109  typedef typename AddTrait< HybridMatrix<T,M,N,SO1>, MT >::Type Type;
1110 };
1111 
1112 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1113 struct AddTrait< StrictlyUpperMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
1114 {
1115  typedef typename AddTrait< MT, DynamicMatrix<T,SO2> >::Type Type;
1116 };
1117 
1118 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1119 struct AddTrait< DynamicMatrix<T,SO1>, StrictlyUpperMatrix<MT,SO2,DF> >
1120 {
1121  typedef typename AddTrait< DynamicMatrix<T,SO1>, MT >::Type Type;
1122 };
1123 
1124 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
1125 struct AddTrait< StrictlyUpperMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
1126 {
1127  typedef typename AddTrait< MT, CustomMatrix<T,AF,PF,SO2> >::Type Type;
1128 };
1129 
1130 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
1131 struct AddTrait< CustomMatrix<T,AF,PF,SO1>, StrictlyUpperMatrix<MT,SO2,DF> >
1132 {
1133  typedef typename AddTrait< CustomMatrix<T,AF,PF,SO1>, MT >::Type Type;
1134 };
1135 
1136 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1137 struct AddTrait< StrictlyUpperMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
1138 {
1139  typedef typename AddTrait< MT, CompressedMatrix<T,SO2> >::Type Type;
1140 };
1141 
1142 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1143 struct AddTrait< CompressedMatrix<T,SO1>, StrictlyUpperMatrix<MT,SO2,DF> >
1144 {
1145  typedef typename AddTrait< CompressedMatrix<T,SO1>, MT >::Type Type;
1146 };
1147 
1148 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
1149 struct AddTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
1150 {
1151  typedef typename AddTrait<MT1,MT2>::Type Type;
1152 };
1153 
1154 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
1155 struct AddTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1156 {
1157  typedef typename AddTrait<MT1,MT2>::Type Type;
1158 };
1159 
1160 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1161 struct AddTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1162 {
1163  typedef typename AddTrait<MT1,MT2>::Type Type;
1164 };
1165 
1166 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1167 struct AddTrait< HermitianMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1168 {
1169  typedef typename AddTrait<MT1,MT2>::Type Type;
1170 };
1171 
1172 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1173 struct AddTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
1174 {
1175  typedef typename AddTrait<MT1,MT2>::Type Type;
1176 };
1177 
1178 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1179 struct AddTrait< LowerMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1180 {
1181  typedef typename AddTrait<MT1,MT2>::Type Type;
1182 };
1183 
1184 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1185 struct AddTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
1186 {
1187  typedef typename AddTrait<MT1,MT2>::Type Type;
1188 };
1189 
1190 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1191 struct AddTrait< UniLowerMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1192 {
1193  typedef typename AddTrait<MT1,MT2>::Type Type;
1194 };
1195 
1196 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1197 struct AddTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, StrictlyLowerMatrix<MT2,SO2,DF2> >
1198 {
1199  typedef typename AddTrait<MT1,MT2>::Type Type;
1200 };
1201 
1202 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1203 struct AddTrait< StrictlyLowerMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1204 {
1205  typedef typename AddTrait<MT1,MT2>::Type Type;
1206 };
1207 
1208 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1209 struct AddTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1210 {
1211  typedef UpperMatrix< typename AddTrait<MT1,MT2>::Type > Type;
1212 };
1213 
1214 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1215 struct AddTrait< UpperMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1216 {
1217  typedef UpperMatrix< typename AddTrait<MT1,MT2>::Type > Type;
1218 };
1219 
1220 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1221 struct AddTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
1222 {
1223  typedef UniUpperMatrix< typename AddTrait<MT1,MT2>::Type > Type;
1224 };
1225 
1226 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1227 struct AddTrait< UniUpperMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1228 {
1229  typedef UniUpperMatrix< typename AddTrait<MT1,MT2>::Type > Type;
1230 };
1231 
1232 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1233 struct AddTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1234 {
1235  typedef StrictlyUpperMatrix< typename AddTrait<MT1,MT2>::Type > Type;
1236 };
1238 //*************************************************************************************************
1239 
1240 
1241 
1242 
1243 //=================================================================================================
1244 //
1245 // SUBTRAIT SPECIALIZATIONS
1246 //
1247 //=================================================================================================
1248 
1249 //*************************************************************************************************
1251 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1252 struct SubTrait< StrictlyUpperMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
1253 {
1254  typedef typename SubTrait< MT, StaticMatrix<T,M,N,SO2> >::Type Type;
1255 };
1256 
1257 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1258 struct SubTrait< StaticMatrix<T,M,N,SO1>, StrictlyUpperMatrix<MT,SO2,DF> >
1259 {
1260  typedef typename SubTrait< StaticMatrix<T,M,N,SO1>, MT >::Type Type;
1261 };
1262 
1263 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1264 struct SubTrait< StrictlyUpperMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
1265 {
1266  typedef typename SubTrait< MT, HybridMatrix<T,M,N,SO2> >::Type Type;
1267 };
1268 
1269 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1270 struct SubTrait< HybridMatrix<T,M,N,SO1>, StrictlyUpperMatrix<MT,SO2,DF> >
1271 {
1272  typedef typename SubTrait< HybridMatrix<T,M,N,SO1>, MT >::Type Type;
1273 };
1274 
1275 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1276 struct SubTrait< StrictlyUpperMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
1277 {
1278  typedef typename SubTrait< MT, DynamicMatrix<T,SO2> >::Type Type;
1279 };
1280 
1281 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1282 struct SubTrait< DynamicMatrix<T,SO1>, StrictlyUpperMatrix<MT,SO2,DF> >
1283 {
1284  typedef typename SubTrait< DynamicMatrix<T,SO1>, MT >::Type Type;
1285 };
1286 
1287 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
1288 struct SubTrait< StrictlyUpperMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
1289 {
1290  typedef typename SubTrait< MT, CustomMatrix<T,AF,PF,SO2> >::Type Type;
1291 };
1292 
1293 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
1294 struct SubTrait< CustomMatrix<T,AF,PF,SO1>, StrictlyUpperMatrix<MT,SO2,DF> >
1295 {
1296  typedef typename SubTrait< CustomMatrix<T,AF,PF,SO1>, MT >::Type Type;
1297 };
1298 
1299 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1300 struct SubTrait< StrictlyUpperMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
1301 {
1302  typedef typename SubTrait< MT, CompressedMatrix<T,SO2> >::Type Type;
1303 };
1304 
1305 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1306 struct SubTrait< CompressedMatrix<T,SO1>, StrictlyUpperMatrix<MT,SO2,DF> >
1307 {
1308  typedef typename SubTrait< CompressedMatrix<T,SO1>, MT >::Type Type;
1309 };
1310 
1311 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
1312 struct SubTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
1313 {
1314  typedef typename SubTrait<MT1,MT2>::Type Type;
1315 };
1316 
1317 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
1318 struct SubTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1319 {
1320  typedef typename SubTrait<MT1,MT2>::Type Type;
1321 };
1322 
1323 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1324 struct SubTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1325 {
1326  typedef typename SubTrait<MT1,MT2>::Type Type;
1327 };
1328 
1329 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1330 struct SubTrait< HermitianMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1331 {
1332  typedef typename SubTrait<MT1,MT2>::Type Type;
1333 };
1334 
1335 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1336 struct SubTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
1337 {
1338  typedef typename SubTrait<MT1,MT2>::Type Type;
1339 };
1340 
1341 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1342 struct SubTrait< LowerMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1343 {
1344  typedef typename SubTrait<MT1,MT2>::Type Type;
1345 };
1346 
1347 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1348 struct SubTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
1349 {
1350  typedef typename SubTrait<MT1,MT2>::Type Type;
1351 };
1352 
1353 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1354 struct SubTrait< UniLowerMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1355 {
1356  typedef typename SubTrait<MT1,MT2>::Type Type;
1357 };
1358 
1359 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1360 struct SubTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, StrictlyLowerMatrix<MT2,SO2,DF2> >
1361 {
1362  typedef typename SubTrait<MT1,MT2>::Type Type;
1363 };
1364 
1365 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1366 struct SubTrait< StrictlyLowerMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1367 {
1368  typedef typename SubTrait<MT1,MT2>::Type Type;
1369 };
1370 
1371 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1372 struct SubTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1373 {
1374  typedef UpperMatrix< typename SubTrait<MT1,MT2>::Type > Type;
1375 };
1376 
1377 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1378 struct SubTrait< UpperMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1379 {
1380  typedef UpperMatrix< typename SubTrait<MT1,MT2>::Type > Type;
1381 };
1382 
1383 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1384 struct SubTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
1385 {
1386  typedef UpperMatrix< typename SubTrait<MT1,MT2>::Type > Type;
1387 };
1388 
1389 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1390 struct SubTrait< UniUpperMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1391 {
1392  typedef UniUpperMatrix< typename SubTrait<MT1,MT2>::Type > Type;
1393 };
1394 
1395 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1396 struct SubTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1397 {
1398  typedef StrictlyUpperMatrix< typename SubTrait<MT1,MT2>::Type > Type;
1399 };
1401 //*************************************************************************************************
1402 
1403 
1404 
1405 
1406 //=================================================================================================
1407 //
1408 // MULTTRAIT SPECIALIZATIONS
1409 //
1410 //=================================================================================================
1411 
1412 //*************************************************************************************************
1414 template< typename MT, bool SO, bool DF, typename T >
1415 struct MultTrait< StrictlyUpperMatrix<MT,SO,DF>, T, typename EnableIf< IsNumeric<T> >::Type >
1416 {
1417  typedef StrictlyUpperMatrix< typename MultTrait<MT,T>::Type > Type;
1418 };
1419 
1420 template< typename T, typename MT, bool SO, bool DF >
1421 struct MultTrait< T, StrictlyUpperMatrix<MT,SO,DF>, typename EnableIf< IsNumeric<T> >::Type >
1422 {
1423  typedef StrictlyUpperMatrix< typename MultTrait<T,MT>::Type > Type;
1424 };
1425 
1426 template< typename MT, bool SO, bool DF, typename T, size_t N >
1427 struct MultTrait< StrictlyUpperMatrix<MT,SO,DF>, StaticVector<T,N,false> >
1428 {
1429  typedef typename MultTrait< MT, StaticVector<T,N,false> >::Type Type;
1430 };
1431 
1432 template< typename T, size_t N, typename MT, bool SO, bool DF >
1433 struct MultTrait< StaticVector<T,N,true>, StrictlyUpperMatrix<MT,SO,DF> >
1434 {
1435  typedef typename MultTrait< StaticVector<T,N,true>, MT >::Type Type;
1436 };
1437 
1438 template< typename MT, bool SO, bool DF, typename T, size_t N >
1439 struct MultTrait< StrictlyUpperMatrix<MT,SO,DF>, HybridVector<T,N,false> >
1440 {
1441  typedef typename MultTrait< MT, HybridVector<T,N,false> >::Type Type;
1442 };
1443 
1444 template< typename T, size_t N, typename MT, bool SO, bool DF >
1445 struct MultTrait< HybridVector<T,N,true>, StrictlyUpperMatrix<MT,SO,DF> >
1446 {
1447  typedef typename MultTrait< HybridVector<T,N,true>, MT >::Type Type;
1448 };
1449 
1450 template< typename MT, bool SO, bool DF, typename T >
1451 struct MultTrait< StrictlyUpperMatrix<MT,SO,DF>, DynamicVector<T,false> >
1452 {
1453  typedef typename MultTrait< MT, DynamicVector<T,false> >::Type Type;
1454 };
1455 
1456 template< typename T, typename MT, bool SO, bool DF >
1457 struct MultTrait< DynamicVector<T,true>, StrictlyUpperMatrix<MT,SO,DF> >
1458 {
1459  typedef typename MultTrait< DynamicVector<T,true>, MT >::Type Type;
1460 };
1461 
1462 template< typename MT, bool SO, bool DF, typename T, bool AF, bool PF >
1463 struct MultTrait< StrictlyUpperMatrix<MT,SO,DF>, CustomVector<T,AF,PF,false> >
1464 {
1465  typedef typename MultTrait< MT, CustomVector<T,AF,PF,false> >::Type Type;
1466 };
1467 
1468 template< typename T, bool AF, bool PF, typename MT, bool SO, bool DF >
1469 struct MultTrait< CustomVector<T,AF,PF,true>, StrictlyUpperMatrix<MT,SO,DF> >
1470 {
1471  typedef typename MultTrait< CustomVector<T,AF,PF,true>, MT >::Type Type;
1472 };
1473 
1474 template< typename MT, bool SO, bool DF, typename T >
1475 struct MultTrait< StrictlyUpperMatrix<MT,SO,DF>, CompressedVector<T,false> >
1476 {
1477  typedef typename MultTrait< MT, CompressedVector<T,false> >::Type Type;
1478 };
1479 
1480 template< typename T, typename MT, bool SO, bool DF >
1481 struct MultTrait< CompressedVector<T,true>, StrictlyUpperMatrix<MT,SO,DF> >
1482 {
1483  typedef typename MultTrait< CompressedVector<T,true>, MT >::Type Type;
1484 };
1485 
1486 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1487 struct MultTrait< StrictlyUpperMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
1488 {
1489  typedef typename MultTrait< MT, StaticMatrix<T,M,N,SO2> >::Type Type;
1490 };
1491 
1492 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1493 struct MultTrait< StaticMatrix<T,M,N,SO1>, StrictlyUpperMatrix<MT,SO2,DF> >
1494 {
1495  typedef typename MultTrait< StaticMatrix<T,M,N,SO1>, MT >::Type Type;
1496 };
1497 
1498 template< typename MT, bool SO1, bool DF, typename T, size_t M, size_t N, bool SO2 >
1499 struct MultTrait< StrictlyUpperMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
1500 {
1501  typedef typename MultTrait< MT, HybridMatrix<T,M,N,SO2> >::Type Type;
1502 };
1503 
1504 template< typename T, size_t M, size_t N, bool SO1, typename MT, bool SO2, bool DF >
1505 struct MultTrait< HybridMatrix<T,M,N,SO1>, StrictlyUpperMatrix<MT,SO2,DF> >
1506 {
1507  typedef typename MultTrait< HybridMatrix<T,M,N,SO1>, MT >::Type Type;
1508 };
1509 
1510 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1511 struct MultTrait< StrictlyUpperMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
1512 {
1513  typedef typename MultTrait< MT, DynamicMatrix<T,SO2> >::Type Type;
1514 };
1515 
1516 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1517 struct MultTrait< DynamicMatrix<T,SO1>, StrictlyUpperMatrix<MT,SO2,DF> >
1518 {
1519  typedef typename MultTrait< DynamicMatrix<T,SO1>, MT >::Type Type;
1520 };
1521 
1522 template< typename MT, bool SO1, bool DF, typename T, bool AF, bool PF, bool SO2 >
1523 struct MultTrait< StrictlyUpperMatrix<MT,SO1,DF>, CustomMatrix<T,AF,PF,SO2> >
1524 {
1525  typedef typename MultTrait< MT, CustomMatrix<T,AF,PF,SO2> >::Type Type;
1526 };
1527 
1528 template< typename T, bool AF, bool PF, bool SO1, typename MT, bool SO2, bool DF >
1529 struct MultTrait< CustomMatrix<T,AF,PF,SO1>, StrictlyUpperMatrix<MT,SO2,DF> >
1530 {
1531  typedef typename MultTrait< CustomMatrix<T,AF,PF,SO1>, MT >::Type Type;
1532 };
1533 
1534 template< typename MT, bool SO1, bool DF, typename T, bool SO2 >
1535 struct MultTrait< StrictlyUpperMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
1536 {
1537  typedef typename MultTrait< MT, CompressedMatrix<T,SO2> >::Type Type;
1538 };
1539 
1540 template< typename T, bool SO1, typename MT, bool SO2, bool DF >
1541 struct MultTrait< CompressedMatrix<T,SO1>, StrictlyUpperMatrix<MT,SO2,DF> >
1542 {
1543  typedef typename MultTrait< CompressedMatrix<T,SO1>, MT >::Type Type;
1544 };
1545 
1546 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2, bool NF >
1547 struct MultTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
1548 {
1549  typedef typename MultTrait<MT1,MT2>::Type Type;
1550 };
1551 
1552 template< typename MT1, bool SO1, bool DF1, bool NF, typename MT2, bool SO2, bool DF2 >
1553 struct MultTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1554 {
1555  typedef typename MultTrait<MT1,MT2>::Type Type;
1556 };
1557 
1558 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1559 struct MultTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, HermitianMatrix<MT2,SO2,DF2> >
1560 {
1561  typedef typename MultTrait<MT1,MT2>::Type Type;
1562 };
1563 
1564 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1565 struct MultTrait< HermitianMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1566 {
1567  typedef typename MultTrait<MT1,MT2>::Type Type;
1568 };
1569 
1570 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1571 struct MultTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
1572 {
1573  typedef typename MultTrait<MT1,MT2>::Type Type;
1574 };
1575 
1576 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1577 struct MultTrait< LowerMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1578 {
1579  typedef typename MultTrait<MT1,MT2>::Type Type;
1580 };
1581 
1582 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1583 struct MultTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
1584 {
1585  typedef typename MultTrait<MT1,MT2>::Type Type;
1586 };
1587 
1588 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1589 struct MultTrait< UniLowerMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1590 {
1591  typedef typename MultTrait<MT1,MT2>::Type Type;
1592 };
1593 
1594 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1595 struct MultTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, StrictlyLowerMatrix<MT2,SO2,DF2> >
1596 {
1597  typedef typename MultTrait<MT1,MT2>::Type Type;
1598 };
1599 
1600 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1601 struct MultTrait< StrictlyLowerMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1602 {
1603  typedef typename MultTrait<MT1,MT2>::Type Type;
1604 };
1605 
1606 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1607 struct MultTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
1608 {
1609  typedef StrictlyUpperMatrix< typename MultTrait<MT1,MT2>::Type > Type;
1610 };
1611 
1612 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1613 struct MultTrait< UpperMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1614 {
1615  typedef StrictlyUpperMatrix< typename MultTrait<MT1,MT2>::Type > Type;
1616 };
1617 
1618 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1619 struct MultTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, UniUpperMatrix<MT2,SO2,DF2> >
1620 {
1621  typedef StrictlyUpperMatrix< typename MultTrait<MT1,MT2>::Type > Type;
1622 };
1623 
1624 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1625 struct MultTrait< UniUpperMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1626 {
1627  typedef StrictlyUpperMatrix< typename MultTrait<MT1,MT2>::Type > Type;
1628 };
1629 
1630 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1631 struct MultTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1632 {
1633  typedef StrictlyUpperMatrix< typename MultTrait<MT1,MT2>::Type > Type;
1634 };
1636 //*************************************************************************************************
1637 
1638 
1639 
1640 
1641 //=================================================================================================
1642 //
1643 // DIVTRAIT SPECIALIZATIONS
1644 //
1645 //=================================================================================================
1646 
1647 //*************************************************************************************************
1649 template< typename MT, bool SO, bool DF, typename T >
1650 struct DivTrait< StrictlyUpperMatrix<MT,SO,DF>, T, typename EnableIf< IsNumeric<T> >::Type >
1651 {
1652  typedef StrictlyUpperMatrix< typename DivTrait<MT,T>::Type > Type;
1653 };
1655 //*************************************************************************************************
1656 
1657 
1658 
1659 
1660 //=================================================================================================
1661 //
1662 // MATHTRAIT SPECIALIZATIONS
1663 //
1664 //=================================================================================================
1665 
1666 //*************************************************************************************************
1668 template< typename MT1, bool SO1, bool DF1, typename MT2, bool SO2, bool DF2 >
1669 struct MathTrait< StrictlyUpperMatrix<MT1,SO1,DF1>, StrictlyUpperMatrix<MT2,SO2,DF2> >
1670 {
1671  typedef StrictlyUpperMatrix< typename MathTrait<MT1,MT2>::HighType > HighType;
1672  typedef StrictlyUpperMatrix< typename MathTrait<MT1,MT2>::LowType > LowType;
1673 };
1675 //*************************************************************************************************
1676 
1677 
1678 
1679 
1680 //=================================================================================================
1681 //
1682 // SUBMATRIXTRAIT SPECIALIZATIONS
1683 //
1684 //=================================================================================================
1685 
1686 //*************************************************************************************************
1688 template< typename MT, bool SO, bool DF >
1689 struct SubmatrixTrait< StrictlyUpperMatrix<MT,SO,DF> >
1690 {
1691  typedef typename SubmatrixTrait<MT>::Type Type;
1692 };
1694 //*************************************************************************************************
1695 
1696 
1697 
1698 
1699 //=================================================================================================
1700 //
1701 // ROWTRAIT SPECIALIZATIONS
1702 //
1703 //=================================================================================================
1704 
1705 //*************************************************************************************************
1707 template< typename MT, bool SO, bool DF >
1708 struct RowTrait< StrictlyUpperMatrix<MT,SO,DF> >
1709 {
1710  typedef typename RowTrait<MT>::Type Type;
1711 };
1713 //*************************************************************************************************
1714 
1715 
1716 
1717 
1718 //=================================================================================================
1719 //
1720 // COLUMNTRAIT SPECIALIZATIONS
1721 //
1722 //=================================================================================================
1723 
1724 //*************************************************************************************************
1726 template< typename MT, bool SO, bool DF >
1727 struct ColumnTrait< StrictlyUpperMatrix<MT,SO,DF> >
1728 {
1729  typedef typename ColumnTrait<MT>::Type Type;
1730 };
1732 //*************************************************************************************************
1733 
1734 } // namespace blaze
1735 
1736 #endif
Header file for mathematical functions.
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
StrictlyUpperMatrix specialization for sparse matrices.
Header file for the implementation of the base template of the UniUpperMatrix.
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:547
Header file for the implementation of the base template of the UpperMatrix.
StrictlyUpperMatrix specialization for dense matrices.
Header file for the IsSquare type trait.
Header file for the multiplication trait.
Header file for the IsStrictlyUpper type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Matrix adapter for strictly upper triangular matrices.
Definition: Forward.h:51
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
Header file for the Columns type trait.
Header file for the IsAligned type trait.
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
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 implementation of the base template of the StrictlyUpperMatrix.
Header file for the DerestrictTrait class template.
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
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.
Header file for the column trait.
Header file for the isDefault shim.
#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
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
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