Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • jcarpent/eigenpy
  • gsaurel/eigenpy
  • stack-of-tasks/eigenpy
3 results
Show changes
Showing
with 249 additions and 330 deletions
EigenPy — Efficient Python bindings between Numpy/Eigen EigenPy — Versatile and efficient Python bindings between Numpy and Eigen
====== ======
<p align="center"> <p align="center">
<a href="https://opensource.org/licenses/BSD-2-Clause"><img src="https://img.shields.io/badge/License-BSD%202--Clause-green.svg" alt="License"/></a> <a href="https://opensource.org/licenses/BSD-2-Clause"><img src="https://img.shields.io/badge/License-BSD%202--Clause-green.svg" alt="License"/></a>
<a href="https://travis-ci.org/stack-of-tasks/eigenpy"><img src="https://travis-ci.org/stack-of-tasks/eigenpy.svg?branch=master" alt="Build Status"/></a> <a href="https://github.com/stack-of-tasks/eigenpy/workflows/linux.yml"><img alt="Build Status" src="https://github.com/stack-of-tasks/eigenpy/actions/workflows/linux.yml/badge.svg?branch=devel" /></a>
<a href="https://anaconda.org/conda-forge/eigenpy"><img src="https://img.shields.io/conda/dn/conda-forge/eigenpy.svg" alt="Conda Downloads"/></a> <a href="https://anaconda.org/conda-forge/eigenpy"><img src="https://img.shields.io/conda/dn/conda-forge/eigenpy.svg" alt="Conda Downloads"/></a>
<a href="https://anaconda.org/conda-forge/eigenpy"><img src="https://img.shields.io/conda/vn/conda-forge/eigenpy.svg" alt="Conda Version"/></a> <a href="https://anaconda.org/conda-forge/eigenpy"><img src="https://img.shields.io/conda/vn/conda-forge/eigenpy.svg" alt="Conda Version"/></a>
<a href="https://badge.fury.io/py/eigenpy"><img src="https://badge.fury.io/py/eigenpy.svg" alt="PyPI version"></a> <a href="https://badge.fury.io/py/eigenpy"><img src="https://badge.fury.io/py/eigenpy.svg" alt="PyPI version"></a>
<a href="https://github.com/psf/black"><img src="https://img.shields.io/badge/code%20style-black-000000.svg" alt="Code style: black"></a> <a href="https://github.com/psf/black"><img src="https://img.shields.io/badge/code%20style-black-000000.svg" alt="Code style: black"></a>
<a href="https://github.com/astral-sh/ruff"><img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json" alt="Linter: ruff"></a>
</p> </p>
**EigenPy** is an open source framework which allows to bind the famous [Eigen](http://eigen.tuxfamily.org) C++ library in Python. **EigenPy** is an open-source framework that allows the binding of the famous [Eigen](http://eigen.tuxfamily.org) C++ library in Python via Boost.Python.
**EigenPy** provides: **EigenPy** provides:
- full memory sharing between Numpy and Eigen avoiding memory allocation
- full support Eigen::Ref avoiding memory allocation
- exposition of the Geometry module of Eigen for easy code prototyping
- standard matrix decomposion routines of Eigen such as the Cholesky decomposition, SVD decomposition, QR decomposition, and etc.
- full support of SWIG objects
## Setup - full memory sharing between Numpy and Eigen, avoiding memory allocation
- full support Eigen::Ref avoiding memory allocation
- full support of the Eigen::Tensor module
- exposition of the Geometry module of Eigen for easy code prototyping
- standard matrix decomposion routines of Eigen such as the Cholesky decomposition (SVD and QR decompositions [can be added](#contributing))
- full support of SWIG objects
- full support of runtime declaration of Numpy scalar types
- extended API to expose several STL types and some of their Boost equivalents: `optional` types, `std::pair`, maps, variants...
- full support of vectorization between C++ and Python (all the hold objects are properly aligned in memory)
The installation of **EigenPy** on your computer is made easy for Linux/BSD, Mac OS X and Windows environments. ## Installation
### The Conda approach The installation of **EigenPy** on your computer is made easy for Linux/BSD, Mac OS X, and Windows environments.
### Conda
You simply need this simple line: You simply need this simple line:
``` ```bash
conda install eigenpy -c conda-forge conda install eigenpy -c conda-forge
``` ```
### Ubuntu ### Ubuntu
You can easily install **EigenPy** from binairies. You can easily install **EigenPy** from binaries.
#### Add robotpkg apt repository #### Add robotpkg apt repository
1. Add robotpkg as source repository to apt: 1. Add robotpkg as source repository to apt:
``` ```
sudo sh -c "echo 'deb [arch=amd64] http://robotpkg.openrobots.org/packages/debian/pub $(lsb_release -cs) robotpkg' >> /etc/apt/sources.list.d/robotpkg.list" sudo sh -c "echo 'deb [arch=amd64] http://robotpkg.openrobots.org/packages/debian/pub $(lsb_release -cs) robotpkg' >> /etc/apt/sources.list.d/robotpkg.list"
...@@ -42,27 +50,24 @@ sudo sh -c "echo 'deb [arch=amd64] http://robotpkg.openrobots.org/packages/debia ...@@ -42,27 +50,24 @@ sudo sh -c "echo 'deb [arch=amd64] http://robotpkg.openrobots.org/packages/debia
``` ```
curl http://robotpkg.openrobots.org/packages/debian/robotpkg.key | sudo apt-key add - curl http://robotpkg.openrobots.org/packages/debian/robotpkg.key | sudo apt-key add -
``` ```
3. You need to run at least once apt update to fetch the package descriptions: 3. You need to run at least one apt update to fetch the package descriptions:
``` ```bash
sudo apt-get update sudo apt-get update
``` ```
#### Install EigenPy #### Install EigenPy
4. The installation of **EigenPy** and its dependencies is made through the line: 4. The installation of **EigenPy** and its dependencies is made through the line:
For Python 2.7 ```bash
```
sudo apt install robotpkg-py27-eigenpy
```
or for Python 3.{5,6,7}
```
sudo apt install robotpkg-py35-eigenpy sudo apt install robotpkg-py35-eigenpy
``` ```
where 35 should be replaced by the python 3 you want to work this (e.g. `robotpkg-py36-eigenpy` to work with Python 3.6). where 35 should be replaced by the Python 3, you want to work this (e.g., `robotpkg-py36-eigenpy` to work with Python 3.6).
### Mac OS X ### Mac OS X
The installation of **EigenPy** on Mac OS X is made via [HomeBrew](https://brew.sh/). The installation of **EigenPy** on Mac OS X is made via [HomeBrew](https://brew.sh/).
You just need to register the tap of the sofware repository. You just need to register the tap of the software repository.
``` ```
brew tap gepetto/homebrew-gepetto brew tap gepetto/homebrew-gepetto
...@@ -72,17 +77,23 @@ and then install **EigenPy** for Python 3.x with: ...@@ -72,17 +77,23 @@ and then install **EigenPy** for Python 3.x with:
brew install eigenpy brew install eigenpy
``` ```
## Build
Build instruction can be found [here](./development/build.md)
## Credits ## Credits
The following people have been involved in the development of **EigenPy**: The following people have been involved in the development of **EigenPy**:
- [Justin Carpentier](https://jcarpent.github.io) (INRIA): main developer and manager of the project - [Justin Carpentier](https://jcarpent.github.io) (Inria): main developer and manager of the project
- [Nicolas Mansard](http://projects.laas.fr/gepetto/index.php/Members/NicolasMansard) (LAAS-CNRS): initial project instructor - [Nicolas Mansard](http://projects.laas.fr/gepetto/index.php/Members/NicolasMansard) (LAAS-CNRS): initial project instructor
- [Wolfgang Merkt](http://www.wolfgangmerkt.com/) (University of Edinburgh): ROS integration and support - [Wolfgang Merkt](http://www.wolfgangmerkt.com/) (University of Edinburgh): ROS integration and support
- [Sean Yen](https://www.linkedin.com/in/seanyentw) (Microsoft): Windows integration - [Sean Yen](https://www.linkedin.com/in/seanyentw) (Microsoft): Windows integration
- [Loïc Estève](https://github.com/lesteve) (INRIA): Conda integration - [Loïc Estève](https://github.com/lesteve) (Inria): Conda integration
- [Wilson Jallet](https://manifoldfr.github.io/) (Inria/LAAS-CNRS): core developer
- [Joris Vaillant](https://github.com/jorisv) (Inria): core developer and manager of the project
If you have taken part to the development of **EigenPy**, feel free to add your name and contribution here. If you have taken part in the development of **EigenPy**, feel free to add your name and contribution here.
## Acknowledgments ## Acknowledgments
......
from __future__ import print_function
import eigenpy
import numpy as np
import time # noqa import time # noqa
import timeit # noqa import timeit # noqa
import numpy as np
from IPython import get_ipython from IPython import get_ipython
import eigenpy
ipython = get_ipython() ipython = get_ipython()
quat = eigenpy.Quaternion() quat = eigenpy.Quaternion()
...@@ -24,23 +22,6 @@ print(cmd2) ...@@ -24,23 +22,6 @@ print(cmd2)
ipython.magic(cmd2) ipython.magic(cmd2)
print("\n") print("\n")
eigenpy.switchToNumpyMatrix()
print("----------------------")
print("switch to numpy matrix")
print("----------------------")
print("\n")
cmd3 = "timeit quat.coeffs()"
print(cmd3)
ipython.magic(cmd3)
print("\n")
eigenpy.switchToNumpyArray()
print("---------------------")
print("switch to numpy array")
print("---------------------")
print("\n")
cmd4 = "timeit quat.coeffs()" cmd4 = "timeit quat.coeffs()"
print(cmd4) print(cmd4)
ipython.magic(cmd4) ipython.magic(cmd4)
......
Subproject commit 110a0188d45b0cd01ab0a7c92a2b22e8452d16ea Subproject commit 2ede15d1cb9d66401ba96788444ad64c44ffccd8
# Build and install from source with Pixi
To build **EigenPy** from source the easiest way is to use [Pixi](https://pixi.sh/latest/#installation).
[Pixi](https://pixi.sh/latest/) is a cross-platform package management tool for developers that
will install all required dependencies in `.pixi` directory.
It's used by our CI agent so you have the guarantee to get the right dependencies.
Run the following command to install dependencies, configure, build and test the project:
```bash
pixi run test
```
The project will be built in the `build` directory.
You can run `pixi shell` and build the project with `cmake` and `ninja` manually.
# Contributing
Standard matrix decomposion routines of Eigen such as the SVD and QR decompositions
can be readily added to **EigenPy** following the example of the Cholesky decomposition
that is already implemented.
Feel free to open a PR if you wrap them for your use case.
# Release with Pixi
To create a release with Pixi run the following commands on the **devel** branch:
```bash
EIGENPY_VERSION=X.Y.Z pixi run release_new_version
git push origin
git push origin vX.Y.Z
git push origin devel:master
```
Where `X.Y.Z` is the new version.
Be careful to follow the [Semantic Versioning](https://semver.org/spec/v2.0.0.html) rules.
You will find the following assets:
- `./build_new_version/eigenpy-X.Y.Z.tar.gz`
- `./build_new_version/eigenpy-X.Y.Z.tar.gz.sig`
Then, create a new release on [GitHub](https://github.com/stack-of-tasks/eigenpy/releases/new) with:
* Tag: vX.Y.Z
* Title: EigenPy X.Y.Z
* Body:
```
## What's Changed
CHANGELOG CONTENT
**Full Changelog**: https://github.com/stack-of-tasks/eigenpy/compare/vXX.YY.ZZ...vX.Y.Z
```
Where `XX.YY.ZZ` is the last release version.
Then upload `eigenpy-X.Y.Z.tar.gz` and `eigenpy-X.Y.Z.tar.gz.sig` and publish the release.
:: Setup ccache
set CMAKE_CXX_COMPILER_LAUNCHER=ccache
:: Create compile_commands.json for language server
set CMAKE_EXPORT_COMPILE_COMMANDS=1
:: Activate color output with Ninja
set CMAKE_COLOR_DIAGNOSTICS=1
:: Set default build value only if not previously set
if not defined EIGENPY_BUILD_TYPE (set EIGENPY_BUILD_TYPE=Release)
if not defined EIGENPY_PYTHON_STUBS (set EIGENPY_PYTHON_STUBS=ON)
if not defined EIGENPY_CHOLMOD_SUPPORT (set EIGENPY_CHOLMOD_SUPPORT=OFF)
if not defined EIGENPY_ACCELERATE_SUPPORT (set EIGENPY_ACCELERATE_SUPPORT=OFF)
#! /bin/bash
# Activation script
# Remove flags setup from cxx-compiler
unset CFLAGS
unset CPPFLAGS
unset CXXFLAGS
unset DEBUG_CFLAGS
unset DEBUG_CPPFLAGS
unset DEBUG_CXXFLAGS
unset LDFLAGS
if [[ $host_alias == *"apple"* ]];
then
# On OSX setting the rpath and -L it's important to use the conda libc++ instead of the system one.
# If conda-forge use install_name_tool to package some libs, -headerpad_max_install_names is then mandatory
export LDFLAGS="-Wl,-headerpad_max_install_names -Wl,-rpath,$CONDA_PREFIX/lib -L$CONDA_PREFIX/lib"
elif [[ $host_alias == *"linux"* ]];
then
# On GNU/Linux, I don't know if these flags are mandatory with g++ but
# it allow to use clang++ as compiler
export LDFLAGS="-Wl,-rpath,$CONDA_PREFIX/lib -Wl,-rpath-link,$CONDA_PREFIX/lib -L$CONDA_PREFIX/lib"
fi
# Setup ccache
export CMAKE_CXX_COMPILER_LAUNCHER=ccache
# Create compile_commands.json for language server
export CMAKE_EXPORT_COMPILE_COMMANDS=1
# Activate color output with Ninja
export CMAKE_COLOR_DIAGNOSTICS=1
# Set default build value only if not previously set
export EIGENPY_BUILD_TYPE=${EIGENPY_BUILD_TYPE:=Release}
export EIGENPY_PYTHON_STUBS=${EIGENPY_PYTHON_STUBS:=ON}
export EIGENPY_CHOLMOD_SUPPORT=${EIGENPY_CHOLMOD_SUPPORT:=OFF}
export EIGENPY_ACCELERATE_SUPPORT=${EIGENPY_ACCELERATE_SUPPORT:=OFF}
#! /bin/bash
# Clang activation script
export CC="clang"
export CXX="clang++"
:: Setup clang-cl compiler
set CC=clang-cl
set CXX=clang-cl
INPUT = @CMAKE_SOURCE_DIR@/src \ INPUT = @PROJECT_SOURCE_DIR@/doc \
@CMAKE_SOURCE_DIR@/doc/additionalDoc @PROJECT_SOURCE_DIR@/include \
IMAGE_PATH = @CMAKE_SOURCE_DIR@/doc/pictures @PROJECT_SOURCE_DIR@/README.md
FILE_PATTERNS = *.cc *.cpp *.h *.hpp *.hxx RECURSIVE = YES
TAGFILES = \ FILE_PATTERNS = *.cpp *.h *.hpp *.hxx
EXTRACT_ALL = NO
EXTRACT_ANON_NSPACES = NO
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = YES
FULL_PATH_NAMES = YES
EXCLUDE_SYMBOLS = std, *::internal, internal::*, *::internal::*
INCLUDE_PATH = @PROJECT_SOURCE_DIR@/include
GENERATE_TREEVIEW = YES
VERBATIM_HEADERS = YES
SHOW_FILES = YES
SHOW_NAMESPACES = YES
SOURCE_BROWSER = YES
ALPHABETICAL_INDEX = YES
USE_MDFILE_AS_MAINPAGE = README.md
BUILTIN_STL_SUPPORT = YES
HAVE_DOT = YES
DOT_IMAGE_FORMAT = SVG
/*
* Copyright 2010,
* François Bleibel,
* Olivier Stasse,
*
* CNRS/AIST
*
* This file is part of sot-dynamic.
* sot-dynamic is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
* sot-dynamic is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details. You should
* have received a copy of the GNU Lesser General Public License along
* with sot-dynamic. If not, see <http://www.gnu.org/licenses/>.
*/
/** \mainpage
\section soth_section_introduction Introduction
The soth package is ...
**/
<br><br>
<hr>
<center>
<img src="./pictures/footer.jpg" Height=100>
<br>soth library documentation</br>
</center>
<hr>
</center>
</body>
</head>
<HTML>
<HEAD>
<TITLE>soth library documentation</TITLE>
<LINK HREF="package.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY>
body {
font-family: 'Lucida Grande','Lucida Sans Unicode',Verdana,Sans-Serif;
color: #5D5D5D;
}
dl {
border: 1.5px #82b6d7 solid;
width: 97%;
padding: 5px;
color: #330077;
}
code {
color: #3C9A35;
}
td.md {
color: #0066CC;
}
h1 {
padding-top: 50px;
padding: 0px;
font-family: 'Lucida Grande','Lucida Sans Unicode',Verdana,Sans-Serif;
font-variant: small-caps;
color:#0066CC;
text-align: center;
}
h2,h3,hr {
magin-top: 15px;
padding: 0px;
font-family: 'Lucida Grande','Lucida Sans Unicode',Verdana,Sans-Serif;
font-variant: small-caps;
color:#0066CC;
}
h4 {
color: #3C9A35;
}
a:link {
font-weight: bold;
text-decoration: none;
color:#0066CC
}
a:hover, a:active {
text-decoration: underline;
color: #3C9A35;
}
a:visited {
font-weight: bold;
color: #3C9A35;
text-decoration: none;
}
DIV.memitem
{
spacing: 10px;
width:100%;
background:#FFFFFF;
font-size:100%;
line-height:normal;
border-width: 1px;
border-style: solid;
border-color: #808080;
-moz-border-radius: 8px 8px 8px 8px;
}
DIV.memproto
{
width:100%;
background:#F0F0F0;
font-size:100%;
line-height:normal;
border-width: 1px;
border-style: solid;
border-color: #808080;
-moz-border-radius: 8px 8px 8px 8px;
}
DIV.memdoc
{
padding: 10px;
width:100%;
font-size:100%;
line-height:normal;
}
DIV.tabs
{
float : left;
width : 100%;
background : url("tab_b.gif") repeat-x bottom;
margin-bottom : 4px;
}
DIV.tabs UL
{
margin : 0px;
padding-left : 10px;
list-style : none;
}
DIV.tabs LI, DIV.tabs FORM
{
display : inline;
margin : 0px;
padding : 0px;
}
DIV.tabs FORM
{
float : right;
}
DIV.tabs A
{
float : left;
background : url("tab_r.gif") no-repeat right top;
border-bottom : 1px solid #84B0C7;
font-size : x-small;
font-weight : bold;
text-decoration : none;
}
DIV.tabs A:hover
{
background-position: 100% -150px;
}
DIV.tabs A:link, DIV.tabs A:visited,
DIV.tabs A:active, DIV.tabs A:hover
{
color: #1A419D;
}
DIV.tabs SPAN
{
float : left;
display : block;
background : url("tab_l.gif") no-repeat left top;
padding : 5px 9px;
white-space : nowrap;
}
DIV.tabs INPUT
{
float : right;
display : inline;
font-size : 1em;
}
DIV.tabs TD
{
font-size : x-small;
font-weight : bold;
text-decoration : none;
}
DIV.tabs SPAN {float : none;}
DIV.tabs A:hover SPAN
{
background-position: 0% -150px;
}
DIV.tabs LI#current A
{
background-position: 100% -150px;
border-width : 0px;
}
DIV.tabs LI#current SPAN
{
background-position: 0% -150px;
padding-bottom : 6px;
}
DIV.nav
{
background : none;
border : none;
border-bottom : 1px solid #84B0C7;
}
DIV.groupHeader
{
padding-top: 30px;
padding-bottom: 20px;
background : none;
border : none;
border-bottom : 1px solid #84B0C7;
font-family: 'Lucida Grande','Lucida Sans Unicode',Verdana,Sans-Serif;
font-variant: small-caps;
font-size: 14pt;
color:#0066CC;
}
.directory p
{
margin: 0px;
white-space: nowrap;
font-family: 'Lucida Grande','Lucida Sans Unicode',Verdana,Sans-Serif;
font-size: 10pt;
font-weight: normal;
}
.directory h3
{
font-family: 'Lucida Grande','Lucida Sans Unicode',Verdana,Sans-Serif;
margin: 0px;
margin-top: 1em;
padding-bottom: 20px;
font-size: 12pt;
font-variant: small-caps;
text-align: center;
}
.directory a:visited {
font-weight: bold;
text-decoration: none;
color:#0066CC
}
doc/pictures/HRP2.jpg

23.1 KiB

doc/pictures/footer.jpg

23.1 KiB

Copy in this directory the image you wish to use in the footer of the documentation or edit file sot-core/doc/footer.html and
remove this file.
File deleted
{
"nodes": {
"flake-parts": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1738453229,
"narHash": "sha256-7H9XgNiGLKN1G1CgRh0vUL4AheZSYzPm+zmZ7vxbJdo=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "32ea77a06711b758da0ad9bd6a844c5740a87abd",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1738410390,
"narHash": "sha256-xvTo0Aw0+veek7hvEVLzErmJyQkEcRk6PSR4zsRQFEc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "3a228057f5b619feb3186e986dbe76278d707b6e",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-lib": {
"locked": {
"lastModified": 1738452942,
"narHash": "sha256-vJzFZGaCpnmo7I6i416HaBLpC+hvcURh/BQwROcGIp8=",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/072a6db25e947df2f31aab9eccd0ab75d5b2da11.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/072a6db25e947df2f31aab9eccd0ab75d5b2da11.tar.gz"
}
},
"root": {
"inputs": {
"flake-parts": "flake-parts",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}