dpilger26 / NumCpp

C++ implementation of the Python Numpy library
https://dpilger26.github.io/NumCpp
MIT License
3.51k stars 548 forks source link

Does NumCpp support broadcast? #174

Closed for-just-we closed 1 year ago

for-just-we commented 1 year ago

I did subtract operation between a vector1 with shape [2, 47] and vector2 with shape [1, 47]. The error message is:

Function: operator-
Line: 412
Error: Array dimensions do not match.libc++abi: terminating with uncaught exception of type std::invalid_argument: File: xxx/NumCpp/include/NumCpp/NdArray/NdArrayOperators.hpp
Function: operator-
Line: 412
Error: Array dimensions do not match.

It seems that NumCpp could not automatically transform vector2 into shape [2, 47]. How could I do this manually?

dpilger26 commented 1 year ago

No, at the moment the only broadcasting supported is scalar.

dpilger26 commented 1 year ago

Fixed in Release Version 2.10.0.