Class NeuronSet
An immutable, sorted, duplicate-free set of neuron indices with a name. Every input, output, silence mask and query in dotFly resolves to one of these.
public sealed class NeuronSet : IReadOnlyList<int>, IReadOnlyCollection<int>, IEnumerable<int>, IEnumerable
- Inheritance
-
NeuronSet
- Implements
- Inherited Members
Properties
Count
Number of neurons.
public int Count { get; }
Property Value
Empty
The empty set.
public static NeuronSet Empty { get; }
Property Value
Indices
The sorted neuron indices.
public ReadOnlySpan<int> Indices { get; }
Property Value
this[int]
Gets the element at the specified index in the read-only list.
public int this[int position] { get; }
Parameters
positionint
Property Value
- int
The element at the specified index in the read-only list.
Name
Set name (a shipped set name, a query description, or user-supplied).
public string Name { get; }
Property Value
Methods
Contains(int)
Whether the set contains the given neuron index (binary search).
public bool Contains(int neuron)
Parameters
neuronint
Returns
From(string, ReadOnlySpan<int>)
Creates a set from arbitrary indices (sorted and de-duplicated).
public static NeuronSet From(string name, ReadOnlySpan<int> indices)
Parameters
namestringindicesReadOnlySpan<int>
Returns
GetEnumerator()
Returns an enumerator that iterates through the collection.
public IEnumerator<int> GetEnumerator()
Returns
- IEnumerator<int>
An enumerator that can be used to iterate through the collection.
Rename(string)
Returns a copy of this set under a different name.
public NeuronSet Rename(string name)
Parameters
namestring
Returns
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.
Operators
operator &(NeuronSet, NeuronSet)
Intersection.
public static NeuronSet operator &(NeuronSet a, NeuronSet b)
Parameters
Returns
operator |(NeuronSet, NeuronSet)
Union.
public static NeuronSet operator |(NeuronSet a, NeuronSet b)
Parameters
Returns
operator -(NeuronSet, NeuronSet)
Difference (elements of a not in b).
public static NeuronSet operator -(NeuronSet a, NeuronSet b)