本文整理汇总了C++中intVector类的典型用法代码示例。如果您正苦于以下问题:C++ intVector类的具体用法?C++ intVector怎么用?C++ intVector使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了intVector类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Get1_5Clusters
void CBKInfEngine::
Get1_5Clusters(int nnodesPerSlice, intVector& interfNds, intVecVector& clusters,
intVecVector* clusters1_5Sl) const
{
int nInterfNds = interfNds.size();
clusters1_5Sl->assign( clusters.begin(), clusters.end() );
clusters1_5Sl->insert( clusters1_5Sl->end(), clusters.begin(), clusters.end() );
int nClusters = clusters.size();
int i,j;
for( i = 0; i < nClusters; i++ )
{
int nnodesPerClust = clusters[i].size();
for( j = 0; j < nnodesPerClust; j++ )
{
intVector::iterator loc = std::find( interfNds.begin(),
interfNds.end(), clusters[i][j] );
(*clusters1_5Sl)[i][j] = loc - interfNds.begin();
(*clusters1_5Sl)[i + nClusters][j] += nInterfNds;
}
}
}
示例2: GetObsDimsWithVls
void CSamplingInfEngine::
GetObsDimsWithVls(intVector &domain, int nonObsNode, const CEvidence* pEv,
intVector *dims, intVector *vls) const
{
int nnodes = domain.size();
dims->resize(nnodes - 1);
vls->resize(nnodes - 1);
int* it = &domain.front();
int* itDims = &dims->front();
int* itVls = &vls->front();
int i;
for( i = 0; i < nnodes; i++, it++ )
{
if( *it != nonObsNode )
{
*itDims = i;
*itVls = pEv->GetValueBySerialNumber(*it)->GetInt();//only if all nds are tabular!!
itDims++;
itVls++;
}
}
}
示例3: CheckClustersValidity
bool CBKInfEngine::
CheckClustersValidity( intVecVector& clusters, intVector& interfNds )
{
if( clusters.empty() )
{
return false;
}
intVector::iterator interfNdsLit = interfNds.begin();
intVector::iterator interfNdsRit = interfNds.end();
int i;
for( i = 0; i < clusters.size(); i++ )
{
if( clusters[i].empty() )
{
return false;
}
else
{
int j;
for( j = 0; j < clusters[i].size(); j++ )
{
if( std::find(interfNdsLit, interfNdsRit, clusters[i][j]) == interfNdsRit )
{
return false;
}
}
}
}
return true;
}
示例4: m_pResultBNet
CMlStaticStructLearn::CMlStaticStructLearn(CStaticGraphicalModel *pGrModel,
ELearningTypes LearnType,
EOptimizeTypes AlgorithmType,
EScoreFunTypes ScoreType, int nMaxFanIn,
intVector& vAncestor, intVector& vDescent)
:CStaticLearningEngine(pGrModel, LearnType),
m_pResultBNet(NULL), m_pResultDAG(NULL)
{
int nnodes = pGrModel->GetNumberOfNodes();
m_nNodes = nnodes;
int i;
for (i = 0; i<nnodes; i++) m_vResultRenaming.push_back(i);
m_ScoreType = ScoreType;
m_Algorithm = AlgorithmType;
m_nMaxFanIn = nMaxFanIn;
m_ScoreMethod = MaxLh;
m_priorType = Dirichlet;
m_K2alfa = 0;
m_vAncestor.assign(vAncestor.begin(), vAncestor.end());
m_vDescent.assign(vDescent.begin(),vDescent.end());
PNL_CHECK_RANGES(nMaxFanIn, 1, nnodes);
intVector ranges(nMaxFanIn);
for(i=0; i<nMaxFanIn; i++) ranges[i] = nnodes+1;
float max = 0.0f;
m_pNodeScoreCache = (CSparseMatrix<float>**)malloc(nnodes * sizeof(CSparseMatrix<float>*));
for(i=0; i<nnodes; i++)
{
m_pNodeScoreCache[i] = CSparseMatrix<float>::Create(nMaxFanIn,
&ranges.front(), max, 0);
}
}
示例5: eliminateSpecificSurface
// enforce epicardium properties on boundary nodes (boundary between
// epicardium and endocardium mesh)
void AnisotropyGenerator::eliminateSpecificSurface(InputFileData* InputData,
AnisotropyCondition& condition,
intVector& surfElems,
int surfID,
std::ofstream& logFile) {
using namespace std;
vector<ConditionParticle>& ptcls = condition.getParticles();
vector<ConditionElement>& elems = condition.getElements();
bool notSame = false;
for(int j = 1;j < surfElems.size();j++) {
if(elems[surfElems[j - 1]].getSurfaceID()
!= elems[surfElems[j]].getSurfaceID()) {
notSame = true;
}
}
if(notSame == true) {
intVector dummyVec;
for(int k = 0;k < surfElems.size();k++) {
if(elems[surfElems[k]].getSurfaceID() == surfID) {
dummyVec.push_back(surfElems[k]);
}
}
surfElems = dummyVec;
}
}
示例6:
/**********************************************************************************
* AUTHOR : Naveen Sundar G.
* DATE : 10-AUGUST-2007
* NAME : toIntVector
* DESCRIPTION : This method converts the feature instance to an intVector.
* ARGUMENTS : The integer vector passed by reference
* RETURNS : 0 on success.
* NOTES :
* CHANGE HISTROY
* Author Date Description of change
*************************************************************************************/
int L7ShapeFeature::toIntVector(intVector& intVec)
{
intVec.push_back(m_x);
intVec.push_back(m_y);
intVec.push_back(m_xFirstDerv);
intVec.push_back(m_yFirstDerv);
intVec.push_back(m_xSecondDerv);
intVec.push_back(m_ySecondDerv);
intVec.push_back(m_curvature);
intVec.push_back(m_penUp);
return SUCCESS;
}
示例7: CreateTabularPotential
void CMNet::CreateTabularPotential( const intVector& domain,
const floatVector& data )
{
AllocFactor( domain.size(), &domain.front() );
pFactorVector factors;
int numFactors = GetFactors( domain.size(), &domain.front(), &factors );
if( numFactors != 1 )
{
PNL_THROW( CInconsistentSize,
"domain must be the same as corresponding domain size got from graph" );
}
factors[0]->AllocMatrix( &data.front(), matTable );
}
示例8: BuildCurrentEvidenceMatrix
//-------------------------------------------------------------------------------
void CSoftMaxCPD::BuildCurrentEvidenceMatrix(float ***full_evid, float ***evid,intVector family,int numEv)
{
int i, j;
*evid = new float* [family.size()];
for (i = 0; i < family.size(); i++)
{
(*evid)[i] = new float [numEv];
}
for (i = 0; i < numEv; i++)
{
for (j = 0; j < family.size(); j++)
{
(*evid)[j][i] = (*full_evid)[family[j]][i];
}
}
}
示例9:
bool
DatabaseCorrelation::GetCorrelatedTimeStates(int state, intVector &states) const
{
bool retval = false;
if(state >= 0 && state < numStates)
{
states.clear();
int index = state;
for(size_t i = 0; i < databaseNames.size(); ++i)
{
states.push_back(indices[index]);
index += numStates;
}
retval = true;
}
return retval;
}
示例10:
void
Dyna3DFile::GetMaterials(intVector &matnos, stringVector &matnames, doubleVector &matdens)
{
for(int i = 0; i < materialCards.size(); ++i)
{
matnos.push_back(materialCards[i].materialNumber);
matnames.push_back(materialCards[i].materialName);
matdens.push_back(materialCards[i].density);
}
}
示例11: AllocDistribution
void CGaussianCPD::AllocDistribution( const floatVector& mean,
const floatVector& cov, float normCoeff,
const floatVecVector& weights,
const intVector& parentCombination )
{
if( weights.size() )
{
pnlVector<const float*> pWeights;
int numWeights = weights.size();
pWeights.resize( numWeights );
for( int i = 0; i < numWeights; i++ )
{
pWeights[i] = &weights[i].front();
}
AllocDistribution( &mean.front(), &cov.front(), normCoeff,
&pWeights.front(), &parentCombination.front() );
}
else
{
AllocDistribution( &mean.front(), &cov.front(), normCoeff, NULL,
&parentCombination.front() );
}
}
示例12: SM_ComputeDistribution
// compute the distribution of correspondence statuses in this order:
// connected, paused, observed, expected, blacklisted, alternate, silent
void SM_ComputeDistribution( intVector &dist )
{
// reset the distribution
dist.clear();
for (int i=0; i<3; i++)
dist.push_back( 0 );
// populate the distribution
for ( corresVector::iterator iter = cq.begin(); iter != cq.end(); iter++ ) {
switch ( iter->status() ) {
case _CONNECTED:
dist[0]++;
break;
case _EXPECTED:
dist[1]++;
break;
case _BLACKLISTED:
dist[2]++;
break;
default:
assert( false );
}
}
}
示例13: AttributeSubject
avtSpeciesMetaData::avtSpeciesMetaData(const std::string &n,
const std::string &meshn, const std::string &matn,
int nummat, const intVector &ns, const std::vector<stringVector> &sn)
: AttributeSubject(avtSpeciesMetaData::TypeMapFormatString)
{
// Initialize all.
*this = avtSpeciesMetaData();
// Override members
name = n;
originalName = name;
meshName = meshn;
materialName = matn;
numMaterials = nummat;
ClearSpecies();
for (size_t i=0; i<ns.size(); i++)
AddSpecies(avtMatSpeciesMetaData(ns[i], sn[i]));
validVariable = true;
}
示例14: PNL_CHECK_RANGES
float CMlStaticStructLearn::ScoreFamily(intVector vFamily)
{
int nParents = vFamily.size() - 1;
PNL_CHECK_RANGES(nParents, 0, m_nMaxFanIn);
intVector indexes(m_nMaxFanIn,0);
int i;
for(i=0; i<nParents; i++)
{
indexes[i] = vFamily[i]+1;
}
int node = vFamily[nParents];
float score;
float defval = m_pNodeScoreCache[node]->GetDefaultValue();
score = m_pNodeScoreCache[node]->GetElementByIndexes(&indexes.front());
if(score == defval)
{
score = ComputeFamilyScore(vFamily);
m_pNodeScoreCache[node]->SetElementByIndexes(score, &indexes.front());
}
return score;
}
示例15: MarginalNodes
void CGibbsSamplingInfEngine::
MarginalNodes( const intVector& queryNdsIn, int notExpandJPD )
{
MarginalNodes( &queryNdsIn.front(), queryNdsIn.size(), notExpandJPD );
}