Skip to content

Commit 2aa8cf5

Browse files
committed
Removed debug printing; formatted
1 parent 98670c5 commit 2aa8cf5

File tree

2 files changed

+2
-56
lines changed

2 files changed

+2
-56
lines changed

check/TestFilereader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ TEST_CASE("read-highs-lp-file", "[highs_filereader]") {
548548
REQUIRE(h.writeModel(model_name0) == HighsStatus::kOk);
549549
REQUIRE(h.readModel(model_name0) == HighsStatus::kOk);
550550
REQUIRE(h.writeModel(model_name1) == HighsStatus::kOk);
551-
551+
552552
// std::remove(model_name0.c_str());
553553
// std::remove(model_name1.c_str());
554554

extern/filereaderlp/reader.cpp

Lines changed: 1 addition & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,6 @@ struct RawToken {
7171
type = RawTokenType::STR;
7272
return *this;
7373
}
74-
/*
75-
RawToken& operator=(const double v) {
76-
dvalue = v;
77-
type = RawTokenType::CONS;
78-
return *this;
79-
}
80-
*/
8174
RawToken& operator=(const std::pair<double, std::string> vs) {
8275
dvalue = vs.first;
8376
svalue = vs.second;
@@ -347,8 +340,6 @@ void Reader::parseexpression(std::vector<ProcessedToken>::iterator& it,
347340
std::shared_ptr<LinTerm>(new LinTerm());
348341
linterm->coef = it->value;
349342
linterm->var = builder.getvarbyname(name);
350-
// printf("LpReader: Term %+g %s\n", linterm->coef,
351-
//name.c_str());
352343
expr->linterms.push_back(linterm);
353344

354345
++it;
@@ -358,7 +349,6 @@ void Reader::parseexpression(std::vector<ProcessedToken>::iterator& it,
358349

359350
// const
360351
if (it->type == ProcessedTokenType::CONST) {
361-
// printf("LpReader: Offset change from %+g by %+g\n", expr->offset, it->value);
362352
expr->offset += it->value;
363353
++it;
364354
continue;
@@ -372,8 +362,6 @@ void Reader::parseexpression(std::vector<ProcessedToken>::iterator& it,
372362
std::shared_ptr<LinTerm>(new LinTerm());
373363
linterm->coef = 1.0;
374364
linterm->var = builder.getvarbyname(name);
375-
// printf("LpReader: Term %+g %s\n", linterm->coef,
376-
//name.c_str());
377365
expr->linterms.push_back(linterm);
378366

379367
++it;
@@ -883,32 +871,7 @@ void Reader::splittokens() {
883871

884872
void Reader::processtokens() {
885873
std::string svalue_lc;
886-
int pass_n = 0;
887-
const bool report_tokens = true;
888-
printf("RawTokenType::NONE = %d\n", int(RawTokenType::NONE));
889-
printf("RawTokenType::STR = %d\n", int(RawTokenType::STR));
890-
printf("RawTokenType::CONS = %d\n", int(RawTokenType::CONS));
891874
while (!rawtokens[0].istype(RawTokenType::FLEND)) {
892-
if (report_tokens) {
893-
pass_n++;
894-
if (pass_n == 9) {
895-
printf("pass_n = 9\n");
896-
}
897-
printf("\nPass %d\n", pass_n);
898-
/*
899-
if (rawtokens[2].dvalue == 55) {
900-
rawtokens[2].type = RawTokenType(1);
901-
rawtokens[2].dvalue = 0;
902-
rawtokens[2].svalue = "55";
903-
}
904-
*/
905-
for (int i = 0; i < NRAWTOKEN; i++) {
906-
printf("Token %d: type = %2d; dvalue = %d; svalue = %s\n", i,
907-
int(rawtokens[i].type),
908-
int(rawtokens[i].dvalue),
909-
rawtokens[i].svalue.c_str());
910-
}
911-
}
912875
fflush(stdout);
913876

914877
// Slash + asterisk: comment, skip everything up to next asterisk + slash
@@ -990,8 +953,6 @@ void Reader::processtokens() {
990953
// constraint identifier - with numeric constant value as name?
991954
if (rawtokens[0].istype(RawTokenType::CONS) &&
992955
rawtokens[1].istype(RawTokenType::COLON)) {
993-
printf("rawtokens[0] - CONS; rawtokens[1] - COLON; rawtokens[0].dvalue = %g; rawtokens[0].svalue = %s\n", rawtokens[0].dvalue, rawtokens[0].svalue.c_str());
994-
// rawtokens[0].svalue = std::to_string(rawtokens[0].dvalue);
995956
processedtokens.emplace_back(ProcessedTokenType::CONID,
996957
rawtokens[0].svalue);
997958
nextrawtoken(2);
@@ -1157,14 +1118,6 @@ void Reader::processtokens() {
11571118
// FILEEND should have been handled in condition of while()
11581119
assert(!rawtokens[0].istype(RawTokenType::FLEND));
11591120

1160-
if (report_tokens) {
1161-
for (int i = 0; i < NRAWTOKEN; i++) {
1162-
printf("Token %d: type = %2d; dvalue = %d; svalue = %s\n", i,
1163-
int(rawtokens[i].type),
1164-
int(rawtokens[i].dvalue),
1165-
rawtokens[i].svalue.c_str());
1166-
}
1167-
}
11681121
// catch all unknown symbols
11691122
lpassert(false);
11701123
break;
@@ -1236,12 +1189,6 @@ bool Reader::readnexttoken(RawToken& t) {
12361189

12371190
// check single character tokens
12381191
char nextchar = this->linebuffer[this->linebufferpos];
1239-
printf("Reader::readnexttoken: nextchar = %c\n", nextchar);
1240-
char char_1 = '1';
1241-
char char_r = 'r';
1242-
if (nextchar == char_1 || nextchar == char_r) {
1243-
printf("Reader::readnexttoken: nextchar = %c!\n", nextchar);
1244-
}
12451192
switch (nextchar) {
12461193
// check for comment
12471194
case '\\':
@@ -1341,8 +1288,7 @@ bool Reader::readnexttoken(RawToken& t) {
13411288
// double is a constraint name
13421289
size_t double_len = endptr - startptr;
13431290
std::string double_name = this->linebuffer.substr(this->linebufferpos, double_len);
1344-
printf("double_len = %d; double_name = %s\n", int(double_len), double_name.c_str());
1345-
// t = constant;
1291+
// t = constant;
13461292
t = std::make_pair(constant, double_name);
13471293
this->linebufferpos += endptr - startptr;
13481294
return true;

0 commit comments

Comments
 (0)