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

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

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

// method: eq
//
// arguments:
//  const SupportVectorModel& arg: (input) dat ato copy
//
// return: a boolean value - true if objects are equivalent, false otherwise
//
// check whether the svm models are equal.
//
boolean SupportVectorModel::eq(const SupportVectorModel& arg_a) const {

  // check all the data members
  //
  if ((algorithm_d != arg_a.algorithm_d) ||
      (implementation_d != arg_a.implementation_d) ||
      !support_vectors_d.eq(arg_a.support_vectors_d) ||
      !kernels_d.eq(arg_a.kernels_d) ||
      !alphas_d.eq(arg_a.alphas_d) ||
      !bias_d.eq(arg_a.bias_d) ||
      !sigmoid_d.eq(arg_a.sigmoid_d)) {
    return false;
  }
  else {
    return true;
  }
}

// method: eq
//
// arguments:
//  const StatisticalModelBase& arg: (input) object to test
//
// return: a boolean value indicating equality
//
// this method is part of the StatisticalModelBase interface contract
// which compares two virtual model types
//
boolean SupportVectorModel::eq(const StatisticalModelBase& arg_a) const {

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









