// file: $isip/class/pr/SupportVectorMachine/svm_00.cc
//

// isip include files
//
#include "SupportVectorMachine.h"

// method: SupportVectorMachine
//
// arguments: none
//
// return: none
//
SupportVectorMachine::SupportVectorMachine() {

  // initialize the member data
  //
  penalty_d = DEF_PENALTY;
  tol_d = DEF_TOLERANCE;
  eps_d = DEF_EPSILON;
  bias_d = DEF_BIAS;
  max_points_d = DEF_MAX_POINTS;
  
  polynomial_degree_d = DEF_POLYNOMIAL_DEGREE;
  rbf_gamma_d = DEF_RBF_GAMMA;
  sigmoid_kappa_d = DEF_SIGMOID_KAPPA;
  sigmoid_delta_d = DEF_SIGMOID_DELTA;

  output_type_d = DEF_TYPE;
  algorithm_d = DEF_ALGORITHM;
  implementation_d = DEF_IMPLEMENTATION;  
}

//-----------------------------------------------------------------------------
//
// we define non-integral constants in the default constructor
//
//-----------------------------------------------------------------------------

// constants: required constants such as the class name
//
const String SupportVectorMachine::CLASS_NAME(L"SupportVectorMachine");

// constants: NameMap(s) for the enumerated values
//
const NameMap SupportVectorMachine::ALGO_MAP(L"SEQUENTIAL_MINIMAL_OPTIMIZATION");
const NameMap SupportVectorMachine::IMPL_MAP(L"LINEAR, POLYNOMIAL, RBF, SIGMOID");
const NameMap SupportVectorMachine::TYPE_MAP(L"TEXT, BINARY");

// constants: i/o related constants
//
const String SupportVectorMachine::DEF_PARAM(L"");
const String SupportVectorMachine::DEF_COMMENT_TAG(L"#");

const String SupportVectorMachine::PARAM_PENALTY(L"penalty");
const String SupportVectorMachine::PARAM_EPSILON(L"epsilon");
const String SupportVectorMachine::PARAM_TOLERANCE(L"tolerance");
const String SupportVectorMachine::PARAM_POLYNOMIAL_DEGREE(L"polynomial_degree");
const String SupportVectorMachine::PARAM_AUDIO_DB(L"audio_database");
const String SupportVectorMachine::PARAM_OUTPUT_TYPE(L"output_type");
const String SupportVectorMachine::PARAM_OUTPUT_FILE(L"output_file");
const String SupportVectorMachine::PARAM_RBF_GAMMA(L"rbf_gamma");
const String SupportVectorMachine::PARAM_SIGMOID_KAPPA(L"sigmoid_kappa");
const String SupportVectorMachine::PARAM_SIGMOID_DELTA(L"sigmoid_delta");
const String SupportVectorMachine::PARAM_ALGORITHM(L"algorithm");
const String SupportVectorMachine::PARAM_IMPLEMENTATION(L"implementation");

// static instantiations: memory manager and a permanent scratch space
//
MemoryManager SupportVectorMachine::mgr_d(sizeof(SupportVectorMachine), SupportVectorMachine::CLASS_NAME);
Integral::DEBUG SupportVectorMachine::debug_level_d = Integral::NONE;
Integral::DEBUG SupportVectorMachine::verbosity_d = Integral::NONE;
