[Lemon-commits] Alpar Juttner: Implement CplLp::write() for LP f...
Lemon HG
hg at lemon.cs.elte.hu
Thu Feb 25 10:24:25 CET 2021
details: http://lemon.cs.elte.hu/hg/lemon/rev/86a5b114a066
changeset: 1428:86a5b114a066
user: Alpar Juttner <alpar [at] cs.elte.hu>
date: Wed Jan 20 16:31:29 2021 +0100
description:
Implement CplLp::write() for LP format (#640)
diffstat:
lemon/clp.cc | 10 ++++++++++
lemon/clp.h | 2 ++
2 files changed, 12 insertions(+), 0 deletions(-)
diffs (30 lines):
diff --git a/lemon/clp.cc b/lemon/clp.cc
--- a/lemon/clp.cc
+++ b/lemon/clp.cc
@@ -461,4 +461,14 @@
}
}
+ void ClpLp::_write(std::string file, std::string format) const
+ {
+ if(format == "LP")
+ _prob->writeLp(file.c_str(), "", 1e-5, 10, 5,
+ sense()==ClpLp::MIN?1:-1,
+ true
+ );
+ else throw UnsupportedFormatError(format);
+ }
+
} //END OF NAMESPACE LEMON
diff --git a/lemon/clp.h b/lemon/clp.h
--- a/lemon/clp.h
+++ b/lemon/clp.h
@@ -139,6 +139,8 @@
virtual void _messageLevel(MessageLevel);
+ void _write(std::string file, std::string format) const;
+
public:
///Solves LP with primal simplex method.
More information about the Lemon-commits
mailing list