这篇教程C++ vt函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中vt函数的典型用法代码示例。如果您正苦于以下问题:C++ vt函数的具体用法?C++ vt怎么用?C++ vt使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了vt函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: mainint main(int argc, char *argv[]) { int info; int m = 6; int n = 4; if (argc > 2) { m = boost::lexical_cast<int>(argv[1]); n = boost::lexical_cast<int>(argv[2]); } std::cout << "m = " << m << "/nn = " << n << std::endl; int k = std::min(m, n); // generate random martix matrix_t mat = matrix_t::Random(m, n); std::cout << "Input random matrix A:/n" << mat << std::endl; // singular value decomposition matrix_t a = mat; // 'a' will be destroyed by dgesvd vector_t s(k), superb(k); matrix_t u(m, k), vt(k, n); info = LAPACKE_zgesvd(LAPACK_COL_MAJOR, 'S', 'S', m, n, &a(0, 0), m, &s(0), &u(0, 0), m, &vt(0, 0), k, &superb(0)); std::cout << "U:/n" << u << std::endl; std::cout << "S:/n" << s << std::endl; std::cout << "Vt:/n" << vt << std::endl; // check correctness of SVD matrix_t smat = matrix_t::Zero(k, k); for (int i = 0; i < k; ++i) smat(i, i) = s(i); matrix_t check = u * smat * vt; std::cout << "U * S * Vt:/n" << check << std::endl; std::cout << "| A - U * S * Vt | = " << (mat - check).norm() << std::endl;}
开发者ID:t-sakashita,项目名称:rokko,代码行数:32,
示例2: get_fundamental_matrixcv::Matx33d get_fundamental_matrix(std::vector<tutor::PPoint2d> x1 , std::vector<tutor::PPoint2d> x2) { cv::Mat_<double> W; cv::Mat_<double> u, d, vt; for (int i=0; i< (int)x1.size(); i++ ) { cv::Mat_<double> Wi = (cv::Mat_<double>(1, 9) << x1[i].x()*x2[i].x(), x1[i].y()*x2[i].x(), x2[i].x(), x1[i].x()*x2[i].y(), x1[i].y()*x2[i].y(), x2[i].y(), x1[i].x(), x1[i].y(), 1); W.push_back(Wi); } cv::SVD::compute(W, d, u, vt, cv::SVD::FULL_UV); // std::cout << "d=" << d << endl; // std::cout << "U=" << u << endl; // std::cout << "vt=" << vt << endl; cv::Mat_<double> F = (cv::Mat_<double>(3,3) << vt(8,0),vt(8,1),vt(8,2),vt(8,3),vt(8,4),vt(8,5),vt(8,6),vt(8,7),vt(8,8) ) ; // cv::Matx33d F(vt(8,0),vt(8,1),vt(8,2),vt(8,3),vt(8,4),vt(8,5),vt(8,6),vt(8,7),vt(8,8) ) ; //// decompose F //// Now, F's degree of freedom is 3, but actually F's degree of freedom is 2. so reduce F's degree of freedom cv::SVD::compute(F, d, u, vt, cv::SVD::FULL_UV); // std::cout << "d=" << d << std::endl; cv::Mat_<double> D = (cv::Mat_<double> (3,3) << d(0), 0, 0, 0, d(1), 0, 0, 0, 0); // std::cout << "Reduced D=" << D << std::endl; F = u*D*vt; F = F / F(2,2); std::cout << "F=" << F << std::endl; // std::cout << "Reduced F=" << F << std::endl; return F;}
开发者ID:NuitNoir,项目名称:practice,代码行数:29,
示例3: setupvoid VirtualTerminal::init(){ auto logind = LogindIntegration::self(); if (logind->vt() != -1) { setup(logind->vt()); } connect(logind, &LogindIntegration::virtualTerminalChanged, this, &VirtualTerminal::setup); if (logind->isConnected()) { logind->takeControl(); } else { connect(logind, &LogindIntegration::connectedChanged, logind, &LogindIntegration::takeControl); }}
开发者ID:KDE,项目名称:kwin,代码行数:13,
示例4: vtstd::vector<double> WallModel::getUVs() { double pw = 1.0 / TEX_IMAGE_TILE_WIDTH; double ph = 1.0 / TEX_IMAGE_TILE_HEIGHT; double tileWidth = TEX_TILE_WIDTH * pw; double tileHeight = TEX_TILE_HEIGHT * ph; double height = top - bottom; double heightOffset = ((height - TILE_SIZE) / TILE_SIZE) * tileHeight; double hJump = tileWidth + 2 * pw; double vJump = tileHeight + 2 * ph; double uOffset = (hJump * textureCol) + pw; double vOffset = 1.0 - (vJump * (textureRow + 1)) + ph; double vtd[] = {uOffset, vOffset, uOffset + tileWidth, vOffset, uOffset + tileWidth, vOffset + tileHeight + heightOffset, uOffset, vOffset + tileHeight + heightOffset }; std::vector<double> vt(vtd, vtd + sizeof(vtd) / sizeof(double)); return vt;}
开发者ID:jefrsilva,项目名称:AssembleeKQJ,代码行数:25,
示例5: vt// staticvoid LLLandmark::processRegionIDAndHandle(LLMessageSystem* msg, void**){ LLUUID region_id; msg->getUUID("ReplyBlock", "RegionID", region_id); mRegions.erase(region_id); CacheInfo info; const F32 CACHE_EXPIRY_SECONDS = 60.0f * 10.0f; // ten minutes info.mTimer.setTimerExpirySec(CACHE_EXPIRY_SECONDS); msg->getU64("ReplyBlock", "RegionHandle", info.mRegionHandle); region_map_t::value_type vt(region_id, info); mRegions.insert(vt);#if LL_DEBUG U32 grid_x, grid_y; grid_from_region_handle(info.mRegionHandle, &grid_x, &grid_y); lldebugs << "Landmark got reply for region: " << region_id << " " << grid_x << "," << grid_y << llendl;#endif // make all the callbacks here. region_callback_map_t::iterator it; while((it = sRegionCallbackMap.find(region_id)) != sRegionCallbackMap.end()) { (*it).second(region_id, info.mRegionHandle); sRegionCallbackMap.erase(it); }}
开发者ID:HizWylder,项目名称:GIS,代码行数:28,
示例6: vtSTDMETHODIMP CLogMessage::get_SysError(BSTR* pVal){TRY_CATCH CComVariant vt(m_logMessage.GetProperty(CSingleton<CNetLogFieldsMap>::instance().GetFieldIndex(cLog::_FIELD_SYSTEM_ERROR))); if ( vt.vt == VT_EMPTY || vt.intVal == 0) { *pVal = NULL; return S_OK; } /// Getting syserror PTCHAR Buffer; DWORD BufferAllocated; //Formatting winerror message tstring intVal; if(!(BufferAllocated=FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_SYSTEM, NULL, vt.intVal, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (PTCHAR) &Buffer, 16, NULL))) { intVal = i2tstring(vt.intVal); Buffer = const_cast<PTCHAR>(intVal.c_str()); } *pVal = CComBSTR(Buffer).Copy(); // Deallocating buffer if it was allocated before if (BufferAllocated) LocalFree( Buffer ); return S_OK;CATCH_LOG_COMERROR()}
开发者ID:SupportSpace,项目名称:SupportCenter,代码行数:29,
示例7: vtvector<TParticle*> LMCphysGen::GenCerPhotons(TParticle *part, LMCstep *step, Int_t N) { const Double_t hbarc = 0.197326960277E-6; //GeV.nm vector <TParticle*> v; //rotation matrix to transform vectors from geom -> part TRotation rm; TVector3 vt(part->Px(), part->Py(), part->Pz()); rm.RotateX(vt.Theta()); //rotate on X rm.RotateZ(vt.Phi()); //rotate on Z TVector3 pdir = vt.Unit(); // rotation matrix from part->geom TRotation im = rm.Inverse(); //generate photons Double_t Emin = 2.*TMath::Pi()* hbarc / 200.; //GeV Double_t Emax = 2.*TMath::Pi()* hbarc / 700.; //GeV TVector3 InitPoint = step->GetInitPoint(); Double_t stepLength = step->GetStepLength(); for (int i=0; i< N; i++) { Double_t thetaCer = step->GetCerAngle(); Double_t phi = (RandGen->Rndm())*2.*TMath::Pi(); TVector3 photonDir(sin(thetaCer)*cos(phi), sin(thetaCer)*sin(phi), cos(thetaCer)); TVector3 photonDirDet = im*photonDir; //transform photon direction from particle to detector frame Double_t photonE = Emin + (RandGen->Rndm())*(Emax-Emin); //cerenkov photon flat on energy (GeV) TVector3 photonMomDet = photonE*photonDirDet; //on detector frame TVector3 GenPoint = InitPoint + stepLength*(RandGen->Rndm())*pdir; v.push_back(new TParticle(22,0,0,0,0,0,photonMomDet.X(),photonMomDet.Y(),photonMomDet.Z(),photonE,GenPoint.X(),GenPoint.Y(),GenPoint.Z(),0)); } return v;}
开发者ID:luisbatalha,项目名称:Cosmic-Ray-Simulator,代码行数:32,
示例8: mainint main(int argc, char *argv[]){ if (argc != 3) { return -1; } try { std::vector<uint8_t> imageData; std::stringstream stream(argv[1]); std::string path(argv[2]); int size; stream >> size; ffmpegthumbnailer::VideoThumbnailer vt(size, false, true, 20, false); vt.generateThumbnail(path, ThumbnailerImageTypeEnum::Png, imageData); char *base64_data = toBase64(imageData.data(), imageData.size(), Base64Encoding); printf("%s", base64_data); fflush(stdout); } catch (std::logic_error e) { std::cerr << e.what(); return -1; } return 0;}
开发者ID:linuxdeepin,项目名称:dde-file-manager,代码行数:29,
示例9: rot void rot (const T1 &t1, V1 &v1, const T2 &t2, V2 &v2) { typedef typename promote_traits<typename V1::value_type, typename V2::value_type>::promote_type promote_type; vector<promote_type> vt (t1 * v1 + t2 * v2); v2.assign (- t2 * v1 + t1 * v2); v1.assign (vt); }
开发者ID:imos,项目名称:icfpc2015,代码行数:7,
示例10: minWindow // two pointers, dynamicly maintain window frame that contains all chars in T string minWindow(string S, string T) { vector<int> vt (256, 0); vector<int> vs (256, 0); for(int i = 0; i < T.size(); ++i) vt[T[i]]++; int count = 0; int slow = 0; int min_len = INT_MAX; int min_srt = 0; for(int fast = 0; fast < S.size(); ++fast){ if(vt[S[fast]]){ // create window vs[S[fast]]++; if(vs[S[fast]] <= vt[S[fast]]) count++; } if(count == T.size()){ while(!vt[S[slow]] || vs[S[slow]] > vt[S[slow]]){ // maintain window if(vt[S[slow]]) vs[S[slow]]--; slow++; } if(fast - slow + 1 < min_len){ min_len = fast - slow + 1; min_srt = slow; } } } return min_len == INT_MAX ? "" : S.substr(min_srt, min_len); }
开发者ID:zackkk,项目名称:leetcode,代码行数:30,
示例11: aintMultiPlasticityLinearSystem::singularValuesOfR(const std::vector<RankTwoTensor> & r, std::vector<Real> & s){ int bm = r.size(); int bn = 6; s.resize(std::min(bm, bn)); // prepare for gesvd or gesdd routine provided by PETSc // Want to find the singular values of matrix // ( r[0](0,0) r[0](0,1) r[0](0,2) r[0](1,1) r[0](1,2) r[0](2,2) ) // ( r[1](0,0) r[1](0,1) r[1](0,2) r[1](1,1) r[1](1,2) r[1](2,2) ) // a = ( r[2](0,0) r[2](0,1) r[2](0,2) r[2](1,1) r[2](1,2) r[2](2,2) ) // ( r[3](0,0) r[3](0,1) r[3](0,2) r[3](1,1) r[3](1,2) r[3](2,2) ) // ( r[4](0,0) r[4](0,1) r[4](0,2) r[4](1,1) r[4](1,2) r[4](2,2) ) // bm = 5 std::vector<double> a(bm * 6); // Fill in the a "matrix" by going down columns unsigned ind = 0; for (int col = 0; col < 3; ++col) for (int row = 0; row < bm; ++row) a[ind++] = r[row](0, col); for (int col = 3; col < 5; ++col) for (int row = 0; row < bm; ++row) a[ind++] = r[row](1, col - 2); for (int row = 0; row < bm; ++row) a[ind++] = r[row](2, 2); // u and vt are dummy variables because they won't // get referenced due to the "N" and "N" choices int sizeu = 1; std::vector<double> u(sizeu); int sizevt = 1; std::vector<double> vt(sizevt); int sizework = 16 * (bm + 6); // this is above the lowerbound specified in the LAPACK doco std::vector<double> work(sizework); int info; LAPACKgesvd_("N", "N", &bm, &bn, &a[0], &bm, &s[0], &u[0], &sizeu, &vt[0], &sizevt, &work[0], &sizework, &info); return info;}
开发者ID:FHilty,项目名称:moose,代码行数:59,
示例12: null //========================================================================== // null space basis up to epsi //========================================================================== tab_t null(base_t epsi = -1 )const { epsi = epsi < 0 ? nt2::eps(w_(1)) : epsi; int j = numel(w_); for(; (j > 0) && (w_(j)<= epsi); j--); j++; return nt2::fliplr(trans(vt()(_(j, last_index<1>(vt_)), _))); }
开发者ID:KWMalik,项目名称:nt2,代码行数:11,
示例13: whilePopulationAlphabet::index_type PopulationAlphabet::getSymbol( const locus_t & l, const allele_t & a, bool createNew ) {// std::cout << "Getting symbol for: " << l << std::endl; locus_alleles_t res = m_db.left.equal_range( l ); variant_db_t::iterator it = m_db.end(); while( res.first != res.second ) { if( res.first->second == a ) { it = m_db.project_up( res.first ); } else { res.first++; } } size_t offset = m_db.size(); if( it == m_db.end() ) { if( !createNew ) return npos; variant_db_t::value_type vt(l, a); std::pair< variant_db_t::iterator, bool > res = m_db.insert( m_db.end(), vt); assert( res.second ); it = res.first; // std::cout << it->left << " ?== " << l << std::endl; assert( it->left == l ); // std::cout << "Added new variant to database: " << l << std::endl; } else { offset = (it - m_db.begin()); }// std::cout << "variant offset in database: " << offset << std::endl; if( m_free_list.size() <= offset ) { size_t fspace = m_free_list.find_first(); if( fspace == bitset_type::npos ) { fspace = m_free_list.size(); m_free_list.push_back(false); m_free_intersect.push_back(false); m_free_union.push_back(true); }// std::cout << "First free space: " << fspace << std::endl; if( fspace != offset ) { variant_db_t::iterator sit = m_db.begin() + fspace; variant_db_t::iterator nit = it + 1; m_db.relocate( sit, it); m_db.relocate( nit, sit); m_free_list[fspace] = false; offset = fspace;// } else {// std::cout << "Variant in first free space already" << std::endl; } } return offset;}
开发者ID:putnampp,项目名称:clotho-dev,代码行数:58,
示例14: get_ptr_in_mapLLLandmark* LLLandmarkList::getAsset(const LLUUID& asset_uuid, loaded_callback_t cb){ LLLandmark* landmark = get_ptr_in_map(mList, asset_uuid); if(landmark) { LLVector3d dummy; if(cb && !landmark->getGlobalPos(dummy)) { // landmark is not completely loaded yet loaded_callback_map_t::value_type vt(asset_uuid, cb); mLoadedCallbackMap.insert(vt); } return landmark; } else { if ( mBadList.find(asset_uuid) != mBadList.end() ) { return NULL; } landmark_requested_list_t::iterator iter = mRequestedList.find(asset_uuid); if (iter != mRequestedList.end()) { const F32 rerequest_time = 30.f; // 30 seconds between requests if (gFrameTimeSeconds - iter->second < rerequest_time) { return NULL; } } if (cb) { loaded_callback_map_t::value_type vt(asset_uuid, cb); mLoadedCallbackMap.insert(vt); } gAssetStorage->getAssetData(asset_uuid, LLAssetType::AT_LANDMARK, LLLandmarkList::processGetAssetReply, NULL); mRequestedList[asset_uuid] = gFrameTimeSeconds; } return NULL;}
开发者ID:CmdrCupcake,项目名称:SingularityViewer,代码行数:45,
示例15: callback// staticvoid LLLandmark::requestRegionHandle( LLMessageSystem* msg, const LLHost& upstream_host, const LLUUID& region_id, region_handle_callback_t callback){ if(region_id.isNull()) { // don't bother with checking - it's 0. lldebugs << "requestRegionHandle: null" << llendl; if(callback) { const U64 U64_ZERO = 0; callback(region_id, U64_ZERO); } } else { if(region_id == mLocalRegion.first) { lldebugs << "requestRegionHandle: local" << llendl; if(callback) { callback(region_id, mLocalRegion.second); } } else { region_map_t::iterator it = mRegions.find(region_id); if(it == mRegions.end()) { lldebugs << "requestRegionHandle: upstream" << llendl; if(callback) { region_callback_map_t::value_type vt(region_id, callback); sRegionCallbackMap.insert(vt); } lldebugs << "Landmark requesting information about: " << region_id << llendl; msg->newMessage("RegionHandleRequest"); msg->nextBlock("RequestBlock"); msg->addUUID("RegionID", region_id); msg->sendReliable(upstream_host); } else if(callback) { // we have the answer locally - just call the callack. lldebugs << "requestRegionHandle: ready" << llendl; callback(region_id, (*it).second.mRegionHandle); } } } // As good a place as any to expire old entries. expireOldEntries();}
开发者ID:HizWylder,项目名称:GIS,代码行数:57,
示例16: mainint main(){ std::vector<Items> vt(10); vt.push_back(Items(8.2,2.8, 3)); for (int i = 0; i < 10; i++) vt[i].ShowItems(); return 0;}
开发者ID:gergalerg,项目名称:Boost,代码行数:10,
示例17: GM_CHECK_NUM_PARAMSint gmMatrix3::gmfTransformVector(gmThread *a_thread){ GM_CHECK_NUM_PARAMS(1); gmMat3Type* native = gmMatrix3::GetThisObject( a_thread ); GM_CHECK_VECTOR_PARAM(v,0); Vector3f vt(v.x,v.y,v.z); vt = *native * vt; a_thread->PushVector(vt.X(), vt.Y(), vt.Z()); return GM_OK;}
开发者ID:fishxz,项目名称:omni-bot,代码行数:11,
示例18: searchRange vector<int> searchRange(vector<int>& nums, int target) { int n = nums.size(); vector<int> vt(2,-1); if( n < 1 ) return vt; int low = lowerBound(nums, target); if( low >= 0 ){ vt[0] = low; vt[1] = upperBound(nums, target); } return vt; }
开发者ID:maybeluo,项目名称:leetcode,代码行数:11,
示例19: qt void GazeboRosSkidSteerDrive::publishOdometry(double step_time) { ros::Time current_time = ros::Time::now(); std::string odom_frame = tf::resolve(tf_prefix_, odometry_frame_); std::string base_footprint_frame = tf::resolve(tf_prefix_, robot_base_frame_); // TODO create some non-perfect odometry! // getting data for base_footprint to odom transform math::Pose pose = this->parent->GetWorldPose(); tf::Quaternion qt(pose.rot.x, pose.rot.y, pose.rot.z, pose.rot.w); tf::Vector3 vt(pose.pos.x, pose.pos.y, pose.pos.z); tf::Transform base_footprint_to_odom(qt, vt); if (this->broadcast_tf_) { transform_broadcaster_->sendTransform( tf::StampedTransform(base_footprint_to_odom, current_time, odom_frame, base_footprint_frame)); } // publish odom topic odom_.pose.pose.position.x = pose.pos.x; odom_.pose.pose.position.y = pose.pos.y; odom_.pose.pose.orientation.x = pose.rot.x; odom_.pose.pose.orientation.y = pose.rot.y; odom_.pose.pose.orientation.z = pose.rot.z; odom_.pose.pose.orientation.w = pose.rot.w; odom_.pose.covariance[0] = 0.00001; odom_.pose.covariance[7] = 0.00001; odom_.pose.covariance[14] = 1000000000000.0; odom_.pose.covariance[21] = 1000000000000.0; odom_.pose.covariance[28] = 1000000000000.0; odom_.pose.covariance[35] = 0.01; // get velocity in /odom frame math::Vector3 linear; linear = this->parent->GetWorldLinearVel(); odom_.twist.twist.angular.z = this->parent->GetWorldAngularVel().z; // convert velocity to child_frame_id (aka base_footprint) float yaw = pose.rot.GetYaw(); odom_.twist.twist.linear.x = cosf(yaw) * linear.x + sinf(yaw) * linear.y; odom_.twist.twist.linear.y = cosf(yaw) * linear.y - sinf(yaw) * linear.x; odom_.header.stamp = current_time; odom_.header.frame_id = odom_frame; odom_.child_frame_id = base_footprint_frame; odometry_publisher_.publish(odom_); }
开发者ID:team-diana,项目名称:gazebo_ros_pkgs,代码行数:54,
示例20: vtbool PlayState::frameStarted(const Ogre::FrameEvent& evt){ // movimiento de camara luego quitar Ogre::Vector3 vt(0,0,0); Ogre::Real tSpeed = 1.0; if(InputManager::getSingleton().getKeyboard()->isKeyDown(OIS::KC_UP)) vt+=Ogre::Vector3(0,0,-1); if(InputManager::getSingleton().getKeyboard()->isKeyDown(OIS::KC_DOWN)) vt+=Ogre::Vector3(0,0,1); if(InputManager::getSingleton().getKeyboard()->isKeyDown(OIS::KC_LEFT)) vt+=Ogre::Vector3(-1,0,0); if(InputManager::getSingleton().getKeyboard()->isKeyDown(OIS::KC_RIGHT)) vt+=Ogre::Vector3(1,0,0); _camera->moveRelative(vt * 0.1 * tSpeed); return true;}
开发者ID:Breikdans,项目名称:HundirLaFlota,代码行数:13,
示例21: vtvoid MazeSolver::solveByDFSRecursive(){ VisitedTracker vt(maze->numRows(), maze->numCols()); int numSquares = maze->numRows() * maze->numCols(); std::vector<Direction> p( numSquares ); int numExplored = 0; dfsHelper(maze->getStartRow(), maze->getStartCol(), vt, p, numExplored); std::vector<Direction> path = pathCreator(p); display->reportSolution(path, vt, numExplored); return; }
开发者ID:kharjani,项目名称:Spring-2016,代码行数:14,
示例22: transformVertices// Applies a transformation in the form of a matrix to a list of vertices.vector<glm::vec4> transformVertices(const glm::mat4 & transMatrix, const vector<glm::vec4> & vertices){ vector<glm::vec4> transformedVertices; for (unsigned int i = 0; i < vertices.size(); i++) { glm::vec4 vt(transMatrix * vertices[i]); transformedVertices.push_back(vt); } return transformedVertices;} // end transformVertices
开发者ID:frazeeat,项目名称:CSE287,代码行数:15,
示例23: BuildMenuFileName// Build Recent File menu entries from givengeneric_string BuildMenuFileName(int filenameLen, unsigned int pos, const generic_string &filename){ generic_string strTemp; if (pos < 9) { strTemp.push_back('&'); strTemp.push_back('1' + (TCHAR)pos); } else if (pos == 9) { strTemp.append(TEXT("1&0")); } else { strTemp.append(uintToString(pos + 1)); } strTemp.append(TEXT(": ")); if (filenameLen > 0) { std::vector<TCHAR> vt(filenameLen + 1); //--FLS: W removed from PathCompactPathExW due to compiler errors for ANSI version. PathCompactPathEx(&vt[0], filename.c_str(), filenameLen + 1, 0); strTemp.append(convertFileName(vt.begin(), vt.begin() + lstrlen(&vt[0]))); } else { // (filenameLen < 0) generic_string::const_iterator it = filename.begin(); if (filenameLen == 0) it += PathFindFileName(filename.c_str()) - filename.c_str(); // MAX_PATH is still here to keep old trimming behaviour. if (filename.end() - it < MAX_PATH) { strTemp.append(convertFileName(it, filename.end())); } else { strTemp.append(convertFileName(it, it + MAX_PATH / 2 - 3)); strTemp.append(TEXT("...")); strTemp.append(convertFileName(filename.end() - MAX_PATH / 2, filename.end())); } } return strTemp;}
开发者ID:125radheyshyam,项目名称:notepad-plus-plus,代码行数:50,
示例24: generateMatrix vector<vector<int>> generateMatrix(int n) { vector< vector<int> > matrix(n); //vector< vector<int> > matrix; //matrix.clear(); for(int i = 0; i < n; i++){ vector<int> vt(n, 0); matrix[i] = vt; // matrix.push_back(vt); } int pos = 1; for(int i = 0; i < n/2; i++) { putCircle(matrix, pos, i, i, n-1-i, n-1-i); } if(n%2) matrix[n/2][n/2] = pos; return matrix; }
开发者ID:maybeluo,项目名称:leetcode,代码行数:16,
示例25: vt// staticbool LLService::registerCreator(const std::string& name, creator_t fn){ llinfos << "LLService::registerCreator(" << name << ")" << llendl; if(name.empty()) { return false; } creators_t::value_type vt(name, fn); std::pair<creators_t::iterator, bool> rv = sCreatorFunctors.insert(vt); return rv.second; // alternately... //std::string name_str(name); //sCreatorFunctors[name_str] = fn;}
开发者ID:OS-Development,项目名称:VW.Kirsten,代码行数:17,
注:本文中的vt函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ vtSetError函数代码示例 C++ vsyslog函数代码示例 |