您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GMX_RELEASE_ASSERT函数代码示例

51自学网 2021-06-01 20:53:35
  C++
这篇教程C++ GMX_RELEASE_ASSERT函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中GMX_RELEASE_ASSERT函数的典型用法代码示例。如果您正苦于以下问题:C++ GMX_RELEASE_ASSERT函数的具体用法?C++ GMX_RELEASE_ASSERT怎么用?C++ GMX_RELEASE_ASSERT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了GMX_RELEASE_ASSERT函数的24个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: GMX_RELEASE_ASSERT

voidAnalysisDataDisplacementModule::setMSDHistogram(AnalysisDataBinAverageModule *histm){    GMX_RELEASE_ASSERT(!_impl->histm, "Can only set MSD histogram once");    _impl->histm = histm;    histm->setIgnoreMissing(true);    addModule(histm);}
开发者ID:alexholehouse,项目名称:gromacs,代码行数:8,


示例2: GMX_RELEASE_ASSERT

AnalysisDataHandleTrajectoryAnalysisModuleData::dataHandle(const AnalysisData &data){    Impl::HandleContainer::const_iterator i = impl_->handles_.find(&data);    GMX_RELEASE_ASSERT(i != impl_->handles_.end(),                       "Data handle requested on unknown dataset");    return i->second;}
开发者ID:MelroLeandro,项目名称:gromacs,代码行数:8,


示例3: GMX_RELEASE_ASSERT

void TopologyManager::initUniformMolecules(int moleculeSize){    GMX_RELEASE_ASSERT(mtop_ != nullptr, "Topology not initialized");    GMX_RELEASE_ASSERT(mtop_->molblock.size() == 1, "initUniformMolecules only implemented for a single molblock");    gmx_molblock_t &molblock = mtop_->molblock[0];    t_atoms        &atoms    = mtop_->moltype[molblock.type].atoms;    GMX_RELEASE_ASSERT(atoms.nr % moleculeSize == 0,                       "The number of atoms should be a multiple of moleculeSize");    molblock.nmol  = atoms.nr/moleculeSize;    atoms.nr       = moleculeSize;    const int nres = atoms.atom[atoms.nr].resind;    GMX_RELEASE_ASSERT(atoms.atom[atoms.nr-1].resind != nres,                       "The residues should break at molecule boundaries");    atoms.nres                 = nres;    mtop_->haveMoleculeIndices = true;    gmx_mtop_finalize(mtop_.get());}
开发者ID:friforever,项目名称:gromacs,代码行数:17,


示例4: GMX_RELEASE_ASSERT

voidAnalysisDataDisplacementModule::setMSDHistogram(        AnalysisDataBinAverageModulePointer histm){    GMX_RELEASE_ASSERT(_impl->histm == NULL, "Can only set MSD histogram once");    _impl->histm = histm.get();    addModule(histm);}
开发者ID:pslacerda,项目名称:gromacs,代码行数:8,


示例5: GMX_RELEASE_ASSERT

void OptionsAssigner::finishSection(){    // Should only be called if we are in a subsection.    GMX_RELEASE_ASSERT(impl_->inSection(), "startSection() not called");    Impl::Section *section = impl_->sectionStack_.back();    section->finish();    impl_->sectionStack_.pop_back();}
开发者ID:friforever,项目名称:gromacs,代码行数:8,


示例6: GMX_RELEASE_ASSERT

voidAbstractAnalysisArrayData::setColumnCount(int ncols){    GMX_RELEASE_ASSERT(!isAllocated(),                       "Cannot change column count after data has been allocated");    AbstractAnalysisData::setColumnCount(0, ncols);    pointSetInfo_ = AnalysisDataPointSetInfo(0, ncols, 0, 0);}
开发者ID:MelroLeandro,项目名称:gromacs,代码行数:8,


示例7: removeExtraSpaces

/*! /brief Replace duplicated spaces with a single one in string * * Only the first character will be kept for multiple adjacent characters that * are both identical and where the first one returns true for isspace(). * * /param str String that will be modified. */static voidremoveExtraSpaces(std::string *str){    GMX_RELEASE_ASSERT(str != nullptr, "A pointer to an actual string must be provided");    std::string::iterator newEnd =        std::unique( str->begin(), str->end(), [ = ](char a, char b){ return isspace(a) != 0 && (a == b); } );    str->erase(newEnd, str->end());}
开发者ID:friforever,项目名称:gromacs,代码行数:15,


示例8: GMX_RELEASE_ASSERT

voidAnalysisDataModuleManager::applyModule(AbstractAnalysisData        *data,                                       AnalysisDataModuleInterface *module){    impl_->checkModuleProperties(*module);    GMX_RELEASE_ASSERT(impl_->state_ == Impl::eFinished,                       "Data module can only be applied to ready data");    impl_->presentData(data, module);}
开发者ID:ElsevierSoftwareX,项目名称:SOFTX-D-15-00003,代码行数:9,


示例9: gmx_omp_nthreads_set

voidgmx_omp_nthreads_set(int mod, int nthreads){    /* Catch an attempt to set the number of threads on an invalid     * OpenMP module. */    GMX_RELEASE_ASSERT(mod >= 0 && mod < emntNR, "Trying to set nthreads on invalid OpenMP module");    modth.nth[mod] = nthreads;}
开发者ID:friforever,项目名称:gromacs,代码行数:9,


示例10: GMX_RELEASE_ASSERT

void AbstractOptionStorage::finish(){    GMX_RELEASE_ASSERT(!bInSet_, "finishSet() not called");    processAll();    if (isRequired() && !(isSet() || hasFlag(efOption_ExplicitDefaultValue)))    {        GMX_THROW(InvalidInputError("Option is required, but not set"));    }}
开发者ID:alwanderer,项目名称:gromacs,代码行数:9,


示例11: _gmx_sel_mempool_reserve

void_gmx_sel_mempool_reserve(gmx_sel_mempool_t *mp, size_t size){    GMX_RELEASE_ASSERT(mp->nblocks == 0,                       "Cannot reserve memory pool when there is something allocated");    GMX_RELEASE_ASSERT(!mp->buffer, "Cannot reserve memory pool twice");    if (size == 0)    {        size = mp->maxsize;    }    mp->buffer = (char *)malloc(size);    if (!mp->buffer)    {        throw std::bad_alloc();    }    mp->freesize = size;    mp->freeptr  = mp->buffer;}
开发者ID:alexholehouse,项目名称:gromacs,代码行数:18,


示例12: dd_collect_state

void dd_collect_state(gmx_domdec_t *dd,                      const t_state *state_local, t_state *state){    int nh = state_local->nhchainlength;    if (DDMASTER(dd))    {        GMX_RELEASE_ASSERT(state->nhchainlength == nh, "The global and local Nose-Hoover chain lengths should match");        for (int i = 0; i < efptNR; i++)        {            state->lambda[i] = state_local->lambda[i];        }        state->fep_state = state_local->fep_state;        state->veta      = state_local->veta;        state->vol0      = state_local->vol0;        copy_mat(state_local->box, state->box);        copy_mat(state_local->boxv, state->boxv);        copy_mat(state_local->svir_prev, state->svir_prev);        copy_mat(state_local->fvir_prev, state->fvir_prev);        copy_mat(state_local->pres_prev, state->pres_prev);        for (int i = 0; i < state_local->ngtc; i++)        {            for (int j = 0; j < nh; j++)            {                state->nosehoover_xi[i*nh+j]        = state_local->nosehoover_xi[i*nh+j];                state->nosehoover_vxi[i*nh+j]       = state_local->nosehoover_vxi[i*nh+j];            }            state->therm_integral[i] = state_local->therm_integral[i];        }        for (int i = 0; i < state_local->nnhpres; i++)        {            for (int j = 0; j < nh; j++)            {                state->nhpres_xi[i*nh+j]        = state_local->nhpres_xi[i*nh+j];                state->nhpres_vxi[i*nh+j]       = state_local->nhpres_vxi[i*nh+j];            }        }        state->baros_integral = state_local->baros_integral;    }    if (state_local->flags & (1 << estX))    {        gmx::ArrayRef<gmx::RVec> globalXRef = state ? makeArrayRef(state->x) : gmx::EmptyArrayRef();        dd_collect_vec(dd, state_local, makeConstArrayRef(state_local->x), globalXRef);    }    if (state_local->flags & (1 << estV))    {        gmx::ArrayRef<gmx::RVec> globalVRef = state ? makeArrayRef(state->v) : gmx::EmptyArrayRef();        dd_collect_vec(dd, state_local, makeConstArrayRef(state_local->v), globalVRef);    }    if (state_local->flags & (1 << estCGP))    {        gmx::ArrayRef<gmx::RVec> globalCgpRef = state ? makeArrayRef(state->cg_p) : gmx::EmptyArrayRef();        dd_collect_vec(dd, state_local, makeConstArrayRef(state_local->cg_p), globalCgpRef);    }}
开发者ID:friforever,项目名称:gromacs,代码行数:57,


示例13: GMX_RELEASE_ASSERT

void OptionsAssigner::appendValue(const std::string &value){    AbstractOptionStorage *option = _impl->_currentOption;    GMX_RELEASE_ASSERT(option != NULL, "startOption() not called");    // Does not count correctly, but the actual count is not really used.    // TODO: Rename the variable to better reflect the usage.    ++_impl->_currentValueCount;    option->appendValue(value);}
开发者ID:alexholehouse,项目名称:gromacs,代码行数:9,


示例14: GMX_RELEASE_ASSERT

/*! /internal * This method is not const because the dataStarted() methods of the attached * modules can request storage of the data. */voidAbstractAnalysisData::notifyDataStart(){    GMX_RELEASE_ASSERT(!impl_->bDataStart_,                       "notifyDataStart() called more than once");    GMX_RELEASE_ASSERT(columnCount_ > 0, "Data column count is not set");    impl_->bDataStart_ = impl_->bInData_ = true;    Impl::ModuleList::const_iterator i;    for (i = impl_->modules_.begin(); i != impl_->modules_.end(); ++i)    {        if (columnCount_ > 1 && !((*i)->flags() & AnalysisDataModuleInterface::efAllowMulticolumn))        {            GMX_THROW(APIError("Data module not compatible with data object properties"));        }        (*i)->dataStarted(this);    }}
开发者ID:enasyunis,项目名称:gromacs,代码行数:22,


示例15: GMX_RELEASE_ASSERT

void UpdateGroupsCog::addCogs(gmx::ArrayRef<const int>        globalAtomIndices,                              gmx::ArrayRef<const gmx::RVec>  coordinates){    const int    localAtomBegin = cogIndices_.size();    const size_t cogBegin       = cogs_.size();    GMX_RELEASE_ASSERT(globalAtomIndices.size() >= localAtomBegin,                       "addCogs should only be called to add COGs to the list that is already present (which could be empty)");    cogIndices_.reserve(globalAtomIndices.size());    int moleculeBlock = 0;    for (int localAtom = localAtomBegin; localAtom < globalAtomIndices.size(); localAtom++)    {        const int   globalAtom = globalAtomIndices[localAtom];        int         moleculeIndex;        int         atomIndexInMolecule;        mtopGetMolblockIndex(&mtop_, globalAtom,                             &moleculeBlock, &moleculeIndex, &atomIndexInMolecule);        const auto &indicesForBlock        = indicesPerMoleculeblock_[moleculeBlock];        int         globalUpdateGroupIndex =            indicesForBlock.groupStart_ +            moleculeIndex*indicesForBlock.numGroupsPerMolecule_ +            indicesForBlock.groupIndex_[atomIndexInMolecule];        if (const int *cogIndexPtr = globalToLocalMap_.find(globalUpdateGroupIndex))        {            GMX_ASSERT(static_cast<size_t>(*cogIndexPtr) >= cogBegin,                       "Added atoms should not be part of previously present groups");            cogIndices_.push_back(*cogIndexPtr);            cogs_[*cogIndexPtr] += coordinates[localAtom];            numAtomsPerCog_[*cogIndexPtr]++;        }        else        {            const int cogIndex = cogs_.size();            globalToLocalMap_.insert(globalUpdateGroupIndex, cogIndex);            cogIndices_.push_back(cogIndex);            cogs_.push_back(coordinates[localAtom]);            numAtomsPerCog_.push_back(1);        }    }    /* Divide sum of coordinates for each COG by the number of atoms */    for (size_t i = cogBegin; i < cogs_.size(); i++)    {        const int numAtoms = numAtomsPerCog_[i];        if (numAtoms > 1)        {            cogs_[i] /= numAtoms;        }    }}
开发者ID:friforever,项目名称:gromacs,代码行数:56,


示例16: GMX_RELEASE_ASSERT

bool File::isInteractive() const{    GMX_RELEASE_ASSERT(impl_->fp_ != NULL,                       "Attempted to access a file object that is not open");#ifdef HAVE_UNISTD_H    return isatty(fileno(impl_->fp_));#else    return true;#endif}
开发者ID:FoldingAtHome,项目名称:gromacs,代码行数:10,


示例17: GMX_RELEASE_ASSERT

void TimeUnitBehavior::setTimeUnit(TimeUnit timeUnit){    GMX_RELEASE_ASSERT(timeUnit >= 0 && timeUnit <= TimeUnit_s,                       "Invalid time unit");    timeUnit_ = timeUnit;    if (timeUnitStore_ != NULL)    {        *timeUnitStore_ = timeUnit;    }}
开发者ID:MelroLeandro,项目名称:gromacs,代码行数:10,


示例18: GMX_RELEASE_ASSERT

voidSelectionCollection::setOutputPosType(const char *type){    GMX_RELEASE_ASSERT(type != NULL, "Cannot assign NULL position type");    //! Check that the type is valid.    e_poscalc_t  dummytype;    int          dummyflags;    gmx_ana_poscalc_type_from_enum(type, &dummytype, &dummyflags);    _impl->_spost = type;}
开发者ID:alexholehouse,项目名称:gromacs,代码行数:10,


示例19: impl_

HelpWriterContext::HelpWriterContext(File *file, HelpOutputFormat format,                                     const HelpLinks *links)    : impl_(new Impl(Impl::StatePointer(new Impl::SharedState(file, format, links)))){    if (links != NULL)    {        GMX_RELEASE_ASSERT(links->impl_->format_ == format,                           "Links must have the same output format as the context");    }}
开发者ID:daniellandau,项目名称:gromacs,代码行数:10,


示例20: programContext_

CommandLineModuleManager::Impl::Impl(const char                *binaryName,                                     CommandLineProgramContext *programContext)    : programContext_(*programContext),      binaryName_(binaryName != NULL ? binaryName : ""),      helpModule_(NULL), singleModule_(NULL),      bQuiet_(false){    GMX_RELEASE_ASSERT(binaryName_.find('-') == std::string::npos,                       "Help export does not currently work with binary names with dashes");}
开发者ID:JehandadKhan,项目名称:gromacs,代码行数:10,


示例21: GMX_RELEASE_ASSERT

void MessageStringCollector::finishContext(){    GMX_RELEASE_ASSERT(!impl_->contexts_.empty(),                       "finishContext() called without context");    impl_->contexts_.pop_back();    if (impl_->prevContext_ > impl_->contexts_.size())    {        impl_->prevContext_ = impl_->contexts_.size();    }}
开发者ID:FoldingAtHome,项目名称:gromacs,代码行数:10,


示例22: gmx_ana_pos_reserve_forces

/*! * /param[in,out] pos   Position data structure. * * Currently, this function can only be called after gmx_ana_pos_reserve() * has been called at least once with a /p n >= 0. */voidgmx_ana_pos_reserve_forces(gmx_ana_pos_t *pos){    GMX_RELEASE_ASSERT(pos->nalloc_x > 0,                       "No memory reserved yet for positions");    if (!pos->f)    {        snew(pos->f, pos->nalloc_x);    }}
开发者ID:ParkerdeWaal,项目名称:fABMACS,代码行数:16,


示例23: GMX_RELEASE_ASSERT

voidAnalysisDataProxy::dataStarted(AbstractAnalysisData *data){    GMX_RELEASE_ASSERT(data == &source_, "Source data mismatch");    setDataSetCount(data->dataSetCount());    for (int i = 0; i < data->dataSetCount(); ++i)    {        setColumnCount(i, columnSpan_);    }    moduleManager().notifyDataStart(this);}
开发者ID:ElsevierSoftwareX,项目名称:SOFTX-D-15-00003,代码行数:11,


示例24: copy_state_serial

static void copy_state_serial(const t_state *src, t_state *dest){    if (dest != src)    {        /* Currently the local state is always a pointer to the global         * in serial, so we should never end up here.         * TODO: Implement a (trivial) t_state copy once converted to C++.         */        GMX_RELEASE_ASSERT(false, "State copying is currently not implemented in replica exchange");    }}
开发者ID:friforever,项目名称:gromacs,代码行数:11,



注:本文中的GMX_RELEASE_ASSERT函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ GM_ASSERT函数代码示例
C++ GMX_ASSERT函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。