|
From: | Colin Macdonald |
Subject: | Re: Doubs in Gsoc chebfun project: getting error while running g=f+1, needed tips to resolve it. |
Date: | Thu, 8 Mar 2018 10:04:23 -0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 |
On 2018-03-06 05:52 PM, Saurav Malani wrote:
As I was proceeding as per your instructions in octave gsoc page under chebfun, I am facing few problems. 1. As you told that "f = chebfun(@(x) sin(x), [-2 6])" and f(pi) should work. I would say yes it works fine, but when I cross checked the answer with matlab answer, there was a significant difference. octave output:1.1102e-16 matlab output:3.3307e-16
Well, those are machine precision. So I would say difference is (probably) insignificant. Try f(pi/3) for example and compare those. Difference b/w Octave and Matlab should be O(eps)---if not, that's a bug.
2. Also, as you mentioned that g=f+1 should also work. But, when I try this, I get this error.g=f+1g = chebfun column1 (1 smooth piece) interval length endpoint values [ -2, 6] 24 0.091 0.72 vertical scale = 2 error: 'infoJ' undefined near line 47 column 19 error: called from dispData at line 47 column 1 disp>colDisp at line 76 column 22 disp at line 50 column 9 display at line 34 column 5g(pi)error: out(_,2): but out has size 1x1 error: called from subsref at line 112 column 17. so, to debug it, I just want to know what is the first function (.m file) to be called when we enter something like g=f+1. so that I can track further for which function is being called and may try to figure out region for possible problem? Also, in general what is the best method in octave to debug, I am using grep command to find where it is used or called and in this way I am proceeding, but this is a bit slow and inefficient method. Any tips on this?
What version of Octave? I was tested with a recent development version. I think I get this same error on Octave 4.2.1.
You can try and debug it by looking at the list of functions called ("distData, disp->colDisp", etc.
Look at the output of "class(f)" to see where to look for these functions...You will need to be able to work with the development version of Octave if you want to do GSoC so maybe there? This should be documented on the wiki.
Also, I looked into the github repo[1] as pointed out, to be a good place to start. But, to be honest I didn't deduce much from it. Just found that you changed f.funs to ffuns. I tried tracking this also, but did not found anything.
>> [1] https://github.com/cbm755/chebfun/commit/e20b0ad2dc89cfe8e50ba461b864eff7d5bbef17
>
Also, I didn't understand why you wrote ffuns=f.funs, what difference is this making?
Why not try switching it back and see what happens...?It makes a difference because of the way object oriented programming works in Octave. There are subtle differences in how OO is implemented in Octave versus Matlab. The task here is whether we can workaround that difference (in chebfun code) or whether its a bug in Octave (and needs to be fixed in Octave).
best, Colin
[Prev in Thread] | Current Thread | [Next in Thread] |