NemoMath is a math-library for robotics and learning... so why don't you just use Eigen 2???
The answer is twofold:
1.: NemoMath takes care of shared ownership issues in robotics/learning applications and systems.¶Use Eigen (or similar Libs) in something more complex than one method of spaghetti code and you need to think about two questions:
- Who is responsible for deleting an object?
- Who is allowed to modify an object (mutability) and when is a copy necessary?
The first thing that people usually come up with are smart-pointers like
boost::shared_ptr. It solves the problem when to delete an object. But, it makes the mutability-issue even worse, since it is not transparent to const-correctness. There is always a danger that some other objects holds a smart pointer on your vector and modifies it. Also, you lose a lot of the original API convenience, such as mathematical operators, which are not directly usable through a smart-pointer.
- Highly efficient intrusive-counters on internal data-objects. Passing a
nemo::MathVectoris almost as efficient as passing a plain C-pointer.
- Copy-on-write on all Vector and Matrix objects. You can pass them without expensive copying been performed. Once a write-operation takes place, the library takes care of a copy.
Due to these two features, working with
nemo::Matrix feels like using simple objects, with which you can do "value-based" programming.
Yet it avoids all the typical overhead. See source:/trunk/nemomath/examples/ExampleVector.cpp
2.: NemoMath goes far beyond linear algebra.¶Ultra-flexible Functor API
- Define your own Mappings and combine them flexibly: source:/trunk/nemomath/examples/ExampleMapping.cpp
- Or just use the operators to express things simply and elegantly: source:/trunk/nemomath/examples/ExampleMappingArithmetics.cpp
- Mappings are invertible by a simple
inverse()function call (see MappingInversion details).
- Allows flexible interaction (for instance of vectors and matrices) with functor objects: source:/trunk/nemomath/examples/ExampleCollections.cpp
- Generic TimeSeries data-type that can accessed and modified in an associative or index-based manner, and ensures the ordering semantics of time: source://trunk/nemomath/examples/ExampleTimeSeries.cpp
- All these data-structures provide STL-compliance, including iterators.