mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Fixed some incorrect assertions
This commit is contained in:
@@ -304,7 +304,7 @@ LevenbergMarquardt<FunctorType>::minimizeInit(FVectorType &x)
|
|||||||
// m_fjac.reserve(VectorXi::Constant(n,5)); // FIXME Find a better alternative
|
// m_fjac.reserve(VectorXi::Constant(n,5)); // FIXME Find a better alternative
|
||||||
if (!m_useExternalScaling)
|
if (!m_useExternalScaling)
|
||||||
m_diag.resize(n);
|
m_diag.resize(n);
|
||||||
eigen_assert( (!m_useExternalScaling || m_diag.size()==n) || "When m_useExternalScaling is set, the caller must provide a valid 'm_diag'");
|
eigen_assert( (!m_useExternalScaling || m_diag.size()==n) && "When m_useExternalScaling is set, the caller must provide a valid 'm_diag'");
|
||||||
m_qtf.resize(n);
|
m_qtf.resize(n);
|
||||||
|
|
||||||
/* Function Body */
|
/* Function Body */
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ HybridNonLinearSolver<FunctorType,Scalar>::solveInit(FVectorType &x)
|
|||||||
fjac.resize(n, n);
|
fjac.resize(n, n);
|
||||||
if (!useExternalScaling)
|
if (!useExternalScaling)
|
||||||
diag.resize(n);
|
diag.resize(n);
|
||||||
eigen_assert( (!useExternalScaling || diag.size()==n) || "When useExternalScaling is set, the caller must provide a valid 'diag'");
|
eigen_assert( (!useExternalScaling || diag.size()==n) && "When useExternalScaling is set, the caller must provide a valid 'diag'");
|
||||||
|
|
||||||
/* Function Body */
|
/* Function Body */
|
||||||
nfev = 0;
|
nfev = 0;
|
||||||
@@ -390,7 +390,7 @@ HybridNonLinearSolver<FunctorType,Scalar>::solveNumericalDiffInit(FVectorType &
|
|||||||
fvec.resize(n);
|
fvec.resize(n);
|
||||||
if (!useExternalScaling)
|
if (!useExternalScaling)
|
||||||
diag.resize(n);
|
diag.resize(n);
|
||||||
eigen_assert( (!useExternalScaling || diag.size()==n) || "When useExternalScaling is set, the caller must provide a valid 'diag'");
|
eigen_assert( (!useExternalScaling || diag.size()==n) && "When useExternalScaling is set, the caller must provide a valid 'diag'");
|
||||||
|
|
||||||
/* Function Body */
|
/* Function Body */
|
||||||
nfev = 0;
|
nfev = 0;
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ LevenbergMarquardt<FunctorType,Scalar>::minimizeInit(FVectorType &x)
|
|||||||
fjac.resize(m, n);
|
fjac.resize(m, n);
|
||||||
if (!useExternalScaling)
|
if (!useExternalScaling)
|
||||||
diag.resize(n);
|
diag.resize(n);
|
||||||
eigen_assert( (!useExternalScaling || diag.size()==n) || "When useExternalScaling is set, the caller must provide a valid 'diag'");
|
eigen_assert( (!useExternalScaling || diag.size()==n) && "When useExternalScaling is set, the caller must provide a valid 'diag'");
|
||||||
qtf.resize(n);
|
qtf.resize(n);
|
||||||
|
|
||||||
/* Function Body */
|
/* Function Body */
|
||||||
@@ -215,7 +215,7 @@ LevenbergMarquardt<FunctorType,Scalar>::minimizeOneStep(FVectorType &x)
|
|||||||
{
|
{
|
||||||
using std::abs;
|
using std::abs;
|
||||||
using std::sqrt;
|
using std::sqrt;
|
||||||
|
|
||||||
eigen_assert(x.size()==n); // check the caller is not cheating us
|
eigen_assert(x.size()==n); // check the caller is not cheating us
|
||||||
|
|
||||||
/* calculate the jacobian matrix. */
|
/* calculate the jacobian matrix. */
|
||||||
@@ -398,7 +398,7 @@ LevenbergMarquardt<FunctorType,Scalar>::minimizeOptimumStorageInit(FVectorType
|
|||||||
fjac.resize(n, n);
|
fjac.resize(n, n);
|
||||||
if (!useExternalScaling)
|
if (!useExternalScaling)
|
||||||
diag.resize(n);
|
diag.resize(n);
|
||||||
eigen_assert( (!useExternalScaling || diag.size()==n) || "When useExternalScaling is set, the caller must provide a valid 'diag'");
|
eigen_assert( (!useExternalScaling || diag.size()==n) && "When useExternalScaling is set, the caller must provide a valid 'diag'");
|
||||||
qtf.resize(n);
|
qtf.resize(n);
|
||||||
|
|
||||||
/* Function Body */
|
/* Function Body */
|
||||||
|
|||||||
Reference in New Issue
Block a user