Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
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
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
74693d8f
Commit
74693d8f
authored
1 year ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
fit print more compact
parent
f181962b
No related branches found
No related tags found
1 merge request
!1745
refactor fit dirs and fit monitor
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Sim/Fitting/FitPrintService.cpp
+9
-38
9 additions, 38 deletions
Sim/Fitting/FitPrintService.cpp
Sim/Fitting/FitPrintService.h
+0
-3
0 additions, 3 deletions
Sim/Fitting/FitPrintService.h
Sim/Fitting/FitStatus.h
+2
-3
2 additions, 3 deletions
Sim/Fitting/FitStatus.h
with
11 additions
and
44 deletions
Sim/Fitting/FitPrintService.cpp
+
9
−
38
View file @
74693d8f
...
...
@@ -21,22 +21,6 @@
#include
<iostream>
#include
<sstream>
namespace
{
size_t
length_of_longest_name
(
const
mumufit
::
Parameters
&
params
)
{
size_t
result
(
0
);
for
(
const
auto
&
par
:
params
)
{
if
(
par
.
name
().
size
()
>
result
)
result
=
par
.
name
().
size
();
}
return
result
;
}
}
// namespace
FitPrintService
::
FitPrintService
()
=
default
;
void
FitPrintService
::
print
(
const
FitObjective
&
objective
)
{
std
::
ostringstream
ostr
;
...
...
@@ -47,7 +31,6 @@ void FitPrintService::print(const FitObjective& objective)
}
ostr
<<
iterationHeaderString
(
objective
);
ostr
<<
wallTimeString
();
ostr
<<
parameterString
(
objective
);
if
(
objective
.
isCompleted
())
...
...
@@ -60,20 +43,12 @@ std::string FitPrintService::iterationHeaderString(const FitObjective& objective
{
std
::
ostringstream
result
;
result
<<
"FitPrintService::update -> Info."
<<
" NCall:"
<<
objective
.
iterationInfo
().
iterationCount
()
<<
" Chi2:"
<<
std
::
scientific
<<
std
::
setprecision
(
8
)
<<
objective
.
iterationInfo
().
chi2
()
<<
"
\n
"
;
return
result
.
str
();
}
std
::
string
FitPrintService
::
wallTimeString
()
{
std
::
ostringstream
result
;
m_last_call_time
.
stop
();
result
<<
"Wall time since last call:"
<<
std
::
fixed
<<
std
::
setprecision
(
2
)
<<
m_last_call_time
.
runTime
()
<<
"
\n
"
;
result
<<
"Fit iteration "
<<
objective
.
iterationInfo
().
iterationCount
()
<<
" Chi2 "
<<
std
::
scientific
<<
std
::
setprecision
(
8
)
<<
objective
.
iterationInfo
().
chi2
()
<<
" dt "
<<
m_last_call_time
.
runTime
()
<<
"
\n
"
;
m_last_call_time
.
start
();
return
result
.
str
();
...
...
@@ -83,14 +58,10 @@ std::string FitPrintService::parameterString(const FitObjective& objective)
{
std
::
ostringstream
result
;
const
auto
params
=
objective
.
iterationInfo
().
parameters
();
const
auto
length
=
length_of_longest_name
(
params
);
for
(
const
auto
&
par
:
params
)
{
result
<<
Base
::
String
::
padRight
(
par
.
name
(),
length
)
<<
std
::
scientific
<<
std
::
setprecision
(
6
)
<<
" "
<<
par
.
startValue
()
<<
" "
<<
par
.
limits
().
toString
()
<<
" "
<<
par
.
value
()
<<
"
\n
"
;
}
result
<<
"P"
;
for
(
const
auto
&
par
:
objective
.
iterationInfo
().
parameters
())
result
<<
" "
<<
std
::
scientific
<<
std
::
setprecision
(
6
)
<<
par
.
value
();
result
<<
"
\n
"
;
return
result
.
str
();
}
...
...
This diff is collapsed.
Click to expand it.
Sim/Fitting/FitPrintService.h
+
0
−
3
View file @
74693d8f
...
...
@@ -27,13 +27,10 @@ class FitObjective;
class
FitPrintService
{
public:
FitPrintService
();
void
print
(
const
FitObjective
&
objective
);
private:
std
::
string
iterationHeaderString
(
const
FitObjective
&
objective
);
std
::
string
wallTimeString
();
std
::
string
parameterString
(
const
FitObjective
&
objective
);
std
::
string
fitResultString
(
const
FitObjective
&
objective
);
...
...
This diff is collapsed.
Click to expand it.
Sim/Fitting/FitStatus.h
+
2
−
3
View file @
74693d8f
...
...
@@ -23,12 +23,11 @@
#include
<functional>
#include
<vector>
class
FitObjective
;
class
FitPrintService
;
namespace
mumufit
{
class
MinimizerResult
;
}
class
FitObjective
;
class
FitPrintService
;
//! Contains status of the fitting (running, interupted etc) and all intermediate
//! information which has to be collected during the fit.
...
...
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