Changeset 2a94d3 in git for IntegerProgramming


Ignore:
Timestamp:
Jun 16, 2006, 7:31:49 PM (18 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', '4a9821a93ffdc22a6696668bd4f6b8c9de3e6c5f')
Children:
543931e9b94b51dfcb076b90134259291fd4bde5
Parents:
db1fa735ecf3d44ab99e9d5ba0e77c249138d14e
Message:
*hannes: solaris/cc port


git-svn-id: file:///usr/local/Singular/svn/trunk@9228 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
IntegerProgramming
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • IntegerProgramming/IP_algorithms.cc

    rdb1fa7 r2a94d3  
    30813081    }
    30823082
    3083     Integer right_hand[weighted_variables+elimination_variables];
     3083    Integer *right_hand=new Integer[weighted_variables+elimination_variables];
    30843084
    30853085    for(short k=0;k<instances;k++)
     
    31023102            "first input \nfile, "
    31033103            "this and all following right hand vectors will be ignored"<<endl;
     3104          delete[] right_hand;
    31043105          return 0;
    31053106        }
     
    31703171      output<<"computation time"<<endl;
    31713172      output<<setw(6)<<setprecision(2)<<elapsed<<" sec"<<endl<<endl;
     3173      delete[] right_hand;
    31723174    }
    31733175  }
     
    31873189      }
    31883190
    3189       Integer right_hand[weighted_variables+elimination_variables];
     3191      Integer *right_hand=new Integer[weighted_variables+elimination_variables];
    31903192      BOOLEAN error=FALSE;    // to test legality of right hand vectors
    31913193
     
    32093211              "first input \nfile, this and all following right hand vectors "
    32103212              "will be ignored"<<endl;
     3213            delete[] right_hand;
    32113214            return 0;
    32123215          }
     
    32773280        output<<"computation time"<<endl;
    32783281        output<<setw(6)<<setprecision(2)<<elapsed<<" sec"<<endl<<endl;
     3282        delete[] right_hand;
    32793283      }
    32803284    }
     
    33093313              "first input \nfile, this and all following right hand vectors "
    33103314              "will be ignored"<<endl;
     3315            delete[] right_hand;
    33113316            return 0;
    33123317          }
     
    33493354    }
    33503355
     3356  delete[] right_hand;
    33513357  return 1;
    33523358
  • IntegerProgramming/ideal.cc

    rdb1fa7 r2a94d3  
    128128  // size
    129129
    130   Integer generator[A.columns+A.rows+1];
     130  Integer *generator=new Integer[A.columns+A.rows+1];
    131131  // A.columns + A.rows +1 is the number of variables for the Conti-Traverso
    132132  // algorithm with "inversion variable".
     
    165165  add_generator(*bin);
    166166
     167  delete[] generator;
    167168  return *this;
    168169}
     
    181182  // size
    182183
    183   Integer generator[A.columns+A.rows];
     184  Integer *generator=new Integer[A.columns+A.rows];
    184185  // A.columns + A.rows is the number of variables for the Conti-Traverso
    185186  // algorithm without "inversion variable".
     
    206207    add_generator(*bin);
    207208  }
    208 
     209  delete[] generator;
    209210  return *this;
    210211}
     
    232233  }
    233234
    234   Integer generator[A.columns+1];
     235  Integer *generator=new Integer[A.columns+1];
    235236  // This is the number of variables needed for Pottier's algorithm.
    236237
     
    257258          "basic data type short."<<endl;
    258259        size=-3;
     260        delete[] generator;
    259261        return *this;
    260262      }
     
    271273          "basic data type int."<<endl;
    272274        size=-3;
     275        delete[] generator;
    273276        return *this;
    274277      }
     
    285288          "basic data type long."<<endl;
    286289        size=-3;
     290        delete[] generator;
    287291        return *this;
    288292      }
     
    326330
    327331  delete[] sat_var;
     332  delete[] generator;
    328333
    329334  return *this;
     
    355360  }
    356361
    357   Integer generator[A.columns];
     362  Integer * generator=new Integer[A.columns];
    358363  // The algorithm of Hosten and Sturmfels does not need supplementary
    359364  // variables.
     
    380385          "into the used basic data type short."<<endl;
    381386        size=-3;
     387        delete[] generator;
    382388        return *this;
    383389      }
     
    393399          "into the used basic data type int."<<endl;
    394400        size=-3;
     401        delete[] generator;
    395402        return *this;
    396403      }
     
    406413          "into the used basic data type long."<<endl;
    407414        size=-3;
     415        delete[] generator;
    408416        return *this;
    409417      }
     
    424432  }
    425433
     434  delete[] generator;
    426435  return *this;
    427436}
     
    478487      "term_ordering&):\nargument term ordering might be inappropriate"<<endl;
    479488
    480   Integer generator[A.columns];
     489  Integer *generator=new Integer[A.columns];
    481490  // The algorithm of DiBiase and Urbanke does not need supplementary
    482491  // variables.
     
    502511          "into the used basic data type short."<<endl;
    503512        size=-3;
     513        delete[] generator;
    504514        return *this;
    505515      }
     
    515525          "into the used basic data type int."<<endl;
    516526        size=-3;
     527        delete[] generator;
    517528        return *this;
    518529      }
     
    528539          "into the used basic data type long."<<endl;
    529540        size=-3;
     541        delete[] generator;
    530542        return *this;
    531543      }
     
    543555  }
    544556  delete[] F;
     557  delete[] generator;
    545558  return *this;
    546559}
     
    589602  // one supplementary variable used to saturate the ideal
    590603
    591   Integer generator[A.columns+1];
     604  Integer *generator=new Integer[A.columns+1];
    592605  // The algorithm of Bigatti, LaScala and Robbiano needs one supplementary
    593606  // weighted variable.
     
    623636          "not fit into the used basic data type short."<<endl;
    624637        size=-3;
     638        delete[] generator;
    625639        return *this;
    626640      }
     
    636650          "not fit into the used basic data type int."<<endl;
    637651        size=-3;
     652        delete[] generator;
    638653        return *this;
    639654      }
     
    669684    // insert generator
    670685  }
     686  delete[] generator;
    671687  return *this;
    672688}
     
    874890  short number_of_variables=
    875891    w.number_of_elimination_variables()+w.number_of_weighted_variables();
    876   Integer generator[number_of_variables];
     892  Integer* generator=new Integer[number_of_variables];
    877893
    878894  for(long i=0;i<number_of_generators;i++)
     
    888904          "const short&): \ninput failure when reading generator "<<i<<endl;
    889905        size=-2;
     906        delete[] generator;
    890907        return;
    891908      }
     
    896913  size=number_of_generators;
    897914  number_of_new_binomials=size;
     915  delete[] generator;
    898916}
    899917
Note: See TracChangeset for help on using the changeset viewer.