Commit 0370cde4 authored by Manuel Grizonnet's avatar Manuel Grizonnet

WRG:avoid comparison between int and unsigned int

parent c24c078c
......@@ -73,7 +73,7 @@ FCLSUnmixingFunctor<TInput, TOutput, TPrecision>
const double Delta = 1.0E-6;
m_U = U;
m_N.set_size(U.rows() + 1, U.cols());
for (int r = 0; r < U.rows(); ++r)
for (unsigned int r = 0; r < U.rows(); ++r)
{
m_N.set_row(r, U.get_row(r));
}
......@@ -104,7 +104,7 @@ FCLSUnmixingFunctor<TInput, TOutput, TPrecision>
{
// TODO : support different types between input and output ?
VectorType inVector(in.Size());
for (int i = 0; i < in.GetSize(); i++ )
for (unsigned int i = 0; i < in.GetSize(); i++ )
{
inVector[i] = in[i];
}
......@@ -118,7 +118,7 @@ FCLSUnmixingFunctor<TInput, TOutput, TPrecision>
// Apply FCLS iterations
const double Delta = 1.0E-6;
VectorType s(nbBands + 1);
for (int r = 0; r < nbBands; ++r)
for (unsigned int r = 0; r < nbBands; ++r)
{
s[r] = inVector[r];
}
......@@ -127,7 +127,7 @@ FCLSUnmixingFunctor<TInput, TOutput, TPrecision>
VectorType lambda(nbEndmembers);
VectorType fclsVector = uclsVector;
VectorType correction(uclsVector.size());
for (int i = 0; i < m_MaxIteration; ++i)
for (unsigned int i = 0; i < m_MaxIteration; ++i)
{
// Error in original paper : divergence
// lambda = m_Nt * (s - m_N * fclsVector);
......@@ -138,7 +138,7 @@ FCLSUnmixingFunctor<TInput, TOutput, TPrecision>
}
OutputType out(fclsVector.size());
for (int i = 0; i < out.GetSize(); i++ )
for (unsigned int i = 0; i < out.GetSize(); i++ )
{
out[i] = fclsVector[i];
}
......
......@@ -91,7 +91,7 @@ ISRAUnmixingFunctor<TInput, TOutput, TPrecision>
{
// TODO : support different types between input and output ?
VectorType inVector(in.Size());
for (int i = 0; i < in.GetSize(); i++ )
for (unsigned int i = 0; i < in.GetSize(); i++ )
{
inVector[i] = in[i];
}
......@@ -103,23 +103,23 @@ ISRAUnmixingFunctor<TInput, TOutput, TPrecision>
unsigned int nbBands = in.Size();
// Apply ISRA iterations
for (int i = 0; i < m_MaxIteration; ++i)
for (unsigned int i = 0; i < m_MaxIteration; ++i)
{
// Use a temporary storage since it is used
// inside the iterations
VectorType outVectorNew = outVector;
for (int e = 0; e < nbEndmembers; ++e)
for (unsigned int e = 0; e < nbEndmembers; ++e)
{
PrecisionType numerator = 0;
PrecisionType denominator = 0;
for (int b = 0; b < nbBands; ++b)
for (unsigned int b = 0; b < nbBands; ++b)
{
numerator += in[b] * m_U(b, e);
PrecisionType dot = 0;
for (int s = 0; s < nbEndmembers; ++s)
for (unsigned int s = 0; s < nbEndmembers; ++s)
{
// Use outVector from previous iteration here
dot += m_U(b, s) * outVector[s];
......@@ -135,7 +135,7 @@ ISRAUnmixingFunctor<TInput, TOutput, TPrecision>
}
OutputType out(outVector.size());
for (int i = 0; i < out.GetSize(); i++ )
for (unsigned int i = 0; i < out.GetSize(); i++ )
{
out[i] = outVector[i];
}
......
......@@ -93,7 +93,7 @@ NCLSUnmixingFunctor<TInput, TOutput, TPrecision>
{
// TODO : support different types between input and output ?
VectorType inVector(in.Size());
for (int i = 0; i < in.GetSize(); i++ )
for (unsigned int i = 0; i < in.GetSize(); i++ )
{
inVector[i] = in[i];
}
......@@ -109,7 +109,7 @@ NCLSUnmixingFunctor<TInput, TOutput, TPrecision>
VectorType nclsVector = uclsVector;
VectorType correction(uclsVector.size());
for (int i = 0; i < m_MaxIteration; ++i)
for (unsigned int i = 0; i < m_MaxIteration; ++i)
{
// Error in original paper : divergence
// lambda = m_Ut * (inVector - m_U * nclsVector);
......@@ -120,7 +120,7 @@ NCLSUnmixingFunctor<TInput, TOutput, TPrecision>
}
OutputType out(nclsVector.size());
for (int i = 0; i < out.GetSize(); i++ )
for (unsigned int i = 0; i < out.GetSize(); i++ )
{
out[i] = nclsVector[i];
}
......
......@@ -74,7 +74,7 @@ public:
{
// TODO : support different types between input and output ?
VectorType inVector(in.Size());
for (int i = 0; i < in.GetSize(); i++ )
for (unsigned int i = 0; i < in.GetSize(); i++ )
{
inVector[i] = in[i];
}
......@@ -82,7 +82,7 @@ public:
VectorType outVector = m_Inv * inVector;
OutputType out(outVector.size());
for (int i = 0; i < out.GetSize(); i++ )
for (unsigned int i = 0; i < out.GetSize(); i++ )
{
out[i] = outVector[i];
}
......
......@@ -368,7 +368,7 @@ void VCAImageFilter<TImage>::GenerateData()
{
vnl_vector<PrecisionType> e = E.get_column(i);
typename VectorImageType::PixelType pixel(input->GetNumberOfComponentsPerPixel());
for (int j = 0; j < e.size(); j++)
for (unsigned int j = 0; j < e.size(); j++)
{
pixel[j] = E(j, i);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment