using System;
using NumSharp;
namespace NumSharp001
{
internal class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World using the NumSharp package!");
Console.WriteLine("basic definitions ");
var array001 = np.full(5, 6); //[5, 5, 5 .. 5]
Console.WriteLine("This array001 variable has these 6 values : " + array001);
var array_zeros = np.zeros(6);
Console.WriteLine("This array_zeros variable has these 6 values : " + array_zeros);
var array_arange = np.arange(6);
Console.WriteLine("This array_arange variable has these 6 values : " + array_arange);
var matrix_3x3 = np.zeros((3, 3));
Console.WriteLine("This matrix_3x3 variable has these values : " + matrix_3x3);
Console.WriteLine("Save array to disk");
Console.WriteLine("NumSharp cannot save arrays has more than int byteMaxSize = 2_147_483_591 elements");
NDArray disk_array = new double[]{1,2,3};
disk_array.ToString();
np.Save((Array)disk_array, "my_array.npy");
Console.WriteLine("Load array from disk.");
NDArray load_array = np.Load<double[]>("my_array.npy");
var disk_load_array = load_array.ToString();
Console.WriteLine(disk_load_array);
}
}
}