deebot / CythonBasics

This repository contains the codes written while exploring cython for the course Simulation and Modelling.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CythonBasics

This repository contains the codes written while exploring cython for the course Simulation and Modelling.

Primes_Speedtest

This folder contains code to calculate no of primes.

To create shared object library. Compile using following command

python setup.py build_ext --inplace

After you have the .so file.To test the speed run the code timing_test.py using command below

python timing_test.py

WrapperC

This folder contains an example to create a wrapper for C code.

🔨 Build using following command

make

💡 TO test the wrapper.In terminal run

ipython3

Then import the module

import mt_random as mt

Run the command to give initial seed. Here we pass 1000

mt.init_state(1000)

Generate random number

mt.rand_int32()

clean using

make clean

About

This repository contains the codes written while exploring cython for the course Simulation and Modelling.


Languages

Language:C 61.3%Language:Python 38.0%Language:Makefile 0.6%