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
4fef622b
Commit
4fef622b
authored
15 years ago
by
Liam Healy
Browse files
Options
Downloads
Patches
Plain Diff
Removed iterate extension; it is now in the grid system
parent
f7103228
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
data/iterate.lisp
+0
-123
0 additions, 123 deletions
data/iterate.lisp
gsll.asd
+1
-9
1 addition, 9 deletions
gsll.asd
with
1 addition
and
132 deletions
data/iterate.lisp
deleted
100644 → 0
+
0
−
123
View file @
f7103228
;; Iterate
;; Norman Werner 2009-05-26 22:23:40EDT iterate.lisp
;; Time-stamp: <2009-12-27 09:42:05EST iterate.lisp>
;;
;; Copyright 2009 Norman Werner, Liam M. Healy
;; Distributed under the terms of the GNU General Public License
;;
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
(
in-package
:iter
)
#|
As an example try:
(defparameter m1 #m(1 2 3 ^ 0 6 8))
(iter:iter (iter:for e :matrix-element m1) (princ e) (princ " "))
(iter:iter (iter:for (row column) :matrix-element-index m1)
(princ (gsll:maref m1 row column)) (princ " "))
|#
(
defclause-sequence
matrix-row
matrix-row-index
:access-fn
(
lambda
(
marray
index
)
(
check-type
marray
gsl:matrix
)
(
gsll:row
marray
index
))
:size-fn
(
lambda
(
marray
)
(
check-type
marray
gsl:matrix
)
(
c-array:dim0
marray
))
:element-type
t
:sequence-type
t
:element-doc-string
"(copied) rows of a matrix"
:index-doc-string
"index of the rows in a matrix"
)
(
defclause-sequence
matrix-column
matrix-column-index
:access-fn
(
lambda
(
marray
index
)
(
check-type
marray
gsl:matrix
)
(
gsll:column
marray
index
))
:size-fn
(
lambda
(
marray
)
(
check-type
marray
gsl:matrix
)
(
c-array:dim1
marray
))
:element-type
t
:sequence-type
t
:element-doc-string
"(copied) columns of a matrix"
:index-doc-string
"index of the columns in a matrix"
)
(
defclause-sequence
vector-element
vector-element-index
:access-fn
(
lambda
(
vector
index
)
(
check-type
vector
gsl:mvector
)
(
gsll:maref
vector
index
))
:size-fn
(
lambda
(
vector
)
(
check-type
vector
gsl:mvector
)
(
c-array:dim0
vector
))
:element-type
t
:sequence-type
t
:element-doc-string
"(copied) elements of a vector"
:index-doc-string
"index of elements in a vector"
)
(
defmacro-driver
(
FOR
element
matrix-element
matrix
)
"Iterates over all (copied) elements in matrix"
(
cl-utilities:with-unique-names
(
row-index
col-index
row-size
col-size
m
)
(
when
generate
(
error
"Not yet implemented a generate clause for matrix-element."
))
`
(
progn
(
with
,
m
=
,
matrix
)
(
with
,
row-index
=
0
)
(
with
,
col-index
=
0
)
(
with
,
row-size
=
(
c-array:dim0
,
m
))
(
with
,
col-size
=
(
c-array:dim1
,
m
))
(
for
,
element
:next
(
if
(
>=
,
row-index
,
row-size
)
(
terminate
)
(
if
(
>=
,
col-index
,
col-size
)
(
progn
(
setf
,
col-index
0
)
(
incf
,
row-index
)
(
if
(
>=
,
row-index
,
row-size
)
(
terminate
)
(
gsl:maref
,
m
,
row-index
,
col-index
)))
(
prog1
(
gsl:maref
,
m
,
row-index
,
col-index
)
(
incf
,
col-index
))))))))
(
defmacro-driver
(
FOR
indexes
matrix-element-index
matrix
)
"Iterates over the indexes in matrix. indexes is a list like (row-index-name
column-index-name) "
(
cl-utilities:with-unique-names
(
row-index
col-index
row-size
col-size
m
)
(
when
generate
(
error
"Not yet implemented a generate clause for matrix-element-index."
))
`
(
progn
(
with
,
m
=
,
matrix
)
(
with
,
row-index
=
0
)
(
with
,
col-index
=
0
)
(
with
,
row-size
=
(
c-array:dim0
,
m
))
(
with
,
col-size
=
(
c-array:dim1
,
m
))
(
for
,
indexes
next
(
if
(
>=
,
row-index
,
row-size
)
(
terminate
)
(
if
(
>=
,
col-index
,
col-size
)
(
progn
(
setf
,
col-index
0
)
(
incf
,
row-index
)
(
if
(
>=
,
row-index
,
row-size
)
(
terminate
)
(
list
,
row-index
,
col-index
)))
(
prog1
(
list
,
row-index
,
col-index
)
(
incf
,
col-index
))))))))
This diff is collapsed.
Click to expand it.
gsll.asd
+
1
−
9
View file @
4fef622b
;; Definition of GSLL system
;; Liam Healy
;; Time-stamp: <2010-0
1
-0
1
1
2:19:3
0EST gsll.asd>
;; Time-stamp: <2010-0
2
-0
7
1
6:58:1
0EST gsll.asd>
;;
;; Copyright 2006, 2007, 2008, 2009 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
...
...
@@ -266,11 +266,3 @@
((
cffi-grovel:grovel-file
"mksa"
)
(
cffi-grovel:grovel-file
"cgsm"
)
(
:file
export
)))))
#+
asdf-system-connections
(
asdf:defsystem-connection
gsll-iterate-extension
:requires
(
gsll
iterate
)
:components
((
:module
"gsll-iterate"
:pathname
"data/"
:components
((
:file
"iterate"
)))))
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