Commit a7a5f644 authored by Liam Healy's avatar Liam Healy
Browse files

Port of ntuple to cbinfo form

In the previous conversion of callbacks, ntuple was somehow missed.
parent 8c0e6eb7
;; Definition of GSLL system
;; Liam Healy
;; Time-stamp: <2009-06-06 17:05:47EDT gsll.asd>
;; Time-stamp: <2009-06-07 08:33:27EDT gsll.asd>
;; $Id$
(when (asdf:find-system :fsbv nil)
......@@ -183,7 +183,8 @@
(:file "statistics" :depends-on (histogram))
(:file "operations" :depends-on (histogram))
(:file "probability-distribution" :depends-on (histogram))
(:file "ntuple")))
;;(:file "ntuple")
(:module calculus
:depends-on (init data random)
;; N-tuples
;; Liam Healy Sat Feb 3 2007 - 12:53
;; Time-stamp: <2008-08-17 09:39:34EDT ntuple.lisp>
;; Time-stamp: <2009-06-06 23:54:34EDT ntuple.lisp>
;; $Id$
(in-package :gsl)
;;; The basic definitions are here, but a smooth interface to CL
;;; has not been created, and it has not been tested.
;;; /usr/include/gsl/gsl_ntuple.h
;;; This requires two callback structs in :callbacks.
;;; Writing a file
(defmfun create-ntuple (filename data size)
......@@ -59,14 +61,18 @@
((ntuple :pointer))
:documentation ; FDL
"Closes the ntuple file ntupe and frees its
associated allocated memory.")
"Closes the ntuple file and frees its associated allocated memory.")
;;; Histogramming ntuple values
(defmfun project-ntuple (histogram ntuple value-function select-function)
((histogram :pointer) (ntuple :pointer)
(value-function :pointer) (select-function :pointer))
(valfn :pointer) (selfn :pointer))
(valfn fnstruct nil (function :pointer (:input :pointer) :slug))
;; Need a second cbstruct definition:
;;(selfn fnstruct nil (function :pointer (:input :pointer) :slug))
:callback-dynamic (nil (function))
:documentation ; FDL
"Update the histogram the ntuple
using the functions value-function and select-function. For each
......@@ -79,19 +85,14 @@
;;; Callback definitions
(export '(def-ntuple-select-function def-ntuple-value-function))
(defmacro def-ntuple-select-function (name arg)
;; FDL
"The selection function determines which ntuple rows are selected
for histogramming. The struct component function should return a
non-zero value for each ntuple row that is to be included in the
histogram. "
`(def-single-function ,name ,arg :int :pointer))
(defmacro def-ntuple-value-function (name arg)
;; FDL
"The value function computes scalar values for those ntuple rows
selected by the selection function which should return the value
to be added to the histogram."
`(def-single-function ,name ,arg :double :pointer))
;; GSL structures for holding functions
;; Liam Healy 2009-04-04 22:15:56EDT callback-struct.lisp
;; Time-stamp: <2009-06-06 10:50:41EDT callback-struct.lisp>
;; Time-stamp: <2009-06-06 21:48:50EDT callback-struct.lisp>
(define "_GNU_SOURCE")
......@@ -10,6 +10,8 @@
(include "gsl/gsl_math.h")
;;; Only the function
;;; also in /usr/include/gsl/gsl_ntuple.h as gsl_ntuple_select_fn and
;;; gsl_ntuple_value_fn.
(cstruct fnstruct "gsl_function"
(function "function" :type :pointer)
(parameters "params" :type :pointer))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment