gausselim
Class GaussElimModel

java.lang.Object
  extended by gausselim.GaussElimModel

public class GaussElimModel
extends java.lang.Object

Gaussian elimination for solving systems of linear equations.

Author:
Steven Van Impe (steven.vanimpe@ugent.be)

Constructor Summary
GaussElimModel(int order, java.math.MathContext mc)
          Create a new model for Gaussian elimination.
 
Method Summary
 void addChangeListener(javax.swing.event.ChangeListener l)
          Add a ChangeListener.
 void fireStateChanged(javax.swing.event.ChangeEvent e)
          Notify all ChangeListeners.
 java.math.BigDecimal getA(int row, int column)
           
 java.math.BigDecimal getB(int row)
           
 ExampleSystem getExampleSystem()
           
 java.math.BigDecimal getL(int row, int column)
           
 java.math.MathContext getMathContext()
           
 int getOrder()
           
 PivotingMethod getPivotingMethod()
           
 java.lang.String getStatus()
           
 int getStep()
           
 java.math.BigDecimal getX(int row)
           
 void initialize(java.math.BigDecimal[][] a, java.math.BigDecimal[] b)
          Initialize the system with the specified input matrices.
 boolean isSolved()
           
 void removeChangeListener(javax.swing.event.ChangeListener l)
          Remove a ChangeListener.
 void reset()
          Reset the system.
 void setA(int row, int column, java.math.BigDecimal value)
          Assign a new value to A(row, column).
 void setB(int row, java.math.BigDecimal value)
          Assign a new value to b(row).
 void setExampleSystem(ExampleSystem es)
          Assign a new ExampleSystem to the system.
 void setMathContext(java.math.MathContext mc)
          Assign a new MathContext to the system.
 void setOrder(int order)
          Assign a new order (>= 2) to the system.
 void setPivotingMethod(PivotingMethod pm)
          Assign a new PivotingMethod to the system.
 void solve()
          Solve the system using backwards substitution.
 void step()
          Perform a single elimination step.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GaussElimModel

public GaussElimModel(int order,
                      java.math.MathContext mc)
Create a new model for Gaussian elimination.

Method Detail

reset

public void reset()
Reset the system.


initialize

public void initialize(java.math.BigDecimal[][] a,
                       java.math.BigDecimal[] b)
Initialize the system with the specified input matrices. This is only allowed at step 1.


getA

public java.math.BigDecimal getA(int row,
                                 int column)
Returns:
A(row, column)

getL

public java.math.BigDecimal getL(int row,
                                 int column)
Returns:
L(row, column)

setA

public void setA(int row,
                 int column,
                 java.math.BigDecimal value)
Assign a new value to A(row, column). This is only allowed at step 1.


getB

public java.math.BigDecimal getB(int row)
Returns:
b(row)

setB

public void setB(int row,
                 java.math.BigDecimal value)
Assign a new value to b(row). This is only allowed at step 1.


getX

public java.math.BigDecimal getX(int row)
Returns:
x(row)

getOrder

public int getOrder()
Returns:
the order of the system

setOrder

public void setOrder(int order)
Assign a new order (>= 2) to the system. This will cause the system to reset.


getStep

public int getStep()
Returns:
the current step in the elimination process

isSolved

public boolean isSolved()
Returns:
whether the solution has been calculated

getStatus

public java.lang.String getStatus()
Returns:
the status of the system

getMathContext

public java.math.MathContext getMathContext()
Returns:
the current MathContext being used

setMathContext

public void setMathContext(java.math.MathContext mc)
Assign a new MathContext to the system. This will cause the system to reset. In case of a null value, the default MathContext.DECIMAL64 is used.


getExampleSystem

public ExampleSystem getExampleSystem()
Returns:
the current ExampleSystem being used

setExampleSystem

public void setExampleSystem(ExampleSystem es)
Assign a new ExampleSystem to the system. This will cause the system to reset. In case of a null value, the default ZeroSystem is used.


getPivotingMethod

public PivotingMethod getPivotingMethod()
Returns:
the current PivotingMethod being used

setPivotingMethod

public void setPivotingMethod(PivotingMethod pm)
Assign a new PivotingMethod to the system. In case of a null value, the default NoPivoting is used.


step

public void step()
Perform a single elimination step.


solve

public void solve()
Solve the system using backwards substitution.


addChangeListener

public void addChangeListener(javax.swing.event.ChangeListener l)
Add a ChangeListener.


removeChangeListener

public void removeChangeListener(javax.swing.event.ChangeListener l)
Remove a ChangeListener.


fireStateChanged

public void fireStateChanged(javax.swing.event.ChangeEvent e)
Notify all ChangeListeners.