octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GSoC interval] Re: Update and questions regarding vecorization


From: Oliver Heimlich
Subject: [GSoC interval] Re: Update and questions regarding vecorization
Date: Tue, 27 Jun 2017 01:22:40 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

On 21.06.2017 23:56, Oliver Heimlich wrote:
>> Broadcasting for ternary functions:
>> I added support for broadcasting of N-dimensional arrays for binary
>> functions in mpfr_function_d.cc. This in practice required a rewrite of
>> the whole function, I will write a bit more about this in my blog post
>> tomorrow. When I looked at the ternary functions noticed that it does
>> not perform full broadcasting at the moment. However the only ternary
>> function used is fma.m and that function performs broadcasting already
>> in the octave-script. Should I still add broadcasting for ternary
>> functions? It might be used in the future. If we choose not to we should
>> probably add a comment about it in the code.

> Sounds complicated, I'll answer this during the Weekend after looking at
> your code for the binary functions.  I don't see broadcasting in
> mpfr_function_d as important, since I consider it more of an internal
> function.  Do you know of any ternary Octave functions that allow
> broadcasting, e. g., does plot3 allow broadcasting?

Hi Joel,

I have merged your changes locally, but didn't publish them yet in the
official repository.  Some remarks/questions regarding the new
vectorization code in mpfr_function_d.cc:

 - The method NDArray.size has been introduced in Octave 4.2.  If we
rely on that method, the package will have a dependency on the latest
version of Octave.  I'd prefer, if the package can compile under Octave
4.0 (where this method is missing).  Could you use a different method
(or define a helper function if compiled with an old Octave version)?

 - In your blog post—which was a very interesting read, by the way, and
I could learn some Octave pro stuff—you write that you have been
inspired by do_bsxfun_op in Octave core.  I guess I should add copyright
notes then from that file, shouldn't I?

        Copyright (C) 2009-2017 Jaroslav Hajek
        Copyright (C) 2009 VZLU Prague

   By the way, I also add copyright notes to all files modified by you.
So, you don't have to do that yourself.

 - For the ternary vectorization operator: Like I said before, it is not
a priority to have broadcasting handled in mpfr_function_d when it is
already handled in the m-file.  Probably, the resulting C++ code would
be hard to understand.  You should remove the naive broadcast / resize
code from the function entirely, and require that all three input
arguments are of equal size.

Oliver


P. S. I didn't finish unit tests for vectorization yet.

P. P. S. I can remember another ternary function from an early draft of
the interval arithmetic standard (it doesn't make sense to compute that
with mpfr):

        case (c, g, h) = if c < 0 then g, else h.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]