1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 /* */ 3 /* This file is part of the class library */ 4 /* SoPlex --- the Sequential object-oriented simPlex. */ 5 /* */ 6 /* Copyright (c) 1996-2023 Zuse Institute Berlin (ZIB) */ 7 /* */ 8 /* Licensed under the Apache License, Version 2.0 (the "License"); */ 9 /* you may not use this file except in compliance with the License. */ 10 /* You may obtain a copy of the License at */ 11 /* */ 12 /* http://www.apache.org/licenses/LICENSE-2.0 */ 13 /* */ 14 /* Unless required by applicable law or agreed to in writing, software */ 15 /* distributed under the License is distributed on an "AS IS" BASIS, */ 16 /* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ 17 /* See the License for the specific language governing permissions and */ 18 /* limitations under the License. */ 19 /* */ 20 /* You should have received a copy of the Apache-2.0 license */ 21 /* along with SoPlex; see the file LICENSE. If not email to soplex@zib.de. */ 22 /* */ 23 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 24 25 #include <assert.h> 26 27 #include "soplex/spxdefines.h" 28 #include "soplex/spxsolver.h" 29 #include "soplex/spxfileio.h" 30 31 namespace soplex 32 { 33 template <class R> 34 bool SPxSolverBase<R>::readBasisFile( 35 const char* filename, 36 const NameSet* rowNames, 37 const NameSet* colNames) 38 { 39 spxifstream file(filename); 40 41 if(!file) 42 return false; 43 44 return this->readBasis(file, rowNames, colNames); 45 } 46 47 template <class R> 48 bool SPxSolverBase<R>::writeBasisFile 49 (const char* filename, 50 const NameSet* rowNames, 51 const NameSet* colNames, 52 const bool cpxFormat) const 53 { 54 std::ofstream file(filename); 55 56 if(!file) 57 return false; 58 59 this->writeBasis(file, rowNames, colNames); 60 return true; 61 } 62 63 } // namespace soplex 64