Skip to content

Commit

Permalink
Some cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
MathieuDutSik committed Nov 23, 2024
1 parent 39b81af commit eae0bd8
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 38 deletions.
1 change: 0 additions & 1 deletion src_basic/Temp_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

// Only standard includes are allowed. Forbidden are:
// ---any boost include
// ---any TBB include
// ---anything that requires a non-trivial installation

// C-style includes
Expand Down
12 changes: 6 additions & 6 deletions src_graph/GRAPH_traces.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ TRACES_GetCanonicalOrdering_Arr(DataTraces &DT,
for (size_t i = 0; i < n; i++)
V[DT.lab1[i]] = Tidx(i);
#ifdef TIMINGS
os << "|TRACES_GetCanonicalOrdering_Arr|=" << time << "\n";
os << "|TRA: TRACES_GetCanonicalOrdering_Arr|=" << time << "\n";
#endif
return V;
}
Expand Down Expand Up @@ -256,7 +256,7 @@ TRACES_GetCanonicalOrdering(Tgr const &eGR, [[maybe_unused]] std::ostream &os) {
SG_FREE(sg1);
SG_FREE(cg1);
#ifdef TIMINGS
os << "|TRACES_GetCanonicalOrdering|=" << time << "\n";
os << "|TRA: TRACES_GetCanonicalOrdering|=" << time << "\n";
#endif
return V;
}
Expand Down Expand Up @@ -304,7 +304,7 @@ TRACES_GetListGenerators_Arr(DataTraces &DT, size_t const &n_last,
freeschreier(NULL, &gens);
schreier_freedyn();
#ifdef TIMINGS
os << "|TRACES_GetListGenerators_Arr|=" << time << "\n";
os << "|TRA: TRACES_GetListGenerators_Arr|=" << time << "\n";
#endif
return ListGen;
}
Expand Down Expand Up @@ -389,7 +389,7 @@ TRACES_GetListGenerators(Tgr const &eGR, size_t const &n_last,
DYNFREE(orbits, orbits_sz);
SG_FREE(sg1);
#ifdef TIMINGS
os << "|TRACES_GetListGenerators|=" << time << "\n";
os << "|TRA: TRACES_GetListGenerators|=" << time << "\n";
#endif
return ListGen;
}
Expand Down Expand Up @@ -433,7 +433,7 @@ TRACES_GetCanonicalOrdering_ListGenerators_Arr(
freeschreier(NULL, &gens);
schreier_freedyn();
#ifdef TIMINGS
os << "|TRACES_GetCanonicalOrdering_ListGenerators_Arr|=" << time << "\n";
os << "|TRA: TRACES_GetCanonicalOrdering_ListGenerators_Arr|=" << time << "\n";
#endif
return {std::move(V), std::move(ListGen)};
}
Expand Down Expand Up @@ -526,7 +526,7 @@ TRACES_GetCanonicalOrdering_ListGenerators(Tgr const &eGR, size_t n_last,
SG_FREE(sg1);
SG_FREE(cg1);
#ifdef TIMINGS
os << "|TRACES_GetCanonicalOrdering_ListGenerators|=" << time << "\n";
os << "|TRA: TRACES_GetCanonicalOrdering_ListGenerators|=" << time << "\n";
#endif
return {std::move(V), std::move(ListGen)};
}
Expand Down
62 changes: 31 additions & 31 deletions src_svg/SVGfunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ coor operator-(coor const &c1, coor const &c2) {
return {c1.x - c2.x, c1.y - c2.y};
}

std::ostream &operator<<(std::ostream &os, coor const &obj) {
os << "(" << obj.x << "," << obj.y << ")";
std::ostream &operator<<(std::ostream &os_out, coor const &obj) {
os_out << "(" << obj.x << "," << obj.y << ")";
return os;
}

Expand Down Expand Up @@ -346,71 +346,71 @@ void GeneralWriteSVGfile(std::string const &eFile,
//
// First the preamble
//
std::ofstream os(eFile);
os << std::fixed;
os << std::setprecision(9);
os << "<svg height=\"" << height << "\" width=\"" << width << "\">\n";
std::ofstream os_out(eFile);
os_out << std::fixed;
os_out << std::setprecision(9);
os_out << "<svg height=\"" << height << "\" width=\"" << width << "\">\n";
//
// Now the major loop for the data printing
//
for (auto &eGeneral : eSVGplot.ListGeneral) {
if (eGeneral.svgtype == SvgType::clip) {
os << " <defs>\n";
os << " <clipPath id=\"" << eGeneral.clip.name << "\">\n";
os << " <rect x=\"" << eGeneral.clip.x << "\" y=\""
os_out << " <defs>\n";
os_out << " <clipPath id=\"" << eGeneral.clip.name << "\">\n";
os_out << " <rect x=\"" << eGeneral.clip.x << "\" y=\""
<< eGeneral.clip.y << "\" width=\"" << eGeneral.clip.width
<< "\" height=\"" << eGeneral.clip.height << "\" />\n";
os << " </clipPath>\n";
os << " </defs>\n";
os_out << " </clipPath>\n";
os_out << " </defs>\n";
}
if (eGeneral.svgtype == SvgType::line) {
coor ePt = eGeneral.line.ePt;
coor fPt = eGeneral.line.fPt;
os << " <line x1=\"" << GetStringValueX(ePt.x) << "\" y1=\""
os_out << " <line x1=\"" << GetStringValueX(ePt.x) << "\" y1=\""
<< GetStringValueY(ePt.y) << "\" x2=\"" << GetStringValueX(fPt.x)
<< "\" y2=\"" << GetStringValueY(fPt.y) << "\" "
<< GetQualityString(eGeneral.line.eQual) << " />\n";
}
if (eGeneral.svgtype == SvgType::polyline) {
os << "<polyline points=\"";
os_out << "<polyline points=\"";
bool IsFirst = true;
for (auto &ePt : eGeneral.polyline.ListCoor) {
if (!IsFirst)
os << " ";
os_out << " ";
IsFirst = false;
os << GetStringValueX(ePt.x) << "," << GetStringValueY(ePt.y);
os_out << GetStringValueX(ePt.x) << "," << GetStringValueY(ePt.y);
}
os << "\" " << GetQualityStringPolyline(eGeneral.polyline.eQual)
os_out << "\" " << GetQualityStringPolyline(eGeneral.polyline.eQual)
<< " />\n";
}
if (eGeneral.svgtype == SvgType::bezier) {
auto eBez = eGeneral.bezier;
os << " <path d=\"M" << GetStringPair(eBez.pointM) << " C "
os_out << " <path d=\"M" << GetStringPair(eBez.pointM) << " C "
<< GetStringPair(eBez.pointC) << ", " << GetStringPair(eBez.point1)
<< ", " << GetStringPair(eBez.point2) << "\" fill=\"none\" "
<< GetQualityString(eBez.eQual) << " />\n";
}
if (eGeneral.svgtype == SvgType::ellipse) {
auto eEll = eGeneral.ellipse;
os << " <ellipse";
os << " cx=\"" << GetStringValueX(eEll.c.x) << "\"";
os << " cy=\"" << GetStringValueY(eEll.c.y) << "\"";
os << " rx=\"" << GetStringValue(eEll.r.x, 0) << "\"";
os << " ry=\"" << GetStringValue(eEll.r.y, 0) << "\"";
os << " " << GetQualityStringEllipse(eEll.eQual);
os << " />\n";
os_out << " <ellipse";
os_out << " cx=\"" << GetStringValueX(eEll.c.x) << "\"";
os_out << " cy=\"" << GetStringValueY(eEll.c.y) << "\"";
os_out << " rx=\"" << GetStringValue(eEll.r.x, 0) << "\"";
os_out << " ry=\"" << GetStringValue(eEll.r.y, 0) << "\"";
os_out << " " << GetQualityStringEllipse(eEll.eQual);
os_out << " />\n";
}
if (eGeneral.svgtype == SvgType::text) {
auto eText = eGeneral.text;
os << " <text";
os << " x=\"" << GetStringValueX(eText.point.x) << "\"";
os << " y=\"" << GetStringValueY(eText.point.y) << "\"";
os << " font-size=\"" << eText.Size << "\"";
os << " fill=\"" << StringColor(eText.color) << "\">";
os << eText.string << "</text>\n";
os_out << " <text";
os_out << " x=\"" << GetStringValueX(eText.point.x) << "\"";
os_out << " y=\"" << GetStringValueY(eText.point.y) << "\"";
os_out << " font-size=\"" << eText.Size << "\"";
os_out << " fill=\"" << StringColor(eText.color) << "\">";
os_out << eText.string << "</text>\n";
}
}
os << "</svg>\n";
os_out << "</svg>\n";
}

// clang-format off
Expand Down

0 comments on commit eae0bd8

Please sign in to comment.