Error: incomplete type is not allowed

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
<div style="padding-bottom:0px; margin-bottom:0px; font-size:0.75em; line-height:1.5
Hi Everyone,


I found some error when I try to compile my below code (I use Visual Studio 2010),
this code generated message error like : Error: incomplete type is not allowed
for the replay and help, Im very appreciate. Thanks in advance

#include<stdio.h><br/>
#include<stdlib.h><br/>
#include<conio.h><br/>
#include<string.h><br/>
#include<math.h><br/>
#include<memory.h><br/>
#include<fstream><br/>
typedef unsigned char boolean;<br/>
extern boolean rtIsNaN(float value);<br/>
extern boolean rtIsInf(float value);<br/>
extern float rtNaN;<br/>
extern float rtInf;<br/>
float diff_sig_data[10];<br/>
<br/>
<br/>
<br/>
<br/>
void b_conv(const float A_data[10], const int A_sizes[1], float C_data[10], int C_sizes[1])<br/>
{<br/>
int jC;<br/>
int j;<br/>
int jA1;<br/>
int jA2;<br/>
float s;<br/>
static const int B[3] = { 0, -1, 1 };<br/>
<br/>
<br/>
C_sizes[0] = 10;<br/>
for (jC = 0; jC < 10; jC++) <br/>
{<br/>
j = jC + 2;<br/>
if (3 < j + 1) <br/>
<span style="white-space:pre {<br/>
jA1 = j - 2;<br/>
} <br/>
<span style="white-space:pre else <br/>
<span style="white-space:pre {<br/>
jA1 = 1;<br/>
}<br/>
<br/>
<br/>
if (10 < j) <br/>
<span style="white-space:pre {<br/>
jA2 = 10;<br/>
} <br/>
<span style="white-space:pre else <br/>
<span style="white-space:pre {<br/>
jA2 = j;<br/>
}<br/>
<br/>
<br/>
s = 0.0;<br/>
while (jA1 <= jA2) <br/>
<span style="white-space:pre {<br/>
s += A_data[jA1 - 1] * (float)B[j - jA1];<br/>
jA1++;<br/>
}<br/>
<br/>
<br/>
C_data[jC] = s;<br/>
}<br/>
}<br/>
<br/>
<br/>
void conv(const float A_data[10], const int A_sizes[1], float C_data[10],int C_sizes[1])<br/>
{<br/>
int jC;<br/>
int j;<br/>
int jA1;<br/>
int jA2;<br/>
float s;<br/>
static const int B[3] = { 1, -1, 0 };<br/>
<br/>
<br/>
C_sizes[0] = 10;<br/>
for (jC = 0; jC < 10; jC++) <br/>
{<br/>
j = jC + 2;<br/>
if (3 < j + 1) <br/>
<span style="white-space:pre {<br/>
jA1 = j - 2;<br/>
} <br/>
<span style="white-space:pre else <br/>
<span style="white-space:pre {<br/>
jA1 = 1;<br/>
}<br/>
<br/>
<br/>
if (10 < j) <br/>
<span style="white-space:pre {<br/>
jA2 = 10;<br/>
} <br/>
<span style="white-space:pre else <br/>
<span style="white-space:pre {<br/>
jA2 = j;<br/>
}<br/>
<br/>
<br/>
s = 0.0;<br/>
while (jA1 <= jA2) <br/>
<span style="white-space:pre {<br/>
s += A_data[jA1 - 1] * (float)B[j - jA1];<br/>
jA1++;<br/>
}<br/>
<br/>
<br/>
C_data[jC] = s;<br/>
}<br/>
}<br/>
<br/>
<br/>
static float rt_powd_snf(float u0, float u1)<br/>
{<br/>
float y;<br/>
float d0;<br/>
float d1;<br/>
if (rtIsNaN(u0) || rtIsNaN(u1)) <br/>
{<br/>
y = rtNaN;<br/>
} <br/>
else {<br/>
d0 = fabs(u0);<br/>
d1 = fabs(u1);<br/>
if (rtIsInf(u1)) <br/>
<span style="white-space:pre {<br/>
if (d0 == 1.0) <br/>
<span style="white-space:pre {<br/>
y = rtNaN;<br/>
} <br/>
<span style="white-space:pre else if (d0 > 1.0) <br/>
<span style="white-space:pre {<br/>
if (u1 > 0.0) <br/>
<span style="white-space:pre {<br/>
y = rtInf;<br/>
} else <br/>
<span style="white-space:pre {<br/>
y = 0.0;<br/>
}<br/>
} else if (u1 > 0.0) <br/>
<span style="white-space:pre {<br/>
y = 0.0;<br/>
} else <br/>
<span style="white-space:pre {<br/>
y = rtInf;<br/>
}<br/>
} <br/>
<span style="white-space:pre else if (d1 == 0.0) <br/>
<span style="white-space:pre {<br/>
y = 1.0;<br/>
} <br/>
<span style="white-space:pre else if (d1 == 1.0) <br/>
<span style="white-space:pre {<br/>
if (u1 > 0.0) <br/>
<span style="white-space:pre {<br/>
y = u0;<br/>
} else <br/>
<span style="white-space:pre {<br/>
y = 1.0 / u0;<br/>
}<br/>
} <br/>
<span style="white-space:pre else if (u1 == 2.0) <br/>
<span style="white-space:pre {<br/>
y = u0 * u0;<br/>
} <br/>
<span style="white-space:pre else if ((u1 == 0.5) && (u0 >= 0.0)) <br/>
<span style="white-space:pre {<br/>
y = sqrt(u0);<br/>
} <br/>
<span style="white-space:pre else if ((u0 < 0.0) && (u1 > floor(u1))) <br/>
<span style="white-space:pre {<br/>
y = rtNaN;<br/>
} <br/>
<span style="white-space:pre else <br/>
<span style="white-space:pre {<br/>
y = pow(u0, u1);<br/>
}<br/>
}<br/>
<br/>
<br/>
return y;<br/>
}<br/>
<br/>
<br/>
void power(const float a_data[10], const int a_sizes[1], float y_data[10],int y_sizes[1])<br/>
{<br/>
int k;<br/>
y_sizes[0] = 10;<br/>
for (k = 0; k < 10; k++) <br/>
{<br/>
y_data[k] = rt_powd_snf(a_data[k], 2.0);<br/>
}<br/>
}<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
void aniso(float diff_sig_data[10], int diff_sig_sizes[1])<br/>
{<br/>
<span style="white-space:pre const float b_sig[10]={10, 10, 11, 10, 9, 10, 13, 10, 10, 10};<br/>
<span style="white-space:pre int t;<br/>
<span style="white-space:pre int t;<br/>
<span style="white-space:pre int nablaW_sizes;<br/>
<span style="white-space:pre float nablaW_data[10];<br/>
<span style="white-space:pre int nablaE_sizes;<br/>
<span style="white-space:pre float nablaE_data[10];<br/>
<span style="white-space:pre float b_nablaW_data[10];<br/>
<span style="white-space:pre float b_nablaE_data[10];<br/>
<span style="white-space:pre int tmp_sizes;<br/>
<span style="white-space:pre float tmp_data[10];<br/>
<span style="white-space:pre int K=2;<br/>
<span style="white-space:pre int iteration=5;<br/>
<br/>
<br/>
<span style="white-space:pre diff_sig_sizes[0]=10;<br/>
<br/>
<br/>
<br/>
<br/>
<span style="white-space:pre memcpy((void *)&diff_sig_data[0], (void *)&b_sig[0], 10U * sizeof(float));<br/>
<br/>
<br/>
<span style="white-space:pre for (t = 0; t < iteration; t++) //loop as long as number iteration<br/>
<span style="white-space:pre {<br/>
<span style="white-space:pre conv(diff_sig_data, diff_sig_sizes, nablaW_data, *(int (*)[1])&nablaW_sizes); //do the convolution to distinguish between edge end not<br/>
<span style="white-space:pre b_conv(diff_sig_data, diff_sig_sizes, nablaE_data, *(int (*)[1])&nablaE_sizes);<br/>
<br/>
<br/>
<br/>
<br/>
nablaW_sizes = 10;<br/>
for (nablaE_sizes = 0; nablaE_sizes < 10; nablaE_sizes++) // multiply with the coefficient<br/>
<span style="white-space:pre {<br/>
b_nablaW_data[nablaE_sizes] = nablaW_data[nablaE_sizes] / K;<br/>
b_nablaE_data[nablaE_sizes] = nablaE_data[nablaE_sizes] / K;<br/>
}<br/>
<br/>
<br/>
power(b_nablaW_data, *(int (*)[1])&nablaW_sizes, tmp_data, *(int (*)[1])&tmp_sizes);<br/>
nablaE_sizes = 10;<br/>
power(b_nablaE_data, *(int (*)[1])&nablaE_sizes, b_nablaW_data, *(int (*)[1])&tmp_sizes);<br/>
<br/>
<br/>
<span style="white-space:pre <br/>
<span style="white-space:pre diff_sig_sizes[0] = 10;<br/>
for (nablaE_sizes = 0; nablaE_sizes < 10; nablaE_sizes++) <br/>
<span style="white-space:pre {<br/>
diff_sig_data[nablaE_sizes] = diff_sig_data[nablaE_sizes] + 0.33333333333333331 * ((1.0 / (1.0 +tmp_data[nablaE_sizes]) * nablaW_data[nablaE_sizes] + 1.0 / (1.0 +b_nablaW_data[nablaE_sizes]) * nablaE_data[nablaE_sizes])+(diff_sig_data[0]-diff_sig_data[nablaE_sizes]));<br/>
}<br/>
<span style="white-space:pre <br/>
}<br/>
}<br/>
<br/>
<br/>
<br/>
<br/>
void main()<br/>
{<br/>
<span style="white-space:pre //float diff_sig_data[10]=[10 10 11 10 9 10 13 10 10 10];<br/>
<br/>
<br/>
<span style="white-space:pre printf("aniso : nn%f",aniso());<br/>
<br/>
<br/>
return 0;<br/>
}<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>



<br/>


View the full article
 
Back
Top