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
Select Git revision
  • devel
  • update_flake_lock_action
  • master
  • pr/370
  • pr/456
  • pr/455
  • pre-commit-ci-update-config
  • pr/238
  • 1.3.1
  • 1.3.4
  • v1.0.0
  • v1.0.1
  • v1.1.0
  • v1.2.0
  • v1.3.0
  • v1.3.1
  • v1.3.2
  • v1.3.3
  • v1.4.0
  • v1.4.1
  • v1.4.2
  • v1.4.3
  • v1.4.4
  • v1.4.5
  • v1.5.0
  • v1.5.1
  • v1.5.2
  • v1.5.3
  • v1.5.4
  • v1.5.5
  • v1.5.6
  • v1.5.7
  • v1.5.8
  • v1.6.0
  • v1.6.1
  • v1.6.10
  • v1.6.11
  • v1.6.12
  • v1.6.13
  • v1.6.2
  • v1.6.3
  • v1.6.4
  • v1.6.5
  • v1.6.6
  • v1.6.7
  • v1.6.8
  • v1.6.9
  • v2.0.0
  • v2.0.1
  • v2.0.2
  • v2.0.3
  • v2.1.0
  • v2.1.1
  • v2.1.2
  • v2.2.0
  • v2.2.1
  • v2.2.2
  • v2.3.0
  • v2.3.1
  • v2.3.2
  • v2.3.3
  • v2.4.0
  • v2.4.1
  • v2.4.2
  • v2.4.3
  • v2.4.4
  • v2.5.0
  • v2.6.0
  • v2.6.1
  • v2.6.10
  • v2.6.11
  • v2.6.2
  • v2.6.3
  • v2.6.4
  • v2.6.5
  • v2.6.6
  • v2.6.7
  • v2.6.8
  • v2.6.9
  • v2.7.0
  • v2.7.1
  • v2.7.10
  • v2.7.11
  • v2.7.12
  • v2.7.13
  • v2.7.14
  • v2.7.2
  • v2.7.3
  • v2.7.4
  • v2.7.5
  • v2.7.6
  • v2.7.7
  • v2.7.8
  • v2.7.9
  • v2.8.0
  • v2.8.1
  • v2.9.0
  • v2.9.1
  • v2.9.2
  • v3.0.0
  • v3.1.0
  • v3.11.0
102 results

Target

Select target project
  • Justin Carpentier / eigenpy
  • Guilhem Saurel / eigenpy
  • Stack Of Tasks / eigenpy
3 results
Select Git revision
  • devel
  • master
  • topic/perf
  • topic/multipy
  • topic/multipy2
  • topic/soabi
  • 1.3.1
  • 1.3.4
  • v1.0.1
  • v1.2.0
  • v1.3.0
  • v1.3.1
  • v1.3.2
  • v1.3.3
  • v1.4.0
  • v1.4.1
  • v1.4.2
  • v1.4.3
  • v1.4.4
  • v1.4.5
  • v1.5.0
21 results
Show changes

Commits on Source 1599

1,499 additional commits have been omitted to prevent performance issues.
262 files
+ 25408
3960
Compare changes
  • Side-by-side
  • Inline

Files

.clang-format

0 → 100644
+3 −0
Original line number Original line Diff line number Diff line
BasedOnStyle: Google
SortIncludes: false
Standard: Cpp11

.git-blame-ignore-revs

0 → 100644
+11 −0
Original line number Original line Diff line number Diff line
# pre-commit run -a (Guilhem Saurel, 2022-07-27)
4af05ec6781f9da65b81af8e3af8d69213f99e85

# pre-commit run -a (Guilhem Saurel, 2024-02-17)
48fb48c83f0456de2fb612ef55df8ad789824d87

# pre-commit run -a (Guilhem Saurel, 2024-02-19)
0bae435330ee475f8dbb11bf5e672284d294d9b3

# pre-commit run -a (ManifoldFR, 2025-04-25)
51b49061575d46e0668eba0da200217cbfd9e883

.gitattributes

0 → 100644
+3 −0
Original line number Original line Diff line number Diff line
# GitHub syntax highlighting
pixi.lock linguist-language=YAML
+15 −0
Original line number Original line Diff line number Diff line
name: CI - Check-changelog

on:
  pull_request:
    types: [assigned, opened, synchronize, reopened, labeled, unlabeled, edited]
    branches:
      - devel
jobs:
  check-changelog:
    name: Check changelog action
    runs-on: ubuntu-latest
    steps:
      - uses: tarides/changelog-check-action@v2
        with:
          changelog: CHANGELOG.md
+48 −0
Original line number Original line Diff line number Diff line
name: CI - JRL-cmakemodules

on:
  push:
    paths-ignore:
      - 'doc/**'
      - '.gitlab-ci.yml'
      - '.gitignore'
      - '*.md'
      - 'LICENSE'
      - 'colcon.pkg'
      - '.pre-commit-config.yaml'
  pull_request:
    paths-ignore:
      - 'doc/**'
      - '.gitlab-ci.yml'
      - '.gitignore'
      - '*.md'
      - 'LICENSE'
      - 'colcon.pkg'
      - '.pre-commit-config.yaml'
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  with-submodules:
    name: Check configuration with git submodules
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          submodules: true
      - run: sudo apt install libboost-all-dev libeigen3-dev python3-numpy python3-scipy
      - run: cmake .


  without-submodules:
    name: Check configuration without git submodules
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          submodules: false
          path: eigenpy
      - run: sudo apt install libboost-all-dev libeigen3-dev python3-numpy python3-scipy
      - run: cmake -B build -S eigenpy
      - run: grep -qvz CMAKE_PROJECT_VERSION:STATIC=0.0 build/CMakeCache.txt
+60 −0
Original line number Original line Diff line number Diff line
name: CI - Linux via APT

on:
  push:
    paths-ignore:
      - 'doc/**'
      - '.gitlab-ci.yml'
      - '.gitignore'
      - '*.md'
      - 'LICENSE'
      - 'colcon.pkg'
      - '.pre-commit-config.yaml'
  pull_request:
    paths-ignore:
      - 'doc/**'
      - '.gitlab-ci.yml'
      - '.gitignore'
      - '*.md'
      - 'LICENSE'
      - 'colcon.pkg'
      - '.pre-commit-config.yaml'
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  test:
    name: "Test python ${{ matrix.python }} on ${{ matrix.ubuntu }}.04"
    runs-on: "ubuntu-${{ matrix.ubuntu }}.04"
    strategy:
      matrix:
        python: [3]
        ubuntu: [22, 24]
    steps:
      - uses: actions/checkout@v3
        with:
          submodules: 'true'
      - run: |
          sudo apt-get update
          sudo apt-get install cmake libboost-all-dev libeigen3-dev python*-numpy python*-dev python*-scipy
          echo $(sudo apt list --installed)
          echo $(g++ --version)
      - run: cmake . -DPYTHON_EXECUTABLE=$(which python${{ matrix.python }}) -DBUILD_TESTING_SCIPY=ON
      - run: make -j2
      - run: ctest --output-on-failure

  check:
    if: always()
    name: check-linux

    needs:
    - test

    runs-on: Ubuntu-latest

    steps:
    - name: Decide whether the needed jobs succeeded or failed
      uses: re-actors/alls-green@release/v1
      with:
        jobs: ${{ toJSON(needs) }}
+97 −0
Original line number Original line Diff line number Diff line
name: CI - MacOS/Linux/Windows via Pixi

on:
  push:
    paths-ignore:
      - 'doc/**'
      - '.gitlab-ci.yml'
      - '.gitignore'
      - '*.md'
      - 'LICENSE'
      - 'colcon.pkg'
      - '.pre-commit-config.yaml'
  pull_request:
    paths-ignore:
      - 'doc/**'
      - '.gitlab-ci.yml'
      - '.gitignore'
      - '*.md'
      - 'LICENSE'
      - 'colcon.pkg'
      - '.pre-commit-config.yaml'
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  eigenpy-pixi:
    name: ${{ matrix.os }} - Env ${{ matrix.environment }} ${{ matrix.build_type }} ${{ matrix.cxx_options }} ${{ matrix.compiler }}
    runs-on: ${{ matrix.os }}
    env:
      CCACHE_BASEDIR: "${GITHUB_WORKSPACE}"
      CCACHE_DIR: "${GITHUB_WORKSPACE}/.ccache"
      CCACHE_COMPRESS: true
      CCACHE_COMPRESSLEVEL: 6

    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, macos-latest, macos-13]
        environment: [all, all-py39]
        build_type: [Release, Debug]
        cxx_options: ['', '-mavx2']

        exclude:
          - os: macos-latest
            cxx_options: '-mavx2'
          - os: macos-13
            cxx_options: '-mavx2'

        include:
          - os: windows-latest
            environment: all
            cxx_options: ''
            build_type: Release
          - os: windows-latest
            environment: all-clang-cl
            cxx_options: ''
            build_type: Release

    steps:
    - uses: actions/checkout@v4
      with:
        submodules: recursive

    - uses: actions/cache@v4
      with:
        path: .ccache
        key: ccache-macos-linux-windows-pixi-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.cxx_options }}-${{ matrix.environment }}-${{ github.sha }}
        restore-keys: ccache-macos-linux-windows-pixi-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.cxx_options }}-${{ matrix.environment }}-

    - uses: prefix-dev/setup-pixi@v0.8.1
      with:
        cache: true
        environments: ${{ matrix.environment }}

    - name: Build EigenPy [MacOS/Linux/Windows]
      env:
        CMAKE_BUILD_PARALLEL_LEVEL: 2
        EIGENPY_BUILD_TYPE: ${{ matrix.build_type }}
        EIGENPY_CXX_FLAGS: ${{ matrix.cxx_options }}
      run: |
        pixi run -e ${{ matrix.environment }} test

  check:
    if: always()
    name: check-macos-linux-windows-pixi

    needs:
    - eigenpy-pixi

    runs-on: Ubuntu-latest

    steps:
    - name: Decide whether the needed jobs succeeded or failed
      uses: re-actors/alls-green@release/v1
      with:
        jobs: ${{ toJSON(needs) }}
+19 −0
Original line number Original line Diff line number Diff line
name: "CI - Nix"

on:
  push:

jobs:
  nix:
    runs-on: "${{ matrix.os }}-latest"
    strategy:
      matrix:
        os: [ubuntu, macos]
    steps:
      - uses: actions/checkout@v4
      - uses: cachix/install-nix-action@v27
      - uses: cachix/cachix-action@v15
        with:
          name: gepetto
          authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
      - run: nix build -L
+72 −0
Original line number Original line Diff line number Diff line
name: CI - Ensure relocatable

on:
  push:
    paths-ignore:
      - 'doc/**'
      - '.gitlab-ci.yml'
      - '.gitignore'
      - '*.md'
      - 'LICENSE'
      - 'colcon.pkg'
      - '.pre-commit-config.yaml'
  pull_request:
    paths-ignore:
      - 'doc/**'
      - '.gitlab-ci.yml'
      - '.gitignore'
      - '*.md'
      - 'LICENSE'
      - 'colcon.pkg'
      - '.pre-commit-config.yaml'
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  relocatable:
    name: Ensure relocatable
    runs-on: ubuntu-latest
    env:
      CCACHE_DIR: /github/home/.ccache # Enable ccache
      CMAKE_CXX_COMPILER_LAUNCHER: ccache

    steps:
    - uses: actions/checkout@v3
      with:
        submodules: recursive

    - uses: actions/cache@v3
      with:
        path: ${{ env.CCACHE_DIR }}
        key: reloc

    - name: prepare cache dir
      run: sudo mkdir -p ${CCACHE_DIR}/tmp && sudo chown -R $(id -un) ${CCACHE_DIR}

    - name: prepare work prefix
      run: sudo mkdir -p /RELOC/SRC && sudo chown -R $(id -un) /RELOC

    - name: clone in /RELOC/SRC
      run: git -C /RELOC/SRC clone --recursive $(pwd)

    - name: install dependencies
      run: sudo apt install libboost-all-dev libeigen3-dev python-is-python3 python3-numpy python3-pip python3-scipy ccache

    - name: update CMake
      run: pip install -U pip && pip install -U cmake

    - name: configure in /RELOC/BLD
      run: cmake -S /RELOC/SRC/eigenpy -B /RELOC/BLD -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/RELOC/PFX

    - name: build in /RELOC/BLD
      run: cmake --build /RELOC/BLD -j2

    - name: install in /RELOC/PFX
      run: cmake --build /RELOC/BLD -t install

    - name: check installed package doesn't contain references to RELOC
      run: grep -r RELOC /RELOC/PFX | grep -v Binary | tee references

    - name: exit accordingly
      run: exit $(wc -l references | cut -d " " -f 1)
+63 −0
Original line number Original line Diff line number Diff line
# This config uses industrial_ci (https://github.com/ros-industrial/industrial_ci.git).
# For troubleshooting, see readme (https://github.com/ros-industrial/industrial_ci/blob/master/README.rst)

name: CI - Linux via ROS

# This determines when this workflow is run
on:
  push:
    paths-ignore:
      - 'doc/**'
      - '.gitlab-ci.yml'
      - '.gitignore'
      - '*.md'
      - 'LICENSE'
      - 'colcon.pkg'
      - '.pre-commit-config.yaml'
  pull_request:
    paths-ignore:
      - 'doc/**'
      - '.gitlab-ci.yml'
      - '.gitignore'
      - '*.md'
      - 'LICENSE'
      - 'colcon.pkg'
      - '.pre-commit-config.yaml'
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  CI:
    strategy:
      matrix:
        env:
          - {ROS_DISTRO: humble}
          - {ROS_DISTRO: jazzy}
          - {ROS_DISTRO: rolling}
    env:
      # PRERELEASE: true  # Fails due to issues in the underlying Docker image
      BUILDER: colcon
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          submodules: recursive
      # Run industrial_ci
      - uses: 'ros-industrial/industrial_ci@3e67ec54d63496e076267392148a26229740befc'
        env: ${{ matrix.env }}

  check:
    if: always()
    name: check-ros-ci

    needs:
    - CI

    runs-on: Ubuntu-latest

    steps:
    - name: Decide whether the needed jobs succeeded or failed
      uses: re-actors/alls-green@release/v1
      with:
        jobs: ${{ toJSON(needs) }}
+20 −0
Original line number Original line Diff line number Diff line
name: update-flake-lock

on:
  workflow_dispatch:
  schedule:
    - cron: '0 15 3 * *'

jobs:
  lockfile:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4
      - name: Install Nix
        uses: DeterminateSystems/nix-installer-action@main
      - name: Update flake.lock
        uses: DeterminateSystems/update-flake-lock@main
        with:
          pr-labels: "no changelog"
          token: ${{ secrets.GH_TOKEN_FOR_UPDATES }}
+52 −0
Original line number Original line Diff line number Diff line
name: CI - Update Pixi lockfile
permissions:
  contents: write
  pull-requests: write

on:
  workflow_dispatch:
  schedule:
    - cron: 0 5 1 * *

jobs:
  pixi-update:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/create-github-app-token@v1
        id: generate-token
        with:
          app-id: ${{ secrets.APP_ID }}
          private-key: ${{ secrets.APP_PRIVATE_KEY }}

      - uses: actions/checkout@v4
        with:
          token: ${{ steps.generate-token.outputs.token }}
          ref: devel
          # Make sure the value of GITHUB_TOKEN will not be persisted in repo's config
          persist-credentials: false

      - name: Set up pixi
        uses: prefix-dev/setup-pixi@v0.8.1
        with:
          run-install: false

      - name: Update lockfile
        run: |
          set -o pipefail
          pixi update --json | pixi exec pixi-diff-to-markdown >> diff.md

      - name: Create pull request
        uses: peter-evans/create-pull-request@v7
        with:
          token: ${{ steps.generate-token.outputs.token }}
          commit-message: 'pixi: Update pixi lockfile'
          title: Update pixi lockfile
          body-path: diff.md
          branch: topic/update-pixi
          base: devel
          labels: |
            pixi
            no changelog
          delete-branch: true
          add-paths: pixi.lock
+3 −1
Original line number Original line Diff line number Diff line
*~
*~
*build*
*build*/
# pixi environments
.pixi
+1 −83
Original line number Original line Diff line number Diff line
variables:
include: https://rainboard.laas.fr/project/eigenpy/.gitlab-ci.yml
  GIT_SUBMODULE_STRATEGY: "recursive"
  GIT_DEPTH: "3"
  CCACHE_BASEDIR: "${CI_PROJECT_DIR}"
  CCACHE_DIR: "${CI_PROJECT_DIR}/ccache"

cache:
  paths:
    - ccache

.robotpkg-py-eigenpy: &robotpkg-py-eigenpy
  except:
    - gh-pages
  script:
    - mkdir -p ccache
    - cd /root/robotpkg/math/py-eigenpy
    - git pull
    - make checkout MASTER_REPOSITORY="dir ${CI_PROJECT_DIR}"
    - make install
    - cd work.$(hostname)/$(make show-var VARNAME=DISTNAME)
    - make test
    - make uninstall

robotpkg-py-eigenpy-16.04-release:
  <<: *robotpkg-py-eigenpy
  image: memmos.laas.fr:5000/stack-of-tasks/eigenpy/py-eigenpy:16.04

robotpkg-py-eigenpy-18.04-release:
  <<: *robotpkg-py-eigenpy
  image: memmos.laas.fr:5000/stack-of-tasks/eigenpy/py-eigenpy:18.04

robotpkg-py-eigenpy-py3-16.04-release:
  <<: *robotpkg-py-eigenpy
  image: memmos.laas.fr:5000/stack-of-tasks/eigenpy/py-eigenpy-py3:16.04

robotpkg-py-eigenpy-py3-18.04-release:
  <<: *robotpkg-py-eigenpy
  image: memmos.laas.fr:5000/stack-of-tasks/eigenpy/py-eigenpy-py3:18.04

robotpkg-py-eigenpy-14.04-release:
  <<: *robotpkg-py-eigenpy
  image: memmos.laas.fr:5000/stack-of-tasks/eigenpy/py-eigenpy:14.04

robotpkg-py-eigenpy-14.04-debug:
  <<: *robotpkg-py-eigenpy
  image: memmos.laas.fr:5000/stack-of-tasks/eigenpy/py-eigenpy:14.04
  before_script:
    - echo PKG_OPTIONS.py-eigenpy=debug >> /opt/openrobots/etc/robotpkg.conf

robotpkg-py-eigenpy-py3-14.04-release:
  <<: *robotpkg-py-eigenpy
  image: memmos.laas.fr:5000/stack-of-tasks/eigenpy/py-eigenpy-py3:14.04

robotpkg-py-eigenpy-py3-14.04-debug:
  <<: *robotpkg-py-eigenpy
  image: memmos.laas.fr:5000/stack-of-tasks/eigenpy/py-eigenpy-py3:14.04
  before_script:
    - echo PKG_OPTIONS.py-eigenpy=debug >> /opt/openrobots/etc/robotpkg.conf

robotpkg-py-eigenpy-16.04-debug:
  <<: *robotpkg-py-eigenpy
  image: memmos.laas.fr:5000/stack-of-tasks/eigenpy/py-eigenpy:16.04
  before_script:
    - echo PKG_OPTIONS.py-eigenpy=debug >> /opt/openrobots/etc/robotpkg.conf

robotpkg-py-eigenpy-py3-16.04-debug:
  <<: *robotpkg-py-eigenpy
  image: memmos.laas.fr:5000/stack-of-tasks/eigenpy/py-eigenpy-py3:16.04
  before_script:
    - echo PKG_OPTIONS.py-eigenpy=debug >> /opt/openrobots/etc/robotpkg.conf

robotpkg-py-eigenpy-18.04-debug:
  <<: *robotpkg-py-eigenpy
  image: memmos.laas.fr:5000/stack-of-tasks/eigenpy/py-eigenpy:18.04
  before_script:
    - echo PKG_OPTIONS.py-eigenpy=debug >> /opt/openrobots/etc/robotpkg.conf

robotpkg-py-eigenpy-py3-18.04-debug:
  <<: *robotpkg-py-eigenpy
  image: memmos.laas.fr:5000/stack-of-tasks/eigenpy/py-eigenpy-py3:18.04
  before_script:
    - echo PKG_OPTIONS.py-eigenpy=debug >> /opt/openrobots/etc/robotpkg.conf
+0 −3
Original line number Original line Diff line number Diff line
[submodule "cmake"]
[submodule "cmake"]
	path = cmake
	path = cmake
	url = https://github.com/jrl-umi3218/jrl-cmakemodules.git
	url = https://github.com/jrl-umi3218/jrl-cmakemodules.git
[submodule ".travis"]
	path = .travis
	url = https://github.com/jrl-umi3218/jrl-travis.git
+32 −0
Original line number Original line Diff line number Diff line
ci:
  autoupdate_branch: devel
  autofix_prs: false
  autoupdate_schedule: quarterly
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
  rev: v0.11.4
  hooks:
  - id: ruff
    args:
    - --fix
    - --exit-non-zero-on-fix
    - --ignore
    - UP036
  - id: ruff-format
- repo: https://github.com/cheshirekow/cmake-format-precommit
  rev: v0.6.13
  hooks:
  - id: cmake-format
- repo: https://github.com/pappasam/toml-sort
  rev: v0.24.2
  hooks:
  - id: toml-sort-fix
    exclude: pixi.toml
- repo: https://github.com/pre-commit/mirrors-clang-format
  rev: v20.1.0
  hooks:
  - id: clang-format
- repo: https://github.com/pre-commit/pre-commit-hooks
  rev: v5.0.0
  hooks:
  - id: trailing-whitespace
Compare 0f12f18e to 0f12f18e
Original line number Original line Diff line number Diff line
Subproject commit 0f12f18e62a504278ef31f0118f1da48607a524e

.travis.yml

deleted100644 → 0
+0 −61
Original line number Original line Diff line number Diff line
language: python
sudo: required
compiler:
  - gcc
# - clang
env:
  global:
    - secure: "SnIBG/xLIHX3CSvUbqqsX8xTVqIqQ7fFS6HWO6KZQVBsT6yugTwYHbyhNiU531JejYJ/I3ZrDhXfYH3qFZiYxnH1sifvwV+fnTtMXpPN7qPZwIymkjcmm6gJF51e0C7VOfUbvKFv0ngwj+ul21rgZSMuoEvxPK0WxtE3/ZSfn9c="
    - APT_DEPENDENCIES="doxygen libeigen3-dev libboost-test-dev libboost-python-dev"
    - DEBSIGN_KEYID=5AE5CD75
    - CC=gcc
    - DO_COVERAGE_ON_BRANCH="master;release"
    - DO_CPPCHECK_ON_BRANCH=""
    - DO_INSTALL_DOC_EXCEPT_ON_BRANCH=""
    - BUILD_WITH_CATKIN_SUPPORT=false
    - MAKEFLAGS="-j2"

jobs:
  include:
    - dist: bionic
      env: BUILDTYPE=Release
      python: 2.7
    - dist: bionic
      env: BUILDTYPE=Release
      python: 3.6
    - dist: bionic
      env: BUILDTYPE=Debug
      python: 2.7
    - dist: bionic
      env: BUILDTYPE=Debug
      python: 3.6
    - dist: xenial
      env: BUILDTYPE=Release
      python: 2.7
    - dist: xenial
      env: BUILDTYPE=Release
      python: 3.5
    - dist: trusty 
      env: BUILDTYPE=Release
      python: 2.7
    - dist: trusty 
      env: BUILDTYPE=Release
      python: 3.4

notifications:
  email:
    - pinocchio-build@laas.fr
branches:
  only:
    - master
    - debian
    - devel
before_install: ./.travis/run before_install
install: pip install coveralls numpy
script:
  - export CMAKE_ADDITIONAL_OPTIONS="-DCMAKE_BUILD_TYPE=${BUILDTYPE}"
  - sudo free -m -t
  - ls -l /usr/lib/x86_64-linux-gnu/libboost_python*
  - ./.travis/run ../travis_custom/custom_build
after_failure: ./.travis/run after_failure
after_success: ./.travis/run after_success

CHANGELOG.md

0 → 100644
+852 −0

File added.

Preview size limit exceeded, changes collapsed.

+413 −127

File changed.

Preview size limit exceeded, changes collapsed.

+2 −2
Original line number Original line Diff line number Diff line
BSD 2-Clause License
BSD 2-Clause License


Copyright (c) 2014-2019, CNRS
Copyright (c) 2014-2020, CNRS
Copyright (c) 2018-2019, INRIA
Copyright (c) 2018-2025, INRIA
All rights reserved.
All rights reserved.


Redistribution and use in source and binary forms, with or without
Redistribution and use in source and binary forms, with or without
+54 −41
Original line number Original line Diff line number Diff line
EigenPy — Python bindings between Numpy and Eigen
EigenPy — Versatile and efficient Python bindings between Numpy and Eigen
======
======


[![License](https://img.shields.io/badge/License-BSD%202--Clause-green.svg)](https://opensource.org/licenses/BSD-2-Clause)
<p align="center">
[![Build Status](https://travis-ci.org/stack-of-tasks/eigenpy.svg?branch=devel)](https://travis-ci.org/stack-of-tasks/eigenpy)
  <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>
[![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/eigenpy.svg)](https://anaconda.org/conda-forge/eigenpy)
  <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>
[![Conda Version](https://img.shields.io/conda/vn/conda-forge/eigenpy.svg)](https://anaconda.org/conda-forge/eigenpy)
  <a href="https://anaconda.org/conda-forge/eigenpy"><img src="https://img.shields.io/conda/dn/conda-forge/eigenpy.svg" alt="Conda Downloads"/></a>
[![Anaconda-Server Badge](https://anaconda.org/conda-forge/eigenpy/badges/installer/conda.svg)](https://conda.anaconda.org/conda-forge)
  <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://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>


**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** is an open source framework which allows to bind the famous [Eigen](http://eigen.tuxfamily.org) in Python as NumPy object (as matrix or array).
**EigenPy** provides:
**EigenPy** also exposes the Geometry module of Eigen for easy code prototyping.
**EigenPy** also supports the basic matrix decomposion routines of Eigen such as the Cholesky decomposition, SVD decomposition, QR decomposition, and etc.


## 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 and Mac OS X environments.
## Installation

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:
```bash
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. Check your distribution codename in a terminal with the following command:
1. Add robotpkg as source repository to apt:
```
```
$ lsb_release -c
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"
Codename:       xenial
```
```
2. Add robotpkg as source repository to apt:
2. Register the authentication certificate of robotpkg:
```
sudo sh -c "echo 'deb [arch=amd64] http://robotpkg.openrobots.org/packages/debian/pub xenial robotpkg' >> /etc/apt/sources.list.d/robotpkg.list"
```
3. Register the authentication certificate of robotpkg:
```
```
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 -
```
```
4. 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
5. The installation of **EigenPy** and its dependencies is made through the line:


For Python 2.7
4. The installation of **EigenPy** and its dependencies is made through the line:
```

sudo apt install robotpkg-py27-eigenpy
```bash
```
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
```
```
and then install **EigenPy** with:
and then install **EigenPy** for Python 3.x with:
```
```
brew install eigenpy
brew install eigenpy
```
```
for Python 2.7 or:

```
## Build
brew install eigenpy-python3

```
Build instruction can be found [here](./development/build.md)
for Python 3 support.


## 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


+6 −24
Original line number Original line Diff line number Diff line
from __future__ import print_function
import time  # noqa
import timeit  # noqa


import eigenpy
import numpy as np
import numpy as np
from IPython import get_ipython


import time
import eigenpy
import timeit


from IPython import get_ipython
ipython = get_ipython()
ipython = get_ipython()


quat = eigenpy.Quaternion()
quat = eigenpy.Quaternion()
a = [0., 0., 0.]
a = [0.0, 0.0, 0.0]


cmd1 = "timeit np.array(a)"
cmd1 = "timeit np.array(a)"
print("\n")
print("\n")
@@ -23,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)
@@ -50,7 +32,7 @@ print(cmd5)
ipython.magic(cmd5)
ipython.magic(cmd5)
print("\n")
print("\n")


a_matrix = np.matrix(a);
a_matrix = np.matrix(a)
cmd6 = "timeit np.asarray(a_matrix)"
cmd6 = "timeit np.asarray(a_matrix)"
print(cmd6)
print(cmd6)
ipython.magic(cmd6)
ipython.magic(cmd6)
Compare 3d9ae677 to b5ae8e49
Original line number Original line Diff line number Diff line
Subproject commit 3d9ae677710fd6f86176e9031aa3fe40d8f656ce
Subproject commit b5ae8e49306840a50ae9c752c5b4040f892c89d8

colcon.pkg

0 → 100644
+6 −0
Original line number Original line Diff line number Diff line
{
    "hooks": [
        "share/eigenpy/hook/ament_prefix_path.dsv",
        "share/eigenpy/hook/python_path.dsv"
    ]
}
 No newline at end of file

development/build.md

0 → 100644
+17 −0
Original line number Original line Diff line number Diff line
# 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.
+7 −0
Original line number Original line Diff line number Diff line
# 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.

development/release.md

0 → 100644
+34 −0
Original line number Original line Diff line number Diff line
# 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.
+14 −0
Original line number Original line Diff line number Diff line
:: 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)
+38 −0
Original line number Original line Diff line number Diff line
#! /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}
+5 −0
Original line number Original line Diff line number Diff line
#! /bin/bash
# Clang activation script

export CC="clang"
export CXX="clang++"
+3 −0
Original line number Original line Diff line number Diff line
:: Setup clang-cl compiler
set CC=clang-cl
set CXX=clang-cl
+32 −5
Original line number Original line Diff line number Diff line
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

doc/additionalDoc/package.hh

deleted100644 → 0
+0 −26
Original line number Original line Diff line number Diff line
/*
 * 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 ...

**/

doc/footer.html

deleted100644 → 0
+0 −11
Original line number Original line Diff line number Diff line
 <br><br>
 <hr>
 <center>
 <img src="./pictures/footer.jpg" Height=100>
 <br>soth library documentation</br>
 </center>
 <hr>
 </center>
 </body>
 </head>

doc/header.html

deleted100644 → 0
+0 −7
Original line number Original line Diff line number Diff line
<HTML>
    <HEAD>
      <TITLE>soth library documentation</TITLE>
      <LINK HREF="package.css" REL="stylesheet" TYPE="text/css">
    </HEAD>
    <BODY>

doc/package.css

deleted100644 → 0
+0 −230
Original line number Original line Diff line number Diff line
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

deleted100644 → 0
−23.1 KiB

23.06 KiB

doc/pictures/footer.jpg

deleted100644 → 0
−23.1 KiB

23.06 KiB

doc/pictures/footer.txt

deleted100644 → 0
+0 −2
Original line number Original line Diff line number Diff line
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.

doc/pictures/soth.tif

deleted100644 → 0
−118 KiB

File deleted.

+24 −0
Original line number Original line Diff line number Diff line
FROM ubuntu:22.04

RUN apt-get update -y && DEBIAN_FRONTEND=noninteractive apt-get install -qqy \
    build-essential \
    cmake \
    cmake-curses-gui \
    vim \
    gdb \
    git \
    libboost-all-dev \
    libeigen3-dev \
    liburdfdom-dev \
    python3-numpy

WORKDIR /src
RUN git clone --recursive -j2 -b devel https://github.com/stack-of-tasks/eigenpy

ENV CTEST_OUTPUT_ON_FAILURE=ON
ENV CTEST_PROGRESS_OUTPUT=ON
ENV CTEST_PARALLEL_LEVEL=2

WORKDIR /src/eigenpy/build
RUN cmake -DPYTHON_EXECUTABLE=$(which python3) -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON ..
RUN make -sj2

eigenpyConfig.cmake

deleted100644 → 0
+0 −14
Original line number Original line Diff line number Diff line
cmake_minimum_required(VERSION 2.8.3)

message(STATUS "Loading eigenpy from PkgConfig")

find_package(PkgConfig REQUIRED)
pkg_check_modules(eigenpy REQUIRED eigenpy)

# find absolute library paths for all eigenpy_LIBRARIES
set(libs ${eigenpy_LIBRARIES})
set(eigenpy_LIBRARIES "")
foreach(lib ${libs})
  find_library(abs_lib_${lib} ${lib} HINTS ${eigenpy_LIBRARY_DIRS})
  list(APPEND eigenpy_LIBRARIES "${abs_lib_${lib}}")
endforeach()

flake.lock

0 → 100644
+61 −0
Original line number Original line Diff line number Diff line
{
  "nodes": {
    "flake-parts": {
      "inputs": {
        "nixpkgs-lib": "nixpkgs-lib"
      },
      "locked": {
        "lastModified": 1743550720,
        "narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=",
        "owner": "hercules-ci",
        "repo": "flake-parts",
        "rev": "c621e8422220273271f52058f618c94e405bb0f5",
        "type": "github"
      },
      "original": {
        "owner": "hercules-ci",
        "repo": "flake-parts",
        "type": "github"
      }
    },
    "nixpkgs": {
      "locked": {
        "lastModified": 1743583204,
        "narHash": "sha256-F7n4+KOIfWrwoQjXrL2wD9RhFYLs2/GGe/MQY1sSdlE=",
        "owner": "NixOS",
        "repo": "nixpkgs",
        "rev": "2c8d3f48d33929642c1c12cd243df4cc7d2ce434",
        "type": "github"
      },
      "original": {
        "owner": "NixOS",
        "ref": "nixos-unstable",
        "repo": "nixpkgs",
        "type": "github"
      }
    },
    "nixpkgs-lib": {
      "locked": {
        "lastModified": 1743296961,
        "narHash": "sha256-b1EdN3cULCqtorQ4QeWgLMrd5ZGOjLSLemfa00heasc=",
        "owner": "nix-community",
        "repo": "nixpkgs.lib",
        "rev": "e4822aea2a6d1cdd36653c134cacfd64c97ff4fa",
        "type": "github"
      },
      "original": {
        "owner": "nix-community",
        "repo": "nixpkgs.lib",
        "type": "github"
      }
    },
    "root": {
      "inputs": {
        "flake-parts": "flake-parts",
        "nixpkgs": "nixpkgs"
      }
    }
  },
  "root": "root",
  "version": 7
}

flake.nix

0 → 100644
+40 −0
Original line number Original line Diff line number Diff line
{
  description = "Bindings between Numpy and Eigen using Boost.Python";

  inputs = {
    flake-parts.url = "github:hercules-ci/flake-parts";
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
  };

  outputs =
    inputs:
    inputs.flake-parts.lib.mkFlake { inherit inputs; } {
      systems = inputs.nixpkgs.lib.systems.flakeExposed;
      perSystem =
        { pkgs, self', ... }:
        {
          apps.default = {
            type = "app";
            program = pkgs.python3.withPackages (_: [ self'.packages.default ]);
          };
          devShells.default = pkgs.mkShell { inputsFrom = [ self'.packages.default ]; };
          packages = {
            default = self'.packages.eigenpy;
            eigenpy = pkgs.python3Packages.eigenpy.overrideAttrs (_: {
              src = pkgs.lib.fileset.toSource {
                root = ./.;
                fileset = pkgs.lib.fileset.unions [
                  ./CMakeLists.txt
                  ./doc
                  ./include
                  ./package.xml
                  ./python
                  ./src
                  ./unittest
                ];
              };
            });
          };
        };
    };
}
+169 −0
Original line number Original line Diff line number Diff line
/*
 * Copyright 2023 INRIA
 */

#ifndef __eigenpy_alignment_hpp__
#define __eigenpy_alignment_hpp__

#include <boost/python/detail/referent_storage.hpp>
#include <boost/python/converter/arg_from_python.hpp>
#include <boost/python/converter/rvalue_from_python_data.hpp>
#include <boost/type_traits/aligned_storage.hpp>
#include <eigenpy/utils/is-aligned.hpp>

namespace eigenpy {

template <std::size_t size, std::size_t alignment = EIGENPY_DEFAULT_ALIGN_BYTES>
struct aligned_storage {
  union type {
    typename ::boost::aligned_storage<size, alignment>::type data;
    char bytes[size];
  };
};

template <class Data>
struct aligned_instance {
  PyObject_VAR_HEAD PyObject *dict;
  PyObject *weakrefs;
  boost::python::instance_holder *objects;

  typename aligned_storage<sizeof(Data)>::type storage;
};

inline void *aligned_malloc(
    std::size_t size, std::size_t alignment = EIGENPY_DEFAULT_ALIGN_BYTES) {
  void *original = std::malloc(size + alignment);
  if (original == 0) return 0;
  if (is_aligned(original, alignment)) return original;
  void *aligned =
      reinterpret_cast<void *>((reinterpret_cast<std::size_t>(original) &
                                ~(std::size_t(alignment - 1))) +
                               alignment);
  *(reinterpret_cast<void **>(aligned) - 1) = original;
  return aligned;
}

}  // namespace eigenpy

namespace boost {
namespace python {
namespace detail {

template <typename Scalar, int Rows, int Cols, int Options, int MaxRows,
          int MaxCols>
struct referent_storage<
    Eigen::Matrix<Scalar, Rows, Cols, Options, MaxRows, MaxCols> &> {
  typedef Eigen::Matrix<Scalar, Rows, Cols, Options, MaxRows, MaxCols> T;
  typedef
      typename eigenpy::aligned_storage<referent_size<T &>::value>::type type;
};

template <typename Scalar, int Rows, int Cols, int Options, int MaxRows,
          int MaxCols>
struct referent_storage<
    const Eigen::Matrix<Scalar, Rows, Cols, Options, MaxRows, MaxCols> &> {
  typedef Eigen::Matrix<Scalar, Rows, Cols, Options, MaxRows, MaxCols> T;
  typedef
      typename eigenpy::aligned_storage<referent_size<T &>::value>::type type;
};

#ifdef EIGENPY_WITH_TENSOR_SUPPORT
template <typename Scalar, int Rank, int Options, typename IndexType>
struct referent_storage<Eigen::Tensor<Scalar, Rank, Options, IndexType> &> {
  typedef Eigen::Tensor<Scalar, Rank, Options, IndexType> T;
  typedef
      typename eigenpy::aligned_storage<referent_size<T &>::value>::type type;
};

template <typename Scalar, int Rank, int Options, typename IndexType>
struct referent_storage<
    const Eigen::Tensor<Scalar, Rank, Options, IndexType> &> {
  typedef Eigen::Tensor<Scalar, Rank, Options, IndexType> T;
  typedef
      typename eigenpy::aligned_storage<referent_size<T &>::value>::type type;
};
#endif

template <typename Scalar, int Options>
struct referent_storage<Eigen::Quaternion<Scalar, Options> &> {
  typedef Eigen::Quaternion<Scalar, Options> T;
  typedef
      typename eigenpy::aligned_storage<referent_size<T &>::value>::type type;
};

template <typename Scalar, int Options>
struct referent_storage<const Eigen::Quaternion<Scalar, Options> &> {
  typedef Eigen::Quaternion<Scalar, Options> T;
  typedef
      typename eigenpy::aligned_storage<referent_size<T &>::value>::type type;
};

}  // namespace detail
}  // namespace python
}  // namespace boost

namespace boost {
namespace python {
namespace objects {

// Force alignment of instance with value_holder
template <typename Derived>
struct instance<value_holder<Derived>>
    : ::eigenpy::aligned_instance<value_holder<Derived>> {};

}  // namespace objects
}  // namespace python
}  // namespace boost

namespace eigenpy {

template <class T>
struct call_destructor {
  static void run(void *bytes) {
    typedef typename boost::remove_const<
        typename boost::remove_reference<T>::type>::type T_;
    static_cast<T_ *>((void *)bytes)->~T_();
  }
};

template <class T>
struct rvalue_from_python_data
    : ::boost::python::converter::rvalue_from_python_storage<T> {
#if (!defined(__MWERKS__) || __MWERKS__ >= 0x3000) &&                        \
    (!defined(__EDG_VERSION__) || __EDG_VERSION__ >= 245) &&                 \
    (!defined(__DECCXX_VER) || __DECCXX_VER > 60590014) &&                   \
    !defined(BOOST_PYTHON_SYNOPSIS) /* Synopsis' OpenCXX has trouble parsing \
    this */
  // This must always be a POD struct with m_data its first member.
  BOOST_STATIC_ASSERT(
      BOOST_PYTHON_OFFSETOF(
          ::boost::python::converter::rvalue_from_python_storage<T>, stage1) ==
      0);
#endif

  // The usual constructor
  rvalue_from_python_data(
      ::boost::python::converter::rvalue_from_python_stage1_data const
          &_stage1) {
    this->stage1 = _stage1;
  }

  // This constructor just sets m_convertible -- used by
  // implicitly_convertible<> to perform the final step of the
  // conversion, where the construct() function is already known.
  rvalue_from_python_data(void *convertible) {
    this->stage1.convertible = convertible;
  }

  // Destroys any object constructed in the storage.
  ~rvalue_from_python_data() {
    if (this->stage1.convertible == this->storage.bytes) {
      void *storage = reinterpret_cast<void *>(this->storage.bytes);
      call_destructor<T>::run(storage);
    }
  }
};

}  // namespace eigenpy

#endif  // __eigenpy_alignment_hpp__
+125 −139
Original line number Original line Diff line number Diff line
/*
/*
 * Copyright 2014-2019, CNRS
 * Copyright 2014-2023 CNRS INRIA
 * Copyright 2018-2019, INRIA
 */
 */


#ifndef __eigenpy_angle_axis_hpp__
#ifndef __eigenpy_angle_axis_hpp__
#define __eigenpy_angle_axis_hpp__
#define __eigenpy_angle_axis_hpp__


#include "eigenpy/fwd.hpp"
#include "eigenpy/eigenpy.hpp"


#include <Eigen/Core>
namespace eigenpy {
#include <Eigen/Geometry>


namespace eigenpy
template <typename AngleAxis>
{
class AngleAxisVisitor;

  namespace bp = boost::python;
  
  template<typename AngleAxis> class AngleAxisVisitor;


template <typename Scalar>
template <typename Scalar>
  struct call< Eigen::AngleAxis<Scalar> >
struct call<Eigen::AngleAxis<Scalar>> {
  {
  typedef Eigen::AngleAxis<Scalar> AngleAxis;
  typedef Eigen::AngleAxis<Scalar> AngleAxis;
    static inline void expose()
    {
      AngleAxisVisitor<AngleAxis>::expose();
    }


    static inline bool isApprox(const AngleAxis & self, const AngleAxis & other,
  static inline void expose() { AngleAxisVisitor<AngleAxis>::expose(); }
                                const Scalar & prec = Eigen::NumTraits<Scalar>::dummy_precision())

    {
  static inline bool isApprox(
      const AngleAxis& self, const AngleAxis& other,
      const Scalar& prec = Eigen::NumTraits<Scalar>::dummy_precision()) {
    return self.isApprox(other, prec);
    return self.isApprox(other, prec);
  }
  }
};
};


  BOOST_PYTHON_FUNCTION_OVERLOADS(isApproxAngleAxis_overload,call<Eigen::AngleAxisd>::isApprox,2,3)

template <typename AngleAxis>
template <typename AngleAxis>
  class AngleAxisVisitor
class AngleAxisVisitor : public bp::def_visitor<AngleAxisVisitor<AngleAxis>> {
  : public bp::def_visitor< AngleAxisVisitor<AngleAxis> >
  {

  typedef typename AngleAxis::Scalar Scalar;
  typedef typename AngleAxis::Scalar Scalar;
  typedef typename AngleAxis::Vector3 Vector3;
  typedef typename AngleAxis::Vector3 Vector3;
  typedef typename AngleAxis::Matrix3 Matrix3;
  typedef typename AngleAxis::Matrix3 Matrix3;


  typedef typename Eigen::Quaternion<Scalar, 0> Quaternion;
  typedef typename Eigen::Quaternion<Scalar, 0> Quaternion;
  typedef Eigen::RotationBase<AngleAxis, 3> RotationBase;


  public:
  BOOST_PYTHON_FUNCTION_OVERLOADS(isApproxAngleAxis_overload,
                                  call<AngleAxis>::isApprox, 2, 3)


 public:
  template <class PyClass>
  template <class PyClass>
    void visit(PyClass& cl) const 
  void visit(PyClass& cl) const {
    {
    cl.def(bp::init<>(bp::arg("self"), "Default constructor"))
      cl
        .def(bp::init<Scalar, Vector3>(bp::args("self", "angle", "axis"),
      .def(bp::init<>(bp::arg("self"),"Default constructor"))
      .def(bp::init<Scalar,Vector3>
           ((bp::arg("self"),bp::arg("angle"),bp::arg("axis")),
                                       "Initialize from angle and axis."))
                                       "Initialize from angle and axis."))
      .def(bp::init<Matrix3>
        .def(bp::init<Matrix3>(bp::args("self", "R"),
           ((bp::arg("self"),bp::arg("rotationMatrix")),
                               "Initialize from a rotation matrix"))
                               "Initialize from a rotation matrix"))
      .def(bp::init<Quaternion>(bp::arg("self"),bp::arg("quaternion"),"Initialize from a quaternion."))
        .def(bp::init<Quaternion>(bp::args("self", "quaternion"),
      .def(bp::init<AngleAxis>(bp::arg("self"),bp::arg("copy"),"Copy constructor."))
                                  "Initialize from a quaternion."))
        .def(bp::init<AngleAxis>(bp::args("self", "copy"), "Copy constructor."))


        /* --- Properties --- */
        /* --- Properties --- */
      .add_property("axis",
        .add_property(
                    bp::make_function((const Vector3 & (AngleAxis::*)()const)&AngleAxis::axis,
            "axis",
                                      bp::return_value_policy<bp::copy_const_reference>()),
            bp::make_function((Vector3 & (AngleAxis::*)()) & AngleAxis::axis,
                              bp::return_internal_reference<>()),
            &AngleAxisVisitor::setAxis, "The rotation axis.")
            &AngleAxisVisitor::setAxis, "The rotation axis.")
        .add_property("angle",
        .add_property("angle",
                      (Scalar (AngleAxis::*)() const) & AngleAxis::angle,
                      (Scalar (AngleAxis::*)() const) & AngleAxis::angle,
                      &AngleAxisVisitor::setAngle, "The rotation angle.")
                      &AngleAxisVisitor::setAngle, "The rotation angle.")


        /* --- Methods --- */
        /* --- Methods --- */
      .def("inverse",&AngleAxis::inverse,
        .def("inverse", &AngleAxis::inverse, bp::arg("self"),
           bp::arg("self"),
             "Return the inverse rotation.")
             "Return the inverse rotation.")
      .def("fromRotationMatrix",&AngleAxis::template fromRotationMatrix<Matrix3>,
        .def("fromRotationMatrix",
           (bp::arg("self"),bp::arg("rot")),
             &AngleAxis::template fromRotationMatrix<Matrix3>,
           "Sets *this from a 3x3 rotation matrix",
             (bp::arg("self"), bp::arg("rotation matrix")),
           bp::return_self<>())
             "Sets *this from a 3x3 rotation matrix", bp::return_self<>())
      .def("toRotationMatrix",
        .def("toRotationMatrix", &AngleAxis::toRotationMatrix,
           bp::arg("self"),
             //           bp::arg("self"),
           &AngleAxis::toRotationMatrix,
             "Constructs and returns an equivalent rotation matrix.")
           "Constructs and returns an equivalent 3x3 rotation matrix.")
        .def("matrix", &AngleAxis::matrix, bp::arg("self"),
      .def("matrix",&AngleAxis::matrix,
           bp::arg("self"),
             "Returns an equivalent rotation matrix.")
             "Returns an equivalent rotation matrix.")


      .def("isApprox",
        .def("isApprox", &call<AngleAxis>::isApprox,
           &call<AngleAxis>::isApprox,
             isApproxAngleAxis_overload(
           isApproxAngleAxis_overload(bp::args("self","other","prec"),
                 bp::args("self", "other", "prec"),
                                      "Returns true if *this is approximately equal to other, within the precision determined by prec."))
                 "Returns true if *this is approximately equal to other, "
                 "within the precision determined by prec."))


        /* --- Operators --- */
        /* --- Operators --- */
        .def(bp::self * bp::other<Vector3>())
        .def(bp::self * bp::other<Vector3>())
@@ -101,26 +86,27 @@ namespace eigenpy
        .def("__ne__", &AngleAxisVisitor::__ne__)
        .def("__ne__", &AngleAxisVisitor::__ne__)


        .def("__str__", &print)
        .def("__str__", &print)
      .def("__repr__",&print)
        .def("__repr__", &print);
      ;
  }
  }


 private:
 private:
  static void setAxis(AngleAxis& self, const Vector3& axis) {
    self.axis() = axis;
  }


    static void setAxis(AngleAxis & self, const Vector3 & axis)
  static void setAngle(AngleAxis& self, const Scalar& angle) {
    { self.axis() = axis; }
    self.angle() = angle;

  }
    static void setAngle( AngleAxis & self, const Scalar & angle)
    { self.angle() = angle; }


    static bool __eq__(const AngleAxis & u, const AngleAxis & v)
  static bool __eq__(const AngleAxis& u, const AngleAxis& v) {
    { return u.axis() == v.axis() && v.angle() == u.angle(); }
    return u.axis() == v.axis() && v.angle() == u.angle();
  }


    static bool __ne__(const AngleAxis & u, const AngleAxis & v)
  static bool __ne__(const AngleAxis& u, const AngleAxis& v) {
    { return !__eq__(u,v); }
    return !__eq__(u, v);
  }


    static std::string print(const AngleAxis & self)
  static std::string print(const AngleAxis& self) {
    {
    std::stringstream ss;
    std::stringstream ss;
    ss << "angle: " << self.angle() << std::endl;
    ss << "angle: " << self.angle() << std::endl;
    ss << "axis: " << self.axis().transpose() << std::endl;
    ss << "axis: " << self.axis().transpose() << std::endl;
@@ -129,15 +115,15 @@ namespace eigenpy
  }
  }


 public:
 public:

  static void expose() {
    static void expose()
    bp::class_<AngleAxis>(
    {
        "AngleAxis", "AngleAxis representation of a rotation.\n\n", bp::no_init)
      bp::class_<AngleAxis>("AngleAxis",
        .def(AngleAxisVisitor<AngleAxis>())
                            "AngleAxis representation of a rotation.\n\n",
        .def(IdVisitor<AngleAxis>());
                            bp::no_init)

      .def(AngleAxisVisitor<AngleAxis>());
    // Cast to Eigen::RotationBase
    bp::implicitly_convertible<AngleAxis, RotationBase>();
  }
  }

};
};


}  // namespace eigenpy
}  // namespace eigenpy
+20 −0
Original line number Original line Diff line number Diff line
/*
 * Copyright 2020 INRIA
 */

#ifndef __eigenpy_decompositions_computation_info_hpp__
#define __eigenpy_decompositions_computation_info_hpp__

#include "eigenpy/fwd.hpp"

namespace eigenpy {
inline void exposeComputationInfo() {
  boost::python::enum_<Eigen::ComputationInfo>("ComputationInfo")
      .value("Success", Eigen::Success)
      .value("NumericalIssue", Eigen::NumericalIssue)
      .value("NoConvergence", Eigen::NoConvergence)
      .value("InvalidInput", Eigen::InvalidInput);
}
}  // namespace eigenpy

#endif  // define __eigenpy_decompositions_computation_info_hpp__
+33 −0
Original line number Original line Diff line number Diff line
//
// Copyright (c) 2016-2023 CNRS INRIA
// Copyright (c) 2023 Heriot-Watt University
//

#ifndef __eigenpy_utils_copyable_hpp__
#define __eigenpy_utils_copyable_hpp__

#include <boost/python.hpp>

namespace eigenpy {

///
/// \brief Add the Python method copy to allow a copy of this by calling the
/// copy constructor.
///
template <class C>
struct CopyableVisitor : public bp::def_visitor<CopyableVisitor<C>> {
  template <class PyClass>
  void visit(PyClass& cl) const {
    cl.def("copy", &copy, bp::arg("self"), "Returns a copy of *this.");
    cl.def("__copy__", &copy, bp::arg("self"), "Returns a copy of *this.");
    cl.def("__deepcopy__", &deepcopy, bp::args("self", "memo"),
           "Returns a deep copy of *this.");
  }

 private:
  static C copy(const C& self) { return C(self); }
  static C deepcopy(const C& self, bp::dict) { return C(self); }
};
}  // namespace eigenpy

#endif  // ifndef __eigenpy_utils_copyable_hpp__
+189 −0
Original line number Original line Diff line number Diff line
/*
 * Copyright 2024 INRIA
 */

#ifndef __eigenpy_decompositions_col_piv_houselholder_qr_hpp__
#define __eigenpy_decompositions_col_piv_houselholder_qr_hpp__

#include "eigenpy/eigenpy.hpp"
#include "eigenpy/utils/scalar-name.hpp"

#include <Eigen/QR>

namespace eigenpy {

template <typename _MatrixType>
struct ColPivHouseholderQRSolverVisitor
    : public boost::python::def_visitor<
          ColPivHouseholderQRSolverVisitor<_MatrixType>> {
  typedef _MatrixType MatrixType;
  typedef typename MatrixType::Scalar Scalar;
  typedef typename MatrixType::RealScalar RealScalar;
  typedef Eigen::Matrix<Scalar, Eigen::Dynamic, 1, MatrixType::Options>
      VectorXs;
  typedef Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic,
                        MatrixType::Options>
      MatrixXs;
  typedef Eigen::ColPivHouseholderQR<MatrixType> Solver;
  typedef Solver Self;

  template <class PyClass>
  void visit(PyClass &cl) const {
    cl.def(bp::init<>(bp::arg("self"),
                      "Default constructor.\n"
                      "The default constructor is useful in cases in which the "
                      "user intends to perform decompositions via "
                      "HouseholderQR.compute(matrix)"))
        .def(bp::init<Eigen::DenseIndex, Eigen::DenseIndex>(
            bp::args("self", "rows", "cols"),
            "Default constructor with memory preallocation.\n"
            "Like the default constructor but with preallocation of the "
            "internal data according to the specified problem size. "))
        .def(bp::init<MatrixType>(
            bp::args("self", "matrix"),
            "Constructs a QR factorization from a given matrix.\n"
            "This constructor computes the QR factorization of the matrix "
            "matrix by calling the method compute()."))

        .def("absDeterminant", &Self::absDeterminant, bp::arg("self"),
             "Returns the absolute value of the determinant of the matrix of "
             "which *this is the QR decomposition.\n"
             "It has only linear complexity (that is, O(n) where n is the "
             "dimension of the square matrix) as the QR decomposition has "
             "already been computed.\n"
             "Note: This is only for square matrices.")
        .def("logAbsDeterminant", &Self::logAbsDeterminant, bp::arg("self"),
             "Returns the natural log of the absolute value of the determinant "
             "of the matrix of which *this is the QR decomposition.\n"
             "It has only linear complexity (that is, O(n) where n is the "
             "dimension of the square matrix) as the QR decomposition has "
             "already been computed.\n"
             "Note: This is only for square matrices. This method is useful to "
             "work around the risk of overflow/underflow that's inherent to "
             "determinant computation.")
        .def("dimensionOfKernel", &Self::dimensionOfKernel, bp::arg("self"),
             "Returns the dimension of the kernel of the matrix of which *this "
             "is the QR decomposition.")
        .def("info", &Self::info, bp::arg("self"),
             "Reports whether the QR factorization was successful.\n"
             "Note: This function always returns Success. It is provided for "
             "compatibility with other factorization routines.")
        .def("isInjective", &Self::isInjective, bp::arg("self"),
             "Returns true if the matrix associated with this QR decomposition "
             "represents an injective linear map, i.e. has trivial kernel; "
             "false otherwise.\n"
             "\n"
             "Note: This method has to determine which pivots should be "
             "considered nonzero. For that, it uses the threshold value that "
             "you can control by calling setThreshold(threshold).")
        .def("isInvertible", &Self::isInvertible, bp::arg("self"),
             "Returns true if the matrix associated with the QR decomposition "
             "is invertible.\n"
             "\n"
             "Note: This method has to determine which pivots should be "
             "considered nonzero. For that, it uses the threshold value that "
             "you can control by calling setThreshold(threshold).")
        .def("isSurjective", &Self::isSurjective, bp::arg("self"),
             "Returns true if the matrix associated with this QR decomposition "
             "represents a surjective linear map; false otherwise.\n"
             "\n"
             "Note: This method has to determine which pivots should be "
             "considered nonzero. For that, it uses the threshold value that "
             "you can control by calling setThreshold(threshold).")
        .def("maxPivot", &Self::maxPivot, bp::arg("self"),
             "Returns the absolute value of the biggest pivot, i.e. the "
             "biggest diagonal coefficient of U.")
        .def("nonzeroPivots", &Self::nonzeroPivots, bp::arg("self"),
             "Returns the number of nonzero pivots in the QR decomposition. "
             "Here nonzero is meant in the exact sense, not in a fuzzy sense. "
             "So that notion isn't really intrinsically interesting, but it is "
             "still useful when implementing algorithms.")
        .def("rank", &Self::rank, bp::arg("self"),
             "Returns the rank of the matrix associated with the QR "
             "decomposition.\n"
             "\n"
             "Note: This method has to determine which pivots should be "
             "considered nonzero. For that, it uses the threshold value that "
             "you can control by calling setThreshold(threshold).")

        .def("setThreshold",
             (Self & (Self::*)(const RealScalar &)) & Self::setThreshold,
             bp::args("self", "threshold"),
             "Allows to prescribe a threshold to be used by certain methods, "
             "such as rank(), who need to determine when pivots are to be "
             "considered nonzero. This is not used for the QR decomposition "
             "itself.\n"
             "\n"
             "When it needs to get the threshold value, Eigen calls "
             "threshold(). By default, this uses a formula to automatically "
             "determine a reasonable threshold. Once you have called the "
             "present method setThreshold(const RealScalar&), your value is "
             "used instead.\n"
             "\n"
             "Note: A pivot will be considered nonzero if its absolute value "
             "is strictly greater than |pivot| ⩽ threshold×|maxpivot| where "
             "maxpivot is the biggest pivot.",
             bp::return_self<>())
        .def("threshold", &Self::threshold, bp::arg("self"),
             "Returns the threshold that will be used by certain methods such "
             "as rank().")

        .def("matrixQR", &Self::matrixQR, bp::arg("self"),
             "Returns the matrix where the Householder QR decomposition is "
             "stored in a LAPACK-compatible way.",
             bp::return_value_policy<bp::copy_const_reference>())
        .def("matrixR", &Self::matrixR, bp::arg("self"),
             "Returns the matrix where the result Householder QR is stored.",
             bp::return_value_policy<bp::copy_const_reference>())

        .def(
            "compute",
            (Solver & (Solver::*)(const Eigen::EigenBase<MatrixType> &matrix)) &
                Solver::compute,
            bp::args("self", "matrix"),
            "Computes the QR factorization of given matrix.",
            bp::return_self<>())

        .def("inverse", inverse, bp::arg("self"),
             "Returns the inverse of the matrix associated with the QR "
             "decomposition..")

        .def("solve", &solve<MatrixXs>, bp::args("self", "B"),
             "Returns the solution X of A X = B using the current "
             "decomposition of A where B is a right hand side matrix.");
  }

  static void expose() {
    static const std::string classname =
        "ColPivHouseholderQR" + scalar_name<Scalar>::shortname();
    expose(classname);
  }

  static void expose(const std::string &name) {
    bp::class_<Solver>(
        name.c_str(),
        "This class performs a rank-revealing QR decomposition of a matrix A "
        "into matrices P, Q and R such that:\n"
        "AP=QR\n"
        "by using Householder transformations. Here, P is a permutation "
        "matrix, Q a unitary matrix and R an upper triangular matrix.\n"
        "\n"
        "This decomposition performs column pivoting in order to be "
        "rank-revealing and improve numerical stability. It is slower than "
        "HouseholderQR, and faster than FullPivHouseholderQR.",
        bp::no_init)
        .def(ColPivHouseholderQRSolverVisitor())
        .def(IdVisitor<Solver>());
  }

 private:
  template <typename MatrixOrVector>
  static MatrixOrVector solve(const Solver &self, const MatrixOrVector &vec) {
    return self.solve(vec);
  }
  static MatrixXs inverse(const Self &self) { return self.inverse(); }
};

}  // namespace eigenpy

#endif  // ifndef __eigenpy_decompositions_col_piv_houselholder_qr_hpp__
+204 −0
Original line number Original line Diff line number Diff line
/*
 * Copyright 2024 INRIA
 */

#ifndef __eigenpy_decompositions_complete_orthogonal_decomposition_hpp__
#define __eigenpy_decompositions_complete_orthogonal_decomposition_hpp__

#include "eigenpy/eigenpy.hpp"
#include "eigenpy/utils/scalar-name.hpp"

#include <Eigen/QR>

namespace eigenpy {

template <typename _MatrixType>
struct CompleteOrthogonalDecompositionSolverVisitor
    : public boost::python::def_visitor<
          CompleteOrthogonalDecompositionSolverVisitor<_MatrixType>> {
  typedef _MatrixType MatrixType;
  typedef typename MatrixType::Scalar Scalar;
  typedef typename MatrixType::RealScalar RealScalar;
  typedef Eigen::Matrix<Scalar, Eigen::Dynamic, 1, MatrixType::Options>
      VectorXs;
  typedef Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic,
                        MatrixType::Options>
      MatrixXs;
  typedef Eigen::CompleteOrthogonalDecomposition<MatrixType> Solver;
  typedef Solver Self;

  template <class PyClass>
  void visit(PyClass &cl) const {
    cl.def(bp::init<>(bp::arg("self"),
                      "Default constructor.\n"
                      "The default constructor is useful in cases in which the "
                      "user intends to perform decompositions via "
                      "CompleteOrthogonalDecomposition.compute(matrix)"))
        .def(bp::init<Eigen::DenseIndex, Eigen::DenseIndex>(
            bp::args("self", "rows", "cols"),
            "Default constructor with memory preallocation.\n"
            "Like the default constructor but with preallocation of the "
            "internal data according to the specified problem size. "))
        .def(bp::init<MatrixType>(bp::args("self", "matrix"),
                                  "Constructs a complete orthogonal "
                                  "factorization from a given matrix.\n"
                                  "This constructor computes the complete "
                                  "orthogonal factorization of the matrix "
                                  "matrix by calling the method compute()."))

        .def("absDeterminant", &Self::absDeterminant, bp::arg("self"),
             "Returns the absolute value of the determinant of the matrix "
             "associated with the complete orthogonal decomposition.\n"
             "It has only linear complexity (that is, O(n) where n is the "
             "dimension of the square matrix) as the complete orthogonal "
             "decomposition has "
             "already been computed.\n"
             "Note: This is only for square matrices.")
        .def("logAbsDeterminant", &Self::logAbsDeterminant, bp::arg("self"),
             "Returns the natural log of the absolute value of the determinant "
             "of the matrix of which *this is the complete orthogonal "
             "decomposition.\n"
             "It has only linear complexity (that is, O(n) where n is the "
             "dimension of the square matrix) as the complete orthogonal "
             "decomposition has "
             "already been computed.\n"
             "Note: This is only for square matrices. This method is useful to "
             "work around the risk of overflow/underflow that's inherent to "
             "determinant computation.")
        .def("dimensionOfKernel", &Self::dimensionOfKernel, bp::arg("self"),
             "Returns the dimension of the kernel of the matrix of which *this "
             "is the complete orthogonal decomposition.")
        .def("info", &Self::info, bp::arg("self"),
             "Reports whether the complete orthogonal factorization was "
             "successful.\n"
             "Note: This function always returns Success. It is provided for "
             "compatibility with other factorization routines.")
        .def("isInjective", &Self::isInjective, bp::arg("self"),
             "Returns true if the matrix associated with this complete "
             "orthogonal decomposition "
             "represents an injective linear map, i.e. has trivial kernel; "
             "false otherwise.\n"
             "\n"
             "Note: This method has to determine which pivots should be "
             "considered nonzero. For that, it uses the threshold value that "
             "you can control by calling setThreshold(threshold).")
        .def("isInvertible", &Self::isInvertible, bp::arg("self"),
             "Returns true if the matrix associated with the complete "
             "orthogonal decomposition "
             "is invertible.\n"
             "\n"
             "Note: This method has to determine which pivots should be "
             "considered nonzero. For that, it uses the threshold value that "
             "you can control by calling setThreshold(threshold).")
        .def("isSurjective", &Self::isSurjective, bp::arg("self"),
             "Returns true if the matrix associated with this complete "
             "orthogonal decomposition "
             "represents a surjective linear map; false otherwise.\n"
             "\n"
             "Note: This method has to determine which pivots should be "
             "considered nonzero. For that, it uses the threshold value that "
             "you can control by calling setThreshold(threshold).")
        .def("maxPivot", &Self::maxPivot, bp::arg("self"),
             "Returns the absolute value of the biggest pivot, i.e. the "
             "biggest diagonal coefficient of U.")
        .def("nonzeroPivots", &Self::nonzeroPivots, bp::arg("self"),
             "Returns the number of nonzero pivots in the complete orthogonal "
             "decomposition. "
             "Here nonzero is meant in the exact sense, not in a fuzzy sense. "
             "So that notion isn't really intrinsically interesting, but it is "
             "still useful when implementing algorithms.")
        .def("rank", &Self::rank, bp::arg("self"),
             "Returns the rank of the matrix associated with the complete "
             "orthogonal "
             "decomposition.\n"
             "\n"
             "Note: This method has to determine which pivots should be "
             "considered nonzero. For that, it uses the threshold value that "
             "you can control by calling setThreshold(threshold).")

        .def("setThreshold",
             (Self & (Self::*)(const RealScalar &)) & Self::setThreshold,
             bp::args("self", "threshold"),
             "Allows to prescribe a threshold to be used by certain methods, "
             "such as rank(), who need to determine when pivots are to be "
             "considered nonzero. This is not used for the complete orthogonal "
             "decomposition "
             "itself.\n"
             "\n"
             "When it needs to get the threshold value, Eigen calls "
             "threshold(). By default, this uses a formula to automatically "
             "determine a reasonable threshold. Once you have called the "
             "present method setThreshold(const RealScalar&), your value is "
             "used instead.\n"
             "\n"
             "Note: A pivot will be considered nonzero if its absolute value "
             "is strictly greater than |pivot| ⩽ threshold×|maxpivot| where "
             "maxpivot is the biggest pivot.",
             bp::return_self<>())
        .def("threshold", &Self::threshold, bp::arg("self"),
             "Returns the threshold that will be used by certain methods such "
             "as rank().")

        .def("matrixQTZ", &Self::matrixQTZ, bp::arg("self"),
             "Returns the matrix where the complete orthogonal decomposition "
             "is stored.",
             bp::return_value_policy<bp::copy_const_reference>())
        .def("matrixT", &Self::matrixT, bp::arg("self"),
             "Returns the matrix where the complete orthogonal decomposition "
             "is stored.",
             bp::return_value_policy<bp::copy_const_reference>())
        .def("matrixZ", &Self::matrixZ, bp::arg("self"),
             "Returns the matrix Z.")

        .def(
            "compute",
            (Solver & (Solver::*)(const Eigen::EigenBase<MatrixType> &matrix)) &
                Solver::compute,
            bp::args("self", "matrix"),
            "Computes the complete orthogonal factorization of given matrix.",
            bp::return_self<>())

        .def("pseudoInverse", pseudoInverse, bp::arg("self"),
             "Returns the pseudo-inverse of the matrix associated with the "
             "complete orthogonal "
             "decomposition.")

        .def("solve", &solve<MatrixXs>, bp::args("self", "B"),
             "Returns the solution X of A X = B using the current "
             "decomposition of A where B is a right hand side matrix.");
  }

  static void expose() {
    static const std::string classname =
        "CompleteOrthogonalDecomposition" + scalar_name<Scalar>::shortname();
    expose(classname);
  }

  static void expose(const std::string &name) {
    bp::class_<Solver>(
        name.c_str(),
        "This class performs a rank-revealing complete orthogonal "
        "decomposition of a matrix A into matrices P, Q, T, and Z such that:\n"
        "AP=Q[T000]Z"
        "by using Householder transformations. Here, P is a permutation "
        "matrix, Q and Z are unitary matrices and T an upper triangular matrix "
        "of size rank-by-rank. A may be rank deficient.",
        bp::no_init)
        .def(CompleteOrthogonalDecompositionSolverVisitor())
        .def(IdVisitor<Solver>());
  }

 private:
  template <typename MatrixOrVector>
  static MatrixOrVector solve(const Solver &self, const MatrixOrVector &vec) {
    return self.solve(vec);
  }
  static MatrixXs pseudoInverse(const Self &self) {
    return self.pseudoInverse();
  }
};

}  // namespace eigenpy

#endif  // ifndef
        // __eigenpy_decompositions_complete_orthogonal_decomposition_hpp__
+93 −0
Original line number Original line Diff line number Diff line
/*
 * Copyright 2020 INRIA
 */

#ifndef __eigenpy_decompositions_eigen_solver_hpp__
#define __eigenpy_decompositions_eigen_solver_hpp__

#include <Eigen/Core>
#include <Eigen/Eigenvalues>

#include "eigenpy/eigen-to-python.hpp"
#include "eigenpy/eigenpy.hpp"
#include "eigenpy/utils/scalar-name.hpp"

namespace eigenpy {

template <typename _MatrixType>
struct EigenSolverVisitor
    : public boost::python::def_visitor<EigenSolverVisitor<_MatrixType>> {
  typedef _MatrixType MatrixType;
  typedef typename MatrixType::Scalar Scalar;
  typedef Eigen::EigenSolver<MatrixType> Solver;

  template <class PyClass>
  void visit(PyClass& cl) const {
    cl.def(bp::init<>("Default constructor"))
        .def(bp::init<Eigen::DenseIndex>(
            bp::arg("size"), "Default constructor with memory preallocation"))
        .def(bp::init<MatrixType, bp::optional<bool>>(
            bp::args("matrix", "compute_eigen_vectors"),
            "Computes eigendecomposition of given matrix"))

        .def("eigenvalues", &Solver::eigenvalues, bp::arg("self"),
             "Returns the eigenvalues of given matrix.",
             bp::return_internal_reference<>())
        .def("eigenvectors", &Solver::eigenvectors, bp::arg("self"),
             "Returns the eigenvectors of given matrix.")

        .def("compute", &EigenSolverVisitor::compute_proxy<MatrixType>,
             bp::args("self", "matrix"),
             "Computes the eigendecomposition of given matrix.",
             bp::return_self<>())
        .def("compute",
             (Solver &
              (Solver::*)(const Eigen::EigenBase<MatrixType>& matrix, bool)) &
                 Solver::compute,
             bp::args("self", "matrix", "compute_eigen_vectors"),
             "Computes the eigendecomposition of given matrix.",
             bp::return_self<>())

        .def("getMaxIterations", &Solver::getMaxIterations, bp::arg("self"),
             "Returns the maximum number of iterations.")
        .def("setMaxIterations", &Solver::setMaxIterations,
             bp::args("self", "max_iter"),
             "Sets the maximum number of iterations allowed.",
             bp::return_self<>())

        .def("pseudoEigenvalueMatrix", &Solver::pseudoEigenvalueMatrix,
             bp::arg("self"),
             "Returns the block-diagonal matrix in the "
             "pseudo-eigendecomposition.")
        .def("pseudoEigenvectors", &Solver::pseudoEigenvectors, bp::arg("self"),
             "Returns the pseudo-eigenvectors of given matrix.",
             bp::return_internal_reference<>())

        .def("info", &Solver::info, bp::arg("self"),
             "NumericalIssue if the input contains INF or NaN values or "
             "overflow occured. Returns Success otherwise.");
  }

  static void expose() {
    static const std::string classname =
        "EigenSolver" + scalar_name<Scalar>::shortname();
    expose(classname);
  }

  static void expose(const std::string& name) {
    bp::class_<Solver>(name.c_str(), bp::no_init)
        .def(EigenSolverVisitor())
        .def(IdVisitor<Solver>());
  }

 private:
  template <typename MatrixType>
  static Solver& compute_proxy(Solver& self,
                               const Eigen::EigenBase<MatrixType>& matrix) {
    return self.compute(matrix);
  }
};

}  // namespace eigenpy

#endif  // ifndef __eigenpy_decompositions_eigen_solver_hpp__
+183 −0
Original line number Original line Diff line number Diff line
/*
 * Copyright 2024 INRIA
 */

#ifndef __eigenpy_decompositions_full_piv_houselholder_qr_hpp__
#define __eigenpy_decompositions_full_piv_houselholder_qr_hpp__

#include "eigenpy/eigenpy.hpp"
#include "eigenpy/utils/scalar-name.hpp"

#include <Eigen/QR>

namespace eigenpy {

template <typename _MatrixType>
struct FullPivHouseholderQRSolverVisitor
    : public boost::python::def_visitor<
          FullPivHouseholderQRSolverVisitor<_MatrixType>> {
  typedef _MatrixType MatrixType;
  typedef typename MatrixType::Scalar Scalar;
  typedef typename MatrixType::RealScalar RealScalar;
  typedef Eigen::Matrix<Scalar, Eigen::Dynamic, 1, MatrixType::Options>
      VectorXs;
  typedef Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic,
                        MatrixType::Options>
      MatrixXs;
  typedef Eigen::FullPivHouseholderQR<MatrixType> Solver;
  typedef Solver Self;

  template <class PyClass>
  void visit(PyClass &cl) const {
    cl.def(bp::init<>(bp::arg("self"),
                      "Default constructor.\n"
                      "The default constructor is useful in cases in which the "
                      "user intends to perform decompositions via "
                      "HouseholderQR.compute(matrix)"))
        .def(bp::init<Eigen::DenseIndex, Eigen::DenseIndex>(
            bp::args("self", "rows", "cols"),
            "Default constructor with memory preallocation.\n"
            "Like the default constructor but with preallocation of the "
            "internal data according to the specified problem size. "))
        .def(bp::init<MatrixType>(
            bp::args("self", "matrix"),
            "Constructs a QR factorization from a given matrix.\n"
            "This constructor computes the QR factorization of the matrix "
            "matrix by calling the method compute()."))

        .def("absDeterminant", &Self::absDeterminant, bp::arg("self"),
             "Returns the absolute value of the determinant of the matrix of "
             "which *this is the QR decomposition.\n"
             "It has only linear complexity (that is, O(n) where n is the "
             "dimension of the square matrix) as the QR decomposition has "
             "already been computed.\n"
             "Note: This is only for square matrices.")
        .def("logAbsDeterminant", &Self::logAbsDeterminant, bp::arg("self"),
             "Returns the natural log of the absolute value of the determinant "
             "of the matrix of which *this is the QR decomposition.\n"
             "It has only linear complexity (that is, O(n) where n is the "
             "dimension of the square matrix) as the QR decomposition has "
             "already been computed.\n"
             "Note: This is only for square matrices. This method is useful to "
             "work around the risk of overflow/underflow that's inherent to "
             "determinant computation.")
        .def("dimensionOfKernel", &Self::dimensionOfKernel, bp::arg("self"),
             "Returns the dimension of the kernel of the matrix of which *this "
             "is the QR decomposition.")
        .def("isInjective", &Self::isInjective, bp::arg("self"),
             "Returns true if the matrix associated with this QR decomposition "
             "represents an injective linear map, i.e. has trivial kernel; "
             "false otherwise.\n"
             "\n"
             "Note: This method has to determine which pivots should be "
             "considered nonzero. For that, it uses the threshold value that "
             "you can control by calling setThreshold(threshold).")
        .def("isInvertible", &Self::isInvertible, bp::arg("self"),
             "Returns true if the matrix associated with the QR decomposition "
             "is invertible.\n"
             "\n"
             "Note: This method has to determine which pivots should be "
             "considered nonzero. For that, it uses the threshold value that "
             "you can control by calling setThreshold(threshold).")
        .def("isSurjective", &Self::isSurjective, bp::arg("self"),
             "Returns true if the matrix associated with this QR decomposition "
             "represents a surjective linear map; false otherwise.\n"
             "\n"
             "Note: This method has to determine which pivots should be "
             "considered nonzero. For that, it uses the threshold value that "
             "you can control by calling setThreshold(threshold).")
        .def("maxPivot", &Self::maxPivot, bp::arg("self"),
             "Returns the absolute value of the biggest pivot, i.e. the "
             "biggest diagonal coefficient of U.")
        .def("nonzeroPivots", &Self::nonzeroPivots, bp::arg("self"),
             "Returns the number of nonzero pivots in the QR decomposition. "
             "Here nonzero is meant in the exact sense, not in a fuzzy sense. "
             "So that notion isn't really intrinsically interesting, but it is "
             "still useful when implementing algorithms.")
        .def("rank", &Self::rank, bp::arg("self"),
             "Returns the rank of the matrix associated with the QR "
             "decomposition.\n"
             "\n"
             "Note: This method has to determine which pivots should be "
             "considered nonzero. For that, it uses the threshold value that "
             "you can control by calling setThreshold(threshold).")

        .def("setThreshold",
             (Self & (Self::*)(const RealScalar &)) & Self::setThreshold,
             bp::args("self", "threshold"),
             "Allows to prescribe a threshold to be used by certain methods, "
             "such as rank(), who need to determine when pivots are to be "
             "considered nonzero. This is not used for the QR decomposition "
             "itself.\n"
             "\n"
             "When it needs to get the threshold value, Eigen calls "
             "threshold(). By default, this uses a formula to automatically "