Werner compil warning (#32)

* Replace int by size_t in for loops.

* Various dtor missing and some other warning fixes.

* fixed size_t vs int

* fixed size_t vs int

---------

Co-authored-by: Paddle <PaddleStroke@users.noreply.github.com>
Co-authored-by: Aik-Siong Koh <askoh@askoh.com>
This commit is contained in:
PaddleStroke
2023-11-16 21:32:13 +01:00
committed by GitHub
parent f452cd6298
commit 6f4fca7efb
35 changed files with 125 additions and 116 deletions

View File

@@ -23,7 +23,7 @@ namespace MbD {
}
void DiagonalMatrix::atiputDiagonalMatrix(int i, std::shared_ptr<DiagonalMatrix> diagMat)
{
for (int ii = 0; ii < diagMat->size(); ii++)
for (size_t ii = 0; ii < diagMat->size(); ii++)
{
this->at(i + ii) = diagMat->at(ii);
}
@@ -53,7 +53,7 @@ namespace MbD {
double DiagonalMatrix::sumOfSquares()
{
double sum = 0.0;
for (int i = 0; i < this->size(); i++)
for (size_t i = 0; i < this->size(); i++)
{
double element = this->at(i);
sum += element * element;
@@ -67,14 +67,14 @@ namespace MbD {
}
void DiagonalMatrix::zeroSelf()
{
for (int i = 0; i < this->size(); i++) {
for (size_t i = 0; i < this->size(); i++) {
this->at(i) = 0.0;
}
}
double DiagonalMatrix::maxMagnitude()
{
double max = 0.0;
for (int i = 0; i < this->size(); i++)
for (size_t i = 0; i < this->size(); i++)
{
double element = this->at(i);
if (element < 0.0) element = -element;
@@ -86,7 +86,7 @@ namespace MbD {
{
s << "DiagMat[";
s << this->at(0);
for (int i = 1; i < this->size(); i++)
for (size_t i = 1; i < this->size(); i++)
{
s << ", " << this->at(i);
}