Skip to content

shapeworks::DualVectorFunction

More...

#include <DualVectorFunction.h>

Inherits from shapeworks::VectorFunction, itk::LightObject

Public Types

Name
typedef DualVectorFunction Self
typedef itk::SmartPointer< Self > Pointer
typedef itk::SmartPointer< const Self > ConstPointer
typedef VectorFunction Superclass
typedef Superclass::VectorType VectorType

Public Functions

Name
itkTypeMacro(DualVectorFunction , VectorFunction )
itkNewMacro(Self )
itkStaticConstMacro(Dimension , unsigned int , VDimension )
virtual VectorType Evaluate(unsigned int idx, unsigned int d, const ParticleSystem * system, double & maxmove) const
virtual double EnergyA(unsigned int idx, unsigned int d, const ParticleSystem * system) const
virtual double EnergyB(unsigned int idx, unsigned int d, const ParticleSystem * system) const
virtual double Energy(unsigned int idx, unsigned int d, const ParticleSystem * system) const
virtual VectorType Evaluate(unsigned int idx, unsigned int d, const ParticleSystem * system, double & maxmove, double & energy) const
virtual void BeforeEvaluate(unsigned int , unsigned int , const ParticleSystem * )
virtual void AfterIteration()
virtual void BeforeIteration()
virtual void SetParticleSystem(ParticleSystem * p)
virtual void SetDomainNumber(unsigned int i)
void SetFunctionA(VectorFunction * o)
VectorFunction * GetFunctionA()
VectorFunction * GetFunctionB()
void SetFunctionB(VectorFunction * o)
void SetAOn()
void SetAOff()
void SetAOn(bool s)
bool GetAOn() const
void SetBOn()
void SetBOff()
void SetBOn(bool s)
bool GetBOn() const
virtual void SetRelativeEnergyScaling(double r) override
virtual double GetRelativeEnergyScaling() const override
void SetRelativeGradientScaling(double r)
double GetRelativeGradientScaling() const
double GetAverageGradMagA() const
double GetAverageGradMagB() const
double GetAverageEnergyA() const
double GetAverageEnergyB() const
virtual VectorFunction::Pointer Clone()

Protected Functions

Name
DualVectorFunction()
virtual ~DualVectorFunction()
void operator=(const DualVectorFunction & )
DualVectorFunction(const DualVectorFunction & )

Public Attributes

Name
constexpr static int VDimension

Protected Attributes

Name
bool m_AOn
bool m_BOn
double m_RelativeGradientScaling
double m_RelativeEnergyScaling
double m_AverageGradMagA
double m_AverageGradMagB
double m_AverageEnergyA
double m_AverageEnergyB
double m_Counter
VectorFunction::Pointer m_FunctionA
VectorFunction::Pointer m_FunctionB

Additional inherited members

Public Functions inherited from shapeworks::VectorFunction

Name
virtual void ResetBuffers()
virtual ParticleSystem * GetParticleSystem() const
virtual int GetDomainNumber() const

Protected Functions inherited from shapeworks::VectorFunction

Name
VectorFunction()
virtual ~VectorFunction()
VectorFunction(const VectorFunction & )

Protected Attributes inherited from shapeworks::VectorFunction

Name
ParticleSystem * m_ParticleSystem
unsigned int m_DomainNumber

Detailed Description

class shapeworks::DualVectorFunction;

This class combines the results of evaluating 2 VectorFunction and presents the interface of a single function evaluation. Optionally, only the first function can be used by calling SetLinkOff().

Public Types Documentation

typedef Self

typedef DualVectorFunction shapeworks::DualVectorFunction::Self;

Standard class typedefs.

typedef Pointer

typedef itk::SmartPointer<Self> shapeworks::DualVectorFunction::Pointer;

typedef ConstPointer

typedef itk::SmartPointer<const Self> shapeworks::DualVectorFunction::ConstPointer;

typedef Superclass

typedef VectorFunction shapeworks::DualVectorFunction::Superclass;

typedef VectorType

typedef Superclass::VectorType shapeworks::DualVectorFunction::VectorType;

Vector type.

Public Functions Documentation

function itkTypeMacro

itkTypeMacro(
    DualVectorFunction ,
    VectorFunction 
)

function itkNewMacro

itkNewMacro(
    Self 
)

Method for creation through the object factory.

function itkStaticConstMacro

itkStaticConstMacro(
    Dimension ,
    unsigned int ,
    VDimension 
)

Dimensionality of the domain of the particle system.

function Evaluate

inline virtual VectorType Evaluate(
    unsigned int idx,
    unsigned int d,
    const ParticleSystem * system,
    double & maxmove
) const

Reimplements: shapeworks::VectorFunction::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 EnergyA

inline virtual double EnergyA(
    unsigned int idx,
    unsigned int d,
    const ParticleSystem * system
) const

function EnergyB

inline virtual double EnergyB(
    unsigned int idx,
    unsigned int d,
    const ParticleSystem * system
) const

function Energy

inline virtual double Energy(
    unsigned int idx,
    unsigned int d,
    const ParticleSystem * system
) const

Reimplements: shapeworks::VectorFunction::Energy

function Evaluate

inline virtual VectorType Evaluate(
    unsigned int idx,
    unsigned int d,
    const ParticleSystem * system,
    double & maxmove,
    double & energy
) const

Reimplements: shapeworks::VectorFunction::Evaluate

function BeforeEvaluate

inline virtual void BeforeEvaluate(
    unsigned int ,
    unsigned int ,
    const ParticleSystem * 
)

Reimplements: shapeworks::VectorFunction::BeforeEvaluate

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 AfterIteration

inline virtual void AfterIteration()

Reimplements: shapeworks::VectorFunction::AfterIteration

This method is called by a solver after each iteration. Subclasses may or may not implement this method.

function BeforeIteration

inline virtual void BeforeIteration()

Reimplements: shapeworks::VectorFunction::BeforeIteration

This method is called by a solver before each iteration. Subclasses may or may not implement this method.

function SetParticleSystem

inline virtual void SetParticleSystem(
    ParticleSystem * p
)

Reimplements: shapeworks::VectorFunction::SetParticleSystem

Some subclasses may require a pointer to the particle system and its domain number. These methods set/get those values.

function SetDomainNumber

inline virtual void SetDomainNumber(
    unsigned int i
)

Reimplements: shapeworks::VectorFunction::SetDomainNumber

function SetFunctionA

inline void SetFunctionA(
    VectorFunction * o
)

function GetFunctionA

inline VectorFunction * GetFunctionA()

function GetFunctionB

inline VectorFunction * GetFunctionB()

function SetFunctionB

inline void SetFunctionB(
    VectorFunction * o
)

function SetAOn

inline void SetAOn()

Turn each term on and off.

function SetAOff

inline void SetAOff()

function SetAOn

inline void SetAOn(
    bool s
)

function GetAOn

inline bool GetAOn() const

function SetBOn

inline void SetBOn()

function SetBOff

inline void SetBOff()

function SetBOn

inline void SetBOn(
    bool s
)

function GetBOn

inline bool GetBOn() const

function SetRelativeEnergyScaling

inline virtual void SetRelativeEnergyScaling(
    double r
) override

Reimplements: shapeworks::VectorFunction::SetRelativeEnergyScaling

The relative scaling scales the gradient B relative to A. By default this value is 1.0.

function GetRelativeEnergyScaling

inline virtual double GetRelativeEnergyScaling() const override

Reimplements: shapeworks::VectorFunction::GetRelativeEnergyScaling

function SetRelativeGradientScaling

inline void SetRelativeGradientScaling(
    double r
)

function GetRelativeGradientScaling

inline double GetRelativeGradientScaling() const

function GetAverageGradMagA

inline double GetAverageGradMagA() const

function GetAverageGradMagB

inline double GetAverageGradMagB() const

function GetAverageEnergyA

inline double GetAverageEnergyA() const

function GetAverageEnergyB

inline double GetAverageEnergyB() const

function Clone

inline virtual VectorFunction::Pointer Clone()

Reimplements: shapeworks::VectorFunction::Clone

Protected Functions Documentation

function DualVectorFunction

inline DualVectorFunction()

function ~DualVectorFunction

inline virtual ~DualVectorFunction()

function operator=

void operator=(
    const DualVectorFunction & 
)

function DualVectorFunction

DualVectorFunction(
    const DualVectorFunction & 
)

Public Attributes Documentation

variable VDimension

static constexpr static int VDimension = 3;

Protected Attributes Documentation

variable m_AOn

bool m_AOn;

variable m_BOn

bool m_BOn;

variable m_RelativeGradientScaling

double m_RelativeGradientScaling;

variable m_RelativeEnergyScaling

double m_RelativeEnergyScaling;

variable m_AverageGradMagA

double m_AverageGradMagA;

variable m_AverageGradMagB

double m_AverageGradMagB;

variable m_AverageEnergyA

double m_AverageEnergyA;

variable m_AverageEnergyB

double m_AverageEnergyB;

variable m_Counter

double m_Counter;

variable m_FunctionA

VectorFunction::Pointer m_FunctionA;

variable m_FunctionB

VectorFunction::Pointer m_FunctionB;

Updated on 2024-03-17 at 12:58:44 -0600