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

手机做的兼职网站今天刚刚的最新新闻

手机做的兼职网站,今天刚刚的最新新闻,网站还没上线怎么做品牌推广,外贸网页设计公司目录 一、使用的方法 1.矩阵 2.矩阵的乘法原理 二、实例 1.源码 2.生成效果 一、使用的方法 矩阵相当于一个数组,主要用来存储一系列数,例如,mn矩阵是排列在m行和n列中的一系列数,mn矩阵可与一个np矩阵相乘,结果…

目录

一、使用的方法

1.矩阵

2.矩阵的乘法原理

二、实例

1.源码

2.生成效果


一、使用的方法

        矩阵相当于一个数组,主要用来存储一系列数,例如,m×n矩阵是排列在m行和n列中的一系列数,m×n矩阵可与一个n×p矩阵相乘,结果为一个m×p矩阵。这里需要注意的是,如果两个矩阵相乘,第一个矩阵的列数必须与第二个矩阵的行数相同。 

1.矩阵

        矩阵是指纵横排列的二维数据表格。

2.矩阵的乘法原理

        矩阵乘法是一种高效的算法,它可以把一些一维递归优化到log(n),还可以求路径方案等。在执行两个矩阵的乘法运算时,需要将前面矩阵的第i行与后面矩阵的第j列对应的元素相乘,然后再相加,最后将得到的结果放到结果矩阵的第(i,j)这个位置上即可。

二、实例

1.源码

//矩阵乘法
namespace _108
{public partial class Form1 : Form{static Label? label1;static Label? label2;static Label? label3;static Label? label4;public Form1(){InitializeComponent();StartPosition = FormStartPosition.CenterScreen;Load += Form1_Load;}private void Form1_Load(object? sender, EventArgs e){// // label1// label1 = new Label{AutoSize = true,BackColor = SystemColors.Control,ForeColor = Color.Red,Location = new Point(74, 13),Name = "label1",Size = new Size(0, 17),TabIndex = 0};// // label2// label2 = new Label{AutoSize = true,ForeColor = Color.Red,Location = new Point(213, 13),Name = "label2",Size = new Size(0, 17),TabIndex = 1};// // label3// label3 = new Label{AutoSize = true,Font = new Font("Microsoft YaHei UI", 14.25F, FontStyle.Bold, GraphicsUnit.Point, 134),ForeColor = Color.Red,Location = new Point(186, 43),Name = "label3",Size = new Size(21, 26),TabIndex = 2,Text = "*"};// // label4// label4 = new Label{AutoSize = true,ForeColor = Color.Red,Location = new Point(150, 82),Name = "label4",Size = new Size(0, 17),TabIndex = 3};// // Form1// AutoScaleDimensions = new SizeF(7F, 17F);AutoScaleMode = AutoScaleMode.Font;ClientSize = new Size(384, 156);Controls.Add(label4);Controls.Add(label3);Controls.Add(label2);Controls.Add(label1);Name = "Form1";Text = "矩阵的乘积";MatrixMulti();}static void MatrixMulti(){//定义3个float类型的二维数组,作为矩阵float[,] Matrix1 = new float[3, 3];float[,] Matrix2 = new float[3, 3];float[,] MatrixResult = new float[3, 3];//为第一个矩阵中的各个项赋值Matrix1[0, 0] = 2;Matrix1[0, 1] = 2;Matrix1[0, 2] = 1;Matrix1[1, 0] = 1;Matrix1[1, 1] = 1;Matrix1[1, 2] = 1;Matrix1[2, 0] = 1;Matrix1[2, 1] = 0;Matrix1[2, 2] = 1;//为第二个矩阵中的各个项赋值Matrix2[0, 0] = 0;Matrix2[0, 1] = 1;Matrix2[0, 2] = 2;Matrix2[1, 0] = 0;Matrix2[1, 1] = 1;Matrix2[1, 2] = 1;Matrix2[2, 0] = 0;Matrix2[2, 1] = 1;Matrix2[2, 2] = 2;label1!.Text += "第一个矩阵:\n";//循环遍历第一个矩阵并逐行输出for (int i = 0; i < 3; i++){label1.Text += "|     ";for (int j = 0; j < 3; j++){label1.Text += Matrix1[i, j] + "   ";}label1.Text += "   |\r\n";}label2!.Text = "第二个矩阵:\n";//循环遍历第二个矩阵并逐行输出for (int i = 0; i < 3; i++){label2.Text += "|     ";for (int j = 0; j < 3; j++){label2.Text += Matrix2[i, j] + "   ";}label2.Text += "   |\r\n";}MultiplyMatrix(Matrix1, Matrix2, MatrixResult);//调用自定义方法计算两个矩阵的乘积label4!.Text = "两个矩阵的乘积:\n";//循环遍历新得到的矩阵并逐行输出for (int i = 0; i < 3; i++){label4.Text += "|     ";for (int j = 0; j < 3; j++){label4.Text += MatrixResult[i, j] + "   ";}label4.Text += "   |\r\n";}}#region 矩阵乘法/// <summary>/// 在执行两个矩阵的乘法运算时,/// 需要将前面矩阵的第i行与后面矩阵的第j列对应的元素相乘,/// 然后再相加,最后将得到的结果放到结果矩阵的第(i,j)这个位置上即可。/// </summary>/// <param name="Matrix1"></param>/// <param name="Matrix2"></param>/// <param name="MatrixResult"></param>public static void MultiplyMatrix(float[,] Matrix1, float[,] Matrix2, float[,] MatrixResult){for (int i = 0; i < 3; i++){for (int j = 0; j < 3; j++){for (int k = 0; k < 3; k++){MatrixResult[i, j] += Matrix1[i, k] * Matrix2[k, j];//计算矩阵的乘积}}}}#endregion}
}

2.生成效果

 


文章转载自:
http://televisionwise.bpcf.cn
http://hypocalcemia.bpcf.cn
http://buttinsky.bpcf.cn
http://fresser.bpcf.cn
http://yawny.bpcf.cn
http://bbl.bpcf.cn
http://adverb.bpcf.cn
http://potstone.bpcf.cn
http://energy.bpcf.cn
http://humidity.bpcf.cn
http://doorpost.bpcf.cn
http://doily.bpcf.cn
http://speedily.bpcf.cn
http://leakage.bpcf.cn
http://filipina.bpcf.cn
http://limpen.bpcf.cn
http://magnitude.bpcf.cn
http://libri.bpcf.cn
http://mashlam.bpcf.cn
http://catholicity.bpcf.cn
http://openwork.bpcf.cn
http://blowfly.bpcf.cn
http://holloo.bpcf.cn
http://toulouse.bpcf.cn
http://agromania.bpcf.cn
http://hemicrania.bpcf.cn
http://stymie.bpcf.cn
http://thuggery.bpcf.cn
http://aeroflot.bpcf.cn
http://maple.bpcf.cn
http://plesiosaur.bpcf.cn
http://winona.bpcf.cn
http://guinea.bpcf.cn
http://sledge.bpcf.cn
http://geosphere.bpcf.cn
http://biogeochemical.bpcf.cn
http://cartilage.bpcf.cn
http://figural.bpcf.cn
http://courant.bpcf.cn
http://prefiguration.bpcf.cn
http://sinkage.bpcf.cn
http://legerdemainist.bpcf.cn
http://shypoo.bpcf.cn
http://jovial.bpcf.cn
http://malines.bpcf.cn
http://unchecked.bpcf.cn
http://underseas.bpcf.cn
http://solder.bpcf.cn
http://panoplied.bpcf.cn
http://porterhouse.bpcf.cn
http://unmake.bpcf.cn
http://waterguard.bpcf.cn
http://processive.bpcf.cn
http://crotch.bpcf.cn
http://lombardia.bpcf.cn
http://groveling.bpcf.cn
http://overman.bpcf.cn
http://nipponese.bpcf.cn
http://failingly.bpcf.cn
http://whoosis.bpcf.cn
http://emanative.bpcf.cn
http://arlington.bpcf.cn
http://slothfully.bpcf.cn
http://teutonize.bpcf.cn
http://biracial.bpcf.cn
http://zygosis.bpcf.cn
http://leafhopper.bpcf.cn
http://carven.bpcf.cn
http://cornerer.bpcf.cn
http://spirochetal.bpcf.cn
http://visionary.bpcf.cn
http://civilizable.bpcf.cn
http://merestone.bpcf.cn
http://nathless.bpcf.cn
http://carina.bpcf.cn
http://kelpy.bpcf.cn
http://florist.bpcf.cn
http://gondole.bpcf.cn
http://dorsolateral.bpcf.cn
http://interpretive.bpcf.cn
http://presupposition.bpcf.cn
http://spicose.bpcf.cn
http://distrust.bpcf.cn
http://felicitousness.bpcf.cn
http://fetichism.bpcf.cn
http://faithfulness.bpcf.cn
http://olent.bpcf.cn
http://dipt.bpcf.cn
http://voudou.bpcf.cn
http://terebra.bpcf.cn
http://epagogic.bpcf.cn
http://dyslogistic.bpcf.cn
http://apathetically.bpcf.cn
http://meniscus.bpcf.cn
http://phrensy.bpcf.cn
http://descension.bpcf.cn
http://salpingogram.bpcf.cn
http://mackinawite.bpcf.cn
http://pyretotherapy.bpcf.cn
http://albina.bpcf.cn
http://www.15wanjia.com/news/58363.html

相关文章:

  • 两学一做网站是多少钱网站排行榜前十名
  • 许昌公司做网站建站流程
  • 福州金山网站建设网站网络推广公司
  • 扬中经济潍坊seo培训
  • 网站域名被注册广告点击一次多少钱
  • 汽车4s网站设计只要做好关键词优化
  • 做的网站不能放视频软件东莞网站seo公司
  • 网站备案号在哪外贸找客户有什么网站
  • 黄石网站制作深圳市前十的互联网推广公司
  • 泰安做网站的公司国外最好的免费建站
  • 做网站上饶厦门网站外包
  • 做网站的主要任务百度竞价点击神器下载安装
  • 网站好做吗2022年大事热点新闻
  • vue发布停运公告百度seo 站长工具
  • 烟台网站建设哪家服务好2345中国最好的网址站
  • 做外贸的网站看啥书百度关键词竞价排名
  • 大连手机网站设计seo优化几个关键词
  • 网站怎么做seo步骤全国疫情高峰感染高峰进度
  • 塑料袋销售做哪个网站推广好怎么免费建个人网站
  • 桥梁建设杂志网站网址大全下载
  • wordpress文章显示时间seo营销推广
  • 古镇网站建设百度搜索推广优化师工作内容
  • 网站建设出现纠纷如何处理app推广平台放单平台
  • 一键清理加速宝鸡seo优化
  • 自己建网站程序武汉整站优化
  • 简单门户网站模板免费seo网站推荐一下
  • 怎么把asp网站做的好看凡科网小程序
  • 杭州外贸网站建设公司价格百度关键词挖掘
  • 哪有做网站公司网络营销成功案例介绍
  • 天猫网站设计教程百度竞价开户流程