Exception in thread "AWT-EventQueue-0"
i get following error:
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: x (50
.998998998999) is outside the range of data points (51.0 to 50.0
at flanagan.interpolation.CubicSpline.interpolate(CubicSpline.java:217)
at flanagan.plot.Plot.graph(Plot.java:1316)
at flanagan.plot.PlotGraph.paint(PlotGraph.java:126)
at sun.awt.RepaintArea.paintComponent(RepaintArea.java:248)
at sun.awt.RepaintArea.paint(RepaintArea.java:224)
at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:254)
at java.awt.Component.dispatchEventImpl(Component.java:4031)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:234)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
help me. its urgent.
-thanks.
> i get following error:
The argument looks like it's within the range to me. However, the data points are in descending order, which is what's creating the problem. Mr. Flanagan's [url=http://www.ee.ucl.ac.uk/~mflanaga/java/CubicSpline.java]source code[/url] contains the following guard clause:
if (xx<this.x[0] || xx>this.x[this.nPoints-1]){
throw new IllegalArgumentException("x ("
+xx+") is outside the range of data points ("
+x[0]+" to "+x[this.nPoints-1]);
}
Since 50.99 is less than 51.0 and greater than 50.00, you get the IllegalArgumentException. Try changing the range so that the values are in ascending order.
> help me. its urgent.
It's not urgent to me, and your urgency is of no concern. Don't flag your post "urgent". It looks like you think you deserve some kind of special attention above other people asking questions.
~
> The argument looks like it's within the range
> to me. However, the data points are in descending
> order, which is what's creating the problem. Mr.
> Flanagan's
> [url=http://www.ee.ucl.ac.uk/~mflanaga/java/CubicSplin
> e.java]source code[/url] contains the following guard
> clause:
Heh heh!Hookd on fonix werkd fer mee! Apologies to the OP. I'll remember to re-read the post next time I decide to be a ****.
*bows to the mightier Java/English speaker and runs for coffee*
> so it can be ascending/descending...
Dr. Flanagan, the author of the CubicSpline class you're using, says it can't. I've shown you the logic from that class. So, either order your array according to expectations, or contact Dr. Flanagan with your request to change his source code.
~
Sir,
is/are there any other class/classes for plotting :-
1)delay[x] vs x for 10000 values of x (through for loop)
2)a 2D array of double elements. (thru for loop)?
i was using following technique to plot by flanagan's class:
for(int x=0;x<no_of_packets;x++) {
plotdata[1][x]=(double)playout_delays[0][x];
plotdata[0][x]=(double)x;
plotdata[2][x]=(double)x;
plotdata[3][x]=(double)delay_array[x];
}
for(int x=0;x<no_of_packets;x++) {
plotdata[1][x]=(double)playout_delays[1][x];
plotdata[0][x]=(double)x;
plotdata[2][x]=(double)x;
plotdata[3][x]=(double)delay_array[x];
}
these plotdata[][] was then passed to flanagan's plotting class.
-thanks.>