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
#include <iostream> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <sys/time.h> | |
//---------------------------------------------------------------------- | |
const int N = 20000; | |
const double L = 10.0; | |
const int D = 3; | |
const int X = 0; |
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
# put "source .zshrc.git" on your .zshrc | |
autoload -U colors; colors | |
function rprompt-git { | |
local name st color | |
name=`git symbolic-ref HEAD 2> /dev/null | sed -e "s/refs\/heads\///g"` | |
if [[ -z $name ]]; then | |
return | |
fi |
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
//---------------------------------------------------------------------- | |
#include <stdio.h> | |
#include <emmintrin.h> | |
#include <immintrin.h> | |
//---------------------------------------------------------------------- | |
void | |
printm256(__m256d r){ | |
double *a = (double*)(&r); | |
printf("%f %f %f %f\n",a[0],a[1],a[2],a[3]); | |
} |
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
# Constructing a maze with a clustering algorithm | |
# (C) Copyright H. Watanabe 2015 | |
# Distributed under the Boost Software License, Version 1.0. | |
# (See copy at http://www.boost.org/LICENSE_1_0.txt) | |
class Maze | |
def initialize(s) | |
@lx = s | |
@ly = @lx*297/210 | |
@bond_h = Array.new((@lx+1)*@ly) { false} | |
@bond_v = Array.new(@lx*(@ly+1)) { false} |
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
#include <iostream> | |
#include <algorithm> | |
#include <vector> | |
#include <stdlib.h> | |
//---------------------------------------------------------------------- | |
int | |
myrand(const int max) { | |
double r = static_cast<double>(rand()) / (static_cast<double>(RAND_MAX) + 1.0); | |
return static_cast<int>(r * max); | |
}; |
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
#include <iostream> | |
#include <algorithm> | |
#include <stdlib.h> | |
//---------------------------------------------------------------------- | |
bool called_srand = false; | |
//---------------------------------------------------------------------- | |
int | |
myrand(const int max) { | |
if(called_srand){ | |
called_srand = false; |
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
$ icpc --version | |
icpc (ICC) 12.1.4 20120410 | |
Copyright (C) 1985-2012 Intel Corporation. All rights reserved. | |
$ g++ --version | |
g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-11) |
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
#include <iostream> | |
#include <stdio.h> | |
#include <math.h> | |
#include <stdlib.h> | |
//---------------------------------------------------------------------- | |
const int N = 10000; | |
const int SAMPLE = 65536; | |
//---------------------------------------------------------------------- | |
double | |
myrand(void){ |
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
#include <iostream> | |
#include <stdio.h> | |
#include <math.h> | |
#include <stdlib.h> | |
//---------------------------------------------------------------------- | |
const int N = 10000; | |
const int SAMPLE = 65535; | |
//---------------------------------------------------------------------- | |
double | |
myrand(void){ |
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
#include <iostream> | |
#include <stdio.h> | |
#include <math.h> | |
#include <stdlib.h> | |
#include <curand.h> | |
//---------------------------------------------------------------------- | |
const int N = 10000; | |
const int SAMPLE = 65536; | |
//---------------------------------------------------------------------- | |
double |