35#ifndef _BLAZE_MATH_DENSE_DENSEVECTOR_H_
36#define _BLAZE_MATH_DENSE_DENSEVECTOR_H_
80template<
typename T1,
typename T2,
bool TF >
81auto operator==(
const DenseVector<T1,TF>& vec, T2 scalar )
82 -> EnableIf_t< IsScalar_v<T2>,
bool >;
84template<
typename T1,
typename T2,
bool TF >
85auto operator==( T1 scalar,
const DenseVector<T2,TF>& vec )
86 -> EnableIf_t< IsScalar_v<T1>,
bool >;
88template<
typename T1,
typename T2,
bool TF >
89auto operator!=(
const DenseVector<T1,TF>& vec, T2 scalar )
90 -> EnableIf_t< IsScalar_v<T2>,
bool >;
92template<
typename T1,
typename T2,
bool TF >
93auto operator!=( T1 scalar,
const DenseVector<T2,TF>& vec )
94 -> EnableIf_t< IsScalar_v<T1>,
bool >;
96template<
typename VT,
bool TF,
typename ST >
97auto operator+=( DenseVector<VT,TF>& vec, ST scalar )
98 -> EnableIf_t< IsScalar_v<ST>, VT& >;
100template<
typename VT,
bool TF,
typename ST >
101auto operator+=( DenseVector<VT,TF>&& vec, ST scalar )
102 -> EnableIf_t< IsScalar_v<ST>, VT& >;
104template<
typename VT,
bool TF,
typename ST >
105auto operator-=( DenseVector<VT,TF>& vec, ST scalar )
106 -> EnableIf_t< IsScalar_v<ST>, VT& >;
108template<
typename VT,
bool TF,
typename ST >
109auto operator-=( DenseVector<VT,TF>&& vec, ST scalar )
110 -> EnableIf_t< IsScalar_v<ST>, VT& >;
112template<
typename VT,
bool TF,
typename ST >
113auto operator*=( DenseVector<VT,TF>& vec, ST scalar )
114 -> EnableIf_t< IsScalar_v<ST>, VT& >;
116template<
typename VT,
bool TF,
typename ST >
117auto operator*=( DenseVector<VT,TF>&& vec, ST scalar )
118 -> EnableIf_t< IsScalar_v<ST>, VT& >;
120template<
typename VT,
bool TF,
typename ST >
121auto operator/=( DenseVector<VT,TF>& vec, ST scalar )
122 -> EnableIf_t< IsScalar_v<ST>, VT& >;
124template<
typename VT,
bool TF,
typename ST >
125auto operator/=( DenseVector<VT,TF>&& vec, ST scalar )
126 -> EnableIf_t< IsScalar_v<ST>, VT& >;
128template<
typename VT,
bool TF >
129VT&
operator<<=( DenseVector<VT,TF>& vec,
int count );
131template<
typename VT,
bool TF >
132VT&
operator<<=( DenseVector<VT,TF>&& vec,
int count );
134template<
typename VT1,
typename VT2,
bool TF >
135VT1&
operator<<=( DenseVector<VT1,TF>& lhs,
const DenseVector<VT2,TF>& rhs );
137template<
typename VT1,
typename VT2,
bool TF >
138VT1&
operator<<=( DenseVector<VT1,TF>&& lhs,
const DenseVector<VT2,TF>& rhs );
140template<
typename VT,
bool TF >
141VT&
operator>>=( DenseVector<VT,TF>& vec,
int count );
143template<
typename VT,
bool TF >
144VT&
operator>>=( DenseVector<VT,TF>&& vec,
int count );
146template<
typename VT1,
typename VT2,
bool TF >
147VT1&
operator>>=( DenseVector<VT1,TF>& lhs,
const DenseVector<VT2,TF>& rhs );
149template<
typename VT1,
typename VT2,
bool TF >
150VT1&
operator>>=( DenseVector<VT1,TF>&& lhs,
const DenseVector<VT2,TF>& rhs );
152template<
typename VT,
bool TF,
typename ST >
153auto operator&=( DenseVector<VT,TF>& vec, ST scalar )
154 -> EnableIf_t< IsScalar_v<ST>, VT& >;
156template<
typename VT,
bool TF,
typename ST >
157auto operator&=( DenseVector<VT,TF>&& vec, ST scalar )
158 -> EnableIf_t< IsScalar_v<ST>, VT& >;
160template<
typename VT1,
typename VT2,
bool TF >
161VT1&
operator&=( DenseVector<VT1,TF>& lhs,
const DenseVector<VT2,TF>& rhs );
163template<
typename VT1,
typename VT2,
bool TF >
164VT1&
operator&=( DenseVector<VT1,TF>&& lhs,
const DenseVector<VT2,TF>& rhs );
166template<
typename VT,
bool TF,
typename ST >
167auto operator|=( DenseVector<VT,TF>& vec, ST scalar )
168 -> EnableIf_t< IsScalar_v<ST>, VT& >;
170template<
typename VT,
bool TF,
typename ST >
171auto operator|=( DenseVector<VT,TF>&& vec, ST scalar )
172 -> EnableIf_t< IsScalar_v<ST>, VT& >;
174template<
typename VT1,
typename VT2,
bool TF >
175VT1&
operator|=( DenseVector<VT1,TF>& lhs,
const DenseVector<VT2,TF>& rhs );
177template<
typename VT1,
typename VT2,
bool TF >
178VT1&
operator|=( DenseVector<VT1,TF>&& lhs,
const DenseVector<VT2,TF>& rhs );
180template<
typename VT,
bool TF,
typename ST >
181auto operator^=( DenseVector<VT,TF>& vec, ST scalar )
182 -> EnableIf_t< IsScalar_v<ST>, VT& >;
184template<
typename VT,
bool TF,
typename ST >
185auto operator^=( DenseVector<VT,TF>&& vec, ST scalar )
186 -> EnableIf_t< IsScalar_v<ST>, VT& >;
188template<
typename VT1,
typename VT2,
bool TF >
189VT1&
operator^=( DenseVector<VT1,TF>& lhs,
const DenseVector<VT2,TF>& rhs );
191template<
typename VT1,
typename VT2,
bool TF >
192VT1&
operator^=( DenseVector<VT1,TF>&& lhs,
const DenseVector<VT2,TF>& rhs );
222 for(
size_t i=0; i<a.size(); ++i )
223 if( !
equal( a[i], scalar ) )
return false;
247 return ( vec == scalar );
270 return !( vec == scalar );
293 return !( vec == scalar );
317 if( IsRestricted_v<VT> ) {
318 if( !tryAdd( *vec, 0UL, (*vec).size(), scalar ) ) {
323 decltype(
auto) left( derestrict( *vec ) );
377 if( IsRestricted_v<VT> ) {
378 if( !trySub( *vec, 0UL, (*vec).size(), scalar ) ) {
383 decltype(
auto) left( derestrict( *vec ) );
437 if( IsRestricted_v<VT> ) {
438 if( !tryMult( *vec, 0UL, (*vec).size(), scalar ) ) {
443 decltype(
auto) left( derestrict( *vec ) );
501 if( IsRestricted_v<VT> ) {
502 if( !tryDiv( *vec, 0UL, (*vec).size(), scalar ) ) {
507 decltype(
auto) left( derestrict( *vec ) );
560 if( IsRestricted_v<VT> ) {
561 if( !tryShift( *vec, 0UL, (*vec).size(), count ) ) {
566 decltype(
auto) left( derestrict( *vec ) );
610template<
typename VT1
615 if( IsRestricted_v<VT1> ) {
616 if( !tryShiftAssign( *lhs, *rhs, 0UL ) ) {
621 decltype(
auto) left( derestrict( *lhs ) );
645template<
typename VT1
671 if( IsRestricted_v<VT> ) {
672 if( !tryShift( *vec, 0UL, (*vec).size(), count ) ) {
677 decltype(
auto) left( derestrict( *vec ) );
721template<
typename VT1
726 if( IsRestricted_v<VT1> ) {
727 if( !tryShiftAssign( *lhs, *rhs, 0UL ) ) {
732 decltype(
auto) left( derestrict( *lhs ) );
755template<
typename VT1
783 if( IsRestricted_v<VT> ) {
784 if( !tryBitand( *vec, 0UL, (*vec).size(), scalar ) ) {
789 decltype(
auto) left( derestrict( *vec ) );
836template<
typename VT1
841 if( IsRestricted_v<VT1> ) {
842 if( !tryBitandAssign( *lhs, *rhs, 0UL ) ) {
847 decltype(
auto) left( derestrict( *lhs ) );
870template<
typename VT1
898 if( IsRestricted_v<VT> ) {
899 if( !tryBitor( *vec, 0UL, (*vec).size(), scalar ) ) {
904 decltype(
auto) left( derestrict( *vec ) );
951template<
typename VT1
956 if( IsRestricted_v<VT1> ) {
957 if( !tryBitorAssign( *lhs, *rhs, 0UL ) ) {
962 decltype(
auto) left( derestrict( *lhs ) );
985template<
typename VT1
1007template<
typename VT
1013 if( IsRestricted_v<VT> ) {
1014 if( !tryBitxor( *vec, 0UL, (*vec).size(), scalar ) ) {
1019 decltype(
auto) left( derestrict( *vec ) );
1043template<
typename VT
1066template<
typename VT1
1071 if( IsRestricted_v<VT1> ) {
1072 if( !tryBitxorAssign( *lhs, *rhs, 0UL ) ) {
1077 decltype(
auto) left( derestrict( *lhs ) );
1100template<
typename VT1
1121template<
typename VT,
bool TF >
1122bool isnan(
const DenseVector<VT,TF>& dv );
1124template<
typename VT,
bool TF >
1125bool isinf(
const DenseVector<VT,TF>& dv );
1127template<
typename VT,
bool TF >
1128bool isfinite(
const DenseVector<VT,TF>& dv );
1130template<
typename VT,
bool TF >
1131bool isDivisor(
const DenseVector<VT,TF>& dv );
1133template< RelaxationFlag RF,
typename VT,
bool TF >
1134bool isUniform(
const DenseVector<VT,TF>& dv );
1136template< RelaxationFlag RF,
typename VT,
bool TF >
1137bool isZero(
const DenseVector<VT,TF>& dv );
1159template<
typename VT
1168 for(
size_t i=0UL; i<a.size(); ++i ) {
1169 if(
isnan( a[i] ) )
return true;
1192template<
typename VT
1201 for(
size_t i=0UL; i<a.size(); ++i ) {
1202 if(
isinf( a[i] ) )
return true;
1226template<
typename VT
1235 for(
size_t i=0UL; i<a.size(); ++i ) {
1236 if( !
isfinite( a[i] ) )
return false;
1259template<
typename VT
1265 for(
size_t i=0UL; i<a.size(); ++i ) {
1311 if( IsUniform_v<VT> || (*dv).size() < 2UL )
1316 const auto& cmp( a[0UL] );
1318 for(
size_t i=1UL; i<a.size(); ++i ) {
1319 if( !equal<RF>( a[i], cmp ) )
1366 if( IsZero_v<VT> || (*dv).size() == 0UL )
1371 for(
size_t i=0UL; i<a.size(); ++i ) {
1372 if( !isZero<RF>( a[i] ) )
Header file for auxiliary alias declarations.
typename T::CompositeType CompositeType_t
Alias declaration for nested CompositeType type definitions.
Definition: Aliases.h:110
Header file for run time assertion macros.
Header file for the EnableIf class template.
Header file for the isDivisor shim.
Header file for the isfinite shim.
Header file for the IsFloatingPoint type trait.
Header file for the isinf shim.
Header file for the isnan shim.
Header file for the IsRestricted type trait.
Header file for the IsScalar type trait.
Deactivation of problematic macros.
Constraint on the data type.
Header file for the relaxation flag enumeration.
Header file for the RemoveReference type trait.
Header file for the UnderlyingBuiltin type trait.
Base class for N-dimensional dense vectors.
Definition: DenseVector.h:77
Header file for the DenseVector base class.
auto operator/=(DenseVector< VT, TF > &&vec, ST scalar) -> EnableIf_t< IsScalar_v< ST >, VT & >
Division assignment operator for the division of a temporary dense vector by a scalar value ( ).
Definition: DenseVector.h:536
bool isUniform(const DenseVector< VT, TF > &dv)
Checks if the given dense vector is a uniform vector.
Definition: DenseVector.h:1309
auto operator-=(DenseVector< VT, TF > &&vec, ST scalar) -> EnableIf_t< IsScalar_v< ST >, VT & >
Subtraction assignment operator for the subtraction of a temporary dense vector and a scalar value ( ...
Definition: DenseVector.h:410
auto operator!=(T1 scalar, const DenseVector< T2, TF > &vec) -> EnableIf_t< IsScalar_v< T1 >, bool >
Inequality operator for the comparison of a scalar value and a dense vector.
Definition: DenseVector.h:290
bool isDivisor(const DenseVector< VT, TF > &dv)
Returns whether the given dense vector is a valid divisor.
Definition: DenseVector.h:1261
VT1 & operator^=(DenseVector< VT1, TF > &&lhs, const DenseVector< VT2, TF > &rhs)
Bitwise XOR assignment operator for the bitwise XOR of a temporary dense vector.
Definition: DenseVector.h:1103
VT1 & operator&=(DenseVector< VT1, TF > &&lhs, const DenseVector< VT2, TF > &rhs)
Bitwise AND assignment operator for the bitwise AND of a temporary dense vector.
Definition: DenseVector.h:873
VT1 & operator>>=(DenseVector< VT1, TF > &&lhs, const DenseVector< VT2, TF > &rhs)
Right-shift assignment operator for the elementwise right-shift of a temporary dense.
Definition: DenseVector.h:758
VT1 & operator|=(DenseVector< VT1, TF > &&lhs, const DenseVector< VT2, TF > &rhs)
Bitwise OR assignment operator for the bitwise OR of a temporary dense vector.
Definition: DenseVector.h:988
bool isZero(const DenseVector< VT, TF > &dv)
Checks if the given dense vector is a zero vector.
Definition: DenseVector.h:1364
auto operator+=(DenseVector< VT, TF > &&vec, ST scalar) -> EnableIf_t< IsScalar_v< ST >, VT & >
Addition assignment operator for the addition of a temporary dense vector and a scalar value ( ).
Definition: DenseVector.h:350
auto operator*=(DenseVector< VT, TF > &&vec, ST scalar) -> EnableIf_t< IsScalar_v< ST >, VT & >
Multiplication assignment operator for the multiplication of a temporary dense vector and a scalar va...
Definition: DenseVector.h:470
VT1 & operator<<=(DenseVector< VT1, TF > &&lhs, const DenseVector< VT2, TF > &rhs)
Left-shift assignment operator for the elementwise left-shift of a temporary dense vector.
Definition: DenseVector.h:648
bool isnan(const DenseVector< VT, TF > &dv)
Checks the given dense vector for not-a-number elements.
Definition: DenseVector.h:1161
bool isinf(const DenseVector< VT, TF > &dv)
Checks the given dense vector for infinite elements.
Definition: DenseVector.h:1194
bool isfinite(const DenseVector< VT, TF > &dv)
Checks the given dense vector for finite elements.
Definition: DenseVector.h:1228
auto operator==(T1 scalar, const DenseVector< T2, TF > &vec) -> EnableIf_t< IsScalar_v< T1 >, bool >
Equality operator for the comparison of a scalar value and a dense vector.
Definition: DenseVector.h:244
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:207
typename UnderlyingBuiltin< T >::Type UnderlyingBuiltin_t
Auxiliary alias declaration for the UnderlyingBuiltin type trait.
Definition: UnderlyingBuiltin.h:117
RelaxationFlag
Relaxation flag for strict or relaxed semantics.
Definition: RelaxationFlag.h:66
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.
Definition: Assert.h:101
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.
Definition: Assert.h:117
auto smpAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs) -> EnableIf_t< IsDenseVector_v< VT1 > >
Default implementation of the SMP assignment of a vector to a dense vector.
Definition: DenseVector.h:105
bool equal(const SharedValue< T1 > &lhs, const SharedValue< T2 > &rhs)
Equality check for a two shared values.
Definition: SharedValue.h:343
constexpr bool IsFloatingPoint_v
Auxiliary variable template for the IsFloatingPoint type trait.
Definition: IsFloatingPoint.h:95
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.
Definition: EnableIf.h:138
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.
Definition: Exception.h:235
Header file for the exception macros of the math module.
Header file for the equal shim.
Header file for the isZero shim.
Header file for the pow2 shim.
Header file for the sqrt shim.
Header file for the IsZero type trait.
Header file for basic type definitions.