Commit Graph

134 Commits (044582ca4a0ac3604975dfb42f4799788dde22f1)

Author SHA1 Message Date
Frank Dellaert ba91bd53fd Add better error reporting 2019-06-15 11:12:19 -04:00
Duy-Nguyen Ta 1cdc228d6a remove trailing spaces 2019-02-11 10:58:34 -05:00
dellaert c5a0f1a839 Undo unrelated changes 2017-08-06 17:42:20 -07:00
dellaert d752c9e249 Re-wrote constructor overloading logic which saves a lot of overhead 2017-08-06 14:58:23 -07:00
dellaert 2374347e69 Make internal, overloaded static methods cdefs to avoid call code/overhead 2017-08-06 13:25:54 -07:00
dellaert 6068166d2b Moved wrapper class signature to Class.cpp 2017-08-06 12:21:26 -07:00
dellaert 74a33ff222 Re-structured argument overloading to call a common function 2017-08-06 11:07:13 -07:00
Duy-Nguyen Ta 869dc811b0 graceful dynamic cast failures 2017-03-21 02:34:04 -04:00
Duy-Nguyen Ta 07b1bbfe7f remove namespace requirement for cython wrapper
Only for unittesting wrap geometry.h, not yet tested in real python/cython
2017-03-18 18:29:53 -04:00
Duy-Nguyen Ta 16a1643d17 gracefully rasing exception when trying to create obj of a class with no constructor 2017-03-15 22:47:14 -04:00
Duy-Nguyen Ta b7efaf8c3f special ctor signature to be used with cyCreateFromShared
so that calling the default ctor by mistake on a class without the default ctor will respond nicely with an exception instead of a seg-fault
2017-03-08 15:22:16 -05:00
Duy-Nguyen Ta 5a8bd5afda [cython] bypass a problem with no default constructor
Add this to support cyCreateFromShared, which needs to call the default Python constructor to construct the Python object before reassigning the internal shared ptr to the c++ object.
2017-03-06 01:18:19 -05:00
Duy-Nguyen Ta da8a8a3bb0 remove unused argument 2016-12-16 19:24:49 -05:00
Duy-Nguyen Ta f154be176f Major update to generate proper Cython pxd header files which could be included in other projects/modules
All cdef (class, functions, variables) declarations are moved to pxd. Implementations of those cdefs and normal Python def are in pyx.
See: http://cython.readthedocs.io/en/latest/src/userguide/sharing_declarations.html#sharing-extension-types
2016-12-16 00:23:45 -05:00
Duy-Nguyen Ta 0cef864663 __cinit__ --> __init__ 2016-12-05 11:00:33 -05:00
Duy-Nguyen Ta 4439968f05 tabs to spaces 2016-11-30 05:56:07 -05:00
Duy-Nguyen Ta 5958b2397c resolve overloads via type checking, simplify Values's insert and update, more friendly Matrix and Vector utils
Keyword arguments are not needed anymore
2016-11-29 11:58:22 -05:00
Duy-Nguyen Ta 74f80fea4f [refactor] more understandable function names
Clearing confusions between pxd and pyx classes and objects!
2016-11-22 12:13:33 -05:00
Duy-Nguyen Ta fbcb9041f2 big refactoring, support method/static method overloading 2016-11-20 09:24:43 -05:00
Duy-Nguyen Ta 9f58d21030 support dynamic cast from all parents/virtual base 2016-11-18 11:00:15 -05:00
Duy-Nguyen Ta acf3c9d259 proper overloading constructors 2016-11-16 17:51:03 -05:00
Duy-Nguyen Ta 2433cbd8e8 Remove copy constructor assumption. Manually add copy constructors. Remove dependency on default constructor (some like Optimizers and Marginals don't have the default constructor). Remove cyCreateFromValue. Ignore variable name when checking overload similarity. 2016-09-13 17:11:23 -04:00
Duy-Nguyen Ta 53dbe25c50 Cython pxd: putting template instantiations at the correct place right after a template class 2016-09-12 18:36:45 -04:00
Duy-Nguyen Ta 06ab94766c improve inherited method removal
Checking nontemplateMethods_ against parent's methods_ because:
1. Only nontemplateMethods_ are serialized to Cython's pxd, which doesn't like duplicate methods
2. Parent's methods_ list has every methods inherited from grand and grand-grand parents, etc., so we don't need to check higher levels.
Also refactor to reduce nested code
2016-09-12 12:38:04 -04:00
Duy-Nguyen Ta e35f0c3f50 remove inherited functions for Cython classes. Testing HessianFactor with debug info... 2016-09-12 11:05:28 -04:00
Duy-Nguyen Ta 1b04c6713b handle "This". Wrap all geometry 2016-09-11 18:14:19 -04:00
Duy-Nguyen Ta 948e6262db first version ever compiled.
... Not without some changes:
- add traits<size_t> in Key.h
- add these to JacobianFactor:
    explicit JacobianFactor(const Eigen::Map<Vector>& b_in);
    Vector py_getb() { return getb(); }
    Matrix py_getA() { return getA(); }
---------
... Remaining corner cases:
 ☐ Eigency: Map[] to Block
 ☐ Eigency: ambiguous call: A(const T&) A(const Vector& v) and Eigency A(Map[Vector]& v)
 ☐ Fix return properly
   ☐ handle pair
 ☐ Fix method template of Vector/Matrix: template argument is [Vector] while arugment is Map[Vector]
 ☐ Constructor: generate default constructor? (hack: if it's serializable?)
 ☐ Constructor: ambiguous construct from Vector/Matrix
 ☐ Key and size_t: traits<size_t> doesn't exist
 ☐ [Nice to have] Auto delete duplicate methods in derived class
2016-09-10 19:50:12 -04:00
Duy-Nguyen Ta d719b9b7ae ctypedefs for all instantiated classes 2016-09-09 21:50:55 -04:00
Duy-Nguyen Ta 10f510119a pyx class methods with arguments/return type casting 2016-09-09 18:37:48 -04:00
Duy-Nguyen Ta 56c0d2a65e pyx wrapper for static methods 2016-09-09 16:39:47 -04:00
Duy-Nguyen Ta 1e84da1cfa pyx: add constructors and fixing inheritance 2016-09-09 15:52:44 -04:00
Duy-Nguyen Ta 2d3d6d99f9 standardize function name to emit_cython_[pxd/pyx]. Remove first level namespace from Cython object names.
Examples: gtsam_Point3 --> Point3, gtsam_noiseModel_Base --> noiseModel_Base
2016-09-09 12:01:51 -04:00
Duy-Nguyen Ta 16345e4ba1 revert changes in methods_, handle template methods for Cython pxd in a less instrusive way 2016-09-09 07:49:42 -04:00
Duy-Nguyen Ta 40da298f68 emit methods to pxd, change the way template methods are handled
pxd allows template methods, whereas the current scheme instantiates/expands all template methods and add them to the same methods_ container. The new scheme treats them all separately: nontemplated methods in methods_, template methods in templateMethods_, and template methods after instantiation in expandedTemplateMethods_.
2016-09-09 07:26:11 -04:00
Duy-Nguyen Ta 6e96e095f3 remove unused function 2016-09-09 07:18:58 -04:00
Duy-Nguyen Ta ecde851d8c [inprogress] cython wrapper 2016-09-08 13:33:32 -04:00
Yao Chen d1ea1015a9 Replaced BOOSE_FOREACH with for in wrap folder. Tested the changed code locally: successful. 2016-05-20 21:41:18 -04:00
Frank 2060b09a2b Avoid calling default constructors and/or vector 2016-02-11 19:03:11 -08:00
dellaert 699943d632 Changes to wrap from FixedValues branch/PR. Since unrelated to that PR and useful for OptionalJacobian wrapping in py_wrap, made this a separate PR. 2016-02-07 20:33:48 -08:00
dellaert aceeb2037b Template tightening 2014-12-01 20:29:35 +01:00
dellaert 8eb6393c92 Using TemplateGrammar 2014-12-01 14:35:02 +01:00
dellaert ba51b02cf0 Moving to optionals fixed template dreturn argument!
Merge branch 'qualified' into grammar_wrongtest

Conflicts:
	wrap/Class.cpp
	wrap/Function.h
	wrap/Qualified.h
	wrap/ReturnType.h
	wrap/tests/testWrap.cpp
2014-12-01 09:48:56 +01:00
dellaert 6d916c6b75 Semi-private name/namespaces 2014-11-30 20:20:13 +01:00
dellaert 14ef786dfe Removing empty in favor of boost::optional 2014-11-30 10:38:24 +01:00
dellaert c609666ab9 More informative fail 2014-11-29 16:13:23 +01:00
dellaert 6c24fc2aca Python prototype 2014-11-14 17:47:25 +01:00
dellaert 7a4748d3dc Simplified method/function hierarchy drastically, and renamed bottom addOverload to initializeOrCheck to reflect what it does. Also, gratuitous re-ordering of addOverload arguments. 2014-11-14 16:44:08 +01:00
dellaert e07da1c82d Added matlabName, and made data members private 2014-11-13 22:43:29 +01:00
dellaert 8ef78db9d8 Fixed template expansion of classes 2014-11-13 21:53:58 +01:00
dellaert 09e3c7df9f struct Constructor: public ArgumentOverloads 2014-11-13 21:34:59 +01:00