Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
miscmaths
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FSL
miscmaths
Commits
6f413434
Commit
6f413434
authored
14 years ago
by
Michael Chappell
Browse files
Options
Downloads
Patches
Plain Diff
Bug fixes to Variable Metric Convergence detection
parent
fd64d0cb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
nonlin.cpp
+5
-1
5 additions, 1 deletion
nonlin.cpp
with
5 additions
and
1 deletion
nonlin.cpp
+
5
−
1
View file @
6f413434
...
...
@@ -622,6 +622,7 @@ NonlinOut varmet(const NonlinParam& p, const NonlinCF& cfo)
else
if
(
status
==
LM_LAMBDA_NILL
)
{
// This means we might be heading uphill and should restart
if
(
p
.
NextRestart
())
{
// If we have spare restarts
p
.
SetCF
(
p
.
CF
());
// Another copy of old value
p
.
SetPar
(
p
.
Par
());
// Another copy of old values
iH
.
reset
();
// Back to being unity matrix
pdir
=
-
grad
;
continue
;
...
...
@@ -634,7 +635,10 @@ NonlinOut varmet(const NonlinParam& p, const NonlinCF& cfo)
ColumnVector
dpar
=
newpar
-
p
.
Par
();
p
.
SetPar
(
newpar
);
p
.
SetCF
(
newcf
);
if
(
zero_par_step_conv
(
dpar
,
p
.
Par
(),
p
.
FractionalParameterTolerance
()))
{
p
.
SetStatus
(
NL_PARCONV
);
return
(
p
.
Status
());}
// cout << "p.FractionalParameterTolerance() = " << p.FractionalParameterTolerance() << endl;
// cout << "P.Par() = " << p.Par() << endl;
// cout << "dpar = " << dpar << endl;
if
(
zero_par_step_conv
(
p
.
Par
(),
dpar
,
p
.
FractionalParameterTolerance
()))
{
p
.
SetStatus
(
NL_PARCONV
);
return
(
p
.
Status
());}
// Get gradient at new point
ColumnVector
newgrad
=
sf
*
cfo
.
grad
(
p
.
Par
());
// Test for convergence based on "zero" gradient
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment