FunctionParameters::FunctionParameters(ParameterNode* firstParameter, unsigned size) : m_size(size) { unsigned i = 0; for (ParameterNode* parameter = firstParameter; parameter; parameter = parameter->nextParam()) new (&identifiers()[i++]) Identifier(parameter->ident()); }
void WebDatabaseManager::getDatabaseOrigins(uint64_t callbackID) const { Vector<RefPtr<SecurityOrigin>> origins; DatabaseManager::manager().origins(origins); size_t numOrigins = origins.size(); Vector<String> identifiers(numOrigins); for (size_t i = 0; i < numOrigins; ++i) identifiers[i] = origins[i]->databaseIdentifier(); m_process->send(Messages::WebDatabaseManagerProxy::DidGetDatabaseOrigins(identifiers, callbackID), 0); }
void WebDatabaseManager::getDatabaseOrigins(uint64_t callbackID) const { WebProcess::LocalTerminationDisabler terminationDisabler(WebProcess::shared()); Vector<RefPtr<SecurityOrigin> > origins; DatabaseTracker::tracker().origins(origins); size_t numOrigins = origins.size(); Vector<String> identifiers(numOrigins); for (size_t i = 0; i < numOrigins; ++i) identifiers[i] = origins[i]->databaseIdentifier(); WebProcess::shared().connection()->send(Messages::WebDatabaseManagerProxy::DidGetDatabaseOrigins(identifiers, callbackID), 0); }
void Solver::CreateBlocksPPHH(){ vec identifiers = zeros<vec>(0); Npphh = 0; for (int I=0; I<NHOLES; I++){ for (int A=0; A<NPARTICLES; A++){ if (Holes(I,2) == Particles(A,2) ) { // Block found bool IDExist = any( identifiers == Holes(I,2) ); if ( ! IDExist){ identifiers.insert_rows(Npphh,1); identifiers(Npphh) = Holes(I,2); Npphh ++; } } } } blockspphh = new Block*[Npphh]; for (int n=0; n<Npphh; n++) blockspphh[n] = new Block(basis, Nholes, Nparticles); for (int I=0; I<NHOLES; I++){ for (int A=0; A<NPARTICLES; A++){ if (Holes(I,2) == Particles(A,2)){ uvec indices = find( identifiers == Holes(I,2) ); int indice = indices(0); blockspphh[indice]->AddStates( Holes.row(I), Particles.row(A) ); } } } for (int n=0; n<Npphh; n++){ blockspphh[n]->FinishBlock(); } #pragma omp parallel { int id = omp_get_thread_num(); int threads = omp_get_num_threads(); for (int n=id; n<Npphh; n+=threads) blockspphh[n]->Epsilonpphh(); } }
void Solver::CreateBlocksPHHP(){ vec identifiers = zeros<vec>(0); Nphhp = 0; for (int x1=0; x1<NX; x1++){ for (int x2=0; x2<NX; x2++){ if (Xph(x1,2) == Xhp(x2,2)){ bool IDExist = any( identifiers == Xph(x1,2) ); if ( ! IDExist){ identifiers.insert_rows(Nphhp,1); identifiers(Nphhp) = Xph(x1,2); Nphhp ++; } } } } blocksphhp = new Block*[Nphhp]; for (int n=0; n<Nphhp; n++) blocksphhp[n] = new Block(basis,Nholes,Nparticles); for (int x1=0; x1<NX; x1++){ for (int x2=0; x2<NX; x2++){ if (Xph(x1,2) == Xhp(x2,2)){ uvec indices = find( identifiers == Xph(x1,2) ); int indice = indices(0); blocksphhp[indice]->AddCrossStates(Xph.row(x1),Xhp.row(x2)); } } } for (int n=0; n<Nphhp; n++) blocksphhp[n]->FinishBlock(); #pragma omp parallel { int id = omp_get_thread_num(); int threads = omp_get_num_threads(); for (int n=id; n<Nphhp; n+=threads) blocksphhp[n]->Epsilonphhp(); } }
IdentifiersPtr Parser::parseIdentifierList() { IdentifierPtr curIdentifier = parseIdentifier(); if (m_errorCode > ErrorCodes::NoError) { panic(identifierListFollow, identifierListFollowSize); return IdentifiersPtr(); } IdentifiersPtr identifiers(new Identifiers); identifiers->list.push_back(curIdentifier); IdentifiersPtr rest = parseIdentifierList_r(); if (rest) { identifiers->list.insert(identifiers->list.end(), rest->list.begin(), rest->list.end()); } return identifiers; }
void Solver::CreateBlocksKPHH(){ vec identifiers = zeros<vec>(0); Nkphh = 0; for (int k1=0; k1<NKp; k1++){ for (int k2=0; k2<NKp3; k2++){ if (Kp(k1,1) == Kphh(k2,3) ) { // Block found bool IDExist = any( identifiers == Kp(k1,1) ); if ( ! IDExist){ identifiers.insert_rows(Nkphh,1); identifiers(Nkphh) = Kp(k1,1); Nkphh ++; } } } } blockskphh = new Block*[Nkphh]; for (int n=0; n<Nkphh; n++) blockskphh[n] = new Block(basis,Nholes,Nparticles); for (int k1=0; k1<NKp; k1++){ for (int k2=0; k2<NKp3; k2++){ if (Kp(k1,1) == Kphh(k2,3) ) { // Block found uvec indices = find( identifiers == Kp(k1,1)); int indice = indices(0); blockskphh[indice]->AddTripleStates( Kp.row(k1), Kphh.row(k2) ); } } } for (int n=0; n<Nkphh; n++) blockskphh[n]->FinishBlock(); #pragma omp parallel { int id = omp_get_thread_num(); int threads = omp_get_num_threads(); for (int n=id; n<Nkphh; n+=threads) blockskphh[n]->Epsilonkphh(); } }
FunctionParameters::~FunctionParameters() { for (unsigned i = 0; i < m_size; ++i) identifiers()[i].~Identifier(); }