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

        public T UnsafeAt(index_t i0)
        {
            return(data[i0]);
        }
示例#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);
 }
示例#20
0
 public T UnsafeAt(index_t i0, index_t i1)
 {
     return(data[i1 + i0 * dims[1]]);
 }
示例#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]);
        }
示例#22
0
 public T UnsafeAt(index_t i0, index_t i1, index_t i2)
 {
     return(data[(i1 + i0 * dims[1]) * dims[2] + i2]);
 }
示例#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)");
 }