1 Star 0 Fork 16

Job/NumCpp

forked from Gitee 极速下载/NumCpp 
加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
example02.cpp 1.06 KB
一键复制 编辑 原始数据 按行查看 历史
Tobias Knopp 提交于 2013-05-10 14:19 +08:00 . nfft and radon transform (including fbp)
#include <numcpp.h>
using namespace numcpp;
int main()
{
size_t N = 4;
Matrix<double> x = reshape(range(0,N*N-1),N,N);
print(x);
print(transpose(x));
print(rotl90(x));
print(rotr90(x));
print(rot180(x));
Vector<double> y = range(0,N);
print(y);
reverse_(y);
print(y);
shuffle_(y);
print(y);
auto z = copy(y);
z(0) = 30;
print(y);
print(z);
h5write(x, "test.h5", "/testV");
auto kk = h5read<double,2>("test.h5", "/testV");
print(kk);
export_image(kk, "test.pdf");
auto zz = meshgrid(range(1,4), range(10,15));
print(zz.first);
print(zz.second);
auto p = phantom(128);
export_image(p, "p.pdf");
export_image(flipud(p), "p_ud.pdf", colormaps::autumn);
export_image(fliplr(p), "p_lr.pdf", colormaps::winter);
export_image(rotl90(p), "p_rotl90.pdf");
{
auto x = linspace(0,1,100);
auto fig = Figure();
fig.imshow(phantom(512));
fig.plot(sin(2*pi*x), "green");
fig.plot(cos(2*pi*x), "red");
fig.plot(sin(2*pi*x), cos(2*pi*x), "yellow");
fig.save("first_plot.pdf");
}
return 0;
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/flyboy82/numcpp.git
git@gitee.com:flyboy82/numcpp.git
flyboy82
numcpp
NumCpp
master

搜索帮助