Do more. Code less. Free software for GPU computing.
<scroll to top>
Functions | Friends

Element-wise arithmetic

Basics

Functions

array mul (const array &, const array &)
 elementwise multiply
array mul (const array &, const double scalar)
 multiply array with scalar
array mul (const double scalar, const array &)
 multiply array with scalar
array operator- () const
 Arithmetic negation.
array operator! () const
 Logical negation (not binary compliment)
array operator* (const double &scalar) const
 multiply array with scalar
array operator+ (const array &) const
array operator+ (const double &) const
array operator- (const array &) const
array operator- (const double &) const
array operator/ (const array &) const
array operator/ (const double &) const
array operator% (const array &) const
array operator% (const double &) const
array & operator+= (const array &)
array & operator+= (const double &)
array & operator-= (const array &)
array & operator-= (const double &)
array & operator*= (const array &)
array & operator*= (const double &)
array & operator/= (const array &)
array & operator/= (const double &)
array & operator%= (const array &)
array & operator%= (const double &)
array & operator++ ()
array & operator-- ()
array operator& (const array &) const
array operator&& (const array &) const
array operator&& (const bool &) const
array operator&& (const int &) const
array operator&& (const unsigned &) const
array operator&& (const double &) const
array operator| (const array &) const
array operator|| (const array &) const
array operator|| (const bool &) const
array operator|| (const int &) const
array operator|| (const unsigned &) const
array operator|| (const double &) const
array operator^ (const array &) const
array operator== (const array &) const
array operator== (const bool &) const
array operator== (const int &) const
array operator== (const double &) const
array operator!= (const array &) const
array operator!= (const bool &) const
array operator!= (const int &) const
array operator!= (const double &) const
array operator< (const array &) const
array operator< (const bool &) const
array operator< (const int &) const
array operator< (const double &) const
array operator<= (const array &) const
array operator<= (const bool &) const
array operator<= (const int &) const
array operator<= (const double &) const
array operator> (const array &) const
array operator> (const bool &) const
array operator> (const int &) const
array operator> (const double &) const
array operator>= (const array &) const
array operator>= (const bool &) const
array operator>= (const int &) const
array operator>= (const double &) const
array convert (const array &, dtype type)
 convert array to another type
array sin (const array &x)
array sinh (const array &x)
array asin (const array &x)
array asinh (const array &x)
array cos (const array &x)
array cosh (const array &x)
array acos (const array &x)
array acosh (const array &x)
array tan (const array &x)
array tanh (const array &x)
array atan (const array &x)
array atanh (const array &x)
array isFinite (const array &x)
 True iff finite.
array isInfinite (const array &x)
 True iff infinity.
array isNan (const array &x)
 True iff NaN.
array sign (const array &x)
array sqrt (const array &x, bool isreal=false)
 Assume output will be real if isreal==true (faster), otherwise produce complex values if necessary (slower to check)
array root (const array &radicand, const array &n)
 Calculate n-th root of real-valued radicand.
array root (const array &radicand, const double n)
 Calculate n-th root of real-valued radicand.
array root (const double radicand, const array &n)
 Calculate n-th root of real-valued radicand.
array pow2 (const array &x)
 Two raised to power x (2^x)
array pow (const array &base, const array &power, bool isreal=false)
 base raised to power (exponent).
array pow (const array &base, const double power, bool isreal=false)
 base raised to power (exponent).
array pow (const double base, const array &power, bool isreal=false)
 base raised to power (exponent).
array ceil (const array &x)
 Smallest integral value not less than x (round toward inf)
array floor (const array &x)
 Largest integral value not greater than x (round toward negative inf)
array round (const array &x)
 Round to nearest integer (away from zero).
array trunc (const array &x)
 Round to nearest integer (towards zero).
array factorial (const array &x)
array min (const array &x, const array &y)
 Minimum between x and y at every position.
array min (const double x, const array &y)
 Minimum between x and every element of y.
array max (const array &x, const array &y)
 Maximum between x and y at every position.
array max (const double x, const array &y)
 Maximum between x and every element of y.
array log (const array &x, bool isreal=false)
 Assume output will be real if isreal==true (faster), otherwise produce complex values if necessary (slower to check)
array log2 (const array &x)
array log10 (const array &x)
array log1p (const array &x)
array exp (const array &x)
array expm1 (const array &x)
array gamma (const array &x)
array gammaln (const array &x)
array epsilon (const array &x)
array erf (const array &x)
array erfc (const array &x)
array erfinv (const array &x)
array erfcinv (const array &x)
array abs (const array &x)
 Absolute value of real or complex number (result is real)
array arg (const array &x)
 Phase angle (radians)
array conj (const array &x)
 Complex conjugate (no effect on real values)
array real (const array &x)
 Real component of array.
array imag (const array &x)
 Imaginary component of array.
array complex (const array &x)
 Form a complex result from one real input.
array complex (const array &real, const array &imaginary)
 Form a complex result from real and imaginary parts.
array complex (const array &real, const double imaginary)
 Form a complex result from real and imaginary parts.
array complex (const double real, const array &imaginary)
 Form a complex result from real and imaginary parts.
array atan2 (const array &, const array &)
 arc tangent function of two variables
array atan2 (const array &, const double)
 arc tangent function of two variables
array atan2 (const double, const array &)
 arc tangent function of two variables
array hypot (const array &, const array &)
 Euclidean distance function without undue overflow or underflow during intermediate steps.
array hypot (const array &, const double)
 Euclidean distance function without undue overflow or underflow during intermediate steps.
array hypot (const double, const array &)
 Euclidean distance function without undue overflow or underflow during intermediate steps.
array rem (const array &, const array &)
 remainder
array rem (const array &, const double)
 remainder
array rem (const double, const array &)
 remainder
array mod (const array &x, const array &y)
 Compute x-n*y where n is quotient of x/y.
array mod (const array &x, const double y)
 Compute x-n*y where n is quotient of x/y.
array mod (const double x, const array &y)
 Compute x-n*y where n is quotient of x/y.

Friends

array operator* (const double &scalar, const array &)
 multiply array with scalar
array operator+ (const double &, const array &)
array operator- (const double &, const array &)
array operator/ (const double &, const array &)
array operator% (const double &, const array &)
array operator&& (const bool &, const array &)
array operator&& (const int &, const array &)
array operator&& (const unsigned &, const array &)
array operator|| (const bool &, const array &)
array operator|| (const int &, const array &)
array operator|| (const unsigned &, const array &)
array operator== (const bool &, const array &)
array operator== (const int &, const array &)
array operator== (const double &, const array &)
array operator!= (const bool &, const array &)
array operator!= (const int &, const array &)
array operator!= (const double &, const array &)
array operator< (const bool &, const array &)
array operator< (const int &, const array &)
array operator< (const double &, const array &)
array operator<= (const bool &, const array &)
array operator<= (const int &, const array &)
array operator<= (const double &, const array &)
array operator> (const bool &, const array &)
array operator> (const int &, const array &)
array operator> (const double &, const array &)
array operator>= (const bool &, const array &)
array operator>= (const int &, const array &)
array operator>= (const double &, const array &)

Function Documentation

array af::mul ( const array &  ,
const array &   
)
array af::mul ( const array &  ,
const double  scalar 
)

multiply array with scalar

array af::mul ( const double  scalar,
const array &   
)

multiply array with scalar

array operator- ( ) const [inherited]

Arithmetic negation.

array operator! ( ) const [inherited]

Logical negation (not binary compliment)

array operator* ( const double &  scalar) const [inherited]

multiply array with scalar

array operator+ ( const array ) const [inherited]
array operator+ ( const double &  ) const [inherited]
array operator- ( const array ) const [inherited]
array operator- ( const double &  ) const [inherited]
array operator/ ( const array ) const [inherited]
array operator/ ( const double &  ) const [inherited]
array operator% ( const array ) const [inherited]
array operator% ( const double &  ) const [inherited]
array& operator+= ( const array ) [inherited]
array& operator+= ( const double &  ) [inherited]
array& operator-= ( const array ) [inherited]
array& operator-= ( const double &  ) [inherited]
array& operator*= ( const array ) [inherited]
array& operator*= ( const double &  ) [inherited]
array& operator/= ( const array ) [inherited]
array& operator/= ( const double &  ) [inherited]
array& operator%= ( const array ) [inherited]
array& operator%= ( const double &  ) [inherited]
array& operator++ ( ) [inherited]
array& operator-- ( ) [inherited]
array operator& ( const array ) const [inherited]
array operator&& ( const array ) const [inherited]
array operator&& ( const bool &  ) const [inherited]
array operator&& ( const int &  ) const [inherited]
array operator&& ( const unsigned &  ) const [inherited]
array operator&& ( const double &  ) const [inherited]
array operator| ( const array ) const [inherited]
array operator|| ( const array ) const [inherited]
array operator|| ( const bool &  ) const [inherited]
array operator|| ( const int &  ) const [inherited]
array operator|| ( const unsigned &  ) const [inherited]
array operator|| ( const double &  ) const [inherited]
array operator^ ( const array ) const [inherited]
array operator== ( const array ) const [inherited]
array operator== ( const bool &  ) const [inherited]
array operator== ( const int &  ) const [inherited]
array operator== ( const double &  ) const [inherited]
array operator!= ( const array ) const [inherited]
array operator!= ( const bool &  ) const [inherited]
array operator!= ( const int &  ) const [inherited]
array operator!= ( const double &  ) const [inherited]
array operator< ( const array ) const [inherited]
array operator< ( const bool &  ) const [inherited]
array operator< ( const int &  ) const [inherited]
array operator< ( const double &  ) const [inherited]
array operator<= ( const array ) const [inherited]
array operator<= ( const bool &  ) const [inherited]
array operator<= ( const int &  ) const [inherited]
array operator<= ( const double &  ) const [inherited]
array operator> ( const array ) const [inherited]
array operator> ( const bool &  ) const [inherited]
array operator> ( const int &  ) const [inherited]
array operator> ( const double &  ) const [inherited]
array operator>= ( const array ) const [inherited]
array operator>= ( const bool &  ) const [inherited]
array operator>= ( const int &  ) const [inherited]
array operator>= ( const double &  ) const [inherited]
array af::convert ( const array &  ,
dtype  type 
)

convert array to another type

Examples:
examples/image/gfor_hist_demo.cpp.
array af::sin ( const array &  x)
array af::sinh ( const array &  x)
array af::asin ( const array &  x)
array af::asinh ( const array &  x)
array af::cos ( const array &  x)
array af::cosh ( const array &  x)
array af::acos ( const array &  x)
array af::acosh ( const array &  x)
array af::tan ( const array &  x)
array af::tanh ( const array &  x)
array af::atan ( const array &  x)
array af::atanh ( const array &  x)
array af::isFinite ( const array &  x)

True iff finite.

array af::isInfinite ( const array &  x)

True iff infinity.

array af::isNan ( const array &  x)

True iff NaN.

array af::sign ( const array &  x)
array af::sqrt ( const array &  x,
bool  isreal = false 
)

Assume output will be real if isreal==true (faster), otherwise produce complex values if necessary (slower to check)

Examples:
examples/blackscholes/blackscholes.cpp, examples/pi/pi.cpp, and examples/pi/pi_cuda.cu.
array af::root ( const array &  radicand,
const array &  n 
)

Calculate n-th root of real-valued radicand.

array af::root ( const array &  radicand,
const double  n 
)

Calculate n-th root of real-valued radicand.

array af::root ( const double  radicand,
const array &  n 
)

Calculate n-th root of real-valued radicand.

array af::pow2 ( const array &  x)

Two raised to power x (2^x)

array af::pow ( const array &  base,
const array &  power,
bool  isreal = false 
)

base raised to power (exponent).

If isreal is true then bypass checks for complexity (faster).

Examples:
examples/fdtd/fdtd.cpp.
array af::pow ( const array &  base,
const double  power,
bool  isreal = false 
)

base raised to power (exponent).

If isreal is true then bypass checks for complexity (faster).

array af::pow ( const double  base,
const array &  power,
bool  isreal = false 
)

base raised to power (exponent).

If isreal is true then bypass checks for complexity (faster).

array af::ceil ( const array &  x)

Smallest integral value not less than x (round toward inf)

Examples:
examples/fdtd/fdtd.cpp.
array af::floor ( const array &  x)

Largest integral value not greater than x (round toward negative inf)

Examples:
examples/swe/swe.cpp.
array af::round ( const array &  x)

Round to nearest integer (away from zero).

See also:
trunc
array af::trunc ( const array &  x)

Round to nearest integer (towards zero).

See also:
round
array af::factorial ( const array &  x)
array af::min ( const array &  x,
const array &  y 
)

Minimum between x and y at every position.

Examples:
examples/image/gfor_hist_demo.cpp, and examples/misc/integer.cpp.
array af::min ( const double  x,
const array &  y 
)

Minimum between x and every element of y.

array af::max ( const array &  x,
const array &  y 
)
array af::max ( const double  x,
const array &  y 
)

Maximum between x and every element of y.

array af::log ( const array &  x,
bool  isreal = false 
)

Assume output will be real if isreal==true (faster), otherwise produce complex values if necessary (slower to check)

Examples:
examples/blackscholes/blackscholes.cpp.
array af::log2 ( const array &  x)
array af::log10 ( const array &  x)
array af::log1p ( const array &  x)
array af::exp ( const array &  x)
array af::expm1 ( const array &  x)
array af::gamma ( const array &  x)
array af::gammaln ( const array &  x)
array af::epsilon ( const array &  x)
array af::erf ( const array &  x)
array af::erfc ( const array &  x)
array af::erfinv ( const array &  x)
array af::erfcinv ( const array &  x)
array af::abs ( const array &  x)

Absolute value of real or complex number (result is real)

Examples:
examples/fdtd/fdtd.cpp, examples/image/image_demo.cpp, and examples/misc/lin_algebra.cpp.
array af::arg ( const array &  x)

Phase angle (radians)

array af::conj ( const array &  x)

Complex conjugate (no effect on real values)

array af::real ( const array &  x)

Real component of array.

Examples:
examples/image/gfor_hist_demo.cpp, and examples/misc/fft.cpp.
array af::imag ( const array &  x)

Imaginary component of array.

Examples:
examples/image/gfor_hist_demo.cpp, and examples/misc/fft.cpp.
array af::complex ( const array &  x)

Form a complex result from one real input.

array af::complex ( const array &  real,
const array &  imaginary 
)

Form a complex result from real and imaginary parts.

array af::complex ( const array &  real,
const double  imaginary 
)

Form a complex result from real and imaginary parts.

array af::complex ( const double  real,
const array &  imaginary 
)

Form a complex result from real and imaginary parts.

array af::atan2 ( const array &  ,
const array &   
)

arc tangent function of two variables

array af::atan2 ( const array &  ,
const double   
)

arc tangent function of two variables

array af::atan2 ( const double  ,
const array &   
)

arc tangent function of two variables

array af::hypot ( const array &  ,
const array &   
)

Euclidean distance function without undue overflow or underflow during intermediate steps.

array af::hypot ( const array &  ,
const double   
)

Euclidean distance function without undue overflow or underflow during intermediate steps.

array af::hypot ( const double  ,
const array &   
)

Euclidean distance function without undue overflow or underflow during intermediate steps.

array af::rem ( const array &  ,
const array &   
)

remainder

array af::rem ( const array &  ,
const double   
)

remainder

array af::rem ( const double  ,
const array &   
)

remainder

array af::mod ( const array &  x,
const array &  y 
)

Compute x-n*y where n is quotient of x/y.

Round toward zero.

array af::mod ( const array &  x,
const double  y 
)

Compute x-n*y where n is quotient of x/y.

Round toward zero.

array af::mod ( const double  x,
const array &  y 
)

Compute x-n*y where n is quotient of x/y.

Round toward zero.


Friends

array operator* ( const double &  scalar,
const array  
) [friend, inherited]

multiply array with scalar

array operator+ ( const double &  ,
const array  
) [friend, inherited]
array operator- ( const double &  ,
const array  
) [friend, inherited]
array operator/ ( const double &  ,
const array  
) [friend, inherited]
array operator% ( const double &  ,
const array  
) [friend, inherited]
array operator&& ( const bool &  ,
const array  
) [friend, inherited]
array operator&& ( const int &  ,
const array  
) [friend, inherited]
array operator&& ( const unsigned &  ,
const array  
) [friend, inherited]
array operator|| ( const bool &  ,
const array  
) [friend, inherited]
array operator|| ( const int &  ,
const array  
) [friend, inherited]
array operator|| ( const unsigned &  ,
const array  
) [friend, inherited]
array operator== ( const bool &  ,
const array  
) [friend, inherited]
array operator== ( const int &  ,
const array  
) [friend, inherited]
array operator== ( const double &  ,
const array  
) [friend, inherited]
array operator!= ( const bool &  ,
const array  
) [friend, inherited]
array operator!= ( const int &  ,
const array  
) [friend, inherited]
array operator!= ( const double &  ,
const array  
) [friend, inherited]
array operator< ( const bool &  ,
const array  
) [friend, inherited]
array operator< ( const int &  ,
const array  
) [friend, inherited]
array operator< ( const double &  ,
const array  
) [friend, inherited]
array operator<= ( const bool &  ,
const array  
) [friend, inherited]
array operator<= ( const int &  ,
const array  
) [friend, inherited]
array operator<= ( const double &  ,
const array  
) [friend, inherited]
array operator> ( const bool &  ,
const array  
) [friend, inherited]
array operator> ( const int &  ,
const array  
) [friend, inherited]
array operator> ( const double &  ,
const array  
) [friend, inherited]
array operator>= ( const bool &  ,
const array  
) [friend, inherited]
array operator>= ( const int &  ,
const array  
) [friend, inherited]
array operator>= ( const double &  ,
const array  
) [friend, inherited]
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines