if mode==2, the user is supposed to supply diag: do some basic check.

This commit is contained in:
Thomas Capricelli
2009-08-25 22:02:19 +02:00
parent fa0183e7c7
commit 3bca4bba87
2 changed files with 5 additions and 0 deletions

View File

@@ -113,6 +113,7 @@ HybridNonLinearSolver<FunctorType,Scalar>::solve(
fvec.resize(n);
if (mode != 2)
diag.resize(n);
assert( (mode!=2 || diag.size()==n) || "When using mode==2, the caller must provide a valid 'diag'");
/* Local variables */
int i, j, l, iwa[1];
@@ -433,6 +434,7 @@ HybridNonLinearSolver<FunctorType,Scalar>::solveNumericalDiff(
fvec.resize(n);
if (mode != 2)
diag.resize(n);
assert( (mode!=2 || diag.size()==n) || "When using mode==2, the caller must provide a valid 'diag'");
/* Local variables */
int i, j, l, iwa[1];