From e54e50a1f35b5636d92baef536d78fd844267ca2 Mon Sep 17 00:00:00 2001 From: Ronny Lorenz Date: Tue, 28 Jan 2014 16:57:04 +0100 Subject: [PATCH 5/8] remove all the remaining unnecessary stuff --- Node.cpp | 7 ++++--- Util.cpp | 27 +-------------------------- 2 files changed, 5 insertions(+), 29 deletions(-) diff --git a/Node.cpp b/Node.cpp index 3ddcb0f..3f33123 100644 --- a/Node.cpp +++ b/Node.cpp @@ -291,12 +291,13 @@ void Node::CalculateFoldingPath(Node* extremum,std::string integrated_structure) int maxE_idx = -1; int t = Node::transcribed; std::vector > v; - + /* length of path always is the base pair distance + 1 */ + p_len = bp_distance(const_cast(sequence.substr(0,t).c_str()), + const_cast(Node::front_structure.c_str())) + 1; p = get_path(const_cast(sequence.substr(0,t).c_str()), const_cast(Node::front_structure.c_str()), const_cast(integrated_structure.substr(0,t).c_str()), - Node::OptS->maxkeep, - &p_len); + Node::OptS->maxkeep); bool barrier_exceeded=false; for (int i=0; i bp){ return "("+Str(bp.first)+","+Str(bp.second)+")"; @@ -283,21 +273,6 @@ ConformationToStacks(std::vector > > & stacks, st } } -void *MG_space(unsigned size) { - void *pointer; - - if ( (pointer = (void *) calloc(1, (size_t) size)) == NULL) { -#ifdef EINVAL - if (errno==EINVAL) { - fprintf(stderr,"SPACE: requested size: %d\n", size); - printf("SPACE allocation failure -> EINVAL"); - } - if (errno==ENOMEM) -#endif - printf("SPACE allocation failure -> no memory"); - } - return pointer; -} #ifdef WITH_DMALLOC #define MG_space(S) calloc(1,(S)) @@ -314,7 +289,7 @@ void *MG_space(unsigned size) { // short *table; length = (short) strlen(structure); - stack = (short *) MG_space(sizeof(short)*(length+1)); + stack = (short *) space(sizeof(short)*(length+1)); //table = (short *) space(sizeof(short)*(length+2)); pair_table[0] = length; -- 2.5.2