use of org.ojalgo.concurrent.DivideAndConquer in project ojAlgo by optimatika.
the class PrimitiveDenseStore method substituteBackwards.
public void substituteBackwards(final Access2D<Double> body, final boolean unitDiagonal, final boolean conjugated, final boolean hermitian) {
final int tmpRowDim = myRowDim;
final int tmpColDim = myColDim;
if (tmpColDim > SubstituteBackwards.THRESHOLD) {
final DivideAndConquer tmpConquerer = new DivideAndConquer() {
@Override
public void conquer(final int first, final int limit) {
SubstituteBackwards.invoke(PrimitiveDenseStore.this.data, tmpRowDim, first, limit, body, unitDiagonal, conjugated, hermitian);
}
};
tmpConquerer.invoke(0, tmpColDim, SubstituteBackwards.THRESHOLD);
} else {
SubstituteBackwards.invoke(data, tmpRowDim, 0, tmpColDim, body, unitDiagonal, conjugated, hermitian);
}
}
use of org.ojalgo.concurrent.DivideAndConquer in project ojAlgo by optimatika.
the class PrimitiveDenseStore method fillMatching.
@Override
public void fillMatching(final Access1D<?> values) {
if (values instanceof TransjugatedStore) {
final TransjugatedStore<?> transposed = (TransjugatedStore<?>) values;
if (myColDim > FillMatchingSingle.THRESHOLD) {
final DivideAndConquer tmpConquerer = new DivideAndConquer() {
@Override
public void conquer(final int first, final int limit) {
FillMatchingSingle.transpose(data, myRowDim, first, limit, transposed.getOriginal());
}
};
tmpConquerer.invoke(0, myColDim, FillMatchingSingle.THRESHOLD);
} else {
FillMatchingSingle.transpose(data, myRowDim, 0, myColDim, transposed.getOriginal());
}
} else {
super.fillMatching(values);
}
}
use of org.ojalgo.concurrent.DivideAndConquer in project ojAlgo by optimatika.
the class PrimitiveDenseStore method aggregateAll.
public Double aggregateAll(final Aggregator aggregator) {
final int tmpRowDim = myRowDim;
final int tmpColDim = myColDim;
final AggregatorFunction<Double> tmpMainAggr = aggregator.getFunction(PrimitiveAggregator.getSet());
if (tmpColDim > AggregateAll.THRESHOLD) {
final DivideAndConquer tmpConquerer = new DivideAndConquer() {
@Override
public void conquer(final int first, final int limit) {
final AggregatorFunction<Double> tmpPartAggr = aggregator.getFunction(PrimitiveAggregator.getSet());
PrimitiveDenseStore.this.visit(tmpRowDim * first, tmpRowDim * limit, 1, tmpPartAggr);
synchronized (tmpMainAggr) {
tmpMainAggr.merge(tmpPartAggr.get());
}
}
};
tmpConquerer.invoke(0, tmpColDim, AggregateAll.THRESHOLD);
} else {
PrimitiveDenseStore.this.visit(0, this.size(), 1, tmpMainAggr);
}
return tmpMainAggr.get();
}
use of org.ojalgo.concurrent.DivideAndConquer in project ojAlgo by optimatika.
the class PrimitiveDenseStore method applyLU.
public void applyLU(final int iterationPoint, final BasicArray<Double> multipliers) {
final double[] tmpData = data;
final double[] tmpColumn = ((Primitive64Array) multipliers).data;
if ((myColDim - iterationPoint - 1) > ApplyLU.THRESHOLD) {
final DivideAndConquer tmpConquerer = new DivideAndConquer() {
@Override
protected void conquer(final int first, final int limit) {
ApplyLU.invoke(tmpData, myRowDim, first, limit, tmpColumn, iterationPoint);
}
};
tmpConquerer.invoke(iterationPoint + 1, myColDim, ApplyLU.THRESHOLD);
} else {
ApplyLU.invoke(tmpData, myRowDim, iterationPoint + 1, myColDim, tmpColumn, iterationPoint);
}
}
use of org.ojalgo.concurrent.DivideAndConquer in project ojAlgo by optimatika.
the class PrimitiveDenseStore method applyLDL.
public void applyLDL(final int iterationPoint, final BasicArray<Double> multipliers) {
final double[] tmpData = data;
final double[] tmpColumn = ((Primitive64Array) 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);
}
}
Aggregations