当前位置: 首页>>代码示例>>C++>>正文


C++ GMX_RELEASE_ASSERT函数代码示例

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


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

示例1: GMX_RELEASE_ASSERT

void
AnalysisDataDisplacementModule::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,代码来源:displacement.cpp

示例2: GMX_RELEASE_ASSERT

AnalysisDataHandle
TrajectoryAnalysisModuleData::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,代码来源:analysismodule.cpp

示例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,代码来源:toputils.cpp

示例4: GMX_RELEASE_ASSERT

void
AnalysisDataDisplacementModule::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,代码来源:displacement.cpp

示例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,代码来源:optionsassigner.cpp

示例6: GMX_RELEASE_ASSERT

void
AbstractAnalysisArrayData::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,代码来源:arraydata.cpp

示例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 void
removeExtraSpaces(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,代码来源:ocl_compiler.cpp

示例8: GMX_RELEASE_ASSERT

void
AnalysisDataModuleManager::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,代码来源:datamodulemanager.cpp

示例9: gmx_omp_nthreads_set

void
gmx_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,代码来源:gmx_omp_nthreads.cpp

示例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,代码来源:abstractoption.cpp

示例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,代码来源:mempool.cpp

示例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,代码来源:collect.cpp

示例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,代码来源:optionsassigner.cpp

示例14: GMX_RELEASE_ASSERT

/*! \internal
 * This method is not const because the dataStarted() methods of the attached
 * modules can request storage of the data.
 */
void
AbstractAnalysisData::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,代码来源:abstractdata.cpp

示例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,代码来源:updategroupscog.cpp


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