HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SIM_DerScalar Class Reference

#include <SIM_DerScalar.h>

Public Member Functions

 SIM_DerScalar ()
 
 SIM_DerScalar (fpreal v)
 Initialize to a constant vector, with no derivative. More...
 
 SIM_DerScalar (fpreal v, const UT_Vector3 &D)
 
fpreal v () const
 
const UT_Vector3D () const
 
SIM_DerScalaroperator= (fpreal rhs)
 
SIM_DerScalar operator- () const
 
SIM_DerScalar operator+ (const SIM_DerScalar &rhs) const
 
SIM_DerScalar operator+ (fpreal rhs) const
 
SIM_DerScalar operator- (const SIM_DerScalar &rhs) const
 
SIM_DerScalar operator- (fpreal rhs) const
 
SIM_DerScalar operator* (const SIM_DerScalar &rhs) const
 
SIM_DerScalar operator* (fpreal rhs) const
 
SIM_DerScalar sqr () const
 
SIM_DerScalar operator/ (const SIM_DerScalar &rhs) const
 
SIM_DerScalar operator/ (fpreal rhs) const
 
SIM_DerScalar operator+= (const SIM_DerScalar &rhs)
 
SIM_DerScalar operator+= (fpreal rhs)
 
SIM_DerScalar operator-= (const SIM_DerScalar &rhs)
 
SIM_DerScalar operator-= (fpreal rhs)
 
SIM_DerScalar operator*= (const SIM_DerScalar &rhs)
 
SIM_DerScalar operator*= (fpreal rhs)
 
SIM_DerScalar operator/= (const SIM_DerScalar &rhs)
 
SIM_DerScalar operator/= (fpreal rhs)
 
SIM_DerScalar inverse () const
 
SIM_DerScalar sqrt () const
 

Detailed Description

This class defines a scalar and its derivative w.r.t. a 3D vector. It uses automatic differentiation to maintain the dependency upon the derivative vector as arithmetic operations are performed.

By performing a sequence of arithmetic operations on this class after initializing its derivative appropriately, you can easily keep track of the effect of those operations on the derivative. Independent variables can be included in an equation using the conventional UT_Vector3 and fpreal types, and dependent variables can use the SIM_DerVector3 and SIM_DerScalar types.

It is inspired by Eitan Grinspun's class for the same purpose, described in his 2003 SCA paper on Discrete Shells.

Definition at line 29 of file SIM_DerScalar.h.

Constructor & Destructor Documentation

SIM_DerScalar::SIM_DerScalar ( )
inline

Definition at line 32 of file SIM_DerScalar.h.

SIM_DerScalar::SIM_DerScalar ( fpreal  v)
inlineexplicit

Initialize to a constant vector, with no derivative.

Definition at line 34 of file SIM_DerScalar.h.

SIM_DerScalar::SIM_DerScalar ( fpreal  v,
const UT_Vector3 D 
)
inline

Initialize to a vector with a derivative. This is particularly useful for initializing the variables themselves, where D=I.

Definition at line 38 of file SIM_DerScalar.h.

Member Function Documentation

const UT_Vector3& SIM_DerScalar::D ( ) const
inline

Definition at line 49 of file SIM_DerScalar.h.

SIM_DerScalar SIM_DerScalar::inverse ( ) const
inline

Definition at line 115 of file SIM_DerScalar.h.

SIM_DerScalar SIM_DerScalar::operator* ( const SIM_DerScalar rhs) const
inline

Definition at line 80 of file SIM_DerScalar.h.

SIM_DerScalar SIM_DerScalar::operator* ( fpreal  rhs) const
inline

Definition at line 86 of file SIM_DerScalar.h.

SIM_DerScalar SIM_DerScalar::operator*= ( const SIM_DerScalar rhs)
inline

Definition at line 107 of file SIM_DerScalar.h.

SIM_DerScalar SIM_DerScalar::operator*= ( fpreal  rhs)
inline

Definition at line 109 of file SIM_DerScalar.h.

SIM_DerScalar SIM_DerScalar::operator+ ( const SIM_DerScalar rhs) const
inline

Definition at line 62 of file SIM_DerScalar.h.

SIM_DerScalar SIM_DerScalar::operator+ ( fpreal  rhs) const
inline

Definition at line 67 of file SIM_DerScalar.h.

SIM_DerScalar SIM_DerScalar::operator+= ( const SIM_DerScalar rhs)
inline

Definition at line 99 of file SIM_DerScalar.h.

SIM_DerScalar SIM_DerScalar::operator+= ( fpreal  rhs)
inline

Definition at line 101 of file SIM_DerScalar.h.

SIM_DerScalar SIM_DerScalar::operator- ( ) const
inline

Definition at line 57 of file SIM_DerScalar.h.

SIM_DerScalar SIM_DerScalar::operator- ( const SIM_DerScalar rhs) const
inline

Definition at line 71 of file SIM_DerScalar.h.

SIM_DerScalar SIM_DerScalar::operator- ( fpreal  rhs) const
inline

Definition at line 76 of file SIM_DerScalar.h.

SIM_DerScalar SIM_DerScalar::operator-= ( const SIM_DerScalar rhs)
inline

Definition at line 103 of file SIM_DerScalar.h.

SIM_DerScalar SIM_DerScalar::operator-= ( fpreal  rhs)
inline

Definition at line 105 of file SIM_DerScalar.h.

SIM_DerScalar SIM_DerScalar::operator/ ( const SIM_DerScalar rhs) const
inline

Definition at line 95 of file SIM_DerScalar.h.

SIM_DerScalar SIM_DerScalar::operator/ ( fpreal  rhs) const
inline

Definition at line 97 of file SIM_DerScalar.h.

SIM_DerScalar SIM_DerScalar::operator/= ( const SIM_DerScalar rhs)
inline

Definition at line 111 of file SIM_DerScalar.h.

SIM_DerScalar SIM_DerScalar::operator/= ( fpreal  rhs)
inline

Definition at line 113 of file SIM_DerScalar.h.

SIM_DerScalar& SIM_DerScalar::operator= ( fpreal  rhs)
inline

Definition at line 54 of file SIM_DerScalar.h.

SIM_DerScalar SIM_DerScalar::sqr ( ) const
inline

Definition at line 91 of file SIM_DerScalar.h.

SIM_DerScalar SIM_DerScalar::sqrt ( ) const
inline

Definition at line 127 of file SIM_DerScalar.h.

fpreal SIM_DerScalar::v ( ) const
inline

Definition at line 46 of file SIM_DerScalar.h.


The documentation for this class was generated from the following file: