Changeset 6
 Timestamp:
 Apr 27, 2009 12:33:21 PM (11 years ago)
 Location:
 trunk/adolc
 Files:

 3 edited
Legend:
 Unmodified
 Added
 Removed

trunk/adolc/convolut.c
r1 r6 24 24 /* Evaluates convolution of a and b to c */ 25 25 void conv( int dim, double *a, revreal *b, double *c ) { 26 double tmpVal; 27 int i,j; 28 for (i=dim1; i>=0; i) { 29 tmpVal = a[i]*b[0]; 30 for (j=1; j<=i; j++) 31 tmpVal += a[ij]*b[j]; 32 c[i] = tmpVal; 33 } 34 } 35 36 void conv0( int dim, revreal *a, revreal *b, double *c ) { 26 37 double tmpVal; 27 38 int i,j; … … 65 76 } 66 77 78 /**/ 79 /* olvo 980616 nf */ 80 /* Increments truncated convolution of a and b to c and sets a to zero */ 81 void inconv1( int dim, revreal *a, revreal *b, revreal *c ) { 82 revreal tmpVal; 83 int i,j; 84 for (i=dim1; i>=0; i) { 85 tmpVal = a[i]*b[0]; 86 a[i] = 0; 87 for (j=1; j<=i; j++) 88 tmpVal += a[ij]*b[j]; 89 c[i] += tmpVal; 90 } 91 } 92 67 93 /****************************************************************************/ 68 94 /* DECREMENTAL CONVOLUTION */ … … 90 116 tmpVal = a[i]*b[0]; 91 117 a[i] = 0; 118 for (j=1; j<=i; j++) 119 tmpVal += a[ij]*b[j]; 120 c[i] = tmpVal; 121 } 122 } 123 124 /**/ 125 /* Decrements truncated convolution of a and b to c */ 126 void deconv1( int dim, revreal *a, revreal *b, revreal *c ) { 127 revreal tmpVal; 128 int i,j; 129 for (i=dim1; i>=0; i) { 130 tmpVal = a[i]*b[0]; 92 131 for (j=1; j<=i; j++) 93 132 tmpVal += a[ij]*b[j]; 
trunk/adolc/convolut.h
r1 r6 26 26 /**/ 27 27 /* Evaluates convolution of a and b to c */ 28 void conv( int dim, double *a, double *b, double *c ); 28 void conv( int dim, double *a, revreal *b, double *c ); 29 void conv0( int dim, revreal *a, revreal *b, double *c ); 29 30 30 31 /****************************************************************************/ … … 33 34 /**/ 34 35 /* Increments truncated convolution of a and b to c */ 35 void inconv ( int dim, double *a, double*b, double* c );36 void inconv ( int dim, double *a, revreal *b, double* c ); 36 37 37 38 /**/ 38 39 /* Increments truncated convolution of a and b to c and sets a to zero */ 39 void inconv0( int dim, double *a, double *b, double* c ); 40 void inconv0( int dim, double *a, revreal *b, double* c ); 41 void inconv1( int dim, revreal *a, revreal *b, revreal* c ); 40 42 41 43 … … 49 51 /**/ 50 52 /* Decrements truncated convolution of a and b to c and sets a to zero */ 51 void deconv0( int dim, double* a, double *b, double* c ); 53 void deconv0( int dim, double* a, revreal *b, double* c ); 54 void deconv1( int dim, revreal* a, revreal *b, revreal* c ); 52 55 53 56 … … 56 59 57 60 /**/ 58 void divide(int dim, double* a, double *b, double* c);61 void divide(int dim, revreal* a, revreal *b, revreal* c); 59 62 60 63 /**/ 61 void recipr(int dim, double a, double *b, double* c);64 void recipr(int dim, double a, revreal *b, revreal* c); 62 65 63 66 
trunk/adolc/ho_rev.c
r1 r6 1031 1031 /* RECOMPUTATION */ 1032 1032 ASSIGN_T( Tres, rpp_T[res]) 1033 deconv (k,Targ1,Targ2,Tres);1033 deconv1(k,Targ1,Targ2,Tres); 1034 1034 1035 1035 FOR_0_LE_l_LT_p … … 1074 1074 /* RECOMPUTATION */ 1075 1075 ASSIGN_T( Tres, rpp_T[res]) 1076 inconv (k,Targ1,Targ2,Tres);1076 inconv1(k,Targ1,Targ2,Tres); 1077 1077 1078 1078 FOR_0_LE_l_LT_p … … 1089 1089 AARG2_INC_O; 1090 1090 1091 deconv (k,Ares,Targ1,Aarg2);1092 deconv (k,Ares,Targ2,Aarg1);1091 deconv0(k,Ares,Targ1,Aarg2); 1092 deconv0(k,Ares,Targ2,Aarg1); 1093 1093 1094 1094 HOV_INC(Ares, k) … … 1168 1168 VEC_COMPUTED_CHECK 1169 1169 recipr(k,1.0,Targ2,rp_Ttemp); 1170 conv (k ,rp_Ttemp,1170 conv0(k ,rp_Ttemp, 1171 1171 Tres, dp_Atemp2); 1172 1172 VEC_COMPUTED_END … … 1222 1222 VEC_COMPUTED_CHECK 1223 1223 recipr(k,1.0,Targ,rp_Ttemp); 1224 conv (k, rp_Ttemp,1224 conv0(k, rp_Ttemp, 1225 1225 Tres, dp_Atemp); 1226 1226 VEC_COMPUTED_END 1227 deconv 0(k,Ares,dp_Atemp,Aarg);1227 deconv(k,Ares,dp_Atemp,Aarg); 1228 1228 1229 1229 HOV_INC(Ares, k) … … 2073 2073 2074 2074 /* clean up */ 2075 myfree2(rpp_T); 2075 free((char*)*rpp_T); 2076 free((char*) rpp_T); 2076 2077 myfree2(dpp_A); 2077 2078 free(rp_Ttemp);
Note: See TracChangeset
for help on using the changeset viewer.