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, solveEqn
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getDimension, getDimension, getZeroAii_row, isFactorized, isSquareMatrix, setFactorized, solveEqn
protected DoubleSEqnRow[] aryAii
public AbstractSparseEqnDoubleImpl(int n)
public AbstractSparseEqnDoubleImpl(int rows, int cols)
public void increaseDimension()
ISparseEquation
increaseDimension
in interface ISparseEquation
n
- matrix dimensionpublic void addToAij(double x, int i, int j)
addToAij
in interface ISparseEqnDouble
x
- 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 ISparseEqnDouble
x
- 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)
ISparseEqnDouble
getAij
in interface ISparseEqnDouble
i
- the element row numberj
- the element column numberpublic void setB2Zero()
setB2Zero
in interface ISparseEquation
setB2Zero
in class AbstractSparseEquation<ISparseEqnSolver>
i
- the element row numberpublic void setB2Unity(int i)
setB2Unity
in interface ISparseEquation
i
- the element row numberpublic double getXi(int i)
getXi
in interface ISparseEqnDouble
i
- 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 ISparseEqnDouble
bi
- the bi elementi
- row number (1-n convention)public void addToBi(double bi, int i)
addToBi
in interface ISparseEqnDouble
bi
- the bi elementi
- row numberpublic void reset()
reset
in interface ISparseEquation
public void setToZero()
setToZero
in interface ISparseEquation
public void solveEqn() throws IpssNumericException
solveEqn
in interface ISparseEquation
IpssNumericException
public double[] solveLUedEqn(double[] b) throws IpssNumericException
solveLUedEqn
in interface ISparseEqnDouble
IpssNumericException
public boolean factorization() throws IpssNumericException
factorization
in interface ISparseEquation
factorization
in class AbstractSparseEquation<ISparseEqnSolver>
tolerance
- the tolerance for matrix singular detectionIpssNumericException
public boolean factorization(double tolerance) throws IpssNumericException
factorization
in interface ISparseEquation
factorization
in class AbstractSparseEquation<ISparseEqnSolver>
tolerance
- the tolerance for matrix singular detectionIpssNumericException
public int getTotalElements()
getTotalElements
in interface ISparseEquation
public java.lang.String getBusId(int row)
ISparseEquation
getBusId
in interface ISparseEquation
getBusId
in class AbstractSparseEquation<ISparseEqnSolver>
row
- row numberpublic void setBusId(int row, java.lang.String id)
ISparseEquation
setBusId
in interface ISparseEquation
setBusId
in class AbstractSparseEquation<ISparseEqnSolver>
row
- row numberid
- bus idpublic java.lang.String toString()
toString
in class java.lang.Object
public double err(double[] x)