Web Analytics Made Easy - Statcounter
Skip to content

Class SBDTypeDual#

ClassList > SBDTypeDual

This class describes a dual number. More...

  • #include <SBDTypeDual.hpp>

Public Attributes#

Type Name
SBQuantity::dimensionless * a
The first component of the dual number.
SBQuantity::dimensionless * b
The second component of the dual number.

Public Functions#

Type Name
SBDTypeDual ()
Constructs a dual number with both components set to zero.
SBDTypeDual (double a, double b)
Constructs a dual number with components a andb .
SBDTypeDual (const SBQuantity::dimensionless & a, const SBQuantity::dimensionless & b)
Constructs a dual number with components a andb .
SBDTypeDual inverse () const
Returns the inverse of the dual number.
virtual bool isSerializable () const
Returns true __
SBDTypeDual operator* (const SBDTypeDual & d) const
Returns the product of this dual number with dual number d .
SBDTypeDual operator* (double d) const
Returns the product of this dual number with double d .
SBDTypeDual operator* (const SBQuantity::dimensionless & d) const
Returns the product of this dual number with dimensionless quantity d .
SBDTypeDual & operator*= (const SBDTypeDual & d)
Multiplies this dual number with dual number d .
SBDTypeDual & operator*= (double d)
Multiplies this dual number with double d .
SBDTypeDual & operator*= (const SBQuantity::dimensionless & d)
Multiplies this dual number with dimensionless quantity d .
SBDTypeDual operator+ (const SBDTypeDual & d) const
Returns the sum of this dual number with dual number d .
SBDTypeDual & operator+= (const SBDTypeDual & d)
Adds dual number d to this dual number.
SBDTypeDual operator- (const SBDTypeDual & d) const
Returns the difference between this dual number and dual number d .
SBDTypeDual operator- () const
Returns the opposite of this dual number.
SBDTypeDual & operator-= (const SBDTypeDual & d)
Subtracts dual number d from this dual number.
SBDTypeDual operator/ (const SBDTypeDual & d) const
Returns the division of this dual number by dual number d .
SBDTypeDual & operator/= (const SBDTypeDual & d)
Divides this dual number by dual number d .
void print (std::ostream & os) const
Prints the dual number.
void print () const
Prints the dual number.
virtual void serialize (SBCSerializer * serializer, const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER) const
Serializes the dual number.
SBDTypeDual squareRoot () const
Returns the square root of the dual number.
virtual void unserialize (SBCSerializer * serializer, const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER)
Unserializes the dual number.
~SBDTypeDual ()
Destructs the dual number.

Detailed Description#

This class describes dual numbers.

Dual numbers are pairs of dimensionless physical quantities, that are mainly used in conjunction with dual quaternions.

Short name: SBDual

See also: SBDTypeDualQuaternion

See also: SAMSON's unit system

Public Attributes Documentation#

variable a#

The first component of the dual number.

SBQuantity::dimensionless* SBDTypeDual::a;


variable b#

The second component of the dual number.

SBQuantity::dimensionless* SBDTypeDual::b;


Public Functions Documentation#

function SBDTypeDual [1/3]#

Constructs a dual number with both components set to zero.

SBDTypeDual::SBDTypeDual () 


function SBDTypeDual [2/3]#

Constructs a dual number with components a andb .

SBDTypeDual::SBDTypeDual (
    double a,
    double b
) 

Constructs a dual number with the given components.

Parameters:

  • a The first component of the dual number.
  • b The second component of the dual number.

function SBDTypeDual [3/3]#

Constructs a dual number with components a andb .

SBDTypeDual::SBDTypeDual (
    const SBQuantity::dimensionless & a,
    const SBQuantity::dimensionless & b
) 

Constructs a dual number with the given components.

Parameters:

  • a The first component as a dimensionless quantity.
  • b The second component as a dimensionless quantity.

function inverse#

Returns the inverse of the dual number.

SBDTypeDual SBDTypeDual::inverse () const

Returns the multiplicative inverse of this dual number.

Returns:

The inverse dual number.


function isSerializable#

Returns true __

virtual bool SBDTypeDual::isSerializable () const

Returns true to indicate that the type can be serialized.

Returns:

true.


function operator*#

Returns the product of this dual number with dual number d .

SBDTypeDual SBDTypeDual::operator* (
    const SBDTypeDual & d
) const

Returns the product of this dual number and another dual number.

Parameters:

  • d The dual number multiplier.

Returns:

The resulting dual number.


function operator*#

Returns the product of this dual number with double d .

SBDTypeDual SBDTypeDual::operator* (
    double d
) const

Returns the product of this dual number and a scalar value.

Parameters:

  • d The scalar multiplier.

Returns:

The resulting dual number.


function operator*#

Returns the product of this dual number with dimensionless quantity d .

SBDTypeDual SBDTypeDual::operator* (
    const SBQuantity::dimensionless & d
) const

Returns the product of this dual number and a dimensionless quantity.

Parameters:

  • d The dimensionless multiplier.

Returns:

The resulting dual number.


function operator*=#

Multiplies this dual number with dual number d .

SBDTypeDual & SBDTypeDual::operator*= (
    const SBDTypeDual & d
) 

Multiplies this dual number by the given dual number.

Parameters:

  • d The dual number multiplier.

function operator*=#

Multiplies this dual number with double d .

SBDTypeDual & SBDTypeDual::operator*= (
    double d
) 

Multiplies this dual number by a scalar value.

Parameters:

  • d The scalar multiplier.

function operator*=#

Multiplies this dual number with dimensionless quantity d .

SBDTypeDual & SBDTypeDual::operator*= (
    const SBQuantity::dimensionless & d
) 

Multiplies this dual number by a dimensionless quantity.

Parameters:

  • d The dimensionless multiplier.

function operator+#

Returns the sum of this dual number with dual number d .

SBDTypeDual SBDTypeDual::operator+ (
    const SBDTypeDual & d
) const

Returns the sum of this dual number and another dual number.

Parameters:

  • d The dual number to add.

Returns:

The resulting dual number.


function operator+=#

Adds dual number d to this dual number.

SBDTypeDual & SBDTypeDual::operator+= (
    const SBDTypeDual & d
) 

Adds the given dual number to this dual number.

Parameters:

  • d The dual number to add.

function operator-#

Returns the difference between this dual number and dual number d .

SBDTypeDual SBDTypeDual::operator- (
    const SBDTypeDual & d
) const

Returns the difference between this dual number and another dual number.

Parameters:

  • d The dual number to subtract.

Returns:

The resulting dual number.


function operator-#

Returns the opposite of this dual number.

SBDTypeDual SBDTypeDual::operator- () const

Returns the negated dual number.

Returns:

The negated dual number.


function operator-=#

Subtracts dual number d from this dual number.

SBDTypeDual & SBDTypeDual::operator-= (
    const SBDTypeDual & d
) 

Subtracts the given dual number from this dual number.

Parameters:

  • d The dual number to subtract.

function operator/#

Returns the division of this dual number by dual number d .

SBDTypeDual SBDTypeDual::operator/ (
    const SBDTypeDual & d
) const

Returns the division of this dual number by another dual number.

Parameters:

  • d The dual number divisor.

Returns:

The resulting dual number.


function operator/=#

Divides this dual number by dual number d .

SBDTypeDual & SBDTypeDual::operator/= (
    const SBDTypeDual & d
) 

Divides this dual number by the given dual number.

Parameters:

  • d The dual number divisor.

function print [1/2]#

Prints the dual number.

void SBDTypeDual::print (
    std::ostream & os
) const

Prints the dual number to the given output stream.

Parameters:

  • os The output stream to write to.

function print [2/2]#

Prints the dual number.

void SBDTypeDual::print () const

Prints the dual number to standard output.


function serialize#

Serializes the dual number.

virtual void SBDTypeDual::serialize (
    SBCSerializer * serializer,
    const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER
) const

Serializes the dual number to the provided serializer.

Parameters:

  • serializer The serializer used to write the dual number.
  • sdkVersionNumber The SDK version number for compatibility.

function squareRoot#

Returns the square root of the dual number.

SBDTypeDual SBDTypeDual::squareRoot () const

Returns the square root of this dual number.

Returns:

The square root dual number.


function unserialize#

Unserializes the dual number.

virtual void SBDTypeDual::unserialize (
    SBCSerializer * serializer,
    const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER
) 

Unserializes the dual number from the provided serializer.

Parameters:

  • serializer The serializer used to read the dual number.
  • sdkVersionNumber The SDK version number for compatibility.

function ~SBDTypeDual#

Destructs the dual number.

SBDTypeDual::~SBDTypeDual () 

Destroys the dual number and releases its resources.