如何在犰狳中共享共同的记忆? [英] How to share common memory in armadillo?

查看:123
本文介绍了如何在犰狳中共享共同的记忆?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在犰狳中,高级构造函数提供了共享内存的方式,例如

In armadillo, the advanced constructor provide the way to share memory like

mat B(10,10);

mat A(B.memptr(),2,50,false, true);

但是在有关类的c ++程序中,应该首先在头文件中声明变量,例如

but in c++ program about class, one should first declare variables in head file,like

mat A,B;

并在cpp文件中实现其他功能.

and realize other things in cpp file.

那么,谁能告诉我如何在头文件中声明A和B的情况下在cpp文件中的mat A和Mat B之间共享内存?

So, anyone can tell me how to share memory between mat A and mat B in cpp file with the declaration of mat A and B in head file?

推荐答案

vs 2013

In vs 2013,

#define ARMA_USE_CXX11

#define ARMA_USE_CXX11

应包括在内.然后 std :: move 即可.

should be included. And then std::move would work.

感谢 hbrerkere 引导正确的方法.

这篇关于如何在犰狳中共享共同的记忆?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆