Class PossibleValues
Tracks per-square possible values for a puzzle.
Inheritance
Inherited Members
Namespace: SudokuSpice.RuleBased
Assembly: SudokuSpice.dll
Syntax
public class PossibleValues
Constructors
| Improve this Doc View SourcePossibleValues(PossibleValues)
Copy-constructor to provide a deep copy.
Declaration
public PossibleValues(PossibleValues existing)
Parameters
| Type | Name | Description |
|---|---|---|
| PossibleValues | existing | The existing |
PossibleValues(Int32, BitVector)
Constructs a PossibleValues object to track possible values for a size-x-size
puzzle. All coordinates are initialized to uniquePossibleValues
possible values.
Declaration
public PossibleValues(int size, BitVector uniquePossibleValues)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | size | The size of the puzzle for which we want to track possible values. |
| BitVector | uniquePossibleValues | The full set of possible values for any given square in this puzzle. |
Properties
| Improve this Doc View SourceAllPossible
Returns a BitVector for the complete set of possible values for any given
square in the puzzle represented by this PossibleValues object.
Declaration
public BitVector AllPossible { get; }
Property Value
| Type | Description |
|---|---|
| BitVector |
Item[Coordinate]
Provides read and write access to the possible values for the given square.
Declaration
public BitVector this[in Coordinate c] { get; set; }
Parameters
| Type | Name | Description |
|---|---|---|
| Coordinate | c | The Coordinate of the square. |
Property Value
| Type | Description |
|---|---|
| BitVector | The possible values for that square as a BitVector. |
Methods
| Improve this Doc View SourceIntersect(Coordinate, BitVector)
Updates the possible values for the square at the given Coordinate to be
the intersect of their current value and the given possibleValues.
Declaration
public void Intersect(in Coordinate c, BitVector possibleValues)
Parameters
| Type | Name | Description |
|---|---|---|
| Coordinate | c | The Coordinate of the square to update. |
| BitVector | possibleValues | The possible values to intersect with. |
Reset(Coordinate)
Resets the possible values for the given Coordinate to the full set of possible values for this puzzle.
Declaration
public void Reset(in Coordinate c)
Parameters
| Type | Name | Description |
|---|---|---|
| Coordinate | c | The |
Reset(ReadOnlySpan<Coordinate>)
Resets the possible values to AllPossible at the given coordinates.
Declaration
public void Reset(ReadOnlySpan<Coordinate> coordinates)
Parameters
| Type | Name | Description |
|---|---|---|
| System.ReadOnlySpan<Coordinate> | coordinates |