SIM_DerVector3 Class Reference

#include <SIM_DerVector3.h>

List of all members.

Public Member Functions

 SIM_DerVector3 ()
 SIM_DerVector3 (const UT_Vector3 &v)
 Initialize to a constant vector, with no derivative.
 SIM_DerVector3 (const UT_Vector3 &v, const UT_Matrix3 &D)
const UT_Vector3v () const
 The vector v.
const UT_Matrix3D () const
SIM_DerVector3 operator- () const
SIM_DerVector3 operator+ (const SIM_DerVector3 &rhs) const
SIM_DerVector3 operator+ (const UT_Vector3 &rhs) const
SIM_DerVector3 operator- (const SIM_DerVector3 &rhs) const
SIM_DerVector3 operator- (const UT_Vector3 &rhs) const
SIM_DerVector3 operator* (const SIM_DerScalar &rhs) const
SIM_DerVector3 operator* (fpreal scalar) const
SIM_DerVector3operator+= (const SIM_DerVector3 &rhs)
SIM_DerVector3operator+= (const UT_Vector3 &rhs)
SIM_DerVector3operator-= (const SIM_DerVector3 &rhs)
SIM_DerVector3operator-= (const UT_Vector3 &rhs)
SIM_DerVector3operator*= (const SIM_DerScalar &rhs)
SIM_DerVector3operator*= (const fpreal rhs)
SIM_DerScalar dot (const SIM_DerVector3 &rhs) const
SIM_DerScalar dot (const UT_Vector3 &rhs) const
SIM_DerVector3 cross (const SIM_DerVector3 &rhs) const
SIM_DerVector3 cross (const UT_Vector3 &rhs) const
SIM_DerScalar length2 () const
SIM_DerScalar length () const
SIM_DerVector3 normalize () const

Static Public Member Functions

static UT_Matrix3 S (const UT_Vector3 &v)


Detailed Description

This class defines a 3D vector and its partial derivative w.r.t. another 3D vector. It uses automatic differentiation to maintain the dependency upon the derivative vector as arithmetic operations are performed. The derivative of a vector-valued function is, of course, a Jacobian matrix.

By performing a sequence of arithmetic operations on this vector 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 40 of file SIM_DerVector3.h.


Constructor & Destructor Documentation

SIM_DerVector3::SIM_DerVector3 (  )  [inline]

Definition at line 43 of file SIM_DerVector3.h.

SIM_DerVector3::SIM_DerVector3 ( const UT_Vector3 v  )  [inline, explicit]

Initialize to a constant vector, with no derivative.

Definition at line 45 of file SIM_DerVector3.h.

SIM_DerVector3::SIM_DerVector3 ( const UT_Vector3 v,
const UT_Matrix3 D 
) [inline]

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

Definition at line 49 of file SIM_DerVector3.h.


Member Function Documentation

SIM_DerVector3 SIM_DerVector3::cross ( const UT_Vector3 rhs  )  const [inline]

Definition at line 214 of file SIM_DerVector3.h.

SIM_DerVector3 SIM_DerVector3::cross ( const SIM_DerVector3 rhs  )  const [inline]

Definition at line 204 of file SIM_DerVector3.h.

const UT_Matrix3& SIM_DerVector3::D (  )  const [inline]

Derivative matrix, dv/dx. The entries of the matrix are laid out like a typical Jacobian:

[ dv1/dx1 dv1/dx2 dv1/dx3 ] [ dv2/dx1 dv2/dx2 dv2/dx3 ] [ dv3/dx1 dv3/dx2 dv3/dx3 ]

[ dv1/dx ] = [ dv2/dx ] [ dv3/dx ]

= [ dv/dx1 dv/dx2 dv/dx3 ]

Definition at line 72 of file SIM_DerVector3.h.

SIM_DerScalar SIM_DerVector3::dot ( const UT_Vector3 rhs  )  const [inline]

Definition at line 194 of file SIM_DerVector3.h.

SIM_DerScalar SIM_DerVector3::dot ( const SIM_DerVector3 rhs  )  const [inline]

Definition at line 184 of file SIM_DerVector3.h.

SIM_DerScalar SIM_DerVector3::length (  )  const [inline]

Definition at line 236 of file SIM_DerVector3.h.

SIM_DerScalar SIM_DerVector3::length2 (  )  const [inline]

Definition at line 222 of file SIM_DerVector3.h.

SIM_DerVector3 SIM_DerVector3::normalize (  )  const [inline]

Definition at line 247 of file SIM_DerVector3.h.

SIM_DerVector3 SIM_DerVector3::operator* ( fpreal  scalar  )  const [inline]

Definition at line 101 of file SIM_DerVector3.h.

SIM_DerVector3 SIM_DerVector3::operator* ( const SIM_DerScalar rhs  )  const [inline]

Definition at line 173 of file SIM_DerVector3.h.

SIM_DerVector3& SIM_DerVector3::operator*= ( const fpreal  rhs  )  [inline]

Definition at line 116 of file SIM_DerVector3.h.

SIM_DerVector3& SIM_DerVector3::operator*= ( const SIM_DerScalar rhs  )  [inline]

Definition at line 114 of file SIM_DerVector3.h.

SIM_DerVector3 SIM_DerVector3::operator+ ( const UT_Vector3 rhs  )  const [inline]

Definition at line 87 of file SIM_DerVector3.h.

SIM_DerVector3 SIM_DerVector3::operator+ ( const SIM_DerVector3 rhs  )  const [inline]

Definition at line 82 of file SIM_DerVector3.h.

SIM_DerVector3& SIM_DerVector3::operator+= ( const UT_Vector3 rhs  )  [inline]

Definition at line 108 of file SIM_DerVector3.h.

SIM_DerVector3& SIM_DerVector3::operator+= ( const SIM_DerVector3 rhs  )  [inline]

Definition at line 106 of file SIM_DerVector3.h.

SIM_DerVector3 SIM_DerVector3::operator- ( const UT_Vector3 rhs  )  const [inline]

Definition at line 96 of file SIM_DerVector3.h.

SIM_DerVector3 SIM_DerVector3::operator- ( const SIM_DerVector3 rhs  )  const [inline]

Definition at line 91 of file SIM_DerVector3.h.

SIM_DerVector3 SIM_DerVector3::operator- (  )  const [inline]

Definition at line 78 of file SIM_DerVector3.h.

SIM_DerVector3& SIM_DerVector3::operator-= ( const UT_Vector3 rhs  )  [inline]

Definition at line 112 of file SIM_DerVector3.h.

SIM_DerVector3& SIM_DerVector3::operator-= ( const SIM_DerVector3 rhs  )  [inline]

Definition at line 110 of file SIM_DerVector3.h.

static UT_Matrix3 SIM_DerVector3::S ( const UT_Vector3 v  )  [inline, static]

Definition at line 131 of file SIM_DerVector3.h.

const UT_Vector3& SIM_DerVector3::v (  )  const [inline]

The vector v.

Definition at line 57 of file SIM_DerVector3.h.


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

Generated on Fri May 25 00:10:40 2012 for HDK by  doxygen 1.5.9