commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sébastien Brisard (Commented) (JIRA) <>
Subject [jira] [Commented] (MATH-761) Improve encapsulation of data in the nested classes of SymmLQ
Date Fri, 23 Mar 2012 19:53:27 GMT


Sébastien Brisard commented on MATH-761:

As of {{r1303674}}, the last breach in data encapsulation is the reference to an instance
of {{SymmLQ.State}} that {{SymmLQ.SymmLQEvent}} keeps. The rationale for this is the ability
to call {{SymmLQ.State.moveToCG(RealVector)}} from within {{SymmLQ.SymmLQEvent}}. Indeed,
throughout the iterations, the SYMMLQ algorithm does not evaluate the current estimate of
the solution to the linear system. After the iterations have converged, a final refinement
is performed to get the solution. However, the current estimate of the solution *should* be
accessible from the events fired by {{SymmLQ}}. In order to spare some CPU time, this estimate
is lazily initialized when {{SymmLQ.SymmLQEvent.getSolution()}} is called. This leads to rather
unwanted sharing of data between different classes.

Monitoring shows that the gain provided by this lazy initialization is in fact negligible
for decently large linear systems. It is therefore decided that the refinement of the solution
should be evaluated *at each iteration* in the main loop of the SYMMLQ algo, rather than on
demand in the {{SymmLQEvent}}. This allows better data encapsulation in {{SymmLQ.State}}.
More precisely, all vector updates occur *explicitely* instead of transparently (through the
use of references). Also, {{SymmLQEvent}} can be completely removed, and replaced with {{DefaultIterativeLinearSolverEvent}}.

All these changes are performed in {{r1304574}}.
> Improve encapsulation of data in the nested classes of SymmLQ
> -------------------------------------------------------------
>                 Key: MATH-761
>                 URL:
>             Project: Commons Math
>          Issue Type: Improvement
>    Affects Versions: 3.1
>            Reporter: Sébastien Brisard
>            Assignee: Sébastien Brisard
>              Labels: linear
> In order to limit object creation, the current implementation of the {{SymmLQ}} solver
makes heavy use of references accross nested classes in {{SymmLQ}}. This makes the code difficult
to read, and should be modified, keeping the public API.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message