/// <summary> /// An N-dimensional iterator object to index arrays. /// </summary> public ndindex(object oshape) { shape newshape = NumpyExtensions.ConvertTupleToShape(oshape); var x = np.as_strided(np.zeros(1), shape: newshape.iDims, strides: np.zeros_like(newshape.iDims, dtype: np.intp).ToArray <npy_intp>()); core = new nditer(x); }
public bool MoveNext() { if (current == null) { current = core; } return(core.MoveNext()); }
/// <summary> /// Produce an object that mimics broadcasting. /// </summary> /// <param name="aobjects">Input parameters.</param> /// <returns></returns> public static broadcast broadcast(params object[] aobjects) { ndarray[] arrays = new ndarray[aobjects.Length]; for (int i = 0; i < aobjects.Length; i++) { arrays[i] = asanyarray(aobjects[i]); } var nditer = new nditer(arrays); broadcast bcast = new broadcast(nditer); return(bcast); }
public broadcast(nditer iter) { core = iter; }