定义Dlib C ++常量矩阵

时间:2017-08-03 12:30:47

标签: c++ shared-libraries dlib compile-time-constant

我发现了一篇关于此的帖子,但这并不是真的相关。因此我的问题是:如何将Dlib矩阵定义为全局编译时常量?见附件。

谢谢..

#include <iostream>
#include "dlib/matrix.h"
using namespace dlib;
using namespace std;

const int n_rows = 2;
const int n_cols = 4;
const matrix <int,n_rows,n_cols> X = 1,2,3,4,5,6,7,8; 

int main()
{   
  cout << "X: \n" << X << endl;
  return 0;
}

0 个答案:

没有答案