The spartns Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The spartns Reference Manual

This is the spartns Reference Manual, version 1.4.3, generated automatically by Declt version 2.3 "Robert April" on Tue Feb 20 09:22:39 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

1.1 spartns

Maintainer

Jeronimo Pellegrini

Author

Jeronimo Pellegrini

License

LLGPL

Description

SPARse TeNSor representation library

Version

1.4.3

Source

spartns.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

2 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

2.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

2.1.1 spartns.asd

Location

spartns.asd

Systems

spartns (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

2.1.2 spartns/spartns-packages.lisp

Parent

spartns (system)

Location

spartns-packages.lisp

Packages

Next: , Previous: , Up: Lisp files   [Contents][Index]

2.1.3 spartns/utils.lisp

Dependency

spartns-packages.lisp (file)

Parent

spartns (system)

Location

utils.lisp

Exported Definitions
Internal Definitions

Previous: , Up: Lisp files   [Contents][Index]

2.1.4 spartns/spartns.lisp

Dependency

utils.lisp (file)

Parent

spartns (system)

Location

spartns.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

3 Packages

Packages are listed by definition order.


Next: , Previous: , Up: Packages   [Contents][Index]

3.1 spartns

Source

spartns-packages.lisp (file)

Use List
Exported Definitions
Internal Definitions

Previous: , Up: Packages   [Contents][Index]

3.2 jp-utils

Source

spartns-packages.lisp (file)

Use List

common-lisp

Used By List

spartns

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

4.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

4.1.1 Macros

Macro: defscheme &key NAME TYPE MAKE GET SET DELETE TRAVERSE PACK CAPACITY COUNT

Adds a new representation scheme.
- name is the name of the scheme (a symbol)
- type is the Common Lisp type of an instance of this scheme. For example, if your scheme represents the mapping as a hashtable, then type is HASH-TABLE. If it is represented as a Lisp list, then it is LIST

All other parameters (make, get, set, delete, traverse, capacity, count) should contain the Lisp code necessary to perform these actions:

- make: the code necessary to create an instance of this scheme. If your code contains the symbols SIZE and ELEMENT-TYPE, they will be substituted for the actual values;
- get: code necessary to access one element. Symbols that are substituted: DATA, INDEX, SPARSE-ELEMENT. It should return TWO VALUES:
+ the retrieved element (the sparse element, if the index was not found);
+ either T or NIL, depending on wether the element was found or not.
For example, (IF found (VALUES element T)
(VALUES sparse NIL));
- set: code to set one position. Substituted symbols: DATA, INDEX, VALUE, ELEMENT-TYPE
- delete: code to remove one element. Substituted symbols: DATA, INDEX, SPARSE-ELEMENT, ELEMENT-TYPE;
- traverse: code to traverse the structure, binding variables to the index and value while executing a body of code. Substituted symbols: INDEX, VALUE, DATA, ELEMENT-TYPE, BODY;
- pack: code that packs the container, releasing non-used memory;
- capacity: code that returns the maximum number of elements that the instance can handle. Substituted symbols: DATA;
- count: code to return the actual number of non-zero elements. Substituted symbols: DATA.

The macro will return the name of the newly created scheme.

For example:
(defscheme :name hash
:type HASH-TABLE
:make (let () (declare (ignore element-type)) (make-hash-table :size size)) :get (gethash index data sparse-element)
:set (setf (gethash index data) value)
:delete (remhash index data)
:traverse (do-traverse-hash (index value data) body)
:pack (values) ; we don’t write code for shrinking a hashtable!
:capacity (let () (declare (ignore data)) most-positive-fixnum)
:count (hash-table-count data))

In the example, the make function ignores ELEMENT-TYPE (because hashtables ignore them).

However, you should NOT try to make the code ignore symbols by using, for example,
(let () (declare (ignore element-type)) (make-hash-table :size size))
because the element-type inside DECLARE will be substituted.

Since the make function returns an object of type HASH-TABLE, then this is the value passed to the type parameter.

The capacity code always returns most-positive-fixnum, since hashtables can grow.

Package

spartns

Source

spartns.lisp (file)

Macro: defspartn NAME &key REPRESENTATION NON-ZERO ELEMENT-TYPE SPARSE-ELEMENT TEST-EQUAL RESIZE-FUNCTION RESIZE-AMOUNT DEF DECLARE

Defines a new spartn scheme.
If the DEF parameter is not NIL, then functions and macros will be created to access the spartn
scheme.

If the name of the new scheme is X, then the following functions will be defined:
- (MAKE-X)
- (GET-X tensor index)
- (SET-X tensor index value)
- (DELETE-X tensor index)
- (PACK-X tensor)
- (COPY-X tensor)
The macro (TRAVERSE-X index-list value tensor body) will also be defined.

NON-ZERO is just a hint so that containers in each dimension will be created with approximately
this size. It is not a hard limit, and there is no guarantee that this will actually be the size
of the containers.

RESIZE-FUNCTION is a function that tells the amount by which container sizes is increased.
The default value is (lambda (x) 200). This may or may not be used, depending on the representation scheme.

The default value of DEF is T. You can set it to NIL if you want to use w/spartns (which will create the same macros and functions locally anyway).

The parameter DECLARE is used to include declarations inside the defined functions. By default it is (optimize (speed 3) (safety 1)).

Package

spartns

Source

spartns.lisp (file)

Macro: do-sequence (IDX SEQ) &rest BODY

Runs across a sequence (syntatic sugar).

Package

jp-utils

Source

utils.lisp (file)

Macro: fast-binary-search THE-ELEMENT VECTOR &key ELEMENT-TYPE TEST= TEST< GET-ELEMENT START END NOT-FOUND

This is binary search with type declarations. It’s similar to the binary-search function.

Package

jp-utils

Source

utils.lisp (file)

Macro: get-binary-search &key ELEMENT-TYPE TEST= TEST< GET-ELEMENT NOT-FOUND

This function returns a function (with type declarations) that will perform binary search.

Package

jp-utils

Source

utils.lisp (file)

Macro: spartn-convert OLD-DATA &key FROM TO DESTRUCTIVE

Returns a new spartn using a different representation but with the same contents as the one given. from and to must be the names of the representation schemes (symbols, not strings).

Example:

(defspartn hashhash
:representation ’(hash hash)
...)

(defspartn
:representation ’(hash cvector)
...)

(let ((mat (make-hashash)))
(let ((mat2 (spartn-convert mat :from hashash :to hashcvec)))
(get-hashvec mat2 ’(2 3))))

Here MAT uses spartn scheme HASHHASH, which represents the tensor as a hashtable of hashtables. MAT2 is obtained by converting MAT to scheme HASHCVEC, which represents the tensor as a hashtable of compressed vectors.

Package

spartns

Source

spartns.lisp (file)

Macro: w/fast-traversals TRAVERSAL-LIST &body BODY

Builds a structure of the type SPARTN-FAST-TRAVERSAL and calls do-fast-traversal
to actually run through it.

(spartns:w/fast-traversals ((2d-matrix m1 i j val-1)
(2d-matrix m2 x y val-2))
(set-2d-matrix prod
(+ (* i 5) x)
(+ (* j 5) y)
(* val-1 val-2)))
==>

(LET ((#:POSITION-830 0)
(#:ARRAY-VAL-1-831 (MAKE-ARRAY 1000 :ELEMENT-TYPE ’NUMBER))
(#:ARRAY-VAL-2-832 (MAKE-ARRAY 1000 :ELEMENT-TYPE ’NUMBER))
(#:ARRAY-I-833 (MAKE-ARRAY 1000 :ELEMENT-TYPE ’FIXNUM))
(#:ARRAY-J-834 (MAKE-ARRAY 1000 :ELEMENT-TYPE ’FIXNUM))
(#:ARRAY-X-835 (MAKE-ARRAY 1000 :ELEMENT-TYPE ’FIXNUM))
(#:ARRAY-Y-836 (MAKE-ARRAY 1000 :ELEMENT-TYPE ’FIXNUM)))
(DECLARE (TYPE FIXNUM #:POSITION-830)
(TYPE (SIMPLE-ARRAY NUMBER (*)) #:ARRAY-VAL-1-831)
(TYPE (SIMPLE-ARRAY NUMBER (*)) #:ARRAY-VAL-2-832)
(TYPE (SIMPLE-ARRAY FIXNUM (*)) #:ARRAY-I-833)
(TYPE (SIMPLE-ARRAY FIXNUM (*)) #:ARRAY-J-834)
(TYPE (SIMPLE-ARRAY FIXNUM (*)) #:ARRAY-X-835)
(TYPE (SIMPLE-ARRAY FIXNUM (*)) #:ARRAY-Y-836))
;; w/spartn-traversals will go make the traversal we’d like to do
;; repeatedly; we’ll store the indices AND values:
(SPARTNS:W/SPARTN-TRAVERSALS
((2D-MATRIX M1 I J VAL-1) (2D-MATRIX M2 X Y VAL-2))
(SETF (AREF (THE (SIMPLE-ARRAY NUMBER (*)) #:ARRAY-VAL-1-831) #:POSITION-830) VAL-1) (SETF (AREF (THE (SIMPLE-ARRAY NUMBER (*)) #:ARRAY-VAL-2-832) #:POSITION-830) VAL-2) (SETF (AREF (THE (SIMPLE-ARRAY FIXNUM (*)) #:ARRAY-I-833) #:POSITION-830) I)
(SETF (AREF (THE (SIMPLE-ARRAY FIXNUM (*)) #:ARRAY-J-834) #:POSITION-830) J)
(SETF (AREF (THE (SIMPLE-ARRAY FIXNUM (*)) #:ARRAY-X-835) #:POSITION-830) X)
(SETF (AREF (THE (SIMPLE-ARRAY FIXNUM (*)) #:ARRAY-Y-836) #:POSITION-830) Y)
(INCF #:POSITION-830)
;; (car array-names): all ararys have the same size. If the first one is
;; full, increase the size of all of them:
(WHEN (>= #:POSITION-830 (THE FIXNUM (LENGTH #:ARRAY-VAL-1-831)))
(SETF #:ARRAY-VAL-1-831
(JP-UTILS:ROBUST-ADJUST-ARRAY #:ARRAY-VAL-1-831
(THE FIXNUM (+ 1000 #:POSITION-830))
:ELEMENT-TYPE (ARRAY-ELEMENT-TYPE #:ARRAY-VAL-1-831)))
(SETF #:ARRAY-VAL-2-832
(JP-UTILS:ROBUST-ADJUST-ARRAY #:ARRAY-VAL-2-832
(THE FIXNUM (+ 1000 #:POSITION-830))
:ELEMENT-TYPE (ARRAY-ELEMENT-TYPE #:ARRAY-VAL-2-832)))
(SETF #:ARRAY-I-833
(JP-UTILS:ROBUST-ADJUST-ARRAY #:ARRAY-I-833
(THE FIXNUM (+ 1000 #:POSITION-830))
:ELEMENT-TYPE
(ARRAY-ELEMENT-TYPE #:ARRAY-I-833)))
(SETF #:ARRAY-J-834
(JP-UTILS:ROBUST-ADJUST-ARRAY #:ARRAY-J-834
(THE FIXNUM (+ 1000 #:POSITION-830))
:ELEMENT-TYPE (ARRAY-ELEMENT-TYPE #:ARRAY-J-834)))
(SETF #:ARRAY-X-835
(JP-UTILS:ROBUST-ADJUST-ARRAY #:ARRAY-X-835
(THE FIXNUM (+ 1000 #:POSITION-830))
:ELEMENT-TYPE (ARRAY-ELEMENT-TYPE #:ARRAY-X-835)))
(SETF #:ARRAY-Y-836
(JP-UTILS:ROBUST-ADJUST-ARRAY #:ARRAY-Y-836
(THE FIXNUM (+ 1000 #:POSITION-830))
:ELEMENT-TYPE (ARRAY-ELEMENT-TYPE #:ARRAY-Y-836)))))
;; position now holds the size of the final traversal, so we adjust all arrays to that
;; size:
(SETQ #:ARRAY-VAL-1-831
(JP-UTILS:ROBUST-ADJUST-ARRAY #:ARRAY-VAL-1-831 #:POSITION-830
:ELEMENT-TYPE (ARRAY-ELEMENT-TYPE #:ARRAY-VAL-1-831)))
(SETQ #:ARRAY-VAL-2-832
(JP-UTILS:ROBUST-ADJUST-ARRAY #:ARRAY-VAL-2-832 #:POSITION-830
:ELEMENT-TYPE (ARRAY-ELEMENT-TYPE #:ARRAY-VAL-2-832)))
(SETQ #:ARRAY-I-833
(JP-UTILS:ROBUST-ADJUST-ARRAY #:ARRAY-I-833 #:POSITION-830
:ELEMENT-TYPE (ARRAY-ELEMENT-TYPE #:ARRAY-I-833)))
(SETQ #:ARRAY-J-834
(JP-UTILS:ROBUST-ADJUST-ARRAY #:ARRAY-J-834 #:POSITION-830
:ELEMENT-TYPE (ARRAY-ELEMENT-TYPE #:ARRAY-J-834)))
(SETQ #:ARRAY-X-835
(JP-UTILS:ROBUST-ADJUST-ARRAY #:ARRAY-X-835 #:POSITION-830
:ELEMENT-TYPE (ARRAY-ELEMENT-TYPE #:ARRAY-X-835)))
(SETQ #:ARRAY-Y-836
(JP-UTILS:ROBUST-ADJUST-ARRAY #:ARRAY-Y-836 #:POSITION-830
:ELEMENT-TYPE (ARRAY-ELEMENT-TYPE #:ARRAY-Y-836)))
(SYMBOL-MACROLET ((VAL-1 (AREF (THE (SIMPLE-ARRAY NUMBER (*)) #:ARRAY-VAL-1-831) #:INDEX-837)) (VAL-2 (AREF (THE (SIMPLE-ARRAY NUMBER (*)) #:ARRAY-VAL-2-832) #:INDEX-837)) (I (AREF (THE (SIMPLE-ARRAY FIXNUM (*)) #:ARRAY-I-833) #:INDEX-837)) (J (AREF (THE (SIMPLE-ARRAY FIXNUM (*)) #:ARRAY-J-834) #:INDEX-837)) (X (AREF (THE (SIMPLE-ARRAY FIXNUM (*)) #:ARRAY-X-835) #:INDEX-837)) (Y (AREF (THE (SIMPLE-ARRAY FIXNUM (*)) #:ARRAY-Y-836) #:INDEX-837))) (LOOP FOR #:INDEX-837 BELOW (LENGTH #:ARRAY-VAL-1-831) DO
(SET-2D-MATRIX PROD (+ (* I 5) X) (+ (* J 5) Y) (* VAL-1 VAL-2)))))

*NOTE*: When you do a fast-traversal, you are NOT operating on the original structures anymore, but on a copy (see the code above).

Package

spartns

Source

spartns.lisp (file)

Macro: w/spartn-traversals TRAVERSAL-LIST &body BODY

Traverses several tensors, possibly synchronizing indices. For example:

(w/spartn-traversals ((A data-a i j k l val-a)
(B data-b i j k val-b)
...)

Will traverse data-a and data-b (of type A and B respectively), looping over l.

(w/spartn-traversals ((A data-a i j k l val-a)
(B data-b a b i j val-b)
(C data-c i a m n val-c :dont-bind (b m)))
...)

Will traverse data-a, data-b and data-c, but the only entries will be those such that the first index on data-a and data-c are equal to that of the second index of data-b, and so on.

Package

spartns

Source

spartns.lisp (file)

Macro: w/spartns SPARTN-LIST &body BODY

Creates local definitions for functions and macros to access a spartn scheme.
These are the same functions and macros that DEFSPARTN creates if you pass it DEF=T.

This is useful if you don’t want the overhead of function calls (including boxing and unboxing of numbers). This macro will use LABELS and MACROLET to create the functions and macros that access the spartns in spartn-list.

Example:
(defspartn xyz
...
:def nil)

(w/spartns (xyz)
(let ((s (make-xyz)))
(set-xyz s ’(0 0 0) 0.5)
...))

The w/spartns S-expression will be expanded into:
(labels ((make-xyz (...))
(get-xyz (...))
(set-xyz (...))
...)
(macrolet ((traverse-xyz ...))
(let ((s (make-xyz)))
(set-xyz s ’(0 0 0) 0.5)
...)))

Package

spartns

Source

spartns.lisp (file)

Macro: with-gensyms (&rest NAMES) &body BODY

Expands into code that binds all names to symbols generated by (gensym).

Package

jp-utils

Source

utils.lisp (file)


Previous: , Up: Exported definitions   [Contents][Index]

4.1.2 Functions

Function: binary-search THE-ELEMENT VECTOR &key TEST= TEST< GET-ELEMENT START END NOT-FOUND

Performs a binary search for an element el on a (sorted) array vec.
Return values:
- The index where the element was found
- Either t (if el was found) or nil (if el was not found) You can ask the function to return something else on failure.
Named parameters:
- get-element is the function used to retrieve an element of the vector. The default is aref. This should be a FUNCTION, and not a symbol!
- start and end are the start and end indices within the array. If
they are not supplied, 0 and the last index will be used.
- test= and test-before are the tests to be used for equality and for determining precedence between elements. These should be FUNCTIONS, and not symbols!
- not-found is the element to be returned when the element is not found. If not-found is set to ’t’, then, in case of failure, the function will return (i NIL), where i is the index where the element *should* be (or where it could be inserted).
So, by default you can test the return inside an (if (binary-search) ...), since it returns either NIL or the position.

Package

jp-utils

Source

utils.lisp (file)

Function: counting-sort ()

Counting sort. Only works for arrays of fixnums.
data is the array. The elements in the array must range from zero to k. Optional parameters start and end can be used to specify a subrange of the array to be sorted, but then the new array will have zeroes in all other places (this will be fixed later).

This function returns the new array and the counting array, which tells where each each key starts in the new array.

Package

jp-utils

Source

utils.lisp (file)

Function: counting-sort-g ()

Generalized counting sort: it will sort data structures, provided that there
is a way to identify elements with fixnum keys.

Parameters:
===========
- data is the structure to be sorted.
- sorted-data is the new sorted structure, that needs to be previously allocated
(and be similar to data)
- k is the maximum key value. CAUTION: this function will allocate an array
of size k, so if it is too large, it may not work.
- start and end define the slice of the keys that will be sorted.
- The key function identifies array elements given a fixnum. By default
tihs is aref;
- The copy-element wihch will be used to copy elements among different posisions
needs to have four arguments:
+ new: the new data structure
+ new-i: the index in the new data structure
+ old: the old data structure
+ old-i: the index in the old data structure
So, given those, this function should copy an element from position old-i on
structure old to position new-i on structure new.

Return value and result:
========================

This function will return the counting array, which shows where in the new structure
each key begins:

(let ((new-data (make-array 12 :element-type ’fixnum)))
(counting-sort-g #(0 2 4 6 0 2 4 6 1 3 5 7) new-data 8 0 11))
=> #(0 2 3 5 6 8 9 11)

new-data #(0 0 1 2 2 3 4 4 5 6 6 7)
count vector: #(0 2 3 5 6 8 9 11)

Looking at the count vector, we see that the elements with key ’0’ start
at position ’0’ in the new structure; the elements with key ’1’ start
at position ’2’; elements with key ’2’ start at ’3’, etc, and elements
with key ’7’ start at the last position, ’11’.

Example:
========
;;; A structure contains two arrays:
(defstruct (two-arrays (conc-name ta))
array-one
array-two)

;;; Now we sort it, using the first array as the key array, and the second as
;;; the data array.
(counting-sort-g two-arrays
two-arrays-new
100
10
110
:key #’(lambda (data i) (aref (ta-array-one data) i))
:copy-element #’(lambda (new new-i old old-i)
(setf (aref (ta-array-one new) new-i) (aref (ta-array-one old) old-i) (aref (ta-array-two new) new-i) (aref (ta-array-two old) old-i))

Efficiency:
===========

If k is not large, this is much faster than Lisp’s built-in sort function, because it
does not rely on element comparison. cl:sort takes O(n lg n) time, counting-sort-g takes
O(n + k) time. On the other hand, it requires O(n + k) additional memory: besides the
argument sorted-data, which is provided by you, this function will also allocate an array
of size k.

For details, see:

- Cormen, Leiserson, Rivest and Stein: ’Introduction to algorithms’
- Berman and Paul, ’Algorithms: sequential, parallel, and distributed’
- Wikipedia:
+ http://en.wikipedia.org/wiki/Sorting_algorithm
+ http://en.wikipedia.org/wiki/Counting_sort

Because it is generic and works on any data structure, this function can be ten times
slower than the counting-sort function in this package, which works on arrays of fixnums
only.

Package

jp-utils

Source

utils.lisp (file)

Function: format-symbol STRING &rest ARGS
Package

jp-utils

Source

utils.lisp (file)

Function: format-uninterned-symbol STRING &rest ARGS
Package

jp-utils

Source

utils.lisp (file)

Function: generate-random-array SIZE RANGE-START RANGE-END

Generates an array of fixnums of size n, ranging from 0 to k

Package

jp-utils

Source

utils.lisp (file)

Function: hash-table-keys HASH

Returns a list with the keys of a hash table.

Package

jp-utils

Source

utils.lisp (file)

Function: robust-adjust-array ARRAY SIZE &key ELEMENT-TYPE

Adjusts the size of an array, setting it to the new one. Also works around
an issue with Allegro Common Lisp: in ACL, when you call adjust-array on a non-adjustable array, the resulting array is not necessarily of the same type. It is not a SIMPLE-ARRAY anymore. Dependig on how you try to fix it, you may end up with an array whose element-type is T. So, this is a method for resizing an array and keeping the same array type.

Yes, we want SIMPLE-ARRAYs because access is faster. But we also want to adjust them, even if adjusting is slow.

Package

jp-utils

Source

utils.lisp (file)

Function: sortedp SEQ &key TEST

Determines if a sequence is sorted. Will return (t size)
on success (where size is the size of the sequence) or
nil size), where size is the size of the largest sorted subsequence, from the beginning to the right.
For example:
(sortedp ’(10 20 30 40 1 100)) ==> (NIL, 4)
(sortedp #(10 20 30 40 50 100)) ==> (T, 6)
See that the size of the sorted sequence is always at least one, except for empty sequences, which are always sorted:
(sortedp ()) ==> (T, 0)

Package

jp-utils

Source

utils.lisp (file)

Function: subst-all SUBST-LIST TREE

Performs several substitutions on a tree (similar to what subst does). subst-list is a list of substitutions. For example:
(subst-all ’((a 1) (b 2) (c 3))
’(x y a (z b (u v c))))
=> (X Y 1 (Z 2 (U V 3)))

Package

jp-utils

Source

utils.lisp (file)


Previous: , Up: Definitions   [Contents][Index]

4.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

4.2.1 Special variables

Special Variable: *representation-schemes*

This variable holds a hashtable that maps names (symbols)
to representation schemes for sparse vectors. These are structures that map fixnums onto data of any type.

Package

spartns

Source

spartns.lisp (file)

Special Variable: *spartn-schemes*

This variable holds a hashtable which maps names onto spartn schemes.

Package

spartns

Source

spartns.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

4.2.2 Macros

Macro: do-traverse-cvector (INDEX VALUE CVEC &key ELEMENT-TYPE START END SETF) &body BODY

Traverses a cvector, binding variables to the index and value.

element-type is used in type declarations inside the code; start and end are used for indices; setf is a flag that makes the method use SYMBOL-MACROLET instead of LET for the value binding (it is on by default).

Example:
(macroexpand-1 ’(spartns::do-traverse-cvector (i v d) b))

==>

(LET ((#:FIXED-END-775 (1- (SPARTNS::CVECTOR-COUNT D))))
(LOOP SPARTNS::FOR #:I-774 FIXNUM SPARTNS::FROM 0 SPARTNS::TO #:FIXED-END-775 DO
(LET ((I (AREF (SPARTNS::CVECTOR-INDEX D) #:I-774))) (SYMBOL-MACROLET ((V
(AREF
(THE (SIMPLE-ARRAY T (*)) (SPARTNS::CVECTOR-VALUES D)) #:I-774)))
(DECLARE (TYPE T V) (TYPE FIXNUM I))
B))))
T

Package

spartns

Source

spartns.lisp (file)

Macro: get-cvec CV INDEX SPARSE-ELEMENT ELEMENT-TYPE TEST-EQUAL

Retrieves an element from a cvector, given its index.
If the element is found, returns (values element T).
If the element is not in the vector, returns (values sparse-element NIL) instead.

Package

spartns

Source

spartns.lisp (file)

Macro: make-new-cvector SIZE &key ELEMENT-TYPE SPARSE-ELEMENT

Makes a new (empty) cvector with maximum capacity equal to size.
The element-type parameter can be used to make the internal representation more efficient. The default element-type is T.

Package

spartns

Source

spartns.lisp (file)

Macro: pack-cvec CV ELEMENT-TYPE

Packs a cvector so cvector-count will be the same as cvector-max-capacity.

Package

spartns

Source

spartns.lisp (file)

Macro: resize-cvec CV ELEMENT-TYPE NEW-SIZE

Resizes a cvector, adjusting the arrays for values and indices

Package

spartns

Source

spartns.lisp (file)

Macro: set-cvec CV INDEX SPARSE-ELEMENT ELEMENT-TYPE VALUE RESIZE-FUNCTION

Sets an element in a cvector, given its index.
If the index is not in the vector, it is added, unless there is no more space left, in which case an error is signaled.

Package

spartns

Source

spartns.lisp (file)

Macro: spartn-generic-traverse (INDEX-LIST VALUE DATA) REP-LIST ELEMENT-TYPE SPARSE-ELEMENT TEST-EQUAL DONT-BIND &body BODY

Traverses a sparse tensor, given:
- A list of symbols (that will be bound to the indices) - A symbol to be bound to the value
- The data
- The representation scheme
- The body

Package

spartns

Source

spartns.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

4.2.3 Functions

Function: array-structure-active STRUCTURE
Function: (setf array-structure-active) VALUE STRUCTURE
Package

spartns

Source

spartns.lisp (file)

Function: array-structure-count STRUCTURE
Function: (setf array-structure-count) VALUE STRUCTURE
Package

spartns

Source

spartns.lisp (file)

Function: array-structure-max-capacity STRUCTURE
Function: (setf array-structure-max-capacity) VALUE STRUCTURE
Package

spartns

Source

spartns.lisp (file)

Function: array-structure-values STRUCTURE
Function: (setf array-structure-values) VALUE STRUCTURE
Package

spartns

Source

spartns.lisp (file)

Function: chained-delete &key DATA REP-LIST INDEX-LIST ELEMENT-TYPE SPARSE-ELEMENT BLOCK-NAME TEST-EQUAL EMPTY-DIM-MAP

This function will return the code necessary to delete one element from
a sparse tensor, given the chained representation scheme.
- data will be inserted as is in the code. It is the container where the tensor is stored. - rep-list MUST be a list of the representation schemes, and it CANNOT be a variable, because it will be used in macroexpansion time.
- index-list is inserted as is, and will be later replaced by the list of indices.
- element-type is inserted as is. It is the type of the stored elements.
- sparse-element is inserted as is. It is the value of the sparse element.
- block-name is just a name for the block of code. A wrapper function will use gensym for this.

Package

spartns

Source

spartns.lisp (file)

Function: chained-get &key DATA REP-LIST INDEX-LIST ELEMENT-TYPE SPARSE-ELEMENT BLOCK-NAME TEST-EQUAL EMPTY-DIM-MAP

This function will return the code necessary to access one element in
a sparse tensor, given the chained representation scheme.
- data will be inserted as is in the code. It is the container where the tensor is stored. - rep-list MUST be a list of the representation schemes, and it CANNOT be a variable, because it will be used in macroexpansion time.
- index-list is inserted as is, and will be later replaced by the list of indices.
- element-type is inserted as is. It is the type of the stored elements.
- sparse-element is inserted as is. It is the value of the sparse element.
- block-name is just a name for the block of code. A wrapper function will use gensym for this.
This function should be used by a macro that creates the real function for accessing the tensor.

Package

spartns

Source

spartns.lisp (file)

Function: chained-make &key REP-LIST NON-ZERO-LIST ELEMENT-TYPE SPARSE-ELEMENT EMPTY-DIM-MAP

This function will return the code necessary to create the representation of one of the dimensions of the sparse tensor.

Package

spartns

Source

spartns.lisp (file)

Function: chained-pack &key DATA REP-LIST ELEMENT-TYPE
Package

spartns

Source

spartns.lisp (file)

Function: chained-set &key DATA REP-LIST INDEX-LIST NEW-VALUE NON-ZERO-LIST ELEMENT-TYPE SPARSE-ELEMENT BLOCK-NAME TEST-EQUAL EMPTY-DIM-MAP RESIZE-FUNCTION

This function will return the code necessary to store one element in
a sparse tensor, given the chained representation scheme.
- data will be inserted as is in the code. It is the container where the tensor is stored. - rep-list MUST be a list of the representation schemes, and it CANNOT be a variable, because it will be used in macroexpansion time.
- index-list is inserted as is, and will be later replaced by the list of indices.
- new-value will be inserted as is. It is the value to be stored in the tensor.
- element-type is inserted as is. It is the type of the stored elements.
- sparse-element is inserted as is. It is the value of the sparse element.
- block-name is just a name for the block of code. A wrapper function will use gensym for this.

Package

spartns

Source

spartns.lisp (file)

Function: check-defspartn-parameters NAME REPRESENTATION NON-ZERO ELEMENT-TYPE SPARSE-ELEMENT TEST-EQUAL RESIZE-FUNCTION RESIZE-AMOUNT DEF DECLARE

This function checks the types of some parameters to defspartn.

Package

spartns

Source

spartns.lisp (file)

Function: clock-elapsed-time STRUCTURE
Function: (setf clock-elapsed-time) VALUE STRUCTURE
Package

jp-utils

Source

utils.lisp (file)

Function: clock-running STRUCTURE
Function: (setf clock-running) VALUE STRUCTURE
Package

jp-utils

Source

utils.lisp (file)

Function: clock-start-time STRUCTURE
Function: (setf clock-start-time) VALUE STRUCTURE
Package

jp-utils

Source

utils.lisp (file)

Function: collect-non-zeros-into-fast-traversal SYMBOL-LIST ARRAY-LIST TYPES-LIST POSITION

Produces the code to SETF values in a fast traversal:

(collect-non-zeros-into-fast-traversal ’(i j k v w)
’(II JJ KK VV WW)
’(fixnum fixnum fixnum double-float double-float) 10)
==>
((SETF (AREF (THE (SIMPLE-ARRAY FIXNUM (*)) II) 10) I)
(SETF (AREF (THE (SIMPLE-ARRAY FIXNUM (*)) JJ) 10) J)
(SETF (AREF (THE (SIMPLE-ARRAY FIXNUM (*)) KK) 10) K)
(SETF (AREF (THE (SIMPLE-ARRAY DOUBLE-FLOAT (*)) VV) 10) V)
(SETF (AREF (THE (SIMPLE-ARRAY DOUBLE-FLOAT (*)) WW) 10) W))

Package

spartns

Source

spartns.lisp (file)

Function: copy-array-structure SEQUENCE

Return a copy of SEQUENCE which is EQUAL to SEQUENCE but not EQ.

Package

spartns

Source

SYS:SRC;CODE;SEQ.LISP (not found)

Function: copy-clock SEQUENCE

Return a copy of SEQUENCE which is EQUAL to SEQUENCE but not EQ.

Package

jp-utils

Source

SYS:SRC;CODE;SEQ.LISP (not found)

Function: copy-cvector SEQUENCE

Return a copy of SEQUENCE which is EQUAL to SEQUENCE but not EQ.

Package

spartns

Source

SYS:SRC;CODE;SEQ.LISP (not found)

Function: copy-spartn-scheme INSTANCE
Package

spartns

Source

spartns.lisp (file)

Function: create-and-bind-arrays NON-ZEROS SYMBOL-LIST TYPE-LIST

Generates the code to create and bind arrays, and also the
type declarations. For example:

(multiple-value-bind (n b d)
(create-and-bind-arrays 4 ’(x y z w) ’(fixnum character double-float fixnum)) (format t "=======n:~%~a~%=======b:~%~a~%=======d:~%~a~%" n b d))

The output is:

(ARRAY-X-2960 ARRAY-Y-2961 ARRAY-Z-2962 ARRAY-W-2963)
=======b:
((ARRAY-X-2960 (MAKE-ARRAY 4 ELEMENT-TYPE FIXNUM))
(ARRAY-Y-2961 (MAKE-ARRAY 4 ELEMENT-TYPE CHARACTER))
(ARRAY-Z-2962 (MAKE-ARRAY 4 ELEMENT-TYPE DOUBLE-FLOAT))
(ARRAY-W-2963 (MAKE-ARRAY 4 ELEMENT-TYPE FIXNUM)))
=======d:
((TYPE (SIMPLE-ARRAY FIXNUM (*)) ARRAY-X-2960)
(TYPE (SIMPLE-ARRAY CHARACTER (*)) ARRAY-Y-2961)
(TYPE (SIMPLE-ARRAY DOUBLE-FLOAT (*)) ARRAY-Z-2962)
(TYPE (SIMPLE-ARRAY FIXNUM (*)) ARRAY-W-2963))

Package

spartns

Source

spartns.lisp (file)

Function: create-next-dim VALUE DATA REP-LIST INDEX-LIST NON-ZERO-LIST ELEMENT-TYPE SPARSE-ELEMENT RESIZE-FUNCTION

This function is used by chained-set to create a new structure when necessary.

Package

spartns

Source

spartns.lisp (file)

Function: cvector-count STRUCTURE
Function: (setf cvector-count) VALUE STRUCTURE
Package

spartns

Source

spartns.lisp (file)

Function: cvector-index STRUCTURE
Function: (setf cvector-index) VALUE STRUCTURE
Package

spartns

Source

spartns.lisp (file)

Function: cvector-max-capacity STRUCTURE
Function: (setf cvector-max-capacity) VALUE STRUCTURE
Package

spartns

Source

spartns.lisp (file)

Function: cvector-values STRUCTURE
Function: (setf cvector-values) VALUE STRUCTURE
Package

spartns

Source

spartns.lisp (file)

Function: def-spartn-copy FUN-NAME SCHEME-NAME &key DECLARE DEF

Creates a fuction that copies a spartn.

Examples:

(def-spartn-copy ’my-copy-function ’hash)
==>
(MY-COPY-FUNCTION (#:DATA-817) "Copies a sparse tensor of type HASH" (DECLARE (OPTIMIZE (SPEED 3) (SAFETY 1)))
(SPARTN-CONVERT #:DATA-817 :FROM HASH :TO HASH :DESTRUCTIVE NIL))

(def-spartn-copy ’my-copy-function ’hash :def t)
==>
(DEFUN MY-COPY-FUNCTION (#:DATA-820)
"Copies a sparse tensor of type HASH"
(DECLARE (OPTIMIZE (SPEED 3) (SAFETY 1)))
(SPARTN-CONVERT #:DATA-820 :FROM HASH :TO HASH :DESTRUCTIVE NIL))

Package

spartns

Source

spartns.lisp (file)

Function: def-spartn-delete FUN-NAME REP-LIST TYPE SPARSE-ELEMENT TEST-EQUAL EMPTY-DIM-MAP &key DECLARE DEF

Creates a function to delete elements from a tensor.

Package

spartns

Source

spartns.lisp (file)

Function: def-spartn-get FUN-NAME REP-LIST TYPE SPARSE-ELEMENT TEST-EQUAL EMPTY-DIM-MAP &key DECLARE DEF

Creates a function to get elements in a tensor.

Package

spartns

Source

spartns.lisp (file)

Function: def-spartn-make FUN-NAME REP-LIST TYPE SPARSE NON-ZERO-LIST EMPTY-DIM-MAP &key DECLARE DEF

Creates a function to initialize a tensor.

Package

spartns

Source

spartns.lisp (file)

Function: def-spartn-pack FUN-NAME REP-LIST TYPE &key DEF

Creates a function that packs a sparse tensor.

Package

spartns

Source

spartns.lisp (file)

Function: def-spartn-set FUN-NAME REP-LIST TYPE SPARSE-ELEMENT NON-ZERO-LIST TEST-EQUAL EMPTY-DIM-MAP RESIZE-FUNCTION &key DECLARE DEF

Creates a function to set elements in a tensor.

Package

spartns

Source

spartns.lisp (file)

Function: def-spartn-traverse MAC-NAME REP-LIST TYPE SPARSE TEST-EQUAL &key DEF

Creates a macro for traversing one type of spartn, given the representation scheme (as a list), the element type, the sparse element and the desired name for the new macro.
For example:
(def-spartn-traverse do-hhd (hash hash) double-float 0d0 #’=)
This will create a macro DO-HHD which can be used like this:
(do-hhd ((i j) val data)
(format t "The value at (~a, ~a) is ~a" i j val))

Package

spartns

Source

spartns.lisp (file)

Function: define-spartn-functions NAME SPARTN-SCHEME EMPTY-DIM-MAP EMPTY-DIM-DEFS &key DEF DECLARE

Returns the code for the functions used with a spartn scheme. This is used by defspartn and w/spartns. If DEF is T, then this function will generate top-level code to define the functions:

(DEFUN get-X (tensor index) ...)

If DEF is NIL, then only the names, lambda-lists and bodies are generated:

(get-X (tensor index) ...)

The first form is used by defspartn (which is supposed to be used as a top-leval form), and the second is used by w/spartns (which will use LABELS to create local functions).

Package

spartns

Source

spartns.lisp (file)

Function: define-spartn-macros NAME SPARTN-SCHEME EMPTY-DIM-MAP &key DEF

Returns the code for the macros used with a spartn scheme. This is used by defspartn and w/spartns. If DEF is T, then this function will generate top-level code to define the functions and macros:

(DEFMACRO traverse-X (index-list value tensor &body body) ...)

If DEF is NIL, then only the names, lambda-lists and bodies are generated:

(traverse-X (index-list value tensor &body body) ...)

The first form is used by defspartn (which is supposed to be used as a top-leval form), and the second is used by w/spartns (which will use MACROLET to create local macros).

Package

spartns

Source

spartns.lisp (file)

Function: do-fast-traversal SYMBOL-LIST ARRAY-LIST TYPES-LIST BODY

Traverses a structure of the type spartn-fast-traversal,
binding the symbols for indices and values.

Example:
(do-fast-traversal ’(i j k) ; indices
’(v1 v2 v3) ; arrays
’(fixnum double-float double-float) ; types
’((format t "i=~a j=~a k=~a~%" i j k)))) ; body

==>

(SYMBOL-MACROLET ((I (AREF (THE (SIMPLE-ARRAY FIXNUM (*)) V1) #:INDEX-2309)) (J (AREF (THE (SIMPLE-ARRAY DOUBLE-FLOAT (*)) V2) #:INDEX-2309)) (K (AREF (THE (SIMPLE-ARRAY DOUBLE-FLOAT (*)) V3) #:INDEX-2309))) (LOOP FOR #:INDEX-2309 BELOW 4 DO
(FORMAT T "i=~a j=~a k=~a~%" I J K)))

The symbol used for the index variable (#:INDEX-2309 in this example) is created by gensym.

*NOTE* that we used ’(( body )) when calling do-fast-traversal, and ,@body inside it.

Package

spartns

Source

spartns.lisp (file)

Function: elapsed-time ()

Returns the time elapsed since the stopwatch started, while it was running (pauses are excluded).
If the clock was currently running, the time until now is computed. Otherwise, time until the most recenr stop is computed.

Package

jp-utils

Source

utils.lisp (file)

Function: expand-scheme FUNCTION SCHEME SUBST-LIST

Expands the code from a representation scheme, substituting parameters.
For example, if a scheme with the name ’cvector has this function registered: ’spartns::get –> ’(get-cvec data index sparse-element)
Then expand-scheme will work like this:
(expand-scheme ’spartns::get ’cvector ’((data d) (index i) (sparse-element sp))) => ’(get-cvec d i sp)

Package

spartns

Source

spartns.lisp (file)

Function: flatten LIST

Flattens a list.

Package

spartns

Source

spartns.lisp (file)

Function: get-create REP

Returns the Lisp code to create an empty dimension, given its representation. Examples:

(get-create ’hash)
==>
(MAKE-HASH-TABLE :SIZE 0)

(get-create ’cvector)
==>
(MAKE-NEW-CVECTOR (THE FIXNUM 0) :ELEMENT-TYPE FIXNUM :SPARSE-ELEMENT 0)

Package

spartns

Source

spartns.lisp (file)

Function: get-scheme NAME

Retrieves a representation scheme given its name, which should be a symbol. If the scheme is not registered, this function returns NIL.

(spartns::get-scheme ’spartns:cvector)
==>
#<HASH-TABLE :TEST EQ :COUNT 10 {10036CF001}>
T

The hashtable returned is the representation scheme (see the function DEFSCHEME).

Package

spartns

Source

spartns.lisp (file)

Function: hash-table-keys-as-array HASH
Package

jp-utils

Source

utils.lisp (file)

Function: make-array-structure &key (VALUES VALUES) (ACTIVE ACTIVE) (MAX-CAPACITY MAX-CAPACITY) (COUNT COUNT)
Package

spartns

Source

spartns.lisp (file)

Function: make-clock &key (START-TIME START-TIME) (ELAPSED-TIME ELAPSED-TIME) (RUNNING RUNNING)
Package

jp-utils

Source

utils.lisp (file)

Function: make-cvector &key (VALUES VALUES) (INDEX INDEX) (MAX-CAPACITY MAX-CAPACITY) (COUNT COUNT)
Package

spartns

Source

spartns.lisp (file)

Function: make-empty-dimensions REP-LIST

Given arepresentation list, this function returns two values:
the Lisp code for creating empty dimensions for those representations, and a hashtable that maps symbols like EMPTY-REP- to those empty structures. For example,

(make-empty-dimensions ’(cvector hash array)
==>
(LET ((#:EMPTY-ARRAY-847
(MAKE-ARRAY-STRUCTURE :VALUES
(MAKE-ARRAY 0 :ELEMENT-TYPE ’FIXNUM :INITIAL-ELEMENT (THE FIXNUM 0)) :ACTIVE
(MAKE-ARRAY 0 :ELEMENT-TYPE ’(MOD 2) :INITIAL-ELEMENT 0) :MAX-CAPACITY 0))
(#:EMPTY-HASH-846 (MAKE-HASH-TABLE :SIZE 0)))),
#<HASHTABLE :TEST EQL :COUNT 2 {129910020})

The second value returned (the hashtable) maps:
hash –> #:EMPTY-HASH-846
array –> #:EMPTY-ARRAY-847

The cvector scheme was not included because it is the first in the representation list.

Package

spartns

Source

spartns.lisp (file)

Function: make-spartn-scheme &key (REPRESENTATION REPRESENTATION) (NON-ZERO NON-ZERO) (ELEMENT-TYPE ELEMENT-TYPE) (SPARSE-ELEMENT SPARSE-ELEMENT) (DECLARE DECLARE) (TEST-EQUAL TEST-EQUAL) (RESIZE-FUNCTION RESIZE-FUNCTION)
Package

spartns

Source

spartns.lisp (file)

Function: make-types-list TYPE-LIST INDEX-SYMBOL-LIST

Make s alist of types:

(make-types-list ’(hash-float cvector-double) ’(i j k l))

==>
’(single-float double-float fixnum fixnum fixnum fixnum)

type-list is a list of spartn schemes.

Package

spartns

Source

spartns.lisp (file)

Function: remove-scheme NAME

Removes a representation scheme from the database.

Package

spartns

Source

spartns.lisp (file)

Function: reset-clock ()

Completely resets the stopwatch.

Package

jp-utils

Source

utils.lisp (file)

Function: sequence-first SEQ

Returns the first element of a sequence.

Package

jp-utils

Source

utils.lisp (file)

Function: sparse-element-for-next-dim REP-LIST EMPTY-DIM-MAP SPARSE-ELEMENT

Returns the sparse element to be used in the next dimension: either the sparse-element for the tensor (if this is the last dimension) or an empty map using next dimension’s representation.

Package

spartns

Source

spartns.lisp (file)

Function: spartn-scheme-declare INSTANCE
Function: (setf spartn-scheme-declare) VALUE INSTANCE
Package

spartns

Source

spartns.lisp (file)

Function: spartn-scheme-element-type INSTANCE
Function: (setf spartn-scheme-element-type) VALUE INSTANCE
Package

spartns

Source

spartns.lisp (file)

Function: spartn-scheme-non-zero INSTANCE
Function: (setf spartn-scheme-non-zero) VALUE INSTANCE
Package

spartns

Source

spartns.lisp (file)

Function: spartn-scheme-p OBJECT
Package

spartns

Source

spartns.lisp (file)

Function: spartn-scheme-representation INSTANCE
Function: (setf spartn-scheme-representation) VALUE INSTANCE
Package

spartns

Source

spartns.lisp (file)

Function: spartn-scheme-resize-function INSTANCE
Function: (setf spartn-scheme-resize-function) VALUE INSTANCE
Package

spartns

Source

spartns.lisp (file)

Function: spartn-scheme-sparse-element INSTANCE
Function: (setf spartn-scheme-sparse-element) VALUE INSTANCE
Package

spartns

Source

spartns.lisp (file)

Function: spartn-scheme-test-equal INSTANCE
Function: (setf spartn-scheme-test-equal) VALUE INSTANCE
Package

spartns

Source

spartns.lisp (file)

Function: split-indices-values-dont-bind TRAV

Returns index-list values dont-bind

Package

spartns

Source

spartns.lisp (file)

Function: split-traversal-descriptions TRAVERSAL-LIST

Splits the descriptions of several traversals into several lists: one for
spartn type, one for the data containers, one for the variable to bind for value and one for the lists of variables to bind for indices.

For example,
(split-traversal-descriptions ’((A data-a i j k l val-a)
(B data-b x y z val-b :dont-bind (x))
(C data-c a b c val-c)))
==>

(values (A B C)
(DATA-A DATA-B DATA-C)
(VAL-A VAL-B VAL-C)
((I J K L) (X Y Z) (A B C))
(NIL (x) NIL))

This is used by the macro w/spartns.

Package

spartns

Source

spartns.lisp (file)

Function: start-clock ()

Sets the start time of the stopwatch to ’now’, but does NOT reset the elapsed time.

Package

jp-utils

Source

utils.lisp (file)

Function: stop-clock ()

Pauses the stopwatch and updates the elapsed-time.

Package

jp-utils

Source

utils.lisp (file)

Function: traverse-spartn-aux INDEX-LIST VALUE DATA ELEMENT-TYPE SPARSE-ELEMENT REP-LIST TEST-EQUAL DONT-BIND EMPTY-DIM-MAP BODY

This is an auxiliary function that is used by the spartn-generic-traverse macro. It will produce the code to traverse a sparse tensor, given the representation scheme.

dont-bind is a list of indices not to bind.

Package

spartns

Source

spartns.lisp (file)

Function: with-spartn-traversals-aux SPARTN-TYPE-LIST DATA-LIST INDEX-LIST-LIST VALUE-LIST DONT-BINDS USED-INDEX-LIST BODY

Generates the code to traverse several spartns, possibly with shared indices.
This function does the heavy work, while w/spartn-traversals is the macro that exposes the functionality.

(with-spartn-traversals-aux ’(number2d fixnum2d) ’(A B) ’((I J) (x y)) ’(va vb) ’(pprint))

==>

(TRAVERSE-NUMBER2D ((I J) VA A)
(TRAVERSE-FIXNUM2D ((X Y) VB B)
(PROGN PPRINT))

Now an example with an excluded index:

(with-spartn-traversals-aux ’(number-2d fixnum-2d)
’(A B)
’((I J) (x y))
’(va vb)
’(x) ;; <======= HERE! ’(progn
(pprint x)
(pprint y)
(pprint va)))

==>

(TRAVERSE-NUMBER-2D ((I J) VA A)
(TRAVERSE-FIXNUM-2D ((#:B-X-803 Y) VB B)
(WHEN (AND (EQL X #:B-X-803))
(PROGN PROGN (PPRINT X) (PPRINT Y) (PPRINT VA)))))

Note that the X index was excluded from the variables over which
we loop. The code will loop over #:B-X-803 (locally created), but
the body will only be evaluated if it is equal to X, which should
be set outside the loop. This is equivalent to using a fixed value
for one index.

Package

spartns

Source

spartns.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

4.2.4 Structures

Structure: spartn-scheme ()
Package

spartns

Source

spartns.lisp (file)

Direct superclasses

structure-object (structure)

Direct slots
Slot: representation
Readers

spartn-scheme-representation (function)

Writers

(setf spartn-scheme-representation) (function)

Slot: non-zero
Readers

spartn-scheme-non-zero (function)

Writers

(setf spartn-scheme-non-zero) (function)

Slot: element-type
Readers

spartn-scheme-element-type (function)

Writers

(setf spartn-scheme-element-type) (function)

Slot: sparse-element
Readers

spartn-scheme-sparse-element (function)

Writers

(setf spartn-scheme-sparse-element) (function)

Slot: declare
Readers

spartn-scheme-declare (function)

Writers

(setf spartn-scheme-declare) (function)

Slot: test-equal
Readers

spartn-scheme-test-equal (function)

Writers

(setf spartn-scheme-test-equal) (function)

Slot: resize-function
Readers

spartn-scheme-resize-function (function)

Writers

(setf spartn-scheme-resize-function) (function)


Previous: , Up: Internal definitions   [Contents][Index]

4.2.5 Types

Type: internal-time-type ()
Package

jp-utils

Source

utils.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   F   L   S  
Index Entry  Section

F
File, Lisp, spartns.asd: The spartns<dot>asd file
File, Lisp, spartns/spartns-packages.lisp: The spartns/spartns-packages<dot>lisp file
File, Lisp, spartns/spartns.lisp: The spartns/spartns<dot>lisp file
File, Lisp, spartns/utils.lisp: The spartns/utils<dot>lisp file

L
Lisp File, spartns.asd: The spartns<dot>asd file
Lisp File, spartns/spartns-packages.lisp: The spartns/spartns-packages<dot>lisp file
Lisp File, spartns/spartns.lisp: The spartns/spartns<dot>lisp file
Lisp File, spartns/utils.lisp: The spartns/utils<dot>lisp file

S
spartns.asd: The spartns<dot>asd file
spartns/spartns-packages.lisp: The spartns/spartns-packages<dot>lisp file
spartns/spartns.lisp: The spartns/spartns<dot>lisp file
spartns/utils.lisp: The spartns/utils<dot>lisp file

Jump to:   F   L   S  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   (  
A   B   C   D   E   F   G   H   M   P   R   S   T   W  
Index Entry  Section

(
(setf array-structure-active): Internal functions
(setf array-structure-count): Internal functions
(setf array-structure-max-capacity): Internal functions
(setf array-structure-values): Internal functions
(setf clock-elapsed-time): Internal functions
(setf clock-running): Internal functions
(setf clock-start-time): Internal functions
(setf cvector-count): Internal functions
(setf cvector-index): Internal functions
(setf cvector-max-capacity): Internal functions
(setf cvector-values): Internal functions
(setf spartn-scheme-declare): Internal functions
(setf spartn-scheme-element-type): Internal functions
(setf spartn-scheme-non-zero): Internal functions
(setf spartn-scheme-representation): Internal functions
(setf spartn-scheme-resize-function): Internal functions
(setf spartn-scheme-sparse-element): Internal functions
(setf spartn-scheme-test-equal): Internal functions

A
array-structure-active: Internal functions
array-structure-count: Internal functions
array-structure-max-capacity: Internal functions
array-structure-values: Internal functions

B
binary-search: Exported functions

C
chained-delete: Internal functions
chained-get: Internal functions
chained-make: Internal functions
chained-pack: Internal functions
chained-set: Internal functions
check-defspartn-parameters: Internal functions
clock-elapsed-time: Internal functions
clock-running: Internal functions
clock-start-time: Internal functions
collect-non-zeros-into-fast-traversal: Internal functions
copy-array-structure: Internal functions
copy-clock: Internal functions
copy-cvector: Internal functions
copy-spartn-scheme: Internal functions
counting-sort: Exported functions
counting-sort-g: Exported functions
create-and-bind-arrays: Internal functions
create-next-dim: Internal functions
cvector-count: Internal functions
cvector-index: Internal functions
cvector-max-capacity: Internal functions
cvector-values: Internal functions

D
def-spartn-copy: Internal functions
def-spartn-delete: Internal functions
def-spartn-get: Internal functions
def-spartn-make: Internal functions
def-spartn-pack: Internal functions
def-spartn-set: Internal functions
def-spartn-traverse: Internal functions
define-spartn-functions: Internal functions
define-spartn-macros: Internal functions
defscheme: Exported macros
defspartn: Exported macros
do-fast-traversal: Internal functions
do-sequence: Exported macros
do-traverse-cvector: Internal macros

E
elapsed-time: Internal functions
expand-scheme: Internal functions

F
fast-binary-search: Exported macros
flatten: Internal functions
format-symbol: Exported functions
format-uninterned-symbol: Exported functions
Function, (setf array-structure-active): Internal functions
Function, (setf array-structure-count): Internal functions
Function, (setf array-structure-max-capacity): Internal functions
Function, (setf array-structure-values): Internal functions
Function, (setf clock-elapsed-time): Internal functions
Function, (setf clock-running): Internal functions
Function, (setf clock-start-time): Internal functions
Function, (setf cvector-count): Internal functions
Function, (setf cvector-index): Internal functions
Function, (setf cvector-max-capacity): Internal functions
Function, (setf cvector-values): Internal functions
Function, (setf spartn-scheme-declare): Internal functions
Function, (setf spartn-scheme-element-type): Internal functions
Function, (setf spartn-scheme-non-zero): Internal functions
Function, (setf spartn-scheme-representation): Internal functions
Function, (setf spartn-scheme-resize-function): Internal functions
Function, (setf spartn-scheme-sparse-element): Internal functions
Function, (setf spartn-scheme-test-equal): Internal functions
Function, array-structure-active: Internal functions
Function, array-structure-count: Internal functions
Function, array-structure-max-capacity: Internal functions
Function, array-structure-values: Internal functions
Function, binary-search: Exported functions
Function, chained-delete: Internal functions
Function, chained-get: Internal functions
Function, chained-make: Internal functions
Function, chained-pack: Internal functions
Function, chained-set: Internal functions
Function, check-defspartn-parameters: Internal functions
Function, clock-elapsed-time: Internal functions
Function, clock-running: Internal functions
Function, clock-start-time: Internal functions
Function, collect-non-zeros-into-fast-traversal: Internal functions
Function, copy-array-structure: Internal functions
Function, copy-clock: Internal functions
Function, copy-cvector: Internal functions
Function, copy-spartn-scheme: Internal functions
Function, counting-sort: Exported functions
Function, counting-sort-g: Exported functions
Function, create-and-bind-arrays: Internal functions
Function, create-next-dim: Internal functions
Function, cvector-count: Internal functions
Function, cvector-index: Internal functions
Function, cvector-max-capacity: Internal functions
Function, cvector-values: Internal functions
Function, def-spartn-copy: Internal functions
Function, def-spartn-delete: Internal functions
Function, def-spartn-get: Internal functions
Function, def-spartn-make: Internal functions
Function, def-spartn-pack: Internal functions
Function, def-spartn-set: Internal functions
Function, def-spartn-traverse: Internal functions
Function, define-spartn-functions: Internal functions
Function, define-spartn-macros: Internal functions
Function, do-fast-traversal: Internal functions
Function, elapsed-time: Internal functions
Function, expand-scheme: Internal functions
Function, flatten: Internal functions
Function, format-symbol: Exported functions
Function, format-uninterned-symbol: Exported functions
Function, generate-random-array: Exported functions
Function, get-create: Internal functions
Function, get-scheme: Internal functions
Function, hash-table-keys: Exported functions
Function, hash-table-keys-as-array: Internal functions
Function, make-array-structure: Internal functions
Function, make-clock: Internal functions
Function, make-cvector: Internal functions
Function, make-empty-dimensions: Internal functions
Function, make-spartn-scheme: Internal functions
Function, make-types-list: Internal functions
Function, remove-scheme: Internal functions
Function, reset-clock: Internal functions
Function, robust-adjust-array: Exported functions
Function, sequence-first: Internal functions
Function, sortedp: Exported functions
Function, sparse-element-for-next-dim: Internal functions
Function, spartn-scheme-declare: Internal functions
Function, spartn-scheme-element-type: Internal functions
Function, spartn-scheme-non-zero: Internal functions
Function, spartn-scheme-p: Internal functions
Function, spartn-scheme-representation: Internal functions
Function, spartn-scheme-resize-function: Internal functions
Function, spartn-scheme-sparse-element: Internal functions
Function, spartn-scheme-test-equal: Internal functions
Function, split-indices-values-dont-bind: Internal functions
Function, split-traversal-descriptions: Internal functions
Function, start-clock: Internal functions
Function, stop-clock: Internal functions
Function, subst-all: Exported functions
Function, traverse-spartn-aux: Internal functions
Function, with-spartn-traversals-aux: Internal functions

G
generate-random-array: Exported functions
get-binary-search: Exported macros
get-create: Internal functions
get-cvec: Internal macros
get-scheme: Internal functions

H
hash-table-keys: Exported functions
hash-table-keys-as-array: Internal functions

M
Macro, defscheme: Exported macros
Macro, defspartn: Exported macros
Macro, do-sequence: Exported macros
Macro, do-traverse-cvector: Internal macros
Macro, fast-binary-search: Exported macros
Macro, get-binary-search: Exported macros
Macro, get-cvec: Internal macros
Macro, make-new-cvector: Internal macros
Macro, pack-cvec: Internal macros
Macro, resize-cvec: Internal macros
Macro, set-cvec: Internal macros
Macro, spartn-convert: Exported macros
Macro, spartn-generic-traverse: Internal macros
Macro, w/fast-traversals: Exported macros
Macro, w/spartn-traversals: Exported macros
Macro, w/spartns: Exported macros
Macro, with-gensyms: Exported macros
make-array-structure: Internal functions
make-clock: Internal functions
make-cvector: Internal functions
make-empty-dimensions: Internal functions
make-new-cvector: Internal macros
make-spartn-scheme: Internal functions
make-types-list: Internal functions

P
pack-cvec: Internal macros

R
remove-scheme: Internal functions
reset-clock: Internal functions
resize-cvec: Internal macros
robust-adjust-array: Exported functions

S
sequence-first: Internal functions
set-cvec: Internal macros
sortedp: Exported functions
sparse-element-for-next-dim: Internal functions
spartn-convert: Exported macros
spartn-generic-traverse: Internal macros
spartn-scheme-declare: Internal functions
spartn-scheme-element-type: Internal functions
spartn-scheme-non-zero: Internal functions
spartn-scheme-p: Internal functions
spartn-scheme-representation: Internal functions
spartn-scheme-resize-function: Internal functions
spartn-scheme-sparse-element: Internal functions
spartn-scheme-test-equal: Internal functions
split-indices-values-dont-bind: Internal functions
split-traversal-descriptions: Internal functions
start-clock: Internal functions
stop-clock: Internal functions
subst-all: Exported functions

T
traverse-spartn-aux: Internal functions

W
w/fast-traversals: Exported macros
w/spartn-traversals: Exported macros
w/spartns: Exported macros
with-gensyms: Exported macros
with-spartn-traversals-aux: Internal functions

Jump to:   (  
A   B   C   D   E   F   G   H   M   P   R   S   T   W  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   *  
D   E   N   R   S   T  
Index Entry  Section

*
*representation-schemes*: Internal special variables
*spartn-schemes*: Internal special variables

D
declare: Internal structures

E
element-type: Internal structures

N
non-zero: Internal structures

R
representation: Internal structures
resize-function: Internal structures

S
Slot, declare: Internal structures
Slot, element-type: Internal structures
Slot, non-zero: Internal structures
Slot, representation: Internal structures
Slot, resize-function: Internal structures
Slot, sparse-element: Internal structures
Slot, test-equal: Internal structures
sparse-element: Internal structures
Special Variable, *representation-schemes*: Internal special variables
Special Variable, *spartn-schemes*: Internal special variables

T
test-equal: Internal structures

Jump to:   *  
D   E   N   R   S   T  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   I   J   P   S   T  
Index Entry  Section

I
internal-time-type: Internal types

J
jp-utils: The jp-utils package

P
Package, jp-utils: The jp-utils package
Package, spartns: The spartns package

S
spartn-scheme: Internal structures
spartns: The spartns system
spartns: The spartns package
Structure, spartn-scheme: Internal structures
System, spartns: The spartns system

T
Type, internal-time-type: Internal types

Jump to:   I   J   P   S   T