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/sh | |
sbcl --eval "(ql:quickload '(:swank :cl-mpi))" \ | |
--eval "(defun toplevel () \ | |
(push #'mpi:mpi-finalize *exit-hooks*) \ | |
(mpi:mpi-init) \ | |
(let ((port (+ swank::default-server-port (mpi:mpi-comm-rank)))) \ | |
(swank:create-server :port port :dont-close t)) \ | |
(sb-impl::toplevel-init))" \ | |
--eval "(save-lisp-and-die \"mpisbcl\" :executable t :toplevel #'toplevel)" |
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
.text | |
.align 4,0x90 | |
.globl __Z21matrix_vector_productPKdPd | |
__Z21matrix_vector_productPKdPd: | |
LFB18: | |
vmovsd 8(%rdi), %xmm2 | |
vmovsd (%rdi), %xmm1 | |
vmulsd %xmm2, %xmm2, %xmm3 | |
vmovsd 16(%rdi), %xmm0 | |
vmovsd 32(%rdi), %xmm6 |
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
.text | |
.align 4,0x90 | |
.globl __Z21matrix_vector_productPKdPd | |
__Z21matrix_vector_productPKdPd: | |
LFB18: | |
movsd (%rdi), %xmm0 | |
movsd 8(%rdi), %xmm4 | |
movapd %xmm0, %xmm5 | |
movsd 16(%rdi), %xmm3 | |
mulsd %xmm0, %xmm5 |
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
This file goes in /usr/lib/gnome-flashback/ | |
#! /bin/sh | |
exec gnome-session --session=gnome-flashback-stumpwm --disable-acceleration-check "$@" |
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 <cstdlib> | |
#include <iostream> | |
#include <SuiteSparseQR.hpp> | |
int main(int argc, char* argv[]) { | |
cholmod_common common; | |
cholmod_sparse *A; | |
cholmod_dense *x, *b, *residual; |
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
/* | |
* Example: spy("foobar.ppm", A); | |
*/ | |
int spy(std::string const& ppmfile, arma::mat const& M) { | |
ofstream ofs(ppmfile); | |
if (!ofs.is_open()) | |
return -1; | |
ofs << "P3\n" << M.n_rows << " " << M.n_cols << "\n1\n"; |
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
#ifndef DOUBLE2_H | |
#define DOUBLE2_H | |
#include <cmath> | |
#include <ostream> | |
#include <initializer_list> | |
struct double2 { | |
union { |
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
#define abort_unless(expr) do { \ | |
if (!(expr)) { \ | |
fprintf(stderr, "%s:%u (%s): Assertion `%s' failed.\n", \ | |
__FILE__, __LINE__, __func__, __STRING(expr)); \ | |
fflush(stderr); \ | |
abort(); \ | |
} \ | |
} while (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
#include <cmath> | |
inline unsigned next_power_of_two(unsigned x) { | |
return unsigned(exp2f(ceilf(log2f(float(x))))); | |
} |
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
template <typename T = double> | |
vector<T> linspace(T a, T b, size_t N) { | |
T h = (b - a) / static_cast<T>(N-1); | |
vector<T> xs(N); | |
typename vector<T>::iterator x; | |
T val; | |
for (x = xs.begin(), val = a; x != xs.end(); ++x, val += h) | |
*x = val; | |
return xs; | |
} |