https://github.com/eimfach/matrix
A toy matrix implementation for learning purpose
https://github.com/eimfach/matrix
cpp cpp20 matrix matrix-multiplication
Last synced: 21 days ago
JSON representation
A toy matrix implementation for learning purpose
- Host: GitHub
- URL: https://github.com/eimfach/matrix
- Owner: eimfach
- License: gpl-2.0
- Created: 2025-04-06T11:51:54.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-11T11:03:25.000Z (about 1 year ago)
- Last Synced: 2025-04-18T23:39:55.561Z (about 1 year ago)
- Topics: cpp, cpp20, matrix, matrix-multiplication
- Language: C++
- Homepage:
- Size: 204 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Matrix
A toy matrix implementation using modern C++.
## Motivation / Learning Goals
This project serves as a personal exercise to learn and deepen my understanding of key C++ concepts. The primary focus was on:
* Object-Oriented Programming (OOP) principles in C++.
* Correctly implementing Operator Overloading for intuitive class usage.
* Utilizing Templates for generic code design.
* Exploring modern C++20 features like Concepts.
* Efficient use of `std::vector` for underlying data storage.
* Adhering to coding guidelines using the [Guidelines Support Library (GSL)](https://github.com/microsoft/GSL) (specifically for safe numeric casts like `narrow_cast`)
* (Optional: Initial experiments with performance considerations in C++.)
## Features
* Basic Matrix class storing `double` values.
* Initialization with dimensions and optional initial data (`std::vector`).
* Overloaded `operator*` for:
* Matrix-Matrix multiplication.
* Scalar multiplication (Matrix * `double`).
* `size()` method to get the total number of elements.
* *(Note: Direct public element accessors (get/set methods or operator()) and formatted printing (`operator<<`) are not currently implemented.)*
## Tech Stack / Requirements
* **Language:** C++20
* **Libraries:**
* [Microsoft Guidelines Support Library (GSL)](https://github.com/microsoft/GSL)
* **Development Environment:** Developed using Visual Studio.