Search in sources :

Example 6 with DivideAndConquer

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

the class ComplexDenseStore method applyCholesky.

public void applyCholesky(final int iterationPoint, final BasicArray<ComplexNumber> multipliers) {
    final ComplexNumber[] tmpData = data;
    final ComplexNumber[] tmpColumn = ((ComplexArray) 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 : DivideAndConquer(org.ojalgo.concurrent.DivideAndConquer) ComplexArray(org.ojalgo.array.ComplexArray) ComplexNumber(org.ojalgo.scalar.ComplexNumber)

Example 7 with DivideAndConquer

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

the class ComplexDenseStore method applyLDL.

public void applyLDL(final int iterationPoint, final BasicArray<ComplexNumber> multipliers) {
    final ComplexNumber[] tmpData = data;
    final ComplexNumber[] tmpColumn = ((ComplexArray) 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) ComplexArray(org.ojalgo.array.ComplexArray) ComplexNumber(org.ojalgo.scalar.ComplexNumber)

Example 8 with DivideAndConquer

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

the class ComplexDenseStore method modifyAll.

@Override
public void modifyAll(final UnaryFunction<ComplexNumber> 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) {
                ComplexDenseStore.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 9 with DivideAndConquer

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

the class ComplexDenseStore method aggregateAll.

public ComplexNumber aggregateAll(final Aggregator aggregator) {
    final int tmpRowDim = myRowDim;
    final int tmpColDim = myColDim;
    final AggregatorFunction<ComplexNumber> tmpMainAggr = aggregator.getFunction(ComplexAggregator.getSet());
    if (tmpColDim > AggregateAll.THRESHOLD) {
        final DivideAndConquer tmpConquerer = new DivideAndConquer() {

            @Override
            public void conquer(final int aFirst, final int aLimit) {
                final AggregatorFunction<ComplexNumber> tmpPartAggr = aggregator.getFunction(ComplexAggregator.getSet());
                ComplexDenseStore.this.visit(tmpRowDim * aFirst, tmpRowDim * aLimit, 1, tmpPartAggr);
                synchronized (tmpMainAggr) {
                    tmpMainAggr.merge(tmpPartAggr.get());
                }
            }
        };
        tmpConquerer.invoke(0, tmpColDim, AggregateAll.THRESHOLD);
    } else {
        ComplexDenseStore.this.visit(0, this.size(), 1, tmpMainAggr);
    }
    return tmpMainAggr.get();
}
Also used : DivideAndConquer(org.ojalgo.concurrent.DivideAndConquer) ComplexNumber(org.ojalgo.scalar.ComplexNumber)

Example 10 with DivideAndConquer

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

the class ComplexDenseStore method applyLU.

public void applyLU(final int iterationPoint, final BasicArray<ComplexNumber> multipliers) {
    final ComplexNumber[] tmpData = data;
    final ComplexNumber[] tmpColumn = ((ComplexArray) 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) ComplexArray(org.ojalgo.array.ComplexArray) 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