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

The la4j should use efficient way of performing operaions on sparse/dense entries #56

Closed
vkostyukov opened this issue Jul 2, 2013 · 2 comments

Comments

@vkostyukov
Copy link
Owner

@vkostyukov vkostyukov commented Jul 2, 2013

There are sparse entries in la4j, like CRSMatrix and CCSMatrix. So, it is not necessary to iterate through the all elements of these matrices while multiplying (for example). So, it would be great to develop proof-of-concept that will allow to hide details from developes and using the same API provide a more efficient way to perform basic operations.

In terms of matrix multiplying, it should be:

Matrix a = new CRSMatrix(...);
Matrix b = new Basic2DMatrix(...);

Matrix c = a.multiply(b);

Just an Idea: Probably, it would be the good idea to incapsulate all operations in special objects, which know the internal structure (or some other details) and generate such objects in matrices methods like multiply from two matrix operands.

I'm open for descussion.

@vkostyukov
Copy link
Owner Author

@vkostyukov vkostyukov commented Jul 23, 2013

It might be a good idea to create a separate class hierarchy for new concept: _The la4j Engine_. Like this:

  • interface org.la4j.engine.Engine
  • interface/class MatrixEngine
  • interface/class VectorEngine

And somehow submit tasks there. Like:

Matrix multiply(Matrix that) {
  return Matrices.ENGINE.execute(new MultiplyTask(this, that)); 
  // or simply return Matrices.execute();  
}

It defines the next step for la4j: parallel engine.

@vkostyukov
Copy link
Owner Author

@vkostyukov vkostyukov commented Aug 5, 2013

The straighforward solution would be provide pair of methods: par() and seq() for wrapping matrices with special eingine implementation.

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

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.