Skip to content

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

Notifications You must be signed in to change notification settings

kashu21/CythonBasics

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 61.4%
  • Python 38.0%
  • Makefile 0.6%