// file: $isip_ifc/class/algo/CorrelationEntropy/correntp_00.cc
// version: $Id: correntp_00.cc
//

// isip include files
//
#include "CorrelationEntropy.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 CorrelationEntropy::clear(Integral::CMODE ctype_a) {

  // reset all protected data
  //
  if (ctype_a != Integral::RETAIN) {
    algorithm_d = DEF_ALGORITHM;
    implementation_d = DEF_IMPLEMENTATION;
    embedding_d = DEF_EMBEDDING;
    epsilon_d = DEF_EPSILON;
    embed_dim_min_d = DEF_EMBED_DIM_MIN;
    embed_dim_max_d = DEF_EMBED_DIM_MAX;
    theiler_correction_d = DEF_THEILER_CORRECTION;
    delay_d = DEF_DELAY;
    svd_window_size_d = DEF_SVD_WINDOW_SIZE;
  }
  
  // call the base clear method
  //
  return AlgorithmBase::clear(ctype_a);
}

// 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
// CorrelationEntropy object, if the input algorithm object is not a
// CorrelationEntropy object, it returns an error
//
boolean CorrelationEntropy::assign(const AlgorithmBase& arg_a) {

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

  // case: other
  //  if the input algorithm object is not a CorrelationEntropy 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 CorrelationEntropy object is identical
// to the input algorithm object, if the input algorithm object is not
// an CorrelationEntropy object, it returns an error
//
boolean CorrelationEntropy::eq(const AlgorithmBase& arg_a) const {
  
  // case: input is a CorrelationEntropy object
  //
  if (typeid(arg_a) == typeid(CorrelationEntropy)) {
    return eq((CorrelationEntropy&)arg_a);
  }

  // case: other
  //  if the input algorithm object is not a CorrelationEntropy 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 CorrelationEntropy::CLASS_NAME(L"CorrelationEntropy");

// constants: i/o related constants
//
const String CorrelationEntropy::DEF_PARAM(L"");
const String CorrelationEntropy::PARAM_ALGORITHM(L"algorithm");
const String CorrelationEntropy::PARAM_IMPLEMENTATION(L"implementation");
const String CorrelationEntropy::PARAM_EMBEDDING(L"embedding");
const String CorrelationEntropy::PARAM_EPSILON(L"epsilon");
const String CorrelationEntropy::PARAM_EMBED_DIM_MIN(L"embed_dim_min");
const String CorrelationEntropy::PARAM_EMBED_DIM_MAX(L"embed_dim_max");
const String CorrelationEntropy::PARAM_THEILER_CORRECTION(L"theiler_correction");
const String CorrelationEntropy::PARAM_DELAY(L"delay");
const String CorrelationEntropy::PARAM_SVD_WINDOW_SIZE(L"svd_window_size");

// constants: NameMap(s) for the enumerated values
//
const NameMap CorrelationEntropy::ALGO_MAP(L"NORMAL");
const NameMap CorrelationEntropy::IMPL_MAP(L"CORRELATION_INTEGRAL");
const NameMap CorrelationEntropy::EMBED_MAP(L"TIME_DELAY");

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


