Giter VIP home page Giter VIP logo

cython_wrapping's Introduction

Cython Wrapping

A collection of examples to wrap C++-Code using Cython to be able to use it within Python.

Prerequisites

  1. Create a virtual Python environment (e.g. using conda)
    conda create -n wrapper Python=3.7

  2. Inside the created environment install the required packages
    conda activate wrapper
    conda install -c anaconda pip
    pip install -r requirements.txt

  3. Go to one of the subdirectories (e.g. 01_simple_c_wrapper) and follow the steps there (stay in the wrapper virtual environment).

The code has been tested on MacOS (10.9) and Linux (Ubuntu 18.04 LTS).

01 Simple C Wrapper

Wrapping a function in C that takes a string and prints that string on the console.

References:

02 Simple C++ Wrapper

Wrapping a function in C++ that takes a string and prints that string on the console.

References:

03 C++ Array Wrapper

Wrapping a function in C++ that takes an array and a number and multiplies that number to each element of the array.

References:

04 C++ Class Wrapper

Wrapping a class in C++ that encapsulates an array and provides various functions to handle that array (sum of its elements, getting array length, getting array itself, multiplying each element by a constant).

References:

05 C++ MultiClass Wrapper

Wrapping multiple class in C++. Again, we have one class that encapsulates an array. Furthermore, we have another class that takes a constant as input and offers a function which takes a vector class and multiplies each element of the vector class by the constant.

References:

06 C++ Dependency Wrapper

Wrapping a class in C++ that encapsulates an array and provides various functions to handle that array (sum of its elements, getting array length, getting array itself, multiplying the array with another array). Internally the C++ class uses OpenCV as external library.

References:

07 Wrapper Package

Creating a package called pymath containing a regular Python class and a Cython class that wraps a C++ class. The package can be installed using pip.

References:

cython_wrapping's People

Contributors

bam098 avatar dependabot[bot] avatar

Stargazers

akatski avatar  avatar Ritobrata Ghosh avatar

Watchers

 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.