35 #ifndef _BLAZE_MATH_DENSE_DENSEVECTOR_H_ 36 #define _BLAZE_MATH_DENSE_DENSEVECTOR_H_ 75 template<
typename T1,
typename T2,
bool TF >
76 auto operator==(
const DenseVector<T1,TF>& vec, T2 scalar )
77 -> EnableIf_t< IsNumeric_v<T2>,
bool >;
79 template<
typename T1,
typename T2,
bool TF >
80 auto operator==( T1 scalar,
const DenseVector<T2,TF>& vec )
81 -> EnableIf_t< IsNumeric_v<T1>,
bool >;
83 template<
typename T1,
typename T2,
bool TF >
84 auto operator!=(
const DenseVector<T1,TF>& vec, T2 scalar )
85 -> EnableIf_t< IsNumeric_v<T2>,
bool >;
87 template<
typename T1,
typename T2,
bool TF >
88 auto operator!=( T1 scalar,
const DenseVector<T2,TF>& vec )
89 -> EnableIf_t< IsNumeric_v<T1>,
bool >;
91 template<
typename VT,
bool TF,
typename ST >
92 auto operator*=( DenseVector<VT,TF>& vec, ST scalar )
93 -> EnableIf_t< IsNumeric_v<ST>, VT& >;
95 template<
typename VT,
bool TF,
typename ST >
96 auto operator*=( DenseVector<VT,TF>&& vec, ST scalar )
97 -> EnableIf_t< IsNumeric_v<ST>, VT& >;
99 template<
typename VT,
bool TF,
typename ST >
100 auto operator/=( DenseVector<VT,TF>& vec, ST scalar )
101 -> EnableIf_t< IsNumeric_v<ST>, VT& >;
103 template<
typename VT,
bool TF,
typename ST >
104 auto operator/=( DenseVector<VT,TF>&& vec, ST scalar )
105 -> EnableIf_t< IsNumeric_v<ST>, VT& >;
122 template<
typename T1
135 for(
size_t i=0; i<a.size(); ++i )
136 if( !
equal( a[i], scalar ) )
return false;
154 template<
typename T1
160 return ( vec == scalar );
177 template<
typename T1
183 return !( vec == scalar );
200 template<
typename T1
206 return !( vec == scalar );
224 template<
typename VT
230 if( IsRestricted_v<VT> ) {
231 if( !tryMult( ~vec, 0UL, (~vec).
size(), scalar ) ) {
236 BLAZE_DECLTYPE_AUTO( left, derestrict( ~vec ) );
260 template<
typename VT
286 template<
typename VT
294 if( IsRestricted_v<VT> ) {
295 if( !tryDiv( ~vec, 0UL, (~vec).
size(), scalar ) ) {
300 BLAZE_DECLTYPE_AUTO( left, derestrict( ~vec ) );
326 template<
typename VT
348 template<
typename VT,
bool TF >
349 bool isnan(
const DenseVector<VT,TF>& dv );
351 template<
typename VT,
bool TF >
352 bool isDivisor(
const DenseVector<VT,TF>& dv );
354 template<
bool RF,
typename VT,
bool TF >
355 bool isUniform(
const DenseVector<VT,TF>& dv );
357 template<
typename VT,
bool TF >
358 const ElementType_t<VT>
sqrLength(
const DenseVector<VT,TF>& dv );
360 template<
typename VT,
bool TF >
386 template<
typename VT
392 for(
size_t i=0UL; i<a.size(); ++i ) {
393 if(
isnan( a[i] ) )
return true;
416 template<
typename VT
422 for(
size_t i=0UL; i<a.size(); ++i ) {
468 if( IsUniform_v<VT> || (~dv).
size() < 2UL )
473 const auto& cmp( a[0UL] );
475 for(
size_t i=1UL; i<a.size(); ++i ) {
476 if( !equal<RF>( a[i], cmp ) )
523 if( IsZero_v<VT> || (~dv).
size() == 0UL )
528 for(
size_t i=0UL; i<a.size(); ++i ) {
529 if( !isZero<RF>( a[i] ) )
551 template<
typename VT
560 for(
size_t i=0UL; i<(~dv).
size(); ++i )
604 template<
typename VT
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.
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, the program execution is terminated. The BLAZE_USER_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERT flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:117
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:354
Header file for basic type definitions.
Header file for the isZero shim.
Header file for the DenseVector base class.
Header file for the decltype(auto) workaround.
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.The ElementType_t alias declaration provide...
Definition: Aliases.h:170
auto length(const DenseVector< VT, TF > &dv) -> decltype(sqrt(sqrLength(~dv)))
Calculation of the length (magnitude) of the dense vector .
Definition: DenseVector.h:606
bool isZero(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is 0.
Definition: DiagonalProxy.h:673
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.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
const ElementType_t< VT > sqrLength(const DenseVector< VT, TF > &dv)
Calculation of the square length (magnitude) of the dense vector .
Definition: DenseVector.h:553
Type ElementType
Type of the compressed matrix elements.
Definition: CompressedMatrix.h:3080
decltype(auto) sum(const DenseMatrix< MT, SO > &dm)
Reduces the given dense matrix by means of addition.
Definition: DMatReduceExpr.h:2146
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:713
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:849
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:418
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
#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
Header file for the IsZero type trait.
decltype(auto) pow2(const Proxy< PT, RT > &proxy)
Computing the square value of the represented element.
Definition: Proxy.h:1384
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.
decltype(auto) sqrt(const DenseMatrix< MT, SO > &dm)
Computes the square root of each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1453
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:290
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:263
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, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
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