摘要: %使用遗传算法求解% f(x1,x2)=x1^2+x2^2-0.3*cos(3*pi*x1)-0.4*cos(4*pi*x2)+0.7的极小值,并画出每一代中个体适配函% 数的平均值和最小值随迭代次数的变化关系%程序总体说明:% 编码方式说明: 由于期望所求的函数极小值包含了平方项,而正弦和余弦项的范围只能是-1---1,因此优化范围的x1,x2只能在-1--1之间,编码时% 首先将x1,x2加1变到0--2之间,之后为了编码需要,设采样精度是0.01 ,将0--2之间的数乘以100,得到0--200之间的整数,另外为了编码的需要,%设编码为8位,编码成0--255的二进制码。,每个个体用16 阅读全文
posted @ 2011-05-08 15:26 Keosu 阅读(1398) 评论(2) 推荐(0) 编辑
摘要: 操作系统环境:Ubuntu 10.10 Last Update 2011-4-18 15:47:10 1.WARN mapred.JobClient: Error reading task output ******2.INFO mapred.JobClient: Task Id : attempt_201104051702_0010_m_000010_2, Status : FAILED Too many fetch-failures3.INFO ipc.Client: Retrying connect to server: [domain:port]. Already tried X t. 阅读全文
posted @ 2011-04-18 15:47 Keosu 阅读(978) 评论(0) 推荐(0) 编辑
摘要: onesCreate array of all ones Y = ones(n)Y = ones(m,n)Y = ones([m n])Y = ones(m,n,p,...)Y = ones([m n p ...]) Y = ones(n) returns an n-by-n matrix of 1s. An error message appears if n is not a scalar.Y = ones(m,n) or Y = ones([m n]) returns an m-by-n matrix of ones.Y = ones(m,n,p,...) or Y = ones([m 阅读全文
posted @ 2011-03-25 21:35 Keosu 阅读(667) 评论(0) 推荐(0) 编辑
摘要: 打印1~1000.(不使用循环,不使用条件语句)1 使用函数指针退出 代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--voidyesprint(inti);voidnoprint(inti);typedefvoid(*fnPtr)(int);fnPtrdispatch[]={yesprint,noprint};voidyesprint(inti){printf("%d\n",i);dispatch[i/1000](i+1);}voidnopri 阅读全文
posted @ 2011-01-07 11:20 Keosu 阅读(321) 评论(0) 推荐(0) 编辑
摘要: unique: Removes duplicate elements that are adjacent to each other in a specified range.unique函数#include<vector>#include<algorithm>#include<functional>#include<iostream>#include<ostream>usingnamespacestd;//Returnwhethermodulusofelem1isequaltomodulusofelem2boolmod_equal( 阅读全文
posted @ 2010-10-10 16:34 Keosu 阅读(361) 评论(0) 推荐(0) 编辑
摘要: C++ File Operation12voidFileHandle(stringname,stringoutfile)3{4ifstreamin(name.c_str());5ofstreamout(outfile.c_str());67if(in){89out<<in.rdbuf();1011}12in.close();13out.close();14}------------------------------------时间 #include<time.h>time_t t = time(NULL);cout << ctime(&t);// 阅读全文
posted @ 2010-10-07 15:29 Keosu 阅读(624) 评论(0) 推荐(0) 编辑
摘要: Kosaraju算法 ,Targen算法(递归) c#1代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->1/*2*User:Answer3*Date:2010-04-134*Time:21:585*/6usingSystem;7usingSystem.IO;8usingSystem.Collections;9usingSystem.Text;1011namespaceGraph12{13///<summary>14///Des 阅读全文
posted @ 2010-04-14 10:54 Keosu 阅读(497) 评论(0) 推荐(0) 编辑
摘要: 1.MATLAB的基本知识1-1、基本运算与函数   基本数学运算,只需将运算式直接打入提示号(>>)之后;内置函数:sin,cos ……变量存放向量、矩阵:向量基本运算矩阵输入:A = [1 2 3 4; 5 6 7 8; 9 10 11 12];   【附】% 注释符号 ;  help   lookfor ... 阅读全文
posted @ 2010-04-03 10:29 Keosu 阅读(376) 评论(0) 推荐(0) 编辑
摘要: 原文:http://www.51cto.com/specbook/15/35600.htm .NET 的发展与变迁 微软的.NET Framework是一套可以集成到Windows操作系统中的组件。它为应用程序提供了中间代码的支持,并且可以通过运行时来管理这些中间代码。.NET Framework是微软的一个关键产品,它更适合于在Windows平台上新编写的软件。 微软通过中间代码的形式提供了很... 阅读全文
posted @ 2010-03-28 09:25 Keosu 阅读(254) 评论(0) 推荐(0) 编辑
摘要: (1)“@”符号@不解释转义字符,以下等价:string x="D:\\T\\My Doc";string y = @"D:\T\My Doc";(2)基本的语法字符。\d   0-9的数字\D   \d的补集(以所以字符为全集,下同),即所有非数字的字符\w   单词字符,指大小写字母、0-9的数字、下划线\W   \w的补集\s   空白字符,包括换行符\n、回车符\r... 阅读全文
posted @ 2010-03-17 21:39 Keosu 阅读(310) 评论(0) 推荐(0) 编辑