Skip to content

Commit a6904f1

Browse files
committed
conflicting class names
1 parent b00315a commit a6904f1

File tree

21 files changed

+330
-330
lines changed

21 files changed

+330
-330
lines changed

include/maxplus/algebra/mpmatrix.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050

5151
namespace MaxPlus {
5252

53-
class CString;
53+
class MPString;
5454

5555
using namespace Graphs;
5656

@@ -76,7 +76,7 @@ class Vector {
7676

7777
void put(unsigned int row, MPTime value);
7878

79-
void toString(CString &outString, CDouble scale = 1.0) const;
79+
void toString(MPString &outString, CDouble scale = 1.0) const;
8080

8181
Vector(const Vector &);
8282

@@ -206,9 +206,9 @@ class Matrix {
206206
*/
207207
void addCols(uint n);
208208

209-
void toString(CString &outString, CDouble scale = 1.0) const;
210-
void toMatlabString(CString &outString, CDouble scale = 1.0) const;
211-
void toLaTeXString(CString &outString, CDouble scale = 1.0) const;
209+
void toString(MPString &outString, CDouble scale = 1.0) const;
210+
void toMatlabString(MPString &outString, CDouble scale = 1.0) const;
211+
void toLaTeXString(MPString &outString, CDouble scale = 1.0) const;
212212

213213
// Algebraic operations.
214214
[[nodiscard]] Matrix add(MPTime increase) const;
@@ -310,7 +310,7 @@ class VectorList : private std::vector<std::unique_ptr<Vector>> {
310310

311311
void grow(); // append one vector place
312312

313-
void toString(CString &outString, CDouble scale = 1.0) const;
313+
void toString(MPString &outString, CDouble scale = 1.0) const;
314314

315315
// bool findSimilar(const Vector& vec, CDouble threshold) const;
316316
// similar - differs by a constant within a threshold

include/maxplus/algebra/mpsparsematrix.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
#include "mptype.h"
4545
#include <vector>
4646

47-
class CString;
47+
class MPString;
4848

4949
namespace MaxPlus {
5050

@@ -87,7 +87,7 @@ class SparseVector {
8787
void putAll(unsigned int startRow, unsigned int endRow, MPTime value);
8888
void insertVector(unsigned int startRow, const SparseVector &v);
8989

90-
void toString(CString &outString, CDouble scale = 1.0) const;
90+
void toString(MPString &outString, CDouble scale = 1.0) const;
9191

9292
SparseVector &operator=(const SparseVector &);
9393

@@ -188,7 +188,7 @@ class SparseMatrix {
188188

189189
void compress();
190190

191-
void toString(CString &outString, CDouble scale = 1.0) const;
191+
void toString(MPString &outString, CDouble scale = 1.0) const;
192192

193193
MPTime mpEigenvalue();
194194

include/maxplus/algebra/mptype.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@ namespace MaxPlus {
5757
using MPThroughput = CDouble;
5858

5959
class MPTime;
60-
CString timeToString(MPTime val);
60+
MPString timeToString(MPTime val);
6161

6262
class MPTime {
6363
public:
6464
explicit MPTime(CDouble val = MPTIME_MAXVAL) : myVal(val) {}
6565

6666
explicit operator CDouble() const { return myVal; }
67-
explicit operator CString() const { return timeToString(*this); }
67+
explicit operator MPString() const { return timeToString(*this); }
6868
MPTime &operator-();
6969
MPTime &operator+=(MPTime a);
7070
MPTime &operator-=(MPTime a);
@@ -206,26 +206,26 @@ inline MPTime MPTime::fabs() const { return MPTime(std::fabs(this->myVal)); }
206206
// toString
207207
//==============================
208208

209-
inline CString timeToString(MPTime val) {
209+
inline MPString timeToString(MPTime val) {
210210
// We intentionally dont use isMinusInfinity() here,
211211
// so that we can expose the unwanted "impure" infinities here.
212212
//
213213
if (static_cast<CDouble>(val) == MPTIME_MIN_INF_VAL) {
214-
return CString("-mp_inf");
214+
return MPString("-mp_inf");
215215
}
216-
return CString(static_cast<CDouble>(val));
216+
return MPString(static_cast<CDouble>(val));
217217
}
218-
inline CString timeToMatlabString(MPTime val) {
218+
inline MPString timeToMatlabString(MPTime val) {
219219
if (val.isMinusInfinity()) {
220-
return CString("-Inf");
220+
return MPString("-Inf");
221221
}
222-
return CString(static_cast<CDouble>(val));
222+
return MPString(static_cast<CDouble>(val));
223223
}
224-
inline CString timeToLaTeXString(MPTime val) {
224+
inline MPString timeToLaTeXString(MPTime val) {
225225
if (val.isMinusInfinity()) {
226-
return CString("-\\infty{}");
226+
return MPString("-\\infty{}");
227227
}
228-
return CString(static_cast<CDouble>(val));
228+
return MPString(static_cast<CDouble>(val));
229229
}
230230

231231
} // namespace MaxPlus

include/maxplus/base/exception/exception.h

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -48,39 +48,39 @@
4848
namespace MaxPlus {
4949

5050
/*
51-
* CException
52-
* CException container class.
51+
* MPException
52+
* MPException container class.
5353
*/
54-
class CException : std::exception {
54+
class MPException : std::exception {
5555
private:
56-
CString message;
57-
CString cause;
56+
MPString message;
57+
MPString cause;
5858

5959
public:
6060
// Constructor
61-
explicit CException(const CString &message) : message(message) {}
61+
explicit MPException(const MPString &message) : message(message) {}
6262

63-
CException(const CString &message, CException &e) : message(message) {
63+
MPException(const MPString &message, MPException &e) : message(message) {
6464
cause = " caused by: " + e.getMessage();
6565
if (!e.getCause().empty()) {
6666
cause += "\n" + e.getCause();
6767
}
6868
}
6969

70-
CException(const CException &e) : message(e.getMessage()), cause(e.getCause()) {}
70+
MPException(const MPException &e) : message(e.getMessage()), cause(e.getCause()) {}
7171

7272
// Destructor
73-
~CException() override = default;
73+
~MPException() override = default;
7474

75-
CException &operator=(const CException &other) = delete;
76-
CException(CException &&) = delete;
77-
CException &operator=(CException &&) = delete;
75+
MPException &operator=(const MPException &other) = delete;
76+
MPException(MPException &&) = delete;
77+
MPException &operator=(MPException &&) = delete;
7878

7979
// Message
80-
[[nodiscard]] CString getMessage() const { return message; }
80+
[[nodiscard]] MPString getMessage() const { return message; }
8181

8282
// Cause
83-
[[nodiscard]] CString getCause() const { return cause; }
83+
[[nodiscard]] MPString getCause() const { return cause; }
8484

8585
// Report
8686
std::ostream &report(std::ostream &stream) const {
@@ -94,23 +94,23 @@ class CException : std::exception {
9494
return stream;
9595
}
9696

97-
friend std::ostream &operator<<(std::ostream &stream, const CException &e);
97+
friend std::ostream &operator<<(std::ostream &stream, const MPException &e);
9898
};
9999

100100
} // namespace MaxPlus
101101

102102
#define ASSERT(condition, msg) \
103103
{ \
104104
if (!(condition)) \
105-
throw MaxPlus::CException(MaxPlus::CString(__FILE__) + MaxPlus::CString(":") + MaxPlus::CString(__LINE__) + MaxPlus::CString(": ") \
106-
+ MaxPlus::CString(msg)); \
105+
throw MaxPlus::MPException(MaxPlus::MPString(__FILE__) + MaxPlus::MPString(":") + MaxPlus::MPString(__LINE__) + MaxPlus::MPString(": ") \
106+
+ MaxPlus::MPString(msg)); \
107107
}
108108

109109
#define EXCEPTION(msg, ...) \
110110
{ \
111111
char buf[1024]; \
112112
sprintf(&buf[0], msg, __VA_ARGS__); \
113-
throw CException(buf); \
113+
throw MPException(buf); \
114114
}
115115

116116
#endif

include/maxplus/base/fraction/fraction.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ class CFraction {
6666
CDoubleToFraction(v, INFINITY);
6767
};
6868

69-
explicit CFraction(CString &f) {
70-
if (f.find('/') == CString::npos) {
69+
explicit CFraction(MPString &f) {
70+
if (f.find('/') == MPString::npos) {
7171
num = std::int64_t(f);
7272
den = 1;
7373
} else {
74-
num = std::int64_t(CString(f.substr(0, f.find('/'))));
75-
den = std::int64_t(CString(f.substr(f.find('/') + 1)));
74+
num = std::int64_t(MPString(f.substr(0, f.find('/'))));
75+
den = std::int64_t(MPString(f.substr(f.find('/') + 1)));
7676
}
7777
val = static_cast<CDouble>(num) / static_cast<CDouble>(den);
7878
};

include/maxplus/base/fsm/fsm.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ class SetOfStates : public Abstract::SetOfStates {
379379
if (this->labelIndex.find(l) != this->labelIndex.end()) {
380380
return *this->labelIndex[l];
381381
}
382-
throw MaxPlus::CException("error - state not found in FiniteStateMachine::_withLabel");
382+
throw MaxPlus::MPException("error - state not found in FiniteStateMachine::_withLabel");
383383
}
384384

385385
bool hasStateWithLabel(StateLabelType l) {
@@ -544,7 +544,7 @@ class FiniteStateMachine : public Abstract::FiniteStateMachine {
544544

545545
[[nodiscard]] StateRef<StateLabelType, EdgeLabelType> getInitialState() const override {
546546
if (this->initialStates.empty()) {
547-
throw MaxPlus::CException("FSM has no initial state.");
547+
throw MaxPlus::MPException("FSM has no initial state.");
548548
}
549549
auto s = this->initialStates.begin();
550550
return dynamic_cast<StateRef<StateLabelType, EdgeLabelType>>(*s);
@@ -955,34 +955,34 @@ namespace StateStringLabeled {
955955
// make an FSM class with unlabeled edges, based on the labeled one with some dummy char labels
956956
//
957957

958-
class State : public Labeled::State<MaxPlus::CString, char> {
958+
class State : public Labeled::State<MaxPlus::MPString, char> {
959959
public:
960-
explicit State(const MaxPlus::CString &withLabel) : Labeled::State<MaxPlus::CString, char>(withLabel) {}
960+
explicit State(const MaxPlus::MPString &withLabel) : Labeled::State<MaxPlus::MPString, char>(withLabel) {}
961961

962962
const Abstract::SetOfEdgeRefs &getOutgoingEdges() {
963963
return dynamic_cast<const Abstract::SetOfEdgeRefs &>(
964-
Labeled::State<MaxPlus::CString, char>::getOutgoingEdges());
964+
Labeled::State<MaxPlus::MPString, char>::getOutgoingEdges());
965965
}
966966
};
967967

968-
class FiniteStateMachine : public Labeled::FiniteStateMachine<MaxPlus::CString, char> {
968+
class FiniteStateMachine : public Labeled::FiniteStateMachine<MaxPlus::MPString, char> {
969969
public:
970-
[[nodiscard]] Labeled::StateRef<MaxPlus::CString, char> getInitialState() const override {
971-
return dynamic_cast<Labeled::StateRef<MaxPlus::CString, char>>(Labeled::FiniteStateMachine<MaxPlus::CString, char>::getInitialState());
970+
[[nodiscard]] Labeled::StateRef<MaxPlus::MPString, char> getInitialState() const override {
971+
return dynamic_cast<Labeled::StateRef<MaxPlus::MPString, char>>(Labeled::FiniteStateMachine<MaxPlus::MPString, char>::getInitialState());
972972
};
973973

974-
void setInitialStateLabeled(const MaxPlus::CString &sl);
974+
void setInitialStateLabeled(const MaxPlus::MPString &sl);
975975

976-
void addStateLabeled(const MaxPlus::CString &sl);
976+
void addStateLabeled(const MaxPlus::MPString &sl);
977977

978978
void addEdge(State *src, State *dst);
979979

980-
void addEdgeLabeled(const MaxPlus::CString &src, const MaxPlus::CString &dst);
980+
void addEdgeLabeled(const MaxPlus::MPString &src, const MaxPlus::MPString &dst);
981981

982982
std::shared_ptr<Abstract::SetOfStateRefs> reachableStates();
983983
};
984984

985-
class Edge : public Labeled::Edge<MaxPlus::CString, char> {};
985+
class Edge : public Labeled::Edge<MaxPlus::MPString, char> {};
986986
} // namespace StateStringLabeled
987987

988988
namespace Product {

include/maxplus/base/fsm/iofsm.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77
#include <utility>
88

99
// Input/Output Automaton
10-
using InputAction = MaxPlus::CString;
11-
using OutputAction = MaxPlus::CString;
10+
using InputAction = MaxPlus::MPString;
11+
using OutputAction = MaxPlus::MPString;
1212
using IOAEdgeLabel = std::pair<InputAction, OutputAction>;
1313
using IOAState = ::FSM::Labeled::State<CId, IOAEdgeLabel>;
1414
using IOAStateRef = const IOAState*;
1515
using IOAEdge = ::FSM::Labeled::Edge<CId, IOAEdgeLabel>;
1616
using IOAEdgeRef = ::FSM::Labeled::EdgeRef<CId, IOAEdgeLabel>;
17-
using IOASetOfStates = ::FSM::Labeled::SetOfStates<CId, MaxPlus::CString>;
18-
using IOASetOfStateRefs = ::FSM::Labeled::SetOfStateRefs<CId, MaxPlus::CString>;
19-
using IOASetOfEdges = ::FSM::Labeled::SetOfEdges<CId, MaxPlus::CString>;
17+
using IOASetOfStates = ::FSM::Labeled::SetOfStates<CId, MaxPlus::MPString>;
18+
using IOASetOfStateRefs = ::FSM::Labeled::SetOfStateRefs<CId, MaxPlus::MPString>;
19+
using IOASetOfEdges = ::FSM::Labeled::SetOfEdges<CId, MaxPlus::MPString>;
2020
using IOASetOfEdgeRefs = ::FSM::Abstract::SetOfEdgeRefs;
2121

2222
namespace FSM::Labeled {

0 commit comments

Comments
 (0)