35 #ifndef _BLAZE_MATH_DENSE_DENSEVECTOR_H_ 36 #define _BLAZE_MATH_DENSE_DENSEVECTOR_H_ 74 template<
typename T1,
typename T2,
bool TF >
75 auto operator==(
const DenseVector<T1,TF>& vec, T2 scalar )
76 -> EnableIf_t< IsNumeric_v<T2>,
bool >;
78 template<
typename T1,
typename T2,
bool TF >
79 auto operator==( T1 scalar,
const DenseVector<T2,TF>& vec )
80 -> EnableIf_t< IsNumeric_v<T1>,
bool >;
82 template<
typename T1,
typename T2,
bool TF >
83 auto operator!=(
const DenseVector<T1,TF>& vec, T2 scalar )
84 -> EnableIf_t< IsNumeric_v<T2>,
bool >;
86 template<
typename T1,
typename T2,
bool TF >
87 auto operator!=( T1 scalar,
const DenseVector<T2,TF>& vec )
88 -> EnableIf_t< IsNumeric_v<T1>,
bool >;
90 template<
typename VT,
bool TF,
typename ST >
91 auto operator+=( DenseVector<VT,TF>& vec, ST scalar )
92 -> EnableIf_t< IsNumeric_v<ST>, VT& >;
94 template<
typename VT,
bool TF,
typename ST >
95 auto operator+=( DenseVector<VT,TF>&& vec, ST scalar )
96 -> EnableIf_t< IsNumeric_v<ST>, VT& >;
98 template<
typename VT,
bool TF,
typename ST >
99 auto operator-=( DenseVector<VT,TF>& vec, ST scalar )
100 -> EnableIf_t< IsNumeric_v<ST>, VT& >;
102 template<
typename VT,
bool TF,
typename ST >
103 auto operator-=( DenseVector<VT,TF>&& vec, ST scalar )
104 -> EnableIf_t< IsNumeric_v<ST>, VT& >;
106 template<
typename VT,
bool TF,
typename ST >
107 auto operator*=( DenseVector<VT,TF>& vec, ST scalar )
108 -> EnableIf_t< IsNumeric_v<ST>, VT& >;
110 template<
typename VT,
bool TF,
typename ST >
111 auto operator*=( DenseVector<VT,TF>&& vec, ST scalar )
112 -> EnableIf_t< IsNumeric_v<ST>, VT& >;
114 template<
typename VT,
bool TF,
typename ST >
115 auto operator/=( DenseVector<VT,TF>& vec, ST scalar )
116 -> EnableIf_t< IsNumeric_v<ST>, VT& >;
118 template<
typename VT,
bool TF,
typename ST >
119 auto operator/=( DenseVector<VT,TF>&& vec, ST scalar )
120 -> EnableIf_t< IsNumeric_v<ST>, VT& >;
122 template<
typename VT,
bool TF >
123 VT&
operator<<=( DenseVector<VT,TF>& vec,
int count );
125 template<
typename VT,
bool TF >
126 VT&
operator<<=( DenseVector<VT,TF>&& vec,
int count );
128 template<
typename VT1,
typename VT2,
bool TF >
129 VT1&
operator<<=( DenseVector<VT1,TF>& lhs,
const DenseVector<VT2,TF>& rhs );
131 template<
typename VT1,
typename VT2,
bool TF >
132 VT1&
operator<<=( DenseVector<VT1,TF>&& lhs,
const DenseVector<VT2,TF>& rhs );
134 template<
typename VT,
bool TF >
135 VT&
operator>>=( DenseVector<VT,TF>& vec,
int count );
137 template<
typename VT,
bool TF >
138 VT&
operator>>=( DenseVector<VT,TF>&& vec,
int count );
140 template<
typename VT1,
typename VT2,
bool TF >
141 VT1&
operator>>=( DenseVector<VT1,TF>& lhs,
const DenseVector<VT2,TF>& rhs );
143 template<
typename VT1,
typename VT2,
bool TF >
144 VT1&
operator>>=( DenseVector<VT1,TF>&& lhs,
const DenseVector<VT2,TF>& rhs );
146 template<
typename VT,
bool TF,
typename ST >
147 auto operator&=( DenseVector<VT,TF>& vec, ST scalar )
148 -> EnableIf_t< IsNumeric_v<ST>, VT& >;
150 template<
typename VT,
bool TF,
typename ST >
151 auto operator&=( DenseVector<VT,TF>&& vec, ST scalar )
152 -> EnableIf_t< IsNumeric_v<ST>, VT& >;
154 template<
typename VT1,
typename VT2,
bool TF >
155 VT1&
operator&=( DenseVector<VT1,TF>& lhs,
const DenseVector<VT2,TF>& rhs );
157 template<
typename VT1,
typename VT2,
bool TF >
158 VT1&
operator&=( DenseVector<VT1,TF>&& lhs,
const DenseVector<VT2,TF>& rhs );
160 template<
typename VT,
bool TF,
typename ST >
161 auto operator|=( DenseVector<VT,TF>& vec, ST scalar )
162 -> EnableIf_t< IsNumeric_v<ST>, VT& >;
164 template<
typename VT,
bool TF,
typename ST >
165 auto operator|=( DenseVector<VT,TF>&& vec, ST scalar )
166 -> EnableIf_t< IsNumeric_v<ST>, VT& >;
168 template<
typename VT1,
typename VT2,
bool TF >
169 VT1&
operator|=( DenseVector<VT1,TF>& lhs,
const DenseVector<VT2,TF>& rhs );
171 template<
typename VT1,
typename VT2,
bool TF >
172 VT1&
operator|=( DenseVector<VT1,TF>&& lhs,
const DenseVector<VT2,TF>& rhs );
174 template<
typename VT,
bool TF,
typename ST >
175 auto operator^=( DenseVector<VT,TF>& vec, ST scalar )
176 -> EnableIf_t< IsNumeric_v<ST>, VT& >;
178 template<
typename VT,
bool TF,
typename ST >
179 auto operator^=( DenseVector<VT,TF>&& vec, ST scalar )
180 -> EnableIf_t< IsNumeric_v<ST>, VT& >;
182 template<
typename VT1,
typename VT2,
bool TF >
183 VT1&
operator^=( DenseVector<VT1,TF>& lhs,
const DenseVector<VT2,TF>& rhs );
185 template<
typename VT1,
typename VT2,
bool TF >
186 VT1&
operator^=( DenseVector<VT1,TF>&& lhs,
const DenseVector<VT2,TF>& rhs );
203 template<
typename T1
216 for(
size_t i=0; i<a.size(); ++i )
217 if( !
equal( a[i], scalar ) )
return false;
235 template<
typename T1
241 return ( vec == scalar );
258 template<
typename T1
264 return !( vec == scalar );
281 template<
typename T1
287 return !( vec == scalar );
305 template<
typename VT
311 if( IsRestricted_v<VT> ) {
312 if( !tryAdd( ~vec, 0UL, (~vec).
size(), scalar ) ) {
317 decltype(
auto) left( derestrict( ~vec ) );
341 template<
typename VT
365 template<
typename VT
371 if( IsRestricted_v<VT> ) {
372 if( !trySub( ~vec, 0UL, (~vec).
size(), scalar ) ) {
377 decltype(
auto) left( derestrict( ~vec ) );
401 template<
typename VT
425 template<
typename VT
431 if( IsRestricted_v<VT> ) {
432 if( !tryMult( ~vec, 0UL, (~vec).
size(), scalar ) ) {
437 decltype(
auto) left( derestrict( ~vec ) );
461 template<
typename VT
487 template<
typename VT
495 if( IsRestricted_v<VT> ) {
496 if( !tryDiv( ~vec, 0UL, (~vec).
size(), scalar ) ) {
501 decltype(
auto) left( derestrict( ~vec ) );
527 template<
typename VT
550 template<
typename VT
554 if( IsRestricted_v<VT> ) {
555 if( !tryShift( ~vec, 0UL, (~vec).
size(), count ) ) {
560 decltype(
auto) left( derestrict( ~vec ) );
583 template<
typename VT
604 template<
typename VT1
609 if( IsRestricted_v<VT1> ) {
610 if( !tryShiftAssign( ~lhs, ~rhs, 0UL ) ) {
615 decltype(
auto) left( derestrict( ~lhs ) );
639 template<
typename VT1
661 template<
typename VT
665 if( IsRestricted_v<VT> ) {
666 if( !tryShift( ~vec, 0UL, (~vec).
size(), count ) ) {
671 decltype(
auto) left( derestrict( ~vec ) );
694 template<
typename VT
715 template<
typename VT1
720 if( IsRestricted_v<VT1> ) {
721 if( !tryShiftAssign( ~lhs, ~rhs, 0UL ) ) {
726 decltype(
auto) left( derestrict( ~lhs ) );
749 template<
typename VT1
771 template<
typename VT
777 if( IsRestricted_v<VT> ) {
778 if( !tryBitand( ~vec, 0UL, (~vec).
size(), scalar ) ) {
783 decltype(
auto) left( derestrict( ~vec ) );
807 template<
typename VT
830 template<
typename VT1
835 if( IsRestricted_v<VT1> ) {
836 if( !tryBitandAssign( ~lhs, ~rhs, 0UL ) ) {
841 decltype(
auto) left( derestrict( ~lhs ) );
864 template<
typename VT1
886 template<
typename VT
892 if( IsRestricted_v<VT> ) {
893 if( !tryBitor( ~vec, 0UL, (~vec).
size(), scalar ) ) {
898 decltype(
auto) left( derestrict( ~vec ) );
922 template<
typename VT
945 template<
typename VT1
950 if( IsRestricted_v<VT1> ) {
951 if( !tryBitorAssign( ~lhs, ~rhs, 0UL ) ) {
956 decltype(
auto) left( derestrict( ~lhs ) );
979 template<
typename VT1
1001 template<
typename VT
1007 if( IsRestricted_v<VT> ) {
1008 if( !tryBitxor( ~vec, 0UL, (~vec).
size(), scalar ) ) {
1013 decltype(
auto) left( derestrict( ~vec ) );
1037 template<
typename VT
1060 template<
typename VT1
1065 if( IsRestricted_v<VT1> ) {
1066 if( !tryBitxorAssign( ~lhs, ~rhs, 0UL ) ) {
1071 decltype(
auto) left( derestrict( ~lhs ) );
1094 template<
typename VT1
1115 template<
typename VT,
bool TF >
1116 bool isnan(
const DenseVector<VT,TF>& dv );
1118 template<
typename VT,
bool TF >
1119 bool isDivisor(
const DenseVector<VT,TF>& dv );
1121 template<
bool RF,
typename VT,
bool TF >
1122 bool isUniform(
const DenseVector<VT,TF>& dv );
1147 template<
typename VT
1153 for(
size_t i=0UL; i<a.size(); ++i ) {
1154 if(
isnan( a[i] ) )
return true;
1177 template<
typename VT
1183 for(
size_t i=0UL; i<a.size(); ++i ) {
1229 if( IsUniform_v<VT> || (~dv).
size() < 2UL )
1234 const auto& cmp( a[0UL] );
1236 for(
size_t i=1UL; i<a.size(); ++i ) {
1237 if( !equal<RF>( a[i], cmp ) )
1284 if( IsZero_v<VT> || (~dv).
size() == 0UL )
1289 for(
size_t i=0UL; i<a.size(); ++i ) {
1290 if( !isZero<RF>( a[i] ) )
Header file for the isnan shim.
#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
Header file for auxiliary alias declarations.
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
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 basic type definitions.
Header file for the isZero shim.
auto operator^=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Bitwise XOR assignment operator for the bitwise XOR of a dense matrix and a scalar value.
Definition: DenseMatrix.h:1089
Header file for the DenseVector base class.
auto operator&=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Bitwise AND assignment operator for the bitwise AND of a dense matrix and a scalar value.
Definition: DenseMatrix.h:851
bool isZero(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is 0.
Definition: DiagonalProxy.h:677
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 sqrt shim.
MT & operator<<=(DenseMatrix< MT, SO > &mat, int count)
Left-shift assignment operator for the uniform left-shift of a dense matrix.
Definition: DenseMatrix.h:622
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
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
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:76
Header file for the pow2 shim.
Header file for the equal shim.
bool isnan(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is not a number.
Definition: DiagonalProxy.h:717
Header file for the exception macros of the math module.
bool isUniform(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a uniform matrix.
Definition: DenseMatrix.h:1638
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 the IsNumeric type trait.
bool isDivisor(const DenseVector< VT, TF > &dv)
Returns whether the given dense vector is a valid divisor.
Definition: DenseVector.h:1179
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
Header file for run time assertion macros.
typename T::CompositeType CompositeType_t
Alias declaration for nested CompositeType type definitions.The CompositeType_t alias declaration pro...
Definition: Aliases.h:90
Header file for the IsZero type trait.
constexpr size_t size(const Matrix< MT, SO > &matrix) noexcept
Returns the total number of elements of the matrix.
Definition: Matrix.h:530
auto smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs) -> EnableIf_t< IsDenseMatrix_v< MT1 > >
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:100
Header file for the RemoveReference type trait.
auto operator|=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Bitwise OR assignment operator for the bitwise OR of a dense matrix and a scalar value.
Definition: DenseMatrix.h:970
Header file for the isDivisor shim.
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
MT & operator>>=(DenseMatrix< MT, SO > &mat, int count)
Right-shift assignment operator for the uniform right-shift of a dense matrix.
Definition: DenseMatrix.h:736
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,...
Definition: Assert.h:101
bool equal(const SharedValue< T1 > &lhs, const SharedValue< T2 > &rhs)
Equality check for a two shared values.
Definition: SharedValue.h:342