| 12 | #include "GB.h" |
| 13 | |
| 14 | GrB_Info GrB_Descriptor_new // create a new descriptor |
| 15 | ( |
| 16 | GrB_Descriptor *descriptor // handle of descriptor to create |
| 17 | ) |
| 18 | { |
| 19 | |
| 20 | //-------------------------------------------------------------------------- |
| 21 | // check inputs |
| 22 | //-------------------------------------------------------------------------- |
| 23 | |
| 24 | GB_WHERE1 ("GrB_Descriptor_new (&descriptor)") ; |
| 25 | GB_RETURN_IF_NULL (descriptor) ; |
| 26 | (*descriptor) = NULL ; |
| 27 | |
| 28 | //-------------------------------------------------------------------------- |
| 29 | // create the descriptor |
| 30 | //-------------------------------------------------------------------------- |
| 31 | |
| 32 | // allocate the descriptor |
| 33 | size_t header_size ; |
| 34 | (*descriptor) = GB_MALLOC (1, struct GB_Descriptor_opaque, &header_size) ; |
| 35 | if (*descriptor == NULL) |
| 36 | { |
| 37 | // out of memory |
| 38 | return (GrB_OUT_OF_MEMORY) ; |
| 39 | } |
| 40 | |
| 41 | // initialize the descriptor |
| 42 | GrB_Descriptor desc = *descriptor ; |
| 43 | desc->magic = GB_MAGIC ; |
| 44 | desc->header_size = header_size ; |
| 45 | desc->logger = NULL ; // error string |
| 46 | desc->logger_size = 0 ; |
| 47 | desc->out = GxB_DEFAULT ; // descriptor for output |
| 48 | desc->mask = GxB_DEFAULT ; // descriptor for the mask input |
| 49 | desc->in0 = GxB_DEFAULT ; // descriptor for the first input |
| 50 | desc->in1 = GxB_DEFAULT ; // descriptor for the second input |
| 51 | desc->axb = GxB_DEFAULT ; // descriptor for selecting the C=A*B method |
| 52 | desc->nthreads_max = GxB_DEFAULT ; // max # of threads to use |
| 53 | desc->chunk = GxB_DEFAULT ; // chunk for auto-tuning of # threads |
| 54 | desc->do_sort = false ; // do not sort in GrB_mxm and others |
| 55 | desc->compression = GxB_DEFAULT ; |
| 56 | desc->import = GxB_DEFAULT ; // trust input data in GxB import/deserialize |
| 57 | return (GrB_SUCCESS) ; |
| 58 | } |
| 59 |
no outgoing calls
no test coverage detected