From 45041425b05d93e26c29ba4e524a5a1ea4c98923 Mon Sep 17 00:00:00 2001 From: "yuxi.hong" Date: Thu, 31 Dec 2020 16:14:03 -0500 Subject: [PATCH] windows --- recipes/cnpy/all/test_package/example1.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/recipes/cnpy/all/test_package/example1.cpp b/recipes/cnpy/all/test_package/example1.cpp index 725b235ebc7be..f4dafb6298173 100644 --- a/recipes/cnpy/all/test_package/example1.cpp +++ b/recipes/cnpy/all/test_package/example1.cpp @@ -1,20 +1,15 @@ #include #include -#include - #include"cnpy.h" int main() { - const int Nx = 128; - const int Ny = 64; - const int Nz = 32; - - std::vector> data(Nx*Ny*Nz); - for(int i = 0;i < Nx*Ny*Nz;i++) data[i] = std::complex(rand(),rand()); + const size_t Nx = 16; + const size_t Ny = 16; + const size_t Nz = 16; + std::vector data(Nx*Ny*Nz); + for(int i = 0;i < Nx*Ny*Nz;i++) data[i] = rand(); cnpy::npy_save("arr1.npy",&data[0],{Nz,Ny,Nx},"w"); cnpy::NpyArray arr = cnpy::npy_load("arr1.npy"); - std::complex* loaded_data = arr.data>(); - return EXIT_SUCCESS; }