可以把 Matrix 与 Vector 分开装
查看原帖
可以把 Matrix 与 Vector 分开装
1057033
liuyongtao楼主2025/7/23 14:49

大致像这样:

struct Matrix {
  vector<vector<int>> a;
  // ...
  Matrix operator*(const Matrix &x) const { // ... }
};

struct Vector {
  vector<int> a;
  // ...
  Vector operator*(const Matrix &x) const { // ... }
  Vector operator+(const Vector &x) const { // ... }
};

struct SMT {
  vector<Vector> T;
  vector<Matrix> tag;
  // ...
};

2025/7/23 14:49
加载中...