I apologize that I don't have the time =
to look into this further but I thought I should post a bug to users.

I was getting very strange results and tracked the issue down to us=
ing vnl_vector<T>::arg_min(); the result was sometimes incorrect. Loo=
king further lead me to vnl_c_vector and and the underlying sse implementat=
ion of arg_min.I wrote a small program to test the arg_min implementation (=
I found that the arg_min was failing on a vector with these particular elem=
ent values).

#include<vcl_iostream.h>

#include"vnl= /vnl_vector.h"

unsigned myargmin(vnl_vector<float> const& v){

=C2=A0 unsi= gned idx =3D 0;

=C2=A0 float val =3D v[0];

=C2=A0 for(unsigned i =3D = 1; i < v.size(); ++i)

=C2=A0=C2=A0=C2=A0 if(v[i] < val)

=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 idx =3D i;

=C2=A0 return idx;

}

int main(){

=C2=A0 vnl_vector<float> v(4);

=C2=A0 v[0]= =3D 40; v[1] =3D 28; v[2] =3D 10; v[3] =3D 5;

=C2=A0 vcl_cout <&= lt; v.arg_min() << vcl_endl;

=C2=A0 vcl_cout << myargmin= (v) << vcl_endl;

}

#include<vcl_iostream.h>

#include"vnl= /vnl_vector.h"

unsigned myargmin(vnl_vector<float> const& v){

=C2=A0 unsi= gned idx =3D 0;

=C2=A0 float val =3D v[0];

=C2=A0 for(unsigned i =3D = 1; i < v.size(); ++i)

=C2=A0=C2=A0=C2=A0 if(v[i] < val)

=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 idx =3D i;

=C2=A0 return idx;

}

int main(){

=C2=A0 vnl_vector<float> v(4);

=C2=A0 v[0]= =3D 40; v[1] =3D 28; v[2] =3D 10; v[3] =3D 5;

=C2=A0 vcl_cout <&= lt; v.arg_min() << vcl_endl;

=C2=A0 vcl_cout << myargmin= (v) << vcl_endl;

}

When sse is enabled, the arg_min is 0 and myargmin is 3=
.

When sse is disabled, the argmin is 3 and myargmin is 3.

When sse is disabled, the argmin is 3 and myargmin is 3.

I'm using clang with CMAKE_CXX_FLAGS=3D"-Werror=3Dgnu -st=
d=3Dc++0x -fPIC".

I'm attaching the output of "cmake -LA | tee cmake_var.txt&quo= t;

I'm attaching the output of "cmake -LA | tee cmake_var.txt&quo= t;

I'm also attaching the output of cat /proc/cpuinfo=
> cpuinfo.txt in case that helps with the sse problem.