linearalgebra
Class LinearSystem
java.lang.Object
linearalgebra.LinearSystem
public class LinearSystem
- extends java.lang.Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
L
private NumericMatrixInterface L
a
private final NumericMatrixInterface a
x
private final UnknownValue[] x
b
private NumericColumnInterface b
c
private NumericColumnInterface c
m_partialPivot
private boolean m_partialPivot
UNSOLVED
private static final byte UNSOLVED
- See Also:
- Constant Field Values
SINGULAR
private static final byte SINGULAR
- See Also:
- Constant Field Values
INFINITE
private static final byte INFINITE
- See Also:
- Constant Field Values
ZEROSOLN
private static final byte ZEROSOLN
- See Also:
- Constant Field Values
m_solvableStatus
private byte m_solvableStatus
LinearSystem
public LinearSystem(NumericMatrixInterface m)
LinearSystem
public LinearSystem(NumericMatrixInterface m,
boolean partialPivot)
LinearSystem
public LinearSystem(NumericMatrixInterface m,
NumericColumnInterface b)
LinearSystem
public LinearSystem(NumericMatrixInterface m,
NumericColumnInterface b,
boolean partialPivot)
solve
public void solve()
getSolutionColumn
public NumericColumnInterface getSolutionColumn()
getRowLeftPivotIndex
public int getRowLeftPivotIndex(int row)
getUnknownValue
public double getUnknownValue(int row)
swapUnknowns
public void swapUnknowns(int row1,
int row2)
getUnknown
public UnknownValue getUnknown(int row)
swapUnknowns
public void swapUnknowns(PermutationMatrix p)
getUnknownDescription
public java.lang.String getUnknownDescription(int index)
getVariableName
private java.lang.String getVariableName(int index)
leftEliminate
public void leftEliminate()
swapRows
private void swapRows(int row1,
int row2)
rightEliminate
public void rightEliminate()
normalize
public void normalize()
throws SwapRowsException,
OnlyZeroRowsError
- Throws:
SwapRowsException
OnlyZeroRowsError
backSubstituteUpper
public void backSubstituteUpper()
backSubstituteLower
public void backSubstituteLower()
getEquationCount
public int getEquationCount()
multiplyRow
public void multiplyRow(int row,
double scalar)
normalizeRow
public void normalizeRow(int row)
throws SwapRowsException,
OnlyZeroRowsError
- Throws:
SwapRowsException
OnlyZeroRowsError
combineRows
public void combineRows(int srcRow,
int dstRow,
double scalar)
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
getVariableCount
public int getVariableCount()
getPivot
public double getPivot(int srcRow,
int dstRow)
throws SwapRowsException,
OnlyZeroRowsError
- Throws:
SwapRowsException
OnlyZeroRowsError
getPivotColumn
private int getPivotColumn(int row)
throws SwapRowsException,
OnlyZeroRowsError
- Throws:
SwapRowsException
OnlyZeroRowsError
getSolution
public java.lang.String getSolution(int row)
getUnknownConstraint
private LinearExpression getUnknownConstraint(int row,
int unknownColumn)
appendSign
private static double appendSign(double v,
java.lang.StringBuffer s)
rhs
private NumericColumnInterface rhs()
isNonsingular
public final boolean isNonsingular()
isUnderdetermined
public final boolean isUnderdetermined()
setSingular
private final void setSingular()
setUnderdeterminedUnknown
private final void setUnderdeterminedUnknown()
setInconsistentRow
private final void setInconsistentRow()
clearAllBindings
private void clearAllBindings()
isInconsistent
public final boolean isInconsistent()
getSolvableDescription
public java.lang.String getSolvableDescription()
getSymbolicEquation
public LinearEquation getSymbolicEquation(int rowIndex)
simplifyConstraints
public void simplifyConstraints()
getGeneralSolution
public GeneralSolution getGeneralSolution()
getRank
public int getRank()
setB
public void setB(NumericColumn b)
getLeastSquaresSolution
public NumericColumnInterface getLeastSquaresSolution()
getLeastSquaresProjection
public NumericColumnInterface getLeastSquaresProjection()
getLeastSquaresError
public double getLeastSquaresError()
getLeastSquaresSolutionForOrthonomolColumns
public NumericColumnInterface getLeastSquaresSolutionForOrthonomolColumns()
shiftOriginToZero
private void shiftOriginToZero()