diff options
author | Alberto Ruiz <aruiz@um.es> | 2014-05-08 08:48:12 +0200 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2014-05-08 08:48:12 +0200 |
commit | 1925c123d7d8184a1d2ddc0a413e0fd2776e1083 (patch) | |
tree | fad79f909d9c3be53d68e6ebd67202650536d387 /examples/devel/ej2/functions.c | |
parent | eb3f702d065a4a967bb754977233e6eec408fd1f (diff) |
empty hmatrix-base
Diffstat (limited to 'examples/devel/ej2/functions.c')
-rw-r--r-- | examples/devel/ej2/functions.c | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/examples/devel/ej2/functions.c b/examples/devel/ej2/functions.c deleted file mode 100644 index 4dcd377..0000000 --- a/examples/devel/ej2/functions.c +++ /dev/null | |||
@@ -1,24 +0,0 @@ | |||
1 | /* general element order */ | ||
2 | |||
3 | typedef struct { double r, i; } doublecomplex; | ||
4 | |||
5 | #define DVEC(A) int A##n, double*A##p | ||
6 | #define CVEC(A) int A##n, doublecomplex*A##p | ||
7 | #define DMAT(A) int A##r, int A##c, double*A##p | ||
8 | #define CMAT(A) int A##r, int A##c, doublecomplex*A##p | ||
9 | |||
10 | #define AT(M,r,c) (M##p[(r)*sr+(c)*sc]) | ||
11 | |||
12 | int c_diag(int ro, DMAT(m),DVEC(y),DMAT(z)) { | ||
13 | int i,j,sr,sc; | ||
14 | if (ro==1) { sr = mc; sc = 1;} else { sr = 1; sc = mr;} | ||
15 | for (j=0; j<yn; j++) { | ||
16 | yp[j] = AT(m,j,j); | ||
17 | } | ||
18 | for (i=0; i<mr; i++) { | ||
19 | for (j=0; j<mc; j++) { | ||
20 | AT(z,i,j) = i==j?yp[i]:0; | ||
21 | } | ||
22 | } | ||
23 | return 0; | ||
24 | } | ||