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
template<typename T> | |
T pow_n(T x, int n){ | |
T a = 1.0; | |
while(n > 0){ | |
if(n % 2 == 0){ | |
x = x*x; | |
n = n>>1; | |
}else{ | |
a = a*x; |
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
#include <sys/time.h> | |
double time_dif(timeval &tv1, timeval &tv2) | |
{ | |
const double dt = tv2.tv_sec - tv1.tv_sec + (tv2.tv_usec - tv1.tv_usec) * 1.0e-6; | |
return dt; | |
} | |
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
set terminal postscript eps enhanced color lw 2 defaultplex "Helvetica" 16 | |
#set terminal postscript eps enhanced color | |
set output "dif.eps" | |
set size 0.65,1.23 | |
set nokey | |
#set key graph 0.7, graph 0.8 | |
set nogrid | |
set format y '%g' | |
set format x '%g' |
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
set terminal postscript eps enhanced color lw 2 defaultplex "Helvetica" 16 | |
#set terminal postscript eps enhanced color solid | |
set output "dif.eps" | |
set size 0.65,0.62 | |
unset key | |
#set key graph 0.7, graph 0.9 | |
unset grid | |
set format y '%g' | |
set format x '%g' |
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
#!/bin/bash | |
flame_rate=10 | |
output_file="out" | |
number_of_digit=3 | |
ffmpeg -r ${flame_rate} -i "time%0"${number_of_digit}"d.jpeg" -qscale 0 ${output_file}".mp4" |
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
#include <iostream> | |
#include <cmath> | |
#include <gsl/gsl_math.h> | |
#include <gsl/gsl_vector.h> | |
#include <gsl/gsl_matrix.h> | |
#include <gsl/gsl_eigen.h> | |
#include <gsl/gsl_sort_vector.h> | |
#define DIM 2 |
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
#include <iostream> | |
#include "Eigen/Core" | |
#include "Eigen/Eigenvalues" | |
int main(void){ | |
using namespace Eigen; | |
Matrix2d A; | |
Vector2d a; | |
A << 1,-0.5,-0.5,1; | |
SelfAdjointEigenSolver<Matrix2d> es(A); |
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
#include <iostream> | |
#include <boost/random.hpp> | |
int main () | |
{ | |
using namespace boost; | |
using namespace std; | |
mt19937 gen(100); |
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
#small sample for GMM | |
#install.packages('mclust') #installing Mclust package | |
library(mclust) | |
dat <- read.table("./result/") | |
dat <- data.matrix(dat) | |
result.dat <- Mclust(dat) | |
plot(result.dat) | |
summary(result.dat,parameters=TRUE) |
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
#!/bin/bash | |
R --vanilla --slave < gmm.R | |
#R --vanilla --slave --args ./infile.txt ./outfile.txt 10000 < gmm.R |
OlderNewer