Skip to content

Commit 36b998f

Browse files
3D matrices
1 parent 7eb231f commit 36b998f

File tree

1 file changed

+59
-4
lines changed

1 file changed

+59
-4
lines changed

include/binsparse/c_bindings/binsparse_matrix.h

Lines changed: 59 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ bc_type_code ;
198198
// index [0] = non-NULL, of size npointer [0]
199199
// index [1] = NULL
200200
// values: size nvals = m * npointer [0], or 1 if iso
201-
//
201+
202202
// Are all 16 formats possible?
203203
// (Full, Sparse, Hyper, Index) x (Full, Sparse, Hyper, Index) ?
204204
// I think the last dimension must be Full or Index, which leads to
@@ -211,21 +211,76 @@ bc_type_code ;
211211
// (Full, Full) full
212212
// (Hyper, Full) hyper-full
213213
//
214-
// not described aboce:
214+
// not described above:
215215
//
216216
// (Index, Full) can be defined, looks useful. An unorderd
217217
// set of full vectors.
218218
// (Sparse, Full) can be defined but not useful?
219-
// (Full, Index) huh?
219+
// (Full, Index) huh? See Rule (2) below.
220220
//
221+
221222
// bitmap format: held as two full bc_matrices with same dimension and
222223
// axis_order. The first matrix ('bitmap' pattern) is always bool.
223224
// The second full matrix holds the values.
224225
// Format of both bc_matrices is (Full, Full)
225226

227+
// I think a few rules might work:
228+
//
229+
// (1) from left to right, if a "Full" format appears, the remaining
230+
// formats must all be Full.
231+
//
232+
// (2) the last format must be "Index" or "Full".
233+
234+
226235
// rank = 3?
227236
//
228-
// describe some for future extensions
237+
// describe some for future extensions. Possible formats, a subset
238+
// of (4 x 4 x 2) = 32 formats (rule 1) minus the 10 formats that break
239+
// rule 2. Some of these can be described but are not useful.
240+
// This results in 22 possible formats ... I think. Of those,
241+
// at least 4 are not useful (, ... Sparse, Full, ...)
242+
243+
// (Index , Index , Index)
244+
// (Index , Hyper , Index)
245+
// (Index , Sparse, Index)
246+
// (Index , Full, Index) not possible (rule 2)
247+
248+
// (Hyper , Index , Index)
249+
// (Hyper , Hyper , Index)
250+
// (Hyper , Sparse, Index)
251+
// (Hyper , Full , Index) not possible (rule 2)
252+
253+
// (Sparse, Index , Index)
254+
// (Sparse, Hyper , Index)
255+
// (Sparse, Sparse, Index)
256+
// (Sparse, Full , Index) not possible (rule 2)
257+
258+
// (Full , Index , Index) not possible (rule 2)
259+
// (Full , Hyper , Index) not possible (rule 2)
260+
// (Full , Sparse, Index) not possible (rule 2)
261+
// (Full , Full , Index) not possible (rule 2)
262+
263+
// (Index , Index , Full )
264+
// (Index , Hyper , Full )
265+
// (Index , Sparse, Full ) ok but not useful?
266+
// (Index , Full , Full )
267+
268+
// (Hyper , Index , Full )
269+
// (Hyper , Hyper , Full )
270+
// (Hyper , Sparse, Full ) ok but not useful?
271+
// (Hyper , Full , Full )
272+
273+
// (Sparse, Index , Full )
274+
// (Sparse, Hyper , Full )
275+
// (Sparse, Sparse, Full ) ok but not useful?
276+
// (Sparse, Full , Full ) ok but not useful?
277+
278+
// (Full , Index , Full ) not possible (rule 2)
279+
// (Full , Hyper , Full ) not possible (rule 2)
280+
// (Full , Sparse, Full ) not possible (rule 2)
281+
// (Full , Full , Full )
282+
283+
229284

230285
#define KMAX 32 // maximum rank allowed. Is 32 too large?
231286
// should each of the KMAX-sized arrays be dynamically allocated?

0 commit comments

Comments
 (0)