public T At(index_t i0, index_t i1, index_t i2) { return(this[i0, i1, i2]); }
public T At(index_t i0, index_t i1, index_t i2, index_t i3) { return(this[i0, i1, i2, i3]); }
public Floatarray(index_t d0) : base(d0) { }
public T At(index_t i0, index_t i1) { return(this[i0, i1]); }
public void UnsafePut(index_t i0, T value) { data[i0] = value; }
public void UnsafePut(index_t i0, index_t i1, T value) { data[i1 + i0 * dims[1]] = value; }
/// <summary> /// Constructor. Creates a rank 3 array with dimensions d0, d1, and d2. /// </summary> public Narray(index_t d0, index_t d1, index_t d2) { alloc_(d0, d1, d2); }
public void Put(index_t i0, index_t i1, index_t i2, index_t i3, T value) { this[i0, i1, i2, i3] = value; }
/// <summary> /// Constructor. Creates a rank 1 array with dimensions d0. /// </summary> /// <param name="d0">size of dimension 0</param> public Narray(index_t d0) { alloc_(d0); }
/// <summary> /// Constructor. Creates a rank 2 array with dimensions d0 and d1. /// </summary> /// <param name="d0">size of dimension 0</param> /// <param name="d1">size of dimension 1</param> public Narray(index_t d0, index_t d1) { alloc_(d0, d1); }
public Rectarray(index_t d0) : base(d0) { }
public Longarray(index_t d0) : base(d0) { }
public Doublearray(index_t d0) : base(d0) { }
public void Put(index_t i0, T value) { this[i0] = value; }
/// <summary> /// Constructor. Creates a rank 4 array with dimensions d0, d1, d2 and d3. /// </summary> public Narray(index_t d0, index_t d1, index_t d2, index_t d3) { alloc_(d0, d1, d2, d3); }
public void Put(index_t i0, index_t i1, T value) { this[i0, i1] = value; }
/// <summary> /// Truncates the array. /// </summary> /// <param name="d0">smaller size for 0 dimension</param> /// <returns>this instance</returns> public Narray <T> Truncate(index_t d0) { check(d0 <= dims[0] && dims[1] == 0, "can only truncate 1D arrays to smaller arrays"); SetDims(d0); return(this); }
// Unsafe subscriptings. public T UnsafeAt(index_t i0) { return(data[i0]); }
/// <summary> /// Resizes the array to the given size; this is guaranteed to reallocate /// the storage fresh. /// </summary> public Narray <T> Renew(index_t d0, index_t d1 = 0, index_t d2 = 0, index_t d3 = 0) { Dealloc(); Resize(d0, d1, d2, d3); return(this); }
public T UnsafeAt(index_t i0, index_t i1) { return(data[i1 + i0 * dims[1]]); }
// Methods provided for easier binding to scripting languages and // for references with operator-> We're just doing this for the // most common case. public T At(index_t i0) { return(this[i0]); }
public T UnsafeAt(index_t i0, index_t i1, index_t i2) { return(data[(i1 + i0 * dims[1]) * dims[2] + i2]); }
/// <summary> /// change the elements of the array /// </summary> public void SetDims(index_t d0, index_t d1 = 0, index_t d2 = 0, index_t d3 = 0) { total = total_(d0, d1, d2, d3); dims[0] = d0; dims[1] = d1; dims[2] = d2; dims[3] = d3; dims[4] = 0; check(total <= allocated, "bad SetDims (internal error)"); }