亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? namelist.cpp

?? linux的gps應用
?? CPP
字號:
#pragma ident "$Id: Namelist.cpp 293 2006-11-10 16:39:56Z rickmach $"//============================================================================////  This file is part of GPSTk, the GPS Toolkit.////  The GPSTk is free software; you can redistribute it and/or modify//  it under the terms of the GNU Lesser General Public License as published//  by the Free Software Foundation; either version 2.1 of the License, or//  any later version.////  The GPSTk is distributed in the hope that it will be useful,//  but WITHOUT ANY WARRANTY; without even the implied warranty of//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the//  GNU Lesser General Public License for more details.////  You should have received a copy of the GNU Lesser General Public//  License along with GPSTk; if not, write to the Free Software Foundation,//  Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA//  //  Copyright 2004, The University of Texas at Austin////============================================================================//============================================================================////This software developed by Applied Research Laboratories at the University of//Texas at Austin, under contract to an agency or agencies within the U.S. //Department of Defense. The U.S. Government retains all rights to use,//duplicate, distribute, disclose, or release this software. ////Pursuant to DoD Directive 523024 //// DISTRIBUTION STATEMENT A: This software has been approved for public //                           release, distribution is unlimited.////=============================================================================/** * @file Namelist.cpp * Implementation of class Namelist. * class gpstk::Namelist encapsulates a list of labels for use with classes Matrix, * Vector and SRI. *///------------------------------------------------------------------------------------// system includes#include <string>#include <vector>#include <algorithm>#include <ostream>#include <fstream> // for copyfmt// GPSTk#include "Exception.hpp"#include "StringUtils.hpp"#include "Namelist.hpp"using namespace std;namespace gpstk{//------------------------------------------------------------------------------------// constructor given dimension - creates default labelsNamelist::Namelist(const unsigned int& n){try {   if(n == 0) return;   string name;   for(unsigned int i=0; i<n; i++) {      ostringstream oss;      oss << "NAME" << setw(2) << setfill('0') << i;      name = oss.str();      labels.push_back(name);   }}catch(Exception& e) { GPSTK_RETHROW(e); }}// explicit constructor - only a unique subset of names will be included.Namelist::Namelist(const vector<string>& names){try {   for(unsigned int i=0; i<names.size(); i++) {      bool unique=true;      for(unsigned int j=i+1; j<names.size(); j++) {         if(names[i] == names[j]) { unique=false; break; }      }      if(unique) labels.push_back(names[i]);   }}catch(Exception& e) { GPSTK_RETHROW(e); }}// add a name to the Namelist; do nothing if the name is not unique.Namelist& Namelist::operator+=(const string& name){try {   if(this->contains(name)) return *this;   labels.push_back(name);   return *this;}catch(Exception& e) { GPSTK_RETHROW(e); }}// remove a name from the Namelist; does nothing if the name is not found.Namelist& Namelist::operator-=(const string& name){try {   vector<string>::iterator it;   if((it=find(labels.begin(),labels.end(),name)) == labels.end()) return *this;   labels.erase(it);   return *this;}catch(Exception& e) { GPSTK_RETHROW(e); }}// swap two elements, as given by their indexes; no effect if either index// is out of range.void Namelist::swap(const unsigned int& i, const unsigned int& j){try {   if(i == j) return;   if(i >= labels.size() || j >= labels.size()) return;   string str = labels[i];   labels[i] = labels[j];   labels[j] = str;}catch(Exception& e) { GPSTK_RETHROW(e); }}// reorder the list by sortingvoid Namelist::sort(void){try {   // compiler tries Namelist::sort() first...   std::sort(labels.begin(),labels.end());}catch(Exception& e) { GPSTK_RETHROW(e); }}// resize the list by either truncation or adding default names.void Namelist::resize(unsigned int n){try {   if(n == labels.size()) return;   int N=labels.size();   while(labels.size() < n) {      string s;      do {         ostringstream oss;         oss << "NAME" << setw(2) << setfill('0') << N << setfill(' ');         s = oss.str();         N++;      } while(this->contains(s));      labels.push_back(s);   }   while(labels.size() > n) {      labels.pop_back();   }}catch(Exception& e) { GPSTK_RETHROW(e); }}// randomize the listvoid Namelist::randomize(long seed){try {   if(labels.size() <= 1) return;   random_shuffle(labels.begin(), labels.end());}catch(Exception& e) { GPSTK_RETHROW(e); }}// is the Namelist valid? checks for repeated namesbool Namelist::valid(void) const{try {   for(unsigned int i=0; i<labels.size(); i++)      for(unsigned int j=i+1; j<labels.size(); j++)         if(labels[i] == labels[j]) return false;   return true;}catch(Exception& e) { GPSTK_RETHROW(e); }}// does the Namelist contain the input name?bool Namelist::contains(const string& name) const{try {   for(unsigned int i=0; i<labels.size(); i++)      if(labels[i] == name) return true;   return false;}catch(Exception& e) { GPSTK_RETHROW(e); }}// are two Namelists identical, ignoring a permutation?bool operator==(const Namelist& N1, const Namelist& N2){try {   if(N1.size() != N2.size()) return false;   if(N1.size() == 0) return true;   for(unsigned int i=0; i<N1.size(); i++) {      unsigned int match=0;      for(unsigned int j=0; j<N2.size(); j++)         if(N1.labels[i] == N2.labels[j]) match++;      if(match != 1) return false;     // if > 1, N2 is invalid   }   return true;}catch(Exception& e) { GPSTK_RETHROW(e); }}// are two Namelists different, ignoring a permutation?bool operator!=(const Namelist& N1, const Namelist& N2){try {   return !(N1==N2);}catch(Exception& e) { GPSTK_RETHROW(e); }}// are two Namelists exactly identical, even considering permutations?bool identical(const Namelist& N1, const Namelist& N2){try {   if(N1.size() != N2.size()) return false;   if(N1.size() == 0) return true;   for(unsigned int i=0; i<N1.size(); i++) {      if(N1.labels[i] != N2.labels[i]) return false;   }   return true;}catch(Exception& e) { GPSTK_RETHROW(e); }}// construct the subset Namelist which is common to the two input (AND)Namelist operator&(const Namelist& N1, const Namelist& N2){try {   Namelist N(N1);   N &= N2;   return N;}catch(Exception& e) { GPSTK_RETHROW(e); }}// merge two Namelists, i.e. construct a non-redundant combination (OR)Namelist operator|(const Namelist& N1, const Namelist& N2){try {   Namelist N(N1);   N |= N2;   return N;}catch(Exception& e) { GPSTK_RETHROW(e); }}// construct the subset Namelist which is NOT common to two others (XOR)Namelist operator^(const Namelist& N1, const Namelist& N2){try {   Namelist N(N1);   N ^= N2;   return N;}catch(Exception& e) { GPSTK_RETHROW(e); }}// replace this with (this & input) (AND - common to both)Namelist& Namelist::operator&=(const Namelist& N){try {   Namelist NAND;   for(unsigned int i=0; i<labels.size(); i++)      if(N.contains(labels[i])) NAND += labels[i];   *this = NAND;   return *this;}catch(Exception& e) { GPSTK_RETHROW(e); }}// replace this with (this | input) (OR - merge - superset)// NB new elements must be added at the end (for class SRI).Namelist& Namelist::operator|=(const Namelist& N){try {   Namelist NOR(*this);   for(unsigned int i=0; i<N.labels.size(); i++)      if(!(this->contains(N.labels[i]))) NOR += N.labels[i];   *this = NOR;   return *this;}catch(Exception& e) { GPSTK_RETHROW(e); }}// replace this with (this ^ input) (XOR - not common)Namelist& Namelist::operator^=(const Namelist& N){try {   unsigned int i;   Namelist NXOR;   for(i=0; i<labels.size(); i++)      if(!(N.contains(labels[i]))) NXOR += labels[i];   for(i=0; i<N.labels.size(); i++)      if(!(this->contains(N.labels[i]))) NXOR += N.labels[i];   *this = NXOR;   return *this;}catch(Exception& e) { GPSTK_RETHROW(e); }}// access to a specific name, given its index; may be used as lvalue.//string& Namelist::operator[](const unsigned int in)//{//   if(in >= labels.size()) throw ...//   return labels[in];//}// access to a specific name, given its index.// returns 'out-of-range' if the index is out of range.string Namelist::getName(const unsigned int in) const{try {   if(in >= labels.size()) return string("out-of-range");   return labels[in];}catch(Exception& e) { GPSTK_RETHROW(e); }}// assign a specific name, given its index;// no effect if the index is out of range or the name is not unique.// return true if successfulbool Namelist::setName(const unsigned int in, const string& name){try {   if(in >= labels.size()) return false;   if(labels[in] == name) return true;    // NB b/c contains(name) would be true..   if(contains(name)) return false;   labels[in] = name;   return true;}catch(Exception& e) { GPSTK_RETHROW(e); }}// return the index of the name in the list that matches the input, -1 if not found.int Namelist::index(const string& name) const{try {   for(unsigned int i=0; i<labels.size(); i++)      if(labels[i] == name) return i;   return -1;}catch(Exception& e) { GPSTK_RETHROW(e); }}// output operatorostream& operator<<(ostream& os, const Namelist& N){try {   for(unsigned int i=0; i<N.labels.size(); i++) os << " / " << N.labels[i];   os << " / ";   return os;}catch(Exception& e) { GPSTK_RETHROW(e); }}ostream& operator<<(ostream& os, const LabelledVector& nlp){try {   unsigned int i;   string s;   //ofstream savefmt;   //savefmt.copyfmt(os);   //int wid=os.width(),prec=os.precision();   if(nlp.msg.size() > 0)      s = StringUtils::leftJustify(nlp.msg,nlp.wid);   else      s = StringUtils::rightJustify(string(""),nlp.wid);   os << s;   for(i=0; i<nlp.NL.size(); i++) {      if(nlp.NL.getName(i).size() > nlp.wid)      s = StringUtils::leftJustify(nlp.NL.getName(i),nlp.wid);      else      s = StringUtils::rightJustify(nlp.NL.getName(i),nlp.wid);      os << s;   }   os << endl;   s = StringUtils::rightJustify(string(""),nlp.wid);   os << s;   if(nlp.form == 1) os << fixed;   if(nlp.form == 2) os << scientific;   for(i=0; i<nlp.V.size(); i++) {      //os.copyfmt(savefmt);      //os << nlp.V(i);      os << setw(nlp.wid) << setprecision(nlp.prec) << nlp.V(i);   }   return os;}catch(Exception& e) { GPSTK_RETHROW(e); }}ostream& operator<<(ostream& os, const LabelledMatrix& nlp){try {   unsigned int i,j;   string s;   const Namelist *pNLcol = &nlp.NLcols;   const Namelist *pNLrow = &nlp.NLrows;      // first make sure we have both namelists   if(nlp.NLrows.size() == 0 && nlp.NLcols.size() == 0) {      os << " Error -- Namelists in LabelledMatrix are empty! ";      return os;   }   if(nlp.NLrows.size() == 0) pNLrow = pNLcol;   if(nlp.NLcols.size() == 0) pNLcol = pNLrow;      // on column labels line, add message or space for row labels   if(nlp.rc == 0) {    // only if printing both column and row labels      if(nlp.msg.size() > 0)         s = StringUtils::leftJustify(nlp.msg,nlp.wid);      else         s = StringUtils::rightJustify(string(""),nlp.wid);      os << s;   }      // print column labels   if(nlp.rc != 1) { // but not if 'rows only'      for(i=0; i<(nlp.M.cols()<pNLcol->size()?nlp.M.cols():pNLcol->size()); i++) {         if(pNLcol->getName(i).size() > nlp.wid)            s = StringUtils::leftJustify(pNLcol->getName(i),nlp.wid);         else            s = StringUtils::rightJustify(pNLcol->getName(i),nlp.wid);         os << s;      }      os << endl;   }   if(nlp.form == 1) os << fixed;   if(nlp.form == 2) os << scientific;   for(i=0; i<nlp.M.rows(); i++) {         // print row labels      if(nlp.rc != 2) { // but not if 'columns only'         if(pNLrow->getName(i).size() > nlp.wid)            s = StringUtils::leftJustify(pNLrow->getName(i),nlp.wid);         else            s = StringUtils::rightJustify(pNLrow->getName(i),nlp.wid);         os << s;      }         // finally, print the data      for(j=0; j<nlp.M.cols(); j++) {         os << setw(nlp.wid) << setprecision(nlp.prec) << nlp.M(i,j);      }      if(i<nlp.M.rows()-1) os << endl;   }   return os;}catch(Exception& e) { GPSTK_RETHROW(e); }}} // end namespace gpstk//------------------------------------------------------------------------------------//------------------------------------------------------------------------------------

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
免费观看在线色综合| 亚洲一区二区三区在线看| 欧美日韩免费观看一区二区三区| 国产精品456露脸| 国产一区二区三区在线看麻豆| 婷婷国产在线综合| 视频一区视频二区在线观看| 亚洲成人av中文| 日韩国产精品大片| 国模娜娜一区二区三区| 激情综合网av| 成人精品一区二区三区中文字幕| 成人午夜看片网址| 色香色香欲天天天影视综合网| 91片在线免费观看| 欧美日韩大陆在线| 欧美精品一区二区高清在线观看| 久久网站最新地址| 中文字幕一区视频| 亚洲福中文字幕伊人影院| 免费成人小视频| 国产黄色精品网站| 一本久久a久久精品亚洲| 色av成人天堂桃色av| 3d动漫精品啪啪1区2区免费 | 久久九九99视频| 欧美激情资源网| 一区二区国产视频| 蜜桃视频一区二区三区在线观看 | 国产日韩欧美综合在线| 中文字幕电影一区| 天天综合色天天综合色h| 蜜桃视频在线一区| 97aⅴ精品视频一二三区| 精品视频在线视频| 国产婷婷色一区二区三区四区| 国产精品网站导航| 日韩精品一二三区| 99精品偷自拍| 精品三级av在线| 亚洲一区在线观看免费| 国产黄色精品视频| 欧美一区二区三区白人| 亚洲美女一区二区三区| 久久精品噜噜噜成人88aⅴ| 91年精品国产| 久久午夜老司机| 丝袜亚洲另类欧美综合| av在线播放不卡| 精品国产91乱码一区二区三区| 亚洲精品成人天堂一二三| 国产九色精品成人porny | 日韩视频免费直播| 亚洲一区二区精品视频| 国产凹凸在线观看一区二区| 8x8x8国产精品| 一区二区三区在线观看国产| 成人手机电影网| 亚洲精品一线二线三线无人区| 夜夜精品浪潮av一区二区三区| 成人性视频网站| 国产午夜精品一区二区三区嫩草| 日韩av一二三| 欧美日韩美少妇| 亚洲成av人综合在线观看| av一区二区三区在线| 中文乱码免费一区二区| 国产一区二区在线影院| 日韩欧美卡一卡二| 蜜桃91丨九色丨蝌蚪91桃色| 精品视频一区三区九区| 亚洲一区二区三区四区的| 欧美一区二区三区色| 亚洲图片一区二区| 欧美日韩国产在线观看| 亚洲一区二区三区视频在线播放 | 91精品国产全国免费观看| 亚洲国产日韩一区二区| 欧美丝袜第三区| 亚洲成人自拍网| 欧美人妇做爰xxxⅹ性高电影| 亚洲宅男天堂在线观看无病毒| 91国模大尺度私拍在线视频| 亚洲免费在线电影| 欧美性大战久久久久久久蜜臀| 亚洲日本在线视频观看| 色婷婷香蕉在线一区二区| 亚洲欧美日韩在线不卡| 在线区一区二视频| 视频精品一区二区| 欧美精品一区二区久久婷婷 | 成人av动漫在线| 亚洲色图在线视频| 欧美四级电影在线观看| 亚洲福利一二三区| 精品日本一线二线三线不卡| 国产在线视频精品一区| 中文字幕亚洲不卡| 欧美体内she精高潮| 久久精品国产一区二区三| 久久青草欧美一区二区三区| 成人手机在线视频| 午夜视频在线观看一区| 精品国产a毛片| 91丝袜美腿高跟国产极品老师| 亚洲精品va在线观看| 欧美一级久久久久久久大片| 国产精品一区久久久久| 一卡二卡欧美日韩| 日韩精品中文字幕一区二区三区| 成人一区在线看| 日日夜夜一区二区| 国产精品电影院| 日韩一级二级三级| 99国产精品99久久久久久| 日韩福利电影在线观看| 中文字幕第一区综合| 欧美一区二区三区男人的天堂| 成人综合在线视频| 蜜臀va亚洲va欧美va天堂| 国产精品女人毛片| 欧美成人a∨高清免费观看| 色综合视频在线观看| 国内精品久久久久影院薰衣草 | 欧美一区二区三区婷婷月色| 成人一区在线观看| 国产成a人亚洲| 亚洲国产精品久久不卡毛片 | 欧美男同性恋视频网站| 国产一区二区免费视频| 日韩精品成人一区二区在线| 国产欧美精品一区二区色综合| 欧美精品高清视频| 91丨九色丨国产丨porny| 国产成人精品免费在线| 美女视频网站久久| 日韩国产精品久久久| 一区二区成人在线| 亚洲视频一二三| 国产精品久久久久国产精品日日| 欧美xxxx老人做受| 欧美一区二区三区电影| 欧美日韩午夜影院| 欧洲日韩一区二区三区| 97久久精品人人澡人人爽| 国产91精品露脸国语对白| 久久爱www久久做| 久久国产生活片100| 日韩精品成人一区二区在线| 亚洲成在线观看| 夜夜揉揉日日人人青青一国产精品| 国产精品久久福利| 中文字幕一区二区视频| 中文字幕一区二区不卡| 中文在线免费一区三区高中清不卡| 欧美电影免费观看高清完整版在线观看 | 亚洲黄色免费网站| 亚洲激情成人在线| 亚洲精品成a人| 亚洲成人福利片| 日韩av电影免费观看高清完整版 | 色悠久久久久综合欧美99| 北条麻妃国产九九精品视频| 国产91精品久久久久久久网曝门 | 色婷婷综合五月| 欧美性受xxxx| 制服丝袜av成人在线看| 精品国产欧美一区二区| 2020国产精品久久精品美国| 久久久久久**毛片大全| 国产清纯白嫩初高生在线观看91| 国产三级精品三级在线专区| 久久久蜜臀国产一区二区| 国产精品女上位| 亚洲成人自拍网| 国产一区二区三区电影在线观看| 国产福利精品一区| 91美女在线观看| 日韩亚洲电影在线| 国产精品情趣视频| 一区二区三区在线观看网站| 日韩精品一二区| 成人午夜电影网站| 欧美日韩黄色一区二区| 欧美成人综合网站| 中文字幕综合网| 日本va欧美va欧美va精品| 国产成人精品综合在线观看| 94-欧美-setu| 欧美精品 国产精品| 国产亚洲一区二区三区四区| 亚洲日本青草视频在线怡红院| 日韩激情av在线| 成人av动漫网站| 日韩三级精品电影久久久| 亚洲日本欧美天堂| 国产一区二区在线观看免费 | 欧美久久久久久蜜桃| 中文在线一区二区| 久久精品国产一区二区三 |