use of org.ojalgo.concurrent.DivideAndConquer 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.concurrent.DivideAndConquer 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.concurrent.DivideAndConquer in project ojAlgo by optimatika.
the class ComplexDenseStore method modifyAll.
@Override
public void modifyAll(final UnaryFunction<ComplexNumber> aFunc) {
final int tmpRowDim = myRowDim;
final int tmpColDim = myColDim;
if (tmpColDim > ModifyAll.THRESHOLD) {
final DivideAndConquer tmpConquerer = new DivideAndConquer() {
@Override
public void conquer(final int aFirst, final int aLimit) {
ComplexDenseStore.this.modify(tmpRowDim * aFirst, tmpRowDim * aLimit, 1, aFunc);
}
};
tmpConquerer.invoke(0, tmpColDim, ModifyAll.THRESHOLD);
} else {
this.modify(tmpRowDim * 0, tmpRowDim * tmpColDim, 1, aFunc);
}
}
use of org.ojalgo.concurrent.DivideAndConquer in project ojAlgo by optimatika.
the class ComplexDenseStore method aggregateAll.
public ComplexNumber aggregateAll(final Aggregator aggregator) {
final int tmpRowDim = myRowDim;
final int tmpColDim = myColDim;
final AggregatorFunction<ComplexNumber> tmpMainAggr = aggregator.getFunction(ComplexAggregator.getSet());
if (tmpColDim > AggregateAll.THRESHOLD) {
final DivideAndConquer tmpConquerer = new DivideAndConquer() {
@Override
public void conquer(final int aFirst, final int aLimit) {
final AggregatorFunction<ComplexNumber> tmpPartAggr = aggregator.getFunction(ComplexAggregator.getSet());
ComplexDenseStore.this.visit(tmpRowDim * aFirst, tmpRowDim * aLimit, 1, tmpPartAggr);
synchronized (tmpMainAggr) {
tmpMainAggr.merge(tmpPartAggr.get());
}
}
};
tmpConquerer.invoke(0, tmpColDim, AggregateAll.THRESHOLD);
} else {
ComplexDenseStore.this.visit(0, this.size(), 1, tmpMainAggr);
}
return tmpMainAggr.get();
}
use of org.ojalgo.concurrent.DivideAndConquer 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);
}
}
Aggregations