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

URGENT: MatrixProduct.scala is missing Matrix * col and row * Matrix #248

Closed
johnynek opened this issue Dec 13, 2012 · 4 comments · Fixed by #249
Closed

URGENT: MatrixProduct.scala is missing Matrix * col and row * Matrix #248

johnynek opened this issue Dec 13, 2012 · 4 comments · Fixed by #249

Comments

@johnynek
Copy link
Collaborator

WTF?

Someone should quickly add something like:

mat * (col.toMatrix(true)).getCol(true)

((row.toMatrix(true)) * mat).getRow(true)

That should be in before the next release. A fancier algorithm could possibly improve this when the vectors are really small.

@ccsevers
Copy link
Contributor

I started on this earlier today, should have something once I get out of meetings.

@joshdevins
Copy link
Contributor

Glad I mentioned something on the mailing list ;) @ccsevers do you have a repo/branch I can clone?

@ccsevers
Copy link
Contributor

I put up a new branch in my fork called vector_implicits. Let me write a couple tests and I'll open a pull request.

I added row_Mat, Mat_col, vec+vec, vec-vec, vec hProd vec and col * row (outer product, dangerous).

@johnynek
Copy link
Collaborator Author

Sweet, Chris.

Outer-product is interesting. One idea I had for outer-product was to make a separate class for it, and not actually materialize the result. Since:
|v><u| * |w><x| = <u|w>* |v><x|, and similarly with multiplying by matrices, you can avoid the materialization for a long time.

We can add outer-product now (people should just be careful), but it might be interesting to think of these algebraic optimizations that a Matrix aware scheduler can do.

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

Successfully merging a pull request may close this issue.

3 participants