00001 /* 00002 * Copyright 2007 Martin von Gagern 00003 * 00004 * 00005 * This file is part of mqn2mps. 00006 * 00007 * mqn2mps is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation; either version 3 of the License, or 00010 * (at your option) any later version. 00011 * 00012 * mqn2mps is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00019 */ 00020 00021 00022 #ifndef MPSGEN_HH 00023 #define MPSGEN_HH 00024 00025 /** 00026 * @file 00027 * Interface of class mpsgen 00028 */ 00029 00030 class CoinPackedMatrix; 00031 00032 /** 00033 * Output module for writing MPS files. 00034 * 00035 * The MPS file format is commonly used as input format for linear 00036 * optimization software. Descriptions can be found on the web. This 00037 * class uses the CoinUtils library to write output in this format. 00038 */ 00039 class mpsgen : public mipgen { 00040 public: 00041 mpsgen(const driver& d); 00042 virtual ~mpsgen(); 00043 void write(const char* filename); 00044 00045 protected: 00046 void make_matrix(size_t rows, size_t cols); 00047 void set_element(size_t row, size_t col, int val); 00048 00049 private: 00050 00051 /** 00052 * COIN-OR matrix representation. 00053 * As we don't use mipgen::matrix, shadowing that structure by using 00054 * the same name only avoids accidential access to an uninitialized 00055 * data structure. 00056 */ 00057 CoinPackedMatrix* matrix; 00058 }; 00059 00060 #endif
1.6.0