ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/gclib/seqalign/GXAlign.h
(Generate patch)
# Line 5 | Line 5
5  
6   #define GDEBUG 1
7  
8 #define ERROR_FRACTION 6  // 1/this : the higher it is, the smaller the diagonal band
8   #define MAX_SPACE 1000000
9   #define LARGE 100000000
10  
# Line 175 | Line 174
174             delete sp;
175             sp = next_sp;
176             }
177 +      GFREE(space_array);
178        }
179 +
180    GX3Val* getSpace(int amount) {
181       GX3Val* v;
182       if (amount < 0) return NULL;
# Line 192 | Line 193
193       }
194   };
195  
196 + #define ERROR_FRACTION 6  // 1/this : the higher it is, the smaller the diagonal band
197 +
198   struct GXAlnMem { //GreedyAlignMem
199    int** flast_d;
200    int* max_row_free;
# Line 206 | Line 209
209      space=NULL;
210      max_d = (int)(max_len / ERROR_FRACTION + 1);
211      int d_diff = (Xdrop+reward/2)/(penalty+reward) + 1;
212 <    GCALLOC(flast_d, (max_d+2)* sizeof(int));
212 >    GCALLOC(flast_d, (max_d+2)* sizeof(int*));
213      if (flast_d == NULL) {
214         GError("Error: cannot allocate GXAlnMem structure!\n");
215         }
# Line 222 | Line 225
225    ~GXAlnMem() {
226      delete space;
227      GFREE(max_row_free);
228 <    //GFREE(flast_d[0]);  // FIXME
229 <    //TODO: check with valgrind
227 <    //for (int i=0;i<max_d+2;i++) {
228 <    //   GFREE(flast_d[i]);
229 <    //   }
230 <    //GFREE(flast_d);
228 >    GFREE(flast_d[0]);
229 >    GFREE(flast_d);
230      }
231   };
232  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines