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

Arithmetic operations
[Library Functions]


Functions

template<int N, typename T> ShGeneric< N, T > SH::operator+ (const ShGeneric< N, T > &left, const ShGeneric< N, T > &right)
 Addition.

template<int N, typename T> ShGeneric< N, T > operator+ (const ShGeneric< 1, T > &left, const ShGeneric< N, T > &right)
template<int N, typename T> ShGeneric< N, T > operator+ (const ShGeneric< N, T > &left, const ShGeneric< 1, T > &right)
template<typename T> ShGeneric< 1, T > operator+ (const ShGeneric< 1, T > &left, const ShGeneric< 1, T > &right)
 SH_SHLIB_CONST_SCALAR_OP (operator+)
 SH_SHLIB_CONST_N_OP_BOTH (operator+)
template<int N, typename T> ShGeneric< N, T > SH::operator- (const ShGeneric< N, T > &left, const ShGeneric< N, T > &right)
 Subtraction.

template<int N, typename T> ShGeneric< N, T > operator- (const ShGeneric< 1, T > &left, const ShGeneric< N, T > &right)
template<int N, typename T> ShGeneric< N, T > operator- (const ShGeneric< N, T > &left, const ShGeneric< 1, T > &right)
template<typename T> ShGeneric< 1, T > operator- (const ShGeneric< 1, T > &left, const ShGeneric< 1, T > &right)
 SH_SHLIB_CONST_SCALAR_OP (operator-)
 SH_SHLIB_CONST_N_OP_BOTH (operator-)
template<int N, typename T> ShGeneric< N, T > SH::operator * (const ShGeneric< N, T > &left, const ShGeneric< N, T > &right)
 Multiplication.

template<int N, typename T> ShGeneric< N, T > operator * (const ShGeneric< 1, T > &left, const ShGeneric< N, T > &right)
template<int N, typename T> ShGeneric< N, T > operator * (const ShGeneric< N, T > &left, const ShGeneric< 1, T > &right)
template<typename T> ShGeneric< 1, T > operator * (const ShGeneric< 1, T > &left, const ShGeneric< 1, T > &right)
 SH_SHLIB_CONST_SCALAR_OP (operator *)
 SH_SHLIB_CONST_N_OP_BOTH (operator *)
template<int N, typename T> ShGeneric< N, T > SH::operator/ (const ShGeneric< N, T > &left, const ShGeneric< N, T > &right)
 Division.

template<int N, typename T> ShGeneric< N, T > operator/ (const ShGeneric< N, T > &left, const ShGeneric< 1, T > &right)
template<int N, typename T> ShGeneric< N, T > operator/ (const ShGeneric< 1, T > &left, const ShGeneric< N, T > &right)
template<typename T> ShGeneric< 1, T > operator/ (const ShGeneric< 1, T > &left, const ShGeneric< 1, T > &right)
 SH_SHLIB_CONST_SCALAR_OP (operator/)
 SH_SHLIB_CONST_N_OP_LEFT (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 T> ShGeneric< N, T > SH::pow (const ShGeneric< N, T > &left, const ShGeneric< N, T > &right)
 Power.

template<int N, typename T> ShGeneric< N, T > pow (const ShGeneric< N, T > &left, const ShGeneric< 1, T > &right)
template<typename T> ShGeneric< 1, T > pow (const ShGeneric< 1, T > &left, const ShGeneric< 1, T > &right)
 SH_SHLIB_CONST_SCALAR_OP (pow)
 SH_SHLIB_CONST_N_OP_RIGHT (pow)
template<int N, typename T> ShGeneric< N, T > SH::mad (const ShGeneric< N, T > &m1, const ShGeneric< N, T > &m2, const ShGeneric< N, T > &a)
 Multiply and add.

template<int N, typename T> ShGeneric< N, T > mad (const ShGeneric< N, T > &m1, const ShGeneric< 1, T > &m2, const ShGeneric< N, T > &a)
template<int N, typename T> ShGeneric< N, T > mad (const ShGeneric< 1, T > &m1, const ShGeneric< N, T > &m2, const ShGeneric< N, T > &a)
template<typename T> ShGeneric< 1, T > mad (const ShGeneric< 1, T > &m1, const ShGeneric< 1, T > &m2, const ShGeneric< 1, T > &a)
template<int N, typename T> ShGeneric< N, T > mad (T m1, const ShGeneric< N, T > &m2, const ShGeneric< N, T > &a)
template<int N, typename T> ShGeneric< N, T > mad (double m1, const ShGeneric< N, T > &m2, const ShGeneric< N, T > &a)
template<int N, typename T> ShGeneric< N, T > mad (const ShGeneric< N, T > &m1, T m2, const ShGeneric< N, T > &a)
template<int N, typename T> ShGeneric< N, T > mad (const ShGeneric< N, T > &m1, double m2, const ShGeneric< N, T > &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  ) 
 

Exponent base 10.

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

Definition at line 168 of file ShLibArithImpl.hpp.

Referenced by SH::expm1().

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

Exponent base 2.

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

Definition at line 176 of file ShLibArithImpl.hpp.

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

Minus-one Exponent base 10.

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

Definition at line 192 of file ShLibArithImpl.hpp.

References SH::exp().

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

Logarithm base 10.

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

Definition at line 198 of file ShLibArithImpl.hpp.

Referenced by SH::logp1().

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

Logarithm base 2.

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

Definition at line 206 of file ShLibArithImpl.hpp.

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

Plus-One Logarithm base 10.

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

Definition at line 222 of file ShLibArithImpl.hpp.

References SH::log().

template<int N, typename T>
ShGeneric< N, T > SH::mad const ShGeneric< N, T > &  m1,
const ShGeneric< N, T > &  m2,
const ShGeneric< N, T > &  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 254 of file ShLibArithImpl.hpp.

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

template<int N, typename T>
ShGeneric< N, T > SH::operator * const ShGeneric< N, T > &  left,
const ShGeneric< N, T > &  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 103 of file ShLibArithImpl.hpp.

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

Addition.

On tuples, this operator acts componentwise.

Todo:
scalar promotion.

Definition at line 37 of file ShLibArithImpl.hpp.

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

Subtraction.

On tuples, this operator acts componentwise.

Todo:
scalar promotion.

Definition at line 70 of file ShLibArithImpl.hpp.

template<int N, typename T>
ShGeneric< N, T > SH::operator/ const ShGeneric< N, T > &  left,
const ShGeneric< N, T > &  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 136 of file ShLibArithImpl.hpp.

template<int N, typename T>
ShGeneric< N, T > SH::pow const ShGeneric< N, T > &  left,
const ShGeneric< N, T > &  right
[inline]
 

Power.

Raise a tuple to a power.

Todo:
scalar promotion.

Definition at line 229 of file ShLibArithImpl.hpp.

Referenced by SH::lit().


Generated on Fri Nov 5 16:51:41 2004 for Sh by doxygen 1.3.7