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
c75ac3d6
Commit
c75ac3d6
authored
21 years ago
by
Peter Bannister
Browse files
Options
Downloads
Patches
Plain Diff
added in_slice option to optimise.[h,cc]
parent
5cd889d8
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
optimise.cc
+6
-3
6 additions, 3 deletions
optimise.cc
optimise.h
+1
-1
1 addition, 1 deletion
optimise.h
with
7 additions
and
4 deletions
optimise.cc
+
6
−
3
View file @
c75ac3d6
...
...
@@ -247,7 +247,7 @@ namespace MISCMATHS {
float
optimise
(
ColumnVector
&
pt
,
int
numopt
,
const
ColumnVector
&
tol
,
float
(
*
func
)(
const
ColumnVector
&
),
int
&
iterations_done
,
int
max_iter
,
const
ColumnVector
&
boundguess
)
int
max_iter
,
const
ColumnVector
&
boundguess
,
const
bool
in_slice
)
{
// Calculate dot product of dir by tol
// st (x1-x2)*dir_tol = average number of tolerances between x1 and x2
...
...
@@ -270,8 +270,11 @@ namespace MISCMATHS {
for
(
int
n
=
1
;
n
<=
numopt
;
n
++
)
{
dir
=
0.0
;
dir
(
n
)
=
1.0
;
fval
=
optimise1d
(
pt
,
dir
,
tol
,
lit
,
func
,
100
,
fval
,
bndguess
);
littot
+=
lit
;
// if the in_slice flag has been set, only correct in z_rot, x_trans and y_trans
if
((
!
in_slice
)
||
(
n
==
3
)
||
(
n
==
4
)
||
(
n
==
5
))
{
fval
=
optimise1d
(
pt
,
dir
,
tol
,
lit
,
func
,
100
,
fval
,
bndguess
);
littot
+=
lit
;
}
}
// check to see if the point has moved more than one average tolerance
float
avtol
=
SP
((
initpt
-
pt
),
inv_tol
).
SumAbsoluteValue
();
...
...
This diff is collapsed.
Click to expand it.
optimise.h
+
1
−
1
View file @
c75ac3d6
...
...
@@ -27,7 +27,7 @@ float optimise1d(ColumnVector &pt, const ColumnVector dir,
float
optimise
(
ColumnVector
&
pt
,
int
numopt
,
const
ColumnVector
&
tol
,
float
(
*
func
)(
const
ColumnVector
&
),
int
&
iterations_done
,
int
max_iter
,
const
ColumnVector
&
boundguess
);
int
max_iter
,
const
ColumnVector
&
boundguess
,
const
bool
in_slice
=
false
);
}
...
...
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