|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcz.cuni.jagrlib.DefaultProperty
cz.cuni.jagrlib.Piece
cz.cuni.jagrlib.piece.SLERelaxation
public class SLERelaxation
SLE solver - various relaxation methods. Gauss-Seidel and Southwell iterations (with optional over-relaxation) are implemented so far.
Nested Class Summary | |
---|---|
static class |
SLERelaxation.Methods
Supported methods. |
Field Summary | |
---|---|
protected double[] |
B
Actual vector of unknown variables. |
protected static java.lang.String |
CATEGORY
Object category. |
protected SLEData |
data
Accelerator: input SLEData. |
protected double |
epsilon
Required solution accuracy (max. norm of residual vector). |
static java.lang.String |
EPSILON
|
protected int |
i
Index of the next unknown to be relaxed (for ordinal methods). |
protected boolean |
isInitialized
Was the solver already initialized? |
protected double[] |
K
Actual matrix column. |
protected int |
N
Number of unknowns. |
protected double |
omega
Over-relaxation factor. |
protected double[] |
r
Residual vector. |
protected double[] |
r2
Second residual vector for Jacobi method (used for new solution generation). |
static RegPiece |
reg
Static registration instance for this class. |
protected int |
steps
Number of performed iteration steps. |
protected static java.lang.String |
TEMPLATE_NAME
Object template identifier. |
static java.lang.String |
USED_METHOD
|
protected SLERelaxation.Methods |
usedMethod
Actual sub-method. |
Fields inherited from class cz.cuni.jagrlib.Piece |
---|
channels, info, pl, plugs, TEMPLATE_TYPE, userBreak |
Fields inherited from interface cz.cuni.jagrlib.iface.SLESolver |
---|
OMEGA, STEPS, TOTAL_RESIDUAL |
Fields inherited from interface cz.cuni.jagrlib.iface.Property |
---|
LOGGING, STATISTICS, TEXT_DESCRIPTION |
Constructor Summary | |
---|---|
SLERelaxation()
|
Method Summary | |
---|---|
int |
actualComponent()
Get actual component number. |
java.lang.Object |
get(java.lang.String key)
Gets the given property. |
double[] |
getSolution(double[] result)
Reads the whole solution vector. |
double |
getSolution(int col)
Reads a single unknown (element of solution vector). |
protected double |
getTotalResidual()
|
double |
refine(int maxIterations,
boolean save)
Refine the solution performing several iterations. |
void |
reset()
Reset the solver (if applicable). |
void |
set(java.lang.String key,
java.lang.Object value)
Sets the given property. |
void |
setComponent(int c)
Set actual component (non-mandatory). |
double |
setEpsilon(double epsilon)
Sets solver accuracy (whatever it means). |
static int |
setTemplate(Template t,
int ord)
General-purpose registration routine. |
void |
solve(boolean save)
Solve the whole system en bloc. |
protected double |
solve(int maxIterations,
boolean save)
Performs the given number of iteration steps. |
void |
update()
Input data was changed, solver should adapt to it. |
Methods inherited from class cz.cuni.jagrlib.Piece |
---|
className, connect, findPlug, findPlug, getInfo, getInterface, getInterface, getPlug, getReg, init, isCompatible, isCompatible, isConnected, logError, logWarning, myInterface, newInputPlug, newOptOutputPlug, newOutputPlug, newPlug, noTemplates, propBegin, propBounds, propDefault, propEnd, propEnum, propManipulator, propManipulator, setProgressListener, setRegStrings, setTemplateDynamic, stop |
Methods inherited from class cz.cuni.jagrlib.DefaultProperty |
---|
booleanProperty, booleanProperty, colorDoubleProperty, colorProperty, commit, doubleProperty, doubleProperty, doubleProperty, enumProperty, floatProperty, floatProperty, floatProperty, intProperty, intProperty, intProperty, longProperty, longProperty, longProperty, set, stringProperty |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface cz.cuni.jagrlib.iface.Property |
---|
commit |
Field Detail |
---|
protected SLEData data
protected SLERelaxation.Methods usedMethod
protected double epsilon
protected double omega
1.0
for plain relaxation.
protected int i
protected int steps
protected int N
protected double[] B
protected double[] K
protected double[] r
protected double[] r2
protected boolean isInitialized
public static final java.lang.String USED_METHOD
public static final java.lang.String EPSILON
protected static final java.lang.String TEMPLATE_NAME
protected static final java.lang.String CATEGORY
public static final RegPiece reg
Constructor Detail |
---|
public SLERelaxation()
Method Detail |
---|
public double setEpsilon(double epsilon)
setEpsilon
in interface SLESolver
public void solve(boolean save)
solve
in interface SLESolver
save
- Solution will be saved into the associated SLEData
.public void reset()
reset
in interface SLESolver
public double refine(int maxIterations, boolean save)
refine
in interface SLESolver
maxIterations
- Number of iterations requested.save
- Solution will be saved into the associated SLEData
.
public void update()
solve(boolean)
or refine(int, boolean)
will be called afterwards..
update
in interface SLESolver
public double getSolution(int col)
getSolution
in interface SLESolver
public double[] getSolution(double[] result)
getSolution
in interface SLESolver
public int actualComponent()
actualComponent
in interface SLESolver
public void setComponent(int c)
setComponent
in interface SLESolver
protected double solve(int maxIterations, boolean save)
maxIterations
- Maximal number of iterations.save
- Solution will be saved into the associated SLEData
.
protected double getTotalResidual()
public void set(java.lang.String key, java.lang.Object value)
set
in interface Property
set
in class DefaultProperty
key
- Key string.value
- The new value.Property.commit()
public java.lang.Object get(java.lang.String key)
get
in interface Property
get
in class DefaultProperty
key
- Key string.
null
.public static int setTemplate(Template t, int ord)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |