Hey everyone,
I'm conducting research and need to export a file containing data from one program, rearrange and possibly interpolate, for upload to another program. The data contains values at x1 and y1 points, I have other x2 and y2 points where I need values. My program looks if the x's are equal and y's are equal and stores the data, if not it interpolates. Currently the input file requires no interpolation and contains all the x2 and y2 points required, but only some are stored. When y2 (or r as called in the program) is = 0.3 it is just ignored, along with some other numbers. I've used cout to compare all the values before they are stored, and when they are printed out they show that they are both equal and formatted the same. So the value should be stored, but it isn't.
I thought it was because some zero's where stored as 3e-20 or some pseudo zero, I fixed that however. I've tested it by manually putting in values that are equal right before the if statement that stores, it works then. The rN and zN values give the exact nodes I need (I've checked by printing out), the file I've read in contains all these values, however some just won't trigger the if statement (for example r=0.3).
Using ubuntu, notepad++,and g++ to compile.
Thank you very much for your help, it's been days.
Regards,
Nick
Code:
https://1drv.ms/t/s!ArSAc7sTeAlag1yqCHVHPkRCvJsH?e=qR7Abv
This is the data file, it is named "comMag.txt", it is a sample / simple one with no interpolating required. First two columns are garbage, then they are z,r, bz, br, bphi. The part I need help with is when zN == z and rN ==r the if statement isn't entered.
datafile:
https://1drv.ms/t/s!ArSAc7sTeAlag1vHVZIHoFGLkWop?e=esQPHZ