6 instantiations of NRange
System.Numerics.Tensors (6)
System\NRange.cs (4)
93public static NRange StartAt(NIndex start) => new NRange(start, NIndex.End); 96public static NRange EndAt(NIndex end) => new NRange(NIndex.Start, end); 99public static NRange All => new NRange(NIndex.Start, NIndex.End); 128public static implicit operator NRange(Range range) => new NRange(range.Start, range.End);
System\Numerics\Tensors\netcore\Tensor.cs (2)
482ranges[i] = new NRange(start[i], new NIndex(0, fromEnd: true)); 498ranges[i] = new NRange(startIndex[i], new NIndex(0, fromEnd: true));
58 references to NRange
System.Numerics.Tensors (58)
System\NRange.cs (28)
19public readonly struct NRange : IEquatable<NRange> 27/// <summary>Constructs an <see cref="NRange"/> object using the start and end <see cref="NIndex"/>.</summary> 28/// <param name="start">The inclusive start <see cref="NIndex"/> of the <see cref="NRange"/>.</param> 29/// <param name="end">The exclusive end <see cref="NIndex"/> of the <see cref="NRange"/>.</param> 37/// Constructs an <see cref="NRange"/> object using a <see cref="Range"/>. 46/// <summary>Compares the current <see cref="NRange"/> object to another object of the same type for equality.</summary> 49value is NRange r && 53/// <summary>Compares the current <see cref="NRange"/> object to another <see cref="NRange"/> object for equality.</summary> 55public bool Equals(NRange other) => other.Start.Equals(Start) && other.End.Equals(End); 92/// <summary>Creates an <see cref="NRange"/> object starting from start <see cref="NIndex"/> to the end of the collection.</summary> 93public static NRange StartAt(NIndex start) => new NRange(start, NIndex.End); 95/// <summary>Creates an <see cref="NRange"/> object starting from first element in the collection to the end <see cref="NIndex"/>.</summary> 96public static NRange EndAt(NIndex end) => new NRange(NIndex.Start, end); 99public static NRange All => new NRange(NIndex.Start, NIndex.End); 101/// <summary>Calculates the start offset and length of the <see cref="NRange"/> object using a collection length.</summary> 102/// <param name="length">The length of the collection that the <see cref="NRange"/> will be used with. Must be a positive value.</param> 106/// The <see cref="NRange"/> is validated to be inside the length scope, however. 125/// Implicitly converts a <see cref="Range"/> to an <see cref="NRange"/>. 128public static implicit operator NRange(Range range) => new NRange(range.Start, range.End); 131/// Explicitly converts an <see cref="NRange"/> to a <see cref="Range"/> without doing bounds checks. 133/// <param name="value"><see cref="NRange"/> to convert.</param> 134public static explicit operator Range(NRange value) => new Range((Index)value.Start, (Index)value.End); 137/// Explicitly converts an <see cref="NRange"/> to a <see cref="Range"/>. 139/// <param name="value"><see cref="NRange"/> to convert.</param> 140public static explicit operator checked Range(NRange value) => new Range(checked((Index)value.Start), checked((Index)value.End)); 143/// Converts a <see cref="NRange"/> to a <see cref="Range"/>. 149/// Converts a <see cref="NRange"/> to a <see cref="Range"/> without doing bounds checks.
System\Numerics\Tensors\netcore\IReadOnlyTensor.cs (3)
60TSelf this[params scoped ReadOnlySpan<NRange> ranges] { get; } 87ReadOnlyTensorSpan<T> AsReadOnlyTensorSpan(params scoped ReadOnlySpan<NRange> range); 140TSelf Slice(params scoped ReadOnlySpan<NRange> range);
System\Numerics\Tensors\netcore\ITensor.cs (2)
91new TSelf this[params scoped ReadOnlySpan<NRange> ranges] { get; set; } 118TensorSpan<T> AsTensorSpan(params scoped ReadOnlySpan<NRange> range);
System\Numerics\Tensors\netcore\ReadOnlyTensorSpan.cs (6)
370public ReadOnlyTensorSpan<T> this[params scoped ReadOnlySpan<NRange> ranges] 657NRange[] ranges = new NRange[indexes.Length]; 672NRange[] ranges = new NRange[lengths.Length]; 686public ReadOnlyTensorSpan<T> Slice(params scoped ReadOnlySpan<NRange> ranges)
System\Numerics\Tensors\netcore\Tensor.cs (10)
224public Tensor<T> this[params ReadOnlySpan<NRange> ranges] 236if (ranges == ReadOnlySpan<NRange>.Empty) 320Tensor<T> IReadOnlyTensor<Tensor<T>, T>.this[params ReadOnlySpan<NRange> ranges] 396public TensorSpan<T> AsTensorSpan(params scoped ReadOnlySpan<NRange> start) => AsTensorSpan().Slice(start); 423public ReadOnlyTensorSpan<T> AsReadOnlyTensorSpan(params scoped ReadOnlySpan<NRange> start) => AsTensorSpan().Slice(start); 459public Tensor<T> Slice(params ReadOnlySpan<NRange> start) 479NRange[] ranges = new NRange[start.Length]; 495NRange[] ranges = new NRange[startIndex.Length];
System\Numerics\Tensors\netcore\TensorExtensions.cs (3)
3147public static Tensor<T> SetSlice<T>(this Tensor<T> tensor, in ReadOnlyTensorSpan<T> values, params ReadOnlySpan<NRange> ranges) 3160public static ref readonly TensorSpan<T> SetSlice<T>(this in TensorSpan<T> tensor, scoped in ReadOnlyTensorSpan<T> values, params scoped ReadOnlySpan<NRange> ranges) 3163if (ranges == ReadOnlySpan<NRange>.Empty)
System\Numerics\Tensors\netcore\TensorSpan.cs (6)
374public TensorSpan<T> this[params scoped ReadOnlySpan<NRange> ranges] 691NRange[] ranges = new NRange[indexes.Length]; 706NRange[] ranges = new NRange[lengths.Length]; 720public TensorSpan<T> Slice(params scoped ReadOnlySpan<NRange> ranges)