File: GB_ijlist.h

package info (click to toggle)
suitesparse 1%3A7.10.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 254,920 kB
  • sloc: ansic: 1,134,743; cpp: 46,133; makefile: 4,875; fortran: 2,087; java: 1,826; sh: 996; ruby: 725; python: 495; asm: 371; sed: 166; awk: 44
file content (40 lines) | stat: -rw-r--r-- 1,578 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//------------------------------------------------------------------------------
// GB_ijlist.h: return kth item, i = I [k], in an index list
//------------------------------------------------------------------------------

// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

//------------------------------------------------------------------------------

#ifndef GB_IJLIST_H
#define GB_IJLIST_H

//------------------------------------------------------------------------------
// kind of index list, Ikind and Jkind, and assign variations
//------------------------------------------------------------------------------

#define GB_ALL 0
#define GB_RANGE 1
#define GB_STRIDE 2
#define GB_LIST 3

#define GB_ASSIGN 0
#define GB_SUBASSIGN 1
#define GB_ROW_ASSIGN 2
#define GB_COL_ASSIGN 3

//------------------------------------------------------------------------------
// GB_IJLIST: given k, return the kth item i = I [k] in the list (32/64 bit)
//------------------------------------------------------------------------------

#define GB_IJLIST(I,k,Ikind,Icolon)                                         \
(                                                                           \
    (Ikind == GB_ALL) ?     (k) :                                           \
    ((Ikind == GB_RANGE) ?  (Icolon [GxB_BEGIN] + (k)) :                    \
    ((Ikind == GB_STRIDE) ? (Icolon [GxB_BEGIN] + (k) * Icolon [GxB_INC]) : \
    /* else GB_LIST */      (GB_IGET (I, k))))                              \
)

#endif