当前位置: 首页 > news >正文

网站宣传流程网站的外链

网站宣传流程,网站的外链,阳泉网站开发,怎样在百度上宣传自己的产品埃尔米特插值 原理 #pragma once #include vector #include functional /*埃尔米特插值*/ struct InterpolationPoint {double x; // 插值点的横坐标double y; // 插值点的纵坐标double derivative; // 插值点的导数值// 默认构造函数InterpolationPoint() : x…埃尔米特插值 原理 #pragma once #include vector #include functional /*埃尔米特插值*/ struct InterpolationPoint {double x; // 插值点的横坐标double y; // 插值点的纵坐标double derivative; // 插值点的导数值// 默认构造函数InterpolationPoint() : x(0.0), y(0.0), derivative(0.0) {}// 带参数的构造函数InterpolationPoint(double x_val, double y_val, double derivative_val) : x(x_val), y(y_val), derivative(derivative_val) {}// 拷贝构造函数InterpolationPoint(const InterpolationPoint other) : x(other.x), y(other.y), derivative(other.derivative) {}// 移动构造函数InterpolationPoint(InterpolationPoint other) noexcept : x(other.x), y(other.y), derivative(other.derivative) {other.x 0.0;other.y 0.0;other.derivative 0.0;}// Copy assignment operatorInterpolationPoint operator(const InterpolationPoint other) {if (this ! other) {x other.x;y other.y;derivative other.derivative;}return *this;}// 设置插值点的值void set(double x_val, double y_val, double derivative_val) {x x_val;y y_val;derivative derivative_val;}// 获取插值点的横坐标double get_x() const {return x;}// 获取插值点的纵坐标double get_y() const {return y;}// 获取插值点的导数值double get_derivative() const {return derivative;} };class HermiteInterpolator { public:HermiteInterpolator(const std::vectorInterpolationPoint points);HermiteInterpolator(int width, std::vectorint adjPoints);void setPoints(const std::vectorInterpolationPoint points);double interpolate(double x) ;private:// 返回连接两点的线段函数std::functiondouble(double) getLineFunction( InterpolationPoint p1, InterpolationPoint p2);private:std::vectorInterpolationPoint points_; }; #include pch.h #include HermiteInterpolator.h #include fstream HermiteInterpolator::HermiteInterpolator(const std::vectorInterpolationPoint points) : points_(points) { } HermiteInterpolator::HermiteInterpolator(int width, std::vectorint adjPoints) {float step width / adjPoints.size();for (int i 0; i adjPoints.size(); i){InterpolationPoint point(step*i, adjPoints[i] , 0);points_.push_back(point);} } void HermiteInterpolator::setPoints(const std::vectorInterpolationPoint points) {points_ points; }// 返回连接两点的线段函数 std::functiondouble(double) HermiteInterpolator::getLineFunction( InterpolationPoint p1, InterpolationPoint p2) {// 计算线段的斜率和截距double slope (p2.y - p1.y) / (p2.x - p1.x);double intercept p1.y - slope * p1.x;// 返回线段的lambda表达式return [slope, intercept](double x) {return slope * x intercept;}; } // 计算三次分段Hermite插值函数的值 double HermiteInterpolator::interpolate(double x) {int y 0;int n points_.size();if (n 3){// 获取线段函数std::functiondouble(double) lineFunction getLineFunction(points_[0], points_[1]);y lineFunction(x);}else{for (int i 0; i n - 1; i) {if (x points_[i].x x points_[i 1].x) {double h points_[i 1].x - points_[i].x;double t (x - points_[i].x) / h;// (x-x_k)/(x_{k1} - x_k)double tk (x - points_[i 1].x) / (-h); // (x - x_{ k 1 }) / (x_k - x_{ k 1 }) double y0 (1 2 * t) * tk * tk;double y1 (1 2 * tk) * t * t;double y2 (x - points_[i].x) * tk * tk;double y3 (x - points_[i 1].x) * t * t;y points_[i].y * y0 points_[i 1].y * y1 points_[i].derivative * y2 points_[i 1].derivative * y3;}}}//ofstream f;//f.open(D:\\work\\documentation\\HermiteInterpolator.txt, ios::app);//f x, y endl;//f.close();return y; // 如果找不到对应的插值段返回默认值 }为了可视化效果可以把结果写到HermiteInterpolator.txt 画图python代码 import matplotlib.pyplot as plt# 打开文本文件进行读取 with open(D:\\work\\documentation\\HermiteInterpolator.txt) as f:data f.readlines()# 定义两个列表分别存储横坐标和纵坐标的数据 x [] y [] # 遍历每一行 for i, line in enumerate(data):# 去除换行符if line:user_pwd_list line.strip().split(,)# 横坐标是行号x.append(float(user_pwd_list[0]))# 纵坐标是数值数据y.append(float(user_pwd_list[1]))# 创建散点图 plt.scatter(x, y)# 添加标题和轴标签 plt.title(Scatter Plot) plt.xlabel(Line) plt.ylabel(Value)# 显示并保存图像 #plt.savefig(plot.png) plt.show()
http://www.zqtcl.cn/news/425148/

相关文章:

  • 太仓网站建设平台成都家装设计公司排名
  • 现在建一个网站一年费用只要几百元如何建一个免费试用网站
  • 网站没有被收录销售型网站的建设流程及特点
  • 成都58手机微信网站建设名录近一周财经新闻热点
  • wordpress情侣网站源码微信开放平台官网登录
  • 网站改版提示无需改版有没有兼职做设计的网站
  • 网站sem怎么做网络建设设计方案
  • wap网站在线生成做饰品网站
  • 网站主机在哪里注册呢江西的赣州网站建设
  • 零基础网站建设视频教程建筑设计专业是干什么的
  • 淘客做网站的话虚拟主机多大重庆网上房地产网签合同查询
  • 官网建站网站seo关键字优化软件
  • 网站制作的内容什么好开发板用什么语言编程
  • 医院品牌网站建设aws创建wordpress
  • dw做的网站怎么让别人看到动易网站频道栏目字体大小修改
  • 东莞网站设计公司排名辽宁建设工程信息网网上开标
  • 网站推广工具有页面素材图片
  • 网页设计搭建网站外贸求购信息平台
  • 仓库改造类网站怎么做手机创建网站的软件
  • 成都平台网站建设公司邯郸网络科技公司
  • 热门课程自己做网站大型购物网站建站
  • apache 创建网站重庆建站模板
  • 手机怎么制作网站叶县建设局网站
  • 怎么做后台网站一键更新搜索引擎优化的主要策略
  • 站酷网免费素材图库官网国外域名购买
  • 石家庄个人谁做网站天体摄影
  • 徐州集团网站建设网站排名快速提升工具
  • 自己创业做原公司一样的网站做网站要学会什么语言
  • 宿州高端网站建设公司网络业务
  • 做多语言版本网站网站收录低