From eb0b8ef5f7e8a21bf11b9c4b22e66d476b62bc60 Mon Sep 17 00:00:00 2001 From: Michael BAUDIN Date: Wed, 23 Aug 2023 20:21:50 +0200 Subject: [PATCH] Removes unnecessary variables. --- lib/src/Base/Func/LinearEvaluation.cxx | 10 ++++++++-- .../MetaModel/LinearModel/LinearModelAnalysis.cxx | 2 -- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/src/Base/Func/LinearEvaluation.cxx b/lib/src/Base/Func/LinearEvaluation.cxx index b55dbcd021e..364700f9c83 100644 --- a/lib/src/Base/Func/LinearEvaluation.cxx +++ b/lib/src/Base/Func/LinearEvaluation.cxx @@ -50,9 +50,15 @@ LinearEvaluation::LinearEvaluation(const Point & center, , linear_(linear.transpose()) { /* Check if the dimension of the constant term is compatible with the linear term */ - if (constant.getDimension() != linear.getNbColumns()) throw InvalidDimensionException(HERE) << "Constant term dimension is incompatible with the linear term"; + if (constant.getDimension() != linear.getNbColumns()) + throw InvalidDimensionException(HERE) << "Constant term dimension is incompatible with the linear term. " + <<"The constant has dimension: " << constant.getDimension() + <<" but the number of columns in the linear matrix is: " << linear.getNbColumns(); /* Check if the dimension of the center term is compatible with the linear term */ - if (center.getDimension() != linear.getNbRows()) throw InvalidDimensionException(HERE) << "Center term dimension is incompatible with the linear term"; + if (center.getDimension() != linear.getNbRows()) + throw InvalidDimensionException(HERE) << "Center term dimension is incompatible with the linear term. " + << "The dimension of the center is: " << center.getDimension() + << " but the number of rows of the linear matrix is: " << linear.getNbRows(); setInputDescription(Description::BuildDefault(getInputDimension(), "x")); setOutputDescription(Description::BuildDefault(getOutputDimension(), "y")); } diff --git a/lib/src/Uncertainty/Algorithm/MetaModel/LinearModel/LinearModelAnalysis.cxx b/lib/src/Uncertainty/Algorithm/MetaModel/LinearModel/LinearModelAnalysis.cxx index 0ada3ab06a7..04928308d2a 100644 --- a/lib/src/Uncertainty/Algorithm/MetaModel/LinearModel/LinearModelAnalysis.cxx +++ b/lib/src/Uncertainty/Algorithm/MetaModel/LinearModel/LinearModelAnalysis.cxx @@ -81,9 +81,7 @@ String LinearModelAnalysis::__str__(const String & offset) const const Point tscores(getCoefficientsTScores()); const Point pValues(getCoefficientsPValues()); const Description names(linearModelResult_.getCoefficientsNames()); - const Scalar sigma2 = linearModelResult_.getSampleResiduals().computeRawMoment(2)[0]; const SignedInteger dof = linearModelResult_.getDegreesOfFreedom(); - const UnsignedInteger sampleSize = linearModelResult_.getSampleResiduals().getSize(); const String separator(" | "); const String separatorEndLine(" |"); size_t twidth = 0; // column title max width