Commit f72fd283 authored by Hahn, Steven's avatar Hahn, Steven
Browse files

Refs #14988. Ran modernize-loop-convert on API

parent 7ed35139
......@@ -236,8 +236,8 @@ const std::vector<std::string> Algorithm::workspaceMethodOn() const {
Poco::StringTokenizer::TOK_IGNORE_EMPTY);
std::vector<std::string> res;
res.reserve(tokenizer.count());
for (auto iter = tokenizer.begin(); iter != tokenizer.end(); ++iter) {
res.push_back(*iter);
for (const auto &iter : tokenizer) {
res.push_back(iter);
}
return res;
......@@ -315,8 +315,7 @@ void Algorithm::cacheWorkspaceProperties() {
m_outputWorkspaceProps.clear();
m_pureOutputWorkspaceProps.clear();
const std::vector<Property *> &props = this->getProperties();
for (size_t i = 0; i < props.size(); i++) {
Property *prop = props[i];
for (auto prop : props) {
IWorkspaceProperty *wsProp = dynamic_cast<IWorkspaceProperty *>(prop);
if (wsProp) {
switch (prop->direction()) {
......@@ -361,12 +360,12 @@ void Algorithm::lockWorkspaces() {
// First, Write-lock the output workspaces
auto &debugLog = g_log.debug();
for (size_t i = 0; i < m_outputWorkspaceProps.size(); i++) {
Workspace_sptr ws = m_outputWorkspaceProps[i]->getWorkspace();
for (auto &m_outputWorkspaceProp : m_outputWorkspaceProps) {
Workspace_sptr ws = m_outputWorkspaceProp->getWorkspace();
if (ws) {
// The workspace property says to do locking,
// AND it has NOT already been write-locked
if (m_outputWorkspaceProps[i]->isLocking() &&
if (m_outputWorkspaceProp->isLocking() &&
std::find(m_writeLockedWorkspaces.begin(),
m_writeLockedWorkspaces.end(),
ws) == m_writeLockedWorkspaces.end()) {
......@@ -379,12 +378,12 @@ void Algorithm::lockWorkspaces() {
}
// Next read-lock the input workspaces
for (size_t i = 0; i < m_inputWorkspaceProps.size(); i++) {
Workspace_sptr ws = m_inputWorkspaceProps[i]->getWorkspace();
for (auto &m_inputWorkspaceProp : m_inputWorkspaceProps) {
Workspace_sptr ws = m_inputWorkspaceProp->getWorkspace();
if (ws) {
// The workspace property says to do locking,
// AND it has NOT already been write-locked
if (m_inputWorkspaceProps[i]->isLocking() &&
if (m_inputWorkspaceProp->isLocking() &&
std::find(m_writeLockedWorkspaces.begin(),
m_writeLockedWorkspaces.end(),
ws) == m_writeLockedWorkspaces.end()) {
......@@ -406,15 +405,13 @@ void Algorithm::unlockWorkspaces() {
if (this->isChild())
return;
auto &debugLog = g_log.debug();
for (size_t i = 0; i < m_writeLockedWorkspaces.size(); i++) {
Workspace_sptr ws = m_writeLockedWorkspaces[i];
for (auto ws : m_writeLockedWorkspaces) {
if (ws) {
debugLog << "Unlocking " << ws->getName() << std::endl;
ws->getLock()->unlock();
}
}
for (size_t i = 0; i < m_readLockedWorkspaces.size(); i++) {
Workspace_sptr ws = m_readLockedWorkspaces[i];
for (auto ws : m_readLockedWorkspaces) {
if (ws) {
debugLog << "Unlocking " << ws->getName() << std::endl;
ws->getLock()->unlock();
......@@ -466,11 +463,11 @@ bool Algorithm::execute() {
if (!validateProperties()) {
// Reset name on input workspaces to trigger attempt at collection from ADS
const std::vector<Property *> &props = getProperties();
for (unsigned int i = 0; i < props.size(); ++i) {
IWorkspaceProperty *wsProp = dynamic_cast<IWorkspaceProperty *>(props[i]);
for (auto prop : props) {
IWorkspaceProperty *wsProp = dynamic_cast<IWorkspaceProperty *>(prop);
if (wsProp && !(wsProp->getWorkspace())) {
// Setting it's name to the same one it already had
props[i]->setValue(props[i]->value());
prop->setValue(prop->value());
}
}
// Try the validation again
......@@ -511,14 +508,14 @@ bool Algorithm::execute() {
// Log each issue
auto &errorLog = getLogger().error();
auto &warnLog = getLogger().warning();
for (auto it = errors.begin(); it != errors.end(); it++) {
if (this->existsProperty(it->first))
errorLog << "Invalid value for " << it->first << ": " << it->second
<< "\n";
for (auto &error : errors) {
if (this->existsProperty(error.first))
errorLog << "Invalid value for " << error.first << ": "
<< error.second << "\n";
else {
numErrors -= 1; // don't count it as an error
warnLog << "validateInputs() references non-existant property \""
<< it->first << "\"\n";
<< error.first << "\"\n";
}
}
// Throw because something was invalid
......@@ -782,11 +779,11 @@ Algorithm_sptr Algorithm::createChildAlgorithm(const std::string &name,
// If output workspaces are nameless, give them a temporary name to satisfy
// validator
const std::vector<Property *> &props = alg->getProperties();
for (unsigned int i = 0; i < props.size(); ++i) {
auto wsProp = dynamic_cast<IWorkspaceProperty *>(props[i]);
if (props[i]->direction() == Mantid::Kernel::Direction::Output && wsProp) {
if (props[i]->value().empty()) {
props[i]->createTemporaryValue();
for (auto prop : props) {
auto wsProp = dynamic_cast<IWorkspaceProperty *>(prop);
if (prop->direction() == Mantid::Kernel::Direction::Output && wsProp) {
if (prop->value().empty()) {
prop->createTemporaryValue();
}
}
}
......@@ -1132,12 +1129,12 @@ bool Algorithm::checkGroups() {
// Unroll the groups or single inputs into vectors of workspace
m_groups.clear();
m_groupWorkspaces.clear();
for (size_t i = 0; i < m_inputWorkspaceProps.size(); i++) {
auto *prop = dynamic_cast<Property *>(m_inputWorkspaceProps[i]);
for (auto &m_inputWorkspaceProp : m_inputWorkspaceProps) {
auto *prop = dynamic_cast<Property *>(m_inputWorkspaceProp);
auto *wsGroupProp = dynamic_cast<WorkspaceProperty<WorkspaceGroup> *>(prop);
std::vector<Workspace_sptr> thisGroup;
Workspace_sptr ws = m_inputWorkspaceProps[i]->getWorkspace();
Workspace_sptr ws = m_inputWorkspaceProp->getWorkspace();
WorkspaceGroup_sptr wsGroup =
boost::dynamic_pointer_cast<WorkspaceGroup>(ws);
......@@ -1159,12 +1156,12 @@ bool Algorithm::checkGroups() {
numGroups++;
processGroups = true;
std::vector<std::string> names = wsGroup->getNames();
for (size_t j = 0; j < names.size(); j++) {
for (auto &name : names) {
Workspace_sptr memberWS =
AnalysisDataService::Instance().retrieve(names[j]);
AnalysisDataService::Instance().retrieve(name);
if (!memberWS)
throw std::invalid_argument("One of the members of " +
wsGroup->name() + ", " + names[j] +
wsGroup->name() + ", " + name +
" was not found!.");
thisGroup.push_back(memberWS);
}
......@@ -1239,8 +1236,8 @@ bool Algorithm::processGroups() {
std::vector<WorkspaceGroup_sptr> outGroups;
// ---------- Create all the output workspaces ----------------------------
for (size_t owp = 0; owp < m_pureOutputWorkspaceProps.size(); owp++) {
Property *prop = dynamic_cast<Property *>(m_pureOutputWorkspaceProps[owp]);
for (auto &m_pureOutputWorkspaceProp : m_pureOutputWorkspaceProps) {
Property *prop = dynamic_cast<Property *>(m_pureOutputWorkspaceProp);
if (prop) {
WorkspaceGroup_sptr outWSGrp = WorkspaceGroup_sptr(new WorkspaceGroup());
outGroups.push_back(outWSGrp);
......@@ -1357,8 +1354,8 @@ bool Algorithm::processGroups() {
} // for each entry in each group
// restore group notifications
for (size_t i = 0; i < outGroups.size(); i++) {
outGroups[i]->observeADSNotifications(true);
for (auto &outGroup : outGroups) {
outGroup->observeADSNotifications(true);
}
// We finished successfully.
......@@ -1379,8 +1376,7 @@ void Algorithm::copyNonWorkspaceProperties(IAlgorithm *alg, int periodNum) {
if (!alg)
throw std::runtime_error("Algorithm not created!");
std::vector<Property *> props = this->getProperties();
for (size_t i = 0; i < props.size(); i++) {
Property *prop = props[i];
for (auto prop : props) {
if (prop) {
IWorkspaceProperty *wsProp = dynamic_cast<IWorkspaceProperty *>(prop);
// Copy the property using the string
......@@ -1510,9 +1506,7 @@ void Algorithm::cancel() {
m_cancel = true;
// Loop over the output workspaces and try to cancel them
for (auto it = m_ChildAlgorithms.begin(); it != m_ChildAlgorithms.end();
++it) {
const auto &weakPtr = *it;
for (auto &weakPtr : m_ChildAlgorithms) {
if (IAlgorithm_sptr sharedPtr = weakPtr.lock()) {
sharedPtr->cancel();
}
......
......@@ -366,9 +366,8 @@ AlgorithmFactoryImpl::getDescriptors(bool includeHidden) const {
// Traverse each parent category, working our way from the top down.
std::string currentLayer = "";
for (auto layerIt = categoryLayers.begin();
layerIt != categoryLayers.end(); ++layerIt) {
currentLayer.append(*layerIt);
for (auto &categoryLayer : categoryLayers) {
currentLayer.append(categoryLayer);
if (hiddenCategories.find(currentLayer) != hiddenCategories.end()) {
// Category is hidden, no need to check any others.
......
......@@ -149,9 +149,9 @@ void AlgorithmManagerImpl::setMaxAlgorithms(int n) {
*/
IAlgorithm_sptr AlgorithmManagerImpl::getAlgorithm(AlgorithmID id) const {
Mutex::ScopedLock _lock(this->m_managedMutex);
for (auto a = m_managed_algs.cbegin(); a != m_managed_algs.cend(); ++a) {
if ((**a).getAlgorithmID() == id)
return *a;
for (const auto &m_managed_alg : m_managed_algs) {
if ((*m_managed_alg).getAlgorithmID() == id)
return m_managed_alg;
}
return IAlgorithm_sptr();
}
......@@ -207,8 +207,7 @@ std::vector<IAlgorithm_const_sptr> AlgorithmManagerImpl::runningInstancesOf(
const std::string &algorithmName) const {
std::vector<IAlgorithm_const_sptr> theRunningInstances;
Mutex::ScopedLock _lock(this->m_managedMutex);
for (auto alg = m_managed_algs.begin(); alg != m_managed_algs.end(); ++alg) {
auto currentAlgorithm = *alg;
for (auto currentAlgorithm : m_managed_algs) {
if (currentAlgorithm->name() == algorithmName &&
currentAlgorithm->isRunning()) {
theRunningInstances.push_back(currentAlgorithm);
......@@ -221,9 +220,9 @@ std::vector<IAlgorithm_const_sptr> AlgorithmManagerImpl::runningInstancesOf(
/// Requests cancellation of all running algorithms
void AlgorithmManagerImpl::cancelAll() {
Mutex::ScopedLock _lock(this->m_managedMutex);
for (auto it = m_managed_algs.begin(); it != m_managed_algs.end(); ++it) {
if ((*it)->isRunning())
(*it)->cancel();
for (auto &m_managed_alg : m_managed_algs) {
if (m_managed_alg->isRunning())
m_managed_alg->cancel();
}
}
......
......@@ -269,8 +269,8 @@ void AlgorithmProxy::stopped() {
*/
void AlgorithmProxy::dropWorkspaceReferences() {
const std::vector<Property *> &props = getProperties();
for (unsigned int i = 0; i < props.size(); ++i) {
if (auto *wsProp = dynamic_cast<IWorkspaceProperty *>(props[i])) {
for (auto prop : props) {
if (auto *wsProp = dynamic_cast<IWorkspaceProperty *>(prop)) {
wsProp->clear();
}
}
......
......@@ -236,10 +236,10 @@ AnalysisDataServiceImpl::topLevelItems() const {
auto topLevelNames = this->getObjectNames();
std::set<Workspace_sptr> groupMembers;
for (auto it = topLevelNames.begin(); it != topLevelNames.end(); ++it) {
for (const auto &topLevelName : topLevelNames) {
try {
const std::string &name = *it;
auto ws = this->retrieve(*it);
const std::string &name = topLevelName;
auto ws = this->retrieve(topLevelName);
topLevel.insert(std::make_pair(name, ws));
if (auto group = boost::dynamic_pointer_cast<WorkspaceGroup>(ws)) {
group->reportMembers(groupMembers);
......
......@@ -55,17 +55,15 @@ ICatalog_sptr CatalogManagerImpl::getCatalog(const std::string &sessionID) {
if (sessionID.empty()) {
auto composite = boost::make_shared<CompositeCatalog>();
for (auto item = m_activeCatalogs.begin(); item != m_activeCatalogs.end();
++item) {
composite->add(item->second);
for (auto &m_activeCatalog : m_activeCatalogs) {
composite->add(m_activeCatalog.second);
}
return composite;
}
for (auto iter = m_activeCatalogs.begin(); iter != m_activeCatalogs.end();
++iter) {
if (sessionID == iter->first->getSessionId())
return iter->second;
for (auto &m_activeCatalog : m_activeCatalogs) {
if (sessionID == m_activeCatalog.first->getSessionId())
return m_activeCatalog.second;
}
// If we reached this point then the session is corrupt/invalid.
......@@ -81,9 +79,8 @@ ICatalog_sptr CatalogManagerImpl::getCatalog(const std::string &sessionID) {
*/
void CatalogManagerImpl::destroyCatalog(const std::string &sessionID) {
if (sessionID.empty()) {
for (auto item = m_activeCatalogs.begin(); item != m_activeCatalogs.end();
++item) {
item->second->logout();
for (auto &m_activeCatalog : m_activeCatalogs) {
m_activeCatalog.second->logout();
}
m_activeCatalogs.clear();
}
......@@ -104,9 +101,8 @@ void CatalogManagerImpl::destroyCatalog(const std::string &sessionID) {
std::vector<CatalogSession_sptr> CatalogManagerImpl::getActiveSessions() {
std::vector<CatalogSession_sptr> sessions;
for (auto item = m_activeCatalogs.begin(); item != m_activeCatalogs.end();
++item) {
sessions.push_back(item->first);
for (auto &m_activeCatalog : m_activeCatalogs) {
sessions.push_back(m_activeCatalog.first);
}
return sessions;
......
......@@ -50,8 +50,8 @@ void ChopperModel::initialize(const std::string &params) {
setBaseParameters(keyValues);
for (auto iter = keyValues.begin(); iter != keyValues.end(); ++iter) {
setParameterValue(iter->first, iter->second);
for (auto &keyValue : keyValues) {
setParameterValue(keyValue.first, keyValue.second);
}
}
......
......@@ -37,9 +37,8 @@ CatalogSession_sptr CompositeCatalog::login(const std::string &username,
* Log the user out of all catalogues in the container.
*/
void CompositeCatalog::logout() {
for (auto catalog = m_catalogs.begin(); catalog != m_catalogs.end();
++catalog) {
(*catalog)->logout();
for (auto &m_catalog : m_catalogs) {
m_catalog->logout();
}
}
......@@ -55,9 +54,8 @@ void CompositeCatalog::logout() {
void CompositeCatalog::search(const ICat::CatalogSearchParam &inputs,
ITableWorkspace_sptr &outputws, const int &offset,
const int &limit) {
for (auto catalog = m_catalogs.begin(); catalog != m_catalogs.end();
++catalog) {
(*catalog)->search(inputs, outputws, offset, limit);
for (auto &m_catalog : m_catalogs) {
m_catalog->search(inputs, outputws, offset, limit);
}
}
......@@ -68,9 +66,8 @@ void CompositeCatalog::search(const ICat::CatalogSearchParam &inputs,
int64_t CompositeCatalog::getNumberOfSearchResults(
const ICat::CatalogSearchParam &inputs) {
int64_t numberOfSearchResults = 0;
for (auto catalog = m_catalogs.begin(); catalog != m_catalogs.end();
++catalog) {
numberOfSearchResults += (*catalog)->getNumberOfSearchResults(inputs);
for (auto &m_catalog : m_catalogs) {
numberOfSearchResults += m_catalog->getNumberOfSearchResults(inputs);
}
return numberOfSearchResults;
}
......@@ -81,9 +78,8 @@ int64_t CompositeCatalog::getNumberOfSearchResults(
* @param outputws :: The workspace to store the results.
*/
void CompositeCatalog::myData(ITableWorkspace_sptr &outputws) {
for (auto catalog = m_catalogs.begin(); catalog != m_catalogs.end();
++catalog) {
(*catalog)->myData(outputws);
for (auto &m_catalog : m_catalogs) {
m_catalog->myData(outputws);
}
}
......@@ -95,9 +91,8 @@ void CompositeCatalog::myData(ITableWorkspace_sptr &outputws) {
*/
void CompositeCatalog::getDataSets(const std::string &investigationId,
ITableWorkspace_sptr &outputws) {
for (auto catalog = m_catalogs.begin(); catalog != m_catalogs.end();
++catalog) {
(*catalog)->getDataSets(investigationId, outputws);
for (auto &m_catalog : m_catalogs) {
m_catalog->getDataSets(investigationId, outputws);
}
}
......@@ -109,9 +104,8 @@ void CompositeCatalog::getDataSets(const std::string &investigationId,
*/
void CompositeCatalog::getDataFiles(const std::string &investigationId,
ITableWorkspace_sptr &outputws) {
for (auto catalog = m_catalogs.begin(); catalog != m_catalogs.end();
++catalog) {
(*catalog)->getDataFiles(investigationId, outputws);
for (auto &m_catalog : m_catalogs) {
m_catalog->getDataFiles(investigationId, outputws);
}
}
......@@ -120,9 +114,8 @@ void CompositeCatalog::getDataFiles(const std::string &investigationId,
* @param instruments :: A reference to the vector to store the results.
*/
void CompositeCatalog::listInstruments(std::vector<std::string> &instruments) {
for (auto catalog = m_catalogs.begin(); catalog != m_catalogs.end();
++catalog) {
(*catalog)->listInstruments(instruments);
for (auto &m_catalog : m_catalogs) {
m_catalog->listInstruments(instruments);
}
}
......@@ -132,9 +125,8 @@ void CompositeCatalog::listInstruments(std::vector<std::string> &instruments) {
*/
void CompositeCatalog::listInvestigationTypes(
std::vector<std::string> &invstTypes) {
for (auto catalog = m_catalogs.begin(); catalog != m_catalogs.end();
++catalog) {
(*catalog)->listInvestigationTypes(invstTypes);
for (auto &m_catalog : m_catalogs) {
m_catalog->listInvestigationTypes(invstTypes);
}
}
......@@ -142,9 +134,8 @@ void CompositeCatalog::listInvestigationTypes(
* Keep each catalog session alive in the container.
*/
void CompositeCatalog::keepAlive() {
for (auto catalog = m_catalogs.begin(); catalog != m_catalogs.end();
++catalog) {
(*catalog)->keepAlive();
for (auto &m_catalog : m_catalogs) {
m_catalog->keepAlive();
}
}
}
......
......@@ -62,9 +62,9 @@ std::string CompositeFunction::asString() const {
getAttribute("NumDeriv").asBool() == true) {
ostr << "composite=" << name();
std::vector<std::string> attr = this->getAttributeNames();
for (size_t i = 0; i < attr.size(); i++) {
std::string attName = attr[i];
std::string attValue = this->getAttribute(attr[i]).value();
for (auto &i : attr) {
std::string attName = i;
std::string attValue = this->getAttribute(i).value();
if (!attValue.empty()) {
ostr << ',' << attName << '=' << attValue;
}
......@@ -369,9 +369,7 @@ void CompositeFunction::checkFunction() {
std::vector<IFunction_sptr> functions(m_functions.begin(), m_functions.end());
m_functions.clear();
for (std::vector<IFunction_sptr>::size_type i = 0; i < functions.size();
i++) {
IFunction_sptr f = functions[i];
for (auto f : functions) {
CompositeFunction_sptr cf =
boost::dynamic_pointer_cast<CompositeFunction>(f);
if (cf)
......
......@@ -73,9 +73,8 @@ void ExperimentInfo::copyExperimentInfoFrom(const ExperimentInfo *other) {
if (other->m_moderatorModel)
m_moderatorModel = other->m_moderatorModel->clone();
m_choppers.clear();
for (auto iter = other->m_choppers.begin(); iter != other->m_choppers.end();
++iter) {
m_choppers.push_back((*iter)->clone());
for (const auto &m_chopper : other->m_choppers) {
m_choppers.push_back(m_chopper->clone());
}
}
......@@ -106,9 +105,8 @@ const std::string ExperimentInfo::toString() const {
// parameter files loaded
auto paramFileVector = this->instrumentParameters().getParameterFilenames();
for (auto itFilename = paramFileVector.begin();
itFilename != paramFileVector.end(); ++itFilename) {
out << "Parameters from: " << *itFilename;
for (auto &itFilename : paramFileVector) {
out << "Parameters from: " << itFilename;
out << "\n";
}
......@@ -851,11 +849,9 @@ ExperimentInfo::getInstrumentFilename(const std::string &instrumentName,
DateAndTime refDateGoodFile("1900-01-31 23:59:00"); // used to help determine
// the most recently
// starting matching IDF
for (auto instDirs_itr = directoryNames.begin();
instDirs_itr != directoryNames.end(); ++instDirs_itr) {
for (auto directoryName : directoryNames) {
// This will iterate around the directories from user ->etc ->install, and
// find the first beat file
std::string directoryName = *instDirs_itr;
for (Poco::DirectoryIterator dir_itr(directoryName); dir_itr != end_iter;
++dir_itr) {
if (!Poco::File(dir_itr->path()).isFile())
......
......@@ -71,16 +71,14 @@ void Expression::add_operators(const std::vector<std::string> &ops) {
char j = 0;
tokenizer tkz(m_operators->binary[i], " ",
tokenizer::TOK_IGNORE_EMPTY | tokenizer::TOK_TRIM);
for (auto it = tkz.begin(); it != tkz.end(); it++) {
m_operators->precedence[*it] = i + 1;
m_operators->op_number[*it] = j++;
for (const auto &it : tkz) {
m_operators->precedence[it] = i + 1;
m_operators->op_number[it] = j++;
}
}
for (size_t i = 0; i < ops.size(); i++) {
std::string str = ops[i];
for (size_t j = 0; j < str.size(); j++) {
char c = str[j];
for (auto str : ops) {
for (char c : str) {
if (c == ' ')
continue;
m_operators->symbols.insert(c);
......@@ -90,10 +88,8 @@ void Expression::add_operators(const std::vector<std::string> &ops) {
void Expression::add_unary(const std::set<std::string> &ops) {
m_operators->unary = ops;
for (auto it = ops.cbegin(); it != ops.cend(); ++it) {
for (auto c = it->cbegin(); c != it->cend(); ++c) {
m_operators->symbols.insert(*c);
}
for (const auto &op : ops) {
m_operators->symbols.insert(op.cbegin(), op.cend());
}
}
......@@ -364,8 +360,8 @@ void Expression::logPrint(const std::string &pads) const {
std::string myPads = pads + " ";
if (m_terms.size()) {
std::cerr << myPads << m_op << '[' << m_funct << ']' << "(" << '\n';
for (size_t i = 0; i < m_terms.size(); i++)
m_terms[i].logPrint(myPads);
for (const auto &m_term : m_terms)
m_term.logPrint(myPads);
std::cerr << myPads << ")" << '\n';
} else
std::cerr << myPads << m_op << m_funct << '\n';
......@@ -456,11 +452,11 @@ std::string Expression::str() const {
if (m_terms.size()) {
if (brackets)
res << '(';
for (size_t i = 0; i < m_terms.size(); i++) {
res << m_terms[i].operator_name();
size_t prec1 = op_prec(m_terms[i].m_funct);
for (const auto &m_term : m_terms) {
res << m_term.operator_name();
size_t prec1 = op_prec(m_term.m_funct);
bool isItUnary = false;
if (m_terms[i].size() == 1 && is_unary(m_terms[i].m_funct)) {
if (m_term.size() == 1 && is_unary(m_term.m_funct)) {
prec1 = 0; // unary operator
isItUnary = true;
}
......@@ -469,7 +465,7 @@ std::string Expression::str() const {
res << '(';
if (isItUnary)
res << ' ';
res << m_terms[i].str();
res << m_term.str();
if (bk)
res << ')';
}
......@@ -498,12 +494,12 @@ std::set<std::string> Expression::getVariables() const {
out.insert(s);
}
} else {
for (auto e = begin(); e != end(); ++e) {
if (e->isFunct()) {
std::set<std::string> tout = e->getVariables();
for (const auto &e : *this) {
if (e.isFunct()) {
std::set<std::string> tout = e.getVariables();
out.insert(tout.begin(), tout.end());
} else {
std::string s = e->name();
std::string s = e.name();
if (!s.empty() && !isdigit(s[0])) {
out.insert(s);
}
......