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

建立网站代码/聊石家庄seo

建立网站代码,聊石家庄seo,怎么找一家公司的网站,cms企业网站模板1 文本格式 using System; using System.Collections.Generic; namespace Legalsoft.Truffer { public class Mglin { private int n { get; set; } private int ng { get; set; } private double[,] uj1 { get; set; } private Lis…

1 文本格式

using System;
using System.Collections.Generic;

namespace Legalsoft.Truffer
{
    public class Mglin
    {
        private int n { get; set; }
        private int ng { get; set; }
        private double[,] uj1 { get; set; }
        private List<double[,]> rho { get; set; } = new List<double[,]>();

        public Mglin(double[,] u, int ncycle)
        {
            this.n = u.GetLength(0);
            this.ng = 0;
            int nn = n;
            while ((nn >>= 1) != 0)
            {
                ng++;
            }
            if ((n - 1) != (1 << ng))
            {
                throw new Exception("n-1 must be a power of 2 in mglin.");
            }
            nn = n;
            int ngrid = ng - 1;
            //rho.resize(ng);
            rho = new List<double[,]>(ng);
            rho[ngrid] = new double[nn, nn];
            rho[ngrid] = u;
            while (nn > 3)
            {
                nn = nn / 2 + 1;
                rho[--ngrid] = new double[nn, nn];

                //rstrct(ref rho[ngrid], rho[ngrid + 1]);
                double[,] tmp = rho[ngrid];
                rstrct(tmp, rho[ngrid + 1]);
                //rho[ngrid] = new double[,](tmp);
                rho[ngrid] = Globals.CopyFrom(tmp);
            }
            nn = 3;
            double[,] uj = new double[nn, nn];
            slvsml(uj, rho[0]);
            for (int j = 1; j < ng; j++)
            {
                nn = 2 * nn - 1;
                uj1 = uj;
                uj = new double[nn, nn];
                interp(uj, uj1);
                uj1 = null;
                for (int jcycle = 0; jcycle < ncycle; jcycle++)
                {
                    mg(j, uj, rho[j]);
                }
            }
            u = uj;
        }

        public void interp(double[,] uf, double[,] uc)
        {
            int nf = uf.GetLength(0);
            int nc = nf / 2 + 1;
            for (int jc = 0; jc < nc; jc++)
            {
                for (int ic = 0; ic < nc; ic++)
                {
                    uf[2 * ic, 2 * jc] = uc[ic, jc];
                }
            }
            for (int jf = 0; jf < nf; jf += 2)
            {
                for (int iif = 1; iif < nf - 1; iif += 2)
                {
                    uf[iif, jf] = 0.5 * (uf[iif + 1, jf] + uf[iif - 1, jf]);
                }
            }
            for (int jf = 1; jf < nf - 1; jf += 2)
            {
                for (int iif = 0; iif < nf; iif++)
                {
                    uf[iif, jf] = 0.5 * (uf[iif, jf + 1] + uf[iif, jf - 1]);
                }
            }
        }

        public void addint(double[,] uf, double[,] uc, double[,] res)
        {
            int nf = uf.GetLength(0);
            interp(res, uc);
            for (int j = 0; j < nf; j++)
            {
                for (int i = 0; i < nf; i++)
                {
                    uf[i, j] += res[i, j];
                }
            }
        }

        public void slvsml(double[,] u, double[,] rhs)
        {
            double h = 0.5;
            for (int i = 0; i < 3; i++)
            {
                for (int j = 0; j < 3; j++)
                {
                    u[i, j] = 0.0;
                }
            }
            u[1, 1] = -h * h * rhs[1, 1] / 4.0;
        }

        public void relax(double[,] u, double[,] rhs)
        {
            int n = u.GetLength(0);
            double h = 1.0 / (n - 1);
            double h2 = h * h;
            for (int ipass = 0, jsw = 1; ipass < 2; ipass++, jsw = 3 - jsw)
            {
                for (int j = 1, isw = jsw; j < n - 1; j++, isw = 3 - isw)
                {
                    for (int i = isw; i < n - 1; i += 2)
                    {
                        u[i, j] = 0.25 * (u[i + 1, j] + u[i - 1, j] + u[i, j + 1] + u[i, j - 1] - h2 * rhs[i, j]);
                    }
                }
            }
        }

        public void resid(double[,] res, double[,] u, double[,] rhs)
        {
            int n = u.GetLength(0);
            double h = 1.0 / (n - 1);
            double h2i = 1.0 / (h * h);
            for (int j = 1; j < n - 1; j++)
            {
                for (int i = 1; i < n - 1; i++)
                {
                    res[i, j] = -h2i * (u[i + 1, j] + u[i - 1, j] + u[i, j + 1] + u[i, j - 1] - 4.0 * u[i, j]) + rhs[i, j];
                }
            }
            for (int i = 0; i < n; i++)
            {
                res[i, 0] = res[i, n - 1] = res[0, i] = res[n - 1, i] = 0.0;
            }
        }

        public void rstrct(double[,] uc, double[,] uf)
        {
            int nc = uc.GetLength(0);
            int ncc = 2 * nc - 2;
            for (int jf = 2, jc = 1; jc < nc - 1; jc++, jf += 2)
            {
                for (int iif = 2, ic = 1; ic < nc - 1; ic++, iif += 2)
                {
                    uc[ic, jc] = 0.5 * uf[iif, jf] + 0.125 * (uf[iif + 1, jf] + uf[iif - 1, jf] + uf[iif, jf + 1] + uf[iif, jf - 1]);
                }
            }
            for (int jc = 0, ic = 0; ic < nc; ic++, jc += 2)
            {
                uc[ic, 0] = uf[jc, 0];
                uc[ic, nc - 1] = uf[jc, ncc];
            }
            for (int jc = 0, ic = 0; ic < nc; ic++, jc += 2)
            {
                uc[0, ic] = uf[0, jc];
                uc[nc - 1, ic] = uf[ncc, jc];
            }
        }

        public void mg(int j, double[,] u, double[,] rhs)
        {
            const int NPRE = 1;
            const int NPOST = 1;
            int nf = u.GetLength(0);
            int nc = (nf + 1) / 2;
            if (j == 0)
            {
                slvsml(u, rhs);
            }
            else
            {
                double[,] res = new double[nc, nc];
                double[,] v = new double[nc, nc];
                double[,] temp = new double[nf, nf];
                for (int jpre = 0; jpre < NPRE; jpre++)
                {
                    relax(u, rhs);
                }
                resid(temp, u, rhs);
                rstrct(res, temp);
                mg(j - 1, v, res);
                addint(u, v, temp);
                for (int jpost = 0; jpost < NPOST; jpost++)
                {
                    relax(u, rhs);
                }
            }
        }
    }
}
 

2 代码格式

using System;
using System.Collections.Generic;namespace Legalsoft.Truffer
{public class Mglin{private int n { get; set; }private int ng { get; set; }private double[,] uj1 { get; set; }private List<double[,]> rho { get; set; } = new List<double[,]>();public Mglin(double[,] u, int ncycle){this.n = u.GetLength(0);this.ng = 0;int nn = n;while ((nn >>= 1) != 0){ng++;}if ((n - 1) != (1 << ng)){throw new Exception("n-1 must be a power of 2 in mglin.");}nn = n;int ngrid = ng - 1;//rho.resize(ng);rho = new List<double[,]>(ng);rho[ngrid] = new double[nn, nn];rho[ngrid] = u;while (nn > 3){nn = nn / 2 + 1;rho[--ngrid] = new double[nn, nn];//rstrct(ref rho[ngrid], rho[ngrid + 1]);double[,] tmp = rho[ngrid];rstrct(tmp, rho[ngrid + 1]);//rho[ngrid] = new double[,](tmp);rho[ngrid] = Globals.CopyFrom(tmp);}nn = 3;double[,] uj = new double[nn, nn];slvsml(uj, rho[0]);for (int j = 1; j < ng; j++){nn = 2 * nn - 1;uj1 = uj;uj = new double[nn, nn];interp(uj, uj1);uj1 = null;for (int jcycle = 0; jcycle < ncycle; jcycle++){mg(j, uj, rho[j]);}}u = uj;}public void interp(double[,] uf, double[,] uc){int nf = uf.GetLength(0);int nc = nf / 2 + 1;for (int jc = 0; jc < nc; jc++){for (int ic = 0; ic < nc; ic++){uf[2 * ic, 2 * jc] = uc[ic, jc];}}for (int jf = 0; jf < nf; jf += 2){for (int iif = 1; iif < nf - 1; iif += 2){uf[iif, jf] = 0.5 * (uf[iif + 1, jf] + uf[iif - 1, jf]);}}for (int jf = 1; jf < nf - 1; jf += 2){for (int iif = 0; iif < nf; iif++){uf[iif, jf] = 0.5 * (uf[iif, jf + 1] + uf[iif, jf - 1]);}}}public void addint(double[,] uf, double[,] uc, double[,] res){int nf = uf.GetLength(0);interp(res, uc);for (int j = 0; j < nf; j++){for (int i = 0; i < nf; i++){uf[i, j] += res[i, j];}}}public void slvsml(double[,] u, double[,] rhs){double h = 0.5;for (int i = 0; i < 3; i++){for (int j = 0; j < 3; j++){u[i, j] = 0.0;}}u[1, 1] = -h * h * rhs[1, 1] / 4.0;}public void relax(double[,] u, double[,] rhs){int n = u.GetLength(0);double h = 1.0 / (n - 1);double h2 = h * h;for (int ipass = 0, jsw = 1; ipass < 2; ipass++, jsw = 3 - jsw){for (int j = 1, isw = jsw; j < n - 1; j++, isw = 3 - isw){for (int i = isw; i < n - 1; i += 2){u[i, j] = 0.25 * (u[i + 1, j] + u[i - 1, j] + u[i, j + 1] + u[i, j - 1] - h2 * rhs[i, j]);}}}}public void resid(double[,] res, double[,] u, double[,] rhs){int n = u.GetLength(0);double h = 1.0 / (n - 1);double h2i = 1.0 / (h * h);for (int j = 1; j < n - 1; j++){for (int i = 1; i < n - 1; i++){res[i, j] = -h2i * (u[i + 1, j] + u[i - 1, j] + u[i, j + 1] + u[i, j - 1] - 4.0 * u[i, j]) + rhs[i, j];}}for (int i = 0; i < n; i++){res[i, 0] = res[i, n - 1] = res[0, i] = res[n - 1, i] = 0.0;}}public void rstrct(double[,] uc, double[,] uf){int nc = uc.GetLength(0);int ncc = 2 * nc - 2;for (int jf = 2, jc = 1; jc < nc - 1; jc++, jf += 2){for (int iif = 2, ic = 1; ic < nc - 1; ic++, iif += 2){uc[ic, jc] = 0.5 * uf[iif, jf] + 0.125 * (uf[iif + 1, jf] + uf[iif - 1, jf] + uf[iif, jf + 1] + uf[iif, jf - 1]);}}for (int jc = 0, ic = 0; ic < nc; ic++, jc += 2){uc[ic, 0] = uf[jc, 0];uc[ic, nc - 1] = uf[jc, ncc];}for (int jc = 0, ic = 0; ic < nc; ic++, jc += 2){uc[0, ic] = uf[0, jc];uc[nc - 1, ic] = uf[ncc, jc];}}public void mg(int j, double[,] u, double[,] rhs){const int NPRE = 1;const int NPOST = 1;int nf = u.GetLength(0);int nc = (nf + 1) / 2;if (j == 0){slvsml(u, rhs);}else{double[,] res = new double[nc, nc];double[,] v = new double[nc, nc];double[,] temp = new double[nf, nf];for (int jpre = 0; jpre < NPRE; jpre++){relax(u, rhs);}resid(temp, u, rhs);rstrct(res, temp);mg(j - 1, v, res);addint(u, v, temp);for (int jpost = 0; jpost < NPOST; jpost++){relax(u, rhs);}}}}
}

相关文章:

C#,数值计算——偏微分方程,Mglin的计算方法与源程序

1 文本格式 using System; using System.Collections.Generic; namespace Legalsoft.Truffer { public class Mglin { private int n { get; set; } private int ng { get; set; } private double[,] uj1 { get; set; } private Lis…...

一机服务万人,拓世法宝AI智能商业数字人一体机,解锁文旅新表达

在人工智能的强劲推动下&#xff0c;人们走进了一个令人振奋的数字化时代。如何让文化传承与现代科技完美融合&#xff0c;成为一个十分有趣的议题&#xff0c;当AI技术结合文旅生活&#xff0c;便悄然开启了一种全新的旅游服务模式——AI数字文旅。 在我国国家博物馆、文旅大…...

【源码解析】聊聊SpringBean是如何初始化和创建

我们知道通过类进行修复不同的属性&#xff0c;比如单例、原型等&#xff0c;而具体的流程是怎么样的呢&#xff0c;这一篇我们开始从源码的视角分析以下。 刷新方法 在刷新容器中有一个方法&#xff0c;其实就是 Bean创建的过程。 finishBeanFactoryInitialization(beanFact…...

【0基础学Java第六课】-- 数组的定义与使用

6 数组的定义与使用 6.1 什么是数组6.2 数组的创建及初始化6.2.1 数组的创建&#xff1a;6.2.2 数组的初始化 6.3 数组的使用6.3.1 数组中元素的访问6.3.2 Java中JVM当中的内存划分6.3.3 遍历数组 6.4 数组是引用类型6.4.1 初始JVM的内存分布6.4.2 基本类型变量与引用类型变量的…...

后台项目Gradle打包jar,不包含依赖jar并放到外部路径

# 1.Gradle打包jar # 2.依赖jar包外放到其他目录 # 3.保留引用关系 # 4.去掉引入的缓存build.gradle// 需要放到dependencies下面 // 傻逼问题 1 这个jar打包还得主动开 jar.enabled true // 1.清除上一次的lib目录 task clearJar(type: Delete) {delete "$buildDir\\lib…...

NSSCTF web刷题记录4

文章目录 [NSSRound#4 SWPU]1zweb(revenge)[强网杯 2019]高明的黑客[BJDCTF 2020]Cookie is so subtle![MoeCTF 2021]fake game[第五空间 2021]PNG图片转换器[ASIS 2019]Unicorn shop[justCTF 2020]gofs[UUCTF 2022 新生赛]phonecode[b01lers 2020]Life On Mars[HZNUCTF 2023 f…...

什么是大模型?一文读懂大模型的基本概念

大模型是指具有大规模参数和复杂计算结构的机器学习模型。本文从大模型的基本概念出发&#xff0c;对大模型领域容易混淆的相关概念进行区分&#xff0c;并就大模型的发展历程、特点和分类、泛化与微调进行了详细解读&#xff0c;供大家在了解大模型基本知识的过程中起到一定参…...

数据结构之队的实现

&#x1d649;&#x1d65e;&#x1d658;&#x1d65a;!!&#x1f44f;&#x1f3fb;‧✧̣̥̇‧✦&#x1f44f;&#x1f3fb;‧✧̣̥̇‧✦ &#x1f44f;&#x1f3fb;‧✧̣̥̇:Solitary-walk ⸝⋆ ━━━┓ - 个性标签 - &#xff1a;来于“云”的“羽球人”。…...

【实战Flask API项目指南】之三 路由和视图函数

实战Flask API项目指南之 路由和视图函数 本系列文章将带你深入探索实战Flask API项目指南&#xff0c;通过跟随小菜的学习之旅&#xff0c;你将逐步掌握 Flask 在实际项目中的应用。让我们一起踏上这个精彩的学习之旅吧&#xff01; 前言 当小菜踏入Flask后端开发的世界时&…...

mediasoup udp端口分配策略

mediasoup-worker多进程启动时&#xff0c;rtcMinPort/rtcMaxPort可以使用相同的配置。 for (let i 0; i < numWorkers; i) { let worker await mediasoup.createWorker({ logLevel: config.mediasoup.worker.logLevel, logTags: config.mediasoup.work…...

山西电力市场日前价格预测【2023-11-07】

日前价格预测 预测说明&#xff1a; 如上图所示&#xff0c;预测明日&#xff08;2023-11-07&#xff09;山西电力市场全天平均日前电价为318.54元/MWh。其中&#xff0c;最高日前电价为514.01元/MWh&#xff0c;预计出现在18: 00。最低日前电价为192.95元/MWh&#xff0c;预计…...

Microsoft Dynamics 365 CE 扩展定制 - 5. 外部集成

本章内容包括: 使用.NET从其他系统连接到Dynamics 365使用OData(Java)从其他系统连接到Dynamics 365使用外部库从外部源检索数据使用web应用程序连接到Dynamics 365运行Azure计划任务设置Azure Service Bus终结点与Azure Service Bus构建近乎实时的集成使用来自Azure服务总线…...

手机升级STM32单片机,pad下载程序,手机固件升级单片机,局域网程序下载,STM32单片机远程下载升级

STM32单片机&#xff0c;是我们最常见的一种MCU。通常我们在使用STM32单片机都会遇到程序在线升级下载的问题。 STM32单片机的在线下载通常需要以下几种方式完成&#xff1a; 1、使用ST提供的串口下载工具&#xff0c;本地完成固件的升级下载。 2、自行完成系统BootLoader的编写…...

【漏洞复现】weblogic-SSRF漏洞

感谢互联网提供分享知识与智慧&#xff0c;在法治的社会里&#xff0c;请遵守有关法律法规 文章目录 漏洞测试注入HTTP头&#xff0c;利用Redis反弹shell 问题解决 Path : vulhub/weblogic/ssrf 编译及启动测试环境 docker compose up -dWeblogic中存在一个SSRF漏洞&#xff0…...

FreeSWTCH dialplan check nosdp

应朋友要求写一段dialplan&#xff0c;如果没有sdp&#xff08;sip_profile打开了3pcc&#xff09;&#xff0c;马上回486&#xff0c;当然如果有sdp&#xff0c;dialplan正常往下走 我试了试&#xff0c;貌似不太复杂&#xff0c;如下&#xff1a; <!-- check no sdp --&…...

微信小程序案例3-1 比较数字

文章目录 一、运行效果二、知识储备&#xff08;一&#xff09;Page()函数&#xff08;二&#xff09;数据绑定&#xff08;三&#xff09;事件绑定&#xff08;四&#xff09;事件对象&#xff08;五&#xff09;this关键字&#xff08;六&#xff09;setData()方法&#xff0…...

哈希表----数据结构

引入 如果你是一个队伍的队长&#xff0c;现在有 24 个队员&#xff0c;需要将他们分成 6 组&#xff0c;你会怎么分&#xff1f;其实有一种方法是让所有人排成一排&#xff0c;然后从队头开始报数&#xff0c;报的数字就是编号。当所有人都报完数后&#xff0c;这 24 人也被分…...

可达矩阵-邻接矩阵-以及有向图的python绘制

参考1 自定义输入矩阵来绘制 根据参考代码&#xff0c; 自定义 代码如下&#xff1a; # 编程实现有向图连通性的判断 from pylab import mplmpl.rcParams[font.sans-serif] [SimHei] mpl.rcParams[axes.unicode_minus] False import numpy as np import networkx as nx imp…...

react typescript @别名的使用

1、config/webpack.config.js中找到alias&#xff0c;添加: path.resolve(src) &#xff0c;如下&#xff1a; alias: {// Support React Native Web// https://www.smashingmagazine.com/2016/08/a-glimpse-into-the-future-with-react-native-for-web/"react-native&qu…...

C++性能优化笔记-6-C++元素的效率差异-7-类型转换

C元素的效率差异 类型转换signed与unsigned转换整数大小转换浮点精度转换整数到浮点转换浮点到整数转换指针类型转换重新解释对象的类型const_caststatic_castreinterpret_castdynamic_cast转换类对象 类型转换 在C语法中&#xff0c;有几种方式进行类型转换&#xff1a; // …...

c#中switch常用模式

声明模式 首先检查value的类型&#xff0c;然后根据类型输出相应的消息 public void ShowMessage(object value) {switch (value){case int i: Console.WriteLine($"value is int:{i}"); break;case long l: Console.WriteLine($"value is long:{l}"); b…...

Flink SQL 常用作业sql

目录 flink sql常用配置kafka source to mysql sink窗口函数 开窗datagen 自动生成数据表tumble 滚动窗口hop 滑动窗口cumulate 累积窗口 grouping sets 多维分析over 函数TopN flink sql常用配置 设置输出结果格式 SET sql-client.execution.result-modetableau;kafka source…...

nodejs国内镜像及切换版本工具nvm

淘宝 NPM 镜像站&#xff08;http://npm.taobao.org&#xff09;已更换域名&#xff0c;新域名&#xff1a; Web 站点&#xff1a;https://npmmirror.com Registry Endpoint&#xff1a;https://registry.npmmirror.com 详见&#xff1a; 【望周知】淘宝 NPM 镜像换域名了&…...

用Rust和Scraper库编写图像爬虫的建议

本文提供一些有关如何使用Rust和Scraper库编写图像爬虫的一般建议&#xff1a; 1、首先&#xff0c;你需要安装Rust和Scraper库。你可以通过Rustup或Cargo来安装Rust&#xff0c;然后使用Cargo来安装Scraper库。 2、然后&#xff0c;你可以使用Scraper库的Crawler类来创建一个…...

Java 语言环境搭建

JDK 是一种用于构建在 Java 平台上发布的应用程序、Applet 和组件的开发环境&#xff0c;即编写 Java 程序必须使用 JDK&#xff0c;它提供了编译和运行 Java 程序的环境。 在安装 JDK 之前&#xff0c;首先要到 Oracle 网站获取 JDK 安装包。JDK 安装包被集成在 Java SE 中&a…...

酷开科技 | 酷开系统里萌萌哒小维在等你!

在一片金黄淡绿的颜色中&#xff0c;深秋的脚步更近了&#xff0c;在这个气候微凉的季节里&#xff0c;你是不是更想拥有一种温暖的陪伴呢&#xff1f;酷开科技智慧AI语音功能更懂你&#xff0c;贴心的小维用心陪伴你的每一天。 01.全天候陪伴 在酷开系统中&#xff0c;只要你…...

Bash 4关联数组:错误“声明:-A:无效选项”

Bash 4 associative arrays: error “declare: -A: invalid option” 就是bash版本太低 1.先确定现在的版本 bash -version 我的就是版本太低 升级新版本bash4.2 即可 升级步骤 1.下载bash-4.2wget http://ftp.gnu.org/gnu/bash/bash-4.2.tar.gz 2. 下载完成解压 tar -zxvf…...

干货|AI辅助完成论文的正确打开方式!

论文写作中可能遇到问题 1. 选题问题&#xff1a;是否无法确定研究方向和选择合适的题目&#xff1f; 2. 文献综述问题&#xff1a;是否困惑如何进行文献调研和综述&#xff1f; 3. 方法论问题&#xff1a;是否不知道该选择何种研究方法&#xff1f; 4. 数据处理问题&#…...

SpringBoot--Web开发篇:含enjoy模板引擎整合,SpringBoot整合springMVC;及上传文件至七牛云;restFul

SpringBoot的Web开发 官网学习&#xff1a; 进入spring官网 --> projects --> SpringBoot --> LEARN --> Reference Doc. --> Web --> 就能看到上述页面 静态资源映射规则 官方文档 总结&#xff1a; 只要是静态资源&#xff0c;放在类路径下&#xff1…...

线上JAVA应用平稳运行一段时间后出现JVM崩溃问题 | 京东云技术团队

一、问题是怎么发现的 系统是一个定时任务系统&#xff0c;需要定时执行业务代码&#xff0c;业务代码主要是访问MYSQL数据库和缓存进行操作&#xff0c;该开始启动&#xff0c;系统日志一切正常&#xff0c;但是运行一段时间到凌晨后&#xff0c;系统就自动崩溃了&#xff0c…...