Skip to content

Commit be545c1

Browse files
committed
up
1 parent 12d59f0 commit be545c1

6 files changed

Lines changed: 695 additions & 6 deletions

File tree

k+/deps

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#e.g. on linux(debian..): $sudo sh deps lin
2+
#windows requires msys2/mingw64: $sh deps win
3+
4+
5+
#linux(debian):
6+
#if [ "$1" = "lin" ]; then apt install \
7+
# openblas?
8+
# lapack?
9+
# liblpsolve?
10+
# libcurl?
11+
# umfpack?
12+
# arpack?
13+
# fftw?
14+
# sqlite?
15+
# r-mathlib
16+
# resvg?
17+
#fi
18+
19+
20+
#windows(mingw-w64):
21+
if [ "$1" = "win" ]; then pacman -S \
22+
mingw-w64-x86_64-openblas \
23+
mingw-w64-x86_64-lapack \
24+
mingw-w64-x86_64-lpsolve \
25+
mingw-w64-x86_64-curl \
26+
mingw-w64-x86_64-suitesparse \
27+
mingw-w64-x86_64-arpack \
28+
mingw-w64-x86_64-fftw \
29+
mingw-w64-x86_64-sqlite3 \
30+
fi
31+
# r-mathlib?
32+
# resvg?

k+/fftw.c

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
#include"fftw3.h"
3+
#include<stdint.h>
4+
5+
#define N 32768
6+
7+
8+
int32_t rand_=1592653589;
9+
double rnd(){ //uniform double, same version as k.
10+
int32_t r = rand_;
11+
r^=(r<<13);r^=(r>>17);r^=(r<<5);rand_ = r;
12+
return 0.5+((double)r)/4294967295.0;
13+
}
14+
15+
16+
void P(double *x){printf("%lf %lf %lf %lf..\n",x[0],x[1],x[2],x[3]);}
17+
void R(double *x){for(int i=0;i<2*N;i++)x[i]=rnd();}
18+
19+
20+
int main(int args, char **argv){
21+
fftw_complex *x;
22+
fftw_plan p;
23+
24+
25+
x=(fftw_complex*)fftw_malloc(sizeof(fftw_complex)*N);
26+
p=fftw_plan_dft_1d(N,x,x,FFTW_FORWARD,FFTW_ESTIMATE);
27+
28+
for(int i=0;i<1000;i++){
29+
R((double*)x);
30+
fftw_execute(p);
31+
}
32+
P((double*)x);
33+
return 0;
34+
}
35+
36+
*/

0 commit comments

Comments
 (0)