-
Notifications
You must be signed in to change notification settings - Fork 109
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
Use pipeTo instead of with? #179
Labels
Milestone
Comments
An example of usage: Matrix a = ...
Matrix b = a.pipeTo(LinearAlgebra.GAUSS_JORDAN).invert(); |
Matrix a = ...
// GAUSS_JORDAN is no longe a factory in an operation from Matrix to MatrixInverter
MatrixInverter = a.pipeTo(LinearAlgebra.GAUSS_JORDAN);
// A typical use-case
Matrix b = a.pipeTo(LinearAlgebra.GAUSS_JORDAN).invert();
// Or in-place:
Matrix b = a.pipeTo(LinearAlgebra.GAUSS_JORDAN).invertInPlace();
// Or do it in a single line
Matrix b = a.pipeAndApplyTo(LinearAlgebra.GAUSS_JORDAN);
// Or in-place
Matrix b = a.pipeAndApplyInPlaceTo(LinearAlgebra.GAUSS_JORDAN); |
Everything is an operation: Iverter, Decompisitor, LinearSolver. And |
Just curring: // we didn't pass vector to a MatrixVectorOration, so it returned a curried operation;
// we still have troubles here since we want to cache the LU between calls to solver.apply().
VectorOperation<Vector> solver = a.pipeTo(LinearAlgebra.FORWARD_BACK_SUBST);
solver.apply(Vector); // we might want to pass a factory
Matrix b = a.pipeTo(LinearAlgebra.GAUSS_JORDAN);
// GAUSS_JORDAN is an operation factory |
A matrix-operation-factory concept MatrixOperationFactory<T> {
MatrixOperation<T> apply(Factory factory)
} |
In a base class: public <T> pipeTo<T>(MatrixOperationFactory<T> operation) {
return pipeTo(operation.apply(factory))
} |
The overall picture for decomposers should looks like: Matrix lup[] = a.pipeTo(LinearAlgebra.LU); |
This was referenced Dec 5, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm thinking of using
pipeTo
method name istead ofwithSolver
,withDecompositor
,withInverter
:The text was updated successfully, but these errors were encountered: