Implement CplLp::write() for LP format (#640)
authorAlpar Juttner <alpar@cs.elte.hu>
Wed, 20 Jan 2021 16:31:29 +0100
changeset 142886a5b114a066
parent 1427 57abff252556
child 1429 eba5aa390aca
Implement CplLp::write() for LP format (#640)
lemon/clp.cc
lemon/clp.h
     1.1 --- a/lemon/clp.cc	Wed Jan 20 16:17:21 2021 +0100
     1.2 +++ b/lemon/clp.cc	Wed Jan 20 16:31:29 2021 +0100
     1.3 @@ -461,4 +461,14 @@
     1.4      }
     1.5    }
     1.6  
     1.7 +   void ClpLp::_write(std::string file, std::string format) const
     1.8 +  {
     1.9 +    if(format == "LP")
    1.10 +      _prob->writeLp(file.c_str(), "", 1e-5, 10, 5,
    1.11 +                     sense()==ClpLp::MIN?1:-1,
    1.12 +                     true
    1.13 +                     );
    1.14 +    else throw UnsupportedFormatError(format);
    1.15 +  }
    1.16 + 
    1.17  } //END OF NAMESPACE LEMON
     2.1 --- a/lemon/clp.h	Wed Jan 20 16:17:21 2021 +0100
     2.2 +++ b/lemon/clp.h	Wed Jan 20 16:31:29 2021 +0100
     2.3 @@ -139,6 +139,8 @@
     2.4  
     2.5      virtual void _messageLevel(MessageLevel);
     2.6  
     2.7 +    void _write(std::string file, std::string format) const;
     2.8 +
     2.9    public:
    2.10  
    2.11      ///Solves LP with primal simplex method.