Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Kalashnikovni committed Nov 21, 2023
1 parent 9e4fee3 commit 4be3206
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 19 deletions.
6 changes: 3 additions & 3 deletions sbg/info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ std::ostream &operator<<(std::ostream &out, const DeclRanged &dr)
if (sz > 0) {
out << "[";
unsigned int j = 0;
for (; j < sz - 1; j++) {
for (; j < sz - 1; ++j) {
out << cardinal(mdi[j]) << ", ";
}
out << cardinal(mdi[j]);
Expand Down Expand Up @@ -95,7 +95,7 @@ std::ostream &operator<<(std::ostream &out, const UseRanged &ur)
if (sz > 0) {
out << "[";
unsigned int j = 0;
for (; j < sz - 1; j++) out << mdle[j] << ", ";
for (; j < sz - 1; ++j) out << mdle[j] << ", ";
out << mdle[j];
out << "]";
}
Expand Down Expand Up @@ -128,7 +128,7 @@ std::ostream &operator<<(std::ostream &out, const RangedExpr &re)
out << "for ";

unsigned int j = 0;
for (; j < sz - 1; j++) out << iterators[j] << " in " << mdi[j] << ", ";
for (; j < sz - 1; ++j) out << iterators[j] << " in " << mdi[j] << ", ";
out << iterators[j] << " in " << mdi[j];

out << " loop\n" << re.expr() << "\nend for;";
Expand Down
2 changes: 1 addition & 1 deletion sbg/interval.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ Interval intersection(Interval i1, Interval i2)
, new_begin = max_begin
, new_end = std::min(i1.end(), i2.end());
bool found_member = false;
for (NAT x = max_begin; x < max_begin + new_step; x++)
for (NAT x = max_begin; x < max_begin + new_step; ++x)
if (isMember(x, i1) && isMember(x, i2)) {
new_begin = x;
found_member = true;
Expand Down
4 changes: 2 additions & 2 deletions sbg/multidim_lexp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ MDLExp::MDLExp(Util::MD_NAT x)
MDLExp::MDLExp(unsigned int dimensions) : exps_() {
Util::ERROR_UNLESS(dimensions > 0, "LIB::MDLE2: empty not allowed");

for (unsigned int j = 0; j < dimensions; j++)
for (unsigned int j = 0; j < dimensions; ++j)
exps_.emplace_back(LExp());
}
MDLExp::MDLExp(LExp le) : exps_() { exps_.emplace_back(le); }
MDLExp::MDLExp(unsigned int nmbr_copies, LExp le) : exps_()
{
Util::ERROR_UNLESS(nmbr_copies > 0, "LIB::MDLE3: empty not allowed");

for (unsigned int j = 0; j < nmbr_copies; j++)
for (unsigned int j = 0; j < nmbr_copies; ++j)
exps_.emplace_back(le);
}
MDLExp::MDLExp(LExpVector v) : exps_(v) {}
Expand Down
4 changes: 2 additions & 2 deletions sbg/ord_pw_mdinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ OrdPWMDInter complementAtom(OrdPWMDInter pwi)

// "During" interval
if (i.begin() < Util::Inf) {
for (Util::NAT j = 1; j < i.step(); j++) {
for (Util::NAT j = 1; j < i.step(); ++j) {
Interval i_res(i.begin() + j, i.step(), i.end());
if (!isEmpty(i_res))
c.emplaceBack(SetPiece(i_res));
Expand Down Expand Up @@ -440,7 +440,7 @@ MDInterOrdSet boundedTraverse(OrdPWMDInter pwi1
MDInterOrdSetIt end1 = pwi1.end(), end2 = pwi2.end();

SetPiece mdi1, mdi2;
for (int j = 0; it1 != end1 && it2 != end2; j++) {
for (int j = 0; it1 != end1 && it2 != end2; ++j) {
mdi1 = *it1;
mdi2 = *it2;

Expand Down
12 changes: 6 additions & 6 deletions sbg/pw_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ SBGMap<Set> &PWMap<Set>::operator[](std::size_t n)
, "LIB::PWMap::operator[]: invalid n");

auto first = maps_.begin();
for (unsigned int j = 0; j < n; j++)
first++;
for (unsigned int j = 0; j < n; ++j)
++first;
return *first;
}

Expand All @@ -133,8 +133,8 @@ const SBGMap<Set> &PWMap<Set>::operator[](std::size_t n) const
, "LIB::PWMap::operator[]: invalid n");

auto first = maps_.begin();
for (unsigned int j = 0; j < n; j++)
first++;
for (unsigned int j = 0; j < n; ++j)
++first;
return *first;
}

Expand Down Expand Up @@ -291,7 +291,7 @@ PWMap<Set> mapInf(PWMap<Set> pw, unsigned int n)

Set pw_dom = dom(pw);
if (!isEmpty(pw_dom)) {
for (unsigned int j = 0; !(old_res == res) && j < n; j++) {
for (unsigned int j = 0; !(old_res == res) && j < n; ++j) {
old_res = res;
res = composition(res, pw);
}
Expand Down Expand Up @@ -557,7 +557,7 @@ PWMap<Set> minMap(SetPiece dom_piece, Exp e1, Exp e2, Exp e3, Exp e4)
}

aux_dom = dom_piece;
j++;
++j;
}
}

Expand Down
2 changes: 1 addition & 1 deletion sbg/sbg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ SBGraph<Set> copy(unsigned int times, SBGraph<Set> g)
off.emplaceBack(LExp(0, o));
}

for (unsigned int j = 0; j < times; j++) {
for (unsigned int j = 0; j < times; ++j) {
if (j > 0) {
V_new = concatenation(V_new, V_ith);
Vmap_new = concatenation(Vmap_new, Vmap_ith);
Expand Down
2 changes: 1 addition & 1 deletion sbg/sbg_algorithms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ PathInfo<Set> MinReach<Set>::calculate(Set unmatched_V)
old_semap_nth = semap_nth;
semap_nth = composition(new_semap, semap_nth);

j++;
++j;
} while (isEmpty(ER) && j < nmbrSV(dg)
&& !(old_semap_nth == semap_nth));
ER = intersection(ER, Ec);
Expand Down
6 changes: 3 additions & 3 deletions sbg/unord_pw_mdinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ SetPiece UnordPWMDInter::operator[](std::size_t n)

iterator it_res = pieces_.begin();

for (unsigned int j = 0; j < n; j++)
for (unsigned int j = 0; j < n; ++j)
++it_res;

return *it_res;
Expand All @@ -102,7 +102,7 @@ const SetPiece &UnordPWMDInter::operator[](std::size_t n) const

iterator it_res = pieces_.begin();

for (unsigned int j = 0; j < n; j++)
for (unsigned int j = 0; j < n; ++j)
++it_res;

return *it_res;
Expand Down Expand Up @@ -284,7 +284,7 @@ UnordPWMDInter complementAtom(UnordPWMDInter pwi)

// "During" interval
if (i.begin() < Util::Inf) {
for (Util::NAT j = 1; j < i.step(); j++) {
for (Util::NAT j = 1; j < i.step(); ++j) {
Interval i_res(i.begin() + j, i.step(), i.end());
if (!isEmpty(i_res)) {
all[dim] = i_res;
Expand Down
1 change: 1 addition & 0 deletions util/defs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ void MD_NAT::emplace_back(NAT x) { value_.emplace_back(x); }
void MD_NAT::push_back(NAT x) { emplace_back(x); }

NAT &MD_NAT::operator[](std::size_t n) { return value_[n]; }
const NAT &MD_NAT::operator[](std::size_t n) const { return value_[n]; }

bool MD_NAT::operator==(const MD_NAT &md) const
{
Expand Down
1 change: 1 addition & 0 deletions util/defs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ struct MD_NAT {
void push_back(NAT x);

NAT &operator[](std::size_t n);
const NAT &operator[](std::size_t n) const;

eq_class(MD_NAT);
lt_class(MD_NAT);
Expand Down

0 comments on commit 4be3206

Please sign in to comment.