// file: $isip/class/stat/SupportVectorModel/svm_01.cc
// version: $Id: svm_01.cc 8764 2002-10-26 19:45:56Z jelinek $
//

// isip include files
//
#include "SupportVectorModel.h"
#include <Console.h>

// method: debug
//
// arguments:
//  const unichar* msg: (input) message to print
//
// return: boolean value indicating status
//
// this is the debug method
//
boolean SupportVectorModel::debug(const unichar* msg_a) const {

  // declare local variables
  //
  String value;
  String output;

  // output an information message
  //
  output.debugStr(name(), msg_a, L":");
  Console::put(output);
  Console::increaseIndention();

  // display the algorithm name
  //
  output.debugStr(name(), msg_a, L"algorithm_d",
		  ALGO_MAP.getName((long)algorithm_d));
  Console::put(output);

  // display the implementation name
  //
  output.debugStr(name(), msg_a, L"implementation_d",
		  IMPL_MAP.getName((long)implementation_d));
  Console::put(output);

  // output range information
  //
  Console::put(L"displaying support_vectors_d:");
  Console::increaseIndention();
  support_vectors_d.debug(L"support_vectors_d");
  Console::decreaseIndention();

  Console::put(L"displaying kernels_d:");
  Console::increaseIndention();
  kernels_d.debug(L"kernels_d");
  Console::decreaseIndention();

  Console::put(L"displaying alphas_d:");
  Console::increaseIndention();
  alphas_d.debug(L"alphas_d");
  Console::decreaseIndention();

  Console::put(L"displaying bias_d:");
  Console::increaseIndention();
  bias_d.debug(L"bias_d");
  Console::decreaseIndention();

  if (implementation_d == SIGMOID) {
    Console::put(L"displaying sigmoid_d:");
    Console::increaseIndention();
    sigmoid_d.debug(L"sigmoid_d");
    Console::decreaseIndention();
  }
  else {
    return Error::handle(name(), L"debug",
			 Error::NOT_IMPLEM, __FILE__, __LINE__);
  }

  // output the computation mode information
  //
  output.debugStr(name(), msg_a, L"mode_d", MODE_MAP((ushort)mode_d));
  Console::put(output);
  
  value.assign(is_valid_d);
  output.debugStr(name(), msg_a, L"is_valid_d", value);
  Console::put(output);

  // decrease indention
  //
  Console::decreaseIndention();

  // exit gracefully
  //
  return true;
}
