Changeset 38


Ignore:
Timestamp:
Sep 13, 2006 11:49:32 AM (13 years ago)
Author:
pbonami
Message:

Fix some code dependent on gcc

Location:
branches/devel/Bonmin/src/IpoptInterface
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/devel/Bonmin/src/IpoptInterface/IpCbcColReader.cpp

    r1 r38  
    4747      continue;
    4848    varNames_.push_back(name);
    49     varIndices_[varNames_[nVar].c_str()]=nVar;
     49    varIndices_[varNames_[nVar].c_str()] = nVar;
    5050    nVar++;
    5151  }
  • branches/devel/Bonmin/src/IpoptInterface/IpCbcColReader.hpp

    r1 r38  
    1111#define IpCbcColReader_HPP
    1212#include <string>
     13#include <vector>
    1314#include <list>
    1415#include <fstream>
    1516#include <iostream>
    1617#include <CoinHelperFunctions.hpp>
    17 #include <ext/hash_map>
    18 
     18//#include <tr1/unordered_map>
     19#include <map>
    1920/** A class for reading a .col file containing name for variable (ampl generated file).
    2021   */
     
    4243
    4344  /// String comparison strucutre.
    44   struct eqstr
     45  struct ltstr
    4546  {
    4647    bool operator()(const char* s1, const char* s2) const
    4748    {
    48       return strcmp(s1, s2) == 0;
     49      return strcmp(s1, s2) < 0;
    4950    }
    5051  };
    5152
    5253  /// Hash type.
    53   typedef __gnu_cxx::hash_map<const char *, int> namesHash;//, __gnu_cxx::hash <const char *>, eqstr > namesHash;
    54 
     54 // typedef __gnu_cxx::hash_map<const char *, int> namesHash;//, __gnu_cxx::hash <const char *>, eqstr > namesHash;
     55 // typedef std::tr1::unordered_map<std::string, int, std::tr1::hash<std::string> > namesHash;
     56  typedef std::map<const char *, int, ltstr> namesHash;
    5557  ///Hash map used to store the indices.
    5658  namesHash varIndices_;
Note: See TracChangeset for help on using the changeset viewer.