Skip to content

Commit

Permalink
many sizet to int conversions
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnAD committed Dec 6, 2023
1 parent ed88f20 commit 1ae5f7e
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion OndselSolver/Array.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ namespace MbD {
inline double Array<T>::maxMagnitudeOfVector()
{
double answer = 0.0;
for (int i = 0; i < this->size(); i++)
for (int i = 0; i < (int)this->size(); i++)
{
double mag = std::abs(this->at(i));
if (answer < mag) answer = mag;
Expand Down
2 changes: 1 addition & 1 deletion OndselSolver/DiagonalMatrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ namespace MbD {
{
s << "DiagMat[";
s << this->at(0);
for (int i = 1; i < this->size(); i++)
for (int i = 1; i < (int)this->size(); i++)
{
s << ", " << this->at(i);
}
Expand Down
6 changes: 3 additions & 3 deletions OndselSolver/FullColumn.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ namespace MbD {
return answer;
}
template<typename T>
inline FColsptr<T> FullColumn<T>::times(T a)
inline FColsptr<T> FullColumn<T>::times(T)
{
assert(false);
}
Expand Down Expand Up @@ -116,7 +116,7 @@ namespace MbD {
inline void FullColumn<T>::equalSelfPlusFullColumnAt(FColsptr<T> fullCol, int ii)
{
//self is subcolumn of fullCol
for (int i = 0; i < this->size(); i++)
for (int i = 0; i < (int)this->size(); i++)
{
this->at(i) += fullCol->at(ii + i);
}
Expand Down Expand Up @@ -238,7 +238,7 @@ namespace MbD {
{
s << "FullCol{";
s << this->at(0);
for (int i = 1; i < this->size(); i++)
for (int i = 1; i < (int)this->size(); i++)
{
s << ", " << this->at(i);
}
Expand Down
16 changes: 8 additions & 8 deletions OndselSolver/FullMatrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -337,14 +337,14 @@ namespace MbD {
template<>
inline void FullMatrix<double>::zeroSelf()
{
for (int i = 0; i < this->size(); i++) {
for (int i = 0; i < (int)this->size(); i++) {
this->at(i)->zeroSelf();
}
}
template<>
inline void FullMatrix<double>::identity() {
this->zeroSelf();
for (int i = 0; i < this->size(); i++) {
for (int i = 0; i < (int)this->size(); i++) {
this->at(i)->at(i) = 1.0;
}
}
Expand Down Expand Up @@ -388,7 +388,7 @@ namespace MbD {
return answer;
}
template<typename T>
inline FMatsptr<T> FullMatrix<T>::times(T a)
inline FMatsptr<T> FullMatrix<T>::times(T)
{
assert(false);
}
Expand Down Expand Up @@ -485,7 +485,7 @@ namespace MbD {
inline double FullMatrix<double>::sumOfSquares()
{
double sum = 0.0;
for (int i = 0; i < this->size(); i++)
for (int i = 0; i < (int)this->size(); i++)
{
sum += this->at(i)->sumOfSquares();
}
Expand Down Expand Up @@ -532,15 +532,15 @@ namespace MbD {
template<typename T>
inline void FullMatrix<T>::magnifySelf(T factor)
{
for (int i = 0; i < this->size(); i++) {
for (int i = 0; i < (int)this->size(); i++) {
this->at(i)->magnifySelf(factor);
}
}
template<typename T>
inline std::ostream& FullMatrix<T>::printOn(std::ostream& s) const
{
s << "FullMat[" << std::endl;
for (int i = 0; i < this->size(); i++)
for (int i = 0; i < (int)this->size(); i++)
{
s << *(this->at(i)) << std::endl;
}
Expand Down Expand Up @@ -611,7 +611,7 @@ namespace MbD {
inline T FullMatrix<T>::trace()
{
T trace = 0.0;
for (int i = 0; i < this->size(); i++)
for (int i = 0; i < (int)this->size(); i++)
{
trace += this->at(i)->at(i);
}
Expand All @@ -621,7 +621,7 @@ namespace MbD {
inline double FullMatrix<T>::maxMagnitude()
{
double max = 0.0;
for (int i = 0; i < this->size(); i++)
for (int i = 0; i < (int)this->size(); i++)
{
double element = this->at(i)->maxMagnitude();
if (max < element) max = element;
Expand Down
6 changes: 3 additions & 3 deletions OndselSolver/FullRow.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ namespace MbD {
return answer;
}
template<typename T>
inline FRowsptr<T> FullRow<T>::times(T a)
inline FRowsptr<T> FullRow<T>::times(T)
{
assert(false);
}
Expand Down Expand Up @@ -107,7 +107,7 @@ namespace MbD {
inline T FullRow<T>::timesFullColumn(FullColumn<T>* fullCol)
{
auto answer = this->at(0) * fullCol->at(0);
for (int i = 1; i < this->size(); i++)
for (int i = 1; i < (int)this->size(); i++)
{
answer += this->at(i) * fullCol->at(i);
}
Expand Down Expand Up @@ -202,7 +202,7 @@ namespace MbD {
{
s << "FullRow{";
s << this->at(0);
for (int i = 1; i < this->size(); i++)
for (int i = 1; i < (int)this->size(); i++)
{
s << ", " << this->at(i);
}
Expand Down
18 changes: 9 additions & 9 deletions OndselSolver/FullVector.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ namespace MbD {
inline double FullVector<double>::sumOfSquares()
{
double sum = 0.0;
for (int i = 0; i < this->size(); i++)
for (int i = 0; i < (int)this->size(); i++)
{
double element = this->at(i);
sum += element * element;
Expand All @@ -92,7 +92,7 @@ namespace MbD {
template<>
inline void FullVector<double>::zeroSelf()
{
for (int i = 0; i < this->size(); i++) {
for (int i = 0; i < (int)this->size(); i++) {
this->at(i) = 0.0;
}
}
Expand Down Expand Up @@ -122,7 +122,7 @@ namespace MbD {
template<typename T>
inline void FullVector<T>::equalSelfPlusFullVectortimes(std::shared_ptr<FullVector<T>> fullVec, T factor)
{
for (int i = 0; i < this->size(); i++)
for (int i = 0; i < (int)this->size(); i++)
{
this->atiplusNumber(i, fullVec->at(i) * factor);
}
Expand All @@ -131,7 +131,7 @@ namespace MbD {
inline double FullVector<double>::maxMagnitude()
{
double max = 0.0;
for (int i = 0; i < this->size(); i++)
for (int i = 0; i < (int)this->size(); i++)
{
double element = this->at(i);
if (element < 0.0) element = -element;
Expand All @@ -156,7 +156,7 @@ namespace MbD {
inline double FullVector<T>::length()
{
double ssq = 0.0;
for (int i = 0; i < this->size(); i++)
for (int i = 0; i < (int)this->size(); i++)
{
double elem = this->at(i);
ssq += elem * elem;
Expand All @@ -173,7 +173,7 @@ namespace MbD {
template<>
inline void FullVector<double>::conditionSelfWithTol(double tol)
{
for (int i = 0; i < this->size(); i++)
for (int i = 0; i < (int)this->size(); i++)
{
double element = this->at(i);
if (element < 0.0) element = -element;
Expand Down Expand Up @@ -205,7 +205,7 @@ namespace MbD {
//"Test if elements are increasing."
//"Ok if spoilers are less than tol."
auto next = this->at(0);
for (int i = 1; i < this->size(); i++)
for (int i = 1; i < (int)this->size(); i++)
{
auto previous = next;
next = this->at(i);
Expand All @@ -219,7 +219,7 @@ namespace MbD {
//"Test if elements are increasing."
//"Ok if spoilers are less than tol."
auto next = this->at(0);
for (int i = 1; i < this->size(); i++)
for (int i = 1; i < (int)this->size(); i++)
{
auto previous = next;
next = this->at(i);
Expand All @@ -232,7 +232,7 @@ namespace MbD {
{
s << "FullVec{";
s << this->at(0);
for (int i = 1; i < this->size(); i++)
for (int i = 1; i < (int)this->size(); i++)
{
s << ", " << this->at(i);
}
Expand Down
10 changes: 5 additions & 5 deletions OndselSolver/SparseMatrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ namespace MbD {
inline double SparseMatrix<T>::sumOfSquares()
{
double sum = 0.0;
for (int i = 0; i < this->size(); i++)
for (int i = 0; i < (int)this->size(); i++)
{
sum += this->at(i)->sumOfSquares();
}
Expand All @@ -107,7 +107,7 @@ namespace MbD {
template<>
inline void SparseMatrix<double>::zeroSelf()
{
for (int i = 0; i < this->size(); i++) {
for (int i = 0; i < (int)this->size(); i++) {
this->at(i)->zeroSelf();
}
}
Expand Down Expand Up @@ -191,7 +191,7 @@ namespace MbD {
inline double SparseMatrix<T>::maxMagnitude()
{
double max = 0.0;
for (int i = 0; i < this->size(); i++)
for (int i = 0; i < (int)this->size(); i++)
{
double element = this->at(i)->maxMagnitude();
if (max < element) max = element;
Expand All @@ -202,7 +202,7 @@ namespace MbD {
inline std::ostream& SparseMatrix<T>::printOn(std::ostream& s) const
{
s << "SpMat[" << std::endl;
for (int i = 0; i < this->size(); i++)
for (int i = 0; i < (int)this->size(); i++)
{
s << *(this->at(i)) << std::endl;
}
Expand Down Expand Up @@ -243,7 +243,7 @@ namespace MbD {
template<typename T>
inline void SparseMatrix<T>::magnifySelf(T factor)
{
for (int i = 0; i < this->size(); i++) {
for (int i = 0; i < (int)this->size(); i++) {
this->at(i)->magnifySelf(factor);
}
}
Expand Down

0 comments on commit 1ae5f7e

Please sign in to comment.