bugGNU Octave - Bugs: bug #32040, ppval fails after use of fnder

 
 

bug #32040: ppval fails after use of fnder

Submitted by:  None
Submitted on:  Mon 03 Jan 2011 07:05:35 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: Kai Habel <kahacjde>
Originator Name: JuanPiOriginator Email: -unavailable-
Open/Closed: ClosedRelease: dev
Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Fri 15 Apr 2011 09:27:24 AM UTC, comment #8:

Hello,

I have finally pushed this changeset. Since it changes the interpolations functions as well, there is a risk that something does not work as expected. I have applied it to the default branch only.

Kai

Kai Habel <kahacjde>
Project MemberIn charge of this item.
Wed 16 Mar 2011 11:37:18 PM UTC, comment #7:

I tried the tests and demos for interp1, mkpp, pchip, ppval, and spline.

Everything work as expected.

Ben Abbott <bpabbott>
Project Member
Wed 16 Mar 2011 09:09:51 PM UTC, comment #6:

Hello,

this took longer than expected. I have a working changeset, which fixes the incompatibilities with matlab, like the structure filed names and the handling of ND arguments. So, please give it a try and report any problems you observe. Since I have touched interp1 as well, there is a risk that I have broken code that depends on interpolation. I have run a lot of tests, but there might me some hidden issues.

The script of JuanPi works if ppder is called instead of fnder.

Kai

(file #22940)

Kai Habel <kahacjde>
Project MemberIn charge of this item.
Wed 09 Feb 2011 07:59:37 PM UTC, comment #5:

Just an intermediate comment. I have decided to change the pp structures to be compatible with matlab. Until now we were incompatible to large degree with the current matlab versions with respect to the shape of the coefs matrix and other things.

The good news is that I have now compatible mkpp, unmkpp, ppval functions. Currently I am working on spline, pchip, and interp1 to make them also compatible.

After that I have to work on the demos and tests. So this might take some more time.

Kai

Kai Habel <kahacjde>
Project MemberIn charge of this item.
Thu 06 Jan 2011 01:45:22 PM UTC, comment #4:

I don't have answers to the questions raised, but I will have a look at the problem described by Juan.

Kai

Kai Habel <kahacjde>
Project MemberIn charge of this item.
Thu 06 Jan 2011 12:45:54 PM UTC, comment #3:

I noticed the difference in fields as well. Perhaps ...

  1. Change the structures to that used by ML.
  2. Write a simple function do convert between the current structure and the ML one, and call it when needed.

Regarding the size change, I'me not certain, but I suspect it is/was intended to allow more than one piecewise polynomial (see "demo mkpp").

My spare time for Octave is directed to fixing printing on WIndows (MinGW). Once that is done, I can take a look at this. However, it would better if someone more familiar with how this work and where it is used took a look.

Ben Abbott <bpabbott>
Project Member
Thu 06 Jan 2011 07:26:15 AM UTC, comment #2:

It appears the Matlab spline and fnder functions create structures with the fields 'form', 'breaks', 'coefs', 'pieces', 'order', and 'dim', but Octave produces structures with the fields 'x', 'd', 'P', and 'orient' (for both) and also 'k' for fnder. What's the reason for the difference? Is this something that we should try to fix before the release? I imagine someone somewhere depending on these fieldnames, so they might as well be the same...

Also, it seems the orientation of the P field has changed. For the example below, pp.P is 1x9x4 now, but in 3.2.4 it is 9x4. Why has this changed? In Matlab, it is apparently 9x4 (and called coefs instead of P).

John W. Eaton <jwe>
Project Administrator
Tue 04 Jan 2011 02:50:55 PM UTC, comment #1:

I noticed the demo for mkpp no longer runs. Perhaps the changeset which improved the compatibility with ML has resulted in breaking some older code. The changeset is linked to below.

http://hg.savannah.gnu.org/hgweb/octave/rev/31900e17b5f5

However, it doesn't look to me like the problem is with mkpp, but with fnder. Looking at ppd, there are 9 different regions for which polynomials must be specified. However, ppd.P only includes coefficients for 8 regions. Thus when the evaluating within the last region an error occurs.

I've cc'd Kai Habel.

Ben Abbott <bpabbott>
Project Member
Mon 03 Jan 2011 07:05:35 PM UTC, original submission:

The following lines where giving no errors in Octave 3.2.4 (Ubuntu 10.10)

In 3.3.54 and the repository version the last line gives the following error

If I change xi for

then

works fine

output of

Checked in the dev compiled for Ubuntu 10.10

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #22940:  Changeset.pp added by kahacjde (29KiB - application/octet-stream)
file #22340:  config.status added by None (132KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by siko1056 (Updated the item)
  • -unavailable- added by kahacjde (Posted a comment)
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by bpabbott (Posted a comment)
  • -unavailable- added by bpabbott
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 28 Sep 2015 02:48:03 PM UTCsiko1056StatusPatch Submitted=>Fixed
    Fri 15 Apr 2011 09:27:24 AM UTCkahacjdeOpen/ClosedOpen=>Closed
    Wed 16 Mar 2011 09:09:51 PM UTCkahacjdeAttached File-=>Added Changeset.pp, #22940
      StatusIn Progress=>Patch Submitted
    Sun 16 Jan 2011 07:42:56 PM UTCkahacjdeStatusNone=>In Progress
    Sun 16 Jan 2011 07:42:17 PM UTCkahacjdeAssigned toNone=>kahacjde
    Tue 04 Jan 2011 02:50:55 PM UTCbpabbottCarbon-Copy-=>Added -unavailable-
    Mon 03 Jan 2011 07:05:35 PM UTCNoneAttached File-=>Added config.status, #22340

    Back to the top


    Powered by Savane 3.1-cleanup1