|
Stratax
Scientific computing containers and operations
|
#include <stratax/core/Concepts.hpp>#include <stratax/core/Exceptions.hpp>#include <stratax/core/Validation.hpp>Go to the source code of this file.
Functions | |
| template<Array A> | |
| void | require_same_arithmetic_shape (const A &lhs, const A &rhs) |
| Verifies that two arrays have the same shape before arithmetic. | |
| template<Array A> | |
| A | operator+ (const A &lhs, const A &rhs) |
| Adds two arrays element by element. | |
| template<Array A> | |
| A | operator- (const A &lhs, const A &rhs) |
| Subtracts two arrays element by element. | |
| template<Array A> | |
| A | operator* (const A &lhs, const A &rhs) |
| Multiplies two arrays element by element. | |
| template<Array A> | |
| A | operator/ (const A &lhs, const A &rhs) |
| Divides two arrays element by element. | |
| template<Array A, Numeric Scalar> | |
| A | operator+ (const A &lhs, const Scalar &rhs) |
| Adds a scalar to every element of an array. | |
| template<Array A, Numeric Scalar> | |
| A | operator- (const A &lhs, const Scalar &rhs) |
| Subtracts a scalar from every element of an array. | |
| template<Array A, Numeric Scalar> | |
| A | operator* (const A &lhs, const Scalar &rhs) |
| Multiplies every element of an array by a scalar. | |
| template<Array A, Numeric Scalar> | |
| A | operator/ (const A &lhs, const Scalar &rhs) |
| Divides every element of an array by a scalar. | |
| template<Numeric Scalar, Array A> | |
| A | operator+ (const Scalar &lhs, const A &rhs) |
| Adds an array to a scalar. | |
| template<Numeric Scalar, Array A> | |
| A | operator- (const Scalar &lhs, const A &rhs) |
| Subtracts each array element from a scalar. | |
| template<Numeric Scalar, Array A> | |
| A | operator* (const Scalar &lhs, const A &rhs) |
| Multiplies an array by a scalar. | |
| template<Numeric Scalar, Array A> | |
| A | operator/ (const Scalar &lhs, const A &rhs) |
| Divides a scalar by each array element. | |
| template<Array A> | |
| A & | operator+= (A &lhs, const A &rhs) |
| Adds an array to itself in place. | |
| template<Array A> | |
| A & | operator-= (A &lhs, const A &rhs) |
| Subtracts an array from itself in place. | |
| template<Array A> | |
| A & | operator*= (A &lhs, const A &rhs) |
| Multiplies an array by another array in place. | |
| template<Array A> | |
| A & | operator/= (A &lhs, const A &rhs) |
| Divides an array by another array in place. | |
| template<Array A, Numeric Scalar> | |
| A & | operator+= (A &lhs, const Scalar &rhs) |
| Adds a scalar to an array in place. | |
| template<Array A, Numeric Scalar> | |
| A & | operator-= (A &lhs, const Scalar &rhs) |
| Subtracts a scalar from an array in place. | |
| template<Array A, Numeric Scalar> | |
| A & | operator*= (A &lhs, const Scalar &rhs) |
| Multiplies an array by a scalar in place. | |
| template<Array A, Numeric Scalar> | |
| A & | operator/= (A &lhs, const Scalar &rhs) |
| Divides an array by a scalar in place. | |
| template<Array A> | |
| A | operator- (const A &arr) |
| Negates every element of an array. | |
| template<Array A> | |
| A | operator+ (const A &arr) |
| Returns an array unchanged. | |
| A operator* | ( | const A & | lhs, |
| const A & | rhs ) |
Multiplies two arrays element by element.
| lhs | Left-hand operand. |
| rhs | Right-hand operand. |
| Exceptions::ShapeError | If the operands do not match in shape. |
Definition at line 93 of file Arithmetic.hpp.
References require_same_arithmetic_shape().
Multiplies every element of an array by a scalar.
Definition at line 201 of file Arithmetic.hpp.
Multiplies an array by a scalar.
Definition at line 291 of file Arithmetic.hpp.
| A & operator*= | ( | A & | lhs, |
| const A & | rhs ) |
Multiplies an array by another array in place.
| lhs | Left-hand operand to modify. |
| rhs | Right-hand operand. |
| Exceptions::ShapeError | If the operands do not match in shape. |
Definition at line 367 of file Arithmetic.hpp.
Multiplies an array by a scalar in place.
Definition at line 429 of file Arithmetic.hpp.
| A operator+ | ( | const A & | arr | ) |
Returns an array unchanged.
| arr | Array operand. |
Definition at line 472 of file Arithmetic.hpp.
| A operator+ | ( | const A & | lhs, |
| const A & | rhs ) |
Adds two arrays element by element.
| lhs | Left-hand operand. |
| rhs | Right-hand operand. |
| Exceptions::ShapeError | If the operands do not match in shape. |
Definition at line 35 of file Arithmetic.hpp.
References require_same_arithmetic_shape().
Adds a scalar to every element of an array.
Definition at line 155 of file Arithmetic.hpp.
Adds an array to a scalar.
Definition at line 254 of file Arithmetic.hpp.
| A & operator+= | ( | A & | lhs, |
| const A & | rhs ) |
Adds an array to itself in place.
| lhs | Left-hand operand to modify. |
| rhs | Right-hand operand. |
| Exceptions::ShapeError | If the operands do not match in shape. |
Definition at line 335 of file Arithmetic.hpp.
Adds a scalar to an array in place.
Definition at line 399 of file Arithmetic.hpp.
| A operator- | ( | const A & | arr | ) |
Negates every element of an array.
| arr | Array operand. |
Definition at line 459 of file Arithmetic.hpp.
| A operator- | ( | const A & | lhs, |
| const A & | rhs ) |
Subtracts two arrays element by element.
| lhs | Left-hand operand. |
| rhs | Right-hand operand. |
| Exceptions::ShapeError | If the operands do not match in shape. |
Definition at line 64 of file Arithmetic.hpp.
References require_same_arithmetic_shape().
Subtracts a scalar from every element of an array.
Definition at line 178 of file Arithmetic.hpp.
Subtracts each array element from a scalar.
Definition at line 268 of file Arithmetic.hpp.
| A & operator-= | ( | A & | lhs, |
| const A & | rhs ) |
Subtracts an array from itself in place.
| lhs | Left-hand operand to modify. |
| rhs | Right-hand operand. |
| Exceptions::ShapeError | If the operands do not match in shape. |
Definition at line 351 of file Arithmetic.hpp.
Subtracts a scalar from an array in place.
Definition at line 414 of file Arithmetic.hpp.
| A operator/ | ( | const A & | lhs, |
| const A & | rhs ) |
Divides two arrays element by element.
| lhs | Left-hand operand. |
| rhs | Right-hand operand. |
| Exceptions::ShapeError | If the operands do not match in shape. |
| Exceptions::ZeroDivisionError | If any divisor element is zero. |
Definition at line 123 of file Arithmetic.hpp.
References require_same_arithmetic_shape().
Divides every element of an array by a scalar.
| Exceptions::ZeroDivisionError | If the scalar is zero. |
Definition at line 226 of file Arithmetic.hpp.
Divides a scalar by each array element.
| Exceptions::ZeroDivisionError | If any array element is zero. |
Definition at line 307 of file Arithmetic.hpp.
| A & operator/= | ( | A & | lhs, |
| const A & | rhs ) |
Divides an array by another array in place.
| lhs | Left-hand operand to modify. |
| rhs | Right-hand operand. |
| Exceptions::ShapeError | If the operands do not match in shape. |
| Exceptions::ZeroDivisionError | If any divisor element is zero. |
Definition at line 384 of file Arithmetic.hpp.
Divides an array by a scalar in place.
| Exceptions::ZeroDivisionError | If the scalar is zero. |
Definition at line 445 of file Arithmetic.hpp.
| void require_same_arithmetic_shape | ( | const A & | lhs, |
| const A & | rhs ) |
Verifies that two arrays have the same shape before arithmetic.
| lhs | Left-hand operand. |
| rhs | Right-hand operand. |
| Exceptions::ShapeError | If the operands do not match in size or shape. |
Definition at line 16 of file Arithmetic.hpp.
References stratax::core::validation::require_same_shape().
Referenced by operator*(), operator+(), operator-(), and operator/().