Package net.sourceforge.lept4j
Class L_Sudoku
- java.lang.Object
-
- com.sun.jna.Structure
-
- net.sourceforge.lept4j.L_Sudoku
-
- Direct Known Subclasses:
L_Sudoku.ByReference
,L_Sudoku.ByValue
public class L_Sudoku extends com.sun.jna.Structure
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.
native declaration : sudoku.h:24
This file was autogenerated by JNAerator,
a tool written by Olivier Chafik that uses a few opensource projects..
For help, please visit NativeLibs4Java or JNA.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
L_Sudoku.ByReference
static class
L_Sudoku.ByValue
-
Field Summary
Fields Modifier and Type Field Description int
current
index into @locs of current location
C type : l_int32int
failure
set to 1 if no solution is possible
C type : l_int32int
finished
set to 1 when solved
C type : l_int32com.sun.jna.ptr.IntByReference
init
initial state, with 0 representing
C type : l_int32*com.sun.jna.ptr.IntByReference
locs
location of unknowns
C type : l_int32*int
nguess
shows current number of guesses
C type : l_int32int
num
number of unknowns
C type : l_int32com.sun.jna.ptr.IntByReference
state
present state, including inits and
C type : l_int32*
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.List<?>
getFieldOrder()
-
Methods inherited from class com.sun.jna.Structure
allocateMemory, allocateMemory, autoAllocate, autoRead, autoRead, autoWrite, autoWrite, cacheTypeInfo, clear, ensureAllocated, equals, fieldOffset, getAutoRead, getAutoWrite, getFieldList, getFields, getNativeAlignment, getNativeSize, getNativeSize, getPointer, getStringEncoding, getStructAlignment, hashCode, newInstance, newInstance, read, readField, readField, setAlignType, setAutoRead, setAutoSynch, setAutoWrite, setFieldOrder, setStringEncoding, size, sortFields, toArray, toArray, toString, toString, useMemory, useMemory, write, writeField, writeField, writeField
-
-
-
-
Field Detail
-
num
public int num
number of unknowns
C type : l_int32
-
locs
public com.sun.jna.ptr.IntByReference locs
location of unknowns
C type : l_int32*
-
current
public int current
index into @locs of current location
C type : l_int32
-
init
public com.sun.jna.ptr.IntByReference init
initial state, with 0 representing
C type : l_int32*
-
state
public com.sun.jna.ptr.IntByReference state
present state, including inits and
C type : l_int32*
-
nguess
public int nguess
shows current number of guesses
C type : l_int32
-
finished
public int finished
set to 1 when solved
C type : l_int32
-
failure
public int failure
set to 1 if no solution is possible
C type : l_int32
-
-
Constructor Detail
-
L_Sudoku
public L_Sudoku()
-
L_Sudoku
public L_Sudoku(int num, com.sun.jna.ptr.IntByReference locs, int current, com.sun.jna.ptr.IntByReference init, com.sun.jna.ptr.IntByReference state, int nguess, int finished, int failure)
- Parameters:
num
- number of unknowns
C type : l_int32locs
- location of unknowns
C type : l_int32*current
- index into @locs of current location
C type : l_int32init
- initial state, with 0 representing
C type : l_int32*state
- present state, including inits and
C type : l_int32*nguess
- shows current number of guesses
C type : l_int32finished
- set to 1 when solved
C type : l_int32failure
- set to 1 if no solution is possible
C type : l_int32
-
L_Sudoku
public L_Sudoku(com.sun.jna.Pointer peer)
-
-