I wrote a class for seprate some task into two sub-tasks.
e.g. make the additions of two vectors of same size.
I designed it as a like binary function, I mean one of the input pointers is also the output.
I also supposed the input and output had the same size.
Then I wrote a apply a slight modification in order to manage the situation where the input and the output don't have the same size.
e.g. the horizontal addition of the elements of a vector.
Since this modification something weird happen.
I apply it for process histograms of unsigned short.
The histogram is store in a std::vector<std::uint64_t>
of size 65536.
I want to make the addition of two histograms in one and clear the other.
At the moment where my class split itself the input in two output elements something mysterious happen.
65536 / 2 = 1099511660544.
Like everyone I sustpected a saturation of range what could have been copied into another type.
But for manage the size I use std::size_t
EVERY WHERE. I am working on 64 bits machine so I do think it's not a saturation issue.
Any help would be helpfull.
Thanks in advance.
Aucun commentaire:
Enregistrer un commentaire