Git Product home page Git Product logo

multiple-polymorphism's Introduction

Multiple polymorphism

Genericity offers a programming paradigm that reconciles polymorphism (static) and performance in order to define algorithms operating on data of different types without additional costs. In C++, this polymorphism is based on templates. Generic and high-performance C++ libraries are intensively based on this paradigm.

While C++ is a language of choice for the development of final scientific applications, it remains too restrictive during the analysis and prototyping phases, for which we prefer generally interactive languages (Python / R / Matlab); this is why many C++ libraries have chosen to export their functionalities through bindings.

The problem remains that the static/generic polymorphism (where each functionality = 1 type) cooperates wrong with dynamic polymorphism (1 type = multiple features).

This project aims to establish a practical solution to this problem.

Prerequisites

Install freeimage and boost via your package manager

sudo apt install libfreeimage3 libboost-all-dev # Ubuntu
# or
sudo pacman -S freeimage boost # Manjaro

Install conan

pip install conan

Add the Pylene repository in your conan remotes

conan remote add lrde-public https://artifactory.lrde.epita.fr/artifactory/api/conan/lrde-public

Clone

git clone https://github.com/gaziduc/multiple-polymorphism
cd multiple-polymorphism

Build

mkdir build
cd build
conan install .. --build=missing -s compiler.cppstd=20
cmake ..
make

Launch testsuite

make test

Usage

import pylene as pln

se = pln.se.disc(10)
# se = pln.se.rectangle(width=5, height=5)

# image is a numpy image
out1 = pln.morpho.dilation(image, se) 
out2 = pln.morpho.erosion(image, se)
out3 = pln.morpho.opening(image, se)
out4 = pln.morpho.closing(image, se)

multiple-polymorphism's People

Contributors

gaziduc avatar liolaeus avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.