Skip to content

Instantly share code, notes, and snippets.

@sonesuke
sonesuke / f2c_install.sh
Created October 9, 2017 00:34
install f2c on OSX
#http://qiita.com/yukiB/items/5ac2e9ccbfa5634d405c
setenv INSTALL /usr/local
curl "http://netlib.sandia.gov/cgi-bin/netlib/netlibfiles.tar?filename=netlib/f2c" -o "f2c.tar"
tar -xvf f2c.tar
gunzip -rf f2c/*
cd f2c
mkdir libf2c
mv libf2c.zip libf2c
cd libf2c
@sonesuke
sonesuke / gmres.c
Created October 9, 2017 12:49
gmres
#include <cblas.h>
#include <math.h>
#include <memory.h>
typedef enum {GMRES_SUCCESS, GMRES_NOT_CONVERGENCE} GMRES_RESULT;
typedef void (*axfunc)(double*, double*);
/* Compute the Givens rotation matrix parameters for a and b. */
@sonesuke
sonesuke / gmres.c
Created October 10, 2017 14:54
fdgmres
#include <cblas.h>
#include <math.h>
#include <memory.h>
#include <stdio.h>
typedef enum {GMRES_SUCCESS, GMRES_NOT_CONVERGENCE} GMRES_RESULT;
typedef void (*axfunc)(double*, double*);
@sonesuke
sonesuke / sample.py
Created October 28, 2017 12:05
falcon upload
import falcon
from falcon_multipart.middleware import MultipartMiddleware
# http --from localhost:8888 [email protected]
class SampleResource:
def on_post(self, req, resp, **kwargs):
f = req.get_param('file')
raw = f.file.read()
with open('file.txt', 'wb') as f: