26 #include "OSInstance.h"
33 #include "OSCommonUtil.h"
36 #include "CoinFinite.hpp"
53 int main(
int argC,
char* argV[]){
59 cout <<
"Start Building the Model" << endl;
60 std::cout <<
"Hello World" << std::endl;
62 std::string osilFileName =
"../../data/osilFiles/rosenbrockmod.osil";
63 std::cout <<
"Try to read a sample file" << std::endl;
64 std::cout <<
"The file is: " ;
65 std::cout << osilFileName << std::endl;
70 osinstance = osilreader->
readOSiL( osil);
77 ostringstream solverOutput;
80 pFile2 = freopen(
"os.log",
"w", stdout);
82 std::cout <<
"LINE 1 OUTPUT " << std::endl;
83 printf(
"LINE 2 OUTPUT \n");
85 pFile = fopen(
"os.log",
"r");
87 while (!feof( stdout)) {
89 if(c !=-1) solverOutput <<
c;
96 ostringstream solverOutput;
97 std::streambuf* save_buffer = cout.rdbuf(solverOutput.rdbuf());
98 std::cout <<
"LINE 1 OUTPUT " << std::endl ;
99 printf(
"LINE 2 OUTPUT \n") ;
100 cout.rdbuf(save_buffer);
101 std::cout <<
"LINE 3 OUTPUT " << std::endl;
103 std::cout << solverOutput.str() << std::endl;
107 ostringstream outStr;
111 std::cout << outStr.str() << std::endl;
113 outStr <<
"New" << std::endl;
114 std::cout << outStr.str() << std::endl;
bool writeFileFromString(char *fname, std::string thestring)
write a file from an input string.
int main(int argc, char *argv[])
OSInstance * readOSiL(const std::string &osil)
parse the OSiL model instance.
Used to read an OSiL string.
std::string getFileAsString(const char *fname)
read a file and return contents as a string.
The in-memory representation of an OSiL instance..
class used to make it easy to read and write files.