use of org.ojalgo.concurrent.DivideAndConquer in project ojAlgo by optimatika.
the class ComplexDenseStore method substituteForwards.
public void substituteForwards(final Access2D<ComplexNumber> body, final boolean unitDiagonal, final boolean conjugated, final boolean identity) {
final int tmpRowDim = myRowDim;
final int tmpColDim = myColDim;
if (tmpColDim > SubstituteForwards.THRESHOLD) {
final DivideAndConquer tmpConquerer = new DivideAndConquer() {
@Override
public void conquer(final int aFirst, final int aLimit) {
SubstituteForwards.invoke(ComplexDenseStore.this.data, tmpRowDim, aFirst, aLimit, body, unitDiagonal, conjugated, identity, FACTORY.scalar());
}
};
tmpConquerer.invoke(0, tmpColDim, SubstituteForwards.THRESHOLD);
} else {
SubstituteForwards.invoke(data, tmpRowDim, 0, tmpColDim, body, unitDiagonal, conjugated, identity, FACTORY.scalar());
}
}
use of org.ojalgo.concurrent.DivideAndConquer in project ojAlgo by optimatika.
the class ComplexDenseStore method transformLeft.
public void transformLeft(final Householder<ComplexNumber> transformation, final int firstColumn) {
final Householder.Complex tmpTransf = ComplexDenseStore.cast(transformation);
final ComplexNumber[] tmpData = data;
final int tmpRowDim = myRowDim;
final int tmpColDim = myColDim;
if ((tmpColDim - firstColumn) > HouseholderLeft.THRESHOLD) {
final DivideAndConquer tmpConquerer = new DivideAndConquer() {
@Override
public void conquer(final int aFirst, final int aLimit) {
HouseholderLeft.invoke(tmpData, tmpRowDim, aFirst, aLimit, tmpTransf);
}
};
tmpConquerer.invoke(firstColumn, tmpColDim, HouseholderLeft.THRESHOLD);
} else {
HouseholderLeft.invoke(tmpData, tmpRowDim, firstColumn, tmpColDim, tmpTransf);
}
}
use of org.ojalgo.concurrent.DivideAndConquer in project ojAlgo by optimatika.
the class PrimitiveDenseStore method fillMatching.
@Override
public void fillMatching(final UnaryFunction<Double> function, final Access1D<Double> arguments) {
final int matchingCount = (int) FunctionUtils.min(this.count(), arguments.count());
if (myColDim > FillMatchingSingle.THRESHOLD) {
final DivideAndConquer tmpConquerer = new DivideAndConquer() {
@Override
protected void conquer(final int first, final int limit) {
Primitive64Array.invoke(data, first, limit, 1, arguments, function);
}
};
tmpConquerer.invoke(0, matchingCount, FillMatchingSingle.THRESHOLD * FillMatchingSingle.THRESHOLD);
} else {
Primitive64Array.invoke(data, 0, matchingCount, 1, arguments, function);
}
}
use of org.ojalgo.concurrent.DivideAndConquer in project ojAlgo by optimatika.
the class PrimitiveDenseStore method modifyAll.
@Override
public void modifyAll(final UnaryFunction<Double> modifier) {
final int tmpRowDim = myRowDim;
final int tmpColDim = myColDim;
if (tmpColDim > ModifyAll.THRESHOLD) {
final DivideAndConquer tmpConquerer = new DivideAndConquer() {
@Override
public void conquer(final int first, final int limit) {
PrimitiveDenseStore.this.modify(tmpRowDim * first, tmpRowDim * limit, 1, modifier);
}
};
tmpConquerer.invoke(0, tmpColDim, ModifyAll.THRESHOLD);
} else {
this.modify(tmpRowDim * 0, tmpRowDim * tmpColDim, 1, modifier);
}
}
use of org.ojalgo.concurrent.DivideAndConquer in project ojAlgo by optimatika.
the class PrimitiveDenseStore method substituteForwards.
public void substituteForwards(final Access2D<Double> body, final boolean unitDiagonal, final boolean conjugated, final boolean identity) {
final int tmpRowDim = myRowDim;
final int tmpColDim = myColDim;
if (tmpColDim > SubstituteForwards.THRESHOLD) {
final DivideAndConquer tmpConquerer = new DivideAndConquer() {
@Override
public void conquer(final int first, final int limit) {
SubstituteForwards.invoke(PrimitiveDenseStore.this.data, tmpRowDim, first, limit, body, unitDiagonal, conjugated, identity);
}
};
tmpConquerer.invoke(0, tmpColDim, SubstituteForwards.THRESHOLD);
} else {
SubstituteForwards.invoke(data, tmpRowDim, 0, tmpColDim, body, unitDiagonal, conjugated, identity);
}
}
Aggregations