Coder Social home page Coder Social logo

matrix's Introduction

matrix

中文

All class and methods is included in namespace la (the acronym of Linear Algebra).

A cpp template class to calculate matrix.

Only work well in Visual Studio.

Usage

auto a = la::matrix<3, 3>({ 1,2,3,4,5,6,7,8,9 });
auto b = la::matrix<3, 3>({ 6,5,7,6,1,3,5,9,4 });
//init two matrix using vector
std::cout << a; //out put matrix to consale
print(hdc, a); //out put matrix to Windows framework
//paint in gray degree
a = -a; //negative
a = ~a; //transposition
b += a; //add a to b
auto c = b + a; //calculate sum of two matrix
b -= a;
auto c = b - a;
a *= 5;
auto c = a * 5; //5*a is also legal and equal
//if you want to calculate product of two matrix, olease use operator%
a /= 10;
auto c = a/10; // 10/a is illegal
auto c = a % b; //calculate product of two matrix
a %= b; //only available when both a & b is square matrix
//usage of iterator is similar to std::vector
for (auto iter = a.begin(); iter != a.end(); ++iter) {
    std::cout << *i << "\t";
}
//there are const_iterator, reverse_iterator, const_reverse_iterator available
//pay attention to use --iter when using reverse_iterator

matrix's People

Contributors

shizuku avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

auscanaoy

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.