Show / Hide Table of Contents

Class PossibleValues

Tracks per-square possible values for a puzzle.

Inheritance
object
PossibleValues
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: SudokuSpice.RuleBased
Assembly: SudokuSpice.dll
Syntax
public class PossibleValues

Constructors

| Edit this page View Source

PossibleValues(PossibleValues)

Copy-constructor to provide a deep copy.

Declaration
public PossibleValues(PossibleValues existing)
Parameters
Type Name Description
PossibleValues existing

The existing PossibleValues object that you want to copy.

| Edit this page View Source

PossibleValues(int, 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
int 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

| Edit this page View Source

AllPossible

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
| Edit this page View Source

this[Coordinate]

Provides read and write access to the possible values for the given square.

Declaration
[SuppressMessage("Design", "CA1043:Use Integral Or String Argument For Indexers", Justification = "This makes sense with Coordinate, which removes any ambiguity between first and second arguments")]
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

| Edit this page View Source

Intersect(in 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.

| Edit this page View Source

Reset(in 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 Coordinate of the square to reset.

| Edit this page View Source

Reset(ReadOnlySpan<Coordinate>)

Resets the possible values to AllPossible at the given coordinates.

Declaration
public void Reset(ReadOnlySpan<Coordinate> coordinates)
Parameters
Type Name Description
ReadOnlySpan<Coordinate> coordinates
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX