2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 * Copyright (C) 2011 - Scilab Enterprises - Adeline CARNIS
5 * This file must be used under the terms of the CeCILL.
6 * This source file is licensed as described in the file COPYING, which
7 * you should have received as part of this distribution. The terms
8 * are also available at
9 * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
13 #include "eigs_dependencies.h"
15 extern int C2F(dgemv) (char* trans, int* m, int* n, double* alpha, double* A,
16 int* lda, double* x, int* incx, double* beta, double* y, int* incy);
17 extern double C2F(ddot) (int *n, double* x, int* incx, double* y, int* incy);
19 void process_dneupd_data(double* DR, double* DI, double* Z, int N, int nev, double* AR,
20 doublecomplex* eigenvalue, doublecomplex* eigenvector,
23 /* if sigma_imaginary there is an extra step to compute the eigenvalues
24 as explained in the dneupd user guide */
38 if ( sigma_imaginary )
40 temp1 = (double*) malloc(N * sizeof(double));
41 temp2 = (double*) malloc(N * sizeof(double));
47 C2F(dgemv) ("n", &N, &N, &alpha, AR, &N, Z + N * i, &iOne, &beta, temp1, &iOne);
48 eigenvalue[i] = (doublecomplex)
50 C2F(ddot) (&N, Z + N * i, &iOne, temp1, &iOne), 0
56 C2F(dgemv) ("n", &N, &N, &alpha, AR, &N, Z + N * i, &iOne, &beta, temp1, &iOne);
57 C2F(dgemv) ("n", &N, &N, &alpha, AR, &N, Z + N * (i + 1), &iOne, &beta, temp2, &iOne);
58 real_part = C2F(ddot) (&N, Z + N * i, &iOne, temp1, &iOne) + \
59 C2F(ddot) (&N, Z + N * (i + 1), &iOne, temp2, &iOne);
60 imag_part = C2F(ddot) (&N, Z + N * i, &iOne, temp2, &iOne) - \
61 C2F(ddot) (&N, Z + N * (i + 1), &iOne, temp1, &iOne);
62 eigenvalue[i] = (doublecomplex)
66 eigenvalue[i + 1] = (doublecomplex)
78 for (i = 0; i < nev + 1; i++)
80 eigenvalue[i] = (doublecomplex)
95 for (j = 0; j < N; j++)
97 eigenvector[i * N + j] = (doublecomplex)
99 Z[i * N + j], Z[(i + 1) * N + j]
101 eigenvector[(i + 1) * N + j] = (doublecomplex)
103 Z[i * N + j], -Z[(i + 1) * N + j]
110 for (j = 0; j < N; j++)
112 eigenvector[i * N + j] = (doublecomplex)