11 2015 档案

摘要:binary format 格式化描述符 参数1 参数2...参数N binary scan 二进制数据 格式化描述符 变量1 变量2... 变量N 格式化描述符由两部分组成,第一是格式化类型关键字(一个字母),另一个为可选的整数count(不选,默认为1)注意:格式化关键字区分大小写 格式化... 阅读全文
posted @ 2015-11-28 23:29 硫酸亚铜 阅读(1160) 评论(0) 推荐(0) 编辑
摘要:摘自《c++和面向对象数值计算》,代码简洁明快,采用模板函数,通用性增强,牛顿差分合理利用存储空间,采用Horner算法(又称秦九韶算法)提高精度,减少时间复杂度,高!确实是高!对其中代码稍加改动。#include#include using namespace std;template T ... 阅读全文
posted @ 2015-11-28 20:51 硫酸亚铜 阅读(781) 评论(0) 推荐(1) 编辑
摘要:摘自《c++和面向对象数值计算》,代码简洁明快,采用模板函数,通用性增强,对其中代码稍加改动#include#include using namespace std;template T lagrange(constvector&vx,constvector&vy,T x); int main... 阅读全文
posted @ 2015-11-28 16:30 硫酸亚铜 阅读(1251) 评论(0) 推荐(0) 编辑
摘要:本程序对cosx函数进行插值,取步长为0.1,因此x的值为0.00,0.10,0.20,0.30,对应的y值为cos(0.00),cos(0.10),cos(0.20),cos(0.30),其实本程序Horner方法(又称秦九韶算法)效率更高,计算更加准确#include #include u... 阅读全文
posted @ 2015-11-28 11:51 硫酸亚铜 阅读(766) 评论(0) 推荐(0) 编辑
摘要:XY0.400.410750.550.578150.650.696750.800.888110.901.026521.051.25382#includeusing namespacestd;doubleaverage_deviation(double* function_value,doubl... 阅读全文
posted @ 2015-11-28 05:10 硫酸亚铜 阅读(1038) 评论(0) 推荐(0) 编辑
摘要:#include#include #include"matlib.h"using namespacestd;int main(){ initM(MATCOM_VERSION); //初始化Matcom C++矩阵库,当与exitM()同时使用,否则会造成内存泄露 Mma... 阅读全文
posted @ 2015-11-28 03:23 硫酸亚铜 阅读(264) 评论(0) 推荐(0) 编辑
摘要:已给sin0.32=0.314567,sin0.34=0.333487,sin0.36=0.352274,计算sin0.3367的值#include #include#include using namespace std;int main(){ double numerator_c... 阅读全文
posted @ 2015-11-27 23:53 硫酸亚铜 阅读(1812) 评论(0) 推荐(0) 编辑
摘要:C++当中获得现在计算机上所能表示的各种类型(比如int,longint,shortint,double,float等)最大最小有两种方法,一种是使用c++预先定义的宏,对于有些编译器可能需要包含和两种头文件,还有一种是使用numeric_limits::max()和numeric_limit... 阅读全文
posted @ 2015-11-27 20:37 硫酸亚铜 阅读(532) 评论(0) 推荐(0) 编辑
摘要:2 1 0 03 1 3 00 5 2 70 0 9 0这个程序对于三对角矩阵都是有效的,为了精简代码可以考虑用链表的方式动态存储矩阵数据,由于程序已经完成,本次未采用链表,看着代码比较冗长#include#include... 阅读全文
posted @ 2015-11-27 19:31 硫酸亚铜 阅读(712) 评论(0) 推荐(0) 编辑
摘要:0 0 0 0 0 00 3 0 0 0 00 0 0 6 0 00 0 9 0 0 ... 阅读全文
posted @ 2015-11-27 19:04 硫酸亚铜 阅读(619) 评论(0) 推荐(0) 编辑
摘要:#include#includeusingnamespace std;int main(){ doublex,y,h,temp,f; x=0; //对x赋初值 y=1; //对y赋初值 h=0.1; /... 阅读全文
posted @ 2015-11-27 19:01 硫酸亚铜 阅读(743) 评论(0) 推荐(0) 编辑
摘要:#include#includeusingnamespace std;int main(){ doublex,y,yn,h,temp,f; x=0; //对x赋初值 y=1; //对y赋初值 h=0.1; ... 阅读全文
posted @ 2015-11-27 18:59 硫酸亚铜 阅读(963) 评论(0) 推荐(0) 编辑
摘要:#include#includeusingnamespace std;int main(){ doublex,y,yn,h,temp; x=0; //对x赋初值 y=1; //对y赋初值 h=0.1; ... 阅读全文
posted @ 2015-11-27 18:56 硫酸亚铜 阅读(598) 评论(0) 推荐(0) 编辑
摘要:#include#includeusing namespace std;int main() { double x, y, h; //,x为对应的每一步x的值,其中y为对应的每一步y的值 x = 0; //对x赋初值 y = 1; ... 阅读全文
posted @ 2015-11-27 18:54 硫酸亚铜 阅读(1151) 评论(0) 推荐(0) 编辑
摘要:编写一个用牛顿法解方程x=tanx 的程序,求最接近4.5和7.7的根#include#includeusingnamespace std;int main(){ doubleinit_first = 4.5, init_second =7.7; //求4.5和7.7附近的... 阅读全文
posted @ 2015-11-27 18:50 硫酸亚铜 阅读(1531) 评论(0) 推荐(0) 编辑
摘要:利用二分法求解在区间[0,π/2]上的根#include#includeusingnamespace std;double dichotomy(doublebegin, double end);int main(){ constdouble pi =3.14; //定义π的... 阅读全文
posted @ 2015-11-27 18:37 硫酸亚铜 阅读(445) 评论(0) 推荐(0) 编辑