You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

IterativeLinearSolvers

It is not uncommon to have to solve (large) linear systems for which it is both expensive and unnecessary to explicitly define all coefficients of the underlying matrix.

In the present approach, the only requirement we make on the linear operator A is the ability to compute the matrix-vector product A.x (and possibly the product A'.x, where A' is the transpose of A).There are quite a few iterative solvers around for addressing such problems: conjugate gradient, SYMMLQ, to name but a few. This proposal aims at including these algorithms into commons-math. I have already implemented some of these algorithms, but I would like to have a discussion on the interface. Here are a few ideas.

The LinearMap interface

The linear operator A would be defined as implementing the interface LinearMap, which could look like this

public interface LinearMap extends AnyMatrix{
  public void apply(double[] x, double[] y);
  public void apply(RealVector x, RealVector y);
}

Comments

Since it extends AnyMatrix, a LinearMap must implement getColumnDimension() and getRowDimension(). There might be a conflict in terminology, since the whole point in LinearMap is to forget about the underlying matrix, and to focus on the linear operator. Maybe it would be better to define radically different functions, for example

getDomainDimension()
getCodomainDimension()
  • No labels