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:
@@ -257,32 +257,32 @@ namespace MbD {
|
||||
}
|
||||
void FullMatrixDouble::zeroSelf()
|
||||
{
|
||||
for (int i = 0; i < this->size(); i++) {
|
||||
for (size_t i = 0; i < this->size(); i++) {
|
||||
this->at(i)->zeroSelf();
|
||||
}
|
||||
}
|
||||
void FullMatrixFullMatrixDouble::zeroSelf()
|
||||
{
|
||||
for (int i = 0; i < this->size(); i++) {
|
||||
for (size_t i = 0; i < this->size(); i++) {
|
||||
this->at(i)->zeroSelf();
|
||||
}
|
||||
}
|
||||
void FullMatrixFullColumnDouble::zeroSelf()
|
||||
{
|
||||
for (int i = 0; i < this->size(); i++) {
|
||||
for (size_t i = 0; i < this->size(); i++) {
|
||||
this->at(i)->zeroSelf();
|
||||
}
|
||||
}
|
||||
void FullMatrixDouble::identity() {
|
||||
this->zeroSelf();
|
||||
for (int i = 0; i < this->size(); i++) {
|
||||
for (size_t i = 0; i < this->size(); i++) {
|
||||
this->at(i)->at(i) = 1.0;
|
||||
}
|
||||
}
|
||||
void FullMatrixFullMatrixDouble::identity() {
|
||||
assert(false);
|
||||
// this->zeroSelf();
|
||||
// for (int i = 0; i < this->size(); i++) {
|
||||
// for (size_t i = 0; i < this->size(); i++) {
|
||||
// this->at(i)->at(i) = 1.0;
|
||||
// }
|
||||
}
|
||||
@@ -410,7 +410,7 @@ namespace MbD {
|
||||
}
|
||||
void FullMatrixDouble::atijputFullColumn(int i1, int j1, FColsptr<double> fullCol)
|
||||
{
|
||||
for (int ii = 0; ii < fullCol->size(); ii++)
|
||||
for (size_t ii = 0; ii < fullCol->size(); ii++)
|
||||
{
|
||||
this->at(i1 + ii)->at(j1) = fullCol->at(ii);
|
||||
}
|
||||
@@ -432,7 +432,7 @@ namespace MbD {
|
||||
double FullMatrixDouble::sumOfSquares()
|
||||
{
|
||||
double sum = 0.0;
|
||||
for (int i = 0; i < this->size(); i++)
|
||||
for (size_t i = 0; i < this->size(); i++)
|
||||
{
|
||||
sum += this->at(i)->sumOfSquares();
|
||||
}
|
||||
@@ -441,7 +441,7 @@ namespace MbD {
|
||||
double FullMatrixFullMatrixDouble::sumOfSquares()
|
||||
{
|
||||
double sum = 0.0;
|
||||
for (int i = 0; i < this->size(); i++)
|
||||
for (size_t i = 0; i < this->size(); i++)
|
||||
{
|
||||
sum += this->at(i)->sumOfSquares();
|
||||
}
|
||||
@@ -450,7 +450,7 @@ namespace MbD {
|
||||
double FullMatrixFullColumnDouble::sumOfSquares()
|
||||
{
|
||||
double sum = 0.0;
|
||||
for (int i = 0; i < this->size(); i++)
|
||||
for (size_t i = 0; i < this->size(); i++)
|
||||
{
|
||||
sum += this->at(i)->sumOfSquares();
|
||||
}
|
||||
@@ -482,14 +482,14 @@ namespace MbD {
|
||||
}
|
||||
void FullMatrixDouble::magnifySelf(double factor)
|
||||
{
|
||||
for (int i = 0; i < this->size(); i++) {
|
||||
for (size_t i = 0; i < this->size(); i++) {
|
||||
this->at(i)->magnifySelf(factor);
|
||||
}
|
||||
}
|
||||
std::ostream& FullMatrixDouble::printOn(std::ostream& s) const
|
||||
{
|
||||
s << "FullMat[" << std::endl;
|
||||
for (int i = 0; i < this->size(); i++)
|
||||
for (size_t i = 0; i < this->size(); i++)
|
||||
{
|
||||
s << *(this->at(i)) << std::endl;
|
||||
}
|
||||
@@ -558,7 +558,7 @@ namespace MbD {
|
||||
double FullMatrixDouble::trace()
|
||||
{
|
||||
double trace = 0.0;
|
||||
for (int i = 0; i < this->size(); i++)
|
||||
for (size_t i = 0; i < this->size(); i++)
|
||||
{
|
||||
trace += this->at(i)->at(i);
|
||||
}
|
||||
@@ -567,7 +567,7 @@ namespace MbD {
|
||||
double FullMatrixDouble::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)->maxMagnitude();
|
||||
if (max < element) max = element;
|
||||
@@ -577,7 +577,7 @@ namespace MbD {
|
||||
double FullMatrixFullMatrixDouble::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)->maxMagnitude();
|
||||
if (max < element) max = element;
|
||||
@@ -587,7 +587,7 @@ namespace MbD {
|
||||
double FullMatrixFullColumnDouble::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)->maxMagnitude();
|
||||
if (max < element) max = element;
|
||||
|
||||
Reference in New Issue
Block a user