Search in sources :

Example 41 with DivideAndConquer

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

Example 42 with DivideAndConquer

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

Example 43 with DivideAndConquer

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

Example 44 with DivideAndConquer

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

Example 45 with DivideAndConquer

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