35 #ifndef _BLAZE_MATH_ADAPTORS_UNIUPPERMATRIX_DENSE_H_ 36 #define _BLAZE_MATH_ADAPTORS_UNIUPPERMATRIX_DENSE_H_ 112 template<
typename MT
114 class UniUpperMatrix<MT,SO,true>
115 :
public DenseMatrix< UniUpperMatrix<MT,SO,true>, SO >
119 using OT = OppositeType_t<MT>;
120 using TT = TransposeType_t<MT>;
121 using ET = ElementType_t<MT>;
126 using This = UniUpperMatrix<MT,SO,true>;
127 using BaseType = DenseMatrix<This,SO>;
128 using ResultType = This;
129 using OppositeType = UniUpperMatrix<OT,!SO,true>;
130 using TransposeType = UniLowerMatrix<TT,!SO,true>;
131 using ElementType = ET;
132 using SIMDType = SIMDType_t<MT>;
133 using ReturnType = ReturnType_t<MT>;
134 using CompositeType =
const This&;
135 using Reference = UniUpperProxy<MT>;
136 using ConstReference = ConstReference_t<MT>;
137 using Pointer = Pointer_t<MT>;
138 using ConstPointer = ConstPointer_t<MT>;
139 using ConstIterator = ConstIterator_t<MT>;
145 template<
typename NewType >
148 using Other = UniUpperMatrix< typename MT::template Rebind<NewType>::Other >;
155 template<
size_t NewM
159 using Other = UniUpperMatrix< typename MT::template Resize<NewM,NewN>::Other >;
170 using IteratorCategory = std::random_access_iterator_tag;
171 using ValueType = ElementType_t<MT>;
172 using PointerType = UniUpperProxy<MT>;
173 using ReferenceType = UniUpperProxy<MT>;
174 using DifferenceType = ptrdiff_t;
177 using iterator_category = IteratorCategory;
178 using value_type = ValueType;
179 using pointer = PointerType;
180 using reference = ReferenceType;
181 using difference_type = DifferenceType;
187 inline Iterator() noexcept
201 inline Iterator( MT& matrix,
size_t row,
size_t column ) noexcept
214 inline Iterator&
operator+=(
size_t inc ) noexcept {
215 ( SO )?( row_ += inc ):( column_ += inc );
226 inline Iterator&
operator-=(
size_t dec ) noexcept {
227 ( SO )?( row_ -= dec ):( column_ -= dec );
237 inline Iterator& operator++() noexcept {
238 ( SO )?( ++row_ ):( ++column_ );
248 inline const Iterator operator++(
int ) noexcept {
249 const Iterator tmp( *
this );
260 inline Iterator& operator--() noexcept {
261 ( SO )?( --row_ ):( --column_ );
271 inline const Iterator operator--(
int ) {
272 const Iterator tmp( *
this );
284 return ReferenceType( *matrix_, row_, column_ );
293 inline PointerType operator->()
const {
294 return PointerType( *matrix_, row_, column_ );
308 inline SIMDType load()
const {
309 return (*matrix_).load(row_,column_);
323 inline SIMDType
loada()
const {
324 return (*matrix_).loada(row_,column_);
338 inline SIMDType
loadu()
const {
339 return (*matrix_).loadu(row_,column_);
348 inline operator ConstIterator()
const {
350 return matrix_->begin( column_ ) + row_;
352 return matrix_->begin( row_ ) + column_;
363 friend inline bool operator==(
const Iterator& lhs,
const Iterator& rhs ) noexcept {
364 return ( SO )?( lhs.row_ == rhs.row_ ):( lhs.column_ == rhs.column_ );
375 friend inline bool operator==(
const Iterator& lhs,
const ConstIterator& rhs ) {
376 return ( ConstIterator( lhs ) == rhs );
387 friend inline bool operator==(
const ConstIterator& lhs,
const Iterator& rhs ) {
388 return ( lhs == ConstIterator( rhs ) );
399 friend inline bool operator!=(
const Iterator& lhs,
const Iterator& rhs ) noexcept {
400 return ( SO )?( lhs.row_ != rhs.row_ ):( lhs.column_ != rhs.column_ );
411 friend inline bool operator!=(
const Iterator& lhs,
const ConstIterator& rhs ) {
412 return ( ConstIterator( lhs ) != rhs );
423 friend inline bool operator!=(
const ConstIterator& lhs,
const Iterator& rhs ) {
424 return ( lhs != ConstIterator( rhs ) );
435 friend inline bool operator<(
const Iterator& lhs,
const Iterator& rhs ) noexcept {
436 return ( SO )?( lhs.row_ < rhs.row_ ):( lhs.column_ < rhs.column_ );
447 friend inline bool operator<(
const Iterator& lhs,
const ConstIterator& rhs ) {
448 return ( ConstIterator( lhs ) < rhs );
459 friend inline bool operator<(
const ConstIterator& lhs,
const Iterator& rhs ) {
460 return ( lhs < ConstIterator( rhs ) );
471 friend inline bool operator>(
const Iterator& lhs,
const Iterator& rhs ) noexcept {
472 return ( SO )?( lhs.row_ > rhs.row_ ):( lhs.column_ > rhs.column_ );
483 friend inline bool operator>(
const Iterator& lhs,
const ConstIterator& rhs ) {
484 return ( ConstIterator( lhs ) > rhs );
495 friend inline bool operator>(
const ConstIterator& lhs,
const Iterator& rhs ) {
496 return ( lhs > ConstIterator( rhs ) );
507 friend inline bool operator<=(
const Iterator& lhs,
const Iterator& rhs ) noexcept {
508 return ( SO )?( lhs.row_ <= rhs.row_ ):( lhs.column_ <= rhs.column_ );
519 friend inline bool operator<=(
const Iterator& lhs,
const ConstIterator& rhs ) {
520 return ( ConstIterator( lhs ) <= rhs );
531 friend inline bool operator<=(
const ConstIterator& lhs,
const Iterator& rhs ) {
532 return ( lhs <= ConstIterator( rhs ) );
543 friend inline bool operator>=(
const Iterator& lhs,
const Iterator& rhs ) noexcept {
544 return ( SO )?( lhs.row_ >= rhs.row_ ):( lhs.column_ >= rhs.column_ );
555 friend inline bool operator>=(
const Iterator& lhs,
const ConstIterator& rhs ) {
556 return ( ConstIterator( lhs ) >= rhs );
567 friend inline bool operator>=(
const ConstIterator& lhs,
const Iterator& rhs ) {
568 return ( lhs >= ConstIterator( rhs ) );
578 inline DifferenceType
operator-(
const Iterator& rhs )
const noexcept {
579 return ( SO )?( row_ - rhs.row_ ):( column_ - rhs.column_ );
590 friend inline const Iterator
operator+(
const Iterator& it,
size_t inc ) noexcept {
592 return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
594 return Iterator( *it.matrix_, it.row_, it.column_ + inc );
605 friend inline const Iterator
operator+(
size_t inc,
const Iterator& it ) noexcept {
607 return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
609 return Iterator( *it.matrix_, it.row_, it.column_ + inc );
620 friend inline const Iterator
operator-(
const Iterator& it,
size_t dec ) noexcept {
622 return Iterator( *it.matrix_, it.row_ - dec, it.column_ );
624 return Iterator( *it.matrix_, it.row_, it.column_ - dec );
639 static constexpr
bool simdEnabled = MT::simdEnabled;
642 static constexpr
bool smpAssignable = MT::smpAssignable;
648 explicit inline UniUpperMatrix();
649 template<
typename A1 >
explicit inline UniUpperMatrix(
const A1& a1 );
650 explicit inline UniUpperMatrix(
size_t n,
const ElementType& init );
652 inline UniUpperMatrix( initializer_list< initializer_list<ElementType> > list );
654 template<
typename Other >
655 explicit inline UniUpperMatrix(
size_t n,
const Other* array );
657 template<
typename Other,
size_t N >
658 explicit inline UniUpperMatrix(
const Other (&array)[N][N] );
660 explicit inline UniUpperMatrix( ElementType* ptr,
size_t n );
661 explicit inline UniUpperMatrix( ElementType* ptr,
size_t n,
size_t nn );
663 inline UniUpperMatrix(
const UniUpperMatrix& m );
664 inline UniUpperMatrix( UniUpperMatrix&& m ) noexcept;
671 ~UniUpperMatrix() =
default;
678 inline Reference operator()(
size_t i,
size_t j );
679 inline ConstReference operator()(
size_t i,
size_t j )
const;
680 inline Reference at(
size_t i,
size_t j );
681 inline ConstReference at(
size_t i,
size_t j )
const;
682 inline ConstPointer
data () const noexcept;
683 inline ConstPointer
data (
size_t i ) const noexcept;
684 inline Iterator
begin (
size_t i );
685 inline ConstIterator
begin (
size_t i ) const;
686 inline ConstIterator
cbegin(
size_t i ) const;
687 inline Iterator
end (
size_t i );
688 inline ConstIterator
end (
size_t i ) const;
689 inline ConstIterator
cend (
size_t i ) const;
696 inline UniUpperMatrix& operator=( const ElementType& rhs );
697 inline UniUpperMatrix& operator=( initializer_list< initializer_list<ElementType> > list );
699 template< typename Other,
size_t N >
700 inline UniUpperMatrix& operator=( const Other (&array)[N][N] );
702 inline UniUpperMatrix& operator=( const UniUpperMatrix& rhs );
703 inline UniUpperMatrix& operator=( UniUpperMatrix&& rhs ) noexcept;
705 template< typename MT2,
bool SO2 >
706 inline auto operator=( const Matrix<MT2,SO2>& rhs )
709 template< typename MT2,
bool SO2 >
710 inline auto operator=( const Matrix<MT2,SO2>& rhs )
713 template< typename MT2,
bool SO2 >
714 inline auto operator+=( const Matrix<MT2,SO2>& rhs )
717 template< typename MT2,
bool SO2 >
718 inline auto operator+=( const Matrix<MT2,SO2>& rhs )
721 template< typename MT2,
bool SO2 >
722 inline auto operator-=( const Matrix<MT2,SO2>& rhs )
725 template< typename MT2,
bool SO2 >
726 inline auto operator-=( const Matrix<MT2,SO2>& rhs )
729 template< typename MT2,
bool SO2 >
730 inline auto operator%=( const Matrix<MT2,SO2>& rhs ) -> UniUpperMatrix&;
737 inline
size_t rows() const noexcept;
738 inline
size_t columns() const noexcept;
739 inline
size_t spacing() const noexcept;
740 inline
size_t capacity() const noexcept;
741 inline
size_t capacity(
size_t i ) const noexcept;
743 inline
size_t nonZeros(
size_t i ) const;
745 inline
void reset(
size_t i );
747 void resize (
size_t n,
bool preserve=true );
748 inline
void extend (
size_t n,
bool preserve=true );
749 inline
void reserve(
size_t elements );
751 inline
void swap( UniUpperMatrix& m ) noexcept;
753 static inline constexpr
size_t maxNonZeros() noexcept;
754 static inline constexpr
size_t maxNonZeros(
size_t n ) noexcept;
761 inline
bool isIntact() const noexcept;
768 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
769 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
771 inline
bool isAligned () const noexcept;
772 inline
bool canSMPAssign() const noexcept;
784 inline const MT construct(
size_t n ,
TrueType );
785 inline const MT construct( const ElementType& value,
FalseType );
787 template< typename MT2,
bool SO2, typename T >
788 inline const MT construct( const Matrix<MT2,SO2>& m, T );
800 template< typename MT2,
bool SO2,
bool DF2 >
801 friend MT2& derestrict( UniUpperMatrix<MT2,SO2,DF2>& m );
840 template< typename MT
842 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix()
845 for(
size_t i=0UL; i<
rows(); ++i )
846 matrix_(i,i) = ElementType(1);
873 template<
typename MT
875 template<
typename A1 >
876 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix(
const A1& a1 )
877 : matrix_( construct( a1, typename IsResizable<MT>::Type() ) )
893 template<
typename MT
895 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix(
size_t n,
const ElementType& init )
896 : matrix_( n, n, ElementType() )
901 for(
size_t j=0UL; j<
columns(); ++j ) {
902 for(
size_t i=0UL; i<j; ++i )
904 matrix_(j,j) = ElementType(1);
908 for(
size_t i=0UL; i<
rows(); ++i ) {
909 matrix_(i,i) = ElementType(1);
910 for(
size_t j=i+1UL; j<
columns(); ++j )
946 template<
typename MT
948 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( initializer_list< initializer_list<ElementType> > list )
987 template<
typename MT
989 template<
typename Other >
990 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix(
size_t n,
const Other* array )
991 : matrix_( n, n, array )
1026 template<
typename MT
1028 template<
typename Other
1030 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix(
const Other (&array)[N][N] )
1078 template<
typename MT
1080 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( ElementType* ptr,
size_t n )
1081 : matrix_( ptr, n, n )
1130 template<
typename MT
1132 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( ElementType* ptr,
size_t n,
size_t nn )
1133 : matrix_( ptr, n, n, nn )
1151 template<
typename MT
1153 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix(
const UniUpperMatrix& m )
1154 : matrix_( m.matrix_ )
1169 template<
typename MT
1171 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( UniUpperMatrix&& m ) noexcept
1172 : matrix_( std::move( m.matrix_ ) )
1205 template<
typename MT
1207 inline typename UniUpperMatrix<MT,SO,true>::Reference
1208 UniUpperMatrix<MT,SO,true>::operator()(
size_t i,
size_t j )
1213 return Reference( matrix_, i, j );
1235 template<
typename MT
1237 inline typename UniUpperMatrix<MT,SO,true>::ConstReference
1238 UniUpperMatrix<MT,SO,true>::operator()(
size_t i,
size_t j )
const 1243 return matrix_(i,j);
1266 template<
typename MT
1268 inline typename UniUpperMatrix<MT,SO,true>::Reference
1269 UniUpperMatrix<MT,SO,true>::at(
size_t i,
size_t j )
1277 return (*
this)(i,j);
1300 template<
typename MT
1302 inline typename UniUpperMatrix<MT,SO,true>::ConstReference
1303 UniUpperMatrix<MT,SO,true>::at(
size_t i,
size_t j )
const 1311 return (*
this)(i,j);
1330 template<
typename MT
1332 inline typename UniUpperMatrix<MT,SO,true>::ConstPointer
1335 return matrix_.data();
1350 template<
typename MT
1352 inline typename UniUpperMatrix<MT,SO,true>::ConstPointer
1355 return matrix_.data(i);
1373 template<
typename MT
1375 inline typename UniUpperMatrix<MT,SO,true>::Iterator
1379 return Iterator( matrix_, 0UL, i );
1381 return Iterator( matrix_, i, 0UL );
1399 template<
typename MT
1401 inline typename UniUpperMatrix<MT,SO,true>::ConstIterator
1404 return matrix_.begin(i);
1422 template<
typename MT
1424 inline typename UniUpperMatrix<MT,SO,true>::ConstIterator
1427 return matrix_.cbegin(i);
1445 template<
typename MT
1447 inline typename UniUpperMatrix<MT,SO,true>::Iterator
1451 return Iterator( matrix_,
rows(), i );
1453 return Iterator( matrix_, i,
columns() );
1471 template<
typename MT
1473 inline typename UniUpperMatrix<MT,SO,true>::ConstIterator
1476 return matrix_.end(i);
1494 template<
typename MT
1496 inline typename UniUpperMatrix<MT,SO,true>::ConstIterator
1499 return matrix_.cend(i);
1520 template<
typename MT
1522 inline UniUpperMatrix<MT,SO,true>&
1523 UniUpperMatrix<MT,SO,true>::operator=(
const ElementType& rhs )
1526 for(
size_t j=1UL; j<
columns(); ++j )
1527 for(
size_t i=0UL; i<j; ++i )
1531 for(
size_t i=0UL; i<
rows(); ++i )
1532 for(
size_t j=i+1UL; j<
columns(); ++j )
1567 template<
typename MT
1569 inline UniUpperMatrix<MT,SO,true>&
1570 UniUpperMatrix<MT,SO,true>::operator=( initializer_list< initializer_list<ElementType> > list )
1572 const InitializerMatrix<ElementType> tmp( list, list.size() );
1613 template<
typename MT
1615 template<
typename Other
1617 inline UniUpperMatrix<MT,SO,true>&
1618 UniUpperMatrix<MT,SO,true>::operator=(
const Other (&array)[N][N] )
1626 matrix_ = std::move( tmp );
1647 template<
typename MT
1649 inline UniUpperMatrix<MT,SO,true>&
1650 UniUpperMatrix<MT,SO,true>::operator=(
const UniUpperMatrix& rhs )
1652 matrix_ = rhs.matrix_;
1670 template<
typename MT
1672 inline UniUpperMatrix<MT,SO,true>&
1673 UniUpperMatrix<MT,SO,true>::operator=( UniUpperMatrix&& rhs ) noexcept
1675 matrix_ = std::move( rhs.matrix_ );
1699 template<
typename MT
1701 template<
typename MT2
1703 inline auto UniUpperMatrix<MT,SO,true>::operator=(
const Matrix<MT2,SO2>& rhs )
1704 -> DisableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >
1706 if( IsStrictlyTriangular_v<MT2> || ( !IsUniUpper_v<MT2> && !
isUniUpper( ~rhs ) ) ) {
1734 template<
typename MT
1736 template<
typename MT2
1738 inline auto UniUpperMatrix<MT,SO,true>::operator=(
const Matrix<MT2,SO2>& rhs )
1739 -> EnableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >
1741 if( IsStrictlyTriangular_v<MT2> || ( !IsSquare_v<MT2> && !
isSquare( ~rhs ) ) ) {
1745 if( IsUniUpper_v<MT2> ) {
1755 matrix_ = std::move( tmp );
1780 template<
typename MT
1782 template<
typename MT2
1785 -> DisableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >
1787 if( IsLower_v<MT2> || IsUniTriangular_v<MT2> ||
1816 template<
typename MT
1818 template<
typename MT2
1821 -> EnableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >
1823 if( IsLower_v<MT2> || IsUniTriangular_v<MT2> ||
1824 ( !IsSquare_v<MT2> && !
isSquare( ~rhs ) ) ) {
1828 if( IsStrictlyUpper_v<MT2> ) {
1832 const ResultType_t<MT2> tmp( ~rhs );
1863 template<
typename MT
1865 template<
typename MT2
1868 -> DisableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >
1870 if( IsLower_v<MT2> || IsUniTriangular_v<MT2> ||
1899 template<
typename MT
1901 template<
typename MT2
1904 -> EnableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >
1906 if( IsLower_v<MT2> || IsUniTriangular_v<MT2> ||
1907 ( !IsSquare_v<MT2> && !
isSquare( ~rhs ) ) ) {
1911 if( IsStrictlyUpper_v<MT2> ) {
1915 const ResultType_t<MT2> tmp( ~rhs );
1946 template<
typename MT
1948 template<
typename MT2
1950 inline auto UniUpperMatrix<MT,SO,true>::operator%=(
const Matrix<MT2,SO2>& rhs )
1953 if( !IsSquare_v<MT2> && !
isSquare( ~rhs ) ) {
1957 If_t< IsComputation_v<MT2>, ResultType_t<MT2>,
const MT2& > tmp( ~rhs );
1959 for(
size_t i=0UL; i<(~rhs).
rows(); ++i ) {
1960 if( !
isOne( tmp(i,i) ) ) {
1990 template<
typename MT
1994 return matrix_.rows();
2006 template<
typename MT
2010 return matrix_.columns();
2027 template<
typename MT
2031 return matrix_.spacing();
2043 template<
typename MT
2047 return matrix_.capacity();
2065 template<
typename MT
2069 return matrix_.capacity(i);
2081 template<
typename MT
2085 return matrix_.nonZeros();
2103 template<
typename MT
2107 return matrix_.nonZeros(i);
2119 template<
typename MT
2126 for(
size_t j=1UL; j<
columns(); ++j )
2127 for(
size_t i=0UL; i<j; ++i )
2128 clear( matrix_(i,j) );
2131 for(
size_t i=0UL; i<
rows(); ++i )
2132 for(
size_t j=i+1UL; j<
columns(); ++j )
2133 clear( matrix_(i,j) );
2153 template<
typename MT
2160 for(
size_t j=0UL; j<i; ++j )
2161 clear( matrix_(j,i) );
2164 for(
size_t j=i+1UL; j<
columns(); ++j )
2165 clear( matrix_(i,j) );
2184 template<
typename MT
2190 if( IsResizable_v<MT> ) {
2237 template<
typename MT
2247 const size_t oldsize( matrix_.rows() );
2249 matrix_.resize( n, n,
true );
2253 const size_t increment( n - oldsize );
2254 submatrix( matrix_, oldsize, 0UL, increment, n-1UL ).reset();
2256 for(
size_t i=oldsize; i<n; ++i )
2257 matrix_(i,i) = ElementType(1);
2277 template<
typename MT
2279 inline void UniUpperMatrix<MT,SO,true>::extend(
size_t n,
bool preserve )
2300 template<
typename MT
2302 inline void UniUpperMatrix<MT,SO,true>::reserve(
size_t elements )
2320 template<
typename MT
2324 matrix_.shrinkToFit();
2337 template<
typename MT
2343 swap( matrix_, m.matrix_ );
2361 template<
typename MT
2363 inline constexpr
size_t UniUpperMatrix<MT,SO,true>::maxNonZeros() noexcept
2367 return maxNonZeros( Size_v<MT,0UL> );
2383 template<
typename MT
2385 inline constexpr
size_t UniUpperMatrix<MT,SO,true>::maxNonZeros(
size_t n ) noexcept
2387 return ( ( n + 1UL ) * n ) / 2UL;
2411 template<
typename MT
2442 template<
typename MT
2444 template<
typename Other >
2445 inline bool UniUpperMatrix<MT,SO,true>::canAlias(
const Other* alias )
const noexcept
2447 return matrix_.canAlias( alias );
2464 template<
typename MT
2466 template<
typename Other >
2467 inline bool UniUpperMatrix<MT,SO,true>::isAliased(
const Other* alias )
const noexcept
2469 return matrix_.isAliased( alias );
2485 template<
typename MT
2487 inline bool UniUpperMatrix<MT,SO,true>::isAligned() const noexcept
2489 return matrix_.isAligned();
2506 template<
typename MT
2508 inline bool UniUpperMatrix<MT,SO,true>::canSMPAssign() const noexcept
2510 return matrix_.canSMPAssign();
2532 template<
typename MT
2535 UniUpperMatrix<MT,SO,true>::load(
size_t i,
size_t j )
const noexcept
2537 return matrix_.load( i, j );
2559 template<
typename MT
2564 return matrix_.loada( i, j );
2586 template<
typename MT
2591 return matrix_.loadu( i, j );
2612 template<
typename MT
2614 inline const MT UniUpperMatrix<MT,SO,true>::construct(
size_t n,
TrueType )
2618 MT tmp( n, n, ElementType() );
2620 for(
size_t i=0UL; i<n; ++i )
2621 tmp(i,i) = ElementType(1);
2636 template<
typename MT
2638 inline const MT UniUpperMatrix<MT,SO,true>::construct(
const ElementType& init,
FalseType )
2646 for(
size_t j=0UL; j<
columns(); ++j ) {
2647 for(
size_t i=0UL; i<j; ++i )
2649 tmp(j,j) = ElementType(1);
2653 for(
size_t i=0UL; i<
rows(); ++i ) {
2654 tmp(i,i) = ElementType(1);
2655 for(
size_t j=i+1UL; j<
columns(); ++j )
2677 template<
typename MT
2679 template<
typename MT2
2682 inline const MT UniUpperMatrix<MT,SO,true>::construct(
const Matrix<MT2,SO2>& m, T )
2686 if( IsStrictlyTriangular_v<MT2> || ( !IsUniUpper_v<MT2> && !
isUniUpper( tmp ) ) ) {
#define BLAZE_CONSTRAINT_MUST_NOT_BE_TRANSFORMATION_TYPE(T)
Constraint on the data type.In case the given data type T is a transformation expression (i....
Definition: Transformation.h:81
Constraint on the data type.
Header file for the implementation of the Submatrix view.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_CONST(T)
Constraint on the data type.In case the given data type is a const-qualified type,...
Definition: Const.h:79
BoolConstant< false > FalseType
Type/value traits base class.The FalseType class is used as base class for type traits and value trai...
Definition: IntegralConstant.h:121
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.This macro encapsulates the default way o...
Definition: Exception.h:235
Constraint on the data type.
Header file for auxiliary alias declarations.
decltype(auto) column(Matrix< MT, SO > &matrix, RCAs... args)
Creating a view on a specific column of the given matrix.
Definition: Column.h:133
auto operator-=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Subtraction assignment operator for the subtraction of a dense matrix and a scalar value ( ).
Definition: DenseMatrix.h:432
constexpr ptrdiff_t Size_v
Auxiliary variable template for the Size type trait.The Size_v variable template provides a convenien...
Definition: Size.h:176
Constraint on the data type.
Constraint on the data type.
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.In case of an invalid run time expression,...
Definition: Assert.h:117
Header file for the IsUniUpper type trait.
size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:546
Header file for basic type definitions.
constexpr const DenseIterator< Type, AF > operator-(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:750
MT::ElementType * data(DenseMatrix< MT, SO > &dm) noexcept
Low-level data access to the dense matrix elements.
Definition: DenseMatrix.h:170
decltype(auto) submatrix(Matrix< MT, SO > &, RSAs...)
Creating a view on a specific submatrix of the given matrix.
Definition: Submatrix.h:178
#define BLAZE_CONSTRAINT_MUST_BE_MATRIX_WITH_STORAGE_ORDER(T, SO)
Constraint on the data type.In case the given data type T is not a dense or sparse matrix type and in...
Definition: StorageOrder.h:63
#define BLAZE_CONSTRAINT_MUST_NOT_BE_COMPUTATION_TYPE(T)
Constraint on the data type.In case the given data type T is a computational expression (i....
Definition: Computation.h:81
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional matrix type,...
Definition: DenseMatrix.h:61
constexpr bool operator<(const NegativeAccuracy< A > &lhs, const T &rhs)
Less-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:332
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > loadu(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loadu.h:76
Constraint on the data type.
MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:372
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:595
void shrinkToFit(Matrix< MT, SO > &matrix)
Requesting the removal of unused capacity.
Definition: Matrix.h:799
Header file for the MAYBE_UNUSED function template.
Header file for all adaptor forward declarations.
decltype(auto) declupp(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as upper.
Definition: DMatDeclUppExpr.h:1001
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VOLATILE(T)
Constraint on the data type.In case the given data type is a volatile-qualified type,...
Definition: Volatile.h:79
size_t nonZeros(const Matrix< MT, SO > &matrix)
Returns the total number of non-zero elements in the matrix.
Definition: Matrix.h:584
BoolConstant< true > TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: IntegralConstant.h:132
Header file for the extended initializer_list functionality.
Constraint on the data type.
constexpr size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:514
MT::ConstIterator cend(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:482
MT::ConstIterator cbegin(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:416
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
size_t spacing(const DenseMatrix< MT, SO > &dm) noexcept
Returns the spacing between the beginning of two rows/columns.
Definition: DenseMatrix.h:253
#define BLAZE_CONSTRAINT_MUST_BE_SQUARE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a square matrix type,...
Definition: Square.h:60
Header file for the IsSquare type trait.
Constraint on the data type.
Header file for the implementation of a matrix representation of an initializer list.
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.The EnableIf_t alias declaration provides a convenient...
Definition: EnableIf.h:138
Header file for the DisableIf class template.
Header file for the IsStrictlyUpper type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
#define BLAZE_CONSTRAINT_MUST_BE_STATIC_TYPE(T)
Constraint on the data type.In case the given data type T is not a static data type,...
Definition: Static.h:61
decltype(auto) operator *(const DenseMatrix< MT1, false > &lhs, const DenseMatrix< MT2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:9091
#define BLAZE_CONSTRAINT_MUST_NOT_BE_POINTER_TYPE(T)
Constraint on the data type.In case the given data type T is not a pointer type, a compilation error ...
Definition: Pointer.h:79
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
Header file for the DenseMatrix base class.
constexpr bool operator>(const NegativeAccuracy< A > &lhs, const T &rhs)
Greater-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:370
constexpr bool operator>=(const NegativeAccuracy< A > &, const T &rhs)
Greater-or-equal-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:446
auto operator+=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Addition assignment operator for the addition of a dense matrix and a scalar value ( ).
Definition: DenseMatrix.h:370
constexpr bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:253
Constraint on the data type.
Header file for the IsLower type trait.
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition: MaybeUnused.h:81
Header file for the UniUpperProxy class.
Header file for the IsUniTriangular type trait.
Header file for the IsStrictlyTriangular type trait.
Constraints on the storage order of matrix types.
decltype(auto) elements(Vector< VT, TF > &vector, REAs... args)
Creating a view on a selection of elements of the given vector.
Definition: Elements.h:139
Header file for the exception macros of the math module.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UPPER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a upper triangular matrix type,...
Definition: Upper.h:81
void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:738
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:438
constexpr bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:293
Header file for the EnableIf class template.
Header file for utility functions for dense matrices.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:615
constexpr bool IsComputation_v
Auxiliary variable template for the IsComputation type trait.The IsComputation_v variable template pr...
Definition: IsComputation.h:90
Header file for the isOne shim.
#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,...
Definition: Symmetric.h:79
bool isStrictlyUpper(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a strictly upper triangular matrix.
Definition: DenseMatrix.h:2235
Header file for run time assertion macros.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UNIFORM_TYPE(T)
Constraint on the data type.In case the given data type T is a uniform vector or matrix type,...
Definition: Uniform.h:81
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
decltype(auto) row(Matrix< MT, SO > &, RRAs...)
Creating a view on a specific row of the given matrix.
Definition: Row.h:133
#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:61
#define BLAZE_CONSTRAINT_MUST_NOT_BE_LOWER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a lower triangular matrix type,...
Definition: Lower.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_RESIZABLE_TYPE(T)
Constraint on the data type.In case the given data type T is resizable, i.e. has a 'resize' member fu...
Definition: Resizable.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type,...
Definition: Reference.h:79
bool isOne(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is 1.
Definition: DiagonalProxy.h:697
Header file for the isDefault shim.
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b) noexcept
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:282
Constraint on the data type.
Constraint on the data type.
constexpr bool operator<=(const NegativeAccuracy< A > &, const T &rhs)
Less-or-equal-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:408
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VIEW_TYPE(T)
Constraint on the data type.In case the given data type T is a view type (i.e. a subvector,...
Definition: View.h:81
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:498
constexpr const DenseIterator< Type, AF > operator+(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Addition between a DenseIterator and an integral value.
Definition: DenseIterator.h:718
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > loada(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loada.h:79
#define BLAZE_CONSTRAINT_MUST_BE_RESIZABLE_TYPE(T)
Constraint on the data type.In case the given data type T is not resizable, i.e. does not have a 'res...
Definition: Resizable.h:61
Header file for the IsComputation type trait class.
Header file for the IntegralConstant class template.
bool isUniUpper(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is an upper unitriangular matrix.
Definition: DenseMatrix.h:2148
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:264
#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,...
Definition: Hermitian.h:79
typename DisableIf< Condition, T >::Type DisableIf_t
Auxiliary type for the DisableIf class template.The DisableIf_t alias declaration provides a convenie...
Definition: DisableIf.h:138
#define BLAZE_STATIC_ASSERT(expr)
Compile time assertion macro.In case of an invalid compile time expression, a compilation error is cr...
Definition: StaticAssert.h:112
bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition: Matrix.h:951
Header file for the IsResizable type trait.
System settings for the inline keywords.
Header file for the Size type trait.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression,...
Definition: Assert.h:101
Header file for the implementation of the base template of the UniUpperMatrix.
Header file for the clear shim.