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

Matrices as a datatype #32

Open
jpolitz opened this issue Jun 13, 2013 · 8 comments
Open

Matrices as a datatype #32

jpolitz opened this issue Jun 13, 2013 · 8 comments

Comments

@jpolitz
Copy link
Member

jpolitz commented Jun 13, 2013

For graphics (e.g. seam-carving), pagerank-like algorithms, etc, it would be useful to have a matrix or spreadsheet-like datatype.

@blerner
Copy link
Member

blerner commented Jun 13, 2013

So would 1-d arrays...
Providing matrix operations as a built-in library would be quite
nice, and given that +/-/* all desugar to method calls you could
even get operator overloading for them. But writing that library can
be done easily in Pyret, once you have fast 1/2/n-dimensional array
accesses.On 6/13/2013 9:40 AM, Joe Politz wrote:

  For graphics (e.g. seam-carving), pagerank-like algorithms,
    etc, it would be useful to have a matrix or spreadsheet-like
    datatype.
  —
    Reply to this email directly or view
      it on GitHub.

@shriram
Copy link
Member

shriram commented Jun 13, 2013

Also useful for tasks like collaborative filtering (think Netflix
challenge).

Spreadsheets are slightly different from matrices, in that I'd like the
user to even be able to type the labels of the rows and columns, and can
perhaps even use them for addressing the elements. (But the spreadsheets
will not be reactive, ie, raw data, no formulas and other active content.)

@dbp
Copy link
Collaborator

dbp commented Jun 13, 2013

I'd vote for implementing matrices not with arrays, but rather
hashtables. In most real applications, matrices are both very big and very
sparse. Having memory usage proportional to the non-sparse entries vs the
whole domain is really nice. Phil Klein has pedagogical matrix/vector
implementations in python that are essentially dictionaries mapping tuples
to field elements (used in 53), and it works really well, because python
has the operator to method call desugaring.

But, we should still have arrays.

On Thu, Jun 13, 2013 at 11:03 AM, Shriram Krishnamurthi <
notifications@github.com> wrote:

Also useful for tasks like collaborative filtering (think Netflix
challenge).

Spreadsheets are slightly different from matrices, in that I'd like the
user to even be able to type the labels of the rows and columns, and can
perhaps even use them for addressing the elements. (But the spreadsheets
will not be reactive, ie, raw data, no formulas and other active content.)


Reply to this email directly or view it on GitHubhttps://github.com//issues/32#issuecomment-19397680
.

@blerner
Copy link
Member

blerner commented Jun 14, 2013

That sounds like it's arguing for traits, then, so you can have both
sparse and dense implementations that nevertheless expose Matrix
operations...  ;-)On 6/13/2013 7:05 PM, Daniel Patterson
  wrote:
I'd vote for implementing matrices _not_ with arrays,
  but rather

  hashtables. In most real applications, matrices are both very big
  and very

  sparse. Having memory usage proportional to the non-sparse entries
  vs the

  whole domain is really nice. Phil Klein has pedagogical
  matrix/vector

  implementations in python that are essentially dictionaries
  mapping tuples

  to field elements (used in 53), and it works really well, because
  python

  has the operator to method call desugaring.

  But, we should still have arrays.

  On Thu, Jun 13, 2013 at 11:03 AM, Shriram Krishnamurthi <
  notifications@github.com> wrote:

  > Also useful for tasks like collaborative filtering (think
  Netflix

  > challenge).

  >

  > Spreadsheets are slightly different from matrices, in that
  I'd like the

  > user to even be able to type the labels of the rows and
  columns, and can

  > perhaps even use them for addressing the elements. (But the
  spreadsheets

  > will not be reactive, ie, raw data, no formulas and other
  active content.)

  >

  > —

  > Reply to this email directly or view it on

GitHubhttps://github.com//issues/32#issuecomment-19397680
> .

  >
  —
    Reply to this email directly or view
      it on GitHub.

@schanzer
Copy link

schanzer commented Oct 7, 2016

For documentation's sake, there's an old PR for this: #688

@schanzer
Copy link

schanzer commented Nov 4, 2017

Now that we have tabular data, is this still something we want?

@blerner
Copy link
Member

blerner commented Nov 4, 2017

Matrices != tables. There's still a use for this as a library (and there's an initial, fairly complete implementation already), but we need to decide how we want the operators to behave in it and whether we want to use methods or functions, etc.

@shriram
Copy link
Member

shriram commented Nov 4, 2017

Echoing that matrices ≠ tables, so that's not a reason to close.

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