-
Notifications
You must be signed in to change notification settings - Fork 0
/
matrix.h
35 lines (33 loc) · 864 Bytes
/
matrix.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef MATRIX_H
#define MATRIX_H
#include <stdlib.h>
#include <cmath>
#include <iostream>
#include "vector.h"
class Matrix
{
int row_w;
int col_w;
double* numbers;
public:
Matrix();
Matrix(int row_width, int col_width);
Matrix(int n);
int getColWidth() const;
int getRowWidth() const;
double getAt(int r, int w) const;
void setAt(int r, int w, double x);
void transpose(); // needs test
void invert();
void print() const;
Matrix getTranspose() const;
Matrix getInverse() const;
Matrix& operator=(const Matrix &rhs);
void rotate2d(double degrees);
~Matrix();
const Vector operator*(const Vector &other) const;
const Matrix operator-(const Matrix &other) const;
const Matrix operator*(const double &other) const;
const Matrix operator*(const Matrix &other) const; //needs test
};
#endif