Skip to content

Commit

Permalink
Link export: short type names #232
Browse files Browse the repository at this point in the history
  • Loading branch information
glebbelov committed Feb 29, 2024
1 parent 5c343d5 commit 191728c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion include/mp/flat/constr_keeper.h
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,7 @@ class ConstraintKeeper final
ConstraintKeeper(Converter& cvt, const char* nm, const char* optnm) :
BasicConstraintKeeper(cvt.GetValuePresolver(), nm, optnm), cvt_(cvt)
{
GetValueNode().SetName(GetShortTypeName()); // change value node name
GetConverter().AddConstraintKeeper(*this, ConversionPriority());
}

Expand Down Expand Up @@ -880,7 +881,7 @@ class ConstraintKeeper final
fmt::MemoryWriter wrt;
{
MiniJSONWriter jw(wrt);
jw["con_type"] = GetShortTypeName();
jw["CON_TYPE"] = GetShortTypeName();
jw["index"] = i_con;
jw["depth"] = cnt.GetDepth();
// wrt.write("\"data\": ");
Expand Down
4 changes: 2 additions & 2 deletions include/mp/flat/converter_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class FlatModel
fmt::MemoryWriter wrt;
{
MiniJSONWriter jw(wrt);
jw["var_index"] = i+i_start;
jw["VAR_INDEX"] = i+i_start;
jw["bounds"] << lbs[i] << ubs[i];
jw["type"] = (int)types[i];
jw["is_from_nl"] = (int)is_var_original(i);
Expand Down Expand Up @@ -238,7 +238,7 @@ class FlatModel
fmt::MemoryWriter wrt;
{
MiniJSONWriter jw(wrt);
jw["obj_index"] = i_obj;
jw["OBJ_INDEX"] = i_obj;
jw["sense"] = (int)obj.obj_sense();
wrt.write("\"qp_terms\": ");
WriteJSON(wrt, obj.GetQPTerms());
Expand Down
2 changes: 1 addition & 1 deletion include/mp/valcvt.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class ValuePresolverImpl : public BasicValuePresolver {
MiniJSONWriter jw(wrt);
jw["link_index"] = std::make_tuple(i_exported_, i_entry);
jw["link_type"] = ln.GetTypeName();
WriteNodes(jw["source_nodes"], entry_items_.src_items_);
WriteNodes(jw["src_nodes"], entry_items_.src_items_);
WriteNodes(jw["dest_nodes"], entry_items_.dest_items_);
}
/// Export record
Expand Down

0 comments on commit 191728c

Please sign in to comment.