Exemplo n.º 1
0
//------------
// Constructor
//------------
// copy constructor
XEMBinaryParameter::XEMBinaryParameter(const XEMBinaryParameter * iParameter):XEMParameter(iParameter){

  // tab modality //
  _tabNbModality = copyTab(iParameter->getTabNbModality(), _pbDimension);

  // total number of modality //
  _totalNbModality = iParameter->getTotalNbModality();

  // Centers
  _tabCenter  = copyTab(iParameter->getTabCenter(), _nbCluster, _pbDimension);

}
Exemplo n.º 2
0
SudokuBoard::SudokuBoard(const SudokuBoard& tocopy){

    this->c     = tocopy.c;
    this->level = tocopy.level;
    this->tab   = copyTab(tocopy.tab);

}
Exemplo n.º 3
0
//------------
// Constructor (if USER initialisation)
//------------
XEMBinaryParameter::XEMBinaryParameter(int64_t iNbCluster, int64_t iPbDimension, XEMModelType * iModelType, int64_t * tabNbModality):XEMParameter(iNbCluster,iPbDimension,iModelType){
  int64_t j, k;

  // tab modality //
  _tabNbModality = copyTab(tabNbModality,_pbDimension);

  // total number of modality //
  _totalNbModality = 0;
  for (j=0; j<_pbDimension; j++){
    _totalNbModality += _tabNbModality[j];
  }

  // Centers
  _tabCenter     = new int64_t*[_nbCluster];
  for (k=0; k<_nbCluster; k++){
    _tabCenter[k]  = new int64_t[_pbDimension];
    for (j=0; j<_pbDimension; j++){
      _tabCenter[k][j] = 0;
    }
  }

  if (hasFreeProportion(iModelType->_nameModel)) {
    _freeProportion = true;
  }
  else{
    _freeProportion = false;
  }

}
Exemplo n.º 4
0
//------------
// Constructor
//------------
XEMModel::XEMModel(XEMModel * iModel) {
    _deleteData = true;
    _nbCluster              = iModel->getNbCluster();
    _nbSample               = iModel->getNbSample();
    _algoName = iModel->_algoName;
    XEMModelType * iModelType = iModel->getParameter()->getModelType();
    XEMModelName iModelName = iModelType->_nameModel;

    if ( isBinary(iModelName )) {
        XEMBinaryData * bD = (XEMBinaryData*)(iModel->getData());
        _data = new XEMBinaryData(*bD);
    }
    else {
        XEMGaussianData * gD = (XEMGaussianData*)(iModel->getData());
        _data = new XEMGaussianData(*gD);
    }

    _tabFik      = copyTab(iModel->getTabFik()     , _nbSample, _nbCluster);
    _tabSumF     = copyTab(iModel->getTabSumF()    , _nbSample);
    _tabTik      = copyTab(iModel->getTabTik()     , _nbSample, _nbCluster);
    _tabZikKnown = copyTab(iModel->getTabZikKnown(), _nbSample,_nbCluster);
    _tabZiKnown = copyTab(iModel->getTabZiKnown(), _nbSample);
    _tabCik      = copyTab(iModel->getTabCik()     , _nbSample, _nbCluster);
    _tabNk       = copyTab(iModel->getTabNk()      , _nbCluster);

    _parameter   = (iModel->getParameter())->clone();
    _parameter->setModel(this);

}
Exemplo n.º 5
0
SudokuBoard& SudokuBoard::operator=(SudokuBoard board){
    if(&board == this) //self-assignment a=a
        return *this;

    this->c = board.c;
    this->level = board.level;
    clear(this->tab);
    this->tab = copyTab(board.tab);
return *this;
}
Exemplo n.º 6
0
//------------
// Constructor (copy)
//------------
XEMGaussianParameter::XEMGaussianParameter(const XEMGaussianParameter * iParameter):XEMParameter(iParameter){
  int64_t  k;
  _tabMean              = new double*[_nbCluster];
  double ** iTabMean           = iParameter->getTabMean();
  for (k=0; k<_nbCluster; k++){
    _tabMean[k]            = copyTab(iTabMean[k],_pbDimension);
  }
  _tabWk              = new XEMMatrix* [_nbCluster];
  //_tabSigma           = new XEMMatrix* [_nbCluster];

}