@@ -33,13 +33,13 @@ void EdgeLabeledModeFSM::removeDanglingStates() {
33
33
ELSSetOfStateRefs statesToBeRemoved;
34
34
35
35
// const ELSSetOfStates& elsStates = this->getStates();
36
- auto &elsEdges = dynamic_cast <const ELSSetOfEdges &>(this ->getEdges ());
36
+ const auto &elsEdges = dynamic_cast <const ELSSetOfEdges &>(this ->getEdges ());
37
37
38
38
/* go through all edges and find all edges that end in
39
39
dangling states. Also store dangling states.*/
40
40
for (const auto &it : elsEdges) {
41
41
42
- auto e = dynamic_cast <ELSEdgeRef>(&(*it.second ));
42
+ const auto * e = dynamic_cast <ELSEdgeRef>(&(*it.second ));
43
43
const auto &s = dynamic_cast <ELSStateRef>(e->getDestination ());
44
44
const auto &oEdges = dynamic_cast <const ELSSetOfEdges &>(s->getOutgoingEdges ());
45
45
if (oEdges.empty ()) {
@@ -77,8 +77,8 @@ void EdgeLabeledModeFSM::removeDanglingStates() {
77
77
dangling states. Also store dangling states.*/
78
78
for (const auto &it : elsEdges2) {
79
79
80
- auto e = dynamic_cast <ELSEdgeRef>(&(*(it.second )));
81
- const auto s = dynamic_cast <ELSStateRef>(e->getDestination ());
80
+ const auto * e = dynamic_cast <ELSEdgeRef>(&(*(it.second )));
81
+ const auto * const s = dynamic_cast <ELSStateRef>(e->getDestination ());
82
82
const auto &oEdges = dynamic_cast <const ELSSetOfEdges &>(s->getOutgoingEdges ());
83
83
if (oEdges.empty ()) {
84
84
edgesToBeRemoved.insert (e);
@@ -188,7 +188,7 @@ std::shared_ptr<MaxPlusAutomaton> SMPLS::convertToMaxPlusAutomaton() const {
188
188
auto &q1 = dynamic_cast <ELSState &>(*(q.second ));
189
189
CId q1Id = q1.getLabel ();
190
190
191
- std::map<int , MPAStateRef> q1StateMap;
191
+ std::map<size_t , MPAStateRef> q1StateMap;
192
192
193
193
// for every outgoing edge of the state
194
194
const auto &t = dynamic_cast <const ELSSetOfEdgeRefs &>(q1.getOutgoingEdges ());
@@ -251,7 +251,7 @@ void SMPLSwithEvents::saveDeterminizedIOAtoFile(const MPString &file) {
251
251
252
252
MPString errMsg = " " ;
253
253
auto i = I.begin ();
254
- auto &s = dynamic_cast <const IOAState &>(*(*i));
254
+ const auto &s = dynamic_cast <const IOAState &>(*(*i));
255
255
i++;
256
256
// we remove the rest of the initial states since only one is allowed
257
257
for (; i != I.end ();) {
@@ -310,14 +310,14 @@ std::shared_ptr<MaxPlusAutomaton> SMPLSwithEvents::convertToMaxPlusAutomaton() {
310
310
311
311
const auto &I2 = this ->ioa ->getInitialStates ();
312
312
for (const auto &i : I2) {
313
- auto s = dynamic_cast <IOAStateRef>(i);
313
+ const auto * s = dynamic_cast <IOAStateRef>(i);
314
314
prepareMatrices (*s, eventList, visitedEdges);
315
- auto sr = this ->elsFSM .getStateLabeled (s->getLabel ());
315
+ const auto * sr = this ->elsFSM .getStateLabeled (s->getLabel ());
316
316
this ->elsFSM .addInitialState (*sr);
317
317
}
318
318
const auto &I3 = this ->ioa ->getFinalStates ();
319
319
for (const auto &i : I3) {
320
- auto s = dynamic_cast <IOAStateRef>(i);
320
+ const auto * s = dynamic_cast <IOAStateRef>(i);
321
321
this ->elsFSM .addFinalState (*this ->elsFSM .getStateLabeled (s->getLabel ()));
322
322
}
323
323
return SMPLS::convertToMaxPlusAutomaton ();
@@ -631,7 +631,7 @@ void SMPLSwithEvents::isConsistentUtil(const IOAState &s,
631
631
}
632
632
}
633
633
}
634
- const auto s2 = dynamic_cast <IOAStateRef>(e->getDestination ());
634
+ const auto * const s2 = dynamic_cast <IOAStateRef>(e->getDestination ());
635
635
636
636
isConsistentUtil (*s2, eList, finalStates, errMsg, visited);
637
637
}
@@ -666,7 +666,7 @@ void SMPLSwithEvents::determinizeUtil(const IOAState &s,
666
666
const auto *e = dynamic_cast <const IOAEdge *>(*i);
667
667
InputAction input = e->getLabel ().first ;
668
668
if (input.empty ()) {
669
- const auto s2 = dynamic_cast <IOAStateRef>(e->getDestination ());
669
+ const auto * const s2 = dynamic_cast <IOAStateRef>(e->getDestination ());
670
670
outfile << s.stateLabel << " -," << e->getLabel ().second << " ->" << s2->stateLabel ;
671
671
ioa->removeEdge (*e);
672
672
@@ -702,7 +702,7 @@ void SMPLSwithEvents::determinizeUtil(const IOAState &s,
702
702
} else {
703
703
// only allow edges with the outcome of the same event
704
704
if (this ->findEventByOutcome (input) == ev) {
705
- const auto s2 = dynamic_cast <IOAStateRef>(e->getDestination ());
705
+ const auto * const s2 = dynamic_cast <IOAStateRef>(e->getDestination ());
706
706
outfile << s.stateLabel << " -" << e->getLabel ().first << " ,"
707
707
<< e->getLabel ().second << " ->" << s2->stateLabel ;
708
708
0 commit comments