Error X Values Must Be Monotonically Increasing
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack time values must be non-decreasing. Overflow the company Business Learn more about hiring developers or posting ads with us Stack input range must be monotonically increasing react native Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up GSL interpolation error, values must be x values must be monotonically increasing up vote 0 down vote favorite Hi my problem is that my data set is monotonically increasing but towards the end the of the data it looks like it does below ,where some of the x[i-1] = x[i] as shown below. This causes an error to be raised in GSL because it thinks that the values are not monotonically increasing. Is there a solution, fix or work around for this problem? the values are already double precision ,this particular data set starts at 9.86553e-06 and ends at .999999 would the only solution be to offset every value in a for loop? 0.999981 0.999981 0.999981 0.999982 0.999982 0.999983 0.999983 0.999983 0.999984 0.999984 0.999985 0.999985 0.999985 c++ c gsl share|improve this question edited Sep 18 '12 at 15:08 asked Sep 18 '12 at 14:59 pyCthon 3,06473275 I guess I'm a little confused because double precision gives you far more than 6 significant decimal places. Single precision gives you 6. –Matt Phillips Sep 18 '12 at 15:23 it is double precision the problem is its a huge data set and the data gets closer and closer to 1 very slowly –pyCthon Sep 18 '12 at 15:24 add a comment| 2 Answers 2 active oldest votes up vote 2 down vote I had a similar issue. I had removed duplicates by a simple condition operator (if statement) and this did not affect the final result (checked by MatLab). Though, this might be a bit problem-specific. share|improve this answer answered Mar 6 '13 at 18:21 Eugene B 636919 add a comment| up vote 1 down vote If you've genuinely reached the limits of what double precision allows--your delta is < machine epsilon--then there is nothing you can do with the
installing and running ROOT here. Please post bug reports in Jira. Moderator: rootdev Post Reply Search Advanced search First unread post • 2 posts • Page 1 of 1 cecoppola Posts: 76 Joined: Thu Jul 23, 2009 17:55 GSL Interpolator randomly http://stackoverflow.com/questions/12479644/gsl-interpolation-error-values-must-be-x-values-must-be-monotonically-increasin crashes? Quote Unread postby cecoppola » Tue Jun 03, 2014 6:08 I am using this to interpolate function values:Code: Select all const double max = 2147483648;
double nu = rand()/max;
double y[41];
for(int i https://root.cern.ch/phpBB3/viewtopic.php?t=18138 = 0; i < 41; i++) {
y[i] = (double)i;
}
double m1ty2[41];
m1ty2[0] = 0;
for(int i = 0; i < 40; i++) {
m1ty2[i+1] = m1ty[i];
}
ROOT::Math::Interpolator vfind(41, ROOT::Math::Interpolation::kAKIMA);
vfind.SetData(41, m1ty2, y);
double t;
t = vfind.Eval(nu);
Here are the values:i,y[0],m1ty2[0] = 0,0.000000,0.000000i,y[1],m1ty2[1] = 1,1.000000,0.001090i,y[2],m1ty2[2] = 2,2.000000,0.002652i,y[3],m1ty2[3] = 3,3.000000,0.012321i,y[4],m1ty2[4] = 4,4.000000,0.027259i,y[5],m1ty2[5] = 5,5.000000,0.047992i,y[6],m1ty2[6] = 6,6.000000,0.074795i,y[7],m1ty2[7] = 7,7.000000,0.107240i,y[8],m1ty2[8] = 8,8.000000,0.143878i,y[9],m1ty2[9] = 9,9.000000,0.182101i,y[10],m1ty2[10] = 10,10.000000,0.222717i,y[11],m1ty2[11] = 11,11.000000,0.264620i,y[12],m1ty2[12] = 12,12.000000,0.306531i,y[13],m1ty2[13] = 13,13.000000,0.347742i,y[14],m1ty2[14] = 14,14.000000,0.387842i,y[15],m1ty2[15] = 15,15.000000,0.426756i,y[16],m1ty2[16] = 16,16.000000,0.465835i,y[17],m1ty2[17] = 17,17.000000,0.504637i,y[18],m1ty2[18] = 18,18.000000,0.542549i,y[19],m1ty2[19] = 19,19.000000,0.579252i,y[20],m1ty2[20] = 20,20.000000,0.614601i,y[21],m1ty2[21] = 21,21.000000,0.648580i,y[22],m1ty2[22] = 22,22.000000,0.681212i,y[23],m1ty2[23] = 23,23.000000,0.712527i,y[24],m1ty2[24] = 2
by kmerrima, 8 years ago) Ok, I'm trying this. Line 1/* interpolation/interp.c2 * 3 * Copyright (C) 2007 Brian Gough4 * Copyright (C) 1996, 1997, 1998, 1999, 2000 Gerard Jungman5 * 6 * This program is https://wiki.csc.calpoly.edu/481-W09-BodyStereo/browser/cust-gsl/gsl/interpolation/interp.c free software; you can redistribute it and/or modify7 * it under the terms of the GNU General Public License as published by8 * the Free Software Foundation; either version 3 of the License, or (at9 * your option) any later version.10 * 11 * This program is distributed in the hope that it will must be be useful, but12 * WITHOUT ANY WARRANTY; without even the implied warranty of13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU14 * General Public License for more details.15 * 16 * You should have received a copy of the GNU General Public License17 * along with this program; if not, write to values must be the Free Software18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.19 */2021/* Author: G. Jungman22 */23#include