Search in sources :

Example 1 with DivideAndConquer

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

the class BigDenseStore method transformLeft.

public void transformLeft(final Householder<BigDecimal> transformation, final int firstColumn) {
    final Householder.Big tmpTransf = BigDenseStore.cast(transformation);
    final BigDecimal[] 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);
    }
}
Also used : DivideAndConquer(org.ojalgo.concurrent.DivideAndConquer) Householder(org.ojalgo.matrix.transformation.Householder) BigDecimal(java.math.BigDecimal)

Example 2 with DivideAndConquer

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

the class BigDenseStore method applyCholesky.

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

Example 3 with DivideAndConquer

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

the class BigDenseStore method applyLU.

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

Example 4 with DivideAndConquer

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

the class BigDenseStore method transformRight.

public void transformRight(final Householder<BigDecimal> transformation, final int firstRow) {
    final Householder.Big tmpTransf = BigDenseStore.cast(transformation);
    final BigDecimal[] 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) BigDecimal(java.math.BigDecimal)

Example 5 with DivideAndConquer

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

the class ComplexDenseStore method substituteBackwards.

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

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