6 instantiations of NRange
System.Numerics.Tensors (6)
System\NRange.cs (4)
93
public static NRange StartAt(NIndex start) => new
NRange
(start, NIndex.End);
96
public static NRange EndAt(NIndex end) => new
NRange
(NIndex.Start, end);
99
public static NRange All => new
NRange
(NIndex.Start, NIndex.End);
128
public static implicit operator NRange(Range range) => new
NRange
(range.Start, range.End);
System\Numerics\Tensors\netcore\Tensor.cs (2)
482
ranges[i] = new
NRange
(start[i], new NIndex(0, fromEnd: true));
498
ranges[i] = new
NRange
(startIndex[i], new NIndex(0, fromEnd: true));
58 references to NRange
System.Numerics.Tensors (58)
System\NRange.cs (28)
19
public 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>
49
value is
NRange
r &&
53
/// <summary>Compares the current <see cref="
NRange
"/> object to another <see cref="
NRange
"/> object for equality.</summary>
55
public 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>
93
public 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>
96
public static
NRange
EndAt(NIndex end) => new NRange(NIndex.Start, end);
99
public 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
"/>.
128
public 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>
134
public 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>
140
public 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)
60
TSelf this[params scoped ReadOnlySpan<
NRange
> ranges] { get; }
87
ReadOnlyTensorSpan<T> AsReadOnlyTensorSpan(params scoped ReadOnlySpan<
NRange
> range);
140
TSelf Slice(params scoped ReadOnlySpan<
NRange
> range);
System\Numerics\Tensors\netcore\ITensor.cs (2)
91
new TSelf this[params scoped ReadOnlySpan<
NRange
> ranges] { get; set; }
118
TensorSpan<T> AsTensorSpan(params scoped ReadOnlySpan<
NRange
> range);
System\Numerics\Tensors\netcore\ReadOnlyTensorSpan.cs (6)
370
public ReadOnlyTensorSpan<T> this[params scoped ReadOnlySpan<
NRange
> ranges]
657
NRange
[] ranges = new
NRange
[indexes.Length];
672
NRange
[] ranges = new
NRange
[lengths.Length];
686
public ReadOnlyTensorSpan<T> Slice(params scoped ReadOnlySpan<
NRange
> ranges)
System\Numerics\Tensors\netcore\Tensor.cs (10)
224
public Tensor<T> this[params ReadOnlySpan<
NRange
> ranges]
236
if (ranges == ReadOnlySpan<
NRange
>.Empty)
320
Tensor<T> IReadOnlyTensor<Tensor<T>, T>.this[params ReadOnlySpan<
NRange
> ranges]
396
public TensorSpan<T> AsTensorSpan(params scoped ReadOnlySpan<
NRange
> start) => AsTensorSpan().Slice(start);
423
public ReadOnlyTensorSpan<T> AsReadOnlyTensorSpan(params scoped ReadOnlySpan<
NRange
> start) => AsTensorSpan().Slice(start);
459
public Tensor<T> Slice(params ReadOnlySpan<
NRange
> start)
479
NRange
[] ranges = new
NRange
[start.Length];
495
NRange
[] ranges = new
NRange
[startIndex.Length];
System\Numerics\Tensors\netcore\TensorExtensions.cs (3)
3147
public static Tensor<T> SetSlice<T>(this Tensor<T> tensor, in ReadOnlyTensorSpan<T> values, params ReadOnlySpan<
NRange
> ranges)
3160
public static ref readonly TensorSpan<T> SetSlice<T>(this in TensorSpan<T> tensor, scoped in ReadOnlyTensorSpan<T> values, params scoped ReadOnlySpan<
NRange
> ranges)
3163
if (ranges == ReadOnlySpan<
NRange
>.Empty)
System\Numerics\Tensors\netcore\TensorSpan.cs (6)
374
public TensorSpan<T> this[params scoped ReadOnlySpan<
NRange
> ranges]
691
NRange
[] ranges = new
NRange
[indexes.Length];
706
NRange
[] ranges = new
NRange
[lengths.Length];
720
public TensorSpan<T> Slice(params scoped ReadOnlySpan<
NRange
> ranges)