View jaro.cpp
#include <cstring>
#include <cstdlib>
#include <R.h>
#include <Rdefines.h>
double jaro(const char* a, const char* b, double range = 0.5, double match_weight = 1.0,
double trans_weight = 1.0) {
unsigned int la = strlen(a);
unsigned int lb = strlen(b);
// create a buffers; these store for each character in a and b which have
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu-14.04"
config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box"
View one_to_one.R
library(lpSolve)
pairs_select <- function(x, y, w, n = 1, m = 1) {
d <- data.frame(x=as.numeric(as.factor(x)), y=as.numeric(as.factor(y)), w=w)
nx <- length(unique(d$x))
ny <- length(unique(d$y))
C <- cbind(c(d$x, d$y + nx), seq_len(nrow(d)))
C <- cbind(C, 1)
res <- lp("max", d$w, dense.const = C, const.dir = rep("<=", nx+ny),
const.rhs = c(rep(n, nx), rep(m, ny)), all.bin=TRUE, use.rw=TRUE)
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<script src="http://d3js.org/d3.v3.min.js"></script>
</head>
<body>
<div id="vis">
</div>
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<script src="http://d3js.org/d3.v3.min.js"></script>
<style>
.orbit {
stroke : #000000;