Skip to content

Commit f7f79a4

Browse files
committed
A lot of cleaning up following the recent merge (see commit 5246a31).
1 parent 5246a31 commit f7f79a4

File tree

75 files changed

+3831
-3827
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+3831
-3827
lines changed

src/analyser.cpp

Lines changed: 84 additions & 84 deletions
Large diffs are not rendered by default.

src/analyser_p.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ struct AnalyserInternalEquation
125125
bool variableOnRhs(const AnalyserInternalVariablePtr &variable);
126126
bool variableOnLhsOrRhs(const AnalyserInternalVariablePtr &variable);
127127

128-
bool check(const AnalyserModelPtr &model, bool checkNlaSystems);
128+
bool check(const AnalyserModelPtr &analyserModel, bool checkNlaSystems);
129129
};
130130

131131
/**
@@ -152,7 +152,7 @@ class Analyser::AnalyserImpl: public Logger::LoggerImpl
152152

153153
Analyser *mAnalyser = nullptr;
154154

155-
AnalyserModelPtr mModel = AnalyserModel::AnalyserModelImpl::create();
155+
AnalyserModelPtr mAnalyserModel = AnalyserModel::AnalyserModelImpl::create();
156156

157157
AnalyserExternalVariablePtrs mExternalVariables;
158158

@@ -178,8 +178,8 @@ class Analyser::AnalyserImpl: public Logger::LoggerImpl
178178
void analyseComponent(const ComponentPtr &component);
179179
void analyseComponentVariables(const ComponentPtr &component);
180180

181-
void doEquivalentVariables(const VariablePtr &variable,
182-
VariablePtrs &equivalentVariables) const;
181+
void equivalentVariables(const VariablePtr &variable,
182+
VariablePtrs &equivalentVariables) const;
183183
VariablePtrs equivalentVariables(const VariablePtr &variable) const;
184184

185185
void analyseEquationAst(const AnalyserEquationAstPtr &ast);
@@ -247,7 +247,7 @@ class Analyser::AnalyserImpl: public Logger::LoggerImpl
247247

248248
static bool isExternalVariable(const AnalyserInternalVariablePtr &variable);
249249

250-
bool isStateRateBased(const AnalyserEquationPtr &equation,
250+
bool isStateRateBased(const AnalyserEquationPtr &analyserEquation,
251251
AnalyserEquationPtrs &checkedEquations);
252252

253253
void addInvalidVariableIssue(const AnalyserInternalVariablePtr &variable,

src/analysermodel.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -231,46 +231,46 @@ AnalyserVariablePtr AnalyserModel::externalVariable(size_t index) const
231231
return mPimpl->mExternalVariables[index];
232232
}
233233

234-
AnalyserVariablePtr AnalyserModel::variable(const VariablePtr &variable)
234+
AnalyserVariablePtr AnalyserModel::analyserVariable(const VariablePtr &variable)
235235
{
236236
if (!isValid() || (variable == nullptr)) {
237237
return {};
238238
}
239239

240-
for (const auto &modelVariable : variables(shared_from_this())) {
241-
if (areEquivalentVariables(variable, modelVariable->variable())) {
242-
return modelVariable;
240+
for (const auto &analyserVariable : analyserVariables(shared_from_this())) {
241+
if (areEquivalentVariables(variable, analyserVariable->variable())) {
242+
return analyserVariable;
243243
}
244244
}
245245

246246
return {};
247247
}
248248

249-
size_t AnalyserModel::equationCount() const
249+
size_t AnalyserModel::analyserEquationCount() const
250250
{
251251
if (!isValid()) {
252252
return 0;
253253
}
254254

255-
return mPimpl->mEquations.size();
255+
return mPimpl->mAnalyserEquations.size();
256256
}
257257

258-
std::vector<AnalyserEquationPtr> AnalyserModel::equations() const
258+
std::vector<AnalyserEquationPtr> AnalyserModel::analyserEquations() const
259259
{
260260
if (!isValid()) {
261261
return {};
262262
}
263263

264-
return mPimpl->mEquations;
264+
return mPimpl->mAnalyserEquations;
265265
}
266266

267-
AnalyserEquationPtr AnalyserModel::equation(size_t index) const
267+
AnalyserEquationPtr AnalyserModel::analyserEquation(size_t index) const
268268
{
269-
if (!isValid() || (index >= mPimpl->mEquations.size())) {
269+
if (!isValid() || (index >= mPimpl->mAnalyserEquations.size())) {
270270
return {};
271271
}
272272

273-
return mPimpl->mEquations[index];
273+
return mPimpl->mAnalyserEquations[index];
274274
}
275275

276276
bool AnalyserModel::needEqFunction() const

src/analysermodel_p.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ struct AnalyserModel::AnalyserModelImpl
4141
std::vector<AnalyserVariablePtr> mAlgebraicVariables;
4242
std::vector<AnalyserVariablePtr> mExternalVariables;
4343

44-
std::vector<AnalyserEquationPtr> mEquations;
44+
std::vector<AnalyserEquationPtr> mAnalyserEquations;
4545

4646
bool mNeedEqFunction = false;
4747
bool mNeedNeqFunction = false;

src/analyservariable.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,21 @@ void AnalyserVariable::AnalyserVariableImpl::populate(AnalyserVariable::Type typ
3434
size_t index,
3535
const VariablePtr &initialisingVariable,
3636
const VariablePtr &variable,
37-
const AnalyserModelPtr &model,
38-
const std::vector<AnalyserEquationPtr> &equations)
37+
const AnalyserModelPtr &analyserModel,
38+
const std::vector<AnalyserEquationPtr> &analyserEquations)
3939
{
4040
mType = type;
4141
mIndex = index;
4242
mInitialisingVariable = initialisingVariable;
4343
mVariable = variable;
44-
mModel = model;
44+
mAnalyserModel = analyserModel;
4545

46-
std::copy(equations.begin(), equations.end(), back_inserter(mEquations));
46+
std::copy(analyserEquations.begin(), analyserEquations.end(), back_inserter(mAnalyserEquations));
4747
}
4848

4949
bool AnalyserVariable::AnalyserVariableImpl::constantWithDummyEquation() const
5050
{
51-
return (mType == Type::CONSTANT) && (mEquations.front().lock() == nullptr);
51+
return (mType == Type::CONSTANT) && (mAnalyserEquations.front().lock() == nullptr);
5252
}
5353

5454
AnalyserVariable::AnalyserVariable()
@@ -96,44 +96,44 @@ VariablePtr AnalyserVariable::variable() const
9696

9797
AnalyserModelPtr AnalyserVariable::model() const
9898
{
99-
return mPimpl->mModel.lock();
99+
return mPimpl->mAnalyserModel.lock();
100100
}
101101

102102
// Note: our equation-related methods must account for the fact that a constant initialised using the `initial_value`
103103
// attribute (rather than through an equation; e.g. x = 3) will have a dummy equation associated with it which
104104
// we don't want to be accessible, hence the calls to constantWithDummyEquation() in the following methods.
105105

106-
size_t AnalyserVariable::equationCount() const
106+
size_t AnalyserVariable::analyserEquationCount() const
107107
{
108108
if (mPimpl->constantWithDummyEquation()) {
109109
return 0;
110110
}
111111

112-
return mPimpl->mEquations.size();
112+
return mPimpl->mAnalyserEquations.size();
113113
}
114114

115-
std::vector<AnalyserEquationPtr> AnalyserVariable::equations() const
115+
std::vector<AnalyserEquationPtr> AnalyserVariable::analyserEquations() const
116116
{
117117
if (mPimpl->constantWithDummyEquation()) {
118118
return {};
119119
}
120120

121121
std::vector<AnalyserEquationPtr> res;
122122

123-
for (const auto &equation : mPimpl->mEquations) {
124-
res.push_back(equation.lock());
123+
for (const auto &analyserEquation : mPimpl->mAnalyserEquations) {
124+
res.push_back(analyserEquation.lock());
125125
}
126126

127127
return res;
128128
}
129129

130-
AnalyserEquationPtr AnalyserVariable::equation(size_t index) const
130+
AnalyserEquationPtr AnalyserVariable::analyserEquation(size_t index) const
131131
{
132-
if (mPimpl->constantWithDummyEquation() || (index >= mPimpl->mEquations.size())) {
132+
if (mPimpl->constantWithDummyEquation() || (index >= mPimpl->mAnalyserEquations.size())) {
133133
return {};
134134
}
135135

136-
return mPimpl->mEquations[index].lock();
136+
return mPimpl->mAnalyserEquations[index].lock();
137137
}
138138

139139
} // namespace libcellml

src/analyservariable_p.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ struct AnalyserVariable::AnalyserVariableImpl
3535
size_t mIndex = 0;
3636
VariablePtr mInitialisingVariable;
3737
VariablePtr mVariable;
38-
AnalyserModelWeakPtr mModel;
39-
std::vector<AnalyserEquationWeakPtr> mEquations;
38+
AnalyserModelWeakPtr mAnalyserModel;
39+
std::vector<AnalyserEquationWeakPtr> mAnalyserEquations;
4040

4141
static AnalyserVariablePtr create();
4242

4343
void populate(AnalyserVariable::Type type, size_t index, const VariablePtr &initialisingVariable,
44-
const VariablePtr &variable, const AnalyserModelPtr &model,
45-
const std::vector<AnalyserEquationPtr> &equations);
44+
const VariablePtr &variable, const AnalyserModelPtr &analyserModel,
45+
const std::vector<AnalyserEquationPtr> &analyserEquations);
4646

4747
bool constantWithDummyEquation() const;
4848
};

src/api/libcellml/analysermodel.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -278,37 +278,37 @@ class LIBCELLML_EXPORT AnalyserModel
278278
*
279279
* @return The analyser variable for the given @p variable on success, @c nullptr on failure.
280280
*/
281-
AnalyserVariablePtr variable(const VariablePtr &variable);
281+
AnalyserVariablePtr analyserVariable(const VariablePtr &variable);
282282

283283
/**
284-
* @brief Get the number of equations.
284+
* @brief Get the number of analyser equations.
285285
*
286-
* Return the number of equations in the @ref AnalyserModel.
286+
* Return the number of analyser equations in the @ref AnalyserModel.
287287
*
288-
* @return The number of equations.
288+
* @return The number of analyser equations.
289289
*/
290-
size_t equationCount() const;
290+
size_t analyserEquationCount() const;
291291

292292
/**
293-
* @brief Get the equations.
293+
* @brief Get the analyser equations.
294294
*
295-
* Return the equations in the @ref AnalyserModel.
295+
* Return the analyser equations in the @ref AnalyserModel.
296296
*
297-
* @return The equations as a @c std::vector.
297+
* @return The analyser equations as a @c std::vector.
298298
*/
299-
std::vector<AnalyserEquationPtr> equations() const;
299+
std::vector<AnalyserEquationPtr> analyserEquations() const;
300300

301301
/**
302-
* @brief Get the equation at @p index.
302+
* @brief Get the analyser equation at @p index.
303303
*
304-
* Return the equation at the index @p index in this @ref AnalyserModel.
304+
* Return the analyser equation at the index @p index in this @ref AnalyserModel.
305305
*
306-
* @param index The index of the equation to return.
306+
* @param index The index of the analyser equation to return.
307307
*
308-
* @return The equation at the given @p index on success, @c nullptr on
308+
* @return The analyser equation at the given @p index on success, @c nullptr on
309309
* failure.
310310
*/
311-
AnalyserEquationPtr equation(size_t index) const;
311+
AnalyserEquationPtr analyserEquation(size_t index) const;
312312

313313
/**
314314
* @brief Test to determine if @ref AnalyserModel needs an "equal to"

0 commit comments

Comments
 (0)