#define MAXROWS 88
#define MAXSTATES 10
#define MAXPROBS 6
int obs[MAXROWS]= {0,5,2,3,0,5,2,3,2,4,0,3,5,1,4,3,1,5,2,0,4,4,1,5,3,3,1,4,0,5,1,2,3,0,2,0,5,2,0, 4,4,5,3,0,5,2,5,1,5,4,0,3,1,4,5,2,3,5,1,5,2,4,5,1,5,4,2,5,0,3,4,1,5,2,4,1,5,0,4,2,3,0,5,1,5,2,4,1};//{2,1,0} ;
int q[MAXROWS]= {1};
int s=MAXROWS, i=1,j=0;
double **A;
double **B;
double AD[MAXSTATES][MAXSTATES]={{0,1,0,0,0,0,0,0,0,0},{0,0,1,0,0,0,0,0,0,0},{0,0,0,1,0,0,0,0,0,0},{0,0,0,0,1,0,0,0,0,0},{0.8,0,0,0,0,0.2,0,0,0,0},{0,0,0,0,0,0,1,0,0,0},{0,0,0,0,0,0,0,1,0,0},{0,0,0,0,0,0,0,0,1,0},{0.2,0,0,0,0,0.8,0,0,0,0}};//{{.6,.4},{.3,.7}};//{ { .500, .375, .125 }, { .250,.125, .625 }, { .250,.375,.375 } };
double BD[MAXSTATES][MAXPROBS]={{.167,.167,.167,.167,.167,.167},{.167,.167,.167,.167,.167,.167},{.167,.167,.167,.167,.167,.167},{.167,.167,.167,.167,.167,.167},{.167,.167,.167,.167,.167,.167},{.4,.1125,.1125,.1125,.1125,.15},{.4,.1125,.1125,.1125,.1125,.15},{.4,.1125,.1125,.1125,.1125,.15},{.4,.1125,.1125,.1125,.1125,.15},{.4,.1125,.1125,.1125,.1125,.15}};//{{.1,.3,.6},{.5,.4,.1}};//{ { .60, .20 ,.15, .05}, { .25, .25, .25, .25 }, { .05,.10,.35,.50 } };
double *pi;
double pi2[MAXSTATES] = {1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};//{.4,.6};
double *poolA;
double *curPtrA;
double *poolB;
double *curPtrB;
double pproba=0;
double **delta;
double *pool;
double *curPtr;
int **psi;
int *poolpsi;
int *curPtrpsi;
HMM model;
A = (double** )calloc(MAXSTATES, sizeof(double* ));
poolA = (double *)calloc( MAXSTATES * MAXSTATES, sizeof(double));
curPtrA = poolA;
for( i = 0; i < MAXSTATES; i++)
{
*(A + i) = curPtrA;
curPtrA += MAXSTATES;
}
B = (double** )calloc(MAXSTATES, sizeof(double* ));
poolB = (double *)calloc( MAXSTATES * MAXPROBS, sizeof(double));
curPtrB = poolB;
for( i = 0; i < MAXSTATES; i++)
{
*(B + i) = curPtrB;
curPtrB += MAXPROBS;
}
for(i = 0; i <MAXSTATES; i++)
for(j=0; j< MAXPROBS; j++)
B[i][j] = BD[i][j];
for(i = 0; i < MAXSTATES; i++)
for(j=0; j< MAXSTATES; j++)
A[i][j] = AD[i][j];
pi = (double* )calloc(MAXSTATES, sizeof(double* ));
for(i = 0; i <MAXSTATES; i++)
pi[i] = pi2[i];
model.M=MAXPROBS;
model.N=MAXSTATES;
model.A= A;
model.B = B;
model.pi = pi;
//double delta[6][4];
psi = (int** )calloc(MAXROWS, sizeof(int* ));
poolpsi = (int *)calloc( MAXROWS*MAXSTATES, sizeof(int));
curPtrpsi = poolpsi;
for( i = 0; i < MAXROWS; i++)
{
*(psi + i) = curPtrpsi;
curPtrpsi += MAXSTATES;
}
Ich fange an, Fehler auf psi = (int **) ... Zeile über Heaps, die wie folgt ist:
"Windows hat einen Haltepunkt in TestProj.exe ausgelöst.
Dies kann auf eine Beschädigung des Heaps zurückzuführen sein, was auf einen Fehler in TestProj.exe oder einer der geladenen DLLs hinweist.
Dies kann auch darauf zurückzuführen sein, dass der Benutzer F12 drückt, während TestProj.exe den Fokus hat.
Das Ausgabefenster kann weitere Diagnoseinformationen enthalten."