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.
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/interfaces inherited from class com.sun.jna.Structure
com.sun.jna.Structure.FieldOrder, com.sun.jna.Structure.StructField
-
Field Summary
Modifier and TypeFieldDescriptionint
index into @locs of current location
C type : l_int32int
set to 1 if no solution is possible
C type : l_int32int
set to 1 when solved
C type : l_int32com.sun.jna.ptr.IntByReference
initial state, with 0 representing
C type : l_int32*com.sun.jna.ptr.IntByReference
location of unknowns
C type : l_int32*int
shows current number of guesses
C type : l_int32int
number of unknowns
C type : l_int32com.sun.jna.ptr.IntByReference
present state, including inits and
C type : l_int32*Fields inherited from class com.sun.jna.Structure
ALIGN_DEFAULT, ALIGN_GNUC, ALIGN_MSVC, ALIGN_NONE, CALCULATE_SIZE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGets this Structure's field names in their proper order.Methods inherited from class com.sun.jna.Structure
allocateMemory, allocateMemory, autoAllocate, autoRead, autoRead, autoWrite, autoWrite, cacheTypeInfo, calculateSize, clear, createFieldsOrder, createFieldsOrder, createFieldsOrder, createFieldsOrder, dataEquals, dataEquals, ensureAllocated, equals, fieldOffset, getAutoRead, getAutoWrite, getFieldList, getFields, getNativeAlignment, getNativeSize, getNativeSize, getPointer, getStringEncoding, getStructAlignment, hashCode, newInstance, newInstance, read, readField, readField, setAlignType, setAutoRead, setAutoSynch, setAutoWrite, setStringEncoding, size, sortFields, toArray, toArray, toString, toString, useMemory, useMemory, write, writeField, writeField, writeField
-
Field Details
-
num
public int numnumber of unknowns
C type : l_int32 -
locs
public com.sun.jna.ptr.IntByReference locslocation of unknowns
C type : l_int32* -
current
public int currentindex into @locs of current location
C type : l_int32 -
init
public com.sun.jna.ptr.IntByReference initinitial state, with 0 representing
C type : l_int32* -
state
public com.sun.jna.ptr.IntByReference statepresent state, including inits and
C type : l_int32* -
nguess
public int nguessshows current number of guesses
C type : l_int32 -
finished
public int finishedset to 1 when solved
C type : l_int32 -
failure
public int failureset to 1 if no solution is possible
C type : l_int32
-
-
Constructor Details
-
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)
-
-
Method Details
-
getFieldOrder
Gets this Structure's field names in their proper order.- Overrides:
getFieldOrder
in classcom.sun.jna.Structure
- Returns:
- list of ordered field names
-