[Top][All Lists]

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

[Octave-patch-tracker] [patch #8644] Add dirac and heaviside functions

From: Colin Macdonald
Subject: [Octave-patch-tracker] [patch #8644] Add dirac and heaviside functions
Date: Tue, 07 Apr 2015 16:17:10 +0000
User-agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0


                 Summary: Add dirac and heaviside functions
                 Project: GNU Octave
            Submitted by: cbm
            Submitted on: Tue 07 Apr 2015 04:17:09 PM GMT
                Category: None
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any



[tl;dr] I could put these into the Symbolic pkg but it seems to me these make
more sense in core.

AFAICT, the Symbol Maths Toolbox for Matlab includes @double/dirac and
@double/heaviside rather than in core Matlab.  

Longer explanation/justification:

1.  One reason we should have these at all is that SymPy can generate Octave
code for a given symbolic expression, which will currently fail if the
expression includes Heaviside or DiracDelta.  This effects us in Octave
because it means the Symbolic pkg cannot (currently) generate a function
handle (e.g, for fast plotting) from symbolic expressions that contain
heaviside or dirac.
2.  I can easily patch SymPy to output code calling dirac.m and heaviside.m. 
But If I add dirac and heaviside to @double/ in the Symbolic pkg than that
patch for SymPy does not really generate Octave code but rather
"Octave+Symbolic pkg" code.  Wearing my SymPy dev hat, I'm not sure I'd want
to merge such a patch.
3.  In SymPy, I could generate inline Octave code for heaviside but it would
not treat nan correctly (or at least I don't know of a function handle
implementation that would: 1/2*(x==0) + double(x>0) does the wrong thing for
nan.  And I don't know a one-liner for dirac.

So IMHO, simplest thing is to put heaviside.m and dirac.m into core Octave.


File Attachments:

Date: Tue 07 Apr 2015 04:17:09 PM GMT  Name: octave_add_dirac_heaviside.patch 
Size: 6kB   By: cbm



Reply to this item at:


  Message sent via/by Savannah

reply via email to

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