eOn 3.2.0
Long-timescale dynamics: aKMC, NEB, parallel replica
☾
Toggle main menu visibility
Loading...
Searching...
No Matches
Optimizer.cpp
Go to the documentation of this file.
1
/*
2
** This file is part of eOn.
3
**
4
** SPDX-License-Identifier: BSD-3-Clause
5
**
6
** Copyright (c) 2010--present, eOn Development Team
7
** All rights reserved.
8
**
9
** Repo:
10
** https://github.com/TheochemUI/eOn
11
*/
12
#include "
eon/Optimizer.h
"
13
#include "
eon/BaseStructures.h
"
14
#include "
eon/ConjugateGradients.h
"
15
#include "
eon/FIRE.h
"
16
#include "
eon/LBFGS.h
"
17
#include "
eon/Quickmin.h
"
18
#include "
eon/SteepestDescent.h
"
19
#ifdef WITH_XTSCI
20
#include "
eon/XtsciOptimizer.h
"
21
#endif
22
23
namespace
eonc::helpers::create
{
24
std::unique_ptr<Optimizer>
mkOptim
(std::shared_ptr<ObjectiveFunction> a_objf,
25
OptType
a_otype,
26
const
Parameters
&a_params) {
27
switch
(a_otype) {
28
case
OptType::FIRE
: {
29
return
std::make_unique<FIRE>(a_objf, a_params);
30
}
31
case
OptType::QM
: {
32
return
std::make_unique<Quickmin>(a_objf, a_params);
33
}
34
case
OptType::CG
: {
35
return
std::make_unique<ConjugateGradients>(a_objf, a_params);
36
}
37
case
OptType::LBFGS
: {
38
return
std::make_unique<LBFGS>(a_objf, a_params);
39
}
40
case
OptType::SD
: {
41
return
std::make_unique<SteepestDescent>(a_objf, a_params);
42
}
43
#ifdef WITH_XTSCI
44
case
OptType::XTSCI
: {
45
return
std::make_unique<XtsciOptimizer>(a_objf, a_params);
46
}
47
#else
48
case
OptType::XTSCI
: {
49
throw
std::runtime_error(
50
"[Optimizer] opt_method=xtsci needs -Dwith_xtsci=true"
);
51
}
52
#endif
53
case
OptType::None
: {
54
throw
std::runtime_error(
"[Optimizer] Cannot create None"
);
55
}
56
case
OptType::Unknown
: {
57
throw
std::runtime_error(
"[Optimizer] Cannot create Unknown"
);
58
}
59
default
: {
60
throw
std::runtime_error(
"Unsupported optimization type"
);
61
}
62
}
63
}
64
}
// namespace eonc::helpers::create
BaseStructures.h
ConjugateGradients.h
Direct optimization for energy minimization.
FIRE.h
LBFGS.h
Optimizer.h
The optimizer class is used to serve as an abstract class for all optimizers, as well as to call an o...
Quickmin.h
SteepestDescent.h
XtsciOptimizer.h
eonc::Parameters
Definition
Parameters.h:35
eonc::helpers::create
Definition
Optimizer.cpp:23
eonc::helpers::create::mkOptim
std::unique_ptr< Optimizer > mkOptim(std::shared_ptr< ObjectiveFunction > a_objf, OptType a_otype, const Parameters &a_params)
Definition
Optimizer.cpp:24
eonc::OptType
OptType
Definition
BaseStructures.h:103
eonc::OptType::LBFGS
@ LBFGS
Definition
BaseStructures.h:109
eonc::OptType::SD
@ SD
Definition
BaseStructures.h:111
eonc::OptType::CG
@ CG
Definition
BaseStructures.h:108
eonc::OptType::None
@ None
Definition
BaseStructures.h:106
eonc::OptType::XTSCI
@ XTSCI
Definition
BaseStructures.h:112
eonc::OptType::Unknown
@ Unknown
Definition
BaseStructures.h:105
eonc::OptType::FIRE
@ FIRE
Definition
BaseStructures.h:110
eonc::OptType::QM
@ QM
Definition
BaseStructures.h:107
client
Optimizer.cpp
Generated by
1.17.0
Generated by
Doxygen 1.17.0
Analytics by
Antics
provided by
TurtleTech ehf