use of org.ojalgo.array.ComplexArray in project ojAlgo by optimatika.
the class ComplexDenseStore method applyCholesky.
public void applyCholesky(final int iterationPoint, final BasicArray<ComplexNumber> multipliers) {
final ComplexNumber[] tmpData = data;
final ComplexNumber[] tmpColumn = ((ComplexArray) multipliers).data;
if ((myColDim - iterationPoint - 1) > ApplyCholesky.THRESHOLD) {
final DivideAndConquer tmpConquerer = new DivideAndConquer() {
@Override
protected void conquer(final int aFirst, final int aLimit) {
ApplyCholesky.invoke(tmpData, myRowDim, aFirst, aLimit, tmpColumn);
}
};
tmpConquerer.invoke(iterationPoint + 1, myColDim, ApplyCholesky.THRESHOLD);
} else {
ApplyCholesky.invoke(tmpData, myRowDim, iterationPoint + 1, myColDim, tmpColumn);
}
}
use of org.ojalgo.array.ComplexArray in project ojAlgo by optimatika.
the class ComplexDenseStore method applyLDL.
public void applyLDL(final int iterationPoint, final BasicArray<ComplexNumber> multipliers) {
final ComplexNumber[] tmpData = data;
final ComplexNumber[] tmpColumn = ((ComplexArray) multipliers).data;
if ((myColDim - iterationPoint - 1) > ApplyLDL.THRESHOLD) {
final DivideAndConquer tmpConquerer = new DivideAndConquer() {
@Override
protected void conquer(final int first, final int limit) {
ApplyLDL.invoke(tmpData, myRowDim, first, limit, tmpColumn, iterationPoint);
}
};
tmpConquerer.invoke(iterationPoint + 1, myColDim, ApplyLDL.THRESHOLD);
} else {
ApplyLDL.invoke(tmpData, myRowDim, iterationPoint + 1, myColDim, tmpColumn, iterationPoint);
}
}
use of org.ojalgo.array.ComplexArray in project ojAlgo by optimatika.
the class ComplexDenseStore method applyLU.
public void applyLU(final int iterationPoint, final BasicArray<ComplexNumber> multipliers) {
final ComplexNumber[] tmpData = data;
final ComplexNumber[] tmpColumn = ((ComplexArray) multipliers).data;
if ((myColDim - iterationPoint - 1) > ApplyLU.THRESHOLD) {
final DivideAndConquer tmpConquerer = new DivideAndConquer() {
@Override
protected void conquer(final int aFirst, final int aLimit) {
ApplyLU.invoke(tmpData, myRowDim, aFirst, aLimit, tmpColumn, iterationPoint);
}
};
tmpConquerer.invoke(iterationPoint + 1, myColDim, ApplyLU.THRESHOLD);
} else {
ApplyLU.invoke(tmpData, myRowDim, iterationPoint + 1, myColDim, tmpColumn, iterationPoint);
}
}
use of org.ojalgo.array.ComplexArray in project ojAlgo by optimatika.
the class ComplexDenseStore method divideAndCopyColumn.
public void divideAndCopyColumn(final int row, final int column, final BasicArray<ComplexNumber> destination) {
final ComplexNumber[] tmpData = data;
final int tmpRowDim = myRowDim;
final ComplexNumber[] tmpDestination = ((ComplexArray) destination).data;
int tmpIndex = row + (column * tmpRowDim);
final ComplexNumber tmpDenominator = tmpData[tmpIndex];
for (int i = row + 1; i < tmpRowDim; i++) {
tmpIndex++;
tmpDestination[i] = tmpData[tmpIndex] = tmpData[tmpIndex].divide(tmpDenominator);
}
}
use of org.ojalgo.array.ComplexArray in project ojAlgo by optimatika.
the class PrimitiveDenseStore method computeInPlaceSchur.
public Array1D<ComplexNumber> computeInPlaceSchur(final PhysicalStore<Double> transformationCollector, final boolean eigenvalue) {
// final PrimitiveDenseStore tmpThisCopy = this.copy();
// final PrimitiveDenseStore tmpCollCopy = (PrimitiveDenseStore)
// aTransformationCollector.copy();
//
// tmpThisCopy.computeInPlaceHessenberg(true);
// Actual
final double[] tmpData = data;
final double[] tmpCollectorData = ((PrimitiveDenseStore) transformationCollector).data;
final double[] tmpVctrWork = new double[this.getMinDim()];
EvD1D.orthes(tmpData, tmpCollectorData, tmpVctrWork);
// BasicLogger.logDebug("Schur Step", this);
// BasicLogger.logDebug("Hessenberg", tmpThisCopy);
final double[][] tmpDiags = EvD1D.hqr2(tmpData, tmpCollectorData, eigenvalue);
final double[] aRawReal = tmpDiags[0];
final double[] aRawImag = tmpDiags[1];
final int tmpLength = Math.min(aRawReal.length, aRawImag.length);
final ComplexArray retVal = ComplexArray.make(tmpLength);
final ComplexNumber[] tmpRaw = retVal.data;
for (int i = 0; i < tmpLength; i++) {
tmpRaw[i] = ComplexNumber.of(aRawReal[i], aRawImag[i]);
}
return Array1D.COMPLEX.wrap(retVal);
}
Aggregations