Skip to content

Commit

Permalink
last of the easy changes
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnAD committed Dec 7, 2023
1 parent c88a4f4 commit cb5058f
Show file tree
Hide file tree
Showing 19 changed files with 58 additions and 57 deletions.
2 changes: 1 addition & 1 deletion OndselSolver/PlanarJoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ MbD::PlanarJoint::PlanarJoint()
{
}

MbD::PlanarJoint::PlanarJoint(const char* str)
MbD::PlanarJoint::PlanarJoint(const char*)
{
}

Expand Down
2 changes: 1 addition & 1 deletion OndselSolver/PointInPlaneJoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ MbD::PointInPlaneJoint::PointInPlaneJoint()
{
}

MbD::PointInPlaneJoint::PointInPlaneJoint(const char* str)
MbD::PointInPlaneJoint::PointInPlaneJoint(const char*)
{
}

Expand Down
16 changes: 8 additions & 8 deletions OndselSolver/Polynomial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ MbD::Polynomial::Polynomial(Symsptr var, std::shared_ptr<std::vector<Symsptr>> c
coeffs->insert(coeffs->end(), coefficients->begin(), coefficients->end());
}

Symsptr MbD::Polynomial::expandUntil(Symsptr sptr, std::shared_ptr<std::unordered_set<Symsptr>> set)
Symsptr MbD::Polynomial::expandUntil(Symsptr, std::shared_ptr<std::unordered_set<Symsptr>> set)
{
auto newCoeffs = std::make_shared<std::vector<Symsptr>>();
for (int i = 0; i < coeffs->size(); i++)
for (int i = 0; i < (int)coeffs->size(); i++)
{
auto coeff = coeffs->at(i);
auto newCoeff = coeff->expandUntil(coeff, set);
Expand All @@ -41,10 +41,10 @@ Symsptr MbD::Polynomial::expandUntil(Symsptr sptr, std::shared_ptr<std::unordere
return std::make_shared<Polynomial>(xx, newCoeffs);
}

Symsptr MbD::Polynomial::simplifyUntil(Symsptr sptr, std::shared_ptr<std::unordered_set<Symsptr>> set)
Symsptr MbD::Polynomial::simplifyUntil(Symsptr, std::shared_ptr<std::unordered_set<Symsptr>> set)
{
auto newCoeffs = std::make_shared<std::vector<Symsptr>>();
for (int i = 0; i < coeffs->size(); i++)
for (int i = 0; i < (int)coeffs->size(); i++)
{
auto coeff = coeffs->at(i);
auto newCoeff = coeff->simplifyUntil(coeff, set);
Expand All @@ -58,7 +58,7 @@ Symsptr MbD::Polynomial::differentiateWRTx()
//Differentiate powers
if (coeffs->size() == 1) return sptrConstant(0.0);
auto newCoeffs = std::make_shared<std::vector<Symsptr>>();
for (int i = 1; i < coeffs->size(); i++)
for (int i = 1; i < (int)coeffs->size(); i++)
{
auto newCoeff = i * coeffs->at(i)->getValue();
newCoeffs->push_back(sptrConstant(newCoeff));
Expand All @@ -80,7 +80,7 @@ Symsptr MbD::Polynomial::integrateWRT(Symsptr var)
assert(xx == var);
auto newCoeffs = std::make_shared<std::vector<Symsptr>>();
newCoeffs->push_back(sptrConstant(0.0));
for (int i = 0; i < coeffs->size(); i++)
for (int i = 0; i < (int)coeffs->size(); i++)
{
auto newCoeff = coeffs->at(i)->getValue() / (i + 1);
newCoeffs->push_back(sptrConstant(newCoeff));
Expand All @@ -93,7 +93,7 @@ double MbD::Polynomial::getValue()
auto xvalue = xx->getValue();
auto xpower = 1.0;
auto answer = 0.0;
for (int i = 0; i < coeffs->size(); i++)
for (int i = 0; i < (int)coeffs->size(); i++)
{
answer += coeffs->at(i)->getValue() * xpower;
xpower *= xvalue;
Expand All @@ -113,7 +113,7 @@ std::ostream& MbD::Polynomial::printOn(std::ostream& s) const
s << *xx << ", ";
s << "coeffs{";
s << *coeffs->at(0);
for (int i = 1; i < coeffs->size(); i++)
for (int i = 1; i < (int)coeffs->size(); i++)
{
s << ", " << *coeffs->at(i);
}
Expand Down
2 changes: 1 addition & 1 deletion OndselSolver/PosICKineNewtonRaphson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void PosICKineNewtonRaphson::assignEquationNumbers()
con->iG = eqnNo;
eqnNo += 1;
}
auto lastEqnNo = eqnNo - 1;
//auto lastEqnNo = eqnNo - 1;
nEqns = eqnNo; //C++ uses index 0.
n = nEqns;
}
Expand Down
2 changes: 1 addition & 1 deletion OndselSolver/Power.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Symsptr MbD::Power::differentiateWRTy()
return deriv->simplified();
}

Symsptr MbD::Power::simplifyUntil(Symsptr sptr, std::shared_ptr<std::unordered_set<Symsptr>> set)
Symsptr MbD::Power::simplifyUntil(Symsptr, std::shared_ptr<std::unordered_set<Symsptr>>)
{
assert(false);
return Symsptr();
Expand Down
8 changes: 4 additions & 4 deletions OndselSolver/Product.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Symsptr MbD::Product::differentiateWRT(Symsptr var)
}
);
auto derivativeTerms = std::make_shared<std::vector<Symsptr>>();
for (int i = 0; i < terms->size(); i++)
for (int i = 0; i < (int)terms->size(); i++)
{
auto& derivative = derivatives->at(i);
auto newTermFunctions = std::make_shared<std::vector<Symsptr>>(*terms);
Expand Down Expand Up @@ -103,7 +103,7 @@ Symsptr Product::expandUntil(Symsptr sptr, std::shared_ptr<std::unordered_set<Sy
return Symbolic::times(factor, sumOfProductsOfSums);
}

Symsptr Product::simplifyUntil(Symsptr sptr, std::shared_ptr<std::unordered_set<Symsptr>> set)
Symsptr Product::simplifyUntil(Symsptr, std::shared_ptr<std::unordered_set<Symsptr>> set)
{
auto itr = std::find_if(set->begin(), set->end(), [this](Symsptr sym) {return this == (sym.get()); });
if (itr != set->end()) {
Expand Down Expand Up @@ -146,7 +146,7 @@ std::ostream& Product::printOn(std::ostream& s) const
{
s << "(";
s << *(this->terms->at(0));
for (int i = 1; i < this->terms->size(); i++)
for (int i = 1; i < (int)this->terms->size(); i++)
{
s << "*" << *(this->terms->at(i));
}
Expand All @@ -162,7 +162,7 @@ bool Product::isProduct()
double Product::getValue()
{
double answer = 1.0;
for (int i = 0; i < terms->size(); i++) answer *= terms->at(i)->getValue();
for (int i = 0; i < (int)terms->size(); i++) answer *= terms->at(i)->getValue();
return answer;
}

Expand Down
30 changes: 15 additions & 15 deletions OndselSolver/RedundantConstraint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

using namespace MbD;

void RedundantConstraint::removeRedundantConstraints(std::shared_ptr<std::vector<int>> redundantEqnNos)
void RedundantConstraint::removeRedundantConstraints(std::shared_ptr<std::vector<int>>)
{
}

Expand All @@ -30,11 +30,11 @@ ConstraintType RedundantConstraint::type()
return redundant;
}

void MbD::RedundantConstraint::fillqsuddotlam(FColDsptr col)
void MbD::RedundantConstraint::fillqsuddotlam(FColDsptr)
{
}

void RedundantConstraint::fillqsulam(FColDsptr col)
void RedundantConstraint::fillqsulam(FColDsptr)
{
}

Expand All @@ -46,19 +46,19 @@ void RedundantConstraint::prePosIC()
{
}

void RedundantConstraint::fillEssenConstraints(std::shared_ptr<Constraint> sptr, std::shared_ptr<std::vector<std::shared_ptr<Constraint>>> essenConstraints)
void RedundantConstraint::fillEssenConstraints(std::shared_ptr<Constraint>, std::shared_ptr<std::vector<std::shared_ptr<Constraint>>>)
{
}

void RedundantConstraint::fillDispConstraints(std::shared_ptr<Constraint> sptr, std::shared_ptr<std::vector<std::shared_ptr<Constraint>>> dispConstraints)
void RedundantConstraint::fillDispConstraints(std::shared_ptr<Constraint>, std::shared_ptr<std::vector<std::shared_ptr<Constraint>>>)
{
}

void RedundantConstraint::fillPerpenConstraints(std::shared_ptr<Constraint> sptr, std::shared_ptr<std::vector<std::shared_ptr<Constraint>>> perpenConstraints)
void RedundantConstraint::fillPerpenConstraints(std::shared_ptr<Constraint>, std::shared_ptr<std::vector<std::shared_ptr<Constraint>>>)
{
}

void RedundantConstraint::fillConstraints(std::shared_ptr<Constraint> sptr, std::shared_ptr<std::vector<std::shared_ptr<Constraint>>> redunConstraints)
void RedundantConstraint::fillConstraints(std::shared_ptr<Constraint>, std::shared_ptr<std::vector<std::shared_ptr<Constraint>>>)
{
}

Expand All @@ -67,23 +67,23 @@ void RedundantConstraint::fillRedundantConstraints(std::shared_ptr<Constraint> s
redunConstraints->push_back(sptr);
}

void RedundantConstraint::setqsulam(FColDsptr col)
void RedundantConstraint::setqsulam(FColDsptr)
{
}

void RedundantConstraint::setqsudotlam(FColDsptr col)
void RedundantConstraint::setqsudotlam(FColDsptr)
{
}

void RedundantConstraint::fillPosICError(FColDsptr col)
void RedundantConstraint::fillPosICError(FColDsptr)
{
}

void RedundantConstraint::fillPosKineError(FColDsptr col)
void RedundantConstraint::fillPosKineError(FColDsptr)
{
}

void RedundantConstraint::fillPosKineJacob(SpMatDsptr mat)
void RedundantConstraint::fillPosKineJacob(SpMatDsptr)
{
}

Expand All @@ -95,15 +95,15 @@ void RedundantConstraint::preAccIC()
{
}

void RedundantConstraint::fillAccICIterError(FColDsptr col)
void RedundantConstraint::fillAccICIterError(FColDsptr)
{
}

void RedundantConstraint::setqsuddotlam(FColDsptr col)
void RedundantConstraint::setqsuddotlam(FColDsptr)
{
}

void RedundantConstraint::discontinuityAtaddTypeTo(double t, std::shared_ptr<std::vector<DiscontinuityType>> disconTypes)
void RedundantConstraint::discontinuityAtaddTypeTo(double, std::shared_ptr<std::vector<DiscontinuityType>>)
{
//"Reactivate all constraints."
assert(false);
Expand Down
2 changes: 1 addition & 1 deletion OndselSolver/SparseMatrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ namespace MbD {
template<typename T>
inline void SparseMatrix<T>::atijplusFullColumn(int i, int j, FColsptr<T> fullCol)
{
for (int ii = 0; ii < fullCol->size(); ii++)
for (int ii = 0; ii < (int)fullCol->size(); ii++)
{
this->atijplusNumber(i + ii, j, fullCol->at(ii));
}
Expand Down
6 changes: 3 additions & 3 deletions OndselSolver/SparseRow.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,23 +64,23 @@ namespace MbD {
template<typename T>
inline void SparseRow<T>::atiplusFullRow(int j, FRowsptr<T> fullRow)
{
for (int jj = 0; jj < fullRow->size(); jj++)
for (int jj = 0; jj < (int)fullRow->size(); jj++)
{
(*this)[j + jj] += fullRow->at(jj);
}
}
template<typename T>
inline void SparseRow<T>::atiminusFullRow(int j, FRowsptr<T> fullRow)
{
for (int jj = 0; jj < fullRow->size(); jj++)
for (int jj = 0; jj < (int)fullRow->size(); jj++)
{
(*this)[j + jj] -= fullRow->at(jj);
}
}
template<typename T>
inline void SparseRow<T>::atiplusFullRowtimes(int j, FRowsptr<T> fullRow, double factor)
{
for (int jj = 0; jj < fullRow->size(); jj++)
for (int jj = 0; jj < (int)fullRow->size(); jj++)
{
(*this)[j + jj] += fullRow->at(jj) * factor;
}
Expand Down
4 changes: 3 additions & 1 deletion OndselSolver/StableBackwardDifference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ double MbD::StableBackwardDifference::pvdotpv()
return sum;
}

FColDsptr MbD::StableBackwardDifference::derivativepresentpastpresentDerivativepastDerivative(int n, FColDsptr y, std::shared_ptr<std::vector<FColDsptr>> ypast, FColDsptr ydot, std::shared_ptr<std::vector<FColDsptr>> ydotpast)
FColDsptr MbD::StableBackwardDifference::derivativepresentpastpresentDerivativepastDerivative(
int, FColDsptr, std::shared_ptr<std::vector<FColDsptr>>, FColDsptr,
std::shared_ptr<std::vector<FColDsptr>>)
{
assert(false);
return FColDsptr();
Expand Down
11 changes: 5 additions & 6 deletions OndselSolver/Sum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,16 @@ void MbD::Sum::parse(std::istringstream& iss)
}
}

void MbD::Sum::parseTerm(std::istringstream& iss)
void MbD::Sum::parseTerm(std::istringstream&)
{
}

void MbD::Sum::parsePlusTerm(std::istringstream& iss)
{
iss.get();

}

void MbD::Sum::parseMinusTerm(std::istringstream& iss)
void MbD::Sum::parseMinusTerm(std::istringstream&)
{
}

Expand Down Expand Up @@ -84,7 +83,7 @@ Symsptr Sum::expandUntil(Symsptr sptr, std::shared_ptr<std::unordered_set<Symspt
}
}

Symsptr Sum::simplifyUntil(Symsptr sptr, std::shared_ptr<std::unordered_set<Symsptr>> set)
Symsptr Sum::simplifyUntil(Symsptr, std::shared_ptr<std::unordered_set<Symsptr>> set)
{
auto itr = std::find_if(set->begin(), set->end(), [this](Symsptr sym) {return this == (sym.get()); });
if (itr != set->end()) {
Expand Down Expand Up @@ -128,7 +127,7 @@ bool Sum::isSum()
double Sum::getValue()
{
double answer = 0.0;
for (int i = 0; i < terms->size(); i++) answer += terms->at(i)->getValue();
for (int i = 0; i < (int)terms->size(); i++) answer += terms->at(i)->getValue();
return answer;
}

Expand Down Expand Up @@ -174,7 +173,7 @@ std::ostream& Sum::printOn(std::ostream& s) const
{
s << "(";
s << *(this->terms->at(0));
for (int i = 1; i < this->terms->size(); i++)
for (int i = 1; i < (int)this->terms->size(); i++)
{
s << " + " << *(this->terms->at(i));
}
Expand Down
10 changes: 5 additions & 5 deletions OndselSolver/Symbolic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@ void Symbolic::initialize()
{
}

Symsptr MbD::Symbolic::differentiateWRT(Symsptr var)
Symsptr MbD::Symbolic::differentiateWRT(Symsptr)
{
assert(false);
return Symsptr();
}

Symsptr MbD::Symbolic::integrateWRT(Symsptr var)
Symsptr MbD::Symbolic::integrateWRT(Symsptr)
{
assert(false);
return Symsptr();
Expand Down Expand Up @@ -121,13 +121,13 @@ Symsptr MbD::Symbolic::expandUntil(std::shared_ptr<std::unordered_set<Symsptr>>
return expandUntil(clonesptr(), set);
}

Symsptr Symbolic::expandUntil(Symsptr sptr, std::shared_ptr<std::unordered_set<Symsptr>> set)
Symsptr Symbolic::expandUntil(Symsptr sptr, std::shared_ptr<std::unordered_set<Symsptr>>)
{
assert(false);
return sptr;
}

Symsptr Symbolic::simplifyUntil(Symsptr sptr, std::shared_ptr<std::unordered_set<Symsptr>> set)
Symsptr Symbolic::simplifyUntil(Symsptr sptr, std::shared_ptr<std::unordered_set<Symsptr>>)
{
assert(false);
return sptr;
Expand Down Expand Up @@ -183,7 +183,7 @@ double Symbolic::getValue()
return 0.0;
}

double MbD::Symbolic::getValue(double arg)
double MbD::Symbolic::getValue(double)
{
assert(false);
return 0.0;
Expand Down
6 changes: 3 additions & 3 deletions OndselSolver/SymbolicParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ bool MbD::SymbolicParser::raisedTo()
return false;
}

bool MbD::SymbolicParser::expected(std::string msg)
bool MbD::SymbolicParser::expected(std::string)
{
return false;
}
Expand Down Expand Up @@ -468,7 +468,7 @@ void MbD::SymbolicParser::notify(std::string msg)
notifyat(msg, mark);
}

void MbD::SymbolicParser::notifyat(std::string msg, int mrk)
void MbD::SymbolicParser::notifyat(std::string, int)
{
//"Temporarily reset source in order to get full contents"
auto p = source->tellg();
Expand All @@ -487,7 +487,7 @@ void MbD::SymbolicParser::notifyat(std::string msg, int mrk)
void MbD::SymbolicParser::combineStackTo(int pos)
{
auto args = std::make_shared<std::vector<Symsptr>>();
while (stack->size() > (int) pos) {
while ((int)stack->size() > pos) {
Symsptr arg = stack->top();
stack->pop();
args->push_back(arg);
Expand Down
2 changes: 1 addition & 1 deletion OndselSolver/System.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ double System::maximumMass()
double System::maximumMomentOfInertia()
{
double max = 0.0;
for (int i = 0; i < parts->size(); i++)
for (int i = 0; i < (int)parts->size(); i++)
{
auto& part = parts->at(i);
for (int j = 0; j < 3; j++)
Expand Down
Loading

0 comments on commit cb5058f

Please sign in to comment.