Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
gsll
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Antonio Juan
gsll
Commits
104e13ca
Commit
104e13ca
authored
14 years ago
by
Liam Healy
Browse files
Options
Downloads
Patches
Plain Diff
Generalize gref-mpointer-form to set values and fix documentation
parent
4d69bb66
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
data/both.lisp
+1
-4
1 addition, 4 deletions
data/both.lisp
init/callback.lisp
+6
-7
6 additions, 7 deletions
init/callback.lisp
init/funcallable.lisp
+11
-7
11 additions, 7 deletions
init/funcallable.lisp
init/mobject.lisp
+2
-2
2 additions, 2 deletions
init/mobject.lisp
with
20 additions
and
20 deletions
data/both.lisp
+
1
−
4
View file @
104e13ca
;; Functions for both vectors and matrices.
;; Functions for both vectors and matrices.
;; Liam Healy 2008-04-26 20:48:44EDT both.lisp
;; Liam Healy 2008-04-26 20:48:44EDT both.lisp
;; Time-stamp: <2010-07-
06 22
:37:
34
EDT both.lisp>
;; Time-stamp: <2010-07-
11 18
:37:
28
EDT both.lisp>
;;
;;
;; Copyright 2008, 2009 Liam M. Healy
;; Copyright 2008, 2009 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
;; Distributed under the terms of the GNU General Public License
...
@@ -78,9 +78,6 @@
...
@@ -78,9 +78,6 @@
"Exchange the elements of a and b
"Exchange the elements of a and b
by copying. The two must have the same dimensions."
)
by copying. The two must have the same dimensions."
)
;;; These functions are here as debugging tools only; they do not insure
;;; coherency between the C and CL sides and therefore should not be
;;; used in production.
;;; For matrix functions, there should be another index argument
;;; For matrix functions, there should be another index argument
#|
#|
(defmfun set-value ((object vector) index value)
(defmfun set-value ((object vector) index value)
...
...
This diff is collapsed.
Click to expand it.
init/callback.lisp
+
6
−
7
View file @
104e13ca
;; Foreign callback functions.
;; Foreign callback functions.
;; Liam Healy
;; Liam Healy
;; Time-stamp: <2010-0
6-29 22:5
1:1
9
EDT callback.lisp>
;; Time-stamp: <2010-0
7-11 19:0
1:1
7
EDT callback.lisp>
;;
;;
;; Copyright 2009 Liam M. Healy
;; Copyright 2009 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
;; Distributed under the terms of the GNU General Public License
...
@@ -37,14 +37,13 @@
...
@@ -37,14 +37,13 @@
;;; they are defined with those tasks. The macro #'defmcallback can
;;; they are defined with those tasks. The macro #'defmcallback can
;;; specify that the CL function is to expect in arglist and return as
;;; specify that the CL function is to expect in arglist and return as
;;; multiple values scalar quantities that come from and will be bound
;;; multiple values scalar quantities that come from and will be bound
;;; to either grid:foreign-arrays
or C vectors
. This is done with a list of the
;;; to either grid:foreign-arrays. This is done with a list of the
;;; type and size, e.g. (:double 3), and for setting :set, type size,
;;; type and size, e.g. (:double 3), and for setting :set, type size,
;;; e.g. (:set :double 3). If the 'grid:foreign-array argument is nil, it will
;;; e.g. (:set :double 3). These can read either :cvector or
;;; expand to read or set a C vector; if it is T, it will expand to
;;; :foreign-array. This allows the user to define ordinary CL
;;; read or set a grid:foreign-array. This allows the user to define ordinary CL
;;; functions with scalars as input and output. However, it may be
;;; functions with scalars as input and output. However, it may be
;;; desirable to read and set grid:foreign-arrays, in which case
:pointer is the
;;; desirable to read and set grid:foreign-arrays, in which case
;;; right specification.
;;;
:pointer is the
right specification.
;;;;****************************************************************************
;;;;****************************************************************************
;;;; Setting slots
;;;; Setting slots
...
...
This diff is collapsed.
Click to expand it.
init/funcallable.lisp
+
11
−
7
View file @
104e13ca
;; Generate a lambda that calls the user function; will be called by callback.
;; Generate a lambda that calls the user function; will be called by callback.
;; Liam Healy
;; Liam Healy
;; Time-stamp: <2010-07-1
0 22:18:51
EDT funcallable.lisp>
;; Time-stamp: <2010-07-1
1 18:12:29
EDT funcallable.lisp>
;;
;;
;; Copyright 2009 Liam M. Healy
;; Copyright 2009
, 2010
Liam M. Healy
;; Distributed under the terms of the GNU General Public License
;; Distributed under the terms of the GNU General Public License
;;
;;
;; This program is free software: you can redistribute it and/or modify
;; This program is free software: you can redistribute it and/or modify
...
@@ -66,13 +66,17 @@
...
@@ -66,13 +66,17 @@
;;;;****************************************************************************
;;;;****************************************************************************
(
defun
gref-mpointer-form
(
defun
gref-mpointer-form
(
mpointer
index
&optional
(
category
'vector
)
(
element-type
'double-float
))
(
mpointer
index
&optional
value
(
category
'vector
)
(
element-type
'double-float
))
"Create the call that will return an element from a GSL array mpointer."
"Create the call that will return an element from a GSL array mpointer,
or set it to value if value is non-NIL."
(
ffexpand
(
ffexpand
nil
nil
(
actual-gsl-function-name
(
actual-gsl-function-name
'
(
"gsl_"
:category
:type
"_get"
)
category
element-type
)
`
(
"gsl_"
:category
:type
,
(
if
value
"_set"
"_get"
))
`
(
:pointer
,
mpointer
sizet
,
index
,
element-type
)))
category
element-type
)
(
if
value
`
(
:pointer
,
mpointer
sizet
,
index
,
element-type
,
value
:void
)
`
(
:pointer
,
mpointer
sizet
,
index
,
element-type
))))
(
defun
reference-foreign-element
(
defun
reference-foreign-element
(
foreign-variable-name
linear-index
argspec
dimension-values
)
(
foreign-variable-name
linear-index
argspec
dimension-values
)
...
@@ -92,7 +96,7 @@
...
@@ -92,7 +96,7 @@
(
parse-callback-argspec
argspec
'element-type
))
(
parse-callback-argspec
argspec
'element-type
))
;; A vector
;; A vector
(
gref-mpointer-form
(
gref-mpointer-form
foreign-variable-name
linear-index
'vector
foreign-variable-name
linear-index
nil
'vector
(
parse-callback-argspec
argspec
'element-type
)))
(
parse-callback-argspec
argspec
'element-type
)))
`
(
cffi:mem-aref
`
(
cffi:mem-aref
,
foreign-variable-name
,
foreign-variable-name
...
...
This diff is collapsed.
Click to expand it.
init/mobject.lisp
+
2
−
2
View file @
104e13ca
;; Definition of GSL objects and ways to use them.
;; Definition of GSL objects and ways to use them.
;; Liam Healy, Sun Dec 3 2006 - 10:21
;; Liam Healy, Sun Dec 3 2006 - 10:21
;; Time-stamp: <2010-07-
07 14:30:3
0EDT mobject.lisp>
;; Time-stamp: <2010-07-
11 17:07:4
0EDT mobject.lisp>
;;
;;
;; Copyright 2006, 2007, 2008, 2009 Liam M. Healy
;; Copyright 2006, 2007, 2008, 2009 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
;; Distributed under the terms of the GNU General Public License
...
@@ -62,7 +62,7 @@
...
@@ -62,7 +62,7 @@
;;; allocate-inputs
;;; allocate-inputs
;;; freer
;;; freer
;;; callbacks
;;; callbacks
;;; See callback
s
.lisp
;;; See callback.lisp
;;; superclasses
;;; superclasses
;;; List of superclasses other than 'mobject.
;;; List of superclasses other than 'mobject.
;;; singular
;;; singular
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment