This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- encoding: utf-8 -*- | |
from functools import reduce | |
from math import sqrt | |
from random import random | |
class MyRandomizer: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
toroidal <- function(points, values) { | |
d <- ncol(points) | |
shifts <- sapply( | |
1:d, | |
function(x) { max(points[, x]) - min(points[, x]) } | |
) | |
directions <- c(0, 1, -1) | |
all_shifts <- expand.grid( | |
lapply( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Dependencies: LAPACK | |
Ubuntu: sudo apt-get install liblapack3 liblapack-dev | |
Compile: g++ -o barycentric barycentric.cpp -O3 -Wall -Wextra -pedantic -std=gnu++11 -llapack | |
*/ | |
#include <iostream> | |
#include <cassert> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import itertools | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from scipy.spatial import Delaunay | |
points = np.array([ | |
[0, 0], | |
[0, 2], | |
[2, 0], | |
[0.5, 0.5] |
NewerOlder