Skip to content

Instantly share code, notes, and snippets.

View Terminus-IMRC's full-sized avatar
💭
Doing nothing helpful

Yukimasa Sugizaki Terminus-IMRC

💭
Doing nothing helpful
View GitHub Profile
@Terminus-IMRC
Terminus-IMRC / !README.md
Last active December 24, 2023 07:27
deviceQuery results
@Terminus-IMRC
Terminus-IMRC / bench-random.cpp
Created June 26, 2022 10:27
A benchmark program for C++ random number generators
#include <bit>
#include <random>
#include <benchmark/benchmark.h>
template <class Generator> static void BM_random(benchmark::State &state) {
Generator gen;
for (auto _ : state)
benchmark::DoNotOptimize(gen());
We couldn’t find that file to show.
@Terminus-IMRC
Terminus-IMRC / chargen.txt
Created November 16, 2020 17:06
The chargen service in one line: xargs -0 -a chargen.txt yes
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefg
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefgh
"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghi
#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghij
$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijk
%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijkl
&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklm
'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmn
()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmno
)*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnop

docker-texlive-templates

English/Japanese TeX Live examples in a Docker container.

$ docker-compose build
$ make test-english.pdf
$ make test-japanese.pdf
$ make clean
@Terminus-IMRC
Terminus-IMRC / README.md
Last active December 13, 2020 11:01
Raspberry Pi informations
@Terminus-IMRC
Terminus-IMRC / log.txt
Last active September 24, 2019 09:34
Rump's example with MPFI
$ c++ rump.cpp -lmpfi -lmpfr -lgmp
$ for prec in 1 10 20 30 31 32 33 34 35 36 37 38 39 40; do ./a.out $prec; done
prec = 1: {-5.48801451098564180059512748897e+36,8.80613556589959273415384575891e+36}
prec = 10: {-719561148094296450146500608,1425281040027303069683286016}
prec = 20: {-108086391056891902.82763671875,144115188075855873.1728515625}
prec = 30: {-4194302.82739605994683529388567,4194305.17260394005319312782376}
prec = 31: {-524286.827396059946822859387794,524289.172603940053178916969046}
prec = 32: {-32766.8273960599468214160978619,1.17260394005317863186453174879}
prec = 33: {-4094.82739605994682137446449843,1.17260394005317863186453174879}
prec = 34: {-510.827396059946821369260328005,1.17260394005317863186453174879}
@Terminus-IMRC
Terminus-IMRC / cannon.py
Last active July 1, 2019 10:15
Matrix-matrix multiplication: Cannon's algorithm
#!/usr/bin/env python3
import numpy as np
# Assume that P = N * N.
N = 4
A = np.arange(0, 2 * N * N, 2).reshape(N, N)
B = np.arange(1, 2 * N * N, 2).reshape(N, N)
C_gt = A.dot(B)
@Terminus-IMRC
Terminus-IMRC / comb.cpp
Last active June 7, 2019 04:18
Parallel computation of multiple-precision binomal coefficients C(a,b)
#include <iostream>
#include <gmp.h>
#include <gmpxx.h>
#include <omp.h>
int main(int argc, char *argv[])
{
if (argc != 1 + 2) {
std::cerr << "Specify a and b for comb(a, b)\n";
return 1;
@Terminus-IMRC
Terminus-IMRC / 00RESULT.md
Last active April 24, 2019 12:46
Isomorphism of MSQ

n = 3

$ time ./isomorph_msq.py
(0, 1, 2, 3, 4, 5, 6, 7, 8)
(0, 3, 6, 1, 4, 7, 2, 5, 8)
(2, 1, 0, 5, 4, 3, 8, 7, 6)
(2, 5, 8, 1, 4, 7, 0, 3, 6)
(6, 3, 0, 7, 4, 1, 8, 5, 2)
(6, 7, 8, 3, 4, 5, 0, 1, 2)