From 5f5e9331a8788455d290e3748559032f8484a20c Mon Sep 17 00:00:00 2001 From: JasonChmn <jason.chemin@hotmail.fr> Date: Thu, 18 Apr 2019 13:36:39 +0200 Subject: [PATCH] Modification in doc of files in curves folder --- include/curves/bezier_curve.h | 24 +++++++------ include/curves/curve_abc.h | 16 ++++----- include/curves/exact_cubic.h | 12 ++++--- include/curves/polynom.h | 63 ++++++++++++++++++----------------- 4 files changed, 63 insertions(+), 52 deletions(-) diff --git a/include/curves/bezier_curve.h b/include/curves/bezier_curve.h index 45f50d6..50d45bf 100644 --- a/include/curves/bezier_curve.h +++ b/include/curves/bezier_curve.h @@ -148,7 +148,7 @@ struct bezier_curve : public curve_abc<Time, Numeric, Dim, Safe, Point> public: /// \brief Evaluation of the bezier curve at time t. /// \param t : time when to evaluate the curve. - /// \return Point corresponding on curve at time t. + /// \return \f$x(t)\f$, point corresponding on curve at time t. virtual point_t operator()(const time_t t) const { if(Safe &! (0 <= t && t <= T_)) @@ -162,8 +162,8 @@ struct bezier_curve : public curve_abc<Time, Numeric, Dim, Safe, Point> /// \brief Compute the derivative curve at order N. /// Computes the derivative at order N, \f$\frac{d^Nx(t)}{dt^N}\f$ of bezier curve of parametric equation x(t). - /// \param order : order of the derivative. - /// \return Derivative \f$\frac{dx(t)}{dt}\f$. + /// \param order : order of derivative. + /// \return Derivative \f$\frac{d^Nx(t)}{dt^N}\f$. bezier_curve_t compute_derivate(const std::size_t order) const { if(order == 0) return *this; @@ -199,12 +199,12 @@ struct bezier_curve : public curve_abc<Time, Numeric, Dim, Safe, Point> return integ.compute_primitive(order-1); } - /// \brief Evaluate the derivative at order N of the curve. + /// \brief Evaluate the derivative of order N of curve at time t. /// If the derivative is to be evaluated several times, it is - /// rather recommended to compute the derivative curve using compute_derivate. - /// \param order : order of the derivative + /// rather recommended to compute derivative curve using compute_derivate. + /// \param order : order of derivative. /// \param t : time when to evaluate the curve. - /// \return Point corresponding on derivative curve at time t. + /// \return \f$\frac{d^Nx(t)}{dt^N}\f$, point corresponding on derivative curve of order N at time t. virtual point_t derivate(const time_t t, const std::size_t order) const { bezier_curve_t deriv =compute_derivate(order); @@ -215,7 +215,7 @@ struct bezier_curve : public curve_abc<Time, Numeric, Dim, Safe, Point> /// Warning: the horner scheme is about 100 times faster than this method. /// This method will probably be removed in the future. /// \param t : unNormalized time - /// \return Point corresponding on curve at time t. + /// \return \f$x(t)\f$, point corresponding on curve at time t. /// point_t evalBernstein(const Numeric t) const { @@ -230,7 +230,7 @@ struct bezier_curve : public curve_abc<Time, Numeric, Dim, Safe, Point> /// \brief Evaluate all Bernstein polynomes for a certain degree using horner's scheme. /// \param t : unNormalized time - /// \return Point corresponding on curve at time t. + /// \return \f$x(t)\f$, point corresponding on curve at time t. /// point_t evalHorner(const Numeric t) const { @@ -254,7 +254,7 @@ struct bezier_curve : public curve_abc<Time, Numeric, Dim, Safe, Point> /// \brief Evaluate the curve value at time t using deCasteljau algorithm. /// \param t : unNormalized time - /// \return Point corresponding on curve at time t. + /// \return \f$x(t)\f$, point corresponding on curve at time t. /// point_t evalDeCasteljau(const Numeric t) const { // normalize time : @@ -357,7 +357,11 @@ struct bezier_curve : public curve_abc<Time, Numeric, Dim, Safe, Point> /*Helpers*/ public: + /// \brief Get the minimum time for which the curve is defined + /// \return \f$t_{min}\f$, lower bound of time range. virtual time_t min() const{return 0.;} + /// \brief Get the maximum time for which the curve is defined. + /// \return \f$t_{max}\f$, upper bound of time range. virtual time_t max() const{return T_;} /*Helpers*/ diff --git a/include/curves/curve_abc.h b/include/curves/curve_abc.h index c0306e7..a36af6c 100644 --- a/include/curves/curve_abc.h +++ b/include/curves/curve_abc.h @@ -41,24 +41,24 @@ struct curve_abc : std::unary_function<Time, Point> public: /// \brief Evaluation of the cubic spline at time t. /// \param t : time when to evaluate the spine - /// \return Point corresponding on curve at time t. + /// \return \f$x(t)\f$, point corresponding on curve at time t. virtual point_t operator()(const time_t t) const = 0; - /// \brief Evaluation of the derivative spline at time t. + /// \brief Evaluate the derivative of order N of curve at time t. /// \param t : time when to evaluate the spline. - /// \param order : order of the derivative. - /// \return Point corresponding on curve at time t. + /// \param order : order of derivative. + /// \return \f$\frac{d^Nx(t)}{dt^N}\f$, point corresponding on derivative curve of order N at time t. virtual point_t derivate(const time_t t, const std::size_t order) const = 0; /*Operations*/ /*Helpers*/ public: - /// \brief Returns the minimum time for wich curve is defined - /// \return Lower bound of time range. + /// \brief Get the minimum time for which the curve is defined. + /// \return \f$t_{min}\f$, lower bound of time range. virtual time_t min() const = 0; - /// \brief Returns the maximum time for wich curve is defined - /// \return Upper bound of time range. + /// \brief Get the maximum time for which the curve is defined. + /// \return \f$t_{max}\f$, upper bound of time range. virtual time_t max() const = 0; std::pair<time_t, time_t> timeRange() {return std::make_pair(min(), max());} diff --git a/include/curves/exact_cubic.h b/include/curves/exact_cubic.h index 693109c..18fdefa 100644 --- a/include/curves/exact_cubic.h +++ b/include/curves/exact_cubic.h @@ -158,7 +158,7 @@ struct exact_cubic : public curve_abc<Time, Numeric, Dim, Safe, Point> public: /// \brief Evaluation of the cubic spline at time t. /// \param t : time when to evaluate the spline - /// \return Point corresponding on spline at time t. + /// \return \f$x(t)\f$, point corresponding on spline at time t. /// virtual point_t operator()(const time_t t) const { @@ -172,10 +172,10 @@ struct exact_cubic : public curve_abc<Time, Numeric, Dim, Safe, Point> throw std::runtime_error("Exact cubic evaluation failed; t is outside bounds"); } - /// \brief Evaluation of the derivative spline at time t. + /// \brief Evaluate the derivative of order N of spline at time t. /// \param t : time when to evaluate the spline. - /// \param order : order of the derivative. - /// \return Point corresponding on derivative spline at time t. + /// \param order : order of derivative. + /// \return \f$\frac{d^Nx(t)}{dt^N}\f$, point corresponding on derivative spline of order N at time t. /// virtual point_t derivate(const time_t t, const std::size_t order) const { @@ -192,7 +192,11 @@ struct exact_cubic : public curve_abc<Time, Numeric, Dim, Safe, Point> /*Helpers*/ public: + /// \brief Get the minimum time for which the curve is defined + /// \return \f$t_{min}\f$, lower bound of time range. num_t virtual min() const{return subSplines_.front().min();} + /// \brief Get the maximum time for which the curve is defined. + /// \return \f$t_{max}\f$, upper bound of time range. num_t virtual max() const{return subSplines_.back().max();} /*Helpers*/ diff --git a/include/curves/polynom.h b/include/curves/polynom.h index 2fd55ae..54cf5a4 100644 --- a/include/curves/polynom.h +++ b/include/curves/polynom.h @@ -25,10 +25,11 @@ namespace curves { -/// \class polynom -/// \brief Represents a polynomf arbitrary order defined on the interval -/// [tBegin, tEnd]. It follows the equation -/// x(t) = a + b(t - t_min_) + ... + d(t - t_min_)^N, where N is the order +/// \class polynom. +/// \brief Represents a polynom of an arbitrary order defined on the interval +/// \f$[t_{min}, t_{max}]\f$. It follows the equation : +/// \f$ x(t) = a + b(t - t_{min}) + ... + d(t - t_{min})^N \f$, +/// where N is the order and \f$ t \in [t_{min}, t_{max}] \f$. /// template<typename Time= double, typename Numeric=Time, std::size_t Dim=3, bool Safe=false, typename Point= Eigen::Matrix<Numeric, Dim, 1>, typename T_Point =std::vector<Point,Eigen::aligned_allocator<Point> > > @@ -44,12 +45,12 @@ struct polynom : public curve_abc<Time, Numeric, Dim, Safe, Point> /* Constructors - destructors */ public: - ///\brief Constructor - ///\param coefficients : a reference to an Eigen matrix where each column is a coefficient, + /// \brief Constructor. + /// \param coefficients : a reference to an Eigen matrix where each column is a coefficient, /// from the zero order coefficient, up to the highest order. Spline order is given /// by the number of the columns -1. - ///\param min: LOWER bound on interval definition of the spline - ///\param max: UPPER bound on interval definition of the spline + /// \param min: LOWER bound on interval definition of the curve. + /// \param max: UPPER bound on interval definition of the curve. polynom(const coeff_t& coefficients, const time_t min, const time_t max) : curve_abc_t(), coefficients_(coefficients), dim_(Dim), order_(coefficients_.cols()-1), t_min_(min), t_max_(max) @@ -57,12 +58,12 @@ struct polynom : public curve_abc<Time, Numeric, Dim, Safe, Point> safe_check(); } - ///\brief Constructor - ///\param coefficients : a container containing all coefficients of the spline, starting - /// with the zero order coefficient, up to the highest order. Spline order is given - /// by the size of the coefficients - ///\param min: LOWER bound on interval definition of the spline - ///\param max: UPPER bound on interval definition of the spline + /// \brief Constructor + /// \param coefficients : a container containing all coefficients of the spline, starting + /// with the zero order coefficient, up to the highest order. Spline order is given + /// by the size of the coefficients. + /// \param min: LOWER bound on interval definition of the spline. + /// \param max: UPPER bound on interval definition of the spline. polynom(const T_Point& coefficients, const time_t min, const time_t max) : curve_abc_t(), coefficients_(init_coeffs(coefficients.begin(), coefficients.end())), @@ -71,12 +72,12 @@ struct polynom : public curve_abc<Time, Numeric, Dim, Safe, Point> safe_check(); } - ///\brief Constructor - ///\param zeroOrderCoefficient : an iterator pointing to the first element of a structure containing the coefficients - /// it corresponds to the zero degree coefficient - ///\param out : an iterator pointing to the last element of a structure ofcoefficients - ///\param min: LOWER bound on interval definition of the spline - ///\param max: UPPER bound on interval definition of the spline + /// \brief Constructor. + /// \param zeroOrderCoefficient : an iterator pointing to the first element of a structure containing the coefficients + /// it corresponds to the zero degree coefficient. + /// \param out : an iterator pointing to the last element of a structure ofcoefficients. + /// \param min : LOWER bound on interval definition of the spline. + /// \param max : UPPER bound on interval definition of the spline. template<typename In> polynom(In zeroOrderCoefficient, In out, const time_t min, const time_t max) :coefficients_(init_coeffs(zeroOrderCoefficient, out)), @@ -85,7 +86,7 @@ struct polynom : public curve_abc<Time, Numeric, Dim, Safe, Point> safe_check(); } - ///\brief Destructor + /// \brief Destructor ~polynom() { // NOTHING @@ -117,7 +118,7 @@ struct polynom : public curve_abc<Time, Numeric, Dim, Safe, Point> public: /*/// \brief Evaluation of the cubic spline at time t. /// \param t : the time when to evaluate the spine - /// \param return : the value x(t) + /// \param return \f$x(t)\f$, point corresponding on curve at time t. virtual point_t operator()(const time_t t) const { if((t < t_min_ || t > t_max_) && Safe){ throw std::out_of_range("TODO");} @@ -131,8 +132,8 @@ struct polynom : public curve_abc<Time, Numeric, Dim, Safe, Point> /// \brief Evaluation of the cubic spline at time t using horner's scheme. - /// \param t : the time when to evaluate the spine - /// \param return : the value x(t) + /// \param t : time when to evaluate the spline. + /// \return \f$x(t)\f$, point corresponding on spline at time t. virtual point_t operator()(const time_t t) const { if((t < t_min_ || t > t_max_) && Safe){ throw std::out_of_range("TODO");} @@ -144,10 +145,10 @@ struct polynom : public curve_abc<Time, Numeric, Dim, Safe, Point> } - /// \brief Evaluation of the derivative spline at time t. - /// \param t : the time when to evaluate the spline - /// \param order : order of the derivative - /// \param return : the value x(t) + /// \brief Evaluation of the derivative of order N of spline at time t. + /// \param t : the time when to evaluate the spline. + /// \param order : order of derivative. + /// \return \f$\frac{d^Nx(t)}{dt^N}\f$, point corresponding on derivative spline at time t. virtual point_t derivate(const time_t t, const std::size_t order) const { if((t < t_min_ || t > t_max_) && Safe){ throw std::out_of_range("TODO");} @@ -172,9 +173,11 @@ struct polynom : public curve_abc<Time, Numeric, Dim, Safe, Point> /*Helpers*/ public: - /// \brief Returns the minimum time for wich curve is defined + /// \brief Get the minimum time for which the curve is defined + /// \return \f$t_{min}\f$, lower bound of time range. num_t virtual min() const {return t_min_;} - /// \brief Returns the maximum time for wich curve is defined + /// \brief Get the maximum time for which the curve is defined. + /// \return \f$t_{max}\f$, upper bound of time range. num_t virtual max() const {return t_max_;} /*Helpers*/ -- GitLab