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

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

Projects

None yet

1 participant

@vkostyukov
Owner

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
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.

@vkostyukov
Owner

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

@vkostyukov vkostyukov added the duplicate label Dec 7, 2014
@vkostyukov vkostyukov closed this Dec 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment