MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / GxB_Desc_set

Function GxB_Desc_set

deps/GraphBLAS/Source/GxB_Desc_set.c:17–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15#include "GB.h"
16
17GrB_Info GxB_Desc_set // set a parameter in a descriptor
18(
19 GrB_Descriptor desc, // descriptor to modify
20 GrB_Desc_Field field, // parameter to change
21 ... // value to change it to
22)
23{
24
25 //--------------------------------------------------------------------------
26 // check inputs
27 //--------------------------------------------------------------------------
28
29 if (desc != NULL && desc->header_size == 0)
30 {
31 // built-in descriptors may not be modified
32 return (GrB_INVALID_VALUE) ;
33 }
34
35 GB_WHERE (desc, "GxB_Desc_set (desc, field, value)") ;
36 GB_RETURN_IF_NULL_OR_FAULTY (desc) ;
37 ASSERT_DESCRIPTOR_OK (desc, "desc to set", GB0) ;
38
39 //--------------------------------------------------------------------------
40 // set the parameter
41 //--------------------------------------------------------------------------
42
43 va_list ap ;
44
45 switch (field)
46 {
47
48 case GrB_OUTP :
49
50 {
51 va_start (ap, field) ;
52 int value = va_arg (ap, int) ;
53 va_end (ap) ;
54 if (! (value == GxB_DEFAULT || value == GrB_REPLACE))
55 {
56 GB_ERROR (GrB_INVALID_VALUE,
57 "invalid descriptor value [%d] for GrB_OUTP field;\n"
58 "must be GxB_DEFAULT [%d] or GrB_REPLACE [%d]",
59 value, (int) GxB_DEFAULT, (int) GrB_REPLACE) ;
60 }
61 desc->out = (GrB_Desc_Value) value ;
62 }
63 break ;
64
65 case GrB_MASK :
66
67 {
68 va_start (ap, field) ;
69 int value = va_arg (ap, int) ;
70 va_end (ap) ;
71 if (! (value == GxB_DEFAULT ||
72 value == GrB_COMP ||
73 value == GrB_STRUCTURE ||
74 value == (GrB_COMP + GrB_STRUCTURE)))

Callers 12

mexFunctionFunction · 0.85
mexFunctionFunction · 0.85
mexFunctionFunction · 0.85
mexFunctionFunction · 0.85
get_descriptorFunction · 0.85
mexFunctionFunction · 0.85
mexFunctionFunction · 0.85
mexFunctionFunction · 0.85
mexFunctionFunction · 0.85
get_descriptorFunction · 0.85
mexFunctionFunction · 0.85
mexFunctionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected