Skip to content

Latest commit

 

History

History
43 lines (22 loc) · 855 Bytes

README.md

File metadata and controls

43 lines (22 loc) · 855 Bytes

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