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

Make as-vec work consistently on all matrix sizes #30

Open
mikera opened this issue May 27, 2013 · 0 comments
Open

Make as-vec work consistently on all matrix sizes #30

mikera opened this issue May 27, 2013 · 0 comments

Comments

@mikera
Copy link
Collaborator

mikera commented May 27, 2013

Currently the as-vec function behaves inconsistently:

  1. When given a normal mxn matrix, it converts to a vector of vectors, as expected
  2. When given a nx1 or 1xn matrix, it produces a flattened (1D) vector

The Clatrix behaviour is similar to that displayed by R, but this is widely regarded as a design flaw, see e.g.: http://radfordneal.wordpress.com/2008/08/20/design-flaws-in-r-2-%E2%80%94-dropped-dimensions/

This auto-flattening behaviour causes problems when writing any code that is designed to deal with arbitrary sized matrix, as it requires significant amounts of special-case code to be written. I believe it is also a root cause of some of the problems with recent builds of Incanter.

I propose that this should be fixed in the next major release of Clatrix, and the behaviour (1) adopted throughout. It may be a breaking change for some users.

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

1 participant