Skip to content

Instantly share code, notes, and snippets.

View mitmul's full-sized avatar

Shunta Saito mitmul

View GitHub Profile
@mitmul
mitmul / pcl.rb
Created November 27, 2012 07:29
PCL(trunk, 1.7.0)
require 'formula'
# Documentation: https://github.com/mxcl/homebrew/wiki/Formula-Cookbook
# PLEASE REMOVE ALL GENERATED COMMENTS BEFORE SUBMITTING YOUR PULL REQUEST!
class Pcl < Formula
homepage 'http://pointclouds.org'
head 'http://svn.pointclouds.org/pcl/trunk/'
depends_on 'cmake' => :build
TEMPLATE = app
CONFIG += console
CONFIG -= qt
CONFIG -= x86_64
CONFIG += x86
QMAKE_CXXFLAGS_WARN_ON += "-Wno-unused-parameter"
unix:*-g++*: QMAKE_CXXFLAGS += -fpermissive
SOURCES += main.cpp \
testapp.cpp \
@mitmul
mitmul / to_csv.rb
Last active December 11, 2015 23:38
# encoding: utf-8
src = "jawiki-latest-all-titles-in-ns0"
dst = "wikipedia.csv"
File.open(dst, "w") do |fp|
File.open(src).each do |line|
line.chomp!
# いらない単語を飛ばす
require "gnuplot"
def draw_chart(x, y)
Gnuplot.open do |gp|
Gnuplot::Plot.new(gp) do |plot|
y.each do |name, value|
if x.size == value[0].size
plot.data << Gnuplot::DataSet.new([x, value[0]]) do |ds|
ds.with = value[1]
ds.title = name
require "gnuplot"
require "narray"
def draw_chart(x, y)
Gnuplot.open do |gp|
Gnuplot::Plot.new(gp) do |plot|
y.each do |name, value|
if x.size == value.size
plot.data << Gnuplot::DataSet.new([x, value]) do |ds|
ds.with = "lines"
require "gnuplot"
require "narray"
def draw_chart(x, y)
Gnuplot.open do |gp|
Gnuplot::Plot.new(gp) do |plot|
y.each do |name, value|
if x.size == value.size
plot.data << Gnuplot::DataSet.new([x, value]) do |ds|
ds.with = "lines"
# encoding: utf-8
require "narray"
class DownhillSimplex
def initialize(objective_function, simplex_num, min, max, dimension)
@obj_func = objective_function
@alpha = 1.0
@beta = 0.5
@gamma = 2.0
@dim = dimension
require 'formula'
# Documentation: https://github.com/mxcl/homebrew/wiki/Formula-Cookbook
# PLEASE REMOVE ALL GENERATED COMMENTS BEFORE SUBMITTING YOUR PULL REQUEST!
class SharkSvn < Formula
homepage 'http://image.diku.dk/shark/sphinx_pages/build/html/index.html'
url 'svn://svn.code.sf.net/p/shark-project/code/trunk/Shark'
sha1 ''
version "3.0"
@mitmul
mitmul / levmar.cpp
Last active December 16, 2015 05:08
#include "levmar.h"
Levmar::Levmar()
: param_num(0),
func_num(0),
iter_limit(0),
covar(NULL)
{
// 最適化パラメータ初期化
optimize_param[0] = LM_INIT_MU;
strfitnessfct = 'frastrigin10';
N = 10;
xmean = rand(N,1);
init_xmean = xmean;
sigma = 0.5;
stopfitness = 1e-10;
stopeval = 1e3*N^2;
lambda = 4+floor(300*log(N));
mu = lambda/2;