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

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

?? compatibility.c

?? http://gaul.sourceforge.net/ 這里大部分人討論的是在Matlab里實現GA的toolbox.以上為一個GA的C語言的軟件包.如果你想利用GA做優化算法,非常有用.而且有
?? C
字號:
/**********************************************************************  compatibility.c **********************************************************************  compatibility - Compatibility/Portability stuff.  Copyright ?2000-2004, Stewart Adcock <stewart@linux-domain.com>  All rights reserved.  The latest version of this program should be available at:  http://gaul.sourceforge.net/  This program is free software; you can redistribute it and/or modify  it under the terms of the GNU General Public License as published by  the Free Software Foundation; either version 2 of the License, or  (at your option) any later version.  Alternatively, if your project  is incompatible with the GPL, I will probably agree to requests  for permission to use the terms of any other license.  This program is distributed in the hope that it will be useful, but  WITHOUT ANY WARRANTY WHATSOEVER.  A full copy of the GNU General Public License should be in the file  "COPYING" provided with this distribution; if not, see:  http://www.gnu.org/ **********************************************************************  Synopsis:	Compatibility/portability functions.		Note that some of these functions are POSIX		compliant. Some are ANSI compliant.  Some are just		plain non-standard. **********************************************************************/#include "gaul/compatibility.h"#if HAVE_IPOW != 1/* * Integer power. */int ipow(int n, int e)  {  int	result=1;	/* The answer. */  while (e>0)    {    result*=n;    e--;    }  return result;  }#endif	/* HAVE_IPOW */#if HAVE_DPOW != 1/* * Double to integer power. */double dpow(double n, int e)  {  double	result=1.0;	/* The answer. */  while (e>0)    {    result*=n;    e--;    }  return result;  }#endif	/* HAVE_DPOW */#if HAVE_MEMCPY != 1#if HAVE_BCOPY != 1/* * Copy LEN characters from SRC to DEST *  * Some systems, such as SunOS do have BCOPY instead. * In which case this is defined as a macro in the header. */void memcpy(char *dest, const char *src, size_t len)  {  char		*dest_p;  const	char	*src_p;  int		byte_c;    if (len <= 0)    return;    src_p = src;  dest_p = dest;    if (src_p <= dest_p && src_p + (len - 1) >= dest_p)    {    /* overlap, must copy right-to-left. */    src_p += len - 1;    dest_p += len - 1;    for (byte_c = 0; byte_c < len; byte_c++)      *dest_p-- = *src_p--;    }  else    {    for (byte_c = 0; byte_c < len; byte_c++)      *dest_p++ = *src_p++;    }  return;  }#endif /* HAVE_BCOPY */#endif /* HAVE_MEMCPY */#if HAVE_STRCHR != 1#if HAVE_INDEX != 1/* * Find C in STR by searching through the string */char *strchr(const char *str, int c)  {  while ( *str != '\0' )    {    if (*str == (char)c)      return (char *)str;    str++;    }    if (c == '\0')    return (char *)str;  return NULL;  }#endif /* HAVE_INDEX */#endif /* HAVE_STRCHR */#if HAVE_STRLEN  != 1/* * Return the length in characters of STR */size_t strlen(const char *str)  {  int	len=0;    while ( *str != '\0' )    {    str++;    len++;    }    return len;  }#endif /* HAVE_STRLEN */#if HAVE_STRCMP != 1/* * Compare str1 and str2. * * It returns -1, 0 or 1 if str1 is found, to be less than, to be * equal to, or be greater than str2, respectively. */int strcmp(const char *str1, const char *str2)  {  while (*str1 != '\0' && *str1 == *str2)    {    str1++;    str2++;    }  return *str1 - *str2;  }#endif /* HAVE_STRCMP */#if HAVE_STRNCMP != 1/* * Compare at most len characters of str1 and str2. * * It returns -1, 0 or 1 if str1 is found, to be less than, to be * equal to, or be greater than str2, respectively. */int strncmp(const char *str1, const char *str2, size_t len)  {  int	c=0;    while ( c < len )    {    if (*str1 != *str2 || *str1 == '\0')      return *str1 - *str2;    c++;    str1++;    str2++;    }    return 0;  }#endif /* HAVE_STRNCMP */#if HAVE_STRCPY != 1/* * Copies str2 to str1. * * Returns str1. */char *strcpy(char *str1, const char *str2)  {  char	*str_p;  str_p = str1;  while (*str2 != '\0')    {    *str_p = *str2;    str_p++;    str2++;    }  *str_p = '\0';    return str1;  }#endif /* HAVE_STRCPY */#if HAVE_STRNCPY != 1/* * Copy str2 to str1 until len characters copied, or a null * character is found in str2. * * Returns str1. */char	*strncpy(char *str1, const char *str2, size_t len)  {  char		*str1_p, null_reached = FALSE;  int		len_c;    for (len_c = 0, str1_p = str1; len_c < len && !null_reached; len_c++, str1_p++, str2++)    {    if (null_reached || *str2 == '\0')      {      null_reached = TRUE;      *str1_p = '\0';      }    else      {      *str1_p = *str2;      }    }    return str1;  }#endif /* HAVE_STRNCPY */#if HAVE_STRPBRK != 1/* * Locate the first occurrence in the string s of any of the characters in the string accept. */char *strpbrk(const char *s, const char *accept)  {  const char *s1;  const char *s2;   for (s1 = s; *s1 != '\0'; ++s1)    {    for (s2 = accept; *s2 != '\0'; ++s2)      {      if (*s1 == *s2) return (char *) s1;      }    }       return NULL;  }#endif /* HAVE_STRPBRK */#if HAVE_STRSEP != 1/* * If *str is NULL, return NULL.  Otherwise, this find the first token * in the string *str, where tokens are delimited by symbols in the * string delim.  This token is terminated with a `\0' character (by * overwriting the delimiter) and *str is updated to point past the * token.  If no delimiter is found, the token is taken to be the * entire string *str, and *str is made NULL. * * Returns a pointer to the token (i.e returns the original value of *str) * * The strsep() function was introduced as a replacement for strtok(), * which cannot handle empty fields. */char *strsep(char **str, const char *delim)  {  char *s = *str, *end;  if (!s) return NULL;  end = strpbrk(s, delim);  if (end) *end++ = '\0';  *str = end;  return s;  }#endif /* HAVE_STRSEP */#if HAVE_STRCASECMP != 1/* * Compare strings like strncmp(), but ignoring case. */int strcasecmp(const char *str0, const char *str1)  {  while( tolower(*str0)==tolower(*str1) )    {    if(*str0=='\0')      return 0;    str0++;    str1++;    }  return tolower(*str0)-tolower(*str1);  }#endif /* HAVE_STRCASECMP */#if HAVE_STRNCASECMP != 1/* * Compare strings like strncmp(), but ignoring case. * ie, only compares first n chars. */int strncasecmp(const char *str0, const char *str1, size_t n)  {  size_t i;    for(i=0; i<n && tolower(*str0)==tolower(*str1); i++, str0++, str1++)    if(*str0=='\0')      return 0;  return (i==n) ? 0 : (tolower(*str0)-tolower(*str1));  }#endif /* HAVE_STRNCASECMP */#if HAVE_USLEEP != 1/* * Sleep for a specified number of microseconds. * -- Should replace with the POSIX standard's nanosleep(). */void usleep(unsigned long usec)  {#if W32_CRIPPLED == 1# if USE_WINDOWS_H == 1  Sleep(usec/1000);		/* Windows sleep is in milliseconds. */#else  int	i;  for (i=0; i<usec*10; i++);	/* A completely dodgy kludge.  Just introduces an arbitrary length delay. */# endif#else  #if HAVE_SNOOZE == 1		/* i.e. BeOS, AtheOS, Syllable. */  snooze(usec/1000);		/* BeOS sleep is in milliseconds. */  #else  struct timeval tv;  tv.tv_sec=0;  tv.tv_usec=usec;  select(0, NULL, NULL, NULL, &tv);  #endif#endif  return;  }#endif /* HAVE_USLEEP */#if HAVE_MEMSET != 1/* * Set LEN characters in STR to character C */#if USE_OPTIMISED_MEMSET != 1/* Original version.  Must use this on Solaris, by the looks of things. */void *memset(void *str, int c, size_t len)  {  char	*orig = str;    for (; len > 0; len--, str++) *(char *)str = (char)c;    return orig;  }#else/* Optimised version *//* * Copyright (c) 1990, 1993 *      The Regents of the University of California.  All rights reserved. * * This code is derived from software contributed to Berkeley by * Mike Hibler and Chris Torek. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright *    notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright *    notice, this list of conditions and the following disclaimer in the *    documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors *    may be used to endorse or promote products derived from this software *    without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */void *memset(void *dst0, int c0, size_t bytes)  {    size_t t;    unsigned int c;    unsigned char *dst;    const int word_size = sizeof(unsigned int);    const int word_mask = (sizeof(unsigned int) - 1);    dst = dst0;    /* if not enough words for a reasonable speedup, just fill bytes */    if (bytes < 3 * word_size) {        while (bytes != 0) {            *dst++ = c0;            --bytes;        }        return dst0;    }    /* fill the whole stamping word */    if ((c = (unsigned char)c0) != 0) {         c = c | (c << 8);#if (SIZEOF_INT > 2)        c = c | (c << 16);#endif#if (SIZEOF_INT > 4)        c = c | (c << 32);#endif    }    /* align destination by filling in bytes */    if ((t = (long)dst & word_mask) != 0) {        t = word_size - t;        bytes -= t;        do {            *dst++ = c0;        } while (--t != 0);    }    /* now fill with words. length was >= 2*words so we know t >= 1 here */    t = bytes / word_size;    do {        *(unsigned int *)dst = c;        dst += word_size;    } while (--t != 0);    /* finish with trailing bytes, if there are bytes left */    t = bytes & word_mask;    if (t != 0) {        do {            *dst++ = c0;        } while (--t != 0);    }  return dst0;  }#endif#endif /* HAVE_MEMSET */#if HAVE_MEMCMP != 1#if HAVE_BCMP != 1/* * Some systems, such as SunOS do have BCMP instead. * In which case this is defined as a macro in the header. */int memcmp(const void *src1, const void *src2, size_t n)  {  const unsigned char *cp1=src1;  const unsigned char *cp2=src2;     while (n-- > 0) if (*cp1++ != *cp2++) return (*--cp1 - *--cp2);  return 0;  }#endif /* HAVE_BCMP */#endif /* HAVE_MEMCMP */#if HAVE_STRDUP != 1char *strdup(const char *str)  {  char *new_str;  if (!str) return NULL;  new_str = s_malloc(sizeof(char)*(strlen(str)+1));  strcpy(new_str, str);  return new_str;  }#endif /* HAVE_STRDUP */#if HAVE_STRNDUP != 1char *strndup(const char *str, size_t n)  {  char *new_str=NULL;  if (str)    {    new_str = s_malloc(sizeof(char)*(n+1));    strncpy(new_str, str, n);    new_str[n] = '\0';    }  return new_str;  }#endif /* HAVE_STRNDUP */#if HAVE_DIEF != 1/* * Needed as a function because many compilers don't use vararg macros. * HAVE_DIEF is set in "SAA_header.h", not "config.h". */void dief(const char *format, ...)  {  va_list       ap;                        /* variable args structure */  printf("FATAL ERROR: ");  va_start(ap, format);  vprintf(format, ap);  va_end(ap);  printf("\n");  abort();  }#endif /* HAVE_DIEF */#if HAVE_WAITPID != 1 && !defined( W32_CRIPPLED )pid_t waitpid(pid_t pid, int *pstatus, int options)  {  pid_t result;  do    {    result = wait(pstatus);    } while (result >= 0 && result != pid);  return result;  }#endif /* HAVE_WAITPID */#if HAVE_MIN != 1int min( int a, int b )  {  return a <= b ? a : b;  }#endif#if HAVE_MAX != 1int max( int a, int b )  {  return a >= b ? a : b;  }#endif#if HAVE_SINCOS != 1/* * This is an undocumented GNU extension, which is actually fairly useful. */void sincos( double radians, double *s, double *c )  {#if __i368__  __asm__ ("fsincos" : "=t" (*c), "=u" (*s) : "0" (radians));#else  *s = sin(radians);  *c = cos(radians);#endif/*printf("DEBUG: sincos(%f) = %f %f\n", radians, *s, *c);*/  return;  }#endif /* HAVE_SINCOS */#if HAVE_GETHOSTNAME != 1/* * gethostname() - get host name   This function is used to access the host name of the current processor.  It   returns a NULL-terminated hostname by filling the array name with a length of   len bytes.  In case the NULL-terminated hostname does not fit, no error is   returned, but the hostname is truncated.  In the specification, it is   unspecified whether the truncated hostname will be NULL-terminated, but here   it is.   What should happen is that upon success, zero is returned.  On error, -1    is returned, and errno is set to EINVAL.  But here the hostname is set to   <unknown>.  From the manpage:       EINVAL len is negative or, for sethostname, len is larger than the              maximum allowed size, or, for gethostname on Linux/i386, len              is smaller than the actual size.  (In this last case glibc 2.1              uses ENAMETOOLONG.)   SUSv2 guarantees that host names are limited to 255 bytes.  POSIX   1003.1-2001 guarantees that host names (not including the terminating   NUL) are limited to HOST_NAME_MAX bytes. */int gethostname(char *name, size_t len)  {  snprintf(name, len, "<unknown>");  return TRUE;  }#endif /* HAVE_GETHOSTNAME */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品久久一区二区| 一区二区三区美女| 亚洲欧美一区二区在线观看| 午夜精彩视频在线观看不卡| 成人性生交大合| 日韩一区二区三区电影在线观看 | 日韩欧美的一区| 亚洲欧美国产三级| 国产a区久久久| 欧美成人欧美edvon| 亚洲综合视频在线观看| 成人av电影在线| 国产欧美一区二区精品性色超碰| 免费在线一区观看| 精品国产乱码久久久久久老虎| 亚洲一区二区三区四区五区黄 | 亚洲天堂中文字幕| 九九视频精品免费| 日韩一级免费观看| 丝袜a∨在线一区二区三区不卡| 一本色道亚洲精品aⅴ| 国产精品久久久久久久久晋中 | 久久狠狠亚洲综合| 欧美日韩精品一区二区三区 | 一区二区三区四区亚洲| 成人av网址在线| 国产精品久久久久精k8 | 麻豆精品视频在线观看| 欧美肥胖老妇做爰| 亚洲国产精品精华液网站 | 成人禁用看黄a在线| 久久精品一区二区三区不卡| 欧美日本高清视频在线观看| 亚洲va国产天堂va久久en| 色综合久久中文综合久久97| 亚洲精品高清视频在线观看| 91国偷自产一区二区开放时间| 亚洲人吸女人奶水| 日本高清免费不卡视频| 亚洲国产综合视频在线观看| 欧美日韩一区二区三区四区| 天堂在线一区二区| 日韩一区二区三区在线| 国模套图日韩精品一区二区| 久久久精品一品道一区| 国产高清不卡一区二区| 国产精品黄色在线观看| 在线精品视频免费播放| 日本美女一区二区三区视频| 亚洲精品在线观看视频| 成人国产精品免费观看| 亚洲成av人影院在线观看网| 精品视频全国免费看| 久久国内精品视频| 中文字幕乱码一区二区免费| 色婷婷久久久亚洲一区二区三区| 亚洲另类一区二区| 日韩欧美国产电影| 从欧美一区二区三区| 一区二区三区美女视频| 91精品国产麻豆国产自产在线| 精品一区二区精品| 国产精品久久综合| 91精品国产色综合久久不卡电影 | 亚洲欧美一区二区三区孕妇| 欧美丝袜丝交足nylons图片| 国产一区二区三区免费观看| 亚洲三级免费电影| 日韩欧美一区在线观看| 99免费精品在线| 另类小说图片综合网| 亚洲乱码日产精品bd| 日韩免费看的电影| 欧美性色aⅴ视频一区日韩精品| 久99久精品视频免费观看| 夜夜爽夜夜爽精品视频| 久久久久久久久久美女| 欧美色涩在线第一页| 国产成人综合网站| 日韩精品亚洲一区| 最近日韩中文字幕| 亚洲精品在线免费观看视频| 欧美视频一区二区三区| 99视频热这里只有精品免费| 秋霞影院一区二区| 一区二区在线观看不卡| 久久伊99综合婷婷久久伊| 欧美日本国产视频| 色婷婷久久99综合精品jk白丝 | 欧美色精品天天在线观看视频| 国产成人免费在线视频| 另类小说欧美激情| 丝袜亚洲另类丝袜在线| 一区二区三区在线视频观看 | 国产三级一区二区| 日韩精品一区二区三区四区| 欧美色图在线观看| 色综合中文综合网| 波波电影院一区二区三区| 免费成人在线网站| 亚洲va天堂va国产va久| 亚洲综合色自拍一区| 综合欧美亚洲日本| 国产精品美女久久久久久久| 久久精品在线免费观看| 精品1区2区在线观看| 精品国产乱码久久久久久久久 | 国产在线不卡一卡二卡三卡四卡| 午夜精品成人在线视频| 性欧美疯狂xxxxbbbb| 亚洲一区影音先锋| 艳妇臀荡乳欲伦亚洲一区| 一区二区三区在线视频观看58 | 一区二区三区国产精华| 亚洲久草在线视频| 亚洲影视在线播放| 午夜久久久久久久久久一区二区| 亚洲黄一区二区三区| 亚洲国产一二三| 香蕉影视欧美成人| 日本sm残虐另类| 九色综合狠狠综合久久| 国产酒店精品激情| 成人午夜在线播放| 99国产精品久久久久久久久久久| 一本色道久久综合亚洲91| 欧美日韩中文字幕一区| 欧美一级艳片视频免费观看| 欧美电影免费观看高清完整版在 | 久久久久国产成人精品亚洲午夜| 久久综合色之久久综合| 欧美国产日本韩| 一区二区三区中文免费| 日本成人在线一区| 国产一区二区调教| 99re在线视频这里只有精品| 精品视频在线免费看| 久久亚洲欧美国产精品乐播| 中文字幕欧美日本乱码一线二线| 亚洲麻豆国产自偷在线| 日本不卡一二三| 成人污污视频在线观看| 日本高清不卡在线观看| 日韩欧美电影在线| 国产精品福利影院| 丝袜亚洲另类欧美| 福利电影一区二区| 欧美日韩三级在线| 国产欧美日产一区| 午夜精品一区二区三区免费视频 | 国产高清在线观看免费不卡| 91久久国产最好的精华液| 91麻豆精品国产综合久久久久久| 久久亚洲春色中文字幕久久久| 综合在线观看色| 青青草97国产精品免费观看无弹窗版| 国产91在线观看| 欧美日韩免费电影| 亚洲欧美在线观看| 久久se这里有精品| 在线亚洲高清视频| 久久五月婷婷丁香社区| 亚洲电影你懂得| 成人h版在线观看| 精品久久久久久久久久久久久久久久久 | 国产亚洲精品福利| 丝袜亚洲另类丝袜在线| 91小视频免费看| xvideos.蜜桃一区二区| 日韩黄色小视频| 欧美吻胸吃奶大尺度电影 | 裸体一区二区三区| 在线中文字幕一区二区| 欧美国产精品v| 另类人妖一区二区av| 欧美日韩国产经典色站一区二区三区 | 色婷婷激情综合| 国产精品入口麻豆原神| 国产一区二区在线观看视频| 欧美一区二区三区视频免费播放| 一区二区三区四区视频精品免费 | 欧美一区二区视频免费观看| 亚洲欧美色综合| 岛国av在线一区| 欧美精品一区二| 精品一区二区在线免费观看| 3atv一区二区三区| 午夜精品久久久久久久久久久| 91免费在线看| 亚洲精品va在线观看| 91麻豆国产精品久久| 亚洲日本一区二区| 成人av片在线观看| 中文字幕色av一区二区三区| 国产91精品一区二区| 国产亚洲一区二区三区在线观看| 精品一区二区影视| 久久久久久久久伊人| 成人一区二区三区在线观看| 亚洲欧洲国产专区|