Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
alta
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alta
alta
Commits
cb99c1eb
Commit
cb99c1eb
authored
Sep 18, 2013
by
Laurent Belcour
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding a function get_string to the argument object.
Adding more functionalities to the Ipopt fitter
parent
12b40171
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
1 deletion
+49
-1
sources/core/args.h
sources/core/args.h
+12
-0
sources/plugins/nonlinear_fitter_ipopt/fitter.cpp
sources/plugins/nonlinear_fitter_ipopt/fitter.cpp
+6
-0
sources/plugins/nonlinear_fitter_ipopt/fitter.h
sources/plugins/nonlinear_fitter_ipopt/fitter.h
+11
-1
sources/tests/unitary-blinn.py
sources/tests/unitary-blinn.py
+20
-0
No files found.
sources/core/args.h
View file @
cb99c1eb
...
...
@@ -130,6 +130,18 @@ class arguments
//std::cerr << "Underfined request to key : \"" << key << "\"" << std::endl ;
return
std
::
string
()
;
}
}
//! \brief acces to the string value associated with the parameter
//! \a key.
//!
//! The \a default_value argument will be returned if the \a key
//! has no associated value.
std
::
string
get_string
(
const
std
::
string
&
key
,
std
::
string
default_value
=
""
)
const
{
if
(
_map
.
count
(
key
)
>
0
)
return
_map
.
find
(
key
)
->
second
.
c_str
()
;
else
return
default_value
;
}
//! \brief acces to the float value associated with the parameter
//! \a key.
...
...
sources/plugins/nonlinear_fitter_ipopt/fitter.cpp
View file @
cb99c1eb
...
...
@@ -265,9 +265,15 @@ bool nonlinear_fitter_ipopt::fit_data(const data* d, function* fit, const argume
// Static parameters for the Solver
app
->
Options
()
->
SetStringValue
(
"hessian_approximation"
,
"limited-memory"
);
#ifdef DEBUG
app
->
Options
()
->
SetIntegerValue
(
"print_level"
,
5
);
#else
app
->
Options
()
->
SetIntegerValue
(
"print_level"
,
0
);
#endif
// Solver's options
app
->
Options
()
->
SetIntegerValue
(
"max_iter"
,
args
.
get_int
(
"ipopt-max-iter"
,
10
));
app
->
Options
()
->
SetStringValue
(
"linear_solver"
,
args
.
get_string
(
"ipopt-solver"
,
"mumps"
));
// Solves the NL problem
...
...
sources/plugins/nonlinear_fitter_ipopt/fitter.h
View file @
cb99c1eb
...
...
@@ -28,11 +28,21 @@
*
* <pre>
* INCLUDEPATH += [path-to-ipopt-include]
* LIBS += -L[path-to-ipopt-lib] -lipopt
* LIBS += -L[path-to-ipopt-lib] -lipopt -lipoptamplinterface
* -lcoinmumps -lcoinmetis -lcoinlapack -lcoinblas -lcoinasl
* </pre>
*
*
* <h3>Plugin parameters</h3>
* <ul>
* <li><b>--ipopt-max-iter</b> <em>[int]</em> to control the number
* of iterations the non linear solver will take before returning a
* solution. <em>Note that this solution might incorrect.</em></li>
* <li><b>--ceres-solverr</b> <em>[string]</em> to control the type
* linear solver that will be used during matrix operations. See
* <a href="http://www.coin-or.org/Ipopt/documentation/node50.html">
* here</a> for the list of possible choices.</li>
* </ul>
*
*/
class
nonlinear_fitter_ipopt
:
public
fitter
...
...
sources/tests/unitary-blinn.py
0 → 100644
View file @
cb99c1eb
import
math
f
=
open
(
'unitary-blinn.data'
,
'w+'
)
# Generate the header of the file in the ALTA format
f
.
write
(
"#DIM 1 1
\n
"
)
f
.
write
(
"#PARAM_IN COS_TH
\n
"
)
f
.
write
(
"#PARAM_OUT INV_STERADIAN
\n
"
)
def
blinn
(
cost
,
sigma
):
return
math
.
pow
(
cost
,
sigma
);
#endif
for
i
in
range
(
0
,
99
):
theta
=
i
*
0.01
val
=
blinn
(
theta
,
10
);
f
.
write
(
str
(
theta
)
+
"
\t
"
+
str
(
val
)
+
"
\n
"
);
#end
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