C#,数值计算——计算实对称矩阵所有特征值与特征向量的三角分解与QL迭代法源程序

news2024/11/24 5:29:22

1 文本格式

using System;

namespace Legalsoft.Truffer
{
    /// <summary>
    /// Computes all eigenvalues and eigenvectors of a real symmetric matrix by
    /// reduction to tridiagonal form followed by QL iteration.
    /// </summary>
    public class Symmeig
    {
        public int n { get; set; }
        public double[,] z;
        public double[] d;
        public double[] e;
        public bool yesvecs { get; set; }

        /// <summary>
        /// Computes all eigenvalues and eigenvectors of a real symmetric matrix
        /// a[0..n - 1][0..n - 1] by reduction to tridiagonal form followed by QL
        /// iteration.On output, d[0..n - 1] contains the eigenvalues of a sorted into
        /// descending order, while z[0..n - 1][0..n - 1] is a matrix whose columns contain
        /// the corresponding normalized eigenvectors.If yesvecs is input as true (the
        /// default), then the eigenvectors are computed.If yesvecs is input as false,
        /// only the eigenvalues are computed.
        /// </summary>
        /// <param name="a"></param>
        /// <param name="yesvec"></param>
        public Symmeig(double[,] a, bool yesvec = true)
        {
            this.n = a.GetLength(0);
            this.z = a;
            this.d = new double[n];
            this.e = new double[n];
            this.yesvecs = yesvec;

            tred2();
            tqli();
            sort();
        }

        /// <summary>
        /// Computes all eigenvalues and(optionally) eigenvectors of a real,
        /// symmetric, tridiagonal matrix by QL iteration.On input, dd[0..n - 1]
        /// contains the diagonal elements of the tridi- agonal matrix.The vector
        /// ee[0..n-1] inputs the subdiagonal elements of the tridiagonal matrix, with
        /// ee[0] arbitrary.Output is the same as the constructor above.
        /// </summary>
        /// <param name="dd"></param>
        /// <param name="ee"></param>
        /// <param name="yesvec"></param>
        public Symmeig(double[] dd, double[] ee, bool yesvec = true)
        {
            this.n = dd.Length;
            this.d = dd;
            this.e = ee;
            this.z = new double[n, n];
            this.yesvecs = yesvec;
            for (int i = 0; i < n; i++)
            {
                z[i, i] = 1.0;
            }

            tqli();
            sort();
        }

        public void sort()
        {
            if (yesvecs)
            {
                Jacobi.eigsrt( d,  z);
            }
            else
            {
                Jacobi.eigsrt( d,  z);
            }
        }

        /// <summary>
        /// Householder reduction of a real symmetric matrix z[0..n - 1][0..n-1]. (The
        /// input matrix A to Symmeig is stored in z.) On output, z is replaced by the
        /// orthogonal matrix Q effecting the transformation.d[0..n - 1] contains the
        /// diagonal elements of the tridiagonal matrix and e[0..n - 1] the off-diagonal
        /// elements, with e[0]=0. If yesvecs is false, so that only eigenvalues will
        /// subsequently be determined, several statements are omitted, in which case z
        /// contains no useful information on output.
        /// </summary>
        public void tred2()
        {
            for (int i = n - 1; i > 0; i--)
            {
                int l = i - 1;
                double h = 0.0;
                double scale = 0.0;
                if (l > 0)
                {
                    for (int k = 0; k < i; k++)
                    {
                        scale += Math.Abs(z[i, k]);
                    }
                    //if (scale == 0.0)
                    if (Math.Abs(scale) <= float.Epsilon)
                    {
                        e[i] = z[i, l];
                    }
                    else
                    {
                        for (int k = 0; k < i; k++)
                        {
                            z[i, k] /= scale;
                            h += z[i, k] * z[i, k];
                        }
                        double f = z[i, l];
                        double g = (f >= 0.0 ? -Math.Sqrt(h) : Math.Sqrt(h));
                        e[i] = scale * g;
                        h -= f * g;
                        z[i, l] = f - g;
                        f = 0.0;
                        for (int j = 0; j < i; j++)
                        {
                            if (yesvecs)
                            {
                                z[j, i] = z[i, j] / h;
                            }
                            g = 0.0;
                            for (int k = 0; k < j + 1; k++)
                            {
                                g += z[j, k] * z[i, k];
                            }
                            for (int k = j + 1; k < i; k++)
                            {
                                g += z[k, j] * z[i, k];
                            }
                            e[j] = g / h;
                            f += e[j] * z[i, j];
                        }
                        double hh = f / (h + h);
                        for (int j = 0; j < i; j++)
                        {
                            f = z[i, j];
                            e[j] = g = e[j] - hh * f;
                            for (int k = 0; k < j + 1; k++)
                            {
                                z[j, k] -= (f * e[k] + g * z[i, k]);
                            }
                        }
                    }
                }
                else
                {
                    e[i] = z[i, l];
                }
                d[i] = h;
            }
            if (yesvecs)
            {
                d[0] = 0.0;
            }
            e[0] = 0.0;
            for (int i = 0; i < n; i++)
            {
                if (yesvecs)
                {
                    if (d[i] != 0.0)
                    {
                        for (int j = 0; j < i; j++)
                        {
                            double g = 0.0;
                            for (int k = 0; k < i; k++)
                            {
                                g += z[i, k] * z[k, j];
                            }
                            for (int k = 0; k < i; k++)
                            {
                                z[k, j] -= g * z[k, i];
                            }
                        }
                    }
                    d[i] = z[i, i];
                    z[i, i] = 1.0;
                    for (int j = 0; j < i; j++)
                    {
                        z[j, i] = z[i, j] = 0.0;
                    }
                }
                else
                {
                    d[i] = z[i, i];
                }
            }
        }

        /// <summary>
        /// QL algorithm with implicit shifts to determine the eigenvalues and
        /// (optionally) the eigenvectors of a real, symmetric, tridiagonal matrix, or
        /// of a real symmetric matrix previously reduced by tred2. On input,
        /// d[0..n-1] contains the diagonal elements of the tridiagonal matrix. On
        /// output, it returns the eigenvalues. The vector e[0..n - 1] inputs the
        /// subdiagonal elements of the tridiagonal matrix, with e[0] arbitrary. On
        /// output e is destroyed.If the eigenvectors of a tridiagonal matrix are
        /// desired, the matrix z[0..n - 1][0..n - 1] is input as the identity matrix.If
        /// the eigenvectors of a matrix that has been reduced by tred2 are required,
        /// then z is input as the matrix output by tred2.In either case, column k of
        /// z returns the normalized eigenvector corresponding to d[k]
        /// </summary>
        /// <exception cref="Exception"></exception>
        public void tqli()
        {
            const double EPS = float.Epsilon;
            for (int i = 1; i < n; i++)
            {
                e[i - 1] = e[i];
            }
            e[n - 1] = 0.0;
            for (int l = 0; l < n; l++)
            {
                int iter = 0;
                int m;
                do
                {
                    for (m = l; m < n - 1; m++)
                    {
                        double dd = Math.Abs(d[m]) + Math.Abs(d[m + 1]);
                        if (Math.Abs(e[m]) <= EPS * dd)
                        {
                            break;
                        }
                    }
                    if (m != l)
                    {
                        if (iter++ == 30)
                        {
                            throw new Exception("Too many iterations in tqli");
                        }
                        double g = (d[l + 1] - d[l]) / (2.0 * e[l]);
                        double r = pythag(g, 1.0);
                        g = d[m] - d[l] + e[l] / (g + Globals.SIGN(r, g));
                        double s = 1.0;
                        double c = 1.0;
                        double p = 0.0;
                        int i = m - 1;
                        for (; i >= l; i--)
                        {
                            double f = s * e[i];
                            double b = c * e[i];
                            e[i + 1] = (r = pythag(f, g));
                            //if (r == 0.0)
                            if (Math.Abs(r) <= float.Epsilon)
                            {
                                d[i + 1] -= p;
                                e[m] = 0.0;
                                break;
                            }
                            s = f / r;
                            c = g / r;
                            g = d[i + 1] - p;
                            r = (d[i] - g) * s + 2.0 * c * b;
                            d[i + 1] = g + (p = s * r);
                            g = c * r - b;
                            if (yesvecs)
                            {
                                for (int k = 0; k < n; k++)
                                {
                                    f = z[k, i + 1];
                                    z[k, i + 1] = s * z[k, i] + c * f;
                                    z[k, i] = c * z[k, i] - s * f;
                                }
                            }
                        }
                        //if (r == 0.0 && i >= l)
                        if (Math.Abs(r) <= float.Epsilon && i >= l)
                        {
                            continue;
                        }
                        d[l] -= p;
                        e[l] = g;
                        e[m] = 0.0;
                    }
                } while (m != l);
            }
        }

        public double pythag(double a, double b)
        {
            double absa = Math.Abs(a);
            double absb = Math.Abs(b);
            //return (absa > absb ? absa * Math.Sqrt(1.0 + Globals.SQR(absb / absa)) : (absb == 0.0 ? 0.0 : absb * Math.Sqrt(1.0 + Globals.SQR(absa / absb))));
            return (absa > absb ? absa * Math.Sqrt(1.0 + Globals.SQR(absb / absa)) : ((absb <= float.Epsilon) ? 0.0 : absb * Math.Sqrt(1.0 + Globals.SQR(absa / absb))));
        }
    }
}
 

2 代码格式

using System;

namespace Legalsoft.Truffer
{
    /// <summary>
    /// Computes all eigenvalues and eigenvectors of a real symmetric matrix by
    /// reduction to tridiagonal form followed by QL iteration.
    /// </summary>
    public class Symmeig
    {
        public int n { get; set; }
        public double[,] z;
        public double[] d;
        public double[] e;
        public bool yesvecs { get; set; }

        /// <summary>
        /// Computes all eigenvalues and eigenvectors of a real symmetric matrix
        /// a[0..n - 1][0..n - 1] by reduction to tridiagonal form followed by QL
        /// iteration.On output, d[0..n - 1] contains the eigenvalues of a sorted into
        /// descending order, while z[0..n - 1][0..n - 1] is a matrix whose columns contain
        /// the corresponding normalized eigenvectors.If yesvecs is input as true (the
        /// default), then the eigenvectors are computed.If yesvecs is input as false,
        /// only the eigenvalues are computed.
        /// </summary>
        /// <param name="a"></param>
        /// <param name="yesvec"></param>
        public Symmeig(double[,] a, bool yesvec = true)
        {
            this.n = a.GetLength(0);
            this.z = a;
            this.d = new double[n];
            this.e = new double[n];
            this.yesvecs = yesvec;

            tred2();
            tqli();
            sort();
        }

        /// <summary>
        /// Computes all eigenvalues and(optionally) eigenvectors of a real,
        /// symmetric, tridiagonal matrix by QL iteration.On input, dd[0..n - 1]
        /// contains the diagonal elements of the tridi- agonal matrix.The vector
        /// ee[0..n-1] inputs the subdiagonal elements of the tridiagonal matrix, with
        /// ee[0] arbitrary.Output is the same as the constructor above.
        /// </summary>
        /// <param name="dd"></param>
        /// <param name="ee"></param>
        /// <param name="yesvec"></param>
        public Symmeig(double[] dd, double[] ee, bool yesvec = true)
        {
            this.n = dd.Length;
            this.d = dd;
            this.e = ee;
            this.z = new double[n, n];
            this.yesvecs = yesvec;
            for (int i = 0; i < n; i++)
            {
                z[i, i] = 1.0;
            }

            tqli();
            sort();
        }

        public void sort()
        {
            if (yesvecs)
            {
                Jacobi.eigsrt( d,  z);
            }
            else
            {
                Jacobi.eigsrt( d,  z);
            }
        }

        /// <summary>
        /// Householder reduction of a real symmetric matrix z[0..n - 1][0..n-1]. (The
        /// input matrix A to Symmeig is stored in z.) On output, z is replaced by the
        /// orthogonal matrix Q effecting the transformation.d[0..n - 1] contains the
        /// diagonal elements of the tridiagonal matrix and e[0..n - 1] the off-diagonal
        /// elements, with e[0]=0. If yesvecs is false, so that only eigenvalues will
        /// subsequently be determined, several statements are omitted, in which case z
        /// contains no useful information on output.
        /// </summary>
        public void tred2()
        {
            for (int i = n - 1; i > 0; i--)
            {
                int l = i - 1;
                double h = 0.0;
                double scale = 0.0;
                if (l > 0)
                {
                    for (int k = 0; k < i; k++)
                    {
                        scale += Math.Abs(z[i, k]);
                    }
                    //if (scale == 0.0)
                    if (Math.Abs(scale) <= float.Epsilon)
                    {
                        e[i] = z[i, l];
                    }
                    else
                    {
                        for (int k = 0; k < i; k++)
                        {
                            z[i, k] /= scale;
                            h += z[i, k] * z[i, k];
                        }
                        double f = z[i, l];
                        double g = (f >= 0.0 ? -Math.Sqrt(h) : Math.Sqrt(h));
                        e[i] = scale * g;
                        h -= f * g;
                        z[i, l] = f - g;
                        f = 0.0;
                        for (int j = 0; j < i; j++)
                        {
                            if (yesvecs)
                            {
                                z[j, i] = z[i, j] / h;
                            }
                            g = 0.0;
                            for (int k = 0; k < j + 1; k++)
                            {
                                g += z[j, k] * z[i, k];
                            }
                            for (int k = j + 1; k < i; k++)
                            {
                                g += z[k, j] * z[i, k];
                            }
                            e[j] = g / h;
                            f += e[j] * z[i, j];
                        }
                        double hh = f / (h + h);
                        for (int j = 0; j < i; j++)
                        {
                            f = z[i, j];
                            e[j] = g = e[j] - hh * f;
                            for (int k = 0; k < j + 1; k++)
                            {
                                z[j, k] -= (f * e[k] + g * z[i, k]);
                            }
                        }
                    }
                }
                else
                {
                    e[i] = z[i, l];
                }
                d[i] = h;
            }
            if (yesvecs)
            {
                d[0] = 0.0;
            }
            e[0] = 0.0;
            for (int i = 0; i < n; i++)
            {
                if (yesvecs)
                {
                    if (d[i] != 0.0)
                    {
                        for (int j = 0; j < i; j++)
                        {
                            double g = 0.0;
                            for (int k = 0; k < i; k++)
                            {
                                g += z[i, k] * z[k, j];
                            }
                            for (int k = 0; k < i; k++)
                            {
                                z[k, j] -= g * z[k, i];
                            }
                        }
                    }
                    d[i] = z[i, i];
                    z[i, i] = 1.0;
                    for (int j = 0; j < i; j++)
                    {
                        z[j, i] = z[i, j] = 0.0;
                    }
                }
                else
                {
                    d[i] = z[i, i];
                }
            }
        }

        /// <summary>
        /// QL algorithm with implicit shifts to determine the eigenvalues and
        /// (optionally) the eigenvectors of a real, symmetric, tridiagonal matrix, or
        /// of a real symmetric matrix previously reduced by tred2. On input,
        /// d[0..n-1] contains the diagonal elements of the tridiagonal matrix. On
        /// output, it returns the eigenvalues. The vector e[0..n - 1] inputs the
        /// subdiagonal elements of the tridiagonal matrix, with e[0] arbitrary. On
        /// output e is destroyed.If the eigenvectors of a tridiagonal matrix are
        /// desired, the matrix z[0..n - 1][0..n - 1] is input as the identity matrix.If
        /// the eigenvectors of a matrix that has been reduced by tred2 are required,
        /// then z is input as the matrix output by tred2.In either case, column k of
        /// z returns the normalized eigenvector corresponding to d[k]
        /// </summary>
        /// <exception cref="Exception"></exception>
        public void tqli()
        {
            const double EPS = float.Epsilon;
            for (int i = 1; i < n; i++)
            {
                e[i - 1] = e[i];
            }
            e[n - 1] = 0.0;
            for (int l = 0; l < n; l++)
            {
                int iter = 0;
                int m;
                do
                {
                    for (m = l; m < n - 1; m++)
                    {
                        double dd = Math.Abs(d[m]) + Math.Abs(d[m + 1]);
                        if (Math.Abs(e[m]) <= EPS * dd)
                        {
                            break;
                        }
                    }
                    if (m != l)
                    {
                        if (iter++ == 30)
                        {
                            throw new Exception("Too many iterations in tqli");
                        }
                        double g = (d[l + 1] - d[l]) / (2.0 * e[l]);
                        double r = pythag(g, 1.0);
                        g = d[m] - d[l] + e[l] / (g + Globals.SIGN(r, g));
                        double s = 1.0;
                        double c = 1.0;
                        double p = 0.0;
                        int i = m - 1;
                        for (; i >= l; i--)
                        {
                            double f = s * e[i];
                            double b = c * e[i];
                            e[i + 1] = (r = pythag(f, g));
                            //if (r == 0.0)
                            if (Math.Abs(r) <= float.Epsilon)
                            {
                                d[i + 1] -= p;
                                e[m] = 0.0;
                                break;
                            }
                            s = f / r;
                            c = g / r;
                            g = d[i + 1] - p;
                            r = (d[i] - g) * s + 2.0 * c * b;
                            d[i + 1] = g + (p = s * r);
                            g = c * r - b;
                            if (yesvecs)
                            {
                                for (int k = 0; k < n; k++)
                                {
                                    f = z[k, i + 1];
                                    z[k, i + 1] = s * z[k, i] + c * f;
                                    z[k, i] = c * z[k, i] - s * f;
                                }
                            }
                        }
                        //if (r == 0.0 && i >= l)
                        if (Math.Abs(r) <= float.Epsilon && i >= l)
                        {
                            continue;
                        }
                        d[l] -= p;
                        e[l] = g;
                        e[m] = 0.0;
                    }
                } while (m != l);
            }
        }

        public double pythag(double a, double b)
        {
            double absa = Math.Abs(a);
            double absb = Math.Abs(b);
            //return (absa > absb ? absa * Math.Sqrt(1.0 + Globals.SQR(absb / absa)) : (absb == 0.0 ? 0.0 : absb * Math.Sqrt(1.0 + Globals.SQR(absa / absb))));
            return (absa > absb ? absa * Math.Sqrt(1.0 + Globals.SQR(absb / absa)) : ((absb <= float.Epsilon) ? 0.0 : absb * Math.Sqrt(1.0 + Globals.SQR(absa / absb))));
        }
    }
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1288167.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Linux磁盘阵列raid

RAID介绍 RAID &#xff08; Redundant Array of Independent Disks &#xff09;即独立磁盘冗余阵列&#xff0c;通常简称为磁盘阵列。简单地说&#xff0c; RAID 是由多个独立的高性能磁盘驱动器组成的磁盘子系统&#xff0c;从而提供比单个磁盘更高的存储性能和数据冗余的技…

使用 javascript 模拟 git diff 命令实现文本文件差异比较

diff.html&#xff1a; <!DOCTYPE html> <html> <head><title>文件比较</title><meta charset"UTF-8"> </head> <body> <h1>文件比较</h1> <form><label for"file1">版本1&…

微服务1 springcloud学习笔记P1-P40

b微服务技术栈_哔哩哔哩_bilibili 文档资料: 链接&#xff1a;https://pan.baidu.com/s/1P_Ag1BYiPaF52EI19A0YRw?pwdd03r 提取码&#xff1a;d03r 一 了解微服务技术 二 Eureka (1) Eureka配置 (2) 注册user-service (3) 总结 Ribbon 负载均衡 (1) 流程 三 nacos配置管理…

CFS三层靶机内网渗透

CFS三层靶机内网渗透 一、靶场搭建1.基础参数信息2.靶场搭建2.1网卡配置2.2Target1配置2.2.1 网卡配置2.2.2 Target1 BT配置 2.3Target2配置2.3.1 网卡配置2.3.2 Target2 BT配置 2.4Target3配置 二、内网渗透Target11.1信息收集1.1.1IP收集1.1.2端口收集1.1.3目录收集 1.2 webs…

思维模型 移情效应

本系列文章 主要是 分享 思维模型&#xff0c;涉及各个领域&#xff0c;重在提升认知。情感迁移&#xff0c;爱屋及乌。 1 移情效应的应用 1.1 移情效应在市场营销中应用-多芬&#xff08;Dove&#xff09;“真美运动” 多芬&#xff08;Dove&#xff09;是一家知名的个人护理…

园区规划技术要点

&#xff08;一&#xff09;技术点介绍 1.WLAN&#xff1a;无线局域网WLAN&#xff08;Wireless Local Area Network&#xff09;是一种无线计算机网络&#xff0c;使用无线信道代替有线传输介质连接两个或多个设备形成一个局域网LAN&#xff08;Local Area Network&#xff09…

BUU UPLOAD COURSE 1

传一个cmd.php木马文件 访问一下这个图片地址 发现什么都没有&#xff0c;在hackbar里面连接一下我们的木马 然后看到了一些目录 然后直接查看flag就出来了 这里也可以用蚁剑去连接 直接访问地址&#xff0c;拿着地址去连接就行了。

从零开始,轻松实现Python接口自动化测试(基于PyCharm)

1.接口清单整理 &#xff08;1&#xff09;请求&#xff1a; 请求URL请求方法请求参数请求报文 &#xff08;2&#xff09;响应 状态码响应数据 2.用例设计 &#xff08;1&#xff09;单接口测试用例 模板&#xff1a;id、模块、接口名称、请求URL、用例名称、请求方法、…

用Python手把手教你WordCloud可视化

目录 WordCloud是什么&#xff1f; 具体使用 总结 WordCloud是什么&#xff1f; WordCloud是一种数据可视化技术&#xff0c;通过根据文本中单词的频率或权重来生成一个视觉上吸引人的词云图。在词云图中&#xff0c;单词的大小和颜色通常与其在文本中的出现频率相关&#…

【Java Web学习笔记】5 - XML

项目代码 https://github.com/yinhai1114/JavaWeb_LearningCode/tree/main/xml 零、在线文档 XML系列教程 一、XML引出 1.为什么需要XML 1.需求1 :两个程序间进行数据通信? 2.需求2:给一台服务器&#xff0c;做-一个配置文件&#xff0c;当服务器程序启动时&#xff0c;去…

synxflow 安装环境

介绍&#xff1a; 该软件可以动态模拟洪水淹没&#xff0c;滑坡跳动和泥石流使用多个cuda支持的gpu。它还提供了一个用户友好但多功能的Python界面&#xff0c;可以完全集成到数据科学工作流程中&#xff0c;旨在简化和加速危害风险评估任务。 这个包我从网上找到的资源特别特…

【WPF.NET开发】构造动态布局

本文内容 系统必备创建项目配置默认的 Grid Panel 控件向面板中添加控件测试布局汇总所有内容后续步骤 在动态定位中&#xff0c;您通过指定子元素相对于父元素应该如何排列以及应该如何包装来排列子元素。 您还可以将窗口和控件设置为在其内容扩展时自动扩展。 适用于 Vis…

Avalonia中使用Prism实现区域导航功能

前言 上一篇文章我们讲了在Avalonia开发中&#xff0c;引入Prism框架来完成项目的MVVM迁移。本章内容将带领大家学习如何在Avalonia中使用Prism框架实现区域导航功能。如果你还不知道Avalonia中如何引入Prism框架&#xff0c;请看我上一篇文章&#xff1a;Avalonia框架下面使用…

公有云迁移研究——AWS DMS

大纲 1 什么是DMS2 DMS的作用3 DMS在迁移的时候都做些什么4 在使用DMS的时候我们需要做些什么5 操作5.1 创建两个数据库终端节点5.2 创建迁移任务 6 可能遇到的问题7 总结 在本地机房或其他云往AWS上做迁移时&#xff0c;往往会遇到数据库迁移的任务。如果数据量不是特别大&…

【unity3D】Transform组件(如何访问和获取Transform组件)

&#x1f497; 未来的游戏开发程序媛&#xff0c;现在的努力学习菜鸡 &#x1f4a6;本专栏是我关于游戏开发的学习笔记 &#x1f236;本篇是unity的Transform组件 Transform组件 基础知识介绍三个成员变量常用属性扩展 Transform的相关查找方法静态方法 基础知识 介绍 在Unit…

ELK(一)—介绍

一、ELK介绍 ELK是指Elasticsearch、Logstash和Kibana&#xff0c;这三个开源软件构成了一个功能强大的日志管理和分析平台。Elasticsearch作为分布式搜索引擎&#xff0c;负责实时存储和检索大规模数据&#xff1b;Logstash用于从多个数据源采集、处理和传输日志数据&#xff…

分包(微信小程序)

首先&#xff0c;微信小程序中使用分包是为了减少首屏的请求&#xff0c;因为微信小程序会默认下载主包内的内容并展示到页面上&#xff0c;但是随着业务量的增加&#xff0c;代码量也会越来越大。会导致我们启动小程序的时候首页加载速度过慢的这个问题。这时我们就可以采用分…

dockerdesktop推送镜像到dockerhub

1.查看镜像(打开powershell) docker ps2.打tag docker tag pengzx/aspnetcoredocker:v1 pengzx/aspnetcoredocker:v2pengzx/aspnetcoredocker:v1:本地的镜像名加版本号 pengzx/aspnetcoredocker:v2&#xff1a;需要上传的镜像名&#xff08;要以dockerhub的用户名开头/本地镜像…

Data Linked UI

DataLinkedUl是一个Unity框架,它允许您在为您的应用程序创建用户界面时实现专业的数据驱动方法。使用此资产,您可以创建灵活的基于瓦片的任意大小的复杂接口系统。 核心功能: 灵活性-允许适应和调整数据变化,允许各种结构和功能配置,而不需要对现有系统进行重大破坏。 可伸…

HTTP之跨域

HTTP之跨域 跨域&#xff08;Cors&#xff09;两种请求简单请求浏览器不同的处理方式Access-Control-Allow-OriginAccess-Control-Allow-CredentialswithCredentials属性 非简单请求服务器回应&#xff1a;什么时候会触发OPTIONS&#xff08;预检请求&#xff09;呢&#xff1f…