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

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

?? astring.cc

?? COOOL:CWP面向對象最優(yōu)化庫(CWP Object Oriented Optimization Library) COOOL是C++類的一個集合
?? CC
字號:
// *****************************************************************// UGA        version        1.0        --       November       1992// *****************************************************************// This  code is part of a preliminary release of UGA (uni-processor// genetic  algorithm)  and  associated  class  libraries.   It  was// developed  on  Sun Sparcstations using AT&T's C++ compiler.  Ver-// sions which will compile using the GNU C++  compiler  on  various// architectures are in preparation.// This software was developed and tested at  various  institutions,// including  Amoco  Production  Company's  Tulsa  Research  Center,// Princeton University, The University of Paris, and Los Alamos Na-// tional Laboratories.  The authors wish to express their gratitude// to these institutions for encouraging this work.// You get this code for free.// You can do anything you want with it, including make a fortune.// Neither the authors, Amoco, nor anyone else you can imagine makes// any  promises or guarantees about anything in this package or any// aspect of its functionality.// Authors:  Martin L. Smith, Terri L. Fischer// For    further    information    contact    John    Scales     at// jscales@dix.mines.colorado.edu,  telephone:   303-273-3408,  fax:// 303-273-3478.  // This may look like C code, but it is really -*- C++ -*-#include <AString.hh>#include <string.h>#include <ctype.h>#include <stdlib.h>#include <stdio.h>static const int	default_chunk_size = 8;static const char*	myNameIs = "AString";static const char*	empty_string = "";// private methodsvoid AString::bigEnough(const int size){    if(size < 0){	cerr << className() << "bigEnough: arg size = " << size	    << " is less than zero." << endl;	exit(1);    	}        if(size >= 0 && mem < (size + 1)){	char* tmp = contents;		// have to do division before multiplication because	// we're doing integer arithmetic and we want the division	// step to truncate the answer		int num_chunks = ((size + 1) + (chunksize() - 1)) / chunksize();	mem = num_chunks * chunksize();	contents = new char[mem];	contents[0] = '\0';		if(tmp != NULL)	    strcpy(contents, tmp);	delete tmp;    }}void AString::initVars() {    length(0);    mem = 0;    contents = NULL;    chunksize(default_chunk_size);}int AString::inRange(const long i) const {    return(i >= 0 && i < length());}void AString::length(const int new_length){    len = new_length >= 0 ? new_length : -1;}// protected methods// Description:// Converts a single char into an AString.  Be warned that it will// also convert numbers (\fIe.g.\fP 7) into an AString as well.AString::AString(const char c){    initVars();    copy(c);}// Description:// Called by the equality operators. Returns an integer greater than,// equal to, or less than 0, according as the current AString is// lexicographically greater than, equal to, or less than the AString// argument \fIas\fP.int AString::compare(const AString& as) const{    if(this == &as)		// they're the same AString	return 0;    int asIsEmpty	= as.empty();    int thisIsEmpty	= empty();        if(asIsEmpty && thisIsEmpty) // both are empty	return 0;		 // contents == as.contents    else if(asIsEmpty || thisIsEmpty) // only one is empty	return asIsEmpty ? 1 : -1;    else			      // neither are empty	return strcmp(contents, as.contents);}// Description:// Called by the equality operators. Returns an integer greater than,// equal to, or less than 0, according as the current AString is// lexicographically greater than, equal to, or less than the const char*// argument \fIs\fP.int AString::compare(const char* s) const {    if(contents == s)	return 0;		// they're the same pointer        int sIsEmpty = (s == NULL ? True : (strlen(s) == 0 ? TRUE : FALSE));    int thisIsEmpty = empty();    if(sIsEmpty && thisIsEmpty) // both are empty	return 0;		 // s == as.s    else if(sIsEmpty || thisIsEmpty) // only one is empty	// sIsEmpty ? contents > s : contents < s	return sIsEmpty ? 1 : -1;    else			     // neither are empty	return strcmp(contents, s);}// Description:// Appends the contents of the AString argument \fIas\fP to the end of// the current AString.void AString::concat(const AString& as){    if(!as.empty()){	int this_length	= length();	int as_length	= as.length();	int m		= this_length + as_length;	bigEnough(m);		// make bigEnough before assigning pointer	char* start_pointer = &contents[this_length];	length(m);	// do strncpy (instead of strcpy) in case as is same AString as this	strncpy(start_pointer, as.contents, as_length);	contents[m] = '\0';    }}// Description:// Appends the contents of the const char* argument \fIs\fP to the end// of the current AString.void AString::concat(const char* s){    if(s != NULL){	int this_length	= length();	int s_length	= strlen(s);	int m		= this_length + s_length;	bigEnough(m);		// make bigEnough before assigning pointer	char* start_pointer = &contents[this_length];	length(m);	strncpy(start_pointer, s, s_length);	contents[m] = '\0';    }}	// Description:// Appends the const char argument \fIc\fP to the end of the current// AString.void AString::concat(const char& c){    int m = length();    bigEnough(m + 1);    contents[m++] = c;    contents[m] = '\0';    length(m);}// Description:// Replaces the old contents of the current AString with the contents// of the AString argument \fIas\fP.void AString::copy(const AString& as){    if(this != &as)		// if they're not the same AString	if(!as.empty()){	    length(as.length());	    bigEnough(length());	    strcpy(contents, as.contents);	}}// Description:// Replaces the old contents of the current AString with the contents// of the const char* argument \fIcp\fP.void AString::copy(const char* cp){    if(contents != cp)		// if they're not the same pointer	if(cp != NULL){	    length(strlen(cp));	    bigEnough(length());	    strcpy(contents, cp);	}}// Description:// Replaces the old contents of the current AString with the const// char argument \fIc\fP.void AString::copy(const char& c){    length(1);    bigEnough(length());    contents[0] = c;    contents[1] = '\0';}// Description:// Returns 1 if the variable \fIcontents\fP is equal to NULL and 0// otherwise.int AString::isNull() const {    return(contents == NULL);}// public methods// Description:// Default constructor.AString::AString(){    initVars();}// Description:// Converts a const char* into an AString.AString::AString(const char* cp){    initVars();    copy(cp);}// copy constructorAString::AString(const AString& as){    initVars();    copy(as);}AString::~AString(){    delete contents;}// Description:// Returns the size of memory allocation hunks.int AString::chunksize() const {    return(chunk_size > 0 ? chunk_size : default_chunk_size);}// Description:// Changes the size of memory allocation hunks.void AString::chunksize(const int new_size){    if(new_size > 0)	chunk_size = new_size;}// Description:// Returns 1 if the string is empty, 0 otherwise.int AString::empty() const {    return (length() == 0);}// Description:// Returns the number of characters in the string.// Always non-negative.int AString::length() const{    if(len == -1){	AString* that = (AString*)(this); // cast away const-ness	that->length(isNull() ? 0 : strlen(contents));    }    return(len);}// Description:// Assigns one AString to another. The user doesn't have to worry// about there being enough space to hold the new string.AString& AString::operator=(const AString& as){    if(this != &as){				// check for s = s	delete contents;			// zap the current guy	initVars();	chunksize(as.chunksize());	copy(as);    }    return *this;}// Description:// Assigns a char* to an AString. The user doesn't have to worry// about there being enough space to hold the new string.AString& AString::operator=(const char* s){    delete contents;			// zap the current guy    initVars();    copy(s);    return *this;}// Description:// Returns the (read-only) value of the \fIi\fPth character,// counting from zero.const char& AString::operator[](const long i) const{    if(!inRange(i)){	cerr << className() << "[" << i << "], i is out of range" << endl;	exit(1);    }    return(contents[i]);}// Description:// Add an AString to the end of the current AString.AString& AString::operator+=(const AString& as){    concat(as);    return *this;}// Description:// Add a char* to the end of the current AString.AString& AString::operator+=(const char* s){    concat(s);    return *this;}// Description:// Return a (read-only) character pointer to the current AString.AString::operator const char*() const{    if(isNull())	return empty_string;    else	return(contents);}const char* AString::className() const{    return(myNameIs);}// Description:// Return a lower-case'd version of the current AString.AString AString::asLowerCase() const{    AString t = *this;    for(int i = 0; i < len; i++)	t.contents[i] = tolower(t.contents[i]);    return t;}// friend functions// Description:// Return an AString formed by joining two AStrings.AString operator+(const AString& as, const AString& bs){    AString tmp;    tmp.bigEnough(as.length() + bs.length());    tmp.concat(as);    tmp.concat(bs);    return tmp;}// Description:// Return an AString formed by joining an AString and a const char*.AString operator+(const AString& as, const char* s){    AString tmp;    tmp.bigEnough(as.length() + (s == NULL ? 0 : strlen(s)));    tmp.concat(as);    tmp.concat(s);    return tmp;}// Description:// Return an AString formed by joining a const char* and an AString.AString operator+(const char* s, const AString& as){    AString tmp;    tmp.bigEnough((s == NULL ? 0 : strlen(s)) + as.length());    tmp.concat(s);    tmp.concat(as);    return tmp;}// equalityint operator==(const AString& as, const AString& bs){    return(as.compare(bs) == 0);}int operator==(const AString& as, const char* s){    return(as.compare(s) == 0);}int operator==(const char* s, const AString& as){    return(as.compare(s) == 0);}// inequalityint operator!=(const AString& as, const AString& bs){    return(as.compare(bs) != 0);}int operator!=(const AString& as, const char* s){    return(as.compare(s) != 0);}int operator!=(const char* s, const AString& as){    return(as.compare(s) != 0);}// greater thanint operator>(const AString& as, const AString& bs){    return(as.compare(bs) > 0);}int operator>(const AString& as, const char* s){    return(as.compare(s) > 0);}int operator>(const char* s, const AString& as){    return(as.compare(s) < 0);	// reverse the order }// greater than or equal toint operator>=(const AString& as, const AString& bs){    return(as.compare(bs) >= 0);}int operator>=(const AString& as, const char* s){    return(as.compare(s) >= 0);}int operator>=(const char* s, const AString& as){    return(as.compare(s) <= 0);	// reverse the order}// less thanint operator<(const AString& as, const AString& bs){    return(as.compare(bs) < 0);}int operator<(const AString& as, const char* s){    return(as.compare(s) < 0);}int operator<(const char* s, const AString& as){    return(as.compare(s) > 0);	// reverse the order}// less than or equal toint operator<=(const AString& as, const AString& bs){    return(as.compare(bs) <= 0);}int operator<=(const AString& as, const char* s){    return(as.compare(s) <= 0);}int operator<=(const char* s, const AString& as){    return(as.compare(s) >= 0);	// reverse the order}ostream& operator<<(ostream& fp, const AString& as){   fp << as.contents;   return fp;}istream& operator>>(istream& fp, AString& as){   fp >> as.contents;   return fp;}// functions#include <stdarg.h>		// to get varargs// Description:// Format, according to \fIfmt\fP the arguments to ASFormat() and// into an AString.  Uses printf(3) style arguments.AString ASFormat(char* fmt, ...){    va_list	arg_list;    char	s[1024];        va_start(arg_list, fmt);    (void) vsprintf(s, fmt, arg_list);    va_end(arg_list);    AString as = s;    return as;}// Description:// Convert an unsigned char into an AString.AString toAS(unsigned char uc){    return ASFormat("%c", uc);}// Description:// Convert a char into an AString.AString toAS(char c){    return ASFormat("%c", c);}// Description:// Convert an unsigned short into its AString representation.AString toAS(unsigned short um){    return ASFormat("%hu", um);}// Description:// Convert a short into its AString representation.AString toAS(short m){    return ASFormat("%hd", m);}// Description:// Convert a unsigned int into its AString representation.AString toAS(unsigned int um){    return ASFormat("%u", um);}// Description:// Convert a int into its AString representation.AString toAS(int m){    return ASFormat("%d", m);}// Description:// Convert a long into its AString representation.AString toAS(unsigned long um){    return ASFormat("%lu", um);}// Description:// Convert a long into its AString representation.AString toAS(long m){    return ASFormat("%d", m);}// Description:// Convert a float or float into its AString representation.AString toAS(double d){    return ASFormat("%g", d);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一区二区三区免费看| 972aa.com艺术欧美| 91精品福利在线一区二区三区| 亚洲欧美成aⅴ人在线观看 | 亚洲一区在线看| 日本道免费精品一区二区三区| 亚洲视频一二三| 欧美日韩中文字幕一区二区| 午夜影院在线观看欧美| 日韩一级欧美一级| 黑人精品欧美一区二区蜜桃| 国产丝袜美腿一区二区三区| 99久久777色| 亚洲国产精品久久人人爱蜜臀| 欧美精品视频www在线观看| 久久不见久久见免费视频1| 久久久精品国产免费观看同学| 国产精品一级在线| 亚洲精品国产精品乱码不99| 欧美日韩国产天堂| 国产原创一区二区| 亚洲色图在线看| 欧美精品xxxxbbbb| 国产激情一区二区三区四区| 一区二区三区中文字幕精品精品| 欧美色老头old∨ideo| 久久9热精品视频| 亚洲欧洲精品一区二区精品久久久| 在线观看免费成人| 精油按摩中文字幕久久| 亚洲视频每日更新| 日韩精品最新网址| 日本三级亚洲精品| 国产精品素人视频| 欧美丰满少妇xxxxx高潮对白| 国内精品国产成人| 亚洲一区二区影院| 国产婷婷色一区二区三区 | 白白色 亚洲乱淫| 丝袜亚洲另类欧美| 中文字幕一区二区三区精华液 | 欧美一区午夜精品| www.亚洲色图.com| 精品伊人久久久久7777人| 亚洲欧美日韩在线不卡| 精品国产1区二区| 欧美人伦禁忌dvd放荡欲情| 成人午夜在线免费| 免费精品视频在线| 一个色妞综合视频在线观看| 国产网站一区二区三区| 欧美三级午夜理伦三级中视频| 国产河南妇女毛片精品久久久| 亚洲bt欧美bt精品777| 日韩理论片网站| 久久久久久久久久久久久久久99 | 国产剧情av麻豆香蕉精品| 亚洲午夜在线观看视频在线| 国产精品网曝门| 日韩免费在线观看| 欧美日本一区二区| 色妹子一区二区| 成人免费va视频| 国产精品一区二区久久精品爱涩| 三级欧美在线一区| 亚洲综合视频在线观看| 亚洲国产精品成人综合色在线婷婷| 欧美高清一级片在线| 91成人看片片| 一本久久综合亚洲鲁鲁五月天| 国产成人99久久亚洲综合精品| 日本不卡中文字幕| 丝袜美腿一区二区三区| 午夜av一区二区三区| 亚洲国产毛片aaaaa无费看| 怡红院av一区二区三区| 亚洲视频一区在线观看| 中文字幕视频一区| 国产精品久久一级| 国产精品色一区二区三区| 欧美国产丝袜视频| 中文av一区二区| 国产精品毛片久久久久久久| 国产精品丝袜黑色高跟| 欧美激情中文字幕| 国产精品女主播av| 亚洲视频小说图片| 亚洲影院久久精品| 天天做天天摸天天爽国产一区 | 欧美色大人视频| 91激情在线视频| 欧美日韩国产欧美日美国产精品| 欧美日韩另类一区| 91精品国产高清一区二区三区 | av亚洲精华国产精华精| av激情亚洲男人天堂| 一本色道久久综合亚洲91 | 在线观看欧美黄色| 欧美日韩免费视频| 日韩视频在线永久播放| 久久综合色一综合色88| 国产日韩亚洲欧美综合| 国产精品色眯眯| 亚洲一区视频在线| 日本亚洲三级在线| 国产原创一区二区| 99精品视频在线播放观看| 欧美午夜精品一区二区三区| 911国产精品| 国产亚洲视频系列| 1000精品久久久久久久久| 亚洲图片一区二区| 狠狠色丁香婷婷综合| 97久久精品人人做人人爽| 欧美日韩精品电影| 久久婷婷综合激情| 亚洲欧美日韩久久精品| 蜜臀久久久久久久| 成人一区二区三区视频 | 捆绑紧缚一区二区三区视频| 国产精品18久久久久久久久久久久| 大白屁股一区二区视频| 欧美性大战久久久久久久蜜臀| 88在线观看91蜜桃国自产| 久久久精品国产免大香伊| 亚洲黄色免费电影| 狠狠狠色丁香婷婷综合久久五月| 99久久亚洲一区二区三区青草| 欧美日韩国产精品自在自线| 国产亚洲午夜高清国产拍精品 | 亚洲高清免费视频| 国产伦理精品不卡| 欧美日韩久久不卡| 国产精品视频在线看| 蜜臀av一级做a爰片久久| 99久久精品免费看国产免费软件| 51久久夜色精品国产麻豆| 国产精品日产欧美久久久久| 婷婷久久综合九色综合绿巨人| 国产iv一区二区三区| 日韩一区二区电影网| 一区二区三区成人在线视频| 国产精品 日产精品 欧美精品| 欧美美女一区二区在线观看| 国产精品国产精品国产专区不片| 日本v片在线高清不卡在线观看| 97精品久久久久中文字幕| 精品国产免费视频| 水蜜桃久久夜色精品一区的特点| 99精品久久99久久久久| 欧美精品一区二区三区在线| 午夜视频久久久久久| 色婷婷av一区二区三区大白胸 | 日韩欧美中文字幕制服| 又紧又大又爽精品一区二区| 国产传媒欧美日韩成人| 欧美一卡二卡三卡| 午夜精品福利久久久| 日本道色综合久久| 一区二区中文视频| 国产不卡视频一区| 久久久国产精品午夜一区ai换脸| 日韩成人精品视频| 欧美精品久久久久久久久老牛影院| 亚洲欧美另类小说视频| 99国产精品久久久| 国产精品久久久久久久久晋中| 国产九九视频一区二区三区| 精品乱人伦一区二区三区| 蜜臀av一区二区| 欧美大片免费久久精品三p| 日本美女视频一区二区| 欧美久久久影院| 视频一区视频二区中文| 欧美一区二区三区人| 日本不卡一二三区黄网| 日韩视频一区二区在线观看| 毛片一区二区三区| 欧美一二三四在线| 精品一区精品二区高清| 久久在线免费观看| 国产精品白丝jk白祙喷水网站| 久久久精品人体av艺术| 顶级嫩模精品视频在线看| 国产精品午夜在线| 色偷偷成人一区二区三区91| 一区二区三区精密机械公司| 欧美色老头old∨ideo| 日韩精品亚洲一区二区三区免费| 欧美久久久久久久久中文字幕| 亚洲v精品v日韩v欧美v专区| 91精品国产91久久久久久一区二区 | 免费人成黄页网站在线一区二区| 欧美电影一区二区| 久久国产三级精品| 国产午夜久久久久| 91视频免费观看| 午夜电影网亚洲视频| 精品久久一二三区| 成人av中文字幕|