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
|
//------------------------------------------------------------------------------
// GB_helper.h: helper functions for @GrB interface
//------------------------------------------------------------------------------
// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2022, All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
//------------------------------------------------------------------------------
// These functions are only used by the @GrB interface for
// SuiteSparse:GraphBLAS.
#ifndef GB_HELPER_H
#define GB_HELPER_H
#include "GB.h"
GB_PUBLIC double GB_helper0 (void) ;
GB_PUBLIC
void GB_helper1 // convert zero-based indices to one-based
(
double *restrict I_double, // output array
const GrB_Index *restrict I, // input array
int64_t nvals // size of input and output arrays
) ;
GB_PUBLIC
void GB_helper1i // convert zero-based indices to one-based
(
int64_t *restrict I, // input/output array
int64_t nvals // size of input/output array
) ;
GB_PUBLIC
bool GB_helper3 // return true if OK, false on error
(
int64_t *restrict List, // size len, output array
const double *restrict List_double, // size len, input array
int64_t len,
int64_t *List_max // also compute the max entry in the list
) ;
GB_PUBLIC
bool GB_helper3i // return true if OK, false on error
(
int64_t *restrict List, // size len, output array
const int64_t *restrict List_int64, // size len, input array
int64_t len,
int64_t *List_max // also compute the max entry in the list
) ;
GB_PUBLIC
bool GB_helper4 // return true if OK, false on error
(
const GrB_Index *restrict I, // array of size len
const int64_t len,
GrB_Index *List_max // find max (I) + 1
) ;
GB_PUBLIC
void GB_helper5 // construct pattern of S
(
GrB_Index *restrict Si, // array of size anz
GrB_Index *restrict Sj, // array of size anz
const GrB_Index *restrict Mi, // array of size mnz, M->i
const GrB_Index *restrict Mj, // array of size mnz
const int64_t mvlen, // M->vlen
GrB_Index *restrict Ai, // array of size anz, A->i
const int64_t avlen, // M->vlen
const GrB_Index anz
) ;
GB_PUBLIC
void GB_helper7 // Kx = uint64 (0:mnz-1)
(
uint64_t *restrict Kx, // array of size mnz
const GrB_Index mnz
) ;
GB_PUBLIC
void GB_helper8
(
GB_void *C, // output array of size nvals * s
GB_void *A, // input scalar of size s
GrB_Index nvals, // size of C
size_t s // size of each scalar
) ;
GB_PUBLIC
double GB_helper10 // norm (x-y,p), or -1 on error
(
GB_void *x_arg, // float or double, depending on type parameter
bool x_iso, // true if x is iso
GB_void *y_arg, // same type as x, treat as zero if NULL
bool y_iso, // true if x is iso
GrB_Type type, // GrB_FP32 or GrB_FP64
int64_t p, // 0, 1, 2, INT64_MIN, or INT64_MAX
GrB_Index n
) ;
#endif
|