Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generalize usage of VP_OVERRIDE #1600

Merged
merged 1 commit into from
Feb 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/tutorial/misc/tutorial-pf.dox
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ we have:
w_i = l(\textbf{x}_i, \textbf{z})
\f]

After an update, a check is performed to see if the PF is not degenerated (i.e. if the weigths of most particles became very low).
After an update, a check is performed to see if the PF is not degenerated (i.e. if the weights of most particles became very low).
If the PF became degenerated, the particles are resampled depending on a resampling scheme. Different kind of checks
and of resampling algorithms exist in the litterature.

Expand Down
2 changes: 1 addition & 1 deletion modules/core/include/visp3/core/vpParticleFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ BEGIN_VISP_NAMESPACE
w_i = l(\textbf{x}_i, \textbf{z})
\f]

After an update, a check is performed to see if the PF is not degenerated (i.e. if the weigths of most particles became very low).
After an update, a check is performed to see if the PF is not degenerated (i.e. if the weights of most particles became very low).
If the PF became degenerated, the particles are resampled depending on a resampling scheme. Different kind of checks
and of resampling algorithms exist in the litterature. In this class, we implemented the Simple Resampling algorithm
in a dedicated method and let to the user the possibility of writing user-defined check and resampling methods.
Expand Down
24 changes: 4 additions & 20 deletions modules/core/include/visp3/core/vpStatisticalTestEWMA.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,7 @@ class VISP_EXPORT vpStatisticalTestEWMA : public vpStatisticalTestAbstract
*
* \sa detectUpwardMeanDrift()
*/
#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
virtual vpMeanDriftType detectDownwardMeanDrift() override;
#else
virtual vpMeanDriftType detectDownwardMeanDrift();
#endif
virtual vpMeanDriftType detectDownwardMeanDrift() VP_OVERRIDE;

/**
* \brief Detects if an upward mean drift occurred on the mean.
Expand All @@ -100,34 +96,22 @@ class VISP_EXPORT vpStatisticalTestEWMA : public vpStatisticalTestAbstract
*
* \sa detectDownwardMeanDrift()
*/
#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
virtual vpMeanDriftType detectUpwardMeanDrift() override;
#else
virtual vpMeanDriftType detectUpwardMeanDrift();
#endif
virtual vpMeanDriftType detectUpwardMeanDrift() VP_OVERRIDE;

/**
* \brief Update m_s and if enough values are available, compute the mean, the standard
* deviation and the limits.
*
* \param[in] signal The new value of the signal to monitor.
*/
#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
virtual bool updateStatistics(const float &signal) override;
#else
virtual bool updateStatistics(const float &signal);
#endif
virtual bool updateStatistics(const float &signal) VP_OVERRIDE;

/**
* \brief Update the test signals.
*
* \param[in] signal The new value of the signal to monitor.
*/
#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
virtual void updateTestSignals(const float &signal) override;
#else
virtual void updateTestSignals(const float &signal);
#endif
virtual void updateTestSignals(const float &signal) VP_OVERRIDE;

public:
/**
Expand Down
35 changes: 10 additions & 25 deletions modules/core/include/visp3/core/vpStatisticalTestHinkley.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,7 @@ class VISP_EXPORT vpStatisticalTestHinkley : public vpStatisticalTestAbstract
*
* \return \b vpMeanDriftType::MEAN_DRIFT_DOWNWARD if a downward mean drift occurred, \b vpMeanDriftType::MEAN_DRIFT_NONE otherwise.
*/
#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
virtual vpMeanDriftType detectDownwardMeanDrift() override;
#else
virtual vpMeanDriftType detectDownwardMeanDrift();
#endif
virtual vpMeanDriftType detectDownwardMeanDrift() VP_OVERRIDE;

/**
* \brief Detects if an upward mean drift occurred on the mean.
Expand All @@ -154,34 +150,23 @@ class VISP_EXPORT vpStatisticalTestHinkley : public vpStatisticalTestAbstract
*
* \sa detectDownwardMeanDrift()
*/
#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
virtual vpMeanDriftType detectUpwardMeanDrift() override;
#else
virtual vpMeanDriftType detectUpwardMeanDrift();
#endif
virtual vpMeanDriftType detectUpwardMeanDrift() VP_OVERRIDE;

/**
* \brief Update m_s and if enough values are available, compute the mean, the standard
* deviation and the limits.
*
* \param[in] signal The new value of the signal to monitor.
*/
#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
virtual bool updateStatistics(const float &signal) override;
#else
virtual bool updateStatistics(const float &signal);
#endif
virtual bool updateStatistics(const float &signal) VP_OVERRIDE;

/**
* \brief Update the test signals.
*
* \param[in] signal The new value of the signal to monitor.
*/
virtual void updateTestSignals(const float &signal) VP_OVERRIDE;

/**
* \brief Update the test signals.
*
* \param[in] signal The new value of the signal to monitor.
*/
#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
virtual void updateTestSignals(const float &signal) override;
#else
virtual void updateTestSignals(const float &signal);
#endif
public:
/**
* @brief Construct a new vpStatisticalTestHinkley object.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,45 +101,30 @@ class VISP_EXPORT vpStatisticalTestMeanAdjustedCUSUM : public vpStatisticalTestA
*
* \sa detectUpwardMeanDrift()
*/
#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
virtual vpMeanDriftType detectDownwardMeanDrift() override;
#else
virtual vpMeanDriftType detectDownwardMeanDrift();
#endif
virtual vpMeanDriftType detectDownwardMeanDrift() VP_OVERRIDE;

/**
* \brief Detects if a upward jump occurred on the mean.
*
* \return upwardJump if a upward jump occurred, noJump otherwise.
*/
#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
virtual vpMeanDriftType detectUpwardMeanDrift() override;
#else
virtual vpMeanDriftType detectUpwardMeanDrift();
#endif
virtual vpMeanDriftType detectUpwardMeanDrift() VP_OVERRIDE;

/**
* \brief Update m_s and if enough values are available, compute the mean, the standard
* deviation and the limits.
*
* \param[in] signal The new value of the signal to monitor.
*/
#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
virtual bool updateStatistics(const float &signal) override;
#else
virtual bool updateStatistics(const float &signal);
#endif
virtual bool updateStatistics(const float &signal) VP_OVERRIDE;

/**
* \brief Update the test signals.
*
* \param[in] signal The new value of the signal to monitor.
*/
#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
virtual void updateTestSignals(const float &signal) override;
#else
virtual void updateTestSignals(const float &signal);
#endif
virtual void updateTestSignals(const float &signal) VP_OVERRIDE;

public:
/**
* \brief Construct a new vpStatisticalTestMeanAdjustedCUSUM object.
Expand Down
31 changes: 5 additions & 26 deletions modules/core/include/visp3/core/vpStatisticalTestShewhart.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,7 @@ class VISP_EXPORT vpStatisticalTestShewhart : public vpStatisticalTestSigma
/**
* \brief Compute the upper and lower limits of the test signal.
*/
#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
virtual void computeLimits() override;
#else
virtual void computeLimits();
#endif
virtual void computeLimits() VP_OVERRIDE;

/**
* \brief Detects if a downward mean drift occurred.
Expand All @@ -124,47 +120,30 @@ class VISP_EXPORT vpStatisticalTestShewhart : public vpStatisticalTestSigma
*
* \sa detectUpwardMeanDrift()
*/
#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
virtual vpMeanDriftType detectDownwardMeanDrift() override;
#else
virtual vpMeanDriftType detectDownwardMeanDrift();
#endif

virtual vpMeanDriftType detectDownwardMeanDrift() VP_OVERRIDE;
/**
* \brief Detects if an upward mean drift occurred on the mean.
*
* \return \b vpMeanDriftType::MEAN_DRIFT_UPWARD if an upward mean drift occurred, \b vpMeanDriftType::MEAN_DRIFT_NONE otherwise.
*
* \sa detectDownwardMeanDrift()
*/
#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
virtual vpMeanDriftType detectUpwardMeanDrift() override;
#else
virtual vpMeanDriftType detectUpwardMeanDrift();
#endif
virtual vpMeanDriftType detectUpwardMeanDrift() VP_OVERRIDE;

/**
* \brief Update m_s and if enough values are available, compute the mean, the standard
* deviation and the limits.
*
* \param[in] signal The new value of the signal to monitor.
*/
#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
virtual bool updateStatistics(const float &signal) override;
#else
virtual bool updateStatistics(const float &signal);
#endif
virtual bool updateStatistics(const float &signal) VP_OVERRIDE;

/**
* \brief Update the test signals.
*
* \param[in] signal The new value of the signal to monitor.
*/
#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
virtual void updateTestSignals(const float &signal) override;
#else
virtual void updateTestSignals(const float &signal);
#endif
virtual void updateTestSignals(const float &signal) VP_OVERRIDE;
public:
/**
* \brief Construct a new vpStatisticalTestShewhart object.
Expand Down
25 changes: 5 additions & 20 deletions modules/core/include/visp3/core/vpStatisticalTestSigma.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,7 @@ class VISP_EXPORT vpStatisticalTestSigma : public vpStatisticalTestAbstract
*
* \sa detectUpwardMeanDrift()
*/
#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
virtual vpMeanDriftType detectDownwardMeanDrift() override;
#else
virtual vpMeanDriftType detectDownwardMeanDrift();
#endif
virtual vpMeanDriftType detectDownwardMeanDrift() VP_OVERRIDE;

/**
* \brief Detects if an upward mean drift occurred on the mean.
Expand All @@ -97,34 +93,23 @@ class VISP_EXPORT vpStatisticalTestSigma : public vpStatisticalTestAbstract
*
* \sa detectDownwardMeanDrift()
*/
#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
virtual vpMeanDriftType detectUpwardMeanDrift() override;
#else
virtual vpMeanDriftType detectUpwardMeanDrift();
#endif
virtual vpMeanDriftType detectUpwardMeanDrift() VP_OVERRIDE;

/**
* \brief Update m_s and if enough values are available, compute the mean, the standard
* deviation and the limits.
*
* \param[in] signal The new value of the signal to monitor.
*/
#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
virtual bool updateStatistics(const float &signal) override;
#else
virtual bool updateStatistics(const float &signal);
#endif
virtual bool updateStatistics(const float &signal) VP_OVERRIDE;

/**
* \brief Update the test signals.
*
* \param[in] signal The new value of the signal to monitor.
*/
#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
virtual void updateTestSignals(const float &signal) override;
#else
virtual void updateTestSignals(const float &signal);
#endif
virtual void updateTestSignals(const float &signal) VP_OVERRIDE;

public:
/**
* \brief Construct a new vpStatisticalTestSigma object.
Expand Down
2 changes: 1 addition & 1 deletion modules/core/include/visp3/core/vpUKSigmaDrawerAbstract.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class VISP_EXPORT vpUKSigmaDrawerAbstract
virtual std::vector<vpColVector> drawSigmaPoints(const vpColVector &mean, const vpMatrix &covariance) = 0;

/**
* \brief Computed the weigths that correspond to the sigma poitns that have been drawn.
* \brief Computed the weights that correspond to the sigma points that have been drawn.
*
* \return vpSigmaPointsWeights The weights that correspond to the sigma points.
*/
Expand Down
6 changes: 3 additions & 3 deletions modules/core/include/visp3/core/vpUKSigmaDrawerMerwe.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,14 @@ class VISP_EXPORT vpUKSigmaDrawerMerwe : public vpUKSigmaDrawerAbstract
* \param[in] covariance The current process covariance of the UKF.
* @return std::vector<vpColVector> The sigma points.
*/
virtual std::vector<vpColVector> drawSigmaPoints(const vpColVector &mean, const vpMatrix &covariance) override;
virtual std::vector<vpColVector> drawSigmaPoints(const vpColVector &mean, const vpMatrix &covariance) VP_OVERRIDE;

/**
* \brief Computed the weigths that correspond to the sigma poitns that have been drawn.
* \brief Computed the weights that correspond to the sigma points that have been drawn.
*
* \return vpSigmaPointsWeights The weights that correspond to the sigma points.
*/
virtual vpSigmaPointsWeights computeWeights() override;
virtual vpSigmaPointsWeights computeWeights() VP_OVERRIDE;
protected:
inline void computeLambda()
{
Expand Down
2 changes: 1 addition & 1 deletion modules/core/src/math/matrix/vpMatrix_covariance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ vpMatrix vpMatrix::computeCovarianceMatrix(const vpMatrix &A, const vpColVector

\param b : Vector b from WAx = Wb.

\param W : Diagonal weigths matrix from WAx = Wb.
\param W : Diagonal weights matrix from WAx = Wb.
*/
vpMatrix vpMatrix::computeCovarianceMatrix(const vpMatrix &A, const vpColVector &x, const vpColVector &b,
const vpMatrix &W)
Expand Down
4 changes: 2 additions & 2 deletions modules/gui/src/pointcloud/vpPclViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,14 +253,14 @@ unsigned int vpPclViewer::addSurface(const pclPointCloudPointXYZRGB::Ptr &surfac

// Storing the weights attached to the surface
m_vweights.push_back(weights);
bool use_weigths = weights.size() > 0;
bool use_weights = weights.size() > 0;

// Copying the coordinates of each point of the original pcl,
// while affecting them the default color.
// Points that have a weight below \b s_ignoreThresh are ignored
for (unsigned int index = 0; index < nbPoints; index++) {
bool shouldPointBeVisible = false;
if (use_weigths) {
if (use_weights) {
// If weights are defined, the point should be visible only
// if the weight is greater than the ignore threshold.
shouldPointBeVisible = weights[index] > s_ignoreThresh;
Expand Down
2 changes: 1 addition & 1 deletion modules/tracker/me/src/moving-edges/vpNurbs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ void vpNurbs::globalCurveApprox(std::vector<vpImagePoint> &l_crossingPoints, uns
Rj[i] = sum;
sum = 0;
for (unsigned int k = 0; k < m - 1; k++)
sum = sum + A[k][i]; // The crossing points weigths are equal to 1.
sum = sum + A[k][i]; // The crossing points weights are equal to 1.
Rw[i] = sum;
}

Expand Down
Loading