利用STL的vector能够实现多维矩阵,但是写起来不怎么好看,使用typedef定位为

固定的格式:

//多维矩形,vector实现;
template<class T>
class      iQsVec
{
public:
    typedef         std::vector<T>         dim1;              //一维;
    typedef         std::vector<std::vector<T>>         dim2;     //二维;
    typedef         std::vector<std::vector<std::vector<T>>>         dim3;     //三维;
    typedef         std::vector<std::vector<std::vector<std::vector<T>>>>       dim4;     //四维;
};

 

对应即为:

iQsVec<float>::dim3

相关文章:

  • 2021-11-07
  • 2021-12-12
  • 2022-12-23
  • 2022-12-23
  • 2021-10-12
  • 2021-12-12
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-07-29
  • 2022-12-23
  • 2022-02-22
  • 2022-03-05
  • 2021-12-20
相关资源
相似解决方案