Search in sources :

Example 31 with DivideAndConquer

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());
    }
}
Also used : DivideAndConquer(org.ojalgo.concurrent.DivideAndConquer)

Example 32 with DivideAndConquer

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);
    }
}
Also used : DivideAndConquer(org.ojalgo.concurrent.DivideAndConquer) Householder(org.ojalgo.matrix.transformation.Householder) ComplexNumber(org.ojalgo.scalar.ComplexNumber)

Example 33 with DivideAndConquer

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);
    }
}
Also used : DivideAndConquer(org.ojalgo.concurrent.DivideAndConquer)

Example 34 with DivideAndConquer

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);
    }
}
Also used : DivideAndConquer(org.ojalgo.concurrent.DivideAndConquer)

Example 35 with DivideAndConquer

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);
    }
}
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