public abstract class AbstractSparseEqnDoubleImpl extends AbstractSparseEquation<ISparseEqnSolver> implements ISparseEqnDouble
ISparseEquation.IndexType| Modifier and Type | Field and Description |
|---|---|
protected DoubleSEqnRow[] |
aryAii |
colCnt, factored, rowCnt, solver, squareMatrix, zeroAii_row| Constructor and Description |
|---|
AbstractSparseEqnDoubleImpl(int n) |
AbstractSparseEqnDoubleImpl(int rows,
int cols) |
| Modifier and Type | Method and Description |
|---|---|
void |
addToAij(double x,
int i,
int j)
Add the aij element to the matrix.
|
void |
addToBi(double bi,
int i)
Set bi element.
|
double |
err(double[] x) |
boolean |
factorization()
Decomposition of the matrix.
|
boolean |
factorization(double tolerance)
Decomposition of the matrix.
|
double |
getAij(int i,
int j)
Get the aij element.
|
java.lang.String |
getBusId(int row)
get cached bus id by the row number
|
DoubleSEqnRow |
getElem(int i) |
int |
getTotalElements()
Get the total elements in the matrix
|
double |
getXi(int i)
Get the bi element.
|
double[] |
getXVector()
Get the b/x vector
|
void |
increaseDimension()
Increase matrix dimension by 1.
|
void |
reset()
Reset the matrix to zero - set all aii and bi to 0.0 and clear the aijList
|
void |
setAij(double x,
int i,
int j)
Set the aij element.
|
void |
setB2Unity(int i)
Set all b elements to 0.0 and bi = 1.0, a unit vector.
|
void |
setB2Zero()
Set all b elements to 0.0 and bi = 1.0, a unit vector.
|
void |
setBi(double bi,
int i)
Set bi element.
|
void |
setBusId(int row,
java.lang.String id)
set bus id corresponding to the row
|
void |
setBVector(double[] b)
Set b/x vector.
|
void |
setElem(int i,
DoubleSEqnRow aii) |
void |
setToZero()
Reset all matrix element to zero, preserve the matrix structure.
|
void |
solveEqn()
Solve the [A]X = B problem
|
double[] |
solveLUedEqn(double[] b)
Solve the [A]X = B problem
|
java.lang.String |
toString()
Get the string representation of the matrix object
|
getDimension, getDimension, getZeroAii_row, isFactorized, isSquareMatrix, setFactorized, setZeroAii_row, solveEqnclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetDimension, getDimension, getZeroAii_row, isFactorized, isSquareMatrix, setFactorized, solveEqnprotected DoubleSEqnRow[] aryAii
public AbstractSparseEqnDoubleImpl(int n)
public AbstractSparseEqnDoubleImpl(int rows,
int cols)
public void increaseDimension()
ISparseEquationincreaseDimension in interface ISparseEquationn - matrix dimensionpublic void addToAij(double x,
int i,
int j)
addToAij in interface ISparseEqnDoublex - the aij elementi - the element row numberj - the element column numberpublic DoubleSEqnRow getElem(int i)
public void setElem(int i,
DoubleSEqnRow aii)
public void setAij(double x,
int i,
int j)
setAij in interface ISparseEqnDoublex - the aij elementi - the element row number (1-n convention)j - the element column number (1-n convention)public double getAij(int i,
int j)
ISparseEqnDoublegetAij in interface ISparseEqnDoublei - the element row numberj - the element column numberpublic void setB2Zero()
setB2Zero in interface ISparseEquationsetB2Zero in class AbstractSparseEquation<ISparseEqnSolver>i - the element row numberpublic void setB2Unity(int i)
setB2Unity in interface ISparseEquationi - the element row numberpublic double getXi(int i)
getXi in interface ISparseEqnDoublei - the element row numberpublic double[] getXVector()
i - the element row numberpublic void setBVector(double[] b)
b - the b vectorpublic void setBi(double bi,
int i)
setBi in interface ISparseEqnDoublebi - the bi elementi - row number (1-n convention)public void addToBi(double bi,
int i)
addToBi in interface ISparseEqnDoublebi - the bi elementi - row numberpublic void reset()
reset in interface ISparseEquationpublic void setToZero()
setToZero in interface ISparseEquationpublic void solveEqn()
throws IpssNumericException
solveEqn in interface ISparseEquationIpssNumericExceptionpublic double[] solveLUedEqn(double[] b)
throws IpssNumericException
solveLUedEqn in interface ISparseEqnDoubleIpssNumericExceptionpublic boolean factorization()
throws IpssNumericException
factorization in interface ISparseEquationfactorization in class AbstractSparseEquation<ISparseEqnSolver>tolerance - the tolerance for matrix singular detectionIpssNumericExceptionpublic boolean factorization(double tolerance)
throws IpssNumericException
factorization in interface ISparseEquationfactorization in class AbstractSparseEquation<ISparseEqnSolver>tolerance - the tolerance for matrix singular detectionIpssNumericExceptionpublic int getTotalElements()
getTotalElements in interface ISparseEquationpublic java.lang.String getBusId(int row)
ISparseEquationgetBusId in interface ISparseEquationgetBusId in class AbstractSparseEquation<ISparseEqnSolver>row - row numberpublic void setBusId(int row,
java.lang.String id)
ISparseEquationsetBusId in interface ISparseEquationsetBusId in class AbstractSparseEquation<ISparseEqnSolver>row - row numberid - bus idpublic java.lang.String toString()
toString in class java.lang.Objectpublic double err(double[] x)