David Campbell avatar David Campbell committed 7e4d362

Added some more classes for structs

Comments (0)

Files changed (2)

svmlight/svmlight.py

 svm = CDLL("./svmlight.so")
 
 class WORD(Structure):
-	_fields_ = [("wnum", c_long),
+	_fields_ = [("wnum",   c_long),
 			    ("weight", c_float)]
 
 class SVECTOR(Structure):
-	_fields_ = [("words", POINTER(WORD)),
-			    ("twonorm_sq", c_double),
+	_fields_ = [("words",       POINTER(WORD)),
+			    ("twonorm_sq",  c_double),
 				("userdefined", c_char),
-				("kernel_id", c_long),
-				("next", POINTER(SVECTOR),
-				("factor", c_double)]
+				("kernel_id",   c_long),
+				("next",        POINTER(SVECTOR),
+				("factor",      c_double)]
 
 
 class DOC(Structure):
-	_fields_ = [("docnum", c_long),
-			    ("queryid", c_long),
+	_fields_ = [("docnum",     c_long),
+			    ("queryid",    c_long),
 				("costfactor", c_double),
-				("slackid", c_long),
-				("fvec", POINTER(SVECTOR))]
+				("slackid",    c_long),
+				("fvec",       POINTER(SVECTOR))]
+
+class QP(Structure):
+	_fields_ = [("opt_n",     c_long),
+                ("opt_m",     c_long),
+                ("opt_ce",    POINTER(c_double)),
+                ("opt_ce0",   POINTER(c_double)),
+                ("opt_g",     POINTER(c_double)),
+                ("opt_g0",    POINTER(c_double)),
+                ("opt_xinit", POINTER(c_double)),
+                ("opt_low",   POINTER(c_double)),
+                ("opt_up",    POINTER(c_double))]
+
+class KERNEL_CACHE(Structure):
+  _fields_ = [("index",         POINTER(c_long)),
+              ("buffer",        POINTER(c_float)),
+              ("invindex",      POINTER(c_long)),
+              ("active2totdoc", POINTER(c_long)),
+              ("totdoc2active", POINTER(c_long)),
+              ("lru",           POINTER(c_long)),
+              ("occu",          POINTER(c_long)),
+              ("elems",         c_long),
+              ("max_elems",     c_long),
+              ("time",          c_long),
+              ("activenum",     c_long),
+              ("buffsize",      c_long)]
 
 
 if __name__ == "__main__":

svmlight/toconvert.txt

 ToDo:
 
-QP
-KERNEL_CACHE
 TIMING
 SHRINK_STATE
 
-
 Assigned to David:
 
 WORD
 SVECTOR
 DOC
 #defines from svm_common.h
+QP
+
+KERNEL_CACHE
 
 Assigned to Ceri:
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.