Hi Yaron,

 > I am trying to use ViennaCL with Ceemple and encountered a possible bug.
>
> In amg_base.hpp:1045, iter2 is decremented (code below). However,
> nothing (at least locally in this function) prevents iter2 from
> being pointlist.begin() and then the result is undefined, see
>
> http://stackoverflow.com/questions/18225651/is-stdvectorbegin-1-undefined
>
> Also, why are both iter and iter2 required? it seems iter alone could do
> the job.

thanks for reporting. From what I can tell, you are totally right. 
Unfortunately, the student who contributed this code moved to the 
private sector and is no longer available, so I can't tell whether there 
are any invisible guarantees on the set.

The AMG code is subject to significant refactoring, I added your message 
to the associated issue:
   https://github.com/viennacl/viennacl-dev/issues/16

Do you happen to have a test case where this particular piece of code 
triggers an error? A simple fix would indeed be to just remove the use 
of iter2, which is probably not a significant performance hit anyway.

Thanks again and best regards,
Karli


------------------------------------------------------------------------------
_______________________________________________
ViennaCL-devel mailing list
ViennaCL-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/viennacl-devel

Reply via email to