Template Class MeanFieldPSpinSpherical#

Inheritance Relationships#

Base Type#

Class Documentation#

template<size_t p>
class MeanFieldPSpinSpherical : public pele::BasePotential#

Public Functions

inline virtual ~MeanFieldPSpinSpherical()#
inline MeanFieldPSpinSpherical(
pele::Array<double> interactions_,
size_t nspins_,
double tol_
)#
inline double add_energy(pele::Array<double> const &x)#
inline virtual double add_energy_gradient(
pele::Array<double> const &x,
pele::Array<double> &grad
)#

compute the energy and gradient, but don’t initialize the gradient to zero

inline virtual double add_energy_gradient_hessian(
pele::Array<double> const &x,
pele::Array<double> &grad,
pele::Array<double> &hess
)#

compute the energy, gradient, and Hessian, but don’t initialize the gradient or hessian to zero

inline virtual double get_energy(pele::Array<double> const &x)#

Return the energy of configuration x.

This is the only function which must be overloaded

inline virtual double get_energy_gradient(
pele::Array<double> const &x,
pele::Array<double> &grad
)#

compute the energy and gradient.

If not overloaded it will compute the numerical gradient

virtual void numerical_gradient(
Array<double> const &x,
Array<double> &grad,
double eps = 1e-6
)#

compute the numerical gradient

virtual void numerical_hessian(
Array<double> const &x,
Array<double> &hess,
double eps = 1e-6
)#

compute the numerical gradient

Protected Functions

inline size_t m_get_index(size_t *comb)#
inline void m_orthogonalize(Array<double> const &spins_, Array<double> &grad)#
inline void m_normalize_spins(Array<double> &spins_)#

Protected Attributes

pele::Array<double> m_interactions#
pele::Array<double> m_spins#
pele::Array<size_t> m_indexes#
size_t m_N#
double m_tol#
double m_sqrt_N#
double m_N_prf#
pele::combination_generator<size_t*> m_combination_generator#
pele::combination_generator<size_t*> m_combination_generator_grad#
pele::combination_generator<size_t*> m_combination_generator_hess#

Protected Static Attributes

static const size_t m_p = p#
static const size_t m_pf = Factorial<m_p>::value#