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

Projects
None yet
1 participant
@vkostyukov
Owner

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

This comment has been minimized.

Show comment
Hide comment
@vkostyukov

vkostyukov Jul 23, 2013

Owner

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.

Owner

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

This comment has been minimized.

Show comment
Hide comment
@vkostyukov

vkostyukov Aug 5, 2013

Owner

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

Owner

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