diff --git a/lib/include/openturns/OTdebug.h b/lib/include/openturns/OTdebug.h index 2aacaaaf82..b1b647d601 100644 --- a/lib/include/openturns/OTdebug.h +++ b/lib/include/openturns/OTdebug.h @@ -39,20 +39,23 @@ # ifdef __GNUC__ # ifdef SWIG -# define DEPRECATED -# define UNUSED -# define NOTHROW +# define OT_DEPRECATED +# define OT_UNUSED +# define OT_NOTHROW +# define OT_WARN_UNUSED # else /* not SWIG */ -# define DEPRECATED __attribute__ ((deprecated)) -# define UNUSED __attribute__ ((unused)) -# define NOTHROW __attribute__ ((nothrow)) +# define OT_DEPRECATED __attribute__ ((deprecated)) +# define OT_UNUSED __attribute__ ((unused)) +# define OT_NOTHROW __attribute__ ((nothrow)) +# define OT_WARN_UNUSED __attribute__ ((warn_unused)) # endif /* SWIG */ # else /* not __GNUC_ */ -# define DEPRECATED -# define UNUSED -# define NOTHROW +# define OT_DEPRECATED +# define OT_UNUSED +# define OT_NOTHROW +# define OT_WARN_UNUSED # endif /* __GNUC_ */ diff --git a/lib/src/Base/Algo/CorrectedLeaveOneOut.cxx b/lib/src/Base/Algo/CorrectedLeaveOneOut.cxx index 4f69c09df7..a064791861 100644 --- a/lib/src/Base/Algo/CorrectedLeaveOneOut.cxx +++ b/lib/src/Base/Algo/CorrectedLeaveOneOut.cxx @@ -68,11 +68,8 @@ Scalar CorrectedLeaveOneOut::run(const Sample & y, return FittingAlgorithmImplementation::run(y, weight, indices, proxy); } -Scalar CorrectedLeaveOneOut::run(LeastSquaresMethod & method, - const Sample & y) const +Scalar CorrectedLeaveOneOut::run(LeastSquaresMethod & method, const Sample & y) const { - const Sample x(method.getInputSample()); - const UnsignedInteger sampleSize = y.getSize(); if (y.getDimension() != 1) throw InvalidArgumentException(HERE) << "Output sample should be unidimensional (dim=" << y.getDimension() << ")."; diff --git a/lib/src/Base/Algo/KFold.cxx b/lib/src/Base/Algo/KFold.cxx index 0cda12f16b..8b2100d459 100644 --- a/lib/src/Base/Algo/KFold.cxx +++ b/lib/src/Base/Algo/KFold.cxx @@ -71,12 +71,9 @@ Scalar KFold::run(const Sample & y, return FittingAlgorithmImplementation::run(y, weight, indices, proxy); } -Scalar KFold::run(LeastSquaresMethod & method, - const Sample & y) const +Scalar KFold::run(LeastSquaresMethod & method, const Sample & y) const { const Sample x(method.getInputSample()); - const FunctionCollection basis(method.getBasis()); - const UnsignedInteger sampleSize = x.getSize(); const Scalar variance = y.computeVariance()[0]; diff --git a/lib/src/Base/Common/openturns/ComparisonOperator.hxx b/lib/src/Base/Common/openturns/ComparisonOperator.hxx index e317765922..680c396a0d 100644 --- a/lib/src/Base/Common/openturns/ComparisonOperator.hxx +++ b/lib/src/Base/Common/openturns/ComparisonOperator.hxx @@ -34,7 +34,7 @@ BEGIN_NAMESPACE_OPENTURNS * The implementation defined what comparison is actually performed. * @see ComparisonOperatorImplementation */ -class OT_API ComparisonOperator +class OT_API OT_WARN_UNUSED ComparisonOperator : public TypedInterfaceObject { CLASSNAME diff --git a/lib/src/Base/Func/openturns/Function.hxx b/lib/src/Base/Func/openturns/Function.hxx index c6b8ec8b78..8f3c0e6f53 100644 --- a/lib/src/Base/Func/openturns/Function.hxx +++ b/lib/src/Base/Func/openturns/Function.hxx @@ -40,7 +40,7 @@ BEGIN_NAMESPACE_OPENTURNS * the function, the gradient or the hessian. * @see FunctionImplementation */ -class OT_API Function +class OT_API OT_WARN_UNUSED Function : public TypedInterfaceObject { CLASSNAME diff --git a/lib/src/Base/Geom/openturns/Domain.hxx b/lib/src/Base/Geom/openturns/Domain.hxx index b10c1de9fc..00dd005eef 100644 --- a/lib/src/Base/Geom/openturns/Domain.hxx +++ b/lib/src/Base/Geom/openturns/Domain.hxx @@ -32,7 +32,7 @@ BEGIN_NAMESPACE_OPENTURNS * * A class that holds a domain */ -class OT_API Domain +class OT_API OT_WARN_UNUSED Domain : public TypedInterfaceObject { CLASSNAME diff --git a/lib/src/Base/Geom/openturns/Interval.hxx b/lib/src/Base/Geom/openturns/Interval.hxx index 1031beca39..6122ab4433 100644 --- a/lib/src/Base/Geom/openturns/Interval.hxx +++ b/lib/src/Base/Geom/openturns/Interval.hxx @@ -34,7 +34,7 @@ BEGIN_NAMESPACE_OPENTURNS * * A class that holds a collection of interval */ -class OT_API Interval +class OT_API OT_WARN_UNUSED Interval : public DomainImplementation { CLASSNAME diff --git a/lib/src/Base/Geom/openturns/Mesh.hxx b/lib/src/Base/Geom/openturns/Mesh.hxx index e1c51b2fb6..48196ac723 100644 --- a/lib/src/Base/Geom/openturns/Mesh.hxx +++ b/lib/src/Base/Geom/openturns/Mesh.hxx @@ -38,7 +38,7 @@ BEGIN_NAMESPACE_OPENTURNS * * A class that holds a mesh */ -class OT_API Mesh +class OT_API OT_WARN_UNUSED Mesh : public PersistentObject { CLASSNAME diff --git a/lib/src/Base/Geom/openturns/RegularGrid.hxx b/lib/src/Base/Geom/openturns/RegularGrid.hxx index 6392afe807..0471465063 100644 --- a/lib/src/Base/Geom/openturns/RegularGrid.hxx +++ b/lib/src/Base/Geom/openturns/RegularGrid.hxx @@ -37,7 +37,7 @@ BEGIN_NAMESPACE_OPENTURNS * end time = start time + ( timeStep * steps ) */ -class OT_API RegularGrid +class OT_API OT_WARN_UNUSED RegularGrid : public Mesh { CLASSNAME diff --git a/lib/src/Base/Graph/openturns/Drawable.hxx b/lib/src/Base/Graph/openturns/Drawable.hxx index 26e8ba8597..6a2f89d52a 100644 --- a/lib/src/Base/Graph/openturns/Drawable.hxx +++ b/lib/src/Base/Graph/openturns/Drawable.hxx @@ -31,7 +31,7 @@ BEGIN_NAMESPACE_OPENTURNS * Drawable is an interface to implement graphics */ -class OT_API Drawable : +class OT_API OT_WARN_UNUSED Drawable : public TypedInterfaceObject { CLASSNAME diff --git a/lib/src/Base/Graph/openturns/Graph.hxx b/lib/src/Base/Graph/openturns/Graph.hxx index d6cdb1e4a9..a81b952c06 100644 --- a/lib/src/Base/Graph/openturns/Graph.hxx +++ b/lib/src/Base/Graph/openturns/Graph.hxx @@ -35,7 +35,7 @@ BEGIN_NAMESPACE_OPENTURNS * and manages drawables to be plotted on the same window */ -class OT_API Graph : +class OT_API OT_WARN_UNUSED Graph : public TypedInterfaceObject { diff --git a/lib/src/Base/IterativeStat/IterativeMoments.cxx b/lib/src/Base/IterativeStat/IterativeMoments.cxx index 5a4e2cccdb..d772dad298 100644 --- a/lib/src/Base/IterativeStat/IterativeMoments.cxx +++ b/lib/src/Base/IterativeStat/IterativeMoments.cxx @@ -141,7 +141,6 @@ Point IterativeMoments::getKurtosis() const Point result(dimension_); const Point varianceEstimator(getVariance()); - const Point skewnessEstimator(getSkewness()); const UnsignedInteger n = iteration_; const Scalar factor1 = n * (n + 1.0) / ((n - 1.0) * (n - 2.0) * (n - 3.0)); diff --git a/lib/src/Base/Optim/BonminProblem.cxx b/lib/src/Base/Optim/BonminProblem.cxx index 19b5ac1082..646aa77b5f 100644 --- a/lib/src/Base/Optim/BonminProblem.cxx +++ b/lib/src/Base/Optim/BonminProblem.cxx @@ -92,11 +92,8 @@ bool BonminProblem::get_nlp_info(int & n, return true; } -bool BonminProblem::get_variables_types( int n, - VariableTypeTable var_types) +bool BonminProblem::get_variables_types(int n, VariableTypeTable var_types) { - Indices variablesTypes(optimProblem_.getVariablesType()); - // Conversion from OptimizationProblemImplementation::VariableType to TMINLP::VariableType for (int i = 0; i < n; ++i) { diff --git a/lib/src/Base/Optim/Pagmo.cxx b/lib/src/Base/Optim/Pagmo.cxx index 957880347d..1ef9a2a99d 100644 --- a/lib/src/Base/Optim/Pagmo.cxx +++ b/lib/src/Base/Optim/Pagmo.cxx @@ -75,7 +75,6 @@ struct PagmoProblem // pagmo wants the integer components grouped at the end, so renumbering is in order Indices renum; - Indices renum_inv; const Indices types(algorithm_->getProblem().getVariablesType()); for (UnsignedInteger i = 0; i < types.getSize(); ++ i) if (types[i] == OptimizationProblemImplementation::CONTINUOUS) diff --git a/lib/src/Base/Stat/DiracCovarianceModel.cxx b/lib/src/Base/Stat/DiracCovarianceModel.cxx index 8efa5c01a9..c09c0fefac 100644 --- a/lib/src/Base/Stat/DiracCovarianceModel.cxx +++ b/lib/src/Base/Stat/DiracCovarianceModel.cxx @@ -110,7 +110,6 @@ DiracCovarianceModel::DiracCovarianceModel(const UnsignedInteger inputDimension, amplitude_[i] = sqrt(covariance(i, i)); if (!covariance.isDiagonal()) { - CorrelationMatrix correlation(outputDimension_); for(UnsignedInteger j = 0; j < outputDimension_; ++j) for(UnsignedInteger i = j; i < outputDimension_; ++i) outputCorrelation_(i, j) = covariance(i, j) / (amplitude_[i] * amplitude_[j]); diff --git a/lib/src/Base/Stat/TensorizedCovarianceModel.cxx b/lib/src/Base/Stat/TensorizedCovarianceModel.cxx index be45763e3a..0ee9b35b2c 100644 --- a/lib/src/Base/Stat/TensorizedCovarianceModel.cxx +++ b/lib/src/Base/Stat/TensorizedCovarianceModel.cxx @@ -76,7 +76,6 @@ void TensorizedCovarianceModel::setCollection(const CovarianceModelCollection & // Check if the given models have the same input dimension const UnsignedInteger size = collection.getSize(); if (!(size > 0)) throw InvalidArgumentException(HERE) << "TensorizedCovarianceModel::setCollection: the collection must have a positive size, here size=0"; - Point amplitude(0); inputDimension_ = collection[0].getInputDimension(); // Get dimension: should be the same for all elements // Since 1.17, collection should be a list of 1d output models diff --git a/lib/src/Base/Stat/TimeSeries.cxx b/lib/src/Base/Stat/TimeSeries.cxx index 37184c8433..98917f95ef 100644 --- a/lib/src/Base/Stat/TimeSeries.cxx +++ b/lib/src/Base/Stat/TimeSeries.cxx @@ -159,8 +159,8 @@ TimeSeries & TimeSeries::add(const Sample & sample) /* Append another time series to the collection. The time grids must match (one follows the other) */ TimeSeries & TimeSeries::add(const TimeSeries & continuer) { - Sample vertices(mesh_.getVertices()); - if ((timeStep_ != continuer.timeStep_) || (start_ + n_ * timeStep_ != continuer.start_)) LOGWARN(OSS() << "The continuer does not have a compatible time grid. Using the values only."); + if ((timeStep_ != continuer.timeStep_) || (start_ + n_ * timeStep_ != continuer.start_)) + LOGWARN(OSS() << "The continuer does not have a compatible time grid. Using the values only."); return add(continuer.getValues()); } diff --git a/lib/src/Base/Stat/openturns/CorrelationMatrix.hxx b/lib/src/Base/Stat/openturns/CorrelationMatrix.hxx index 8409d03f70..49a8105f60 100644 --- a/lib/src/Base/Stat/openturns/CorrelationMatrix.hxx +++ b/lib/src/Base/Stat/openturns/CorrelationMatrix.hxx @@ -32,7 +32,7 @@ BEGIN_NAMESPACE_OPENTURNS * @class CorrelationMatrix */ -class OT_API CorrelationMatrix +class OT_API OT_WARN_UNUSED CorrelationMatrix : public CovarianceMatrix { CLASSNAME diff --git a/lib/src/Base/Stat/openturns/CovarianceMatrix.hxx b/lib/src/Base/Stat/openturns/CovarianceMatrix.hxx index 6c3b0a5bf3..290437e2b2 100644 --- a/lib/src/Base/Stat/openturns/CovarianceMatrix.hxx +++ b/lib/src/Base/Stat/openturns/CovarianceMatrix.hxx @@ -31,7 +31,7 @@ BEGIN_NAMESPACE_OPENTURNS * @class CovarianceMatrix */ -class OT_API CovarianceMatrix +class OT_API OT_WARN_UNUSED CovarianceMatrix : public SymmetricMatrix { CLASSNAME diff --git a/lib/src/Base/Stat/openturns/CovarianceModel.hxx b/lib/src/Base/Stat/openturns/CovarianceModel.hxx index 1a90ade60f..f446036a01 100644 --- a/lib/src/Base/Stat/openturns/CovarianceModel.hxx +++ b/lib/src/Base/Stat/openturns/CovarianceModel.hxx @@ -30,7 +30,7 @@ BEGIN_NAMESPACE_OPENTURNS * @class CovarianceModel */ -class OT_API CovarianceModel +class OT_API OT_WARN_UNUSED CovarianceModel : public TypedInterfaceObject { diff --git a/lib/src/Base/Stat/openturns/HistoryStrategy.hxx b/lib/src/Base/Stat/openturns/HistoryStrategy.hxx index 1b236759ef..0a7b7d9097 100644 --- a/lib/src/Base/Stat/openturns/HistoryStrategy.hxx +++ b/lib/src/Base/Stat/openturns/HistoryStrategy.hxx @@ -33,7 +33,7 @@ BEGIN_NAMESPACE_OPENTURNS * @class HistoryStrategy */ -class OT_API HistoryStrategy +class OT_API OT_WARN_UNUSED HistoryStrategy : public TypedInterfaceObject { diff --git a/lib/src/Base/Stat/openturns/ProcessSample.hxx b/lib/src/Base/Stat/openturns/ProcessSample.hxx index fafb48c4d4..c04bb09caa 100644 --- a/lib/src/Base/Stat/openturns/ProcessSample.hxx +++ b/lib/src/Base/Stat/openturns/ProcessSample.hxx @@ -31,7 +31,7 @@ BEGIN_NAMESPACE_OPENTURNS * * An interface for time series */ -class OT_API ProcessSample +class OT_API OT_WARN_UNUSED ProcessSample : public TypedInterfaceObject { CLASSNAME diff --git a/lib/src/Base/Stat/openturns/Sample.hxx b/lib/src/Base/Stat/openturns/Sample.hxx index 8914d594f5..f950d008a8 100644 --- a/lib/src/Base/Stat/openturns/Sample.hxx +++ b/lib/src/Base/Stat/openturns/Sample.hxx @@ -34,7 +34,7 @@ BEGIN_NAMESPACE_OPENTURNS * @class Sample */ -class OT_API Sample +class OT_API OT_WARN_UNUSED Sample : public TypedInterfaceObject { CLASSNAME diff --git a/lib/src/Base/Stat/openturns/TestResult.hxx b/lib/src/Base/Stat/openturns/TestResult.hxx index 932b01eb66..a18c0e2a87 100644 --- a/lib/src/Base/Stat/openturns/TestResult.hxx +++ b/lib/src/Base/Stat/openturns/TestResult.hxx @@ -35,8 +35,7 @@ BEGIN_NAMESPACE_OPENTURNS * TestResult implements the result of a statistical test */ -class OT_API TestResult : - public PersistentObject +class OT_API OT_WARN_UNUSED TestResult : public PersistentObject { CLASSNAME diff --git a/lib/src/Base/Stat/openturns/TimeSeries.hxx b/lib/src/Base/Stat/openturns/TimeSeries.hxx index b327161f8f..2328aa847d 100644 --- a/lib/src/Base/Stat/openturns/TimeSeries.hxx +++ b/lib/src/Base/Stat/openturns/TimeSeries.hxx @@ -38,8 +38,7 @@ BEGIN_NAMESPACE_OPENTURNS * @class TimeSeries */ -class OT_API TimeSeries - : public FieldImplementation +class OT_API OT_WARN_UNUSED TimeSeries : public FieldImplementation { CLASSNAME diff --git a/lib/src/Base/Type/openturns/Collection.hxx b/lib/src/Base/Type/openturns/Collection.hxx index c6bcd7000d..cc2ff4947d 100644 --- a/lib/src/Base/Type/openturns/Collection.hxx +++ b/lib/src/Base/Type/openturns/Collection.hxx @@ -91,7 +91,7 @@ OStream & operator << (OStream & OS, template -class Collection +class OT_WARN_UNUSED Collection { public: diff --git a/lib/src/Base/Type/openturns/Description.hxx b/lib/src/Base/Type/openturns/Description.hxx index 7e580e2275..a75e1994e8 100644 --- a/lib/src/Base/Type/openturns/Description.hxx +++ b/lib/src/Base/Type/openturns/Description.hxx @@ -31,8 +31,7 @@ BEGIN_NAMESPACE_OPENTURNS * Description is a collection of string for human usage */ -class OT_API Description : - public PersistentCollection +class OT_API OT_WARN_UNUSED Description : public PersistentCollection { CLASSNAME public: diff --git a/lib/src/Base/Type/openturns/Indices.hxx b/lib/src/Base/Type/openturns/Indices.hxx index 4b1b22fc98..86ccfd43b3 100644 --- a/lib/src/Base/Type/openturns/Indices.hxx +++ b/lib/src/Base/Type/openturns/Indices.hxx @@ -31,7 +31,7 @@ BEGIN_NAMESPACE_OPENTURNS * * A class that holds a collection of indices */ -class OT_API Indices : +class OT_API OT_WARN_UNUSED Indices : public PersistentCollection { CLASSNAME diff --git a/lib/src/Base/Type/openturns/Matrix.hxx b/lib/src/Base/Type/openturns/Matrix.hxx index ea7080e368..aa1ded655c 100644 --- a/lib/src/Base/Type/openturns/Matrix.hxx +++ b/lib/src/Base/Type/openturns/Matrix.hxx @@ -39,7 +39,7 @@ class Sample; * Matrix implements the classical mathematical matrix */ -class OT_API Matrix : +class OT_WARN_UNUSED OT_API Matrix : public TypedInterfaceObject { CLASSNAME diff --git a/lib/src/Base/Type/openturns/Point.hxx b/lib/src/Base/Type/openturns/Point.hxx index e16d15df29..ecf8cb77f0 100644 --- a/lib/src/Base/Type/openturns/Point.hxx +++ b/lib/src/Base/Type/openturns/Point.hxx @@ -34,7 +34,7 @@ BEGIN_NAMESPACE_OPENTURNS * Point implements the classical mathematical point */ -class OT_API Point +class OT_API OT_WARN_UNUSED Point : public PersistentCollection { CLASSNAME diff --git a/lib/src/Base/Type/openturns/Tensor.hxx b/lib/src/Base/Type/openturns/Tensor.hxx index 73215d9d24..0ca82bf925 100644 --- a/lib/src/Base/Type/openturns/Tensor.hxx +++ b/lib/src/Base/Type/openturns/Tensor.hxx @@ -37,9 +37,7 @@ class TensorImplementation; * Tensor implements the classical mathematical Tensor */ -class OT_API Tensor : - public TypedInterfaceObject - +class OT_API OT_WARN_UNUSED Tensor : public TypedInterfaceObject { CLASSNAME diff --git a/lib/src/Uncertainty/Algorithm/Analytical/AnalyticalResult.cxx b/lib/src/Uncertainty/Algorithm/Analytical/AnalyticalResult.cxx index 30a80409bc..2580ad54ad 100644 --- a/lib/src/Uncertainty/Algorithm/Analytical/AnalyticalResult.cxx +++ b/lib/src/Uncertainty/Algorithm/Analytical/AnalyticalResult.cxx @@ -428,8 +428,6 @@ Graph AnalyticalResult::drawSensitivity(const Sensitivity & sensitivity, // Create an empty graph Graph sensitivityGraph("Sensitivity", "parameters", "sensitivities", true, "topright"); - BarPlot sensitivityBarPlot(Sample(0, 2), shift, ""); - // Create the barplots const UnsignedInteger sensitivitySize = sensitivity.getSize(); for (UnsignedInteger collectionIndex = 0; collectionIndex < sensitivitySize; ++collectionIndex) diff --git a/lib/src/Uncertainty/Algorithm/MetaModel/FunctionalChaos/FunctionalChaosSobolIndices.cxx b/lib/src/Uncertainty/Algorithm/MetaModel/FunctionalChaos/FunctionalChaosSobolIndices.cxx index fc87e62719..3e4959535c 100644 --- a/lib/src/Uncertainty/Algorithm/MetaModel/FunctionalChaos/FunctionalChaosSobolIndices.cxx +++ b/lib/src/Uncertainty/Algorithm/MetaModel/FunctionalChaos/FunctionalChaosSobolIndices.cxx @@ -83,7 +83,6 @@ String FunctionalChaosSobolIndices::__repr_markdown__() const oss << FunctionalChaosSobolIndices::GetClassName() << "\n"; const Indices indices(functionalChaosResult_.getIndices()); - const Sample coefficients(functionalChaosResult_.getCoefficients()); const UnsignedInteger basisSize = indices.getSize(); EnumerateFunction enumerateFunction(functionalChaosResult_.getOrthogonalBasis().getEnumerateFunction()); diff --git a/lib/src/Uncertainty/Algorithm/MetaModel/Kriging/GeneralLinearModelAlgorithm.cxx b/lib/src/Uncertainty/Algorithm/MetaModel/Kriging/GeneralLinearModelAlgorithm.cxx index ef3c7e9aba..4525838e8a 100644 --- a/lib/src/Uncertainty/Algorithm/MetaModel/Kriging/GeneralLinearModelAlgorithm.cxx +++ b/lib/src/Uncertainty/Algorithm/MetaModel/Kriging/GeneralLinearModelAlgorithm.cxx @@ -432,7 +432,6 @@ Scalar GeneralLinearModelAlgorithm::maximizeReducedLogLikelihood() { // initial guess Point initialParameters(reducedCovarianceModel_.getParameter()); - Indices initialActiveParameters(reducedCovarianceModel_.getActiveParameter()); // We use the functional form of the log-likelihood computation to benefit from the cache mechanism Function reducedLogLikelihoodFunction(getObjectiveFunction()); const Bool noNumericalOptimization = initialParameters.getSize() == 0; diff --git a/lib/src/Uncertainty/Algorithm/MetaModel/Kriging/KrigingResult.cxx b/lib/src/Uncertainty/Algorithm/MetaModel/Kriging/KrigingResult.cxx index 8cf46d10be..ff1495a59f 100644 --- a/lib/src/Uncertainty/Algorithm/MetaModel/Kriging/KrigingResult.cxx +++ b/lib/src/Uncertainty/Algorithm/MetaModel/Kriging/KrigingResult.cxx @@ -205,7 +205,6 @@ void KrigingResult::computePhi() const { // Nothing to do if the design matrix has already been computed if (Gt_.getNbRows() != 0) return; - Matrix Q; LOGINFO("Solve linear system L * phi= F"); Matrix phi; if (0 != covarianceCholeskyFactor_.getNbRows()) @@ -215,7 +214,7 @@ void KrigingResult::computePhi() const // Compute QR decomposition of Phi_ LOGINFO("Compute the QR decomposition of phi"); Matrix G; - Q = phi.computeQR(G); + phi.computeQR(G); Gt_ = G.transpose(); phiT_ = phi.transpose(); } diff --git a/lib/src/Uncertainty/Algorithm/MetaModel/LinearModel/LinearModelAlgorithm.cxx b/lib/src/Uncertainty/Algorithm/MetaModel/LinearModel/LinearModelAlgorithm.cxx index 7938f9fd63..80d17d9a2e 100644 --- a/lib/src/Uncertainty/Algorithm/MetaModel/LinearModel/LinearModelAlgorithm.cxx +++ b/lib/src/Uncertainty/Algorithm/MetaModel/LinearModel/LinearModelAlgorithm.cxx @@ -58,7 +58,7 @@ LinearModelAlgorithm::LinearModelAlgorithm(const Sample & inputSample, try { // the sample description may contain invalid variable names - const SymbolicFunction constant(inputDescription, Description(1, "1")); + SymbolicFunction(inputDescription, Description({"1"})); } catch (const InvalidArgumentException &) { diff --git a/lib/src/Uncertainty/Algorithm/MetaModel/LinearModel/LinearModelAnalysis.cxx b/lib/src/Uncertainty/Algorithm/MetaModel/LinearModel/LinearModelAnalysis.cxx index c5b38300fe..3d47f89f13 100644 --- a/lib/src/Uncertainty/Algorithm/MetaModel/LinearModel/LinearModelAnalysis.cxx +++ b/lib/src/Uncertainty/Algorithm/MetaModel/LinearModel/LinearModelAnalysis.cxx @@ -743,7 +743,6 @@ Graph LinearModelAnalysis::drawCookVsLeverages() const graph.add(text); } const Interval boundingBox(graph.getBoundingBox()); - const Point lowerBound(boundingBox.getLowerBound()); const Point upperBound(boundingBox.getUpperBound()); // Add contour plot Point isovalues(6); diff --git a/lib/src/Uncertainty/Algorithm/Sensitivity/FAST.cxx b/lib/src/Uncertainty/Algorithm/Sensitivity/FAST.cxx index cba837d6a8..07dfe62d85 100644 --- a/lib/src/Uncertainty/Algorithm/Sensitivity/FAST.cxx +++ b/lib/src/Uncertainty/Algorithm/Sensitivity/FAST.cxx @@ -118,7 +118,6 @@ void FAST::run() const for (UnsignedInteger i = 0; i < nbIn; ++ i) phi_i[i] = 2. * M_PI * RandomGenerator::Generate(); - Point xi_s(nbIn); Sample output(0, nbOut); // for each block ... diff --git a/lib/src/Uncertainty/Algorithm/Sensitivity/MauntzKucherenkoSensitivityAlgorithm.cxx b/lib/src/Uncertainty/Algorithm/Sensitivity/MauntzKucherenkoSensitivityAlgorithm.cxx index 41c3900477..ba7ce8948c 100644 --- a/lib/src/Uncertainty/Algorithm/Sensitivity/MauntzKucherenkoSensitivityAlgorithm.cxx +++ b/lib/src/Uncertainty/Algorithm/Sensitivity/MauntzKucherenkoSensitivityAlgorithm.cxx @@ -82,8 +82,6 @@ Sample MauntzKucherenkoSensitivityAlgorithm::computeIndices(const Sample & sampl // Use reference samples // Compute muA = mean(yA) - const Sample yA(sample, 0, size); - const Point muA(yA.computeMean()); // Compute crossMean const Point yADotyB(computeSumDotSamples(sample, size_, 0, size_)); diff --git a/lib/src/Uncertainty/Algorithm/Sensitivity/RankSobolSensitivityAlgorithm.cxx b/lib/src/Uncertainty/Algorithm/Sensitivity/RankSobolSensitivityAlgorithm.cxx index 5beeb34aa5..8cf3551dce 100644 --- a/lib/src/Uncertainty/Algorithm/Sensitivity/RankSobolSensitivityAlgorithm.cxx +++ b/lib/src/Uncertainty/Algorithm/Sensitivity/RankSobolSensitivityAlgorithm.cxx @@ -287,8 +287,6 @@ void RankSobolSensitivityAlgorithm::computeBootstrapDistribution() const { // Build interval using sample variance // Mean reference is the Sensitivity values - const Point FirstOrder(getFirstOrderIndices()); - if (bootstrapSize_ > 0) { // Temporary samples that stores the first/total indices diff --git a/lib/src/Uncertainty/Algorithm/Sensitivity/SobolIndicesAlgorithmImplementation.cxx b/lib/src/Uncertainty/Algorithm/Sensitivity/SobolIndicesAlgorithmImplementation.cxx index e8f2efdca3..7bd8fa3fd0 100644 --- a/lib/src/Uncertainty/Algorithm/Sensitivity/SobolIndicesAlgorithmImplementation.cxx +++ b/lib/src/Uncertainty/Algorithm/Sensitivity/SobolIndicesAlgorithmImplementation.cxx @@ -193,8 +193,6 @@ void SobolIndicesAlgorithmImplementation::computeBootstrapDistribution() const { // Build interval using sample variance // Mean reference is the Sensitivity values - const Point aggregatedFirstOrder(getAggregatedFirstOrderIndices()); - const Point aggregatedTotalOrder(getAggregatedTotalOrderIndices()); if (bootstrapSize_ > 0) { // Temporary samples that stores the first/total indices @@ -742,7 +740,6 @@ Graph SobolIndicesAlgorithmImplementation::DrawImportanceFactors(const Point & v for (UnsignedInteger i = 0; i < dimension; ++i) data[i] = values[i] / l1Norm; /* build labels and colors for the pie */ - Description palette(dimension); Description labels(dimension); Description description(names); // If no description has been given for the input distribution components, give standard ones diff --git a/lib/src/Uncertainty/Algorithm/Simulation/CrossEntropyImportanceSampling.cxx b/lib/src/Uncertainty/Algorithm/Simulation/CrossEntropyImportanceSampling.cxx index 2c8b63b865..5b215339be 100644 --- a/lib/src/Uncertainty/Algorithm/Simulation/CrossEntropyImportanceSampling.cxx +++ b/lib/src/Uncertainty/Algorithm/Simulation/CrossEntropyImportanceSampling.cxx @@ -164,8 +164,7 @@ void CrossEntropyImportanceSampling::run() while ((comparator(threshold, currentQuantile)) && (currentQuantile != threshold)) { - ++iterationNumber ; - Point currentAuxiliaryDistributionParameters = auxiliaryDistributionParameters; + ++ iterationNumber; // Drawing of samples using auxiliary density and evaluation on limit state function auxiliaryInputSample = Sample(0, initialDistribution_.getDimension()); diff --git a/lib/src/Uncertainty/Algorithm/Simulation/NAIS.cxx b/lib/src/Uncertainty/Algorithm/Simulation/NAIS.cxx index c3a5651c3d..543f63fe80 100644 --- a/lib/src/Uncertainty/Algorithm/Simulation/NAIS.cxx +++ b/lib/src/Uncertainty/Algorithm/Simulation/NAIS.cxx @@ -96,8 +96,6 @@ Distribution NAIS::computeAuxiliaryDistribution(const Sample & sample, const UnsignedInteger dimensionSample = getEvent().getAntecedent().getDimension(); const Point silverman(stdPerComponent * std::pow(neff * (dimensionSample + 2.0) / 4.0, -1.0 / (dimensionSample + 4.0))); - Collection margins(dimensionSample); - // Computation of auxiliary distribution using ot.Mixture const UnsignedInteger numberOfSample = getMaximumOuterSampling() * getBlockSize(); Collection collectionOfDistribution(numberOfSample); @@ -251,7 +249,6 @@ void NAIS::run() indicesCritic.add(i); } // for i - const Sample resp_sampleCritic(auxiliaryOutputSample.select(indicesCritic)); const Sample sampleCritic(auxiliaryInputSample.select(indicesCritic)); // Evaluate initial log PDF in parallel on failure sample diff --git a/lib/src/Uncertainty/Algorithm/Simulation/SimulationSensitivityAnalysis.cxx b/lib/src/Uncertainty/Algorithm/Simulation/SimulationSensitivityAnalysis.cxx index 742b98fb0f..263714297d 100644 --- a/lib/src/Uncertainty/Algorithm/Simulation/SimulationSensitivityAnalysis.cxx +++ b/lib/src/Uncertainty/Algorithm/Simulation/SimulationSensitivityAnalysis.cxx @@ -288,12 +288,9 @@ Graph SimulationSensitivityAnalysis::drawImportanceFactorsRange(const Bool proba try { importanceFactors = getTransformation()(accumulator / accumulated).normalizeSquare(); - const Point ref(computeImportanceFactors(currentThreshold)); for (UnsignedInteger j = 0; j < inputDimension; ++j) { - Point point(2); - point[0] = xValue; - point[1] = 100.0 * importanceFactors[j]; + const Point point = {xValue, 100.0 * importanceFactors[j]}; dataCollection[j].add(point); } } diff --git a/lib/src/Uncertainty/Algorithm/Transformation/DistributionTransformation.cxx b/lib/src/Uncertainty/Algorithm/Transformation/DistributionTransformation.cxx index 0209a5015f..b03a1b5755 100644 --- a/lib/src/Uncertainty/Algorithm/Transformation/DistributionTransformation.cxx +++ b/lib/src/Uncertainty/Algorithm/Transformation/DistributionTransformation.cxx @@ -107,7 +107,6 @@ Function DistributionTransformation::Build (const Distribution & distribution, { LOGINFO("Different standard space for input vector and basis"); Function TX; - Function invTX; if (distribution.getStandardDistribution().hasIndependentCopula()) { LOGINFO("Normal standard space for input vector"); @@ -118,7 +117,6 @@ Function DistributionTransformation::Build (const Distribution & distribution, LOGINFO("Non-normal standard space for input vector"); TX = Function(FunctionImplementation(RosenblattEvaluation(distribution.getImplementation()).clone())); } - Function TZ; Function invTZ; if (measure.getStandardDistribution().hasIndependentCopula()) { diff --git a/lib/src/Uncertainty/Algorithm/Transformation/MarginalTransformation/MarginalTransformationEvaluation.cxx b/lib/src/Uncertainty/Algorithm/Transformation/MarginalTransformation/MarginalTransformationEvaluation.cxx index bf4969e938..c03ed84f2b 100644 --- a/lib/src/Uncertainty/Algorithm/Transformation/MarginalTransformation/MarginalTransformationEvaluation.cxx +++ b/lib/src/Uncertainty/Algorithm/Transformation/MarginalTransformation/MarginalTransformationEvaluation.cxx @@ -592,7 +592,6 @@ String MarginalTransformationEvaluation::__str__(const String & offset) const OSS oss(false); const String name(getName()); if (hasVisibleName()) oss << "Marginal transformation " << getName() << " :" << "\n" << offset; - const Description inputDescription(getInputDescription()); const Description outputDescription(getOutputDescription()); UnsignedInteger length = 0; for (UnsignedInteger i = 0; i < inputDistributionCollection_.getSize(); ++i) diff --git a/lib/src/Uncertainty/Bayesian/GaussianNonLinearCalibration.cxx b/lib/src/Uncertainty/Bayesian/GaussianNonLinearCalibration.cxx index b08eff6d50..b00e8d106f 100644 --- a/lib/src/Uncertainty/Bayesian/GaussianNonLinearCalibration.cxx +++ b/lib/src/Uncertainty/Bayesian/GaussianNonLinearCalibration.cxx @@ -356,7 +356,6 @@ void GaussianNonLinearCalibration::run() inputIndices.fill(); Indices outputIndices(outputObservations_.getDimension()); outputIndices.fill(inputIndices.getSize()); - Sample empty; for (UnsignedInteger i = 0; i < bootstrapSize_; ++i) { const Sample joinedSample(bootstrap.generate()); diff --git a/lib/src/Uncertainty/Distribution/BetaMuSigma.cxx b/lib/src/Uncertainty/Distribution/BetaMuSigma.cxx index 5e4bb57f65..3e89dea274 100644 --- a/lib/src/Uncertainty/Distribution/BetaMuSigma.cxx +++ b/lib/src/Uncertainty/Distribution/BetaMuSigma.cxx @@ -76,8 +76,6 @@ Distribution BetaMuSigma::getDistribution() const /* Compute jacobian / native parameters */ Matrix BetaMuSigma::gradient() const { - const Point newParameters = {mu_, sigma_, a_, b_}; - const Scalar mu = mu_; const Scalar sigma = sigma_; const Scalar a = a_; diff --git a/lib/src/Uncertainty/Distribution/ConditionalDistribution.cxx b/lib/src/Uncertainty/Distribution/ConditionalDistribution.cxx index 4f7b4f5ca7..977a03ae0a 100644 --- a/lib/src/Uncertainty/Distribution/ConditionalDistribution.cxx +++ b/lib/src/Uncertainty/Distribution/ConditionalDistribution.cxx @@ -198,7 +198,6 @@ void ConditionalDistribution::setConditionedAndConditioningDistributionsAndLinkF linkFunction_ = linkFunction; setDimension(conditioningDimension + conditionedDistribution.getDimension()); // Start the discretisation into a Mixture - const Interval bounds(conditioningDistribution.getRange()); // Here, implements some knowledge based selection of the integration method // For now, only basic Legendre // Gather the indices of the discrete marginals diff --git a/lib/src/Uncertainty/Distribution/GeneralizedParetoFactory.cxx b/lib/src/Uncertainty/Distribution/GeneralizedParetoFactory.cxx index cb244c57fa..4ec9670d39 100644 --- a/lib/src/Uncertainty/Distribution/GeneralizedParetoFactory.cxx +++ b/lib/src/Uncertainty/Distribution/GeneralizedParetoFactory.cxx @@ -305,7 +305,6 @@ Graph GeneralizedParetoFactory::drawMeanResidualLife(const Sample & sample) cons Sample ciUp(pointsNumber, 1); const Scalar level = ResourceMap::GetAsScalar("GeneralizedParetoFactory-MeanResidualLifeConfidenceLevel"); const Scalar xq = DistFunc::qNormal(0.5 + 0.5 * level); - const Sample sortedSample(sample.sort(0)); for (UnsignedInteger i = 0; i < pointsNumber; ++ i) { u(i, 0) = uMin + i * (uMax - uMin) / (pointsNumber + 1); diff --git a/lib/src/Uncertainty/Distribution/MaximumEntropyOrderStatisticsDistribution.cxx b/lib/src/Uncertainty/Distribution/MaximumEntropyOrderStatisticsDistribution.cxx index 65275aeb71..f04da17694 100644 --- a/lib/src/Uncertainty/Distribution/MaximumEntropyOrderStatisticsDistribution.cxx +++ b/lib/src/Uncertainty/Distribution/MaximumEntropyOrderStatisticsDistribution.cxx @@ -51,7 +51,7 @@ MaximumEntropyOrderStatisticsDistribution::MaximumEntropyOrderStatisticsDistribu setIntegrationNodesNumber(ResourceMap::GetAsUnsignedInteger("MaximumEntropyOrderStatisticsDistribution-CDFIntegrationNodesNumber")); // To insure that the nodes will be already computed when calling computeCDF() in parallel Point weights; - Point nodes(getGaussNodesAndWeights(weights)); + getGaussNodesAndWeights(weights); } /* Parameters constructor */ @@ -68,7 +68,7 @@ MaximumEntropyOrderStatisticsDistribution::MaximumEntropyOrderStatisticsDistribu setIntegrationNodesNumber(ResourceMap::GetAsUnsignedInteger("MaximumEntropyOrderStatisticsDistribution-CDFIntegrationNodesNumber")); // To insure that the nodes will be already computed when calling computeCDF() in parallel Point weights; - Point nodes(getGaussNodesAndWeights(weights)); + getGaussNodesAndWeights(weights); } /* Parameters constructor */ @@ -93,7 +93,7 @@ MaximumEntropyOrderStatisticsDistribution::MaximumEntropyOrderStatisticsDistribu setIntegrationNodesNumber(ResourceMap::GetAsUnsignedInteger("MaximumEntropyOrderStatisticsDistribution-CDFIntegrationNodesNumber")); // To insure that the nodes will be already computed when calling computeCDF() in parallel Point weights; - Point nodes(getGaussNodesAndWeights(weights)); + getGaussNodesAndWeights(weights); } /* Comparison operator */ @@ -349,7 +349,7 @@ PiecewiseHermiteEvaluation MaximumEntropyOrderStatisticsDistribution::interpolat Point localErrors; Scalar error = -1.0; // We integrate the exponential factor in order to detect all the singularities using polynomial approximations of different order - const Point tmp(GaussKronrod(ResourceMap::GetAsUnsignedInteger("MaximumEntropyOrderStatisticsDistribution-ExponentialFactorDiscretization"), ResourceMap::GetAsScalar("GaussKronrod-MaximumError"), GaussKronrodRule(GaussKronrodRule::G1K3)).integrate(phi, xMin, xMax, error, lowerBounds, upperBounds, contributions, localErrors)); + GaussKronrod(ResourceMap::GetAsUnsignedInteger("MaximumEntropyOrderStatisticsDistribution-ExponentialFactorDiscretization"), ResourceMap::GetAsScalar("GaussKronrod-MaximumError"), GaussKronrodRule(GaussKronrodRule::G1K3)).integrate(phi, xMin, xMax, error, lowerBounds, upperBounds, contributions, localErrors); // Now, we have to sort the intervals in order to build the approximation std::sort(upperBounds.begin(), upperBounds.end()); // Here we have to subdivide the intervals to take into account the poorer approximation given by Hermite polynomials diff --git a/lib/src/Uncertainty/Distribution/MeixnerDistribution.cxx b/lib/src/Uncertainty/Distribution/MeixnerDistribution.cxx index 29b9883b09..4adea61565 100644 --- a/lib/src/Uncertainty/Distribution/MeixnerDistribution.cxx +++ b/lib/src/Uncertainty/Distribution/MeixnerDistribution.cxx @@ -224,7 +224,6 @@ void MeixnerDistribution::computeRange() } // Find the numerical upper bound based on the PDF value Point upperBound(mu); - Point stepUpper(sigma); Scalar logPDFUpper = logPDF; while (logPDFUpper > logPDFEpsilon) { diff --git a/lib/src/Uncertainty/Distribution/RandomMixture.cxx b/lib/src/Uncertainty/Distribution/RandomMixture.cxx index 2e6fb9c614..619dd1ccfd 100644 --- a/lib/src/Uncertainty/Distribution/RandomMixture.cxx +++ b/lib/src/Uncertainty/Distribution/RandomMixture.cxx @@ -1452,7 +1452,6 @@ Sample RandomMixture::computePDF(const Point & xMin, return pdf; } // dimension == 1 && size == 2 const Point mu(getMean()); - const Interval bounds(xMin, xMax); //if (!bounds.contains(mu)) throw InvalidArgumentException(HERE) << "Error: requested interval does not contain mean=" << mu; const Point sigma(getStandardDeviation()); diff --git a/lib/src/Uncertainty/Distribution/Student.cxx b/lib/src/Uncertainty/Distribution/Student.cxx index 589cb806c4..3a003dae17 100644 --- a/lib/src/Uncertainty/Distribution/Student.cxx +++ b/lib/src/Uncertainty/Distribution/Student.cxx @@ -273,10 +273,6 @@ Scalar Student::computeProbability(const Interval & interval) const // The generic implementation provided by the DistributionImplementation upper class is more accurate than the generic implementation provided by the ContinuousDistribution upper class for dimension = 1 if (dimension == 1) return DistributionImplementation::computeProbability(interval); // Decompose and normalize the interval - Point lower(normalize(interval.getLowerBound())); - Point upper(normalize(interval.getUpperBound())); - const Interval::BoolCollection finiteLower(interval.getFiniteLowerBound()); - const Interval::BoolCollection finiteUpper(interval.getFiniteUpperBound()); /* General case */ // For moderate dimension, use a Gauss-Legendre integration if (dimension <= ResourceMap::GetAsUnsignedInteger("Student-SmallDimension")) diff --git a/lib/src/Uncertainty/Model/DistributionImplementation.cxx b/lib/src/Uncertainty/Model/DistributionImplementation.cxx index 4b2e8b8066..5655eb8079 100644 --- a/lib/src/Uncertainty/Model/DistributionImplementation.cxx +++ b/lib/src/Uncertainty/Model/DistributionImplementation.cxx @@ -2273,7 +2273,6 @@ Scalar DistributionImplementation::computeConditionalQuantile(const Scalar q, Point DistributionImplementation::computeSequentialConditionalQuantile(const Point & q) const { Point result(0); - Point y(0); for (UnsignedInteger i = 0; i < dimension_; ++i) result.add(computeConditionalQuantile(q[i], result)); return result; diff --git a/lib/src/Uncertainty/Model/EllipticalDistribution.cxx b/lib/src/Uncertainty/Model/EllipticalDistribution.cxx index 5a75679017..a4c6a55a5e 100644 --- a/lib/src/Uncertainty/Model/EllipticalDistribution.cxx +++ b/lib/src/Uncertainty/Model/EllipticalDistribution.cxx @@ -386,9 +386,9 @@ Scalar EllipticalDistribution::computeLogPDF(const Point & point) const /* Get the PDF gradient of the distribution */ Point EllipticalDistribution::computePDFGradient(const Point & point) const { - if (point.getDimension() != getDimension()) throw InvalidArgumentException(HERE) << "Error: the given point must have dimension=1, here dimension=" << point.getDimension(); + if (point.getDimension() != getDimension()) + throw InvalidArgumentException(HERE) << "Error: the given point must have dimension=1, here dimension=" << point.getDimension(); - const Point minusGardientMean(computeDDF(point)); const UnsignedInteger dimension = getDimension(); const Point u(normalize(point)); Point iRu(u); @@ -481,8 +481,6 @@ void EllipticalDistribution::update() const UnsignedInteger dimension = getDimension(); if (dimension > 1) { - // Compute the shape matrix - const CovarianceMatrix shape(getShape()); // Try to compute the Cholesky factor of the shape matrix TriangularMatrix cholesky(getCholesky()); inverseCholesky_ = cholesky.solveLinearSystem(IdentityMatrix(dimension)).getImplementation(); diff --git a/lib/src/Uncertainty/Model/openturns/Distribution.hxx b/lib/src/Uncertainty/Model/openturns/Distribution.hxx index 85ea0dfd3a..09d6ab88cd 100644 --- a/lib/src/Uncertainty/Model/openturns/Distribution.hxx +++ b/lib/src/Uncertainty/Model/openturns/Distribution.hxx @@ -35,7 +35,7 @@ BEGIN_NAMESPACE_OPENTURNS * distribution, can compute PDF or CDF, etc. * They are the actual key component of RandomVectors. */ -class OT_API Distribution +class OT_API OT_WARN_UNUSED Distribution : public TypedInterfaceObject { CLASSNAME diff --git a/lib/src/Uncertainty/Model/openturns/RandomVector.hxx b/lib/src/Uncertainty/Model/openturns/RandomVector.hxx index c29fc052ff..873edc2407 100644 --- a/lib/src/Uncertainty/Model/openturns/RandomVector.hxx +++ b/lib/src/Uncertainty/Model/openturns/RandomVector.hxx @@ -32,7 +32,7 @@ BEGIN_NAMESPACE_OPENTURNS * * The class that implements all random vectors */ -class OT_API RandomVector +class OT_API OT_WARN_UNUSED RandomVector : public TypedInterfaceObject { CLASSNAME diff --git a/lib/src/Uncertainty/Process/DiscreteMarkovChain.cxx b/lib/src/Uncertainty/Process/DiscreteMarkovChain.cxx index f700ff42b6..98a32b7d60 100644 --- a/lib/src/Uncertainty/Process/DiscreteMarkovChain.cxx +++ b/lib/src/Uncertainty/Process/DiscreteMarkovChain.cxx @@ -185,9 +185,6 @@ Field DiscreteMarkovChain::getRealization() const /* Compute the next steps of a Markov chain */ TimeSeries DiscreteMarkovChain::getFuture(const UnsignedInteger stepNumber) const { - // TimeGrid of the process - RegularGrid timeGrid(getTimeGrid()); - if (stepNumber == 0) throw InvalidArgumentException(HERE) << "Error: the number of future steps must be positive."; // TimeGrid associated with the possible future diff --git a/lib/src/Uncertainty/Process/RandomWalk.cxx b/lib/src/Uncertainty/Process/RandomWalk.cxx index ecd845ffc7..3d2768b9b0 100644 --- a/lib/src/Uncertainty/Process/RandomWalk.cxx +++ b/lib/src/Uncertainty/Process/RandomWalk.cxx @@ -125,9 +125,6 @@ Field RandomWalk::getRealization() const /* Compute the next steps of a random walk */ TimeSeries RandomWalk::getFuture(const UnsignedInteger stepNumber) const { - /* TimeGrid of the process */ - RegularGrid timeGrid(getTimeGrid()); - if (stepNumber == 0) throw InvalidArgumentException(HERE) << "Error: the number of future steps must be positive."; /* TimeGrid associated with the possible future */ diff --git a/lib/src/Uncertainty/StatTests/FittingTest.cxx b/lib/src/Uncertainty/StatTests/FittingTest.cxx index c7c66ebc7f..aa241fe192 100644 --- a/lib/src/Uncertainty/StatTests/FittingTest.cxx +++ b/lib/src/Uncertainty/StatTests/FittingTest.cxx @@ -270,9 +270,6 @@ Distribution FittingTest::BestModelLilliefors(const Sample & sample, // First rank the factories according to the biased Kolmogorov test, // which is optimistic wrt the p-value const Scalar fakeLevel = 0.5; - DistributionCollection bestEstimates(size); - // The value -1.0 means that the model has not been built - Point pValues(size, -1.0); Bool builtAtLeastOne = false; Distribution distribution; // There is no need to store the best estimates as the relevant ones will be recomputed during the Lilliefors loop diff --git a/lib/src/Uncertainty/StatTests/HypothesisTest.cxx b/lib/src/Uncertainty/StatTests/HypothesisTest.cxx index ca006b4f60..989ad5fd2d 100644 --- a/lib/src/Uncertainty/StatTests/HypothesisTest.cxx +++ b/lib/src/Uncertainty/StatTests/HypothesisTest.cxx @@ -133,7 +133,6 @@ TestResult HypothesisTest::ChiSquared(const Sample & firstSample, const Sample table(bivariateDiscreteDistribution.getSupport()); const Point frequencies(bivariateDiscreteDistribution.getProbabilities()); - Point classes(binNumberX * binNumberY); Point pointsInClasses(binNumberX * binNumberY); for (UnsignedInteger k = 0; k < table.getSize(); ++k) diff --git a/lib/test/t_AbdoRackwitz_std.cxx b/lib/test/t_AbdoRackwitz_std.cxx index 4c6b6036da..5954e0abe5 100644 --- a/lib/test/t_AbdoRackwitz_std.cxx +++ b/lib/test/t_AbdoRackwitz_std.cxx @@ -95,7 +95,7 @@ int main(int, char *[]) myAlgorithm.run(); OptimizationResult result(myAlgorithm.getResult()); fullprint << "result = " << printPoint(result.getOptimalPoint(), 4) << std::endl; - Graph convergence(result.drawErrorHistory()); + result.drawErrorHistory(); fullprint << "evaluation cache hits=" << levelFunction.getCacheHits() << std::endl; fullprint << "evaluation calls number=" << levelFunction.getEvaluationCallsNumber() << std::endl; fullprint << "gradient calls number=" << levelFunction.getGradientCallsNumber() << std::endl; diff --git a/lib/test/t_AliMikhailHaqCopulaFactory_std.cxx b/lib/test/t_AliMikhailHaqCopulaFactory_std.cxx index fac412dbef..4d7bbc1f50 100644 --- a/lib/test/t_AliMikhailHaqCopulaFactory_std.cxx +++ b/lib/test/t_AliMikhailHaqCopulaFactory_std.cxx @@ -36,12 +36,9 @@ int main(int, char *[]) UnsignedInteger size = 1000; Sample sample(distribution.getSample(size)); AliMikhailHaqCopulaFactory factory; - CovarianceMatrix covariance; - // Distribution estimatedDistribution(factory.build(sample, covariance)); Distribution estimatedDistribution(factory.build(sample)); fullprint << "Distribution =" << distribution << std::endl; fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; estimatedDistribution = factory.build(); fullprint << "Default distribution=" << estimatedDistribution << std::endl; estimatedDistribution = factory.build(distribution.getParameter()); diff --git a/lib/test/t_BernoulliFactory_std.cxx b/lib/test/t_BernoulliFactory_std.cxx index e779aca8fc..c11d1fe4cb 100644 --- a/lib/test/t_BernoulliFactory_std.cxx +++ b/lib/test/t_BernoulliFactory_std.cxx @@ -36,12 +36,9 @@ int main(int, char *[]) UnsignedInteger size = 10000; Sample sample(distribution.getSample(size)); BernoulliFactory factory; - CovarianceMatrix covariance; - // Distribution estimatedDistribution(factory.build(sample, covariance)); Distribution estimatedDistribution(factory.build(sample)); fullprint << "Distribution =" << distribution << std::endl; fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; estimatedDistribution = factory.build(); fullprint << "Default distribution=" << estimatedDistribution << std::endl; estimatedDistribution = factory.build(distribution.getParameter()); diff --git a/lib/test/t_BetaFactory_std.cxx b/lib/test/t_BetaFactory_std.cxx index 7dae1371f1..b008098ec3 100644 --- a/lib/test/t_BetaFactory_std.cxx +++ b/lib/test/t_BetaFactory_std.cxx @@ -36,33 +36,24 @@ int main(int, char *[]) UnsignedInteger size = 10000; Sample sample(distribution.getSample(size)); BetaFactory factory; - CovarianceMatrix covariance; - // Distribution estimatedDistribution(factory.build(sample, covariance)); Distribution estimatedDistribution(factory.build(sample)); fullprint << "Distribution =" << distribution << std::endl; fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; distribution = Beta(0.5, 0.8, -1.0, 2.0); sample = distribution.getSample(size); - // estimatedDistribution = factory.build(sample, covariance); estimatedDistribution = factory.build(sample); fullprint << "Distribution =" << distribution << std::endl; fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; distribution = Beta(0.5, 1.8, -1.0, 2.0); sample = distribution.getSample(size); - // estimatedDistribution = factory.build(sample, covariance); estimatedDistribution = factory.build(sample); fullprint << "Distribution =" << distribution << std::endl; fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; distribution = Beta(1.5, 2.8, -1.0, 2.0); sample = distribution.getSample(size); - // estimatedDistribution = factory.build(sample, covariance); estimatedDistribution = factory.build(sample); fullprint << "Distribution =" << distribution << std::endl; fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; estimatedDistribution = factory.build(); fullprint << "Default distribution=" << estimatedDistribution << std::endl; estimatedDistribution = factory.build(distribution.getParameter()); diff --git a/lib/test/t_BinomialFactory_std.cxx b/lib/test/t_BinomialFactory_std.cxx index ac480744c5..0a990fd124 100644 --- a/lib/test/t_BinomialFactory_std.cxx +++ b/lib/test/t_BinomialFactory_std.cxx @@ -36,12 +36,9 @@ int main(int, char *[]) UnsignedInteger size = 10000; Sample sample(distribution.getSample(size)); BinomialFactory factory; - CovarianceMatrix covariance; - // Distribution estimatedDistribution(factory.build(sample, covariance)); Distribution estimatedDistribution(factory.build(sample)); fullprint << "Distribution =" << distribution << std::endl; fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; estimatedDistribution = factory.build(); fullprint << "Default distribution=" << estimatedDistribution << std::endl; estimatedDistribution = factory.build(distribution.getParameter()); diff --git a/lib/test/t_BlockIndependentCopula_std.cxx b/lib/test/t_BlockIndependentCopula_std.cxx index 940c890419..e87288bda6 100644 --- a/lib/test/t_BlockIndependentCopula_std.cxx +++ b/lib/test/t_BlockIndependentCopula_std.cxx @@ -76,9 +76,8 @@ int main(int, char *[]) // Show PDF and CDF of point //Scalar eps(1e-5); - Point DDF = copula.computeDDF( point ); + Point DDF = copula.computeDDF(point); fullprint << "ddf =" << DDF << std::endl; - Point ddfFD(copula.getDimension()); fullprint << "ddf (FD)=" << copula.DistributionImplementation::computeDDF(point) << std::endl; Scalar PDF = copula.computePDF( point ); fullprint << "pdf =" << PDF << std::endl; diff --git a/lib/test/t_BlockIndependentDistribution_std.cxx b/lib/test/t_BlockIndependentDistribution_std.cxx index 4af9f57b88..10b00101da 100644 --- a/lib/test/t_BlockIndependentDistribution_std.cxx +++ b/lib/test/t_BlockIndependentDistribution_std.cxx @@ -60,9 +60,8 @@ int main(int, char *[]) // Show PDF and CDF of point //Scalar eps(1e-5); - Point DDF = distribution.computeDDF( point ); + Point DDF = distribution.computeDDF(point); fullprint << "ddf =" << DDF << std::endl; - Point ddfFD(distribution.getDimension()); fullprint << "ddf (ref)=" << ref.computeDDF(point) << std::endl; Scalar PDF = distribution.computePDF( point ); fullprint << "pdf =" << PDF << std::endl; @@ -127,9 +126,8 @@ int main(int, char *[]) // Show PDF and CDF of point //Scalar eps(1e-5); - Point DDF = distribution.computeDDF( point ); + Point DDF = distribution.computeDDF(point); fullprint << "ddf =" << DDF << std::endl; - Point ddfFD(distribution.getDimension()); fullprint << "ddf (FD)=" << distribution.DistributionImplementation::computeDDF(point) << std::endl; Scalar PDF = distribution.computePDF( point ); fullprint << "pdf =" << PDF << std::endl; diff --git a/lib/test/t_Bonmin_std.cxx b/lib/test/t_Bonmin_std.cxx index 8400feda94..02fdffeac7 100644 --- a/lib/test/t_Bonmin_std.cxx +++ b/lib/test/t_Bonmin_std.cxx @@ -66,9 +66,6 @@ int main() variablesUpperBounds[3] = 5; Interval variablesBounds(variablesLowerBounds, variablesUpperBounds, variablesFiniteLowerBounds, variablesFiniteUpperBounds) ; - // No equality constraints - Function equalityConstraints; - // Definition of inequality constraints: // Bonmin constraints are defined as g_l <= g(x) <= g_u // OpenTURNS' are defined as g(x) >= 0 diff --git a/lib/test/t_BurrFactory_std.cxx b/lib/test/t_BurrFactory_std.cxx index 2de2e961e1..63ba7714b2 100644 --- a/lib/test/t_BurrFactory_std.cxx +++ b/lib/test/t_BurrFactory_std.cxx @@ -36,12 +36,9 @@ int main(int, char *[]) UnsignedInteger size = 10000; Sample sample(distribution.getSample(size)); BurrFactory factory; - CovarianceMatrix covariance; - // Distribution estimatedDistribution(factory.build(sample, covariance)); Distribution estimatedDistribution(factory.build(sample)); fullprint << "Distribution =" << distribution << std::endl; fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; estimatedDistribution = factory.build(); fullprint << "Default distribution=" << estimatedDistribution << std::endl; estimatedDistribution = factory.build(distribution.getParameter()); diff --git a/lib/test/t_ChiFactory_std.cxx b/lib/test/t_ChiFactory_std.cxx index 33c2895da0..38c7d56a6c 100644 --- a/lib/test/t_ChiFactory_std.cxx +++ b/lib/test/t_ChiFactory_std.cxx @@ -36,26 +36,19 @@ int main(int, char *[]) UnsignedInteger size = 10000; Sample sample(distribution.getSample(size)); ChiFactory factory; - CovarianceMatrix covariance; - // Distribution estimatedDistribution(factory.build(sample, covariance)); Distribution estimatedDistribution(factory.build(sample)); fullprint << "Distribution =" << distribution << std::endl; fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; distribution = Chi(1.0); sample = distribution.getSample(size); - // estimatedDistribution = factory.build(sample, covariance); estimatedDistribution = factory.build(sample); fullprint << "Distribution =" << distribution << std::endl; fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; distribution = Chi(2.5); sample = distribution.getSample(size); - // estimatedDistribution = factory.build(sample, covariance); estimatedDistribution = factory.build(sample); fullprint << "Distribution =" << distribution << std::endl; fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; estimatedDistribution = factory.build(); fullprint << "Default distribution=" << estimatedDistribution << std::endl; estimatedDistribution = factory.build(distribution.getParameter()); @@ -63,7 +56,6 @@ int main(int, char *[]) Chi estimatedChi(factory.buildAsChi(sample)); fullprint << "Chi =" << distribution << std::endl; fullprint << "Estimated chi=" << estimatedChi << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; estimatedChi = factory.buildAsChi(); fullprint << "Default chi=" << estimatedChi << std::endl; estimatedChi = factory.buildAsChi(distribution.getParameter()); diff --git a/lib/test/t_ChiSquareFactory_std.cxx b/lib/test/t_ChiSquareFactory_std.cxx index d9a7f63878..b246ad3a6b 100644 --- a/lib/test/t_ChiSquareFactory_std.cxx +++ b/lib/test/t_ChiSquareFactory_std.cxx @@ -36,26 +36,19 @@ int main(int, char *[]) UnsignedInteger size = 10000; Sample sample(distribution.getSample(size)); ChiSquareFactory factory; - CovarianceMatrix covariance; - // Distribution estimatedDistribution(factory.build(sample, covariance)); Distribution estimatedDistribution(factory.build(sample)); fullprint << "Distribution =" << distribution << std::endl; fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; distribution = ChiSquare(1.0); sample = distribution.getSample(size); - // estimatedDistribution = factory.build(sample, covariance); estimatedDistribution = factory.build(sample); fullprint << "Distribution =" << distribution << std::endl; fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; distribution = ChiSquare(2.5); sample = distribution.getSample(size); - // estimatedDistribution = factory.build(sample, covariance); estimatedDistribution = factory.build(sample); fullprint << "Distribution =" << distribution << std::endl; fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; estimatedDistribution = factory.build(); fullprint << "Default distribution=" << estimatedDistribution << std::endl; estimatedDistribution = factory.build(distribution.getParameter()); @@ -63,7 +56,6 @@ int main(int, char *[]) ChiSquare estimatedChiSquare(factory.buildAsChiSquare(sample)); fullprint << "ChiSquare =" << distribution << std::endl; fullprint << "Estimated chiSquare=" << estimatedChiSquare << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; estimatedChiSquare = factory.buildAsChiSquare(); fullprint << "Default chiSquare=" << estimatedChiSquare << std::endl; estimatedChiSquare = factory.buildAsChiSquare(distribution.getParameter()); diff --git a/lib/test/t_ClaytonCopulaFactory_std.cxx b/lib/test/t_ClaytonCopulaFactory_std.cxx index 07e0d16fa8..963fcc0969 100644 --- a/lib/test/t_ClaytonCopulaFactory_std.cxx +++ b/lib/test/t_ClaytonCopulaFactory_std.cxx @@ -36,12 +36,9 @@ int main(int, char *[]) UnsignedInteger size = 1000; Sample sample(distribution.getSample(size)); ClaytonCopulaFactory factory; - CovarianceMatrix covariance; - // Distribution estimatedDistribution(factory.build(sample, covariance)); Distribution estimatedDistribution(factory.build(sample)); fullprint << "Distribution =" << distribution << std::endl; fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; estimatedDistribution = factory.build(); fullprint << "Default distribution=" << estimatedDistribution << std::endl; estimatedDistribution = factory.build(distribution.getParameter()); diff --git a/lib/test/t_Cobyla_std.cxx b/lib/test/t_Cobyla_std.cxx index ec013577d4..60aae8aee9 100644 --- a/lib/test/t_Cobyla_std.cxx +++ b/lib/test/t_Cobyla_std.cxx @@ -86,7 +86,7 @@ int main(int, char *[]) OptimizationResult result(myAlgorithm.getResult()); fullprint << "result = " << printPoint(result.getOptimalPoint(), 4) << std::endl; fullprint << "multipliers = " << printPoint(result.computeLagrangeMultipliers(), 4) << std::endl; - Graph convergence(result.drawErrorHistory()); + result.drawErrorHistory(); //FIXME:fullprint << "evaluation calls number=" << levelFunction.getEvaluationCallsNumber() << std::endl; fullprint << "gradient calls number=" << levelFunction.getGradientCallsNumber() << std::endl; fullprint << "hessian calls number=" << levelFunction.getHessianCallsNumber() << std::endl; diff --git a/lib/test/t_ComparisonOperator_std.cxx b/lib/test/t_ComparisonOperator_std.cxx index 948a842577..527acda227 100644 --- a/lib/test/t_ComparisonOperator_std.cxx +++ b/lib/test/t_ComparisonOperator_std.cxx @@ -59,7 +59,6 @@ int main(int, char *[]) // fullprint << "Greater.compare(20,20) = " << p_operator->compare(20,20) << std::endl; // fullprint << "Greater.compare(30,20) = " << p_operator->compare(30,20) << std::endl; - ComparisonOperator comparisonOperator; ComparisonOperator less = Less(); fullprint << "Less(10,20) = " << less(10, 20) << std::endl; fullprint << "Less(20,20) = " << less(20, 20) << std::endl; diff --git a/lib/test/t_DesignProxy_std.cxx b/lib/test/t_DesignProxy_std.cxx index b3c2fe89e8..a0df44de75 100644 --- a/lib/test/t_DesignProxy_std.cxx +++ b/lib/test/t_DesignProxy_std.cxx @@ -38,8 +38,6 @@ int main(int, char *[]) for (UnsignedInteger i = 0; i < sampleSize; ++i) X(i, 0) = i + 1.0; - Sample Y(sampleSize, 1); - Collection phis; for (UnsignedInteger j = 0; j < basisSize; ++j) phis.add(SymbolicFunction("x", String(OSS() << "x^" << j + 1))); diff --git a/lib/test/t_DiracFactory_std.cxx b/lib/test/t_DiracFactory_std.cxx index d4fe035850..cb66bf0757 100644 --- a/lib/test/t_DiracFactory_std.cxx +++ b/lib/test/t_DiracFactory_std.cxx @@ -36,12 +36,9 @@ int main(int, char *[]) UnsignedInteger size = 10000; Sample sample(distribution.getSample(size)); DiracFactory factory; - CovarianceMatrix covariance; - // Distribution estimatedDistribution(factory.build(sample, covariance)); Distribution estimatedDistribution(factory.build(sample)); fullprint << "Distribution =" << distribution << std::endl; fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; estimatedDistribution = factory.build(); fullprint << "Default distribution=" << estimatedDistribution << std::endl; estimatedDistribution = factory.build(distribution.getParameter()); diff --git a/lib/test/t_DirichletFactory_std.cxx b/lib/test/t_DirichletFactory_std.cxx index 93c09d2e13..350a155eac 100644 --- a/lib/test/t_DirichletFactory_std.cxx +++ b/lib/test/t_DirichletFactory_std.cxx @@ -41,8 +41,6 @@ int main(int, char *[]) UnsignedInteger size = 10000; Sample sample(distribution.getSample(size)); DirichletFactory factory; - CovarianceMatrix covariance; - // Distribution estimatedDistribution(factory.build(sample, covariance)); Distribution estimatedDistribution(factory.build(sample)); fullprint << "Distribution =" << distribution << std::endl; fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; diff --git a/lib/test/t_Distribution_arithmetic.cxx b/lib/test/t_Distribution_arithmetic.cxx index 87972dff2f..6a996bd988 100644 --- a/lib/test/t_Distribution_arithmetic.cxx +++ b/lib/test/t_Distribution_arithmetic.cxx @@ -33,7 +33,6 @@ int main(int, char *[]) try { Normal dist1(1.0, 0.5); - Graph graph; fullprint << "dist1:" << Distribution(dist1) << std::endl; Distribution result; result = dist1 + 2.0; diff --git a/lib/test/t_Distribution_draw.cxx b/lib/test/t_Distribution_draw.cxx index c6a845c5a8..127e5cf115 100644 --- a/lib/test/t_Distribution_draw.cxx +++ b/lib/test/t_Distribution_draw.cxx @@ -37,55 +37,56 @@ int main(int, char *[]) Normal distND(Point(5, 2.0), Point(5, 4.0), CorrelationMatrix(5)); // Check drawing methods for 1D distributions // PDF - Graph graphPDF(dist1D.drawPDF()); - graphPDF = dist1D.drawPDF(-4.0, 4.0, 101); - graphPDF = dist1D.drawPDF(-4.0, 4.0); - graphPDF = dist1D.drawPDF(101); + dist1D.drawPDF(); + dist1D.drawPDF(-4.0, 4.0, 101); + dist1D.drawPDF(-4.0, 4.0); + dist1D.drawPDF(101); // log-PDF - Graph graphLogPDF(dist1D.drawLogPDF()); - graphLogPDF = dist1D.drawLogPDF(-4.0, 4.0, 101); - graphLogPDF = dist1D.drawLogPDF(-4.0, 4.0); - graphLogPDF = dist1D.drawLogPDF(101); + dist1D.drawLogPDF(); + dist1D.drawLogPDF(-4.0, 4.0, 101); + dist1D.drawLogPDF(-4.0, 4.0); + dist1D.drawLogPDF(101); // CDF - Graph graphCDF(dist1D.drawCDF()); - graphCDF = dist1D.drawCDF(-4.0, 4.0, 101); - graphCDF = dist1D.drawCDF(-4.0, 4.0); - graphCDF = dist1D.drawCDF(101); - Graph graphQuantile(dist1D.drawQuantile()); - graphQuantile = dist1D.drawQuantile(101); - graphQuantile = dist1D.drawQuantile(0.1, 0.9, 101); - graphQuantile = dist1D.drawQuantile(0.1, 0.9); + dist1D.drawCDF(); + dist1D.drawCDF(-4.0, 4.0, 101); + dist1D.drawCDF(-4.0, 4.0); + dist1D.drawCDF(101); + // quantile + dist1D.drawQuantile(); + dist1D.drawQuantile(101); + dist1D.drawQuantile(0.1, 0.9, 101); + dist1D.drawQuantile(0.1, 0.9); // Check drawing methods for 2D distributions // PDF - graphPDF = dist2D.drawPDF(); - graphPDF = dist2D.drawPDF(Point(2, -4.0), Point(2, 4.0), Indices(2, 101)); - graphPDF = dist2D.drawPDF(Point(2, -4.0), Point(2, 4.0)); - graphPDF = dist2D.drawPDF(Indices(2, 101)); + dist2D.drawPDF(); + dist2D.drawPDF(Point(2, -4.0), Point(2, 4.0), Indices(2, 101)); + dist2D.drawPDF(Point(2, -4.0), Point(2, 4.0)); + dist2D.drawPDF(Indices(2, 101)); // log-PDF - graphLogPDF = dist2D.drawLogPDF(); - graphLogPDF = dist2D.drawLogPDF(Point(2, -4.0), Point(2, 4.0), Indices(2, 101)); - graphLogPDF = dist2D.drawPDF(Point(2, -4.0), Point(2, 4.0)); - graphLogPDF = dist2D.drawLogPDF(Indices(2, 101)); + dist2D.drawLogPDF(); + dist2D.drawLogPDF(Point(2, -4.0), Point(2, 4.0), Indices(2, 101)); + dist2D.drawPDF(Point(2, -4.0), Point(2, 4.0)); + dist2D.drawLogPDF(Indices(2, 101)); // CDF - graphCDF = dist2D.drawCDF(); - graphCDF = dist2D.drawCDF(Point(2, -4.0), Point(2, 4.0), Indices(2, 101)); - graphCDF = dist2D.drawCDF(Point(2, -4.0), Point(2, 4.0)); - graphCDF = dist2D.drawCDF(Indices(2, 101)); + dist2D.drawCDF(); + dist2D.drawCDF(Point(2, -4.0), Point(2, 4.0), Indices(2, 101)); + dist2D.drawCDF(Point(2, -4.0), Point(2, 4.0)); + dist2D.drawCDF(Indices(2, 101)); // Check drawing methods for ND distributions // PDF - graphPDF = distND.drawMarginal1DPDF(2, -4.0, 4.0, 101); - graphPDF = distND.drawMarginal2DPDF(2, 3, Point(2, -4.0), Point(2, 4.0), Indices(2, 101)); + distND.drawMarginal1DPDF(2, -4.0, 4.0, 101); + distND.drawMarginal2DPDF(2, 3, Point(2, -4.0), Point(2, 4.0), Indices(2, 101)); // log-PDF - graphLogPDF = distND.drawMarginal1DLogPDF(2, -4.0, 4.0, 101); - graphLogPDF = distND.drawMarginal2DLogPDF(2, 3, Point(2, -4.0), Point(2, 4.0), Indices(2, 101)); + distND.drawMarginal1DLogPDF(2, -4.0, 4.0, 101); + distND.drawMarginal2DLogPDF(2, 3, Point(2, -4.0), Point(2, 4.0), Indices(2, 101)); // CDF - graphCDF = distND.drawMarginal1DCDF(2, -4.0, 4.0, 101); - graphCDF = distND.drawMarginal2DCDF(2, 3, Point(2, -4.0), Point(2, 4.0), Indices(2, 101)); + distND.drawMarginal1DCDF(2, -4.0, 4.0, 101); + distND.drawMarginal2DCDF(2, 3, Point(2, -4.0), Point(2, 4.0), Indices(2, 101)); // Quantile - graphQuantile = dist2D.drawQuantile(); - graphQuantile = dist2D.drawQuantile(101); - graphQuantile = dist2D.drawQuantile(0.1, 0.9, 101); - graphQuantile = dist2D.drawQuantile(0.1, 0.9); + dist2D.drawQuantile(); + dist2D.drawQuantile(101); + dist2D.drawQuantile(0.1, 0.9, 101); + dist2D.drawQuantile(0.1, 0.9); } catch (TestFailed & ex) { diff --git a/lib/test/t_Dlib_global.cxx b/lib/test/t_Dlib_global.cxx index cf954dcce9..be5fb8228b 100644 --- a/lib/test/t_Dlib_global.cxx +++ b/lib/test/t_Dlib_global.cxx @@ -69,10 +69,7 @@ int main() Function(), constrainingBounds); /** REFERENCE POINTS **/ - Point unboundedRefPoint(2, 0.0); - Point boundedRefPoint(2); - boundedRefPoint[0] = 0.0; - boundedRefPoint[1] = -1.0; + Point boundedRefPoint = {0.0, -1.0}; // ============================================================================================================================= // diff --git a/lib/test/t_ExponentialFactory_std.cxx b/lib/test/t_ExponentialFactory_std.cxx index 852f2e8605..94d865f013 100644 --- a/lib/test/t_ExponentialFactory_std.cxx +++ b/lib/test/t_ExponentialFactory_std.cxx @@ -36,12 +36,9 @@ int main(int, char *[]) UnsignedInteger size = 10000; Sample sample(distribution.getSample(size)); ExponentialFactory factory; - CovarianceMatrix covariance; - // Distribution estimatedDistribution(factory.build(sample, covariance)); Distribution estimatedDistribution(factory.build(sample)); fullprint << "Distribution =" << distribution << std::endl; fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; estimatedDistribution = factory.build(); fullprint << "Default distribution=" << estimatedDistribution << std::endl; estimatedDistribution = factory.build(distribution.getParameter()); @@ -49,7 +46,6 @@ int main(int, char *[]) Exponential estimatedExponential(factory.buildAsExponential(sample)); fullprint << "Exponential =" << distribution << std::endl; fullprint << "Estimated exponential=" << estimatedExponential << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; estimatedExponential = factory.buildAsExponential(); fullprint << "Default exponential=" << estimatedExponential << std::endl; estimatedExponential = factory.buildAsExponential(distribution.getParameter()); diff --git a/lib/test/t_FORM_draw.cxx b/lib/test/t_FORM_draw.cxx index 63195ca8bc..aa3a9f95f7 100644 --- a/lib/test/t_FORM_draw.cxx +++ b/lib/test/t_FORM_draw.cxx @@ -111,17 +111,17 @@ int main(int, char *[]) fullprint << "importance factors (classical)=" << printPoint(result.getImportanceFactors(AnalyticalResult::CLASSICAL), digits) << std::endl; /* Graph 1 : Importance Factors graph */ - Graph importanceFactorsGraph(result.drawImportanceFactors()); + result.drawImportanceFactors(); /* Graph 1bis : Importance Factors graph */ - Graph classicalImportanceFactorsGraph(result.drawImportanceFactors(AnalyticalResult::CLASSICAL)); + result.drawImportanceFactors(AnalyticalResult::CLASSICAL); /* Graph 2 : Hasofer Reliability Index Sensitivity Graphs graph */ - AnalyticalResult::GraphCollection reliabilityIndexSensitivityGraphs(result.drawHasoferReliabilityIndexSensitivity()); + result.drawHasoferReliabilityIndexSensitivity(); /* Graph 3 : FORM Event Probability Sensitivity Graphs graph */ - AnalyticalResult::GraphCollection eventProbabilitySensitivityGraphs(result.drawEventProbabilitySensitivity()); + result.drawEventProbabilitySensitivity(); } catch (TestFailed & ex) diff --git a/lib/test/t_FarlieGumbelMorgensternCopulaFactory_std.cxx b/lib/test/t_FarlieGumbelMorgensternCopulaFactory_std.cxx index 5bb5a3173c..edb1505373 100644 --- a/lib/test/t_FarlieGumbelMorgensternCopulaFactory_std.cxx +++ b/lib/test/t_FarlieGumbelMorgensternCopulaFactory_std.cxx @@ -36,12 +36,9 @@ int main(int, char *[]) UnsignedInteger size = 1000; Sample sample(distribution.getSample(size)); FarlieGumbelMorgensternCopulaFactory factory; - CovarianceMatrix covariance; - // Distribution estimatedDistribution(factory.build(sample, covariance)); Distribution estimatedDistribution(factory.build(sample)); fullprint << "Distribution =" << distribution << std::endl; fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; estimatedDistribution = factory.build(); fullprint << "Default distribution=" << estimatedDistribution << std::endl; estimatedDistribution = factory.build(distribution.getParameter()); diff --git a/lib/test/t_Field_draw.cxx b/lib/test/t_Field_draw.cxx index a715264d7b..d5ea199bf2 100644 --- a/lib/test/t_Field_draw.cxx +++ b/lib/test/t_Field_draw.cxx @@ -38,25 +38,25 @@ int main(int, char *[]) Mesh mesh(IntervalMesher(Indices(1, 10)).build(Interval(-2.0, 2.0))); SymbolicFunction function("x", "x"); Field field(mesh, function(mesh.getVertices())); - Graph graph(field.draw()); - graph = field.drawMarginal(0, false); - graph = field.drawMarginal(0, true); + field.draw(); + field.drawMarginal(0, false); + field.drawMarginal(0, true); } // A 2D->1D field { Mesh mesh(IntervalMesher(Indices(2, 10)).build(Interval(Point(2, -2.0), Point(2, 2.0)))); SymbolicFunction function(Description::BuildDefault(2, "x"), Description(1, "x0+x1")); Field field(mesh, function(mesh.getVertices())); - Graph graph(field.draw()); - graph = field.drawMarginal(0, false); - graph = field.drawMarginal(0, true); + field.draw(); + field.drawMarginal(0, false); + field.drawMarginal(0, true); } // A 2D->2D field { Mesh mesh(IntervalMesher(Indices(2, 10)).build(Interval(Point(2, -2.0), Point(2, 2.0)))); SymbolicFunction function(Description::BuildDefault(2, "x"), Description::BuildDefault(2, "x")); Field field(mesh, function(mesh.getVertices())); - Graph graph(field.draw()); + field.draw(); } } catch (TestFailed & ex) diff --git a/lib/test/t_FisherSnedecorFactory_std.cxx b/lib/test/t_FisherSnedecorFactory_std.cxx index cc1a2f0467..b972f659fb 100644 --- a/lib/test/t_FisherSnedecorFactory_std.cxx +++ b/lib/test/t_FisherSnedecorFactory_std.cxx @@ -37,12 +37,9 @@ int main(int, char *[]) UnsignedInteger size = 10000; Sample sample(distribution.getSample(size)); FisherSnedecorFactory factory; - CovarianceMatrix covariance; - // Distribution estimatedDistribution(factory.build(sample, covariance)); Distribution estimatedDistribution(factory.build(sample)); fullprint << "Distribution =" << distribution << std::endl; fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; estimatedDistribution = factory.build(); fullprint << "Default distribution=" << estimatedDistribution << std::endl; estimatedDistribution = factory.build(distribution.getParameter()); diff --git a/lib/test/t_FrankCopulaFactory_std.cxx b/lib/test/t_FrankCopulaFactory_std.cxx index 36ec840f30..95b2a0e247 100644 --- a/lib/test/t_FrankCopulaFactory_std.cxx +++ b/lib/test/t_FrankCopulaFactory_std.cxx @@ -36,12 +36,9 @@ int main(int, char *[]) UnsignedInteger size = 1000; Sample sample(distribution.getSample(size)); FrankCopulaFactory factory; - CovarianceMatrix covariance; - // Distribution estimatedDistribution(factory.build(sample, covariance)); Distribution estimatedDistribution(factory.build(sample)); fullprint << "Distribution =" << distribution << std::endl; fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; estimatedDistribution = factory.build(); fullprint << "Default distribution=" << estimatedDistribution << std::endl; estimatedDistribution = factory.build(distribution.getParameter()); diff --git a/lib/test/t_FrechetFactory_std.cxx b/lib/test/t_FrechetFactory_std.cxx index 3c42dc7587..6851563356 100644 --- a/lib/test/t_FrechetFactory_std.cxx +++ b/lib/test/t_FrechetFactory_std.cxx @@ -36,12 +36,9 @@ int main(int, char *[]) UnsignedInteger size = 10000; Sample sample(distribution.getSample(size)); FrechetFactory factory; - CovarianceMatrix covariance; - // Distribution estimatedDistribution(factory.build(sample, covariance)); Distribution estimatedDistribution(factory.build(sample)); fullprint << "Distribution =" << distribution << std::endl; fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; estimatedDistribution = factory.build(); fullprint << "Default distribution=" << estimatedDistribution << std::endl; estimatedDistribution = factory.build(distribution.getParameter()); diff --git a/lib/test/t_Function_operations.cxx b/lib/test/t_Function_operations.cxx index a4a3aebf7c..5ee57df8fb 100644 --- a/lib/test/t_Function_operations.cxx +++ b/lib/test/t_Function_operations.cxx @@ -64,7 +64,6 @@ int main(int, char *[]) // Sum/difference // First, build two functions from R^3->R^2 Description inVar(Description::BuildDefault(3, "x")); - Description outVar(Description::BuildDefault(2, "y")); Description formula(2); formula[0] = "x0 + 2 * x1 * x2 + 3 * x2"; formula[1] = "x2 - x0 + x1 * x0"; diff --git a/lib/test/t_Function_std.cxx b/lib/test/t_Function_std.cxx index 186cd091a6..1276688d4b 100644 --- a/lib/test/t_Function_std.cxx +++ b/lib/test/t_Function_std.cxx @@ -48,6 +48,7 @@ int main(int, char *[]) /** Copy constructor */ Function newFunc(myFunc); + (void)newFunc; fullprint << "myFunc=" << myFunc << std::endl; Point point(myFunc.getInputDimension(), 1.2); diff --git a/lib/test/t_FunctionalChaos_ishigami_database.cxx b/lib/test/t_FunctionalChaos_ishigami_database.cxx index 511454564c..b627c9c7b2 100644 --- a/lib/test/t_FunctionalChaos_ishigami_database.cxx +++ b/lib/test/t_FunctionalChaos_ishigami_database.cxx @@ -57,7 +57,6 @@ int main(int, char *[]) sob_T2[0] = sob_2[0] + sob_2[1] + sob_3[0]; sob_T2[1] = sob_2[0] + sob_2[2] + sob_3[0]; sob_T2[2] = sob_2[1] + sob_2[2] + sob_3[0]; - Point sob_T3(sob_3); // Create the Ishigami function Description inputVariables(dimension); inputVariables[0] = "xi1"; diff --git a/lib/test/t_FunctionalChaos_ishigami_sparse.cxx b/lib/test/t_FunctionalChaos_ishigami_sparse.cxx index d7e3c6ae11..ba354762a2 100644 --- a/lib/test/t_FunctionalChaos_ishigami_sparse.cxx +++ b/lib/test/t_FunctionalChaos_ishigami_sparse.cxx @@ -54,7 +54,6 @@ int main(int, char *[]) sob_T2[0] = sob_2[0] + sob_2[1] + sob_3[0]; sob_T2[1] = sob_2[0] + sob_2[2] + sob_3[0]; sob_T2[2] = sob_2[1] + sob_2[2] + sob_3[0]; - Point sob_T3(sob_3); // Create the Ishigami function Description inputVariables(dimension); inputVariables[0] = "xi1"; diff --git a/lib/test/t_GeneralLinearModelAlgorithm_std_hmat.cxx b/lib/test/t_GeneralLinearModelAlgorithm_std_hmat.cxx index afc363abb1..1919eed940 100644 --- a/lib/test/t_GeneralLinearModelAlgorithm_std_hmat.cxx +++ b/lib/test/t_GeneralLinearModelAlgorithm_std_hmat.cxx @@ -67,7 +67,7 @@ int main(int, char *[]) Y(i, 0) += 0.01 * DistFunc::rNormal(); } // Add a small noise to data - Sample Y2 = model(X2); + model(X2); Basis basis = LinearBasisFactory(inputDimension).build(); DiracCovarianceModel covarianceModel(inputDimension); @@ -77,7 +77,7 @@ int main(int, char *[]) // perform an evaluation GeneralLinearModelResult result = algo.getResult(); Function metaModel = result.getMetaModel(); - CovarianceModel conditionalCovariance = result.getCovarianceModel(); + result.getCovarianceModel(); const Sample residual = metaModel(X) - Y; assert_almost_equal(residual.computeCentralMoment(2), Point(1, 0.00013144), 1e-5, 1e-5); std::cout << "Test Ok" << std::endl; diff --git a/lib/test/t_GeneralizedParetoFactory_std.cxx b/lib/test/t_GeneralizedParetoFactory_std.cxx index ffd67ec40e..b256af1b6b 100644 --- a/lib/test/t_GeneralizedParetoFactory_std.cxx +++ b/lib/test/t_GeneralizedParetoFactory_std.cxx @@ -37,21 +37,18 @@ int main(int, char *[]) xi[1] = 0.0; xi[2] = 0.75; UnsignedInteger size = 10000; - CovarianceMatrix covariance; GeneralizedParetoFactory factory; GeneralizedPareto distribution; for (UnsignedInteger i = 0; i < 3; ++i) { distribution = GeneralizedPareto(2.5, xi[i], 0.5); Sample sample(distribution.getSample(size)); - // Distribution estimatedDistribution(factory.build(sample, covariance)); Distribution estimatedDistribution(factory.build(sample)); fullprint << "Distribution =" << distribution << std::endl; fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; GeneralizedPareto estimatedGeneralizedPareto(factory.buildAsGeneralizedPareto(sample)); fullprint << "GeneralizedPareto =" << distribution << std::endl; fullprint << "Estimated generalizedPareto=" << estimatedGeneralizedPareto << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; } Distribution estimatedDistribution(factory.build()); fullprint << "Default distribution=" << estimatedDistribution << std::endl; diff --git a/lib/test/t_GeometricFactory_std.cxx b/lib/test/t_GeometricFactory_std.cxx index 9e66a84a29..5d3ee789a0 100644 --- a/lib/test/t_GeometricFactory_std.cxx +++ b/lib/test/t_GeometricFactory_std.cxx @@ -36,12 +36,9 @@ int main(int, char *[]) UnsignedInteger size = 10000; Sample sample(distribution.getSample(size)); GeometricFactory factory; - CovarianceMatrix covariance; - // Distribution estimatedDistribution(factory.build(sample, covariance)); Distribution estimatedDistribution(factory.build(sample)); fullprint << "Distribution =" << distribution << std::endl; fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; estimatedDistribution = factory.build(); fullprint << "Default distribution=" << estimatedDistribution << std::endl; estimatedDistribution = factory.build(distribution.getParameter()); diff --git a/lib/test/t_Gibbs_regression.cxx b/lib/test/t_Gibbs_regression.cxx index 4f1b344959..b0f0688b9e 100644 --- a/lib/test/t_Gibbs_regression.cxx +++ b/lib/test/t_Gibbs_regression.cxx @@ -123,7 +123,6 @@ int main(int, char *[]) indices.fill(3000, 1); Point x_mu(sample.select(indices).computeMean()); - Point x_sigma(sample.select(indices).computeStandardDeviation()); // compute covariance CovarianceMatrix x_cov(sample.computeCovariance()); diff --git a/lib/test/t_GumbelCopulaFactory_std.cxx b/lib/test/t_GumbelCopulaFactory_std.cxx index 297aa98c7d..932ecb1ab6 100644 --- a/lib/test/t_GumbelCopulaFactory_std.cxx +++ b/lib/test/t_GumbelCopulaFactory_std.cxx @@ -36,12 +36,9 @@ int main(int, char *[]) UnsignedInteger size = 1000; Sample sample(distribution.getSample(size)); GumbelCopulaFactory factory; - CovarianceMatrix covariance; - // Distribution estimatedDistribution(factory.build(sample, covariance)); Distribution estimatedDistribution(factory.build(sample)); fullprint << "Distribution =" << distribution << std::endl; fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; estimatedDistribution = factory.build(); fullprint << "Default distribution=" << estimatedDistribution << std::endl; estimatedDistribution = factory.build(distribution.getParameter()); diff --git a/lib/test/t_GumbelFactory_std.cxx b/lib/test/t_GumbelFactory_std.cxx index 06db149758..0670bc0fb6 100644 --- a/lib/test/t_GumbelFactory_std.cxx +++ b/lib/test/t_GumbelFactory_std.cxx @@ -36,12 +36,9 @@ int main(int, char *[]) UnsignedInteger size = 10000; Sample sample(distribution.getSample(size)); GumbelFactory factory; - CovarianceMatrix covariance; - // Distribution estimatedDistribution(factory.build(sample, covariance)); Distribution estimatedDistribution(factory.build(sample)); fullprint << "Distribution =" << distribution << std::endl; fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; estimatedDistribution = factory.build(); fullprint << "Default distribution=" << estimatedDistribution << std::endl; estimatedDistribution = factory.build(distribution.getParameter()); diff --git a/lib/test/t_HypothesisTest_std.cxx b/lib/test/t_HypothesisTest_std.cxx index 4d5be5860d..3688798929 100644 --- a/lib/test/t_HypothesisTest_std.cxx +++ b/lib/test/t_HypothesisTest_std.cxx @@ -42,7 +42,6 @@ int main(int, char *[]) Sample sample(distribution.getSample(size)); Indices indices(dim - 1); indices.fill(1, 1); - Sample sampleX(sample.getMarginal(indices)); Sample sampleY(sample.getMarginal(0)); Sample sampleZ(SymbolicFunction("x", "x^2")(sampleY)); diff --git a/lib/test/t_Indices_std.cxx b/lib/test/t_Indices_std.cxx index b3fbef34ec..6a9dd9aa88 100644 --- a/lib/test/t_Indices_std.cxx +++ b/lib/test/t_Indices_std.cxx @@ -52,29 +52,19 @@ int main(int, char *[]) // Test contains() Indices indices3 = {}; - assert(!indices3.contains(0)); - assert(!indices3.contains(1)); - assert(!indices3.contains(2)); + if(indices3.contains(0)) throw InvalidArgumentException(HERE) << "contains(0)"; + if(indices3.contains(1)) throw InvalidArgumentException(HERE) << "contains(1)"; Indices indices4 = {1, 2, 3}; - assert(indices4.contains(1)); - assert(indices4.contains(2)); - assert(indices4.contains(3)); - assert(!indices4.contains(0)); - assert(!indices4.contains(4)); - Indices indices5 = {3, 5, 7}; - assert(indices5.contains(3)); - assert(indices5.contains(5)); - assert(indices5.contains(7)); - assert(!indices5.contains(0)); - assert(!indices5.contains(1)); + if(!indices4.contains(1)) throw InvalidArgumentException(HERE) << "contains(1)"; + if(indices4.contains(4)) throw InvalidArgumentException(HERE) << "contains(4)"; // Test normInf() and norm1() Indices indices6 = {}; - assert(indices6.normInf() == 0); - assert(indices6.norm1() == 0); + if(indices6.normInf() != 0.0) throw InvalidArgumentException(HERE) << "norm"; + if(indices6.norm1() != 0.0) throw InvalidArgumentException(HERE) << "norm"; Indices indices7 = {1, 2, 3}; - assert(indices7.normInf() == 3); - assert(indices7.norm1() == 6); + if(indices7.normInf() != 3.0) throw InvalidArgumentException(HERE) << "norm"; + if(indices7.norm1() != 6.0) throw InvalidArgumentException(HERE) << "norm"; } catch (TestFailed & ex) diff --git a/lib/test/t_InverseNormalFactory_std.cxx b/lib/test/t_InverseNormalFactory_std.cxx index 4d307f2715..97c8d792a1 100644 --- a/lib/test/t_InverseNormalFactory_std.cxx +++ b/lib/test/t_InverseNormalFactory_std.cxx @@ -36,8 +36,6 @@ int main(int, char *[]) UnsignedInteger size = 10000; Sample sample(distribution.getSample(size)); InverseNormalFactory factory; - CovarianceMatrix covariance; - // Distribution estimatedDistribution(factory.build(sample, covariance)); Distribution estimatedDistribution(factory.build(sample)); fullprint << "Distribution =" << distribution << std::endl; fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; @@ -46,7 +44,6 @@ int main(int, char *[]) fullprint << "Distribution =" << distribution << std::endl; fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; ResourceMap::Set("InverseNormalFactory-Method", "MLE"); - // fullprint << "Covariance=" << covariance << std::endl; estimatedDistribution = factory.build(); fullprint << "Default distribution=" << estimatedDistribution << std::endl; estimatedDistribution = factory.build(distribution.getParameter()); diff --git a/lib/test/t_IterativeMoments_std.cxx b/lib/test/t_IterativeMoments_std.cxx index 7a1f51edea..63f66cd6e2 100644 --- a/lib/test/t_IterativeMoments_std.cxx +++ b/lib/test/t_IterativeMoments_std.cxx @@ -83,7 +83,7 @@ void test_MainFeatures() Point referenceMixedMean = mixedSample.computeMean(); Point referenceMixedVariance = mixedSample.computeVariance(); Point referenceMixedSkewness = mixedSample.computeSkewness(); - Point referenceMixedKurtosis = mixedSample.computeKurtosis(); + //Point referenceMixedKurtosis = mixedSample.computeKurtosis(); /* Here we declare an iterative object of maximum order 3 */ IterativeMoments iterMoments3(3, dimension); diff --git a/lib/test/t_JointDistribution_large.cxx b/lib/test/t_JointDistribution_large.cxx index 0496da54af..4fd433c71d 100644 --- a/lib/test/t_JointDistribution_large.cxx +++ b/lib/test/t_JointDistribution_large.cxx @@ -65,8 +65,8 @@ int main(int, char *[]) fullprint << "Independent copula= " << (distribution.hasIndependentCopula() ? "true" : "false") << std::endl; // Test for sampling - UnsignedInteger size = 10; - Sample anotherSample = distribution.getSample( size ); + const UnsignedInteger size = 10; + distribution.getSample(size); // Define a point Point zero(dimension, 0.0); diff --git a/lib/test/t_KarhunenLoeveP1Algorithm_std.cxx b/lib/test/t_KarhunenLoeveP1Algorithm_std.cxx index e2451f0ca5..c38d56e211 100644 --- a/lib/test/t_KarhunenLoeveP1Algorithm_std.cxx +++ b/lib/test/t_KarhunenLoeveP1Algorithm_std.cxx @@ -120,10 +120,10 @@ int main(int, char *[]) algo.run(); KarhunenLoeveResult result(algo.getResult()); Point lambda(result.getEigenvalues()); - ProcessSample KLModesPS(result.getModesAsProcessSample()); + //ProcessSample KLModesPS(result.getModesAsProcessSample()); // The output is hidden due to near-zero nonreproducible values //fullprint << "KL modes (process sample)=" << KLModesPS << std::endl; - ProcessSample KLScaledModesPS(result.getScaledModesAsProcessSample()); + //ProcessSample KLScaledModesPS(result.getScaledModesAsProcessSample()); // The output is hidden due to near-zero nonreproducible values //fullprint << "KL scaled modes (process sample)=" << KLScaledModesPS << std::endl; Basis KLModes(result.getModes()); diff --git a/lib/test/t_KarhunenLoeveQuadratureAlgorithm_std.cxx b/lib/test/t_KarhunenLoeveQuadratureAlgorithm_std.cxx index 3ae7f538b8..cd8dc24448 100644 --- a/lib/test/t_KarhunenLoeveQuadratureAlgorithm_std.cxx +++ b/lib/test/t_KarhunenLoeveQuadratureAlgorithm_std.cxx @@ -75,7 +75,7 @@ int main(int, char *[]) // fullprint << "KL coefficients=" << coefficients << std::endl; KLFunctions = result.getModes(); // fullprint << "KL functions=" << KLFunctions.__str__() << std::endl; - Function lifted(result.lift(coefficients[0])); + result.lift(coefficients[0]); // fullprint << "KL lift=" << lifted.__str__() << std::endl; Field liftedAsField(result.liftAsField(coefficients[0])); // fullprint << "KL lift as field=" << liftedAsField << std::endl; @@ -97,7 +97,7 @@ int main(int, char *[]) // fullprint << "KL coefficients=" << coefficients << std::endl; KLFunctions = result.getModes(); // fullprint << "KL functions=" << KLFunctions.__str__() << std::endl; - Function lifted(result.lift(coefficients[0])); + result.lift(coefficients[0]); // fullprint << "KL lift=" << lifted.__str__() << std::endl; Field liftedAsField(result.liftAsField(coefficients[0])); // fullprint << "KL lift as field=" << liftedAsField << std::endl; diff --git a/lib/test/t_KernelSmoothing_std.cxx b/lib/test/t_KernelSmoothing_std.cxx index e263e24caa..b965135e19 100644 --- a/lib/test/t_KernelSmoothing_std.cxx +++ b/lib/test/t_KernelSmoothing_std.cxx @@ -133,7 +133,6 @@ int main(int, char *[]) Point right(2); right[0] = 0.9; right[1] = 1.9; - Point lowerBound(2); for (UnsignedInteger nDist = 0; nDist < coll.getSize(); ++nDist) { const Distribution baseDistribution(coll[nDist]); diff --git a/lib/test/t_KrigingAlgorithm_std_hmat.cxx b/lib/test/t_KrigingAlgorithm_std_hmat.cxx index 7426087308..ae8ae740e3 100644 --- a/lib/test/t_KrigingAlgorithm_std_hmat.cxx +++ b/lib/test/t_KrigingAlgorithm_std_hmat.cxx @@ -61,7 +61,7 @@ int main(int, char *[]) X2(0, 0) = 2.0; X2(1, 0) = 4.0; Sample Y(model(X)); - Sample Y2(model(X2)); + model(X2); Basis basis(ConstantBasisFactory(dimension).build()); SquaredExponential covarianceModel(Point(1, 1e-02), Point(1, 4.50736)); diff --git a/lib/test/t_LARS_std.cxx b/lib/test/t_LARS_std.cxx index 0c258e978a..28bdcfbfc1 100644 --- a/lib/test/t_LARS_std.cxx +++ b/lib/test/t_LARS_std.cxx @@ -53,7 +53,6 @@ int main(int, char *[]) sob_T2[0] = sob_2[0] + sob_2[1] + sob_3[0]; sob_T2[1] = sob_2[0] + sob_2[2] + sob_3[0]; sob_T2[2] = sob_2[1] + sob_2[2] + sob_3[0]; - Point sob_T3(sob_3); // Create the Ishigami function Description inputVariables(dimension); inputVariables[0] = "xi1"; diff --git a/lib/test/t_LaplaceFactory_std.cxx b/lib/test/t_LaplaceFactory_std.cxx index d9d3471bdc..8cbf2f8fa8 100644 --- a/lib/test/t_LaplaceFactory_std.cxx +++ b/lib/test/t_LaplaceFactory_std.cxx @@ -36,12 +36,9 @@ int main(int, char *[]) UnsignedInteger size = 10000; Sample sample(distribution.getSample(size)); LaplaceFactory factory; - CovarianceMatrix covariance; - // Distribution estimatedDistribution(factory.build(sample, covariance)); Distribution estimatedDistribution(factory.build(sample)); fullprint << "Distribution =" << distribution << std::endl; fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; estimatedDistribution = factory.build(); fullprint << "Default distribution=" << estimatedDistribution << std::endl; estimatedDistribution = factory.build(distribution.getParameter()); diff --git a/lib/test/t_LogNormalFactory_std.cxx b/lib/test/t_LogNormalFactory_std.cxx index 5df9ff9ee2..309c552358 100644 --- a/lib/test/t_LogNormalFactory_std.cxx +++ b/lib/test/t_LogNormalFactory_std.cxx @@ -37,8 +37,6 @@ int main(int, char *[]) UnsignedInteger size = 10000; Sample sample(distribution.getSample(size)); LogNormalFactory factory; - CovarianceMatrix covariance; - // Distribution estimatedDistribution(factory.build(sample, covariance)); Distribution estimatedDistribution(factory.build(sample)); fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; estimatedDistribution = factory.build(sample, 0); @@ -47,7 +45,6 @@ int main(int, char *[]) fullprint << "Estimated distribution (modified moments)=" << estimatedDistribution << std::endl; estimatedDistribution = factory.build(sample, 2); fullprint << "Estimated distribution (moments)=" << estimatedDistribution << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; estimatedDistribution = factory.build(); fullprint << "Default distribution=" << estimatedDistribution << std::endl; estimatedDistribution = factory.build(distribution.getParameter()); diff --git a/lib/test/t_LogUniformFactory_std.cxx b/lib/test/t_LogUniformFactory_std.cxx index 5379521fa0..f64f9a7332 100644 --- a/lib/test/t_LogUniformFactory_std.cxx +++ b/lib/test/t_LogUniformFactory_std.cxx @@ -36,12 +36,9 @@ int main(int, char *[]) UnsignedInteger size = 10000; Sample sample(distribution.getSample(size)); LogUniformFactory factory; - CovarianceMatrix covariance; - // Distribution estimatedDistribution(factory.build(sample, covariance)); Distribution estimatedDistribution(factory.build(sample)); fullprint << "Distribution =" << distribution << std::endl; fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; estimatedDistribution = factory.build(); fullprint << "Default distribution=" << estimatedDistribution << std::endl; estimatedDistribution = factory.build(distribution.getParameter()); diff --git a/lib/test/t_LogisticFactory_std.cxx b/lib/test/t_LogisticFactory_std.cxx index 33ffe10309..1f80a8604d 100644 --- a/lib/test/t_LogisticFactory_std.cxx +++ b/lib/test/t_LogisticFactory_std.cxx @@ -36,12 +36,9 @@ int main(int, char *[]) UnsignedInteger size = 10000; Sample sample(distribution.getSample(size)); LogisticFactory factory; - CovarianceMatrix covariance; - // Distribution estimatedDistribution(factory.build(sample, covariance)); Distribution estimatedDistribution(factory.build(sample)); fullprint << "Distribution =" << distribution << std::endl; fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; estimatedDistribution = factory.build(); fullprint << "Default distribution=" << estimatedDistribution << std::endl; estimatedDistribution = factory.build(distribution.getParameter()); diff --git a/lib/test/t_MaximumLikelihoodFactory_std.cxx b/lib/test/t_MaximumLikelihoodFactory_std.cxx index 79d0058e35..830ef59a14 100644 --- a/lib/test/t_MaximumLikelihoodFactory_std.cxx +++ b/lib/test/t_MaximumLikelihoodFactory_std.cxx @@ -36,12 +36,9 @@ int main(int, char *[]) UnsignedInteger size = 10000; Sample sample(distribution.getSample(size)); UniformFactory factory; - CovarianceMatrix covariance; - // Distribution estimatedDistribution(factory.build(sample, covariance)); Distribution estimatedDistribution(factory.build(sample)); fullprint << "Distribution =" << distribution << std::endl; fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; estimatedDistribution = factory.build(); fullprint << "Default distribution=" << estimatedDistribution << std::endl; estimatedDistribution = factory.build(distribution.getParameter()); diff --git a/lib/test/t_MeixnerDistributionFactory_std.cxx b/lib/test/t_MeixnerDistributionFactory_std.cxx index 174b8fd08b..80078f5278 100644 --- a/lib/test/t_MeixnerDistributionFactory_std.cxx +++ b/lib/test/t_MeixnerDistributionFactory_std.cxx @@ -42,12 +42,9 @@ int main(int, char *[]) UnsignedInteger size = 1000; Sample sample(distribution.getSample(size)); MeixnerDistributionFactory factory; - CovarianceMatrix covariance; - // Distribution estimatedDistribution(factory.build(sample, covariance)); Distribution estimatedDistribution(factory.build(sample)); fullprint << "Distribution =" << distribution << std::endl; fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; estimatedDistribution = factory.build(); fullprint << "Default distribution=" << estimatedDistribution << std::endl; estimatedDistribution = factory.build(distribution.getParameter()); diff --git a/lib/test/t_MemoizeFunction_std.cxx b/lib/test/t_MemoizeFunction_std.cxx index b56bba3db1..03a35b265b 100644 --- a/lib/test/t_MemoizeFunction_std.cxx +++ b/lib/test/t_MemoizeFunction_std.cxx @@ -98,12 +98,12 @@ int main(int, char *[]) UnsignedInteger size = 4; Sample input(size, 1); for (UnsignedInteger i = 0; i < size; ++i) input(i, 0) = i; - Sample output(f(input)); + f(input); fullprint << "Is history enabled for f? " << (f.isHistoryEnabled() ? "true" : "false") << std::endl; fullprint << "input history=" << f.getInputHistory() << std::endl; fullprint << "output history=" << f.getOutputHistory() << std::endl; f.enableHistory(); - output = f(input); + f(input); fullprint << "Is history enabled for f? " << (f.isHistoryEnabled() ? "true" : "false") << std::endl; fullprint << "input history=" << f.getInputHistory() << std::endl; fullprint << "output history=" << f.getOutputHistory() << std::endl; @@ -112,25 +112,15 @@ int main(int, char *[]) fullprint << "input history=" << f.getInputHistory() << std::endl; fullprint << "output history=" << f.getOutputHistory() << std::endl; // Perform the computation twice - output = f(input); - output = f(input); + f(input); + f(input); fullprint << "input history=" << f.getInputHistory() << std::endl; fullprint << "output history=" << f.getOutputHistory() << std::endl; // Marginal - Description inputVariables; - inputVariables.add("x"); - Description formulas; - formulas.add("x"); - formulas.add("x^2"); - formulas.add("x^3"); - formulas.add("x^4"); - formulas.add("x^5"); - SymbolicFunction multi(inputVariables, formulas); + SymbolicFunction multi(Description({"x"}), Description({"x", "x^2", "x^3", "x^4", "x^5"})); MemoizeFunction memoMulti(multi); - Sample output5(memoMulti(input)); - Indices indices; - indices.add(3); - indices.add(1); + memoMulti(input); + Indices indices = {3, 1}; Function marginal(memoMulti.getMarginal(indices)); fullprint << "memoized marginal=" << marginal << std::endl; Function g2(new SymbolicEvaluation(Description(1, "x"), Description(1, "y"), Description(1, "x^3"))); diff --git a/lib/test/t_MultinomialFactory_std.cxx b/lib/test/t_MultinomialFactory_std.cxx index 8d0e4efc81..990d2715b0 100644 --- a/lib/test/t_MultinomialFactory_std.cxx +++ b/lib/test/t_MultinomialFactory_std.cxx @@ -36,12 +36,9 @@ int main(int, char *[]) UnsignedInteger size = 10000; Sample sample(distribution.getSample(size)); MultinomialFactory factory; - CovarianceMatrix covariance; - // Distribution estimatedDistribution(factory.build(sample, covariance)); Distribution estimatedDistribution(factory.build(sample)); fullprint << "Distribution =" << distribution << std::endl; fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; estimatedDistribution = factory.build(); fullprint << "Default distribution=" << estimatedDistribution << std::endl; Multinomial estimatedMultinomial(factory.buildAsMultinomial(sample)); diff --git a/lib/test/t_NAIS_std.cxx b/lib/test/t_NAIS_std.cxx index 65c09d4265..de612425a6 100644 --- a/lib/test/t_NAIS_std.cxx +++ b/lib/test/t_NAIS_std.cxx @@ -46,7 +46,6 @@ int main() const Point mean(2, 0.0) ; const Point sigma(2, 1.0) ; const Normal distX(mean, sigma, CorrelationMatrix(2)); - const RandomVector inputVector = RandomVector(distX); // Determination of reference probability diff --git a/lib/test/t_NegativeBinomialFactory_std.cxx b/lib/test/t_NegativeBinomialFactory_std.cxx index ad69543ecf..991fac3b50 100644 --- a/lib/test/t_NegativeBinomialFactory_std.cxx +++ b/lib/test/t_NegativeBinomialFactory_std.cxx @@ -36,12 +36,9 @@ int main(int, char *[]) UnsignedInteger size = 10000; Sample sample(distribution.getSample(size)); NegativeBinomialFactory factory; - CovarianceMatrix covariance; - // Distribution estimatedDistribution(factory.build(sample, covariance)); Distribution estimatedDistribution(factory.build(sample)); fullprint << "Distribution =" << distribution << std::endl; fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; estimatedDistribution = factory.build(); fullprint << "Default distribution=" << estimatedDistribution << std::endl; estimatedDistribution = factory.build(distribution.getParameter()); diff --git a/lib/test/t_NonStationaryCovarianceModelFactory_std.cxx b/lib/test/t_NonStationaryCovarianceModelFactory_std.cxx index 8e212c5bb6..1d1dbce856 100644 --- a/lib/test/t_NonStationaryCovarianceModelFactory_std.cxx +++ b/lib/test/t_NonStationaryCovarianceModelFactory_std.cxx @@ -57,7 +57,8 @@ int main(int, char *[]) UserDefinedCovarianceModel myCovarianceModel(myFactory.buildAsUserDefinedCovarianceModel(sample)); // Get the frequency grid of the model - RegularGrid myTimeGrid(myCovarianceModel.getTimeGrid()); + myCovarianceModel.getTimeGrid(); + for (UnsignedInteger i = 0 ; i < size ; ++i) { const Scalar t = timeGrid.getValue(i); diff --git a/lib/test/t_NormalCopulaFactory_std.cxx b/lib/test/t_NormalCopulaFactory_std.cxx index e9d6682f07..4d8bdbf83c 100644 --- a/lib/test/t_NormalCopulaFactory_std.cxx +++ b/lib/test/t_NormalCopulaFactory_std.cxx @@ -45,12 +45,9 @@ int main(int, char *[]) UnsignedInteger size = 10000; Sample sample(distribution.getSample(size)); NormalCopulaFactory factory; - CovarianceMatrix covariance; - // Distribution estimatedDistribution(factory.build(sample, covariance)); Distribution estimatedDistribution(factory.build(sample)); fullprint << "Distribution =" << distribution << std::endl; fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; estimatedDistribution = factory.build(); fullprint << "Default distribution=" << estimatedDistribution << std::endl; NormalCopula estimatedNormalCopula(factory.buildAsNormalCopula(sample)); diff --git a/lib/test/t_OrdinalSumCopula_std.cxx b/lib/test/t_OrdinalSumCopula_std.cxx index 4ccee22c6a..05ad64979b 100644 --- a/lib/test/t_OrdinalSumCopula_std.cxx +++ b/lib/test/t_OrdinalSumCopula_std.cxx @@ -81,8 +81,7 @@ int main(int, char *[]) //Scalar eps(1e-5); Point DDF = copula.computeDDF( point ); fullprint << "ddf =" << DDF << std::endl; - Point ddfFD(dim); - Scalar PDF = copula.computePDF( point ); + Scalar PDF = copula.computePDF(point); fullprint << "pdf =" << PDF << std::endl; Scalar CDF = copula.computeCDF( point ); fullprint << "cdf=" << CDF << std::endl; diff --git a/lib/test/t_PlackettCopulaFactory_std.cxx b/lib/test/t_PlackettCopulaFactory_std.cxx index 3ef8f5e9bc..59a1c77bfc 100644 --- a/lib/test/t_PlackettCopulaFactory_std.cxx +++ b/lib/test/t_PlackettCopulaFactory_std.cxx @@ -36,12 +36,9 @@ int main(int, char *[]) UnsignedInteger size = 1000; Sample sample(distribution.getSample(size)); PlackettCopulaFactory factory; - CovarianceMatrix covariance; - // Distribution estimatedDistribution(factory.build(sample, covariance)); Distribution estimatedDistribution(factory.build(sample)); fullprint << "Distribution =" << distribution << std::endl; fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; estimatedDistribution = factory.build(); fullprint << "Default distribution=" << estimatedDistribution << std::endl; estimatedDistribution = factory.build(distribution.getParameter()); diff --git a/lib/test/t_Point_description.cxx b/lib/test/t_Point_description.cxx index a7ce327b39..60fd6c6643 100644 --- a/lib/test/t_Point_description.cxx +++ b/lib/test/t_Point_description.cxx @@ -73,6 +73,10 @@ int main(int, char *[]) Collection coll2(5, Point(4)); Collection coll3(5, PointWithDescription(4)); Collection coll4(5, Point(4)); + (void)coll1; + (void)coll2; + (void)coll3; + (void)coll4; // Conversion //coll1 = coll3; //coll4 = coll2; diff --git a/lib/test/t_Point_std.cxx b/lib/test/t_Point_std.cxx index 44882ae0a2..555058ab60 100644 --- a/lib/test/t_Point_std.cxx +++ b/lib/test/t_Point_std.cxx @@ -180,8 +180,8 @@ int main(int, char *[]) // empty point operators test { Point point0; - Point point0mul(point0 * 5.0); - Point point0div(point0 / 2.0); + point0 * 5.0; + point0 / 2.0; point0 *= 5.0; point0 /= 2.0; fullprint << "point0=" << point0 << std::endl; diff --git a/lib/test/t_PoissonFactory_std.cxx b/lib/test/t_PoissonFactory_std.cxx index f0d7173e8f..fdc5c9a524 100644 --- a/lib/test/t_PoissonFactory_std.cxx +++ b/lib/test/t_PoissonFactory_std.cxx @@ -36,12 +36,9 @@ int main(int, char *[]) UnsignedInteger size = 10000; Sample sample(distribution.getSample(size)); PoissonFactory factory; - CovarianceMatrix covariance; - // Distribution estimatedDistribution(factory.build(sample, covariance)); Distribution estimatedDistribution(factory.build(sample)); fullprint << "Distribution =" << distribution << std::endl; fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; estimatedDistribution = factory.build(); fullprint << "Default distribution=" << estimatedDistribution << std::endl; estimatedDistribution = factory.build(distribution.getParameter()); diff --git a/lib/test/t_ProbabilitySimulationAlgorithm_draw.cxx b/lib/test/t_ProbabilitySimulationAlgorithm_draw.cxx index c81e3d71bc..0e30336c68 100644 --- a/lib/test/t_ProbabilitySimulationAlgorithm_draw.cxx +++ b/lib/test/t_ProbabilitySimulationAlgorithm_draw.cxx @@ -77,7 +77,7 @@ int main(int, char *[]) ProbabilitySimulationResult result(myAlgo.getResult()); fullprint << "MonteCarlo result=" << result << std::endl; /* Draw the convergence graph */ - Graph convergenceGraph(myAlgo.drawProbabilityConvergence()); + myAlgo.drawProbabilityConvergence(); } catch (TestFailed & ex) { diff --git a/lib/test/t_RandomMixture_std.cxx b/lib/test/t_RandomMixture_std.cxx index 01e0fd3bf8..59f97367e2 100644 --- a/lib/test/t_RandomMixture_std.cxx +++ b/lib/test/t_RandomMixture_std.cxx @@ -344,8 +344,8 @@ int main(int, char *[]) // The segfault was triggered during the construction... RandomMixture mixture2(Collection(1, Dirac())); // After what it was impossible to draw the PDF or the CDF due to a lack of support computation - Graph graphPDF(mixture2.drawPDF()); - Graph graphCDF(mixture2.drawCDF()); + mixture2.drawPDF(); + mixture2.drawCDF(); // Test computeQuantile for the specific case of an analytical 1D mixture RandomMixture case1(Collection(1, ChiSquare()), Point(1, 0.1)); Scalar q = case1.computeQuantile(0.95)[0]; diff --git a/lib/test/t_RandomWalkMetropolisHastings_std.cxx b/lib/test/t_RandomWalkMetropolisHastings_std.cxx index 7bad158edb..d5c8c05566 100644 --- a/lib/test/t_RandomWalkMetropolisHastings_std.cxx +++ b/lib/test/t_RandomWalkMetropolisHastings_std.cxx @@ -144,7 +144,7 @@ int main(int, char *[]) rw.setAdaptationRange(Interval(1.1, 1.2)); rw.setAdaptationPeriod(10); rw.setAdaptationShrinkFactor(0.5); - const Sample decreasing_step_sample(rw.getSample(100)); + rw.getSample(100); assert_almost_equal(rw.getAdaptationFactor(), 2.0, 0.0, 0.0); } diff --git a/lib/test/t_RayleighFactory_std.cxx b/lib/test/t_RayleighFactory_std.cxx index 14d49b70d5..a7d1c2dbcc 100644 --- a/lib/test/t_RayleighFactory_std.cxx +++ b/lib/test/t_RayleighFactory_std.cxx @@ -36,12 +36,9 @@ int main(int, char *[]) UnsignedInteger size = 10000; Sample sample(distribution.getSample(size)); RayleighFactory factory; - CovarianceMatrix covariance; - // Distribution estimatedDistribution(factory.build(sample, covariance)); Distribution estimatedDistribution(factory.build(sample)); fullprint << "Distribution =" << distribution << std::endl; fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; estimatedDistribution = factory.build(); fullprint << "Default distribution=" << estimatedDistribution << std::endl; estimatedDistribution = factory.build(distribution.getParameter()); diff --git a/lib/test/t_RiceFactory_std.cxx b/lib/test/t_RiceFactory_std.cxx index 3cb2048d86..45408e131a 100644 --- a/lib/test/t_RiceFactory_std.cxx +++ b/lib/test/t_RiceFactory_std.cxx @@ -36,12 +36,9 @@ int main(int, char *[]) UnsignedInteger size = 10000; Sample sample(distribution.getSample(size)); RiceFactory factory; - CovarianceMatrix covariance; - // Distribution estimatedDistribution(factory.build(sample, covariance)); Distribution estimatedDistribution(factory.build(sample)); fullprint << "Distribution =" << distribution << std::endl; fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; estimatedDistribution = factory.build(distribution.getParameter()); fullprint << "Distribution from parameters=" << estimatedDistribution << std::endl; estimatedDistribution = factory.build(); diff --git a/lib/test/t_SQP_std.cxx b/lib/test/t_SQP_std.cxx index 9251ef03fc..67ac3cdccb 100644 --- a/lib/test/t_SQP_std.cxx +++ b/lib/test/t_SQP_std.cxx @@ -97,7 +97,7 @@ int main(int, char *[]) OptimizationResult result(mySQPAlgorithm.getResult()); fullprint << "result = " << printPoint(result.getOptimalPoint(), 4) << std::endl; fullprint << "multipliers = " << printPoint(result.computeLagrangeMultipliers(), 4) << std::endl; - Graph convergence(result.drawErrorHistory()); + result.drawErrorHistory(); fullprint << "evaluation calls number=" << levelFunction.getEvaluationCallsNumber() << std::endl; fullprint << "gradient calls number=" << levelFunction.getGradientCallsNumber() << std::endl; fullprint << "hessian calls number=" << levelFunction.getHessianCallsNumber() << std::endl; diff --git a/lib/test/t_Sample_large.cxx b/lib/test/t_Sample_large.cxx index 6b12a41ac7..13db87ac80 100644 --- a/lib/test/t_Sample_large.cxx +++ b/lib/test/t_Sample_large.cxx @@ -73,7 +73,7 @@ int main(int, char *[]) try { // We try to access past the last element of the point - Point err( sample.at(2) ); + sample.at(2); // We should NEVER go here throw TestFailed("Exception NOT thrown"); diff --git a/lib/test/t_Sample_std.cxx b/lib/test/t_Sample_std.cxx index 129b355f40..166d4b92f7 100644 --- a/lib/test/t_Sample_std.cxx +++ b/lib/test/t_Sample_std.cxx @@ -235,7 +235,7 @@ int main(int, char *[]) { // We get the tenth element of the sample // THIS SHOULD NORMALLY FAIL - Point tenthElement = sample1.at(9); + sample1.at(9); // Normally, we should never go here throw TestFailed("Exception has NOT been thrown or caught !"); diff --git a/lib/test/t_SkellamFactory_std.cxx b/lib/test/t_SkellamFactory_std.cxx index 755c69d49e..912b8e2af6 100644 --- a/lib/test/t_SkellamFactory_std.cxx +++ b/lib/test/t_SkellamFactory_std.cxx @@ -36,12 +36,9 @@ int main(int, char *[]) UnsignedInteger size = 10000; Sample sample(distribution.getSample(size)); SkellamFactory factory; - CovarianceMatrix covariance; - // Distribution estimatedDistribution(factory.build(sample, covariance)); Distribution estimatedDistribution(factory.build(sample)); fullprint << "Distribution =" << distribution << std::endl; fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; estimatedDistribution = factory.build(); fullprint << "Default distribution=" << estimatedDistribution << std::endl; estimatedDistribution = factory.build(distribution.getParameter()); diff --git a/lib/test/t_SpectralGaussianProcess_std.cxx b/lib/test/t_SpectralGaussianProcess_std.cxx index fe46ad6f1a..07b890f879 100644 --- a/lib/test/t_SpectralGaussianProcess_std.cxx +++ b/lib/test/t_SpectralGaussianProcess_std.cxx @@ -55,7 +55,7 @@ int main(int, char *[]) // Constructor using maximalFrequency value and size of discretization const Scalar maximalFrequency = 10.0; SpectralGaussianProcess mySpectralProcess1(myModel, maximalFrequency, points); - RegularGrid tg(mySpectralProcess1.getTimeGrid()); + //RegularGrid tg(mySpectralProcess1.getTimeGrid()); fullprint << "mySpectralProcess1 = " << mySpectralProcess1.__str__() << std::endl; fullprint << "Realization = " << mySpectralProcess1.getRealization().__str__() << std::endl; diff --git a/lib/test/t_SymbolicFunction_muparser.cxx b/lib/test/t_SymbolicFunction_muparser.cxx index c8c86e8943..0d69a9dcd2 100644 --- a/lib/test/t_SymbolicFunction_muparser.cxx +++ b/lib/test/t_SymbolicFunction_muparser.cxx @@ -380,7 +380,7 @@ int main(int, char *[]) x[1] = 3.0; x[2] = 4.0; x[3] = 5.0; - Point y(f(x)); + f(x); fullprint << f.__str__() << " should throw" << std::endl; } catch (NotYetImplementedException &) diff --git a/lib/test/t_TriangularFactory_std.cxx b/lib/test/t_TriangularFactory_std.cxx index 0880d30334..f8b39a2ea9 100644 --- a/lib/test/t_TriangularFactory_std.cxx +++ b/lib/test/t_TriangularFactory_std.cxx @@ -36,12 +36,9 @@ int main(int, char *[]) UnsignedInteger size = 10000; Sample sample(distribution.getSample(size)); TriangularFactory factory; - CovarianceMatrix covariance; - // Distribution estimatedDistribution(factory.build(sample, covariance)); Distribution estimatedDistribution(factory.build(sample)); fullprint << "Distribution =" << distribution << std::endl; fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; estimatedDistribution = factory.build(); fullprint << "Default distribution=" << estimatedDistribution << std::endl; estimatedDistribution = factory.build(distribution.getParameter()); @@ -49,7 +46,6 @@ int main(int, char *[]) Triangular estimatedTriangular(factory.buildAsTriangular(sample)); fullprint << "Triangular =" << distribution << std::endl; fullprint << "Estimated triangular=" << estimatedTriangular << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; estimatedTriangular = factory.buildAsTriangular(); fullprint << "Default triangular=" << estimatedTriangular << std::endl; estimatedTriangular = factory.buildAsTriangular(distribution.getParameter()); diff --git a/lib/test/t_TruncatedNormalFactory_std.cxx b/lib/test/t_TruncatedNormalFactory_std.cxx index 6c6a661b75..a9f0cb171d 100644 --- a/lib/test/t_TruncatedNormalFactory_std.cxx +++ b/lib/test/t_TruncatedNormalFactory_std.cxx @@ -51,12 +51,9 @@ int main(int, char *[]) UnsignedInteger size = 10000; Sample sample(distribution.getSample(size)); TruncatedNormalFactory factory; - CovarianceMatrix covariance; - // Distribution estimatedDistribution(factory.build(sample, covariance)); Distribution estimatedDistribution(factory.build(sample)); fullprint << "Distribution =" << distribution << std::endl; fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; estimatedDistribution = factory.build(); fullprint << "Default distribution=" << estimatedDistribution << std::endl; estimatedDistribution = factory.build(distribution.getParameter()); @@ -72,7 +69,6 @@ int main(int, char *[]) // Test for constant sample TruncatedNormalFactory factory; UnsignedInteger size = 10000; - Sample sample(size, Point(1, 0.0)); // buildMethodOfMoments fullprint << "buildMethodOfMoments" << std::endl; TruncatedNormal distribution(2.0, 3.0, -1.0, 4.0); diff --git a/lib/test/t_UniformFactory_std.cxx b/lib/test/t_UniformFactory_std.cxx index 49b707bf7b..90c9ee0197 100644 --- a/lib/test/t_UniformFactory_std.cxx +++ b/lib/test/t_UniformFactory_std.cxx @@ -36,12 +36,9 @@ int main(int, char *[]) UnsignedInteger size = 10000; Sample sample(distribution.getSample(size)); UniformFactory factory; - CovarianceMatrix covariance; - // Distribution estimatedDistribution(factory.build(sample, covariance)); Distribution estimatedDistribution(factory.build(sample)); fullprint << "Distribution =" << distribution << std::endl; fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; estimatedDistribution = factory.build(); fullprint << "Default distribution=" << estimatedDistribution << std::endl; estimatedDistribution = factory.build(distribution.getParameter()); diff --git a/lib/test/t_UserDefinedFactory_std.cxx b/lib/test/t_UserDefinedFactory_std.cxx index ea1f1458e0..4f35adbb49 100644 --- a/lib/test/t_UserDefinedFactory_std.cxx +++ b/lib/test/t_UserDefinedFactory_std.cxx @@ -40,12 +40,9 @@ int main(int, char *[]) sample[2][0] = 3.0; sample[2][1] = 3.5; UserDefinedFactory factory; - CovarianceMatrix covariance; - // Distribution estimatedDistribution(factory.build(sample, covariance)); Distribution estimatedDistribution(factory.build(sample)); fullprint << "Sample =" << sample << std::endl; fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; estimatedDistribution = factory.build(); fullprint << "Default distribution=" << estimatedDistribution << std::endl; UserDefined estimatedUserDefined(factory.buildAsUserDefined(sample)); diff --git a/lib/test/t_WeibullMaxFactory_std.cxx b/lib/test/t_WeibullMaxFactory_std.cxx index 35dfde608b..1351c0d8f7 100644 --- a/lib/test/t_WeibullMaxFactory_std.cxx +++ b/lib/test/t_WeibullMaxFactory_std.cxx @@ -36,12 +36,9 @@ int main(int, char *[]) UnsignedInteger size = 10000; Sample sample(distribution.getSample(size)); WeibullMaxFactory factory; - CovarianceMatrix covariance; - // Distribution estimatedDistribution(factory.build(sample, covariance)); Distribution estimatedDistribution(factory.build(sample)); fullprint << "Distribution =" << distribution << std::endl; fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; estimatedDistribution = factory.build(); fullprint << "Default distribution=" << estimatedDistribution << std::endl; estimatedDistribution = factory.build(distribution.getParameter()); diff --git a/lib/test/t_WeibullMinFactory_std.cxx b/lib/test/t_WeibullMinFactory_std.cxx index eb03764f38..30df08479f 100644 --- a/lib/test/t_WeibullMinFactory_std.cxx +++ b/lib/test/t_WeibullMinFactory_std.cxx @@ -36,12 +36,9 @@ int main(int, char *[]) UnsignedInteger size = 10000; Sample sample(distribution.getSample(size)); WeibullMinFactory factory; - CovarianceMatrix covariance; - // Distribution estimatedDistribution(factory.build(sample, covariance)); Distribution estimatedDistribution(factory.build(sample)); fullprint << "Distribution =" << distribution << std::endl; fullprint << "Estimated distribution=" << estimatedDistribution << std::endl; - // fullprint << "Covariance=" << covariance << std::endl; estimatedDistribution = factory.build(); fullprint << "Default distribution=" << estimatedDistribution << std::endl; estimatedDistribution = factory.build(distribution.getParameter()); diff --git a/python/src/PythonFieldFunction.cxx b/python/src/PythonFieldFunction.cxx index cc4109a11f..c30920e45c 100644 --- a/python/src/PythonFieldFunction.cxx +++ b/python/src/PythonFieldFunction.cxx @@ -62,7 +62,6 @@ PythonFieldFunction::PythonFieldFunction(PyObject * pyCallable) const UnsignedInteger inputDimension = getInputDimension(); const UnsignedInteger outputDimension = getOutputDimension(); - Description description(inputDimension + outputDimension); ScopedPyObjectPointer descIn(PyObject_CallMethod( pyObj_, const_cast("getInputDescription"), diff --git a/python/src/PythonFieldToPointFunction.cxx b/python/src/PythonFieldToPointFunction.cxx index 19d6ca1e26..5f33151d3b 100644 --- a/python/src/PythonFieldToPointFunction.cxx +++ b/python/src/PythonFieldToPointFunction.cxx @@ -62,7 +62,6 @@ PythonFieldToPointFunction::PythonFieldToPointFunction(PyObject * pyCallable) const UnsignedInteger inputDimension = getInputDimension(); const UnsignedInteger outputDimension = getOutputDimension(); - Description description(inputDimension + outputDimension); ScopedPyObjectPointer descIn(PyObject_CallMethod( pyObj_, const_cast("getInputDescription"), diff --git a/python/src/PythonPointToFieldFunction.cxx b/python/src/PythonPointToFieldFunction.cxx index b94531e986..10baa08fd4 100644 --- a/python/src/PythonPointToFieldFunction.cxx +++ b/python/src/PythonPointToFieldFunction.cxx @@ -62,7 +62,6 @@ PythonPointToFieldFunction::PythonPointToFieldFunction(PyObject * pyCallable) const UnsignedInteger inputDimension = getInputDimension(); const UnsignedInteger outputDimension = getOutputDimension(); - Description description(inputDimension + outputDimension); ScopedPyObjectPointer descIn(PyObject_CallMethod( pyObj_, const_cast("getInputDescription"), diff --git a/python/src/Sample.i b/python/src/Sample.i index 827211bb57..f7bf765ec7 100644 --- a/python/src/Sample.i +++ b/python/src/Sample.i @@ -546,7 +546,6 @@ void __setitem__(PyObject * args, PyObject * valObj) val = &temp; } assert(val); - OT::Sample result(size, self->getDimension()); for (Py_ssize_t i = 0; i < size; ++ i) self->at(start + i*step) = val->at(i); } @@ -562,7 +561,6 @@ void __setitem__(PyObject * args, PyObject * valObj) val = &temp; } assert(val); - OT::Sample result(size, self->getDimension()); for (Py_ssize_t i = 0; i < size; ++ i) { PyObject * elt = PySequence_Fast_GET_ITEM(seq.get(), i); @@ -745,7 +743,6 @@ void __setitem__(PyObject * args, PyObject * valObj) // case 2.3: [slice/sequence] <= Sample OT::ScopedPyObjectPointer seq2(PySequence_Fast(obj2, "")); Py_ssize_t size2 = PySequence_Fast_GET_SIZE(seq2.get()); - OT::Sample result(size1, size2); OT::Indices indices2(size2); for (Py_ssize_t j = 0; j < size2; ++ j) {