Move variadic constructors outside #ifndef EIGEN_PARSED_BY_DOXYGEN block, to make it actually appear in the generated documentation.

This commit is contained in:
Christoph Hertzberg 2019-07-12 19:46:37 +02:00
parent 9237883ff1
commit ea6d7eb32f
3 changed files with 47 additions and 46 deletions

View File

@ -162,23 +162,6 @@ class Array
} }
#endif #endif
#ifndef EIGEN_PARSED_BY_DOXYGEN
template<typename T>
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE explicit Array(const T& x)
{
Base::_check_template_params();
Base::template _init1<T>(x);
}
template<typename T0, typename T1>
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE Array(const T0& val0, const T1& val1)
{
Base::_check_template_params();
this->template _init2<T0,T1>(val0, val1);
}
#if EIGEN_HAS_CXX11 #if EIGEN_HAS_CXX11
/** \copydoc PlainObjectBase(const Scalar& a0, const Scalar& a1, const Scalar& a2, const Scalar& a3, const ArgTypes&... args) /** \copydoc PlainObjectBase(const Scalar& a0, const Scalar& a1, const Scalar& a2, const Scalar& a3, const ArgTypes&... args)
* *
@ -186,7 +169,7 @@ class Array
* Output: \verbinclude Array_variadic_ctor_cxx11.out * Output: \verbinclude Array_variadic_ctor_cxx11.out
* *
* \sa Array(const std::initializer_list<std::initializer_list<Scalar>>&) * \sa Array(const std::initializer_list<std::initializer_list<Scalar>>&)
* \sa Array(Scalar), Array(Scalar,Scalar) * \sa Array(const Scalar&), Array(const Scalar&,const Scalar&)
*/ */
template <typename... ArgTypes> template <typename... ArgTypes>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
@ -212,12 +195,29 @@ class Array
* In the case of fixed-sized arrays, the initializer list sizes must exactly match the array sizes, * In the case of fixed-sized arrays, the initializer list sizes must exactly match the array sizes,
* and implicit transposition is allowed for compile-time 1D arrays only. * and implicit transposition is allowed for compile-time 1D arrays only.
* *
* \sa Array(const Scalar& a0, const Scalar& a1, const Scalar& a2, const Scalar& a3, const ArgTypes&... args) * \sa Array(const Scalar& a0, const Scalar& a1, const Scalar& a2, const Scalar& a3, const ArgTypes&... args)
*/ */
EIGEN_DEVICE_FUNC EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE Array(const std::initializer_list<std::initializer_list<Scalar> >& list) : Base(list) {} EIGEN_STRONG_INLINE Array(const std::initializer_list<std::initializer_list<Scalar>>& list) : Base(list) {}
#endif // end EIGEN_HAS_CXX11 #endif // end EIGEN_HAS_CXX11
#ifndef EIGEN_PARSED_BY_DOXYGEN
template<typename T>
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE explicit Array(const T& x)
{
Base::_check_template_params();
Base::template _init1<T>(x);
}
template<typename T0, typename T1>
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE Array(const T0& val0, const T1& val1)
{
Base::_check_template_params();
this->template _init2<T0,T1>(val0, val1);
}
#else #else
/** \brief Constructs a fixed-sized array initialized with coefficients starting at \a data */ /** \brief Constructs a fixed-sized array initialized with coefficients starting at \a data */
EIGEN_DEVICE_FUNC explicit Array(const Scalar *data); EIGEN_DEVICE_FUNC explicit Array(const Scalar *data);

View File

@ -283,27 +283,8 @@ class Matrix
} }
#endif #endif
#ifndef EIGEN_PARSED_BY_DOXYGEN #if EIGEN_HAS_CXX11
/** \copydoc PlainObjectBase(const Scalar&, const Scalar&, const Scalar&, const Scalar&, const ArgTypes&... args)
// This constructor is for both 1x1 matrices and dynamic vectors
template<typename T>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
explicit Matrix(const T& x)
{
Base::_check_template_params();
Base::template _init1<T>(x);
}
template<typename T0, typename T1>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
Matrix(const T0& x, const T1& y)
{
Base::_check_template_params();
Base::template _init2<T0,T1>(x, y);
}
#if EIGEN_HAS_CXX11
/** \copydoc PlainObjectBase(const Scalar&, const Scalar&, const Scalar&, const Scalar&, const ArgTypes&...)
* *
* Example: \include Matrix_variadic_ctor_cxx11.cpp * Example: \include Matrix_variadic_ctor_cxx11.cpp
* Output: \verbinclude Matrix_variadic_ctor_cxx11.out * Output: \verbinclude Matrix_variadic_ctor_cxx11.out
@ -334,13 +315,33 @@ class Matrix
* In the case of fixed-sized matrices, the initializer list sizes must exactly match the matrix sizes, * In the case of fixed-sized matrices, the initializer list sizes must exactly match the matrix sizes,
* and implicit transposition is allowed for compile-time vectors only. * and implicit transposition is allowed for compile-time vectors only.
* *
* \sa Matrix(const Scalar&, const Scalar&, const Scalar&, const Scalar&, const ArgTypes&...) * \sa {@ref Matrix(const Scalar& a0, const Scalar& a1, const Scalar& a2, const Scalar& a3, const ArgTypes&... args)}
*/ */
EIGEN_DEVICE_FUNC EIGEN_DEVICE_FUNC
explicit EIGEN_STRONG_INLINE Matrix(const std::initializer_list<std::initializer_list<Scalar>>& list) : Base(list) {} explicit EIGEN_STRONG_INLINE Matrix(const std::initializer_list<std::initializer_list<Scalar>>& list) : Base(list) {}
#endif // end EIGEN_HAS_CXX11 #endif // end EIGEN_HAS_CXX11
#else #ifndef EIGEN_PARSED_BY_DOXYGEN
// This constructor is for both 1x1 matrices and dynamic vectors
template<typename T>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
explicit Matrix(const T& x)
{
Base::_check_template_params();
Base::template _init1<T>(x);
}
template<typename T0, typename T1>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
Matrix(const T0& x, const T1& y)
{
Base::_check_template_params();
Base::template _init2<T0,T1>(x, y);
}
#else
/** \brief Constructs a fixed-sized matrix initialized with coefficients starting at \a data */ /** \brief Constructs a fixed-sized matrix initialized with coefficients starting at \a data */
EIGEN_DEVICE_FUNC EIGEN_DEVICE_FUNC
explicit Matrix(const Scalar *data); explicit Matrix(const Scalar *data);

View File

@ -532,7 +532,7 @@ class PlainObjectBase : public internal::dense_xpr_base<Derived>::type
* \only_for_vectors * \only_for_vectors
* *
* This constructor is for 1D array or vectors with more than 4 coefficients. * This constructor is for 1D array or vectors with more than 4 coefficients.
* There exists C++98 anologue constructors for fixed-size array/vector having 1, 2, 3, or 4 coefficients. * There exists C++98 analogue constructors for fixed-size array/vector having 1, 2, 3, or 4 coefficients.
* *
* \warning To construct a column (resp. row) vector of fixed length, the number of values passed to this * \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. * constructor must match the the fixed number of rows (resp. columns) of \c *this.