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

Terminology: use 'array' for general case, 'matrix' only for 2D arrays? #18

Closed
mjwillson opened this issue Jan 24, 2013 · 4 comments
Closed
Assignees

Comments

@mjwillson
Copy link
Collaborator

Hi all

So I'm a bit confused at present looking at PImplementation and PDimensionInfo. They're addressing the general NDArray case (great!), but are using the term "matrix" not just for a (2D) matrix, but also for vectors and for general ND arrays.

I suggest we follow tradition in referring to the general case as an 'array' (equally happy with 'ndarray' as in numpy, 'tensor' as in matlab, or similar), and use 'matrix' only for the 2D case. I've just never heard anyone refer to a non-2-dimensional array as a matrix.

Also the "matrix" terminology adds extra unnecessary confusion around the distinction between a 1D array, and a 2D matrix whose shape is 1xN (row matrix?) or Nx1 (column matrix?).

I'd like to suggest that referring to a 'row vector' or 'column vector' is a bad idea because of the potential for confusion about what it means (a 1D vector, or a 2D matrix whose shape is 1xN or Nx1 ?). For reasons discussed on the mailing list, in a general NDArray framework it's preferable not to have special cases for 1D arrays identifying them with 2D matrices, just use a consistent broadcasting rule for all array shapes. A 1D array doesn't really have any natural orientation as a row or a column in a matrix context, at least not unless the chosen broadcasting rule makes it so.

Suggest using just 'vector' for the first case, and 'column matrix' or 'row matrix' for the latter, to make this more explicit.

Happy to put a patch together if people agree.

@mikera
Copy link
Owner

mikera commented Jan 25, 2013

I agree.

Just a couple of caveats:

  • We should be careful about using array in situations where it might be confused with Java arrays. nd-array is probably better in such cases.
  • I still like "core.matrix" as the overall name (it's the common use case, it's less likely to cause confusion comparered to "core.array" and it's also much cooler....)

@ghost ghost assigned mjwillson Jan 25, 2013
@mjwillson
Copy link
Collaborator Author

Agreed re confusion with java arrays.
Perhaps easiest to use nd-array everywhere in the API then, or were you proposing to abbreviate it to array in certain non-confusing situations?

@mikera
Copy link
Owner

mikera commented Jan 26, 2013

array is a better word.

I think we should use array wherever we can. Just be ready to prefix it with ND where it is necessary to avoid confusion. This probably applies to docstrings mostly, but might also make sense in some API names (like an NDArray record type, for example).

@mikera
Copy link
Owner

mikera commented Feb 18, 2013

Closed as I think the terminiology has now been updated in relevant places.

@mikera mikera closed this as completed Feb 18, 2013
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

2 participants