Package org.bytedeco.leptonica
Class L_SUDOKU
java.lang.Object
org.bytedeco.javacpp.Pointer
org.bytedeco.leptonica.L_SUDOKU
- All Implemented Interfaces:
AutoCloseable
\file sudoku.h
The L_Sudoku holds all the information of the current state. The input to sudokuCreate() is a file with any number of lines starting with '#', followed by 9 lines consisting of 9 numbers in each line. These have the known values and use 0 for the unknowns. Blank lines are ignored. The %locs array holds the indices of the unknowns, numbered left-to-right and top-to-bottom from 0 to 80. The array size is initialized to %num. %current is the index into the %locs array of the current guess: locs[current]. The %state array is used to determine the validity of each guess. It is of size 81, and is initialized by setting the unknowns to 0 and the knowns to their input values.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bytedeco.javacpp.Pointer
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
current()
index into %locs of current locationcurrent
(int setter) int
failure()
set to 1 if no solution is possiblefailure
(int setter) int
finished()
set to 1 when solvedfinished
(int setter) getPointer
(long i) init()
the unknownsinit
(IntPointer setter) locs()
location of unknownslocs
(IntPointer setter) int
nguess()
shows current number of guessesnguess
(int setter) int
num()
number of unknownsnum
(int setter) position
(long position) state()
guesses of unknowns up to %currentstate
(IntPointer setter) Methods inherited from class org.bytedeco.javacpp.Pointer
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getDirectBufferAddress, getPointer, getPointer, getPointer, hashCode, interruptDeallocatorThread, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetAddress, offsetof, offsetof, parseBytes, physicalBytes, physicalBytesInaccurate, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, withDeallocator, zero
-
Constructor Details
-
L_SUDOKU
public L_SUDOKU()Default native constructor. -
L_SUDOKU
public L_SUDOKU(long size) Native array allocator. Access withPointer.position(long)
. -
L_SUDOKU
Pointer cast constructor. InvokesPointer(Pointer)
.
-
-
Method Details
-
position
-
getPointer
- Overrides:
getPointer
in classPointer
-
num
number of unknowns -
num
-
locs
location of unknowns -
locs
-
current
index into %locs of current location -
current
-
init
the unknowns -
init
-
state
guesses of unknowns up to %current -
state
-
nguess
shows current number of guesses -
nguess
-
finished
set to 1 when solved -
finished
-
failure
set to 1 if no solution is possible -
failure
-