Miscellanea

Matrix multiplication

The other day I started wondering how the highly optimised routines of numpy would compare against a multithreaded matrix multiplication in C++ and, so, I decided to make my own comparison between apples and oranges. That is, compare different tools in different languages for performing said multiplications. Therefore, what follows is not a comparison between languages. […]

Motion planning

This page contains the code for the paper “Motion planning algorithms for the Dubins Travelling Salesperson Problem” Synopsis A randomised algorithm that finds quickly feasible solutions to large instances of the Dubins Travelling Salesperson problem. Requirements Languages: C++ and Matlab Necessary infrastructure: • a C++ compiler that supports the C++11 dialect • the library ‘random’ […]

SAS and SQL cheat sheet

SAS Basic data manipulation Creating new variables in datasets Suppose we want to create a copy, called SPXTSX_numbered, of an existing dataset FinData.SPXTSX (the name of the dataset shows that it is a permanent dataset stored in the folder/library FinData; if we used a non-permanent dataset, the name would be SPXTSX), and in the new […]

The Beauty and the Beast

A Python, Cython, and C++ cheatsheet Python Simple and reliable timing within a script Use in a loop to calculate the average or median of elapsed times: from timeit import default_timer t0 = default_timer() # Code to be timed cy_elapsed = default_timer() – t0 Basic plotting import numpy as np import matplotlib.pyplot as plt # […]

Advertisements