Design Matrix
Design a customized Matrix.
Introduction
Today, we will explore how to design a customized Matrix class. Matrix is widely used in image processing and scientific computation as data holder. A Matrix data type should have the following attributes and functions:
- size: height and width
- data type: int, float, double
- addition: +
- subtraction: -
- multiplication: *
- scalar multiplication: *
- transpose
Code
Mat.h
1 |
|
main.cpp
1 |
|
1 | output: |