コード例 #1
0
ファイル: cell.cpp プロジェクト: ToughLife/libpabod
void Cell::loadCell (matvar_t *matVar, int i)
{
  loadType (matVar, i);
  loadLhs (matVar, i);
  loadDetwindow (matVar, i);
  loadI (matVar, i);
  loadOffset (matVar, i);

  // Type of structure 1 (last field called def)
  if ( matVar->dims[0] == 1 && matVar->dims[1] == 1 )
  {
    setFlagStr(STR_DEF);
    loadRhs (matVar, i);
    loadDef (matVar, i);
  }

  // Type of structure 2 (last field called anchor)
  else if ( vectorLength(matVar) > 1 )
  {
    setFlagStr(STR_ANCHOR);
    loadRhs (matVar, i, false);
    loadAnchor (matVar, i);
  }

  _IxDim = -1;
  _Ix = NULL;

  _IyDim = -1;
  _Iy = NULL;

  _scoreDim = -1;
  _score = NULL;
}
コード例 #2
0
ファイル: SUSY.cpp プロジェクト: silvest/HEPfit
bool SUSY::InitializeModel()
{
    if (!flag_h) mySUSYSpectrum = new SUSYSpectrum(*this);
    else mySUSYSpectrum = NULL;
/* BEGIN: REMOVE FROM THE PACKAGE */
    if (flag_h) myFH = new FeynHiggsWrapper(*this);
    else myFH = NULL;
/* END: REMOVE FROM THE PACKAGE */
    myEWSUSY = new EWSUSY(*this);
    setFlagStr("Mw", "NORESUM");
    setModelInitialized(StandardModel::InitializeModel());
    setModelSUSY();
    return(true);
}
コード例 #3
0
ファイル: cell.cpp プロジェクト: ToughLife/libpabod
void Cell::loadEmptyCell ()
{
  setFlagStr(INVALID_STR);

  setType (0);

  setLhs (-1);

  _rhsDim = -1;
  _rhs = NULL;

  _detwindow = NULL;

  setI(-1);

  getOffset().w = -1;
  getOffset().blocklabel = -1;

  _anchorDim = -1;
  _anchor = NULL;

  for (int i = 0; i < 4; i++)
    getDef().w[i] = -1;

  getDef().blocklabel = -1;
  getDef().flip = false;
  getDef().symmetric = 0;

  _scoreDim = -1;
  _score = NULL;

  _IxDim = -1;
  _Ix = NULL;

  _IyDim = -1;
  _Iy = NULL;
}
コード例 #4
0
ファイル: cell.cpp プロジェクト: ToughLife/libpabod
void Cell::destroyCell ()
{
  if (getFlagStr() != INVALID_STR)
  {
    if (_rhs != NULL)
    {
      if (getRhsDim() > 1)
        delete[] _rhs;

      else
        delete _rhs;

      _rhs = NULL;
    }

    if (_detwindow != NULL)
    {
      delete[] _detwindow;
      _detwindow = NULL;
    }

    if (getFlagStr() == STR_ANCHOR)
    {
      if (_anchor != NULL)
      {
        for (int i = 0; i < getAnchorDim(); i++)
        {
          if (getAnchor()[i].array != NULL)
          {
            delete[] getAnchor()[i].array;
            getAnchor()[i].array = NULL;
          }
        }

        delete[] _anchor;
        _anchor = NULL;
      } 

      if (_score != NULL)
      {
        for (int i = 0; i < getScoreDim(); i++)
        {
          if (_score[i] != NULL)
          {
            cvReleaseMat (&_score[i]);
            _score[i] = NULL;
          }
        }
      
        delete[] _score;
        _score = NULL;
      }
    }

    if (_Ix != NULL)
    {
      for (int i = 0; i < getIxDim(); i++)
      {
        if (_Ix[i] != NULL)
        {
          cvReleaseMat (&_Ix[i]);
          _Ix[i] = NULL;
        }
      }

      delete[] _Ix;
      _Ix = NULL;
    }

    if (_Iy != NULL)
    {
      for (int i = 0; i < getIyDim(); i++)
      {
        if (_Iy[i] != NULL)
        {
          cvReleaseMat (&_Iy[i]);
          _Iy[i] = NULL;
        }
      }

      delete[]_Iy;
      _Iy = NULL;
    }
  }

  setFlagStr (INVALID_STR);
}