|
Stratax 0.4.0rc1
|
Element-wise boolean comparisons with broadcasting. More...
#include <functional>#include <stratax/core/dtypes/Concepts.hpp>#include <stratax/core/ArrayTraits.hpp>#include <stratax/core/dtypes/Types.hpp>#include <stratax/ops/Broadcasting.hpp>

Go to the source code of this file.
Functions | |
| template<Array L, Array R, typename Op > | |
| auto | stratax::core::comparison_detail::comparison_op (const L &lhs, const R &rhs, Op op) |
| Applies an element-wise comparison to two broadcast-compatible arrays. | |
| template<Array A, DType Scalar, typename Op > | |
| auto | stratax::core::comparison_detail::comparison_scalar_op (const A &lhs, const Scalar &rhs, Op op) |
| Compares every array element with a scalar on the right. | |
| template<DType Scalar, Array A, typename Op > | |
| auto | stratax::core::comparison_detail::comparison_scalar_op (const Scalar &lhs, const A &rhs, Op op) |
| Compares a scalar on the left with every array element. | |
| template<Array L, Array R> | |
| bool | stratax::core::comparison_detail::array_equal (const L &lhs, const R &rhs) |
| Tests whether two arrays have identical shapes and element values. | |
| template<Array L, Array R> | |
| auto | equal (const L &lhs, const R &rhs) |
| Compares two arrays for element-wise equality with broadcasting. | |
| template<Array L, Array R> | |
| auto | not_equal (const L &lhs, const R &rhs) |
| Compares two arrays for element-wise inequality with broadcasting. | |
| template<Array L, Array R> requires ( Ordered<typename L::value_type> && Ordered<typename R::value_type> ) | |
| auto | less (const L &lhs, const R &rhs) |
| Tests each broadcasted left element for strict ordering below the corresponding right element. | |
| template<Array L, Array R> requires ( Ordered<typename L::value_type> && Ordered<typename R::value_type> ) | |
| auto | less_equal (const L &lhs, const R &rhs) |
| Tests each broadcasted left element for ordering below or equal to the corresponding right element. | |
| template<Array L, Array R> requires ( Ordered<typename L::value_type> && Ordered<typename R::value_type> ) | |
| auto | greater (const L &lhs, const R &rhs) |
| Tests each broadcasted left element for strict ordering above the corresponding right element. | |
| template<Array L, Array R> requires ( Ordered<typename L::value_type> && Ordered<typename R::value_type> ) | |
| auto | greater_equal (const L &lhs, const R &rhs) |
| Tests each broadcasted left element for ordering above or equal to the corresponding right element. | |
| template<Array A, DType Scalar> | |
| auto | equal (const A &lhs, const Scalar &rhs) |
| Compares every array element for equality with a right-hand scalar. | |
| template<DType Scalar, Array A> | |
| auto | equal (const Scalar &lhs, const A &rhs) |
| Compares a left-hand scalar for equality with every array element. | |
| template<Array A, DType Scalar> | |
| auto | not_equal (const A &lhs, const Scalar &rhs) |
| Compares every array element for inequality with a right-hand scalar. | |
| template<DType Scalar, Array A> | |
| auto | not_equal (const Scalar &lhs, const A &rhs) |
| Compares a left-hand scalar for inequality with every array element. | |
| template<Array A, Ordered Scalar> requires Ordered<typename A::value_type> | |
| auto | less (const A &lhs, const Scalar &rhs) |
| Tests each array element for strict ordering below a right-hand scalar. | |
| template<Ordered Scalar, Array A> requires Ordered<typename A::value_type> | |
| auto | less (const Scalar &lhs, const A &rhs) |
| Tests a left-hand scalar for strict ordering below each array element. | |
| template<Array A, Ordered Scalar> requires Ordered<typename A::value_type> | |
| auto | less_equal (const A &lhs, const Scalar &rhs) |
| Tests each array element for ordering below or equal to a scalar. | |
| template<Ordered Scalar, Array A> requires Ordered<typename A::value_type> | |
| auto | less_equal (const Scalar &lhs, const A &rhs) |
| Tests a scalar for ordering below or equal to each array element. | |
| template<Array A, Ordered Scalar> requires Ordered<typename A::value_type> | |
| auto | greater (const A &lhs, const Scalar &rhs) |
| Tests each array element for strict ordering above a right-hand scalar. | |
| template<Ordered Scalar, Array A> requires Ordered<typename A::value_type> | |
| auto | greater (const Scalar &lhs, const A &rhs) |
| Tests a left-hand scalar for strict ordering above each array element. | |
| template<Array A, Ordered Scalar> requires Ordered<typename A::value_type> | |
| auto | greater_equal (const A &lhs, const Scalar &rhs) |
| Tests each array element for ordering above or equal to a scalar. | |
| template<Ordered Scalar, Array A> requires Ordered<typename A::value_type> | |
| auto | greater_equal (const Scalar &lhs, const A &rhs) |
| Tests a scalar for ordering above or equal to each array element. | |
| template<Array L, Array R> | |
| auto | operator== (const L &lhs, const R &rhs) |
| Element-wise array equality shorthand for equal(). | |
| template<Array L, Array R> | |
| auto | operator!= (const L &lhs, const R &rhs) |
| Element-wise array inequality shorthand for not_equal(). | |
| template<Array L, Array R> requires ( Ordered<typename L::value_type> && Ordered<typename R::value_type> ) | |
| auto | operator< (const L &lhs, const R &rhs) |
| Element-wise array less-than shorthand for less(). | |
| template<Array L, Array R> requires ( Ordered<typename L::value_type> && Ordered<typename R::value_type> ) | |
| auto | operator<= (const L &lhs, const R &rhs) |
| Element-wise array less-than-or-equal shorthand for less_equal(). | |
| template<Array L, Array R> requires ( Ordered<typename L::value_type> && Ordered<typename R::value_type> ) | |
| auto | operator> (const L &lhs, const R &rhs) |
| Element-wise array greater-than shorthand for greater(). | |
| template<Array L, Array R> requires ( Ordered<typename L::value_type> && Ordered<typename R::value_type> ) | |
| auto | operator>= (const L &lhs, const R &rhs) |
| Element-wise array greater-than-or-equal shorthand for greater_equal(). | |
| template<Array A, DType Scalar> | |
| auto | operator== (const A &lhs, const Scalar &rhs) |
| Element-wise array-to-scalar equality shorthand for equal(). | |
| template<DType Scalar, Array A> | |
| auto | operator== (const Scalar &lhs, const A &rhs) |
| Element-wise scalar-to-array equality shorthand for equal(). | |
| template<Array A, DType Scalar> | |
| auto | operator!= (const A &lhs, const Scalar &rhs) |
| Element-wise array-to-scalar inequality shorthand for not_equal(). | |
| template<DType Scalar, Array A> | |
| auto | operator!= (const Scalar &lhs, const A &rhs) |
| Element-wise scalar-to-array inequality shorthand for not_equal(). | |
| template<Array A, Ordered Scalar> requires Ordered<typename A::value_type> | |
| auto | operator< (const A &lhs, const Scalar &rhs) |
| Element-wise array-to-scalar less-than shorthand for less(). | |
| template<Ordered Scalar, Array A> requires Ordered<typename A::value_type> | |
| auto | operator< (const Scalar &lhs, const A &rhs) |
| Element-wise scalar-to-array less-than shorthand for less(). | |
| template<Array A, Ordered Scalar> requires Ordered<typename A::value_type> | |
| auto | operator<= (const A &lhs, const Scalar &rhs) |
| Element-wise array-to-scalar less-than-or-equal shorthand. | |
| template<Ordered Scalar, Array A> requires Ordered<typename A::value_type> | |
| auto | operator<= (const Scalar &lhs, const A &rhs) |
| Element-wise scalar-to-array less-than-or-equal shorthand. | |
| template<Array A, Ordered Scalar> requires Ordered<typename A::value_type> | |
| auto | operator> (const A &lhs, const Scalar &rhs) |
| Element-wise array-to-scalar greater-than shorthand for greater(). | |
| template<Ordered Scalar, Array A> requires Ordered<typename A::value_type> | |
| auto | operator> (const Scalar &lhs, const A &rhs) |
| Element-wise scalar-to-array greater-than shorthand for greater(). | |
| template<Array A, Ordered Scalar> requires Ordered<typename A::value_type> | |
| auto | operator>= (const A &lhs, const Scalar &rhs) |
| Element-wise array-to-scalar greater-than-or-equal shorthand. | |
| template<Ordered Scalar, Array A> requires Ordered<typename A::value_type> | |
| auto | operator>= (const Scalar &lhs, const A &rhs) |
| Element-wise scalar-to-array greater-than-or-equal shorthand. | |
Element-wise boolean comparisons with broadcasting.
Operations that allocate results require owning-container result trait specializations. Element operators receive the original operand types; the result is converted afterward. Native C++ arithmetic and conversion rules apply, including representability requirements. Allocation failures propagate.
Definition in file Comparison.hpp.
| bool stratax::core::comparison_detail::array_equal | ( | const L & | lhs, |
| const R & | rhs | ||
| ) |
Tests whether two arrays have identical shapes and element values.
true if the shapes and every corresponding value are equal. Definition at line 143 of file Comparison.hpp.
| auto stratax::core::comparison_detail::comparison_op | ( | const L & | lhs, |
| const R & | rhs, | ||
| Op | op | ||
| ) |
Applies an element-wise comparison to two broadcast-compatible arrays.
| L | Left Stratax array type. |
| R | Right Stratax array type. |
| Op | Binary comparison callable. |
| lhs | Left array operand. |
| rhs | Right array operand. |
| op | Comparison applied to each broadcasted element pair. |
lhs and rhs and whose shape is their common broadcasted shape. | Exceptions::BroadcastError | If shapes are incompatible or an empty operand would supply values to a nonempty result. |
n is the result size and r is its rank. Definition at line 36 of file Comparison.hpp.
| auto stratax::core::comparison_detail::comparison_scalar_op | ( | const A & | lhs, |
| const Scalar & | rhs, | ||
| Op | op | ||
| ) |
Compares every array element with a scalar on the right.
lhs's container type and shape. Definition at line 81 of file Comparison.hpp.
| auto stratax::core::comparison_detail::comparison_scalar_op | ( | const Scalar & | lhs, |
| const A & | rhs, | ||
| Op | op | ||
| ) |
Compares a scalar on the left with every array element.
rhs's container type and shape. Definition at line 112 of file Comparison.hpp.
Compares every array element for equality with a right-hand scalar.
lhs. Definition at line 270 of file Comparison.hpp.
Compares two arrays for element-wise equality with broadcasting.
| Exceptions::BroadcastError | If broadcasting is impossible, including an empty operand supplying a nonempty result. |
n is result size and r is result rank. Definition at line 173 of file Comparison.hpp.
Compares a left-hand scalar for equality with every array element.
rhs. Definition at line 282 of file Comparison.hpp.
| auto greater | ( | const A & | lhs, |
| const Scalar & | rhs | ||
| ) |
Tests each array element for strict ordering above a right-hand scalar.
lhs. Definition at line 371 of file Comparison.hpp.
| auto greater | ( | const L & | lhs, |
| const R & | rhs | ||
| ) |
Tests each broadcasted left element for strict ordering above the corresponding right element.
| Exceptions::BroadcastError | If broadcasting is impossible, including an empty operand supplying a nonempty result. |
n is result size and r is result rank. Definition at line 240 of file Comparison.hpp.
| auto greater | ( | const Scalar & | lhs, |
| const A & | rhs | ||
| ) |
Tests a left-hand scalar for strict ordering above each array element.
rhs. Definition at line 384 of file Comparison.hpp.
| auto greater_equal | ( | const A & | lhs, |
| const Scalar & | rhs | ||
| ) |
Tests each array element for ordering above or equal to a scalar.
lhs. Definition at line 397 of file Comparison.hpp.
| auto greater_equal | ( | const L & | lhs, |
| const R & | rhs | ||
| ) |
Tests each broadcasted left element for ordering above or equal to the corresponding right element.
| Exceptions::BroadcastError | If broadcasting is impossible, including an empty operand supplying a nonempty result. |
n is result size and r is result rank. Definition at line 258 of file Comparison.hpp.
| auto greater_equal | ( | const Scalar & | lhs, |
| const A & | rhs | ||
| ) |
Tests a scalar for ordering above or equal to each array element.
rhs. Definition at line 410 of file Comparison.hpp.
| auto less | ( | const A & | lhs, |
| const Scalar & | rhs | ||
| ) |
Tests each array element for strict ordering below a right-hand scalar.
lhs. Definition at line 319 of file Comparison.hpp.
| auto less | ( | const L & | lhs, |
| const R & | rhs | ||
| ) |
Tests each broadcasted left element for strict ordering below the corresponding right element.
| Exceptions::BroadcastError | If broadcasting is impossible, including an empty operand supplying a nonempty result. |
n is result size and r is result rank. Definition at line 204 of file Comparison.hpp.
| auto less | ( | const Scalar & | lhs, |
| const A & | rhs | ||
| ) |
Tests a left-hand scalar for strict ordering below each array element.
rhs. Definition at line 332 of file Comparison.hpp.
| auto less_equal | ( | const A & | lhs, |
| const Scalar & | rhs | ||
| ) |
Tests each array element for ordering below or equal to a scalar.
lhs. Definition at line 345 of file Comparison.hpp.
| auto less_equal | ( | const L & | lhs, |
| const R & | rhs | ||
| ) |
Tests each broadcasted left element for ordering below or equal to the corresponding right element.
| Exceptions::BroadcastError | If broadcasting is impossible, including an empty operand supplying a nonempty result. |
n is result size and r is result rank. Definition at line 222 of file Comparison.hpp.
| auto less_equal | ( | const Scalar & | lhs, |
| const A & | rhs | ||
| ) |
Tests a scalar for ordering below or equal to each array element.
rhs. Definition at line 358 of file Comparison.hpp.
Compares every array element for inequality with a right-hand scalar.
lhs. Definition at line 294 of file Comparison.hpp.
Compares two arrays for element-wise inequality with broadcasting.
| Exceptions::BroadcastError | If broadcasting is impossible, including an empty operand supplying a nonempty result. |
n is result size and r is result rank. Definition at line 186 of file Comparison.hpp.
Compares a left-hand scalar for inequality with every array element.
rhs. Definition at line 306 of file Comparison.hpp.
Element-wise array-to-scalar inequality shorthand for not_equal().
Definition at line 517 of file Comparison.hpp.
Element-wise array inequality shorthand for not_equal().
Definition at line 431 of file Comparison.hpp.
Element-wise scalar-to-array inequality shorthand for not_equal().
Definition at line 527 of file Comparison.hpp.
| auto operator< | ( | const A & | lhs, |
| const Scalar & | rhs | ||
| ) |
Element-wise array-to-scalar less-than shorthand for less().
Definition at line 538 of file Comparison.hpp.
| auto operator< | ( | const L & | lhs, |
| const R & | rhs | ||
| ) |
Element-wise array less-than shorthand for less().
Definition at line 445 of file Comparison.hpp.
| auto operator< | ( | const Scalar & | lhs, |
| const A & | rhs | ||
| ) |
Element-wise scalar-to-array less-than shorthand for less().
Definition at line 549 of file Comparison.hpp.
| auto operator<= | ( | const A & | lhs, |
| const Scalar & | rhs | ||
| ) |
Element-wise array-to-scalar less-than-or-equal shorthand.
Definition at line 560 of file Comparison.hpp.
| auto operator<= | ( | const L & | lhs, |
| const R & | rhs | ||
| ) |
Element-wise array less-than-or-equal shorthand for less_equal().
Definition at line 459 of file Comparison.hpp.
| auto operator<= | ( | const Scalar & | lhs, |
| const A & | rhs | ||
| ) |
Element-wise scalar-to-array less-than-or-equal shorthand.
Definition at line 571 of file Comparison.hpp.
Element-wise array-to-scalar equality shorthand for equal().
Definition at line 497 of file Comparison.hpp.
Element-wise array equality shorthand for equal().
Definition at line 421 of file Comparison.hpp.
Element-wise scalar-to-array equality shorthand for equal().
Definition at line 507 of file Comparison.hpp.
| auto operator> | ( | const A & | lhs, |
| const Scalar & | rhs | ||
| ) |
Element-wise array-to-scalar greater-than shorthand for greater().
Definition at line 582 of file Comparison.hpp.
| auto operator> | ( | const L & | lhs, |
| const R & | rhs | ||
| ) |
Element-wise array greater-than shorthand for greater().
Definition at line 473 of file Comparison.hpp.
| auto operator> | ( | const Scalar & | lhs, |
| const A & | rhs | ||
| ) |
Element-wise scalar-to-array greater-than shorthand for greater().
Definition at line 593 of file Comparison.hpp.
| auto operator>= | ( | const A & | lhs, |
| const Scalar & | rhs | ||
| ) |
Element-wise array-to-scalar greater-than-or-equal shorthand.
Definition at line 604 of file Comparison.hpp.
| auto operator>= | ( | const L & | lhs, |
| const R & | rhs | ||
| ) |
Element-wise array greater-than-or-equal shorthand for greater_equal().
Definition at line 487 of file Comparison.hpp.
| auto operator>= | ( | const Scalar & | lhs, |
| const A & | rhs | ||
| ) |
Element-wise scalar-to-array greater-than-or-equal shorthand.
Definition at line 615 of file Comparison.hpp.