From c7c946aac00869577af146fa79516f8bbcd565b0 Mon Sep 17 00:00:00 2001 From: Jean-Paul Pelteret Date: Thu, 6 Dec 2018 14:41:28 +0100 Subject: [PATCH] Improve some error messages in ADHelper classes. --- source/differentiation/ad/ad_helpers.cc | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/source/differentiation/ad/ad_helpers.cc b/source/differentiation/ad/ad_helpers.cc index d8a7866ba3..e259ab6019 100644 --- a/source/differentiation/ad/ad_helpers.cc +++ b/source/differentiation/ad/ad_helpers.cc @@ -752,7 +752,8 @@ namespace Differentiation this->finalize_sensitive_independent_variables(); Assert(this->independent_variables.size() == this->n_independent_variables(), - ExcInternalError()); + ExcDimensionMismatch(this->independent_variables.size(), + this->n_independent_variables())); return this->independent_variables; } @@ -876,7 +877,8 @@ namespace Differentiation ExcInternalError()); Assert(this->independent_variables.size() == this->n_independent_variables(), - ExcInternalError()); + ExcDimensionMismatch(this->independent_variables.size(), + this->n_independent_variables())); return this->tapeless_driver.value(this->dependent_variables); } @@ -938,7 +940,8 @@ namespace Differentiation ExcInternalError()); Assert(this->independent_variables.size() == this->n_independent_variables(), - ExcInternalError()); + ExcDimensionMismatch(this->independent_variables.size(), + this->n_independent_variables())); this->tapeless_driver.gradient(this->independent_variables, this->dependent_variables, @@ -1008,7 +1011,8 @@ namespace Differentiation ExcInternalError()); Assert(this->independent_variables.size() == this->n_independent_variables(), - ExcInternalError()); + ExcDimensionMismatch(this->independent_variables.size(), + this->n_independent_variables())); this->tapeless_driver.hessian(this->independent_variables, this->dependent_variables, @@ -1153,7 +1157,8 @@ namespace Differentiation ExcInternalError()); Assert(this->independent_variables.size() == this->n_independent_variables(), - ExcInternalError()); + ExcDimensionMismatch(this->independent_variables.size(), + this->n_independent_variables())); this->tapeless_driver.jacobian(this->independent_variables, this->dependent_variables, -- 2.39.5