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

// system include files
//
#include <typeinfo>

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

// method: assign
//
// arguments:
//  const SupportVectorModel& arg: (input) data to copy
//
// return: a boolean value indicating status
//
// copy the input model to current model
//
boolean SupportVectorModel::assign(const SupportVectorModel& arg_a) {

  // assign the algorithm and implementation
  //
  algorithm_d = arg_a.algorithm_d;
  implementation_d = arg_a.implementation_d;

  // assign the machine parameters
  //
  support_vectors_d = arg_a.support_vectors_d;
  kernels_d = arg_a.kernels_d;
  alphas_d = arg_a.alphas_d;
  bias_d = arg_a.bias_d;
  sigmoid_d = arg_a.sigmoid_d;

  // exit gracefully
  //
  return true;
}

// method: assign
//
// arguments:
//  const StatisticalModelBase& arg: (input) object to assign
//
// return: a boolean value
//
// this method assigns input argument to current argument
//
boolean SupportVectorModel::assign(const StatisticalModelBase& arg_a) {

  if (typeid(arg_a) == typeid(SupportVectorModel)) {
    return assign((SupportVectorModel&)arg_a);
  }
  else {
    return Error::handle(name(), L"assign", Error::ARG, __FILE__, __LINE__);
  }
}
