56 template<
typename dtype>
72 template<
typename dtype>
77 const auto function = [](
const std::complex<dtype>& val1, dtype val2) -> std::complex<dtype>
78 {
return val1 + val2; };
90 template<
typename dtype>
95 const auto function = [rhs](dtype& value) -> dtype {
return value += rhs; };
110 template<
typename dtype>
115 const auto function = [rhs](std::complex<dtype>& value) -> std::complex<dtype> {
return value += rhs; };
130 template<
typename dtype>
135 return broadcast::broadcaster<dtype>(lhs, rhs, std::plus<dtype>());
146 template<
typename dtype>
151 const auto function = [](
const auto& val1,
const auto& val2) -> std::complex<dtype> {
return val1 + val2; };
152 return broadcast::broadcaster<std::complex<dtype>>(lhs, rhs, function);
163 template<
typename dtype>
177 template<
typename dtype>
192 template<
typename dtype>
206 template<
typename dtype>
211 const auto function = [rhs](dtype value) -> std::complex<dtype> {
return value + rhs; };
228 template<
typename dtype>
242 template<
typename dtype>
257 template<
typename dtype>
271 template<
typename dtype>
287 template<
typename dtype>
292 const auto function = [](
const std::complex<dtype>& val1, dtype val2) -> std::complex<dtype>
293 {
return val1 - val2; };
305 template<
typename dtype>
310 const auto function = [rhs](dtype& value) -> dtype {
return value -= rhs; };
325 template<
typename dtype>
330 const auto function = [rhs](std::complex<dtype>& value) -> std::complex<dtype> {
return value -= rhs; };
345 template<
typename dtype>
350 return broadcast::broadcaster<dtype>(lhs, rhs, std::minus<dtype>());
361 template<
typename dtype>
366 const auto function = [](
const auto& val1,
const auto& val2) -> std::complex<dtype> {
return val1 - val2; };
367 return broadcast::broadcaster<std::complex<dtype>>(lhs, rhs, function);
378 template<
typename dtype>
383 const auto function = [](
const auto& val1,
const auto& val2) -> std::complex<dtype> {
return val1 - val2; };
384 return broadcast::broadcaster<std::complex<dtype>>(lhs, rhs, function);
395 template<
typename dtype>
410 template<
typename dtype>
415 const auto function = [lhs](dtype value) -> dtype {
return lhs - value; };
432 template<
typename dtype>
437 const auto function = [rhs](dtype value) -> std::complex<dtype> {
return value - rhs; };
454 template<
typename dtype>
459 const auto function = [lhs](dtype value) -> std::complex<dtype> {
return lhs - value; };
476 template<
typename dtype>
491 template<
typename dtype>
496 const auto function = [lhs](std::complex<dtype> value) -> std::complex<dtype> {
return lhs - value; };
511 template<
typename dtype>
514 const auto function = [](dtype value) -> dtype {
return -value; };
529 template<
typename dtype>
545 template<
typename dtype>
550 const auto function = [](
const std::complex<dtype>& val1, dtype val2) -> std::complex<dtype>
551 {
return val1 * val2; };
563 template<
typename dtype>
568 const auto function = [rhs](dtype& value) -> dtype {
return value *= rhs; };
583 template<
typename dtype>
588 const auto function = [rhs](std::complex<dtype>& value) -> std::complex<dtype> {
return value *= rhs; };
603 template<
typename dtype>
608 return broadcast::broadcaster<dtype>(lhs, rhs, std::multiplies<dtype>());
619 template<
typename dtype>
624 const auto function = [](
const auto& val1,
const auto& val2) -> std::complex<dtype> {
return val1 * val2; };
625 return broadcast::broadcaster<std::complex<dtype>>(lhs, rhs, function);
636 template<
typename dtype>
650 template<
typename dtype>
665 template<
typename dtype>
679 template<
typename dtype>
684 const auto function = [rhs](dtype value) -> std::complex<dtype> {
return value * rhs; };
701 template<
typename dtype>
715 template<
typename dtype>
730 template<
typename dtype>
744 template<
typename dtype>
760 template<
typename dtype>
765 const auto function = [](
const std::complex<dtype>& val1, dtype val2) -> std::complex<dtype>
766 {
return val1 / val2; };
778 template<
typename dtype>
783 const auto function = [rhs](dtype& value) -> dtype {
return value /= rhs; };
798 template<
typename dtype>
803 const auto function = [rhs](std::complex<dtype>& value) -> std::complex<dtype> {
return value /= rhs; };
818 template<
typename dtype>
823 return broadcast::broadcaster<dtype>(lhs, rhs, std::divides<dtype>());
834 template<
typename dtype>
839 const auto function = [](
const auto& val1,
const auto& val2) -> std::complex<dtype> {
return val1 / val2; };
840 return broadcast::broadcaster<std::complex<dtype>>(lhs, rhs, function);
851 template<
typename dtype>
856 const auto function = [](
const auto& val1,
const auto& val2) -> std::complex<dtype> {
return val1 / val2; };
857 return broadcast::broadcaster<std::complex<dtype>>(lhs, rhs, function);
868 template<
typename dtype>
883 template<
typename dtype>
888 const auto function = [lhs](dtype value) -> dtype {
return lhs / value; };
905 template<
typename dtype>
910 const auto function = [rhs](dtype value) -> std::complex<dtype> {
return value / rhs; };
927 template<
typename dtype>
932 const auto function = [lhs](dtype value) -> std::complex<dtype> {
return lhs / value; };
949 template<
typename dtype>
964 template<
typename dtype>
969 const auto function = [lhs](
const std::complex<dtype>& value) -> std::complex<dtype> {
return lhs / value; };
986 template<
typename dtype, std::enable_if_t<std::is_
integral_v<dtype> || std::is_
floating_po
int_v<dtype>,
int> = 0>
989 if constexpr (std::is_integral_v<dtype>)
995 const auto function = [](
const dtype value1,
const dtype value2) -> dtype
1009 template<
typename dtype, std::enable_if_t<std::is_
integral_v<dtype> || std::is_
floating_po
int_v<dtype>,
int> = 0>
1012 if constexpr (std::is_integral_v<dtype>)
1014 const auto function = [rhs](dtype& value) -> dtype {
return value %= rhs; };
1019 const auto function = [rhs](dtype& value) ->
void { value =
std::fmod(value, rhs); };
1034 template<
typename dtype, std::enable_if_t<std::is_
integral_v<dtype> || std::is_
floating_po
int_v<dtype>,
int> = 0>
1037 if constexpr (std::is_integral_v<dtype>)
1039 return broadcast::broadcaster<dtype>(lhs, rhs, std::modulus<dtype>());
1043 const auto function = [](dtype value1, dtype value2) -> dtype {
return std::fmod(value1, value2); };
1044 return broadcast::broadcaster<dtype>(lhs, rhs, function);
1056 template<
typename dtype>
1071 template<
typename dtype, std::enable_if_t<std::is_
integral_v<dtype>,
int> = 0>
1077 returnArray.
begin(),
1078 [lhs](dtype value) -> dtype { return lhs % value; });
1091 template<
typename dtype, std::enable_if_t<std::is_
floating_po
int_v<dtype>,
int> = 0>
1092 NdArray<dtype>
operator%(dtype lhs,
const NdArray<dtype>& rhs)
1094 NdArray<dtype> returnArray(rhs.shape());
1097 returnArray.begin(),
1098 [lhs](dtype value) -> dtype { return std::fmod(lhs, value); });
1111 template<
typename dtype>
1127 template<
typename dtype>
1132 const auto function = [rhs](dtype& value) -> dtype {
return value |= rhs; };
1147 template<
typename dtype>
1152 return broadcast::broadcaster<dtype>(lhs, rhs, std::bit_or<dtype>());
1163 template<
typename dtype>
1178 template<
typename dtype>
1192 template<
typename dtype>
1208 template<
typename dtype>
1213 const auto function = [rhs](dtype& value) -> dtype {
return value &= rhs; };
1228 template<
typename dtype>
1233 return broadcast::broadcaster<dtype>(lhs, rhs, std::bit_and<dtype>());
1244 template<
typename dtype>
1259 template<
typename dtype>
1273 template<
typename dtype>
1289 template<
typename dtype>
1294 const auto function = [rhs](dtype& value) -> dtype {
return value ^= rhs; };
1309 template<
typename dtype>
1314 return broadcast::broadcaster<dtype>(lhs, rhs, std::bit_xor<dtype>());
1325 template<
typename dtype>
1340 template<
typename dtype>
1353 template<
typename dtype>
1358 const auto function = [](dtype value) -> dtype {
return ~value; };
1375 template<
typename dtype>
1380 const auto function = [](dtype value1, dtype value2) ->
bool
1383 return broadcast::broadcaster<bool>(lhs, rhs, function);
1394 template<
typename dtype>
1401 const auto function = [rhs](dtype value) ->
bool {
return value && rhs; };
1416 template<
typename dtype>
1430 template<
typename dtype>
1435 const auto function = [](dtype value1, dtype value2) ->
bool
1438 return broadcast::broadcaster<bool>(lhs, rhs, function);
1449 template<
typename dtype>
1456 const auto function = [rhs](dtype value) ->
bool {
return value || rhs; };
1471 template<
typename dtype>
1484 template<
typename dtype>
1491 const auto function = [](dtype value) -> dtype {
return !value; };
1507 template<
typename dtype>
1510 const auto equalTo = [](dtype lhs_, dtype rhs_)
noexcept ->
bool
1513 return broadcast::broadcaster<bool>(lhs, rhs, equalTo);
1525 template<
typename dtype>
1530 const auto equalTo = [inValue](dtype value)
noexcept ->
bool
1547 template<
typename dtype>
1550 return inArray == inValue;
1562 template<
typename dtype>
1565 const auto notEqualTo = [](dtype lhs_, dtype rhs_)
noexcept ->
bool
1568 return broadcast::broadcaster<bool>(lhs, rhs, notEqualTo);
1580 template<
typename dtype>
1585 const auto notEqualTo = [inValue](dtype value)
noexcept ->
bool
1602 template<
typename dtype>
1605 return inArray != inValue;
1617 template<
typename dtype>
1618 NdArray<bool>
operator<(
const NdArray<dtype>& lhs,
const NdArray<dtype>& rhs)
1622 const auto function = [](dtype lhs_, dtype rhs_)
noexcept ->
bool {
return lhs_ < rhs_; };
1623 return broadcast::broadcaster<bool>(lhs, rhs, function);
1635 template<
typename dtype>
1636 NdArray<bool>
operator<(
const NdArray<dtype>& lhs, dtype inValue)
1640 NdArray<bool> returnArray(lhs.shape());
1642 const auto function = [inValue](dtype value)
noexcept ->
bool {
return value < inValue; };
1658 template<
typename dtype>
1659 NdArray<bool>
operator<(dtype inValue,
const NdArray<dtype>& inArray)
1663 NdArray<bool> returnArray(inArray.shape());
1665 const auto function = [inValue](dtype value)
noexcept ->
bool {
return inValue < value; };
1681 template<
typename dtype>
1686 const auto function = [](dtype lhs_, dtype rhs_)
noexcept ->
bool {
return lhs_ > rhs_; };
1687 return broadcast::broadcaster<bool>(lhs, rhs, function);
1699 template<
typename dtype>
1706 const auto function = [inValue](dtype value)
noexcept ->
bool {
return value > inValue; };
1722 template<
typename dtype>
1729 const auto function = [inValue](dtype value)
noexcept ->
bool {
return inValue > value; };
1745 template<
typename dtype>
1746 NdArray<bool>
operator<=(
const NdArray<dtype>& lhs,
const NdArray<dtype>& rhs)
1750 const auto function = [](dtype lhs_, dtype rhs_)
noexcept ->
bool {
return lhs_ <= rhs_; };
1751 return broadcast::broadcaster<bool>(lhs, rhs, function);
1763 template<
typename dtype>
1764 NdArray<bool>
operator<=(
const NdArray<dtype>& lhs, dtype inValue)
1768 NdArray<bool> returnArray(lhs.shape());
1770 const auto function = [inValue](dtype value)
noexcept ->
bool {
return value <= inValue; };
1786 template<
typename dtype>
1787 NdArray<bool>
operator<=(dtype inValue,
const NdArray<dtype>& inArray)
1791 NdArray<bool> returnArray(inArray.shape());
1793 const auto function = [inValue](dtype value)
noexcept ->
bool {
return inValue <= value; };
1809 template<
typename dtype>
1814 const auto function = [](dtype lhs_, dtype rhs_)
noexcept ->
bool {
return lhs_ >= rhs_; };
1815 return broadcast::broadcaster<bool>(lhs, rhs, function);
1827 template<
typename dtype>
1834 const auto function = [inValue](dtype value)
noexcept ->
bool {
return value >= inValue; };
1850 template<
typename dtype>
1857 const auto function = [inValue](dtype value)
noexcept ->
bool {
return inValue >= value; };
1872 template<
typename dtype>
1877 const auto function = [inNumBits](dtype& value) ->
void { value <<= inNumBits; };
1892 template<
typename dtype>
1897 NdArray<dtype> returnArray(lhs);
1898 returnArray <<= inNumBits;
1910 template<
typename dtype>
1915 const auto function = [inNumBits](dtype& value) ->
void { value >>= inNumBits; };
1930 template<
typename dtype>
1936 returnArray >>= inNumBits;
1946 template<
typename dtype>
1951 const auto function = [](dtype& value) ->
void { ++value; };
1965 template<
typename dtype>
1979 template<
typename dtype>
1984 const auto function = [](dtype& value) ->
void { --value; };
1998 template<
typename dtype>
2014 template<
typename dtype>
2019 inOStream << inArray.
str();
#define STATIC_ASSERT_ARITHMETIC_OR_COMPLEX(dtype)
Definition: StaticAsserts.hpp:56
#define STATIC_ASSERT_INTEGER(dtype)
Definition: StaticAsserts.hpp:43
#define STATIC_ASSERT_ARITHMETIC(dtype)
Definition: StaticAsserts.hpp:39
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition: NdArrayCore.hpp:139
const_iterator cbegin() const noexcept
Definition: NdArrayCore.hpp:1365
iterator end() noexcept
Definition: NdArrayCore.hpp:1623
const Shape & shape() const noexcept
Definition: NdArrayCore.hpp:4511
const_iterator cend() const noexcept
Definition: NdArrayCore.hpp:1673
std::string str() const
Definition: NdArrayCore.hpp:4582
iterator begin() noexcept
Definition: NdArrayCore.hpp:1315
NdArray< dtypeIn1 > & broadcaster(NdArray< dtypeIn1 > &inArray1, const NdArray< dtypeIn2 > &inArray2, const Function &function, const AdditionalFunctionArgs &&... additionalFunctionArgs)
Definition: NdArrayBroadcast.hpp:52
OutputIt transform(InputIt first, InputIt last, OutputIt destination, UnaryOperation unaryFunction)
Definition: StlAlgorithms.hpp:775
void for_each(InputIt first, InputIt last, UnaryFunction f)
Definition: StlAlgorithms.hpp:225
bool essentiallyEqual(dtype inValue1, dtype inValue2) noexcept
Definition: essentiallyEqual.hpp:49
Definition: Cartesian.hpp:40
NdArray< dtype > & operator^=(NdArray< dtype > &lhs, const NdArray< dtype > &rhs)
Definition: NdArrayOperators.hpp:1274
bool operator==(const DateTime &lhs, const DateTime &rhs) noexcept
Equality operator for DateTime.
Definition: DateTime/DateTime.hpp:473
NdArray< dtype > & operator%=(NdArray< dtype > &lhs, const NdArray< dtype > &rhs)
Definition: NdArrayOperators.hpp:987
bool operator>=(const std::complex< T > &lhs, const std::complex< T > &rhs) noexcept
Definition: StdComplexOperators.hpp:98
Duration operator-(const DateTime &lhs, const DateTime &rhs) noexcept
Subtraction operator.
Definition: DateTime/DateTime.hpp:551
bool operator>(const std::complex< T > &lhs, const std::complex< T > &rhs) noexcept
Definition: StdComplexOperators.hpp:84
NdArray< dtype > operator%(const NdArray< dtype > &lhs, const NdArray< dtype > &rhs)
Definition: NdArrayOperators.hpp:1035
NdArray< dtype > operator/(const NdArray< dtype > &lhs, const NdArray< dtype > &rhs)
Definition: NdArrayOperators.hpp:819
NdArray< dtype > & operator*=(NdArray< dtype > &lhs, const NdArray< dtype > &rhs)
Definition: NdArrayOperators.hpp:530
NdArray< dtype > & operator++(NdArray< dtype > &rhs)
Definition: NdArrayOperators.hpp:1947
NdArray< dtype > & operator/=(NdArray< dtype > &lhs, const NdArray< dtype > &rhs)
Definition: NdArrayOperators.hpp:745
NdArray< dtype > & operator|=(NdArray< dtype > &lhs, const NdArray< dtype > &rhs)
Definition: NdArrayOperators.hpp:1112
NdArray< dtype > & operator--(NdArray< dtype > &rhs)
Definition: NdArrayOperators.hpp:1980
bool operator!=(const DateTime &lhs, const DateTime &rhs) noexcept
Non Equality operator for DateTime.
Definition: DateTime/DateTime.hpp:486
dtype fmod(dtype inValue1, dtype inValue2) noexcept
Definition: fmod.hpp:52
NdArray< bool > operator||(const NdArray< dtype > &lhs, const NdArray< dtype > &rhs)
Definition: NdArrayOperators.hpp:1431
bool operator<(const std::complex< T > &lhs, const std::complex< T > &rhs) noexcept
Definition: StdComplexOperators.hpp:46
NdArray< dtype > copy(const NdArray< dtype > &inArray)
Definition: copy.hpp:44
std::ostream & operator<<(std::ostream &os, Duration duration)
Output stream operator for the Duration type.
Definition: Clock.hpp:30
NdArrayConstIterator< dtype, PointerType, DifferenceType > operator+(typename NdArrayConstIterator< dtype, PointerType, DifferenceType >::difference_type offset, NdArrayConstIterator< dtype, PointerType, DifferenceType > next) noexcept
Definition: NdArrayIterators.hpp:302
NdArray< dtype > & operator>>=(NdArray< dtype > &lhs, uint8 inNumBits)
Definition: NdArrayOperators.hpp:1911
NdArray< dtype > operator^(const NdArray< dtype > &lhs, const NdArray< dtype > &rhs)
Definition: NdArrayOperators.hpp:1310
NdArray< dtype > & operator<<=(NdArray< dtype > &lhs, uint8 inNumBits)
Definition: NdArrayOperators.hpp:1873
NdArray< dtype > & operator+=(NdArray< dtype > &lhs, const NdArray< dtype > &rhs)
Definition: NdArrayOperators.hpp:57
NdArray< dtype > operator&(const NdArray< dtype > &lhs, const NdArray< dtype > &rhs)
Definition: NdArrayOperators.hpp:1229
std::uint8_t uint8
Definition: Types.hpp:42
bool operator<=(const std::complex< T > &lhs, const std::complex< T > &rhs) noexcept
Definition: StdComplexOperators.hpp:65
NdArray< dtype > operator|(const NdArray< dtype > &lhs, const NdArray< dtype > &rhs)
Definition: NdArrayOperators.hpp:1148
NdArray< bool > operator!(const NdArray< dtype > &inArray)
Definition: NdArrayOperators.hpp:1485
NdArray< dtype > operator>>(const NdArray< dtype > &lhs, uint8 inNumBits)
Definition: NdArrayOperators.hpp:1931
NdArray< dtype > & operator&=(NdArray< dtype > &lhs, const NdArray< dtype > &rhs)
Definition: NdArrayOperators.hpp:1193
NdArray< dtype > & operator-=(NdArray< dtype > &lhs, const NdArray< dtype > &rhs)
Definition: NdArrayOperators.hpp:272
NdArray< bool > operator&&(const NdArray< dtype > &lhs, const NdArray< dtype > &rhs)
Definition: NdArrayOperators.hpp:1376
NdArray< dtype > operator~(const NdArray< dtype > &inArray)
Definition: NdArrayOperators.hpp:1354
NdArray< dtype > operator*(const NdArray< dtype > &lhs, const NdArray< dtype > &rhs)
Definition: NdArrayOperators.hpp:604