use of org.ojalgo.concurrent.DivideAndConquer in project ojAlgo by optimatika.
the class GenericDenseStore method applyLDL.
public void applyLDL(final int iterationPoint, final BasicArray<N> multipliers) {
final N[] tmpData = data;
final N[] tmpColumn = ((ScalarArray<N>) 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 GenericDenseStore method fillMatching.
@Override
public void fillMatching(final UnaryFunction<N> function, final Access1D<N> 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) {
ReferenceTypeArray.invoke(data, first, limit, 1, arguments, function);
}
};
tmpConquerer.invoke(0, matchingCount, FillMatchingSingle.THRESHOLD * FillMatchingSingle.THRESHOLD);
} else {
ReferenceTypeArray.invoke(data, 0, matchingCount, 1, arguments, function);
}
}
use of org.ojalgo.concurrent.DivideAndConquer in project ojAlgo by optimatika.
the class GenericDenseStore method transformRight.
public void transformRight(final Householder<N> transformation, final int firstRow) {
final Householder.Generic<N> tmpTransf = this.cast(transformation);
final N[] tmpData = data;
final int tmpRowDim = myRowDim;
final int tmpColDim = myColDim;
if ((tmpRowDim - firstRow) > HouseholderRight.THRESHOLD) {
final DivideAndConquer tmpConquerer = new DivideAndConquer() {
@Override
public void conquer(final int aFirst, final int aLimit) {
HouseholderRight.invoke(tmpData, aFirst, aLimit, tmpColDim, tmpTransf, myFactory.scalar());
}
};
tmpConquerer.invoke(firstRow, tmpRowDim, HouseholderRight.THRESHOLD);
} else {
HouseholderRight.invoke(tmpData, firstRow, tmpRowDim, tmpColDim, tmpTransf, myFactory.scalar());
}
}
use of org.ojalgo.concurrent.DivideAndConquer in project ojAlgo by optimatika.
the class GenericDenseStore method applyLU.
public void applyLU(final int iterationPoint, final BasicArray<N> multipliers) {
final N[] tmpData = data;
final N[] tmpColumn = ((ScalarArray<N>) 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.concurrent.DivideAndConquer in project ojAlgo by optimatika.
the class GenericDenseStore method modifyAll.
@Override
public void modifyAll(final UnaryFunction<N> 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) {
GenericDenseStore.this.modify(tmpRowDim * aFirst, tmpRowDim * aLimit, 1, aFunc);
}
};
tmpConquerer.invoke(0, tmpColDim, ModifyAll.THRESHOLD);
} else {
this.modify(tmpRowDim * 0, tmpRowDim * tmpColDim, 1, aFunc);
}
}
Aggregations