/
lyapdy
/
skillbox_controllers
Обзор
Документация
Войти
/
lyapdy
/
skillbox_controllers
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
Project7/lib/matrix.h
31 строка
705 B
danillyapunov
Second commit
09 дек 2025, 18:41
09 дек 2025, 18:41
2c9c8f9
Код
Авторство
О чём код?
#pragma once #include <vector> namespace math { typedef double real; class Matrix { private: int cols_; int rows_; std::vector<real> mvec_; public: Matrix() {}; Matrix(int rows, int cols) : cols_(cols), rows_(rows), mvec_(std::vector<real>(rows * cols)) {}; real& operator()(int row, int col); real operator()(int row, int col) const; void print() const; friend Matrix operator+(const Matrix& A, const Matrix& B); friend Matrix operator-(const Matrix& A, const Matrix& B); friend Matrix operator*(const Matrix& A, const Matrix& B); }; }