Matrix library that supports primitive operations, transposes, dot products, and special matrices.See header file for methods and attributes. Built as a project for 6.179 at MIT.
Return | Method | Arguments | Description |
---|---|---|---|
Matrix | randn() | int rows, int columns, int min, int max | Random values within given range |
Matrix | ones() | int rows, int columns | A matrix of ones |
Matrix | eye() | int rows, int columns | Identity Matrix |
Return | Operator | Arguments |
---|---|---|
Matrix | Addition (+) | Matrix a, Matrix b |
Matrix | Subtraction (-) | Matrix a, Matrix b |
Matrix | Multiplication (*) | Matrix a, Matrix b |
istream | &operator>> | istream &is, Matrix &b |
ostream | &operator<< | ostream &os, Matrix &b |
Return | Method | Arguments |
---|---|---|
double | dot(Matrix, Matrix) | Matrix a, Matrix B |
Matrix | transpose() | None |
Matrix.h: Header file, contains methods and attributes
Source.cpp: Implements functions
Main.cpp: Driver
Compile source and main simultaneously:
g++ source.cpp main.cpp -o out -std=c++11