Common Lisp Package: LISTOFLIST

XARRAY support for list-of-list data structures.

README:

FUNCTION

Public

EQUAL-LISTOFLIST (X Y)

FIXME: This function, when written, should walk through 2 listoflists and return T/nil based on equality.

LISTOFLIST->ARRAY (LOL &KEY (TYPE 'ROW-MAJOR))

From a listoflists structure, make an array. FIXME: need to verify that the listoflists is a valid structure (same size rows, typing if required, etc. <example> (defparameter *mdfl-test* (list (list 'a 1 2.1) (list 'b 2 1.1) (list 'c 1 2.0) (list 'd 2 3.0))) (length *mdfl-test*) (length (elt *mdfl-test* 0)) (defparameter *mdfl-test-dt* (make-datatable-from-listoflists *mdfl-test*)) (array-dimensions *mdfl-test-dt*) </example>

LISTOFLISTP (X &KEY (RAGGED T) (VARTYPES NIL))

Test for conformance of structure: list whose sublists are of the same size (if ragged is T, then just test that list has elements of type list).

SUBLISTS-OF-SAME-SIZE-P (LISTS)

WRITEME! Take a list of list, and verify that the sublists are all of the same size. returns size-of-sublist if all sublists same size, otherwise nil

TRANSPOSE-LISTOFLIST (LISTOFLIST)

This function does the moral-equivalent of a matrix transpose on a rectangular list-of-lists data structure. Assumes listoflist is rectangular, need to see what happens if ragged (or at least check). Could use the listoflistp predicate to confirm.

Private

ARRAY->LISTOFLIST (ARR &KEY (TYPE 'ROWMAJOR))

FIXME: need to write this.

CARRAY*-LOL (DIMENSIONS &REST ELEMENTS)

Return a (simple-array element-type dimensions) containing elements, coerced to element-type, where the elemen-type is obtained using numeric-type-classifier.

CARRAY-LOL (ELEMENT-TYPE DIMENSIONS &REST ELEMENTS)

Return a (simple-array element-type dimensions) containing elements, coerced to element-type.

CVECTOR*-LOL (&REST ELEMENTS)

Return a (simple-array element-type (*)) containing elements, coerced to element-type, where the elemen-type is obtained using numeric-type-classifier.

LISTOFLISTS-DIMENSIONS (LOL)

We assume row-major, that is each sublist denotes a row, and columns are formed by taking the jth element from each list to form the jth column

LISTSOFLISTS-CONSISTENT-DIMENSIONS-P (&REST LIST-OF-LIST-NAMES)

Check if the lengths of the lists are equal (T, otherwise NIL), to justify further processing and initial conditions.

GENERIC-FUNCTION

Public

XDIMS (OBJECT)

Return a list of dimensions of object. The list does not share structure with anything, so it can be freely modified.

XRANK (OBJECT)

Returns the number of dimensions of object.

XREF (OBJECT &REST SUBSCRIPTS)

Accesses the element of the object specified by subscripts.

SETFXREF (VALUE OBJECT &REST SUBSCRIPTS)

Accesses the element of the object specified by subscripts.

Undocumented

XTYPE (OBJECT)

Private

Undocumented

XREF-WRITABLE-P (OBJECT &REST SUBSCRIPTS)