35 #ifndef _BLAZE_MATH_ADAPTORS_UPPERMATRIX_H_
36 #define _BLAZE_MATH_ADAPTORS_UPPERMATRIX_H_
79 template<
typename MT,
bool SO,
bool DF >
80 inline void reset( UpperMatrix<MT,SO,DF>& m );
82 template<
typename MT,
bool SO,
bool DF >
83 inline void reset( UpperMatrix<MT,SO,DF>& m,
size_t i );
85 template<
typename MT,
bool SO,
bool DF >
86 inline void clear( UpperMatrix<MT,SO,DF>& m );
88 template<
typename MT,
bool SO,
bool DF >
89 inline bool isDefault(
const UpperMatrix<MT,SO,DF>& m );
91 template<
typename MT,
bool SO,
bool DF >
92 inline void swap( UpperMatrix<MT,SO,DF>& a, UpperMatrix<MT,SO,DF>& b ) ;
104 template<
typename MT
127 template<
typename MT
144 template<
typename MT
172 template<
typename MT
191 template<
typename MT
215 template<
typename MT
218 inline MT& derestrict( UpperMatrix<MT,SO,DF>& m )
236 template<
typename MT,
bool SO,
bool DF >
237 struct Rows< UpperMatrix<MT,SO,DF> > :
public Rows<MT>
253 template<
typename MT,
bool SO,
bool DF >
254 struct Columns< UpperMatrix<MT,SO,DF> > :
public Columns<MT>
270 template<
typename MT,
bool SO,
bool DF >
271 struct IsSquare< UpperMatrix<MT,SO,DF> > :
public TrueType
290 template<
typename MT,
bool SO,
bool DF >
291 struct IsUpper< UpperMatrix<MT,SO,DF> > :
public TrueType
310 template<
typename MT,
bool SO,
bool DF >
311 struct IsAdaptor< UpperMatrix<MT,SO,DF> > :
public TrueType
330 template<
typename MT,
bool SO,
bool DF >
331 struct IsRestricted< UpperMatrix<MT,SO,DF> > :
public TrueType
350 template<
typename MT,
bool SO >
351 struct HasConstDataAccess< UpperMatrix<MT,SO,true> > :
public TrueType
370 template<
typename MT,
bool SO,
bool DF >
371 struct IsResizable< UpperMatrix<MT,SO,DF> > :
public IsResizable<MT>::Type
373 enum { value = IsResizable<MT>::value };
374 typedef typename IsResizable<MT>::Type Type;
390 template<
typename MT,
bool SO,
bool DF >
391 struct RemoveAdaptor< UpperMatrix<MT,SO,DF> >
409 template<
typename MT,
bool SO,
bool DF >
410 struct DerestrictTrait< UpperMatrix<MT,SO,DF> >
428 template<
typename MT,
bool SO1,
bool DF,
typename T,
size_t M,
size_t N,
bool SO2 >
429 struct AddTrait< UpperMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
431 typedef typename AddTrait< MT, StaticMatrix<T,M,N,SO2> >::Type Type;
434 template<
typename T,
size_t M,
size_t N,
bool SO1,
typename MT,
bool SO2,
bool DF >
435 struct AddTrait< StaticMatrix<T,M,N,SO1>, UpperMatrix<MT,SO2,DF> >
437 typedef typename AddTrait< StaticMatrix<T,M,N,SO1>, MT >::Type Type;
440 template<
typename MT,
bool SO1,
bool DF,
typename T,
size_t M,
size_t N,
bool SO2 >
441 struct AddTrait< UpperMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
443 typedef typename AddTrait< MT, HybridMatrix<T,M,N,SO2> >::Type Type;
446 template<
typename T,
size_t M,
size_t N,
bool SO1,
typename MT,
bool SO2,
bool DF >
447 struct AddTrait< HybridMatrix<T,M,N,SO1>, UpperMatrix<MT,SO2,DF> >
449 typedef typename AddTrait< HybridMatrix<T,M,N,SO1>, MT >::Type Type;
452 template<
typename MT,
bool SO1,
bool DF,
typename T,
bool SO2 >
453 struct AddTrait< UpperMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
455 typedef typename AddTrait< MT, DynamicMatrix<T,SO2> >::Type Type;
458 template<
typename T,
bool SO1,
typename MT,
bool SO2,
bool DF >
459 struct AddTrait< DynamicMatrix<T,SO1>, UpperMatrix<MT,SO2,DF> >
461 typedef typename AddTrait< DynamicMatrix<T,SO1>, MT >::Type Type;
464 template<
typename MT,
bool SO1,
bool DF,
typename T,
bool SO2 >
465 struct AddTrait< UpperMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
467 typedef typename AddTrait< MT, CompressedMatrix<T,SO2> >::Type Type;
470 template<
typename T,
bool SO1,
typename MT,
bool SO2,
bool DF >
471 struct AddTrait< CompressedMatrix<T,SO1>, UpperMatrix<MT,SO2,DF> >
473 typedef typename AddTrait< CompressedMatrix<T,SO1>, MT >::Type Type;
476 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2,
bool NF >
477 struct AddTrait< UpperMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
479 typedef typename AddTrait<MT1,MT2>::Type Type;
482 template<
typename MT1,
bool SO1,
bool DF1,
bool NF,
typename MT2,
bool SO2,
bool DF2 >
483 struct AddTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, UpperMatrix<MT2,SO2,DF2> >
485 typedef typename AddTrait<MT1,MT2>::Type Type;
488 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
489 struct AddTrait< UpperMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
491 typedef typename AddTrait<MT1,MT2>::Type Type;
494 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
495 struct AddTrait< LowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
497 typedef typename AddTrait<MT1,MT2>::Type Type;
500 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
501 struct AddTrait< UpperMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
503 typedef typename AddTrait<MT1,MT2>::Type Type;
506 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
507 struct AddTrait< UniLowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
509 typedef typename AddTrait<MT1,MT2>::Type Type;
512 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
513 struct AddTrait< UpperMatrix<MT1,SO1,DF1>, StrictlyLowerMatrix<MT2,SO2,DF2> >
515 typedef typename AddTrait<MT1,MT2>::Type Type;
518 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
519 struct AddTrait< StrictlyLowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
521 typedef typename AddTrait<MT1,MT2>::Type Type;
524 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
525 struct AddTrait< UpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
527 typedef UpperMatrix< typename AddTrait<MT1,MT2>::Type > Type;
543 template<
typename MT,
bool SO1,
bool DF,
typename T,
size_t M,
size_t N,
bool SO2 >
544 struct SubTrait< UpperMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
546 typedef typename SubTrait< MT, StaticMatrix<T,M,N,SO2> >::Type Type;
549 template<
typename T,
size_t M,
size_t N,
bool SO1,
typename MT,
bool SO2,
bool DF >
550 struct SubTrait< StaticMatrix<T,M,N,SO1>, UpperMatrix<MT,SO2,DF> >
552 typedef typename SubTrait< StaticMatrix<T,M,N,SO1>, MT >::Type Type;
555 template<
typename MT,
bool SO1,
bool DF,
typename T,
size_t M,
size_t N,
bool SO2 >
556 struct SubTrait< UpperMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
558 typedef typename SubTrait< MT, HybridMatrix<T,M,N,SO2> >::Type Type;
561 template<
typename T,
size_t M,
size_t N,
bool SO1,
typename MT,
bool SO2,
bool DF >
562 struct SubTrait< HybridMatrix<T,M,N,SO1>, UpperMatrix<MT,SO2,DF> >
564 typedef typename SubTrait< HybridMatrix<T,M,N,SO1>, MT >::Type Type;
567 template<
typename MT,
bool SO1,
bool DF,
typename T,
bool SO2 >
568 struct SubTrait< UpperMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
570 typedef typename SubTrait< MT, DynamicMatrix<T,SO2> >::Type Type;
573 template<
typename T,
bool SO1,
typename MT,
bool SO2,
bool DF >
574 struct SubTrait< DynamicMatrix<T,SO1>, UpperMatrix<MT,SO2,DF> >
576 typedef typename SubTrait< DynamicMatrix<T,SO1>, MT >::Type Type;
579 template<
typename MT,
bool SO1,
bool DF,
typename T,
bool SO2 >
580 struct SubTrait< UpperMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
582 typedef typename SubTrait< MT, CompressedMatrix<T,SO2> >::Type Type;
585 template<
typename T,
bool SO1,
typename MT,
bool SO2,
bool DF >
586 struct SubTrait< CompressedMatrix<T,SO1>, UpperMatrix<MT,SO2,DF> >
588 typedef typename SubTrait< CompressedMatrix<T,SO1>, MT >::Type Type;
591 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2,
bool NF >
592 struct SubTrait< UpperMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
594 typedef typename SubTrait<MT1,MT2>::Type Type;
597 template<
typename MT1,
bool SO1,
bool DF1,
bool NF,
typename MT2,
bool SO2,
bool DF2 >
598 struct SubTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, UpperMatrix<MT2,SO2,DF2> >
600 typedef typename SubTrait<MT1,MT2>::Type Type;
603 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
604 struct SubTrait< UpperMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
606 typedef typename SubTrait<MT1,MT2>::Type Type;
609 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
610 struct SubTrait< LowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
612 typedef typename SubTrait<MT1,MT2>::Type Type;
615 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
616 struct SubTrait< UpperMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
618 typedef typename SubTrait<MT1,MT2>::Type Type;
621 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
622 struct SubTrait< UniLowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
624 typedef typename SubTrait<MT1,MT2>::Type Type;
627 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
628 struct SubTrait< UpperMatrix<MT1,SO1,DF1>, StrictlyLowerMatrix<MT2,SO2,DF2> >
630 typedef typename SubTrait<MT1,MT2>::Type Type;
633 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
634 struct SubTrait< StrictlyLowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
636 typedef typename SubTrait<MT1,MT2>::Type Type;
639 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
640 struct SubTrait< UpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
642 typedef UpperMatrix< typename SubTrait<MT1,MT2>::Type > Type;
658 template<
typename MT,
bool SO,
bool DF,
typename T >
659 struct MultTrait< UpperMatrix<MT,SO,DF>, T >
661 typedef UpperMatrix< typename MultTrait<MT,T>::Type > Type;
665 template<
typename T,
typename MT,
bool SO,
bool DF >
666 struct MultTrait< T, UpperMatrix<MT,SO,DF> >
668 typedef UpperMatrix< typename MultTrait<T,MT>::Type > Type;
672 template<
typename MT,
bool SO,
bool DF,
typename T,
size_t N >
673 struct MultTrait< UpperMatrix<MT,SO,DF>, StaticVector<T,N,false> >
675 typedef typename MultTrait< MT, StaticVector<T,N,false> >::Type Type;
678 template<
typename T,
size_t N,
typename MT,
bool SO,
bool DF >
679 struct MultTrait< StaticVector<T,N,true>, UpperMatrix<MT,SO,DF> >
681 typedef typename MultTrait< StaticVector<T,N,true>, MT >::Type Type;
684 template<
typename MT,
bool SO,
bool DF,
typename T,
size_t N >
685 struct MultTrait< UpperMatrix<MT,SO,DF>, HybridVector<T,N,false> >
687 typedef typename MultTrait< MT, HybridVector<T,N,false> >::Type Type;
690 template<
typename T,
size_t N,
typename MT,
bool SO,
bool DF >
691 struct MultTrait< HybridVector<T,N,true>, UpperMatrix<MT,SO,DF> >
693 typedef typename MultTrait< HybridVector<T,N,true>, MT >::Type Type;
696 template<
typename MT,
bool SO,
bool DF,
typename T >
697 struct MultTrait< UpperMatrix<MT,SO,DF>, DynamicVector<T,false> >
699 typedef typename MultTrait< MT, DynamicVector<T,false> >::Type Type;
702 template<
typename T,
typename MT,
bool SO,
bool DF >
703 struct MultTrait< DynamicVector<T,true>, UpperMatrix<MT,SO,DF> >
705 typedef typename MultTrait< DynamicVector<T,true>, MT >::Type Type;
708 template<
typename MT,
bool SO,
bool DF,
typename T >
709 struct MultTrait< UpperMatrix<MT,SO,DF>, CompressedVector<T,false> >
711 typedef typename MultTrait< MT, CompressedVector<T,false> >::Type Type;
714 template<
typename T,
typename MT,
bool SO,
bool DF >
715 struct MultTrait< CompressedVector<T,true>, UpperMatrix<MT,SO,DF> >
717 typedef typename MultTrait< CompressedVector<T,true>, MT >::Type Type;
720 template<
typename MT,
bool SO1,
bool DF,
typename T,
size_t M,
size_t N,
bool SO2 >
721 struct MultTrait< UpperMatrix<MT,SO1,DF>, StaticMatrix<T,M,N,SO2> >
723 typedef typename MultTrait< MT, StaticMatrix<T,M,N,SO2> >::Type Type;
726 template<
typename T,
size_t M,
size_t N,
bool SO1,
typename MT,
bool SO2,
bool DF >
727 struct MultTrait< StaticMatrix<T,M,N,SO1>, UpperMatrix<MT,SO2,DF> >
729 typedef typename MultTrait< StaticMatrix<T,M,N,SO1>, MT >::Type Type;
732 template<
typename MT,
bool SO1,
bool DF,
typename T,
size_t M,
size_t N,
bool SO2 >
733 struct MultTrait< UpperMatrix<MT,SO1,DF>, HybridMatrix<T,M,N,SO2> >
735 typedef typename MultTrait< MT, HybridMatrix<T,M,N,SO2> >::Type Type;
738 template<
typename T,
size_t M,
size_t N,
bool SO1,
typename MT,
bool SO2,
bool DF >
739 struct MultTrait< HybridMatrix<T,M,N,SO1>, UpperMatrix<MT,SO2,DF> >
741 typedef typename MultTrait< HybridMatrix<T,M,N,SO1>, MT >::Type Type;
744 template<
typename MT,
bool SO1,
bool DF,
typename T,
bool SO2 >
745 struct MultTrait< UpperMatrix<MT,SO1,DF>, DynamicMatrix<T,SO2> >
747 typedef typename MultTrait< MT, DynamicMatrix<T,SO2> >::Type Type;
750 template<
typename T,
bool SO1,
typename MT,
bool SO2,
bool DF >
751 struct MultTrait< DynamicMatrix<T,SO1>, UpperMatrix<MT,SO2,DF> >
753 typedef typename MultTrait< DynamicMatrix<T,SO1>, MT >::Type Type;
756 template<
typename MT,
bool SO1,
bool DF,
typename T,
bool SO2 >
757 struct MultTrait< UpperMatrix<MT,SO1,DF>, CompressedMatrix<T,SO2> >
759 typedef typename MultTrait< MT, CompressedMatrix<T,SO2> >::Type Type;
762 template<
typename T,
bool SO1,
typename MT,
bool SO2,
bool DF >
763 struct MultTrait< CompressedMatrix<T,SO1>, UpperMatrix<MT,SO2,DF> >
765 typedef typename MultTrait< CompressedMatrix<T,SO1>, MT >::Type Type;
768 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2,
bool NF >
769 struct MultTrait< UpperMatrix<MT1,SO1,DF1>, SymmetricMatrix<MT2,SO2,DF2,NF> >
771 typedef typename MultTrait<MT1,MT2>::Type Type;
774 template<
typename MT1,
bool SO1,
bool DF1,
bool NF,
typename MT2,
bool SO2,
bool DF2 >
775 struct MultTrait< SymmetricMatrix<MT1,SO1,DF1,NF>, UpperMatrix<MT2,SO2,DF2> >
777 typedef typename MultTrait<MT1,MT2>::Type Type;
780 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
781 struct MultTrait< UpperMatrix<MT1,SO1,DF1>, LowerMatrix<MT2,SO2,DF2> >
783 typedef typename MultTrait<MT1,MT2>::Type Type;
786 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
787 struct MultTrait< LowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
789 typedef typename MultTrait<MT1,MT2>::Type Type;
792 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
793 struct MultTrait< UpperMatrix<MT1,SO1,DF1>, UniLowerMatrix<MT2,SO2,DF2> >
795 typedef typename MultTrait<MT1,MT2>::Type Type;
798 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
799 struct MultTrait< UniLowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
801 typedef typename MultTrait<MT1,MT2>::Type Type;
804 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
805 struct MultTrait< UpperMatrix<MT1,SO1,DF1>, StrictlyLowerMatrix<MT2,SO2,DF2> >
807 typedef typename MultTrait<MT1,MT2>::Type Type;
810 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
811 struct MultTrait< StrictlyLowerMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
813 typedef typename MultTrait<MT1,MT2>::Type Type;
816 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
817 struct MultTrait< UpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
819 typedef UpperMatrix< typename MultTrait<MT1,MT2>::Type > Type;
835 template<
typename MT,
bool SO,
bool DF,
typename T >
836 struct DivTrait< UpperMatrix<MT,SO,DF>, T >
838 typedef UpperMatrix< typename DivTrait<MT,T>::Type > Type;
855 template<
typename MT1,
bool SO1,
bool DF1,
typename MT2,
bool SO2,
bool DF2 >
856 struct MathTrait< UpperMatrix<MT1,SO1,DF1>, UpperMatrix<MT2,SO2,DF2> >
858 typedef UpperMatrix< typename MathTrait<MT1,MT2>::HighType > HighType;
859 typedef UpperMatrix< typename MathTrait<MT1,MT2>::LowType > LowType;
875 template<
typename MT,
bool SO,
bool DF >
876 struct SubmatrixTrait< UpperMatrix<MT,SO,DF> >
878 typedef typename SubmatrixTrait<MT>::Type Type;
894 template<
typename MT,
bool SO,
bool DF >
895 struct RowTrait< UpperMatrix<MT,SO,DF> >
897 typedef typename RowTrait<MT>::Type Type;
913 template<
typename MT,
bool SO,
bool DF >
914 struct ColumnTrait< UpperMatrix<MT,SO,DF> >
916 typedef typename ColumnTrait<MT>::Type Type;
Constraint on the data type.
Header file for the Rows type trait.
Header file for the subtraction trait.
Header file for the row trait.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:821
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:861
Header file for the implementation of the base template of the UpperMatrix.
Header file for the IsSquare type trait.
Header file for the multiplication trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for all forward declarations of the math module.
Header file for the Columns type trait.
UpperMatrix specialization for dense matrices.
Header file for the RemoveAdaptor type trait.
Matrix adapter for upper triangular matrices.
Definition: Forward.h:54
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:841
Header file for the IsAdaptor type trait.
Header file for the DerestrictTrait class template.
Header file for the HasConstDataAccess type trait.
UpperMatrix specialization for sparse matrices.
Header file for the addition trait.
Header file for the division trait.
Header file for the submatrix trait.
#define BLAZE_CONSTRAINT_MUST_BE_NUMERIC_TYPE(T)
Constraint on the data type.In case the given data type T is not a numeric (integral or floating poin...
Definition: Numeric.h:79
Header file for the column trait.
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b)
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:200
Header file for the mathematical trait.
Header file for the IsUpper type trait.
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.