Operators and related functions¶
Defined in xtensor/xmath.hpp and xtensor/xoperation.hpp
-
template<class
E>
autoxt::operator+(E &&e) Identity.
Returns an xfunction for the element-wise identity of e.
- Return
an xfunction
- Parameters
e: an xexpression
-
template<class
E>
autoxt::operator-(E &&e) Opposite.
Returns an xfunction for the element-wise opposite of e.
- Return
an xfunction
- Parameters
e: an xexpression
-
template<class
E1, classE2>
autoxt::operator+(E1 &&e1, E2 &&e2) Addition.
Returns an xfunction for the element-wise addition of e1 and e2.
- Return
an xfunction
- Parameters
e1: an xexpression or a scalare2: an xexpression or a scalar
-
template<class
E1, classE2>
autoxt::operator-(E1 &&e1, E2 &&e2) Substraction.
Returns an xfunction for the element-wise substraction of e2 to e1.
- Return
an xfunction
- Parameters
e1: an xexpression or a scalare2: an xexpression or a scalar
-
template<class
E1, classE2>
autoxt::operator*(E1 &&e1, E2 &&e2) Multiplication.
Returns an xfunction for the element-wise multiplication of e1 by e2.
- Return
an xfunction
- Parameters
e1: an xexpression or a scalare2: an xexpression or a scalar
-
template<class
E1, classE2>
autoxt::operator/(E1 &&e1, E2 &&e2)¶ Division.
Returns an xfunction for the element-wise division of e1 by e2.
- Return
an xfunction
- Parameters
e1: an xexpression or a scalare2: an xexpression or a scalar
-
template<class
E1, classE2>
autoxt::operator||(E1 &&e1, E2 &&e2)¶ Or.
Returns an xfunction for the element-wise or of e1 and e2.
- Return
an xfunction
- Parameters
e1: an xexpression or a scalare2: an xexpression or a scalar
Warning
doxygenfunction: Cannot find function “operator&&” in doxygen xml output for project “xtensor” from directory: ../xml
-
template<class
E>
autoxt::operator!(E &&e)¶ Not.
Returns an xfunction for the element-wise not of e.
- Return
an xfunction
- Parameters
e: an xexpression
-
template<class
E1, classE2, classE3>
autoxt::where(E1 &&e1, E2 &&e2, E3 &&e3) Ternary selection.
Returns an xfunction for the element-wise ternary selection (i.e. operator ? :) of e1, e2 and e3.
- Return
an xfunction
- Parameters
e1: a boolean xexpressione2: an xexpression or a scalare3: an xexpression or a scalar
-
template<class
E>
boolxt::any(E &&e)¶ Any.
Returns true if any of the values of e is truthy, false otherwise.
- Return
a boolean
- Parameters
e: an xexpression
-
template<class
E>
boolxt::all(E &&e) Any.
Returns true if all of the values of e are truthy, false otherwise.
- Return
a boolean
- Parameters
e: an xexpression
-
template<class
E1, classE2>
autoxt::operator<(E1 &&e1, E2 &&e2) Lesser than.
Returns an xfunction for the element-wise lesser than comparison of e1 and e2.
- Return
an xfunction
- Parameters
e1: an xexpression or a scalare2: an xexpression or a scalar
-
template<class
E1, classE2>
autoxt::operator<=(E1 &&e1, E2 &&e2) Lesser or equal.
Returns an xfunction for the element-wise lesser or equal comparison of e1 and e2.
- Return
an xfunction
- Parameters
e1: an xexpression or a scalare2: an xexpression or a scalar
-
template<class
E1, classE2>
autoxt::operator>(E1 &&e1, E2 &&e2) Greater than.
Returns an xfunction for the element-wise greater than comparison of e1 and e2.
- Return
an xfunction
- Parameters
e1: an xexpression or a scalare2: an xexpression or a scalar
-
template<class
E1, classE2>
autoxt::operator>=(E1 &&e1, E2 &&e2) Greater or equal.
Returns an xfunction for the element-wise greater or equal comparison of e1 and e2.
- Return
an xfunction
- Parameters
e1: an xexpression or a scalare2: an xexpression or a scalar
-
template<class
E1, classE2>
std::enable_if_t<xoptional_comparable<E1, E2>::value, bool>xt::operator==(const xexpression<E1> &e1, const xexpression<E2> &e2) Equality.
Returns true if e1 and e2 have the same shape and hold the same values. Unlike other comparison operators, this does not return an xfunction.
- Return
a boolean
- Parameters
e1: an xexpression or a scalare2: an xexpression or a scalar
-
template<class
E1, classE2>
boolxt::operator!=(const xexpression<E1> &e1, const xexpression<E2> &e2) Inequality.
Returns true if e1 and e2 have different shapes or hold the different values. Unlike other comparison operators, this does not return an xfunction.
- Return
a boolean
- Parameters
e1: an xexpression or a scalare2: an xexpression or a scalar
-
template<class
E1, classE2>
autoxt::equal(E1 &&e1, E2 &&e2) Element-wise equality.
Returns an xfunction for the element-wise equality of e1 and e2.
- Return
an xfunction
- Parameters
e1: an xexpression or a scalare2: an xexpression or a scalar
-
template<class
E1, classE2>
autoxt::not_equal(E1 &&e1, E2 &&e2)¶ Element-wise inequality.
Returns an xfunction for the element-wise inequality of e1 and e2.
- Return
an xfunction
- Parameters
e1: an xexpression or a scalare2: an xexpression or a scalar
-
template<class
E1, classE2>
autoxt::less(E1 &&e1, E2 &&e2)¶ Lesser than.
Returns an xfunction for the element-wise lesser than comparison of e1 and e2. This function is equivalent to operator<(E1&&, E2&&).
- Return
an xfunction
- Parameters
e1: an xexpression or a scalare2: an xexpression or a scalar
-
template<class
E1, classE2>
autoxt::less_equal(E1 &&e1, E2 &&e2)¶ Lesser or equal.
Returns an xfunction for the element-wise lesser or equal comparison of e1 and e2. This function is equivalent to operator<=(E1&&, E2&&).
- Return
an xfunction
- Parameters
e1: an xexpression or a scalare2: an xexpression or a scalar
-
template<class
E1, classE2>
autoxt::greater(E1 &&e1, E2 &&e2)¶ Greater than.
Returns an xfunction for the element-wise greater than comparison of e1 and e2. This function is equivalent to operator>(E1&&, E2&&).
- Return
an xfunction
- Parameters
e1: an xexpression or a scalare2: an xexpression or a scalar
-
template<class
E1, classE2>
autoxt::greater_equal(E1 &&e1, E2 &&e2)¶ Greater or equal.
Returns an xfunction for the element-wise greater or equal comparison of e1 and e2. This function is equivalent to operator>=(E1&&, E2&&).
- Return
an xfunction
- Parameters
e1: an xexpression or a scalare2: an xexpression or a scalar
Warning
doxygenfunction: Cannot find function “operator&” in doxygen xml output for project “xtensor” from directory: ../xml
-
template<class
E1, classE2>
autoxt::operator|(E1 &&e1, E2 &&e2) Bitwise or.
Returns an xfunction for the element-wise bitwise or of e1 and e2.
- Return
an xfunction
- Parameters
e1: an xexpression or a scalare2: an xexpression or a scalar
-
template<class
E1, classE2>
autoxt::operator^(E1 &&e1, E2 &&e2)¶ Bitwise xor.
Returns an xfunction for the element-wise bitwise xor of e1 and e2.
- Return
an xfunction
- Parameters
e1: an xexpression or a scalare2: an xexpression or a scalar
-
template<class
E>
autoxt::operator~(E &&e)¶ Bitwise not.
Returns an xfunction for the element-wise bitwise not of e.
- Return
an xfunction
- Parameters
e: an xexpression
-
template<class
E1, classE2>
autoxt::left_shift(E1 &&e1, E2 &&e2)¶ Bitwise left shift.
Returns an xfunction for the element-wise bitwise left shift of e1 by e2.
- Return
an xfunction
- Parameters
e1: an xexpressione2: an xexpression
-
template<class
E1, classE2>
autoxt::right_shift(E1 &&e1, E2 &&e2)¶ Bitwise left shift.
Returns an xfunction for the element-wise bitwise left shift of e1 by e2.
- Return
an xfunction
- Parameters
e1: an xexpressione2: an xexpression
-
template<class
E1, classE2>
autoxt::operator<<(E1 &&e1, E2 &&e2) Bitwise left shift.
Returns an xfunction for the element-wise bitwise left shift of e1 by e2.
- Return
an xfunction
- See
- Parameters
e1: an xexpressione2: an xexpression
-
template<class
E1, classE2>
autoxt::operator>>(E1 &&e1, E2 &&e2)¶ Bitwise right shift.
Returns an xfunction for the element-wise bitwise right shift of e1 by e2.
- Return
an xfunction
- See
- Parameters
e1: an xexpressione2: an xexpression
-
template<class
R, classE>
autoxt::cast(E &&e)¶ Element-wise
static_cast.Returns an xfunction for the element-wise static_cast of e to type R.
- Return
an xfunction
- Parameters
e: an xexpression or a scalar