aboutsummaryrefslogtreecommitdiffstats
path: root/python/GHquad.c
diff options
context:
space:
mode:
Diffstat (limited to 'python/GHquad.c')
-rw-r--r--python/GHquad.c33
1 files changed, 0 insertions, 33 deletions
diff --git a/python/GHquad.c b/python/GHquad.c
deleted file mode 100644
index 8dafb2b1..00000000
--- a/python/GHquad.c
+++ /dev/null
@@ -1,33 +0,0 @@
-#include "stdlib.h"
-#include "math.h"
-#include "GHquad.h"
-
-extern int dstev_(char* JOBZ, int* n, double* D, double* E, double* Z, int* ldz, double* WORK, int* INFO);
-
-void GHquad(int n, double* Z, double* w) {
- // Setup for eigenvalue computations
- char JOBZ = 'V'; // Compute eigenvalues & vectors
- int INFO;
- int i;
- // Initialize array for workspace
- double * WORK = malloc(sizeof(double)*(2*n-2));
-
- // Initialize array for eigenvectors
- double * V = malloc(sizeof(double)*n*n);
-
- for(i = 0; i<n-1; i++){
- w[i] = sqrt((i+1.)/2);
- }
-
- // Run eigen decomposition
- dstev_(&JOBZ, &n, Z, w, V, &n, WORK, &INFO);
-
- for (i=0; i<n; i++) {
- w[i] = V[i*n] * V[i*n];
- Z[i] *= sqrt(2);
- }
-
- // Deallocate temporary arrays
- free(WORK);
- free(V);
-}