34 const char* xmltext = R
"(<tmp> 35 <var name="B" id="j_B">2.0</var> 46 CHECK(uf.
A == Approx(1.0));
47 CHECK(uf.
B == Approx(2.0));
56 CHECK(val == Approx(val_2));
66 RealType approx_dudr = (val_plus_h - val_minus_h) / (2 * h);
67 CHECK(dudr == Approx(approx_dudr).epsilon(h));
69 RealType approx_d2udr2 = (val_plus_h + val_minus_h - 2 * val) / (h * h);
70 CHECK(d2udr2 == Approx(approx_d2udr2).epsilon(h));
78 CHECK(val == Approx(val_3));
79 CHECK(dudr == Approx(dudr_3));
80 CHECK(d2udr2 == Approx(d2udr2_3));
88 std::vector<TinyVector<RealType, 3>> param_derivs(nparam);
98 for (
int i = 0; i < nparam; i++)
100 std::string var_name = var_param.
name(i);
102 var_param[var_name] = old_param + h;
110 RealType val_dp = (val_h - val) / h;
111 CHECK(val_dp == Approx(param_derivs[i][0]).epsilon(h));
113 RealType dudr_dp = (dudr_h - dudr) / h;
114 CHECK(dudr_dp == Approx(param_derivs[i][1]).epsilon(h));
116 RealType d2udr2_dp = (d2udr2_h - d2udr2) / h;
117 CHECK(d2udr2_dp == Approx(param_derivs[i][2]).epsilon(h));
119 var_param[var_name] = old_param;
class that handles xmlDoc
helper functions for EinsplineSetBuilder
bool put(xmlNodePtr cur) override
process xmlnode and registers variables to optimize
void checkInVariablesExclusive(opt_variables_type &active) override
check in variational parameters to the global list of parameters used by the optimizer.
TEST_CASE("complex_helper", "[type_traits]")
void setCusp(real_type cusp) override
empty virtual function to help builder classes
void resetIndex()
reset Index
Communicate * Controller
Global Communicator for a process.
Wrapping information on parallelism.
Implements the function f = A*r/(B*r + 1) - A/B.
REQUIRE(std::filesystem::exists(filename))
void resetParametersExclusive(const opt_variables_type &active) override
reset the parameters during optimizations.
class to handle a set of variables that can be modified during optimizations
int size_of_active() const
return the number of active variables
bool parseFromString(const std::string_view data)
CHECK(log_values[0]==ComplexApprox(std::complex< double >{ 5.603777579195571, -6.1586603331188225 }))
const std::string & name(int i) const
return the name of i-th variable
bool evaluateDerivatives(real_type r, std::vector< TinyVector< real_type, 3 >> &derivs) override
optimize::VariableSet::real_type real_type
typedef for real values
real_type evaluate(real_type r) const