// file: $isip_ifc/class/algo/Rps/rps_00.cc
// version: $Id: rps_00.cc 10484 2006-03-14 23:50:33Z srinivas $
//

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

//------------------------------------------------------------------------
//
// required public methods
//
//-----------------------------------------------------------------------

// method: clear
//
// arguments:
//  Integral::CMODE ctype: (input) clear mode
//
// return: a boolean value indicating status
//
// this method resets the data members to the default values
//
boolean Rps::clear(Integral::CMODE ctype_a) {

  // reset all protected data
  //
  if (ctype_a != Integral::RETAIN) {
    algorithm_d = DEF_ALGORITHM;
    implementation_d = DEF_IMPLEMENTATION;
    embed_dimension_d = DEF_EMBED_DIMENSION;
    svd_window_size_d = DEF_SVD_WINDOW_SIZE;
    delay_d = DEF_DELAY;
    svd_threshold_d = DEF_SVD_THRESHOLD;
  }
  
  // call the base clear method
  //
  return AlgorithmBase::clear(ctype_a);
}

//---------------------------------------------------------------------------
//
// class-specific public methods:
//  public methods required by the AlgorithmBase interface contract
//
//---------------------------------------------------------------------------

// method: assign
//
// arguments:
//  const AlgorithmBase& arg: (input) object to be assigned
//
// return: a boolean value indicating status
//
// this method assigns the input algorithm object to the current
// Rps object, if the input algorithm object is not an Rps
// object, it returns an error
//
boolean Rps::assign(const AlgorithmBase& arg_a) {

  // case: input is a Rps object
  //
  if (typeid(arg_a) == typeid(Rps)) {
    return assign((Rps&)arg_a);
  }

  // case: other
  //  if the input algorithm object is not a Rps object, return
  //  an error.
  //    
  else {
    return Error::handle(name(), L"assign", Error::ARG, __FILE__, __LINE__);
  }
}

// method: eq
//
// arguments:
//  const AlgorithmBase& arg: (input) object to be compared
//
// return: a boolean value indicating status
//
// this method checks whether the current Rps object is identical
// to the input algorithm object, if the input algorithm object is not
// an Rps object, it returns an error
//
boolean Rps::eq(const AlgorithmBase& arg_a) const {
  
  // case: input is a Rps object
  //
  if (typeid(arg_a) == typeid(Rps)) {
    return eq((Rps&)arg_a);
  }

  // case: other
  //  if the input algorithm object is not a Rps object, return
  //  an error.
  //    
  else {
    return Error::handle(name(), L"eq", Error::ARG, __FILE__, __LINE__);
  }
}

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

// constants: class name
//
const String Rps::CLASS_NAME(L"Rps");

// constants: i/o related constants
//
const String Rps::DEF_PARAM(L"");
const String Rps::PARAM_ALGORITHM(L"algorithm");
const String Rps::PARAM_IMPLEMENTATION(L"implementation");
const String Rps::PARAM_EMBED_DIMENSION(L"embed_dimension");
const String Rps::PARAM_SVD_WINDOW_SIZE(L"svd_window_size");
const String Rps::PARAM_DELAY(L"delay");
const String Rps::PARAM_SVD_THRESHOLD(L"svd_threshold");
const String Rps::PARAM_CMODE(L"compute_mode");

// constants: NameMap(s) for the enumerated values
//
const NameMap Rps::ALGO_MAP(L"TIME_DELAY_EMBEDDING, SVD_EMBEDDING");
const NameMap Rps::IMPL_MAP(L"EMBEDDING");

// static instantiations: memory manager
//
MemoryManager Rps::mgr_d(sizeof(Rps), Rps::name());


