|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.jhu.cs.cisst.algorithms.optimize.fmg.pde.CachingPDE
public abstract class CachingPDE
An abstract class that has the same public interface as class PDE but adds caching for improved performance of classes that dervie from it.
Caching is supported for the right hand side (source term) f and for a representation of the matrix A which is allmost always needed by the methods evaluateLHS() and evaluate().
Constructor Summary | |
---|---|
CachingPDE()
|
Method Summary | |
---|---|
protected abstract java.lang.Object |
actuallySampleMatrix(int sx,
int sy,
int sz,
int level)
sample the matrix A in a way that it can later be used by methods evaluate() and evaluateLHS() on a grid of the given size. |
protected abstract NoBoundaryGrid |
actuallySampleRHS(int sx,
int sy,
int sz,
int level)
sample the right hand side f on a cubic grid of the given size. |
protected java.lang.Object |
sampleMatrix(int sx,
int sy,
int sz,
int level)
a caching frontend to calculating a representation of the matrix A of the PDE for a specific grid size. |
NoBoundaryGrid |
sampleRHS(int sx,
int sy,
int sz,
int level)
implements method from PDE. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface edu.jhu.cs.cisst.algorithms.optimize.fmg.pde.PDE |
---|
evaluate, evaluateLHS, getGridSpacing, solve |
Constructor Detail |
---|
public CachingPDE()
Method Detail |
---|
public NoBoundaryGrid sampleRHS(int sx, int sy, int sz, int level)
Sampling the right hand side f of a PDE for a given grid size (as this method does) is usually a time-consuming task. This implementation improves performance for those cases where sampleRHS() is called more than once for a specific grid size because it caches the right hand side (source term) f for every grid size. This may lead to space inefficiencies in general but not in the context of the (Full) Multigrid algorithm, where the right hand side is needed at all grid levels over and over again.
The actual calculation of the right hand side f is re-routed to method actuallySampleRHS().
sampleRHS
in interface PDE
sx
- the sxsy
- the sysz
- the szlevel
- the level
actuallySampleRHS(int, int, int, int)
,
PDE.sampleRHS(int, int, int, int)
protected abstract NoBoundaryGrid actuallySampleRHS(int sx, int sy, int sz, int level)
It is not necessary to know the value of f at the boundary of the grid, so the return type of this method is of type NoBoundaryGrid. But note that the size of the grid passed to this method includes (as always) the boundary. E.g., a 65x65x65 grid would be described by a size of 65 and its interior values (the one to be set by this method) would comprise the grid elements (1,1,1) to (63,63,63). The boundary elements (where at least one index is either 0 or 64) are non-existent in a NoBoundaryGrid.
sx
- the sxsy
- the sysz
- the szlevel
- the level
protected java.lang.Object sampleMatrix(int sx, int sy, int sz, int level)
Methods evaluateLHS() and evaluate() are supposed to call this method if they need a representation of the matrix A for doing their job for a grid of a certain size.
The actual calculation of the representation of the matrix A is re-routed to method actuallySampleMatrix().
sx
- the sxsy
- the sysz
- the szlevel
- the level
actuallySampleMatrix(int, int, int, int)
protected abstract java.lang.Object actuallySampleMatrix(int sx, int sy, int sz, int level)
The implementer of this method is entirely free in choosing any suitable representation for the matrix A as long as the methods evaluate() and evaluateLHS() are able to fulfill their job when passed the output of this method later in the course of the execution of the FMG algorithm.
sx
- the sxsy
- the sysz
- the szlevel
- the level
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |