Skip to content
This repository was archived by the owner on Dec 30, 2023. It is now read-only.

Conversation

@larsmans
Copy link
Contributor

@larsmans larsmans commented Jul 3, 2014

Here are some fixes for type-safety and exception safety, as well as some small optimizations. See the commit messages for details.

larsmans added 4 commits July 3, 2014 17:23
XXX the at() members of PointCloud[T] can also throw:

>>> a = np.random.randn(10000, 3).astype(np.float32)
>>> p = PointCloud()
>>> p.from_array(a)
>>> p[10000]
terminate called after throwing an instance of 'std::out_of_range'
  what():  vector::_M_range_check
Aborted

... but a bug in Cython's code generator prevents "except+" from
working with a function returning a reference.
Using pointers to work around broken C++ reference support in Cython.
operator[] seems to be completely broken in Cython.

E.g.

>>> a = np.random.randn(10000, 3).astype(np.float32)
>>> p = PointCloud()
>>> p.from_array(a)
>>> %timeit p.to_array()
10000 loops, best of 3: 23.4 µs per loop

Previously 50.8 µs per loop.
@nzjrs nzjrs merged commit 5cd702c into strawlab:master Jul 7, 2014
@larsmans larsmans deleted the fixes-optimizations branch July 7, 2014 12:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants