Search in sources :

Example 26 with DivideAndConquer

use of org.ojalgo.concurrent.DivideAndConquer in project ojAlgo by optimatika.

the class BigDenseStore method substituteForwards.

public void substituteForwards(final Access2D<BigDecimal> 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(BigDenseStore.this.data, tmpRowDim, aFirst, aLimit, body, unitDiagonal, conjugated, identity);
            }
        };
        tmpConquerer.invoke(0, tmpColDim, SubstituteForwards.THRESHOLD);
    } else {
        SubstituteForwards.invoke(data, tmpRowDim, 0, tmpColDim, body, unitDiagonal, conjugated, identity);
    }
}
Also used : DivideAndConquer(org.ojalgo.concurrent.DivideAndConquer)

Example 27 with DivideAndConquer

use of org.ojalgo.concurrent.DivideAndConquer in project ojAlgo by optimatika.

the class BigDenseStore method modifyAll.

@Override
public void modifyAll(final UnaryFunction<BigDecimal> 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) {
                BigDenseStore.this.modify(tmpRowDim * aFirst, tmpRowDim * aLimit, 1, aFunc);
            }
        };
        tmpConquerer.invoke(0, tmpColDim, ModifyAll.THRESHOLD);
    } else {
        this.modify(tmpRowDim * 0, tmpRowDim * tmpColDim, 1, aFunc);
    }
}
Also used : DivideAndConquer(org.ojalgo.concurrent.DivideAndConquer)

Example 28 with DivideAndConquer

use of org.ojalgo.concurrent.DivideAndConquer in project ojAlgo by optimatika.

the class BigDenseStore method substituteBackwards.

public void substituteBackwards(final Access2D<BigDecimal> 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 aFirst, final int aLimit) {
                SubstituteBackwards.invoke(BigDenseStore.this.data, tmpRowDim, aFirst, aLimit, body, unitDiagonal, conjugated, hermitian);
            }
        };
        tmpConquerer.invoke(0, tmpColDim, SubstituteBackwards.THRESHOLD);
    } else {
        SubstituteBackwards.invoke(data, tmpRowDim, 0, tmpColDim, body, unitDiagonal, conjugated, hermitian);
    }
}
Also used : DivideAndConquer(org.ojalgo.concurrent.DivideAndConquer)

Example 29 with DivideAndConquer

use of org.ojalgo.concurrent.DivideAndConquer in project ojAlgo by optimatika.

the class BigDenseStore method applyLDL.

public void applyLDL(final int iterationPoint, final BasicArray<BigDecimal> multipliers) {
    final BigDecimal[] tmpData = data;
    final BigDecimal[] tmpColumn = ((BigArray) 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);
    }
}
Also used : BigArray(org.ojalgo.array.BigArray) DivideAndConquer(org.ojalgo.concurrent.DivideAndConquer) BigDecimal(java.math.BigDecimal)

Example 30 with DivideAndConquer

use of org.ojalgo.concurrent.DivideAndConquer in project ojAlgo by optimatika.

the class ComplexDenseStore method transformRight.

public void transformRight(final Householder<ComplexNumber> transformation, final int firstRow) {
    final Householder.Complex tmpTransf = ComplexDenseStore.cast(transformation);
    final ComplexNumber[] 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);
            }
        };
        tmpConquerer.invoke(firstRow, tmpRowDim, HouseholderRight.THRESHOLD);
    } else {
        HouseholderRight.invoke(tmpData, firstRow, tmpRowDim, tmpColDim, tmpTransf);
    }
}
Also used : DivideAndConquer(org.ojalgo.concurrent.DivideAndConquer) Householder(org.ojalgo.matrix.transformation.Householder) ComplexNumber(org.ojalgo.scalar.ComplexNumber)

Aggregations

DivideAndConquer (org.ojalgo.concurrent.DivideAndConquer)46 Householder (org.ojalgo.matrix.transformation.Householder)8 BigDecimal (java.math.BigDecimal)7 ComplexNumber (org.ojalgo.scalar.ComplexNumber)7 BigArray (org.ojalgo.array.BigArray)3 ComplexArray (org.ojalgo.array.ComplexArray)3 Primitive64Array (org.ojalgo.array.Primitive64Array)3