资源简介
mt_rand() 产生随机数
随机数种子一样,随机数序列则会完全一相同。
所以知道随机数种子后,就能知道所有随机数序列。(随机数种子 => 随机数序列)
知道随机数后,也能推出随机数种子。(随机数 => 随机数种子 => 随机数序列)
代码片段和文件信息
/*
* Copyright (c) 20122013 Solar Designer
*
* Redistribution and use in source and binary forms with or without
* modification are permitted.
*
* There‘s ABSOLUTELY NO WARRANTY express or implied.
*/
#include
#include
#include
#include
#include /* sysconf() */
#include
#include
#ifdef __MIC__
#include
typedef __m512i vtype;
/* hack */
#define _mm_set1_epi32(x) _mm512_set1_epi32(x)
#define _mm_add_epi32(x y) _mm512_add_epi32(x y)
#define _mm_macc_epi32(x y z) _mm512_fmadd_epi32(x y z)
#define _mm_slli_epi32(x i) _mm512_slli_epi32(x i)
#define _mm_srli_epi32(x i) _mm512_srli_epi32(x i)
#define _mm_and_si128(x y) _mm512_and_epi32(x y)
#define _mm_or_si128(x y) _mm512_or_epi32(x y)
#define _mm_xor_si128(x y) _mm512_xor_epi32(x y)
#elif defined(__AVX2__)
#include
typedef __m256i vtype;
/* hack */
#define _mm_set1_epi32(x) _mm256_set1_epi32(x)
#define _mm_add_epi32(x y) _mm256_add_epi32(x y)
#define _mm_macc_epi32(x y z) \
_mm256_add_epi32(_mm256_mullo_epi32((x) (y)) (z))
#define _mm_slli_epi32(x i) _mm256_slli_epi32(x i)
#define _mm_srli_epi32(x i) _mm256_srli_epi32(x i)
#define _mm_and_si128(x y) _mm256_and_si256(x y)
#define _mm_or_si128(x y) _mm256_or_si256(x y)
#define _mm_xor_si128(x y) _mm256_xor_si256(x y)
#define _mm_cmpeq_epi32(x y) _mm256_cmpeq_epi32(x y)
#define _mm_testz_si128(x y) _mm256_testz_si256(x y)
#elif defined(__SSE4_1__)
#include
#include
typedef __m128i vtype;
#ifdef __XOP__
#include
#else
#define _mm_macc_epi32(a b c) \
_mm_add_epi32(_mm_mullo_epi32((a) (b)) (c))
#ifdef __AVX__
#warning XOP and AVX2 are not enabled. Try gcc -mxop (on AMD Bulldozer or newer) or -mavx2 (on Intel Haswell or newer).
#else
#warning AVX* and XOP are not enabled. Try gcc -mxop (on AMD Bulldozer or newer) -mavx (on Intel Sandy Bridge or newer) or -mavx2 (on Intel Haswell or newer).
#endif
#endif
#else
/*
* We require at least SSE4.1 for vectorization because we use
* SSE4.1‘s _mm_mullo_epi32() or XOP‘s _mm_macc_epi32() as well as SSE4.1‘s
* _mm_testz_si128().
*/
#warning SSE4.1 not enabled will use non-vectorized code. Try gcc -msse4 (only on capable CPUs).
#endif
#ifndef _OPENMP
#warning OpenMP not enabled will only use one CPU core. Try gcc -fopenmp.
#endif
#define M 397
#define N 624
#define MATCH_PURE 1
#define MATCH_FULL 2
#define MATCH_SKIP 4
#define MATCH_LAST 8
typedef struct {
uint32_t flags;
int32_t mmin mmax;
int32_t rmin;
double rspan;
} match_t;
#define NEXT_STATE(x i) \
(x) = 1812433253U * ((x) ^ ((x) >> 30)) + (i);
#if defined(__SSE4_1__) || defined(__AVX2__) || defined(__MIC__)
static inline int diff(uint32_t x uint32_t xs uint32_t seed
const match_t *match)
#else
static inline int diff(uint32_t x uint32_t x1 uint32_t xs
const match_t *match)
#endif
{
#if defined(__SSE4_1__) ||
相关资源
- 好用的php微信企业号
- 最专业的PHP集成环境秒杀phpStudy、xa
- THINKPHP商城,含支付宝、微信支付
- thinkPHP支付宝支付功能完整源码
- phpMyFAQ v3.0.1 多国语言版
- php MyFAQ问答系统 多国语言版 v3.0.4
- phpMyFAQ 问答系统
- phpMyFAQ v3.0.0 多国语言版
- phpMyFAQ 开源问答系统 v3.0.0 RC2
- PHP网页小游戏
- php小说采集demo
- PHP寄生虫繁殖劫持程序V3.0
- 韩顺平 PHP从入门到精通百度云资源(
- windows安装intl扩展
- phpSpreadsheet.zip
- Xblog、PHPwind、Oblog三款主流商用博客软
- PHP微信扫码关注公众号并授权登录.
- ZipFile.php(PHP压缩类打包)
- php聊天室源码群聊私聊多聊天室
- PHP支持手势的手机端图片裁剪上传
- 使用PHP+Sphinx建立高效的站内搜索引擎
- vip影视源码自动无需采集THINKPHP版
- ThinkPHP5.1 excel表的导入导出操作 (P
- PhpSpreadsheet Excel组件,PHPExcel升级版
- 追梦翔飞数字报刊管理系统PHPV7.3
- 拼团商城开源系统-基于thinkphp5-如花拼
- 微信支付Native扫码方式PHP
- 微信分享jssdk朋友圈带缩略图-utf8php通
- php简历模板
- php大马一句话数据库集合
评论
共有 条评论