Hi guys,
I have a program which generates lots of data points in 2D (x and y co-ordinates). Perhaps 1,000,000+ of these points. These are floating point numbers. The values all fall within a...
Type: Posts; User: strokebow
Hi guys,
I have a program which generates lots of data points in 2D (x and y co-ordinates). Perhaps 1,000,000+ of these points. These are floating point numbers. The values all fall within a...
Do you have a code example for read n bytes and only use the last one please?
thanks
Hi,
I'm a little rusty.
I am currently reading several values one after another from a file like so:
ifstream f;
double x;
Thanks for your questions. Its helping me to properly form the problem.
The range is variable. between -circle radius and + circle radius.
How do you mean integral?
I want the grid size to...
So, the (x, y) data refers to a position in a circle.
I need to make the data meaningful. By that I want to know where these x,y points are situated on the circle, how they are distributed. In...
I am still thinking about the method. When i rush these seemingly simple tasks it often ends up with poor hard coding. I am still considering the best method.
I think post processing is what I...
I suppose another way to do this would be afterwards.
In real time would be nice. However, post processing wouldn't be so bad.
i.e.) If I had ~500,000 x and y values between -range and +...
Hi,
I need some ideas/advice on how to code the following:
I have two random numbers which are generated and are related to each other (representing x and y co-ordinate). These random numbers...
Hi,
I have a few lines of text, looks something like:
I want to make this in to a CSV.
Thanks both for the help!
All doubles.
Oh I see. So what is the best way to perform (1/6):
static_cast<double>(1/6)?
Any ideas why these 2 expressions (as far as I can see = exactly the same), give vastly different results:
Y = Y + (T/6)*(2*V + 2*P + 2*P + T*S);
I make the following change (introduce T in to...
Furthermore,
How would I do this in the fastest possible way to also take account of negative values.
i.e. the maximum value irrespective of sign.
Would it be just a case of:
xMax =...
Thanks!!
So basically, just keep a variable for the max.
I suppose its quicker to just do:
xMax = (X > xMax)?X:xMax;
yMax = (Y > yMax)?Y:yMax;
Whereby, if X is greater than xMax...
Thanks to both!
This parameter is relating to maximum position of a body (from a given reference) which is constantly being updated due to other equations being iterated which determine the bodies...
Hi,
Could do with some advice here...
My Aim/Motivation:
I have a parameter which is constantly updated throughout the code. I want to find the value for this parameter at its maximum.
I...
Points taken :-)
Hey, thanks to everyone.
Got it sorted. Works nicely. Ended up implementing as Jim suggested. Cheers Jim!!!!
Also, is it really necessary to open the ifstream file?
Couldn't I just store the data in to memory?
Cheers Jim. I'll give that a go now!
Thanks also laserlight for the heads up
Thanks for reply.
Ok, so I use ios::ate instead of ios::out
But I am not sure how that will allow me to truncate the file?
Thanks very much laserlight
I like this idea of truncating the file. How would I go about that?
thanks
Thanks for suggestions!!
Okay, so how about this:
- I copy the file content in to memory (up until the line that I specify).
- Delete the file (can i do this independent of platform?)
- open...
Hi thanks,
Basically this is what I have. Note: f is declared as fstream
f.open(Name_v, ios::binary|ios::in|ios::out);
long int posl;
Thanks again for replies and advice; it is much appreciated!
It seems as if the close function just won't do for me... because it is likely that the program will be closed in a proper manner and...
Thanks both for the advice and help!
I need to re-think my approach: Is there no way to save your files in c++? If I could 'save' them periodically then that would suffice and in the event of a...