This file contains 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
function ∇tSTE(X::Array{Float64,2}, | |
no_objects::Int64, | |
no_dims::Int64, | |
no_triplets::Int64, | |
triplets::Array{Int64,2}, | |
λ::Float64, | |
α::Float64; | |
use_log = true::Bool)::Tuple{Float64,Array{Float64,2}} | |
P = Array{Float64}(Threads.nthreads()) |
This file contains 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
function ∇tSTE(X::Array{Float64,2}, | |
no_objects::Int64, | |
no_dims::Int64, | |
no_triplets::Int64, | |
triplets::Array{Int64,2}, | |
λ::Float64, | |
α::Float64; | |
use_log = true::Bool) | |
P = 0.0::Float64 |
This file contains 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
#!/bin/bash | |
# Convert PDF to encapsulated PostScript | |
# usage: pdf2eps <filename.pdf> | |
# Obtained from: https://tex.stackexchange.com/a/242265/62493 | |
# Remove .pdf extension from input | |
filename=$(echo $1 | sed 's/.pdf//') | |
# Convert into .eps | |
pdftops $filename.pdf $filename-temp.ps | |
ps2eps $filename-temp.ps |
This file contains 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
// Karel Mundnich | |
// April 12, 2017 | |
var reelib = require('reelib'); | |
var barnacles = require('barnacles'); | |
var barnowl = require('barnowl'); | |
var chickadee = require('chickadee'); | |
var sniffypedia = require('sniffypedia'); | |
var fs = require('fs'); | |
var keypress = require('keypress'); |
This file contains 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
plot(data,'k'); | |
rect = [0 0 1080 270]; % Resize to 4:1 | |
set(gcf, 'OuterPosition', rect); | |
r = 150; % pixels per inch | |
set(gcf, 'PaperPosition', rect/r); | |
plot2svg('Figures/plot.svg'); |
This file contains 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 os | |
import subprocess | |
for filename in os.listdir('.'): | |
if filename[-3:] == 'svg': | |
subprocess.call(["inkscape", | |
"-f", | |
filename, | |
"--verb", | |
"EditSelectAll", |
This file contains 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
function [ arg_min, minimum ] = argmin( A, dim ) | |
%ARGMIN Find the argmin of a vector, matrix or datacube. | |
% A is the vector, matrix or data cube for which we want to find the | |
% minimum and the argument of the minimum. | |
% dim is the dimension of the data structure. | |
%% Error check for arguments | |
if dim > 3; error('Dimension must be 1 =< dim =< 3'); end | |
if dim < 1; error('Dimension must be 1 =< dim =< 3'); end | |
if isnan(A); error('A must be real'); end |
NewerOlder