00001 /* 00002 Copyright (c) 2005, Quentin Lequy and Romain Gaucher 00003 All rights reserved. 00004 00005 Redistribution and use in source and binary forms, with or 00006 without modification, are permitted provided that the following 00007 conditions are met: 00008 00009 * Redistributions of source code must retain the above copyright 00010 notice, this list of conditions and the following disclaimer. 00011 00012 * Redistributions in binary form must reproduce the above copyright 00013 notice, this list of conditions and the following disclaimer in the 00014 documentation and/or other materials provided with the distribution. 00015 00016 * Neither the name of Quentin Lequy or Romain Gaucher nor the names 00017 of its contributors may be used to endorse or promote products 00018 derived from this software without specific prior written permission. 00019 00020 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00021 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00022 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00023 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 00024 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00025 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 00026 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 00027 AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00028 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00029 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00030 */ 00031 00033 #ifndef __FICHIER_LP_H 00034 #define __FICHIER_LP_H 00035 00036 00037 #include "FichierProbleme.h" 00038 00039 namespace Modelib { 00040 00046 class FichierLP : public FichierProbleme 00047 { 00048 protected: 00049 00050 bool IsComment (std::string& ); 00051 std::string trim (const std::string& ) const; 00052 std::string AvoidSpaces(const std::string& ) const; 00053 // 00054 bool IsNumber (const std::string& ) const; 00055 void GetNumVar(const std::string& , std::string& , std::string& ); 00056 00057 // parser l'expression de la fonction objectif ! 00058 void ParseObjective(const std::string& ); 00059 void ParseSubjects (const std::string& , const std::string&); 00060 void ParseBounds (const std::string& ); 00061 void ParseGenerals (const std::string& ); 00062 void ParseBinaries (const std::string& ); 00063 void Tokenize(const std::string& ,std::list<std::string>& 00064 ,std::list<std::string>&); 00065 00066 public: 00070 FichierLP(); 00071 00073 bool Open(const std::string& ); 00074 00076 ~FichierLP() 00077 { 00078 //std::cout << "Destructeur de la spécialisation: ~FichierLP()" << std::endl; 00079 }; 00080 }; 00081 00082 } 00083 00084 #endif 00085