laurentkneip / opengv

OpenGV is a collection of computer vision methods for solving geometric vision problems. It is hosted and maintained by the Mobile Perception Lab of ShanghaiTech.
Other
1.01k stars 354 forks source link

Access arrays by pointer arithmetic. #86

Open paulinus opened 5 years ago

paulinus commented 5 years ago

This PR accelerates the python binding by about 20%. The trick is to access the python data using pointer arithmetic rather than calling array methods. This prevents bounds checks on every access to the array.