9#ifndef STRUCTURES_STRUCTURES_H_
10#define STRUCTURES_STRUCTURES_H_
93 return configured_limit <= 0 || iteration < configured_limit;
592 "debug_output_file_extension",
"dat"};
594 "debug_offset_from_mid_point", 3.};
606 "cell_dimensions", {0., 0., 0., 0., 0., 0., 0., 0., 0.}};
624 "laplace_skip_scg_threshold", 0.0};
626 "use_training_geometry_handle",
true};
668 "rotation_removal_projection_threshold",
669 std::numeric_limits<double>::infinity()};
693 log_man <<
i_run.key <<
" : " <<
i_run.value <<
"\n";
818 type.resize(1, num_atoms);
861 double cell[9] = {0., 0., 0., 0., 0., 0., 0., 0., 0.};
905 assertMsg(
field.size() != 0,
"The reference field cannot be empty!");
907 "The reference field should have 5 or more columns!");
916 id.resize(1,
field.rows());
919 for (Eigen::Index i = 0; i <
field.rows(); ++i) {
920 for (Eigen::Index j = 0; j < 3; ++j) {
923 if (
field(i, 3) == 0)
944 for (
int i = 0; i < 9; ++i)
967 for (Eigen::Index i = 0; i <
is_frozen.size(); ++i) {
1050 R.resize(num_rows, other.
R.cols());
1052 E.resize(num_rows, other.
E.cols());
1054 G.resize(num_rows, other.
G.cols());
1061 R.row(dest_row_idx) = other.
R.row(src_row_idx);
1062 E.row(dest_row_idx) = other.
E.row(src_row_idx);
1063 G.row(dest_row_idx) = other.
G.row(src_row_idx);
1071 log_man <<
"R size: " <<
R.size() <<
"\n";
1072 log_man <<
"R (rows, cols): " <<
R.rows() <<
" " <<
R.cols() <<
"\n\n";
1074 log_man <<
"E size: " <<
E.size() <<
"\n";
1075 log_man <<
"E (rows, cols): " <<
E.rows() <<
" " <<
E.cols() <<
"\n\n";
1077 log_man <<
"G size: " <<
G.size() <<
"\n";
1078 log_man <<
"G (rows, cols): " <<
G.rows() <<
" " <<
G.cols() <<
"\n\n";
#define assertMsg(expression, msg)
void appendRows(Eigen::PlainObjectBase< Derived > &mat, const Eigen::PlainObjectBase< Derived > &other)
Gaussian-process regression, kernels, priors, and the searches that run on the surrogate.
ScgCurvatureMode
Selects how SCG computes the directional curvature term.
Eigen::Matrix< int, EigenDynamic, EigenDynamic, FieldMatrixStorage > FieldMatrixi
Eigen::Matrix< Index_t, EigenDynamic, EigenDynamic, FieldMatrixStorage > FieldMatrixIdx
bool usesClassicJointEnergyForcePrior(GPModelProfile profile) noexcept
constexpr bool iterationAllowedByLimit(Index_t iteration, Index_t configured_limit) noexcept
Eigen::Matrix< uint8_t, EigenDynamic, EigenDynamic, FieldMatrixStorage > FieldMatrixU8
Eigen::Matrix< double, EigenDynamic, EigenDynamic, FieldMatrixStorage > FieldMatrixd
AdamOptimizationSettings()
double learning_rate_decay
OptimizerCommonSettings common
Stores configurations of all atoms in the system.
std::vector< Index_t > pair_type_parent
Index_t countMovingAtoms()
void seedNearestNeighbourFromActive()
Seed the fixed-N nearest-neighbour set from the current active (radius-activated) frozen count....
FieldMatrixi atomicNrs
Atomic Number of each atom.
AtomsPositionAndType atoms_froz_inactive
Info on inactive frozen atoms.
FieldMatrixU8 is_frozen
Indicates whether atom is frozen or not.
void assignFromField(const FieldMatrixd &field)
Extract data from a 5-column field.
FieldMatrixIdx id
ID of each atom (we do not use it).
AtomsPositionAndType atoms_froz_active
Info on active frozen atoms.
Index_t n_base_pt
Number of base pair types (0: none).
AtomsPositionAndType atoms_mov
Info on moving atoms.
void copy(const AtomsConfiguration &other)
FieldMatrixIdx type
Type of each atom.
Coord positions
Positions of all atoms in the system.
Eigen::VectorXd atomic_masses
Per-atom input masses; empty selects unit masses.
Structure of atoms positions and types.
void resize(const Index_t num_atoms)
OptimizerCommonSettings common
CeresOptimizationSettings()
Structure of directional derivatives.
std::vector< FieldMatrixd > D1
std::vector< FieldMatrixd > D2
std::vector< FieldMatrixd > D12
EnergyAndGradient(double &e, Eigen::VectorXd &g)
Eigen::VectorXd & gradient
A structure with information used to write the energy surface to a file.
std::string file_extension
bool map_use_configured_priors
MapPriorWeightMode map_prior_weight_mode
Structure of pair of indices.
Structure of limits for iterational loops.
Structure of a string key and template value.
Structure with information for the LBFGS method.
std::shared_ptr< dimer::SphereRotation > sphere_rotation
A copied history starts an independent sphere solve when written.
Observation data: energy, gradient and positions.
void resizeToMatch(const Observation &other, const Index_t num_rows)
void append(const Observation &other)
void copyRow(const Index_t dest_row_idx, const Observation &other, const Index_t src_row_idx)
Settings shared by every hyperparameter optimizer.
OptimizerCommonSettings()
std::function< bool()> stop_requested
A simple pair with identical datatypes.
double map_lengthscale_prior_mu
MapPriorWeightMode map_prior_weight_mode
Annealed (default) or full prior weight; see MapPriorWeightMode.
GPModelProfile model_profile
double tail_lower_barrier
bool use_tail_lower_barrier
OptimizerCommonSettings common
ScgOptimizationSettings()
bool map_use_configured_magn_prior
bool map_use_lognormal_magn_prior
ScgCurvatureMode curvature_mode
bool stationarity_step_stop
bool map_use_configured_lengthscale_prior
double map_lengthscale_prior_s2
std::vector< bool > active_parameters
double map_lengthscale_prior_nu
Stores stop criteria for dimer method (e.g. LBFGS).
Structure of translation parameters.
A simple triplet with identical datatypes.