Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
imagej-elphel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
imagej-elphel
Commits
317d623f
Commit
317d623f
authored
Sep 24, 2014
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixing stopRequested interceipt
parent
d9ef3617
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
FocusingField.java
src/main/java/FocusingField.java
+15
-0
No files found.
src/main/java/FocusingField.java
View file @
317d623f
...
@@ -4435,6 +4435,10 @@ public boolean LevenbergMarquardt(
...
@@ -4435,6 +4435,10 @@ public boolean LevenbergMarquardt(
// while (this.fittingStrategy.isSeriesValid(this.seriesNumber)){ // TODO: Add "stop" tag to series
// while (this.fittingStrategy.isSeriesValid(this.seriesNumber)){ // TODO: Add "stop" tag to series
this
.
currentVector
=
null
;
// invalidate for the new series
this
.
currentVector
=
null
;
// invalidate for the new series
// boolean wasLastSeries=false;
// boolean wasLastSeries=false;
int
saveStopRequested
=
this
.
stopRequested
.
get
();
// preserve from caller stop requested (like temp. scan)
this
.
stopRequested
.
set
(
0
);
// remove caller stop request
while
(
true
)
{
// loop for the same series
while
(
true
)
{
// loop for the same series
boolean
[]
state
=
stepLevenbergMarquardtFirst
(
debugLevel
);
boolean
[]
state
=
stepLevenbergMarquardtFirst
(
debugLevel
);
...
@@ -4444,6 +4448,7 @@ public boolean LevenbergMarquardt(
...
@@ -4444,6 +4448,7 @@ public boolean LevenbergMarquardt(
System
.
out
.
println
(
msg
);
System
.
out
.
println
(
msg
);
commitParameterVector
(
this
.
savedVector
);
commitParameterVector
(
this
.
savedVector
);
this
.
lambda
=
savedLambda
;
this
.
lambda
=
savedLambda
;
this
.
stopRequested
.
set
(
saveStopRequested
);
// restore caller stop request
return
false
;
return
false
;
}
}
...
@@ -4461,6 +4466,7 @@ public boolean LevenbergMarquardt(
...
@@ -4461,6 +4466,7 @@ public boolean LevenbergMarquardt(
(
this
.
stopEachSeries
&&
state
[
1
])
||
(
this
.
stopEachSeries
&&
state
[
1
])
||
(
this
.
stopOnFailure
&&
state
[
1
]
&&
!
state
[
0
])){
(
this
.
stopOnFailure
&&
state
[
1
]
&&
!
state
[
0
])){
if
(
state
[
1
]
&&
!
state
[
0
]
&&
!
calibrate
){
if
(
state
[
1
]
&&
!
state
[
0
]
&&
!
calibrate
){
this
.
stopRequested
.
set
(
saveStopRequested
);
// restore caller stop request
return
false
;
return
false
;
}
}
...
@@ -4499,6 +4505,7 @@ public boolean LevenbergMarquardt(
...
@@ -4499,6 +4505,7 @@ public boolean LevenbergMarquardt(
// if RMS was decreased. this.saveSeries==false after dialogLMAStep(state) only if "cancel" was pressed
// if RMS was decreased. this.saveSeries==false after dialogLMAStep(state) only if "cancel" was pressed
commitParameterVector
(
this
.
savedVector
);
// either new or original
commitParameterVector
(
this
.
savedVector
);
// either new or original
this
.
lambda
=
savedLambda
;
this
.
lambda
=
savedLambda
;
this
.
stopRequested
.
set
(
saveStopRequested
);
// restore caller stop request
return
this
.
saveSeries
;
// TODO: Maybe change result?
return
this
.
saveSeries
;
// TODO: Maybe change result?
}
}
//stepLevenbergMarquardtAction();
//stepLevenbergMarquardtAction();
...
@@ -4506,6 +4513,7 @@ public boolean LevenbergMarquardt(
...
@@ -4506,6 +4513,7 @@ public boolean LevenbergMarquardt(
if
(!
state
[
0
])
{
if
(!
state
[
0
])
{
commitParameterVector
(
this
.
savedVector
);
commitParameterVector
(
this
.
savedVector
);
this
.
lambda
=
savedLambda
;
this
.
lambda
=
savedLambda
;
this
.
stopRequested
.
set
(
saveStopRequested
);
// restore caller stop request
return
false
;
// sequence failed
return
false
;
// sequence failed
}
}
this
.
savedVector
=
this
.
currentVector
.
clone
();
this
.
savedVector
=
this
.
currentVector
.
clone
();
...
@@ -4516,6 +4524,7 @@ public boolean LevenbergMarquardt(
...
@@ -4516,6 +4524,7 @@ public boolean LevenbergMarquardt(
// this.seriesNumber++;
// this.seriesNumber++;
break
;
// while (true), proceed to the next series
break
;
// while (true), proceed to the next series
}
}
this
.
stopRequested
.
set
(
saveStopRequested
);
// restore caller stop request
}
// while true - same series
}
// while true - same series
// if (wasLastSeries) break;
// if (wasLastSeries) break;
// } // while (this.fittingStrategy.isSeriesValid(this.seriesNumber)){ // TODO: Add "stop" tag to series
// } // while (this.fittingStrategy.isSeriesValid(this.seriesNumber)){ // TODO: Add "stop" tag to series
...
@@ -9565,6 +9574,8 @@ f_corr: d_fcorr/d_zcorr=0, other: a, reff, kx -> ar[1], ar[2], ar[3], ar[4]
...
@@ -9565,6 +9574,8 @@ f_corr: d_fcorr/d_zcorr=0, other: a, reff, kx -> ar[1], ar[2], ar[3], ar[4]
qCompareDrDerivatives
(
this
.
qSavedVector
);
qCompareDrDerivatives
(
this
.
qSavedVector
);
}
}
this
.
qCurrentVector
=
null
;
// invalidate for the new series
this
.
qCurrentVector
=
null
;
// invalidate for the new series
int
saveStopRequested
=
stopRequested
.
get
();
// preserve from caller stop requested (like temp. scan)
stopRequested
.
set
(
0
);
// remove caller stop request
while
(
true
)
{
// loop for the same series
while
(
true
)
{
// loop for the same series
boolean
[]
state
=
stepQLevenbergMarquardtFirst
(
debugLevel
);
boolean
[]
state
=
stepQLevenbergMarquardtFirst
(
debugLevel
);
if
(
state
==
null
)
{
if
(
state
==
null
)
{
...
@@ -9574,6 +9585,7 @@ f_corr: d_fcorr/d_zcorr=0, other: a, reff, kx -> ar[1], ar[2], ar[3], ar[4]
...
@@ -9574,6 +9585,7 @@ f_corr: d_fcorr/d_zcorr=0, other: a, reff, kx -> ar[1], ar[2], ar[3], ar[4]
restoreQPars
();
restoreQPars
();
// commitParameterVector(this.savedVector);
// commitParameterVector(this.savedVector);
this
.
qLambda
=
savedLambda
;
this
.
qLambda
=
savedLambda
;
stopRequested
.
set
(
saveStopRequested
);
// restore caller stop request
return
false
;
return
false
;
}
}
...
@@ -9623,6 +9635,7 @@ f_corr: d_fcorr/d_zcorr=0, other: a, reff, kx -> ar[1], ar[2], ar[3], ar[4]
...
@@ -9623,6 +9635,7 @@ f_corr: d_fcorr/d_zcorr=0, other: a, reff, kx -> ar[1], ar[2], ar[3], ar[4]
// commitParameterVector(this.savedVector); // either new or original
// commitParameterVector(this.savedVector); // either new or original
commitQPars
(
this
.
qSavedVector
);
commitQPars
(
this
.
qSavedVector
);
this
.
qLambda
=
savedLambda
;
this
.
qLambda
=
savedLambda
;
stopRequested
.
set
(
saveStopRequested
);
// restore caller stop request
return
this
.
qSaveSeries
;
// TODO: Maybe change result?
return
this
.
qSaveSeries
;
// TODO: Maybe change result?
}
}
//stepLevenbergMarquardtAction();
//stepLevenbergMarquardtAction();
...
@@ -9631,6 +9644,7 @@ f_corr: d_fcorr/d_zcorr=0, other: a, reff, kx -> ar[1], ar[2], ar[3], ar[4]
...
@@ -9631,6 +9644,7 @@ f_corr: d_fcorr/d_zcorr=0, other: a, reff, kx -> ar[1], ar[2], ar[3], ar[4]
// commitParameterVector(this.savedVector);
// commitParameterVector(this.savedVector);
commitQPars
(
this
.
qSavedVector
);
commitQPars
(
this
.
qSavedVector
);
this
.
qLambda
=
savedLambda
;
this
.
qLambda
=
savedLambda
;
stopRequested
.
set
(
saveStopRequested
);
// restore caller stop request
return
false
;
// sequence failed
return
false
;
// sequence failed
}
}
// this.savedVector=this.currentVector.clone();
// this.savedVector=this.currentVector.clone();
...
@@ -9653,6 +9667,7 @@ f_corr: d_fcorr/d_zcorr=0, other: a, reff, kx -> ar[1], ar[2], ar[3], ar[4]
...
@@ -9653,6 +9667,7 @@ f_corr: d_fcorr/d_zcorr=0, other: a, reff, kx -> ar[1], ar[2], ar[3], ar[4]
// commitParameterVector(this.savedVector);
// commitParameterVector(this.savedVector);
saveQPars
();
saveQPars
();
commitQPars
(
this
.
qSavedVector
);
commitQPars
(
this
.
qSavedVector
);
stopRequested
.
set
(
saveStopRequested
);
// restore caller stop request
return
true
;
// all series done
return
true
;
// all series done
}
}
public
void
qCompareDrDerivatives
(
double
[]
vector
){
public
void
qCompareDrDerivatives
(
double
[]
vector
){
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment