shapeworks::VectorFunction
#include <VectorFunction.h>
Inherited by shapeworks::CorrespondenceFunction, shapeworks::DisentangledCorrespondenceFunction, shapeworks::DualVectorFunction, shapeworks::LegacyCorrespondenceFunction, shapeworks::SamplingFunction
Public Types
| Name | |
|---|---|
| using vnl_vector_fixed< double, Dimension > | VectorType Type of vectors. |
Public Functions
| Name | |
|---|---|
| virtual VectorType | evaluate(unsigned int , unsigned int , const ParticleSystem * , double & maxtimestep) const =0 |
| virtual VectorType | evaluate(unsigned int , unsigned int , const ParticleSystem * , double & maxtimestep, double & energy) const =0 |
| virtual double | energy(unsigned int , unsigned int , const ParticleSystem * ) const =0 |
| virtual void | reset_buffers() May be called by the solver class. |
| virtual void | after_iteration() This method is called by a solver after each iteration. |
| virtual void | before_iteration() This method is called by a solver before each iteration. |
| virtual void | before_evaluate(unsigned int , unsigned int , const ParticleSystem * ) |
| virtual void | set_particle_system(ParticleSystem * p) Some subclasses may require a pointer to the particle system and its domain number. |
| virtual ParticleSystem * | get_particle_system() const |
| virtual void | set_domain_number(unsigned int i) |
| virtual int | get_domain_number() const |
| virtual std::shared_ptr< VectorFunction > | clone() |
| virtual double | get_relative_energy_scaling() const |
| virtual void | set_relative_energy_scaling(double r) |
| virtual | ~VectorFunction() =default Virtual destructor for proper cleanup of derived classes. |
Protected Functions
| Name | |
|---|---|
| VectorFunction() | |
| VectorFunction(const VectorFunction & ) =delete | |
| VectorFunction & | operator=(const VectorFunction & ) =delete |
Public Attributes
| Name | |
|---|---|
| constexpr static unsigned int | Dimension |
Protected Attributes
| Name | |
|---|---|
| ParticleSystem * | particle_system_ |
| unsigned int | domain_number_ |
Detailed Description
class shapeworks::VectorFunction;
This is the base class defining the API for a function that takes a particle system, domain, and location index as arguments and returns a vector-valued result.
Public Types Documentation
using VectorType
using shapeworks::VectorFunction::VectorType = vnl_vector_fixed<double, Dimension>;
Type of vectors.
Public Functions Documentation
function evaluate
virtual VectorType evaluate(
unsigned int ,
unsigned int ,
const ParticleSystem * ,
double & maxtimestep
) const =0
Reimplemented by: shapeworks::CorrespondenceFunction::evaluate, shapeworks::DisentangledCorrespondenceFunction::evaluate, shapeworks::LegacyCorrespondenceFunction::evaluate, shapeworks::SamplingFunction::evaluate, shapeworks::DualVectorFunction::evaluate
The first argument is a pointer to the particle system. The second argument is the index of the domain within that particle system. The third argument is the index of the particle location within the given domain.
function evaluate
virtual VectorType evaluate(
unsigned int ,
unsigned int ,
const ParticleSystem * ,
double & maxtimestep,
double & energy
) const =0
Reimplemented by: shapeworks::DualVectorFunction::evaluate, shapeworks::CorrespondenceFunction::evaluate, shapeworks::DisentangledCorrespondenceFunction::evaluate, shapeworks::LegacyCorrespondenceFunction::evaluate, shapeworks::SamplingFunction::evaluate
function energy
virtual double energy(
unsigned int ,
unsigned int ,
const ParticleSystem *
) const =0
Reimplemented by: shapeworks::CorrespondenceFunction::energy, shapeworks::DisentangledCorrespondenceFunction::energy, shapeworks::LegacyCorrespondenceFunction::energy, shapeworks::SamplingFunction::energy, shapeworks::DualVectorFunction::energy
function reset_buffers
inline virtual void reset_buffers()
May be called by the solver class.
Reimplemented by: shapeworks::SamplingFunction::reset_buffers
function after_iteration
inline virtual void after_iteration()
This method is called by a solver after each iteration.
Reimplemented by: shapeworks::CorrespondenceFunction::after_iteration, shapeworks::DisentangledCorrespondenceFunction::after_iteration, shapeworks::DualVectorFunction::after_iteration, shapeworks::LegacyCorrespondenceFunction::after_iteration
function before_iteration
inline virtual void before_iteration()
This method is called by a solver before each iteration.
Reimplemented by: shapeworks::CorrespondenceFunction::before_iteration, shapeworks::DisentangledCorrespondenceFunction::before_iteration, shapeworks::LegacyCorrespondenceFunction::before_iteration, shapeworks::DualVectorFunction::before_iteration
function before_evaluate
inline virtual void before_evaluate(
unsigned int ,
unsigned int ,
const ParticleSystem *
)
Reimplemented by: shapeworks::DualVectorFunction::before_evaluate, shapeworks::SamplingFunction::before_evaluate
This method may be called to set up the state of the function object before a call to evaluate. It is necessary in order to initialize certain constants and variables that may be used for calculating the energy as well as the gradients. Typically this is only necessary for the adaptive gradient descent algorithm.
function set_particle_system
inline virtual void set_particle_system(
ParticleSystem * p
)
Some subclasses may require a pointer to the particle system and its domain number.
Reimplemented by: shapeworks::DualVectorFunction::set_particle_system
function get_particle_system
inline virtual ParticleSystem * get_particle_system() const
function set_domain_number
inline virtual void set_domain_number(
unsigned int i
)
Reimplemented by: shapeworks::DualVectorFunction::set_domain_number
function get_domain_number
inline virtual int get_domain_number() const
function clone
inline virtual std::shared_ptr< VectorFunction > clone()
Reimplemented by: shapeworks::CorrespondenceFunction::clone, shapeworks::DisentangledCorrespondenceFunction::clone, shapeworks::DualVectorFunction::clone, shapeworks::LegacyCorrespondenceFunction::clone, shapeworks::SamplingFunction::clone
function get_relative_energy_scaling
inline virtual double get_relative_energy_scaling() const
Reimplemented by: shapeworks::DualVectorFunction::get_relative_energy_scaling
function set_relative_energy_scaling
inline virtual void set_relative_energy_scaling(
double r
)
Reimplemented by: shapeworks::DualVectorFunction::set_relative_energy_scaling
function ~VectorFunction
virtual ~VectorFunction() =default
Virtual destructor for proper cleanup of derived classes.
Protected Functions Documentation
function VectorFunction
inline VectorFunction()
function VectorFunction
VectorFunction(
const VectorFunction &
) =delete
function operator=
VectorFunction & operator=(
const VectorFunction &
) =delete
Public Attributes Documentation
variable Dimension
static constexpr static unsigned int Dimension = 3;
Protected Attributes Documentation
variable particle_system_
ParticleSystem * particle_system_;
variable domain_number_
unsigned int domain_number_;
Updated on 2025-12-17 at 23:05:25 +0000