Go to the documentation of this file.
32 #define FREE_ARG char*
34 void fuzzy_func_v3(
float *rrs,
float **urrs,
float ***y3inv,
int nclasses,
int nowts,
int df,
double *outdata)
38 float *sa, *
ax, *
b, *
y, *alphachi, **yinv, gamm,
x, gln, chiz, z2;
39 unsigned long msize, *ija;
41 nmax = 2 * df * df + 1;
48 yinv =
matrix(1, df, 1, df);
50 alphachi =
vector(1, nclasses);
54 printf(
"\ninside fuzzy_func...");
55 printf(
"\nnclasses = %d", nclasses);
56 printf(
"\ndf = %d", df);
59 for (
i = 1;
i < nclasses + 1;
i++) {
60 for (
j = 1;
j < df + 1;
j++) {
61 y[
j] = rrs[
j - 1] - urrs[
j][
i];
63 for (
k = 1;
k < df + 1;
k++) {
64 yinv[
j][
k] = y3inv[
i][
j][
k];
69 sprsin(yinv, df, 0.5, nmax, sa, ija);
73 for (
j = 1;
j < df + 1;
j++) {
74 z2 = z2 +
y[
j] *
b[
j];
77 chiz = ((
float) df) / 2.0;
94 if (
x <= (chiz + 1.0)) {
95 gser(&gamm, chiz,
x, &gln);
96 alphachi[
i] = 1.0 - gamm;
98 gcf(&gamm, chiz,
x, &gln);
107 for (
i = 0;
i < nclasses;
i++) {
108 printf(
"\nalpha[%d]=%f",
i, alphachi[
i + 1]);
112 for (
i = 0;
i < nowts - 1;
i++) {
113 *outdata++ = (
double) alphachi[
i + 1];
116 *outdata++ = alphachi[9] + alphachi[10] + alphachi[11] + alphachi[12] + alphachi[13] + alphachi[14] + alphachi[15] + alphachi[16];
127 if (
DEBUG_FUZZY) printf(
"\nleaving fuzzy_member_func...");
float * vector(long nl, long nh)
subroutine gser(gamser, a, x, gln)
void free_matrix(float **m, long nrl, long nrh, long ncl, long nch)
float ** matrix(long nrl, long nrh, long ncl, long nch)
void fuzzy_func_v3(float *rrs, float **urrs, float ***y3inv, int nclasses, int nowts, int df, double *outdata)
subroutine gcf(gammcf, a, x, gln)
void sprsax(float sa[], unsigned long ija[], float x[], float b[], unsigned long n)
void free_vector(float *v, long nl, long nh)
void free_lvector(unsigned long *v, long nl, long nh)
integer, parameter double
unsigned long * lvector(long nl, long nh)
void sprsin(float **a, int n, float thresh, unsigned long nmax, float sa[], unsigned long ija[])