File: GxB_Iterator_get.c

package info (click to toggle)
suitesparse-graphblas 7.4.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 67,112 kB
  • sloc: ansic: 1,072,243; cpp: 8,081; sh: 512; makefile: 506; asm: 369; python: 125; awk: 10
file content (106 lines) | stat: -rw-r--r-- 2,940 bytes parent folder | download | duplicates (3)
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
//------------------------------------------------------------------------------
// GxB_Iterator_get_TYPE: get value of the current entry for any iterator
//------------------------------------------------------------------------------

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

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

#include "GB.h"

// On input, the prior call to GxB_*Iterator_*seek*, or GxB_*Iterator_*next*
// must have returned GrB_SUCCESS, indicating that the iterator is at a valid
// current entry for either a matrix or vector.

// Returns the value of the current entry at the position determined by the
// iterator.  No typecasting is permitted; the method name must match the
// type of the matrix or vector.

#undef GxB_Iterator_get_BOOL
#undef GxB_Iterator_get_INT8
#undef GxB_Iterator_get_INT16
#undef GxB_Iterator_get_INT32
#undef GxB_Iterator_get_INT64
#undef GxB_Iterator_get_UINT8
#undef GxB_Iterator_get_UINT16
#undef GxB_Iterator_get_UINT32
#undef GxB_Iterator_get_UINT64
#undef GxB_Iterator_get_FP32
#undef GxB_Iterator_get_FP64
#undef GxB_Iterator_get_FC32
#undef GxB_Iterator_get_FC64
#undef GxB_Iterator_get_UDT

bool GxB_Iterator_get_BOOL (GxB_Iterator iterator)
{ 
    return (GB_Iterator_get (iterator, bool)) ;
}

int8_t GxB_Iterator_get_INT8 (GxB_Iterator iterator)
{ 
    return (GB_Iterator_get (iterator, int8_t)) ;
}

int16_t GxB_Iterator_get_INT16 (GxB_Iterator iterator)
{ 
    return (GB_Iterator_get (iterator, int16_t)) ;
}

int32_t GxB_Iterator_get_INT32 (GxB_Iterator iterator)
{ 
    return (GB_Iterator_get (iterator, int32_t)) ;
}

int64_t GxB_Iterator_get_INT64 (GxB_Iterator iterator)
{ 
    return (GB_Iterator_get (iterator, int64_t)) ;
}

uint8_t GxB_Iterator_get_UINT8 (GxB_Iterator iterator)
{ 
    return (GB_Iterator_get (iterator, uint8_t)) ;
}

uint16_t GxB_Iterator_get_UINT16 (GxB_Iterator iterator)
{ 
    return (GB_Iterator_get (iterator, uint16_t)) ;
}

uint32_t GxB_Iterator_get_UINT32 (GxB_Iterator iterator)
{ 
    return (GB_Iterator_get (iterator, uint32_t)) ;
}

uint64_t GxB_Iterator_get_UINT64 (GxB_Iterator iterator)
{ 
    return (GB_Iterator_get (iterator, uint64_t)) ;
}

float GxB_Iterator_get_FP32 (GxB_Iterator iterator)
{ 
    return (GB_Iterator_get (iterator, float)) ;
}

double GxB_Iterator_get_FP64 (GxB_Iterator iterator)
{ 
    return (GB_Iterator_get (iterator, double)) ;
}

GxB_FC32_t GxB_Iterator_get_FC32 (GxB_Iterator iterator)
{ 
    return (GB_Iterator_get (iterator, GxB_FC32_t)) ;
}

GxB_FC64_t GxB_Iterator_get_FC64 (GxB_Iterator iterator)
{ 
    return (GB_Iterator_get (iterator, GxB_FC64_t)) ;
}

void GxB_Iterator_get_UDT (GxB_Iterator iterator, void *value)
{ 
    memcpy (value, ((const uint8_t *) (iterator->Ax)) +
        (iterator->iso ? 0 : (iterator->type_size * iterator->p)),
        iterator->type_size) ;
}