public abstract class AbstractSparseEqnComplexImpl<T extends ISparseEqnSolver> extends AbstractSparseEquation<T> implements ISparseEqnComplex
ISparseEquation.IndexType
Modifier and Type | Field and Description |
---|---|
protected ComplexSEqnRow[] |
aryAii |
colCnt, factored, rowCnt, solver, squareMatrix, zeroAii_row
Constructor and Description |
---|
AbstractSparseEqnComplexImpl(int n) |
AbstractSparseEqnComplexImpl(int rows,
int cols) |
Modifier and Type | Method and Description |
---|---|
void |
addToA(org.apache.commons.math3.complex.Complex x,
int i,
int j)
Add the aij element to the matrix.
|
void |
addToB(org.apache.commons.math3.complex.Complex bi,
int i)
add to bi element.
|
boolean |
factorization(double tolerance)
LU decomposition of the matrix.
|
org.apache.commons.math3.complex.Complex |
getA(int i,
int j)
Get the aij element.
|
java.lang.String |
getBusId(int row)
get cached bus id by the row number
|
ComplexSEqnRow |
getElem(int i) |
int |
getTotalElements()
Get the total elements in the matrix
|
org.apache.commons.math3.complex.Complex |
getX(int i)
Get the bi element.
|
int |
getZeroA_row()
Get zero aii row number, in case the matrix is singular
|
void |
increaseDimension()
Increase matrix dimension by 1.
|
org.apache.commons.math3.complex.Complex[] |
multiply(org.apache.commons.math3.complex.Complex[] xAry)
Multiply the complex matrix of the eqn with the array x
|
edu.emory.mathcs.csparsej.tdcomplex.DZcs_common.DZcsa |
multiply(edu.emory.mathcs.csparsej.tdcomplex.DZcs_common.DZcsa xAry)
Multiply the complex matrix of the eqn with the array x
|
void |
reset()
Reset the matrix to zero - set all aii and bi to 0.0 and clear the aijList
|
void |
setA(org.apache.commons.math3.complex.Complex 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.
|
void |
setBi(org.apache.commons.math3.complex.Complex bi,
int i)
Set bi element.
|
void |
setBusId(int row,
java.lang.String id)
set bus id corresponding to the row
|
void |
setBVector(org.apache.commons.math3.complex.Complex[] bAry)
Set b vector, before solving the eqn.
|
void |
setElem(int i,
ComplexSEqnRow aii) |
void |
setToZero()
Reset all matrix element to zero, preserve the matrix structure.
|
void |
solveEqn()
Solve the [A]X = B problem
|
java.lang.String |
toString()
Get the string representation of the matrix object
|
factorization, getDimension, getDimension, getZeroAii_row, isFactorized, isSquareMatrix, setFactorized, setZeroAii_row, solveEqn
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
solveLUedEqn, solveLUedEqn
factorization, getDimension, getDimension, getZeroAii_row, isFactorized, isSquareMatrix, setFactorized, solveEqn
protected ComplexSEqnRow[] aryAii
public AbstractSparseEqnComplexImpl(int n)
public AbstractSparseEqnComplexImpl(int rows, int cols)
public org.apache.commons.math3.complex.Complex[] multiply(org.apache.commons.math3.complex.Complex[] xAry)
ISparseEqnComplex
multiply
in interface ISparseEqnComplex
public edu.emory.mathcs.csparsej.tdcomplex.DZcs_common.DZcsa multiply(edu.emory.mathcs.csparsej.tdcomplex.DZcs_common.DZcsa xAry)
ISparseEqnComplex
multiply
in interface ISparseEqnComplex
public void increaseDimension()
ISparseEquation
increaseDimension
in interface ISparseEquation
n
- matrix dimensionpublic void addToA(org.apache.commons.math3.complex.Complex x, int i, int j)
addToA
in interface ISparseEqnObject<org.apache.commons.math3.complex.Complex,org.apache.commons.math3.complex.Complex>
x
- the aij elementi
- the element row numberj
- the element column numberpublic org.apache.commons.math3.complex.Complex getX(int i)
getX
in interface ISparseEqnObject<org.apache.commons.math3.complex.Complex,org.apache.commons.math3.complex.Complex>
i
- the element row numberpublic ComplexSEqnRow getElem(int i)
public void setElem(int i, ComplexSEqnRow aii)
public void setA(org.apache.commons.math3.complex.Complex x, int i, int j)
setA
in interface ISparseEqnObject<org.apache.commons.math3.complex.Complex,org.apache.commons.math3.complex.Complex>
x
- the aij elementi
- the element row number (1-n convention)j
- the element column number (1-n convention)public org.apache.commons.math3.complex.Complex getA(int i, int j)
getA
in interface ISparseEqnObject<org.apache.commons.math3.complex.Complex,org.apache.commons.math3.complex.Complex>
i
- the element row numberj
- the element column numberpublic void setB2Unity(int i)
setB2Unity
in interface ISparseEquation
i
- the element row numberpublic void setB2Zero()
setB2Zero
in interface ISparseEquation
setB2Zero
in class AbstractSparseEquation<T extends ISparseEqnSolver>
public void setBi(org.apache.commons.math3.complex.Complex bi, int i)
setBi
in interface ISparseEqnObject<org.apache.commons.math3.complex.Complex,org.apache.commons.math3.complex.Complex>
bi
- the bi elementi
- row numberpublic void setBVector(org.apache.commons.math3.complex.Complex[] bAry)
ISparseEqnObject
setBVector
in interface ISparseEqnObject<org.apache.commons.math3.complex.Complex,org.apache.commons.math3.complex.Complex>
bAry
- the b vector elementspublic void addToB(org.apache.commons.math3.complex.Complex bi, int i)
ISparseEqnObject
addToB
in interface ISparseEqnObject<org.apache.commons.math3.complex.Complex,org.apache.commons.math3.complex.Complex>
bi
- the bi elementi
- row numberpublic void reset()
reset
in interface ISparseEquation
public void setToZero()
setToZero
in interface ISparseEquation
public boolean factorization(double tolerance) throws IpssNumericException
factorization
in interface ISparseEquation
factorization
in class AbstractSparseEquation<T extends ISparseEqnSolver>
tolerance
- the tolerance for matrix singular detectionIpssNumericException
public void solveEqn() throws IpssNumericException
solveEqn
in interface ISparseEquation
IpssNumericException
public int getTotalElements()
getTotalElements
in interface ISparseEquation
public int getZeroA_row()
ISparseEqnObject
getZeroA_row
in interface ISparseEqnObject<org.apache.commons.math3.complex.Complex,org.apache.commons.math3.complex.Complex>
public java.lang.String getBusId(int row)
ISparseEquation
getBusId
in interface ISparseEquation
getBusId
in class AbstractSparseEquation<T extends ISparseEqnSolver>
row
- row numberpublic void setBusId(int row, java.lang.String id)
ISparseEquation
setBusId
in interface ISparseEquation
setBusId
in class AbstractSparseEquation<T extends ISparseEqnSolver>
row
- row numberid
- bus idpublic java.lang.String toString()
toString
in class java.lang.Object