Why are you incrementing index twice (a second time after inserting)?
Why are you incrementing index twice (a second time after inserting)?
Which line does the error appear on? (I'm assuming the error was "not dereferencable".) If the error was on the call line, are we sure that it wasn't complaining about bloom (as opposed to searchhash)?
int i is to increment through the string2 strings, index is to get a value for each hash function of that string
The error doesn't appear on a line, during executing it pops up "debug assertion failed" and "vector subscript out of range"
By placing some cout<< statements the error occurs on the searchhash call line.
I know its not complaining about bloom because my inserthash function works. Also, search works if I do not return a value and don't declare stringtruth (so all lines with reference not included) its prints out everything else required.
Okay, it worked when I took stringtruth.resize out of the loop.
Now, I'm running into an issue. It's calculating everything as a true positive or false negative when it should have some in the other two... is my logic flawed...
Code:for (i = 0; i < size - 1; i++){ myset::iterator it = fp.find(vectorString2[i]); if (it != fp.end()){ if (bloomprediction[i] = 1){ tp++; } if (bloomprediction[i] = 0){ fn++; } } else if (it == fp.end()){ if (bloomprediction[i] = 1){ fpos++; } if (bloomprediction[i] = 0){ tn++; cout << "this tn" << tn << endl; } } }
>> for (i = 0; i < size - 1; i++)
The loop condition should check that i < size, not size-1.
>> if (bloomprediction[i] = 1)
Remember: '=' is for assignment, '==' for comparison.
Last edited by Sebastiani; 10-23-2013 at 08:57 PM.
Code:#include <cmath> #include <complex> bool euler_flip(bool value) { return std::pow ( std::complex<float>(std::exp(1.0)), std::complex<float>(0, 1) * std::complex<float>(std::atan(1.0) *(1 << (value + 2))) ).real() < 0; }