Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Arithmetic operations
[Library Functions]

Collaboration diagram for Arithmetic operations:


Functions

template<int N, typename T1, typename T2>
ShGeneric< N, CT1T2 > SH::operator+ (const ShGeneric< N, T1 > &left, const ShGeneric< N, T2 > &right)
 Addition.
template<int N, typename T1, typename T2>
ShGeneric< N, CT1T2 > operator+ (const ShGeneric< 1, T1 > &left, const ShGeneric< N, T2 > &right)
template<int N, typename T1, typename T2>
ShGeneric< N, CT1T2 > operator+ (const ShGeneric< N, T1 > &left, const ShGeneric< 1, T2 > &right)
template<typename T1, typename T2>
ShGeneric< 1, CT1T2 > operator+ (const ShGeneric< 1, T1 > &left, const ShGeneric< 1, T2 > &right)
 SH_SHLIB_CONST_SCALAR_OP_DECL (operator+)
 SH_SHLIB_CONST_N_OP_BOTH_DECL (operator+)
template<int N, typename T1, typename T2>
ShGeneric< N, CT1T2 > SH::operator- (const ShGeneric< N, T1 > &left, const ShGeneric< N, T2 > &right)
 Subtraction.
template<int N, typename T1, typename T2>
ShGeneric< N, CT1T2 > operator- (const ShGeneric< 1, T1 > &left, const ShGeneric< N, T2 > &right)
template<int N, typename T1, typename T2>
ShGeneric< N, CT1T2 > operator- (const ShGeneric< N, T1 > &left, const ShGeneric< 1, T2 > &right)
template<typename T1, typename T2>
ShGeneric< 1, CT1T2 > operator- (const ShGeneric< 1, T1 > &left, const ShGeneric< 1, T2 > &right)
 SH_SHLIB_CONST_SCALAR_OP_DECL (operator-)
 SH_SHLIB_CONST_N_OP_BOTH_DECL (operator-)
template<int N, typename T1, typename T2>
ShGeneric< N, CT1T2 > SH::operator * (const ShGeneric< N, T1 > &left, const ShGeneric< N, T2 > &right)
 Multiplication.
template<int N, typename T1, typename T2>
ShGeneric< N, CT1T2 > operator * (const ShGeneric< 1, T1 > &left, const ShGeneric< N, T2 > &right)
template<int N, typename T1, typename T2>
ShGeneric< N, CT1T2 > operator * (const ShGeneric< N, T1 > &left, const ShGeneric< 1, T2 > &right)
template<typename T1, typename T2>
ShGeneric< 1, CT1T2 > operator * (const ShGeneric< 1, T1 > &left, const ShGeneric< 1, T2 > &right)
 SH_SHLIB_CONST_SCALAR_OP_DECL (operator *)
 SH_SHLIB_CONST_N_OP_BOTH_DECL (operator *)
template<int N, typename T1, typename T2>
ShGeneric< N, CT1T2 > SH::operator/ (const ShGeneric< N, T1 > &left, const ShGeneric< N, T2 > &right)
 Division.
template<int N, typename T1, typename T2>
ShGeneric< N, CT1T2 > operator/ (const ShGeneric< N, T1 > &left, const ShGeneric< 1, T2 > &right)
template<int N, typename T1, typename T2>
ShGeneric< N, CT1T2 > operator/ (const ShGeneric< 1, T1 > &left, const ShGeneric< N, T2 > &right)
template<typename T1, typename T2>
ShGeneric< 1, CT1T2 > operator/ (const ShGeneric< 1, T1 > &left, const ShGeneric< 1, T2 > &right)
 SH_SHLIB_CONST_SCALAR_OP_DECL (operator/)
 SH_SHLIB_CONST_N_OP_LEFT_DECL (operator/)
template<int N, typename T>
ShGeneric< N, T > SH::exp (const ShGeneric< N, T > &var)
 Exponent base 10.
template<int N, typename T>
ShGeneric< N, T > SH::exp2 (const ShGeneric< N, T > &var)
 Exponent base 2.
template<int N, typename T>
ShGeneric< N, T > SH::expm1 (const ShGeneric< N, T > &x)
 Minus-one Exponent base 10.
template<int N, typename T>
ShGeneric< N, T > SH::log (const ShGeneric< N, T > &var)
 Logarithm base 10.
template<int N, typename T>
ShGeneric< N, T > SH::log2 (const ShGeneric< N, T > &var)
 Logarithm base 2.
template<int N, typename T>
ShGeneric< N, T > SH::logp1 (const ShGeneric< N, T > &x)
 Plus-One Logarithm base 10.
template<int N, typename T1, typename T2, typename T3>
ShGeneric< N, CT1T2 > SH::pow (const ShGeneric< N, T1 > &left, const ShGeneric< N, T2 > &right)
 Power.
template<int N, typename T1, typename T2, typename T3>
ShGeneric< N, CT1T2 > pow (const ShGeneric< N, T1 > &left, const ShGeneric< 1, T2 > &right)
template<typename T1, typename T2, typename T3>
ShGeneric< 1, CT1T2 > pow (const ShGeneric< 1, T1 > &left, const ShGeneric< 1, T2 > &right)
 SH_SHLIB_CONST_SCALAR_OP_DECL (pow)
 SH_SHLIB_CONST_N_OP_RIGHT_DECL (pow)
template<int N, typename T1, typename T2, typename T3>
ShGeneric< N, CT1T2T3 > SH::mad (const ShGeneric< N, T1 > &m1, const ShGeneric< N, T2 > &m2, const ShGeneric< N, T3 > &a)
 Multiply and add.
template<int N, typename T1, typename T2, typename T3>
ShGeneric< N, CT1T2T3 > mad (const ShGeneric< N, T1 > &m1, const ShGeneric< 1, T2 > &m2, const ShGeneric< N, T3 > &a)
template<int N, typename T1, typename T2, typename T3>
ShGeneric< N, CT1T2T3 > mad (const ShGeneric< 1, T1 > &m1, const ShGeneric< N, T2 > &m2, const ShGeneric< N, T3 > &a)
template<typename T1, typename T2, typename T3>
ShGeneric< 1, CT1T2T3 > mad (const ShGeneric< 1, T1 > &m1, const ShGeneric< 1, T2 > &m2, const ShGeneric< 1, T3 > &a)
template<int N, typename T1, typename T2>
ShGeneric< N, CT1T2 > mad (double m1, const ShGeneric< N, T1 > &m2, const ShGeneric< N, T2 > &a)
template<int N, typename T1, typename T2>
ShGeneric< N, CT1T2 > mad (const ShGeneric< N, T1 > &m1, double m2, const ShGeneric< N, T2 > &a)
template<int N, typename T>
ShGeneric< N, T > rcp (const ShGeneric< N, T > &var)
template<int N, typename T>
ShGeneric< N, T > sqrt (const ShGeneric< N, T > &var)
template<int N, typename T>
ShGeneric< N, T > rsqrt (const ShGeneric< N, T > &var)
template<int N, typename T>
ShGeneric< N, T > cbrt (const ShGeneric< N, T > &var)

Function Documentation

template<int N, typename T>
ShGeneric< N, T > SH::exp const ShGeneric< N, T > &  var  )  [inline]
 

Exponent base 10.

Operates componentwise on tuples. Returns the natural exponent of x.

Definition at line 193 of file ShLibArithImpl.hpp.

Referenced by SH::expm1().

template<int N, typename T>
ShGeneric< N, T > SH::exp2 const ShGeneric< N, T > &  var  )  [inline]
 

Exponent base 2.

Operates componentwise on tuples. Returns the exponent of x using base 2.

Definition at line 202 of file ShLibArithImpl.hpp.

template<int N, typename T>
ShGeneric< N, T > SH::expm1 const ShGeneric< N, T > &  x  )  [inline]
 

Minus-one Exponent base 10.

Operates componentwise on tuples. Returns the exponent of x - 1 using base 10.

Definition at line 220 of file ShLibArithImpl.hpp.

References SH::exp().

template<int N, typename T>
ShGeneric< N, T > SH::log const ShGeneric< N, T > &  var  )  [inline]
 

Logarithm base 10.

Operates componentwise on tuples. Returns the natural logarithm of x.

Definition at line 227 of file ShLibArithImpl.hpp.

Referenced by SH::logp1().

template<int N, typename T>
ShGeneric< N, T > SH::log2 const ShGeneric< N, T > &  var  )  [inline]
 

Logarithm base 2.

Operates componentwise on tuples. Returns the logarithm of x using base 2.

Definition at line 236 of file ShLibArithImpl.hpp.

template<int N, typename T>
ShGeneric< N, T > SH::logp1 const ShGeneric< N, T > &  x  )  [inline]
 

Plus-One Logarithm base 10.

Operates componentwise on tuples. Returns the logarithm of x + 1 using base 10.

Definition at line 254 of file ShLibArithImpl.hpp.

References SH::log().

template<int N, typename T1, typename T2, typename T3>
ShGeneric< N, CT1T2T3 > SH::mad const ShGeneric< N, T1 > &  m1,
const ShGeneric< N, T2 > &  m2,
const ShGeneric< N, T3 > &  a
[inline]
 

Multiply and add.

This is an intrinsic to access the assembly instruction of the same name. Multiply-add is potentially cheaper than a separate multiply and add. Note: potentially.

Definition at line 288 of file ShLibArithImpl.hpp.

Referenced by ShUtil::hashlcg(), ShUtil::ShNoise< M, T, P >::perlin(), ShUtil::smoothstep(), and ShUtil::sturbulence().

template<int N, typename T1, typename T2>
ShGeneric< N, CT1T2 > SH::operator * const ShGeneric< N, T1 > &  left,
const ShGeneric< N, T2 > &  right
[inline]
 

Multiplication.

On tuples, this operator acts componentwise. If a scalar is multiplied by a tuple, the scalar is promoted by duplication to a tuple.

Definition at line 116 of file ShLibArithImpl.hpp.

template<int N, typename T1, typename T2>
ShGeneric< N, CT1T2 > SH::operator+ const ShGeneric< N, T1 > &  left,
const ShGeneric< N, T2 > &  right
[inline]
 

Addition.

On tuples, this operator acts componentwise.

Todo:
scalar promotion.

Definition at line 38 of file ShLibArithImpl.hpp.

template<int N, typename T1, typename T2>
ShGeneric< N, CT1T2 > SH::operator- const ShGeneric< N, T1 > &  left,
const ShGeneric< N, T2 > &  right
[inline]
 

Subtraction.

On tuples, this operator acts componentwise.

Todo:
scalar promotion.

Definition at line 77 of file ShLibArithImpl.hpp.

template<int N, typename T1, typename T2>
ShGeneric< N, CT1T2 > SH::operator/ const ShGeneric< N, T1 > &  left,
const ShGeneric< N, T2 > &  right
[inline]
 

Division.

On tuples, this operator acts componentwise. If a tuple is divided by a scalar (or vice versa), the scalar is promoted by duplication to a tuple.

Definition at line 155 of file ShLibArithImpl.hpp.

template<int N, typename T1, typename T2, typename T3>
ShGeneric< N, CT1T2 > SH::pow const ShGeneric< N, T1 > &  left,
const ShGeneric< N, T2 > &  right
[inline]
 

Power.

Raise a tuple to a power.

Todo:
scalar promotion.

Definition at line 261 of file ShLibArithImpl.hpp.

Referenced by SH::lit().


Generated on Mon Jan 24 18:37:59 2005 for Sh by  doxygen 1.4.1