Table of Contents

Class NeuronSet

Namespace
DotFly.Core.Graph
Assembly
DotFly.Core.dll

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

int

Empty

The empty set.

public static NeuronSet Empty { get; }

Property Value

NeuronSet

Indices

The sorted neuron indices.

public ReadOnlySpan<int> Indices { get; }

Property Value

ReadOnlySpan<int>

this[int]

Gets the element at the specified index in the read-only list.

public int this[int position] { get; }

Parameters

position int

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

string

Methods

Contains(int)

Whether the set contains the given neuron index (binary search).

public bool Contains(int neuron)

Parameters

neuron int

Returns

bool

From(string, ReadOnlySpan<int>)

Creates a set from arbitrary indices (sorted and de-duplicated).

public static NeuronSet From(string name, ReadOnlySpan<int> indices)

Parameters

name string
indices ReadOnlySpan<int>

Returns

NeuronSet

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

name string

Returns

NeuronSet

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

a NeuronSet
b NeuronSet

Returns

NeuronSet

operator |(NeuronSet, NeuronSet)

Union.

public static NeuronSet operator |(NeuronSet a, NeuronSet b)

Parameters

a NeuronSet
b NeuronSet

Returns

NeuronSet

operator -(NeuronSet, NeuronSet)

Difference (elements of a not in b).

public static NeuronSet operator -(NeuronSet a, NeuronSet b)

Parameters

a NeuronSet
b NeuronSet

Returns

NeuronSet