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
fd270685
Commit
fd270685
authored
2 years ago
by
Mikhail Svechnikov
Browse files
Options
Downloads
Patches
Plain Diff
MinimizerContainerItem: pass algorithm to minimizer: fix
parent
a23500bb
No related branches found
No related tags found
1 merge request
!1004
Fit: catalogize algorithms, not minimizers
Pipeline
#73829
canceled
2 years ago
Stage: build
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
GUI/Model/Job/MinimizerItem.cpp
+24
-4
24 additions, 4 deletions
GUI/Model/Job/MinimizerItem.cpp
GUI/Model/Job/MinimizerItem.h
+1
-0
1 addition, 0 deletions
GUI/Model/Job/MinimizerItem.h
GUI/View/Fit/MinimizerSettingsWidget.cpp
+1
-0
1 addition, 0 deletions
GUI/View/Fit/MinimizerSettingsWidget.cpp
with
26 additions
and
4 deletions
GUI/Model/Job/MinimizerItem.cpp
+
24
−
4
View file @
fd270685
...
...
@@ -43,10 +43,9 @@ void add_algorithm_from_minimizer_to_list_and_map(const QString& minimizer,
ASSERT
(
algorithms
.
size
()
==
descriptions
.
size
())
for
(
int
i
=
0
;
i
<
algorithms
.
size
();
i
++
)
{
QString
name
=
" "
+
algorithms
[
i
];
common_algorithms_list
.
append
(
name
);
common_algorithms_list
.
append
(
algorithms
[
i
]);
common_algorithms_descriptions
.
append
(
descriptions
[
i
]);
algorithm_minimizer_map
.
insert
(
name
,
minimizer_names_map
.
key
(
minimizer
));
algorithm_minimizer_map
.
insert
(
algorithms
[
i
]
,
minimizer_names_map
.
key
(
minimizer
));
}
}
void
create_algorithm_list_and_map
(
QString
&
default_common_algorithm
,
QStringList
&
algorithms_list
,
...
...
@@ -90,7 +89,7 @@ void create_algorithm_list_and_map(QString& default_common_algorithm, QStringLis
add_algorithm_from_minimizer_to_list_and_map
(
GSLLMAMinimizerItem
::
M_TYPE
,
algorithms_list
,
algorithms_descriptions
);
default_common_algorithm
=
algorithms_list
[
1
];
// after the first header
default_common_algorithm
=
algorithms_list
[
1
];
// after the first header
: Minuit2 Migrad
}
#endif
...
...
@@ -204,12 +203,33 @@ void MinimizerContainerItem::setCurrentCommonAlgorithm(const QString& name)
ASSERT
(
algorithmHasMinimizer
(
name
));
setCurrentMinimizer
(
algorithm_minimizer_map
.
value
(
name
));
applyAlgorithmToMinimizer
(
name
);
}
ComboProperty
MinimizerContainerItem
::
commonAlgorithmCombo
()
const
{
return
getItemValue
(
P_COMMON_ALGORITHMS
).
value
<
ComboProperty
>
();
}
void
MinimizerContainerItem
::
applyAlgorithmToMinimizer
(
const
QString
&
name
)
{
// Minuit2
if
(
currentMinimizerM_TYPE
()
==
MinuitMinimizerItem
::
M_TYPE
)
minimizerItemMinuit
()
->
setCurrentAlgorithm
(
name
);
// GSL MultiMin
if
(
currentMinimizerM_TYPE
()
==
GSLMultiMinimizerItem
::
M_TYPE
)
minimizerItemGSLMulti
()
->
setCurrentAlgorithm
(
name
);
// TMVA Genetic
// do nothing
// GSL Simulated Annealing
// do nothing
// GSL Levenberg-Marquardt
// do nothing
}
#endif
QString
MinimizerContainerItem
::
currentObjectiveMetric
()
const
{
...
...
This diff is collapsed.
Click to expand it.
GUI/Model/Job/MinimizerItem.h
+
1
−
0
View file @
fd270685
...
...
@@ -70,6 +70,7 @@ public:
bool
algorithmHasMinimizer
(
const
QString
&
name
);
void
setCurrentCommonAlgorithm
(
const
QString
&
name
);
ComboProperty
commonAlgorithmCombo
()
const
;
void
applyAlgorithmToMinimizer
(
const
QString
&
name
);
#endif
// Objective metric to use for estimating distance between simulated and experimental data
...
...
This diff is collapsed.
Click to expand it.
GUI/View/Fit/MinimizerSettingsWidget.cpp
+
1
−
0
View file @
fd270685
...
...
@@ -139,6 +139,7 @@ void MinimizerSettingsWidget::createGroupedAlgorithmsCombo()
int
prev
=
comboBox
->
currentIndex
()
-
2
;
int
next
=
comboBox
->
currentIndex
()
+
2
;
QSignalBlocker
b
(
comboBox
);
if
(
previous_state
<
comboBox
->
currentIndex
()
&&
next
<
comboBox
->
count
())
comboBox
->
setCurrentIndex
(
next
);
else
if
(
previous_state
>
comboBox
->
currentIndex
()
&&
prev
>=
0
)
...
...
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