On Sat, Jan 2, 2016 at 4:38 AM, Ole Ersoy <ole.er...@gmail.com> 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: dev-unsubscr...@commons.apache.org
> For additional commands, e-mail: dev-h...@commons.apache.org
>

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.

Otmar

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to