I make quite a heavy usage of the range1() functionality and found that it does not work as I would expect it to when e is less than b. For example for(auto i : range1(3,0) ) just keeps counting upwards instead of doing nothing.
Python ranges work differently and I think the idea of these c++ ranges is to mimic the python behavior. In any case, trying to make such a range should at least be caught somehow.
As far as I understand only line 57 of iterate.h needs changing by replacing != by <= (maybe >= too many negations):
|
return curr_ != other.curr_; |
I make quite a heavy usage of the range1() functionality and found that it does not work as I would expect it to when
eis less thanb. For examplefor(auto i : range1(3,0) )just keeps counting upwards instead of doing nothing.Python ranges work differently and I think the idea of these c++ ranges is to mimic the python behavior. In any case, trying to make such a range should at least be caught somehow.
As far as I understand only line 57 of iterate.h needs changing by replacing != by <= (maybe >= too many negations):
ITensor/itensor/util/iterate.h
Line 57 in 92f3936