EVSL  1.1.0
EigenValues Slicing Library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
spslice2.c
Go to the documentation of this file.
1 #include <math.h>
2 #include <stdio.h>
3 #include <stdlib.h>
4 #include "blaslapack.h"
5 #include "def.h"
6 #include "internal_proto.h"
7 #include "string.h" //for memset
8 #include "struct.h"
9 
29 void spslicer2(double* xi, double* yi, int n_int, int npts, double* sli) {
30  /*-------------------- makes a call here to integration by Simpson */
31  double want;
32  int k = 0;
33  double t;
34  int ls = 0;
35 
36  //-------------------- in-place integration ydos<--- int ydos..
37  simpson(xi, yi, npts);
38  //
39  t = yi[0];
40  want = (yi[npts - 1] - yi[0]) / (double)n_int;
41  sli[ls] = xi[k];
42  //-------------------- First point - t should be zero actually
43  for (k = 1; k < npts; k++) {
44  if (yi[k] - t >= want) {
45  //-------------------- New interval defined
46  ls = ls + 1;
47  sli[ls] = xi[k];
48  t = yi[k];
49  }
50  }
51  //-------------------- bound for last interval is last point.
52  sli[n_int] = xi[npts - 1];
53 }
defs in EVSL
void spslicer2(double *xi, double *yi, int n_int, int npts, double *sli)
Definition: spslice2.c:29
This file contains function prototypes and constant definitions internally used in EVSL...
structs used in evsl
Defs for blaslapack routines.
void simpson(double *xi, double *yi, int npts)
Definition: simpson.c:27