Debian Codegraph @

packages/seacas/libraries/chaco/eigen/cksturmcnt.c

raw
1 /*
2 * Copyright(C) 1999-2020 National Technology & Engineering Solutions
3 * of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
4 * NTESS, the U.S. Government retains certain rights in this software.
5 *
6 * See packages/seacas/LICENSE for details
7 */
8
9 /* Check sturmcnt */
10 void cksturmcnt(double *vec, int beg, int end, double x1, double x2, int *x1ck, int *x2ck,
11 int *numck)
12 {
13
14 int i, count;
15
16 count = 0;
17 for (i = beg; i <= end; i++) {
18 if (vec[i] > x1) {
19 count += 1;
20 }
21 }
22 *x1ck = end - count;
23
24 count = 0;
25 for (i = beg; i <= end; i++) {
26 if (vec[i] > x2) {
27 count += 1;
28 }
29 }
30 *x2ck = end - count;
31
32 count = 0;
33 for (i = beg; i <= end; i++) {
34 if (vec[i] > x1 && vec[i] < x2) {
35 count += 1;
36 }
37 }
38 *numck = count;
39 }