
#include <stdio.h>
#include <stdlib.h>

#include <vislearning/cbaselib/LabeledSet.h>

using namespace std;
using namespace OBJREC;
using namespace NICE;

int main ( int argc, char **argv )
{

  Config conf ( argc, argv );

  string setfn = conf.gS ( "main", "set", "train.vec" );
  int format = conf.gI ( "main", "format", 2 );

  LabeledSetVector set;

  set.read ( setfn, format );

  set.printInformation();

  double maximum_value = - numeric_limits<double>::max();
  double minimum_value = numeric_limits<double>::max();
  double maximum_norm = 0;
  double minimum_norm = numeric_limits<double>::max();

  LOOP_ALL ( set )
  {
    EACH ( classno, x );

    if ( x.Max() > maximum_value )
      maximum_value = x.Max();

    if ( x.Min() < minimum_value )
      minimum_value = x.Min();

    if ( x.normL2() > maximum_norm )
      maximum_norm = x.normL2();

    if ( x.normL2() < minimum_norm )
      minimum_norm = x.normL2();

  }

  fprintf ( stderr, "min value: %f\n", minimum_value );
  fprintf ( stderr, "max value: %f\n", maximum_value );
  fprintf ( stderr, "min L2-norm: %f\n", minimum_norm );
  fprintf ( stderr, "max L2-norm: %f\n", maximum_norm );
  fprintf ( stderr, "dimension: %d\n", set.dimension() );
}
