Where is my data?

  • Thread starter Thread starter MyCatAlex
  • Start date Start date
M

MyCatAlex

Guest
A peculiar situation bothers me and it should be resolved. I am building a C++ superstructure on MFCaptureD3D as per github.com. One of the first steps is to write about 3 M floating point numbers in a SSD external drive. I use a blueprint provided graciously by user RLWA32

The writing is done in this loop:

for (int mm = pcom.mmMin; mm <= pcom.mmMax; mm++) // 5 values of mm
{
res = (double)LegendrePolynomials::normSelector(cos(theta), ll, mm);
res *= pcom.factorArr[(int)diag]; // peripheral attenuation/modulation
// selection of the pixel input point by point
counter += 1; // exception below
pfRArray [counter] = res * cos(phi * (float)mm); // real part
pfIArray [counter] = res * sin(phi * (float)mm); // imaginary part
}

It seems the writing takes place but I am not sure. When I open the SSD and look at the file it shows 0 KB, However, when I read the data with

ReadUsingMapping(_T("SphHarm_R.dat"));
ReadUsingMapping(_T("SphHarm_I.dat"));

I get a long stream of floating point numbers. Although I cannot be sure they are the same numbers that my code generated and stored, I know that they are bona fide special functions. (1) they are floating points. (2) They all have absolute values between 0.0 and 1.0 with the vast majority close to 1.0. (3) They seem to be snapshots of periodic functions, (4) roughly half of them are negative and the other half is positive. I know they are Spherical Harmonics. How come the file that is being read shows 0 KB? And when I open it I see no numbers.

I therefore tried to read them with a different method.

Here is the code which did not compile.

// DEBUG
ofstream WriteFile;
ifstream ReadFile;
ReadFile.open(_T("SphHarm_R.dat"));
WriteFile.open(_T("F:\T1.txt"));
for (int ii = 0; ii <= 100; ii++)
{
WriteFile << " " << ii << " " << ReadFile[ii] << endl;
}
// DEBUG ENDS

I got this error:

Severity Code Description Project Path File Line Suppression State
Error C2676 binary '[': 'std::ifstream' does not define this operator or a conversion to a type acceptable to the predefined operator MFCaptureD3D C:\CPlusPlus_Projects\MFCaptureD3D\MFCaptureD3D C:\CPlusPlus_Projects\MFCaptureD3D\MFCaptureD3D\device.cpp 1337

How come, the file into which so much data has been written, shows 0 KB? And it seems this information can easily be read.

I need to resolve this problem. Am I making a mistake somewhere?

Thanks MyCatAlex

Continue reading...
 

Similar threads

Back
Top