大致像这样:
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;
// ...
};