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

Docs should say that hi/lo accept nulls #23

Open
letmaik opened this issue Aug 24, 2015 · 7 comments
Open

Docs should say that hi/lo accept nulls #23

letmaik opened this issue Aug 24, 2015 · 7 comments

Comments

@letmaik
Copy link

letmaik commented Aug 24, 2015

Since lo()/hi() accept nulls this should be added to the Readme as it is quite convenient.

@rreusser
Copy link
Member

rreusser commented Jan 7, 2016

Can you elaborate on your use case? I've used it to just just slice an array in one particular dimension without specifying the bounds of the others.

@letmaik
Copy link
Author

letmaik commented Jan 7, 2016

Yes exactly, that's what I do as well, slicing across one or more dimensions and leaving others untouched (where I use null then instead of giving explicit full bounds).

@rreusser
Copy link
Member

rreusser commented Jan 7, 2016

See: https://github.com/scijs/ndarray-concat-rows/blob/master/index.js#L72

I'm updating the docs for another ticket so will add a note on this now.

@letmaik
Copy link
Author

letmaik commented Jan 7, 2016

What about the example? I don't see any null's.

Am 07.01.2016 um 21:49 schrieb Ricky Reusser:

See: https://github.com/scijs/ndarray-concat-rows/blob/master/index.js#L72

I'm updating the docs for another ticket so will add a note on this now.


Reply to this email directly or view it on GitHub
#23 (comment).

@rreusser
Copy link
Member

rreusser commented Jan 7, 2016

Ah, sorry. Yeah, seemed (unless I'm wrong) that as long as it's undefined or null (omitted as an argument = undefined), lo doesn't increase the lower bound and hi doesn't decrease the upper bound in the unspecified dimensions.

@rreusser
Copy link
Member

rreusser commented Jan 7, 2016

In other words, I used that to grab a section of the ndarray along the first dimension only by leaving the others implicitly unspecified. Concatenating cols was a little more complicated because I had to construct the array of indices explicitly.

(Side note: I'm realizing as I clean some of this up that really more and more of the code should use dynamic code generation to keep this generic n-dimensional programming from actually having to operate in an abstract number of dimensions. With code generation, you just generate the code for the actual number of dimensions for the given input…)

But anyway, AFAIK, either null or implicitly undefined both works.

@letmaik
Copy link
Author

letmaik commented Jan 7, 2016

Right, ok.

About dynamic code generation, as long as it actually has a measureable performance benefit and the code is used enough times that it matters I'm all for it.

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

No branches or pull requests

2 participants