54 template<
typename dtype>
78 template<
typename dtype>
83 if (lhs.shape() != rhs.
shape())
88 const auto function = [](std::complex<dtype>& val1, dtype val2) -> std::complex<dtype>
94 rhs.
cbegin(), lhs.begin(),
function);
107 template<
typename dtype>
112 const auto function = [rhs](dtype& value) -> dtype
130 template<
typename dtype>
135 const auto function = [rhs](std::complex<dtype>& value) -> std::complex<dtype>
153 template<
typename dtype>
166 rhs.
cbegin(), returnArray.
begin(), std::plus<dtype>());
179 template<
typename dtype>
184 if (lhs.
shape() != rhs.shape())
189 const auto function = [](dtype val1,
const std::complex<dtype>& val2) -> std::complex<dtype>
197 rhs.cbegin(), returnArray.
begin(),
function);
210 template<
typename dtype>
224 template<
typename dtype>
229 const auto function = [rhs](dtype value) -> dtype
249 template<
typename dtype>
263 template<
typename dtype>
268 const auto function = [rhs](dtype value) -> std::complex<dtype>
288 template<
typename dtype>
302 template<
typename dtype>
307 const auto function = [rhs](std::complex<dtype> value) -> std::complex<dtype>
327 template<
typename dtype>
341 template<
typename dtype>
365 template<
typename dtype>
370 if (lhs.shape() != rhs.
shape())
375 const auto function = [](std::complex<dtype>& val1, dtype val2) -> std::complex<dtype>
381 rhs.
cbegin(), lhs.begin(),
function);
394 template<
typename dtype>
399 const auto function = [rhs](dtype& value) -> dtype
417 template<
typename dtype>
422 const auto function = [rhs](std::complex<dtype>& value) -> std::complex<dtype>
440 template<
typename dtype>
453 rhs.
cbegin(), returnArray.
begin(), std::minus<dtype>());
466 template<
typename dtype>
471 if (lhs.
shape() != rhs.shape())
476 const auto function = [](dtype val1,
const std::complex<dtype>& val2) -> std::complex<dtype>
484 rhs.cbegin(), returnArray.
begin(),
function);
497 template<
typename dtype>
502 if (lhs.shape() != rhs.
shape())
507 const auto function = [](
const std::complex<dtype>&val1, dtype val2) -> std::complex<dtype>
528 template<
typename dtype>
533 const auto function = [rhs](dtype value) -> dtype
553 template<
typename dtype>
558 const auto function = [lhs](dtype value) -> dtype
578 template<
typename dtype>
583 const auto function = [rhs](dtype value) -> std::complex<dtype>
603 template<
typename dtype>
608 const auto function = [lhs](dtype value) -> std::complex<dtype>
628 template<
typename dtype>
633 const auto function = [rhs](std::complex<dtype> value) -> std::complex<dtype>
653 template<
typename dtype>
658 const auto function = [lhs](std::complex<dtype> value) -> std::complex<dtype>
676 template<
typename dtype>
679 const auto function = [](dtype value) -> dtype
697 template<
typename dtype>
708 rhs.
cbegin(), lhs.
begin(), std::multiplies<dtype>());
721 template<
typename dtype>
726 if (lhs.shape() != rhs.
shape())
731 const auto function = [](std::complex<dtype>& val1, dtype val2) -> std::complex<dtype>
737 rhs.
cbegin(), lhs.begin(),
function);
750 template<
typename dtype>
755 const auto function = [rhs](dtype& value) -> dtype
773 template<
typename dtype>
778 const auto function = [rhs](std::complex<dtype>& value) -> std::complex<dtype>
796 template<
typename dtype>
809 rhs.
cbegin(), returnArray.
begin(), std::multiplies<dtype>());
822 template<
typename dtype>
827 if (lhs.
shape() != rhs.shape())
832 const auto function = [](dtype val1,
const std::complex<dtype>& val2) -> std::complex<dtype>
840 rhs.cbegin(), returnArray.
begin(),
function);
853 template<
typename dtype>
867 template<
typename dtype>
872 const auto function = [rhs](dtype value) -> dtype
892 template<
typename dtype>
906 template<
typename dtype>
911 const auto function = [rhs](dtype value) -> std::complex<dtype>
931 template<
typename dtype>
945 template<
typename dtype>
950 const auto function = [rhs](std::complex<dtype> value) -> std::complex<dtype>
970 template<
typename dtype>
984 template<
typename dtype>
1008 template<
typename dtype>
1013 if (lhs.shape() != rhs.
shape())
1018 const auto function = [](std::complex<dtype>& val1, dtype val2) -> std::complex<dtype>
1024 rhs.
cbegin(), lhs.begin(),
function);
1037 template<
typename dtype>
1042 const auto function = [rhs](dtype& value) -> dtype
1044 return value /= rhs;
1060 template<
typename dtype>
1065 const auto function = [rhs](std::complex<dtype>& value) -> std::complex<dtype>
1067 return value /= rhs;
1083 template<
typename dtype>
1096 rhs.
cbegin(), returnArray.
begin(), std::divides<dtype>());
1109 template<
typename dtype>
1114 if (lhs.
shape() != rhs.shape())
1121 const auto function = [](dtype val1,
const std::complex<dtype>& val2) -> std::complex<dtype>
1127 rhs.cbegin(), returnArray.
begin(),
function);
1140 template<
typename dtype>
1145 if (lhs.shape() != rhs.
shape())
1150 const auto function = [](
const std::complex<dtype>&val1, dtype val2) -> std::complex<dtype>
1171 template<
typename dtype>
1176 const auto function = [rhs](dtype value) -> dtype
1196 template<
typename dtype>
1201 const auto function = [lhs](dtype value) -> dtype
1221 template<
typename dtype>
1226 const auto function = [rhs](dtype value) -> std::complex<dtype>
1246 template<
typename dtype>
1251 const auto function = [lhs](dtype value) -> std::complex<dtype>
1271 template<
typename dtype>
1276 const auto function = [rhs](std::complex<dtype> value) -> std::complex<dtype>
1296 template<
typename dtype>
1301 const auto function = [lhs](std::complex<dtype> value) -> std::complex<dtype>
1321 template<
typename dtype,
1322 enable_if_t<std::is_integral<dtype>::value,
int> = 0>
1343 template<
typename dtype,
1344 enable_if_t<std::is_floating_point<dtype>::value,
int> = 0>
1345 NdArray<dtype>&
operator%=(NdArray<dtype>& lhs,
const NdArray<dtype>& rhs)
1347 if (lhs.shape() != rhs.shape())
1352 const auto function = [](
const dtype value1,
const dtype value2) -> dtype
1370 template<
typename dtype,
1371 enable_if_t<std::is_integral<dtype>::value,
int> = 0>
1374 const auto function = [rhs](dtype& value) -> dtype
1376 return value %= rhs;
1392 template<
typename dtype,
1393 enable_if_t<std::is_floating_point<dtype>::value,
int> = 0>
1394 NdArray<dtype>&
operator%=(NdArray<dtype>& lhs, dtype rhs)
1396 const auto function = [rhs](dtype& value) ->
void
1414 template<
typename dtype>
1430 template<
typename dtype>
1446 template<
typename dtype,
1447 enable_if_t<std::is_integral<dtype>::value,
int> = 0>
1452 [lhs](dtype value) -> dtype
1468 template<
typename dtype,
1469 enable_if_t<std::is_floating_point<dtype>::value,
int> = 0>
1470 NdArray<dtype>
operator%(dtype lhs,
const NdArray<dtype>& rhs)
1472 NdArray<dtype> returnArray(rhs.shape());
1474 [lhs](dtype value) -> dtype
1476 return std::fmod(lhs, value);
1490 template<
typename dtype>
1514 template<
typename dtype>
1519 const auto function = [rhs](dtype& value) -> dtype
1521 return value |= rhs;
1537 template<
typename dtype>
1553 template<
typename dtype>
1569 template<
typename dtype>
1583 template<
typename dtype>
1594 rhs.
cbegin(), lhs.
begin(), std::bit_and<dtype>());
1607 template<
typename dtype>
1612 const auto function = [rhs](dtype& value) -> dtype
1614 return value &= rhs;
1630 template<
typename dtype>
1646 template<
typename dtype>
1662 template<
typename dtype>
1676 template<
typename dtype>
1687 rhs.
cbegin(), lhs.
begin(), std::bit_xor<dtype>());
1700 template<
typename dtype>
1705 const auto function = [rhs](dtype& value) -> dtype
1707 return value ^= rhs;
1723 template<
typename dtype>
1739 template<
typename dtype>
1755 template<
typename dtype>
1768 template<
typename dtype>
1773 const auto function = [](dtype value) -> dtype
1781 returnArray.
begin(),
function);
1794 template<
typename dtype>
1804 const auto function = [](dtype value1, dtype value2) ->
bool
1806 return value1 && value2;
1824 template<
typename dtype>
1831 const auto function = [rhs](dtype value) ->
bool
1833 return value && rhs;
1837 returnArray.
begin(),
function);
1850 template<
typename dtype>
1864 template<
typename dtype>
1874 const auto function = [](dtype value1, dtype value2) ->
bool
1876 return value1 || value2;
1894 template<
typename dtype>
1901 const auto function = [rhs](dtype value) ->
bool
1903 return value || rhs;
1907 returnArray.
begin(),
function);
1920 template<
typename dtype>
1933 template<
typename dtype>
1940 const auto function = [](dtype value) -> dtype
1946 returnArray.
begin(),
function);
1960 template<
typename dtype>
1968 const auto equalTo = [](dtype lhs, dtype rhs) noexcept ->
bool
1990 template<
typename dtype>
1995 const auto equalTo = [inValue](dtype value) noexcept ->
bool
2001 returnArray.
begin(), equalTo);
2015 template<
typename dtype>
2018 return inArray == inValue;
2030 template<
typename dtype>
2038 const auto notEqualTo = [](dtype lhs, dtype rhs) noexcept ->
bool
2060 template<
typename dtype>
2065 const auto notEqualTo = [inValue](dtype value) noexcept ->
bool
2071 returnArray.
begin(), notEqualTo);
2085 template<
typename dtype>
2088 return inArray != inValue;
2100 template<
typename dtype>
2101 NdArray<bool>
operator<(
const NdArray<dtype>& lhs,
const NdArray<dtype>& rhs)
2105 if (lhs.shape() != rhs.shape())
2110 NdArray<bool> returnArray(lhs.shape());
2112 const auto function = [](dtype lhs, dtype rhs) noexcept ->
bool
2118 rhs.cbegin(), returnArray.begin(),
function);
2132 template<
typename dtype>
2133 NdArray<bool>
operator<(
const NdArray<dtype>& lhs, dtype inValue)
2137 NdArray<bool> returnArray(lhs.shape());
2139 const auto function = [inValue](dtype value) noexcept ->
bool
2141 return value < inValue;
2145 returnArray.begin(),
function);
2159 template<
typename dtype>
2160 NdArray<bool>
operator<(dtype inValue,
const NdArray<dtype>& inArray)
2164 NdArray<bool> returnArray(inArray.shape());
2166 const auto function = [inValue](dtype value) noexcept ->
bool
2168 return inValue < value;
2172 returnArray.begin(),
function);
2186 template<
typename dtype>
2198 const auto function = [](dtype lhs, dtype rhs) noexcept ->
bool
2221 template<
typename dtype>
2228 const auto function = [inValue](dtype value) noexcept ->
bool
2230 return value > inValue;
2234 returnArray.
begin(),
function);
2248 template<
typename dtype>
2255 const auto function = [inValue](dtype value) noexcept ->
bool
2257 return inValue > value;
2261 returnArray.
begin(),
function);
2275 template<
typename dtype>
2276 NdArray<bool>
operator<=(
const NdArray<dtype>& lhs,
const NdArray<dtype>& rhs)
2280 if (lhs.shape() != rhs.shape())
2285 NdArray<bool> returnArray(lhs.shape());
2287 const auto function = [](dtype lhs, dtype rhs) noexcept ->
bool
2293 rhs.cbegin(), returnArray.begin(),
function);
2307 template<
typename dtype>
2308 NdArray<bool>
operator<=(
const NdArray<dtype>& lhs, dtype inValue)
2312 NdArray<bool> returnArray(lhs.shape());
2314 const auto function = [inValue](dtype value) noexcept ->
bool
2316 return value <= inValue;
2320 returnArray.begin(),
function);
2334 template<
typename dtype>
2335 NdArray<bool>
operator<=(dtype inValue,
const NdArray<dtype>& inArray)
2339 NdArray<bool> returnArray(inArray.shape());
2341 const auto function = [inValue](dtype value) noexcept ->
bool
2343 return inValue <= value;
2347 returnArray.begin(),
function);
2361 template<
typename dtype>
2373 const auto function = [](dtype lhs, dtype rhs) noexcept ->
bool
2393 template<
typename dtype>
2400 const auto function = [inValue](dtype value) noexcept ->
bool
2402 return value >= inValue;
2406 returnArray.
begin(),
function);
2420 template<
typename dtype>
2427 const auto function = [inValue](dtype value) noexcept ->
bool
2429 return inValue >= value;
2433 returnArray.
begin(),
function);
2446 template<
typename dtype>
2451 const auto function = [inNumBits](dtype& value) ->
void
2453 value <<= inNumBits;
2469 template<
typename dtype>
2474 NdArray<dtype> returnArray(lhs);
2475 returnArray <<= inNumBits;
2487 template<
typename dtype>
2492 const auto function = [inNumBits](dtype& value) ->
void
2494 value >>= inNumBits;
2510 template<
typename dtype>
2516 returnArray >>= inNumBits;
2526 template<
typename dtype>
2531 const auto function = [](dtype& value) ->
void
2548 template<
typename dtype>
2562 template<
typename dtype>
2567 const auto function = [](dtype& value) ->
void
2584 template<
typename dtype>
2600 template<
typename dtype>
2605 inOStream << inArray.
str();
#define THROW_INVALID_ARGUMENT_ERROR(msg)
Definition: Error.hpp:36
#define STATIC_ASSERT_ARITHMETIC_OR_COMPLEX(dtype)
Definition: StaticAsserts.hpp:50
#define STATIC_ASSERT_INTEGER(dtype)
Definition: StaticAsserts.hpp:40
#define STATIC_ASSERT_ARITHMETIC(dtype)
Definition: StaticAsserts.hpp:37
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition: NdArrayCore.hpp:72
const_iterator cbegin() const noexcept
Definition: NdArrayCore.hpp:1216
iterator end() noexcept
Definition: NdArrayCore.hpp:1474
Shape shape() const noexcept
Definition: NdArrayCore.hpp:4283
const_iterator cend() const noexcept
Definition: NdArrayCore.hpp:1524
std::string str() const
Definition: NdArrayCore.hpp:4356
iterator begin() noexcept
Definition: NdArrayCore.hpp:1166
OutputIt transform(InputIt first, InputIt last, OutputIt destination, UnaryOperation unaryFunction)
Definition: StlAlgorithms.hpp:702
void for_each(InputIt first, InputIt last, UnaryFunction f)
Definition: StlAlgorithms.hpp:213
bool essentiallyEqual(dtype inValue1, dtype inValue2) noexcept
Definition: essentiallyEqual.hpp:52
Definition: Coordinate.hpp:45
NdArray< dtype > operator&(const NdArray< dtype > &lhs, const NdArray< dtype > &rhs)
Definition: NdArrayOperators.hpp:1631
NdArray< dtype > & operator%=(NdArray< dtype > &lhs, const NdArray< dtype > &rhs)
Definition: NdArrayOperators.hpp:1323
bool operator>=(const std::complex< T > &lhs, const std::complex< T > &rhs) noexcept
Definition: StdComplexOperators.hpp:97
bool operator>(const std::complex< T > &lhs, const std::complex< T > &rhs) noexcept
Definition: StdComplexOperators.hpp:83
NdArray< bool > operator||(const NdArray< dtype > &lhs, const NdArray< dtype > &rhs)
Definition: NdArrayOperators.hpp:1865
NdArray< bool > operator==(const NdArray< dtype > &lhs, const NdArray< dtype > &rhs)
Definition: NdArrayOperators.hpp:1961
NdArray< dtype > operator|(const NdArray< dtype > &lhs, const NdArray< dtype > &rhs)
Definition: NdArrayOperators.hpp:1538
NdArray< bool > operator!=(const NdArray< dtype > &lhs, const NdArray< dtype > &rhs)
Definition: NdArrayOperators.hpp:2031
NdArray< dtype > operator<<(const NdArray< dtype > &lhs, uint8 inNumBits)
Definition: NdArrayOperators.hpp:2470
NdArray< dtype > & operator+=(NdArray< dtype > &lhs, const NdArray< dtype > &rhs)
Definition: NdArrayOperators.hpp:55
NdArray< dtype > operator%(const NdArray< dtype > &lhs, const NdArray< dtype > &rhs)
Definition: NdArrayOperators.hpp:1415
NdArrayConstIterator< dtype, PointerType, DifferenceType > operator+(typename NdArrayConstIterator< dtype, PointerType, DifferenceType >::difference_type offset, NdArrayConstIterator< dtype, PointerType, DifferenceType > next) noexcept
Definition: NdArrayIterators.hpp:310
NdArray< bool > operator!(const NdArray< dtype > &inArray)
Definition: NdArrayOperators.hpp:1934
dtype fmod(dtype inValue1, dtype inValue2) noexcept
Definition: fmod.hpp:53
bool operator<(const std::complex< T > &lhs, const std::complex< T > &rhs) noexcept
Definition: StdComplexOperators.hpp:45
NdArray< dtype > & operator>>=(NdArray< dtype > &lhs, uint8 inNumBits)
Definition: NdArrayOperators.hpp:2488
NdArray< dtype > operator>>(const NdArray< dtype > &lhs, uint8 inNumBits)
Definition: NdArrayOperators.hpp:2511
NdArray< dtype > & operator-=(NdArray< dtype > &lhs, const NdArray< dtype > &rhs)
Definition: NdArrayOperators.hpp:342
NdArray< dtype > & operator^=(NdArray< dtype > &lhs, const NdArray< dtype > &rhs)
Definition: NdArrayOperators.hpp:1677
NdArray< dtype > operator*(const NdArray< dtype > &lhs, const NdArray< dtype > &rhs)
Definition: NdArrayOperators.hpp:797
NdArray< dtype > & operator|=(NdArray< dtype > &lhs, const NdArray< dtype > &rhs)
Definition: NdArrayOperators.hpp:1491
std::uint8_t uint8
Definition: Types.hpp:42
NdArray< dtype > copy(const NdArray< dtype > &inArray)
Definition: copy.hpp:44
NdArray< dtype > & operator<<=(NdArray< dtype > &lhs, uint8 inNumBits)
Definition: NdArrayOperators.hpp:2447
bool operator<=(const std::complex< T > &lhs, const std::complex< T > &rhs) noexcept
Definition: StdComplexOperators.hpp:64
NdArray< dtype > & operator--(NdArray< dtype > &rhs)
Definition: NdArrayOperators.hpp:2563
NdArray< bool > operator&&(const NdArray< dtype > &lhs, const NdArray< dtype > &rhs)
Definition: NdArrayOperators.hpp:1795
NdArray< dtype > operator-(const NdArray< dtype > &lhs, const NdArray< dtype > &rhs)
Definition: NdArrayOperators.hpp:441
NdArray< dtype > & operator++(NdArray< dtype > &rhs)
Definition: NdArrayOperators.hpp:2527
NdArray< dtype > operator/(const NdArray< dtype > &lhs, const NdArray< dtype > &rhs)
Definition: NdArrayOperators.hpp:1084
NdArray< dtype > & operator/=(NdArray< dtype > &lhs, const NdArray< dtype > &rhs)
Definition: NdArrayOperators.hpp:985
NdArray< dtype > operator^(const NdArray< dtype > &lhs, const NdArray< dtype > &rhs)
Definition: NdArrayOperators.hpp:1724
NdArray< dtype > operator~(const NdArray< dtype > &inArray)
Definition: NdArrayOperators.hpp:1769
NdArray< dtype > & operator&=(NdArray< dtype > &lhs, const NdArray< dtype > &rhs)
Definition: NdArrayOperators.hpp:1584
NdArray< dtype > & operator*=(NdArray< dtype > &lhs, const NdArray< dtype > &rhs)
Definition: NdArrayOperators.hpp:698