9 #include "casm/external/Eigen/Dense"
32 static const std::string
Name;
33 static const std::string
Desc;
36 Reference(Name, Desc),
m_value(_value) {}
48 std::unique_ptr<ConstantReference>
clone()
const {
49 return notstd::make_unique<ConstantReference>(*this->
_clone());
79 typedef std::function<Eigen::VectorXd(const Configuration &)>
InputFunction;
102 InputFunction _input,
105 Reference(_name, _desc),
114 std::unique_ptr<HyperPlaneReferenceBase>
clone()
const {
115 return notstd::make_unique<HyperPlaneReferenceBase>(*this->
_clone());
128 const std::map<std::string, Eigen::VectorXd> &
supercell()
const {
135 const std::map<std::string, Eigen::VectorXd> &
config()
const {
140 std::function<Eigen::VectorXd(const Configuration &)>
input()
const {
185 std::map<std::string, Eigen::VectorXd> &
config() {
242 InputFunction _input,
249 std::unique_ptr<HyperPlaneReference>
clone()
const {
250 return notstd::make_unique<HyperPlaneReference>(*this->
_clone());
279 std::map<std::string, Eigen::VectorXd> &
config() {
virtual HyperPlaneReferenceBase * _clone() const override
Clone.
Eigen::VectorXd m_global_ref
std::function< Eigen::VectorXd(const Configuration &)> input() const
Return the 'input' function that maps a Configuration to coordinates.
std::function< Eigen::VectorXd(const Configuration &)> InputFunction
double value() const
Return the constant value used for all Configuration.
virtual ~HyperPlaneReferenceBase()
static const std::string Desc
Eigen::VectorXd hyperplane(const Configuration &config) const
Return the reference hyperplane used for a particular configuration.
HyperPlaneReferenceBase(std::string _name, std::string _desc, const Eigen::VectorXd &_global_ref, InputFunction _input, SpecializedRef _supercell_ref=SpecializedRef(), SpecializedRef _config_ref=SpecializedRef())
Constructor.
std::map< std::string, Eigen::VectorXd > m_config_ref
static const std::string Desc
static const std::string Name
std::map< std::string, Eigen::VectorXd > SpecializedRef
std::map< std::string, Eigen::VectorXd > & config()
Access a map of configname to reference for Configuration specialized references. ...
std::unique_ptr< ConstantReference > clone() const
std::unique_ptr< HyperPlaneReferenceBase > clone() const
Clone.
const std::map< std::string, Eigen::VectorXd > & supercell() const
const Access a map of scelname to reference for Supercell specialized references
HyperPlaneReference * _clone() const override
Clone.
virtual ConstantReference * _clone() const override
Clone.
std::map< std::string, Eigen::VectorXd > m_supercell_ref
Eigen::VectorXd & global()
Access the global reference.
static const std::string Name
std::unique_ptr< HyperPlaneReference > clone() const
Clone.
double evaluate(const Configuration &config) const override
Return the reference for a particular configuration.
HyperPlaneReference(const Eigen::VectorXd &_global_ref, InputFunction _input, SpecializedRef _supercell_ref=SpecializedRef(), SpecializedRef _config_ref=SpecializedRef())
Constructor.
double evaluate(const Configuration &config) const override
Returns the same constant value for all Configuration.
std::map< std::string, Eigen::VectorXd > & supercell()
Access a map of scelname to reference for Supercell specialized references.
const Eigen::VectorXd & global() const
const Access the global reference
std::map< std::string, Eigen::VectorXd > & config()
Access a map of configname to reference for Configuration specialized references. ...
Maps a Configuration to a scalar value via a hyperplane.
std::map< std::string, Eigen::VectorXd > & supercell()
Access a map of scelname to reference for Supercell specialized references.
Maps all Configurations to the same value.
ScalarAttribute< Configuration > Reference
ConstantReference(double _value=0.0)
Eigen::VectorXd input(const Configuration &config) const
Return the 'input' coordinates that a Configuration is mapped to.
const std::map< std::string, Eigen::VectorXd > & config() const
const Access a map of configname to reference for Configuration specialized references ...
Eigen::VectorXd & global()
Access the global reference.
Maps a Configuration to a scalar value via a hyperplane.
A Configuration represents the values of all degrees of freedom in a Supercell.