public static T[] ToArray <T>(this ndarray a) { if (a.IsASlice) { List <T> Data = a.ToList <T>(); return(Data.ToArray()); } else { T[] data = (T[])a.rawdata(0).datap; return(data); } }
public static List <T> ToList <T>(this ndarray a) { if (a.IsASlice) { List <T> Data = new List <T>(); foreach (T d in a) { Data.Add(d); } return(Data); } else { T[] data = (T[])a.rawdata(0).datap; return(data.ToList()); } }