Git Product home page Git Product logo

matrixfac's Introduction

矩阵分析与应用课程大作业

郭睿 202228015029015

作业要求

实现矩阵的LU分解,QR分解,HouseHolder正交约减,Givens约减,URV分解,并利用上述分解解方程组Ax=b,求行列式

实现介绍

此程序实现了上述所有分解与求行列式功能,解方程组只支持唯一解的情况,且暂未使用URV分解的结果解方程组,暂未考虑非法输入的情况,比如这个程序可能会求一个3行4列的矩阵的行列式。
待解方程组存放在文件中,程序运行时读取文件中的A和b(b是文件中的最后一行)。在完成解方程组后会将解代入原方程组进行验证。

程序使用方法

linux系统上 需要g++编译器,输入命令行命令 g++ factorization.cc 编译生成a.out文件
运行命令./a.out [分解类型] [矩阵行数] [矩阵列数] [矩阵存放文件名] 分解类型0-4,依次对应要求中的分解。
测试LU分解运行命令示例./a.out 0 3 3 LU.txt
输出结果:
LU分解与解方程组输出结果
测试QR分解运行命令示例./a.out 1 3 3 QR.txt
输出结果:
QR分解与解方程组输出结果
测试HouseHolder约减运行命令示例./a.out 2 3 3 HouseHolder.txt
输出结果:
HouseHolder约减与解方程组输出结果
测试Givens约减运行命令示例./a.out 3 3 3 Givens.txt
输出结果:
Givens约减与解方程组输出结果
测试URV分解运行命令示例./a.out 4 3 3 URV.txt
输出结果:
URV分解结果

matrixfac's People

Contributors

gladingray avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.