Skip to content

Instantly share code, notes, and snippets.

cmake_minimum_required(VERSION 2.8)
project( mmpde6_harmonic Fortran )
find_program(ifort "ifort")
# message(${ifort})
set(CMAKE_Fortran_COMPILER ${ifort})
# message(${comp})
@pwl
pwl / binary128.c
Created March 2, 2012 10:26
memory alignment of binary128
#include <stdio.h>
#include <stdint.h>
#include <endian.h>
typedef union
{
__float128 val;
struct
{
(setq require-final-newline t)
(add-hook 'before-save-hook 'delete-trailing-whitespace)
program test_function_registry
use class_func_registry
use flu_module
use class_platonic
use platonic_from_lua_module
use flu_get_module
use class_function
use class_boundary
use boundary_box_module
use class_boundary_dirichlet
@pwl
pwl / PKGBUILD
Created May 26, 2012 12:35
PKGBUILD for camlimages
pkgname=camlimages
pkgver=4.0.1
pkgrel=1
pkgdesc="Objective Caml image processing library"
arch=(i686 x86_64)
url="http://gallium.inria.fr/camlimages"
license=('GPL2')
depends=('libpng' 'libtiff' 'libxpm' 'libungif' 'freetype2' 'libjpeg')
makedepends=('ocaml' 'omake')
md5sums=('e2e1c7360f6a13fa1c5bbc51e7d05444')
@pwl
pwl / Makefile
Created August 13, 2012 13:09
Lua script embedding in fortran
default: script_embed
./script_embed
script_embed: script_embed.f90 script_data.o
gfortran -o $@ $^
script_data.o: script_data.s script.lua
gcc -c -o $@ $<
@pwl
pwl / Makefile
Created August 13, 2012 13:23
Lua script embedding in fortran
default: script_embed
./script_embed
script_embed: script_embed.f90 script_data.o
$(FC) -o $@ $^
script_data.o: script_data.s script.lua
gcc -c -o $@ $<
clean:
@pwl
pwl / gist:5353171
Last active December 16, 2015 01:09
Zbieżność pochodnej z funkcji analitycznej i nieanalitycznej w przedostatnim punkcie siatki. Punkty oznaczają błąd bezwzględny (niebieski) i względny (fioletowy).
$MaxExtraPrecision = 1000;
der[f_, k_, rk_, h_] :=
NDSolve`FiniteDifferenceDerivative[Derivative[k], h Range[0, 100],
f /@ (h Range[0, 100]), DifferenceOrder -> rk];
abserr[f_, k_, rk_] :=
Abs[der[f, k, rk, #][[2]] -
Derivative[k][f][#]] & /@ (2^-Range[1, 30]);
relerr[f_, k_, rk_] :=
abserr[f, k, rk]/Abs@(Derivative[k][f] /@ (2^-Range[1, 30]));
graph[{f1_, f2_}, k_, rk_] :=

Problem:

F(t,y,dy)=dy+y

Scalar equation

  • Noniterative
@pwl
pwl / probabilistic_pca.ipynb
Created March 3, 2017 12:07
Probabilistic PCA with ARD
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.