Comments (4)
Hi, I'm the author of minieigen.
A big issue is that in Eigen, all intermediary results are expression templates, thus each of them is a new type. That's why many operators need to wrapped so that they return the expression template evaluated. If you have some initial implementation of how to go header-only, that would be great.
Also note that minieigen is almost entirely header-only (and templated), it just has a few small .cpp files which register the wrappers in python.
from python.
Hi @eudoxos , I am aware of your work on minieigen and I remember when you announced it on the eigen ML a while back :-)
After having to do alot of bindings between C++ and eigen in function signatures, I found the path of least resistance, though still required a decent amount of registration calls, was to implicitly map eigen types to/from numpy arrays. This means that operations are performed based on numpy code and it's like a shared memory communication. The bad thing is that now there will be subtle floating point differences between eigen implemented functions and numpy's. On the other hand, it drastically reduced the complexity of Eigen's soup of expression templates and other compile time/type issues. Perhaps the functions we'd want to export for using eigen to implement some operations on numpy ndimages would then provide the way to use Eigen to provide the implementation when needed.
I think this actually might be the best path forward, especially if Boost.Numpy gets integrated - what do you think?
from python.
Hi @nevion, that sounds like a very good idea, one will have numpy or eigen use the same chunk of memory as input for its ops. I am not very familiar with numpy on the memory level, can't help much unfortunately. Is Eigen's alignment a possible issue, or that is handled fine by numpy?
The only drawback which I see is that people will have hard(er) time transitioning from numpy to eigen (from python in c++) -- the advantage of minieigen is that you can prototype the code in python and almost cut&paste into c++ and it will do the same thing.
By all means, go forward.
from python.
Recommended: http://pybind11.readthedocs.org/en/latest/, a c++11-only lighter, header-only evolution of good old boost::python. Especiall the chapter on buffer protocol and numpy arrays.
from python.
Related Issues (20)
- warning: missing field 'tp_version_tag' initializer [-Wmissing-field-initializers]
- `no_proxy_helper` should not access `Container::value_type`
- Boost.Python doesn't build under MSVC... HOT 4
- NULL ptr deref in instance_dealloc
- About `No Python class registered for C++ class`,throw errors. HOT 1
- Is it possible to programmatically retrieve C++ class name / Python class name mapping ? HOT 1
- __qualname__ on embedded/inner classes is wrong
- Outdated reference to bjam in examples dir
- Broken URL in build/Jamfile HOT 2
- Qt binding to python - undefined symbol HOT 2
- Compilation failure using numpy 2.0.0b1 HOT 4
- Is Boost.Python is bound to specific python version? HOT 1
- Jupyter Kernel Notebook Dies After Starting Threaded Class HOT 4
- Cannot import Boost.Python from Python 3.11 HOT 4
- Minimal Boost Python example not working HOT 7
- Segfault when importing Python Module HOT 1
- How to Properly Expose Enum Comparison Operators to Python Using Boost.Python? HOT 1
- Expose shared_ptr to const
- missing lib boost_numpy312-vc143-mt-x64-1_85.lib HOT 1
- Boost Python 1.83.0 doesn't support NumPy 2.0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python.