commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Otmar Ertl <>
Subject Re: [math] Matrix parallel operations
Date Sat, 02 Jan 2016 16:33:32 GMT
On Sat, Jan 2, 2016 at 4:38 AM, Ole Ersoy <> wrote:
> Hi,
> Hope ya'll are having an awesome new year!
> Some matrix operations, like createRealIdentityMatrix can be turned into one
> liners like this:
>        IntStream.range(0, dimension).forEach(i -> m.setEntry(i, i, 1.0));
> And can be performed in parallel like this:
>         IntStream.range(0, dimension).parallel().forEach(i -> m.setEntry(i,
> i, 1.0));
> Applying that approach in general we could probably create a
> ParallelXxxRealMatrix fairly easily.   Just thought I'd float the idea.
> Cheers,
> Ole
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Once we go for Java 8, yes. However, all these constructs have some
overhead. I doubt that the naive parallelization using parallel() is
faster than the sequential counterpart, especially for operations such
as matrix initializations. A more efficient parallel implementation
would require the definition of a Spliterator that divides an
operation into less but larger chunks of work in order to amortize
synchronization costs. In general, the implementation of efficient and
well scaling parallel matrix operations requires more work than
writing just a single line of code.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message