Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support broadcasting for additions and multiplications #1

Open
nicolaspanel opened this issue Feb 15, 2016 · 10 comments
Open

Support broadcasting for additions and multiplications #1

nicolaspanel opened this issue Feb 15, 2016 · 10 comments

Comments

@nicolaspanel
Copy link
Owner

see numpy doc for more info

@SimonBiggs
Copy link

This would be amazing. Is it in on the horizon at all?

@nicolaspanel
Copy link
Owner Author

Hi @SimonBiggs
It is definitely on the horizon but I am very busy right now so I can't spend time on this feature.
Let me know if you want to contribute
Best regards

@SimonBiggs
Copy link

Completely understandable :). At the moment I'm just trying to work out if I should go down the boost + emscripten path with C++ or if I can use typescript alone. I'm thinking I should just bite the bullet and dive into C++ and emscripten with boost for my numerical work for now.

@nicolaspanel
Copy link
Owner Author

@SimonBiggs : did C++ and emscripten with boost worked well ? BR

@SimonBiggs
Copy link

In the end I decided that for the time being it was just best to use a server. I decided to use Google App engine. The underlying module I've written needs more validation and testing anyway. I really should focus on that before I make a front end interface. Front end interfaces tend to draw people who trust me too much.

It's getting there, but I think with respect to emscripten I might just wait 12 months and we just might have a Fortran web assembly compiler. That just may solve many numerical needs within the browser.

@Spiruel
Copy link

Spiruel commented Jul 21, 2017

If I have a 2d array and wish to subtract a scalar value from it - in what way can this be carried out in numjs without broadcasting as a feature? Thanks.

@nicolaspanel
Copy link
Owner Author

@Spiruel tank a look to https://github.com/nicolaspanel/numjs/blob/master/README.md#basic-operations (especially subtract method)

@caph1993
Copy link

Hi @SimonBiggs It is definitely on the horizon but I am very busy right now so I can't spend time on this feature. Let me know if you want to contribute Best regards

Hi, I'd like to work on this. I am the author of this library: https://github.com/caph1993/numpy-js/tree/main. My library supports broadcasting already, and just like this library, it works internally with a single flat array, so the code adaptation shouldn't be too difficult.

@caph1993
Copy link

caph1993 commented Apr 7, 2024

The numjs library uses ndarray-ops, which uses cwise, and cwise does not support broadcast (issue). So, unless this feature is added at the core of cwise, one temporary hack would be to reshape the arrays, prepending size 1 in the shortest, then manually concatenating copies of the arrays along every axis that is subject to broadcasting, and finally operating them.

But this would require resolving this issue first : #104

@kgryte
Copy link

kgryte commented Apr 8, 2024

@caph1993 Given your recent efforts, you may also be interested in @stdlib/ndarray and helping out there. Similar to what you describe, stdlib supports similar broadcasting semantics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants