Giter VIP home page Giter VIP logo

matrix's Introduction

matrix

a matrix.h for c++
<1.0版本>

重载了<<,+,-,*,[]运算符,加入了一些处理函数

示例:

matrix<int> m(2,2,0);//新建x=2,y=2的矩阵,并令初始值全为0  
matrix<float> n(2,2);//默认初始值为0  
n.format(2.0);//将n中所有元素格式化为2  
n[1][1]=10.0;//n第二行第二列元素赋值为0  
cout<<n<<endl;   
  //输出n  
  //[2.0 ,2.0  
  // 2.0 ,10.0]  
cout<<n.deter();  
  //输出对应行列式的值  
cout<<n.leaf_m(0,1);  
  //输出代数余子式  
m=n.trans();//将m指向n的转置(不是赋值)  
m=n.clone();//复制n并将m指向n的复制(新空间)  

<1.1版本>

  • 修改:
    n.clone()//只将每一项重新赋值,暂时取消了改变空间  
             // 乘法新加入了两种重载,针对数字或者特殊数字类型fx  
    m=n*3;  
  • 新增:
     n.mean()//对每个元素之和求均值并返回一个1x1的矩阵  
     n.autoeasify()//自动化简矩阵为阶梯型矩阵  
     n.input('i',1,1,2,3,  
                 4,5,2,1,  
                 2,3,4,5);//赋值矩阵,'i'表示数据输入类型为int目前仅支持int和double('d')  
     n.autoeasify_process()//自动化简矩阵并用cout输出中间步骤左乘的初等矩阵  
     n.normal_matrix_l(line_1,line_2,mutiply)//根据n的x属性创建一个初等矩阵,line_2加上line_1乘以mutiply,用于左乘  
     fx s;//特殊数字储存格式,默认为double型,在矩阵运算中代替普通数字作为数乘运算的跟踪  
  • 预告:自动求梯度功能以及dfs函数

<1.3build版本>

  • 修改:
    • 修复了函数内定义变量可能存在的问题,改为内部缓存节点统一调用
    • ‘=’不再依赖外部缓存,而是直接根据值进行重分配
    • clone()全系依赖内部缓存节点new_m,务必警告嵌套使用时new_m的取值
    • 删除了测试和分支代码,增强了可读性
    • 加入了宏定义以取消某些函数
  • 新增:
    n.dfs();//访问isroot为1的最近节点,并根据其输出刷新的n的值
    n.auto_grad(m);//求导,要求n必须为1*1矩阵
    n.clone_link();//返回一个指向n.clone()的指针
    n.clone_same();//返回n的继承
  • 更多内容详见.h文件,有详细的注释。
  • 暂时停止更新

matrix's People

Contributors

cocolinfff avatar

Stargazers

Asakawa Chihara avatar  avatar

Watchers

 avatar  avatar Asakawa Chihara 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.