线性代数:Matrix2x2和Matrix3x3

news2024/11/13 21:22:25

      今天整理自己的框架代码,将Matrix2x2和Matrix3x3给扩展了一下,发现网上unity数学计算相关挺少的,所以记录一下。
      首先扩展Matrix2x2:

using System.Collections;
using System.Collections.Generic;
using Unity.Mathematics;
using UnityEngine;

public class Matrix2x2
{
    #region ///properties

    public const int ROW = 2;
    public const int COLUMN = 2;

    public float M00
    {
        get { return dataArr[0, 0]; }
        set { dataArr[0, 0] = value; }
    }

    public float M01
    {
        get { return dataArr[0, 1]; }
        set { dataArr[0, 1] = value; }
    }

    public float M10
    {
        get { return dataArr[1, 0]; }
        set { dataArr[1, 0] = value; }
    }

    public float M11
    {
        get { return dataArr[1, 1]; }
        set { dataArr[1, 1] = value; }
    }

    private float[,] dataArr = new float[ROW, COLUMN];

    public Vector2 Row0 { get { return new Vector2(M00, M01); } }
    public Vector2 Row1 { get { return new Vector2(M10, M11); } }
    public Vector2 Column0 { get { return new Vector2(M00, M10); } }
    public Vector2 Column1 { get { return new Vector2(M01, M11); } }
    #endregion

    public float this[int row, int col]
    {
        get { return dataArr[row, col]; }
        set { dataArr[row, col] = value; }
    }

    public Matrix2x2() { }

    public Matrix2x2(float m00, float m01, float m10, float m11)
    {
        M00 = m00;
        M01 = m01;

        M10 = m10;
        M11 = m11;
    }
    /// <summary>
    /// xy基向量
    /// 竖向排列
    /// </summary>
    /// <param name="ax"></param>
    /// <param name="ay"></param>
    public Matrix2x2(Vector2 ax, Vector2 ay)
    {
        M00 = ax.x;
        M10 = ax.y;

        M10 = ay.x;
        M11 = ay.y;
    }
    /// <summary>
    /// 2*2数组
    /// </summary>
    /// <param name="arr"></param>
    public Matrix2x2(float[,] arr)
    {
        M00 = arr[0, 0];
        M01 = arr[0, 1];

        M10 = arr[1, 0];
        M11 = arr[1, 1];
    }
    /// <summary>
    /// 矩阵*vector2
    /// </summary>
    /// <param name="m2x2"></param>
    /// <param name="v2"></param>
    /// <returns></returns>
    public static Vector2 operator *(Matrix2x2 m2x2, Vector2 v2)
    {
        float x = Vector2.Dot(m2x2.Row0, v2);
        float y = Vector2.Dot(m2x2.Row1, v2);
        return new Vector2(x, y);
    }
    /// <summary>
    /// 矩阵*矩阵
    /// </summary>
    /// <param name="m2x2a"></param>
    /// <param name="m2x2b"></param>
    /// <returns></returns>
    public static Matrix2x2 operator *(Matrix2x2 m2x2a, Matrix2x2 m2x2b)
    {
        float c00 = Vector2.Dot(m2x2a.Row0, m2x2b.Column0);
        float c01 = Vector2.Dot(m2x2a.Row0, m2x2b.Column1);

        float c10 = Vector2.Dot(m2x2a.Row1, m2x2b.Column0);
        float c11 = Vector2.Dot(m2x2a.Row1, m2x2b.Column1);

        Matrix2x2 ret = new Matrix2x2(c00, c01, c10, c11);
        return ret;
    }
    /// <summary>
    /// 矩阵/标量
    /// </summary>
    /// <param name="m2x2"></param>
    /// <param name="f"></param>
    /// <returns></returns>
    public static Matrix2x2 operator /(Matrix2x2 m2x2, float f)
    {
        for (int x = 0; x < ROW; x++)
        {
            for (int y = 0; y < COLUMN; y++)
            {
                m2x2[x, y] /= f;
            }
        }
        return m2x2;
    }
    /// <summary>
    /// 行列式
    /// </summary>
    /// <returns></returns>
    public float GetDeterminant()
    {
        float det = M00 * M11 - M01 * M10;
        return det;
    }
    /// <summary>
    /// 求转置矩阵
    /// </summary>
    /// <returns></returns>
    public Matrix2x2 GetTransposeMatrix()
    {
        Matrix2x2 m2x2T = new Matrix2x2();
        for (int x = 0; x < ROW; x++)
        {
            for (int y = 0; y < COLUMN; y++)
            {
                m2x2T[x, y] = this[y, x];
            }
        }
        return m2x2T;
    }
    /// <summary>
    /// 求余子式标量
    /// </summary>
    /// <param name="r"></param>
    /// <param name="c"></param>
    /// <returns></returns>
    public float GetCofactorScalar(int r, int c)
    {
        float cof = 0f;
        for (int x = 0; x < ROW; x++)
        {
            for (int y = 0; y < COLUMN; y++)
            {
                if (x != r && y != c)
                {
                    cof = dataArr[x, y];
                    break;
                }
            }
        }
        return cof;
    }
    /// <summary>
    /// 求余子式标量矩阵
    /// + -
    /// - +
    /// </summary>
    /// <returns></returns>
    public Matrix2x2 GetCofactorScalarMatrix()
    {
        Matrix2x2 m2x2 = new Matrix2x2();
        for (int x = 0; x < ROW; x++)
        {
            for (int y = 0; y < COLUMN; y++)
            {
                float cof = GetCofactorScalar(x, y);
                bool ispostive = (x + y) % 2 == 0;
                m2x2[x, y] = ispostive ? cof : -cof;
            }
        }
        return m2x2;
    }
    /// <summary>
    /// 求伴随矩阵
    /// 算法:余子式标量矩阵的转置
    /// </summary>
    /// <returns></returns>
    public Matrix2x2 GetAdjointMatrix()
    {
        Matrix2x2 m2x2 = GetCofactorScalarMatrix();
        Matrix2x2 m2x2T = m2x2.GetTransposeMatrix();
        return m2x2T;
    }
    /// <summary>
    /// 求逆矩阵
    /// 算法:伴随矩阵/行列式值
    /// </summary>
    /// <returns></returns>
    public Matrix2x2 GetInverseMatrix()
    {
        Matrix2x2 m2x2 = GetAdjointMatrix();
        float det = GetDeterminant();
        Matrix2x2 m2x2I = m2x2 / det;
        return m2x2I;
    }

    public override string ToString()
    {
        string ret = $"换行\nM00:{M00} M01:{M01} \nM10:{M10} M11:{M11}";
        return ret;
    }
}

      关于Matrix2x2,我设计了构造、转置、余子式(2x2矩阵的余子式为标量,或称1x1矩阵)、余子式标量矩阵、伴随矩阵和逆矩阵。
      基本上数学运算开发够用了,每个函数的意义只在代码注释上简单说明。
      这里只举一个例子:逆矩阵可以将矩阵变换后向量再变换回来,比如:

Matrix2x2 m2x2 = new Matrix2x2();
m2x2.M00 = 0.3f;
m2x2.M01 = 1.2f;
m2x2.M10 = 5.2f;
m2x2.M11 = -1f;

Debug.LogErrorFormat($"m2x2 = {m2x2}");

Vector2 vec0 = new Vector2(5.8f, 56.1f);

Vector2 vec1 = m2x2 * vec0;

Matrix2x2 m2x2I = m2x2.GetInverseMatrix();

Debug.LogErrorFormat($"m2x2I = {m2x2I}");

Vector2 vec2 = m2x2I * vec1;

Debug.LogErrorFormat($"vec0 = {vec0} vec1 = {vec1} vec2 = {vec2}");

      结果:
在这里插入图片描述
      接下来扩展Matrix3x3:

using NPOI.SS.Formula.Functions;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[System.Serializable]
public class Matrix3x3
{
    #region ///properties

    public const int ROW = 3;
    public const int COLUMN = 3;

    public float M00
    {
        get { return dataArr[0, 0]; }
        set { dataArr[0, 0] = value; }
    }

    public float M01
    {
        get { return dataArr[0, 1]; }
        set { dataArr[0, 1] = value; }
    }

    public float M02
    {
        get { return dataArr[0, 2]; }
        set { dataArr[0, 2] = value; }
    }

    public float M10
    {
        get { return dataArr[1, 0]; }
        set { dataArr[1, 0] = value; }
    }

    public float M11
    {
        get { return dataArr[1, 1]; }
        set { dataArr[1, 1] = value; }
    }

    public float M12
    {
        get { return dataArr[1, 2]; }
        set { dataArr[1, 2] = value; }
    }

    public float M20
    {
        get { return dataArr[2, 0]; }
        set { dataArr[2, 0] = value; }
    }

    public float M21
    {
        get { return dataArr[2, 1]; }
        set { dataArr[2, 1] = value; }
    }

    public float M22
    {
        get { return dataArr[2, 2]; }
        set { dataArr[2, 2] = value; }
    }

    public float[,] dataArr = new float[ROW, COLUMN];

    public Vector3 Row0 { get { return new Vector3(M00, M01, M02); } }
    public Vector3 Row1 { get { return new Vector3(M10, M11, M12); } }
    public Vector3 Row2 { get { return new Vector3(M20, M21, M22); } }
    public Vector3 Column0 { get { return new Vector3(M00, M10, M20); } }
    public Vector3 Column1 { get { return new Vector3(M01, M11, M21); } }
    public Vector3 Column2 { get { return new Vector3(M02, M12, M22); } }
    #endregion

    public float this[int row, int col]
    {
        get { return dataArr[row, col]; }
        set { dataArr[row, col] = value; }
    }

    public Matrix3x3() { }

    public Matrix3x3(float m00, float m01, float m02, float m10, float m11, float m12, float m20, float m21, float m22)
    {
        M00 = m00;
        M01 = m01;
        M02 = m02;

        M10 = m10;
        M11 = m11;
        M12 = m12;

        M20 = m20;
        M21 = m21;
        M22 = m22;
    }
    /// <summary>
    /// xyz基向量排列
    /// </summary>
    /// <param name="ax">x基向量</param>
    /// <param name="ay">y基向量</param>
    /// <param name="az">z基向量</param>
    public Matrix3x3(Vector3 ax, Vector3 ay, Vector3 az)
    {
        M00 = ax.x;
        M10 = ax.y;
        M20 = ax.z;

        M01 = ay.x;
        M11 = ay.y;
        M21 = ay.z;

        M02 = az.x;
        M12 = az.y;
        M22 = az.z;
    }
    /// <summary>
    /// 数组排列
    /// </summary>
    /// <param name="arr"></param>
    public Matrix3x3(float[,] arr)
    {
        M00 = arr[0, 0];
        M01 = arr[0, 1];
        M02 = arr[0, 2];

        M10 = arr[1, 0];
        M11 = arr[1, 1];
        M12 = arr[1, 2];

        M20 = arr[2, 0];
        M21 = arr[2, 1];
        M22 = arr[2, 2];
    }
    /// <summary>
    /// 矩阵*vector2
    /// </summary>
    /// <param name="m3x3"></param>
    /// <param name="v2"></param>
    /// <returns></returns>
    public static Vector2 operator *(Matrix3x3 m3x3, Vector2 v2)
    {
        Vector3 v3 = new Vector3(v2.x, v2.y, 1);
        v3 = m3x3 * v3;
        v2 = new Vector2(v3.x, v3.y);
        return v2;
    }
    /// <summary>
    /// 矩阵*vector3
    /// </summary>
    /// <param name="m3x3"></param>
    /// <param name="v3"></param>
    /// <returns></returns>
    public static Vector3 operator *(Matrix3x3 m3x3, Vector3 v3)
    {
        float x = Vector3.Dot(m3x3.Row0, v3);
        float y = Vector3.Dot(m3x3.Row1, v3);
        float z = Vector3.Dot(m3x3.Row2, v3);

        return new Vector3(x, y, z);
    }
    /// <summary>
    /// 矩阵*矩阵
    /// </summary>
    /// <param name="m3x3a"></param>
    /// <param name="m3x3b"></param>
    /// <returns></returns>
    public static Matrix3x3 operator *(Matrix3x3 m3x3a, Matrix3x3 m3x3b)
    {
        float c00 = Vector2.Dot(m3x3a.Row0, m3x3b.Column0);
        float c01 = Vector2.Dot(m3x3a.Row0, m3x3b.Column1);
        float c02 = Vector2.Dot(m3x3a.Row0, m3x3b.Column2);

        float c10 = Vector2.Dot(m3x3a.Row1, m3x3b.Column0);
        float c11 = Vector2.Dot(m3x3a.Row1, m3x3b.Column1);
        float c12 = Vector2.Dot(m3x3a.Row1, m3x3b.Column2);

        float c20 = Vector2.Dot(m3x3a.Row2, m3x3b.Column0);
        float c21 = Vector2.Dot(m3x3a.Row2, m3x3b.Column1);
        float c22 = Vector2.Dot(m3x3a.Row2, m3x3b.Column2);

        Matrix3x3 ret = new Matrix3x3(c00, c01, c02, c10, c11, c12, c20, c21, c22);
        return ret;
    }
    /// <summary>
    /// 矩阵/标量
    /// </summary>
    /// <param name="m3x3"></param>
    /// <param name="f"></param>
    /// <returns></returns>
    public static Matrix3x3 operator /(Matrix3x3 m3x3, float f)
    {
        for (int x = 0; x < ROW; x++)
        {
            for (int y = 0; y < COLUMN; y++)
            {
                m3x3[x, y] /= f;
            }
        }
        return m3x3;
    }
    /// <summary>
    /// 求行列式
    /// </summary>
    /// <returns></returns>
    public float GetDeterminant()
    {
        float det = M00 * M11 * M22 + M01 * M12 * M20 + M02 * M10 * M21 - M02 * M11 * M20 - M01 * M10 * M22 - M00 * M12 * M21;
        return det;
    }
    /// <summary>
    /// 求转置矩阵
    /// </summary>
    /// <returns></returns>
    public Matrix3x3 GetTransposeMatrix()
    {
        Matrix3x3 m3x3T = new Matrix3x3();
        for (int x = 0; x < ROW; x++)
        {
            for (int y = 0; y < COLUMN; y++)
            {
                m3x3T[x, y] = this[y, x];
            }
        }
        return m3x3T;
    }
    /// <summary>
    /// 求余子式矩阵
    /// </summary>
    /// <param name="r"></param>
    /// <param name="c"></param>
    /// <returns></returns>
    public Matrix2x2 GetCofactorMatrix(int r, int c)
    {
        Matrix2x2 m2x2 = new Matrix2x2();
        for (int x = 0; x < ROW; x++)
        {
            for (int y = 0; y < COLUMN; y++)
            {
                if (x != r && y != c)
                {
                    int row = x > r ? x - 1 : x;
                    int col = y > c ? y - 1 : y;
                    m2x2[row, col] = this[x, y];
                }
            }
        }
        return m2x2;
    }
    /// <summary>
    /// 求代数余子式(余子式矩阵的行列式)矩阵
    /// 余子式矩阵行列式正负号
    /// + - +
    /// - + -
    /// + - +
    /// </summary>
    /// <returns></returns>
    public Matrix3x3 GetCofactorDeterminantMatrix()
    {
        Matrix3x3 m3x3 = new Matrix3x3();
        for (int x = 0; x < ROW; x++)
        {
            for (int y = 0; y < COLUMN; y++)
            {
                Matrix2x2 m2x2 = GetCofactorMatrix(x, y);
                float m2x2det = m2x2.GetDeterminant();
                bool ispostive = (x + y) % 2 == 0;
                m3x3[x, y] = ispostive ? m2x2det : -m2x2det;
            }
        }
        return m3x3;
    }
    /// <summary>
    /// 求伴随矩阵
    /// 算法:代数余子式矩阵的转置
    /// </summary>
    /// <returns></returns>
    public Matrix3x3 GetAdjointMatrix()
    {
        Matrix3x3 m3x3 = GetCofactorDeterminantMatrix();
        Matrix3x3 m3x3T = m3x3.GetTransposeMatrix();
        return m3x3T;
    }
    /// <summary>
    /// 求逆矩阵
    /// 算法:伴随矩阵/行列式值
    /// </summary>
    /// <returns></returns>
    public Matrix3x3 GetInverseMatrix()
    {
        Matrix3x3 m3x3 = GetAdjointMatrix();
        float det = GetDeterminant();
        Matrix3x3 m3x3I = m3x3 / det;
        return m3x3I;
    }

    public override string ToString()
    {
        string ret = $"换行\nM00:{M00} M01:{M01} M02:{M02} \nM10:{M10} M11:{M11} M12:{M12} \nM20:{M20} M21:{M21} M12:{M22}";
        return ret;
    }
}

      还是用逆矩阵验证一下:

Matrix3x3 m3x3 = new Matrix3x3();
m3x3.M00 = -0.3f;
m3x3.M01 = 6.2f;
m3x3.M02 = 12.6f;
m3x3.M10 = 5.2f;
m3x3.M11 = -1.8f;
m3x3.M12 = 7.8f;
m3x3.M20 = -52.2f;
m3x3.M21 = 6.4f;
m3x3.M22 = -70.1f;

Debug.LogErrorFormat($"m3x3 = {m3x3}");

Vector3 vec0 = new Vector3(20.3f, -54f, 4.4f);

Vector3 vec1 = m3x3 * vec0;

Matrix3x3 m3x3I = m3x3.GetInverseMatrix();

Debug.LogErrorFormat($"m3x3I = {m3x3I}");

Vector3 vec2 = m3x3I * vec1;

Debug.LogErrorFormat($"vec0 = {vec0} vec1 = {vec1} vec2 = {vec2}");

      结果:
在这里插入图片描述
      OK,洗了睡,这里吐槽一下:这些矩阵计算unity应该直接提供,写起来眼睛都要看瞎了。

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

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

相关文章

字节青训-小F的永久代币卡回本计划、

目录 一、小F的永久代币卡回本计划 问题描述 测试样例 解题思路&#xff1a; 问题理解&#xff1a; 数学公式&#xff1a; 代码实现&#xff1a; 最终代码&#xff1a; 运行结果&#xff1a; 二、构造特定数组的逆序拼接 问题描述 测试样例 解题思路&#xff1a;…

PGMP-串串0203 项目集管理绩效域战略一致性

1.项目集管理绩效域 2.战略一致性 战略一致性包含内容商业论证BC项目集章程项目集路线图环境评估项目集风险管理策略 前期formulation sub-phaseplanning sub-phase组织的战略计划项目集风险管理策略项目集管理计划商业论证BC项目集章程项目集路线图环境评估

使用ThorUi

摘要&#xff1a; 官网 今天遇到一个老项目&#xff0c;使用的是ThorUi组件库&#xff01;之前没有用过这组件库&#xff0c;所以记录一下不同框架是使用情况&#xff01; ThorUI 是一个基于 Thorium 的 UI 框架&#xff0c;用于构建跨平台的桌面应用程序。如果你打算使用 Thor…

【activiti工作流源码集成】springboot+activiti+mysql+vue+redis工作流审批流集成整合业务绑定表单流程图会签驳回

工作流集成实际项目案例&#xff0c;demo提供 源码获取方式&#xff1a;本文末个人名片直接获取。 前言 activiti工作流引擎项目&#xff0c;企业erp、oa、hr、crm等企事业办公系统轻松落地&#xff0c;请假审批demo从流程绘制到审批结束实例。 一、项目形式 springbootvue…

【React.js】AntDesignPro左侧菜单栏栏目名称不显示的解决方案

作者&#xff1a;CSDN-PleaSure乐事 欢迎大家阅读我的博客 希望大家喜欢 使用环境&#xff1a;WebStorm 目录 问题概述 原因 解决方案 解决方法 潜在问题修改 最终效果呈现 额外内容 管理员界面路由配置 WebStorm背景更换 法一&#xff1a; 法二&#xff1a; 问题概…

布谷直播源码部署服务器关于数据库配置的详细说明

布谷直播源码搭建部署配置接口数据库 /public/db.php&#xff08;2019年8月后的系统在该路径下配置数据库&#xff0c;老版本继续走下面的操作&#xff09; 在项目代码中执行命令安装依赖库&#xff08;⚠️注意&#xff1a;如果已经有了vendor内的依赖文件的就不用执行了&am…

Spring中的过滤器和拦截器

Spring中的过滤器和拦截器 一、引言 在Spring框架中&#xff0c;过滤器&#xff08;Filter&#xff09;和拦截器&#xff08;Interceptor&#xff09;是实现请求处理的两种重要机制。它们都基于AOP&#xff08;面向切面编程&#xff09;思想&#xff0c;用于在请求的生命周期…

Day16二叉树的中序遍历

给定一个二叉树的根节点 root &#xff0c;返回它的中序遍历 。 /*** Definition for a binary tree node.* public class TreeNode {* int val;* TreeNode left;* TreeNode right;* TreeNode() {}* TreeNode(int val) { this.val val; }* TreeNode(i…

RT-DETR实战TT100K中国交通标志识别

本文采用RT-DETR作为核心算法框架&#xff0c;结合PyQt5构建用户界面&#xff0c;使用Python3进行开发。RT-DETR以其高效的实时检测能力&#xff0c;在多个目标检测任务中展现出卓越性能。本研究针对TT100K交通标志数据集进行训练和优化&#xff0c;该数据集包含丰富的TT100K交…

图像信号处理器(ISP,Image Signal Processor)详解

简介&#xff1a;个人学习分享&#xff0c;如有错误&#xff0c;欢迎批评指正。 图像信号处理器&#xff08;ISP&#xff0c;Image Signal Processor&#xff09; 是专门用于处理图像信号的硬件或处理单元&#xff0c;广泛应用于图像传感器&#xff08;如 CMOS 或 CCD 传感器&a…

js基础篇笔记 (万字速通)

此笔记来自于黑马程序员,仅供笔者复习 JavaScript 基础 - 第1天 了解变量、数据类型、运算符等基础概念&#xff0c;能够实现数据类型的转换&#xff0c;结合四则运算体会如何编程。 体会现实世界中的事物与计算机的关系理解什么是数据并知道数据的分类理解变量存储数据的“容…

【GPTs】EmojiAI:轻松生成趣味表情翻译

博客主页&#xff1a; [小ᶻZ࿆] 本文专栏: AIGC | GPTs应用实例 文章目录 &#x1f4af;GPTs指令&#x1f4af;前言&#x1f4af;EmojiAI主要功能适用场景优点缺点 &#x1f4af;小结 &#x1f4af;GPTs指令 中文翻译&#xff1a; 此 GPT 的主要角色是为英文文本提供幽默…

H.264/H.265播放器EasyPlayer.js无插件H5播放器关于WASM的压缩优化

在当今的Web开发领域&#xff0c;流媒体播放器的性能和效率至关重要&#xff0c;尤其是在处理大型视频文件和高分辨率视频流时。EasyPlayer.js RTSP播放器作为一款先进的流媒体播放器&#xff0c;它在WebAssembly&#xff08;WASM&#xff09;的压缩优化方面表现出色&#xff0…

Unity Shader分段式血条

Unity Shader分段式血条 前言项目ASE连线 前言 要给单位加一个类似LOL的分段式血条&#xff0c;用ASE实现并记录一下。里面加了旋转和颜色的渐变。 项目 ASE连线

基于 STM32 的天气时钟项目中添加天气数据的网络获取功能

基于 STM32 的天气时钟项目中添加天气数据的网络获取功能&#xff0c;您需要确保您的开发环境具备网络连接能力。这里以 ESP8266 Wi-Fi 模块为例&#xff0c;详细说明如何实现网络获取天气数据的功能。 1. 硬件连接 连接 ESP8266 模块 请参考以下连接方式&#xff0c;将 ESP82…

element-plus按需引入报错AutoImport is not a function

官网文档&#xff1a;快速开始 | Element Plus webpack配置 // webpack.config.js const AutoImport require(unplugin-auto-import/webpack) const Components require(unplugin-vue-components/webpack) const { ElementPlusResolver } require(unplugin-vue-components…

MatSci-LLM ——潜力和挑战以及大规模语言模型在材料科学中的应用

概述 大规模语言模型的出现正在从根本上改变技术开发和研究的方式。大规模语言模型不仅对自然语言处理领域产生了重大影响&#xff0c;而且对许多相关领域也产生了重大影响&#xff0c;例如从文本生成图像的计算机视觉&#xff08;Zhang 等人&#xff0c;2023 年&#xff09;。…

【系统架构设计师(第2版)】五、软件工程基础知识

5.1 软件工程 20世纪60年代&#xff0c;为了解决软件危机&#xff0c;提出了软件工程的概念。 软件危机的具体表现&#xff1a; 软件开发进度难以预测&#xff1b;软件开发成本难以控制&#xff1b;软件功能难以满足用户期望&#xff1b;软件质量无法保证&#xff1b;软件难以…

C++builder中的人工智能(17):神经网络中的自我规则非单调(Mish)激活函数

在这篇文章中&#xff0c;我们将探讨自我规则非单调激活函数——Mish在神经网络中的应用。了解Mish函数的工作原理&#xff0c;将有助于您在使用C IDE构建C应用程序时更加得心应手。 目录 神经网络中的激活函数是什么&#xff1f;能在C中创建激活函数吗&#xff1f;自我规则非…

华为eNSP实验:IP Source Guard

一&#xff1a;IP Source Guard: IP Source Guard&#xff08;简称IPSG&#xff09;是一种基于二层接口的源IP地址过滤技术&#xff0c;用于防止恶意主机伪造合法主机的IP地址进行网络攻击。以下是对IP Source Guard的详细解析&#xff1a; 基本概念&#xff1a; IP Source Gu…