Search in sources :

Example 16 with DivideAndConquer

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

the class PrimitiveDenseStore method substituteBackwards.

public void substituteBackwards(final Access2D<Double> 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 first, final int limit) {
                SubstituteBackwards.invoke(PrimitiveDenseStore.this.data, tmpRowDim, first, limit, 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 17 with DivideAndConquer

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

the class PrimitiveDenseStore method fillMatching.

@Override
public void fillMatching(final Access1D<?> values) {
    if (values instanceof TransjugatedStore) {
        final TransjugatedStore<?> transposed = (TransjugatedStore<?>) values;
        if (myColDim > FillMatchingSingle.THRESHOLD) {
            final DivideAndConquer tmpConquerer = new DivideAndConquer() {

                @Override
                public void conquer(final int first, final int limit) {
                    FillMatchingSingle.transpose(data, myRowDim, first, limit, transposed.getOriginal());
                }
            };
            tmpConquerer.invoke(0, myColDim, FillMatchingSingle.THRESHOLD);
        } else {
            FillMatchingSingle.transpose(data, myRowDim, 0, myColDim, transposed.getOriginal());
        }
    } else {
        super.fillMatching(values);
    }
}
Also used : DivideAndConquer(org.ojalgo.concurrent.DivideAndConquer)

Example 18 with DivideAndConquer

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

the class PrimitiveDenseStore method aggregateAll.

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

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

Example 19 with DivideAndConquer

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

the class PrimitiveDenseStore method applyLU.

public void applyLU(final int iterationPoint, final BasicArray<Double> multipliers) {
    final double[] tmpData = data;
    final double[] tmpColumn = ((Primitive64Array) multipliers).data;
    if ((myColDim - iterationPoint - 1) > ApplyLU.THRESHOLD) {
        final DivideAndConquer tmpConquerer = new DivideAndConquer() {

            @Override
            protected void conquer(final int first, final int limit) {
                ApplyLU.invoke(tmpData, myRowDim, first, limit, 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) Primitive64Array(org.ojalgo.array.Primitive64Array)

Example 20 with DivideAndConquer

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

the class PrimitiveDenseStore method applyLDL.

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

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