@Name(value="L_Sudoku") @Properties(inherit=leptonica.class) public class L_SUDOKU extends Pointer
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.
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
L_SUDOKU()
Default native constructor.
|
L_SUDOKU(long size)
Native array allocator.
|
L_SUDOKU(Pointer p)
Pointer cast constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
current()
index into %locs of current location
|
L_SUDOKU |
current(int setter) |
int |
failure()
set to 1 if no solution is possible
|
L_SUDOKU |
failure(int setter) |
int |
finished()
set to 1 when solved
|
L_SUDOKU |
finished(int setter) |
L_SUDOKU |
getPointer(long i) |
IntPointer |
init()
the unknowns
|
L_SUDOKU |
init(IntPointer setter) |
IntPointer |
locs()
location of unknowns
|
L_SUDOKU |
locs(IntPointer setter) |
int |
nguess()
shows current number of guesses
|
L_SUDOKU |
nguess(int setter) |
int |
num()
number of unknowns
|
L_SUDOKU |
num(int setter) |
L_SUDOKU |
position(long position) |
IntPointer |
state()
guesses of unknowns up to %current
|
L_SUDOKU |
state(IntPointer setter) |
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
public L_SUDOKU()
public L_SUDOKU(long size)
Pointer.position(long)
.public L_SUDOKU(Pointer p)
Pointer(Pointer)
.public L_SUDOKU getPointer(long i)
getPointer
in class Pointer
public L_SUDOKU num(int setter)
@Cast(value="l_int32*") public IntPointer locs()
public L_SUDOKU locs(IntPointer setter)
public L_SUDOKU current(int setter)
@Cast(value="l_int32*") public IntPointer init()
public L_SUDOKU init(IntPointer setter)
@Cast(value="l_int32*") public IntPointer state()
public L_SUDOKU state(IntPointer setter)
public L_SUDOKU nguess(int setter)
public L_SUDOKU finished(int setter)
public L_SUDOKU failure(int setter)
Copyright © 2024. All rights reserved.