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
subroutine f(mu, Sigma, H, INFO, R, Sigmavar_2, data, muvar_2, k, n) | |
implicit none | |
integer, intent(in) :: k | |
integer, intent(in) :: n | |
real*8, intent(in) :: Sigma(n, n) ! Sigma | |
real*8, intent(in) :: H(k, n) ! H | |
real*8, intent(in) :: mu(n) ! mu | |
real*8, intent(in) :: R(k, k) ! R, H*Sigma*H' + R | |
real*8, intent(in) :: data(k) ! (H*Sigma*H' + R)^-1*((-1)*data + H*mu), data, (-1)* data + H*mu |
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
! # Check out the link below for specific compile instructions for your system: | |
! # https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor/ | |
! | |
! To compile use: | |
! LINK="${MKLROOT}/lib/intel64/libmkl_lapack95_lp64.a -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_lp64.a ${MKLROOT}/lib/intel64/libmkl_sequential.a ${MKLROOT}/lib/intel64/libmkl_core.a -Wl,--end-group -lpthread -lm -ldl" | |
! INC="-I${MKLROOT}/include/intel64/lp64/ -I${MKLROOT}/include/" | |
! ifort -warn all -o example3 $INC example3.f90 $LINK | |
module m_least_squares |
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
! LINK="${MKLROOT}/lib/intel64/libmkl_lapack95_lp64.a -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_lp64.a ${MKLROOT}/lib/intel64/libmkl_sequential.a ${MKLROOT}/lib/intel64/libmkl_core.a -Wl,--end-group -lpthread -lm -ldl" | |
! INC="-I${MKLROOT}/include/intel64/lp64/ -I${MKLROOT}/include/" | |
! ifort -warn all -o test_gttrf $INC test_gttrf.f90 $LINK | |
! ./test_gttrf > test_gttrf.out | |
! gnuplot | |
! gnuplot> Th = 1 | |
! gnuplot> plot "test_gttrf.out" u 1:2 w p pt 7, cosh((1-x)*Th)/cosh(Th) | |
module rd_setup |
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
! See link below for details: | |
! https://scicomp.stackexchange.com/questions/6854/mehrstellenverfahren-for-poisson | |
! | |
program poisson_higher_order | |
implicit none | |
integer, parameter :: wp = kind(1.0d0) | |
real(wp), parameter :: pi = 4._wp*atan(0._wp) |
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
import numpy as np | |
import matplotlib.pyplot as plt | |
from scipy.integrate import solve_ivp | |
# LMTD case | |
def f(t,y,params): | |
p2, p3, Tin = params |
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
def biperiodic_weight_matrix(bbox,x, p, n, diffs, | |
coeffs=None, | |
phi=phs3, | |
order=None, | |
eps=1.0, | |
stencils=None): | |
''' | |
Returns a weight matrix which maps a functions values at `p` to an | |
approximation of that functions derivative at `x`. This is a convenience | |
function which first creates stencils and then computes the RBF-FD weights |
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
subroutine C_F_STRPOINTER (STRARRAY, FSTRPTR, MAXLEN) | |
use, intrinsic :: ISO_C_BINDING | |
implicit none | |
character, dimension(*), target, intent(in) :: STRARRAY | |
character(:), pointer, intent(out) :: FSTRPTR | |
integer, intent(in), optional :: MAXLEN | |
integer :: curlen | |
curlen = 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
import math | |
from fractions import Fraction | |
def continued_fraction(r,steps=10): | |
cf = [] | |
for step in range(steps): | |
i = math.floor(r) | |
cf.append(i) |
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
module cbrt_mod1 | |
implicit none | |
private | |
public :: cbrt, sp, r | |
interface cbrt | |
module procedure cbrt_sp_sp | |
module procedure cbrt_csp_csp |
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
module cbrt_mod2 | |
implicit none | |
private | |
public :: cbrt, sp | |
interface cbrt | |
module procedure cbrt_sp_sp | |
module procedure cbrt_sp_csp |
OlderNewer