MCPcopy Create free account
hub / github.com/ERGO-Code/HiGHS / writeToFile

Method writeToFile

highs/io/FilereaderLp.cpp:309–324  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

307}
308
309void FilereaderLp::writeToFile(FILE* file, const char* format, ...) {
310 va_list argptr;
311 va_start(argptr, format);
312 std::array<char, LP_MAX_LINE_LENGTH + 1> stringbuffer = {};
313 HighsInt tokenlength =
314 vsnprintf(stringbuffer.data(), stringbuffer.size(), format, argptr);
315 va_end(argptr);
316 if (this->linelength + tokenlength >= LP_MAX_LINE_LENGTH) {
317 fprintf(file, "\n");
318 fprintf(file, "%s", stringbuffer.data());
319 this->linelength = tokenlength;
320 } else {
321 fprintf(file, "%s", stringbuffer.data());
322 this->linelength += tokenlength;
323 }
324}
325
326void FilereaderLp::writeToFileLineEnd(FILE* file) {
327 fprintf(file, "\n");

Callers 3

writeToFileValueMethod · 0.95
writeToFileVarMethod · 0.95
writeModelToFileMethod · 0.95

Calls 2

dataMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected