@@ -5,375 +5,4 @@ char *GxB_IMPLEMENTATION_DATE_STR = GxB_IMPLEMENTATION_DATE;
55char * GxB_IMPLEMENTATION_LICENSE_STR = GxB_IMPLEMENTATION_LICENSE ;
66char * GxB_IMPLEMENTATION_NAME_STR = GxB_IMPLEMENTATION_NAME ;
77char * GxB_SPEC_ABOUT_STR = GxB_SPEC_ABOUT ;
8- char * GxB_SPEC_DATE_STR = GxB_SPEC_DATE ;
9-
10- inline static GrB_Info GB_Iterator_rc_bitmap_next (GxB_Iterator iterator )
11- {
12- for (; iterator -> p < iterator -> pend ; iterator -> p ++ )
13- {
14- if (iterator -> Ab [iterator -> p ])
15- {
16- return GrB_SUCCESS ;
17- }
18- }
19-
20- return GrB_NO_VALUE ;
21- }
22-
23- inline static GrB_Info GB_Iterator_rc_knext (GxB_Iterator iterator )
24- {
25- if ((++ iterator -> k ) >= iterator -> anvec )
26- {
27- iterator -> pstart = 0 ;
28- iterator -> pend = 0 ;
29- iterator -> p = 0 ;
30- iterator -> k = iterator -> anvec ;
31- return GxB_EXHAUSTED ;
32- }
33- switch (iterator -> A_sparsity )
34- {
35- default :
36-
37- case 2 :
38-
39- case 1 :
40- {
41- iterator -> pstart = iterator -> Ap [iterator -> k ];
42- iterator -> pend = iterator -> Ap [iterator -> k + 1 ];
43- iterator -> p = iterator -> pstart ;
44- }
45- break ;
46-
47- case 4 :
48- {
49- iterator -> pstart += iterator -> avlen ;
50- iterator -> pend += iterator -> avlen ;
51- iterator -> p = iterator -> pstart ;
52- return GB_Iterator_rc_bitmap_next (iterator );
53- }
54- break ;
55-
56- case 8 :
57- {
58- iterator -> pstart += iterator -> avlen ;
59- iterator -> pend += iterator -> avlen ;
60- iterator -> p = iterator -> pstart ;
61- }
62- break ;
63-
64- }
65-
66- return (iterator -> p >= iterator -> pend ) ? (GrB_NO_VALUE ) : (GrB_SUCCESS );
67- }
68-
69- inline static GrB_Info GB_Iterator_rc_inext (GxB_Iterator iterator )
70- {
71- if ((++ iterator -> p ) >= iterator -> pend )
72- {
73- return GrB_NO_VALUE ;
74- }
75- else
76- if (iterator -> A_sparsity == 4 )
77- {
78- return GB_Iterator_rc_bitmap_next (iterator );
79- }
80- else
81- {
82- return GrB_SUCCESS ;
83- }
84- }
85-
86- inline static GrB_Index GB_Iterator_rc_getj (GxB_Iterator iterator )
87- {
88- if (iterator -> k >= iterator -> anvec )
89- {
90- return iterator -> avdim ;
91- }
92- else
93- if (iterator -> A_sparsity == 1 )
94- {
95- return iterator -> Ah [iterator -> k ];
96- }
97- else
98- {
99- return iterator -> k ;
100- }
101- }
102-
103- inline static GrB_Index GB_Iterator_rc_geti (GxB_Iterator iterator )
104- {
105- return (iterator -> Ai != 0 ) ? (iterator -> Ai [iterator -> p ]) : (iterator -> p - iterator -> pstart );
106- }
107-
108- inline static GrB_Info GxB_rowIterator_attach (GxB_Iterator iterator , GrB_Matrix A , GrB_Descriptor desc )
109- {
110- return GB_Iterator_attach (iterator , A , GxB_BY_ROW , desc );
111- }
112-
113- inline static GrB_Index GxB_rowIterator_kount (GxB_Iterator iterator )
114- {
115- return iterator -> anvec ;
116- }
117-
118- inline static GrB_Info GxB_rowIterator_seekRow (GxB_Iterator iterator , GrB_Index row )
119- {
120- return GB_Iterator_rc_seek (iterator , row , 0 );
121- }
122-
123- inline static GrB_Info GxB_rowIterator_kseek (GxB_Iterator iterator , GrB_Index k )
124- {
125- return GB_Iterator_rc_seek (iterator , k , 1 );
126- }
127-
128- inline static GrB_Info GxB_rowIterator_nextRow (GxB_Iterator iterator )
129- {
130- return GB_Iterator_rc_knext (iterator );
131- }
132-
133- inline static GrB_Info GxB_rowIterator_nextCol (GxB_Iterator iterator )
134- {
135- return GB_Iterator_rc_inext (iterator );
136- }
137-
138- inline static GrB_Index GxB_rowIterator_getRowIndex (GxB_Iterator iterator )
139- {
140- return GB_Iterator_rc_getj (iterator );
141- }
142-
143- inline static GrB_Index GxB_rowIterator_getColIndex (GxB_Iterator iterator )
144- {
145- return GB_Iterator_rc_geti (iterator );
146- }
147-
148- inline static GrB_Info GxB_colIterator_attach (GxB_Iterator iterator , GrB_Matrix A , GrB_Descriptor desc )
149- {
150- return GB_Iterator_attach (iterator , A , GxB_BY_COL , desc );
151- }
152-
153- inline static GrB_Index GxB_colIterator_kount (GxB_Iterator iterator )
154- {
155- return iterator -> anvec ;
156- }
157-
158- inline static GrB_Info GxB_colIterator_seekCol (GxB_Iterator iterator , GrB_Index col )
159- {
160- return GB_Iterator_rc_seek (iterator , col , 0 );
161- }
162-
163- inline static GrB_Info GxB_colIterator_kseek (GxB_Iterator iterator , GrB_Index k )
164- {
165- return GB_Iterator_rc_seek (iterator , k , 1 );
166- }
167-
168- inline static GrB_Info GxB_colIterator_nextCol (GxB_Iterator iterator )
169- {
170- return GB_Iterator_rc_knext (iterator );
171- }
172-
173- inline static GrB_Info GxB_colIterator_nextRow (GxB_Iterator iterator )
174- {
175- return GB_Iterator_rc_inext (iterator );
176- }
177-
178- inline static GrB_Index GxB_colIterator_getColIndex (GxB_Iterator iterator )
179- {
180- return GB_Iterator_rc_getj (iterator );
181- }
182-
183- inline static GrB_Index GxB_colIterator_getRowIndex (GxB_Iterator iterator )
184- {
185- return GB_Iterator_rc_geti (iterator );
186- }
187-
188- inline static GrB_Info GxB_Matrix_Iterator_attach (GxB_Iterator iterator , GrB_Matrix A , GrB_Descriptor desc )
189- {
190- return GB_Iterator_attach (iterator , A , GxB_NO_FORMAT , desc );
191- }
192-
193- inline static GrB_Index GxB_Matrix_Iterator_getpmax (GxB_Iterator iterator )
194- {
195- return iterator -> pmax ;
196- }
197-
198- inline static GrB_Index GxB_Matrix_Iterator_getp (GxB_Iterator iterator )
199- {
200- return iterator -> p ;
201- }
202-
203- inline static void GxB_Matrix_Iterator_getIndex (GxB_Iterator iterator , GrB_Index * row , GrB_Index * col )
204- {
205- switch (iterator -> A_sparsity )
206- {
207- default :
208-
209- case 2 :
210- {
211- if (iterator -> by_col )
212- {
213- * row = iterator -> Ai [iterator -> p ];
214- * col = iterator -> k ;
215- }
216- else
217- {
218- * row = iterator -> k ;
219- * col = iterator -> Ai [iterator -> p ];
220- }
221- }
222- break ;
223-
224- case 1 :
225- {
226- if (iterator -> by_col )
227- {
228- * row = iterator -> Ai [iterator -> p ];
229- * col = iterator -> Ah [iterator -> k ];
230- }
231- else
232- {
233- * row = iterator -> Ah [iterator -> k ];
234- * col = iterator -> Ai [iterator -> p ];
235- }
236- }
237- break ;
238-
239- case 4 :
240-
241- case 8 :
242- {
243- if (iterator -> by_col )
244- {
245- * row = iterator -> p - iterator -> pstart ;
246- * col = iterator -> k ;
247- }
248- else
249- {
250- * row = iterator -> k ;
251- * col = iterator -> p - iterator -> pstart ;
252- }
253- }
254- break ;
255-
256- }
257-
258- }
259-
260- inline static GrB_Index GxB_Vector_Iterator_getpmax (GxB_Iterator iterator )
261- {
262- return iterator -> pmax ;
263- }
264-
265- inline static GrB_Info GxB_Vector_Iterator_seek (GxB_Iterator iterator , GrB_Index p )
266- {
267- if (p >= iterator -> pmax )
268- {
269- iterator -> p = iterator -> pmax ;
270- return GxB_EXHAUSTED ;
271- }
272- else
273- {
274- iterator -> p = p ;
275- if (iterator -> A_sparsity == 4 )
276- {
277- for (; iterator -> p < iterator -> pmax ; iterator -> p ++ )
278- {
279- if (iterator -> Ab [iterator -> p ])
280- {
281- return GrB_SUCCESS ;
282- }
283- }
284-
285- return GxB_EXHAUSTED ;
286- }
287- }
288- return GrB_SUCCESS ;
289- }
290-
291- inline static GrB_Info GxB_Vector_Iterator_next (GxB_Iterator iterator )
292- {
293- if ((++ iterator -> p ) >= iterator -> pmax )
294- {
295- iterator -> p = iterator -> pmax ;
296- return GxB_EXHAUSTED ;
297- }
298- return GrB_SUCCESS ;
299- }
300-
301- inline static GrB_Index GxB_Vector_Iterator_getp (GxB_Iterator iterator )
302- {
303- return iterator -> p ;
304- }
305-
306- inline static GrB_Index GxB_Vector_Iterator_getIndex (GxB_Iterator iterator )
307- {
308- return (iterator -> Ai != 0 ) ? (iterator -> Ai [iterator -> p ]) : (iterator -> p );
309- }
310-
311- inline static bool GxB_Iterator_get_BOOL (GxB_Iterator iterator )
312- {
313- return ((bool * ) iterator -> Ax )[(iterator -> iso ) ? (0 ) : (iterator -> p )];
314- }
315-
316- inline static int8_t GxB_Iterator_get_INT8 (GxB_Iterator iterator )
317- {
318- return ((int8_t * ) iterator -> Ax )[(iterator -> iso ) ? (0 ) : (iterator -> p )];
319- }
320-
321- inline static int16_t GxB_Iterator_get_INT16 (GxB_Iterator iterator )
322- {
323- return ((int16_t * ) iterator -> Ax )[(iterator -> iso ) ? (0 ) : (iterator -> p )];
324- }
325-
326- inline static int32_t GxB_Iterator_get_INT32 (GxB_Iterator iterator )
327- {
328- return ((int32_t * ) iterator -> Ax )[(iterator -> iso ) ? (0 ) : (iterator -> p )];
329- }
330-
331- inline static int64_t GxB_Iterator_get_INT64 (GxB_Iterator iterator )
332- {
333- return ((uint64_t * ) iterator -> Ax )[(iterator -> iso ) ? (0 ) : (iterator -> p )];
334- }
335-
336- inline static uint8_t GxB_Iterator_get_UINT8 (GxB_Iterator iterator )
337- {
338- return ((uint8_t * ) iterator -> Ax )[(iterator -> iso ) ? (0 ) : (iterator -> p )];
339- }
340-
341- inline static uint16_t GxB_Iterator_get_UINT16 (GxB_Iterator iterator )
342- {
343- return ((uint16_t * ) iterator -> Ax )[(iterator -> iso ) ? (0 ) : (iterator -> p )];
344- }
345-
346- inline static uint32_t GxB_Iterator_get_UINT32 (GxB_Iterator iterator )
347- {
348- return ((uint32_t * ) iterator -> Ax )[(iterator -> iso ) ? (0 ) : (iterator -> p )];
349- }
350-
351- inline static uint64_t GxB_Iterator_get_UINT64 (GxB_Iterator iterator )
352- {
353- return ((uint64_t * ) iterator -> Ax )[(iterator -> iso ) ? (0 ) : (iterator -> p )];
354- }
355-
356- inline static float GxB_Iterator_get_FP32 (GxB_Iterator iterator )
357- {
358- return ((float * ) iterator -> Ax )[(iterator -> iso ) ? (0 ) : (iterator -> p )];
359- }
360-
361- inline static double GxB_Iterator_get_FP64 (GxB_Iterator iterator )
362- {
363- return ((double * ) iterator -> Ax )[(iterator -> iso ) ? (0 ) : (iterator -> p )];
364- }
365-
366- inline static GxB_FC32_t GxB_Iterator_get_FC32 (GxB_Iterator iterator )
367- {
368- return ((GxB_FC32_t * ) iterator -> Ax )[(iterator -> iso ) ? (0 ) : (iterator -> p )];
369- }
370-
371- inline static GxB_FC64_t GxB_Iterator_get_FC64 (GxB_Iterator iterator )
372- {
373- return ((GxB_FC64_t * ) iterator -> Ax )[(iterator -> iso ) ? (0 ) : (iterator -> p )];
374- }
375-
376- inline static void GxB_Iterator_get_UDT (GxB_Iterator iterator , void * value )
377- {
378- memcpy (value , iterator -> Ax + ((iterator -> iso ) ? (0 ) : (iterator -> type_size * iterator -> p )), iterator -> type_size );
379- }
8+ char * GxB_SPEC_DATE_STR = GxB_SPEC_DATE ;
0 commit comments