matrix.hpp

来自「unix/linux下拼写检查程序源码」· HPP 代码 · 共 23 行

HPP
23
字号
#ifndef __aspeller_matrix_hh__#define __aspeller_matrix_hh__#include <vector>namespace aspeller {  class ShortMatrix {    int x_size;    int y_size;    std::vector<short> data;  public:    ShortMatrix() {}    void init(int s) {x_size = y_size = s; data.resize(s*s);}    void init(int sx, int sy) {x_size = sx; y_size = sy; data.resize(sx*sy);}    short operator() (int x, int y) const {return data[x + y*x_size];}    short & operator() (int x, int y) {return data[x + y*x_size];}  };}#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?