mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Fix all the doxygen warnings.
This commit is contained in:
@@ -134,8 +134,15 @@ class Array : public PlainObjectBase<Array<Scalar_, Rows_, Cols_, Options_, MaxR
|
||||
return *this;
|
||||
}
|
||||
|
||||
/** \copydoc PlainObjectBase(const Scalar& a0, const Scalar& a1, const Scalar& a2, const Scalar& a3, const
|
||||
* ArgTypes&... args)
|
||||
/** \brief Construct a row of column vector with fixed size from an arbitrary number of coefficients.
|
||||
*
|
||||
* \only_for_vectors
|
||||
*
|
||||
* This constructor is for 1D array or vectors with more than 4 coefficients.
|
||||
*
|
||||
* \warning To construct a column (resp. row) vector of fixed length, the number of values passed to this
|
||||
* constructor must match the the fixed number of rows (resp. columns) of \c *this.
|
||||
*
|
||||
*
|
||||
* Example: \include Array_variadic_ctor_cxx11.cpp
|
||||
* Output: \verbinclude Array_variadic_ctor_cxx11.out
|
||||
|
||||
@@ -81,9 +81,6 @@ class ArrayBase : public DenseBase<Derived> {
|
||||
|
||||
typedef typename Base::CoeffReturnType CoeffReturnType;
|
||||
|
||||
#endif // not EIGEN_PARSED_BY_DOXYGEN
|
||||
|
||||
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
||||
typedef typename Base::PlainObject PlainObject;
|
||||
|
||||
/** \internal Represents a matrix with all coefficients equal to one another*/
|
||||
@@ -118,19 +115,57 @@ class ArrayBase : public DenseBase<Derived> {
|
||||
return derived();
|
||||
}
|
||||
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator+=(const Scalar& scalar);
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator-=(const Scalar& scalar);
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator+=(const Scalar& other) {
|
||||
internal::call_assignment(this->derived(), PlainObject::Constant(rows(), cols(), other),
|
||||
internal::add_assign_op<Scalar, Scalar>());
|
||||
return derived();
|
||||
}
|
||||
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator+=(const ArrayBase<OtherDerived>& other);
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator-=(const ArrayBase<OtherDerived>& other);
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator-=(const Scalar& other) {
|
||||
internal::call_assignment(this->derived(), PlainObject::Constant(rows(), cols(), other),
|
||||
internal::sub_assign_op<Scalar, Scalar>());
|
||||
return derived();
|
||||
}
|
||||
|
||||
/** replaces \c *this by \c *this + \a other.
|
||||
*
|
||||
* \returns a reference to \c *this
|
||||
*/
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator*=(const ArrayBase<OtherDerived>& other);
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator+=(const ArrayBase<OtherDerived>& other) {
|
||||
call_assignment(derived(), other.derived(), internal::add_assign_op<Scalar, typename OtherDerived::Scalar>());
|
||||
return derived();
|
||||
}
|
||||
|
||||
/** replaces \c *this by \c *this - \a other.
|
||||
*
|
||||
* \returns a reference to \c *this
|
||||
*/
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator/=(const ArrayBase<OtherDerived>& other);
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator-=(const ArrayBase<OtherDerived>& other) {
|
||||
call_assignment(derived(), other.derived(), internal::sub_assign_op<Scalar, typename OtherDerived::Scalar>());
|
||||
return derived();
|
||||
}
|
||||
|
||||
/** replaces \c *this by \c *this * \a other coefficient wise.
|
||||
*
|
||||
* \returns a reference to \c *this
|
||||
*/
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator*=(const ArrayBase<OtherDerived>& other) {
|
||||
call_assignment(derived(), other.derived(), internal::mul_assign_op<Scalar, typename OtherDerived::Scalar>());
|
||||
return derived();
|
||||
}
|
||||
|
||||
/** replaces \c *this by \c *this / \a other coefficient wise.
|
||||
*
|
||||
* \returns a reference to \c *this
|
||||
*/
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator/=(const ArrayBase<OtherDerived>& other) {
|
||||
call_assignment(derived(), other.derived(), internal::div_assign_op<Scalar, typename OtherDerived::Scalar>());
|
||||
return derived();
|
||||
}
|
||||
|
||||
public:
|
||||
EIGEN_DEVICE_FUNC ArrayBase<Derived>& array() { return *this; }
|
||||
@@ -173,50 +208,6 @@ class ArrayBase : public DenseBase<Derived> {
|
||||
}
|
||||
};
|
||||
|
||||
/** replaces \c *this by \c *this - \a other.
|
||||
*
|
||||
* \returns a reference to \c *this
|
||||
*/
|
||||
template <typename Derived>
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& ArrayBase<Derived>::operator-=(const ArrayBase<OtherDerived>& other) {
|
||||
call_assignment(derived(), other.derived(), internal::sub_assign_op<Scalar, typename OtherDerived::Scalar>());
|
||||
return derived();
|
||||
}
|
||||
|
||||
/** replaces \c *this by \c *this + \a other.
|
||||
*
|
||||
* \returns a reference to \c *this
|
||||
*/
|
||||
template <typename Derived>
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& ArrayBase<Derived>::operator+=(const ArrayBase<OtherDerived>& other) {
|
||||
call_assignment(derived(), other.derived(), internal::add_assign_op<Scalar, typename OtherDerived::Scalar>());
|
||||
return derived();
|
||||
}
|
||||
|
||||
/** replaces \c *this by \c *this * \a other coefficient wise.
|
||||
*
|
||||
* \returns a reference to \c *this
|
||||
*/
|
||||
template <typename Derived>
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& ArrayBase<Derived>::operator*=(const ArrayBase<OtherDerived>& other) {
|
||||
call_assignment(derived(), other.derived(), internal::mul_assign_op<Scalar, typename OtherDerived::Scalar>());
|
||||
return derived();
|
||||
}
|
||||
|
||||
/** replaces \c *this by \c *this / \a other coefficient wise.
|
||||
*
|
||||
* \returns a reference to \c *this
|
||||
*/
|
||||
template <typename Derived>
|
||||
template <typename OtherDerived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& ArrayBase<Derived>::operator/=(const ArrayBase<OtherDerived>& other) {
|
||||
call_assignment(derived(), other.derived(), internal::div_assign_op<Scalar, typename OtherDerived::Scalar>());
|
||||
return derived();
|
||||
}
|
||||
|
||||
} // end namespace Eigen
|
||||
|
||||
#endif // EIGEN_ARRAYBASE_H
|
||||
|
||||
@@ -287,7 +287,7 @@ DenseBase<Derived>::LinSpaced(Index size, const Scalar& low, const Scalar& high)
|
||||
}
|
||||
|
||||
/**
|
||||
* \copydoc DenseBase::LinSpaced(Index, const Scalar&, const Scalar&)
|
||||
* \copydoc DenseBase::LinSpaced(Index, const DenseBase::Scalar&, const DenseBase::Scalar&)
|
||||
* Special version for fixed size types which does not require the size parameter.
|
||||
*/
|
||||
template <typename Derived>
|
||||
|
||||
@@ -1251,8 +1251,6 @@ template <typename T>
|
||||
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE EIGEN_CONSTEXPR T div_ceil(T a, T b) {
|
||||
using UnsignedT = typename internal::make_unsigned<T>::type;
|
||||
EIGEN_STATIC_ASSERT((NumTraits<T>::IsInteger), THIS FUNCTION IS FOR INTEGER TYPES)
|
||||
eigen_assert(a >= 0);
|
||||
eigen_assert(b > 0);
|
||||
// Note: explicitly declaring a and b as non-negative values allows the compiler to use better optimizations
|
||||
const UnsignedT ua = UnsignedT(a);
|
||||
const UnsignedT ub = UnsignedT(b);
|
||||
@@ -1268,8 +1266,6 @@ EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE EIGEN_CONSTEXPR T round_down(T a, U b) {
|
||||
using UnsignedU = typename internal::make_unsigned<U>::type;
|
||||
EIGEN_STATIC_ASSERT((NumTraits<T>::IsInteger), THIS FUNCTION IS FOR INTEGER TYPES)
|
||||
EIGEN_STATIC_ASSERT((NumTraits<U>::IsInteger), THIS FUNCTION IS FOR INTEGER TYPES)
|
||||
eigen_assert(a >= 0);
|
||||
eigen_assert(b > 0);
|
||||
// Note: explicitly declaring a and b as non-negative values allows the compiler to use better optimizations
|
||||
const UnsignedT ua = UnsignedT(a);
|
||||
const UnsignedU ub = UnsignedU(b);
|
||||
@@ -1279,7 +1275,6 @@ EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE EIGEN_CONSTEXPR T round_down(T a, U b) {
|
||||
/** Log base 2 for 32 bits positive integers.
|
||||
* Conveniently returns 0 for x==0. */
|
||||
EIGEN_CONSTEXPR inline int log2(int x) {
|
||||
eigen_assert(x >= 0);
|
||||
unsigned int v(x);
|
||||
constexpr int table[32] = {0, 9, 1, 10, 13, 21, 2, 29, 11, 14, 16, 18, 22, 25, 3, 30,
|
||||
8, 12, 20, 28, 15, 17, 24, 7, 19, 27, 23, 6, 26, 5, 4, 31};
|
||||
|
||||
@@ -224,8 +224,6 @@ class Matrix : public PlainObjectBase<Matrix<Scalar_, Rows_, Cols_, Options_, Ma
|
||||
return Base::_set(other);
|
||||
}
|
||||
|
||||
/* Here, doxygen failed to copy the brief information when using \copydoc */
|
||||
|
||||
/**
|
||||
* \brief Copies the generic expression \a other into *this.
|
||||
* \copydetails DenseBase::operator=(const EigenBase<OtherDerived> &other)
|
||||
@@ -266,7 +264,15 @@ class Matrix : public PlainObjectBase<Matrix<Scalar_, Rows_, Cols_, Options_, Ma
|
||||
return *this;
|
||||
}
|
||||
|
||||
/** \copydoc PlainObjectBase(const Scalar&, const Scalar&, const Scalar&, const Scalar&, const ArgTypes&... args)
|
||||
/** \brief Construct a row of column vector with fixed size from an arbitrary number of coefficients.
|
||||
*
|
||||
* \only_for_vectors
|
||||
*
|
||||
* This constructor is for 1D array or vectors with more than 4 coefficients.
|
||||
*
|
||||
* \warning To construct a column (resp. row) vector of fixed length, the number of values passed to this
|
||||
* constructor must match the the fixed number of rows (resp. columns) of \c *this.
|
||||
*
|
||||
*
|
||||
* Example: \include Matrix_variadic_ctor_cxx11.cpp
|
||||
* Output: \verbinclude Matrix_variadic_ctor_cxx11.out
|
||||
@@ -280,6 +286,7 @@ class Matrix : public PlainObjectBase<Matrix<Scalar_, Rows_, Cols_, Options_, Ma
|
||||
|
||||
/** \brief Constructs a Matrix and initializes it from the coefficients given as initializer-lists grouped by row.
|
||||
* \cpp11
|
||||
* \anchor matrix_initializer_list
|
||||
*
|
||||
* In the general case, the constructor takes a list of rows, each row being represented as a list of coefficients:
|
||||
*
|
||||
|
||||
@@ -115,6 +115,7 @@ EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Tgt bit_cast(const Src& src) {
|
||||
}
|
||||
} // namespace numext
|
||||
|
||||
// clang-format off
|
||||
/** \class NumTraits
|
||||
* \ingroup Core_Module
|
||||
*
|
||||
@@ -126,48 +127,50 @@ EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Tgt bit_cast(const Src& src) {
|
||||
*
|
||||
* The provided data consists of:
|
||||
* \li A typedef \c Real, giving the "real part" type of \a T. If \a T is already real,
|
||||
* then \c Real is just a typedef to \a T. If \a T is \c std::complex<U> then \c Real
|
||||
* then \c Real is just a typedef to \a T. If \a T is `std::complex<U>` then \c Real
|
||||
* is a typedef to \a U.
|
||||
* \li A typedef \c NonInteger, giving the type that should be used for operations producing non-integral values,
|
||||
* such as quotients, square roots, etc. If \a T is a floating-point type, then this typedef just gives
|
||||
* \a T again. Note however that many Eigen functions such as internal::sqrt simply refuse to
|
||||
* take integers. Outside of a few cases, Eigen doesn't do automatic type promotion. Thus, this typedef is
|
||||
* only intended as a helper for code that needs to explicitly promote types.
|
||||
* \li A typedef \c Literal giving the type to use for numeric literals such as "2" or "0.5". For instance, for \c
|
||||
* std::complex<U>, Literal is defined as \c U. Of course, this type must be fully compatible with \a T. In doubt, just
|
||||
* use \a T here. \li A typedef \a Nested giving the type to use to nest a value inside of the expression tree. If you
|
||||
* don't know what this means, just use \a T here. \li An enum value \a IsComplex. It is equal to 1 if \a T is a \c
|
||||
* std::complex type, and to 0 otherwise. \li An enum value \a IsInteger. It is equal to \c 1 if \a T is an integer type
|
||||
* such as \c int, and to \c 0 otherwise. \li Enum values ReadCost, AddCost and MulCost representing a rough estimate of
|
||||
* the number of CPU cycles needed to by move / add / mul instructions respectively, assuming the data is already stored
|
||||
* in CPU registers. Stay vague here. No need to do architecture-specific stuff. If you don't know what this means, just
|
||||
* use \c Eigen::HugeCost. \li An enum value \a IsSigned. It is equal to \c 1 if \a T is a signed type and to 0 if \a T
|
||||
* is unsigned. \li An enum value \a RequireInitialization. It is equal to \c 1 if the constructor of the numeric type
|
||||
* \a T must be called, and to 0 if it is safe not to call it. Default is 0 if \a T is an arithmetic type, and 1
|
||||
* otherwise. \li An epsilon() function which, unlike <a
|
||||
* href="http://en.cppreference.com/w/cpp/types/numeric_limits/epsilon">std::numeric_limits::epsilon()</a>, it returns a
|
||||
* \a Real instead of a \a T. \li A dummy_precision() function returning a weak epsilon value. It is mainly used as a
|
||||
* default value by the fuzzy comparison operators. \li highest() and lowest() functions returning the highest and
|
||||
* lowest possible values respectively. \li digits() function returning the number of radix digits (non-sign digits for
|
||||
* integers, mantissa for floating-point). This is the analogue of <a
|
||||
* href="http://en.cppreference.com/w/cpp/types/numeric_limits/digits">std::numeric_limits<T>::digits</a> which is used
|
||||
* as the default implementation if specialized. \li digits10() function returning the number of decimal digits that can
|
||||
* be represented without change. This is the analogue of <a
|
||||
* href="http://en.cppreference.com/w/cpp/types/numeric_limits/digits10">std::numeric_limits<T>::digits10</a> which is
|
||||
* used as the default implementation if specialized. \li max_digits10() function returning the number of decimal digits
|
||||
* required to uniquely represent all distinct values of the type. This is the analogue of <a
|
||||
* href="http://en.cppreference.com/w/cpp/types/numeric_limits/max_digits10">std::numeric_limits<T>::max_digits10</a>
|
||||
* \li A typedef \c Literal giving the type to use for numeric literals such as "2" or "0.5". For instance, for
|
||||
* `std::complex<U>`, Literal is defined as \a U. Of course, this type must be fully compatible with \a T. In doubt,
|
||||
* just use \a T here.
|
||||
* \li A typedef \c Nested giving the type to use to nest a value inside of the expression tree. If you don't know what
|
||||
* this means, just use \a T here.
|
||||
* \li An enum value \c IsComplex. It is equal to 1 if \a T is a \c std::complex type, and to 0 otherwise.
|
||||
* \li An enum value \c IsInteger. It is equal to \c 1 if \a T is an integer type such as \c int, and to \c 0 otherwise.
|
||||
* \li Enum values \c ReadCost, \c AddCost and \c MulCost representing a rough estimate of the number of CPU cycles needed to by
|
||||
* move / add / mul instructions respectively, assuming the data is already stored in CPU registers. Stay vague here.
|
||||
* No need to do architecture-specific stuff. If you don't know what this means, just use \c Eigen::HugeCost.
|
||||
* \li An enum value \c IsSigned. It is equal to \c 1 if \a T is a signed type and to 0 if \a T is unsigned.
|
||||
* \li An enum value \c RequireInitialization. It is equal to \c 1 if the constructor of the numeric type \a T must be
|
||||
* called, and to 0 if it is safe not to call it. Default is 0 if \a T is an arithmetic type, and 1 otherwise.
|
||||
* \li An epsilon() function which, unlike <a href="http://en.cppreference.com/w/cpp/types/numeric_limits/epsilon">
|
||||
* `std::numeric_limits::epsilon()`</a>, it returns a \c Real instead of a \a T.
|
||||
* \li A dummy_precision() function returning a weak epsilon value. It is mainly used as a default value by the fuzzy
|
||||
* comparison operators.
|
||||
* \li highest() and lowest() functions returning the highest and lowest possible values respectively.
|
||||
* \li digits() function returning the number of radix digits (non-sign digits for integers, mantissa for floating-point).
|
||||
* This is the analogue of <a href="http://en.cppreference.com/w/cpp/types/numeric_limits/digits">
|
||||
* `std::numeric_limits<T>::digits`</a> which is used as the default implementation if specialized.
|
||||
* \li digits10() function returning the number of decimal digits that can be represented without change. This is the
|
||||
* analogue of <a href="http://en.cppreference.com/w/cpp/types/numeric_limits/digits10">
|
||||
* `std::numeric_limits<T>::digits10`</a> which is used as the default implementation if specialized.
|
||||
* \li max_digits10() function returning the number of decimal digits required to uniquely represent all distinct values
|
||||
* of the type. This is the analogue of <a
|
||||
* href="http://en.cppreference.com/w/cpp/types/numeric_limits/max_digits10">`std::numeric_limits<T>::max_digits10`</a>
|
||||
* which is used as the default implementation if specialized.
|
||||
* \li min_exponent() and max_exponent() functions returning the highest and lowest possible values, respectively,
|
||||
* such that the radix raised to the power exponent-1 is a normalized floating-point number. These are equivalent
|
||||
* to <a
|
||||
* href="http://en.cppreference.com/w/cpp/types/numeric_limits/min_exponent">std::numeric_limits<T>::min_exponent</a>/
|
||||
* <a
|
||||
* href="http://en.cppreference.com/w/cpp/types/numeric_limits/max_exponent">std::numeric_limits<T>::max_exponent</a>.
|
||||
* to <a href="http://en.cppreference.com/w/cpp/types/numeric_limits/min_exponent">
|
||||
* `std::numeric_limits<T>::min_exponent`</a>/<a
|
||||
* href="http://en.cppreference.com/w/cpp/types/numeric_limits/max_exponent">`std::numeric_limits<T>::max_exponent`</a>.
|
||||
* \li infinity() function returning a representation of positive infinity, if available.
|
||||
* \li quiet_NaN function returning a non-signaling "not-a-number", if available.
|
||||
* \li quiet_NaN() function returning a non-signaling "not-a-number", if available.
|
||||
*/
|
||||
|
||||
// clang-format on
|
||||
template <typename T>
|
||||
struct GenericNumTraits {
|
||||
enum {
|
||||
|
||||
@@ -80,27 +80,6 @@ struct matrix_swap_impl;
|
||||
|
||||
} // end namespace internal
|
||||
|
||||
#ifdef EIGEN_PARSED_BY_DOXYGEN
|
||||
namespace doxygen {
|
||||
|
||||
// This is a workaround to doxygen not being able to understand the inheritance logic
|
||||
// when it is hidden by the dense_xpr_base helper struct.
|
||||
// Moreover, doxygen fails to include members that are not documented in the declaration body of
|
||||
// MatrixBase if we inherits MatrixBase<Matrix<Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_> >,
|
||||
// this is why we simply inherits MatrixBase, though this does not make sense.
|
||||
|
||||
/** This class is just a workaround for Doxygen and it does not not actually exist. */
|
||||
template <typename Derived>
|
||||
struct dense_xpr_base_dispatcher;
|
||||
/** This class is just a workaround for Doxygen and it does not not actually exist. */
|
||||
template <typename Scalar_, int Rows_, int Cols_, int Options_, int MaxRows_, int MaxCols_>
|
||||
struct dense_xpr_base_dispatcher<Matrix<Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_>> : public MatrixBase {};
|
||||
/** This class is just a workaround for Doxygen and it does not not actually exist. */
|
||||
template <typename Scalar_, int Rows_, int Cols_, int Options_, int MaxRows_, int MaxCols_>
|
||||
struct dense_xpr_base_dispatcher<Array<Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_>> : public ArrayBase {};
|
||||
|
||||
} // namespace doxygen
|
||||
|
||||
/** \class PlainObjectBase
|
||||
* \ingroup Core_Module
|
||||
* \brief %Dense storage base class for matrices and arrays.
|
||||
@@ -113,12 +92,7 @@ struct dense_xpr_base_dispatcher<Array<Scalar_, Rows_, Cols_, Options_, MaxRows_
|
||||
* \sa \ref TopicClassHierarchy
|
||||
*/
|
||||
template <typename Derived>
|
||||
class PlainObjectBase : public doxygen::dense_xpr_base_dispatcher<Derived>
|
||||
#else
|
||||
template <typename Derived>
|
||||
class PlainObjectBase : public internal::dense_xpr_base<Derived>::type
|
||||
#endif
|
||||
{
|
||||
class PlainObjectBase : public internal::dense_xpr_base<Derived>::type {
|
||||
public:
|
||||
enum { Options = internal::traits<Derived>::Options };
|
||||
typedef typename internal::dense_xpr_base<Derived>::type Base;
|
||||
|
||||
@@ -294,6 +294,7 @@ struct generic_product_impl<Lhs, Rhs, DenseShape, DenseShape, OuterProduct> {
|
||||
}
|
||||
};
|
||||
struct add {
|
||||
/** Add to dst. */
|
||||
template <typename Dst, typename Src>
|
||||
EIGEN_DEVICE_FUNC void operator()(const Dst& dst, const Src& src) const {
|
||||
dst.const_cast_derived() += src;
|
||||
@@ -305,9 +306,12 @@ struct generic_product_impl<Lhs, Rhs, DenseShape, DenseShape, OuterProduct> {
|
||||
dst.const_cast_derived() -= src;
|
||||
}
|
||||
};
|
||||
/** Scaled add. */
|
||||
struct adds {
|
||||
Scalar m_scale;
|
||||
/** Constructor */
|
||||
explicit adds(const Scalar& s) : m_scale(s) {}
|
||||
/** Scaled add to dst. */
|
||||
template <typename Dst, typename Src>
|
||||
void EIGEN_DEVICE_FUNC operator()(const Dst& dst, const Src& src) const {
|
||||
dst.const_cast_derived() += m_scale * src;
|
||||
|
||||
@@ -24,20 +24,6 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::operator*=(co
|
||||
return derived();
|
||||
}
|
||||
|
||||
template <typename Derived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& ArrayBase<Derived>::operator+=(const Scalar& other) {
|
||||
internal::call_assignment(this->derived(), PlainObject::Constant(rows(), cols(), other),
|
||||
internal::add_assign_op<Scalar, Scalar>());
|
||||
return derived();
|
||||
}
|
||||
|
||||
template <typename Derived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& ArrayBase<Derived>::operator-=(const Scalar& other) {
|
||||
internal::call_assignment(this->derived(), PlainObject::Constant(rows(), cols(), other),
|
||||
internal::sub_assign_op<Scalar, Scalar>());
|
||||
return derived();
|
||||
}
|
||||
|
||||
template <typename Derived>
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& DenseBase<Derived>::operator/=(const Scalar& other) {
|
||||
internal::call_assignment(this->derived(), PlainObject::Constant(rows(), cols(), other),
|
||||
|
||||
@@ -321,7 +321,7 @@ bool MatrixBase<Derived>::isSkewSymmetric(const RealScalar& prec) const {
|
||||
return (this->transpose() + *this).isZero(prec);
|
||||
}
|
||||
|
||||
/** \returns the matrix product of \c *this by the skew symmetric matrix \skew.
|
||||
/** \returns the matrix product of \c *this by the skew symmetric matrix \a skew.
|
||||
*/
|
||||
template <typename Derived>
|
||||
template <typename SkewDerived>
|
||||
|
||||
@@ -213,11 +213,12 @@ class trans {
|
||||
}
|
||||
|
||||
/**
|
||||
* Transposes LxunrollN row major block of matrices stored EIGEN_AVX_MAX_NUM_ACC zmm registers to
|
||||
* Transposes LxunrollN row major block of matrices stored `EIGEN_AVX_MAX_NUM_ACC` zmm registers to
|
||||
* "unrollN"xL ymm registers to be stored col-major into C.
|
||||
*
|
||||
* For 8x48, the 8x48 block (row-major) is stored in zmm as follows:
|
||||
*
|
||||
* ```
|
||||
* row0: zmm0 zmm1 zmm2
|
||||
* row1: zmm3 zmm4 zmm5
|
||||
* .
|
||||
@@ -231,10 +232,10 @@ class trans {
|
||||
* .
|
||||
* .
|
||||
* row7: zmm14 zmm15
|
||||
*
|
||||
* ```
|
||||
*
|
||||
* In general we will have {1,2,3} groups of avx registers each of size
|
||||
* EIGEN_AVX_MAX_NUM_ROW. packetIndexOffset is used to select which "block" of
|
||||
* `EIGEN_AVX_MAX_NUM_ROW`. packetIndexOffset is used to select which "block" of
|
||||
* avx registers are being transposed.
|
||||
*/
|
||||
template <int64_t unrollN, int64_t packetIndexOffset>
|
||||
|
||||
@@ -18,19 +18,24 @@ namespace Eigen {
|
||||
|
||||
namespace internal {
|
||||
|
||||
static Packet4ui p4ui_CONJ_XOR =
|
||||
vec_mergeh((Packet4ui)p4i_ZERO, (Packet4ui)p4f_MZERO); //{ 0x00000000, 0x80000000, 0x00000000, 0x80000000 };
|
||||
inline Packet4ui p4ui_CONJ_XOR() {
|
||||
return vec_mergeh((Packet4ui)p4i_ZERO, (Packet4ui)p4f_MZERO); //{ 0x00000000, 0x80000000, 0x00000000, 0x80000000 };
|
||||
}
|
||||
#ifdef EIGEN_VECTORIZE_VSX
|
||||
#if defined(_BIG_ENDIAN)
|
||||
static Packet2ul p2ul_CONJ_XOR1 =
|
||||
(Packet2ul)vec_sld((Packet4ui)p2d_MZERO, (Packet4ui)p2l_ZERO, 8); //{ 0x8000000000000000, 0x0000000000000000 };
|
||||
static Packet2ul p2ul_CONJ_XOR2 =
|
||||
(Packet2ul)vec_sld((Packet4ui)p2l_ZERO, (Packet4ui)p2d_MZERO, 8); //{ 0x8000000000000000, 0x0000000000000000 };
|
||||
inline Packet2ul p2ul_CONJ_XOR1() {
|
||||
(Packet2ul) vec_sld((Packet4ui)p2d_MZERO, (Packet4ui)p2l_ZERO, 8); //{ 0x8000000000000000, 0x0000000000000000 };
|
||||
}
|
||||
inline Packet2ul p2ul_CONJ_XOR2() {
|
||||
(Packet2ul) vec_sld((Packet4ui)p2l_ZERO, (Packet4ui)p2d_MZERO, 8); //{ 0x8000000000000000, 0x0000000000000000 };
|
||||
}
|
||||
#else
|
||||
static Packet2ul p2ul_CONJ_XOR1 =
|
||||
(Packet2ul)vec_sld((Packet4ui)p2l_ZERO, (Packet4ui)p2d_MZERO, 8); //{ 0x8000000000000000, 0x0000000000000000 };
|
||||
static Packet2ul p2ul_CONJ_XOR2 =
|
||||
(Packet2ul)vec_sld((Packet4ui)p2d_MZERO, (Packet4ui)p2l_ZERO, 8); //{ 0x8000000000000000, 0x0000000000000000 };
|
||||
inline Packet2ul p2ul_CONJ_XOR1() {
|
||||
(Packet2ul) vec_sld((Packet4ui)p2l_ZERO, (Packet4ui)p2d_MZERO, 8); //{ 0x8000000000000000, 0x0000000000000000 };
|
||||
}
|
||||
inline Packet2ul p2ul_CONJ_XOR2() {
|
||||
(Packet2ul) vec_sld((Packet4ui)p2d_MZERO, (Packet4ui)p2l_ZERO, 8); //{ 0x8000000000000000, 0x0000000000000000 };
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -50,7 +55,7 @@ struct Packet2cf {
|
||||
v1 = vec_madd(v1, b.v, p4f_ZERO);
|
||||
// multiply a_im * b and get the conjugate result
|
||||
v2 = vec_madd(v2, b.v, p4f_ZERO);
|
||||
v2 = reinterpret_cast<Packet4f>(pxor(v2, reinterpret_cast<Packet4f>(p4ui_CONJ_XOR)));
|
||||
v2 = reinterpret_cast<Packet4f>(pxor(v2, reinterpret_cast<Packet4f>(p4ui_CONJ_XOR())));
|
||||
// permute back to a proper order
|
||||
v2 = vec_perm(v2, v2, p16uc_COMPLEX32_REV);
|
||||
|
||||
@@ -266,7 +271,7 @@ EIGEN_STRONG_INLINE Packet2cf pnegate(const Packet2cf& a) {
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet2cf pconj(const Packet2cf& a) {
|
||||
return Packet2cf(pxor<Packet4f>(a.v, reinterpret_cast<Packet4f>(p4ui_CONJ_XOR)));
|
||||
return Packet2cf(pxor<Packet4f>(a.v, reinterpret_cast<Packet4f>(p4ui_CONJ_XOR())));
|
||||
}
|
||||
|
||||
template <>
|
||||
@@ -399,7 +404,7 @@ struct Packet1cd {
|
||||
// multiply a_im * b and get the conjugate result
|
||||
v2 = vec_madd(a_im, b.v, p2d_ZERO);
|
||||
v2 = reinterpret_cast<Packet2d>(vec_sld(reinterpret_cast<Packet4ui>(v2), reinterpret_cast<Packet4ui>(v2), 8));
|
||||
v2 = pxor(v2, reinterpret_cast<Packet2d>(p2ul_CONJ_XOR1));
|
||||
v2 = pxor(v2, reinterpret_cast<Packet2d>(p2ul_CONJ_XOR1()));
|
||||
|
||||
return Packet1cd(padd<Packet2d>(v1, v2));
|
||||
}
|
||||
@@ -543,7 +548,7 @@ EIGEN_STRONG_INLINE Packet1cd pnegate(const Packet1cd& a) {
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet1cd pconj(const Packet1cd& a) {
|
||||
return Packet1cd(pxor(a.v, reinterpret_cast<Packet2d>(p2ul_CONJ_XOR2)));
|
||||
return Packet1cd(pxor(a.v, reinterpret_cast<Packet2d>(p2ul_CONJ_XOR2())));
|
||||
}
|
||||
|
||||
template <>
|
||||
|
||||
@@ -3155,7 +3155,7 @@ void gemmbfloat16(const DataMapper& res, const bfloat16* indexA, const bfloat16*
|
||||
|
||||
#undef MAX_BFLOAT16_ACC_VSX
|
||||
|
||||
#include "MatrixVectorProduct.h"
|
||||
#include "MatrixVectorProduct.inc"
|
||||
|
||||
/************************************
|
||||
* ppc64le template specializations *
|
||||
|
||||
@@ -2116,7 +2116,7 @@ EIGEN_STRONG_INLINE Packet8bf F32ToBf16(Packet4f p4f) {
|
||||
/**
|
||||
* Pack the high portion of two float Packets into one bfloat16 Packet
|
||||
*
|
||||
* @param lohi to expect either a low & high OR odd & even order
|
||||
* @tparam lohi to expect either a low & high OR odd & even order
|
||||
*/
|
||||
template <bool lohi>
|
||||
EIGEN_ALWAYS_INLINE Packet8bf Bf16PackHigh(Packet4f lo, Packet4f hi) {
|
||||
@@ -2163,7 +2163,7 @@ EIGEN_ALWAYS_INLINE Packet8bf Bf16PackHigh(Packet4f hi, Packet4f lo) {
|
||||
/**
|
||||
* Convert and pack two float Packets into one bfloat16 Packet
|
||||
*
|
||||
* @param lohi to expect either a low & high OR odd & even order
|
||||
* @tparam lohi to expect either a low & high OR odd & even order
|
||||
*/
|
||||
template <bool lohi = true>
|
||||
EIGEN_ALWAYS_INLINE Packet8bf F32ToBf16Two(Packet4f lo, Packet4f hi) {
|
||||
|
||||
@@ -19,14 +19,19 @@ namespace Eigen {
|
||||
namespace internal {
|
||||
|
||||
#if !defined(__ARCH__) || (defined(__ARCH__) && __ARCH__ >= 12)
|
||||
static Packet4ui p4ui_CONJ_XOR = {0x00000000, 0x80000000, 0x00000000,
|
||||
0x80000000}; // vec_mergeh((Packet4ui)p4i_ZERO, (Packet4ui)p4f_MZERO);
|
||||
inline Packet4ui p4ui_CONJ_XOR() {
|
||||
return {0x00000000, 0x80000000, 0x00000000, 0x80000000}; // vec_mergeh((Packet4ui)p4i_ZERO, (Packet4ui)p4f_MZERO);
|
||||
}
|
||||
#endif
|
||||
|
||||
static Packet2ul p2ul_CONJ_XOR1 =
|
||||
(Packet2ul)vec_sld((Packet4ui)p2d_ZERO_, (Packet4ui)p2l_ZERO, 8); //{ 0x8000000000000000, 0x0000000000000000 };
|
||||
static Packet2ul p2ul_CONJ_XOR2 =
|
||||
(Packet2ul)vec_sld((Packet4ui)p2l_ZERO, (Packet4ui)p2d_ZERO_, 8); //{ 0x8000000000000000, 0x0000000000000000 };
|
||||
inline Packet2ul p2ul_CONJ_XOR1() {
|
||||
return (Packet2ul)vec_sld((Packet4ui)p2d_ZERO_, (Packet4ui)p2l_ZERO,
|
||||
8); //{ 0x8000000000000000, 0x0000000000000000 };
|
||||
}
|
||||
inline Packet2ul p2ul_CONJ_XOR2() {
|
||||
return (Packet2ul)vec_sld((Packet4ui)p2l_ZERO, (Packet4ui)p2d_ZERO_,
|
||||
8); //{ 0x8000000000000000, 0x0000000000000000 };
|
||||
}
|
||||
|
||||
struct Packet1cd {
|
||||
EIGEN_STRONG_INLINE Packet1cd() {}
|
||||
@@ -188,7 +193,7 @@ EIGEN_STRONG_INLINE Packet1cd pmul<Packet1cd>(const Packet1cd& a, const Packet1c
|
||||
// multiply a_im * b and get the conjugate result
|
||||
v2 = vec_madd(a_im, b.v, p2d_ZERO);
|
||||
v2 = (Packet2d)vec_sld((Packet4ui)v2, (Packet4ui)v2, 8);
|
||||
v2 = (Packet2d)vec_xor((Packet2d)v2, (Packet2d)p2ul_CONJ_XOR1);
|
||||
v2 = (Packet2d)vec_xor((Packet2d)v2, (Packet2d)p2ul_CONJ_XOR1());
|
||||
|
||||
return Packet1cd(v1 + v2);
|
||||
}
|
||||
@@ -472,7 +477,7 @@ EIGEN_STRONG_INLINE Packet2cf pcmp_eq(const Packet2cf& a, const Packet2cf& b) {
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet2cf pconj(const Packet2cf& a) {
|
||||
return Packet2cf(pxor<Packet4f>(a.v, reinterpret_cast<Packet4f>(p4ui_CONJ_XOR)));
|
||||
return Packet2cf(pxor<Packet4f>(a.v, reinterpret_cast<Packet4f>(p4ui_CONJ_XOR())));
|
||||
}
|
||||
template <>
|
||||
EIGEN_STRONG_INLINE Packet2cf pmul<Packet2cf>(const Packet2cf& a, const Packet2cf& b) {
|
||||
@@ -486,7 +491,7 @@ EIGEN_STRONG_INLINE Packet2cf pmul<Packet2cf>(const Packet2cf& a, const Packet2c
|
||||
|
||||
// multiply a_im * b and get the conjugate result
|
||||
prod_im = a_im * b.v;
|
||||
prod_im = pxor<Packet4f>(prod_im, reinterpret_cast<Packet4f>(p4ui_CONJ_XOR));
|
||||
prod_im = pxor<Packet4f>(prod_im, reinterpret_cast<Packet4f>(p4ui_CONJ_XOR()));
|
||||
// permute back to a proper order
|
||||
prod_im = vec_perm(prod_im, prod_im, p16uc_COMPLEX32_REV);
|
||||
|
||||
|
||||
@@ -305,7 +305,8 @@ inline bool useSpecificBlockingSizes(Index& k, Index& m, Index& n) {
|
||||
* \param[in,out] k Input: the third dimension of the product. Output: the blocking size along the same dimension.
|
||||
* \param[in,out] m Input: the number of rows of the left hand side. Output: the blocking size along the same dimension.
|
||||
* \param[in,out] n Input: the number of columns of the right hand side. Output: the blocking size along the same
|
||||
* dimension.
|
||||
* dimension.
|
||||
* \param[in] num_threads Input: the number of threads used for the computation.
|
||||
*
|
||||
* Given a m x k times k x n matrix product of scalar types \c LhsScalar and \c RhsScalar,
|
||||
* this function computes the blocking size parameters along the respective dimensions
|
||||
|
||||
@@ -308,15 +308,19 @@ struct general_product_to_triangular_selector<MatrixType, ProductType, UpLo, fal
|
||||
}
|
||||
};
|
||||
|
||||
template <typename MatrixType, unsigned int UpLo>
|
||||
template <typename MatrixType_, unsigned int Mode_>
|
||||
template <typename ProductType>
|
||||
EIGEN_DEVICE_FUNC TriangularView<MatrixType, UpLo>& TriangularViewImpl<MatrixType, UpLo, Dense>::_assignProduct(
|
||||
const ProductType& prod, const Scalar& alpha, bool beta) {
|
||||
EIGEN_STATIC_ASSERT((UpLo & UnitDiag) == 0, WRITING_TO_TRIANGULAR_PART_WITH_UNIT_DIAGONAL_IS_NOT_SUPPORTED);
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename TriangularViewImpl<MatrixType_, Mode_, Dense>::TriangularViewType&
|
||||
TriangularViewImpl<MatrixType_, Mode_, Dense>::_assignProduct(
|
||||
const ProductType& prod, const typename TriangularViewImpl<MatrixType_, Mode_, Dense>::Scalar& alpha, bool beta) {
|
||||
EIGEN_STATIC_ASSERT((Mode_ & UnitDiag) == 0, WRITING_TO_TRIANGULAR_PART_WITH_UNIT_DIAGONAL_IS_NOT_SUPPORTED);
|
||||
eigen_assert(derived().nestedExpression().rows() == prod.rows() && derived().cols() == prod.cols());
|
||||
|
||||
general_product_to_triangular_selector<MatrixType, ProductType, UpLo, internal::traits<ProductType>::InnerSize == 1>::
|
||||
run(derived().nestedExpression().const_cast_derived(), prod, alpha, beta);
|
||||
general_product_to_triangular_selector<MatrixType_, ProductType, Mode_,
|
||||
internal::traits<ProductType>::InnerSize == 1>::run(derived()
|
||||
.nestedExpression()
|
||||
.const_cast_derived(),
|
||||
prod, alpha, beta);
|
||||
|
||||
return derived();
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
namespace Eigen {
|
||||
|
||||
/** \class MaxSizeVector
|
||||
* \ingroup Core
|
||||
* \ingroup Core_Module
|
||||
*
|
||||
* \brief The MaxSizeVector class.
|
||||
*
|
||||
|
||||
@@ -79,7 +79,6 @@ typedef EIGEN_DEFAULT_DENSE_INDEX_TYPE DenseIndex;
|
||||
* \details To change this, \c \#define the preprocessor symbol \c EIGEN_DEFAULT_DENSE_INDEX_TYPE.
|
||||
* \sa \blank \ref TopicPreprocessorDirectives, StorageIndex.
|
||||
*/
|
||||
|
||||
typedef EIGEN_DEFAULT_DENSE_INDEX_TYPE Index;
|
||||
|
||||
namespace internal {
|
||||
|
||||
@@ -40,6 +40,7 @@ struct numeric_list<T, n, nn...> {
|
||||
static constexpr T first_value = n;
|
||||
};
|
||||
|
||||
// Ddoxygen doesn't like the recursive definition of gen_numeric_list.
|
||||
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
||||
/* numeric list constructors
|
||||
*
|
||||
@@ -53,6 +54,7 @@ struct numeric_list<T, n, nn...> {
|
||||
|
||||
template <typename T, std::size_t n, T start = 0, T... ii>
|
||||
struct gen_numeric_list : gen_numeric_list<T, n - 1, start, start + n - 1, ii...> {};
|
||||
|
||||
template <typename T, T start, T... ii>
|
||||
struct gen_numeric_list<T, 0, start, ii...> {
|
||||
typedef numeric_list<T, ii...> type;
|
||||
@@ -80,6 +82,10 @@ template <typename T, T V, T... nn>
|
||||
struct gen_numeric_list_repeated<T, 0, V, nn...> {
|
||||
typedef numeric_list<T, nn...> type;
|
||||
};
|
||||
#else
|
||||
template <typename T, std::size_t n, T start = 0, T... ii>
|
||||
struct gen_numeric_list;
|
||||
#endif // not EIGEN_PARSED_BY_DOXYGEN
|
||||
|
||||
/* list manipulation: concatenate */
|
||||
|
||||
@@ -110,16 +116,20 @@ struct mconcat<a, b, cs...> : concat<a, typename mconcat<b, cs...>::type> {};
|
||||
|
||||
template <int n, typename x>
|
||||
struct take;
|
||||
|
||||
template <int n, typename a, typename... as>
|
||||
struct take<n, type_list<a, as...>> : concat<type_list<a>, typename take<n - 1, type_list<as...>>::type> {};
|
||||
|
||||
template <int n>
|
||||
struct take<n, type_list<>> {
|
||||
typedef type_list<> type;
|
||||
};
|
||||
|
||||
template <typename a, typename... as>
|
||||
struct take<0, type_list<a, as...>> {
|
||||
typedef type_list<> type;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct take<0, type_list<>> {
|
||||
typedef type_list<> type;
|
||||
@@ -128,13 +138,12 @@ struct take<0, type_list<>> {
|
||||
template <typename T, int n, T a, T... as>
|
||||
struct take<n, numeric_list<T, a, as...>>
|
||||
: concat<numeric_list<T, a>, typename take<n - 1, numeric_list<T, as...>>::type> {};
|
||||
// XXX The following breaks in gcc-11, and is invalid anyways.
|
||||
// template<typename T, int n> struct take<n, numeric_list<T>> { typedef numeric_list<T> type;
|
||||
// };
|
||||
|
||||
template <typename T, T a, T... as>
|
||||
struct take<0, numeric_list<T, a, as...>> {
|
||||
typedef numeric_list<T> type;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct take<0, numeric_list<T>> {
|
||||
typedef numeric_list<T> type;
|
||||
@@ -173,7 +182,6 @@ template <>
|
||||
struct h_skip_helper_type<0> {
|
||||
typedef type_list<> type;
|
||||
};
|
||||
#endif // not EIGEN_PARSED_BY_DOXYGEN
|
||||
|
||||
template <int n>
|
||||
struct h_skip {
|
||||
|
||||
Reference in New Issue
Block a user