Exemplo n.º 1
0
 public T At(index_t i0, index_t i1, index_t i2)
 {
     return(this[i0, i1, i2]);
 }
Exemplo n.º 2
0
 public T At(index_t i0, index_t i1, index_t i2, index_t i3)
 {
     return(this[i0, i1, i2, i3]);
 }
Exemplo n.º 3
0
 public Floatarray(index_t d0) : base(d0)
 {
 }
Exemplo n.º 4
0
 public T At(index_t i0, index_t i1)
 {
     return(this[i0, i1]);
 }
Exemplo n.º 5
0
 public void UnsafePut(index_t i0, T value)
 {
     data[i0] = value;
 }
Exemplo n.º 6
0
 public void UnsafePut(index_t i0, index_t i1, T value)
 {
     data[i1 + i0 * dims[1]] = value;
 }
Exemplo n.º 7
0
 /// <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);
 }
Exemplo n.º 8
0
 public void Put(index_t i0, index_t i1, index_t i2, index_t i3, T value)
 {
     this[i0, i1, i2, i3] = value;
 }
Exemplo n.º 9
0
 /// <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);
 }
Exemplo n.º 10
0
 /// <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);
 }
Exemplo n.º 11
0
 public Rectarray(index_t d0) : base(d0)
 {
 }
Exemplo n.º 12
0
 public Longarray(index_t d0) : base(d0)
 {
 }
Exemplo n.º 13
0
 public Doublearray(index_t d0) : base(d0)
 {
 }
Exemplo n.º 14
0
 public void Put(index_t i0, T value)
 {
     this[i0] = value;
 }
Exemplo n.º 15
0
 /// <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);
 }
Exemplo n.º 16
0
 public void Put(index_t i0, index_t i1, T value)
 {
     this[i0, i1] = value;
 }
Exemplo n.º 17
0
 /// <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);
 }
Exemplo n.º 18
0
        // Unsafe subscriptings.

        public T UnsafeAt(index_t i0)
        {
            return(data[i0]);
        }
Exemplo n.º 19
0
 /// <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);
 }
Exemplo n.º 20
0
 public T UnsafeAt(index_t i0, index_t i1)
 {
     return(data[i1 + i0 * dims[1]]);
 }
Exemplo n.º 21
0
        // 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]);
        }
Exemplo n.º 22
0
 public T UnsafeAt(index_t i0, index_t i1, index_t i2)
 {
     return(data[(i1 + i0 * dims[1]) * dims[2] + i2]);
 }
Exemplo n.º 23
0
 /// <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)");
 }