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 
     
    static class 
     

    Nested classes/interfaces inherited from class com.sun.jna.Structure

    com.sun.jna.Structure.FieldOrder, com.sun.jna.Structure.StructField
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    int
    index into @locs of current location
    C type : l_int32
    int
    set to 1 if no solution is possible
    C type : l_int32
    int
    set to 1 when solved
    C type : l_int32
    com.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_int32
    int
    number of unknowns
    C type : l_int32
    com.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

    Constructors
    Constructor
    Description
     
    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)
     
    L_Sudoku​(com.sun.jna.Pointer peer)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected List<String>
    Gets 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

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • 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 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_int32
      locs - location of unknowns
      C type : l_int32*
      current - index into @locs of current location
      C type : l_int32
      init - 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_int32
      finished - set to 1 when solved
      C type : l_int32
      failure - 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

      protected List<String> getFieldOrder()
      Gets this Structure's field names in their proper order.
      Overrides:
      getFieldOrder in class com.sun.jna.Structure
      Returns:
      list of ordered field names