35 #ifndef _BLAZE_MATH_ADAPTORS_UPPERMATRIX_DENSE_H_ 36 #define _BLAZE_MATH_ADAPTORS_UPPERMATRIX_DENSE_H_ 107 template<
typename MT
109 class UpperMatrix<MT,SO,true>
110 :
public DenseMatrix< UpperMatrix<MT,SO,true>, SO >
114 using OT = OppositeType_t<MT>;
115 using TT = TransposeType_t<MT>;
116 using ET = ElementType_t<MT>;
121 using This = UpperMatrix<MT,SO,true>;
122 using BaseType = DenseMatrix<This,SO>;
123 using ResultType = This;
124 using OppositeType = UpperMatrix<OT,!SO,true>;
125 using TransposeType = LowerMatrix<TT,!SO,true>;
126 using ElementType = ET;
127 using SIMDType = SIMDType_t<MT>;
128 using ReturnType = ReturnType_t<MT>;
129 using CompositeType =
const This&;
130 using Reference = UpperProxy<MT>;
131 using ConstReference = ConstReference_t<MT>;
132 using Pointer = Pointer_t<MT>;
133 using ConstPointer = ConstPointer_t<MT>;
134 using ConstIterator = ConstIterator_t<MT>;
140 template<
typename NewType >
143 using Other = UpperMatrix< typename MT::template Rebind<NewType>::Other >;
150 template<
size_t NewM
154 using Other = UpperMatrix< typename MT::template Resize<NewM,NewN>::Other >;
165 using IteratorCategory = std::random_access_iterator_tag;
166 using ValueType = ElementType_t<MT>;
167 using PointerType = UpperProxy<MT>;
168 using ReferenceType = UpperProxy<MT>;
169 using DifferenceType = ptrdiff_t;
172 using iterator_category = IteratorCategory;
173 using value_type = ValueType;
174 using pointer = PointerType;
175 using reference = ReferenceType;
176 using difference_type = DifferenceType;
182 inline Iterator() noexcept
196 inline Iterator( MT& matrix,
size_t row,
size_t column ) noexcept
209 inline Iterator&
operator+=(
size_t inc ) noexcept {
210 ( SO )?( row_ += inc ):( column_ += inc );
221 inline Iterator&
operator-=(
size_t dec ) noexcept {
222 ( SO )?( row_ -= dec ):( column_ -= dec );
232 inline Iterator& operator++() noexcept {
233 ( SO )?( ++row_ ):( ++column_ );
243 inline const Iterator operator++(
int ) noexcept {
244 const Iterator tmp( *
this );
255 inline Iterator& operator--() noexcept {
256 ( SO )?( --row_ ):( --column_ );
266 inline const Iterator operator--(
int ) noexcept {
267 const Iterator tmp( *
this );
279 return ReferenceType( *matrix_, row_, column_ );
288 inline PointerType operator->()
const {
289 return PointerType( *matrix_, row_, column_ );
303 inline SIMDType load()
const {
304 return (*matrix_).load(row_,column_);
318 inline SIMDType
loada()
const {
319 return (*matrix_).loada(row_,column_);
333 inline SIMDType
loadu()
const {
334 return (*matrix_).loadu(row_,column_);
343 inline operator ConstIterator()
const {
345 return matrix_->begin( column_ ) + row_;
347 return matrix_->begin( row_ ) + column_;
358 friend inline bool operator==(
const Iterator& lhs,
const Iterator& rhs ) noexcept {
359 return ( SO )?( lhs.row_ == rhs.row_ ):( lhs.column_ == rhs.column_ );
370 friend inline bool operator==(
const Iterator& lhs,
const ConstIterator& rhs ) {
371 return ( ConstIterator( lhs ) == rhs );
382 friend inline bool operator==(
const ConstIterator& lhs,
const Iterator& rhs ) {
383 return ( lhs == ConstIterator( rhs ) );
394 friend inline bool operator!=(
const Iterator& lhs,
const Iterator& rhs ) noexcept {
395 return ( SO )?( lhs.row_ != rhs.row_ ):( lhs.column_ != rhs.column_ );
406 friend inline bool operator!=(
const Iterator& lhs,
const ConstIterator& rhs ) {
407 return ( ConstIterator( lhs ) != rhs );
418 friend inline bool operator!=(
const ConstIterator& lhs,
const Iterator& rhs ) {
419 return ( lhs != ConstIterator( rhs ) );
430 friend inline bool operator<(
const Iterator& lhs,
const Iterator& rhs ) noexcept {
431 return ( SO )?( lhs.row_ < rhs.row_ ):( lhs.column_ < rhs.column_ );
442 friend inline bool operator<(
const Iterator& lhs,
const ConstIterator& rhs ) {
443 return ( ConstIterator( lhs ) < rhs );
454 friend inline bool operator<(
const ConstIterator& lhs,
const Iterator& rhs ) {
455 return ( lhs < ConstIterator( rhs ) );
466 friend inline bool operator>(
const Iterator& lhs,
const Iterator& rhs ) noexcept {
467 return ( SO )?( lhs.row_ > rhs.row_ ):( lhs.column_ > rhs.column_ );
478 friend inline bool operator>(
const Iterator& lhs,
const ConstIterator& rhs ) {
479 return ( ConstIterator( lhs ) > rhs );
490 friend inline bool operator>(
const ConstIterator& lhs,
const Iterator& rhs ) {
491 return ( lhs > ConstIterator( rhs ) );
502 friend inline bool operator<=(
const Iterator& lhs,
const Iterator& rhs ) noexcept {
503 return ( SO )?( lhs.row_ <= rhs.row_ ):( lhs.column_ <= rhs.column_ );
514 friend inline bool operator<=(
const Iterator& lhs,
const ConstIterator& rhs ) {
515 return ( ConstIterator( lhs ) <= rhs );
526 friend inline bool operator<=(
const ConstIterator& lhs,
const Iterator& rhs ) {
527 return ( lhs <= ConstIterator( rhs ) );
538 friend inline bool operator>=(
const Iterator& lhs,
const Iterator& rhs ) noexcept {
539 return ( SO )?( lhs.row_ >= rhs.row_ ):( lhs.column_ >= rhs.column_ );
550 friend inline bool operator>=(
const Iterator& lhs,
const ConstIterator& rhs ) {
551 return ( ConstIterator( lhs ) >= rhs );
562 friend inline bool operator>=(
const ConstIterator& lhs,
const Iterator& rhs ) {
563 return ( lhs >= ConstIterator( rhs ) );
573 inline DifferenceType
operator-(
const Iterator& rhs )
const noexcept {
574 return ( SO )?( row_ - rhs.row_ ):( column_ - rhs.column_ );
585 friend inline const Iterator
operator+(
const Iterator& it,
size_t inc ) noexcept {
587 return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
589 return Iterator( *it.matrix_, it.row_, it.column_ + inc );
600 friend inline const Iterator
operator+(
size_t inc,
const Iterator& it ) noexcept {
602 return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
604 return Iterator( *it.matrix_, it.row_, it.column_ + inc );
615 friend inline const Iterator
operator-(
const Iterator& it,
size_t dec ) noexcept {
617 return Iterator( *it.matrix_, it.row_ - dec, it.column_ );
619 return Iterator( *it.matrix_, it.row_, it.column_ - dec );
634 static constexpr
bool simdEnabled = MT::simdEnabled;
637 static constexpr
bool smpAssignable = MT::smpAssignable;
643 explicit inline UpperMatrix();
644 template<
typename A1 >
explicit inline UpperMatrix(
const A1& a1 );
645 explicit inline UpperMatrix(
size_t n,
const ElementType& init );
647 inline UpperMatrix( initializer_list< initializer_list<ElementType> > list );
649 template<
typename Other >
650 explicit inline UpperMatrix(
size_t n,
const Other* array );
652 template<
typename Other,
size_t N >
653 explicit inline UpperMatrix(
const Other (&array)[N][N] );
655 explicit inline UpperMatrix( ElementType* ptr,
size_t n );
656 explicit inline UpperMatrix( ElementType* ptr,
size_t n,
size_t nn );
658 inline UpperMatrix(
const UpperMatrix& m );
659 inline UpperMatrix( UpperMatrix&& m ) noexcept;
666 ~UpperMatrix() =
default;
673 inline Reference operator()(
size_t i,
size_t j );
674 inline ConstReference operator()(
size_t i,
size_t j )
const;
675 inline Reference at(
size_t i,
size_t j );
676 inline ConstReference at(
size_t i,
size_t j )
const;
677 inline ConstPointer
data () const noexcept;
678 inline ConstPointer
data (
size_t i ) const noexcept;
679 inline Iterator
begin (
size_t i );
680 inline ConstIterator
begin (
size_t i ) const;
681 inline ConstIterator
cbegin(
size_t i ) const;
682 inline Iterator
end (
size_t i );
683 inline ConstIterator
end (
size_t i ) const;
684 inline ConstIterator
cend (
size_t i ) const;
691 inline UpperMatrix& operator=( const ElementType& rhs );
692 inline UpperMatrix& operator=( initializer_list< initializer_list<ElementType> > list );
694 template< typename Other,
size_t N >
695 inline UpperMatrix& operator=( const Other (&array)[N][N] );
697 inline UpperMatrix& operator=( const UpperMatrix& rhs );
698 inline UpperMatrix& operator=( UpperMatrix&& rhs ) noexcept;
700 template< typename MT2,
bool SO2 >
701 inline auto operator=( const Matrix<MT2,SO2>& rhs )
704 template< typename MT2,
bool SO2 >
705 inline auto operator=( const Matrix<MT2,SO2>& rhs )
708 template< typename MT2,
bool SO2 >
709 inline auto operator+=( const Matrix<MT2,SO2>& rhs )
712 template< typename MT2,
bool SO2 >
713 inline auto operator+=( const Matrix<MT2,SO2>& rhs )
716 template< typename MT2,
bool SO2 >
717 inline auto operator-=( const Matrix<MT2,SO2>& rhs )
720 template< typename MT2,
bool SO2 >
721 inline auto operator-=( const Matrix<MT2,SO2>& rhs )
724 template< typename MT2,
bool SO2 >
725 inline auto operator%=( const Matrix<MT2,SO2>& rhs ) -> UpperMatrix&;
727 template< typename ST >
730 template< typename ST >
738 inline
size_t rows() const noexcept;
739 inline
size_t columns() const noexcept;
740 inline
size_t spacing() const noexcept;
741 inline
size_t capacity() const noexcept;
742 inline
size_t capacity(
size_t i ) const noexcept;
744 inline
size_t nonZeros(
size_t i ) const;
746 inline
void reset(
size_t i );
748 void resize (
size_t n,
bool preserve=true );
749 inline
void extend (
size_t n,
bool preserve=true );
750 inline
void reserve(
size_t elements );
752 inline
void swap( UpperMatrix& m ) noexcept;
754 static inline constexpr
size_t maxNonZeros() noexcept;
755 static inline constexpr
size_t maxNonZeros(
size_t n ) noexcept;
762 template< typename Other > inline UpperMatrix& scale( const Other& scalar );
769 inline
bool isIntact() const noexcept;
776 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
777 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
779 inline
bool isAligned () const noexcept;
780 inline
bool canSMPAssign() const noexcept;
792 inline const MT construct(
size_t n ,
TrueType );
793 inline const MT construct( const ElementType& value,
FalseType );
795 template< typename MT2,
bool SO2, typename T >
796 inline const MT construct( const Matrix<MT2,SO2>& m, T );
808 template<
bool RF, typename MT2,
bool SO2,
bool DF2 >
809 friend
bool isDefault( const UpperMatrix<MT2,SO2,DF2>& m );
811 template< typename MT2,
bool SO2,
bool DF2 >
812 friend MT2& derestrict( UpperMatrix<MT2,SO2,DF2>& m );
849 template< typename MT
851 inline UpperMatrix<MT,SO,true>::UpperMatrix()
879 template<
typename MT
881 template<
typename A1 >
882 inline UpperMatrix<MT,SO,true>::UpperMatrix(
const A1& a1 )
883 : matrix_( construct( a1, typename IsResizable<MT>::Type() ) )
899 template<
typename MT
901 inline UpperMatrix<MT,SO,true>::UpperMatrix(
size_t n,
const ElementType& init )
902 : matrix_( n, n, ElementType() )
907 for(
size_t j=0UL; j<
columns(); ++j )
908 for(
size_t i=0UL; i<=j; ++i )
912 for(
size_t i=0UL; i<
rows(); ++i )
913 for(
size_t j=i; j<
columns(); ++j )
948 template<
typename MT
950 inline UpperMatrix<MT,SO,true>::UpperMatrix( initializer_list< initializer_list<ElementType> > list )
989 template<
typename MT
991 template<
typename Other >
992 inline UpperMatrix<MT,SO,true>::UpperMatrix(
size_t n,
const Other* array )
993 : matrix_( n, n, array )
1028 template<
typename MT
1030 template<
typename Other
1032 inline UpperMatrix<MT,SO,true>::UpperMatrix(
const Other (&array)[N][N] )
1077 template<
typename MT
1079 inline UpperMatrix<MT,SO,true>::UpperMatrix( ElementType* ptr,
size_t n )
1080 : matrix_( ptr, n, n )
1126 template<
typename MT
1128 inline UpperMatrix<MT,SO,true>::UpperMatrix( ElementType* ptr,
size_t n,
size_t nn )
1129 : matrix_( ptr, n, n, nn )
1147 template<
typename MT
1149 inline UpperMatrix<MT,SO,true>::UpperMatrix(
const UpperMatrix& m )
1150 : matrix_( m.matrix_ )
1165 template<
typename MT
1167 inline UpperMatrix<MT,SO,true>::UpperMatrix( UpperMatrix&& m ) noexcept
1168 : matrix_( std::move( m.matrix_ ) )
1201 template<
typename MT
1203 inline typename UpperMatrix<MT,SO,true>::Reference
1204 UpperMatrix<MT,SO,true>::operator()(
size_t i,
size_t j )
1209 return Reference( matrix_, i, j );
1231 template<
typename MT
1233 inline typename UpperMatrix<MT,SO,true>::ConstReference
1234 UpperMatrix<MT,SO,true>::operator()(
size_t i,
size_t j )
const 1239 return matrix_(i,j);
1262 template<
typename MT
1264 inline typename UpperMatrix<MT,SO,true>::Reference
1265 UpperMatrix<MT,SO,true>::at(
size_t i,
size_t j )
1273 return (*
this)(i,j);
1296 template<
typename MT
1298 inline typename UpperMatrix<MT,SO,true>::ConstReference
1299 UpperMatrix<MT,SO,true>::at(
size_t i,
size_t j )
const 1307 return (*
this)(i,j);
1326 template<
typename MT
1328 inline typename UpperMatrix<MT,SO,true>::ConstPointer
1331 return matrix_.data();
1346 template<
typename MT
1348 inline typename UpperMatrix<MT,SO,true>::ConstPointer
1351 return matrix_.data(i);
1369 template<
typename MT
1371 inline typename UpperMatrix<MT,SO,true>::Iterator
1375 return Iterator( matrix_, 0UL, i );
1377 return Iterator( matrix_, i, 0UL );
1395 template<
typename MT
1397 inline typename UpperMatrix<MT,SO,true>::ConstIterator
1400 return matrix_.begin(i);
1418 template<
typename MT
1420 inline typename UpperMatrix<MT,SO,true>::ConstIterator
1423 return matrix_.cbegin(i);
1441 template<
typename MT
1443 inline typename UpperMatrix<MT,SO,true>::Iterator
1447 return Iterator( matrix_,
rows(), i );
1449 return Iterator( matrix_, i,
columns() );
1467 template<
typename MT
1469 inline typename UpperMatrix<MT,SO,true>::ConstIterator
1472 return matrix_.end(i);
1490 template<
typename MT
1492 inline typename UpperMatrix<MT,SO,true>::ConstIterator
1495 return matrix_.cend(i);
1516 template<
typename MT
1518 inline UpperMatrix<MT,SO,true>&
1519 UpperMatrix<MT,SO,true>::operator=(
const ElementType& rhs )
1522 for(
size_t j=0UL; j<
columns(); ++j )
1523 for(
size_t i=0UL; i<=j; ++i )
1527 for(
size_t i=0UL; i<
rows(); ++i )
1528 for(
size_t j=i; j<
columns(); ++j )
1563 template<
typename MT
1565 inline UpperMatrix<MT,SO,true>&
1566 UpperMatrix<MT,SO,true>::operator=( initializer_list< initializer_list<ElementType> > list )
1568 const InitializerMatrix<ElementType> tmp( list, list.size() );
1609 template<
typename MT
1611 template<
typename Other
1613 inline UpperMatrix<MT,SO,true>&
1614 UpperMatrix<MT,SO,true>::operator=(
const Other (&array)[N][N] )
1622 matrix_ = std::move( tmp );
1643 template<
typename MT
1645 inline UpperMatrix<MT,SO,true>&
1646 UpperMatrix<MT,SO,true>::operator=(
const UpperMatrix& rhs )
1648 matrix_ = rhs.matrix_;
1666 template<
typename MT
1668 inline UpperMatrix<MT,SO,true>&
1669 UpperMatrix<MT,SO,true>::operator=( UpperMatrix&& rhs ) noexcept
1671 matrix_ = std::move( rhs.matrix_ );
1695 template<
typename MT
1697 template<
typename MT2
1699 inline auto UpperMatrix<MT,SO,true>::operator=(
const Matrix<MT2,SO2>& rhs )
1700 -> DisableIf_t< IsComputation_v<MT2>, UpperMatrix& >
1702 if( !IsUpper_v<MT2> && !
isUpper( ~rhs ) ) {
1730 template<
typename MT
1732 template<
typename MT2
1734 inline auto UpperMatrix<MT,SO,true>::operator=(
const Matrix<MT2,SO2>& rhs )
1735 -> EnableIf_t< IsComputation_v<MT2>, UpperMatrix& >
1737 if( !IsSquare_v<MT2> && !
isSquare( ~rhs ) ) {
1741 if( IsUpper_v<MT2> ) {
1751 matrix_ = std::move( tmp );
1776 template<
typename MT
1778 template<
typename MT2
1781 -> DisableIf_t< IsComputation_v<MT2>, UpperMatrix& >
1783 if( !IsUpper_v<MT2> && !
isUpper( ~rhs ) ) {
1811 template<
typename MT
1813 template<
typename MT2
1816 -> EnableIf_t< IsComputation_v<MT2>, UpperMatrix& >
1818 if( !IsSquare_v<MT2> && !
isSquare( ~rhs ) ) {
1822 if( IsUpper_v<MT2> ) {
1826 const ResultType_t<MT2> tmp( ~rhs );
1857 template<
typename MT
1859 template<
typename MT2
1862 -> DisableIf_t< IsComputation_v<MT2>, UpperMatrix& >
1864 if( !IsUpper_v<MT2> && !
isUpper( ~rhs ) ) {
1892 template<
typename MT
1894 template<
typename MT2
1897 -> EnableIf_t< IsComputation_v<MT2>, UpperMatrix& >
1899 if( !IsSquare_v<MT2> && !
isSquare( ~rhs ) ) {
1903 if( IsUpper_v<MT2> ) {
1907 const ResultType_t<MT2> tmp( ~rhs );
1936 template<
typename MT
1938 template<
typename MT2
1940 inline auto UpperMatrix<MT,SO,true>::operator%=(
const Matrix<MT2,SO2>& rhs )
1943 if( !IsSquare_v<MT2> && !
isSquare( ~rhs ) ) {
1966 template<
typename MT
1968 template<
typename ST >
1970 -> EnableIf_t< IsNumeric_v<ST>, UpperMatrix& >
1986 template<
typename MT
1988 template<
typename ST >
1990 -> EnableIf_t< IsNumeric_v<ST>, UpperMatrix& >
2015 template<
typename MT
2019 return matrix_.rows();
2031 template<
typename MT
2035 return matrix_.columns();
2052 template<
typename MT
2056 return matrix_.spacing();
2068 template<
typename MT
2072 return matrix_.capacity();
2090 template<
typename MT
2094 return matrix_.capacity(i);
2106 template<
typename MT
2110 return matrix_.nonZeros();
2128 template<
typename MT
2132 return matrix_.nonZeros(i);
2144 template<
typename MT
2151 for(
size_t j=0UL; j<
columns(); ++j )
2152 for(
size_t i=0UL; i<=j; ++i )
2153 clear( matrix_(i,j) );
2156 for(
size_t i=0UL; i<
rows(); ++i )
2157 for(
size_t j=i; j<
columns(); ++j )
2158 clear( matrix_(i,j) );
2178 template<
typename MT
2185 for(
size_t j=0UL; j<=i; ++j )
2186 clear( matrix_(j,i) );
2189 for(
size_t j=i; j<
columns(); ++j )
2190 clear( matrix_(i,j) );
2209 template<
typename MT
2215 if( IsResizable_v<MT> ) {
2262 template<
typename MT
2272 const size_t oldsize( matrix_.rows() );
2274 matrix_.resize( n, n,
true );
2277 const size_t increment( n - oldsize );
2278 submatrix( matrix_, oldsize, 0UL, increment, n-1 ).reset();
2298 template<
typename MT
2300 inline void UpperMatrix<MT,SO,true>::extend(
size_t n,
bool preserve )
2321 template<
typename MT
2323 inline void UpperMatrix<MT,SO,true>::reserve(
size_t elements )
2341 template<
typename MT
2345 matrix_.shrinkToFit();
2358 template<
typename MT
2364 swap( matrix_, m.matrix_ );
2382 template<
typename MT
2384 inline constexpr
size_t UpperMatrix<MT,SO,true>::maxNonZeros() noexcept
2388 return maxNonZeros( Size_v<MT,0UL> );
2404 template<
typename MT
2406 inline constexpr
size_t UpperMatrix<MT,SO,true>::maxNonZeros(
size_t n ) noexcept
2408 return ( ( n + 1UL ) * n ) / 2UL;
2440 template<
typename MT
2442 template<
typename Other >
2443 inline UpperMatrix<MT,SO,true>& UpperMatrix<MT,SO,true>::scale(
const Other& scalar )
2445 matrix_.scale( scalar );
2470 template<
typename MT
2501 template<
typename MT
2503 template<
typename Other >
2504 inline bool UpperMatrix<MT,SO,true>::canAlias(
const Other* alias )
const noexcept
2506 return matrix_.canAlias( alias );
2523 template<
typename MT
2525 template<
typename Other >
2526 inline bool UpperMatrix<MT,SO,true>::isAliased(
const Other* alias )
const noexcept
2528 return matrix_.isAliased( alias );
2544 template<
typename MT
2546 inline bool UpperMatrix<MT,SO,true>::isAligned() const noexcept
2548 return matrix_.isAligned();
2565 template<
typename MT
2567 inline bool UpperMatrix<MT,SO,true>::canSMPAssign() const noexcept
2569 return matrix_.canSMPAssign();
2591 template<
typename MT
2594 UpperMatrix<MT,SO,true>::load(
size_t i,
size_t j )
const noexcept
2596 return matrix_.load( i, j );
2618 template<
typename MT
2623 return matrix_.loada( i, j );
2645 template<
typename MT
2650 return matrix_.loadu( i, j );
2671 template<
typename MT
2673 inline const MT UpperMatrix<MT,SO,true>::construct(
size_t n,
TrueType )
2677 return MT( n, n, ElementType() );
2690 template<
typename MT
2692 inline const MT UpperMatrix<MT,SO,true>::construct(
const ElementType& init,
FalseType )
2700 for(
size_t j=0UL; j<
columns(); ++j )
2701 for(
size_t i=0UL; i<=j; ++i )
2705 for(
size_t i=0UL; i<
rows(); ++i )
2706 for(
size_t j=i; j<
columns(); ++j )
2727 template<
typename MT
2729 template<
typename MT2
2732 inline const MT UpperMatrix<MT,SO,true>::construct(
const Matrix<MT2,SO2>& m, T )
2736 if( !IsUpper_v<MT2> && !
isUpper( 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
bool isUpper(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is an upper triangular matrix.
Definition: DenseMatrix.h:2060
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
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
Header file for the isZero shim.
#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.
bool isZero(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is 0.
Definition: DiagonalProxy.h:677
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.
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
constexpr bool IsNumeric_v
Auxiliary variable template for the IsNumeric type trait.The IsNumeric_v variable template provides a...
Definition: IsNumeric.h:143
Constraint on the data type.
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition: MaybeUnused.h:81
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 UpperProxy class.
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 IsNumeric type trait.
auto operator/=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Division assignment operator for the division of a dense matrix by a scalar value ( ).
Definition: DenseMatrix.h:558
#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
Header file for run time assertion macros.
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_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
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 isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:264
auto operator *=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Multiplication assignment operator for the multiplication of a dense matrix and a scalar value ( ).
Definition: DenseMatrix.h:494
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:635
#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
Header file for the IsUpper type trait.
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
Header file for the implementation of the base template of the UpperMatrix.
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 clear shim.