From 1883f0d2d405cc5b7d40a42eb69221d590102b3b Mon Sep 17 00:00:00 2001 From: Jim Kitchen Date: Thu, 22 Apr 2021 10:59:32 -0500 Subject: [PATCH 001/193] Move suitesparse/graphblas -> suitesparse_graphblas to avoid potential name conflicts --- setup.py | 2 +- suitesparse/__init__.py | 1 - {suitesparse/graphblas => suitesparse_graphblas}/__init__.py | 0 {suitesparse/graphblas => suitesparse_graphblas}/build.py | 2 +- .../graphblas => suitesparse_graphblas}/clean_header.py | 0 .../graphblas => suitesparse_graphblas}/create_headers.py | 0 {suitesparse/graphblas => suitesparse_graphblas}/source.c | 0 .../graphblas => suitesparse_graphblas}/suitesparse_graphblas.h | 0 .../suitesparse_graphblas_no_complex.h | 0 tests/test_package.py | 2 +- 10 files changed, 3 insertions(+), 4 deletions(-) delete mode 100644 suitesparse/__init__.py rename {suitesparse/graphblas => suitesparse_graphblas}/__init__.py (100%) rename {suitesparse/graphblas => suitesparse_graphblas}/build.py (93%) rename {suitesparse/graphblas => suitesparse_graphblas}/clean_header.py (100%) rename {suitesparse/graphblas => suitesparse_graphblas}/create_headers.py (100%) rename {suitesparse/graphblas => suitesparse_graphblas}/source.c (100%) rename {suitesparse/graphblas => suitesparse_graphblas}/suitesparse_graphblas.h (100%) rename {suitesparse/graphblas => suitesparse_graphblas}/suitesparse_graphblas_no_complex.h (100%) diff --git a/setup.py b/setup.py index 78ac159..d056918 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ description='SuiteSparse:GraphBLAS Python bindings.', packages=find_packages(), author='Michel Pelletier, James Kitchen, Erik Welch', - cffi_modules=["suitesparse/graphblas/build.py:ffibuilder"], + cffi_modules=["suitesparse_graphblas/build.py:ffibuilder"], install_requires=["cffi>=1.0.0"], setup_requires=["cffi>=1.0.0", "pytest-runner"], tests_require=["pytest"], diff --git a/suitesparse/__init__.py b/suitesparse/__init__.py deleted file mode 100644 index 8b13789..0000000 --- a/suitesparse/__init__.py +++ /dev/null @@ -1 +0,0 @@ - diff --git a/suitesparse/graphblas/__init__.py b/suitesparse_graphblas/__init__.py similarity index 100% rename from suitesparse/graphblas/__init__.py rename to suitesparse_graphblas/__init__.py diff --git a/suitesparse/graphblas/build.py b/suitesparse_graphblas/build.py similarity index 93% rename from suitesparse/graphblas/build.py rename to suitesparse_graphblas/build.py index 0a252e7..c52c3ad 100644 --- a/suitesparse/graphblas/build.py +++ b/suitesparse_graphblas/build.py @@ -11,7 +11,7 @@ source = f.read() ffibuilder.set_source( - "suitesparse.graphblas._graphblas", + "suitesparse_graphblas._graphblas", source, libraries=["graphblas"], include_dirs=[os.path.join(sys.prefix, "include")], diff --git a/suitesparse/graphblas/clean_header.py b/suitesparse_graphblas/clean_header.py similarity index 100% rename from suitesparse/graphblas/clean_header.py rename to suitesparse_graphblas/clean_header.py diff --git a/suitesparse/graphblas/create_headers.py b/suitesparse_graphblas/create_headers.py similarity index 100% rename from suitesparse/graphblas/create_headers.py rename to suitesparse_graphblas/create_headers.py diff --git a/suitesparse/graphblas/source.c b/suitesparse_graphblas/source.c similarity index 100% rename from suitesparse/graphblas/source.c rename to suitesparse_graphblas/source.c diff --git a/suitesparse/graphblas/suitesparse_graphblas.h b/suitesparse_graphblas/suitesparse_graphblas.h similarity index 100% rename from suitesparse/graphblas/suitesparse_graphblas.h rename to suitesparse_graphblas/suitesparse_graphblas.h diff --git a/suitesparse/graphblas/suitesparse_graphblas_no_complex.h b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h similarity index 100% rename from suitesparse/graphblas/suitesparse_graphblas_no_complex.h rename to suitesparse_graphblas/suitesparse_graphblas_no_complex.h diff --git a/tests/test_package.py b/tests/test_package.py index ce0f9a7..e56c1b3 100644 --- a/tests/test_package.py +++ b/tests/test_package.py @@ -1,4 +1,4 @@ -from suitesparse.graphblas import lib, ffi +from suitesparse_graphblas import lib, ffi def test_matrix_existence(): assert hasattr(lib, "GrB_Matrix_new") From 0c6c0eff252f534011e2dd3aa23505f53232ca75 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Thu, 22 Apr 2021 13:30:06 -0500 Subject: [PATCH 002/193] Add Cython utils needed for zero-copy import and export. --- LICENSE | 2 +- MANIFEST.in | 6 ++ pyproject.toml | 5 ++ setup.cfg | 16 +++++ setup.py | 58 ++++++++++++++- suitesparse_graphblas/tests/__init__.py | 0 .../tests}/test_package.py | 0 suitesparse_graphblas/utils.pxd | 34 +++++++++ suitesparse_graphblas/utils.pyx | 70 +++++++++++++++++++ 9 files changed, 187 insertions(+), 4 deletions(-) create mode 100644 MANIFEST.in create mode 100644 pyproject.toml create mode 100644 setup.cfg create mode 100644 suitesparse_graphblas/tests/__init__.py rename {tests => suitesparse_graphblas/tests}/test_package.py (100%) create mode 100644 suitesparse_graphblas/utils.pxd create mode 100644 suitesparse_graphblas/utils.pyx diff --git a/LICENSE b/LICENSE index 261eeb9..422684f 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2021 Anaconda Inc., Graphegon, and contributors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..03094eb --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,6 @@ +include setup.py +include README.md +include LICENSE +include suitesparse_graphblas/*.pxd +include suitesparse_graphblas/*.pyx +include suitesparse_graphblas/*.h diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..deaec6d --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,5 @@ +[build-system] +requires = ["setuptools", "wheel", "numpy >= 1.15"] + +[tool.black] +line-length = 100 diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..820380b --- /dev/null +++ b/setup.cfg @@ -0,0 +1,16 @@ +[aliases] +test=pytest + +[flake8] +max-line-length = 100 +exclude = + versioneer.py, + grblas/tests/test_formatting.py, +ignore = + E203, # whitespace before ':' + E231, # Multiple spaces around "," + W503, # line break before binary operator + +[tool:pytest] +testpaths = suitesparse_graphblas/tests + diff --git a/setup.py b/setup.py index d056918..cf21c9c 100644 --- a/setup.py +++ b/setup.py @@ -1,14 +1,66 @@ -from setuptools import setup, find_packages +from setuptools import setup, find_packages, Extension +from glob import glob +try: + from Cython.Build import cythonize + from Cython.Compiler.Options import get_directive_defaults + + use_cython = True +except ImportError: + use_cython = False +import numpy as np +import os +import sys + +define_macros = [("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")] + +if use_cython: + suffix = ".pyx" + directive_defaults = get_directive_defaults() + directive_defaults["binding"] = True + directive_defaults["language_level"] = 3 + if os.environ.get("CYTHON_COVERAGE"): + directive_defaults["linetrace"] = True + define_macros.append(("CYTHON_TRACE_NOGIL", "1")) +else: + suffix = ".c" + +include_dirs = [np.get_include(), os.path.join(sys.prefix, "include")] +ext_modules = [ + Extension( + name[: -len(suffix)].replace("/", ".").replace("\\", "."), + [name], + include_dirs=include_dirs, + define_macros=define_macros, + ) + for name in glob(f"suitesparse_graphblas/**/*{suffix}", recursive=True) +] +if use_cython: + ext_modules = cythonize(ext_modules, include_path=include_dirs) + +with open("README.md") as f: + long_description = f.read() + +package_data = {"suitesparse_graphblas": ["*.pyx", "*.pxd", "*.h"]} +if sys.platform == "win32": + package_data["suitesparse_graphblas"].append("*.dll") setup( name='suitesparse-graphblas', version='4.0.3', description='SuiteSparse:GraphBLAS Python bindings.', + long_description=long_description, + long_description_content_type="text/markdown", packages=find_packages(), author='Michel Pelletier, James Kitchen, Erik Welch', + author_email="jim22k@gmail.com,erik.n.welch@gmail.com", + url="https://github.com/GraphBLAS/python-suitesparse-graphblas", + ext_modules=ext_modules, cffi_modules=["suitesparse_graphblas/build.py:ffibuilder"], - install_requires=["cffi>=1.0.0"], + python_requires=">=3.7", + install_requires=["cffi>=1.0.0", "numpy>=1.15"], setup_requires=["cffi>=1.0.0", "pytest-runner"], tests_require=["pytest"], + license="Apache License 2.0", + package_data=package_data, + include_package_data=True, ) - diff --git a/suitesparse_graphblas/tests/__init__.py b/suitesparse_graphblas/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_package.py b/suitesparse_graphblas/tests/test_package.py similarity index 100% rename from tests/test_package.py rename to suitesparse_graphblas/tests/test_package.py diff --git a/suitesparse_graphblas/utils.pxd b/suitesparse_graphblas/utils.pxd new file mode 100644 index 0000000..5a742a2 --- /dev/null +++ b/suitesparse_graphblas/utils.pxd @@ -0,0 +1,34 @@ +from numpy cimport ndarray +from libc.stdint cimport uint64_t + +cdef extern from "numpy/arrayobject.h" nogil: + # These aren't public (i.e., "extern"), but other projects use them too + void *PyDataMem_NEW(size_t) + void *PyDataMem_NEW_ZEROED(size_t, size_t) + void *PyDataMem_RENEW(void *, size_t) + void PyDataMem_FREE(void *) + # These are available in newer Cython versions + void PyArray_ENABLEFLAGS(ndarray, int flags) + void PyArray_CLEARFLAGS(ndarray, int flags) + +ctypedef enum GrB_Mode: + GrB_NONBLOCKING + GrB_BLOCKING + +ctypedef uint64_t (*GxB_init)( + GrB_Mode, + void *(*user_malloc_function)(size_t), + void *(*user_calloc_function)(size_t, size_t), + void *(*user_realloc_function)(void *, size_t), + void (*user_free_function)(void *), + bint, # user_malloc_is_thread_safe +) + +cpdef int call_gxb_init(ffi, lib, int mode) + +cpdef ndarray claim_buffer(ffi, cdata, size_t size, dtype) + +cpdef ndarray claim_buffer_2d(ffi, cdata, size_t cdata_size, size_t nrows, size_t ncols, dtype, bint is_c_order) + +cpdef unclaim_buffer(ndarray array) + diff --git a/suitesparse_graphblas/utils.pyx b/suitesparse_graphblas/utils.pyx new file mode 100644 index 0000000..c800d8a --- /dev/null +++ b/suitesparse_graphblas/utils.pyx @@ -0,0 +1,70 @@ +import numpy as np +from numpy cimport ( + import_array, ndarray, npy_intp, + PyArray_SimpleNewFromData, PyArray_New, + NPY_ARRAY_OWNDATA, NPY_ARRAY_WRITEABLE, NPY_ARRAY_F_CONTIGUOUS, +) +from libc.stdint cimport uintptr_t + +import_array() + +cpdef int call_gxb_init(ffi, lib, int mode): + # We need to call `GxB_init`, but we didn't compile Cython against GraphBLAS. So, we get it from cffi. + # Step 1: ffi.addressof(lib, "GxB_init") + # Return type: cffi.cdata object of a function pointer. Can't cast to int. + # Step 2: ffi.cast("uintptr_t", ...) + # Return type: cffi.cdata object of a uintptr_t type, an unsigned pointer. Can cast to int. + # Step 3: int(...) + # Return type: int. The physical address of the function. + # Step 4: (...) + # Return type: uintptr_t in Cython. Cast Python int to Cython integer for pointers. + # Step 5: (...) + # Return: function pointer in Cython! + + cdef GxB_init func = int(ffi.cast("uintptr_t", ffi.addressof(lib, "GxB_init"))) + return func(mode, PyDataMem_NEW, PyDataMem_NEW_ZEROED, PyDataMem_RENEW, PyDataMem_FREE, True) + + +cpdef ndarray claim_buffer(ffi, cdata, size_t size, dtype): + cdef: + npy_intp dims = size + uintptr_t ptr = int(ffi.cast("uintptr_t", cdata)) + ndarray array = PyArray_SimpleNewFromData(1, &dims, dtype.num, ptr) + PyArray_ENABLEFLAGS(array, NPY_ARRAY_OWNDATA) + return array + + +cpdef ndarray claim_buffer_2d(ffi, cdata, size_t cdata_size, size_t nrows, size_t ncols, dtype, bint is_c_order): + cdef: + size_t size = nrows * ncols + ndarray array + uintptr_t ptr + npy_intp dims[2] + if cdata_size == size: + ptr = int(ffi.cast("uintptr_t", cdata)) + dims[0] = nrows + dims[1] = ncols + if is_c_order: + array = PyArray_SimpleNewFromData(2, dims, dtype.num, ptr) + else: + array = PyArray_New( + ndarray, 2, dims, dtype.num, NULL, ptr, -1, + NPY_ARRAY_F_CONTIGUOUS | NPY_ARRAY_WRITEABLE, NULL + ) + PyArray_ENABLEFLAGS(array, NPY_ARRAY_OWNDATA) + elif cdata_size > size: # pragma: no cover + array = claim_buffer(ffi, cdata, cdata_size, dtype) + if is_c_order: + array = array[:size].reshape((nrows, ncols)) + else: + array = array[:size].reshape((ncols, nrows)).T + else: # pragma: no cover + raise ValueError( + f"Buffer size too small: {cdata_size}. " + f"Unable to create matrix of size {nrows}x{ncols} = {size}" + ) + return array + + +cpdef unclaim_buffer(ndarray array): + PyArray_CLEARFLAGS(array, NPY_ARRAY_OWNDATA | NPY_ARRAY_WRITEABLE) From 0f1ac472ed0f3d42ff83f674c7d1a013b4d1f192 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Thu, 22 Apr 2021 15:00:35 -0500 Subject: [PATCH 003/193] Add versioneer --- .gitattributes | 1 + MANIFEST.in | 2 + setup.cfg | 9 +- setup.py | 3 +- suitesparse_graphblas/__init__.py | 5 + suitesparse_graphblas/_version.py | 548 ++++++ suitesparse_graphblas/create_headers.py | 27 +- suitesparse_graphblas/tests/test_package.py | 1 + versioneer.py | 1855 +++++++++++++++++++ 9 files changed, 2429 insertions(+), 22 deletions(-) create mode 100644 .gitattributes create mode 100644 suitesparse_graphblas/_version.py create mode 100644 versioneer.py diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..b6e1e78 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +suitesparse_graphblas/_version.py export-subst diff --git a/MANIFEST.in b/MANIFEST.in index 03094eb..440656f 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -4,3 +4,5 @@ include LICENSE include suitesparse_graphblas/*.pxd include suitesparse_graphblas/*.pyx include suitesparse_graphblas/*.h +include versioneer.py +include suitesparse_graphblas/_version.py diff --git a/setup.cfg b/setup.cfg index 820380b..9a7d334 100644 --- a/setup.cfg +++ b/setup.cfg @@ -5,12 +5,19 @@ test=pytest max-line-length = 100 exclude = versioneer.py, - grblas/tests/test_formatting.py, ignore = E203, # whitespace before ':' E231, # Multiple spaces around "," W503, # line break before binary operator +[versioneer] +VCS = git +style = pep440 +versionfile_source = suitesparse_graphblas/_version.py +versionfile_build = suitesparse_graphblas/_version.py +tag_prefix= +parentdir_prefix=suitesparse_graphblas- + [tool:pytest] testpaths = suitesparse_graphblas/tests diff --git a/setup.py b/setup.py index cf21c9c..7a4fa75 100644 --- a/setup.py +++ b/setup.py @@ -46,7 +46,8 @@ setup( name='suitesparse-graphblas', - version='4.0.3', + version=versioneer.get_version(), + cmdclass=versioneer.get_cmdclass(), description='SuiteSparse:GraphBLAS Python bindings.', long_description=long_description, long_description_content_type="text/markdown", diff --git a/suitesparse_graphblas/__init__.py b/suitesparse_graphblas/__init__.py index 8e13d9f..ae63bfa 100644 --- a/suitesparse_graphblas/__init__.py +++ b/suitesparse_graphblas/__init__.py @@ -1 +1,6 @@ from ._graphblas import ffi, lib + +from ._version import get_versions + +__version__ = get_versions()["version"] +del get_versions diff --git a/suitesparse_graphblas/_version.py b/suitesparse_graphblas/_version.py new file mode 100644 index 0000000..cd87a45 --- /dev/null +++ b/suitesparse_graphblas/_version.py @@ -0,0 +1,548 @@ +# This file helps to compute a version number in source trees obtained from +# git-archive tarball (such as those provided by githubs download-from-tag +# feature). Distribution tarballs (built by setup.py sdist) and build +# directories (produced by setup.py build) will contain a much shorter file +# that just contains the computed version number. + +# This file is released into the public domain. Generated by +# versioneer-0.19 (https://github.com/python-versioneer/python-versioneer) + +"""Git implementation of _version.py.""" + +import errno +import os +import re +import subprocess +import sys + + +def get_keywords(): + """Get the keywords needed to look up the version information.""" + # these strings will be replaced by git during git-archive. + # setup.py/versioneer.py will grep for the variable names, so they must + # each be defined on a line of their own. _version.py will just call + # get_keywords(). + git_refnames = "$Format:%d$" + git_full = "$Format:%H$" + git_date = "$Format:%ci$" + keywords = {"refnames": git_refnames, "full": git_full, "date": git_date} + return keywords + + +class VersioneerConfig: + """Container for Versioneer configuration parameters.""" + + +def get_config(): + """Create, populate and return the VersioneerConfig() object.""" + # these strings are filled in when 'setup.py versioneer' creates + # _version.py + cfg = VersioneerConfig() + cfg.VCS = "git" + cfg.style = "pep440" + cfg.tag_prefix = "" + cfg.parentdir_prefix = "suitesparse_graphblas-" + cfg.versionfile_source = "suitesparse_graphblas/_version.py" + cfg.verbose = False + return cfg + + +class NotThisMethod(Exception): + """Exception raised if a method is not valid for the current scenario.""" + + +LONG_VERSION_PY = {} +HANDLERS = {} + + +def register_vcs_handler(vcs, method): # decorator + """Create decorator to mark a method as the handler of a VCS.""" + + def decorate(f): + """Store f in HANDLERS[vcs][method].""" + if vcs not in HANDLERS: + HANDLERS[vcs] = {} + HANDLERS[vcs][method] = f + return f + + return decorate + + +def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False, env=None): + """Call the given command(s).""" + assert isinstance(commands, list) + p = None + for c in commands: + try: + dispcmd = str([c] + args) + # remember shell=False, so use git.cmd on windows, not just git + p = subprocess.Popen( + [c] + args, + cwd=cwd, + env=env, + stdout=subprocess.PIPE, + stderr=(subprocess.PIPE if hide_stderr else None), + ) + break + except EnvironmentError: + e = sys.exc_info()[1] + if e.errno == errno.ENOENT: + continue + if verbose: + print("unable to run %s" % dispcmd) + print(e) + return None, None + else: + if verbose: + print("unable to find command, tried %s" % (commands,)) + return None, None + stdout = p.communicate()[0].strip().decode() + if p.returncode != 0: + if verbose: + print("unable to run %s (error)" % dispcmd) + print("stdout was %s" % stdout) + return None, p.returncode + return stdout, p.returncode + + +def versions_from_parentdir(parentdir_prefix, root, verbose): + """Try to determine the version from the parent directory name. + + Source tarballs conventionally unpack into a directory that includes both + the project name and a version string. We will also support searching up + two directory levels for an appropriately named parent directory + """ + rootdirs = [] + + for i in range(3): + dirname = os.path.basename(root) + if dirname.startswith(parentdir_prefix): + return { + "version": dirname[len(parentdir_prefix) :], + "full-revisionid": None, + "dirty": False, + "error": None, + "date": None, + } + else: + rootdirs.append(root) + root = os.path.dirname(root) # up a level + + if verbose: + print( + "Tried directories %s but none started with prefix %s" + % (str(rootdirs), parentdir_prefix) + ) + raise NotThisMethod("rootdir doesn't start with parentdir_prefix") + + +@register_vcs_handler("git", "get_keywords") +def git_get_keywords(versionfile_abs): + """Extract version information from the given file.""" + # the code embedded in _version.py can just fetch the value of these + # keywords. When used from setup.py, we don't want to import _version.py, + # so we do it with a regexp instead. This function is not used from + # _version.py. + keywords = {} + try: + f = open(versionfile_abs, "r") + for line in f.readlines(): + if line.strip().startswith("git_refnames ="): + mo = re.search(r'=\s*"(.*)"', line) + if mo: + keywords["refnames"] = mo.group(1) + if line.strip().startswith("git_full ="): + mo = re.search(r'=\s*"(.*)"', line) + if mo: + keywords["full"] = mo.group(1) + if line.strip().startswith("git_date ="): + mo = re.search(r'=\s*"(.*)"', line) + if mo: + keywords["date"] = mo.group(1) + f.close() + except EnvironmentError: + pass + return keywords + + +@register_vcs_handler("git", "keywords") +def git_versions_from_keywords(keywords, tag_prefix, verbose): + """Get version information from git keywords.""" + if not keywords: + raise NotThisMethod("no keywords at all, weird") + date = keywords.get("date") + if date is not None: + # Use only the last line. Previous lines may contain GPG signature + # information. + date = date.splitlines()[-1] + + # git-2.2.0 added "%cI", which expands to an ISO-8601 -compliant + # datestamp. However we prefer "%ci" (which expands to an "ISO-8601 + # -like" string, which we must then edit to make compliant), because + # it's been around since git-1.5.3, and it's too difficult to + # discover which version we're using, or to work around using an + # older one. + date = date.strip().replace(" ", "T", 1).replace(" ", "", 1) + refnames = keywords["refnames"].strip() + if refnames.startswith("$Format"): + if verbose: + print("keywords are unexpanded, not using") + raise NotThisMethod("unexpanded keywords, not a git-archive tarball") + refs = set([r.strip() for r in refnames.strip("()").split(",")]) + # starting in git-1.8.3, tags are listed as "tag: foo-1.0" instead of + # just "foo-1.0". If we see a "tag: " prefix, prefer those. + TAG = "tag: " + tags = set([r[len(TAG) :] for r in refs if r.startswith(TAG)]) + if not tags: + # Either we're using git < 1.8.3, or there really are no tags. We use + # a heuristic: assume all version tags have a digit. The old git %d + # expansion behaves like git log --decorate=short and strips out the + # refs/heads/ and refs/tags/ prefixes that would let us distinguish + # between branches and tags. By ignoring refnames without digits, we + # filter out many common branch names like "release" and + # "stabilization", as well as "HEAD" and "master". + tags = set([r for r in refs if re.search(r"\d", r)]) + if verbose: + print("discarding '%s', no digits" % ",".join(refs - tags)) + if verbose: + print("likely tags: %s" % ",".join(sorted(tags))) + for ref in sorted(tags): + # sorting will prefer e.g. "2.0" over "2.0rc1" + if ref.startswith(tag_prefix): + r = ref[len(tag_prefix) :] + if verbose: + print("picking %s" % r) + return { + "version": r, + "full-revisionid": keywords["full"].strip(), + "dirty": False, + "error": None, + "date": date, + } + # no suitable tags, so version is "0+unknown", but full hex is still there + if verbose: + print("no suitable tags, using unknown + full revision id") + return { + "version": "0+unknown", + "full-revisionid": keywords["full"].strip(), + "dirty": False, + "error": "no suitable tags", + "date": None, + } + + +@register_vcs_handler("git", "pieces_from_vcs") +def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command): + """Get version from 'git describe' in the root of the source tree. + + This only gets called if the git-archive 'subst' keywords were *not* + expanded, and _version.py hasn't already been rewritten with a short + version string, meaning we're inside a checked out source tree. + """ + GITS = ["git"] + if sys.platform == "win32": + GITS = ["git.cmd", "git.exe"] + + out, rc = run_command(GITS, ["rev-parse", "--git-dir"], cwd=root, hide_stderr=True) + if rc != 0: + if verbose: + print("Directory %s not under git control" % root) + raise NotThisMethod("'git rev-parse --git-dir' returned error") + + # if there is a tag matching tag_prefix, this yields TAG-NUM-gHEX[-dirty] + # if there isn't one, this yields HEX[-dirty] (no NUM) + describe_out, rc = run_command( + GITS, + ["describe", "--tags", "--dirty", "--always", "--long", "--match", "%s*" % tag_prefix], + cwd=root, + ) + # --long was added in git-1.5.5 + if describe_out is None: + raise NotThisMethod("'git describe' failed") + describe_out = describe_out.strip() + full_out, rc = run_command(GITS, ["rev-parse", "HEAD"], cwd=root) + if full_out is None: + raise NotThisMethod("'git rev-parse' failed") + full_out = full_out.strip() + + pieces = {} + pieces["long"] = full_out + pieces["short"] = full_out[:7] # maybe improved later + pieces["error"] = None + + # parse describe_out. It will be like TAG-NUM-gHEX[-dirty] or HEX[-dirty] + # TAG might have hyphens. + git_describe = describe_out + + # look for -dirty suffix + dirty = git_describe.endswith("-dirty") + pieces["dirty"] = dirty + if dirty: + git_describe = git_describe[: git_describe.rindex("-dirty")] + + # now we have TAG-NUM-gHEX or HEX + + if "-" in git_describe: + # TAG-NUM-gHEX + mo = re.search(r"^(.+)-(\d+)-g([0-9a-f]+)$", git_describe) + if not mo: + # unparseable. Maybe git-describe is misbehaving? + pieces["error"] = "unable to parse git-describe output: '%s'" % describe_out + return pieces + + # tag + full_tag = mo.group(1) + if not full_tag.startswith(tag_prefix): + if verbose: + fmt = "tag '%s' doesn't start with prefix '%s'" + print(fmt % (full_tag, tag_prefix)) + pieces["error"] = "tag '%s' doesn't start with prefix '%s'" % (full_tag, tag_prefix) + return pieces + pieces["closest-tag"] = full_tag[len(tag_prefix) :] + + # distance: number of commits since tag + pieces["distance"] = int(mo.group(2)) + + # commit: short hex revision ID + pieces["short"] = mo.group(3) + + else: + # HEX: no tags + pieces["closest-tag"] = None + count_out, rc = run_command(GITS, ["rev-list", "HEAD", "--count"], cwd=root) + pieces["distance"] = int(count_out) # total number of commits + + # commit date: see ISO-8601 comment in git_versions_from_keywords() + date = run_command(GITS, ["show", "-s", "--format=%ci", "HEAD"], cwd=root)[0].strip() + # Use only the last line. Previous lines may contain GPG signature + # information. + date = date.splitlines()[-1] + pieces["date"] = date.strip().replace(" ", "T", 1).replace(" ", "", 1) + + return pieces + + +def plus_or_dot(pieces): + """Return a + if we don't already have one, else return a .""" + if "+" in pieces.get("closest-tag", ""): + return "." + return "+" + + +def render_pep440(pieces): + """Build up version string, with post-release "local version identifier". + + Our goal: TAG[+DISTANCE.gHEX[.dirty]] . Note that if you + get a tagged build and then dirty it, you'll get TAG+0.gHEX.dirty + + Exceptions: + 1: no tags. git_describe was just HEX. 0+untagged.DISTANCE.gHEX[.dirty] + """ + if pieces["closest-tag"]: + rendered = pieces["closest-tag"] + if pieces["distance"] or pieces["dirty"]: + rendered += plus_or_dot(pieces) + rendered += "%d.g%s" % (pieces["distance"], pieces["short"]) + if pieces["dirty"]: + rendered += ".dirty" + else: + # exception #1 + rendered = "0+untagged.%d.g%s" % (pieces["distance"], pieces["short"]) + if pieces["dirty"]: + rendered += ".dirty" + return rendered + + +def render_pep440_pre(pieces): + """TAG[.post0.devDISTANCE] -- No -dirty. + + Exceptions: + 1: no tags. 0.post0.devDISTANCE + """ + if pieces["closest-tag"]: + rendered = pieces["closest-tag"] + if pieces["distance"]: + rendered += ".post0.dev%d" % pieces["distance"] + else: + # exception #1 + rendered = "0.post0.dev%d" % pieces["distance"] + return rendered + + +def render_pep440_post(pieces): + """TAG[.postDISTANCE[.dev0]+gHEX] . + + The ".dev0" means dirty. Note that .dev0 sorts backwards + (a dirty tree will appear "older" than the corresponding clean one), + but you shouldn't be releasing software with -dirty anyways. + + Exceptions: + 1: no tags. 0.postDISTANCE[.dev0] + """ + if pieces["closest-tag"]: + rendered = pieces["closest-tag"] + if pieces["distance"] or pieces["dirty"]: + rendered += ".post%d" % pieces["distance"] + if pieces["dirty"]: + rendered += ".dev0" + rendered += plus_or_dot(pieces) + rendered += "g%s" % pieces["short"] + else: + # exception #1 + rendered = "0.post%d" % pieces["distance"] + if pieces["dirty"]: + rendered += ".dev0" + rendered += "+g%s" % pieces["short"] + return rendered + + +def render_pep440_old(pieces): + """TAG[.postDISTANCE[.dev0]] . + + The ".dev0" means dirty. + + Exceptions: + 1: no tags. 0.postDISTANCE[.dev0] + """ + if pieces["closest-tag"]: + rendered = pieces["closest-tag"] + if pieces["distance"] or pieces["dirty"]: + rendered += ".post%d" % pieces["distance"] + if pieces["dirty"]: + rendered += ".dev0" + else: + # exception #1 + rendered = "0.post%d" % pieces["distance"] + if pieces["dirty"]: + rendered += ".dev0" + return rendered + + +def render_git_describe(pieces): + """TAG[-DISTANCE-gHEX][-dirty]. + + Like 'git describe --tags --dirty --always'. + + Exceptions: + 1: no tags. HEX[-dirty] (note: no 'g' prefix) + """ + if pieces["closest-tag"]: + rendered = pieces["closest-tag"] + if pieces["distance"]: + rendered += "-%d-g%s" % (pieces["distance"], pieces["short"]) + else: + # exception #1 + rendered = pieces["short"] + if pieces["dirty"]: + rendered += "-dirty" + return rendered + + +def render_git_describe_long(pieces): + """TAG-DISTANCE-gHEX[-dirty]. + + Like 'git describe --tags --dirty --always -long'. + The distance/hash is unconditional. + + Exceptions: + 1: no tags. HEX[-dirty] (note: no 'g' prefix) + """ + if pieces["closest-tag"]: + rendered = pieces["closest-tag"] + rendered += "-%d-g%s" % (pieces["distance"], pieces["short"]) + else: + # exception #1 + rendered = pieces["short"] + if pieces["dirty"]: + rendered += "-dirty" + return rendered + + +def render(pieces, style): + """Render the given version pieces into the requested style.""" + if pieces["error"]: + return { + "version": "unknown", + "full-revisionid": pieces.get("long"), + "dirty": None, + "error": pieces["error"], + "date": None, + } + + if not style or style == "default": + style = "pep440" # the default + + if style == "pep440": + rendered = render_pep440(pieces) + elif style == "pep440-pre": + rendered = render_pep440_pre(pieces) + elif style == "pep440-post": + rendered = render_pep440_post(pieces) + elif style == "pep440-old": + rendered = render_pep440_old(pieces) + elif style == "git-describe": + rendered = render_git_describe(pieces) + elif style == "git-describe-long": + rendered = render_git_describe_long(pieces) + else: + raise ValueError("unknown style '%s'" % style) + + return { + "version": rendered, + "full-revisionid": pieces["long"], + "dirty": pieces["dirty"], + "error": None, + "date": pieces.get("date"), + } + + +def get_versions(): + """Get version information or return default if unable to do so.""" + # I am in _version.py, which lives at ROOT/VERSIONFILE_SOURCE. If we have + # __file__, we can work backwards from there to the root. Some + # py2exe/bbfreeze/non-CPython implementations don't do __file__, in which + # case we can only use expanded keywords. + + cfg = get_config() + verbose = cfg.verbose + + try: + return git_versions_from_keywords(get_keywords(), cfg.tag_prefix, verbose) + except NotThisMethod: + pass + + try: + root = os.path.realpath(__file__) + # versionfile_source is the relative path from the top of the source + # tree (where the .git directory might live) to this file. Invert + # this to find the root from __file__. + for i in cfg.versionfile_source.split("/"): + root = os.path.dirname(root) + except NameError: + return { + "version": "0+unknown", + "full-revisionid": None, + "dirty": None, + "error": "unable to find root of source tree", + "date": None, + } + + try: + pieces = git_pieces_from_vcs(cfg.tag_prefix, root, verbose) + return render(pieces, cfg.style) + except NotThisMethod: + pass + + try: + if cfg.parentdir_prefix: + return versions_from_parentdir(cfg.parentdir_prefix, root, verbose) + except NotThisMethod: + pass + + return { + "version": "0+unknown", + "full-revisionid": None, + "dirty": None, + "error": "unable to compute version", + "date": None, + } diff --git a/suitesparse_graphblas/create_headers.py b/suitesparse_graphblas/create_headers.py index 74a5b8a..9a5f528 100644 --- a/suitesparse_graphblas/create_headers.py +++ b/suitesparse_graphblas/create_headers.py @@ -380,9 +380,7 @@ def get_groups(ast): seen.update(vals) groups["GrB typedef"] = sorted(vals, key=sort_key) - missing_typedefs = { - x for x in lines if "typedef" in x and "GB" in x and "(" not in x - } - seen + missing_typedefs = {x for x in lines if "typedef" in x and "GB" in x and "(" not in x} - seen assert not missing_typedefs assert all(x.endswith(";") for x in seen) # sanity check @@ -393,20 +391,14 @@ def get_groups(ast): vals = {x for x in enums if "} GrB" in x} for val in vals: seen.update(val.splitlines()) - groups["GrB typedef enums"] = sorted( - vals, key=lambda x: sort_key(x.rsplit("}", 1)[-1]) - ) + groups["GrB typedef enums"] = sorted(vals, key=lambda x: sort_key(x.rsplit("}", 1)[-1])) vals = {x for x in enums if "} GxB" in x} for val in vals: seen.update(val.splitlines()) - groups["GxB typedef enums"] = sorted( - vals, key=lambda x: sort_key(x.rsplit("}", 1)[-1]) - ) + groups["GxB typedef enums"] = sorted(vals, key=lambda x: sort_key(x.rsplit("}", 1)[-1])) - missing_enums = ( - set(enums) - set(groups["GrB typedef enums"]) - set(groups["GxB typedef enums"]) - ) + missing_enums = set(enums) - set(groups["GrB typedef enums"]) - set(groups["GxB typedef enums"]) assert not missing_enums vals = {x for x in lines if "typedef" in x and "GxB" in x} - seen @@ -757,9 +749,7 @@ def main(): # Run it through the preprocessor print(f"Step 2: run preprocessor to create {processed_h}") - include = os.path.join( - os.path.dirname(pycparser.__file__), "utils", "fake_libc_include" - ) + include = os.path.join(os.path.dirname(pycparser.__file__), "utils", "fake_libc_include") command = ( f"gcc -nostdinc -E -I{include} {graphblas_h} " f"| sed 's/ complex / _Complex /g' > {processed_h}" @@ -804,15 +794,12 @@ def main(): unknown_defines = defines - DEFINES - CHAR_DEFINES - IGNORE_DEFINES if unknown_defines: raise ValueError( - f"Unknown #define values found in {graphblas_h}: " - + ", ".join(sorted(unknown_defines)) + f"Unknown #define values found in {graphblas_h}: " + ", ".join(sorted(unknown_defines)) ) print("Success!", "\N{ROCKET}") if args.show_skipped: print() - print( - f"Showing lines from {processed_h} that were skipped when creating {final_h}:" - ) + print(f"Showing lines from {processed_h} that were skipped when creating {final_h}:") print("-" * 80) for line in sorted(groups["not seen"], key=sort_key): print(line) diff --git a/suitesparse_graphblas/tests/test_package.py b/suitesparse_graphblas/tests/test_package.py index e56c1b3..914662d 100644 --- a/suitesparse_graphblas/tests/test_package.py +++ b/suitesparse_graphblas/tests/test_package.py @@ -1,4 +1,5 @@ from suitesparse_graphblas import lib, ffi + def test_matrix_existence(): assert hasattr(lib, "GrB_Matrix_new") diff --git a/versioneer.py b/versioneer.py new file mode 100644 index 0000000..1040c21 --- /dev/null +++ b/versioneer.py @@ -0,0 +1,1855 @@ + +# Version: 0.19 + +"""The Versioneer - like a rocketeer, but for versions. + +The Versioneer +============== + +* like a rocketeer, but for versions! +* https://github.com/python-versioneer/python-versioneer +* Brian Warner +* License: Public Domain +* Compatible with: Python 3.6, 3.7, 3.8, 3.9 and pypy3 +* [![Latest Version][pypi-image]][pypi-url] +* [![Build Status][travis-image]][travis-url] + +This is a tool for managing a recorded version number in distutils-based +python projects. The goal is to remove the tedious and error-prone "update +the embedded version string" step from your release process. Making a new +release should be as easy as recording a new tag in your version-control +system, and maybe making new tarballs. + + +## Quick Install + +* `pip install versioneer` to somewhere in your $PATH +* add a `[versioneer]` section to your setup.cfg (see [Install](INSTALL.md)) +* run `versioneer install` in your source tree, commit the results +* Verify version information with `python setup.py version` + +## Version Identifiers + +Source trees come from a variety of places: + +* a version-control system checkout (mostly used by developers) +* a nightly tarball, produced by build automation +* a snapshot tarball, produced by a web-based VCS browser, like github's + "tarball from tag" feature +* a release tarball, produced by "setup.py sdist", distributed through PyPI + +Within each source tree, the version identifier (either a string or a number, +this tool is format-agnostic) can come from a variety of places: + +* ask the VCS tool itself, e.g. "git describe" (for checkouts), which knows + about recent "tags" and an absolute revision-id +* the name of the directory into which the tarball was unpacked +* an expanded VCS keyword ($Id$, etc) +* a `_version.py` created by some earlier build step + +For released software, the version identifier is closely related to a VCS +tag. Some projects use tag names that include more than just the version +string (e.g. "myproject-1.2" instead of just "1.2"), in which case the tool +needs to strip the tag prefix to extract the version identifier. For +unreleased software (between tags), the version identifier should provide +enough information to help developers recreate the same tree, while also +giving them an idea of roughly how old the tree is (after version 1.2, before +version 1.3). Many VCS systems can report a description that captures this, +for example `git describe --tags --dirty --always` reports things like +"0.7-1-g574ab98-dirty" to indicate that the checkout is one revision past the +0.7 tag, has a unique revision id of "574ab98", and is "dirty" (it has +uncommitted changes). + +The version identifier is used for multiple purposes: + +* to allow the module to self-identify its version: `myproject.__version__` +* to choose a name and prefix for a 'setup.py sdist' tarball + +## Theory of Operation + +Versioneer works by adding a special `_version.py` file into your source +tree, where your `__init__.py` can import it. This `_version.py` knows how to +dynamically ask the VCS tool for version information at import time. + +`_version.py` also contains `$Revision$` markers, and the installation +process marks `_version.py` to have this marker rewritten with a tag name +during the `git archive` command. As a result, generated tarballs will +contain enough information to get the proper version. + +To allow `setup.py` to compute a version too, a `versioneer.py` is added to +the top level of your source tree, next to `setup.py` and the `setup.cfg` +that configures it. This overrides several distutils/setuptools commands to +compute the version when invoked, and changes `setup.py build` and `setup.py +sdist` to replace `_version.py` with a small static file that contains just +the generated version data. + +## Installation + +See [INSTALL.md](./INSTALL.md) for detailed installation instructions. + +## Version-String Flavors + +Code which uses Versioneer can learn about its version string at runtime by +importing `_version` from your main `__init__.py` file and running the +`get_versions()` function. From the "outside" (e.g. in `setup.py`), you can +import the top-level `versioneer.py` and run `get_versions()`. + +Both functions return a dictionary with different flavors of version +information: + +* `['version']`: A condensed version string, rendered using the selected + style. This is the most commonly used value for the project's version + string. The default "pep440" style yields strings like `0.11`, + `0.11+2.g1076c97`, or `0.11+2.g1076c97.dirty`. See the "Styles" section + below for alternative styles. + +* `['full-revisionid']`: detailed revision identifier. For Git, this is the + full SHA1 commit id, e.g. "1076c978a8d3cfc70f408fe5974aa6c092c949ac". + +* `['date']`: Date and time of the latest `HEAD` commit. For Git, it is the + commit date in ISO 8601 format. This will be None if the date is not + available. + +* `['dirty']`: a boolean, True if the tree has uncommitted changes. Note that + this is only accurate if run in a VCS checkout, otherwise it is likely to + be False or None + +* `['error']`: if the version string could not be computed, this will be set + to a string describing the problem, otherwise it will be None. It may be + useful to throw an exception in setup.py if this is set, to avoid e.g. + creating tarballs with a version string of "unknown". + +Some variants are more useful than others. Including `full-revisionid` in a +bug report should allow developers to reconstruct the exact code being tested +(or indicate the presence of local changes that should be shared with the +developers). `version` is suitable for display in an "about" box or a CLI +`--version` output: it can be easily compared against release notes and lists +of bugs fixed in various releases. + +The installer adds the following text to your `__init__.py` to place a basic +version in `YOURPROJECT.__version__`: + + from ._version import get_versions + __version__ = get_versions()['version'] + del get_versions + +## Styles + +The setup.cfg `style=` configuration controls how the VCS information is +rendered into a version string. + +The default style, "pep440", produces a PEP440-compliant string, equal to the +un-prefixed tag name for actual releases, and containing an additional "local +version" section with more detail for in-between builds. For Git, this is +TAG[+DISTANCE.gHEX[.dirty]] , using information from `git describe --tags +--dirty --always`. For example "0.11+2.g1076c97.dirty" indicates that the +tree is like the "1076c97" commit but has uncommitted changes (".dirty"), and +that this commit is two revisions ("+2") beyond the "0.11" tag. For released +software (exactly equal to a known tag), the identifier will only contain the +stripped tag, e.g. "0.11". + +Other styles are available. See [details.md](details.md) in the Versioneer +source tree for descriptions. + +## Debugging + +Versioneer tries to avoid fatal errors: if something goes wrong, it will tend +to return a version of "0+unknown". To investigate the problem, run `setup.py +version`, which will run the version-lookup code in a verbose mode, and will +display the full contents of `get_versions()` (including the `error` string, +which may help identify what went wrong). + +## Known Limitations + +Some situations are known to cause problems for Versioneer. This details the +most significant ones. More can be found on Github +[issues page](https://github.com/python-versioneer/python-versioneer/issues). + +### Subprojects + +Versioneer has limited support for source trees in which `setup.py` is not in +the root directory (e.g. `setup.py` and `.git/` are *not* siblings). The are +two common reasons why `setup.py` might not be in the root: + +* Source trees which contain multiple subprojects, such as + [Buildbot](https://github.com/buildbot/buildbot), which contains both + "master" and "slave" subprojects, each with their own `setup.py`, + `setup.cfg`, and `tox.ini`. Projects like these produce multiple PyPI + distributions (and upload multiple independently-installable tarballs). +* Source trees whose main purpose is to contain a C library, but which also + provide bindings to Python (and perhaps other languages) in subdirectories. + +Versioneer will look for `.git` in parent directories, and most operations +should get the right version string. However `pip` and `setuptools` have bugs +and implementation details which frequently cause `pip install .` from a +subproject directory to fail to find a correct version string (so it usually +defaults to `0+unknown`). + +`pip install --editable .` should work correctly. `setup.py install` might +work too. + +Pip-8.1.1 is known to have this problem, but hopefully it will get fixed in +some later version. + +[Bug #38](https://github.com/python-versioneer/python-versioneer/issues/38) is tracking +this issue. The discussion in +[PR #61](https://github.com/python-versioneer/python-versioneer/pull/61) describes the +issue from the Versioneer side in more detail. +[pip PR#3176](https://github.com/pypa/pip/pull/3176) and +[pip PR#3615](https://github.com/pypa/pip/pull/3615) contain work to improve +pip to let Versioneer work correctly. + +Versioneer-0.16 and earlier only looked for a `.git` directory next to the +`setup.cfg`, so subprojects were completely unsupported with those releases. + +### Editable installs with setuptools <= 18.5 + +`setup.py develop` and `pip install --editable .` allow you to install a +project into a virtualenv once, then continue editing the source code (and +test) without re-installing after every change. + +"Entry-point scripts" (`setup(entry_points={"console_scripts": ..})`) are a +convenient way to specify executable scripts that should be installed along +with the python package. + +These both work as expected when using modern setuptools. When using +setuptools-18.5 or earlier, however, certain operations will cause +`pkg_resources.DistributionNotFound` errors when running the entrypoint +script, which must be resolved by re-installing the package. This happens +when the install happens with one version, then the egg_info data is +regenerated while a different version is checked out. Many setup.py commands +cause egg_info to be rebuilt (including `sdist`, `wheel`, and installing into +a different virtualenv), so this can be surprising. + +[Bug #83](https://github.com/python-versioneer/python-versioneer/issues/83) describes +this one, but upgrading to a newer version of setuptools should probably +resolve it. + + +## Updating Versioneer + +To upgrade your project to a new release of Versioneer, do the following: + +* install the new Versioneer (`pip install -U versioneer` or equivalent) +* edit `setup.cfg`, if necessary, to include any new configuration settings + indicated by the release notes. See [UPGRADING](./UPGRADING.md) for details. +* re-run `versioneer install` in your source tree, to replace + `SRC/_version.py` +* commit any changed files + +## Future Directions + +This tool is designed to make it easily extended to other version-control +systems: all VCS-specific components are in separate directories like +src/git/ . The top-level `versioneer.py` script is assembled from these +components by running make-versioneer.py . In the future, make-versioneer.py +will take a VCS name as an argument, and will construct a version of +`versioneer.py` that is specific to the given VCS. It might also take the +configuration arguments that are currently provided manually during +installation by editing setup.py . Alternatively, it might go the other +direction and include code from all supported VCS systems, reducing the +number of intermediate scripts. + +## Similar projects + +* [setuptools_scm](https://github.com/pypa/setuptools_scm/) - a non-vendored build-time + dependency +* [minver](https://github.com/jbweston/miniver) - a lightweight reimplementation of + versioneer + +## License + +To make Versioneer easier to embed, all its code is dedicated to the public +domain. The `_version.py` that it creates is also in the public domain. +Specifically, both are released under the Creative Commons "Public Domain +Dedication" license (CC0-1.0), as described in +https://creativecommons.org/publicdomain/zero/1.0/ . + +[pypi-image]: https://img.shields.io/pypi/v/versioneer.svg +[pypi-url]: https://pypi.python.org/pypi/versioneer/ +[travis-image]: +https://img.shields.io/travis/com/python-versioneer/python-versioneer.svg +[travis-url]: https://travis-ci.com/github/python-versioneer/python-versioneer + +""" + +import configparser +import errno +import json +import os +import re +import subprocess +import sys + + +class VersioneerConfig: + """Container for Versioneer configuration parameters.""" + + +def get_root(): + """Get the project root directory. + + We require that all commands are run from the project root, i.e. the + directory that contains setup.py, setup.cfg, and versioneer.py . + """ + root = os.path.realpath(os.path.abspath(os.getcwd())) + setup_py = os.path.join(root, "setup.py") + versioneer_py = os.path.join(root, "versioneer.py") + if not (os.path.exists(setup_py) or os.path.exists(versioneer_py)): + # allow 'python path/to/setup.py COMMAND' + root = os.path.dirname(os.path.realpath(os.path.abspath(sys.argv[0]))) + setup_py = os.path.join(root, "setup.py") + versioneer_py = os.path.join(root, "versioneer.py") + if not (os.path.exists(setup_py) or os.path.exists(versioneer_py)): + err = ("Versioneer was unable to run the project root directory. " + "Versioneer requires setup.py to be executed from " + "its immediate directory (like 'python setup.py COMMAND'), " + "or in a way that lets it use sys.argv[0] to find the root " + "(like 'python path/to/setup.py COMMAND').") + raise VersioneerBadRootError(err) + try: + # Certain runtime workflows (setup.py install/develop in a setuptools + # tree) execute all dependencies in a single python process, so + # "versioneer" may be imported multiple times, and python's shared + # module-import table will cache the first one. So we can't use + # os.path.dirname(__file__), as that will find whichever + # versioneer.py was first imported, even in later projects. + me = os.path.realpath(os.path.abspath(__file__)) + me_dir = os.path.normcase(os.path.splitext(me)[0]) + vsr_dir = os.path.normcase(os.path.splitext(versioneer_py)[0]) + if me_dir != vsr_dir: + print("Warning: build in %s is using versioneer.py from %s" + % (os.path.dirname(me), versioneer_py)) + except NameError: + pass + return root + + +def get_config_from_root(root): + """Read the project setup.cfg file to determine Versioneer config.""" + # This might raise EnvironmentError (if setup.cfg is missing), or + # configparser.NoSectionError (if it lacks a [versioneer] section), or + # configparser.NoOptionError (if it lacks "VCS="). See the docstring at + # the top of versioneer.py for instructions on writing your setup.cfg . + setup_cfg = os.path.join(root, "setup.cfg") + parser = configparser.ConfigParser() + with open(setup_cfg, "r") as f: + parser.read_file(f) + VCS = parser.get("versioneer", "VCS") # mandatory + + def get(parser, name): + if parser.has_option("versioneer", name): + return parser.get("versioneer", name) + return None + cfg = VersioneerConfig() + cfg.VCS = VCS + cfg.style = get(parser, "style") or "" + cfg.versionfile_source = get(parser, "versionfile_source") + cfg.versionfile_build = get(parser, "versionfile_build") + cfg.tag_prefix = get(parser, "tag_prefix") + if cfg.tag_prefix in ("''", '""'): + cfg.tag_prefix = "" + cfg.parentdir_prefix = get(parser, "parentdir_prefix") + cfg.verbose = get(parser, "verbose") + return cfg + + +class NotThisMethod(Exception): + """Exception raised if a method is not valid for the current scenario.""" + + +# these dictionaries contain VCS-specific tools +LONG_VERSION_PY = {} +HANDLERS = {} + + +def register_vcs_handler(vcs, method): # decorator + """Create decorator to mark a method as the handler of a VCS.""" + def decorate(f): + """Store f in HANDLERS[vcs][method].""" + if vcs not in HANDLERS: + HANDLERS[vcs] = {} + HANDLERS[vcs][method] = f + return f + return decorate + + +def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False, + env=None): + """Call the given command(s).""" + assert isinstance(commands, list) + p = None + for c in commands: + try: + dispcmd = str([c] + args) + # remember shell=False, so use git.cmd on windows, not just git + p = subprocess.Popen([c] + args, cwd=cwd, env=env, + stdout=subprocess.PIPE, + stderr=(subprocess.PIPE if hide_stderr + else None)) + break + except EnvironmentError: + e = sys.exc_info()[1] + if e.errno == errno.ENOENT: + continue + if verbose: + print("unable to run %s" % dispcmd) + print(e) + return None, None + else: + if verbose: + print("unable to find command, tried %s" % (commands,)) + return None, None + stdout = p.communicate()[0].strip().decode() + if p.returncode != 0: + if verbose: + print("unable to run %s (error)" % dispcmd) + print("stdout was %s" % stdout) + return None, p.returncode + return stdout, p.returncode + + +LONG_VERSION_PY['git'] = r''' +# This file helps to compute a version number in source trees obtained from +# git-archive tarball (such as those provided by githubs download-from-tag +# feature). Distribution tarballs (built by setup.py sdist) and build +# directories (produced by setup.py build) will contain a much shorter file +# that just contains the computed version number. + +# This file is released into the public domain. Generated by +# versioneer-0.19 (https://github.com/python-versioneer/python-versioneer) + +"""Git implementation of _version.py.""" + +import errno +import os +import re +import subprocess +import sys + + +def get_keywords(): + """Get the keywords needed to look up the version information.""" + # these strings will be replaced by git during git-archive. + # setup.py/versioneer.py will grep for the variable names, so they must + # each be defined on a line of their own. _version.py will just call + # get_keywords(). + git_refnames = "%(DOLLAR)sFormat:%%d%(DOLLAR)s" + git_full = "%(DOLLAR)sFormat:%%H%(DOLLAR)s" + git_date = "%(DOLLAR)sFormat:%%ci%(DOLLAR)s" + keywords = {"refnames": git_refnames, "full": git_full, "date": git_date} + return keywords + + +class VersioneerConfig: + """Container for Versioneer configuration parameters.""" + + +def get_config(): + """Create, populate and return the VersioneerConfig() object.""" + # these strings are filled in when 'setup.py versioneer' creates + # _version.py + cfg = VersioneerConfig() + cfg.VCS = "git" + cfg.style = "%(STYLE)s" + cfg.tag_prefix = "%(TAG_PREFIX)s" + cfg.parentdir_prefix = "%(PARENTDIR_PREFIX)s" + cfg.versionfile_source = "%(VERSIONFILE_SOURCE)s" + cfg.verbose = False + return cfg + + +class NotThisMethod(Exception): + """Exception raised if a method is not valid for the current scenario.""" + + +LONG_VERSION_PY = {} +HANDLERS = {} + + +def register_vcs_handler(vcs, method): # decorator + """Create decorator to mark a method as the handler of a VCS.""" + def decorate(f): + """Store f in HANDLERS[vcs][method].""" + if vcs not in HANDLERS: + HANDLERS[vcs] = {} + HANDLERS[vcs][method] = f + return f + return decorate + + +def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False, + env=None): + """Call the given command(s).""" + assert isinstance(commands, list) + p = None + for c in commands: + try: + dispcmd = str([c] + args) + # remember shell=False, so use git.cmd on windows, not just git + p = subprocess.Popen([c] + args, cwd=cwd, env=env, + stdout=subprocess.PIPE, + stderr=(subprocess.PIPE if hide_stderr + else None)) + break + except EnvironmentError: + e = sys.exc_info()[1] + if e.errno == errno.ENOENT: + continue + if verbose: + print("unable to run %%s" %% dispcmd) + print(e) + return None, None + else: + if verbose: + print("unable to find command, tried %%s" %% (commands,)) + return None, None + stdout = p.communicate()[0].strip().decode() + if p.returncode != 0: + if verbose: + print("unable to run %%s (error)" %% dispcmd) + print("stdout was %%s" %% stdout) + return None, p.returncode + return stdout, p.returncode + + +def versions_from_parentdir(parentdir_prefix, root, verbose): + """Try to determine the version from the parent directory name. + + Source tarballs conventionally unpack into a directory that includes both + the project name and a version string. We will also support searching up + two directory levels for an appropriately named parent directory + """ + rootdirs = [] + + for i in range(3): + dirname = os.path.basename(root) + if dirname.startswith(parentdir_prefix): + return {"version": dirname[len(parentdir_prefix):], + "full-revisionid": None, + "dirty": False, "error": None, "date": None} + else: + rootdirs.append(root) + root = os.path.dirname(root) # up a level + + if verbose: + print("Tried directories %%s but none started with prefix %%s" %% + (str(rootdirs), parentdir_prefix)) + raise NotThisMethod("rootdir doesn't start with parentdir_prefix") + + +@register_vcs_handler("git", "get_keywords") +def git_get_keywords(versionfile_abs): + """Extract version information from the given file.""" + # the code embedded in _version.py can just fetch the value of these + # keywords. When used from setup.py, we don't want to import _version.py, + # so we do it with a regexp instead. This function is not used from + # _version.py. + keywords = {} + try: + f = open(versionfile_abs, "r") + for line in f.readlines(): + if line.strip().startswith("git_refnames ="): + mo = re.search(r'=\s*"(.*)"', line) + if mo: + keywords["refnames"] = mo.group(1) + if line.strip().startswith("git_full ="): + mo = re.search(r'=\s*"(.*)"', line) + if mo: + keywords["full"] = mo.group(1) + if line.strip().startswith("git_date ="): + mo = re.search(r'=\s*"(.*)"', line) + if mo: + keywords["date"] = mo.group(1) + f.close() + except EnvironmentError: + pass + return keywords + + +@register_vcs_handler("git", "keywords") +def git_versions_from_keywords(keywords, tag_prefix, verbose): + """Get version information from git keywords.""" + if not keywords: + raise NotThisMethod("no keywords at all, weird") + date = keywords.get("date") + if date is not None: + # Use only the last line. Previous lines may contain GPG signature + # information. + date = date.splitlines()[-1] + + # git-2.2.0 added "%%cI", which expands to an ISO-8601 -compliant + # datestamp. However we prefer "%%ci" (which expands to an "ISO-8601 + # -like" string, which we must then edit to make compliant), because + # it's been around since git-1.5.3, and it's too difficult to + # discover which version we're using, or to work around using an + # older one. + date = date.strip().replace(" ", "T", 1).replace(" ", "", 1) + refnames = keywords["refnames"].strip() + if refnames.startswith("$Format"): + if verbose: + print("keywords are unexpanded, not using") + raise NotThisMethod("unexpanded keywords, not a git-archive tarball") + refs = set([r.strip() for r in refnames.strip("()").split(",")]) + # starting in git-1.8.3, tags are listed as "tag: foo-1.0" instead of + # just "foo-1.0". If we see a "tag: " prefix, prefer those. + TAG = "tag: " + tags = set([r[len(TAG):] for r in refs if r.startswith(TAG)]) + if not tags: + # Either we're using git < 1.8.3, or there really are no tags. We use + # a heuristic: assume all version tags have a digit. The old git %%d + # expansion behaves like git log --decorate=short and strips out the + # refs/heads/ and refs/tags/ prefixes that would let us distinguish + # between branches and tags. By ignoring refnames without digits, we + # filter out many common branch names like "release" and + # "stabilization", as well as "HEAD" and "master". + tags = set([r for r in refs if re.search(r'\d', r)]) + if verbose: + print("discarding '%%s', no digits" %% ",".join(refs - tags)) + if verbose: + print("likely tags: %%s" %% ",".join(sorted(tags))) + for ref in sorted(tags): + # sorting will prefer e.g. "2.0" over "2.0rc1" + if ref.startswith(tag_prefix): + r = ref[len(tag_prefix):] + if verbose: + print("picking %%s" %% r) + return {"version": r, + "full-revisionid": keywords["full"].strip(), + "dirty": False, "error": None, + "date": date} + # no suitable tags, so version is "0+unknown", but full hex is still there + if verbose: + print("no suitable tags, using unknown + full revision id") + return {"version": "0+unknown", + "full-revisionid": keywords["full"].strip(), + "dirty": False, "error": "no suitable tags", "date": None} + + +@register_vcs_handler("git", "pieces_from_vcs") +def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command): + """Get version from 'git describe' in the root of the source tree. + + This only gets called if the git-archive 'subst' keywords were *not* + expanded, and _version.py hasn't already been rewritten with a short + version string, meaning we're inside a checked out source tree. + """ + GITS = ["git"] + if sys.platform == "win32": + GITS = ["git.cmd", "git.exe"] + + out, rc = run_command(GITS, ["rev-parse", "--git-dir"], cwd=root, + hide_stderr=True) + if rc != 0: + if verbose: + print("Directory %%s not under git control" %% root) + raise NotThisMethod("'git rev-parse --git-dir' returned error") + + # if there is a tag matching tag_prefix, this yields TAG-NUM-gHEX[-dirty] + # if there isn't one, this yields HEX[-dirty] (no NUM) + describe_out, rc = run_command(GITS, ["describe", "--tags", "--dirty", + "--always", "--long", + "--match", "%%s*" %% tag_prefix], + cwd=root) + # --long was added in git-1.5.5 + if describe_out is None: + raise NotThisMethod("'git describe' failed") + describe_out = describe_out.strip() + full_out, rc = run_command(GITS, ["rev-parse", "HEAD"], cwd=root) + if full_out is None: + raise NotThisMethod("'git rev-parse' failed") + full_out = full_out.strip() + + pieces = {} + pieces["long"] = full_out + pieces["short"] = full_out[:7] # maybe improved later + pieces["error"] = None + + # parse describe_out. It will be like TAG-NUM-gHEX[-dirty] or HEX[-dirty] + # TAG might have hyphens. + git_describe = describe_out + + # look for -dirty suffix + dirty = git_describe.endswith("-dirty") + pieces["dirty"] = dirty + if dirty: + git_describe = git_describe[:git_describe.rindex("-dirty")] + + # now we have TAG-NUM-gHEX or HEX + + if "-" in git_describe: + # TAG-NUM-gHEX + mo = re.search(r'^(.+)-(\d+)-g([0-9a-f]+)$', git_describe) + if not mo: + # unparseable. Maybe git-describe is misbehaving? + pieces["error"] = ("unable to parse git-describe output: '%%s'" + %% describe_out) + return pieces + + # tag + full_tag = mo.group(1) + if not full_tag.startswith(tag_prefix): + if verbose: + fmt = "tag '%%s' doesn't start with prefix '%%s'" + print(fmt %% (full_tag, tag_prefix)) + pieces["error"] = ("tag '%%s' doesn't start with prefix '%%s'" + %% (full_tag, tag_prefix)) + return pieces + pieces["closest-tag"] = full_tag[len(tag_prefix):] + + # distance: number of commits since tag + pieces["distance"] = int(mo.group(2)) + + # commit: short hex revision ID + pieces["short"] = mo.group(3) + + else: + # HEX: no tags + pieces["closest-tag"] = None + count_out, rc = run_command(GITS, ["rev-list", "HEAD", "--count"], + cwd=root) + pieces["distance"] = int(count_out) # total number of commits + + # commit date: see ISO-8601 comment in git_versions_from_keywords() + date = run_command(GITS, ["show", "-s", "--format=%%ci", "HEAD"], + cwd=root)[0].strip() + # Use only the last line. Previous lines may contain GPG signature + # information. + date = date.splitlines()[-1] + pieces["date"] = date.strip().replace(" ", "T", 1).replace(" ", "", 1) + + return pieces + + +def plus_or_dot(pieces): + """Return a + if we don't already have one, else return a .""" + if "+" in pieces.get("closest-tag", ""): + return "." + return "+" + + +def render_pep440(pieces): + """Build up version string, with post-release "local version identifier". + + Our goal: TAG[+DISTANCE.gHEX[.dirty]] . Note that if you + get a tagged build and then dirty it, you'll get TAG+0.gHEX.dirty + + Exceptions: + 1: no tags. git_describe was just HEX. 0+untagged.DISTANCE.gHEX[.dirty] + """ + if pieces["closest-tag"]: + rendered = pieces["closest-tag"] + if pieces["distance"] or pieces["dirty"]: + rendered += plus_or_dot(pieces) + rendered += "%%d.g%%s" %% (pieces["distance"], pieces["short"]) + if pieces["dirty"]: + rendered += ".dirty" + else: + # exception #1 + rendered = "0+untagged.%%d.g%%s" %% (pieces["distance"], + pieces["short"]) + if pieces["dirty"]: + rendered += ".dirty" + return rendered + + +def render_pep440_pre(pieces): + """TAG[.post0.devDISTANCE] -- No -dirty. + + Exceptions: + 1: no tags. 0.post0.devDISTANCE + """ + if pieces["closest-tag"]: + rendered = pieces["closest-tag"] + if pieces["distance"]: + rendered += ".post0.dev%%d" %% pieces["distance"] + else: + # exception #1 + rendered = "0.post0.dev%%d" %% pieces["distance"] + return rendered + + +def render_pep440_post(pieces): + """TAG[.postDISTANCE[.dev0]+gHEX] . + + The ".dev0" means dirty. Note that .dev0 sorts backwards + (a dirty tree will appear "older" than the corresponding clean one), + but you shouldn't be releasing software with -dirty anyways. + + Exceptions: + 1: no tags. 0.postDISTANCE[.dev0] + """ + if pieces["closest-tag"]: + rendered = pieces["closest-tag"] + if pieces["distance"] or pieces["dirty"]: + rendered += ".post%%d" %% pieces["distance"] + if pieces["dirty"]: + rendered += ".dev0" + rendered += plus_or_dot(pieces) + rendered += "g%%s" %% pieces["short"] + else: + # exception #1 + rendered = "0.post%%d" %% pieces["distance"] + if pieces["dirty"]: + rendered += ".dev0" + rendered += "+g%%s" %% pieces["short"] + return rendered + + +def render_pep440_old(pieces): + """TAG[.postDISTANCE[.dev0]] . + + The ".dev0" means dirty. + + Exceptions: + 1: no tags. 0.postDISTANCE[.dev0] + """ + if pieces["closest-tag"]: + rendered = pieces["closest-tag"] + if pieces["distance"] or pieces["dirty"]: + rendered += ".post%%d" %% pieces["distance"] + if pieces["dirty"]: + rendered += ".dev0" + else: + # exception #1 + rendered = "0.post%%d" %% pieces["distance"] + if pieces["dirty"]: + rendered += ".dev0" + return rendered + + +def render_git_describe(pieces): + """TAG[-DISTANCE-gHEX][-dirty]. + + Like 'git describe --tags --dirty --always'. + + Exceptions: + 1: no tags. HEX[-dirty] (note: no 'g' prefix) + """ + if pieces["closest-tag"]: + rendered = pieces["closest-tag"] + if pieces["distance"]: + rendered += "-%%d-g%%s" %% (pieces["distance"], pieces["short"]) + else: + # exception #1 + rendered = pieces["short"] + if pieces["dirty"]: + rendered += "-dirty" + return rendered + + +def render_git_describe_long(pieces): + """TAG-DISTANCE-gHEX[-dirty]. + + Like 'git describe --tags --dirty --always -long'. + The distance/hash is unconditional. + + Exceptions: + 1: no tags. HEX[-dirty] (note: no 'g' prefix) + """ + if pieces["closest-tag"]: + rendered = pieces["closest-tag"] + rendered += "-%%d-g%%s" %% (pieces["distance"], pieces["short"]) + else: + # exception #1 + rendered = pieces["short"] + if pieces["dirty"]: + rendered += "-dirty" + return rendered + + +def render(pieces, style): + """Render the given version pieces into the requested style.""" + if pieces["error"]: + return {"version": "unknown", + "full-revisionid": pieces.get("long"), + "dirty": None, + "error": pieces["error"], + "date": None} + + if not style or style == "default": + style = "pep440" # the default + + if style == "pep440": + rendered = render_pep440(pieces) + elif style == "pep440-pre": + rendered = render_pep440_pre(pieces) + elif style == "pep440-post": + rendered = render_pep440_post(pieces) + elif style == "pep440-old": + rendered = render_pep440_old(pieces) + elif style == "git-describe": + rendered = render_git_describe(pieces) + elif style == "git-describe-long": + rendered = render_git_describe_long(pieces) + else: + raise ValueError("unknown style '%%s'" %% style) + + return {"version": rendered, "full-revisionid": pieces["long"], + "dirty": pieces["dirty"], "error": None, + "date": pieces.get("date")} + + +def get_versions(): + """Get version information or return default if unable to do so.""" + # I am in _version.py, which lives at ROOT/VERSIONFILE_SOURCE. If we have + # __file__, we can work backwards from there to the root. Some + # py2exe/bbfreeze/non-CPython implementations don't do __file__, in which + # case we can only use expanded keywords. + + cfg = get_config() + verbose = cfg.verbose + + try: + return git_versions_from_keywords(get_keywords(), cfg.tag_prefix, + verbose) + except NotThisMethod: + pass + + try: + root = os.path.realpath(__file__) + # versionfile_source is the relative path from the top of the source + # tree (where the .git directory might live) to this file. Invert + # this to find the root from __file__. + for i in cfg.versionfile_source.split('/'): + root = os.path.dirname(root) + except NameError: + return {"version": "0+unknown", "full-revisionid": None, + "dirty": None, + "error": "unable to find root of source tree", + "date": None} + + try: + pieces = git_pieces_from_vcs(cfg.tag_prefix, root, verbose) + return render(pieces, cfg.style) + except NotThisMethod: + pass + + try: + if cfg.parentdir_prefix: + return versions_from_parentdir(cfg.parentdir_prefix, root, verbose) + except NotThisMethod: + pass + + return {"version": "0+unknown", "full-revisionid": None, + "dirty": None, + "error": "unable to compute version", "date": None} +''' + + +@register_vcs_handler("git", "get_keywords") +def git_get_keywords(versionfile_abs): + """Extract version information from the given file.""" + # the code embedded in _version.py can just fetch the value of these + # keywords. When used from setup.py, we don't want to import _version.py, + # so we do it with a regexp instead. This function is not used from + # _version.py. + keywords = {} + try: + f = open(versionfile_abs, "r") + for line in f.readlines(): + if line.strip().startswith("git_refnames ="): + mo = re.search(r'=\s*"(.*)"', line) + if mo: + keywords["refnames"] = mo.group(1) + if line.strip().startswith("git_full ="): + mo = re.search(r'=\s*"(.*)"', line) + if mo: + keywords["full"] = mo.group(1) + if line.strip().startswith("git_date ="): + mo = re.search(r'=\s*"(.*)"', line) + if mo: + keywords["date"] = mo.group(1) + f.close() + except EnvironmentError: + pass + return keywords + + +@register_vcs_handler("git", "keywords") +def git_versions_from_keywords(keywords, tag_prefix, verbose): + """Get version information from git keywords.""" + if not keywords: + raise NotThisMethod("no keywords at all, weird") + date = keywords.get("date") + if date is not None: + # Use only the last line. Previous lines may contain GPG signature + # information. + date = date.splitlines()[-1] + + # git-2.2.0 added "%cI", which expands to an ISO-8601 -compliant + # datestamp. However we prefer "%ci" (which expands to an "ISO-8601 + # -like" string, which we must then edit to make compliant), because + # it's been around since git-1.5.3, and it's too difficult to + # discover which version we're using, or to work around using an + # older one. + date = date.strip().replace(" ", "T", 1).replace(" ", "", 1) + refnames = keywords["refnames"].strip() + if refnames.startswith("$Format"): + if verbose: + print("keywords are unexpanded, not using") + raise NotThisMethod("unexpanded keywords, not a git-archive tarball") + refs = set([r.strip() for r in refnames.strip("()").split(",")]) + # starting in git-1.8.3, tags are listed as "tag: foo-1.0" instead of + # just "foo-1.0". If we see a "tag: " prefix, prefer those. + TAG = "tag: " + tags = set([r[len(TAG):] for r in refs if r.startswith(TAG)]) + if not tags: + # Either we're using git < 1.8.3, or there really are no tags. We use + # a heuristic: assume all version tags have a digit. The old git %d + # expansion behaves like git log --decorate=short and strips out the + # refs/heads/ and refs/tags/ prefixes that would let us distinguish + # between branches and tags. By ignoring refnames without digits, we + # filter out many common branch names like "release" and + # "stabilization", as well as "HEAD" and "master". + tags = set([r for r in refs if re.search(r'\d', r)]) + if verbose: + print("discarding '%s', no digits" % ",".join(refs - tags)) + if verbose: + print("likely tags: %s" % ",".join(sorted(tags))) + for ref in sorted(tags): + # sorting will prefer e.g. "2.0" over "2.0rc1" + if ref.startswith(tag_prefix): + r = ref[len(tag_prefix):] + if verbose: + print("picking %s" % r) + return {"version": r, + "full-revisionid": keywords["full"].strip(), + "dirty": False, "error": None, + "date": date} + # no suitable tags, so version is "0+unknown", but full hex is still there + if verbose: + print("no suitable tags, using unknown + full revision id") + return {"version": "0+unknown", + "full-revisionid": keywords["full"].strip(), + "dirty": False, "error": "no suitable tags", "date": None} + + +@register_vcs_handler("git", "pieces_from_vcs") +def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command): + """Get version from 'git describe' in the root of the source tree. + + This only gets called if the git-archive 'subst' keywords were *not* + expanded, and _version.py hasn't already been rewritten with a short + version string, meaning we're inside a checked out source tree. + """ + GITS = ["git"] + if sys.platform == "win32": + GITS = ["git.cmd", "git.exe"] + + out, rc = run_command(GITS, ["rev-parse", "--git-dir"], cwd=root, + hide_stderr=True) + if rc != 0: + if verbose: + print("Directory %s not under git control" % root) + raise NotThisMethod("'git rev-parse --git-dir' returned error") + + # if there is a tag matching tag_prefix, this yields TAG-NUM-gHEX[-dirty] + # if there isn't one, this yields HEX[-dirty] (no NUM) + describe_out, rc = run_command(GITS, ["describe", "--tags", "--dirty", + "--always", "--long", + "--match", "%s*" % tag_prefix], + cwd=root) + # --long was added in git-1.5.5 + if describe_out is None: + raise NotThisMethod("'git describe' failed") + describe_out = describe_out.strip() + full_out, rc = run_command(GITS, ["rev-parse", "HEAD"], cwd=root) + if full_out is None: + raise NotThisMethod("'git rev-parse' failed") + full_out = full_out.strip() + + pieces = {} + pieces["long"] = full_out + pieces["short"] = full_out[:7] # maybe improved later + pieces["error"] = None + + # parse describe_out. It will be like TAG-NUM-gHEX[-dirty] or HEX[-dirty] + # TAG might have hyphens. + git_describe = describe_out + + # look for -dirty suffix + dirty = git_describe.endswith("-dirty") + pieces["dirty"] = dirty + if dirty: + git_describe = git_describe[:git_describe.rindex("-dirty")] + + # now we have TAG-NUM-gHEX or HEX + + if "-" in git_describe: + # TAG-NUM-gHEX + mo = re.search(r'^(.+)-(\d+)-g([0-9a-f]+)$', git_describe) + if not mo: + # unparseable. Maybe git-describe is misbehaving? + pieces["error"] = ("unable to parse git-describe output: '%s'" + % describe_out) + return pieces + + # tag + full_tag = mo.group(1) + if not full_tag.startswith(tag_prefix): + if verbose: + fmt = "tag '%s' doesn't start with prefix '%s'" + print(fmt % (full_tag, tag_prefix)) + pieces["error"] = ("tag '%s' doesn't start with prefix '%s'" + % (full_tag, tag_prefix)) + return pieces + pieces["closest-tag"] = full_tag[len(tag_prefix):] + + # distance: number of commits since tag + pieces["distance"] = int(mo.group(2)) + + # commit: short hex revision ID + pieces["short"] = mo.group(3) + + else: + # HEX: no tags + pieces["closest-tag"] = None + count_out, rc = run_command(GITS, ["rev-list", "HEAD", "--count"], + cwd=root) + pieces["distance"] = int(count_out) # total number of commits + + # commit date: see ISO-8601 comment in git_versions_from_keywords() + date = run_command(GITS, ["show", "-s", "--format=%ci", "HEAD"], + cwd=root)[0].strip() + # Use only the last line. Previous lines may contain GPG signature + # information. + date = date.splitlines()[-1] + pieces["date"] = date.strip().replace(" ", "T", 1).replace(" ", "", 1) + + return pieces + + +def do_vcs_install(manifest_in, versionfile_source, ipy): + """Git-specific installation logic for Versioneer. + + For Git, this means creating/changing .gitattributes to mark _version.py + for export-subst keyword substitution. + """ + GITS = ["git"] + if sys.platform == "win32": + GITS = ["git.cmd", "git.exe"] + files = [manifest_in, versionfile_source] + if ipy: + files.append(ipy) + try: + me = __file__ + if me.endswith(".pyc") or me.endswith(".pyo"): + me = os.path.splitext(me)[0] + ".py" + versioneer_file = os.path.relpath(me) + except NameError: + versioneer_file = "versioneer.py" + files.append(versioneer_file) + present = False + try: + f = open(".gitattributes", "r") + for line in f.readlines(): + if line.strip().startswith(versionfile_source): + if "export-subst" in line.strip().split()[1:]: + present = True + f.close() + except EnvironmentError: + pass + if not present: + f = open(".gitattributes", "a+") + f.write("%s export-subst\n" % versionfile_source) + f.close() + files.append(".gitattributes") + run_command(GITS, ["add", "--"] + files) + + +def versions_from_parentdir(parentdir_prefix, root, verbose): + """Try to determine the version from the parent directory name. + + Source tarballs conventionally unpack into a directory that includes both + the project name and a version string. We will also support searching up + two directory levels for an appropriately named parent directory + """ + rootdirs = [] + + for i in range(3): + dirname = os.path.basename(root) + if dirname.startswith(parentdir_prefix): + return {"version": dirname[len(parentdir_prefix):], + "full-revisionid": None, + "dirty": False, "error": None, "date": None} + else: + rootdirs.append(root) + root = os.path.dirname(root) # up a level + + if verbose: + print("Tried directories %s but none started with prefix %s" % + (str(rootdirs), parentdir_prefix)) + raise NotThisMethod("rootdir doesn't start with parentdir_prefix") + + +SHORT_VERSION_PY = """ +# This file was generated by 'versioneer.py' (0.19) from +# revision-control system data, or from the parent directory name of an +# unpacked source archive. Distribution tarballs contain a pre-generated copy +# of this file. + +import json + +version_json = ''' +%s +''' # END VERSION_JSON + + +def get_versions(): + return json.loads(version_json) +""" + + +def versions_from_file(filename): + """Try to determine the version from _version.py if present.""" + try: + with open(filename) as f: + contents = f.read() + except EnvironmentError: + raise NotThisMethod("unable to read _version.py") + mo = re.search(r"version_json = '''\n(.*)''' # END VERSION_JSON", + contents, re.M | re.S) + if not mo: + mo = re.search(r"version_json = '''\r\n(.*)''' # END VERSION_JSON", + contents, re.M | re.S) + if not mo: + raise NotThisMethod("no version_json in _version.py") + return json.loads(mo.group(1)) + + +def write_to_version_file(filename, versions): + """Write the given version number to the given _version.py file.""" + os.unlink(filename) + contents = json.dumps(versions, sort_keys=True, + indent=1, separators=(",", ": ")) + with open(filename, "w") as f: + f.write(SHORT_VERSION_PY % contents) + + print("set %s to '%s'" % (filename, versions["version"])) + + +def plus_or_dot(pieces): + """Return a + if we don't already have one, else return a .""" + if "+" in pieces.get("closest-tag", ""): + return "." + return "+" + + +def render_pep440(pieces): + """Build up version string, with post-release "local version identifier". + + Our goal: TAG[+DISTANCE.gHEX[.dirty]] . Note that if you + get a tagged build and then dirty it, you'll get TAG+0.gHEX.dirty + + Exceptions: + 1: no tags. git_describe was just HEX. 0+untagged.DISTANCE.gHEX[.dirty] + """ + if pieces["closest-tag"]: + rendered = pieces["closest-tag"] + if pieces["distance"] or pieces["dirty"]: + rendered += plus_or_dot(pieces) + rendered += "%d.g%s" % (pieces["distance"], pieces["short"]) + if pieces["dirty"]: + rendered += ".dirty" + else: + # exception #1 + rendered = "0+untagged.%d.g%s" % (pieces["distance"], + pieces["short"]) + if pieces["dirty"]: + rendered += ".dirty" + return rendered + + +def render_pep440_pre(pieces): + """TAG[.post0.devDISTANCE] -- No -dirty. + + Exceptions: + 1: no tags. 0.post0.devDISTANCE + """ + if pieces["closest-tag"]: + rendered = pieces["closest-tag"] + if pieces["distance"]: + rendered += ".post0.dev%d" % pieces["distance"] + else: + # exception #1 + rendered = "0.post0.dev%d" % pieces["distance"] + return rendered + + +def render_pep440_post(pieces): + """TAG[.postDISTANCE[.dev0]+gHEX] . + + The ".dev0" means dirty. Note that .dev0 sorts backwards + (a dirty tree will appear "older" than the corresponding clean one), + but you shouldn't be releasing software with -dirty anyways. + + Exceptions: + 1: no tags. 0.postDISTANCE[.dev0] + """ + if pieces["closest-tag"]: + rendered = pieces["closest-tag"] + if pieces["distance"] or pieces["dirty"]: + rendered += ".post%d" % pieces["distance"] + if pieces["dirty"]: + rendered += ".dev0" + rendered += plus_or_dot(pieces) + rendered += "g%s" % pieces["short"] + else: + # exception #1 + rendered = "0.post%d" % pieces["distance"] + if pieces["dirty"]: + rendered += ".dev0" + rendered += "+g%s" % pieces["short"] + return rendered + + +def render_pep440_old(pieces): + """TAG[.postDISTANCE[.dev0]] . + + The ".dev0" means dirty. + + Exceptions: + 1: no tags. 0.postDISTANCE[.dev0] + """ + if pieces["closest-tag"]: + rendered = pieces["closest-tag"] + if pieces["distance"] or pieces["dirty"]: + rendered += ".post%d" % pieces["distance"] + if pieces["dirty"]: + rendered += ".dev0" + else: + # exception #1 + rendered = "0.post%d" % pieces["distance"] + if pieces["dirty"]: + rendered += ".dev0" + return rendered + + +def render_git_describe(pieces): + """TAG[-DISTANCE-gHEX][-dirty]. + + Like 'git describe --tags --dirty --always'. + + Exceptions: + 1: no tags. HEX[-dirty] (note: no 'g' prefix) + """ + if pieces["closest-tag"]: + rendered = pieces["closest-tag"] + if pieces["distance"]: + rendered += "-%d-g%s" % (pieces["distance"], pieces["short"]) + else: + # exception #1 + rendered = pieces["short"] + if pieces["dirty"]: + rendered += "-dirty" + return rendered + + +def render_git_describe_long(pieces): + """TAG-DISTANCE-gHEX[-dirty]. + + Like 'git describe --tags --dirty --always -long'. + The distance/hash is unconditional. + + Exceptions: + 1: no tags. HEX[-dirty] (note: no 'g' prefix) + """ + if pieces["closest-tag"]: + rendered = pieces["closest-tag"] + rendered += "-%d-g%s" % (pieces["distance"], pieces["short"]) + else: + # exception #1 + rendered = pieces["short"] + if pieces["dirty"]: + rendered += "-dirty" + return rendered + + +def render(pieces, style): + """Render the given version pieces into the requested style.""" + if pieces["error"]: + return {"version": "unknown", + "full-revisionid": pieces.get("long"), + "dirty": None, + "error": pieces["error"], + "date": None} + + if not style or style == "default": + style = "pep440" # the default + + if style == "pep440": + rendered = render_pep440(pieces) + elif style == "pep440-pre": + rendered = render_pep440_pre(pieces) + elif style == "pep440-post": + rendered = render_pep440_post(pieces) + elif style == "pep440-old": + rendered = render_pep440_old(pieces) + elif style == "git-describe": + rendered = render_git_describe(pieces) + elif style == "git-describe-long": + rendered = render_git_describe_long(pieces) + else: + raise ValueError("unknown style '%s'" % style) + + return {"version": rendered, "full-revisionid": pieces["long"], + "dirty": pieces["dirty"], "error": None, + "date": pieces.get("date")} + + +class VersioneerBadRootError(Exception): + """The project root directory is unknown or missing key files.""" + + +def get_versions(verbose=False): + """Get the project version from whatever source is available. + + Returns dict with two keys: 'version' and 'full'. + """ + if "versioneer" in sys.modules: + # see the discussion in cmdclass.py:get_cmdclass() + del sys.modules["versioneer"] + + root = get_root() + cfg = get_config_from_root(root) + + assert cfg.VCS is not None, "please set [versioneer]VCS= in setup.cfg" + handlers = HANDLERS.get(cfg.VCS) + assert handlers, "unrecognized VCS '%s'" % cfg.VCS + verbose = verbose or cfg.verbose + assert cfg.versionfile_source is not None, \ + "please set versioneer.versionfile_source" + assert cfg.tag_prefix is not None, "please set versioneer.tag_prefix" + + versionfile_abs = os.path.join(root, cfg.versionfile_source) + + # extract version from first of: _version.py, VCS command (e.g. 'git + # describe'), parentdir. This is meant to work for developers using a + # source checkout, for users of a tarball created by 'setup.py sdist', + # and for users of a tarball/zipball created by 'git archive' or github's + # download-from-tag feature or the equivalent in other VCSes. + + get_keywords_f = handlers.get("get_keywords") + from_keywords_f = handlers.get("keywords") + if get_keywords_f and from_keywords_f: + try: + keywords = get_keywords_f(versionfile_abs) + ver = from_keywords_f(keywords, cfg.tag_prefix, verbose) + if verbose: + print("got version from expanded keyword %s" % ver) + return ver + except NotThisMethod: + pass + + try: + ver = versions_from_file(versionfile_abs) + if verbose: + print("got version from file %s %s" % (versionfile_abs, ver)) + return ver + except NotThisMethod: + pass + + from_vcs_f = handlers.get("pieces_from_vcs") + if from_vcs_f: + try: + pieces = from_vcs_f(cfg.tag_prefix, root, verbose) + ver = render(pieces, cfg.style) + if verbose: + print("got version from VCS %s" % ver) + return ver + except NotThisMethod: + pass + + try: + if cfg.parentdir_prefix: + ver = versions_from_parentdir(cfg.parentdir_prefix, root, verbose) + if verbose: + print("got version from parentdir %s" % ver) + return ver + except NotThisMethod: + pass + + if verbose: + print("unable to compute version") + + return {"version": "0+unknown", "full-revisionid": None, + "dirty": None, "error": "unable to compute version", + "date": None} + + +def get_version(): + """Get the short version string for this project.""" + return get_versions()["version"] + + +def get_cmdclass(cmdclass=None): + """Get the custom setuptools/distutils subclasses used by Versioneer. + + If the package uses a different cmdclass (e.g. one from numpy), it + should be provide as an argument. + """ + if "versioneer" in sys.modules: + del sys.modules["versioneer"] + # this fixes the "python setup.py develop" case (also 'install' and + # 'easy_install .'), in which subdependencies of the main project are + # built (using setup.py bdist_egg) in the same python process. Assume + # a main project A and a dependency B, which use different versions + # of Versioneer. A's setup.py imports A's Versioneer, leaving it in + # sys.modules by the time B's setup.py is executed, causing B to run + # with the wrong versioneer. Setuptools wraps the sub-dep builds in a + # sandbox that restores sys.modules to it's pre-build state, so the + # parent is protected against the child's "import versioneer". By + # removing ourselves from sys.modules here, before the child build + # happens, we protect the child from the parent's versioneer too. + # Also see https://github.com/python-versioneer/python-versioneer/issues/52 + + cmds = {} if cmdclass is None else cmdclass.copy() + + # we add "version" to both distutils and setuptools + from distutils.core import Command + + class cmd_version(Command): + description = "report generated version string" + user_options = [] + boolean_options = [] + + def initialize_options(self): + pass + + def finalize_options(self): + pass + + def run(self): + vers = get_versions(verbose=True) + print("Version: %s" % vers["version"]) + print(" full-revisionid: %s" % vers.get("full-revisionid")) + print(" dirty: %s" % vers.get("dirty")) + print(" date: %s" % vers.get("date")) + if vers["error"]: + print(" error: %s" % vers["error"]) + cmds["version"] = cmd_version + + # we override "build_py" in both distutils and setuptools + # + # most invocation pathways end up running build_py: + # distutils/build -> build_py + # distutils/install -> distutils/build ->.. + # setuptools/bdist_wheel -> distutils/install ->.. + # setuptools/bdist_egg -> distutils/install_lib -> build_py + # setuptools/install -> bdist_egg ->.. + # setuptools/develop -> ? + # pip install: + # copies source tree to a tempdir before running egg_info/etc + # if .git isn't copied too, 'git describe' will fail + # then does setup.py bdist_wheel, or sometimes setup.py install + # setup.py egg_info -> ? + + # we override different "build_py" commands for both environments + if 'build_py' in cmds: + _build_py = cmds['build_py'] + elif "setuptools" in sys.modules: + from setuptools.command.build_py import build_py as _build_py + else: + from distutils.command.build_py import build_py as _build_py + + class cmd_build_py(_build_py): + def run(self): + root = get_root() + cfg = get_config_from_root(root) + versions = get_versions() + _build_py.run(self) + # now locate _version.py in the new build/ directory and replace + # it with an updated value + if cfg.versionfile_build: + target_versionfile = os.path.join(self.build_lib, + cfg.versionfile_build) + print("UPDATING %s" % target_versionfile) + write_to_version_file(target_versionfile, versions) + cmds["build_py"] = cmd_build_py + + if "setuptools" in sys.modules: + from setuptools.command.build_ext import build_ext as _build_ext + else: + from distutils.command.build_ext import build_ext as _build_ext + + class cmd_build_ext(_build_ext): + def run(self): + root = get_root() + cfg = get_config_from_root(root) + versions = get_versions() + _build_ext.run(self) + if self.inplace: + # build_ext --inplace will only build extensions in + # build/lib<..> dir with no _version.py to write to. + # As in place builds will already have a _version.py + # in the module dir, we do not need to write one. + return + # now locate _version.py in the new build/ directory and replace + # it with an updated value + target_versionfile = os.path.join(self.build_lib, + cfg.versionfile_source) + print("UPDATING %s" % target_versionfile) + write_to_version_file(target_versionfile, versions) + cmds["build_ext"] = cmd_build_ext + + if "cx_Freeze" in sys.modules: # cx_freeze enabled? + from cx_Freeze.dist import build_exe as _build_exe + # nczeczulin reports that py2exe won't like the pep440-style string + # as FILEVERSION, but it can be used for PRODUCTVERSION, e.g. + # setup(console=[{ + # "version": versioneer.get_version().split("+", 1)[0], # FILEVERSION + # "product_version": versioneer.get_version(), + # ... + + class cmd_build_exe(_build_exe): + def run(self): + root = get_root() + cfg = get_config_from_root(root) + versions = get_versions() + target_versionfile = cfg.versionfile_source + print("UPDATING %s" % target_versionfile) + write_to_version_file(target_versionfile, versions) + + _build_exe.run(self) + os.unlink(target_versionfile) + with open(cfg.versionfile_source, "w") as f: + LONG = LONG_VERSION_PY[cfg.VCS] + f.write(LONG % + {"DOLLAR": "$", + "STYLE": cfg.style, + "TAG_PREFIX": cfg.tag_prefix, + "PARENTDIR_PREFIX": cfg.parentdir_prefix, + "VERSIONFILE_SOURCE": cfg.versionfile_source, + }) + cmds["build_exe"] = cmd_build_exe + del cmds["build_py"] + + if 'py2exe' in sys.modules: # py2exe enabled? + from py2exe.distutils_buildexe import py2exe as _py2exe + + class cmd_py2exe(_py2exe): + def run(self): + root = get_root() + cfg = get_config_from_root(root) + versions = get_versions() + target_versionfile = cfg.versionfile_source + print("UPDATING %s" % target_versionfile) + write_to_version_file(target_versionfile, versions) + + _py2exe.run(self) + os.unlink(target_versionfile) + with open(cfg.versionfile_source, "w") as f: + LONG = LONG_VERSION_PY[cfg.VCS] + f.write(LONG % + {"DOLLAR": "$", + "STYLE": cfg.style, + "TAG_PREFIX": cfg.tag_prefix, + "PARENTDIR_PREFIX": cfg.parentdir_prefix, + "VERSIONFILE_SOURCE": cfg.versionfile_source, + }) + cmds["py2exe"] = cmd_py2exe + + # we override different "sdist" commands for both environments + if 'sdist' in cmds: + _sdist = cmds['sdist'] + elif "setuptools" in sys.modules: + from setuptools.command.sdist import sdist as _sdist + else: + from distutils.command.sdist import sdist as _sdist + + class cmd_sdist(_sdist): + def run(self): + versions = get_versions() + self._versioneer_generated_versions = versions + # unless we update this, the command will keep using the old + # version + self.distribution.metadata.version = versions["version"] + return _sdist.run(self) + + def make_release_tree(self, base_dir, files): + root = get_root() + cfg = get_config_from_root(root) + _sdist.make_release_tree(self, base_dir, files) + # now locate _version.py in the new base_dir directory + # (remembering that it may be a hardlink) and replace it with an + # updated value + target_versionfile = os.path.join(base_dir, cfg.versionfile_source) + print("UPDATING %s" % target_versionfile) + write_to_version_file(target_versionfile, + self._versioneer_generated_versions) + cmds["sdist"] = cmd_sdist + + return cmds + + +CONFIG_ERROR = """ +setup.cfg is missing the necessary Versioneer configuration. You need +a section like: + + [versioneer] + VCS = git + style = pep440 + versionfile_source = src/myproject/_version.py + versionfile_build = myproject/_version.py + tag_prefix = + parentdir_prefix = myproject- + +You will also need to edit your setup.py to use the results: + + import versioneer + setup(version=versioneer.get_version(), + cmdclass=versioneer.get_cmdclass(), ...) + +Please read the docstring in ./versioneer.py for configuration instructions, +edit setup.cfg, and re-run the installer or 'python versioneer.py setup'. +""" + +SAMPLE_CONFIG = """ +# See the docstring in versioneer.py for instructions. Note that you must +# re-run 'versioneer.py setup' after changing this section, and commit the +# resulting files. + +[versioneer] +#VCS = git +#style = pep440 +#versionfile_source = +#versionfile_build = +#tag_prefix = +#parentdir_prefix = + +""" + +INIT_PY_SNIPPET = """ +from ._version import get_versions +__version__ = get_versions()['version'] +del get_versions +""" + + +def do_setup(): + """Do main VCS-independent setup function for installing Versioneer.""" + root = get_root() + try: + cfg = get_config_from_root(root) + except (EnvironmentError, configparser.NoSectionError, + configparser.NoOptionError) as e: + if isinstance(e, (EnvironmentError, configparser.NoSectionError)): + print("Adding sample versioneer config to setup.cfg", + file=sys.stderr) + with open(os.path.join(root, "setup.cfg"), "a") as f: + f.write(SAMPLE_CONFIG) + print(CONFIG_ERROR, file=sys.stderr) + return 1 + + print(" creating %s" % cfg.versionfile_source) + with open(cfg.versionfile_source, "w") as f: + LONG = LONG_VERSION_PY[cfg.VCS] + f.write(LONG % {"DOLLAR": "$", + "STYLE": cfg.style, + "TAG_PREFIX": cfg.tag_prefix, + "PARENTDIR_PREFIX": cfg.parentdir_prefix, + "VERSIONFILE_SOURCE": cfg.versionfile_source, + }) + + ipy = os.path.join(os.path.dirname(cfg.versionfile_source), + "__init__.py") + if os.path.exists(ipy): + try: + with open(ipy, "r") as f: + old = f.read() + except EnvironmentError: + old = "" + if INIT_PY_SNIPPET not in old: + print(" appending to %s" % ipy) + with open(ipy, "a") as f: + f.write(INIT_PY_SNIPPET) + else: + print(" %s unmodified" % ipy) + else: + print(" %s doesn't exist, ok" % ipy) + ipy = None + + # Make sure both the top-level "versioneer.py" and versionfile_source + # (PKG/_version.py, used by runtime code) are in MANIFEST.in, so + # they'll be copied into source distributions. Pip won't be able to + # install the package without this. + manifest_in = os.path.join(root, "MANIFEST.in") + simple_includes = set() + try: + with open(manifest_in, "r") as f: + for line in f: + if line.startswith("include "): + for include in line.split()[1:]: + simple_includes.add(include) + except EnvironmentError: + pass + # That doesn't cover everything MANIFEST.in can do + # (http://docs.python.org/2/distutils/sourcedist.html#commands), so + # it might give some false negatives. Appending redundant 'include' + # lines is safe, though. + if "versioneer.py" not in simple_includes: + print(" appending 'versioneer.py' to MANIFEST.in") + with open(manifest_in, "a") as f: + f.write("include versioneer.py\n") + else: + print(" 'versioneer.py' already in MANIFEST.in") + if cfg.versionfile_source not in simple_includes: + print(" appending versionfile_source ('%s') to MANIFEST.in" % + cfg.versionfile_source) + with open(manifest_in, "a") as f: + f.write("include %s\n" % cfg.versionfile_source) + else: + print(" versionfile_source already in MANIFEST.in") + + # Make VCS-specific changes. For git, this means creating/changing + # .gitattributes to mark _version.py for export-subst keyword + # substitution. + do_vcs_install(manifest_in, cfg.versionfile_source, ipy) + return 0 + + +def scan_setup_py(): + """Validate the contents of setup.py against Versioneer's expectations.""" + found = set() + setters = False + errors = 0 + with open("setup.py", "r") as f: + for line in f.readlines(): + if "import versioneer" in line: + found.add("import") + if "versioneer.get_cmdclass()" in line: + found.add("cmdclass") + if "versioneer.get_version()" in line: + found.add("get_version") + if "versioneer.VCS" in line: + setters = True + if "versioneer.versionfile_source" in line: + setters = True + if len(found) != 3: + print("") + print("Your setup.py appears to be missing some important items") + print("(but I might be wrong). Please make sure it has something") + print("roughly like the following:") + print("") + print(" import versioneer") + print(" setup( version=versioneer.get_version(),") + print(" cmdclass=versioneer.get_cmdclass(), ...)") + print("") + errors += 1 + if setters: + print("You should remove lines like 'versioneer.VCS = ' and") + print("'versioneer.versionfile_source = ' . This configuration") + print("now lives in setup.cfg, and should be removed from setup.py") + print("") + errors += 1 + return errors + + +if __name__ == "__main__": + cmd = sys.argv[1] + if cmd == "setup": + errors = do_setup() + errors += scan_setup_py() + if errors: + sys.exit(1) From 66eaae9c597620278315c4c579ecdf242963ad15 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Thu, 22 Apr 2021 19:02:42 -0500 Subject: [PATCH 004/193] Use versioneer for versioning --- pyproject.toml | 2 +- setup.cfg | 14 ++ setup.py | 10 +- suitesparse_graphblas/__init__.py | 3 +- versioneer.py | 250 +++++++++++++++++------------- 5 files changed, 164 insertions(+), 115 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index deaec6d..c9b1056 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools", "wheel", "numpy >= 1.15"] +requires = ["setuptools", "wheel", "numpy>=1.15"] [tool.black] line-length = 100 diff --git a/setup.cfg b/setup.cfg index 9a7d334..c6637a3 100644 --- a/setup.cfg +++ b/setup.cfg @@ -10,6 +10,20 @@ ignore = E231, # Multiple spaces around "," W503, # line break before binary operator +[coverage:run] +source = suitesparse_graphblas +plugins = Cython.Coverage +omit = + suitesparse_graphblas/_version.py + +[coverage:report] +# Regexes for lines to exclude from consideration +exclude_lines = + pragma: no cover + + raise AssertionError + raise NotImplementedError + [versioneer] VCS = git style = pep440 diff --git a/setup.py b/setup.py index 7a4fa75..f76b549 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,6 @@ from setuptools import setup, find_packages, Extension from glob import glob + try: from Cython.Build import cythonize from Cython.Compiler.Options import get_directive_defaults @@ -10,6 +11,7 @@ import numpy as np import os import sys +import versioneer define_macros = [("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")] @@ -45,15 +47,15 @@ package_data["suitesparse_graphblas"].append("*.dll") setup( - name='suitesparse-graphblas', + name="suitesparse-graphblas", version=versioneer.get_version(), cmdclass=versioneer.get_cmdclass(), - description='SuiteSparse:GraphBLAS Python bindings.', + description="SuiteSparse:GraphBLAS Python bindings.", long_description=long_description, long_description_content_type="text/markdown", packages=find_packages(), - author='Michel Pelletier, James Kitchen, Erik Welch', - author_email="jim22k@gmail.com,erik.n.welch@gmail.com", + author="Michel Pelletier, James Kitchen, Erik Welch", + author_email="michel@graphegon.com,jim22k@gmail.com,erik.n.welch@gmail.com", url="https://github.com/GraphBLAS/python-suitesparse-graphblas", ext_modules=ext_modules, cffi_modules=["suitesparse_graphblas/build.py:ffibuilder"], diff --git a/suitesparse_graphblas/__init__.py b/suitesparse_graphblas/__init__.py index ae63bfa..2b1caab 100644 --- a/suitesparse_graphblas/__init__.py +++ b/suitesparse_graphblas/__init__.py @@ -1,5 +1,4 @@ -from ._graphblas import ffi, lib - +from ._graphblas import ffi, lib # noqa from ._version import get_versions __version__ = get_versions()["version"] diff --git a/versioneer.py b/versioneer.py index 1040c21..af35fa4 100644 --- a/versioneer.py +++ b/versioneer.py @@ -1,4 +1,3 @@ - # Version: 0.19 """The Versioneer - like a rocketeer, but for versions. @@ -301,11 +300,13 @@ def get_root(): setup_py = os.path.join(root, "setup.py") versioneer_py = os.path.join(root, "versioneer.py") if not (os.path.exists(setup_py) or os.path.exists(versioneer_py)): - err = ("Versioneer was unable to run the project root directory. " - "Versioneer requires setup.py to be executed from " - "its immediate directory (like 'python setup.py COMMAND'), " - "or in a way that lets it use sys.argv[0] to find the root " - "(like 'python path/to/setup.py COMMAND').") + err = ( + "Versioneer was unable to run the project root directory. " + "Versioneer requires setup.py to be executed from " + "its immediate directory (like 'python setup.py COMMAND'), " + "or in a way that lets it use sys.argv[0] to find the root " + "(like 'python path/to/setup.py COMMAND')." + ) raise VersioneerBadRootError(err) try: # Certain runtime workflows (setup.py install/develop in a setuptools @@ -318,8 +319,10 @@ def get_root(): me_dir = os.path.normcase(os.path.splitext(me)[0]) vsr_dir = os.path.normcase(os.path.splitext(versioneer_py)[0]) if me_dir != vsr_dir: - print("Warning: build in %s is using versioneer.py from %s" - % (os.path.dirname(me), versioneer_py)) + print( + "Warning: build in %s is using versioneer.py from %s" + % (os.path.dirname(me), versioneer_py) + ) except NameError: pass return root @@ -341,6 +344,7 @@ def get(parser, name): if parser.has_option("versioneer", name): return parser.get("versioneer", name) return None + cfg = VersioneerConfig() cfg.VCS = VCS cfg.style = get(parser, "style") or "" @@ -365,17 +369,18 @@ class NotThisMethod(Exception): def register_vcs_handler(vcs, method): # decorator """Create decorator to mark a method as the handler of a VCS.""" + def decorate(f): """Store f in HANDLERS[vcs][method].""" if vcs not in HANDLERS: HANDLERS[vcs] = {} HANDLERS[vcs][method] = f return f + return decorate -def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False, - env=None): +def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False, env=None): """Call the given command(s).""" assert isinstance(commands, list) p = None @@ -383,10 +388,13 @@ def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False, try: dispcmd = str([c] + args) # remember shell=False, so use git.cmd on windows, not just git - p = subprocess.Popen([c] + args, cwd=cwd, env=env, - stdout=subprocess.PIPE, - stderr=(subprocess.PIPE if hide_stderr - else None)) + p = subprocess.Popen( + [c] + args, + cwd=cwd, + env=env, + stdout=subprocess.PIPE, + stderr=(subprocess.PIPE if hide_stderr else None), + ) break except EnvironmentError: e = sys.exc_info()[1] @@ -409,7 +417,9 @@ def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False, return stdout, p.returncode -LONG_VERSION_PY['git'] = r''' +LONG_VERSION_PY[ + "git" +] = r''' # This file helps to compute a version number in source trees obtained from # git-archive tarball (such as those provided by githubs download-from-tag # feature). Distribution tarballs (built by setup.py sdist) and build @@ -993,7 +1003,7 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose): # starting in git-1.8.3, tags are listed as "tag: foo-1.0" instead of # just "foo-1.0". If we see a "tag: " prefix, prefer those. TAG = "tag: " - tags = set([r[len(TAG):] for r in refs if r.startswith(TAG)]) + tags = set([r[len(TAG) :] for r in refs if r.startswith(TAG)]) if not tags: # Either we're using git < 1.8.3, or there really are no tags. We use # a heuristic: assume all version tags have a digit. The old git %d @@ -1002,7 +1012,7 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose): # between branches and tags. By ignoring refnames without digits, we # filter out many common branch names like "release" and # "stabilization", as well as "HEAD" and "master". - tags = set([r for r in refs if re.search(r'\d', r)]) + tags = set([r for r in refs if re.search(r"\d", r)]) if verbose: print("discarding '%s', no digits" % ",".join(refs - tags)) if verbose: @@ -1010,19 +1020,26 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose): for ref in sorted(tags): # sorting will prefer e.g. "2.0" over "2.0rc1" if ref.startswith(tag_prefix): - r = ref[len(tag_prefix):] + r = ref[len(tag_prefix) :] if verbose: print("picking %s" % r) - return {"version": r, - "full-revisionid": keywords["full"].strip(), - "dirty": False, "error": None, - "date": date} + return { + "version": r, + "full-revisionid": keywords["full"].strip(), + "dirty": False, + "error": None, + "date": date, + } # no suitable tags, so version is "0+unknown", but full hex is still there if verbose: print("no suitable tags, using unknown + full revision id") - return {"version": "0+unknown", - "full-revisionid": keywords["full"].strip(), - "dirty": False, "error": "no suitable tags", "date": None} + return { + "version": "0+unknown", + "full-revisionid": keywords["full"].strip(), + "dirty": False, + "error": "no suitable tags", + "date": None, + } @register_vcs_handler("git", "pieces_from_vcs") @@ -1037,8 +1054,7 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command): if sys.platform == "win32": GITS = ["git.cmd", "git.exe"] - out, rc = run_command(GITS, ["rev-parse", "--git-dir"], cwd=root, - hide_stderr=True) + out, rc = run_command(GITS, ["rev-parse", "--git-dir"], cwd=root, hide_stderr=True) if rc != 0: if verbose: print("Directory %s not under git control" % root) @@ -1046,10 +1062,11 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command): # if there is a tag matching tag_prefix, this yields TAG-NUM-gHEX[-dirty] # if there isn't one, this yields HEX[-dirty] (no NUM) - describe_out, rc = run_command(GITS, ["describe", "--tags", "--dirty", - "--always", "--long", - "--match", "%s*" % tag_prefix], - cwd=root) + describe_out, rc = run_command( + GITS, + ["describe", "--tags", "--dirty", "--always", "--long", "--match", "%s*" % tag_prefix], + cwd=root, + ) # --long was added in git-1.5.5 if describe_out is None: raise NotThisMethod("'git describe' failed") @@ -1072,17 +1089,16 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command): dirty = git_describe.endswith("-dirty") pieces["dirty"] = dirty if dirty: - git_describe = git_describe[:git_describe.rindex("-dirty")] + git_describe = git_describe[: git_describe.rindex("-dirty")] # now we have TAG-NUM-gHEX or HEX if "-" in git_describe: # TAG-NUM-gHEX - mo = re.search(r'^(.+)-(\d+)-g([0-9a-f]+)$', git_describe) + mo = re.search(r"^(.+)-(\d+)-g([0-9a-f]+)$", git_describe) if not mo: # unparseable. Maybe git-describe is misbehaving? - pieces["error"] = ("unable to parse git-describe output: '%s'" - % describe_out) + pieces["error"] = "unable to parse git-describe output: '%s'" % describe_out return pieces # tag @@ -1091,10 +1107,9 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command): if verbose: fmt = "tag '%s' doesn't start with prefix '%s'" print(fmt % (full_tag, tag_prefix)) - pieces["error"] = ("tag '%s' doesn't start with prefix '%s'" - % (full_tag, tag_prefix)) + pieces["error"] = "tag '%s' doesn't start with prefix '%s'" % (full_tag, tag_prefix) return pieces - pieces["closest-tag"] = full_tag[len(tag_prefix):] + pieces["closest-tag"] = full_tag[len(tag_prefix) :] # distance: number of commits since tag pieces["distance"] = int(mo.group(2)) @@ -1105,13 +1120,11 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command): else: # HEX: no tags pieces["closest-tag"] = None - count_out, rc = run_command(GITS, ["rev-list", "HEAD", "--count"], - cwd=root) + count_out, rc = run_command(GITS, ["rev-list", "HEAD", "--count"], cwd=root) pieces["distance"] = int(count_out) # total number of commits # commit date: see ISO-8601 comment in git_versions_from_keywords() - date = run_command(GITS, ["show", "-s", "--format=%ci", "HEAD"], - cwd=root)[0].strip() + date = run_command(GITS, ["show", "-s", "--format=%ci", "HEAD"], cwd=root)[0].strip() # Use only the last line. Previous lines may contain GPG signature # information. date = date.splitlines()[-1] @@ -1170,16 +1183,22 @@ def versions_from_parentdir(parentdir_prefix, root, verbose): for i in range(3): dirname = os.path.basename(root) if dirname.startswith(parentdir_prefix): - return {"version": dirname[len(parentdir_prefix):], - "full-revisionid": None, - "dirty": False, "error": None, "date": None} + return { + "version": dirname[len(parentdir_prefix) :], + "full-revisionid": None, + "dirty": False, + "error": None, + "date": None, + } else: rootdirs.append(root) root = os.path.dirname(root) # up a level if verbose: - print("Tried directories %s but none started with prefix %s" % - (str(rootdirs), parentdir_prefix)) + print( + "Tried directories %s but none started with prefix %s" + % (str(rootdirs), parentdir_prefix) + ) raise NotThisMethod("rootdir doesn't start with parentdir_prefix") @@ -1208,11 +1227,9 @@ def versions_from_file(filename): contents = f.read() except EnvironmentError: raise NotThisMethod("unable to read _version.py") - mo = re.search(r"version_json = '''\n(.*)''' # END VERSION_JSON", - contents, re.M | re.S) + mo = re.search(r"version_json = '''\n(.*)''' # END VERSION_JSON", contents, re.M | re.S) if not mo: - mo = re.search(r"version_json = '''\r\n(.*)''' # END VERSION_JSON", - contents, re.M | re.S) + mo = re.search(r"version_json = '''\r\n(.*)''' # END VERSION_JSON", contents, re.M | re.S) if not mo: raise NotThisMethod("no version_json in _version.py") return json.loads(mo.group(1)) @@ -1221,8 +1238,7 @@ def versions_from_file(filename): def write_to_version_file(filename, versions): """Write the given version number to the given _version.py file.""" os.unlink(filename) - contents = json.dumps(versions, sort_keys=True, - indent=1, separators=(",", ": ")) + contents = json.dumps(versions, sort_keys=True, indent=1, separators=(",", ": ")) with open(filename, "w") as f: f.write(SHORT_VERSION_PY % contents) @@ -1254,8 +1270,7 @@ def render_pep440(pieces): rendered += ".dirty" else: # exception #1 - rendered = "0+untagged.%d.g%s" % (pieces["distance"], - pieces["short"]) + rendered = "0+untagged.%d.g%s" % (pieces["distance"], pieces["short"]) if pieces["dirty"]: rendered += ".dirty" return rendered @@ -1369,11 +1384,13 @@ def render_git_describe_long(pieces): def render(pieces, style): """Render the given version pieces into the requested style.""" if pieces["error"]: - return {"version": "unknown", - "full-revisionid": pieces.get("long"), - "dirty": None, - "error": pieces["error"], - "date": None} + return { + "version": "unknown", + "full-revisionid": pieces.get("long"), + "dirty": None, + "error": pieces["error"], + "date": None, + } if not style or style == "default": style = "pep440" # the default @@ -1393,9 +1410,13 @@ def render(pieces, style): else: raise ValueError("unknown style '%s'" % style) - return {"version": rendered, "full-revisionid": pieces["long"], - "dirty": pieces["dirty"], "error": None, - "date": pieces.get("date")} + return { + "version": rendered, + "full-revisionid": pieces["long"], + "dirty": pieces["dirty"], + "error": None, + "date": pieces.get("date"), + } class VersioneerBadRootError(Exception): @@ -1418,8 +1439,7 @@ def get_versions(verbose=False): handlers = HANDLERS.get(cfg.VCS) assert handlers, "unrecognized VCS '%s'" % cfg.VCS verbose = verbose or cfg.verbose - assert cfg.versionfile_source is not None, \ - "please set versioneer.versionfile_source" + assert cfg.versionfile_source is not None, "please set versioneer.versionfile_source" assert cfg.tag_prefix is not None, "please set versioneer.tag_prefix" versionfile_abs = os.path.join(root, cfg.versionfile_source) @@ -1473,9 +1493,13 @@ def get_versions(verbose=False): if verbose: print("unable to compute version") - return {"version": "0+unknown", "full-revisionid": None, - "dirty": None, "error": "unable to compute version", - "date": None} + return { + "version": "0+unknown", + "full-revisionid": None, + "dirty": None, + "error": "unable to compute version", + "date": None, + } def get_version(): @@ -1528,6 +1552,7 @@ def run(self): print(" date: %s" % vers.get("date")) if vers["error"]: print(" error: %s" % vers["error"]) + cmds["version"] = cmd_version # we override "build_py" in both distutils and setuptools @@ -1546,8 +1571,8 @@ def run(self): # setup.py egg_info -> ? # we override different "build_py" commands for both environments - if 'build_py' in cmds: - _build_py = cmds['build_py'] + if "build_py" in cmds: + _build_py = cmds["build_py"] elif "setuptools" in sys.modules: from setuptools.command.build_py import build_py as _build_py else: @@ -1562,10 +1587,10 @@ def run(self): # now locate _version.py in the new build/ directory and replace # it with an updated value if cfg.versionfile_build: - target_versionfile = os.path.join(self.build_lib, - cfg.versionfile_build) + target_versionfile = os.path.join(self.build_lib, cfg.versionfile_build) print("UPDATING %s" % target_versionfile) write_to_version_file(target_versionfile, versions) + cmds["build_py"] = cmd_build_py if "setuptools" in sys.modules: @@ -1587,14 +1612,15 @@ def run(self): return # now locate _version.py in the new build/ directory and replace # it with an updated value - target_versionfile = os.path.join(self.build_lib, - cfg.versionfile_source) + target_versionfile = os.path.join(self.build_lib, cfg.versionfile_source) print("UPDATING %s" % target_versionfile) write_to_version_file(target_versionfile, versions) + cmds["build_ext"] = cmd_build_ext if "cx_Freeze" in sys.modules: # cx_freeze enabled? from cx_Freeze.dist import build_exe as _build_exe + # nczeczulin reports that py2exe won't like the pep440-style string # as FILEVERSION, but it can be used for PRODUCTVERSION, e.g. # setup(console=[{ @@ -1615,17 +1641,21 @@ def run(self): os.unlink(target_versionfile) with open(cfg.versionfile_source, "w") as f: LONG = LONG_VERSION_PY[cfg.VCS] - f.write(LONG % - {"DOLLAR": "$", - "STYLE": cfg.style, - "TAG_PREFIX": cfg.tag_prefix, - "PARENTDIR_PREFIX": cfg.parentdir_prefix, - "VERSIONFILE_SOURCE": cfg.versionfile_source, - }) + f.write( + LONG + % { + "DOLLAR": "$", + "STYLE": cfg.style, + "TAG_PREFIX": cfg.tag_prefix, + "PARENTDIR_PREFIX": cfg.parentdir_prefix, + "VERSIONFILE_SOURCE": cfg.versionfile_source, + } + ) + cmds["build_exe"] = cmd_build_exe del cmds["build_py"] - if 'py2exe' in sys.modules: # py2exe enabled? + if "py2exe" in sys.modules: # py2exe enabled? from py2exe.distutils_buildexe import py2exe as _py2exe class cmd_py2exe(_py2exe): @@ -1641,18 +1671,22 @@ def run(self): os.unlink(target_versionfile) with open(cfg.versionfile_source, "w") as f: LONG = LONG_VERSION_PY[cfg.VCS] - f.write(LONG % - {"DOLLAR": "$", - "STYLE": cfg.style, - "TAG_PREFIX": cfg.tag_prefix, - "PARENTDIR_PREFIX": cfg.parentdir_prefix, - "VERSIONFILE_SOURCE": cfg.versionfile_source, - }) + f.write( + LONG + % { + "DOLLAR": "$", + "STYLE": cfg.style, + "TAG_PREFIX": cfg.tag_prefix, + "PARENTDIR_PREFIX": cfg.parentdir_prefix, + "VERSIONFILE_SOURCE": cfg.versionfile_source, + } + ) + cmds["py2exe"] = cmd_py2exe # we override different "sdist" commands for both environments - if 'sdist' in cmds: - _sdist = cmds['sdist'] + if "sdist" in cmds: + _sdist = cmds["sdist"] elif "setuptools" in sys.modules: from setuptools.command.sdist import sdist as _sdist else: @@ -1676,8 +1710,8 @@ def make_release_tree(self, base_dir, files): # updated value target_versionfile = os.path.join(base_dir, cfg.versionfile_source) print("UPDATING %s" % target_versionfile) - write_to_version_file(target_versionfile, - self._versioneer_generated_versions) + write_to_version_file(target_versionfile, self._versioneer_generated_versions) + cmds["sdist"] = cmd_sdist return cmds @@ -1732,11 +1766,9 @@ def do_setup(): root = get_root() try: cfg = get_config_from_root(root) - except (EnvironmentError, configparser.NoSectionError, - configparser.NoOptionError) as e: + except (EnvironmentError, configparser.NoSectionError, configparser.NoOptionError) as e: if isinstance(e, (EnvironmentError, configparser.NoSectionError)): - print("Adding sample versioneer config to setup.cfg", - file=sys.stderr) + print("Adding sample versioneer config to setup.cfg", file=sys.stderr) with open(os.path.join(root, "setup.cfg"), "a") as f: f.write(SAMPLE_CONFIG) print(CONFIG_ERROR, file=sys.stderr) @@ -1745,15 +1777,18 @@ def do_setup(): print(" creating %s" % cfg.versionfile_source) with open(cfg.versionfile_source, "w") as f: LONG = LONG_VERSION_PY[cfg.VCS] - f.write(LONG % {"DOLLAR": "$", - "STYLE": cfg.style, - "TAG_PREFIX": cfg.tag_prefix, - "PARENTDIR_PREFIX": cfg.parentdir_prefix, - "VERSIONFILE_SOURCE": cfg.versionfile_source, - }) - - ipy = os.path.join(os.path.dirname(cfg.versionfile_source), - "__init__.py") + f.write( + LONG + % { + "DOLLAR": "$", + "STYLE": cfg.style, + "TAG_PREFIX": cfg.tag_prefix, + "PARENTDIR_PREFIX": cfg.parentdir_prefix, + "VERSIONFILE_SOURCE": cfg.versionfile_source, + } + ) + + ipy = os.path.join(os.path.dirname(cfg.versionfile_source), "__init__.py") if os.path.exists(ipy): try: with open(ipy, "r") as f: @@ -1795,8 +1830,7 @@ def do_setup(): else: print(" 'versioneer.py' already in MANIFEST.in") if cfg.versionfile_source not in simple_includes: - print(" appending versionfile_source ('%s') to MANIFEST.in" % - cfg.versionfile_source) + print(" appending versionfile_source ('%s') to MANIFEST.in" % cfg.versionfile_source) with open(manifest_in, "a") as f: f.write("include %s\n" % cfg.versionfile_source) else: From 009d3d689d4375b3ff865c7ee10adfaebd7bf529 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Thu, 22 Apr 2021 20:52:37 -0500 Subject: [PATCH 005/193] Basic `initialize(...)` and `is_initialized` --- suitesparse_graphblas/__init__.py | 40 +++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/suitesparse_graphblas/__init__.py b/suitesparse_graphblas/__init__.py index 2b1caab..c4c7aec 100644 --- a/suitesparse_graphblas/__init__.py +++ b/suitesparse_graphblas/__init__.py @@ -1,5 +1,45 @@ from ._graphblas import ffi, lib # noqa +from . import utils from ._version import get_versions +is_initialized = False + + +def initialize(*, blocking=False, memory_manager="numpy"): + """Initialize GraphBLAS via GrB_init or GxB_init. + + This must be called before any other GraphBLAS functions are called. + A RuntimeError will be raised if called more than once. + + Parameters + ---------- + blocking : bool, optional + Whether to call init with GrB_BLOCKING or GrB_NONBLOCKING. + Default is False. + memory_manager : {'numpy', 'c'}, optional + Choose which malloc/free functions to use. 'numpy' uses numpy's + allocators, which makes it safe to perform zero-copy to and from numpy, + and allows Python to track memory usage via tracemalloc (if enabled). + 'c' uses the default allocators. Default is 'numpy'. + + The global variable `suitesparse_graphblas.is_initialized` indicates whether + GraphBLAS has been initialized. + """ + global is_initialized + if is_initialized: + raise RuntimeError( + "suitesparse-python is already initialized! Unable to initialize again." + ) + blocking = lib.GrB_BLOCKING if blocking else lib.GrB_NONBLOCKING + memory_manager = memory_manager.lower() + if memory_manager == "numpy": + utils.call_gxb_init(ffi, lib, blocking) + elif memory_manager == "c": + lib.GrB_init(blocking) + else: + raise ValueError(f'memory_manager argument must be "numpy" or "c"; got: {memory_manager!r}') + is_initialized = True + + __version__ = get_versions()["version"] del get_versions From 9cda882adec09856ab1adaa80bf4295d3a4bbd0c Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Thu, 22 Apr 2021 21:05:44 -0500 Subject: [PATCH 006/193] Create `is_initialized` function that tries to call `GxB_Global_Option_get` Thanks for the trick, @michelp! --- suitesparse_graphblas/__init__.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/suitesparse_graphblas/__init__.py b/suitesparse_graphblas/__init__.py index c4c7aec..99c3c5c 100644 --- a/suitesparse_graphblas/__init__.py +++ b/suitesparse_graphblas/__init__.py @@ -2,7 +2,11 @@ from . import utils from ._version import get_versions -is_initialized = False + +def is_initialized(): + """Is GraphBLAS initialized via GrB_init or GxB_init?""" + fmt = ffi.new("GxB_Format_Value*") + return lib.GxB_Global_Option_get(lib.GxB_FORMAT, fmt) != lib.GrB_PANIC def initialize(*, blocking=False, memory_manager="numpy"): @@ -25,8 +29,7 @@ def initialize(*, blocking=False, memory_manager="numpy"): The global variable `suitesparse_graphblas.is_initialized` indicates whether GraphBLAS has been initialized. """ - global is_initialized - if is_initialized: + if is_initialized(): raise RuntimeError( "suitesparse-python is already initialized! Unable to initialize again." ) @@ -38,7 +41,6 @@ def initialize(*, blocking=False, memory_manager="numpy"): lib.GrB_init(blocking) else: raise ValueError(f'memory_manager argument must be "numpy" or "c"; got: {memory_manager!r}') - is_initialized = True __version__ = get_versions()["version"] From 3e6a8f7002d3ec41de5bd259b7f1c4606b08396e Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Thu, 22 Apr 2021 21:13:49 -0500 Subject: [PATCH 007/193] I like using MODE instead --- suitesparse_graphblas/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/suitesparse_graphblas/__init__.py b/suitesparse_graphblas/__init__.py index 99c3c5c..b5acb52 100644 --- a/suitesparse_graphblas/__init__.py +++ b/suitesparse_graphblas/__init__.py @@ -5,8 +5,7 @@ def is_initialized(): """Is GraphBLAS initialized via GrB_init or GxB_init?""" - fmt = ffi.new("GxB_Format_Value*") - return lib.GxB_Global_Option_get(lib.GxB_FORMAT, fmt) != lib.GrB_PANIC + return lib.GxB_Global_Option_get(lib.GxB_MODE, ffi.new("GrB_Mode*")) != lib.GrB_PANIC def initialize(*, blocking=False, memory_manager="numpy"): From 225fb81b2f02ce9f78304d5fe22988061dc272ee Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Thu, 22 Apr 2021 21:29:57 -0500 Subject: [PATCH 008/193] Haha, I can't spell --- suitesparse_graphblas/__init__.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/suitesparse_graphblas/__init__.py b/suitesparse_graphblas/__init__.py index b5acb52..b8bd35a 100644 --- a/suitesparse_graphblas/__init__.py +++ b/suitesparse_graphblas/__init__.py @@ -29,9 +29,7 @@ def initialize(*, blocking=False, memory_manager="numpy"): GraphBLAS has been initialized. """ if is_initialized(): - raise RuntimeError( - "suitesparse-python is already initialized! Unable to initialize again." - ) + raise RuntimeError("GraphBLAS is already initialized! Unable to initialize again.") blocking = lib.GrB_BLOCKING if blocking else lib.GrB_NONBLOCKING memory_manager = memory_manager.lower() if memory_manager == "numpy": From 7b5f9969edb0347e88d187a87c218aa5157c80f4 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Fri, 23 Apr 2021 15:21:15 -0500 Subject: [PATCH 009/193] Include C files. Not including them broke the source distribution. Also, remove "clean_header.py", which is no longer used. --- MANIFEST.in | 1 + setup.py | 2 +- suitesparse_graphblas/clean_header.py | 97 --------------------------- 3 files changed, 2 insertions(+), 98 deletions(-) delete mode 100644 suitesparse_graphblas/clean_header.py diff --git a/MANIFEST.in b/MANIFEST.in index 440656f..3e2a1a0 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -3,6 +3,7 @@ include README.md include LICENSE include suitesparse_graphblas/*.pxd include suitesparse_graphblas/*.pyx +include suitesparse_graphblas/*.c include suitesparse_graphblas/*.h include versioneer.py include suitesparse_graphblas/_version.py diff --git a/setup.py b/setup.py index f76b549..d0c4f7a 100644 --- a/setup.py +++ b/setup.py @@ -42,7 +42,7 @@ with open("README.md") as f: long_description = f.read() -package_data = {"suitesparse_graphblas": ["*.pyx", "*.pxd", "*.h"]} +package_data = {"suitesparse_graphblas": ["*.pyx", "*.pxd", "*.c", "*.h"]} if sys.platform == "win32": package_data["suitesparse_graphblas"].append("*.dll") diff --git a/suitesparse_graphblas/clean_header.py b/suitesparse_graphblas/clean_header.py deleted file mode 100644 index 3265a01..0000000 --- a/suitesparse_graphblas/clean_header.py +++ /dev/null @@ -1,97 +0,0 @@ -import sys -import os -import re - - -def rename_defined_constants(text): - # #define GB_PUBLIC extern - text = text.replace("GB_PUBLIC", "extern") - - return text - - -def remove_directives(text): - # There are a few cases of safe `#define` directives that we need to keep - # - #define FOO 12 - # - #define BAR ... - safe_define = re.compile(r"^#define\s+\w+\s+(\d+|\.{3})(\s|$)") - - out = [] - multiline = False - for line in text.splitlines(): - if not line: - out.append(line) - elif multiline: - if line[-1] != "\\": - multiline = False - out.append(f"/* {line} */") - elif line.lstrip()[0] == "#": - if line[-1] == "\\": - multiline = True - if not multiline and safe_define.match(line): - out.append(line) - else: - out.append(f"/* {line} */") - else: - out.append(line) - return "\n".join(out) - - -def remove_complex(text): - out = [] - extern_block = None - complex_extern = False - for line in text.splitlines(): - if extern_block is not None: - if "FC32" in line or "FC64" in line: - complex_extern = True - if line.replace(" ", "") == ");": # End of extern block - extern_block.append(line) - if complex_extern: - for i in range(len(extern_block)): - extern_block[i] = f"// {extern_block[i]}" - out.extend(extern_block) - extern_block = None - complex_extern = False - else: - extern_block.append(line) - elif not line: - out.append(line) - elif line.strip() == "extern": - extern_block = [line] - elif "FC32" in line or "FC64" in line: - # Check if the line is a terminating line - if re.search(r"FC(32|64)\s*;", line): - # By commenting the terminating line out, we lose the closing semicolon - # Walk up the lines, looking for the last non-commented out line - # then replace the trailing comma with a semicolon - for i in range(5): # it's never more than 5 away - if out[-i].startswith("//"): - continue - last_comma_pos = out[-i].rfind(",") - if last_comma_pos < 0: - continue - out[-i] = f"{out[-i][:last_comma_pos]};{out[-i][last_comma_pos+1:]}" - break - out.append(f"// {line}") - else: - out.append(line) - return "\n".join(out) - - -def main(filename): - with open(filename, "r") as f: - text = f.read() - text = rename_defined_constants(text) - text = remove_directives(text) - if "_no_complex_" in filename: - text = remove_complex(text) - with open(filename, "w") as f: - f.write(text) - - -if __name__ == "__main__": - filename = sys.argv[1] - if not os.path.exists(filename): - raise Exception(f'"{filename}" does not exist') - main(filename) From 0ac46698de942de4d161aed36ac6fd6f1a84abdb Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Fri, 23 Apr 2021 16:44:39 -0500 Subject: [PATCH 010/193] It seems `zip_safe=False` is needed b/c Cython --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index d0c4f7a..589fdea 100644 --- a/setup.py +++ b/setup.py @@ -66,4 +66,5 @@ license="Apache License 2.0", package_data=package_data, include_package_data=True, + zip_safe=False, ) From f9a9d21188b78234014bd849248750c40332c383 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Mon, 26 Apr 2021 16:40:42 -0500 Subject: [PATCH 011/193] Try adding a simple CI script for GithubActions. Also, let's require Cython when building (for now). This is probably safest for now (i.e., less error prone). Someday, somebody may want to be able to install from source w/o Cython using only .c files. --- .github/workflows/test.yml | 40 +++++++++++++++++++++ pyproject.toml | 2 +- setup.py | 7 ++++ suitesparse_graphblas/create_headers.py | 2 +- suitesparse_graphblas/tests/test_package.py | 2 +- 5 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..1a31a1e --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,40 @@ +name: python-suitesparse-graphblas + +on: + push: + branches: [ $default-branch ] + pull_request: + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: ["ubuntu-latest", "macos-latest", "windows-latest"] + python-version: [3.7, 3.8, 3.9] + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Conda + uses: conda-incubator/setup-miniconda@v2 + with: + auto-update-conda: true + python-version: ${{ matrix.python-version }} + channels: conda-forge + - name: Build + run: | + conda info + conda list + conda install -c conda-forge cffi cython numpy graphblas pytest coverage black flake8 # TODO: environment.yml + python setup.py build_ext --inplace + python setup.py develop + - name: Test + env: + CYTHON_COVERAGE: true + run: | + coverage run --branch -m pytest + - name: Lint + run: | + black *py suitesparse_graphblas --check --diff + flake8 *py suitesparse_graphblas diff --git a/pyproject.toml b/pyproject.toml index c9b1056..27a1304 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools", "wheel", "numpy>=1.15"] +requires = ["setuptools", "wheel", "numpy>=1.15", "cython"] [tool.black] line-length = 100 diff --git a/setup.py b/setup.py index 589fdea..41bb1c3 100644 --- a/setup.py +++ b/setup.py @@ -25,6 +25,13 @@ define_macros.append(("CYTHON_TRACE_NOGIL", "1")) else: suffix = ".c" + # Make sure all required .c files are here + pyx_files = glob("suitesparse_graphblas/**.pyx", recursive=True) + c_files = glob("suitesparse_graphblas/**.c", recursive=True) + missing = {x[:-4] for x in pyx_files} - {x[:-2] for x in c_files} + if missing: + missing_c = sorted(x + ".c" for x in missing) + raise RuntimeError("Cython required when missing C files: " + ", ".join(missing_c)) include_dirs = [np.get_include(), os.path.join(sys.prefix, "include")] ext_modules = [ diff --git a/suitesparse_graphblas/create_headers.py b/suitesparse_graphblas/create_headers.py index 9a5f528..c19035d 100644 --- a/suitesparse_graphblas/create_headers.py +++ b/suitesparse_graphblas/create_headers.py @@ -32,7 +32,7 @@ def sort_key(string): - """ e.g., sort 'INT8' before 'INT16'""" + """e.g., sort 'INT8' before 'INT16'""" return string.replace("8", "08") diff --git a/suitesparse_graphblas/tests/test_package.py b/suitesparse_graphblas/tests/test_package.py index 914662d..4bc0ab4 100644 --- a/suitesparse_graphblas/tests/test_package.py +++ b/suitesparse_graphblas/tests/test_package.py @@ -1,4 +1,4 @@ -from suitesparse_graphblas import lib, ffi +from suitesparse_graphblas import lib, ffi # noqa def test_matrix_existence(): From db6b70be205d14c1c25c11bc5cf3e0ba2f094ed7 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Mon, 26 Apr 2021 16:45:47 -0500 Subject: [PATCH 012/193] Change to trigger? --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1a31a1e..a92141a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,7 +2,7 @@ name: python-suitesparse-graphblas on: push: - branches: [ $default-branch ] + branches: [main] pull_request: jobs: From 8cd777003ba944fffc9f38d9ba3408aec252d079 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Mon, 26 Apr 2021 17:00:08 -0500 Subject: [PATCH 013/193] Simple GithubAction for CI testing This is probably broken atm (adding here so it will trigger) --- .github/workflows/test.yml | 40 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..a92141a --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,40 @@ +name: python-suitesparse-graphblas + +on: + push: + branches: [main] + pull_request: + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: ["ubuntu-latest", "macos-latest", "windows-latest"] + python-version: [3.7, 3.8, 3.9] + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Conda + uses: conda-incubator/setup-miniconda@v2 + with: + auto-update-conda: true + python-version: ${{ matrix.python-version }} + channels: conda-forge + - name: Build + run: | + conda info + conda list + conda install -c conda-forge cffi cython numpy graphblas pytest coverage black flake8 # TODO: environment.yml + python setup.py build_ext --inplace + python setup.py develop + - name: Test + env: + CYTHON_COVERAGE: true + run: | + coverage run --branch -m pytest + - name: Lint + run: | + black *py suitesparse_graphblas --check --diff + flake8 *py suitesparse_graphblas From 1fca0a8ed25c2b14b65c17327bbb5ad200c307aa Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Mon, 26 Apr 2021 17:00:56 -0500 Subject: [PATCH 014/193] Trigger now? --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a92141a..24cda8d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,7 +2,7 @@ name: python-suitesparse-graphblas on: push: - branches: [main] + branches: [ main ] pull_request: jobs: From 74346e7429c9cb0639437745d2a58f20b10e5639 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Mon, 26 Apr 2021 17:08:20 -0500 Subject: [PATCH 015/193] First time using `conda-incubator/setup-miniconda@v2` action, please bear with me --- .github/workflows/test.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 24cda8d..4601c0b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,7 @@ jobs: fail-fast: false matrix: os: ["ubuntu-latest", "macos-latest", "windows-latest"] - python-version: [3.7, 3.8, 3.9] + python-version: [3.7] #, 3.8, 3.9] steps: - name: Checkout uses: actions/checkout@v2 @@ -22,11 +22,10 @@ jobs: auto-update-conda: true python-version: ${{ matrix.python-version }} channels: conda-forge - - name: Build run: | conda info conda list - conda install -c conda-forge cffi cython numpy graphblas pytest coverage black flake8 # TODO: environment.yml + conda install -c conda-forge cffi cython numpy graphblas=4.0.3 pytest coverage black flake8 # TODO: environment.yml python setup.py build_ext --inplace python setup.py develop - name: Test From 01c8f701f21647f651c43c7bea2db2e4137beffd Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Mon, 26 Apr 2021 17:20:14 -0500 Subject: [PATCH 016/193] Try using environment.yml --- .github/workflows/test.yml | 5 ++++- continuous_integration/environment.yml | 13 +++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 continuous_integration/environment.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4601c0b..5ca3f76 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,11 +21,14 @@ jobs: with: auto-update-conda: true python-version: ${{ matrix.python-version }} + environment-file: continuous_integration/environment.yml channels: conda-forge + activate-environment: suitesparse-graphblas + - name: Build run: | conda info + conda config --show conda list - conda install -c conda-forge cffi cython numpy graphblas=4.0.3 pytest coverage black flake8 # TODO: environment.yml python setup.py build_ext --inplace python setup.py develop - name: Test diff --git a/continuous_integration/environment.yml b/continuous_integration/environment.yml new file mode 100644 index 0000000..fd20fb9 --- /dev/null +++ b/continuous_integration/environment.yml @@ -0,0 +1,13 @@ +name: suitesparse-graphblas +channels: + - conda-forge + - defaults +dependencies: + - graphblas=4.0.3 + - cffi + - cython + - numpy + - pytest + - coverage + - black + - flake8 From 12d7887e7ad4a586c7964a20b8e8fdea2486df1e Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Mon, 26 Apr 2021 17:29:51 -0500 Subject: [PATCH 017/193] specify shell --- .github/workflows/test.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5ca3f76..60df6af 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,10 +8,13 @@ on: jobs: test: runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash -l {0} strategy: fail-fast: false matrix: - os: ["ubuntu-latest", "macos-latest", "windows-latest"] + os: ["ubuntu-latest"] #, "macos-latest", "windows-latest"] python-version: [3.7] #, 3.8, 3.9] steps: - name: Checkout @@ -27,8 +30,10 @@ jobs: - name: Build run: | conda info + conda config --show-sources conda config --show conda list + conda env list python setup.py build_ext --inplace python setup.py develop - name: Test From 0de60411ae7fddac42c7fa5e88113db55ca3ef27 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Mon, 26 Apr 2021 17:35:35 -0500 Subject: [PATCH 018/193] Try MacOS and Windows too --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 60df6af..5e1b7da 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,8 +14,8 @@ jobs: strategy: fail-fast: false matrix: - os: ["ubuntu-latest"] #, "macos-latest", "windows-latest"] - python-version: [3.7] #, 3.8, 3.9] + os: ["ubuntu-latest", "macos-latest", "windows-latest"] + python-version: [3.7, 3.8, 3.9] steps: - name: Checkout uses: actions/checkout@v2 From 128ae68ec834d8dbb7e772299f02ae2df468ce35 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Mon, 26 Apr 2021 17:49:38 -0500 Subject: [PATCH 019/193] Include "Library/include" in include path on Windows --- .github/workflows/test.yml | 6 ++++-- suitesparse_graphblas/build.py | 6 +++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5e1b7da..af95ca9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,8 +14,10 @@ jobs: strategy: fail-fast: false matrix: - os: ["ubuntu-latest", "macos-latest", "windows-latest"] - python-version: [3.7, 3.8, 3.9] + os: ["windows-latest"] + python-version: [3.9] + # os: ["ubuntu-latest", "macos-latest", "windows-latest"] + # python-version: [3.7, 3.8, 3.9] steps: - name: Checkout uses: actions/checkout@v2 diff --git a/suitesparse_graphblas/build.py b/suitesparse_graphblas/build.py index c52c3ad..21a6939 100644 --- a/suitesparse_graphblas/build.py +++ b/suitesparse_graphblas/build.py @@ -10,11 +10,15 @@ with open(os.path.join(thisdir, "source.c")) as f: source = f.read() +include_dirs = [os.path.join(sys.prefix, "include")] +if sys.platform == "win32": + include_dirs.append(os.path.join(sys.prefix, "Library", "include")) + ffibuilder.set_source( "suitesparse_graphblas._graphblas", source, libraries=["graphblas"], - include_dirs=[os.path.join(sys.prefix, "include")], + include_dirs=include_dirs, ) header = "suitesparse_graphblas.h" From 7887b621279d5a4ba4d230b8793ae61d0f43996c Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Mon, 26 Apr 2021 18:06:52 -0500 Subject: [PATCH 020/193] Library dirs too --- .github/workflows/test.yml | 14 +++++++++----- setup.py | 3 ++- suitesparse_graphblas/build.py | 5 ++++- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index af95ca9..48bf736 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,11 +31,6 @@ jobs: activate-environment: suitesparse-graphblas - name: Build run: | - conda info - conda config --show-sources - conda config --show - conda list - conda env list python setup.py build_ext --inplace python setup.py develop - name: Test @@ -47,3 +42,12 @@ jobs: run: | black *py suitesparse_graphblas --check --diff flake8 *py suitesparse_graphblas + - name: Create headers check + # These shouldn't change, so make copies to compare to + cp suitesparse_graphblas/suitesparse_graphblas.h . + cp suitesparse_graphblas/suitesparse_graphblas_no_complex.h . + cp suitesparse_graphblas/source.h . + python suitesparse_graphblas/create_headers.py + diff suitesparse_graphblas/suitesparse_graphblas.h suitesparse_graphblas.h + diff suitesparse_graphblas/suitesparse_graphblas_no_complex.h suitesparse_graphblas_no_complex.h + diff suitesparse_graphblas/source.h source.h diff --git a/setup.py b/setup.py index 41bb1c3..c7990cc 100644 --- a/setup.py +++ b/setup.py @@ -13,6 +13,7 @@ import sys import versioneer +is_win = sys.platform.startswith("win") define_macros = [("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")] if use_cython: @@ -50,7 +51,7 @@ long_description = f.read() package_data = {"suitesparse_graphblas": ["*.pyx", "*.pxd", "*.c", "*.h"]} -if sys.platform == "win32": +if is_win: package_data["suitesparse_graphblas"].append("*.dll") setup( diff --git a/suitesparse_graphblas/build.py b/suitesparse_graphblas/build.py index 21a6939..d4a3daf 100644 --- a/suitesparse_graphblas/build.py +++ b/suitesparse_graphblas/build.py @@ -11,14 +11,17 @@ source = f.read() include_dirs = [os.path.join(sys.prefix, "include")] -if sys.platform == "win32": +library_dirs = [os.path.join(sys.prefix, "lib")] +if is_win: include_dirs.append(os.path.join(sys.prefix, "Library", "include")) + library_dirs.append(os.path.join(sys.prefix, "Library", "lib")) ffibuilder.set_source( "suitesparse_graphblas._graphblas", source, libraries=["graphblas"], include_dirs=include_dirs, + library_dirs=library_dirs, ) header = "suitesparse_graphblas.h" From bc4c1d918ad9d7deb6cc4bd4f9fdaa782823f27f Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Mon, 26 Apr 2021 18:08:05 -0500 Subject: [PATCH 021/193] oops --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 48bf736..7e4ef43 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -43,6 +43,7 @@ jobs: black *py suitesparse_graphblas --check --diff flake8 *py suitesparse_graphblas - name: Create headers check + run: | # These shouldn't change, so make copies to compare to cp suitesparse_graphblas/suitesparse_graphblas.h . cp suitesparse_graphblas/suitesparse_graphblas_no_complex.h . From f5df25f5c1bf0d11a7d2c31ab93bbbbf5d60532b Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Mon, 26 Apr 2021 18:17:59 -0500 Subject: [PATCH 022/193] oops typo --- .github/workflows/test.yml | 15 +++++++-------- suitesparse_graphblas/tests/test_initialize.py | 9 +++++++++ 2 files changed, 16 insertions(+), 8 deletions(-) create mode 100644 suitesparse_graphblas/tests/test_initialize.py diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7e4ef43..d69017e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,10 +14,8 @@ jobs: strategy: fail-fast: false matrix: - os: ["windows-latest"] - python-version: [3.9] - # os: ["ubuntu-latest", "macos-latest", "windows-latest"] - # python-version: [3.7, 3.8, 3.9] + os: ["ubuntu-latest", "macos-latest", "windows-latest"] + python-version: [3.7, 3.8, 3.9] steps: - name: Checkout uses: actions/checkout@v2 @@ -38,17 +36,18 @@ jobs: CYTHON_COVERAGE: true run: | coverage run --branch -m pytest + coverage run -a suitesparse_graphblas/tests/test_initialize.py - name: Lint run: | black *py suitesparse_graphblas --check --diff flake8 *py suitesparse_graphblas - - name: Create headers check + - name: create_headers.py check run: | # These shouldn't change, so make copies to compare to cp suitesparse_graphblas/suitesparse_graphblas.h . cp suitesparse_graphblas/suitesparse_graphblas_no_complex.h . - cp suitesparse_graphblas/source.h . - python suitesparse_graphblas/create_headers.py + cp suitesparse_graphblas/source.c . + coverage run -a suitesparse_graphblas/create_headers.py diff suitesparse_graphblas/suitesparse_graphblas.h suitesparse_graphblas.h diff suitesparse_graphblas/suitesparse_graphblas_no_complex.h suitesparse_graphblas_no_complex.h - diff suitesparse_graphblas/source.h source.h + diff suitesparse_graphblas/source.c source.c diff --git a/suitesparse_graphblas/tests/test_initialize.py b/suitesparse_graphblas/tests/test_initialize.py new file mode 100644 index 0000000..fc69305 --- /dev/null +++ b/suitesparse_graphblas/tests/test_initialize.py @@ -0,0 +1,9 @@ +if __name__ == "__main__": + import suitesparse_graphblas as ssgb + import pytest + + assert ssgb.is_initialized() is False + ssgb.initialize() + assert ssgb.is_initialized() is True + with pytest.raises(RuntimeError, match="GraphBLAS is already initialized"): + ssgb.initialize() From 0870e18bb378a91949746ea5dc9c25ea8a192e0f Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Mon, 26 Apr 2021 18:25:11 -0500 Subject: [PATCH 023/193] oops --- .github/workflows/test.yml | 6 +++--- README.md | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d69017e..89a5a84 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: python-suitesparse-graphblas +name: Test on: push: @@ -36,7 +36,7 @@ jobs: CYTHON_COVERAGE: true run: | coverage run --branch -m pytest - coverage run -a suitesparse_graphblas/tests/test_initialize.py + coverage run -a --branch suitesparse_graphblas/tests/test_initialize.py - name: Lint run: | black *py suitesparse_graphblas --check --diff @@ -47,7 +47,7 @@ jobs: cp suitesparse_graphblas/suitesparse_graphblas.h . cp suitesparse_graphblas/suitesparse_graphblas_no_complex.h . cp suitesparse_graphblas/source.c . - coverage run -a suitesparse_graphblas/create_headers.py + coverage run -a --branch suitesparse_graphblas/create_headers.py diff suitesparse_graphblas/suitesparse_graphblas.h suitesparse_graphblas.h diff suitesparse_graphblas/suitesparse_graphblas_no_complex.h suitesparse_graphblas_no_complex.h diff suitesparse_graphblas/source.c source.c diff --git a/README.md b/README.md index b10641f..c0d40fa 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,9 @@ # python-suitesparse-graphblas + +[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/GraphBLAS/python-suitesparse-graphblas/blob/main/LICENSE) +[![Build Status](https://github.com/GraphBLAS/python-suitesparse-graphblas/workflows/Build%20and%20Test/badge.svg)](https://github.com/GraphBLAS/python-suitesparse-graphblas/actions) +[![Code style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) + Python CFFI Binding around [SuiteSparse:GraphBLAS](https://github.com/DrTimothyAldenDavis/GraphBLAS) From db736a4d0e711b8fa7ba965c64f59887fd50d979 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Mon, 26 Apr 2021 18:32:44 -0500 Subject: [PATCH 024/193] Don't run `create_headers.py` on Windows --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 89a5a84..6606799 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -42,6 +42,7 @@ jobs: black *py suitesparse_graphblas --check --diff flake8 *py suitesparse_graphblas - name: create_headers.py check + if: (! contains(matrix.os, 'windows')) run: | # These shouldn't change, so make copies to compare to cp suitesparse_graphblas/suitesparse_graphblas.h . From 7ebe0841db37576555ed894f430fa81bab64323c Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Mon, 26 Apr 2021 18:49:36 -0500 Subject: [PATCH 025/193] Update badges --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c0d40fa..6c30a71 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ # python-suitesparse-graphblas +[![Version](https://img.shields.io/pypi/v/suitesparse-graphblas.svg)](https://pypi.org/project/suitesparse-graphblas/) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/GraphBLAS/python-suitesparse-graphblas/blob/main/LICENSE) -[![Build Status](https://github.com/GraphBLAS/python-suitesparse-graphblas/workflows/Build%20and%20Test/badge.svg)](https://github.com/GraphBLAS/python-suitesparse-graphblas/actions) +[![Build Status](https://github.com/GraphBLAS/python-suitesparse-graphblas/workflows/Test/badge.svg)](https://github.com/GraphBLAS/python-suitesparse-graphblas/actions) [![Code style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) Python CFFI Binding around From 00b33d5f40973271e378f77f9fe6dcecfecd63f1 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Thu, 13 May 2021 15:43:11 -0400 Subject: [PATCH 026/193] Update to SuiteSparse:GraphBLAS 5.0.3. Also, add sanity check to make sure all GrB and GxB lines are handled. This would have caught the issue of the new functions not being public in v5.0.2. --- continuous_integration/environment.yml | 2 +- suitesparse_graphblas/create_headers.py | 25 +++++++++ suitesparse_graphblas/suitesparse_graphblas.h | 51 +++++++++++-------- .../suitesparse_graphblas_no_complex.h | 51 +++++++++++-------- 4 files changed, 84 insertions(+), 45 deletions(-) diff --git a/continuous_integration/environment.yml b/continuous_integration/environment.yml index fd20fb9..4195345 100644 --- a/continuous_integration/environment.yml +++ b/continuous_integration/environment.yml @@ -3,7 +3,7 @@ channels: - conda-forge - defaults dependencies: - - graphblas=4.0.3 + - graphblas=5.0.3 - cffi - cython - numpy diff --git a/suitesparse_graphblas/create_headers.py b/suitesparse_graphblas/create_headers.py index c19035d..3b01bb6 100644 --- a/suitesparse_graphblas/create_headers.py +++ b/suitesparse_graphblas/create_headers.py @@ -301,6 +301,8 @@ def groupby(index, seq): } IGNORE_DEFINES = { + "GrB", + "GxB", "CMPLX", "CMPLXF", "GB_PUBLIC", @@ -313,6 +315,12 @@ def groupby(index, seq): "GxB_HYPER", } +IGNORE_LINES = { + "GxB_cuda_calloc", + "GxB_cuda_malloc", + "GxB_cuda_free", +} + class VisitEnumTypedef(c_generator.CGenerator): def __init__(self, *args, **kwargs): @@ -410,6 +418,23 @@ def get_groups(ast): groups["not seen"] = sorted(set(lines) - seen, key=sort_key) for group in groups["not seen"]: assert "extern" not in group, group + + unhandled = set() + for line in groups["not seen"]: + if "GrB" in line or "GxB" in line: + for item in IGNORE_LINES: + if item in line: + break + else: + unhandled.add(line) + if unhandled: + raise ValueError( + "\n===================================\n" + "Unhandled functions with GrB or GxB\n" + "-----------------------------------\n " + + "\n ".join(sorted(unhandled)) + + "\n===================================" + ) return groups diff --git a/suitesparse_graphblas/suitesparse_graphblas.h b/suitesparse_graphblas/suitesparse_graphblas.h index e047fbb..1159799 100644 --- a/suitesparse_graphblas/suitesparse_graphblas.h +++ b/suitesparse_graphblas/suitesparse_graphblas.h @@ -104,6 +104,9 @@ typedef enum GxB_GLOBAL_NTHREADS = 5, GxB_GLOBAL_CHUNK = 7, GxB_BURBLE = 99, + GxB_PRINTF = 101, + GxB_FLUSH = 102, + GxB_MEMORY_POOL = 103, GxB_SPARSITY_STATUS = 33, GxB_SPARSITY_CONTROL = 32, GxB_GLOBAL_GPU_CONTROL = 21, @@ -2844,32 +2847,35 @@ extern GrB_Info GxB_Matrix_assign_FC32(GrB_Matrix C, const GrB_Matrix Mask, cons extern GrB_Info GxB_Matrix_assign_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_build_FC32(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const GxB_FC32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); extern GrB_Info GxB_Matrix_build_FC64(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const GxB_FC64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GxB_Matrix_export_BitmapC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, GrB_Index *nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_BitmapR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, GrB_Index *nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_CSC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_CSR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_FullC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, void **Ax, GrB_Index *Ax_size, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_FullR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, void **Ax, GrB_Index *Ax_size, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_HyperCSC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Ai_size, GrB_Index *Ax_size, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_HyperCSR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Aj_size, GrB_Index *Ax_size, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_concat(GrB_Matrix C, const GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_diag(GrB_Matrix C, const GrB_Vector v, int64_t k, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_export_BitmapC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *is_uniform, GrB_Index *nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_export_BitmapR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *is_uniform, GrB_Index *nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_export_CSC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *is_uniform, bool *jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_export_CSR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *is_uniform, bool *jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_export_FullC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, void **Ax, GrB_Index *Ax_size, bool *is_uniform, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_export_FullR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, void **Ax, GrB_Index *Ax_size, bool *is_uniform, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_export_HyperCSC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *is_uniform, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_export_HyperCSR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *is_uniform, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_extractElement_FC32(GxB_FC32_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); extern GrB_Info GxB_Matrix_extractElement_FC64(GxB_FC64_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); extern GrB_Info GxB_Matrix_extractTuples_FC32(GrB_Index *I, GrB_Index *J, GxB_FC32_t *X, GrB_Index *nvals, const GrB_Matrix A); extern GrB_Info GxB_Matrix_extractTuples_FC64(GrB_Index *I, GrB_Index *J, GxB_FC64_t *X, GrB_Index *nvals, const GrB_Matrix A); extern GrB_Info GxB_Matrix_fprint(GrB_Matrix A, const char *name, GxB_Print_Level pr, FILE *f); -extern GrB_Info GxB_Matrix_import_BitmapC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, GrB_Index nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_BitmapR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, GrB_Index nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_CSC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ai_size, GrB_Index Ax_size, bool jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_CSR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Aj_size, GrB_Index Ax_size, bool jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_FullC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, void **Ax, GrB_Index Ax_size, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_FullR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, void **Ax, GrB_Index Ax_size, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_HyperCSC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Ai_size, GrB_Index Ax_size, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_HyperCSR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Aj_size, GrB_Index Ax_size, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_import_BitmapC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool is_uniform, GrB_Index nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_import_BitmapR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool is_uniform, GrB_Index nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_import_CSC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ai_size, GrB_Index Ax_size, bool is_uniform, bool jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_import_CSR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Aj_size, GrB_Index Ax_size, bool is_uniform, bool jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_import_FullC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, void **Ax, GrB_Index Ax_size, bool is_uniform, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_import_FullR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, void **Ax, GrB_Index Ax_size, bool is_uniform, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_import_HyperCSC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Ai_size, GrB_Index Ax_size, bool is_uniform, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_import_HyperCSR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Aj_size, GrB_Index Ax_size, bool is_uniform, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_reduce_FC32(GxB_FC32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_reduce_FC64(GxB_FC64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_select(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Matrix A, const GxB_Scalar Thunk, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_setElement_FC32(GrB_Matrix C, GxB_FC32_t x, GrB_Index i, GrB_Index j); extern GrB_Info GxB_Matrix_setElement_FC64(GrB_Matrix C, GxB_FC64_t x, GrB_Index i, GrB_Index j); +extern GrB_Info GxB_Matrix_split(GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Index *Tile_nrows, const GrB_Index *Tile_ncols, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_subassign(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_subassign_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_subassign_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); @@ -2887,6 +2893,7 @@ extern GrB_Info GxB_Matrix_subassign_UINT32(GrB_Matrix C, const GrB_Matrix Mask, extern GrB_Info GxB_Matrix_subassign_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_type(GrB_Type *type, const GrB_Matrix A); extern GrB_Info GxB_Row_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, GrB_Index i, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_diag(GrB_Vector v, const GrB_Matrix A, int64_t k, const GrB_Descriptor desc); /* monoid */ extern GrB_Info GxB_Monoid_fprint(GrB_Monoid monoid, const char *name, GxB_Print_Level pr, FILE *f); @@ -2985,17 +2992,17 @@ extern GrB_Info GxB_Vector_assign_FC32(GrB_Vector w, const GrB_Vector mask, cons extern GrB_Info GxB_Vector_assign_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_build_FC32(GrB_Vector w, const GrB_Index *I, const GxB_FC32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); extern GrB_Info GxB_Vector_build_FC64(GrB_Vector w, const GrB_Index *I, const GxB_FC64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GxB_Vector_export_Bitmap(GrB_Vector *v, GrB_Type *type, GrB_Index *n, int8_t **vb, void **vx, GrB_Index *vb_size, GrB_Index *vx_size, GrB_Index *nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_export_CSC(GrB_Vector *v, GrB_Type *type, GrB_Index *n, GrB_Index **vi, void **vx, GrB_Index *vi_size, GrB_Index *vx_size, GrB_Index *nvals, bool *jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_export_Full(GrB_Vector *v, GrB_Type *type, GrB_Index *n, void **vx, GrB_Index *vx_size, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_export_Bitmap(GrB_Vector *v, GrB_Type *type, GrB_Index *n, int8_t **vb, void **vx, GrB_Index *vb_size, GrB_Index *vx_size, bool *is_uniform, GrB_Index *nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_export_CSC(GrB_Vector *v, GrB_Type *type, GrB_Index *n, GrB_Index **vi, void **vx, GrB_Index *vi_size, GrB_Index *vx_size, bool *is_uniform, GrB_Index *nvals, bool *jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_export_Full(GrB_Vector *v, GrB_Type *type, GrB_Index *n, void **vx, GrB_Index *vx_size, bool *is_uniform, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_extractElement_FC32(GxB_FC32_t *x, const GrB_Vector v, GrB_Index i); extern GrB_Info GxB_Vector_extractElement_FC64(GxB_FC64_t *x, const GrB_Vector v, GrB_Index i); extern GrB_Info GxB_Vector_extractTuples_FC32(GrB_Index *I, GxB_FC32_t *X, GrB_Index *nvals, const GrB_Vector v); extern GrB_Info GxB_Vector_extractTuples_FC64(GrB_Index *I, GxB_FC64_t *X, GrB_Index *nvals, const GrB_Vector v); extern GrB_Info GxB_Vector_fprint(GrB_Vector v, const char *name, GxB_Print_Level pr, FILE *f); -extern GrB_Info GxB_Vector_import_Bitmap(GrB_Vector *v, GrB_Type type, GrB_Index n, int8_t **vb, void **vx, GrB_Index vb_size, GrB_Index vx_size, GrB_Index nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_import_CSC(GrB_Vector *v, GrB_Type type, GrB_Index n, GrB_Index **vi, void **vx, GrB_Index vi_size, GrB_Index vx_size, GrB_Index nvals, bool jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_import_Full(GrB_Vector *v, GrB_Type type, GrB_Index n, void **vx, GrB_Index vx_size, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_import_Bitmap(GrB_Vector *v, GrB_Type type, GrB_Index n, int8_t **vb, void **vx, GrB_Index vb_size, GrB_Index vx_size, bool is_uniform, GrB_Index nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_import_CSC(GrB_Vector *v, GrB_Type type, GrB_Index n, GrB_Index **vi, void **vx, GrB_Index vi_size, GrB_Index vx_size, bool is_uniform, GrB_Index nvals, bool jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_import_Full(GrB_Vector *v, GrB_Type type, GrB_Index n, void **vx, GrB_Index vx_size, bool is_uniform, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_reduce_FC32(GxB_FC32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_reduce_FC64(GxB_FC64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_select(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Vector u, const GxB_Scalar Thunk, const GrB_Descriptor desc); diff --git a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h index 63271e3..b65b9b0 100644 --- a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h +++ b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h @@ -102,6 +102,9 @@ typedef enum GxB_GLOBAL_NTHREADS = 5, GxB_GLOBAL_CHUNK = 7, GxB_BURBLE = 99, + GxB_PRINTF = 101, + GxB_FLUSH = 102, + GxB_MEMORY_POOL = 103, GxB_SPARSITY_STATUS = 33, GxB_SPARSITY_CONTROL = 32, GxB_GLOBAL_GPU_CONTROL = 21, @@ -2668,24 +2671,27 @@ extern GrB_Info GxB_Matrix_Option_get(GrB_Matrix A, GxB_Option_Field field, ...) extern GrB_Info GxB_Matrix_Option_set(GrB_Matrix A, GxB_Option_Field field, ...); extern GrB_Info GxB_Matrix_apply_BinaryOp1st(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GxB_Scalar x, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_apply_BinaryOp2nd(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GxB_Scalar y, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_BitmapC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, GrB_Index *nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_BitmapR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, GrB_Index *nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_CSC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_CSR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_FullC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, void **Ax, GrB_Index *Ax_size, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_FullR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, void **Ax, GrB_Index *Ax_size, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_HyperCSC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Ai_size, GrB_Index *Ax_size, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_HyperCSR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Aj_size, GrB_Index *Ax_size, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_concat(GrB_Matrix C, const GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_diag(GrB_Matrix C, const GrB_Vector v, int64_t k, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_export_BitmapC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *is_uniform, GrB_Index *nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_export_BitmapR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *is_uniform, GrB_Index *nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_export_CSC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *is_uniform, bool *jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_export_CSR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *is_uniform, bool *jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_export_FullC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, void **Ax, GrB_Index *Ax_size, bool *is_uniform, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_export_FullR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, void **Ax, GrB_Index *Ax_size, bool *is_uniform, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_export_HyperCSC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *is_uniform, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_export_HyperCSR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *is_uniform, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_fprint(GrB_Matrix A, const char *name, GxB_Print_Level pr, FILE *f); -extern GrB_Info GxB_Matrix_import_BitmapC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, GrB_Index nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_BitmapR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, GrB_Index nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_CSC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ai_size, GrB_Index Ax_size, bool jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_CSR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Aj_size, GrB_Index Ax_size, bool jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_FullC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, void **Ax, GrB_Index Ax_size, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_FullR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, void **Ax, GrB_Index Ax_size, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_HyperCSC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Ai_size, GrB_Index Ax_size, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_HyperCSR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Aj_size, GrB_Index Ax_size, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_import_BitmapC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool is_uniform, GrB_Index nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_import_BitmapR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool is_uniform, GrB_Index nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_import_CSC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ai_size, GrB_Index Ax_size, bool is_uniform, bool jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_import_CSR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Aj_size, GrB_Index Ax_size, bool is_uniform, bool jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_import_FullC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, void **Ax, GrB_Index Ax_size, bool is_uniform, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_import_FullR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, void **Ax, GrB_Index Ax_size, bool is_uniform, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_import_HyperCSC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Ai_size, GrB_Index Ax_size, bool is_uniform, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_import_HyperCSR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Aj_size, GrB_Index Ax_size, bool is_uniform, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_select(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Matrix A, const GxB_Scalar Thunk, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_split(GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Index *Tile_nrows, const GrB_Index *Tile_ncols, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_subassign(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_subassign_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_subassign_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); @@ -2701,6 +2707,7 @@ extern GrB_Info GxB_Matrix_subassign_UINT32(GrB_Matrix C, const GrB_Matrix Mask, extern GrB_Info GxB_Matrix_subassign_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_type(GrB_Type *type, const GrB_Matrix A); extern GrB_Info GxB_Row_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, GrB_Index i, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_diag(GrB_Vector v, const GrB_Matrix A, int64_t k, const GrB_Descriptor desc); /* monoid */ extern GrB_Info GxB_Monoid_fprint(GrB_Monoid monoid, const char *name, GxB_Print_Level pr, FILE *f); @@ -2783,13 +2790,13 @@ extern GrB_Info GxB_Vector_Option_get(GrB_Vector A, GxB_Option_Field field, ...) extern GrB_Info GxB_Vector_Option_set(GrB_Vector A, GxB_Option_Field field, ...); extern GrB_Info GxB_Vector_apply_BinaryOp1st(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GxB_Scalar x, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_apply_BinaryOp2nd(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const GxB_Scalar y, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_export_Bitmap(GrB_Vector *v, GrB_Type *type, GrB_Index *n, int8_t **vb, void **vx, GrB_Index *vb_size, GrB_Index *vx_size, GrB_Index *nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_export_CSC(GrB_Vector *v, GrB_Type *type, GrB_Index *n, GrB_Index **vi, void **vx, GrB_Index *vi_size, GrB_Index *vx_size, GrB_Index *nvals, bool *jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_export_Full(GrB_Vector *v, GrB_Type *type, GrB_Index *n, void **vx, GrB_Index *vx_size, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_export_Bitmap(GrB_Vector *v, GrB_Type *type, GrB_Index *n, int8_t **vb, void **vx, GrB_Index *vb_size, GrB_Index *vx_size, bool *is_uniform, GrB_Index *nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_export_CSC(GrB_Vector *v, GrB_Type *type, GrB_Index *n, GrB_Index **vi, void **vx, GrB_Index *vi_size, GrB_Index *vx_size, bool *is_uniform, GrB_Index *nvals, bool *jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_export_Full(GrB_Vector *v, GrB_Type *type, GrB_Index *n, void **vx, GrB_Index *vx_size, bool *is_uniform, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_fprint(GrB_Vector v, const char *name, GxB_Print_Level pr, FILE *f); -extern GrB_Info GxB_Vector_import_Bitmap(GrB_Vector *v, GrB_Type type, GrB_Index n, int8_t **vb, void **vx, GrB_Index vb_size, GrB_Index vx_size, GrB_Index nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_import_CSC(GrB_Vector *v, GrB_Type type, GrB_Index n, GrB_Index **vi, void **vx, GrB_Index vi_size, GrB_Index vx_size, GrB_Index nvals, bool jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_import_Full(GrB_Vector *v, GrB_Type type, GrB_Index n, void **vx, GrB_Index vx_size, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_import_Bitmap(GrB_Vector *v, GrB_Type type, GrB_Index n, int8_t **vb, void **vx, GrB_Index vb_size, GrB_Index vx_size, bool is_uniform, GrB_Index nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_import_CSC(GrB_Vector *v, GrB_Type type, GrB_Index n, GrB_Index **vi, void **vx, GrB_Index vi_size, GrB_Index vx_size, bool is_uniform, GrB_Index nvals, bool jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_import_Full(GrB_Vector *v, GrB_Type type, GrB_Index n, void **vx, GrB_Index vx_size, bool is_uniform, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_select(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Vector u, const GxB_Scalar Thunk, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_subassign(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_subassign_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); From bd71c4e8523216b170a562341da5f3f50d6507b0 Mon Sep 17 00:00:00 2001 From: Michel Pelletier Date: Sun, 20 Jun 2021 12:51:24 -0700 Subject: [PATCH 027/193] Test dockerfile (#14) * Update to SuiteSparse:GraphBLAS 5.0.3. Also, add sanity check to make sure all GrB and GxB lines are handled. This would have caught the issue of the new functions not being public in v5.0.2. * test dockerfile * test dockerfile * test dockerfile * clean up apt, move toward multi stage * multistage docker file down to 227MB * add docker build script. Co-authored-by: Erik Welch --- .dockerignore | 1 + Dockerfile | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ docker_build.sh | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 98 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100755 docker_build.sh diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..9414382 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c766e39 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,48 @@ +ARG BASE_CONTAINER=python:3.9-slim-buster +FROM ${BASE_CONTAINER} as suitesparse +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update && apt-get install -yq build-essential cmake git + +ARG SUITESPARSE +ARG COMPACT + +WORKDIR /build +RUN git clone https://github.com/eliben/pycparser.git --depth 1 + +WORKDIR /build/GraphBLAS/build +RUN git clone https://github.com/DrTimothyAldenDavis/GraphBLAS.git --depth 1 --branch v${SUITESPARSE} \ + && cd GraphBLAS/build \ + && cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DGBCOMPACT=${COMPACT} \ + && make -j$(nproc) \ + && make install + +FROM ${BASE_CONTAINER} as psg +ARG SUITESPARSE +ARG VERSION +ENV PYTHONUNBUFFERED 1 + +COPY --from=suitesparse /usr/include/GraphBLAS.h /usr/local/include/ +COPY --from=suitesparse /usr/lib/x86_64-linux-gnu/libgraphblas* /usr/lib/x86_64-linux-gnu/ +COPY --from=suitesparse /build/pycparser/utils/fake_libc_include/* /usr/local/lib/python3.9/site-packages/pycparser/utils/fake_libc_include/ + +RUN apt-get update && apt-get install -yq build-essential git +RUN pip3 install numpy cffi pytest cython + +RUN mkdir -p /build/python-suitesparse-graphblas +ADD . /build/python-suitesparse-graphblas + +WORKDIR /build/python-suitesparse-graphblas +RUN git tag ${VERSION} && \ + python3 suitesparse_graphblas/create_headers.py && \ + python3 setup.py install && \ + ldconfig + +WORKDIR / +RUN pytest --pyargs suitesparse_graphblas.tests +RUN apt-get -y --purge remove git python3-pip && apt-get clean + +FROM ${BASE_CONTAINER} +COPY --from=suitesparse /usr/lib/x86_64-linux-gnu/libgraphblas* /usr/lib/x86_64-linux-gnu/ +COPY --from=suitesparse /usr/lib/x86_64-linux-gnu/libgomp* /usr/lib/x86_64-linux-gnu/ +COPY --from=psg /usr/local/lib/python3.9/site-packages /usr/local/lib/python3.9/site-packages diff --git a/docker_build.sh b/docker_build.sh new file mode 100755 index 0000000..658f52b --- /dev/null +++ b/docker_build.sh @@ -0,0 +1,49 @@ +if [ $# -eq 0 ] + then + echo "Usage: ./docker_build.sh SUITESPARSE VERSION BRANCH [LOCATION PUSH] + +Example: ./docker_build.sh 5.0.6 5.0.6.0 main clone push + +If location is clone then a fresh git clone will be used. +If push is provided then the script will attempt to push to dockerhub." + exit 1 +fi + +IMAGE=graphblas/python-suitesparse-graphblas +SUITESPARSE=$1 +VERSION=$2 +BRANCH=$3 +LOCATION=$4 +PUSH=$5 + +COMPACT=${COMPACT:-0} + +if [ "$LOCATION" = "clone" ] +then + TMPDIR=$(mktemp -d) + if [ ! -e $TMPDIR ]; then + >&2 echo "Failed to create temp directory" + exit 1 + fi + trap "exit 1" HUP INT PIPE QUIT TERM + trap 'rm -rf "$TMPDIR"' EXIT + + cd $TMPDIR + git clone --branch $BRANCH https://github.com/GraphBLAS/python-suitesparse-graphblas.git + cd python-suitesparse-graphblas +fi + +docker build \ + --build-arg SUITESPARSE=${SUITESPARSE} \ + --build-arg VERSION=${VERSION} \ + --build-arg COMPACT=${COMPACT} \ + -t $IMAGE:$VERSION \ + . + +docker tag $IMAGE:$VERSION $IMAGE:latest + +if [ "$PUSH" = "push" ] +then + docker push $IMAGE:$VERSION + docker push $IMAGE:latest +fi From 0d386e3b483892a8e374ecd3b0b6a347ec44fef0 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Wed, 30 Jun 2021 22:54:59 -0500 Subject: [PATCH 028/193] Update to SuiteSparse:GraphBLAS 5.1.2 --- pyproject.toml | 2 +- setup.py | 2 +- suitesparse_graphblas/suitesparse_graphblas.h | 73 +++++++++++++------ .../suitesparse_graphblas_no_complex.h | 73 +++++++++++++------ 4 files changed, 102 insertions(+), 48 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 27a1304..1cd3c4e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools", "wheel", "numpy>=1.15", "cython"] +requires = ["setuptools", "wheel", "numpy>=1.17", "cython"] [tool.black] line-length = 100 diff --git a/setup.py b/setup.py index c7990cc..a7660a2 100644 --- a/setup.py +++ b/setup.py @@ -68,7 +68,7 @@ ext_modules=ext_modules, cffi_modules=["suitesparse_graphblas/build.py:ffibuilder"], python_requires=">=3.7", - install_requires=["cffi>=1.0.0", "numpy>=1.15"], + install_requires=["cffi>=1.0.0", "numpy>=1.17"], setup_requires=["cffi>=1.0.0", "pytest-runner"], tests_require=["pytest"], license="Apache License 2.0", diff --git a/suitesparse_graphblas/suitesparse_graphblas.h b/suitesparse_graphblas/suitesparse_graphblas.h index 1159799..a25ab12 100644 --- a/suitesparse_graphblas/suitesparse_graphblas.h +++ b/suitesparse_graphblas/suitesparse_graphblas.h @@ -107,6 +107,7 @@ typedef enum GxB_PRINTF = 101, GxB_FLUSH = 102, GxB_MEMORY_POOL = 103, + GxB_PRINT_1BASED = 104, GxB_SPARSITY_STATUS = 33, GxB_SPARSITY_CONTROL = 32, GxB_GLOBAL_GPU_CONTROL = 21, @@ -2824,7 +2825,6 @@ extern GrB_Info GxB_BinaryOp_ztype(GrB_Type *ztype, GrB_BinaryOp binaryop); /* core */ extern GrB_Info GxB_Global_Option_get(GxB_Option_Field field, ...); extern GrB_Info GxB_Global_Option_set(GxB_Option_Field field, ...); -extern GrB_Info GxB_cuda_init(GrB_Mode mode); extern GrB_Info GxB_init(GrB_Mode mode, void *(*user_malloc_function)(size_t), void *(*user_calloc_function)(size_t, size_t), void *(*user_realloc_function)(void *, size_t), void (*user_free_function)(void *), bool user_malloc_is_thread_safe); /* descriptor */ @@ -2847,29 +2847,39 @@ extern GrB_Info GxB_Matrix_assign_FC32(GrB_Matrix C, const GrB_Matrix Mask, cons extern GrB_Info GxB_Matrix_assign_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_build_FC32(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const GxB_FC32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); extern GrB_Info GxB_Matrix_build_FC64(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const GxB_FC64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +extern GrB_Info GxB_Matrix_build_Scalar(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, GxB_Scalar scalar, GrB_Index nvals); extern GrB_Info GxB_Matrix_concat(GrB_Matrix C, const GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_diag(GrB_Matrix C, const GrB_Vector v, int64_t k, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_BitmapC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *is_uniform, GrB_Index *nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_BitmapR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *is_uniform, GrB_Index *nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_CSC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *is_uniform, bool *jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_CSR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *is_uniform, bool *jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_FullC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, void **Ax, GrB_Index *Ax_size, bool *is_uniform, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_FullR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, void **Ax, GrB_Index *Ax_size, bool *is_uniform, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_HyperCSC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *is_uniform, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_HyperCSR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *is_uniform, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_export_BitmapC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_export_BitmapR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_export_CSC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_export_CSR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_export_FullC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_export_FullR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_export_HyperCSC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_export_HyperCSR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_extractElement_FC32(GxB_FC32_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); extern GrB_Info GxB_Matrix_extractElement_FC64(GxB_FC64_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); extern GrB_Info GxB_Matrix_extractTuples_FC32(GrB_Index *I, GrB_Index *J, GxB_FC32_t *X, GrB_Index *nvals, const GrB_Matrix A); extern GrB_Info GxB_Matrix_extractTuples_FC64(GrB_Index *I, GrB_Index *J, GxB_FC64_t *X, GrB_Index *nvals, const GrB_Matrix A); extern GrB_Info GxB_Matrix_fprint(GrB_Matrix A, const char *name, GxB_Print_Level pr, FILE *f); -extern GrB_Info GxB_Matrix_import_BitmapC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool is_uniform, GrB_Index nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_BitmapR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool is_uniform, GrB_Index nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_CSC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ai_size, GrB_Index Ax_size, bool is_uniform, bool jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_CSR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Aj_size, GrB_Index Ax_size, bool is_uniform, bool jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_FullC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, void **Ax, GrB_Index Ax_size, bool is_uniform, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_FullR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, void **Ax, GrB_Index Ax_size, bool is_uniform, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_HyperCSC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Ai_size, GrB_Index Ax_size, bool is_uniform, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_HyperCSR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Aj_size, GrB_Index Ax_size, bool is_uniform, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_import_BitmapC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_import_BitmapR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_import_CSC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_import_CSR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_import_FullC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_import_FullR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_import_HyperCSC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_import_HyperCSR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_memoryUsage(size_t *size, const GrB_Matrix A); +extern GrB_Info GxB_Matrix_pack_BitmapC(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_pack_BitmapR(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_pack_CSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_pack_CSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_pack_FullC(GrB_Matrix A, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_pack_FullR(GrB_Matrix A, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_pack_HyperCSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_pack_HyperCSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_reduce_FC32(GxB_FC32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_reduce_FC64(GxB_FC64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_select(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Matrix A, const GxB_Scalar Thunk, const GrB_Descriptor desc); @@ -2892,6 +2902,14 @@ extern GrB_Info GxB_Matrix_subassign_UINT16(GrB_Matrix C, const GrB_Matrix Mask, extern GrB_Info GxB_Matrix_subassign_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_subassign_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_type(GrB_Type *type, const GrB_Matrix A); +extern GrB_Info GxB_Matrix_unpack_BitmapC(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_unpack_BitmapR(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_unpack_CSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_unpack_CSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_unpack_FullC(GrB_Matrix A, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_unpack_FullR(GrB_Matrix A, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_unpack_HyperCSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_unpack_HyperCSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); extern GrB_Info GxB_Row_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, GrB_Index i, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_diag(GrB_Vector v, const GrB_Matrix A, int64_t k, const GrB_Descriptor desc); @@ -2937,6 +2955,7 @@ extern GrB_Info GxB_Scalar_extractElement_UINT32(uint32_t *x, const GxB_Scalar s extern GrB_Info GxB_Scalar_extractElement_UINT64(uint64_t *x, const GxB_Scalar s); extern GrB_Info GxB_Scalar_fprint(GxB_Scalar s, const char *name, GxB_Print_Level pr, FILE *f); extern GrB_Info GxB_Scalar_free(GxB_Scalar *s); +extern GrB_Info GxB_Scalar_memoryUsage(size_t *size, const GxB_Scalar s); extern GrB_Info GxB_Scalar_new(GxB_Scalar *s, GrB_Type type); extern GrB_Info GxB_Scalar_nvals(GrB_Index *nvals, const GxB_Scalar s); extern GrB_Info GxB_Scalar_setElement_BOOL(GxB_Scalar s, bool x); @@ -2992,17 +3011,22 @@ extern GrB_Info GxB_Vector_assign_FC32(GrB_Vector w, const GrB_Vector mask, cons extern GrB_Info GxB_Vector_assign_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_build_FC32(GrB_Vector w, const GrB_Index *I, const GxB_FC32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); extern GrB_Info GxB_Vector_build_FC64(GrB_Vector w, const GrB_Index *I, const GxB_FC64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GxB_Vector_export_Bitmap(GrB_Vector *v, GrB_Type *type, GrB_Index *n, int8_t **vb, void **vx, GrB_Index *vb_size, GrB_Index *vx_size, bool *is_uniform, GrB_Index *nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_export_CSC(GrB_Vector *v, GrB_Type *type, GrB_Index *n, GrB_Index **vi, void **vx, GrB_Index *vi_size, GrB_Index *vx_size, bool *is_uniform, GrB_Index *nvals, bool *jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_export_Full(GrB_Vector *v, GrB_Type *type, GrB_Index *n, void **vx, GrB_Index *vx_size, bool *is_uniform, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_build_Scalar(GrB_Vector w, const GrB_Index *I, GxB_Scalar scalar, GrB_Index nvals); +extern GrB_Info GxB_Vector_export_Bitmap(GrB_Vector *v, GrB_Type *type, GrB_Index *n, int8_t **vb, void **vx, GrB_Index *vb_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_export_CSC(GrB_Vector *v, GrB_Type *type, GrB_Index *n, GrB_Index **vi, void **vx, GrB_Index *vi_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, bool *jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_export_Full(GrB_Vector *v, GrB_Type *type, GrB_Index *n, void **vx, GrB_Index *vx_size, bool *iso, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_extractElement_FC32(GxB_FC32_t *x, const GrB_Vector v, GrB_Index i); extern GrB_Info GxB_Vector_extractElement_FC64(GxB_FC64_t *x, const GrB_Vector v, GrB_Index i); extern GrB_Info GxB_Vector_extractTuples_FC32(GrB_Index *I, GxB_FC32_t *X, GrB_Index *nvals, const GrB_Vector v); extern GrB_Info GxB_Vector_extractTuples_FC64(GrB_Index *I, GxB_FC64_t *X, GrB_Index *nvals, const GrB_Vector v); extern GrB_Info GxB_Vector_fprint(GrB_Vector v, const char *name, GxB_Print_Level pr, FILE *f); -extern GrB_Info GxB_Vector_import_Bitmap(GrB_Vector *v, GrB_Type type, GrB_Index n, int8_t **vb, void **vx, GrB_Index vb_size, GrB_Index vx_size, bool is_uniform, GrB_Index nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_import_CSC(GrB_Vector *v, GrB_Type type, GrB_Index n, GrB_Index **vi, void **vx, GrB_Index vi_size, GrB_Index vx_size, bool is_uniform, GrB_Index nvals, bool jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_import_Full(GrB_Vector *v, GrB_Type type, GrB_Index n, void **vx, GrB_Index vx_size, bool is_uniform, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_import_Bitmap(GrB_Vector *v, GrB_Type type, GrB_Index n, int8_t **vb, void **vx, GrB_Index vb_size, GrB_Index vx_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_import_CSC(GrB_Vector *v, GrB_Type type, GrB_Index n, GrB_Index **vi, void **vx, GrB_Index vi_size, GrB_Index vx_size, bool iso, GrB_Index nvals, bool jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_import_Full(GrB_Vector *v, GrB_Type type, GrB_Index n, void **vx, GrB_Index vx_size, bool iso, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_memoryUsage(size_t *size, const GrB_Vector v); +extern GrB_Info GxB_Vector_pack_Bitmap(GrB_Vector v, int8_t **vb, void **vx, GrB_Index vb_size, GrB_Index vx_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_pack_CSC(GrB_Vector v, GrB_Index **vi, void **vx, GrB_Index vi_size, GrB_Index vx_size, bool iso, GrB_Index nvals, bool jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_pack_Full(GrB_Vector v, void **vx, GrB_Index vx_size, bool iso, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_reduce_FC32(GxB_FC32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_reduce_FC64(GxB_FC64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_select(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Vector u, const GxB_Scalar Thunk, const GrB_Descriptor desc); @@ -3024,6 +3048,9 @@ extern GrB_Info GxB_Vector_subassign_UINT16(GrB_Vector w, const GrB_Vector mask, extern GrB_Info GxB_Vector_subassign_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_subassign_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_type(GrB_Type *type, const GrB_Vector v); +extern GrB_Info GxB_Vector_unpack_Bitmap(GrB_Vector v, int8_t **vb, void **vx, GrB_Index *vb_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_unpack_CSC(GrB_Vector v, GrB_Index **vi, void **vx, GrB_Index *vi_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, bool *jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_unpack_Full(GrB_Vector v, void **vx, GrB_Index *vx_size, bool *iso, const GrB_Descriptor desc); /* int DEFINES */ #define GRB_SUBVERSION ... diff --git a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h index b65b9b0..7a11625 100644 --- a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h +++ b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h @@ -105,6 +105,7 @@ typedef enum GxB_PRINTF = 101, GxB_FLUSH = 102, GxB_MEMORY_POOL = 103, + GxB_PRINT_1BASED = 104, GxB_SPARSITY_STATUS = 33, GxB_SPARSITY_CONTROL = 32, GxB_GLOBAL_GPU_CONTROL = 21, @@ -2656,7 +2657,6 @@ extern GrB_Info GxB_BinaryOp_ztype(GrB_Type *ztype, GrB_BinaryOp binaryop); /* core */ extern GrB_Info GxB_Global_Option_get(GxB_Option_Field field, ...); extern GrB_Info GxB_Global_Option_set(GxB_Option_Field field, ...); -extern GrB_Info GxB_cuda_init(GrB_Mode mode); extern GrB_Info GxB_init(GrB_Mode mode, void *(*user_malloc_function)(size_t), void *(*user_calloc_function)(size_t, size_t), void *(*user_realloc_function)(void *, size_t), void (*user_free_function)(void *), bool user_malloc_is_thread_safe); /* descriptor */ @@ -2671,25 +2671,35 @@ extern GrB_Info GxB_Matrix_Option_get(GrB_Matrix A, GxB_Option_Field field, ...) extern GrB_Info GxB_Matrix_Option_set(GrB_Matrix A, GxB_Option_Field field, ...); extern GrB_Info GxB_Matrix_apply_BinaryOp1st(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GxB_Scalar x, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_apply_BinaryOp2nd(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GxB_Scalar y, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_build_Scalar(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, GxB_Scalar scalar, GrB_Index nvals); extern GrB_Info GxB_Matrix_concat(GrB_Matrix C, const GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_diag(GrB_Matrix C, const GrB_Vector v, int64_t k, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_BitmapC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *is_uniform, GrB_Index *nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_BitmapR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *is_uniform, GrB_Index *nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_CSC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *is_uniform, bool *jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_CSR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *is_uniform, bool *jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_FullC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, void **Ax, GrB_Index *Ax_size, bool *is_uniform, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_FullR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, void **Ax, GrB_Index *Ax_size, bool *is_uniform, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_HyperCSC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *is_uniform, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_HyperCSR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *is_uniform, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_export_BitmapC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_export_BitmapR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_export_CSC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_export_CSR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_export_FullC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_export_FullR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_export_HyperCSC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_export_HyperCSR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_fprint(GrB_Matrix A, const char *name, GxB_Print_Level pr, FILE *f); -extern GrB_Info GxB_Matrix_import_BitmapC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool is_uniform, GrB_Index nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_BitmapR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool is_uniform, GrB_Index nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_CSC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ai_size, GrB_Index Ax_size, bool is_uniform, bool jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_CSR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Aj_size, GrB_Index Ax_size, bool is_uniform, bool jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_FullC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, void **Ax, GrB_Index Ax_size, bool is_uniform, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_FullR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, void **Ax, GrB_Index Ax_size, bool is_uniform, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_HyperCSC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Ai_size, GrB_Index Ax_size, bool is_uniform, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_HyperCSR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Aj_size, GrB_Index Ax_size, bool is_uniform, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_import_BitmapC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_import_BitmapR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_import_CSC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_import_CSR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_import_FullC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_import_FullR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_import_HyperCSC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_import_HyperCSR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_memoryUsage(size_t *size, const GrB_Matrix A); +extern GrB_Info GxB_Matrix_pack_BitmapC(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_pack_BitmapR(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_pack_CSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_pack_CSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_pack_FullC(GrB_Matrix A, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_pack_FullR(GrB_Matrix A, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_pack_HyperCSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_pack_HyperCSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_select(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Matrix A, const GxB_Scalar Thunk, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_split(GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Index *Tile_nrows, const GrB_Index *Tile_ncols, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_subassign(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); @@ -2706,6 +2716,14 @@ extern GrB_Info GxB_Matrix_subassign_UINT16(GrB_Matrix C, const GrB_Matrix Mask, extern GrB_Info GxB_Matrix_subassign_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_subassign_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_type(GrB_Type *type, const GrB_Matrix A); +extern GrB_Info GxB_Matrix_unpack_BitmapC(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_unpack_BitmapR(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_unpack_CSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_unpack_CSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_unpack_FullC(GrB_Matrix A, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_unpack_FullR(GrB_Matrix A, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_unpack_HyperCSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_unpack_HyperCSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); extern GrB_Info GxB_Row_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, GrB_Index i, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_diag(GrB_Vector v, const GrB_Matrix A, int64_t k, const GrB_Descriptor desc); @@ -2745,6 +2763,7 @@ extern GrB_Info GxB_Scalar_extractElement_UINT32(uint32_t *x, const GxB_Scalar s extern GrB_Info GxB_Scalar_extractElement_UINT64(uint64_t *x, const GxB_Scalar s); extern GrB_Info GxB_Scalar_fprint(GxB_Scalar s, const char *name, GxB_Print_Level pr, FILE *f); extern GrB_Info GxB_Scalar_free(GxB_Scalar *s); +extern GrB_Info GxB_Scalar_memoryUsage(size_t *size, const GxB_Scalar s); extern GrB_Info GxB_Scalar_new(GxB_Scalar *s, GrB_Type type); extern GrB_Info GxB_Scalar_nvals(GrB_Index *nvals, const GxB_Scalar s); extern GrB_Info GxB_Scalar_setElement_BOOL(GxB_Scalar s, bool x); @@ -2790,13 +2809,18 @@ extern GrB_Info GxB_Vector_Option_get(GrB_Vector A, GxB_Option_Field field, ...) extern GrB_Info GxB_Vector_Option_set(GrB_Vector A, GxB_Option_Field field, ...); extern GrB_Info GxB_Vector_apply_BinaryOp1st(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GxB_Scalar x, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_apply_BinaryOp2nd(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const GxB_Scalar y, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_export_Bitmap(GrB_Vector *v, GrB_Type *type, GrB_Index *n, int8_t **vb, void **vx, GrB_Index *vb_size, GrB_Index *vx_size, bool *is_uniform, GrB_Index *nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_export_CSC(GrB_Vector *v, GrB_Type *type, GrB_Index *n, GrB_Index **vi, void **vx, GrB_Index *vi_size, GrB_Index *vx_size, bool *is_uniform, GrB_Index *nvals, bool *jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_export_Full(GrB_Vector *v, GrB_Type *type, GrB_Index *n, void **vx, GrB_Index *vx_size, bool *is_uniform, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_build_Scalar(GrB_Vector w, const GrB_Index *I, GxB_Scalar scalar, GrB_Index nvals); +extern GrB_Info GxB_Vector_export_Bitmap(GrB_Vector *v, GrB_Type *type, GrB_Index *n, int8_t **vb, void **vx, GrB_Index *vb_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_export_CSC(GrB_Vector *v, GrB_Type *type, GrB_Index *n, GrB_Index **vi, void **vx, GrB_Index *vi_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, bool *jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_export_Full(GrB_Vector *v, GrB_Type *type, GrB_Index *n, void **vx, GrB_Index *vx_size, bool *iso, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_fprint(GrB_Vector v, const char *name, GxB_Print_Level pr, FILE *f); -extern GrB_Info GxB_Vector_import_Bitmap(GrB_Vector *v, GrB_Type type, GrB_Index n, int8_t **vb, void **vx, GrB_Index vb_size, GrB_Index vx_size, bool is_uniform, GrB_Index nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_import_CSC(GrB_Vector *v, GrB_Type type, GrB_Index n, GrB_Index **vi, void **vx, GrB_Index vi_size, GrB_Index vx_size, bool is_uniform, GrB_Index nvals, bool jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_import_Full(GrB_Vector *v, GrB_Type type, GrB_Index n, void **vx, GrB_Index vx_size, bool is_uniform, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_import_Bitmap(GrB_Vector *v, GrB_Type type, GrB_Index n, int8_t **vb, void **vx, GrB_Index vb_size, GrB_Index vx_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_import_CSC(GrB_Vector *v, GrB_Type type, GrB_Index n, GrB_Index **vi, void **vx, GrB_Index vi_size, GrB_Index vx_size, bool iso, GrB_Index nvals, bool jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_import_Full(GrB_Vector *v, GrB_Type type, GrB_Index n, void **vx, GrB_Index vx_size, bool iso, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_memoryUsage(size_t *size, const GrB_Vector v); +extern GrB_Info GxB_Vector_pack_Bitmap(GrB_Vector v, int8_t **vb, void **vx, GrB_Index vb_size, GrB_Index vx_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_pack_CSC(GrB_Vector v, GrB_Index **vi, void **vx, GrB_Index vi_size, GrB_Index vx_size, bool iso, GrB_Index nvals, bool jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_pack_Full(GrB_Vector v, void **vx, GrB_Index vx_size, bool iso, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_select(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Vector u, const GxB_Scalar Thunk, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_subassign(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_subassign_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); @@ -2812,6 +2836,9 @@ extern GrB_Info GxB_Vector_subassign_UINT16(GrB_Vector w, const GrB_Vector mask, extern GrB_Info GxB_Vector_subassign_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_subassign_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_type(GrB_Type *type, const GrB_Vector v); +extern GrB_Info GxB_Vector_unpack_Bitmap(GrB_Vector v, int8_t **vb, void **vx, GrB_Index *vb_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_unpack_CSC(GrB_Vector v, GrB_Index **vi, void **vx, GrB_Index *vi_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, bool *jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_unpack_Full(GrB_Vector v, void **vx, GrB_Index *vx_size, bool *iso, const GrB_Descriptor desc); /* int DEFINES */ #define GRB_SUBVERSION ... From ea159814ac15f4fa2753fc2d6382b7aa0c3f5e55 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Sun, 4 Jul 2021 01:28:38 +0000 Subject: [PATCH 029/193] Update to SuiteSparse 5.1.3 (release imminent) --- suitesparse_graphblas/suitesparse_graphblas.h | 2 ++ suitesparse_graphblas/suitesparse_graphblas_no_complex.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/suitesparse_graphblas/suitesparse_graphblas.h b/suitesparse_graphblas/suitesparse_graphblas.h index a25ab12..ceb226f 100644 --- a/suitesparse_graphblas/suitesparse_graphblas.h +++ b/suitesparse_graphblas/suitesparse_graphblas.h @@ -2871,6 +2871,7 @@ extern GrB_Info GxB_Matrix_import_FullC(GrB_Matrix *A, GrB_Type type, GrB_Index extern GrB_Info GxB_Matrix_import_FullR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_import_HyperCSC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_import_HyperCSR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_iso(bool *iso, const GrB_Matrix A); extern GrB_Info GxB_Matrix_memoryUsage(size_t *size, const GrB_Matrix A); extern GrB_Info GxB_Matrix_pack_BitmapC(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_pack_BitmapR(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); @@ -3023,6 +3024,7 @@ extern GrB_Info GxB_Vector_fprint(GrB_Vector v, const char *name, GxB_Print_Leve extern GrB_Info GxB_Vector_import_Bitmap(GrB_Vector *v, GrB_Type type, GrB_Index n, int8_t **vb, void **vx, GrB_Index vb_size, GrB_Index vx_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_import_CSC(GrB_Vector *v, GrB_Type type, GrB_Index n, GrB_Index **vi, void **vx, GrB_Index vi_size, GrB_Index vx_size, bool iso, GrB_Index nvals, bool jumbled, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_import_Full(GrB_Vector *v, GrB_Type type, GrB_Index n, void **vx, GrB_Index vx_size, bool iso, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_iso(bool *iso, const GrB_Vector v); extern GrB_Info GxB_Vector_memoryUsage(size_t *size, const GrB_Vector v); extern GrB_Info GxB_Vector_pack_Bitmap(GrB_Vector v, int8_t **vb, void **vx, GrB_Index vb_size, GrB_Index vx_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_pack_CSC(GrB_Vector v, GrB_Index **vi, void **vx, GrB_Index vi_size, GrB_Index vx_size, bool iso, GrB_Index nvals, bool jumbled, const GrB_Descriptor desc); diff --git a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h index 7a11625..7d9a5a8 100644 --- a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h +++ b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h @@ -2691,6 +2691,7 @@ extern GrB_Info GxB_Matrix_import_FullC(GrB_Matrix *A, GrB_Type type, GrB_Index extern GrB_Info GxB_Matrix_import_FullR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_import_HyperCSC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_import_HyperCSR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_iso(bool *iso, const GrB_Matrix A); extern GrB_Info GxB_Matrix_memoryUsage(size_t *size, const GrB_Matrix A); extern GrB_Info GxB_Matrix_pack_BitmapC(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_pack_BitmapR(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); @@ -2817,6 +2818,7 @@ extern GrB_Info GxB_Vector_fprint(GrB_Vector v, const char *name, GxB_Print_Leve extern GrB_Info GxB_Vector_import_Bitmap(GrB_Vector *v, GrB_Type type, GrB_Index n, int8_t **vb, void **vx, GrB_Index vb_size, GrB_Index vx_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_import_CSC(GrB_Vector *v, GrB_Type type, GrB_Index n, GrB_Index **vi, void **vx, GrB_Index vi_size, GrB_Index vx_size, bool iso, GrB_Index nvals, bool jumbled, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_import_Full(GrB_Vector *v, GrB_Type type, GrB_Index n, void **vx, GrB_Index vx_size, bool iso, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_iso(bool *iso, const GrB_Vector v); extern GrB_Info GxB_Vector_memoryUsage(size_t *size, const GrB_Vector v); extern GrB_Info GxB_Vector_pack_Bitmap(GrB_Vector v, int8_t **vb, void **vx, GrB_Index vb_size, GrB_Index vx_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_pack_CSC(GrB_Vector v, GrB_Index **vi, void **vx, GrB_Index vi_size, GrB_Index vx_size, bool iso, GrB_Index nvals, bool jumbled, const GrB_Descriptor desc); From 14787d2b9aa73f7b2c385eb7fdfa9ab58e940ba2 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Sun, 4 Jul 2021 13:37:52 -0500 Subject: [PATCH 030/193] Update graphblas version in environment.yml --- continuous_integration/environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/continuous_integration/environment.yml b/continuous_integration/environment.yml index 4195345..c7f8251 100644 --- a/continuous_integration/environment.yml +++ b/continuous_integration/environment.yml @@ -3,7 +3,7 @@ channels: - conda-forge - defaults dependencies: - - graphblas=5.0.3 + - graphblas=5.1.3 - cffi - cython - numpy From 05a5ad1a662a8b2e72495001a5903c36d3aa4e60 Mon Sep 17 00:00:00 2001 From: Michel Pelletier Date: Sun, 11 Jul 2021 21:54:24 -0400 Subject: [PATCH 031/193] first sorta tests working for binread binwrite (#18) * first sorta tests working for binread binwrite * fixup string i unblacked * free matrices on each loop * add conftest lib init. * more test asserts. * add tests for GxB_FULL. * black * assert types equal for binread binwrite * rename exceptions. * use any opener interface, full equality tests for binary files. * clean up opener code * clean up header template a bit for the spec. * add implementation id to binary format. * fix up broken checkstatus calls and add sets and gets for switch properties. * oops wrong arg in binary header and make lint happy. * windows? * cant call dlopen(None) on windows... * cant call dlopen(None) on windows... * no binary file cookies for you windows! * no binary file cookies for you windows! * dont want on A as it seems its not necessary * cleanup with some refactored functional code in suitesparse_graphblas.matrix. * oh yeah check the new files in too. * lint * more func api and sweet, sweet doctests. * oh lint. * more doctests. * use frozen set instead of tuple. --- Dockerfile | 11 +- docker_build.sh | 4 +- suitesparse_graphblas/__init__.py | 132 ++++- suitesparse_graphblas/exceptions.py | 54 ++ suitesparse_graphblas/io/__init__.py | 0 suitesparse_graphblas/io/binary.py | 558 ++++++++++++++++++ suitesparse_graphblas/matrix.py | 203 +++++++ suitesparse_graphblas/scalar.py | 70 +++ suitesparse_graphblas/tests/conftest.py | 7 + suitesparse_graphblas/tests/test_doctest.py | 14 + .../tests/test_exceptions.py | 17 + suitesparse_graphblas/tests/test_io.py | 151 +++++ suitesparse_graphblas/vector.py | 104 ++++ 13 files changed, 1316 insertions(+), 9 deletions(-) create mode 100644 suitesparse_graphblas/exceptions.py create mode 100644 suitesparse_graphblas/io/__init__.py create mode 100644 suitesparse_graphblas/io/binary.py create mode 100644 suitesparse_graphblas/matrix.py create mode 100644 suitesparse_graphblas/scalar.py create mode 100644 suitesparse_graphblas/tests/conftest.py create mode 100644 suitesparse_graphblas/tests/test_doctest.py create mode 100644 suitesparse_graphblas/tests/test_exceptions.py create mode 100644 suitesparse_graphblas/tests/test_io.py create mode 100644 suitesparse_graphblas/vector.py diff --git a/Dockerfile b/Dockerfile index c766e39..a34e989 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,7 @@ WORKDIR /build RUN git clone https://github.com/eliben/pycparser.git --depth 1 WORKDIR /build/GraphBLAS/build -RUN git clone https://github.com/DrTimothyAldenDavis/GraphBLAS.git --depth 1 --branch v${SUITESPARSE} \ +RUN git clone https://github.com/DrTimothyAldenDavis/GraphBLAS.git --depth 1 --branch ${SUITESPARSE} \ && cd GraphBLAS/build \ && cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DGBCOMPACT=${COMPACT} \ && make -j$(nproc) \ @@ -29,17 +29,16 @@ COPY --from=suitesparse /build/pycparser/utils/fake_libc_include/* /usr/local/li RUN apt-get update && apt-get install -yq build-essential git RUN pip3 install numpy cffi pytest cython -RUN mkdir -p /build/python-suitesparse-graphblas -ADD . /build/python-suitesparse-graphblas +RUN mkdir -p /psg +ADD . /psg -WORKDIR /build/python-suitesparse-graphblas +WORKDIR /psg RUN git tag ${VERSION} && \ python3 suitesparse_graphblas/create_headers.py && \ python3 setup.py install && \ ldconfig -WORKDIR / -RUN pytest --pyargs suitesparse_graphblas.tests +#RUN pytest --pyargs suitesparse_graphblas.tests RUN apt-get -y --purge remove git python3-pip && apt-get clean FROM ${BASE_CONTAINER} diff --git a/docker_build.sh b/docker_build.sh index 658f52b..c1ae7db 100755 --- a/docker_build.sh +++ b/docker_build.sh @@ -1,8 +1,8 @@ if [ $# -eq 0 ] then - echo "Usage: ./docker_build.sh SUITESPARSE VERSION BRANCH [LOCATION PUSH] + echo "Usage: ./docker_build.sh SUITESPARSE_BRANCH VERSION [BRANCH LOCATION PUSH] -Example: ./docker_build.sh 5.0.6 5.0.6.0 main clone push +Example: ./docker_build.sh v5.1.3 5.1.3.1 main clone push If location is clone then a fresh git clone will be used. If push is provided then the script will attempt to push to dockerhub." diff --git a/suitesparse_graphblas/__init__.py b/suitesparse_graphblas/__init__.py index b8bd35a..402ce03 100644 --- a/suitesparse_graphblas/__init__.py +++ b/suitesparse_graphblas/__init__.py @@ -1,6 +1,7 @@ from ._graphblas import ffi, lib # noqa from . import utils from ._version import get_versions +from . import exceptions as ex def is_initialized(): @@ -8,6 +9,11 @@ def is_initialized(): return lib.GxB_Global_Option_get(lib.GxB_MODE, ffi.new("GrB_Mode*")) != lib.GrB_PANIC +def supports_complex(): + """Does this package support complex numbers?""" + return hasattr(lib, "GrB_FC64") or hasattr(lib, "GxB_FC64") + + def initialize(*, blocking=False, memory_manager="numpy"): """Initialize GraphBLAS via GrB_init or GxB_init. @@ -37,8 +43,132 @@ def initialize(*, blocking=False, memory_manager="numpy"): elif memory_manager == "c": lib.GrB_init(blocking) else: - raise ValueError(f'memory_manager argument must be "numpy" or "c"; got: {memory_manager!r}') + raise ValueError( + f'memory_manager argument must be "numpy" or "c"; got: ' "{memory_manager!r}" # noqa + ) __version__ = get_versions()["version"] del get_versions + + +def libget(name): + """Helper to get items from GraphBLAS which might be GrB or GxB""" + try: + return getattr(lib, name) + except AttributeError: + ext_name = f"GxB_{name[4:]}" + try: + return getattr(lib, ext_name) + except AttributeError: + pass + raise + + +bool_types = frozenset((lib.GrB_BOOL,)) + +signed_integer_types = frozenset( + ( + lib.GrB_INT8, + lib.GrB_INT16, + lib.GrB_INT32, + lib.GrB_INT64, + ) +) + +unsigned_integer_types = frozenset( + ( + lib.GrB_UINT8, + lib.GrB_UINT16, + lib.GrB_UINT32, + lib.GrB_UINT64, + ) +) + +integer_types = signed_integer_types | unsigned_integer_types + +real_types = frozenset( + ( + lib.GrB_FP32, + lib.GrB_FP64, + ) +) + +if supports_complex(): + complex_types = frozenset( + ( + lib.GxB_FC32, + lib.GxB_FC64, + ) + ) +else: + complex_types = frozenset() + + +grb_types = bool_types | integer_types | real_types | complex_types + + +_error_code_lookup = { + # Warning + lib.GrB_NO_VALUE: ex.NoValue, + # API Errors + lib.GrB_UNINITIALIZED_OBJECT: ex.UninitializedObject, + lib.GrB_INVALID_OBJECT: ex.InvalidObject, + lib.GrB_NULL_POINTER: ex.NullPointer, + lib.GrB_INVALID_VALUE: ex.InvalidValue, + lib.GrB_INVALID_INDEX: ex.InvalidIndex, + lib.GrB_DOMAIN_MISMATCH: ex.DomainMismatch, + lib.GrB_DIMENSION_MISMATCH: ex.DimensionMismatch, + lib.GrB_OUTPUT_NOT_EMPTY: ex.OutputNotEmpty, + # Execution Errors + lib.GrB_OUT_OF_MEMORY: ex.OutOfMemory, + lib.GrB_INSUFFICIENT_SPACE: ex.InsufficientSpace, + lib.GrB_INDEX_OUT_OF_BOUNDS: ex.IndexOutOfBound, + lib.GrB_PANIC: ex.Panic, +} +GrB_SUCCESS = lib.GrB_SUCCESS +GrB_NO_VALUE = lib.GrB_NO_VALUE + + +_error_func_lookup = { + "struct GB_Type_opaque *": lib.GrB_Type_error, + "struct GB_UnaryOp_opaque *": lib.GrB_UnaryOp_error, + "struct GB_BinaryOp_opaque *": lib.GrB_BinaryOp_error, + "struct GB_SelectOp_opaque *": lib.GxB_SelectOp_error, + "struct GB_Monoid_opaque *": lib.GrB_Monoid_error, + "struct GB_Semiring_opaque *": lib.GrB_Semiring_error, + "struct GB_Scalar_opaque *": lib.GxB_Scalar_error, + "struct GB_Matrix_opaque *": lib.GrB_Matrix_error, + "struct GB_Vector_opaque *": lib.GrB_Vector_error, + "struct GB_Descriptor_opaque *": lib.GrB_Descriptor_error, +} + + +def check_status(obj, response_code): + """Check the return code of the GraphBLAS function. + + If the operation was successful, return None. + + If the operation returned no value return `exceptions.NoValue`. + + Otherwise it is an error, lookup the exception and the error + description, and throw the exception. + + """ + if response_code == GrB_SUCCESS: + return + if response_code == GrB_NO_VALUE: + return ex.NoValue + + if ffi.typeof(obj).item.kind == "pointer": + obj = obj[0] + + cname = ffi.typeof(obj).cname + error_func = _error_func_lookup.get(cname) + if error_func is None: + raise TypeError(f"Unknown cname {cname} looking up error string.") + + string = ffi.new("char**") + error_func(string, obj) + text = ffi.string(string[0]).decode() + raise _error_code_lookup[response_code](text) diff --git a/suitesparse_graphblas/exceptions.py b/suitesparse_graphblas/exceptions.py new file mode 100644 index 0000000..7002e71 --- /dev/null +++ b/suitesparse_graphblas/exceptions.py @@ -0,0 +1,54 @@ +class GraphBLASException(Exception): + pass + + +class NoValue(GraphBLASException): + pass + + +class UninitializedObject(GraphBLASException): + pass + + +class InvalidObject(GraphBLASException): + pass + + +class NullPointer(GraphBLASException): + pass + + +class InvalidValue(GraphBLASException): + pass + + +class InvalidIndex(GraphBLASException): + pass + + +class DomainMismatch(GraphBLASException): + pass + + +class DimensionMismatch(GraphBLASException): + pass + + +class OutputNotEmpty(GraphBLASException): + pass + + +class OutOfMemory(GraphBLASException): + pass + + +class InsufficientSpace(GraphBLASException): + pass + + +class IndexOutOfBound(GraphBLASException): + pass + + +class Panic(GraphBLASException): + pass diff --git a/suitesparse_graphblas/io/__init__.py b/suitesparse_graphblas/io/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/suitesparse_graphblas/io/binary.py b/suitesparse_graphblas/io/binary.py new file mode 100644 index 0000000..e72e978 --- /dev/null +++ b/suitesparse_graphblas/io/binary.py @@ -0,0 +1,558 @@ +from pathlib import Path +from ctypes.util import find_library +from suitesparse_graphblas import ffi, lib, check_status, matrix, __version__ +from cffi import FFI + + +stdffi = FFI() +stdffi.cdef( + """ +void *malloc(size_t size); +""" +) +stdlib = stdffi.dlopen(find_library("c")) + +# When "packing" a matrix the owner of the memory buffer is transfered +# to SuiteSparse, which then becomes responsible for freeing it. cffi +# wisely does not allow you to do this without declaring and calling +# malloc directly. When SuiteSparse moves over to a more formal +# memory manager with the cuda work, this will likely change and have +# to be replaceable with a allocator common to numpy, cuda, and here. +# Maybe PyDataMem_NEW? + + +def readinto_new_buffer(f, typ, size, allocator=stdlib.malloc): + buff = ffi.cast(typ, allocator(size)) + f.readinto(ffi.buffer(buff, size)) + return buff + + +GRB_HEADER_LEN = 512 +NULL = ffi.NULL + +header_template = """\ +SuiteSparse:GraphBLAS matrix +{suitesparse_version} ({user_agent}) +nrows: {nrows} +ncols: {ncols} +nvec: {nvec} +nvals: {nvals} +format: {format} +size: {size} +type: {type} +iso: {iso} +jumbled: {jumbled} +{comments} +""" + +sizeof = ffi.sizeof +ffinew = ffi.new +buff = ffi.buffer +frombuff = ffi.from_buffer +Isize = ffi.sizeof("GrB_Index") + +_ss_typecodes = { + lib.GrB_BOOL: 0, + lib.GrB_INT8: 1, + lib.GrB_INT16: 2, + lib.GrB_INT32: 3, + lib.GrB_INT64: 4, + lib.GrB_UINT8: 5, + lib.GrB_UINT16: 6, + lib.GrB_UINT32: 7, + lib.GrB_UINT64: 8, + lib.GrB_FP32: 9, + lib.GrB_FP64: 10, + lib.GxB_FC32: 11, + lib.GxB_FC64: 12, +} + +_ss_typenames = { + lib.GrB_BOOL: "GrB_BOOL", + lib.GrB_INT8: "GrB_INT8", + lib.GrB_INT16: "GrB_INT16", + lib.GrB_INT32: "GrB_INT32", + lib.GrB_INT64: "GrB_INT64", + lib.GrB_UINT8: "GrB_UINT8", + lib.GrB_UINT16: "GrB_UINT16", + lib.GrB_UINT32: "GrB_UINT32", + lib.GrB_UINT64: "GrB_UINT64", + lib.GrB_FP32: "GrB_FP32", + lib.GrB_FP64: "GrB_FP64", + lib.GxB_FC32: "GxB_FC32", + lib.GxB_FC64: "GxB_FC64", +} + +_ss_codetypes = {v: k for k, v in _ss_typecodes.items()} + + +def binwrite(A, filename, comments=None, opener=Path.open): + if isinstance(filename, str): + filename = Path(filename) + + check_status(A, lib.GrB_Matrix_wait(A)) + + ffinew = ffi.new + + Ap = ffinew("GrB_Index**") + Ai = ffinew("GrB_Index**") + Ah = ffinew("GrB_Index**") + Ax = ffinew("void**") + Ab = ffinew("int8_t**") + + Ap_size = ffinew("GrB_Index*") + Ai_size = ffinew("GrB_Index*") + Ah_size = ffinew("GrB_Index*") + Ax_size = ffinew("GrB_Index*") + Ab_size = ffinew("GrB_Index*") + + nvec = ffinew("GrB_Index*") + nrows = ffinew("GrB_Index*") + ncols = ffinew("GrB_Index*") + nvals = ffinew("GrB_Index*") + + typesize = ffi.new("size_t*") + is_iso = ffinew("bool*") + is_jumbled = ffinew("bool*") + + impl = ffi.new("uint64_t*", lib.GxB_IMPLEMENTATION) + format = ffinew("GxB_Format_Value*") + hyper_switch = ffinew("double*") + bitmap_switch = ffinew("double*") + sparsity_control = ffinew("int32_t*") + sparsity_status = ffinew("int32_t*") + + typecode = ffinew("int32_t*") + matrix_type = ffi.new("GrB_Type*") + sparsity_status = ffinew("int32_t*") + + nrows[0] = matrix.nrows(A) + ncols[0] = matrix.ncols(A) + nvals[0] = matrix.nvals(A) + matrix_type[0] = matrix.type(A) + + check_status(A, lib.GxB_Type_size(typesize, matrix_type[0])) + typecode[0] = _ss_typecodes[matrix_type[0]] + + format[0] = matrix.format(A) + hyper_switch[0] = matrix.hyper_switch(A) + bitmap_switch[0] = matrix.bitmap_switch(A) + sparsity_status[0] = matrix.sparsity_status(A) + sparsity_control[0] = matrix.sparsity_control(A) + + by_row = format[0] == lib.GxB_BY_ROW + by_col = format[0] == lib.GxB_BY_COL + + is_hyper = sparsity_status[0] == lib.GxB_HYPERSPARSE + is_sparse = sparsity_status[0] == lib.GxB_SPARSE + is_bitmap = sparsity_status[0] == lib.GxB_BITMAP + is_full = sparsity_status[0] == lib.GxB_FULL + + if by_col and is_hyper: + check_status( + A, + lib.GxB_Matrix_unpack_HyperCSC( + A[0], + Ap, + Ah, + Ai, + Ax, + Ap_size, + Ah_size, + Ai_size, + Ax_size, + is_iso, + nvec, + is_jumbled, + NULL, + ), + ) + fmt_string = "HCSC" + + elif by_row and is_hyper: + check_status( + A, + lib.GxB_Matrix_unpack_HyperCSR( + A[0], + Ap, + Ah, + Ai, + Ax, + Ap_size, + Ah_size, + Ai_size, + Ax_size, + is_iso, + nvec, + is_jumbled, + NULL, + ), + ) + fmt_string = "HCSR" + + elif by_col and is_sparse: + check_status( + A, + lib.GxB_Matrix_unpack_CSC( + A[0], Ap, Ai, Ax, Ap_size, Ai_size, Ax_size, is_iso, is_jumbled, NULL + ), + ) + nvec[0] = ncols[0] + fmt_string = "CSC" + + elif by_row and is_sparse: + check_status( + A, + lib.GxB_Matrix_unpack_CSR( + A[0], Ap, Ai, Ax, Ap_size, Ai_size, Ax_size, is_iso, is_jumbled, NULL + ), + ) + nvec[0] = nrows[0] + fmt_string = "CSR" + + elif by_col and is_bitmap: + check_status( + A, lib.GxB_Matrix_unpack_BitmapC(A[0], Ab, Ax, Ab_size, Ax_size, is_iso, nvals, NULL) + ) + nvec[0] = ncols[0] + fmt_string = "BITMAPC" + + elif by_row and is_bitmap: + check_status( + A, lib.GxB_Matrix_unpack_BitmapR(A[0], Ab, Ax, Ab_size, Ax_size, is_iso, nvals, NULL) + ) + nvec[0] = nrows[0] + fmt_string = "BITMAPR" + + elif by_col and is_full: + check_status(A, lib.GxB_Matrix_unpack_FullC(A[0], Ax, Ax_size, is_iso, NULL)) + nvec[0] = ncols[0] + fmt_string = "FULLC" + + elif by_row and is_full: + check_status(A, lib.GxB_Matrix_unpack_FullR(A[0], Ax, Ax_size, is_iso, NULL)) + nvec[0] = nrows[0] + fmt_string = "FULLR" + + else: # pragma nocover + raise TypeError(f"Unknown Matrix format {format[0]}") + + suitesparse_version = ( + f"v{lib.GxB_IMPLEMENTATION_MAJOR}." + "{lib.GxB_IMPLEMENTATION_MINOR}." + "{lib.GxB_IMPLEMENTATION_SUB}" + ) + + vars = dict( + suitesparse_version=suitesparse_version, + user_agent="pygraphblas-" + __version__, + nrows=nrows[0], + ncols=ncols[0], + nvals=nvals[0], + nvec=nvec[0], + format=fmt_string, + size=typesize[0], + type=_ss_typenames[matrix_type[0]], + iso=is_iso[0], + jumbled=is_jumbled[0], + comments=comments, + ) + header_content = header_template.format(**vars) + header = f"{header_content: <{GRB_HEADER_LEN}}".encode("ascii") + + with opener(filename, "wb") as f: + fwrite = f.write + fwrite(header) + fwrite(buff(impl, sizeof("uint64_t"))) + fwrite(buff(format, sizeof("GxB_Format_Value"))) + fwrite(buff(sparsity_status, sizeof("int32_t"))) + fwrite(buff(sparsity_control, sizeof("int32_t"))) + fwrite(buff(hyper_switch, sizeof("double"))) + fwrite(buff(bitmap_switch, sizeof("double"))) + fwrite(buff(nrows, Isize)) + fwrite(buff(ncols, Isize)) + fwrite(buff(nvec, Isize)) + fwrite(buff(nvals, Isize)) + fwrite(buff(typecode, sizeof("int32_t"))) + fwrite(buff(typesize, sizeof("size_t"))) + fwrite(buff(is_iso, sizeof("bool"))) + fwrite(buff(is_jumbled, sizeof("bool"))) + + if is_hyper: + Ap_size[0] = (nvec[0] + 1) * Isize + Ah_size[0] = nvec[0] * Isize + Ai_size[0] = nvals[0] * Isize + Ax_size[0] = nvals[0] * typesize[0] + fwrite(buff(Ap[0], Ap_size[0])) + fwrite(buff(Ah[0], Ah_size[0])) + fwrite(buff(Ai[0], Ai_size[0])) + elif is_sparse: + Ap_size[0] = (nvec[0] + 1) * Isize + Ai_size[0] = nvals[0] * Isize + Ax_size[0] = nvals[0] * typesize[0] + fwrite(buff(Ap[0], Ap_size[0])) + fwrite(buff(Ai[0], Ai_size[0])) + elif is_bitmap: + Ab_size[0] = nrows[0] * ncols[0] * ffi.sizeof("int8_t") + Ax_size[0] = nrows[0] * ncols[0] * typesize[0] + fwrite(buff(Ab[0], Ab_size[0])) + + fwrite(buff(Ax[0], Ax_size[0])) + + if by_col and is_hyper: + check_status( + A, + lib.GxB_Matrix_pack_HyperCSC( + A[0], + Ap, + Ah, + Ai, + Ax, + Ap_size[0], + Ah_size[0], + Ai_size[0], + Ax_size[0], + is_iso[0], + nvec[0], + is_jumbled[0], + NULL, + ), + ) + + elif by_row and is_hyper: + check_status( + A, + lib.GxB_Matrix_pack_HyperCSR( + A[0], + Ap, + Ah, + Ai, + Ax, + Ap_size[0], + Ah_size[0], + Ai_size[0], + Ax_size[0], + is_iso[0], + nvec[0], + is_jumbled[0], + NULL, + ), + ) + + elif by_col and is_sparse: + check_status( + A, + lib.GxB_Matrix_pack_CSC( + A[0], Ap, Ai, Ax, Ap_size[0], Ai_size[0], Ax_size[0], is_iso[0], is_jumbled[0], NULL + ), + ) + + elif by_row and is_sparse: + check_status( + A, + lib.GxB_Matrix_pack_CSR( + A[0], Ap, Ai, Ax, Ap_size[0], Ai_size[0], Ax_size[0], is_iso[0], is_jumbled[0], NULL + ), + ) + + elif by_col and is_bitmap: + check_status( + A, + lib.GxB_Matrix_pack_BitmapC( + A[0], Ab, Ax, Ab_size[0], Ax_size[0], is_iso[0], nvals[0], NULL + ), + ) + + elif by_row and is_bitmap: + check_status( + A, + lib.GxB_Matrix_pack_BitmapR( + A[0], Ab, Ax, Ab_size[0], Ax_size[0], is_iso[0], nvals[0], NULL + ), + ) + + elif by_col and is_full: + check_status(A, lib.GxB_Matrix_pack_FullC(A[0], Ax, Ax_size[0], is_iso[0], NULL)) + + elif by_row and is_full: + check_status(A, lib.GxB_Matrix_pack_FullR(A[0], Ax, Ax_size[0], is_iso[0], NULL)) + else: + raise TypeError("This should hever happen") + + +def binread(filename, opener=Path.open): + if isinstance(filename, str): + filename = Path(filename) + + with opener(filename, "rb") as f: + fread = f.read + + fread(GRB_HEADER_LEN) + impl = frombuff("uint64_t*", fread(sizeof("uint64_t"))) + + assert impl[0] == lib.GxB_IMPLEMENTATION + + format = frombuff("GxB_Format_Value*", fread(sizeof("GxB_Format_Value"))) + sparsity_status = frombuff("int32_t*", fread(sizeof("int32_t"))) + sparsity_control = frombuff("int32_t*", fread(sizeof("int32_t"))) + hyper_switch = frombuff("double*", fread(sizeof("double"))) + bitmap_switch = frombuff("double*", fread(sizeof("double"))) + nrows = frombuff("GrB_Index*", fread(Isize)) + ncols = frombuff("GrB_Index*", fread(Isize)) + nvec = frombuff("GrB_Index*", fread(Isize)) + nvals = frombuff("GrB_Index*", fread(Isize)) + typecode = frombuff("int32_t*", fread(sizeof("int32_t"))) + typesize = frombuff("size_t*", fread(sizeof("size_t"))) + is_iso = frombuff("bool*", fread(sizeof("bool"))) + is_jumbled = frombuff("bool*", fread(sizeof("bool"))) + + by_row = format[0] == lib.GxB_BY_ROW + by_col = format[0] == lib.GxB_BY_COL + + is_hyper = sparsity_status[0] == lib.GxB_HYPERSPARSE + is_sparse = sparsity_status[0] == lib.GxB_SPARSE + is_bitmap = sparsity_status[0] == lib.GxB_BITMAP + is_full = sparsity_status[0] == lib.GxB_FULL + + atype = _ss_codetypes[typecode[0]] + + Ap = ffinew("GrB_Index**") + Ai = ffinew("GrB_Index**") + Ah = ffinew("GrB_Index**") + Ax = ffinew("void**") + Ab = ffinew("int8_t**") + + Ap_size = ffinew("GrB_Index*") + Ai_size = ffinew("GrB_Index*") + Ah_size = ffinew("GrB_Index*") + Ax_size = ffinew("GrB_Index*") + Ab_size = ffinew("GrB_Index*") + + if is_hyper: + Ap_size[0] = (nvec[0] + 1) * Isize + Ah_size[0] = nvec[0] * Isize + Ai_size[0] = nvals[0] * Isize + Ax_size[0] = nvals[0] * typesize[0] + + Ap[0] = readinto_new_buffer(f, "GrB_Index*", Ap_size[0]) + Ah[0] = readinto_new_buffer(f, "GrB_Index*", Ah_size[0]) + Ai[0] = readinto_new_buffer(f, "GrB_Index*", Ai_size[0]) + elif is_sparse: + Ap_size[0] = (nvec[0] + 1) * Isize + Ai_size[0] = nvals[0] * Isize + Ax_size[0] = nvals[0] * typesize[0] + Ap[0] = readinto_new_buffer(f, "GrB_Index*", Ap_size[0]) + Ai[0] = readinto_new_buffer(f, "GrB_Index*", Ai_size[0]) + elif is_bitmap: + Ab_size[0] = nrows[0] * ncols[0] * ffi.sizeof("int8_t") + Ax_size[0] = nrows[0] * ncols[0] * typesize[0] + Ab[0] = readinto_new_buffer(f, "int8_t*", Ab_size[0]) + elif is_full: + Ax_size[0] = nrows[0] * ncols[0] * typesize[0] + + Ax[0] = readinto_new_buffer(f, "uint8_t*", Ax_size[0]) + + A = matrix.new(atype, nrows[0], ncols[0]) + + if by_col and is_hyper: + check_status( + A, + lib.GxB_Matrix_pack_HyperCSC( + A[0], + Ap, + Ah, + Ai, + Ax, + Ap_size[0], + Ah_size[0], + Ai_size[0], + Ax_size[0], + is_iso[0], + nvec[0], + is_jumbled[0], + NULL, + ), + ) + + elif by_row and is_hyper: + check_status( + A, + lib.GxB_Matrix_pack_HyperCSR( + A[0], + Ap, + Ah, + Ai, + Ax, + Ap_size[0], + Ah_size[0], + Ai_size[0], + Ax_size[0], + is_iso[0], + nvec[0], + is_jumbled[0], + NULL, + ), + ) + + elif by_col and is_sparse: + check_status( + A, + lib.GxB_Matrix_pack_CSC( + A[0], + Ap, + Ai, + Ax, + Ap_size[0], + Ai_size[0], + Ax_size[0], + is_iso[0], + is_jumbled[0], + NULL, + ), + ) + + elif by_row and is_sparse: + check_status( + A, + lib.GxB_Matrix_pack_CSR( + A[0], + Ap, + Ai, + Ax, + Ap_size[0], + Ai_size[0], + Ax_size[0], + is_iso[0], + is_jumbled[0], + NULL, + ), + ) + + elif by_col and is_bitmap: + check_status( + A, + lib.GxB_Matrix_pack_BitmapC( + A[0], Ab, Ax, Ab_size[0], Ax_size[0], is_iso[0], nvals[0], NULL + ), + ) + + elif by_row and is_bitmap: + check_status( + A, + lib.GxB_Matrix_pack_BitmapR( + A[0], Ab, Ax, Ab_size[0], Ax_size[0], is_iso[0], nvals[0], NULL + ), + ) + + elif by_col and is_full: + check_status(A, lib.GxB_Matrix_pack_FullC(A[0], Ax, Ax_size[0], is_iso[0], NULL)) + + elif by_row and is_full: + check_status(A, lib.GxB_Matrix_pack_FullR(A[0], Ax, Ax_size[0], is_iso[0], NULL)) + else: + raise TypeError("Unknown format {format[0]}") + + matrix.set_sparsity_control(A, sparsity_control[0]) + matrix.set_hyper_switch(A, hyper_switch[0]) + matrix.set_bitmap_switch(A, bitmap_switch[0]) + return A diff --git a/suitesparse_graphblas/matrix.py b/suitesparse_graphblas/matrix.py new file mode 100644 index 0000000..dd73669 --- /dev/null +++ b/suitesparse_graphblas/matrix.py @@ -0,0 +1,203 @@ +from suitesparse_graphblas import ( + lib, + ffi, + check_status, +) + + +def free(A): + """Free a matrix.""" + check_status(A, lib.GrB_Matrix_free(A)) + + +def new(T, nrows=lib.GxB_INDEX_MAX, ncols=lib.GxB_INDEX_MAX, *, free=free): + """Create a new `GrB_Matrix` of type `T` and initialize it. The + following example creates an eight bit unsigned 2x2 matrix: + + >>> A = new(lib.GrB_UINT8, 2, 2) + >>> shape(A) + (2, 2) + + The default value for `nrows` and `ncols` is `lib.GxB_INDEX_MAX` + which creates a Matrix with maximal bounds: + + >>> A = new(lib.GrB_UINT8) + >>> shape(A) == (lib.GxB_INDEX_MAX, lib.GxB_INDEX_MAX) + True + + The `free` argument is called when the object is garbage + collected, the default is `matrix.free()`. If `free` is None then + there is no automatic garbage collection and it is up to the user + to free the matrix. + + """ + A = ffi.new("GrB_Matrix*") + check_status(A, lib.GrB_Matrix_new(A, T, nrows, ncols)) + if free: + return ffi.gc(A, free) + return A + + +def type(A): + """Return the GraphBLAS type of the vector. + + >>> A = new(lib.GrB_UINT8) + >>> type(A) == lib.GrB_UINT8 + True + + """ + T = ffi.new("GrB_Type*") + check_status(A, lib.GxB_Matrix_type(T, A[0])) + return T[0] + + +def nrows(A): + """Return the number of rows in the matrix. + + >>> A = new(lib.GrB_UINT8, 2, 3) + >>> nrows(A) + 2 + + """ + n = ffi.new("GrB_Index*") + check_status(A, lib.GrB_Matrix_nrows(n, A[0])) + return n[0] + + +def ncols(A): + """Return the number of columns in the matrix. + + >>> A = new(lib.GrB_UINT8, 2, 3) + >>> ncols(A) + 3 + + """ + n = ffi.new("GrB_Index*") + check_status(A, lib.GrB_Matrix_ncols(n, A[0])) + return n[0] + + +def nvals(A): + """Return the number of stored elements in the matrix. + + >>> A = new(lib.GrB_UINT8, 2, 3) + >>> nvals(A) + 0 + + """ + n = ffi.new("GrB_Index*") + check_status(A, lib.GrB_Matrix_nvals(n, A[0])) + return n[0] + + +def shape(A): + """Return the shape of the matrix as a two tuple `(nrows, ncols)` + + >>> A = new(lib.GrB_UINT8, 2, 2) + >>> shape(A) + (2, 2) + + """ + return (nrows(A), ncols(A)) + + +def format(A): + """Return the format of the matrix. + + >>> A = new(lib.GrB_UINT8, 2, 2) + >>> format(A) == lib.GxB_BY_ROW + True + + """ + format = ffi.new("GxB_Format_Value*") + check_status(A, lib.GxB_Matrix_Option_get(A[0], lib.GxB_FORMAT, format)) + return format[0] + + +def set_format(A, format): + """Set the format of the matrix. + + >>> A = new(lib.GrB_UINT8, 2, 2) + >>> set_format(A, lib.GxB_BY_COL) + >>> format(A) == lib.GxB_BY_COL + True + + """ + check_status( + A, lib.GxB_Matrix_Option_set(A[0], lib.GxB_FORMAT, ffi.cast("GxB_Format_Value", format)) + ) + + +def sparsity_status(A): + """Get the sparsity status of the matrix.""" + sparsity_status = ffi.new("int32_t*") + check_status(A, lib.GxB_Matrix_Option_get(A[0], lib.GxB_SPARSITY_STATUS, sparsity_status)) + return sparsity_status[0] + + +def sparsity_control(A): + """Get the sparsity control of the matrix.""" + sparsity_control = ffi.new("int32_t*") + check_status(A, lib.GxB_Matrix_Option_get(A[0], lib.GxB_SPARSITY_CONTROL, sparsity_control)) + return sparsity_control[0] + + +def set_sparsity_control(A, sparsity): + """Set the sparsity control of the matrix.""" + check_status( + A, lib.GxB_Matrix_Option_set(A[0], lib.GxB_SPARSITY_CONTROL, ffi.cast("int", sparsity)) + ) + + +def hyper_switch(A): + """Get the hyper switch of the matrix.""" + hyper_switch = ffi.new("double*") + check_status(A, lib.GxB_Matrix_Option_get(A[0], lib.GxB_HYPER_SWITCH, hyper_switch)) + return hyper_switch[0] + + +def set_hyper_switch(A, hyper_switch): + """Set the hyper switch of the matrix.""" + check_status( + A, lib.GxB_Matrix_Option_set(A[0], lib.GxB_HYPER_SWITCH, ffi.cast("double", hyper_switch)) + ) + + +def bitmap_switch(A): + """Get the bitmap switch of the matrix.""" + bitmap_switch = ffi.new("double*") + check_status(A, lib.GxB_Matrix_Option_get(A[0], lib.GxB_BITMAP_SWITCH, bitmap_switch)) + return bitmap_switch[0] + + +def set_bitmap_switch(A, bitmap_switch): + """Set the bitmap switch of the matrix.""" + check_status( + A, lib.GxB_Matrix_Option_set(A[0], lib.GxB_BITMAP_SWITCH, ffi.cast("double", bitmap_switch)) + ) + + +def set_bool(A, value, i, j): + """Set a boolean value to the matrix at row `i` column `j`. + + >>> A = new(lib.GrB_BOOL, 3, 3) + >>> set_bool(A, True, 2, 2) + >>> bool(A, 2, 2) == True + True + + """ + check_status(A, lib.GrB_Matrix_setElement_BOOL(A[0], value, i, j)) + + +def bool(A, i, j): + """Get a boolean value from the matrix at row `i` column `j`. + + >>> A = new(lib.GrB_BOOL, 3, 3) + >>> set_bool(A, True, 2, 2) + >>> bool(A, 2, 2) == True + True + + """ + value = ffi.new("bool*") + check_status(A, lib.GrB_Matrix_extractElement_BOOL(value, A[0], i, j)) + return value[0] diff --git a/suitesparse_graphblas/scalar.py b/suitesparse_graphblas/scalar.py new file mode 100644 index 0000000..548e3ba --- /dev/null +++ b/suitesparse_graphblas/scalar.py @@ -0,0 +1,70 @@ +from suitesparse_graphblas import ( + lib, + ffi, + check_status, + exceptions, +) + + +def free(v): + """Free a scalar.""" + check_status(v, lib.GxB_Scalar_free(v)) + + +def new(T, *, free=free): + """Create a new `GxB_Scalar` of type `T` and initialize it. + + The `free` argument is called when the object is garbage + collected, the default is `scalar.free()`. If `free` is None then + there is no automatic garbage collection and it is up to the user + to free the scalar. + + >>> S = new(lib.GrB_UINT8) + + """ + s = ffi.new("GxB_Scalar*") + check_status(s, lib.GxB_Scalar_new(s, T)) + if free: + return ffi.gc(s, free) + return s + + +def type(s): + """Return the GraphBLAS type of the scalar. + + >>> S = new(lib.GrB_UINT8) + >>> type(S) == lib.GrB_UINT8 + True + + """ + T = ffi.new("GrB_Type*") + check_status(s, lib.GxB_Scalar_type(T, s[0])) + return T[0] + + +def set_bool(s, value): + """Set a boolean value to the scalar. + + >>> s = new(lib.GrB_BOOL) + >>> set_bool(s, True) + >>> bool(s) == True + True + + """ + check_status(s, lib.GxB_Scalar_setElement_BOOL(s[0], value)) + + +def bool(s): + """Get a boolean value from the scalar. + + >>> s = new(lib.GrB_BOOL) + >>> set_bool(s, True) + >>> bool(s) == True + True + + """ + value = ffi.new("bool*") + res = check_status(s, lib.GxB_Scalar_extractElement_BOOL(value, s[0])) + if res == exceptions.NoValue: + return None + return value[0] diff --git a/suitesparse_graphblas/tests/conftest.py b/suitesparse_graphblas/tests/conftest.py new file mode 100644 index 0000000..24dc269 --- /dev/null +++ b/suitesparse_graphblas/tests/conftest.py @@ -0,0 +1,7 @@ +import pytest +from suitesparse_graphblas import initialize + + +@pytest.fixture(scope="session", autouse=True) +def intialize_suitesparse_graphblas(): + initialize() diff --git a/suitesparse_graphblas/tests/test_doctest.py b/suitesparse_graphblas/tests/test_doctest.py new file mode 100644 index 0000000..7854f35 --- /dev/null +++ b/suitesparse_graphblas/tests/test_doctest.py @@ -0,0 +1,14 @@ +def test_run_doctests(): + import doctest + from suitesparse_graphblas import ( + matrix, + vector, + scalar, + ) + + for mod in ( + matrix, + vector, + scalar, + ): + doctest.testmod(mod, optionflags=doctest.ELLIPSIS, raise_on_error=True) diff --git a/suitesparse_graphblas/tests/test_exceptions.py b/suitesparse_graphblas/tests/test_exceptions.py new file mode 100644 index 0000000..825ce21 --- /dev/null +++ b/suitesparse_graphblas/tests/test_exceptions.py @@ -0,0 +1,17 @@ +from suitesparse_graphblas import ( + ffi, + lib, + check_status, + exceptions, +) + +import pytest + + +def test_check_status(): + A = ffi.new("GrB_Matrix*") + check_status(A, lib.GrB_Matrix_new(A, lib.GrB_BOOL, 2, 2)) + with pytest.raises(exceptions.Panic): + check_status(A, lib.GrB_PANIC) + with pytest.raises(exceptions.Panic): + check_status(A[0], lib.GrB_PANIC) diff --git a/suitesparse_graphblas/tests/test_io.py b/suitesparse_graphblas/tests/test_io.py new file mode 100644 index 0000000..2638446 --- /dev/null +++ b/suitesparse_graphblas/tests/test_io.py @@ -0,0 +1,151 @@ +import platform +import pytest + +if platform.system() == "Windows": + pytest.skip("skipping windows-only tests", allow_module_level=True) + +import gzip +import bz2 +import lzma +from pathlib import Path + +from suitesparse_graphblas import ( + ffi, + lib, + check_status, + grb_types, + bool_types, + signed_integer_types, + unsigned_integer_types, + real_types, + complex_types, + supports_complex, + matrix, +) + +from suitesparse_graphblas.io import binary + +NULL = ffi.NULL + + +def _test_elements(T): + if T in bool_types: + return [True, False], [0, 0], [1, 1] + elif T in signed_integer_types: + return [1, -42], [0, 0], [1, 1] + elif T in unsigned_integer_types: + return [1, 42], [0, 0], [1, 1] + elif T in real_types: + return [1.0, -42.42], [0, 0], [1, 1] + elif T in complex_types: + return [complex(1.0, 1.0), complex(42.0, -42.0)], [0, 0], [1, 1] + + +_element_setters = { + lib.GrB_BOOL: lib.GrB_Matrix_setElement_BOOL, + lib.GrB_INT8: lib.GrB_Matrix_setElement_INT8, + lib.GrB_INT16: lib.GrB_Matrix_setElement_INT16, + lib.GrB_INT32: lib.GrB_Matrix_setElement_INT32, + lib.GrB_INT64: lib.GrB_Matrix_setElement_INT64, + lib.GrB_UINT8: lib.GrB_Matrix_setElement_UINT8, + lib.GrB_UINT16: lib.GrB_Matrix_setElement_UINT16, + lib.GrB_UINT32: lib.GrB_Matrix_setElement_UINT32, + lib.GrB_UINT64: lib.GrB_Matrix_setElement_UINT64, + lib.GrB_FP32: lib.GrB_Matrix_setElement_FP32, + lib.GrB_FP64: lib.GrB_Matrix_setElement_FP64, +} + +if supports_complex(): + _element_setters.update( + { + lib.GxB_FC32: lib.GxB_Matrix_setElement_FC32, + lib.GxB_FC64: lib.GxB_Matrix_setElement_FC64, + } + ) + + +_eq_ops = { + lib.GrB_BOOL: lib.GrB_EQ_BOOL, + lib.GrB_INT8: lib.GrB_EQ_INT8, + lib.GrB_INT16: lib.GrB_EQ_INT16, + lib.GrB_INT32: lib.GrB_EQ_INT32, + lib.GrB_INT64: lib.GrB_EQ_INT64, + lib.GrB_UINT8: lib.GrB_EQ_UINT8, + lib.GrB_UINT16: lib.GrB_EQ_UINT16, + lib.GrB_UINT32: lib.GrB_EQ_UINT32, + lib.GrB_UINT64: lib.GrB_EQ_UINT64, + lib.GrB_FP32: lib.GrB_EQ_FP32, + lib.GrB_FP64: lib.GrB_EQ_FP64, +} + +if supports_complex(): + _eq_ops.update( + { + lib.GxB_FC32: lib.GxB_EQ_FC32, + lib.GxB_FC64: lib.GxB_EQ_FC64, + } + ) + + +def test_matrix_binfile_read_write(tmp_path): + for opener in (Path.open, gzip.open, bz2.open, lzma.open): + for format in (lib.GxB_BY_ROW, lib.GxB_BY_COL): + for T in grb_types: + for sparsity in (lib.GxB_HYPERSPARSE, lib.GxB_SPARSE, lib.GxB_BITMAP, lib.GxB_FULL): + + A = matrix.new(T, 2, 2) + + if T is not lib.GxB_FULL: + for args in zip(*_test_elements(T)): + f = _element_setters[T] + check_status(A, f(A[0], *args)) + else: + Tone = _test_elements(T)[0][0] + check_status( + A[0], + lib.GrB_assign( + A, + NULL, + NULL, + Tone, + lib.GrB_ALL, + 0, + lib.GrB_ALL, + 0, + NULL, + ), + ) + matrix.set_sparsity_control(A, sparsity) + matrix.set_format(A, format) + + binfilef = tmp_path / "binfilewrite_test.binfile" + binary.binwrite(A, binfilef, opener=opener) + B = binary.binread(binfilef, opener=opener) + + assert matrix.type(A) == matrix.type(B) + assert matrix.nrows(A) == matrix.nrows(B) + assert matrix.ncols(A) == matrix.ncols(B) + assert matrix.hyper_switch(A) == matrix.hyper_switch(B) + assert matrix.bitmap_switch(A) == matrix.bitmap_switch(B) + # assert matrix.sparsity_control(A) == matrix.sparsity_control(B) + + C = matrix.new(lib.GrB_BOOL, 2, 2) + + check_status( + C, + lib.GrB_Matrix_eWiseAdd_BinaryOp( + C[0], NULL, NULL, _eq_ops[T], A[0], B[0], NULL + ), + ) + + assert matrix.nvals(A) == matrix.nvals(B) == matrix.nvals(C) + + is_eq = ffi.new("bool*") + check_status( + C, + lib.GrB_Matrix_reduce_BOOL( + is_eq, NULL, lib.GrB_LAND_MONOID_BOOL, C[0], NULL + ), + ) + + assert is_eq[0] diff --git a/suitesparse_graphblas/vector.py b/suitesparse_graphblas/vector.py new file mode 100644 index 0000000..2d0e12b --- /dev/null +++ b/suitesparse_graphblas/vector.py @@ -0,0 +1,104 @@ +from suitesparse_graphblas import ( + lib, + ffi, + check_status, +) + + +def free(v): + """Free a vector.""" + check_status(v, lib.GrB_Vector_free(v)) + + +def new(T, size=lib.GxB_INDEX_MAX, *, free=free): + """Create a new `GrB_Vector` of type `T` and initialize it. + + >>> A = new(lib.GrB_UINT8, 2) + >>> size(A) + 2 + + The default `size` is `lib.GxB_INDEX_MAX`. + + >>> A = new(lib.GrB_UINT8) + >>> size(A) == lib.GxB_INDEX_MAX + True + + The `free` argument is called when the object is garbage + collected, the default is `vector.free()`. If `free` is None then + there is no automatic garbage collection and it is up to the user + to free the vector. + """ + v = ffi.new("GrB_Vector*") + check_status(v, lib.GrB_Vector_new(v, T, size)) + if free: + return ffi.gc(v, free) + return v + + +def type(v): + """Return the GraphBLAS type of the vector. + + >>> v = new(lib.GrB_UINT8, 2) + >>> type(v) == lib.GrB_UINT8 + True + + + """ + T = ffi.new("GrB_Type*") + check_status(v, lib.GxB_Vector_type(T, v[0])) + return T[0] + + +def size(v): + """Return the size of the vector. + + >>> v = new(lib.GrB_UINT8, 2) + >>> size(v) == 2 + True + + """ + n = ffi.new("GrB_Index*") + check_status(v, lib.GrB_Vector_size(n, v[0])) + return n[0] + + +def nvals(v): + """Return the number of stored elements in the vector. + + >>> v = new(lib.GrB_BOOL, 2) + >>> nvals(v) + 0 + >>> set_bool(v, True, 1) + >>> nvals(v) + 1 + + """ + n = ffi.new("GrB_Index*") + check_status(v, lib.GrB_Vector_nvals(n, v[0])) + return n[0] + + +def set_bool(v, value, i): + """Set a boolean value to the vector at position `i`. + + >>> v = new(lib.GrB_BOOL, 3) + >>> set_bool(v, True, 2) + >>> bool(v, 2) == True + True + + """ + check_status(v, lib.GrB_Vector_setElement_BOOL(v[0], value, i)) + + +def bool(v, i): + """Get a boolean value from the vector at position `i`. + + >>> v = new(lib.GrB_BOOL, 3) + >>> set_bool(v, True, 2) + >>> bool(v, 2) == True + True + + """ + value = ffi.new("bool*") + check_status(v, lib.GrB_Vector_extractElement_BOOL(value, v[0], i)) + return value[0] From 9962b58624e69d9718a907a6977db27167651d52 Mon Sep 17 00:00:00 2001 From: Michel Pelletier Date: Mon, 12 Jul 2021 09:16:40 -0400 Subject: [PATCH 032/193] oops fix up string i broke misinterpreting a lint error. --- suitesparse_graphblas/__init__.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/suitesparse_graphblas/__init__.py b/suitesparse_graphblas/__init__.py index 402ce03..87e045b 100644 --- a/suitesparse_graphblas/__init__.py +++ b/suitesparse_graphblas/__init__.py @@ -43,9 +43,7 @@ def initialize(*, blocking=False, memory_manager="numpy"): elif memory_manager == "c": lib.GrB_init(blocking) else: - raise ValueError( - f'memory_manager argument must be "numpy" or "c"; got: ' "{memory_manager!r}" # noqa - ) + raise ValueError(f'memory_manager argument must be "numpy" or "c"; got: {memory_manager!r}') __version__ = get_versions()["version"] From 89f1f6351e0bd1adf62dc751894f18bdc1affb08 Mon Sep 17 00:00:00 2001 From: Michel Pelletier Date: Mon, 26 Jul 2021 18:21:44 -0400 Subject: [PATCH 033/193] Github Action to build and upload linux wheels (#20) * test wheels * review comments from Erik --- .github/workflows/wheels.yml | 33 +++++++++++++++++++++++++++++++++ suitesparse.sh | 13 +++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 .github/workflows/wheels.yml create mode 100644 suitesparse.sh diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml new file mode 100644 index 0000000..6141c53 --- /dev/null +++ b/.github/workflows/wheels.yml @@ -0,0 +1,33 @@ +name: Python wheel package build and publish + +on: + release: + types: [created] + +jobs: + wheels: + runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash -l {0} + strategy: + fail-fast: false + matrix: + os: ["ubuntu-latest"] + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Build manylinux Python wheels + uses: RalfG/python-wheels-manylinux-build@v0.3.4-manylinux2014_x86_64 + with: + python-versions: 'cp37-cp37m cp38-cp38 cp39-cp39' + build-requirements: 'cffi numpy>=1.18,<1.19 cython' + pre-build-command: ${{ format('sh suitesparse.sh {0}', github.ref) }} + - name: Publish wheels to PyPI + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} + run: | + python -m pip install --upgrade pip + pip install twine + twine upload dist/*-manylinux*.whl diff --git a/suitesparse.sh b/suitesparse.sh new file mode 100644 index 0000000..81114d8 --- /dev/null +++ b/suitesparse.sh @@ -0,0 +1,13 @@ + +if [[ $1 =~ refs/tags/v([0-9]\.[0-9]\.[0-9]).*$ ]]; +then + VERSION=${BASH_REMATCH[1]} +else + exit -1 +fi + +curl -L https://github.com/DrTimothyAldenDavis/GraphBLAS/archive/refs/tags/v${VERSION}.tar.gz | tar xzf - +cd GraphBLAS-${VERSION}/build +cmake .. -DCMAKE_BUILD_TYPE=Release +make -j$(nproc) +make install From a062afb5463dcf7632b9c944609b9d5141d1bbe1 Mon Sep 17 00:00:00 2001 From: Michel Pelletier Date: Mon, 26 Jul 2021 18:36:16 -0400 Subject: [PATCH 034/193] tweak regex to match existing release pattern. --- suitesparse.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/suitesparse.sh b/suitesparse.sh index 81114d8..3984649 100644 --- a/suitesparse.sh +++ b/suitesparse.sh @@ -1,5 +1,5 @@ -if [[ $1 =~ refs/tags/v([0-9]\.[0-9]\.[0-9]).*$ ]]; +if [[ $1 =~ refs/tags/([0-9]\.[0-9]\.[0-9]).*$ ]]; then VERSION=${BASH_REMATCH[1]} else From 3db168a27bf89a3dd06d4041aaa5a8a6e823b316 Mon Sep 17 00:00:00 2001 From: Michel Pelletier Date: Wed, 11 Aug 2021 20:59:17 -0700 Subject: [PATCH 035/193] Bad address on large iso (#21) * test wheels * test wheels * test wheels * test wheels * test wheels * test wheels * test wheels * test wheels * test wheels * test wheels * test wheels * test wheels * test wheels * test wheels * test wheels * test wheels * test wheels * test wheels * test wheels * test wheels * test wheels * test wheels * test wheels * test wheels * test wheels * test wheels * test wheels * test wheels * test wheels * test wheels * test wheels * test wheels * test wheels * test wheels * review comments from Erik * tweak regex to match existing release pattern. * handle iso as a value size of 1 * typo in element size --- suitesparse_graphblas/io/binary.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/suitesparse_graphblas/io/binary.py b/suitesparse_graphblas/io/binary.py index e72e978..3825a11 100644 --- a/suitesparse_graphblas/io/binary.py +++ b/suitesparse_graphblas/io/binary.py @@ -282,20 +282,22 @@ def binwrite(A, filename, comments=None, opener=Path.open): Ap_size[0] = (nvec[0] + 1) * Isize Ah_size[0] = nvec[0] * Isize Ai_size[0] = nvals[0] * Isize - Ax_size[0] = nvals[0] * typesize[0] + Ax_size[0] = typesize[0] if is_iso[0] else nvals[0] * typesize[0] fwrite(buff(Ap[0], Ap_size[0])) fwrite(buff(Ah[0], Ah_size[0])) fwrite(buff(Ai[0], Ai_size[0])) elif is_sparse: Ap_size[0] = (nvec[0] + 1) * Isize Ai_size[0] = nvals[0] * Isize - Ax_size[0] = nvals[0] * typesize[0] + Ax_size[0] = typesize[0] if is_iso[0] else nvals[0] * typesize[0] fwrite(buff(Ap[0], Ap_size[0])) fwrite(buff(Ai[0], Ai_size[0])) elif is_bitmap: Ab_size[0] = nrows[0] * ncols[0] * ffi.sizeof("int8_t") - Ax_size[0] = nrows[0] * ncols[0] * typesize[0] + Ax_size[0] = typesize[0] if is_iso[0] else nrows[0] * ncols[0] * typesize[0] fwrite(buff(Ab[0], Ab_size[0])) + else: + Ax_size[0] = typesize[0] if is_iso[0] else nrows[0] * ncols[0] * typesize[0] fwrite(buff(Ax[0], Ax_size[0])) @@ -450,7 +452,7 @@ def binread(filename, opener=Path.open): elif is_full: Ax_size[0] = nrows[0] * ncols[0] * typesize[0] - Ax[0] = readinto_new_buffer(f, "uint8_t*", Ax_size[0]) + Ax[0] = readinto_new_buffer(f, "uint8_t*", typesize[0] if is_iso[0] else Ax_size[0]) A = matrix.new(atype, nrows[0], ncols[0]) From b483d360d48da62f297f7d90c6c708e7e6b1a6e3 Mon Sep 17 00:00:00 2001 From: Michel Pelletier Date: Thu, 12 Aug 2021 09:37:02 -0700 Subject: [PATCH 036/193] =?UTF-8?q?remove=20jumbled=20from=20format,=20fix?= =?UTF-8?q?=20broken=20version=20string,=20cast=20iso=20to=20in=E2=80=A6?= =?UTF-8?q?=20(#22)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * remove jumbled from format, fix broken version string, cast iso to int header. * remove jumbled from format... * oops, left busted is_jumbled read. --- suitesparse_graphblas/io/binary.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/suitesparse_graphblas/io/binary.py b/suitesparse_graphblas/io/binary.py index 3825a11..7c65120 100644 --- a/suitesparse_graphblas/io/binary.py +++ b/suitesparse_graphblas/io/binary.py @@ -41,7 +41,6 @@ def readinto_new_buffer(f, typ, size, allocator=stdlib.malloc): size: {size} type: {type} iso: {iso} -jumbled: {jumbled} {comments} """ @@ -239,8 +238,8 @@ def binwrite(A, filename, comments=None, opener=Path.open): suitesparse_version = ( f"v{lib.GxB_IMPLEMENTATION_MAJOR}." - "{lib.GxB_IMPLEMENTATION_MINOR}." - "{lib.GxB_IMPLEMENTATION_SUB}" + f"{lib.GxB_IMPLEMENTATION_MINOR}." + f"{lib.GxB_IMPLEMENTATION_SUB}" ) vars = dict( @@ -253,8 +252,7 @@ def binwrite(A, filename, comments=None, opener=Path.open): format=fmt_string, size=typesize[0], type=_ss_typenames[matrix_type[0]], - iso=is_iso[0], - jumbled=is_jumbled[0], + iso=int(is_iso[0]), comments=comments, ) header_content = header_template.format(**vars) @@ -276,7 +274,6 @@ def binwrite(A, filename, comments=None, opener=Path.open): fwrite(buff(typecode, sizeof("int32_t"))) fwrite(buff(typesize, sizeof("size_t"))) fwrite(buff(is_iso, sizeof("bool"))) - fwrite(buff(is_jumbled, sizeof("bool"))) if is_hyper: Ap_size[0] = (nvec[0] + 1) * Isize @@ -406,7 +403,7 @@ def binread(filename, opener=Path.open): typecode = frombuff("int32_t*", fread(sizeof("int32_t"))) typesize = frombuff("size_t*", fread(sizeof("size_t"))) is_iso = frombuff("bool*", fread(sizeof("bool"))) - is_jumbled = frombuff("bool*", fread(sizeof("bool"))) + is_jumbled = ffi.new("bool*", 0) by_row = format[0] == lib.GxB_BY_ROW by_col = format[0] == lib.GxB_BY_COL From d5ed2bbfd79fe4a192d25bb75cdc2ef2fbcfee3d Mon Sep 17 00:00:00 2001 From: Michel Pelletier Date: Thu, 12 Aug 2021 11:11:18 -0700 Subject: [PATCH 037/193] fix incorrect array sizes on binary repack. (#23) --- suitesparse_graphblas/io/binary.py | 31 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/suitesparse_graphblas/io/binary.py b/suitesparse_graphblas/io/binary.py index 7c65120..70bea21 100644 --- a/suitesparse_graphblas/io/binary.py +++ b/suitesparse_graphblas/io/binary.py @@ -275,28 +275,25 @@ def binwrite(A, filename, comments=None, opener=Path.open): fwrite(buff(typesize, sizeof("size_t"))) fwrite(buff(is_iso, sizeof("bool"))) + Tsize = typesize[0] + iso = is_iso[0] + if is_hyper: - Ap_size[0] = (nvec[0] + 1) * Isize - Ah_size[0] = nvec[0] * Isize - Ai_size[0] = nvals[0] * Isize - Ax_size[0] = typesize[0] if is_iso[0] else nvals[0] * typesize[0] - fwrite(buff(Ap[0], Ap_size[0])) - fwrite(buff(Ah[0], Ah_size[0])) - fwrite(buff(Ai[0], Ai_size[0])) + fwrite(buff(Ap[0], (nvec[0] + 1) * Isize)) + fwrite(buff(Ah[0], nvec[0] * Isize)) + fwrite(buff(Ai[0], nvals[0] * Isize)) + Axsize = Tsize if iso else nvals[0] * Tsize elif is_sparse: - Ap_size[0] = (nvec[0] + 1) * Isize - Ai_size[0] = nvals[0] * Isize - Ax_size[0] = typesize[0] if is_iso[0] else nvals[0] * typesize[0] - fwrite(buff(Ap[0], Ap_size[0])) - fwrite(buff(Ai[0], Ai_size[0])) + fwrite(buff(Ap[0], (nvec[0] + 1) * Isize)) + fwrite(buff(Ai[0], nvals[0] * Isize)) + Axsize = Tsize if iso else nvals[0] * Tsize elif is_bitmap: - Ab_size[0] = nrows[0] * ncols[0] * ffi.sizeof("int8_t") - Ax_size[0] = typesize[0] if is_iso[0] else nrows[0] * ncols[0] * typesize[0] - fwrite(buff(Ab[0], Ab_size[0])) + fwrite(buff(Ab[0], nrows[0] * ncols[0] * ffi.sizeof("int8_t"))) + Axsize = Tsize if iso else nrows[0] * ncols[0] * Tsize else: - Ax_size[0] = typesize[0] if is_iso[0] else nrows[0] * ncols[0] * typesize[0] + Axsize = Tsize if iso else nrows[0] * ncols[0] * Tsize - fwrite(buff(Ax[0], Ax_size[0])) + fwrite(buff(Ax[0], Axsize)) if by_col and is_hyper: check_status( From 6e29bb417e245c7dd05e22775172e5c3abc51957 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Wed, 6 Oct 2021 14:57:22 -0500 Subject: [PATCH 038/193] Updated to SS:GB v6.0.0.alpha11 --- setup.cfg | 7 + setup.py | 13 +- suitesparse_graphblas/__init__.py | 4 +- suitesparse_graphblas/build.py | 1 + suitesparse_graphblas/create_headers.py | 18 +- suitesparse_graphblas/io/binary.py | 5 +- suitesparse_graphblas/matrix.py | 6 +- suitesparse_graphblas/scalar.py | 7 +- suitesparse_graphblas/suitesparse_graphblas.h | 416 ++++++++++++++---- .../suitesparse_graphblas_no_complex.h | 396 +++++++++++++---- suitesparse_graphblas/tests/conftest.py | 1 + suitesparse_graphblas/tests/test_doctest.py | 7 +- .../tests/test_exceptions.py | 9 +- .../tests/test_initialize.py | 3 +- suitesparse_graphblas/tests/test_io.py | 30 +- suitesparse_graphblas/tests/test_package.py | 2 +- suitesparse_graphblas/utils.pxd | 3 +- suitesparse_graphblas/utils.pyx | 13 +- suitesparse_graphblas/vector.py | 6 +- 19 files changed, 728 insertions(+), 219 deletions(-) diff --git a/setup.cfg b/setup.cfg index c6637a3..39f66e3 100644 --- a/setup.cfg +++ b/setup.cfg @@ -35,3 +35,10 @@ parentdir_prefix=suitesparse_graphblas- [tool:pytest] testpaths = suitesparse_graphblas/tests +[isort] +sections = FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER +profile = black +skip_gitignore = true +float_to_top = true +default_section = THIRDPARTY +known_first_party = suitesparse_graphblas diff --git a/setup.py b/setup.py index a7660a2..8ce3c2f 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,12 @@ -from setuptools import setup, find_packages, Extension +import os +import sys from glob import glob +import numpy as np +from setuptools import Extension, find_packages, setup + +import versioneer + try: from Cython.Build import cythonize from Cython.Compiler.Options import get_directive_defaults @@ -8,10 +14,7 @@ use_cython = True except ImportError: use_cython = False -import numpy as np -import os -import sys -import versioneer + is_win = sys.platform.startswith("win") define_macros = [("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")] diff --git a/suitesparse_graphblas/__init__.py b/suitesparse_graphblas/__init__.py index 87e045b..e0bc953 100644 --- a/suitesparse_graphblas/__init__.py +++ b/suitesparse_graphblas/__init__.py @@ -1,7 +1,7 @@ -from ._graphblas import ffi, lib # noqa +from . import exceptions as ex from . import utils +from ._graphblas import ffi, lib # noqa from ._version import get_versions -from . import exceptions as ex def is_initialized(): diff --git a/suitesparse_graphblas/build.py b/suitesparse_graphblas/build.py index d4a3daf..9a2df43 100644 --- a/suitesparse_graphblas/build.py +++ b/suitesparse_graphblas/build.py @@ -1,5 +1,6 @@ import os import sys + from cffi import FFI is_win = sys.platform.startswith("win") diff --git a/suitesparse_graphblas/create_headers.py b/suitesparse_graphblas/create_headers.py index 3b01bb6..6bc1a5a 100644 --- a/suitesparse_graphblas/create_headers.py +++ b/suitesparse_graphblas/create_headers.py @@ -27,6 +27,7 @@ import shutil import subprocess import sys + import pycparser from pycparser import c_ast, c_generator, parse_file @@ -289,6 +290,13 @@ def groupby(index, seq): "GxB_BEGIN", "GxB_END", "GxB_INC", + "GxB_FAST_IMPORT", + "GxB_MAX_NAME_LEN", + "GxB_COMPRESSION_DEFAULT", + "GxB_COMPRESSION_INTEL", + "GxB_COMPRESSION_LZ4", + "GxB_COMPRESSION_LZ4HC", + "GxB_COMPRESSION_NONE", } CHAR_DEFINES = { @@ -579,7 +587,7 @@ def handle_function_node(node): group = "matrix" elif "GrB_Vector" in text: group = "vector" - elif "GxB_Scalar" in text: + elif "GxB_Scalar" in text or "GrB_Scalar" in text: group = "scalar" else: group = node.name.split("_", 2)[1] @@ -596,6 +604,7 @@ def handle_function_node(node): "Semiring": "semiring", "Type": "type", "UnaryOp": "unary", + "IndexUnaryOp": "indexunary", # "everything else" is "core" "getVersion": "core", "Global": "core", @@ -603,6 +612,7 @@ def handle_function_node(node): "finalize": "core", "init": "core", "wait": "core", + "deserialize": "core", }[group] return { "name": node.name, @@ -807,8 +817,12 @@ def main(): print("Step 6: check #define definitions") with open(graphblas_h) as f: text = f.read() + define_lines = re.compile(r".*?#define\s+\w+\s+") define_pattern = re.compile(r"#define\s+\w+\s+") - defines = {x[len("#define") :].strip() for x in define_pattern.findall(text)} + defines = set() + for line in define_lines.findall(text): + line = line.split("//")[0].split("/*")[0] + defines.update(x[len("#define") :].strip() for x in define_pattern.findall(line)) extra_defines = (DEFINES | CHAR_DEFINES) - defines if extra_defines: # Should this raise? If it's a problem, it will raise when compiling. diff --git a/suitesparse_graphblas/io/binary.py b/suitesparse_graphblas/io/binary.py index 70bea21..410b769 100644 --- a/suitesparse_graphblas/io/binary.py +++ b/suitesparse_graphblas/io/binary.py @@ -1,8 +1,9 @@ -from pathlib import Path from ctypes.util import find_library -from suitesparse_graphblas import ffi, lib, check_status, matrix, __version__ +from pathlib import Path + from cffi import FFI +from suitesparse_graphblas import __version__, check_status, ffi, lib, matrix stdffi = FFI() stdffi.cdef( diff --git a/suitesparse_graphblas/matrix.py b/suitesparse_graphblas/matrix.py index dd73669..bc482af 100644 --- a/suitesparse_graphblas/matrix.py +++ b/suitesparse_graphblas/matrix.py @@ -1,8 +1,4 @@ -from suitesparse_graphblas import ( - lib, - ffi, - check_status, -) +from suitesparse_graphblas import check_status, ffi, lib def free(A): diff --git a/suitesparse_graphblas/scalar.py b/suitesparse_graphblas/scalar.py index 548e3ba..c0d5747 100644 --- a/suitesparse_graphblas/scalar.py +++ b/suitesparse_graphblas/scalar.py @@ -1,9 +1,4 @@ -from suitesparse_graphblas import ( - lib, - ffi, - check_status, - exceptions, -) +from suitesparse_graphblas import check_status, exceptions, ffi, lib def free(v): diff --git a/suitesparse_graphblas/suitesparse_graphblas.h b/suitesparse_graphblas/suitesparse_graphblas.h index ceb226f..ecdf84a 100644 --- a/suitesparse_graphblas/suitesparse_graphblas.h +++ b/suitesparse_graphblas/suitesparse_graphblas.h @@ -2,8 +2,10 @@ /* GrB typedefs */ typedef struct GB_BinaryOp_opaque *GrB_BinaryOp; typedef struct GB_Descriptor_opaque *GrB_Descriptor; +typedef struct GB_IndexUnaryOp_opaque *GrB_IndexUnaryOp; typedef struct GB_Matrix_opaque *GrB_Matrix; typedef struct GB_Monoid_opaque *GrB_Monoid; +typedef struct GB_Scalar_opaque *GrB_Scalar; typedef struct GB_Semiring_opaque *GrB_Semiring; typedef struct GB_Type_opaque *GrB_Type; typedef struct GB_UnaryOp_opaque *GrB_UnaryOp; @@ -17,8 +19,9 @@ typedef struct GB_Scalar_opaque *GxB_Scalar; typedef struct GB_SelectOp_opaque *GxB_SelectOp; /* GxB typedefs (functions) */ -typedef bool (*GxB_select_function)(GrB_Index i, GrB_Index j, const void *x, const void *thunk); +typedef bool (*GxB_select_function)(int64_t i, int64_t j, const void *x, const void *thunk); typedef void (*GxB_binary_function)(void *, const void *, const void *); +typedef void (*GxB_index_unary_function)(void *z, const void *x, int64_t i, int64_t j, const void *thunk); typedef void (*GxB_unary_function)(void *, const void *); /* GrB enums */ @@ -33,7 +36,9 @@ typedef enum GxB_DESCRIPTOR_GPU_CONTROL = 21, GxB_DESCRIPTOR_GPU_CHUNK = 22, GxB_AxB_METHOD = 1000, - GxB_SORT = 35 + GxB_SORT = 35, + GxB_COMPRESSION = 36, + GxB_IMPORT = 37 } GrB_Desc_Field; typedef enum @@ -48,25 +53,37 @@ typedef enum GxB_AxB_GUSTAVSON = 1001, GxB_AxB_DOT = 1003, GxB_AxB_HASH = 1004, - GxB_AxB_SAXPY = 1005 + GxB_AxB_SAXPY = 1005, + GxB_SECURE_IMPORT = 502 } GrB_Desc_Value; +typedef enum +{ + GrB_CSR_FORMAT = 0, + GrB_CSC_FORMAT = 1, + GrB_COO_FORMAT = 2, + GrB_DENSE_ROW_FORMAT = 3, + GrB_DENSE_COL_FORMAT = 4 +} GrB_Format; + typedef enum { GrB_SUCCESS = 0, GrB_NO_VALUE = 1, - GrB_UNINITIALIZED_OBJECT = 2, - GrB_INVALID_OBJECT = 3, - GrB_NULL_POINTER = 4, - GrB_INVALID_VALUE = 5, - GrB_INVALID_INDEX = 6, - GrB_DOMAIN_MISMATCH = 7, - GrB_DIMENSION_MISMATCH = 8, - GrB_OUTPUT_NOT_EMPTY = 9, - GrB_OUT_OF_MEMORY = 10, - GrB_INSUFFICIENT_SPACE = 11, - GrB_INDEX_OUT_OF_BOUNDS = 12, - GrB_PANIC = 13 + GrB_UNINITIALIZED_OBJECT = -1, + GrB_NULL_POINTER = -2, + GrB_INVALID_VALUE = -3, + GrB_INVALID_INDEX = -4, + GrB_DOMAIN_MISMATCH = -5, + GrB_DIMENSION_MISMATCH = -6, + GrB_OUTPUT_NOT_EMPTY = -7, + GrB_NOT_IMPLEMENTED = -8, + GrB_PANIC = -101, + GrB_OUT_OF_MEMORY = -102, + GrB_INSUFFICIENT_SPACE = -103, + GrB_INVALID_OBJECT = -104, + GrB_INDEX_OUT_OF_BOUNDS = -105, + GrB_EMPTY_OBJECT = -106 } GrB_Info; typedef enum @@ -75,6 +92,12 @@ typedef enum GrB_BLOCKING = 1 } GrB_Mode; +typedef enum +{ + GrB_COMPLETE = 0, + GrB_MATERIALIZE = 1 +} GrB_WaitMode; + /* GxB enums */ typedef enum { @@ -355,6 +378,86 @@ extern GrB_Descriptor GrB_DESC_ST1; extern GrB_Descriptor GrB_DESC_T0; extern GrB_Descriptor GrB_DESC_T0T1; extern GrB_Descriptor GrB_DESC_T1; +extern GrB_IndexUnaryOp GrB_COLGT_INT64; +extern GrB_IndexUnaryOp GrB_COLINDEX_INT32; +extern GrB_IndexUnaryOp GrB_COLINDEX_INT64; +extern GrB_IndexUnaryOp GrB_COLLE_INT64; +extern GrB_IndexUnaryOp GrB_DIAGINDEX_INT32; +extern GrB_IndexUnaryOp GrB_DIAGINDEX_INT64; +extern GrB_IndexUnaryOp GrB_DIAG_INT64; +extern GrB_IndexUnaryOp GrB_OFFDIAG_INT64; +extern GrB_IndexUnaryOp GrB_ROWGT_INT64; +extern GrB_IndexUnaryOp GrB_ROWINDEX_INT32; +extern GrB_IndexUnaryOp GrB_ROWINDEX_INT64; +extern GrB_IndexUnaryOp GrB_ROWLE_INT64; +extern GrB_IndexUnaryOp GrB_TRIL_INT64; +extern GrB_IndexUnaryOp GrB_TRIU_INT64; +extern GrB_IndexUnaryOp GrB_VALUEEQ_BOOL; +extern GrB_IndexUnaryOp GrB_VALUEEQ_FP32; +extern GrB_IndexUnaryOp GrB_VALUEEQ_FP64; +extern GrB_IndexUnaryOp GrB_VALUEEQ_INT8; +extern GrB_IndexUnaryOp GrB_VALUEEQ_INT16; +extern GrB_IndexUnaryOp GrB_VALUEEQ_INT32; +extern GrB_IndexUnaryOp GrB_VALUEEQ_INT64; +extern GrB_IndexUnaryOp GrB_VALUEEQ_UINT8; +extern GrB_IndexUnaryOp GrB_VALUEEQ_UINT16; +extern GrB_IndexUnaryOp GrB_VALUEEQ_UINT32; +extern GrB_IndexUnaryOp GrB_VALUEEQ_UINT64; +extern GrB_IndexUnaryOp GrB_VALUEGE_BOOL; +extern GrB_IndexUnaryOp GrB_VALUEGE_FP32; +extern GrB_IndexUnaryOp GrB_VALUEGE_FP64; +extern GrB_IndexUnaryOp GrB_VALUEGE_INT8; +extern GrB_IndexUnaryOp GrB_VALUEGE_INT16; +extern GrB_IndexUnaryOp GrB_VALUEGE_INT32; +extern GrB_IndexUnaryOp GrB_VALUEGE_INT64; +extern GrB_IndexUnaryOp GrB_VALUEGE_UINT8; +extern GrB_IndexUnaryOp GrB_VALUEGE_UINT16; +extern GrB_IndexUnaryOp GrB_VALUEGE_UINT32; +extern GrB_IndexUnaryOp GrB_VALUEGE_UINT64; +extern GrB_IndexUnaryOp GrB_VALUEGT_BOOL; +extern GrB_IndexUnaryOp GrB_VALUEGT_FP32; +extern GrB_IndexUnaryOp GrB_VALUEGT_FP64; +extern GrB_IndexUnaryOp GrB_VALUEGT_INT8; +extern GrB_IndexUnaryOp GrB_VALUEGT_INT16; +extern GrB_IndexUnaryOp GrB_VALUEGT_INT32; +extern GrB_IndexUnaryOp GrB_VALUEGT_INT64; +extern GrB_IndexUnaryOp GrB_VALUEGT_UINT8; +extern GrB_IndexUnaryOp GrB_VALUEGT_UINT16; +extern GrB_IndexUnaryOp GrB_VALUEGT_UINT32; +extern GrB_IndexUnaryOp GrB_VALUEGT_UINT64; +extern GrB_IndexUnaryOp GrB_VALUELE_BOOL; +extern GrB_IndexUnaryOp GrB_VALUELE_FP32; +extern GrB_IndexUnaryOp GrB_VALUELE_FP64; +extern GrB_IndexUnaryOp GrB_VALUELE_INT8; +extern GrB_IndexUnaryOp GrB_VALUELE_INT16; +extern GrB_IndexUnaryOp GrB_VALUELE_INT32; +extern GrB_IndexUnaryOp GrB_VALUELE_INT64; +extern GrB_IndexUnaryOp GrB_VALUELE_UINT8; +extern GrB_IndexUnaryOp GrB_VALUELE_UINT16; +extern GrB_IndexUnaryOp GrB_VALUELE_UINT32; +extern GrB_IndexUnaryOp GrB_VALUELE_UINT64; +extern GrB_IndexUnaryOp GrB_VALUELT_BOOL; +extern GrB_IndexUnaryOp GrB_VALUELT_FP32; +extern GrB_IndexUnaryOp GrB_VALUELT_FP64; +extern GrB_IndexUnaryOp GrB_VALUELT_INT8; +extern GrB_IndexUnaryOp GrB_VALUELT_INT16; +extern GrB_IndexUnaryOp GrB_VALUELT_INT32; +extern GrB_IndexUnaryOp GrB_VALUELT_INT64; +extern GrB_IndexUnaryOp GrB_VALUELT_UINT8; +extern GrB_IndexUnaryOp GrB_VALUELT_UINT16; +extern GrB_IndexUnaryOp GrB_VALUELT_UINT32; +extern GrB_IndexUnaryOp GrB_VALUELT_UINT64; +extern GrB_IndexUnaryOp GrB_VALUENE_BOOL; +extern GrB_IndexUnaryOp GrB_VALUENE_FP32; +extern GrB_IndexUnaryOp GrB_VALUENE_FP64; +extern GrB_IndexUnaryOp GrB_VALUENE_INT8; +extern GrB_IndexUnaryOp GrB_VALUENE_INT16; +extern GrB_IndexUnaryOp GrB_VALUENE_INT32; +extern GrB_IndexUnaryOp GrB_VALUENE_INT64; +extern GrB_IndexUnaryOp GrB_VALUENE_UINT8; +extern GrB_IndexUnaryOp GrB_VALUENE_UINT16; +extern GrB_IndexUnaryOp GrB_VALUENE_UINT32; +extern GrB_IndexUnaryOp GrB_VALUENE_UINT64; extern GrB_Monoid GrB_LAND_MONOID_BOOL; extern GrB_Monoid GrB_LOR_MONOID_BOOL; extern GrB_Monoid GrB_LXNOR_MONOID_BOOL; @@ -658,6 +761,7 @@ extern GrB_BinaryOp GxB_FMOD_FP32; extern GrB_BinaryOp GxB_FMOD_FP64; extern GrB_BinaryOp GxB_HYPOT_FP32; extern GrB_BinaryOp GxB_HYPOT_FP64; +extern GrB_BinaryOp GxB_IGNORE_DUP; extern GrB_BinaryOp GxB_ISEQ_BOOL; extern GrB_BinaryOp GxB_ISEQ_FC32; extern GrB_BinaryOp GxB_ISEQ_FC64; @@ -835,6 +939,10 @@ extern GrB_BinaryOp GxB_SECOND_FC32; extern GrB_BinaryOp GxB_SECOND_FC64; extern GrB_BinaryOp GxB_TIMES_FC32; extern GrB_BinaryOp GxB_TIMES_FC64; +extern GrB_IndexUnaryOp GxB_VALUEEQ_FC32; +extern GrB_IndexUnaryOp GxB_VALUEEQ_FC64; +extern GrB_IndexUnaryOp GxB_VALUENE_FC32; +extern GrB_IndexUnaryOp GxB_VALUENE_FC64; extern GrB_Monoid GxB_ANY_BOOL_MONOID; extern GrB_Monoid GxB_ANY_FC32_MONOID; extern GrB_Monoid GxB_ANY_FC64_MONOID; @@ -2500,7 +2608,7 @@ extern GxB_SelectOp GxB_TRIU; extern GrB_Info GrB_BinaryOp_error(const char **error, const GrB_BinaryOp op); extern GrB_Info GrB_BinaryOp_free(GrB_BinaryOp *binaryop); extern GrB_Info GrB_BinaryOp_new(GrB_BinaryOp *binaryop, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype); -extern GrB_Info GrB_BinaryOp_wait(GrB_BinaryOp *op); +extern GrB_Info GrB_BinaryOp_wait(GrB_BinaryOp op, GrB_WaitMode waitmode); /* core */ extern GrB_Info GrB_finalize(void); @@ -2512,7 +2620,13 @@ extern GrB_Info GrB_Descriptor_error(const char **error, const GrB_Descriptor d) extern GrB_Info GrB_Descriptor_free(GrB_Descriptor *descriptor); extern GrB_Info GrB_Descriptor_new(GrB_Descriptor *descriptor); extern GrB_Info GrB_Descriptor_set(GrB_Descriptor desc, GrB_Desc_Field field, GrB_Desc_Value val); -extern GrB_Info GrB_Descriptor_wait(GrB_Descriptor *desc); +extern GrB_Info GrB_Descriptor_wait(GrB_Descriptor desc, GrB_WaitMode waitmode); + +/* indexunary */ +extern GrB_Info GrB_IndexUnaryOp_error(const char **error, const GrB_IndexUnaryOp op); +extern GrB_Info GrB_IndexUnaryOp_free(GrB_IndexUnaryOp *op); +extern GrB_Info GrB_IndexUnaryOp_new(GrB_IndexUnaryOp *op, GxB_index_unary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ttype); +extern GrB_Info GrB_IndexUnaryOp_wait(GrB_IndexUnaryOp op, GrB_WaitMode waitmode); /* matrix */ extern GrB_Info GrB_Col_assign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); @@ -2525,6 +2639,7 @@ extern GrB_Info GrB_Matrix_apply_BinaryOp1st_INT8(GrB_Matrix C, const GrB_Matrix extern GrB_Info GrB_Matrix_apply_BinaryOp1st_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int16_t x, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_apply_BinaryOp1st_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int32_t x, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_apply_BinaryOp1st_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int64_t x, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_BinaryOp1st_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_apply_BinaryOp1st_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const void *x, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_apply_BinaryOp1st_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint8_t x, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_apply_BinaryOp1st_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint16_t x, const GrB_Matrix A, const GrB_Descriptor desc); @@ -2537,11 +2652,25 @@ extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT8(GrB_Matrix C, const GrB_Matrix extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, int16_t y, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, int32_t y, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, int64_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Scalar y, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const void *y, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, uint8_t y, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, uint16_t y, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, uint32_t y, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, uint64_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, bool thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, float thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, double thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int8_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int16_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int32_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int64_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const GrB_Scalar thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const void *thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint8_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint16_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint32_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint64_t thunk, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_assign(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_assign_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_assign_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); @@ -2550,6 +2679,7 @@ extern GrB_Info GrB_Matrix_assign_INT8(GrB_Matrix C, const GrB_Matrix Mask, cons extern GrB_Info GrB_Matrix_assign_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_assign_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_assign_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_assign_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_assign_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_assign_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_assign_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); @@ -2568,6 +2698,8 @@ extern GrB_Info GrB_Matrix_build_UINT16(GrB_Matrix C, const GrB_Index *I, const extern GrB_Info GrB_Matrix_build_UINT32(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const uint32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); extern GrB_Info GrB_Matrix_build_UINT64(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const uint64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); extern GrB_Info GrB_Matrix_clear(GrB_Matrix A); +extern GrB_Info GrB_Matrix_deserialize(GrB_Matrix *C, GrB_Type type, const void *blob, GrB_Index blob_size); +extern GrB_Info GrB_Matrix_diag(GrB_Matrix C, const GrB_Vector v, int64_t k); extern GrB_Info GrB_Matrix_dup(GrB_Matrix *C, const GrB_Matrix A); extern GrB_Info GrB_Matrix_eWiseAdd_BinaryOp(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_eWiseAdd_Monoid(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); @@ -2576,6 +2708,9 @@ extern GrB_Info GrB_Matrix_eWiseMult_BinaryOp(GrB_Matrix C, const GrB_Matrix Mas extern GrB_Info GrB_Matrix_eWiseMult_Monoid(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_eWiseMult_Semiring(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_error(const char **error, const GrB_Matrix A); +extern GrB_Info GrB_Matrix_export(GrB_Index *Ap, GrB_Index *Ai, void *Ax, GrB_Format format, GrB_Matrix A); +extern GrB_Info GrB_Matrix_exportHint(GrB_Format *format, GrB_Matrix A); +extern GrB_Info GrB_Matrix_exportSize(GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); extern GrB_Info GrB_Matrix_extract(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_extractElement_BOOL(bool *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); extern GrB_Info GrB_Matrix_extractElement_FP32(float *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); @@ -2584,6 +2719,7 @@ extern GrB_Info GrB_Matrix_extractElement_INT8(int8_t *x, const GrB_Matrix A, Gr extern GrB_Info GrB_Matrix_extractElement_INT16(int16_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); extern GrB_Info GrB_Matrix_extractElement_INT32(int32_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); extern GrB_Info GrB_Matrix_extractElement_INT64(int64_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +extern GrB_Info GrB_Matrix_extractElement_Scalar(GrB_Scalar x, const GrB_Matrix A, GrB_Index i, GrB_Index j); extern GrB_Info GrB_Matrix_extractElement_UDT(void *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); extern GrB_Info GrB_Matrix_extractElement_UINT8(uint8_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); extern GrB_Info GrB_Matrix_extractElement_UINT16(uint16_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); @@ -2602,6 +2738,7 @@ extern GrB_Info GrB_Matrix_extractTuples_UINT16(GrB_Index *I, GrB_Index *J, uint extern GrB_Info GrB_Matrix_extractTuples_UINT32(GrB_Index *I, GrB_Index *J, uint32_t *X, GrB_Index *nvals, const GrB_Matrix A); extern GrB_Info GrB_Matrix_extractTuples_UINT64(GrB_Index *I, GrB_Index *J, uint64_t *X, GrB_Index *nvals, const GrB_Matrix A); extern GrB_Info GrB_Matrix_free(GrB_Matrix *A); +extern GrB_Info GrB_Matrix_import(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const void *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); extern GrB_Info GrB_Matrix_kronecker_BinaryOp(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_kronecker_Monoid(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_kronecker_Semiring(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); @@ -2618,6 +2755,7 @@ extern GrB_Info GrB_Matrix_reduce_INT16(int16_t *c, const GrB_BinaryOp accum, co extern GrB_Info GrB_Matrix_reduce_INT32(int32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_reduce_INT64(int64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_reduce_Monoid(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_reduce_Scalar(GrB_Scalar c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_reduce_UDT(void *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_reduce_UINT8(uint8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_reduce_UINT16(uint16_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); @@ -2625,6 +2763,21 @@ extern GrB_Info GrB_Matrix_reduce_UINT32(uint32_t *c, const GrB_BinaryOp accum, extern GrB_Info GrB_Matrix_reduce_UINT64(uint64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_removeElement(GrB_Matrix C, GrB_Index i, GrB_Index j); extern GrB_Info GrB_Matrix_resize(GrB_Matrix C, GrB_Index nrows_new, GrB_Index ncols_new); +extern GrB_Info GrB_Matrix_select_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, bool thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, float thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, double thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int8_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int16_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int32_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int64_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const GrB_Scalar thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const void *thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint8_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint16_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint32_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint64_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_serialize(void *blob, GrB_Index *blob_size_handle, GrB_Matrix A); +extern GrB_Info GrB_Matrix_serializeSize(GrB_Index *blob_size_handle, GrB_Matrix A); extern GrB_Info GrB_Matrix_setElement_BOOL(GrB_Matrix C, bool x, GrB_Index i, GrB_Index j); extern GrB_Info GrB_Matrix_setElement_FP32(GrB_Matrix C, float x, GrB_Index i, GrB_Index j); extern GrB_Info GrB_Matrix_setElement_FP64(GrB_Matrix C, double x, GrB_Index i, GrB_Index j); @@ -2632,12 +2785,13 @@ extern GrB_Info GrB_Matrix_setElement_INT8(GrB_Matrix C, int8_t x, GrB_Index i, extern GrB_Info GrB_Matrix_setElement_INT16(GrB_Matrix C, int16_t x, GrB_Index i, GrB_Index j); extern GrB_Info GrB_Matrix_setElement_INT32(GrB_Matrix C, int32_t x, GrB_Index i, GrB_Index j); extern GrB_Info GrB_Matrix_setElement_INT64(GrB_Matrix C, int64_t x, GrB_Index i, GrB_Index j); +extern GrB_Info GrB_Matrix_setElement_Scalar(GrB_Matrix C, GrB_Scalar x, GrB_Index i, GrB_Index j); extern GrB_Info GrB_Matrix_setElement_UDT(GrB_Matrix C, void *x, GrB_Index i, GrB_Index j); extern GrB_Info GrB_Matrix_setElement_UINT8(GrB_Matrix C, uint8_t x, GrB_Index i, GrB_Index j); extern GrB_Info GrB_Matrix_setElement_UINT16(GrB_Matrix C, uint16_t x, GrB_Index i, GrB_Index j); extern GrB_Info GrB_Matrix_setElement_UINT32(GrB_Matrix C, uint32_t x, GrB_Index i, GrB_Index j); extern GrB_Info GrB_Matrix_setElement_UINT64(GrB_Matrix C, uint64_t x, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_wait(GrB_Matrix *A); +extern GrB_Info GrB_Matrix_wait(GrB_Matrix A, GrB_WaitMode waitmode); extern GrB_Info GrB_Row_assign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, GrB_Index i, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GrB_mxm(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); extern GrB_Info GrB_mxv(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Vector u, const GrB_Descriptor desc); @@ -2659,25 +2813,58 @@ extern GrB_Info GrB_Monoid_new_UINT8(GrB_Monoid *monoid, GrB_BinaryOp op, uint8_ extern GrB_Info GrB_Monoid_new_UINT16(GrB_Monoid *monoid, GrB_BinaryOp op, uint16_t identity); extern GrB_Info GrB_Monoid_new_UINT32(GrB_Monoid *monoid, GrB_BinaryOp op, uint32_t identity); extern GrB_Info GrB_Monoid_new_UINT64(GrB_Monoid *monoid, GrB_BinaryOp op, uint64_t identity); -extern GrB_Info GrB_Monoid_wait(GrB_Monoid *monoid); +extern GrB_Info GrB_Monoid_wait(GrB_Monoid monoid, GrB_WaitMode waitmode); + +/* scalar */ +extern GrB_Info GrB_Scalar_clear(GrB_Scalar s); +extern GrB_Info GrB_Scalar_dup(GrB_Scalar *s, const GrB_Scalar t); +extern GrB_Info GrB_Scalar_error(const char **error, const GrB_Scalar s); +extern GrB_Info GrB_Scalar_extractElement_BOOL(bool *x, const GrB_Scalar s); +extern GrB_Info GrB_Scalar_extractElement_FP32(float *x, const GrB_Scalar s); +extern GrB_Info GrB_Scalar_extractElement_FP64(double *x, const GrB_Scalar s); +extern GrB_Info GrB_Scalar_extractElement_INT8(int8_t *x, const GrB_Scalar s); +extern GrB_Info GrB_Scalar_extractElement_INT16(int16_t *x, const GrB_Scalar s); +extern GrB_Info GrB_Scalar_extractElement_INT32(int32_t *x, const GrB_Scalar s); +extern GrB_Info GrB_Scalar_extractElement_INT64(int64_t *x, const GrB_Scalar s); +extern GrB_Info GrB_Scalar_extractElement_UDT(void *x, const GrB_Scalar s); +extern GrB_Info GrB_Scalar_extractElement_UINT8(uint8_t *x, const GrB_Scalar s); +extern GrB_Info GrB_Scalar_extractElement_UINT16(uint16_t *x, const GrB_Scalar s); +extern GrB_Info GrB_Scalar_extractElement_UINT32(uint32_t *x, const GrB_Scalar s); +extern GrB_Info GrB_Scalar_extractElement_UINT64(uint64_t *x, const GrB_Scalar s); +extern GrB_Info GrB_Scalar_free(GrB_Scalar *s); +extern GrB_Info GrB_Scalar_new(GrB_Scalar *s, GrB_Type type); +extern GrB_Info GrB_Scalar_nvals(GrB_Index *nvals, const GrB_Scalar s); +extern GrB_Info GrB_Scalar_setElement_BOOL(GrB_Scalar s, bool x); +extern GrB_Info GrB_Scalar_setElement_FP32(GrB_Scalar s, float x); +extern GrB_Info GrB_Scalar_setElement_FP64(GrB_Scalar s, double x); +extern GrB_Info GrB_Scalar_setElement_INT8(GrB_Scalar s, int8_t x); +extern GrB_Info GrB_Scalar_setElement_INT16(GrB_Scalar s, int16_t x); +extern GrB_Info GrB_Scalar_setElement_INT32(GrB_Scalar s, int32_t x); +extern GrB_Info GrB_Scalar_setElement_INT64(GrB_Scalar s, int64_t x); +extern GrB_Info GrB_Scalar_setElement_UDT(GrB_Scalar s, void *x); +extern GrB_Info GrB_Scalar_setElement_UINT8(GrB_Scalar s, uint8_t x); +extern GrB_Info GrB_Scalar_setElement_UINT16(GrB_Scalar s, uint16_t x); +extern GrB_Info GrB_Scalar_setElement_UINT32(GrB_Scalar s, uint32_t x); +extern GrB_Info GrB_Scalar_setElement_UINT64(GrB_Scalar s, uint64_t x); +extern GrB_Info GrB_Scalar_wait(GrB_Scalar s, GrB_WaitMode waitmode); /* semiring */ extern GrB_Info GrB_Semiring_error(const char **error, const GrB_Semiring semiring); extern GrB_Info GrB_Semiring_free(GrB_Semiring *semiring); extern GrB_Info GrB_Semiring_new(GrB_Semiring *semiring, GrB_Monoid add, GrB_BinaryOp multiply); -extern GrB_Info GrB_Semiring_wait(GrB_Semiring *semiring); +extern GrB_Info GrB_Semiring_wait(GrB_Semiring semiring, GrB_WaitMode waitmode); /* type */ extern GrB_Info GrB_Type_error(const char **error, const GrB_Type type); extern GrB_Info GrB_Type_free(GrB_Type *type); extern GrB_Info GrB_Type_new(GrB_Type *type, size_t sizeof_ctype); -extern GrB_Info GrB_Type_wait(GrB_Type *type); +extern GrB_Info GrB_Type_wait(GrB_Type type, GrB_WaitMode waitmode); /* unary */ extern GrB_Info GrB_UnaryOp_error(const char **error, const GrB_UnaryOp op); extern GrB_Info GrB_UnaryOp_free(GrB_UnaryOp *unaryop); extern GrB_Info GrB_UnaryOp_new(GrB_UnaryOp *unaryop, GxB_unary_function function, GrB_Type ztype, GrB_Type xtype); -extern GrB_Info GrB_UnaryOp_wait(GrB_UnaryOp *op); +extern GrB_Info GrB_UnaryOp_wait(GrB_UnaryOp op, GrB_WaitMode waitmode); /* vector */ extern GrB_Info GrB_Vector_apply(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_UnaryOp op, const GrB_Vector u, const GrB_Descriptor desc); @@ -2688,6 +2875,7 @@ extern GrB_Info GrB_Vector_apply_BinaryOp1st_INT8(GrB_Vector w, const GrB_Vector extern GrB_Info GrB_Vector_apply_BinaryOp1st_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int16_t x, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_apply_BinaryOp1st_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int32_t x, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_apply_BinaryOp1st_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int64_t x, const GrB_Vector u, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_BinaryOp1st_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_apply_BinaryOp1st_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const void *x, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_apply_BinaryOp1st_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint8_t x, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_apply_BinaryOp1st_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint16_t x, const GrB_Vector u, const GrB_Descriptor desc); @@ -2700,11 +2888,25 @@ extern GrB_Info GrB_Vector_apply_BinaryOp2nd_INT8(GrB_Vector w, const GrB_Vector extern GrB_Info GrB_Vector_apply_BinaryOp2nd_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, int16_t y, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_apply_BinaryOp2nd_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, int32_t y, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_apply_BinaryOp2nd_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, int64_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_BinaryOp2nd_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const GrB_Scalar y, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_apply_BinaryOp2nd_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const void *y, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, uint8_t y, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, uint16_t y, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, uint32_t y, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, uint64_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, bool thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, float thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, double thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int8_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int16_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int32_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int64_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const GrB_Scalar thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const void *thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint8_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint16_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint32_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint64_t thunk, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_assign(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_assign_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_assign_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); @@ -2713,6 +2915,7 @@ extern GrB_Info GrB_Vector_assign_INT8(GrB_Vector w, const GrB_Vector mask, cons extern GrB_Info GrB_Vector_assign_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_assign_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_assign_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_assign_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_assign_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_assign_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_assign_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); @@ -2731,6 +2934,7 @@ extern GrB_Info GrB_Vector_build_UINT16(GrB_Vector w, const GrB_Index *I, const extern GrB_Info GrB_Vector_build_UINT32(GrB_Vector w, const GrB_Index *I, const uint32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); extern GrB_Info GrB_Vector_build_UINT64(GrB_Vector w, const GrB_Index *I, const uint64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); extern GrB_Info GrB_Vector_clear(GrB_Vector v); +extern GrB_Info GrB_Vector_deserialize(GrB_Vector *w, GrB_Type type, const void *blob, GrB_Index blob_size); extern GrB_Info GrB_Vector_dup(GrB_Vector *w, const GrB_Vector u); extern GrB_Info GrB_Vector_eWiseAdd_BinaryOp(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_eWiseAdd_Monoid(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); @@ -2747,6 +2951,7 @@ extern GrB_Info GrB_Vector_extractElement_INT8(int8_t *x, const GrB_Vector v, Gr extern GrB_Info GrB_Vector_extractElement_INT16(int16_t *x, const GrB_Vector v, GrB_Index i); extern GrB_Info GrB_Vector_extractElement_INT32(int32_t *x, const GrB_Vector v, GrB_Index i); extern GrB_Info GrB_Vector_extractElement_INT64(int64_t *x, const GrB_Vector v, GrB_Index i); +extern GrB_Info GrB_Vector_extractElement_Scalar(GrB_Scalar x, const GrB_Vector v, GrB_Index i); extern GrB_Info GrB_Vector_extractElement_UDT(void *x, const GrB_Vector v, GrB_Index i); extern GrB_Info GrB_Vector_extractElement_UINT8(uint8_t *x, const GrB_Vector v, GrB_Index i); extern GrB_Info GrB_Vector_extractElement_UINT16(uint16_t *x, const GrB_Vector v, GrB_Index i); @@ -2774,6 +2979,7 @@ extern GrB_Info GrB_Vector_reduce_INT8(int8_t *c, const GrB_BinaryOp accum, cons extern GrB_Info GrB_Vector_reduce_INT16(int16_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_reduce_INT32(int32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_reduce_INT64(int64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_reduce_Scalar(GrB_Scalar c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_reduce_UDT(void *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_reduce_UINT8(uint8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_reduce_UINT16(uint16_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); @@ -2781,6 +2987,21 @@ extern GrB_Info GrB_Vector_reduce_UINT32(uint32_t *c, const GrB_BinaryOp accum, extern GrB_Info GrB_Vector_reduce_UINT64(uint64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_removeElement(GrB_Vector v, GrB_Index i); extern GrB_Info GrB_Vector_resize(GrB_Vector w, GrB_Index nrows_new); +extern GrB_Info GrB_Vector_select_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, bool thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, float thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, double thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int8_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int16_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int32_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int64_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const GrB_Scalar thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const void *thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint8_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint16_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint32_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint64_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_serialize(void *blob, GrB_Index *blob_size_handle, GrB_Vector u); +extern GrB_Info GrB_Vector_serializeSize(GrB_Index *blob_size_handle, GrB_Vector u); extern GrB_Info GrB_Vector_setElement_BOOL(GrB_Vector w, bool x, GrB_Index i); extern GrB_Info GrB_Vector_setElement_FP32(GrB_Vector w, float x, GrB_Index i); extern GrB_Info GrB_Vector_setElement_FP64(GrB_Vector w, double x, GrB_Index i); @@ -2788,44 +3009,41 @@ extern GrB_Info GrB_Vector_setElement_INT8(GrB_Vector w, int8_t x, GrB_Index i); extern GrB_Info GrB_Vector_setElement_INT16(GrB_Vector w, int16_t x, GrB_Index i); extern GrB_Info GrB_Vector_setElement_INT32(GrB_Vector w, int32_t x, GrB_Index i); extern GrB_Info GrB_Vector_setElement_INT64(GrB_Vector w, int64_t x, GrB_Index i); +extern GrB_Info GrB_Vector_setElement_Scalar(GrB_Vector w, GrB_Scalar x, GrB_Index i); extern GrB_Info GrB_Vector_setElement_UDT(GrB_Vector w, void *x, GrB_Index i); extern GrB_Info GrB_Vector_setElement_UINT8(GrB_Vector w, uint8_t x, GrB_Index i); extern GrB_Info GrB_Vector_setElement_UINT16(GrB_Vector w, uint16_t x, GrB_Index i); extern GrB_Info GrB_Vector_setElement_UINT32(GrB_Vector w, uint32_t x, GrB_Index i); extern GrB_Info GrB_Vector_setElement_UINT64(GrB_Vector w, uint64_t x, GrB_Index i); extern GrB_Info GrB_Vector_size(GrB_Index *n, const GrB_Vector v); -extern GrB_Info GrB_Vector_wait(GrB_Vector *v); +extern GrB_Info GrB_Vector_wait(GrB_Vector v, GrB_WaitMode waitmode); /*************** * GB functions * ***************/ -/* binary */ -extern GrB_Info GB_BinaryOp_new(GrB_BinaryOp *binaryop, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *name); - /* selectop */ extern GrB_Info GB_SelectOp_new(GxB_SelectOp *selectop, GxB_select_function function, GrB_Type xtype, GrB_Type ttype, const char *name); -/* type */ -extern GrB_Info GB_Type_new(GrB_Type *type, size_t sizeof_ctype, const char *name); - -/* unary */ -extern GrB_Info GB_UnaryOp_new(GrB_UnaryOp *unaryop, GxB_unary_function function, GrB_Type ztype, GrB_Type xtype, const char *name); - /**************** * GxB functions * ****************/ /* binary */ extern GrB_Info GxB_BinaryOp_fprint(GrB_BinaryOp binaryop, const char *name, GxB_Print_Level pr, FILE *f); +extern GrB_Info GxB_BinaryOp_new(GrB_BinaryOp *op, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *binop_name, const char *binop_defn); extern GrB_Info GxB_BinaryOp_xtype(GrB_Type *xtype, GrB_BinaryOp binaryop); +extern GrB_Info GxB_BinaryOp_xtype_name(char *type_name, const GrB_BinaryOp binaryop); extern GrB_Info GxB_BinaryOp_ytype(GrB_Type *ytype, GrB_BinaryOp binaryop); +extern GrB_Info GxB_BinaryOp_ytype_name(char *type_name, const GrB_BinaryOp binaryop); extern GrB_Info GxB_BinaryOp_ztype(GrB_Type *ztype, GrB_BinaryOp binaryop); +extern GrB_Info GxB_BinaryOp_ztype_name(char *type_name, const GrB_BinaryOp binaryop); /* core */ extern GrB_Info GxB_Global_Option_get(GxB_Option_Field field, ...); extern GrB_Info GxB_Global_Option_set(GxB_Option_Field field, ...); -extern GrB_Info GxB_init(GrB_Mode mode, void *(*user_malloc_function)(size_t), void *(*user_calloc_function)(size_t, size_t), void *(*user_realloc_function)(void *, size_t), void (*user_free_function)(void *), bool user_malloc_is_thread_safe); +extern GrB_Info GxB_deserialize_type_name(char *type_name, const void *blob, GrB_Index blob_size); +extern GrB_Info GxB_init(GrB_Mode mode, void *(*user_malloc_function)(size_t), void *(*user_calloc_function)(size_t, size_t), void *(*user_realloc_function)(void *, size_t), void (*user_free_function)(void *)); /* descriptor */ extern GrB_Info GxB_Desc_get(GrB_Descriptor desc, GrB_Desc_Field field, ...); @@ -2833,22 +3051,32 @@ extern GrB_Info GxB_Desc_set(GrB_Descriptor desc, GrB_Desc_Field field, ...); extern GrB_Info GxB_Descriptor_fprint(GrB_Descriptor descriptor, const char *name, GxB_Print_Level pr, FILE *f); extern GrB_Info GxB_Descriptor_get(GrB_Desc_Value *val, GrB_Descriptor desc, GrB_Desc_Field field); +/* indexunary */ +extern GrB_Info GxB_IndexUnaryOp_fprint(GrB_IndexUnaryOp op, const char *name, GxB_Print_Level pr, FILE *f); +extern GrB_Info GxB_IndexUnaryOp_new(GrB_IndexUnaryOp *op, GxB_index_unary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ttype, const char *idxop_name, const char *idxop_defn); +extern GrB_Info GxB_IndexUnaryOp_ttype_name(char *type_name, const GrB_IndexUnaryOp op); +extern GrB_Info GxB_IndexUnaryOp_xtype_name(char *type_name, const GrB_IndexUnaryOp op); +extern GrB_Info GxB_IndexUnaryOp_ztype_name(char *type_name, const GrB_IndexUnaryOp op); + /* matrix */ extern GrB_Info GxB_Col_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_Option_get(GrB_Matrix A, GxB_Option_Field field, ...); extern GrB_Info GxB_Matrix_Option_set(GrB_Matrix A, GxB_Option_Field field, ...); -extern GrB_Info GxB_Matrix_apply_BinaryOp1st(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GxB_Scalar x, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_apply_BinaryOp1st(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_apply_BinaryOp1st_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC32_t x, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_apply_BinaryOp1st_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC64_t x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_apply_BinaryOp2nd(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GxB_Scalar y, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_apply_BinaryOp2nd(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Scalar y, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_apply_BinaryOp2nd_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, GxB_FC32_t y, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_apply_BinaryOp2nd_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, GxB_FC64_t y, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_apply_IndexOp_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, GxB_FC32_t thunk, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_apply_IndexOp_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, GxB_FC64_t thunk, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_assign_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_assign_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_build_FC32(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const GxB_FC32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); extern GrB_Info GxB_Matrix_build_FC64(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const GxB_FC64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GxB_Matrix_build_Scalar(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, GxB_Scalar scalar, GrB_Index nvals); +extern GrB_Info GxB_Matrix_build_Scalar(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, GrB_Scalar scalar, GrB_Index nvals); extern GrB_Info GxB_Matrix_concat(GrB_Matrix C, const GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_deserialize(GrB_Matrix *C, GrB_Type type, const void *blob, GrB_Index blob_size, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_diag(GrB_Matrix C, const GrB_Vector v, int64_t k, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_export_BitmapC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_export_BitmapR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); @@ -2883,7 +3111,10 @@ extern GrB_Info GxB_Matrix_pack_HyperCSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index extern GrB_Info GxB_Matrix_pack_HyperCSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_reduce_FC32(GxB_FC32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_reduce_FC64(GxB_FC64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_select(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Matrix A, const GxB_Scalar Thunk, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_select(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Matrix A, const GrB_Scalar Thunk, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_select_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, GxB_FC32_t thunk, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_select_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, GxB_FC64_t thunk, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_serialize(void **blob_handle, GrB_Index *blob_size_handle, GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_setElement_FC32(GrB_Matrix C, GxB_FC32_t x, GrB_Index i, GrB_Index j); extern GrB_Info GxB_Matrix_setElement_FC64(GrB_Matrix C, GxB_FC64_t x, GrB_Index i, GrB_Index j); extern GrB_Info GxB_Matrix_split(GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Index *Tile_nrows, const GrB_Index *Tile_ncols, const GrB_Matrix A, const GrB_Descriptor desc); @@ -2897,12 +3128,14 @@ extern GrB_Info GxB_Matrix_subassign_INT8(GrB_Matrix C, const GrB_Matrix Mask, c extern GrB_Info GxB_Matrix_subassign_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_subassign_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_subassign_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_subassign_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_subassign_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_subassign_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_subassign_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_subassign_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_subassign_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_type(GrB_Type *type, const GrB_Matrix A); +extern GrB_Info GxB_Matrix_type_name(char *type_name, const GrB_Matrix A); extern GrB_Info GxB_Matrix_unpack_BitmapC(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_unpack_BitmapR(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_unpack_CSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); @@ -2937,44 +3170,44 @@ extern GrB_Info GxB_Monoid_terminal_new_UINT32(GrB_Monoid *monoid, GrB_BinaryOp extern GrB_Info GxB_Monoid_terminal_new_UINT64(GrB_Monoid *monoid, GrB_BinaryOp op, uint64_t identity, uint64_t terminal); /* scalar */ -extern GrB_Info GxB_Scalar_clear(GxB_Scalar s); -extern GrB_Info GxB_Scalar_dup(GxB_Scalar *s, const GxB_Scalar t); -extern GrB_Info GxB_Scalar_error(const char **error, const GxB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_BOOL(bool *x, const GxB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_FC32(GxB_FC32_t *x, const GxB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_FC64(GxB_FC64_t *x, const GxB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_FP32(float *x, const GxB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_FP64(double *x, const GxB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_INT8(int8_t *x, const GxB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_INT16(int16_t *x, const GxB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_INT32(int32_t *x, const GxB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_INT64(int64_t *x, const GxB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_UDT(void *x, const GxB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_UINT8(uint8_t *x, const GxB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_UINT16(uint16_t *x, const GxB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_UINT32(uint32_t *x, const GxB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_UINT64(uint64_t *x, const GxB_Scalar s); -extern GrB_Info GxB_Scalar_fprint(GxB_Scalar s, const char *name, GxB_Print_Level pr, FILE *f); -extern GrB_Info GxB_Scalar_free(GxB_Scalar *s); -extern GrB_Info GxB_Scalar_memoryUsage(size_t *size, const GxB_Scalar s); -extern GrB_Info GxB_Scalar_new(GxB_Scalar *s, GrB_Type type); -extern GrB_Info GxB_Scalar_nvals(GrB_Index *nvals, const GxB_Scalar s); -extern GrB_Info GxB_Scalar_setElement_BOOL(GxB_Scalar s, bool x); -extern GrB_Info GxB_Scalar_setElement_FC32(GxB_Scalar s, GxB_FC32_t x); -extern GrB_Info GxB_Scalar_setElement_FC64(GxB_Scalar s, GxB_FC64_t x); -extern GrB_Info GxB_Scalar_setElement_FP32(GxB_Scalar s, float x); -extern GrB_Info GxB_Scalar_setElement_FP64(GxB_Scalar s, double x); -extern GrB_Info GxB_Scalar_setElement_INT8(GxB_Scalar s, int8_t x); -extern GrB_Info GxB_Scalar_setElement_INT16(GxB_Scalar s, int16_t x); -extern GrB_Info GxB_Scalar_setElement_INT32(GxB_Scalar s, int32_t x); -extern GrB_Info GxB_Scalar_setElement_INT64(GxB_Scalar s, int64_t x); -extern GrB_Info GxB_Scalar_setElement_UDT(GxB_Scalar s, void *x); -extern GrB_Info GxB_Scalar_setElement_UINT8(GxB_Scalar s, uint8_t x); -extern GrB_Info GxB_Scalar_setElement_UINT16(GxB_Scalar s, uint16_t x); -extern GrB_Info GxB_Scalar_setElement_UINT32(GxB_Scalar s, uint32_t x); -extern GrB_Info GxB_Scalar_setElement_UINT64(GxB_Scalar s, uint64_t x); -extern GrB_Info GxB_Scalar_type(GrB_Type *type, const GxB_Scalar s); -extern GrB_Info GxB_Scalar_wait(GxB_Scalar *s); +extern GrB_Info GxB_Scalar_clear(GrB_Scalar s); +extern GrB_Info GxB_Scalar_dup(GrB_Scalar *s, const GrB_Scalar t); +extern GrB_Info GxB_Scalar_error(const char **error, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_extractElement_BOOL(bool *x, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_extractElement_FC32(GxB_FC32_t *x, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_extractElement_FC64(GxB_FC64_t *x, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_extractElement_FP32(float *x, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_extractElement_FP64(double *x, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_extractElement_INT8(int8_t *x, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_extractElement_INT16(int16_t *x, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_extractElement_INT32(int32_t *x, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_extractElement_INT64(int64_t *x, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_extractElement_UDT(void *x, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_extractElement_UINT8(uint8_t *x, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_extractElement_UINT16(uint16_t *x, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_extractElement_UINT32(uint32_t *x, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_extractElement_UINT64(uint64_t *x, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_fprint(GrB_Scalar s, const char *name, GxB_Print_Level pr, FILE *f); +extern GrB_Info GxB_Scalar_free(GrB_Scalar *s); +extern GrB_Info GxB_Scalar_memoryUsage(size_t *size, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_new(GrB_Scalar *s, GrB_Type type); +extern GrB_Info GxB_Scalar_nvals(GrB_Index *nvals, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_setElement_BOOL(GrB_Scalar s, bool x); +extern GrB_Info GxB_Scalar_setElement_FC32(GrB_Scalar s, GxB_FC32_t x); +extern GrB_Info GxB_Scalar_setElement_FC64(GrB_Scalar s, GxB_FC64_t x); +extern GrB_Info GxB_Scalar_setElement_FP32(GrB_Scalar s, float x); +extern GrB_Info GxB_Scalar_setElement_FP64(GrB_Scalar s, double x); +extern GrB_Info GxB_Scalar_setElement_INT8(GrB_Scalar s, int8_t x); +extern GrB_Info GxB_Scalar_setElement_INT16(GrB_Scalar s, int16_t x); +extern GrB_Info GxB_Scalar_setElement_INT32(GrB_Scalar s, int32_t x); +extern GrB_Info GxB_Scalar_setElement_INT64(GrB_Scalar s, int64_t x); +extern GrB_Info GxB_Scalar_setElement_UDT(GrB_Scalar s, void *x); +extern GrB_Info GxB_Scalar_setElement_UINT8(GrB_Scalar s, uint8_t x); +extern GrB_Info GxB_Scalar_setElement_UINT16(GrB_Scalar s, uint16_t x); +extern GrB_Info GxB_Scalar_setElement_UINT32(GrB_Scalar s, uint32_t x); +extern GrB_Info GxB_Scalar_setElement_UINT64(GrB_Scalar s, uint64_t x); +extern GrB_Info GxB_Scalar_type(GrB_Type *type, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_type_name(char *type_name, const GrB_Scalar s); /* selectop */ extern GrB_Info GxB_SelectOp_error(const char **error, const GxB_SelectOp op); @@ -2982,7 +3215,7 @@ extern GrB_Info GxB_SelectOp_fprint(GxB_SelectOp selectop, const char *name, GxB extern GrB_Info GxB_SelectOp_free(GxB_SelectOp *selectop); extern GrB_Info GxB_SelectOp_new(GxB_SelectOp *selectop, GxB_select_function function, GrB_Type xtype, GrB_Type ttype); extern GrB_Info GxB_SelectOp_ttype(GrB_Type *ttype, GxB_SelectOp selectop); -extern GrB_Info GxB_SelectOp_wait(GxB_SelectOp *op); +extern GrB_Info GxB_SelectOp_wait(GxB_SelectOp op, GrB_WaitMode waitmode); extern GrB_Info GxB_SelectOp_xtype(GrB_Type *xtype, GxB_SelectOp selectop); /* semiring */ @@ -2992,27 +3225,36 @@ extern GrB_Info GxB_Semiring_multiply(GrB_BinaryOp *multiply, GrB_Semiring semir /* type */ extern GrB_Info GxB_Type_fprint(GrB_Type type, const char *name, GxB_Print_Level pr, FILE *f); -extern GrB_Info GxB_Type_size(size_t *size, GrB_Type type); +extern GrB_Info GxB_Type_from_name(GrB_Type *type, const char *type_name); +extern GrB_Info GxB_Type_name(char *type_name, const GrB_Type type); +extern GrB_Info GxB_Type_new(GrB_Type *type, size_t sizeof_ctype, const char *type_name, const char *type_defn); +extern GrB_Info GxB_Type_size(size_t *size, const GrB_Type type); /* unary */ extern GrB_Info GxB_UnaryOp_fprint(GrB_UnaryOp unaryop, const char *name, GxB_Print_Level pr, FILE *f); +extern GrB_Info GxB_UnaryOp_new(GrB_UnaryOp *unaryop, GxB_unary_function function, GrB_Type ztype, GrB_Type xtype, const char *unop_name, const char *unop_defn); extern GrB_Info GxB_UnaryOp_xtype(GrB_Type *xtype, GrB_UnaryOp unaryop); +extern GrB_Info GxB_UnaryOp_xtype_name(char *type_name, const GrB_UnaryOp unaryop); extern GrB_Info GxB_UnaryOp_ztype(GrB_Type *ztype, GrB_UnaryOp unaryop); +extern GrB_Info GxB_UnaryOp_ztype_name(char *type_name, const GrB_UnaryOp unaryop); /* vector */ extern GrB_Info GxB_Vector_Option_get(GrB_Vector A, GxB_Option_Field field, ...); extern GrB_Info GxB_Vector_Option_set(GrB_Vector A, GxB_Option_Field field, ...); -extern GrB_Info GxB_Vector_apply_BinaryOp1st(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GxB_Scalar x, const GrB_Vector u, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_apply_BinaryOp1st(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_apply_BinaryOp1st_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC32_t x, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_apply_BinaryOp1st_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC64_t x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_apply_BinaryOp2nd(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const GxB_Scalar y, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_apply_BinaryOp2nd(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const GrB_Scalar y, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_apply_BinaryOp2nd_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, GxB_FC32_t y, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_apply_BinaryOp2nd_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, GxB_FC64_t y, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_apply_IndexOp_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, GxB_FC32_t thunk, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_apply_IndexOp_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, GxB_FC64_t thunk, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_assign_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GxB_FC32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_assign_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_build_FC32(GrB_Vector w, const GrB_Index *I, const GxB_FC32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); extern GrB_Info GxB_Vector_build_FC64(GrB_Vector w, const GrB_Index *I, const GxB_FC64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GxB_Vector_build_Scalar(GrB_Vector w, const GrB_Index *I, GxB_Scalar scalar, GrB_Index nvals); +extern GrB_Info GxB_Vector_build_Scalar(GrB_Vector w, const GrB_Index *I, GrB_Scalar scalar, GrB_Index nvals); +extern GrB_Info GxB_Vector_deserialize(GrB_Vector *w, GrB_Type type, const void *blob, GrB_Index blob_size, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_export_Bitmap(GrB_Vector *v, GrB_Type *type, GrB_Index *n, int8_t **vb, void **vx, GrB_Index *vb_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_export_CSC(GrB_Vector *v, GrB_Type *type, GrB_Index *n, GrB_Index **vi, void **vx, GrB_Index *vi_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, bool *jumbled, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_export_Full(GrB_Vector *v, GrB_Type *type, GrB_Index *n, void **vx, GrB_Index *vx_size, bool *iso, const GrB_Descriptor desc); @@ -3031,7 +3273,10 @@ extern GrB_Info GxB_Vector_pack_CSC(GrB_Vector v, GrB_Index **vi, void **vx, GrB extern GrB_Info GxB_Vector_pack_Full(GrB_Vector v, void **vx, GrB_Index vx_size, bool iso, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_reduce_FC32(GxB_FC32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_reduce_FC64(GxB_FC64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_select(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Vector u, const GxB_Scalar Thunk, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_select(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Vector u, const GrB_Scalar Thunk, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_select_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, GxB_FC32_t thunk, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_select_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, GxB_FC64_t thunk, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_serialize(void **blob_handle, GrB_Index *blob_size_handle, GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_setElement_FC32(GrB_Vector w, GxB_FC32_t x, GrB_Index i); extern GrB_Info GxB_Vector_setElement_FC64(GrB_Vector w, GxB_FC64_t x, GrB_Index i); extern GrB_Info GxB_Vector_subassign(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); @@ -3044,12 +3289,14 @@ extern GrB_Info GxB_Vector_subassign_INT8(GrB_Vector w, const GrB_Vector mask, c extern GrB_Info GxB_Vector_subassign_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_subassign_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_subassign_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_subassign_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_subassign_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_subassign_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_subassign_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_subassign_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_subassign_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_type(GrB_Type *type, const GrB_Vector v); +extern GrB_Info GxB_Vector_type_name(char *type_name, const GrB_Vector v); extern GrB_Info GxB_Vector_unpack_Bitmap(GrB_Vector v, int8_t **vb, void **vx, GrB_Index *vb_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_unpack_CSC(GrB_Vector v, GrB_Index **vi, void **vx, GrB_Index *vi_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, bool *jumbled, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_unpack_Full(GrB_Vector v, void **vx, GrB_Index *vx_size, bool *iso, const GrB_Descriptor desc); @@ -3063,7 +3310,13 @@ extern GrB_Info GxB_Vector_unpack_Full(GrB_Vector v, void **vx, GrB_Index *vx_si #define GxB_BEGIN ... #define GxB_BITMAP ... #define GxB_CHUNK ... +#define GxB_COMPRESSION_DEFAULT ... +#define GxB_COMPRESSION_INTEL ... +#define GxB_COMPRESSION_LZ4 ... +#define GxB_COMPRESSION_LZ4HC ... +#define GxB_COMPRESSION_NONE ... #define GxB_END ... +#define GxB_FAST_IMPORT ... #define GxB_FULL ... #define GxB_GPU_CHUNK ... #define GxB_GPU_CONTROL ... @@ -3074,6 +3327,7 @@ extern GrB_Info GxB_Vector_unpack_Full(GrB_Vector v, void **vx, GrB_Index *vx_si #define GxB_IMPLEMENTATION_SUB ... #define GxB_INC ... #define GxB_INDEX_MAX ... +#define GxB_MAX_NAME_LEN ... #define GxB_NBITMAP_SWITCH ... #define GxB_NTHREADS ... #define GxB_RANGE ... diff --git a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h index 7d9a5a8..630e2af 100644 --- a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h +++ b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h @@ -2,8 +2,10 @@ /* GrB typedefs */ typedef struct GB_BinaryOp_opaque *GrB_BinaryOp; typedef struct GB_Descriptor_opaque *GrB_Descriptor; +typedef struct GB_IndexUnaryOp_opaque *GrB_IndexUnaryOp; typedef struct GB_Matrix_opaque *GrB_Matrix; typedef struct GB_Monoid_opaque *GrB_Monoid; +typedef struct GB_Scalar_opaque *GrB_Scalar; typedef struct GB_Semiring_opaque *GrB_Semiring; typedef struct GB_Type_opaque *GrB_Type; typedef struct GB_UnaryOp_opaque *GrB_UnaryOp; @@ -15,8 +17,9 @@ typedef struct GB_Scalar_opaque *GxB_Scalar; typedef struct GB_SelectOp_opaque *GxB_SelectOp; /* GxB typedefs (functions) */ -typedef bool (*GxB_select_function)(GrB_Index i, GrB_Index j, const void *x, const void *thunk); +typedef bool (*GxB_select_function)(int64_t i, int64_t j, const void *x, const void *thunk); typedef void (*GxB_binary_function)(void *, const void *, const void *); +typedef void (*GxB_index_unary_function)(void *z, const void *x, int64_t i, int64_t j, const void *thunk); typedef void (*GxB_unary_function)(void *, const void *); /* GrB enums */ @@ -31,7 +34,9 @@ typedef enum GxB_DESCRIPTOR_GPU_CONTROL = 21, GxB_DESCRIPTOR_GPU_CHUNK = 22, GxB_AxB_METHOD = 1000, - GxB_SORT = 35 + GxB_SORT = 35, + GxB_COMPRESSION = 36, + GxB_IMPORT = 37 } GrB_Desc_Field; typedef enum @@ -46,25 +51,37 @@ typedef enum GxB_AxB_GUSTAVSON = 1001, GxB_AxB_DOT = 1003, GxB_AxB_HASH = 1004, - GxB_AxB_SAXPY = 1005 + GxB_AxB_SAXPY = 1005, + GxB_SECURE_IMPORT = 502 } GrB_Desc_Value; +typedef enum +{ + GrB_CSR_FORMAT = 0, + GrB_CSC_FORMAT = 1, + GrB_COO_FORMAT = 2, + GrB_DENSE_ROW_FORMAT = 3, + GrB_DENSE_COL_FORMAT = 4 +} GrB_Format; + typedef enum { GrB_SUCCESS = 0, GrB_NO_VALUE = 1, - GrB_UNINITIALIZED_OBJECT = 2, - GrB_INVALID_OBJECT = 3, - GrB_NULL_POINTER = 4, - GrB_INVALID_VALUE = 5, - GrB_INVALID_INDEX = 6, - GrB_DOMAIN_MISMATCH = 7, - GrB_DIMENSION_MISMATCH = 8, - GrB_OUTPUT_NOT_EMPTY = 9, - GrB_OUT_OF_MEMORY = 10, - GrB_INSUFFICIENT_SPACE = 11, - GrB_INDEX_OUT_OF_BOUNDS = 12, - GrB_PANIC = 13 + GrB_UNINITIALIZED_OBJECT = -1, + GrB_NULL_POINTER = -2, + GrB_INVALID_VALUE = -3, + GrB_INVALID_INDEX = -4, + GrB_DOMAIN_MISMATCH = -5, + GrB_DIMENSION_MISMATCH = -6, + GrB_OUTPUT_NOT_EMPTY = -7, + GrB_NOT_IMPLEMENTED = -8, + GrB_PANIC = -101, + GrB_OUT_OF_MEMORY = -102, + GrB_INSUFFICIENT_SPACE = -103, + GrB_INVALID_OBJECT = -104, + GrB_INDEX_OUT_OF_BOUNDS = -105, + GrB_EMPTY_OBJECT = -106 } GrB_Info; typedef enum @@ -73,6 +90,12 @@ typedef enum GrB_BLOCKING = 1 } GrB_Mode; +typedef enum +{ + GrB_COMPLETE = 0, + GrB_MATERIALIZE = 1 +} GrB_WaitMode; + /* GxB enums */ typedef enum { @@ -353,6 +376,86 @@ extern GrB_Descriptor GrB_DESC_ST1; extern GrB_Descriptor GrB_DESC_T0; extern GrB_Descriptor GrB_DESC_T0T1; extern GrB_Descriptor GrB_DESC_T1; +extern GrB_IndexUnaryOp GrB_COLGT_INT64; +extern GrB_IndexUnaryOp GrB_COLINDEX_INT32; +extern GrB_IndexUnaryOp GrB_COLINDEX_INT64; +extern GrB_IndexUnaryOp GrB_COLLE_INT64; +extern GrB_IndexUnaryOp GrB_DIAGINDEX_INT32; +extern GrB_IndexUnaryOp GrB_DIAGINDEX_INT64; +extern GrB_IndexUnaryOp GrB_DIAG_INT64; +extern GrB_IndexUnaryOp GrB_OFFDIAG_INT64; +extern GrB_IndexUnaryOp GrB_ROWGT_INT64; +extern GrB_IndexUnaryOp GrB_ROWINDEX_INT32; +extern GrB_IndexUnaryOp GrB_ROWINDEX_INT64; +extern GrB_IndexUnaryOp GrB_ROWLE_INT64; +extern GrB_IndexUnaryOp GrB_TRIL_INT64; +extern GrB_IndexUnaryOp GrB_TRIU_INT64; +extern GrB_IndexUnaryOp GrB_VALUEEQ_BOOL; +extern GrB_IndexUnaryOp GrB_VALUEEQ_FP32; +extern GrB_IndexUnaryOp GrB_VALUEEQ_FP64; +extern GrB_IndexUnaryOp GrB_VALUEEQ_INT8; +extern GrB_IndexUnaryOp GrB_VALUEEQ_INT16; +extern GrB_IndexUnaryOp GrB_VALUEEQ_INT32; +extern GrB_IndexUnaryOp GrB_VALUEEQ_INT64; +extern GrB_IndexUnaryOp GrB_VALUEEQ_UINT8; +extern GrB_IndexUnaryOp GrB_VALUEEQ_UINT16; +extern GrB_IndexUnaryOp GrB_VALUEEQ_UINT32; +extern GrB_IndexUnaryOp GrB_VALUEEQ_UINT64; +extern GrB_IndexUnaryOp GrB_VALUEGE_BOOL; +extern GrB_IndexUnaryOp GrB_VALUEGE_FP32; +extern GrB_IndexUnaryOp GrB_VALUEGE_FP64; +extern GrB_IndexUnaryOp GrB_VALUEGE_INT8; +extern GrB_IndexUnaryOp GrB_VALUEGE_INT16; +extern GrB_IndexUnaryOp GrB_VALUEGE_INT32; +extern GrB_IndexUnaryOp GrB_VALUEGE_INT64; +extern GrB_IndexUnaryOp GrB_VALUEGE_UINT8; +extern GrB_IndexUnaryOp GrB_VALUEGE_UINT16; +extern GrB_IndexUnaryOp GrB_VALUEGE_UINT32; +extern GrB_IndexUnaryOp GrB_VALUEGE_UINT64; +extern GrB_IndexUnaryOp GrB_VALUEGT_BOOL; +extern GrB_IndexUnaryOp GrB_VALUEGT_FP32; +extern GrB_IndexUnaryOp GrB_VALUEGT_FP64; +extern GrB_IndexUnaryOp GrB_VALUEGT_INT8; +extern GrB_IndexUnaryOp GrB_VALUEGT_INT16; +extern GrB_IndexUnaryOp GrB_VALUEGT_INT32; +extern GrB_IndexUnaryOp GrB_VALUEGT_INT64; +extern GrB_IndexUnaryOp GrB_VALUEGT_UINT8; +extern GrB_IndexUnaryOp GrB_VALUEGT_UINT16; +extern GrB_IndexUnaryOp GrB_VALUEGT_UINT32; +extern GrB_IndexUnaryOp GrB_VALUEGT_UINT64; +extern GrB_IndexUnaryOp GrB_VALUELE_BOOL; +extern GrB_IndexUnaryOp GrB_VALUELE_FP32; +extern GrB_IndexUnaryOp GrB_VALUELE_FP64; +extern GrB_IndexUnaryOp GrB_VALUELE_INT8; +extern GrB_IndexUnaryOp GrB_VALUELE_INT16; +extern GrB_IndexUnaryOp GrB_VALUELE_INT32; +extern GrB_IndexUnaryOp GrB_VALUELE_INT64; +extern GrB_IndexUnaryOp GrB_VALUELE_UINT8; +extern GrB_IndexUnaryOp GrB_VALUELE_UINT16; +extern GrB_IndexUnaryOp GrB_VALUELE_UINT32; +extern GrB_IndexUnaryOp GrB_VALUELE_UINT64; +extern GrB_IndexUnaryOp GrB_VALUELT_BOOL; +extern GrB_IndexUnaryOp GrB_VALUELT_FP32; +extern GrB_IndexUnaryOp GrB_VALUELT_FP64; +extern GrB_IndexUnaryOp GrB_VALUELT_INT8; +extern GrB_IndexUnaryOp GrB_VALUELT_INT16; +extern GrB_IndexUnaryOp GrB_VALUELT_INT32; +extern GrB_IndexUnaryOp GrB_VALUELT_INT64; +extern GrB_IndexUnaryOp GrB_VALUELT_UINT8; +extern GrB_IndexUnaryOp GrB_VALUELT_UINT16; +extern GrB_IndexUnaryOp GrB_VALUELT_UINT32; +extern GrB_IndexUnaryOp GrB_VALUELT_UINT64; +extern GrB_IndexUnaryOp GrB_VALUENE_BOOL; +extern GrB_IndexUnaryOp GrB_VALUENE_FP32; +extern GrB_IndexUnaryOp GrB_VALUENE_FP64; +extern GrB_IndexUnaryOp GrB_VALUENE_INT8; +extern GrB_IndexUnaryOp GrB_VALUENE_INT16; +extern GrB_IndexUnaryOp GrB_VALUENE_INT32; +extern GrB_IndexUnaryOp GrB_VALUENE_INT64; +extern GrB_IndexUnaryOp GrB_VALUENE_UINT8; +extern GrB_IndexUnaryOp GrB_VALUENE_UINT16; +extern GrB_IndexUnaryOp GrB_VALUENE_UINT32; +extern GrB_IndexUnaryOp GrB_VALUENE_UINT64; extern GrB_Monoid GrB_LAND_MONOID_BOOL; extern GrB_Monoid GrB_LOR_MONOID_BOOL; extern GrB_Monoid GrB_LXNOR_MONOID_BOOL; @@ -648,6 +751,7 @@ extern GrB_BinaryOp GxB_FMOD_FP32; extern GrB_BinaryOp GxB_FMOD_FP64; extern GrB_BinaryOp GxB_HYPOT_FP32; extern GrB_BinaryOp GxB_HYPOT_FP64; +extern GrB_BinaryOp GxB_IGNORE_DUP; extern GrB_BinaryOp GxB_ISEQ_BOOL; extern GrB_BinaryOp GxB_ISEQ_FP32; extern GrB_BinaryOp GxB_ISEQ_FP64; @@ -2332,7 +2436,7 @@ extern GxB_SelectOp GxB_TRIU; extern GrB_Info GrB_BinaryOp_error(const char **error, const GrB_BinaryOp op); extern GrB_Info GrB_BinaryOp_free(GrB_BinaryOp *binaryop); extern GrB_Info GrB_BinaryOp_new(GrB_BinaryOp *binaryop, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype); -extern GrB_Info GrB_BinaryOp_wait(GrB_BinaryOp *op); +extern GrB_Info GrB_BinaryOp_wait(GrB_BinaryOp op, GrB_WaitMode waitmode); /* core */ extern GrB_Info GrB_finalize(void); @@ -2344,7 +2448,13 @@ extern GrB_Info GrB_Descriptor_error(const char **error, const GrB_Descriptor d) extern GrB_Info GrB_Descriptor_free(GrB_Descriptor *descriptor); extern GrB_Info GrB_Descriptor_new(GrB_Descriptor *descriptor); extern GrB_Info GrB_Descriptor_set(GrB_Descriptor desc, GrB_Desc_Field field, GrB_Desc_Value val); -extern GrB_Info GrB_Descriptor_wait(GrB_Descriptor *desc); +extern GrB_Info GrB_Descriptor_wait(GrB_Descriptor desc, GrB_WaitMode waitmode); + +/* indexunary */ +extern GrB_Info GrB_IndexUnaryOp_error(const char **error, const GrB_IndexUnaryOp op); +extern GrB_Info GrB_IndexUnaryOp_free(GrB_IndexUnaryOp *op); +extern GrB_Info GrB_IndexUnaryOp_new(GrB_IndexUnaryOp *op, GxB_index_unary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ttype); +extern GrB_Info GrB_IndexUnaryOp_wait(GrB_IndexUnaryOp op, GrB_WaitMode waitmode); /* matrix */ extern GrB_Info GrB_Col_assign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); @@ -2357,6 +2467,7 @@ extern GrB_Info GrB_Matrix_apply_BinaryOp1st_INT8(GrB_Matrix C, const GrB_Matrix extern GrB_Info GrB_Matrix_apply_BinaryOp1st_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int16_t x, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_apply_BinaryOp1st_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int32_t x, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_apply_BinaryOp1st_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int64_t x, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_BinaryOp1st_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_apply_BinaryOp1st_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const void *x, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_apply_BinaryOp1st_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint8_t x, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_apply_BinaryOp1st_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint16_t x, const GrB_Matrix A, const GrB_Descriptor desc); @@ -2369,11 +2480,25 @@ extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT8(GrB_Matrix C, const GrB_Matrix extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, int16_t y, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, int32_t y, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, int64_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Scalar y, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const void *y, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, uint8_t y, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, uint16_t y, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, uint32_t y, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, uint64_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, bool thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, float thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, double thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int8_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int16_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int32_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int64_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const GrB_Scalar thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const void *thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint8_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint16_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint32_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint64_t thunk, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_assign(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_assign_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_assign_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); @@ -2382,6 +2507,7 @@ extern GrB_Info GrB_Matrix_assign_INT8(GrB_Matrix C, const GrB_Matrix Mask, cons extern GrB_Info GrB_Matrix_assign_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_assign_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_assign_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_assign_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_assign_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_assign_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_assign_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); @@ -2400,6 +2526,8 @@ extern GrB_Info GrB_Matrix_build_UINT16(GrB_Matrix C, const GrB_Index *I, const extern GrB_Info GrB_Matrix_build_UINT32(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const uint32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); extern GrB_Info GrB_Matrix_build_UINT64(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const uint64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); extern GrB_Info GrB_Matrix_clear(GrB_Matrix A); +extern GrB_Info GrB_Matrix_deserialize(GrB_Matrix *C, GrB_Type type, const void *blob, GrB_Index blob_size); +extern GrB_Info GrB_Matrix_diag(GrB_Matrix C, const GrB_Vector v, int64_t k); extern GrB_Info GrB_Matrix_dup(GrB_Matrix *C, const GrB_Matrix A); extern GrB_Info GrB_Matrix_eWiseAdd_BinaryOp(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_eWiseAdd_Monoid(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); @@ -2408,6 +2536,9 @@ extern GrB_Info GrB_Matrix_eWiseMult_BinaryOp(GrB_Matrix C, const GrB_Matrix Mas extern GrB_Info GrB_Matrix_eWiseMult_Monoid(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_eWiseMult_Semiring(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_error(const char **error, const GrB_Matrix A); +extern GrB_Info GrB_Matrix_export(GrB_Index *Ap, GrB_Index *Ai, void *Ax, GrB_Format format, GrB_Matrix A); +extern GrB_Info GrB_Matrix_exportHint(GrB_Format *format, GrB_Matrix A); +extern GrB_Info GrB_Matrix_exportSize(GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); extern GrB_Info GrB_Matrix_extract(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_extractElement_BOOL(bool *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); extern GrB_Info GrB_Matrix_extractElement_FP32(float *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); @@ -2416,6 +2547,7 @@ extern GrB_Info GrB_Matrix_extractElement_INT8(int8_t *x, const GrB_Matrix A, Gr extern GrB_Info GrB_Matrix_extractElement_INT16(int16_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); extern GrB_Info GrB_Matrix_extractElement_INT32(int32_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); extern GrB_Info GrB_Matrix_extractElement_INT64(int64_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +extern GrB_Info GrB_Matrix_extractElement_Scalar(GrB_Scalar x, const GrB_Matrix A, GrB_Index i, GrB_Index j); extern GrB_Info GrB_Matrix_extractElement_UDT(void *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); extern GrB_Info GrB_Matrix_extractElement_UINT8(uint8_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); extern GrB_Info GrB_Matrix_extractElement_UINT16(uint16_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); @@ -2434,6 +2566,7 @@ extern GrB_Info GrB_Matrix_extractTuples_UINT16(GrB_Index *I, GrB_Index *J, uint extern GrB_Info GrB_Matrix_extractTuples_UINT32(GrB_Index *I, GrB_Index *J, uint32_t *X, GrB_Index *nvals, const GrB_Matrix A); extern GrB_Info GrB_Matrix_extractTuples_UINT64(GrB_Index *I, GrB_Index *J, uint64_t *X, GrB_Index *nvals, const GrB_Matrix A); extern GrB_Info GrB_Matrix_free(GrB_Matrix *A); +extern GrB_Info GrB_Matrix_import(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const void *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); extern GrB_Info GrB_Matrix_kronecker_BinaryOp(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_kronecker_Monoid(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_kronecker_Semiring(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); @@ -2450,6 +2583,7 @@ extern GrB_Info GrB_Matrix_reduce_INT16(int16_t *c, const GrB_BinaryOp accum, co extern GrB_Info GrB_Matrix_reduce_INT32(int32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_reduce_INT64(int64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_reduce_Monoid(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_reduce_Scalar(GrB_Scalar c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_reduce_UDT(void *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_reduce_UINT8(uint8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_reduce_UINT16(uint16_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); @@ -2457,6 +2591,21 @@ extern GrB_Info GrB_Matrix_reduce_UINT32(uint32_t *c, const GrB_BinaryOp accum, extern GrB_Info GrB_Matrix_reduce_UINT64(uint64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_removeElement(GrB_Matrix C, GrB_Index i, GrB_Index j); extern GrB_Info GrB_Matrix_resize(GrB_Matrix C, GrB_Index nrows_new, GrB_Index ncols_new); +extern GrB_Info GrB_Matrix_select_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, bool thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, float thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, double thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int8_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int16_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int32_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int64_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const GrB_Scalar thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const void *thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint8_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint16_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint32_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint64_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_serialize(void *blob, GrB_Index *blob_size_handle, GrB_Matrix A); +extern GrB_Info GrB_Matrix_serializeSize(GrB_Index *blob_size_handle, GrB_Matrix A); extern GrB_Info GrB_Matrix_setElement_BOOL(GrB_Matrix C, bool x, GrB_Index i, GrB_Index j); extern GrB_Info GrB_Matrix_setElement_FP32(GrB_Matrix C, float x, GrB_Index i, GrB_Index j); extern GrB_Info GrB_Matrix_setElement_FP64(GrB_Matrix C, double x, GrB_Index i, GrB_Index j); @@ -2464,12 +2613,13 @@ extern GrB_Info GrB_Matrix_setElement_INT8(GrB_Matrix C, int8_t x, GrB_Index i, extern GrB_Info GrB_Matrix_setElement_INT16(GrB_Matrix C, int16_t x, GrB_Index i, GrB_Index j); extern GrB_Info GrB_Matrix_setElement_INT32(GrB_Matrix C, int32_t x, GrB_Index i, GrB_Index j); extern GrB_Info GrB_Matrix_setElement_INT64(GrB_Matrix C, int64_t x, GrB_Index i, GrB_Index j); +extern GrB_Info GrB_Matrix_setElement_Scalar(GrB_Matrix C, GrB_Scalar x, GrB_Index i, GrB_Index j); extern GrB_Info GrB_Matrix_setElement_UDT(GrB_Matrix C, void *x, GrB_Index i, GrB_Index j); extern GrB_Info GrB_Matrix_setElement_UINT8(GrB_Matrix C, uint8_t x, GrB_Index i, GrB_Index j); extern GrB_Info GrB_Matrix_setElement_UINT16(GrB_Matrix C, uint16_t x, GrB_Index i, GrB_Index j); extern GrB_Info GrB_Matrix_setElement_UINT32(GrB_Matrix C, uint32_t x, GrB_Index i, GrB_Index j); extern GrB_Info GrB_Matrix_setElement_UINT64(GrB_Matrix C, uint64_t x, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_wait(GrB_Matrix *A); +extern GrB_Info GrB_Matrix_wait(GrB_Matrix A, GrB_WaitMode waitmode); extern GrB_Info GrB_Row_assign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, GrB_Index i, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GrB_mxm(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); extern GrB_Info GrB_mxv(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Vector u, const GrB_Descriptor desc); @@ -2491,25 +2641,58 @@ extern GrB_Info GrB_Monoid_new_UINT8(GrB_Monoid *monoid, GrB_BinaryOp op, uint8_ extern GrB_Info GrB_Monoid_new_UINT16(GrB_Monoid *monoid, GrB_BinaryOp op, uint16_t identity); extern GrB_Info GrB_Monoid_new_UINT32(GrB_Monoid *monoid, GrB_BinaryOp op, uint32_t identity); extern GrB_Info GrB_Monoid_new_UINT64(GrB_Monoid *monoid, GrB_BinaryOp op, uint64_t identity); -extern GrB_Info GrB_Monoid_wait(GrB_Monoid *monoid); +extern GrB_Info GrB_Monoid_wait(GrB_Monoid monoid, GrB_WaitMode waitmode); + +/* scalar */ +extern GrB_Info GrB_Scalar_clear(GrB_Scalar s); +extern GrB_Info GrB_Scalar_dup(GrB_Scalar *s, const GrB_Scalar t); +extern GrB_Info GrB_Scalar_error(const char **error, const GrB_Scalar s); +extern GrB_Info GrB_Scalar_extractElement_BOOL(bool *x, const GrB_Scalar s); +extern GrB_Info GrB_Scalar_extractElement_FP32(float *x, const GrB_Scalar s); +extern GrB_Info GrB_Scalar_extractElement_FP64(double *x, const GrB_Scalar s); +extern GrB_Info GrB_Scalar_extractElement_INT8(int8_t *x, const GrB_Scalar s); +extern GrB_Info GrB_Scalar_extractElement_INT16(int16_t *x, const GrB_Scalar s); +extern GrB_Info GrB_Scalar_extractElement_INT32(int32_t *x, const GrB_Scalar s); +extern GrB_Info GrB_Scalar_extractElement_INT64(int64_t *x, const GrB_Scalar s); +extern GrB_Info GrB_Scalar_extractElement_UDT(void *x, const GrB_Scalar s); +extern GrB_Info GrB_Scalar_extractElement_UINT8(uint8_t *x, const GrB_Scalar s); +extern GrB_Info GrB_Scalar_extractElement_UINT16(uint16_t *x, const GrB_Scalar s); +extern GrB_Info GrB_Scalar_extractElement_UINT32(uint32_t *x, const GrB_Scalar s); +extern GrB_Info GrB_Scalar_extractElement_UINT64(uint64_t *x, const GrB_Scalar s); +extern GrB_Info GrB_Scalar_free(GrB_Scalar *s); +extern GrB_Info GrB_Scalar_new(GrB_Scalar *s, GrB_Type type); +extern GrB_Info GrB_Scalar_nvals(GrB_Index *nvals, const GrB_Scalar s); +extern GrB_Info GrB_Scalar_setElement_BOOL(GrB_Scalar s, bool x); +extern GrB_Info GrB_Scalar_setElement_FP32(GrB_Scalar s, float x); +extern GrB_Info GrB_Scalar_setElement_FP64(GrB_Scalar s, double x); +extern GrB_Info GrB_Scalar_setElement_INT8(GrB_Scalar s, int8_t x); +extern GrB_Info GrB_Scalar_setElement_INT16(GrB_Scalar s, int16_t x); +extern GrB_Info GrB_Scalar_setElement_INT32(GrB_Scalar s, int32_t x); +extern GrB_Info GrB_Scalar_setElement_INT64(GrB_Scalar s, int64_t x); +extern GrB_Info GrB_Scalar_setElement_UDT(GrB_Scalar s, void *x); +extern GrB_Info GrB_Scalar_setElement_UINT8(GrB_Scalar s, uint8_t x); +extern GrB_Info GrB_Scalar_setElement_UINT16(GrB_Scalar s, uint16_t x); +extern GrB_Info GrB_Scalar_setElement_UINT32(GrB_Scalar s, uint32_t x); +extern GrB_Info GrB_Scalar_setElement_UINT64(GrB_Scalar s, uint64_t x); +extern GrB_Info GrB_Scalar_wait(GrB_Scalar s, GrB_WaitMode waitmode); /* semiring */ extern GrB_Info GrB_Semiring_error(const char **error, const GrB_Semiring semiring); extern GrB_Info GrB_Semiring_free(GrB_Semiring *semiring); extern GrB_Info GrB_Semiring_new(GrB_Semiring *semiring, GrB_Monoid add, GrB_BinaryOp multiply); -extern GrB_Info GrB_Semiring_wait(GrB_Semiring *semiring); +extern GrB_Info GrB_Semiring_wait(GrB_Semiring semiring, GrB_WaitMode waitmode); /* type */ extern GrB_Info GrB_Type_error(const char **error, const GrB_Type type); extern GrB_Info GrB_Type_free(GrB_Type *type); extern GrB_Info GrB_Type_new(GrB_Type *type, size_t sizeof_ctype); -extern GrB_Info GrB_Type_wait(GrB_Type *type); +extern GrB_Info GrB_Type_wait(GrB_Type type, GrB_WaitMode waitmode); /* unary */ extern GrB_Info GrB_UnaryOp_error(const char **error, const GrB_UnaryOp op); extern GrB_Info GrB_UnaryOp_free(GrB_UnaryOp *unaryop); extern GrB_Info GrB_UnaryOp_new(GrB_UnaryOp *unaryop, GxB_unary_function function, GrB_Type ztype, GrB_Type xtype); -extern GrB_Info GrB_UnaryOp_wait(GrB_UnaryOp *op); +extern GrB_Info GrB_UnaryOp_wait(GrB_UnaryOp op, GrB_WaitMode waitmode); /* vector */ extern GrB_Info GrB_Vector_apply(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_UnaryOp op, const GrB_Vector u, const GrB_Descriptor desc); @@ -2520,6 +2703,7 @@ extern GrB_Info GrB_Vector_apply_BinaryOp1st_INT8(GrB_Vector w, const GrB_Vector extern GrB_Info GrB_Vector_apply_BinaryOp1st_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int16_t x, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_apply_BinaryOp1st_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int32_t x, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_apply_BinaryOp1st_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int64_t x, const GrB_Vector u, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_BinaryOp1st_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_apply_BinaryOp1st_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const void *x, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_apply_BinaryOp1st_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint8_t x, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_apply_BinaryOp1st_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint16_t x, const GrB_Vector u, const GrB_Descriptor desc); @@ -2532,11 +2716,25 @@ extern GrB_Info GrB_Vector_apply_BinaryOp2nd_INT8(GrB_Vector w, const GrB_Vector extern GrB_Info GrB_Vector_apply_BinaryOp2nd_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, int16_t y, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_apply_BinaryOp2nd_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, int32_t y, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_apply_BinaryOp2nd_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, int64_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_BinaryOp2nd_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const GrB_Scalar y, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_apply_BinaryOp2nd_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const void *y, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, uint8_t y, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, uint16_t y, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, uint32_t y, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, uint64_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, bool thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, float thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, double thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int8_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int16_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int32_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int64_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const GrB_Scalar thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const void *thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint8_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint16_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint32_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint64_t thunk, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_assign(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_assign_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_assign_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); @@ -2545,6 +2743,7 @@ extern GrB_Info GrB_Vector_assign_INT8(GrB_Vector w, const GrB_Vector mask, cons extern GrB_Info GrB_Vector_assign_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_assign_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_assign_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_assign_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_assign_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_assign_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_assign_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); @@ -2563,6 +2762,7 @@ extern GrB_Info GrB_Vector_build_UINT16(GrB_Vector w, const GrB_Index *I, const extern GrB_Info GrB_Vector_build_UINT32(GrB_Vector w, const GrB_Index *I, const uint32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); extern GrB_Info GrB_Vector_build_UINT64(GrB_Vector w, const GrB_Index *I, const uint64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); extern GrB_Info GrB_Vector_clear(GrB_Vector v); +extern GrB_Info GrB_Vector_deserialize(GrB_Vector *w, GrB_Type type, const void *blob, GrB_Index blob_size); extern GrB_Info GrB_Vector_dup(GrB_Vector *w, const GrB_Vector u); extern GrB_Info GrB_Vector_eWiseAdd_BinaryOp(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_eWiseAdd_Monoid(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); @@ -2579,6 +2779,7 @@ extern GrB_Info GrB_Vector_extractElement_INT8(int8_t *x, const GrB_Vector v, Gr extern GrB_Info GrB_Vector_extractElement_INT16(int16_t *x, const GrB_Vector v, GrB_Index i); extern GrB_Info GrB_Vector_extractElement_INT32(int32_t *x, const GrB_Vector v, GrB_Index i); extern GrB_Info GrB_Vector_extractElement_INT64(int64_t *x, const GrB_Vector v, GrB_Index i); +extern GrB_Info GrB_Vector_extractElement_Scalar(GrB_Scalar x, const GrB_Vector v, GrB_Index i); extern GrB_Info GrB_Vector_extractElement_UDT(void *x, const GrB_Vector v, GrB_Index i); extern GrB_Info GrB_Vector_extractElement_UINT8(uint8_t *x, const GrB_Vector v, GrB_Index i); extern GrB_Info GrB_Vector_extractElement_UINT16(uint16_t *x, const GrB_Vector v, GrB_Index i); @@ -2606,6 +2807,7 @@ extern GrB_Info GrB_Vector_reduce_INT8(int8_t *c, const GrB_BinaryOp accum, cons extern GrB_Info GrB_Vector_reduce_INT16(int16_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_reduce_INT32(int32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_reduce_INT64(int64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_reduce_Scalar(GrB_Scalar c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_reduce_UDT(void *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_reduce_UINT8(uint8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_reduce_UINT16(uint16_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); @@ -2613,6 +2815,21 @@ extern GrB_Info GrB_Vector_reduce_UINT32(uint32_t *c, const GrB_BinaryOp accum, extern GrB_Info GrB_Vector_reduce_UINT64(uint64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_removeElement(GrB_Vector v, GrB_Index i); extern GrB_Info GrB_Vector_resize(GrB_Vector w, GrB_Index nrows_new); +extern GrB_Info GrB_Vector_select_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, bool thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, float thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, double thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int8_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int16_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int32_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int64_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const GrB_Scalar thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const void *thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint8_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint16_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint32_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint64_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_serialize(void *blob, GrB_Index *blob_size_handle, GrB_Vector u); +extern GrB_Info GrB_Vector_serializeSize(GrB_Index *blob_size_handle, GrB_Vector u); extern GrB_Info GrB_Vector_setElement_BOOL(GrB_Vector w, bool x, GrB_Index i); extern GrB_Info GrB_Vector_setElement_FP32(GrB_Vector w, float x, GrB_Index i); extern GrB_Info GrB_Vector_setElement_FP64(GrB_Vector w, double x, GrB_Index i); @@ -2620,44 +2837,41 @@ extern GrB_Info GrB_Vector_setElement_INT8(GrB_Vector w, int8_t x, GrB_Index i); extern GrB_Info GrB_Vector_setElement_INT16(GrB_Vector w, int16_t x, GrB_Index i); extern GrB_Info GrB_Vector_setElement_INT32(GrB_Vector w, int32_t x, GrB_Index i); extern GrB_Info GrB_Vector_setElement_INT64(GrB_Vector w, int64_t x, GrB_Index i); +extern GrB_Info GrB_Vector_setElement_Scalar(GrB_Vector w, GrB_Scalar x, GrB_Index i); extern GrB_Info GrB_Vector_setElement_UDT(GrB_Vector w, void *x, GrB_Index i); extern GrB_Info GrB_Vector_setElement_UINT8(GrB_Vector w, uint8_t x, GrB_Index i); extern GrB_Info GrB_Vector_setElement_UINT16(GrB_Vector w, uint16_t x, GrB_Index i); extern GrB_Info GrB_Vector_setElement_UINT32(GrB_Vector w, uint32_t x, GrB_Index i); extern GrB_Info GrB_Vector_setElement_UINT64(GrB_Vector w, uint64_t x, GrB_Index i); extern GrB_Info GrB_Vector_size(GrB_Index *n, const GrB_Vector v); -extern GrB_Info GrB_Vector_wait(GrB_Vector *v); +extern GrB_Info GrB_Vector_wait(GrB_Vector v, GrB_WaitMode waitmode); /*************** * GB functions * ***************/ -/* binary */ -extern GrB_Info GB_BinaryOp_new(GrB_BinaryOp *binaryop, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *name); - /* selectop */ extern GrB_Info GB_SelectOp_new(GxB_SelectOp *selectop, GxB_select_function function, GrB_Type xtype, GrB_Type ttype, const char *name); -/* type */ -extern GrB_Info GB_Type_new(GrB_Type *type, size_t sizeof_ctype, const char *name); - -/* unary */ -extern GrB_Info GB_UnaryOp_new(GrB_UnaryOp *unaryop, GxB_unary_function function, GrB_Type ztype, GrB_Type xtype, const char *name); - /**************** * GxB functions * ****************/ /* binary */ extern GrB_Info GxB_BinaryOp_fprint(GrB_BinaryOp binaryop, const char *name, GxB_Print_Level pr, FILE *f); +extern GrB_Info GxB_BinaryOp_new(GrB_BinaryOp *op, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *binop_name, const char *binop_defn); extern GrB_Info GxB_BinaryOp_xtype(GrB_Type *xtype, GrB_BinaryOp binaryop); +extern GrB_Info GxB_BinaryOp_xtype_name(char *type_name, const GrB_BinaryOp binaryop); extern GrB_Info GxB_BinaryOp_ytype(GrB_Type *ytype, GrB_BinaryOp binaryop); +extern GrB_Info GxB_BinaryOp_ytype_name(char *type_name, const GrB_BinaryOp binaryop); extern GrB_Info GxB_BinaryOp_ztype(GrB_Type *ztype, GrB_BinaryOp binaryop); +extern GrB_Info GxB_BinaryOp_ztype_name(char *type_name, const GrB_BinaryOp binaryop); /* core */ extern GrB_Info GxB_Global_Option_get(GxB_Option_Field field, ...); extern GrB_Info GxB_Global_Option_set(GxB_Option_Field field, ...); -extern GrB_Info GxB_init(GrB_Mode mode, void *(*user_malloc_function)(size_t), void *(*user_calloc_function)(size_t, size_t), void *(*user_realloc_function)(void *, size_t), void (*user_free_function)(void *), bool user_malloc_is_thread_safe); +extern GrB_Info GxB_deserialize_type_name(char *type_name, const void *blob, GrB_Index blob_size); +extern GrB_Info GxB_init(GrB_Mode mode, void *(*user_malloc_function)(size_t), void *(*user_calloc_function)(size_t, size_t), void *(*user_realloc_function)(void *, size_t), void (*user_free_function)(void *)); /* descriptor */ extern GrB_Info GxB_Desc_get(GrB_Descriptor desc, GrB_Desc_Field field, ...); @@ -2665,14 +2879,22 @@ extern GrB_Info GxB_Desc_set(GrB_Descriptor desc, GrB_Desc_Field field, ...); extern GrB_Info GxB_Descriptor_fprint(GrB_Descriptor descriptor, const char *name, GxB_Print_Level pr, FILE *f); extern GrB_Info GxB_Descriptor_get(GrB_Desc_Value *val, GrB_Descriptor desc, GrB_Desc_Field field); +/* indexunary */ +extern GrB_Info GxB_IndexUnaryOp_fprint(GrB_IndexUnaryOp op, const char *name, GxB_Print_Level pr, FILE *f); +extern GrB_Info GxB_IndexUnaryOp_new(GrB_IndexUnaryOp *op, GxB_index_unary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ttype, const char *idxop_name, const char *idxop_defn); +extern GrB_Info GxB_IndexUnaryOp_ttype_name(char *type_name, const GrB_IndexUnaryOp op); +extern GrB_Info GxB_IndexUnaryOp_xtype_name(char *type_name, const GrB_IndexUnaryOp op); +extern GrB_Info GxB_IndexUnaryOp_ztype_name(char *type_name, const GrB_IndexUnaryOp op); + /* matrix */ extern GrB_Info GxB_Col_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_Option_get(GrB_Matrix A, GxB_Option_Field field, ...); extern GrB_Info GxB_Matrix_Option_set(GrB_Matrix A, GxB_Option_Field field, ...); -extern GrB_Info GxB_Matrix_apply_BinaryOp1st(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GxB_Scalar x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_apply_BinaryOp2nd(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GxB_Scalar y, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_build_Scalar(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, GxB_Scalar scalar, GrB_Index nvals); +extern GrB_Info GxB_Matrix_apply_BinaryOp1st(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_apply_BinaryOp2nd(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Scalar y, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_build_Scalar(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, GrB_Scalar scalar, GrB_Index nvals); extern GrB_Info GxB_Matrix_concat(GrB_Matrix C, const GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_deserialize(GrB_Matrix *C, GrB_Type type, const void *blob, GrB_Index blob_size, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_diag(GrB_Matrix C, const GrB_Vector v, int64_t k, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_export_BitmapC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_export_BitmapR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); @@ -2701,7 +2923,8 @@ extern GrB_Info GxB_Matrix_pack_FullC(GrB_Matrix A, void **Ax, GrB_Index Ax_size extern GrB_Info GxB_Matrix_pack_FullR(GrB_Matrix A, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_pack_HyperCSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_pack_HyperCSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_select(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Matrix A, const GxB_Scalar Thunk, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_select(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Matrix A, const GrB_Scalar Thunk, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_serialize(void **blob_handle, GrB_Index *blob_size_handle, GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_split(GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Index *Tile_nrows, const GrB_Index *Tile_ncols, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_subassign(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_subassign_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); @@ -2711,12 +2934,14 @@ extern GrB_Info GxB_Matrix_subassign_INT8(GrB_Matrix C, const GrB_Matrix Mask, c extern GrB_Info GxB_Matrix_subassign_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_subassign_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_subassign_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_subassign_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_subassign_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_subassign_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_subassign_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_subassign_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_subassign_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_type(GrB_Type *type, const GrB_Matrix A); +extern GrB_Info GxB_Matrix_type_name(char *type_name, const GrB_Matrix A); extern GrB_Info GxB_Matrix_unpack_BitmapC(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_unpack_BitmapR(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_unpack_CSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); @@ -2747,40 +2972,40 @@ extern GrB_Info GxB_Monoid_terminal_new_UINT32(GrB_Monoid *monoid, GrB_BinaryOp extern GrB_Info GxB_Monoid_terminal_new_UINT64(GrB_Monoid *monoid, GrB_BinaryOp op, uint64_t identity, uint64_t terminal); /* scalar */ -extern GrB_Info GxB_Scalar_clear(GxB_Scalar s); -extern GrB_Info GxB_Scalar_dup(GxB_Scalar *s, const GxB_Scalar t); -extern GrB_Info GxB_Scalar_error(const char **error, const GxB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_BOOL(bool *x, const GxB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_FP32(float *x, const GxB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_FP64(double *x, const GxB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_INT8(int8_t *x, const GxB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_INT16(int16_t *x, const GxB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_INT32(int32_t *x, const GxB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_INT64(int64_t *x, const GxB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_UDT(void *x, const GxB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_UINT8(uint8_t *x, const GxB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_UINT16(uint16_t *x, const GxB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_UINT32(uint32_t *x, const GxB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_UINT64(uint64_t *x, const GxB_Scalar s); -extern GrB_Info GxB_Scalar_fprint(GxB_Scalar s, const char *name, GxB_Print_Level pr, FILE *f); -extern GrB_Info GxB_Scalar_free(GxB_Scalar *s); -extern GrB_Info GxB_Scalar_memoryUsage(size_t *size, const GxB_Scalar s); -extern GrB_Info GxB_Scalar_new(GxB_Scalar *s, GrB_Type type); -extern GrB_Info GxB_Scalar_nvals(GrB_Index *nvals, const GxB_Scalar s); -extern GrB_Info GxB_Scalar_setElement_BOOL(GxB_Scalar s, bool x); -extern GrB_Info GxB_Scalar_setElement_FP32(GxB_Scalar s, float x); -extern GrB_Info GxB_Scalar_setElement_FP64(GxB_Scalar s, double x); -extern GrB_Info GxB_Scalar_setElement_INT8(GxB_Scalar s, int8_t x); -extern GrB_Info GxB_Scalar_setElement_INT16(GxB_Scalar s, int16_t x); -extern GrB_Info GxB_Scalar_setElement_INT32(GxB_Scalar s, int32_t x); -extern GrB_Info GxB_Scalar_setElement_INT64(GxB_Scalar s, int64_t x); -extern GrB_Info GxB_Scalar_setElement_UDT(GxB_Scalar s, void *x); -extern GrB_Info GxB_Scalar_setElement_UINT8(GxB_Scalar s, uint8_t x); -extern GrB_Info GxB_Scalar_setElement_UINT16(GxB_Scalar s, uint16_t x); -extern GrB_Info GxB_Scalar_setElement_UINT32(GxB_Scalar s, uint32_t x); -extern GrB_Info GxB_Scalar_setElement_UINT64(GxB_Scalar s, uint64_t x); -extern GrB_Info GxB_Scalar_type(GrB_Type *type, const GxB_Scalar s); -extern GrB_Info GxB_Scalar_wait(GxB_Scalar *s); +extern GrB_Info GxB_Scalar_clear(GrB_Scalar s); +extern GrB_Info GxB_Scalar_dup(GrB_Scalar *s, const GrB_Scalar t); +extern GrB_Info GxB_Scalar_error(const char **error, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_extractElement_BOOL(bool *x, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_extractElement_FP32(float *x, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_extractElement_FP64(double *x, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_extractElement_INT8(int8_t *x, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_extractElement_INT16(int16_t *x, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_extractElement_INT32(int32_t *x, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_extractElement_INT64(int64_t *x, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_extractElement_UDT(void *x, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_extractElement_UINT8(uint8_t *x, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_extractElement_UINT16(uint16_t *x, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_extractElement_UINT32(uint32_t *x, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_extractElement_UINT64(uint64_t *x, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_fprint(GrB_Scalar s, const char *name, GxB_Print_Level pr, FILE *f); +extern GrB_Info GxB_Scalar_free(GrB_Scalar *s); +extern GrB_Info GxB_Scalar_memoryUsage(size_t *size, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_new(GrB_Scalar *s, GrB_Type type); +extern GrB_Info GxB_Scalar_nvals(GrB_Index *nvals, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_setElement_BOOL(GrB_Scalar s, bool x); +extern GrB_Info GxB_Scalar_setElement_FP32(GrB_Scalar s, float x); +extern GrB_Info GxB_Scalar_setElement_FP64(GrB_Scalar s, double x); +extern GrB_Info GxB_Scalar_setElement_INT8(GrB_Scalar s, int8_t x); +extern GrB_Info GxB_Scalar_setElement_INT16(GrB_Scalar s, int16_t x); +extern GrB_Info GxB_Scalar_setElement_INT32(GrB_Scalar s, int32_t x); +extern GrB_Info GxB_Scalar_setElement_INT64(GrB_Scalar s, int64_t x); +extern GrB_Info GxB_Scalar_setElement_UDT(GrB_Scalar s, void *x); +extern GrB_Info GxB_Scalar_setElement_UINT8(GrB_Scalar s, uint8_t x); +extern GrB_Info GxB_Scalar_setElement_UINT16(GrB_Scalar s, uint16_t x); +extern GrB_Info GxB_Scalar_setElement_UINT32(GrB_Scalar s, uint32_t x); +extern GrB_Info GxB_Scalar_setElement_UINT64(GrB_Scalar s, uint64_t x); +extern GrB_Info GxB_Scalar_type(GrB_Type *type, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_type_name(char *type_name, const GrB_Scalar s); /* selectop */ extern GrB_Info GxB_SelectOp_error(const char **error, const GxB_SelectOp op); @@ -2788,7 +3013,7 @@ extern GrB_Info GxB_SelectOp_fprint(GxB_SelectOp selectop, const char *name, GxB extern GrB_Info GxB_SelectOp_free(GxB_SelectOp *selectop); extern GrB_Info GxB_SelectOp_new(GxB_SelectOp *selectop, GxB_select_function function, GrB_Type xtype, GrB_Type ttype); extern GrB_Info GxB_SelectOp_ttype(GrB_Type *ttype, GxB_SelectOp selectop); -extern GrB_Info GxB_SelectOp_wait(GxB_SelectOp *op); +extern GrB_Info GxB_SelectOp_wait(GxB_SelectOp op, GrB_WaitMode waitmode); extern GrB_Info GxB_SelectOp_xtype(GrB_Type *xtype, GxB_SelectOp selectop); /* semiring */ @@ -2798,19 +3023,26 @@ extern GrB_Info GxB_Semiring_multiply(GrB_BinaryOp *multiply, GrB_Semiring semir /* type */ extern GrB_Info GxB_Type_fprint(GrB_Type type, const char *name, GxB_Print_Level pr, FILE *f); -extern GrB_Info GxB_Type_size(size_t *size, GrB_Type type); +extern GrB_Info GxB_Type_from_name(GrB_Type *type, const char *type_name); +extern GrB_Info GxB_Type_name(char *type_name, const GrB_Type type); +extern GrB_Info GxB_Type_new(GrB_Type *type, size_t sizeof_ctype, const char *type_name, const char *type_defn); +extern GrB_Info GxB_Type_size(size_t *size, const GrB_Type type); /* unary */ extern GrB_Info GxB_UnaryOp_fprint(GrB_UnaryOp unaryop, const char *name, GxB_Print_Level pr, FILE *f); +extern GrB_Info GxB_UnaryOp_new(GrB_UnaryOp *unaryop, GxB_unary_function function, GrB_Type ztype, GrB_Type xtype, const char *unop_name, const char *unop_defn); extern GrB_Info GxB_UnaryOp_xtype(GrB_Type *xtype, GrB_UnaryOp unaryop); +extern GrB_Info GxB_UnaryOp_xtype_name(char *type_name, const GrB_UnaryOp unaryop); extern GrB_Info GxB_UnaryOp_ztype(GrB_Type *ztype, GrB_UnaryOp unaryop); +extern GrB_Info GxB_UnaryOp_ztype_name(char *type_name, const GrB_UnaryOp unaryop); /* vector */ extern GrB_Info GxB_Vector_Option_get(GrB_Vector A, GxB_Option_Field field, ...); extern GrB_Info GxB_Vector_Option_set(GrB_Vector A, GxB_Option_Field field, ...); -extern GrB_Info GxB_Vector_apply_BinaryOp1st(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GxB_Scalar x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_apply_BinaryOp2nd(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const GxB_Scalar y, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_build_Scalar(GrB_Vector w, const GrB_Index *I, GxB_Scalar scalar, GrB_Index nvals); +extern GrB_Info GxB_Vector_apply_BinaryOp1st(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Vector u, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_apply_BinaryOp2nd(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const GrB_Scalar y, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_build_Scalar(GrB_Vector w, const GrB_Index *I, GrB_Scalar scalar, GrB_Index nvals); +extern GrB_Info GxB_Vector_deserialize(GrB_Vector *w, GrB_Type type, const void *blob, GrB_Index blob_size, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_export_Bitmap(GrB_Vector *v, GrB_Type *type, GrB_Index *n, int8_t **vb, void **vx, GrB_Index *vb_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_export_CSC(GrB_Vector *v, GrB_Type *type, GrB_Index *n, GrB_Index **vi, void **vx, GrB_Index *vi_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, bool *jumbled, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_export_Full(GrB_Vector *v, GrB_Type *type, GrB_Index *n, void **vx, GrB_Index *vx_size, bool *iso, const GrB_Descriptor desc); @@ -2823,7 +3055,8 @@ extern GrB_Info GxB_Vector_memoryUsage(size_t *size, const GrB_Vector v); extern GrB_Info GxB_Vector_pack_Bitmap(GrB_Vector v, int8_t **vb, void **vx, GrB_Index vb_size, GrB_Index vx_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_pack_CSC(GrB_Vector v, GrB_Index **vi, void **vx, GrB_Index vi_size, GrB_Index vx_size, bool iso, GrB_Index nvals, bool jumbled, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_pack_Full(GrB_Vector v, void **vx, GrB_Index vx_size, bool iso, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_select(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Vector u, const GxB_Scalar Thunk, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_select(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Vector u, const GrB_Scalar Thunk, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_serialize(void **blob_handle, GrB_Index *blob_size_handle, GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_subassign(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_subassign_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_subassign_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); @@ -2832,12 +3065,14 @@ extern GrB_Info GxB_Vector_subassign_INT8(GrB_Vector w, const GrB_Vector mask, c extern GrB_Info GxB_Vector_subassign_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_subassign_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_subassign_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_subassign_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_subassign_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_subassign_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_subassign_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_subassign_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_subassign_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_type(GrB_Type *type, const GrB_Vector v); +extern GrB_Info GxB_Vector_type_name(char *type_name, const GrB_Vector v); extern GrB_Info GxB_Vector_unpack_Bitmap(GrB_Vector v, int8_t **vb, void **vx, GrB_Index *vb_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_unpack_CSC(GrB_Vector v, GrB_Index **vi, void **vx, GrB_Index *vi_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, bool *jumbled, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_unpack_Full(GrB_Vector v, void **vx, GrB_Index *vx_size, bool *iso, const GrB_Descriptor desc); @@ -2851,7 +3086,13 @@ extern GrB_Info GxB_Vector_unpack_Full(GrB_Vector v, void **vx, GrB_Index *vx_si #define GxB_BEGIN ... #define GxB_BITMAP ... #define GxB_CHUNK ... +#define GxB_COMPRESSION_DEFAULT ... +#define GxB_COMPRESSION_INTEL ... +#define GxB_COMPRESSION_LZ4 ... +#define GxB_COMPRESSION_LZ4HC ... +#define GxB_COMPRESSION_NONE ... #define GxB_END ... +#define GxB_FAST_IMPORT ... #define GxB_FULL ... #define GxB_GPU_CHUNK ... #define GxB_GPU_CONTROL ... @@ -2862,6 +3103,7 @@ extern GrB_Info GxB_Vector_unpack_Full(GrB_Vector v, void **vx, GrB_Index *vx_si #define GxB_IMPLEMENTATION_SUB ... #define GxB_INC ... #define GxB_INDEX_MAX ... +#define GxB_MAX_NAME_LEN ... #define GxB_NBITMAP_SWITCH ... #define GxB_NTHREADS ... #define GxB_RANGE ... diff --git a/suitesparse_graphblas/tests/conftest.py b/suitesparse_graphblas/tests/conftest.py index 24dc269..b6c5ead 100644 --- a/suitesparse_graphblas/tests/conftest.py +++ b/suitesparse_graphblas/tests/conftest.py @@ -1,4 +1,5 @@ import pytest + from suitesparse_graphblas import initialize diff --git a/suitesparse_graphblas/tests/test_doctest.py b/suitesparse_graphblas/tests/test_doctest.py index 7854f35..68b9444 100644 --- a/suitesparse_graphblas/tests/test_doctest.py +++ b/suitesparse_graphblas/tests/test_doctest.py @@ -1,10 +1,7 @@ def test_run_doctests(): import doctest - from suitesparse_graphblas import ( - matrix, - vector, - scalar, - ) + + from suitesparse_graphblas import matrix, scalar, vector for mod in ( matrix, diff --git a/suitesparse_graphblas/tests/test_exceptions.py b/suitesparse_graphblas/tests/test_exceptions.py index 825ce21..26b7861 100644 --- a/suitesparse_graphblas/tests/test_exceptions.py +++ b/suitesparse_graphblas/tests/test_exceptions.py @@ -1,12 +1,7 @@ -from suitesparse_graphblas import ( - ffi, - lib, - check_status, - exceptions, -) - import pytest +from suitesparse_graphblas import check_status, exceptions, ffi, lib + def test_check_status(): A = ffi.new("GrB_Matrix*") diff --git a/suitesparse_graphblas/tests/test_initialize.py b/suitesparse_graphblas/tests/test_initialize.py index fc69305..fbd4db7 100644 --- a/suitesparse_graphblas/tests/test_initialize.py +++ b/suitesparse_graphblas/tests/test_initialize.py @@ -1,7 +1,8 @@ if __name__ == "__main__": - import suitesparse_graphblas as ssgb import pytest + import suitesparse_graphblas as ssgb + assert ssgb.is_initialized() is False ssgb.initialize() assert ssgb.is_initialized() is True diff --git a/suitesparse_graphblas/tests/test_io.py b/suitesparse_graphblas/tests/test_io.py index 2638446..c7e2603 100644 --- a/suitesparse_graphblas/tests/test_io.py +++ b/suitesparse_graphblas/tests/test_io.py @@ -1,30 +1,30 @@ -import platform -import pytest - -if platform.system() == "Windows": - pytest.skip("skipping windows-only tests", allow_module_level=True) - -import gzip import bz2 +import gzip import lzma +import platform from pathlib import Path +import pytest + from suitesparse_graphblas import ( - ffi, - lib, + bool_types, check_status, + complex_types, + ffi, grb_types, - bool_types, - signed_integer_types, - unsigned_integer_types, + lib, + matrix, real_types, - complex_types, + signed_integer_types, supports_complex, - matrix, + unsigned_integer_types, ) - from suitesparse_graphblas.io import binary +if platform.system() == "Windows": + pytest.skip("skipping windows-only tests", allow_module_level=True) + + NULL = ffi.NULL diff --git a/suitesparse_graphblas/tests/test_package.py b/suitesparse_graphblas/tests/test_package.py index 4bc0ab4..7a0c910 100644 --- a/suitesparse_graphblas/tests/test_package.py +++ b/suitesparse_graphblas/tests/test_package.py @@ -1,4 +1,4 @@ -from suitesparse_graphblas import lib, ffi # noqa +from suitesparse_graphblas import ffi, lib # noqa def test_matrix_existence(): diff --git a/suitesparse_graphblas/utils.pxd b/suitesparse_graphblas/utils.pxd index 5a742a2..9eb4fae 100644 --- a/suitesparse_graphblas/utils.pxd +++ b/suitesparse_graphblas/utils.pxd @@ -1,5 +1,6 @@ -from numpy cimport ndarray from libc.stdint cimport uint64_t +from numpy cimport ndarray + cdef extern from "numpy/arrayobject.h" nogil: # These aren't public (i.e., "extern"), but other projects use them too diff --git a/suitesparse_graphblas/utils.pyx b/suitesparse_graphblas/utils.pyx index c800d8a..371fcad 100644 --- a/suitesparse_graphblas/utils.pyx +++ b/suitesparse_graphblas/utils.pyx @@ -1,10 +1,15 @@ import numpy as np +from libc.stdint cimport uintptr_t from numpy cimport ( - import_array, ndarray, npy_intp, - PyArray_SimpleNewFromData, PyArray_New, - NPY_ARRAY_OWNDATA, NPY_ARRAY_WRITEABLE, NPY_ARRAY_F_CONTIGUOUS, + NPY_ARRAY_F_CONTIGUOUS, + NPY_ARRAY_OWNDATA, + NPY_ARRAY_WRITEABLE, + PyArray_New, + PyArray_SimpleNewFromData, + import_array, + ndarray, + npy_intp, ) -from libc.stdint cimport uintptr_t import_array() diff --git a/suitesparse_graphblas/vector.py b/suitesparse_graphblas/vector.py index 2d0e12b..6d76ad5 100644 --- a/suitesparse_graphblas/vector.py +++ b/suitesparse_graphblas/vector.py @@ -1,8 +1,4 @@ -from suitesparse_graphblas import ( - lib, - ffi, - check_status, -) +from suitesparse_graphblas import check_status, ffi, lib def free(v): From f5484e710f27102c3d6c8c0e5807f872df958bb6 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Wed, 6 Oct 2021 17:39:48 -0500 Subject: [PATCH 039/193] Try building SuiteSparse:GraphBLAS from upstream --- .github/workflows/test.yml | 4 +++- continuous_integration/environment.yml | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6606799..091a633 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,8 @@ jobs: strategy: fail-fast: false matrix: - os: ["ubuntu-latest", "macos-latest", "windows-latest"] + # os: ["ubuntu-latest", "macos-latest", "windows-latest"] + os: ["ubuntu-latest"] python-version: [3.7, 3.8, 3.9] steps: - name: Checkout @@ -29,6 +30,7 @@ jobs: activate-environment: suitesparse-graphblas - name: Build run: | + sh suitesparse.sh refs/tags/6.0.0.alpha11 python setup.py build_ext --inplace python setup.py develop - name: Test diff --git a/continuous_integration/environment.yml b/continuous_integration/environment.yml index c7f8251..5b990c8 100644 --- a/continuous_integration/environment.yml +++ b/continuous_integration/environment.yml @@ -3,7 +3,7 @@ channels: - conda-forge - defaults dependencies: - - graphblas=5.1.3 + # - graphblas=5.1.8 - cffi - cython - numpy From b96048503c1f7a5fc948809e315d95ea8155bb6f Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Wed, 6 Oct 2021 17:42:39 -0500 Subject: [PATCH 040/193] Include alpha string in version number --- suitesparse.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/suitesparse.sh b/suitesparse.sh index 3984649..5ee2c0b 100644 --- a/suitesparse.sh +++ b/suitesparse.sh @@ -1,5 +1,5 @@ -if [[ $1 =~ refs/tags/([0-9]\.[0-9]\.[0-9]).*$ ]]; +if [[ $1 =~ refs/tags/([0-9]\.[0-9]\.[0-9].*$) ]]; then VERSION=${BASH_REMATCH[1]} else From 1e5224fcf89af3f481f83a254403755cc0a4d1b8 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Wed, 6 Oct 2021 18:11:20 -0500 Subject: [PATCH 041/193] inline build commands --- .github/workflows/test.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 091a633..c093cef 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,7 +30,14 @@ jobs: activate-environment: suitesparse-graphblas - name: Build run: | - sh suitesparse.sh refs/tags/6.0.0.alpha11 + # sh suitesparse.sh refs/tags/6.0.0.alpha11 + curl -L https://github.com/DrTimothyAldenDavis/GraphBLAS/archive/refs/tags/v6.0.0.alpha11.tar.gz | tar xzf - + pushd GraphBLAS-6.0.0.alpha11/build + cmake .. -DCMAKE_BUILD_TYPE=Release + make -j$(nproc) + make install + popd + python setup.py build_ext --inplace python setup.py develop - name: Test From 559a73a5aaca781259452a2a33d420bb36b40a0e Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Wed, 6 Oct 2021 20:05:25 -0500 Subject: [PATCH 042/193] sudo --- .github/workflows/test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c093cef..eeb0cb8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,7 +16,8 @@ jobs: matrix: # os: ["ubuntu-latest", "macos-latest", "windows-latest"] os: ["ubuntu-latest"] - python-version: [3.7, 3.8, 3.9] + # python-version: [3.7, 3.8, 3.9] + python-version: [3.8] steps: - name: Checkout uses: actions/checkout@v2 @@ -35,7 +36,7 @@ jobs: pushd GraphBLAS-6.0.0.alpha11/build cmake .. -DCMAKE_BUILD_TYPE=Release make -j$(nproc) - make install + sudo make install popd python setup.py build_ext --inplace From a11f8f395af4ce4b0ab84dad20da8ac7f5a7feeb Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Wed, 6 Oct 2021 22:17:38 -0500 Subject: [PATCH 043/193] Try installing GraphBLAS in local conda environment --- .github/workflows/test.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index eeb0cb8..cee7b83 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,9 +34,15 @@ jobs: # sh suitesparse.sh refs/tags/6.0.0.alpha11 curl -L https://github.com/DrTimothyAldenDavis/GraphBLAS/archive/refs/tags/v6.0.0.alpha11.tar.gz | tar xzf - pushd GraphBLAS-6.0.0.alpha11/build - cmake .. -DCMAKE_BUILD_TYPE=Release - make -j$(nproc) - sudo make install + + export PREFIX="${CONDA_PREFIX}" + export INSTALL="${PREFIX}" + export CMAKE_OPTIONS="-DCMAKE_INSTALL_PREFIX=${PREFIX} -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release" + echo ${CMAKE_OPTIONS} + + cmake .. + make library VERBOSE=1 JOBS=16 + make install VERBOSE=1 popd python setup.py build_ext --inplace From 76e23310c0272e36fdfee8729e85160e19c399a4 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Wed, 6 Oct 2021 22:51:58 -0500 Subject: [PATCH 044/193] I'm so bad at this --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cee7b83..bba1e62 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -41,7 +41,7 @@ jobs: echo ${CMAKE_OPTIONS} cmake .. - make library VERBOSE=1 JOBS=16 + make VERBOSE=1 JOBS=16 make install VERBOSE=1 popd From 5209f71687de61419c28582ed765e65367f9c361 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Thu, 7 Oct 2021 11:48:18 -0500 Subject: [PATCH 045/193] I'm so bad at cmake --- .github/workflows/test.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bba1e62..99d88bc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,15 +34,11 @@ jobs: # sh suitesparse.sh refs/tags/6.0.0.alpha11 curl -L https://github.com/DrTimothyAldenDavis/GraphBLAS/archive/refs/tags/v6.0.0.alpha11.tar.gz | tar xzf - pushd GraphBLAS-6.0.0.alpha11/build + echo ${CONDA_PREFIX} - export PREFIX="${CONDA_PREFIX}" - export INSTALL="${PREFIX}" - export CMAKE_OPTIONS="-DCMAKE_INSTALL_PREFIX=${PREFIX} -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release" - echo ${CMAKE_OPTIONS} - - cmake .. - make VERBOSE=1 JOBS=16 - make install VERBOSE=1 + cmake -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release .. + make JOBS=16 + make install popd python setup.py build_ext --inplace From 333edc4e80f505d4edf1f57552fc3c2c54fdaf22 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Thu, 7 Oct 2021 11:52:44 -0500 Subject: [PATCH 046/193] Fix usage of GrB_Matrix_wait --- suitesparse_graphblas/io/binary.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/suitesparse_graphblas/io/binary.py b/suitesparse_graphblas/io/binary.py index 410b769..603a291 100644 --- a/suitesparse_graphblas/io/binary.py +++ b/suitesparse_graphblas/io/binary.py @@ -90,7 +90,7 @@ def binwrite(A, filename, comments=None, opener=Path.open): if isinstance(filename, str): filename = Path(filename) - check_status(A, lib.GrB_Matrix_wait(A)) + check_status(A, lib.GrB_Matrix_wait(A[0], lib.GrB_MATERIALIZE)) ffinew = ffi.new From cbe3908b2366674ebec6420d95ae717709955999 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Sat, 9 Oct 2021 22:53:22 -0500 Subject: [PATCH 047/193] Update to 6.0.0.alpha12 --- .github/workflows/test.yml | 6 +- suitesparse_graphblas/suitesparse_graphblas.h | 128 +++++++++--------- .../suitesparse_graphblas_no_complex.h | 112 +++++++-------- 3 files changed, 123 insertions(+), 123 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 99d88bc..95cd52c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,9 +31,9 @@ jobs: activate-environment: suitesparse-graphblas - name: Build run: | - # sh suitesparse.sh refs/tags/6.0.0.alpha11 - curl -L https://github.com/DrTimothyAldenDavis/GraphBLAS/archive/refs/tags/v6.0.0.alpha11.tar.gz | tar xzf - - pushd GraphBLAS-6.0.0.alpha11/build + # sh suitesparse.sh refs/tags/6.0.0.alpha12 + curl -L https://github.com/DrTimothyAldenDavis/GraphBLAS/archive/refs/tags/v6.0.0.alpha12.tar.gz | tar xzf - + pushd GraphBLAS-6.0.0.alpha12/build echo ${CONDA_PREFIX} cmake -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release .. diff --git a/suitesparse_graphblas/suitesparse_graphblas.h b/suitesparse_graphblas/suitesparse_graphblas.h index ecdf84a..48bfa51 100644 --- a/suitesparse_graphblas/suitesparse_graphblas.h +++ b/suitesparse_graphblas/suitesparse_graphblas.h @@ -21,7 +21,7 @@ typedef struct GB_SelectOp_opaque *GxB_SelectOp; /* GxB typedefs (functions) */ typedef bool (*GxB_select_function)(int64_t i, int64_t j, const void *x, const void *thunk); typedef void (*GxB_binary_function)(void *, const void *, const void *); -typedef void (*GxB_index_unary_function)(void *z, const void *x, int64_t i, int64_t j, const void *thunk); +typedef void (*GxB_index_unary_function)(void *z, const void *x, int64_t i, int64_t j, const void *y); typedef void (*GxB_unary_function)(void *, const void *); /* GrB enums */ @@ -2625,7 +2625,7 @@ extern GrB_Info GrB_Descriptor_wait(GrB_Descriptor desc, GrB_WaitMode waitmode); /* indexunary */ extern GrB_Info GrB_IndexUnaryOp_error(const char **error, const GrB_IndexUnaryOp op); extern GrB_Info GrB_IndexUnaryOp_free(GrB_IndexUnaryOp *op); -extern GrB_Info GrB_IndexUnaryOp_new(GrB_IndexUnaryOp *op, GxB_index_unary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ttype); +extern GrB_Info GrB_IndexUnaryOp_new(GrB_IndexUnaryOp *op, GxB_index_unary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype); extern GrB_Info GrB_IndexUnaryOp_wait(GrB_IndexUnaryOp op, GrB_WaitMode waitmode); /* matrix */ @@ -2658,19 +2658,19 @@ extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT8(GrB_Matrix C, const GrB_Matri extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, uint16_t y, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, uint32_t y, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, uint64_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, bool thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, float thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, double thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int8_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int16_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int32_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int64_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const GrB_Scalar thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const void *thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint8_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint16_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint32_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint64_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, bool y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, float y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, double y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int8_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int16_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int32_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int64_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const GrB_Scalar y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const void *y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint8_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint16_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint32_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint64_t y, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_assign(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_assign_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_assign_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); @@ -2763,19 +2763,19 @@ extern GrB_Info GrB_Matrix_reduce_UINT32(uint32_t *c, const GrB_BinaryOp accum, extern GrB_Info GrB_Matrix_reduce_UINT64(uint64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_removeElement(GrB_Matrix C, GrB_Index i, GrB_Index j); extern GrB_Info GrB_Matrix_resize(GrB_Matrix C, GrB_Index nrows_new, GrB_Index ncols_new); -extern GrB_Info GrB_Matrix_select_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, bool thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, float thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, double thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int8_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int16_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int32_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int64_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const GrB_Scalar thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const void *thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint8_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint16_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint32_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint64_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, bool y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, float y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, double y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int8_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int16_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int32_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int64_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const GrB_Scalar y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const void *y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint8_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint16_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint32_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint64_t y, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_serialize(void *blob, GrB_Index *blob_size_handle, GrB_Matrix A); extern GrB_Info GrB_Matrix_serializeSize(GrB_Index *blob_size_handle, GrB_Matrix A); extern GrB_Info GrB_Matrix_setElement_BOOL(GrB_Matrix C, bool x, GrB_Index i, GrB_Index j); @@ -2894,19 +2894,19 @@ extern GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT8(GrB_Vector w, const GrB_Vecto extern GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, uint16_t y, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, uint32_t y, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, uint64_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, bool thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, float thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, double thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int8_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int16_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int32_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int64_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const GrB_Scalar thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const void *thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint8_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint16_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint32_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint64_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, bool y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, float y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, double y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int8_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int16_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int32_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int64_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const GrB_Scalar y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const void *y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint8_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint16_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint32_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint64_t y, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_assign(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_assign_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_assign_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); @@ -2987,19 +2987,19 @@ extern GrB_Info GrB_Vector_reduce_UINT32(uint32_t *c, const GrB_BinaryOp accum, extern GrB_Info GrB_Vector_reduce_UINT64(uint64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_removeElement(GrB_Vector v, GrB_Index i); extern GrB_Info GrB_Vector_resize(GrB_Vector w, GrB_Index nrows_new); -extern GrB_Info GrB_Vector_select_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, bool thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, float thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, double thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int8_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int16_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int32_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int64_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const GrB_Scalar thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const void *thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint8_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint16_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint32_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint64_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, bool y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, float y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, double y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int8_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int16_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int32_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int64_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const GrB_Scalar y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const void *y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint8_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint16_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint32_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint64_t y, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_serialize(void *blob, GrB_Index *blob_size_handle, GrB_Vector u); extern GrB_Info GrB_Vector_serializeSize(GrB_Index *blob_size_handle, GrB_Vector u); extern GrB_Info GrB_Vector_setElement_BOOL(GrB_Vector w, bool x, GrB_Index i); @@ -3053,9 +3053,9 @@ extern GrB_Info GxB_Descriptor_get(GrB_Desc_Value *val, GrB_Descriptor desc, GrB /* indexunary */ extern GrB_Info GxB_IndexUnaryOp_fprint(GrB_IndexUnaryOp op, const char *name, GxB_Print_Level pr, FILE *f); -extern GrB_Info GxB_IndexUnaryOp_new(GrB_IndexUnaryOp *op, GxB_index_unary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ttype, const char *idxop_name, const char *idxop_defn); -extern GrB_Info GxB_IndexUnaryOp_ttype_name(char *type_name, const GrB_IndexUnaryOp op); +extern GrB_Info GxB_IndexUnaryOp_new(GrB_IndexUnaryOp *op, GxB_index_unary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *idxop_name, const char *idxop_defn); extern GrB_Info GxB_IndexUnaryOp_xtype_name(char *type_name, const GrB_IndexUnaryOp op); +extern GrB_Info GxB_IndexUnaryOp_ytype_name(char *type_name, const GrB_IndexUnaryOp op); extern GrB_Info GxB_IndexUnaryOp_ztype_name(char *type_name, const GrB_IndexUnaryOp op); /* matrix */ @@ -3068,8 +3068,8 @@ extern GrB_Info GxB_Matrix_apply_BinaryOp1st_FC64(GrB_Matrix C, const GrB_Matrix extern GrB_Info GxB_Matrix_apply_BinaryOp2nd(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Scalar y, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_apply_BinaryOp2nd_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, GxB_FC32_t y, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_apply_BinaryOp2nd_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, GxB_FC64_t y, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_apply_IndexOp_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, GxB_FC32_t thunk, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_apply_IndexOp_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, GxB_FC64_t thunk, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_apply_IndexOp_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, GxB_FC32_t y, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_apply_IndexOp_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, GxB_FC64_t y, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_assign_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_assign_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_build_FC32(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const GxB_FC32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); @@ -3112,8 +3112,8 @@ extern GrB_Info GxB_Matrix_pack_HyperCSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index extern GrB_Info GxB_Matrix_reduce_FC32(GxB_FC32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_reduce_FC64(GxB_FC64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_select(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Matrix A, const GrB_Scalar Thunk, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_select_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, GxB_FC32_t thunk, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_select_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, GxB_FC64_t thunk, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_select_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, GxB_FC32_t y, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_select_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, GxB_FC64_t y, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_serialize(void **blob_handle, GrB_Index *blob_size_handle, GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_setElement_FC32(GrB_Matrix C, GxB_FC32_t x, GrB_Index i, GrB_Index j); extern GrB_Info GxB_Matrix_setElement_FC64(GrB_Matrix C, GxB_FC64_t x, GrB_Index i, GrB_Index j); @@ -3247,8 +3247,8 @@ extern GrB_Info GxB_Vector_apply_BinaryOp1st_FC64(GrB_Vector w, const GrB_Vector extern GrB_Info GxB_Vector_apply_BinaryOp2nd(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const GrB_Scalar y, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_apply_BinaryOp2nd_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, GxB_FC32_t y, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_apply_BinaryOp2nd_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, GxB_FC64_t y, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_apply_IndexOp_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, GxB_FC32_t thunk, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_apply_IndexOp_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, GxB_FC64_t thunk, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_apply_IndexOp_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, GxB_FC32_t y, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_apply_IndexOp_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, GxB_FC64_t y, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_assign_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GxB_FC32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_assign_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_build_FC32(GrB_Vector w, const GrB_Index *I, const GxB_FC32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); @@ -3274,8 +3274,8 @@ extern GrB_Info GxB_Vector_pack_Full(GrB_Vector v, void **vx, GrB_Index vx_size, extern GrB_Info GxB_Vector_reduce_FC32(GxB_FC32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_reduce_FC64(GxB_FC64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_select(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Vector u, const GrB_Scalar Thunk, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_select_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, GxB_FC32_t thunk, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_select_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, GxB_FC64_t thunk, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_select_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, GxB_FC32_t y, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_select_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, GxB_FC64_t y, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_serialize(void **blob_handle, GrB_Index *blob_size_handle, GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_setElement_FC32(GrB_Vector w, GxB_FC32_t x, GrB_Index i); extern GrB_Info GxB_Vector_setElement_FC64(GrB_Vector w, GxB_FC64_t x, GrB_Index i); diff --git a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h index 630e2af..4d9e17c 100644 --- a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h +++ b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h @@ -19,7 +19,7 @@ typedef struct GB_SelectOp_opaque *GxB_SelectOp; /* GxB typedefs (functions) */ typedef bool (*GxB_select_function)(int64_t i, int64_t j, const void *x, const void *thunk); typedef void (*GxB_binary_function)(void *, const void *, const void *); -typedef void (*GxB_index_unary_function)(void *z, const void *x, int64_t i, int64_t j, const void *thunk); +typedef void (*GxB_index_unary_function)(void *z, const void *x, int64_t i, int64_t j, const void *y); typedef void (*GxB_unary_function)(void *, const void *); /* GrB enums */ @@ -2453,7 +2453,7 @@ extern GrB_Info GrB_Descriptor_wait(GrB_Descriptor desc, GrB_WaitMode waitmode); /* indexunary */ extern GrB_Info GrB_IndexUnaryOp_error(const char **error, const GrB_IndexUnaryOp op); extern GrB_Info GrB_IndexUnaryOp_free(GrB_IndexUnaryOp *op); -extern GrB_Info GrB_IndexUnaryOp_new(GrB_IndexUnaryOp *op, GxB_index_unary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ttype); +extern GrB_Info GrB_IndexUnaryOp_new(GrB_IndexUnaryOp *op, GxB_index_unary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype); extern GrB_Info GrB_IndexUnaryOp_wait(GrB_IndexUnaryOp op, GrB_WaitMode waitmode); /* matrix */ @@ -2486,19 +2486,19 @@ extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT8(GrB_Matrix C, const GrB_Matri extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, uint16_t y, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, uint32_t y, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, uint64_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, bool thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, float thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, double thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int8_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int16_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int32_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int64_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const GrB_Scalar thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const void *thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint8_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint16_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint32_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint64_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, bool y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, float y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, double y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int8_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int16_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int32_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int64_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const GrB_Scalar y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const void *y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint8_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint16_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint32_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint64_t y, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_assign(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_assign_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_assign_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); @@ -2591,19 +2591,19 @@ extern GrB_Info GrB_Matrix_reduce_UINT32(uint32_t *c, const GrB_BinaryOp accum, extern GrB_Info GrB_Matrix_reduce_UINT64(uint64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_removeElement(GrB_Matrix C, GrB_Index i, GrB_Index j); extern GrB_Info GrB_Matrix_resize(GrB_Matrix C, GrB_Index nrows_new, GrB_Index ncols_new); -extern GrB_Info GrB_Matrix_select_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, bool thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, float thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, double thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int8_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int16_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int32_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int64_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const GrB_Scalar thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const void *thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint8_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint16_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint32_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint64_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, bool y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, float y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, double y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int8_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int16_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int32_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int64_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const GrB_Scalar y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const void *y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint8_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint16_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint32_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint64_t y, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_serialize(void *blob, GrB_Index *blob_size_handle, GrB_Matrix A); extern GrB_Info GrB_Matrix_serializeSize(GrB_Index *blob_size_handle, GrB_Matrix A); extern GrB_Info GrB_Matrix_setElement_BOOL(GrB_Matrix C, bool x, GrB_Index i, GrB_Index j); @@ -2722,19 +2722,19 @@ extern GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT8(GrB_Vector w, const GrB_Vecto extern GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, uint16_t y, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, uint32_t y, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, uint64_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, bool thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, float thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, double thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int8_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int16_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int32_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int64_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const GrB_Scalar thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const void *thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint8_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint16_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint32_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint64_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, bool y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, float y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, double y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int8_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int16_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int32_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int64_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const GrB_Scalar y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const void *y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint8_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint16_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint32_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint64_t y, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_assign(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_assign_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_assign_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); @@ -2815,19 +2815,19 @@ extern GrB_Info GrB_Vector_reduce_UINT32(uint32_t *c, const GrB_BinaryOp accum, extern GrB_Info GrB_Vector_reduce_UINT64(uint64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_removeElement(GrB_Vector v, GrB_Index i); extern GrB_Info GrB_Vector_resize(GrB_Vector w, GrB_Index nrows_new); -extern GrB_Info GrB_Vector_select_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, bool thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, float thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, double thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int8_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int16_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int32_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int64_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const GrB_Scalar thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const void *thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint8_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint16_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint32_t thunk, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint64_t thunk, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, bool y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, float y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, double y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int8_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int16_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int32_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int64_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const GrB_Scalar y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const void *y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint8_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint16_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint32_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint64_t y, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_serialize(void *blob, GrB_Index *blob_size_handle, GrB_Vector u); extern GrB_Info GrB_Vector_serializeSize(GrB_Index *blob_size_handle, GrB_Vector u); extern GrB_Info GrB_Vector_setElement_BOOL(GrB_Vector w, bool x, GrB_Index i); @@ -2881,9 +2881,9 @@ extern GrB_Info GxB_Descriptor_get(GrB_Desc_Value *val, GrB_Descriptor desc, GrB /* indexunary */ extern GrB_Info GxB_IndexUnaryOp_fprint(GrB_IndexUnaryOp op, const char *name, GxB_Print_Level pr, FILE *f); -extern GrB_Info GxB_IndexUnaryOp_new(GrB_IndexUnaryOp *op, GxB_index_unary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ttype, const char *idxop_name, const char *idxop_defn); -extern GrB_Info GxB_IndexUnaryOp_ttype_name(char *type_name, const GrB_IndexUnaryOp op); +extern GrB_Info GxB_IndexUnaryOp_new(GrB_IndexUnaryOp *op, GxB_index_unary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *idxop_name, const char *idxop_defn); extern GrB_Info GxB_IndexUnaryOp_xtype_name(char *type_name, const GrB_IndexUnaryOp op); +extern GrB_Info GxB_IndexUnaryOp_ytype_name(char *type_name, const GrB_IndexUnaryOp op); extern GrB_Info GxB_IndexUnaryOp_ztype_name(char *type_name, const GrB_IndexUnaryOp op); /* matrix */ From 879aadda9fa3becd99f12786fd0d51854e30b35b Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Fri, 29 Oct 2021 16:04:20 -0500 Subject: [PATCH 048/193] Update to alpha16 --- .github/workflows/test.yml | 6 ++-- suitesparse_graphblas/suitesparse_graphblas.h | 30 +++++++++++-------- .../suitesparse_graphblas_no_complex.h | 30 +++++++++++-------- 3 files changed, 37 insertions(+), 29 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 95cd52c..8c8aca7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,9 +31,9 @@ jobs: activate-environment: suitesparse-graphblas - name: Build run: | - # sh suitesparse.sh refs/tags/6.0.0.alpha12 - curl -L https://github.com/DrTimothyAldenDavis/GraphBLAS/archive/refs/tags/v6.0.0.alpha12.tar.gz | tar xzf - - pushd GraphBLAS-6.0.0.alpha12/build + # sh suitesparse.sh refs/tags/6.0.0.alpha16 + curl -L https://github.com/DrTimothyAldenDavis/GraphBLAS/archive/refs/tags/v6.0.0.alpha16.tar.gz | tar xzf - + pushd GraphBLAS-6.0.0.alpha16/build echo ${CONDA_PREFIX} cmake -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release .. diff --git a/suitesparse_graphblas/suitesparse_graphblas.h b/suitesparse_graphblas/suitesparse_graphblas.h index 48bfa51..a238ab3 100644 --- a/suitesparse_graphblas/suitesparse_graphblas.h +++ b/suitesparse_graphblas/suitesparse_graphblas.h @@ -19,9 +19,9 @@ typedef struct GB_Scalar_opaque *GxB_Scalar; typedef struct GB_SelectOp_opaque *GxB_SelectOp; /* GxB typedefs (functions) */ -typedef bool (*GxB_select_function)(int64_t i, int64_t j, const void *x, const void *thunk); +typedef bool (*GxB_select_function)(GrB_Index i, GrB_Index j, const void *x, const void *thunk); typedef void (*GxB_binary_function)(void *, const void *, const void *); -typedef void (*GxB_index_unary_function)(void *z, const void *x, int64_t i, int64_t j, const void *y); +typedef void (*GxB_index_unary_function)(void *z, const void *x, GrB_Index i, GrB_Index j, const void *y); typedef void (*GxB_unary_function)(void *, const void *); /* GrB enums */ @@ -61,9 +61,7 @@ typedef enum { GrB_CSR_FORMAT = 0, GrB_CSC_FORMAT = 1, - GrB_COO_FORMAT = 2, - GrB_DENSE_ROW_FORMAT = 3, - GrB_DENSE_COL_FORMAT = 4 + GrB_COO_FORMAT = 2 } GrB_Format; typedef enum @@ -378,20 +376,20 @@ extern GrB_Descriptor GrB_DESC_ST1; extern GrB_Descriptor GrB_DESC_T0; extern GrB_Descriptor GrB_DESC_T0T1; extern GrB_Descriptor GrB_DESC_T1; -extern GrB_IndexUnaryOp GrB_COLGT_INT64; +extern GrB_IndexUnaryOp GrB_COLGT; extern GrB_IndexUnaryOp GrB_COLINDEX_INT32; extern GrB_IndexUnaryOp GrB_COLINDEX_INT64; -extern GrB_IndexUnaryOp GrB_COLLE_INT64; +extern GrB_IndexUnaryOp GrB_COLLE; +extern GrB_IndexUnaryOp GrB_DIAG; extern GrB_IndexUnaryOp GrB_DIAGINDEX_INT32; extern GrB_IndexUnaryOp GrB_DIAGINDEX_INT64; -extern GrB_IndexUnaryOp GrB_DIAG_INT64; -extern GrB_IndexUnaryOp GrB_OFFDIAG_INT64; -extern GrB_IndexUnaryOp GrB_ROWGT_INT64; +extern GrB_IndexUnaryOp GrB_OFFDIAG; +extern GrB_IndexUnaryOp GrB_ROWGT; extern GrB_IndexUnaryOp GrB_ROWINDEX_INT32; extern GrB_IndexUnaryOp GrB_ROWINDEX_INT64; -extern GrB_IndexUnaryOp GrB_ROWLE_INT64; -extern GrB_IndexUnaryOp GrB_TRIL_INT64; -extern GrB_IndexUnaryOp GrB_TRIU_INT64; +extern GrB_IndexUnaryOp GrB_ROWLE; +extern GrB_IndexUnaryOp GrB_TRIL; +extern GrB_IndexUnaryOp GrB_TRIU; extern GrB_IndexUnaryOp GrB_VALUEEQ_BOOL; extern GrB_IndexUnaryOp GrB_VALUEEQ_FP32; extern GrB_IndexUnaryOp GrB_VALUEEQ_FP64; @@ -2742,6 +2740,7 @@ extern GrB_Info GrB_Matrix_import(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, extern GrB_Info GrB_Matrix_kronecker_BinaryOp(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_kronecker_Monoid(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_kronecker_Semiring(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_nameless(GrB_Scalar S, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_ncols(GrB_Index *ncols, const GrB_Matrix A); extern GrB_Info GrB_Matrix_new(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols); extern GrB_Info GrB_Matrix_nrows(GrB_Index *nrows, const GrB_Matrix A); @@ -2970,6 +2969,7 @@ extern GrB_Info GrB_Vector_extractTuples_UINT16(GrB_Index *I, uint16_t *X, GrB_I extern GrB_Info GrB_Vector_extractTuples_UINT32(GrB_Index *I, uint32_t *X, GrB_Index *nvals, const GrB_Vector v); extern GrB_Info GrB_Vector_extractTuples_UINT64(GrB_Index *I, uint64_t *X, GrB_Index *nvals, const GrB_Vector v); extern GrB_Info GrB_Vector_free(GrB_Vector *v); +extern GrB_Info GrB_Vector_nameless(GrB_Scalar c, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_new(GrB_Vector *v, GrB_Type type, GrB_Index n); extern GrB_Info GrB_Vector_nvals(GrB_Index *nvals, const GrB_Vector v); extern GrB_Info GrB_Vector_reduce_BOOL(bool *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); @@ -3078,6 +3078,7 @@ extern GrB_Info GxB_Matrix_build_Scalar(GrB_Matrix C, const GrB_Index *I, const extern GrB_Info GxB_Matrix_concat(GrB_Matrix C, const GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_deserialize(GrB_Matrix *C, GrB_Type type, const void *blob, GrB_Index blob_size, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_diag(GrB_Matrix C, const GrB_Vector v, int64_t k, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_eWiseUnion(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Matrix A, const GrB_Scalar Amissing, const GrB_Matrix B, const GrB_Scalar Bmissing, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_export_BitmapC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_export_BitmapR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_export_CSC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); @@ -3117,6 +3118,7 @@ extern GrB_Info GxB_Matrix_select_FC64(GrB_Matrix C, const GrB_Matrix Mask, cons extern GrB_Info GxB_Matrix_serialize(void **blob_handle, GrB_Index *blob_size_handle, GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_setElement_FC32(GrB_Matrix C, GxB_FC32_t x, GrB_Index i, GrB_Index j); extern GrB_Info GxB_Matrix_setElement_FC64(GrB_Matrix C, GxB_FC64_t x, GrB_Index i, GrB_Index j); +extern GrB_Info GxB_Matrix_sort(GrB_Matrix C, GrB_Matrix P, GrB_BinaryOp op, GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_split(GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Index *Tile_nrows, const GrB_Index *Tile_ncols, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_subassign(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_subassign_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); @@ -3255,6 +3257,7 @@ extern GrB_Info GxB_Vector_build_FC32(GrB_Vector w, const GrB_Index *I, const Gx extern GrB_Info GxB_Vector_build_FC64(GrB_Vector w, const GrB_Index *I, const GxB_FC64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); extern GrB_Info GxB_Vector_build_Scalar(GrB_Vector w, const GrB_Index *I, GrB_Scalar scalar, GrB_Index nvals); extern GrB_Info GxB_Vector_deserialize(GrB_Vector *w, GrB_Type type, const void *blob, GrB_Index blob_size, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_eWiseUnion(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Vector u, const GrB_Scalar umissing, const GrB_Vector v, const GrB_Scalar vmissing, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_export_Bitmap(GrB_Vector *v, GrB_Type *type, GrB_Index *n, int8_t **vb, void **vx, GrB_Index *vb_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_export_CSC(GrB_Vector *v, GrB_Type *type, GrB_Index *n, GrB_Index **vi, void **vx, GrB_Index *vi_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, bool *jumbled, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_export_Full(GrB_Vector *v, GrB_Type *type, GrB_Index *n, void **vx, GrB_Index *vx_size, bool *iso, const GrB_Descriptor desc); @@ -3279,6 +3282,7 @@ extern GrB_Info GxB_Vector_select_FC64(GrB_Vector w, const GrB_Vector mask, cons extern GrB_Info GxB_Vector_serialize(void **blob_handle, GrB_Index *blob_size_handle, GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_setElement_FC32(GrB_Vector w, GxB_FC32_t x, GrB_Index i); extern GrB_Info GxB_Vector_setElement_FC64(GrB_Vector w, GxB_FC64_t x, GrB_Index i); +extern GrB_Info GxB_Vector_sort(GrB_Vector w, GrB_Vector p, GrB_BinaryOp op, GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_subassign(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_subassign_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_subassign_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GxB_FC32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); diff --git a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h index 4d9e17c..9cbc7df 100644 --- a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h +++ b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h @@ -17,9 +17,9 @@ typedef struct GB_Scalar_opaque *GxB_Scalar; typedef struct GB_SelectOp_opaque *GxB_SelectOp; /* GxB typedefs (functions) */ -typedef bool (*GxB_select_function)(int64_t i, int64_t j, const void *x, const void *thunk); +typedef bool (*GxB_select_function)(GrB_Index i, GrB_Index j, const void *x, const void *thunk); typedef void (*GxB_binary_function)(void *, const void *, const void *); -typedef void (*GxB_index_unary_function)(void *z, const void *x, int64_t i, int64_t j, const void *y); +typedef void (*GxB_index_unary_function)(void *z, const void *x, GrB_Index i, GrB_Index j, const void *y); typedef void (*GxB_unary_function)(void *, const void *); /* GrB enums */ @@ -59,9 +59,7 @@ typedef enum { GrB_CSR_FORMAT = 0, GrB_CSC_FORMAT = 1, - GrB_COO_FORMAT = 2, - GrB_DENSE_ROW_FORMAT = 3, - GrB_DENSE_COL_FORMAT = 4 + GrB_COO_FORMAT = 2 } GrB_Format; typedef enum @@ -376,20 +374,20 @@ extern GrB_Descriptor GrB_DESC_ST1; extern GrB_Descriptor GrB_DESC_T0; extern GrB_Descriptor GrB_DESC_T0T1; extern GrB_Descriptor GrB_DESC_T1; -extern GrB_IndexUnaryOp GrB_COLGT_INT64; +extern GrB_IndexUnaryOp GrB_COLGT; extern GrB_IndexUnaryOp GrB_COLINDEX_INT32; extern GrB_IndexUnaryOp GrB_COLINDEX_INT64; -extern GrB_IndexUnaryOp GrB_COLLE_INT64; +extern GrB_IndexUnaryOp GrB_COLLE; +extern GrB_IndexUnaryOp GrB_DIAG; extern GrB_IndexUnaryOp GrB_DIAGINDEX_INT32; extern GrB_IndexUnaryOp GrB_DIAGINDEX_INT64; -extern GrB_IndexUnaryOp GrB_DIAG_INT64; -extern GrB_IndexUnaryOp GrB_OFFDIAG_INT64; -extern GrB_IndexUnaryOp GrB_ROWGT_INT64; +extern GrB_IndexUnaryOp GrB_OFFDIAG; +extern GrB_IndexUnaryOp GrB_ROWGT; extern GrB_IndexUnaryOp GrB_ROWINDEX_INT32; extern GrB_IndexUnaryOp GrB_ROWINDEX_INT64; -extern GrB_IndexUnaryOp GrB_ROWLE_INT64; -extern GrB_IndexUnaryOp GrB_TRIL_INT64; -extern GrB_IndexUnaryOp GrB_TRIU_INT64; +extern GrB_IndexUnaryOp GrB_ROWLE; +extern GrB_IndexUnaryOp GrB_TRIL; +extern GrB_IndexUnaryOp GrB_TRIU; extern GrB_IndexUnaryOp GrB_VALUEEQ_BOOL; extern GrB_IndexUnaryOp GrB_VALUEEQ_FP32; extern GrB_IndexUnaryOp GrB_VALUEEQ_FP64; @@ -2570,6 +2568,7 @@ extern GrB_Info GrB_Matrix_import(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, extern GrB_Info GrB_Matrix_kronecker_BinaryOp(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_kronecker_Monoid(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_kronecker_Semiring(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_nameless(GrB_Scalar S, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_ncols(GrB_Index *ncols, const GrB_Matrix A); extern GrB_Info GrB_Matrix_new(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols); extern GrB_Info GrB_Matrix_nrows(GrB_Index *nrows, const GrB_Matrix A); @@ -2798,6 +2797,7 @@ extern GrB_Info GrB_Vector_extractTuples_UINT16(GrB_Index *I, uint16_t *X, GrB_I extern GrB_Info GrB_Vector_extractTuples_UINT32(GrB_Index *I, uint32_t *X, GrB_Index *nvals, const GrB_Vector v); extern GrB_Info GrB_Vector_extractTuples_UINT64(GrB_Index *I, uint64_t *X, GrB_Index *nvals, const GrB_Vector v); extern GrB_Info GrB_Vector_free(GrB_Vector *v); +extern GrB_Info GrB_Vector_nameless(GrB_Scalar c, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_new(GrB_Vector *v, GrB_Type type, GrB_Index n); extern GrB_Info GrB_Vector_nvals(GrB_Index *nvals, const GrB_Vector v); extern GrB_Info GrB_Vector_reduce_BOOL(bool *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); @@ -2896,6 +2896,7 @@ extern GrB_Info GxB_Matrix_build_Scalar(GrB_Matrix C, const GrB_Index *I, const extern GrB_Info GxB_Matrix_concat(GrB_Matrix C, const GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_deserialize(GrB_Matrix *C, GrB_Type type, const void *blob, GrB_Index blob_size, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_diag(GrB_Matrix C, const GrB_Vector v, int64_t k, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_eWiseUnion(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Matrix A, const GrB_Scalar Amissing, const GrB_Matrix B, const GrB_Scalar Bmissing, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_export_BitmapC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_export_BitmapR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_export_CSC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); @@ -2925,6 +2926,7 @@ extern GrB_Info GxB_Matrix_pack_HyperCSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index extern GrB_Info GxB_Matrix_pack_HyperCSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_select(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Matrix A, const GrB_Scalar Thunk, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_serialize(void **blob_handle, GrB_Index *blob_size_handle, GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_sort(GrB_Matrix C, GrB_Matrix P, GrB_BinaryOp op, GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_split(GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Index *Tile_nrows, const GrB_Index *Tile_ncols, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_subassign(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_subassign_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); @@ -3043,6 +3045,7 @@ extern GrB_Info GxB_Vector_apply_BinaryOp1st(GrB_Vector w, const GrB_Vector mask extern GrB_Info GxB_Vector_apply_BinaryOp2nd(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const GrB_Scalar y, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_build_Scalar(GrB_Vector w, const GrB_Index *I, GrB_Scalar scalar, GrB_Index nvals); extern GrB_Info GxB_Vector_deserialize(GrB_Vector *w, GrB_Type type, const void *blob, GrB_Index blob_size, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_eWiseUnion(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Vector u, const GrB_Scalar umissing, const GrB_Vector v, const GrB_Scalar vmissing, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_export_Bitmap(GrB_Vector *v, GrB_Type *type, GrB_Index *n, int8_t **vb, void **vx, GrB_Index *vb_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_export_CSC(GrB_Vector *v, GrB_Type *type, GrB_Index *n, GrB_Index **vi, void **vx, GrB_Index *vi_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, bool *jumbled, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_export_Full(GrB_Vector *v, GrB_Type *type, GrB_Index *n, void **vx, GrB_Index *vx_size, bool *iso, const GrB_Descriptor desc); @@ -3057,6 +3060,7 @@ extern GrB_Info GxB_Vector_pack_CSC(GrB_Vector v, GrB_Index **vi, void **vx, GrB extern GrB_Info GxB_Vector_pack_Full(GrB_Vector v, void **vx, GrB_Index vx_size, bool iso, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_select(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Vector u, const GrB_Scalar Thunk, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_serialize(void **blob_handle, GrB_Index *blob_size_handle, GrB_Vector u, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_sort(GrB_Vector w, GrB_Vector p, GrB_BinaryOp op, GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_subassign(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_subassign_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_subassign_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); From d0319acead6f06a0f99517db504b73afdf908129 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Fri, 29 Oct 2021 16:12:03 -0500 Subject: [PATCH 049/193] run isort --- setup.cfg | 7 +++++ setup.py | 13 ++++---- suitesparse_graphblas/__init__.py | 4 +-- suitesparse_graphblas/build.py | 1 + suitesparse_graphblas/create_headers.py | 11 +++++-- suitesparse_graphblas/io/binary.py | 5 ++-- suitesparse_graphblas/matrix.py | 6 +--- suitesparse_graphblas/scalar.py | 7 +---- suitesparse_graphblas/tests/conftest.py | 1 + suitesparse_graphblas/tests/test_doctest.py | 7 ++--- .../tests/test_exceptions.py | 9 ++---- .../tests/test_initialize.py | 3 +- suitesparse_graphblas/tests/test_io.py | 30 +++++++++---------- suitesparse_graphblas/tests/test_package.py | 2 +- suitesparse_graphblas/utils.pxd | 3 +- suitesparse_graphblas/utils.pyx | 13 +++++--- suitesparse_graphblas/vector.py | 6 +--- 17 files changed, 67 insertions(+), 61 deletions(-) diff --git a/setup.cfg b/setup.cfg index c6637a3..39f66e3 100644 --- a/setup.cfg +++ b/setup.cfg @@ -35,3 +35,10 @@ parentdir_prefix=suitesparse_graphblas- [tool:pytest] testpaths = suitesparse_graphblas/tests +[isort] +sections = FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER +profile = black +skip_gitignore = true +float_to_top = true +default_section = THIRDPARTY +known_first_party = suitesparse_graphblas diff --git a/setup.py b/setup.py index a7660a2..8ce3c2f 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,12 @@ -from setuptools import setup, find_packages, Extension +import os +import sys from glob import glob +import numpy as np +from setuptools import Extension, find_packages, setup + +import versioneer + try: from Cython.Build import cythonize from Cython.Compiler.Options import get_directive_defaults @@ -8,10 +14,7 @@ use_cython = True except ImportError: use_cython = False -import numpy as np -import os -import sys -import versioneer + is_win = sys.platform.startswith("win") define_macros = [("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")] diff --git a/suitesparse_graphblas/__init__.py b/suitesparse_graphblas/__init__.py index 87e045b..e0bc953 100644 --- a/suitesparse_graphblas/__init__.py +++ b/suitesparse_graphblas/__init__.py @@ -1,7 +1,7 @@ -from ._graphblas import ffi, lib # noqa +from . import exceptions as ex from . import utils +from ._graphblas import ffi, lib # noqa from ._version import get_versions -from . import exceptions as ex def is_initialized(): diff --git a/suitesparse_graphblas/build.py b/suitesparse_graphblas/build.py index d4a3daf..9a2df43 100644 --- a/suitesparse_graphblas/build.py +++ b/suitesparse_graphblas/build.py @@ -1,5 +1,6 @@ import os import sys + from cffi import FFI is_win = sys.platform.startswith("win") diff --git a/suitesparse_graphblas/create_headers.py b/suitesparse_graphblas/create_headers.py index 3b01bb6..8ce412b 100644 --- a/suitesparse_graphblas/create_headers.py +++ b/suitesparse_graphblas/create_headers.py @@ -27,6 +27,7 @@ import shutil import subprocess import sys + import pycparser from pycparser import c_ast, c_generator, parse_file @@ -579,7 +580,7 @@ def handle_function_node(node): group = "matrix" elif "GrB_Vector" in text: group = "vector" - elif "GxB_Scalar" in text: + elif "GxB_Scalar" in text or "GrB_Scalar" in text: group = "scalar" else: group = node.name.split("_", 2)[1] @@ -596,6 +597,7 @@ def handle_function_node(node): "Semiring": "semiring", "Type": "type", "UnaryOp": "unary", + "IndexUnaryOp": "indexunary", # "everything else" is "core" "getVersion": "core", "Global": "core", @@ -603,6 +605,7 @@ def handle_function_node(node): "finalize": "core", "init": "core", "wait": "core", + "deserialize": "core", }[group] return { "name": node.name, @@ -807,8 +810,12 @@ def main(): print("Step 6: check #define definitions") with open(graphblas_h) as f: text = f.read() + define_lines = re.compile(r".*?#define\s+\w+\s+") define_pattern = re.compile(r"#define\s+\w+\s+") - defines = {x[len("#define") :].strip() for x in define_pattern.findall(text)} + defines = set() + for line in define_lines.findall(text): + line = line.split("//")[0].split("/*")[0] + defines.update(x[len("#define") :].strip() for x in define_pattern.findall(line)) extra_defines = (DEFINES | CHAR_DEFINES) - defines if extra_defines: # Should this raise? If it's a problem, it will raise when compiling. diff --git a/suitesparse_graphblas/io/binary.py b/suitesparse_graphblas/io/binary.py index 70bea21..410b769 100644 --- a/suitesparse_graphblas/io/binary.py +++ b/suitesparse_graphblas/io/binary.py @@ -1,8 +1,9 @@ -from pathlib import Path from ctypes.util import find_library -from suitesparse_graphblas import ffi, lib, check_status, matrix, __version__ +from pathlib import Path + from cffi import FFI +from suitesparse_graphblas import __version__, check_status, ffi, lib, matrix stdffi = FFI() stdffi.cdef( diff --git a/suitesparse_graphblas/matrix.py b/suitesparse_graphblas/matrix.py index dd73669..bc482af 100644 --- a/suitesparse_graphblas/matrix.py +++ b/suitesparse_graphblas/matrix.py @@ -1,8 +1,4 @@ -from suitesparse_graphblas import ( - lib, - ffi, - check_status, -) +from suitesparse_graphblas import check_status, ffi, lib def free(A): diff --git a/suitesparse_graphblas/scalar.py b/suitesparse_graphblas/scalar.py index 548e3ba..c0d5747 100644 --- a/suitesparse_graphblas/scalar.py +++ b/suitesparse_graphblas/scalar.py @@ -1,9 +1,4 @@ -from suitesparse_graphblas import ( - lib, - ffi, - check_status, - exceptions, -) +from suitesparse_graphblas import check_status, exceptions, ffi, lib def free(v): diff --git a/suitesparse_graphblas/tests/conftest.py b/suitesparse_graphblas/tests/conftest.py index 24dc269..b6c5ead 100644 --- a/suitesparse_graphblas/tests/conftest.py +++ b/suitesparse_graphblas/tests/conftest.py @@ -1,4 +1,5 @@ import pytest + from suitesparse_graphblas import initialize diff --git a/suitesparse_graphblas/tests/test_doctest.py b/suitesparse_graphblas/tests/test_doctest.py index 7854f35..68b9444 100644 --- a/suitesparse_graphblas/tests/test_doctest.py +++ b/suitesparse_graphblas/tests/test_doctest.py @@ -1,10 +1,7 @@ def test_run_doctests(): import doctest - from suitesparse_graphblas import ( - matrix, - vector, - scalar, - ) + + from suitesparse_graphblas import matrix, scalar, vector for mod in ( matrix, diff --git a/suitesparse_graphblas/tests/test_exceptions.py b/suitesparse_graphblas/tests/test_exceptions.py index 825ce21..26b7861 100644 --- a/suitesparse_graphblas/tests/test_exceptions.py +++ b/suitesparse_graphblas/tests/test_exceptions.py @@ -1,12 +1,7 @@ -from suitesparse_graphblas import ( - ffi, - lib, - check_status, - exceptions, -) - import pytest +from suitesparse_graphblas import check_status, exceptions, ffi, lib + def test_check_status(): A = ffi.new("GrB_Matrix*") diff --git a/suitesparse_graphblas/tests/test_initialize.py b/suitesparse_graphblas/tests/test_initialize.py index fc69305..fbd4db7 100644 --- a/suitesparse_graphblas/tests/test_initialize.py +++ b/suitesparse_graphblas/tests/test_initialize.py @@ -1,7 +1,8 @@ if __name__ == "__main__": - import suitesparse_graphblas as ssgb import pytest + import suitesparse_graphblas as ssgb + assert ssgb.is_initialized() is False ssgb.initialize() assert ssgb.is_initialized() is True diff --git a/suitesparse_graphblas/tests/test_io.py b/suitesparse_graphblas/tests/test_io.py index 2638446..c7e2603 100644 --- a/suitesparse_graphblas/tests/test_io.py +++ b/suitesparse_graphblas/tests/test_io.py @@ -1,30 +1,30 @@ -import platform -import pytest - -if platform.system() == "Windows": - pytest.skip("skipping windows-only tests", allow_module_level=True) - -import gzip import bz2 +import gzip import lzma +import platform from pathlib import Path +import pytest + from suitesparse_graphblas import ( - ffi, - lib, + bool_types, check_status, + complex_types, + ffi, grb_types, - bool_types, - signed_integer_types, - unsigned_integer_types, + lib, + matrix, real_types, - complex_types, + signed_integer_types, supports_complex, - matrix, + unsigned_integer_types, ) - from suitesparse_graphblas.io import binary +if platform.system() == "Windows": + pytest.skip("skipping windows-only tests", allow_module_level=True) + + NULL = ffi.NULL diff --git a/suitesparse_graphblas/tests/test_package.py b/suitesparse_graphblas/tests/test_package.py index 4bc0ab4..7a0c910 100644 --- a/suitesparse_graphblas/tests/test_package.py +++ b/suitesparse_graphblas/tests/test_package.py @@ -1,4 +1,4 @@ -from suitesparse_graphblas import lib, ffi # noqa +from suitesparse_graphblas import ffi, lib # noqa def test_matrix_existence(): diff --git a/suitesparse_graphblas/utils.pxd b/suitesparse_graphblas/utils.pxd index 5a742a2..9eb4fae 100644 --- a/suitesparse_graphblas/utils.pxd +++ b/suitesparse_graphblas/utils.pxd @@ -1,5 +1,6 @@ -from numpy cimport ndarray from libc.stdint cimport uint64_t +from numpy cimport ndarray + cdef extern from "numpy/arrayobject.h" nogil: # These aren't public (i.e., "extern"), but other projects use them too diff --git a/suitesparse_graphblas/utils.pyx b/suitesparse_graphblas/utils.pyx index c800d8a..371fcad 100644 --- a/suitesparse_graphblas/utils.pyx +++ b/suitesparse_graphblas/utils.pyx @@ -1,10 +1,15 @@ import numpy as np +from libc.stdint cimport uintptr_t from numpy cimport ( - import_array, ndarray, npy_intp, - PyArray_SimpleNewFromData, PyArray_New, - NPY_ARRAY_OWNDATA, NPY_ARRAY_WRITEABLE, NPY_ARRAY_F_CONTIGUOUS, + NPY_ARRAY_F_CONTIGUOUS, + NPY_ARRAY_OWNDATA, + NPY_ARRAY_WRITEABLE, + PyArray_New, + PyArray_SimpleNewFromData, + import_array, + ndarray, + npy_intp, ) -from libc.stdint cimport uintptr_t import_array() diff --git a/suitesparse_graphblas/vector.py b/suitesparse_graphblas/vector.py index 2d0e12b..6d76ad5 100644 --- a/suitesparse_graphblas/vector.py +++ b/suitesparse_graphblas/vector.py @@ -1,8 +1,4 @@ -from suitesparse_graphblas import ( - lib, - ffi, - check_status, -) +from suitesparse_graphblas import check_status, ffi, lib def free(v): From a0eb625e4f3a26297a7e40f40905051eb4a4d2c2 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Fri, 29 Oct 2021 17:25:51 -0500 Subject: [PATCH 050/193] Better test skip on Windows (maybe) --- suitesparse_graphblas/tests/test_io.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/suitesparse_graphblas/tests/test_io.py b/suitesparse_graphblas/tests/test_io.py index c7e2603..0b19320 100644 --- a/suitesparse_graphblas/tests/test_io.py +++ b/suitesparse_graphblas/tests/test_io.py @@ -19,11 +19,11 @@ supports_complex, unsigned_integer_types, ) -from suitesparse_graphblas.io import binary if platform.system() == "Windows": pytest.skip("skipping windows-only tests", allow_module_level=True) +from suitesparse_graphblas.io import binary # noqa isort:skip NULL = ffi.NULL From 4f85733ede966db24d8b825a8f8bf6943acaae03 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Fri, 29 Oct 2021 20:49:44 -0500 Subject: [PATCH 051/193] Update to graphblas=5.1.10 in CI; update versioneer --- continuous_integration/environment.yml | 2 +- suitesparse_graphblas/__init__.py | 9 +- suitesparse_graphblas/_version.py | 230 +++++++--- versioneer.py | 574 ++++++++++++++++++------- 4 files changed, 600 insertions(+), 215 deletions(-) diff --git a/continuous_integration/environment.yml b/continuous_integration/environment.yml index c7f8251..8f3c979 100644 --- a/continuous_integration/environment.yml +++ b/continuous_integration/environment.yml @@ -3,7 +3,7 @@ channels: - conda-forge - defaults dependencies: - - graphblas=5.1.3 + - graphblas=5.1.10 - cffi - cython - numpy diff --git a/suitesparse_graphblas/__init__.py b/suitesparse_graphblas/__init__.py index e0bc953..9212b0c 100644 --- a/suitesparse_graphblas/__init__.py +++ b/suitesparse_graphblas/__init__.py @@ -1,7 +1,7 @@ +from . import _version from . import exceptions as ex from . import utils from ._graphblas import ffi, lib # noqa -from ._version import get_versions def is_initialized(): @@ -46,10 +46,6 @@ def initialize(*, blocking=False, memory_manager="numpy"): raise ValueError(f'memory_manager argument must be "numpy" or "c"; got: {memory_manager!r}') -__version__ = get_versions()["version"] -del get_versions - - def libget(name): """Helper to get items from GraphBLAS which might be GrB or GxB""" try: @@ -170,3 +166,6 @@ def check_status(obj, response_code): error_func(string, obj) text = ffi.string(string[0]).decode() raise _error_code_lookup[response_code](text) + + +__version__ = _version.get_versions()["version"] diff --git a/suitesparse_graphblas/_version.py b/suitesparse_graphblas/_version.py index cd87a45..4db97b4 100644 --- a/suitesparse_graphblas/_version.py +++ b/suitesparse_graphblas/_version.py @@ -5,7 +5,7 @@ # that just contains the computed version number. # This file is released into the public domain. Generated by -# versioneer-0.19 (https://github.com/python-versioneer/python-versioneer) +# versioneer-0.21 (https://github.com/python-versioneer/python-versioneer) """Git implementation of _version.py.""" @@ -14,6 +14,7 @@ import re import subprocess import sys +from typing import Callable, Dict def get_keywords(): @@ -51,8 +52,8 @@ class NotThisMethod(Exception): """Exception raised if a method is not valid for the current scenario.""" -LONG_VERSION_PY = {} -HANDLERS = {} +LONG_VERSION_PY: Dict[str, str] = {} +HANDLERS: Dict[str, Dict[str, Callable]] = {} def register_vcs_handler(vcs, method): # decorator @@ -71,20 +72,20 @@ def decorate(f): def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False, env=None): """Call the given command(s).""" assert isinstance(commands, list) - p = None - for c in commands: + process = None + for command in commands: try: - dispcmd = str([c] + args) + dispcmd = str([command] + args) # remember shell=False, so use git.cmd on windows, not just git - p = subprocess.Popen( - [c] + args, + process = subprocess.Popen( + [command] + args, cwd=cwd, env=env, stdout=subprocess.PIPE, stderr=(subprocess.PIPE if hide_stderr else None), ) break - except EnvironmentError: + except OSError: e = sys.exc_info()[1] if e.errno == errno.ENOENT: continue @@ -94,15 +95,15 @@ def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False, env= return None, None else: if verbose: - print("unable to find command, tried %s" % (commands,)) + print(f"unable to find command, tried {commands}") return None, None - stdout = p.communicate()[0].strip().decode() - if p.returncode != 0: + stdout = process.communicate()[0].strip().decode() + if process.returncode != 0: if verbose: print("unable to run %s (error)" % dispcmd) print("stdout was %s" % stdout) - return None, p.returncode - return stdout, p.returncode + return None, process.returncode + return stdout, process.returncode def versions_from_parentdir(parentdir_prefix, root, verbose): @@ -114,7 +115,7 @@ def versions_from_parentdir(parentdir_prefix, root, verbose): """ rootdirs = [] - for i in range(3): + for _ in range(3): dirname = os.path.basename(root) if dirname.startswith(parentdir_prefix): return { @@ -124,9 +125,8 @@ def versions_from_parentdir(parentdir_prefix, root, verbose): "error": None, "date": None, } - else: - rootdirs.append(root) - root = os.path.dirname(root) # up a level + rootdirs.append(root) + root = os.path.dirname(root) # up a level if verbose: print( @@ -145,22 +145,21 @@ def git_get_keywords(versionfile_abs): # _version.py. keywords = {} try: - f = open(versionfile_abs, "r") - for line in f.readlines(): - if line.strip().startswith("git_refnames ="): - mo = re.search(r'=\s*"(.*)"', line) - if mo: - keywords["refnames"] = mo.group(1) - if line.strip().startswith("git_full ="): - mo = re.search(r'=\s*"(.*)"', line) - if mo: - keywords["full"] = mo.group(1) - if line.strip().startswith("git_date ="): - mo = re.search(r'=\s*"(.*)"', line) - if mo: - keywords["date"] = mo.group(1) - f.close() - except EnvironmentError: + with open(versionfile_abs) as fobj: + for line in fobj: + if line.strip().startswith("git_refnames ="): + mo = re.search(r'=\s*"(.*)"', line) + if mo: + keywords["refnames"] = mo.group(1) + if line.strip().startswith("git_full ="): + mo = re.search(r'=\s*"(.*)"', line) + if mo: + keywords["full"] = mo.group(1) + if line.strip().startswith("git_date ="): + mo = re.search(r'=\s*"(.*)"', line) + if mo: + keywords["date"] = mo.group(1) + except OSError: pass return keywords @@ -168,8 +167,8 @@ def git_get_keywords(versionfile_abs): @register_vcs_handler("git", "keywords") def git_versions_from_keywords(keywords, tag_prefix, verbose): """Get version information from git keywords.""" - if not keywords: - raise NotThisMethod("no keywords at all, weird") + if "refnames" not in keywords: + raise NotThisMethod("Short version file found") date = keywords.get("date") if date is not None: # Use only the last line. Previous lines may contain GPG signature @@ -188,11 +187,11 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose): if verbose: print("keywords are unexpanded, not using") raise NotThisMethod("unexpanded keywords, not a git-archive tarball") - refs = set([r.strip() for r in refnames.strip("()").split(",")]) + refs = {r.strip() for r in refnames.strip("()").split(",")} # starting in git-1.8.3, tags are listed as "tag: foo-1.0" instead of # just "foo-1.0". If we see a "tag: " prefix, prefer those. TAG = "tag: " - tags = set([r[len(TAG) :] for r in refs if r.startswith(TAG)]) + tags = {r[len(TAG) :] for r in refs if r.startswith(TAG)} if not tags: # Either we're using git < 1.8.3, or there really are no tags. We use # a heuristic: assume all version tags have a digit. The old git %d @@ -201,7 +200,7 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose): # between branches and tags. By ignoring refnames without digits, we # filter out many common branch names like "release" and # "stabilization", as well as "HEAD" and "master". - tags = set([r for r in refs if re.search(r"\d", r)]) + tags = {r for r in refs if re.search(r"\d", r)} if verbose: print("discarding '%s', no digits" % ",".join(refs - tags)) if verbose: @@ -210,6 +209,11 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose): # sorting will prefer e.g. "2.0" over "2.0rc1" if ref.startswith(tag_prefix): r = ref[len(tag_prefix) :] + # Filter out refs that exactly match prefix or that don't start + # with a number once the prefix is stripped (mostly a concern + # when prefix is '') + if not re.match(r"\d", r): + continue if verbose: print("picking %s" % r) return { @@ -232,7 +236,7 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose): @register_vcs_handler("git", "pieces_from_vcs") -def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command): +def git_pieces_from_vcs(tag_prefix, root, verbose, runner=run_command): """Get version from 'git describe' in the root of the source tree. This only gets called if the git-archive 'subst' keywords were *not* @@ -240,10 +244,12 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command): version string, meaning we're inside a checked out source tree. """ GITS = ["git"] + TAG_PREFIX_REGEX = "*" if sys.platform == "win32": GITS = ["git.cmd", "git.exe"] + TAG_PREFIX_REGEX = r"\*" - out, rc = run_command(GITS, ["rev-parse", "--git-dir"], cwd=root, hide_stderr=True) + _, rc = runner(GITS, ["rev-parse", "--git-dir"], cwd=root, hide_stderr=True) if rc != 0: if verbose: print("Directory %s not under git control" % root) @@ -251,16 +257,24 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command): # if there is a tag matching tag_prefix, this yields TAG-NUM-gHEX[-dirty] # if there isn't one, this yields HEX[-dirty] (no NUM) - describe_out, rc = run_command( + describe_out, rc = runner( GITS, - ["describe", "--tags", "--dirty", "--always", "--long", "--match", "%s*" % tag_prefix], + [ + "describe", + "--tags", + "--dirty", + "--always", + "--long", + "--match", + f"{tag_prefix}{TAG_PREFIX_REGEX}", + ], cwd=root, ) # --long was added in git-1.5.5 if describe_out is None: raise NotThisMethod("'git describe' failed") describe_out = describe_out.strip() - full_out, rc = run_command(GITS, ["rev-parse", "HEAD"], cwd=root) + full_out, rc = runner(GITS, ["rev-parse", "HEAD"], cwd=root) if full_out is None: raise NotThisMethod("'git rev-parse' failed") full_out = full_out.strip() @@ -270,6 +284,38 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command): pieces["short"] = full_out[:7] # maybe improved later pieces["error"] = None + branch_name, rc = runner(GITS, ["rev-parse", "--abbrev-ref", "HEAD"], cwd=root) + # --abbrev-ref was added in git-1.6.3 + if rc != 0 or branch_name is None: + raise NotThisMethod("'git rev-parse --abbrev-ref' returned error") + branch_name = branch_name.strip() + + if branch_name == "HEAD": + # If we aren't exactly on a branch, pick a branch which represents + # the current commit. If all else fails, we are on a branchless + # commit. + branches, rc = runner(GITS, ["branch", "--contains"], cwd=root) + # --contains was added in git-1.5.4 + if rc != 0 or branches is None: + raise NotThisMethod("'git branch --contains' returned error") + branches = branches.split("\n") + + # Remove the first line if we're running detached + if "(" in branches[0]: + branches.pop(0) + + # Strip off the leading "* " from the list of branches. + branches = [branch[2:] for branch in branches] + if "master" in branches: + branch_name = "master" + elif not branches: + branch_name = None + else: + # Pick the first branch that is returned. Good or bad. + branch_name = branches[0] + + pieces["branch"] = branch_name + # parse describe_out. It will be like TAG-NUM-gHEX[-dirty] or HEX[-dirty] # TAG might have hyphens. git_describe = describe_out @@ -286,7 +332,7 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command): # TAG-NUM-gHEX mo = re.search(r"^(.+)-(\d+)-g([0-9a-f]+)$", git_describe) if not mo: - # unparseable. Maybe git-describe is misbehaving? + # unparsable. Maybe git-describe is misbehaving? pieces["error"] = "unable to parse git-describe output: '%s'" % describe_out return pieces @@ -296,7 +342,7 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command): if verbose: fmt = "tag '%s' doesn't start with prefix '%s'" print(fmt % (full_tag, tag_prefix)) - pieces["error"] = "tag '%s' doesn't start with prefix '%s'" % (full_tag, tag_prefix) + pieces["error"] = f"tag '{full_tag}' doesn't start with prefix '{tag_prefix}'" return pieces pieces["closest-tag"] = full_tag[len(tag_prefix) :] @@ -309,11 +355,11 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command): else: # HEX: no tags pieces["closest-tag"] = None - count_out, rc = run_command(GITS, ["rev-list", "HEAD", "--count"], cwd=root) + count_out, rc = runner(GITS, ["rev-list", "HEAD", "--count"], cwd=root) pieces["distance"] = int(count_out) # total number of commits # commit date: see ISO-8601 comment in git_versions_from_keywords() - date = run_command(GITS, ["show", "-s", "--format=%ci", "HEAD"], cwd=root)[0].strip() + date = runner(GITS, ["show", "-s", "--format=%ci", "HEAD"], cwd=root)[0].strip() # Use only the last line. Previous lines may contain GPG signature # information. date = date.splitlines()[-1] @@ -353,16 +399,63 @@ def render_pep440(pieces): return rendered +def render_pep440_branch(pieces): + """TAG[[.dev0]+DISTANCE.gHEX[.dirty]] . + + The ".dev0" means not master branch. Note that .dev0 sorts backwards + (a feature branch will appear "older" than the master branch). + + Exceptions: + 1: no tags. 0[.dev0]+untagged.DISTANCE.gHEX[.dirty] + """ + if pieces["closest-tag"]: + rendered = pieces["closest-tag"] + if pieces["distance"] or pieces["dirty"]: + if pieces["branch"] != "master": + rendered += ".dev0" + rendered += plus_or_dot(pieces) + rendered += "%d.g%s" % (pieces["distance"], pieces["short"]) + if pieces["dirty"]: + rendered += ".dirty" + else: + # exception #1 + rendered = "0" + if pieces["branch"] != "master": + rendered += ".dev0" + rendered += "+untagged.%d.g%s" % (pieces["distance"], pieces["short"]) + if pieces["dirty"]: + rendered += ".dirty" + return rendered + + +def pep440_split_post(ver): + """Split pep440 version string at the post-release segment. + + Returns the release segments before the post-release and the + post-release version number (or -1 if no post-release segment is present). + """ + vc = str.split(ver, ".post") + return vc[0], int(vc[1] or 0) if len(vc) == 2 else None + + def render_pep440_pre(pieces): - """TAG[.post0.devDISTANCE] -- No -dirty. + """TAG[.postN.devDISTANCE] -- No -dirty. Exceptions: 1: no tags. 0.post0.devDISTANCE """ if pieces["closest-tag"]: - rendered = pieces["closest-tag"] if pieces["distance"]: - rendered += ".post0.dev%d" % pieces["distance"] + # update the post release segment + tag_version, post_version = pep440_split_post(pieces["closest-tag"]) + rendered = tag_version + if post_version is not None: + rendered += ".post%d.dev%d" % (post_version + 1, pieces["distance"]) + else: + rendered += ".post0.dev%d" % (pieces["distance"]) + else: + # no commits, use the tag as the version + rendered = pieces["closest-tag"] else: # exception #1 rendered = "0.post0.dev%d" % pieces["distance"] @@ -396,6 +489,35 @@ def render_pep440_post(pieces): return rendered +def render_pep440_post_branch(pieces): + """TAG[.postDISTANCE[.dev0]+gHEX[.dirty]] . + + The ".dev0" means not master branch. + + Exceptions: + 1: no tags. 0.postDISTANCE[.dev0]+gHEX[.dirty] + """ + if pieces["closest-tag"]: + rendered = pieces["closest-tag"] + if pieces["distance"] or pieces["dirty"]: + rendered += ".post%d" % pieces["distance"] + if pieces["branch"] != "master": + rendered += ".dev0" + rendered += plus_or_dot(pieces) + rendered += "g%s" % pieces["short"] + if pieces["dirty"]: + rendered += ".dirty" + else: + # exception #1 + rendered = "0.post%d" % pieces["distance"] + if pieces["branch"] != "master": + rendered += ".dev0" + rendered += "+g%s" % pieces["short"] + if pieces["dirty"]: + rendered += ".dirty" + return rendered + + def render_pep440_old(pieces): """TAG[.postDISTANCE[.dev0]] . @@ -474,10 +596,14 @@ def render(pieces, style): if style == "pep440": rendered = render_pep440(pieces) + elif style == "pep440-branch": + rendered = render_pep440_branch(pieces) elif style == "pep440-pre": rendered = render_pep440_pre(pieces) elif style == "pep440-post": rendered = render_pep440_post(pieces) + elif style == "pep440-post-branch": + rendered = render_pep440_post_branch(pieces) elif style == "pep440-old": rendered = render_pep440_old(pieces) elif style == "git-describe": @@ -516,7 +642,7 @@ def get_versions(): # versionfile_source is the relative path from the top of the source # tree (where the .git directory might live) to this file. Invert # this to find the root from __file__. - for i in cfg.versionfile_source.split("/"): + for _ in cfg.versionfile_source.split("/"): root = os.path.dirname(root) except NameError: return { diff --git a/versioneer.py b/versioneer.py index af35fa4..1da8595 100644 --- a/versioneer.py +++ b/versioneer.py @@ -1,4 +1,4 @@ -# Version: 0.19 +# Version: 0.21 """The Versioneer - like a rocketeer, but for versions. @@ -255,6 +255,8 @@ dependency * [minver](https://github.com/jbweston/miniver) - a lightweight reimplementation of versioneer +* [versioningit](https://github.com/jwodder/versioningit) - a PEP 518-based setuptools + plugin ## License @@ -271,6 +273,11 @@ [travis-url]: https://travis-ci.com/github/python-versioneer/python-versioneer """ +# pylint:disable=invalid-name,import-outside-toplevel,missing-function-docstring +# pylint:disable=missing-class-docstring,too-many-branches,too-many-statements +# pylint:disable=raise-missing-from,too-many-lines,too-many-locals,import-error +# pylint:disable=too-few-public-methods,redefined-outer-name,consider-using-with +# pylint:disable=attribute-defined-outside-init,too-many-arguments import configparser import errno @@ -279,6 +286,7 @@ import re import subprocess import sys +from typing import Callable, Dict class VersioneerConfig: @@ -315,13 +323,13 @@ def get_root(): # module-import table will cache the first one. So we can't use # os.path.dirname(__file__), as that will find whichever # versioneer.py was first imported, even in later projects. - me = os.path.realpath(os.path.abspath(__file__)) - me_dir = os.path.normcase(os.path.splitext(me)[0]) + my_path = os.path.realpath(os.path.abspath(__file__)) + me_dir = os.path.normcase(os.path.splitext(my_path)[0]) vsr_dir = os.path.normcase(os.path.splitext(versioneer_py)[0]) if me_dir != vsr_dir: print( "Warning: build in %s is using versioneer.py from %s" - % (os.path.dirname(me), versioneer_py) + % (os.path.dirname(my_path), versioneer_py) ) except NameError: pass @@ -330,31 +338,29 @@ def get_root(): def get_config_from_root(root): """Read the project setup.cfg file to determine Versioneer config.""" - # This might raise EnvironmentError (if setup.cfg is missing), or + # This might raise OSError (if setup.cfg is missing), or # configparser.NoSectionError (if it lacks a [versioneer] section), or # configparser.NoOptionError (if it lacks "VCS="). See the docstring at # the top of versioneer.py for instructions on writing your setup.cfg . setup_cfg = os.path.join(root, "setup.cfg") parser = configparser.ConfigParser() - with open(setup_cfg, "r") as f: - parser.read_file(f) + with open(setup_cfg) as cfg_file: + parser.read_file(cfg_file) VCS = parser.get("versioneer", "VCS") # mandatory - def get(parser, name): - if parser.has_option("versioneer", name): - return parser.get("versioneer", name) - return None + # Dict-like interface for non-mandatory entries + section = parser["versioneer"] cfg = VersioneerConfig() cfg.VCS = VCS - cfg.style = get(parser, "style") or "" - cfg.versionfile_source = get(parser, "versionfile_source") - cfg.versionfile_build = get(parser, "versionfile_build") - cfg.tag_prefix = get(parser, "tag_prefix") + cfg.style = section.get("style", "") + cfg.versionfile_source = section.get("versionfile_source") + cfg.versionfile_build = section.get("versionfile_build") + cfg.tag_prefix = section.get("tag_prefix") if cfg.tag_prefix in ("''", '""'): cfg.tag_prefix = "" - cfg.parentdir_prefix = get(parser, "parentdir_prefix") - cfg.verbose = get(parser, "verbose") + cfg.parentdir_prefix = section.get("parentdir_prefix") + cfg.verbose = section.get("verbose") return cfg @@ -363,8 +369,8 @@ class NotThisMethod(Exception): # these dictionaries contain VCS-specific tools -LONG_VERSION_PY = {} -HANDLERS = {} +LONG_VERSION_PY: Dict[str, str] = {} +HANDLERS: Dict[str, Dict[str, Callable]] = {} def register_vcs_handler(vcs, method): # decorator @@ -372,9 +378,7 @@ def register_vcs_handler(vcs, method): # decorator def decorate(f): """Store f in HANDLERS[vcs][method].""" - if vcs not in HANDLERS: - HANDLERS[vcs] = {} - HANDLERS[vcs][method] = f + HANDLERS.setdefault(vcs, {})[method] = f return f return decorate @@ -383,20 +387,20 @@ def decorate(f): def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False, env=None): """Call the given command(s).""" assert isinstance(commands, list) - p = None - for c in commands: + process = None + for command in commands: try: - dispcmd = str([c] + args) + dispcmd = str([command] + args) # remember shell=False, so use git.cmd on windows, not just git - p = subprocess.Popen( - [c] + args, + process = subprocess.Popen( + [command] + args, cwd=cwd, env=env, stdout=subprocess.PIPE, stderr=(subprocess.PIPE if hide_stderr else None), ) break - except EnvironmentError: + except OSError: e = sys.exc_info()[1] if e.errno == errno.ENOENT: continue @@ -406,15 +410,15 @@ def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False, env= return None, None else: if verbose: - print("unable to find command, tried %s" % (commands,)) + print(f"unable to find command, tried {commands}") return None, None - stdout = p.communicate()[0].strip().decode() - if p.returncode != 0: + stdout = process.communicate()[0].strip().decode() + if process.returncode != 0: if verbose: print("unable to run %s (error)" % dispcmd) print("stdout was %s" % stdout) - return None, p.returncode - return stdout, p.returncode + return None, process.returncode + return stdout, process.returncode LONG_VERSION_PY[ @@ -427,7 +431,7 @@ def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False, env= # that just contains the computed version number. # This file is released into the public domain. Generated by -# versioneer-0.19 (https://github.com/python-versioneer/python-versioneer) +# versioneer-0.21 (https://github.com/python-versioneer/python-versioneer) """Git implementation of _version.py.""" @@ -436,6 +440,7 @@ def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False, env= import re import subprocess import sys +from typing import Callable, Dict def get_keywords(): @@ -473,8 +478,8 @@ class NotThisMethod(Exception): """Exception raised if a method is not valid for the current scenario.""" -LONG_VERSION_PY = {} -HANDLERS = {} +LONG_VERSION_PY: Dict[str, str] = {} +HANDLERS: Dict[str, Dict[str, Callable]] = {} def register_vcs_handler(vcs, method): # decorator @@ -492,17 +497,17 @@ def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False, env=None): """Call the given command(s).""" assert isinstance(commands, list) - p = None - for c in commands: + process = None + for command in commands: try: - dispcmd = str([c] + args) + dispcmd = str([command] + args) # remember shell=False, so use git.cmd on windows, not just git - p = subprocess.Popen([c] + args, cwd=cwd, env=env, - stdout=subprocess.PIPE, - stderr=(subprocess.PIPE if hide_stderr - else None)) + process = subprocess.Popen([command] + args, cwd=cwd, env=env, + stdout=subprocess.PIPE, + stderr=(subprocess.PIPE if hide_stderr + else None)) break - except EnvironmentError: + except OSError: e = sys.exc_info()[1] if e.errno == errno.ENOENT: continue @@ -514,13 +519,13 @@ def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False, if verbose: print("unable to find command, tried %%s" %% (commands,)) return None, None - stdout = p.communicate()[0].strip().decode() - if p.returncode != 0: + stdout = process.communicate()[0].strip().decode() + if process.returncode != 0: if verbose: print("unable to run %%s (error)" %% dispcmd) print("stdout was %%s" %% stdout) - return None, p.returncode - return stdout, p.returncode + return None, process.returncode + return stdout, process.returncode def versions_from_parentdir(parentdir_prefix, root, verbose): @@ -532,15 +537,14 @@ def versions_from_parentdir(parentdir_prefix, root, verbose): """ rootdirs = [] - for i in range(3): + for _ in range(3): dirname = os.path.basename(root) if dirname.startswith(parentdir_prefix): return {"version": dirname[len(parentdir_prefix):], "full-revisionid": None, "dirty": False, "error": None, "date": None} - else: - rootdirs.append(root) - root = os.path.dirname(root) # up a level + rootdirs.append(root) + root = os.path.dirname(root) # up a level if verbose: print("Tried directories %%s but none started with prefix %%s" %% @@ -557,22 +561,21 @@ def git_get_keywords(versionfile_abs): # _version.py. keywords = {} try: - f = open(versionfile_abs, "r") - for line in f.readlines(): - if line.strip().startswith("git_refnames ="): - mo = re.search(r'=\s*"(.*)"', line) - if mo: - keywords["refnames"] = mo.group(1) - if line.strip().startswith("git_full ="): - mo = re.search(r'=\s*"(.*)"', line) - if mo: - keywords["full"] = mo.group(1) - if line.strip().startswith("git_date ="): - mo = re.search(r'=\s*"(.*)"', line) - if mo: - keywords["date"] = mo.group(1) - f.close() - except EnvironmentError: + with open(versionfile_abs, "r") as fobj: + for line in fobj: + if line.strip().startswith("git_refnames ="): + mo = re.search(r'=\s*"(.*)"', line) + if mo: + keywords["refnames"] = mo.group(1) + if line.strip().startswith("git_full ="): + mo = re.search(r'=\s*"(.*)"', line) + if mo: + keywords["full"] = mo.group(1) + if line.strip().startswith("git_date ="): + mo = re.search(r'=\s*"(.*)"', line) + if mo: + keywords["date"] = mo.group(1) + except OSError: pass return keywords @@ -580,8 +583,8 @@ def git_get_keywords(versionfile_abs): @register_vcs_handler("git", "keywords") def git_versions_from_keywords(keywords, tag_prefix, verbose): """Get version information from git keywords.""" - if not keywords: - raise NotThisMethod("no keywords at all, weird") + if "refnames" not in keywords: + raise NotThisMethod("Short version file found") date = keywords.get("date") if date is not None: # Use only the last line. Previous lines may contain GPG signature @@ -600,11 +603,11 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose): if verbose: print("keywords are unexpanded, not using") raise NotThisMethod("unexpanded keywords, not a git-archive tarball") - refs = set([r.strip() for r in refnames.strip("()").split(",")]) + refs = {r.strip() for r in refnames.strip("()").split(",")} # starting in git-1.8.3, tags are listed as "tag: foo-1.0" instead of # just "foo-1.0". If we see a "tag: " prefix, prefer those. TAG = "tag: " - tags = set([r[len(TAG):] for r in refs if r.startswith(TAG)]) + tags = {r[len(TAG):] for r in refs if r.startswith(TAG)} if not tags: # Either we're using git < 1.8.3, or there really are no tags. We use # a heuristic: assume all version tags have a digit. The old git %%d @@ -613,7 +616,7 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose): # between branches and tags. By ignoring refnames without digits, we # filter out many common branch names like "release" and # "stabilization", as well as "HEAD" and "master". - tags = set([r for r in refs if re.search(r'\d', r)]) + tags = {r for r in refs if re.search(r'\d', r)} if verbose: print("discarding '%%s', no digits" %% ",".join(refs - tags)) if verbose: @@ -622,6 +625,11 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose): # sorting will prefer e.g. "2.0" over "2.0rc1" if ref.startswith(tag_prefix): r = ref[len(tag_prefix):] + # Filter out refs that exactly match prefix or that don't start + # with a number once the prefix is stripped (mostly a concern + # when prefix is '') + if not re.match(r'\d', r): + continue if verbose: print("picking %%s" %% r) return {"version": r, @@ -637,7 +645,7 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose): @register_vcs_handler("git", "pieces_from_vcs") -def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command): +def git_pieces_from_vcs(tag_prefix, root, verbose, runner=run_command): """Get version from 'git describe' in the root of the source tree. This only gets called if the git-archive 'subst' keywords were *not* @@ -645,11 +653,13 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command): version string, meaning we're inside a checked out source tree. """ GITS = ["git"] + TAG_PREFIX_REGEX = "*" if sys.platform == "win32": GITS = ["git.cmd", "git.exe"] + TAG_PREFIX_REGEX = r"\*" - out, rc = run_command(GITS, ["rev-parse", "--git-dir"], cwd=root, - hide_stderr=True) + _, rc = runner(GITS, ["rev-parse", "--git-dir"], cwd=root, + hide_stderr=True) if rc != 0: if verbose: print("Directory %%s not under git control" %% root) @@ -657,15 +667,16 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command): # if there is a tag matching tag_prefix, this yields TAG-NUM-gHEX[-dirty] # if there isn't one, this yields HEX[-dirty] (no NUM) - describe_out, rc = run_command(GITS, ["describe", "--tags", "--dirty", - "--always", "--long", - "--match", "%%s*" %% tag_prefix], - cwd=root) + describe_out, rc = runner(GITS, ["describe", "--tags", "--dirty", + "--always", "--long", + "--match", + "%%s%%s" %% (tag_prefix, TAG_PREFIX_REGEX)], + cwd=root) # --long was added in git-1.5.5 if describe_out is None: raise NotThisMethod("'git describe' failed") describe_out = describe_out.strip() - full_out, rc = run_command(GITS, ["rev-parse", "HEAD"], cwd=root) + full_out, rc = runner(GITS, ["rev-parse", "HEAD"], cwd=root) if full_out is None: raise NotThisMethod("'git rev-parse' failed") full_out = full_out.strip() @@ -675,6 +686,39 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command): pieces["short"] = full_out[:7] # maybe improved later pieces["error"] = None + branch_name, rc = runner(GITS, ["rev-parse", "--abbrev-ref", "HEAD"], + cwd=root) + # --abbrev-ref was added in git-1.6.3 + if rc != 0 or branch_name is None: + raise NotThisMethod("'git rev-parse --abbrev-ref' returned error") + branch_name = branch_name.strip() + + if branch_name == "HEAD": + # If we aren't exactly on a branch, pick a branch which represents + # the current commit. If all else fails, we are on a branchless + # commit. + branches, rc = runner(GITS, ["branch", "--contains"], cwd=root) + # --contains was added in git-1.5.4 + if rc != 0 or branches is None: + raise NotThisMethod("'git branch --contains' returned error") + branches = branches.split("\n") + + # Remove the first line if we're running detached + if "(" in branches[0]: + branches.pop(0) + + # Strip off the leading "* " from the list of branches. + branches = [branch[2:] for branch in branches] + if "master" in branches: + branch_name = "master" + elif not branches: + branch_name = None + else: + # Pick the first branch that is returned. Good or bad. + branch_name = branches[0] + + pieces["branch"] = branch_name + # parse describe_out. It will be like TAG-NUM-gHEX[-dirty] or HEX[-dirty] # TAG might have hyphens. git_describe = describe_out @@ -691,7 +735,7 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command): # TAG-NUM-gHEX mo = re.search(r'^(.+)-(\d+)-g([0-9a-f]+)$', git_describe) if not mo: - # unparseable. Maybe git-describe is misbehaving? + # unparsable. Maybe git-describe is misbehaving? pieces["error"] = ("unable to parse git-describe output: '%%s'" %% describe_out) return pieces @@ -716,13 +760,11 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command): else: # HEX: no tags pieces["closest-tag"] = None - count_out, rc = run_command(GITS, ["rev-list", "HEAD", "--count"], - cwd=root) + count_out, rc = runner(GITS, ["rev-list", "HEAD", "--count"], cwd=root) pieces["distance"] = int(count_out) # total number of commits # commit date: see ISO-8601 comment in git_versions_from_keywords() - date = run_command(GITS, ["show", "-s", "--format=%%ci", "HEAD"], - cwd=root)[0].strip() + date = runner(GITS, ["show", "-s", "--format=%%ci", "HEAD"], cwd=root)[0].strip() # Use only the last line. Previous lines may contain GPG signature # information. date = date.splitlines()[-1] @@ -763,16 +805,64 @@ def render_pep440(pieces): return rendered +def render_pep440_branch(pieces): + """TAG[[.dev0]+DISTANCE.gHEX[.dirty]] . + + The ".dev0" means not master branch. Note that .dev0 sorts backwards + (a feature branch will appear "older" than the master branch). + + Exceptions: + 1: no tags. 0[.dev0]+untagged.DISTANCE.gHEX[.dirty] + """ + if pieces["closest-tag"]: + rendered = pieces["closest-tag"] + if pieces["distance"] or pieces["dirty"]: + if pieces["branch"] != "master": + rendered += ".dev0" + rendered += plus_or_dot(pieces) + rendered += "%%d.g%%s" %% (pieces["distance"], pieces["short"]) + if pieces["dirty"]: + rendered += ".dirty" + else: + # exception #1 + rendered = "0" + if pieces["branch"] != "master": + rendered += ".dev0" + rendered += "+untagged.%%d.g%%s" %% (pieces["distance"], + pieces["short"]) + if pieces["dirty"]: + rendered += ".dirty" + return rendered + + +def pep440_split_post(ver): + """Split pep440 version string at the post-release segment. + + Returns the release segments before the post-release and the + post-release version number (or -1 if no post-release segment is present). + """ + vc = str.split(ver, ".post") + return vc[0], int(vc[1] or 0) if len(vc) == 2 else None + + def render_pep440_pre(pieces): - """TAG[.post0.devDISTANCE] -- No -dirty. + """TAG[.postN.devDISTANCE] -- No -dirty. Exceptions: 1: no tags. 0.post0.devDISTANCE """ if pieces["closest-tag"]: - rendered = pieces["closest-tag"] if pieces["distance"]: - rendered += ".post0.dev%%d" %% pieces["distance"] + # update the post release segment + tag_version, post_version = pep440_split_post(pieces["closest-tag"]) + rendered = tag_version + if post_version is not None: + rendered += ".post%%d.dev%%d" %% (post_version+1, pieces["distance"]) + else: + rendered += ".post0.dev%%d" %% (pieces["distance"]) + else: + # no commits, use the tag as the version + rendered = pieces["closest-tag"] else: # exception #1 rendered = "0.post0.dev%%d" %% pieces["distance"] @@ -806,6 +896,35 @@ def render_pep440_post(pieces): return rendered +def render_pep440_post_branch(pieces): + """TAG[.postDISTANCE[.dev0]+gHEX[.dirty]] . + + The ".dev0" means not master branch. + + Exceptions: + 1: no tags. 0.postDISTANCE[.dev0]+gHEX[.dirty] + """ + if pieces["closest-tag"]: + rendered = pieces["closest-tag"] + if pieces["distance"] or pieces["dirty"]: + rendered += ".post%%d" %% pieces["distance"] + if pieces["branch"] != "master": + rendered += ".dev0" + rendered += plus_or_dot(pieces) + rendered += "g%%s" %% pieces["short"] + if pieces["dirty"]: + rendered += ".dirty" + else: + # exception #1 + rendered = "0.post%%d" %% pieces["distance"] + if pieces["branch"] != "master": + rendered += ".dev0" + rendered += "+g%%s" %% pieces["short"] + if pieces["dirty"]: + rendered += ".dirty" + return rendered + + def render_pep440_old(pieces): """TAG[.postDISTANCE[.dev0]] . @@ -882,10 +1001,14 @@ def render(pieces, style): if style == "pep440": rendered = render_pep440(pieces) + elif style == "pep440-branch": + rendered = render_pep440_branch(pieces) elif style == "pep440-pre": rendered = render_pep440_pre(pieces) elif style == "pep440-post": rendered = render_pep440_post(pieces) + elif style == "pep440-post-branch": + rendered = render_pep440_post_branch(pieces) elif style == "pep440-old": rendered = render_pep440_old(pieces) elif style == "git-describe": @@ -921,7 +1044,7 @@ def get_versions(): # versionfile_source is the relative path from the top of the source # tree (where the .git directory might live) to this file. Invert # this to find the root from __file__. - for i in cfg.versionfile_source.split('/'): + for _ in cfg.versionfile_source.split('/'): root = os.path.dirname(root) except NameError: return {"version": "0+unknown", "full-revisionid": None, @@ -956,22 +1079,21 @@ def git_get_keywords(versionfile_abs): # _version.py. keywords = {} try: - f = open(versionfile_abs, "r") - for line in f.readlines(): - if line.strip().startswith("git_refnames ="): - mo = re.search(r'=\s*"(.*)"', line) - if mo: - keywords["refnames"] = mo.group(1) - if line.strip().startswith("git_full ="): - mo = re.search(r'=\s*"(.*)"', line) - if mo: - keywords["full"] = mo.group(1) - if line.strip().startswith("git_date ="): - mo = re.search(r'=\s*"(.*)"', line) - if mo: - keywords["date"] = mo.group(1) - f.close() - except EnvironmentError: + with open(versionfile_abs) as fobj: + for line in fobj: + if line.strip().startswith("git_refnames ="): + mo = re.search(r'=\s*"(.*)"', line) + if mo: + keywords["refnames"] = mo.group(1) + if line.strip().startswith("git_full ="): + mo = re.search(r'=\s*"(.*)"', line) + if mo: + keywords["full"] = mo.group(1) + if line.strip().startswith("git_date ="): + mo = re.search(r'=\s*"(.*)"', line) + if mo: + keywords["date"] = mo.group(1) + except OSError: pass return keywords @@ -979,8 +1101,8 @@ def git_get_keywords(versionfile_abs): @register_vcs_handler("git", "keywords") def git_versions_from_keywords(keywords, tag_prefix, verbose): """Get version information from git keywords.""" - if not keywords: - raise NotThisMethod("no keywords at all, weird") + if "refnames" not in keywords: + raise NotThisMethod("Short version file found") date = keywords.get("date") if date is not None: # Use only the last line. Previous lines may contain GPG signature @@ -999,11 +1121,11 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose): if verbose: print("keywords are unexpanded, not using") raise NotThisMethod("unexpanded keywords, not a git-archive tarball") - refs = set([r.strip() for r in refnames.strip("()").split(",")]) + refs = {r.strip() for r in refnames.strip("()").split(",")} # starting in git-1.8.3, tags are listed as "tag: foo-1.0" instead of # just "foo-1.0". If we see a "tag: " prefix, prefer those. TAG = "tag: " - tags = set([r[len(TAG) :] for r in refs if r.startswith(TAG)]) + tags = {r[len(TAG) :] for r in refs if r.startswith(TAG)} if not tags: # Either we're using git < 1.8.3, or there really are no tags. We use # a heuristic: assume all version tags have a digit. The old git %d @@ -1012,7 +1134,7 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose): # between branches and tags. By ignoring refnames without digits, we # filter out many common branch names like "release" and # "stabilization", as well as "HEAD" and "master". - tags = set([r for r in refs if re.search(r"\d", r)]) + tags = {r for r in refs if re.search(r"\d", r)} if verbose: print("discarding '%s', no digits" % ",".join(refs - tags)) if verbose: @@ -1021,6 +1143,11 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose): # sorting will prefer e.g. "2.0" over "2.0rc1" if ref.startswith(tag_prefix): r = ref[len(tag_prefix) :] + # Filter out refs that exactly match prefix or that don't start + # with a number once the prefix is stripped (mostly a concern + # when prefix is '') + if not re.match(r"\d", r): + continue if verbose: print("picking %s" % r) return { @@ -1043,7 +1170,7 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose): @register_vcs_handler("git", "pieces_from_vcs") -def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command): +def git_pieces_from_vcs(tag_prefix, root, verbose, runner=run_command): """Get version from 'git describe' in the root of the source tree. This only gets called if the git-archive 'subst' keywords were *not* @@ -1051,10 +1178,12 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command): version string, meaning we're inside a checked out source tree. """ GITS = ["git"] + TAG_PREFIX_REGEX = "*" if sys.platform == "win32": GITS = ["git.cmd", "git.exe"] + TAG_PREFIX_REGEX = r"\*" - out, rc = run_command(GITS, ["rev-parse", "--git-dir"], cwd=root, hide_stderr=True) + _, rc = runner(GITS, ["rev-parse", "--git-dir"], cwd=root, hide_stderr=True) if rc != 0: if verbose: print("Directory %s not under git control" % root) @@ -1062,16 +1191,24 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command): # if there is a tag matching tag_prefix, this yields TAG-NUM-gHEX[-dirty] # if there isn't one, this yields HEX[-dirty] (no NUM) - describe_out, rc = run_command( + describe_out, rc = runner( GITS, - ["describe", "--tags", "--dirty", "--always", "--long", "--match", "%s*" % tag_prefix], + [ + "describe", + "--tags", + "--dirty", + "--always", + "--long", + "--match", + f"{tag_prefix}{TAG_PREFIX_REGEX}", + ], cwd=root, ) # --long was added in git-1.5.5 if describe_out is None: raise NotThisMethod("'git describe' failed") describe_out = describe_out.strip() - full_out, rc = run_command(GITS, ["rev-parse", "HEAD"], cwd=root) + full_out, rc = runner(GITS, ["rev-parse", "HEAD"], cwd=root) if full_out is None: raise NotThisMethod("'git rev-parse' failed") full_out = full_out.strip() @@ -1081,6 +1218,38 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command): pieces["short"] = full_out[:7] # maybe improved later pieces["error"] = None + branch_name, rc = runner(GITS, ["rev-parse", "--abbrev-ref", "HEAD"], cwd=root) + # --abbrev-ref was added in git-1.6.3 + if rc != 0 or branch_name is None: + raise NotThisMethod("'git rev-parse --abbrev-ref' returned error") + branch_name = branch_name.strip() + + if branch_name == "HEAD": + # If we aren't exactly on a branch, pick a branch which represents + # the current commit. If all else fails, we are on a branchless + # commit. + branches, rc = runner(GITS, ["branch", "--contains"], cwd=root) + # --contains was added in git-1.5.4 + if rc != 0 or branches is None: + raise NotThisMethod("'git branch --contains' returned error") + branches = branches.split("\n") + + # Remove the first line if we're running detached + if "(" in branches[0]: + branches.pop(0) + + # Strip off the leading "* " from the list of branches. + branches = [branch[2:] for branch in branches] + if "master" in branches: + branch_name = "master" + elif not branches: + branch_name = None + else: + # Pick the first branch that is returned. Good or bad. + branch_name = branches[0] + + pieces["branch"] = branch_name + # parse describe_out. It will be like TAG-NUM-gHEX[-dirty] or HEX[-dirty] # TAG might have hyphens. git_describe = describe_out @@ -1097,7 +1266,7 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command): # TAG-NUM-gHEX mo = re.search(r"^(.+)-(\d+)-g([0-9a-f]+)$", git_describe) if not mo: - # unparseable. Maybe git-describe is misbehaving? + # unparsable. Maybe git-describe is misbehaving? pieces["error"] = "unable to parse git-describe output: '%s'" % describe_out return pieces @@ -1107,7 +1276,7 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command): if verbose: fmt = "tag '%s' doesn't start with prefix '%s'" print(fmt % (full_tag, tag_prefix)) - pieces["error"] = "tag '%s' doesn't start with prefix '%s'" % (full_tag, tag_prefix) + pieces["error"] = f"tag '{full_tag}' doesn't start with prefix '{tag_prefix}'" return pieces pieces["closest-tag"] = full_tag[len(tag_prefix) :] @@ -1120,11 +1289,11 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command): else: # HEX: no tags pieces["closest-tag"] = None - count_out, rc = run_command(GITS, ["rev-list", "HEAD", "--count"], cwd=root) + count_out, rc = runner(GITS, ["rev-list", "HEAD", "--count"], cwd=root) pieces["distance"] = int(count_out) # total number of commits # commit date: see ISO-8601 comment in git_versions_from_keywords() - date = run_command(GITS, ["show", "-s", "--format=%ci", "HEAD"], cwd=root)[0].strip() + date = runner(GITS, ["show", "-s", "--format=%ci", "HEAD"], cwd=root)[0].strip() # Use only the last line. Previous lines may contain GPG signature # information. date = date.splitlines()[-1] @@ -1146,27 +1315,26 @@ def do_vcs_install(manifest_in, versionfile_source, ipy): if ipy: files.append(ipy) try: - me = __file__ - if me.endswith(".pyc") or me.endswith(".pyo"): - me = os.path.splitext(me)[0] + ".py" - versioneer_file = os.path.relpath(me) + my_path = __file__ + if my_path.endswith(".pyc") or my_path.endswith(".pyo"): + my_path = os.path.splitext(my_path)[0] + ".py" + versioneer_file = os.path.relpath(my_path) except NameError: versioneer_file = "versioneer.py" files.append(versioneer_file) present = False try: - f = open(".gitattributes", "r") - for line in f.readlines(): - if line.strip().startswith(versionfile_source): - if "export-subst" in line.strip().split()[1:]: - present = True - f.close() - except EnvironmentError: + with open(".gitattributes") as fobj: + for line in fobj: + if line.strip().startswith(versionfile_source): + if "export-subst" in line.strip().split()[1:]: + present = True + break + except OSError: pass if not present: - f = open(".gitattributes", "a+") - f.write("%s export-subst\n" % versionfile_source) - f.close() + with open(".gitattributes", "a+") as fobj: + fobj.write(f"{versionfile_source} export-subst\n") files.append(".gitattributes") run_command(GITS, ["add", "--"] + files) @@ -1180,7 +1348,7 @@ def versions_from_parentdir(parentdir_prefix, root, verbose): """ rootdirs = [] - for i in range(3): + for _ in range(3): dirname = os.path.basename(root) if dirname.startswith(parentdir_prefix): return { @@ -1190,9 +1358,8 @@ def versions_from_parentdir(parentdir_prefix, root, verbose): "error": None, "date": None, } - else: - rootdirs.append(root) - root = os.path.dirname(root) # up a level + rootdirs.append(root) + root = os.path.dirname(root) # up a level if verbose: print( @@ -1203,7 +1370,7 @@ def versions_from_parentdir(parentdir_prefix, root, verbose): SHORT_VERSION_PY = """ -# This file was generated by 'versioneer.py' (0.19) from +# This file was generated by 'versioneer.py' (0.21) from # revision-control system data, or from the parent directory name of an # unpacked source archive. Distribution tarballs contain a pre-generated copy # of this file. @@ -1225,7 +1392,7 @@ def versions_from_file(filename): try: with open(filename) as f: contents = f.read() - except EnvironmentError: + except OSError: raise NotThisMethod("unable to read _version.py") mo = re.search(r"version_json = '''\n(.*)''' # END VERSION_JSON", contents, re.M | re.S) if not mo: @@ -1242,7 +1409,7 @@ def write_to_version_file(filename, versions): with open(filename, "w") as f: f.write(SHORT_VERSION_PY % contents) - print("set %s to '%s'" % (filename, versions["version"])) + print("set {} to '{}'".format(filename, versions["version"])) def plus_or_dot(pieces): @@ -1276,16 +1443,63 @@ def render_pep440(pieces): return rendered +def render_pep440_branch(pieces): + """TAG[[.dev0]+DISTANCE.gHEX[.dirty]] . + + The ".dev0" means not master branch. Note that .dev0 sorts backwards + (a feature branch will appear "older" than the master branch). + + Exceptions: + 1: no tags. 0[.dev0]+untagged.DISTANCE.gHEX[.dirty] + """ + if pieces["closest-tag"]: + rendered = pieces["closest-tag"] + if pieces["distance"] or pieces["dirty"]: + if pieces["branch"] != "master": + rendered += ".dev0" + rendered += plus_or_dot(pieces) + rendered += "%d.g%s" % (pieces["distance"], pieces["short"]) + if pieces["dirty"]: + rendered += ".dirty" + else: + # exception #1 + rendered = "0" + if pieces["branch"] != "master": + rendered += ".dev0" + rendered += "+untagged.%d.g%s" % (pieces["distance"], pieces["short"]) + if pieces["dirty"]: + rendered += ".dirty" + return rendered + + +def pep440_split_post(ver): + """Split pep440 version string at the post-release segment. + + Returns the release segments before the post-release and the + post-release version number (or -1 if no post-release segment is present). + """ + vc = str.split(ver, ".post") + return vc[0], int(vc[1] or 0) if len(vc) == 2 else None + + def render_pep440_pre(pieces): - """TAG[.post0.devDISTANCE] -- No -dirty. + """TAG[.postN.devDISTANCE] -- No -dirty. Exceptions: 1: no tags. 0.post0.devDISTANCE """ if pieces["closest-tag"]: - rendered = pieces["closest-tag"] if pieces["distance"]: - rendered += ".post0.dev%d" % pieces["distance"] + # update the post release segment + tag_version, post_version = pep440_split_post(pieces["closest-tag"]) + rendered = tag_version + if post_version is not None: + rendered += ".post%d.dev%d" % (post_version + 1, pieces["distance"]) + else: + rendered += ".post0.dev%d" % (pieces["distance"]) + else: + # no commits, use the tag as the version + rendered = pieces["closest-tag"] else: # exception #1 rendered = "0.post0.dev%d" % pieces["distance"] @@ -1319,6 +1533,35 @@ def render_pep440_post(pieces): return rendered +def render_pep440_post_branch(pieces): + """TAG[.postDISTANCE[.dev0]+gHEX[.dirty]] . + + The ".dev0" means not master branch. + + Exceptions: + 1: no tags. 0.postDISTANCE[.dev0]+gHEX[.dirty] + """ + if pieces["closest-tag"]: + rendered = pieces["closest-tag"] + if pieces["distance"] or pieces["dirty"]: + rendered += ".post%d" % pieces["distance"] + if pieces["branch"] != "master": + rendered += ".dev0" + rendered += plus_or_dot(pieces) + rendered += "g%s" % pieces["short"] + if pieces["dirty"]: + rendered += ".dirty" + else: + # exception #1 + rendered = "0.post%d" % pieces["distance"] + if pieces["branch"] != "master": + rendered += ".dev0" + rendered += "+g%s" % pieces["short"] + if pieces["dirty"]: + rendered += ".dirty" + return rendered + + def render_pep440_old(pieces): """TAG[.postDISTANCE[.dev0]] . @@ -1397,10 +1640,14 @@ def render(pieces, style): if style == "pep440": rendered = render_pep440(pieces) + elif style == "pep440-branch": + rendered = render_pep440_branch(pieces) elif style == "pep440-pre": rendered = render_pep440_pre(pieces) elif style == "pep440-post": rendered = render_pep440_post(pieces) + elif style == "pep440-post-branch": + rendered = render_pep440_post_branch(pieces) elif style == "pep440-old": rendered = render_pep440_old(pieces) elif style == "git-describe": @@ -1465,7 +1712,7 @@ def get_versions(verbose=False): try: ver = versions_from_file(versionfile_abs) if verbose: - print("got version from file %s %s" % (versionfile_abs, ver)) + print(f"got version from file {versionfile_abs} {ver}") return ver except NotThisMethod: pass @@ -1593,7 +1840,9 @@ def run(self): cmds["build_py"] = cmd_build_py - if "setuptools" in sys.modules: + if "build_ext" in cmds: + _build_ext = cmds["build_ext"] + elif "setuptools" in sys.modules: from setuptools.command.build_ext import build_ext as _build_ext else: from distutils.command.build_ext import build_ext as _build_ext @@ -1612,7 +1861,7 @@ def run(self): return # now locate _version.py in the new build/ directory and replace # it with an updated value - target_versionfile = os.path.join(self.build_lib, cfg.versionfile_source) + target_versionfile = os.path.join(self.build_lib, cfg.versionfile_build) print("UPDATING %s" % target_versionfile) write_to_version_file(target_versionfile, versions) @@ -1754,20 +2003,25 @@ def make_release_tree(self, base_dir, files): """ -INIT_PY_SNIPPET = """ +OLD_SNIPPET = """ from ._version import get_versions __version__ = get_versions()['version'] del get_versions """ +INIT_PY_SNIPPET = """ +from . import {0} +__version__ = {0}.get_versions()['version'] +""" + def do_setup(): """Do main VCS-independent setup function for installing Versioneer.""" root = get_root() try: cfg = get_config_from_root(root) - except (EnvironmentError, configparser.NoSectionError, configparser.NoOptionError) as e: - if isinstance(e, (EnvironmentError, configparser.NoSectionError)): + except (OSError, configparser.NoSectionError, configparser.NoOptionError) as e: + if isinstance(e, (OSError, configparser.NoSectionError)): print("Adding sample versioneer config to setup.cfg", file=sys.stderr) with open(os.path.join(root, "setup.cfg"), "a") as f: f.write(SAMPLE_CONFIG) @@ -1791,14 +2045,20 @@ def do_setup(): ipy = os.path.join(os.path.dirname(cfg.versionfile_source), "__init__.py") if os.path.exists(ipy): try: - with open(ipy, "r") as f: + with open(ipy) as f: old = f.read() - except EnvironmentError: + except OSError: old = "" - if INIT_PY_SNIPPET not in old: + module = os.path.splitext(os.path.basename(cfg.versionfile_source))[0] + snippet = INIT_PY_SNIPPET.format(module) + if OLD_SNIPPET in old: + print(" replacing boilerplate in %s" % ipy) + with open(ipy, "w") as f: + f.write(old.replace(OLD_SNIPPET, snippet)) + elif snippet not in old: print(" appending to %s" % ipy) with open(ipy, "a") as f: - f.write(INIT_PY_SNIPPET) + f.write(snippet) else: print(" %s unmodified" % ipy) else: @@ -1812,12 +2072,12 @@ def do_setup(): manifest_in = os.path.join(root, "MANIFEST.in") simple_includes = set() try: - with open(manifest_in, "r") as f: + with open(manifest_in) as f: for line in f: if line.startswith("include "): for include in line.split()[1:]: simple_includes.add(include) - except EnvironmentError: + except OSError: pass # That doesn't cover everything MANIFEST.in can do # (http://docs.python.org/2/distutils/sourcedist.html#commands), so @@ -1848,7 +2108,7 @@ def scan_setup_py(): found = set() setters = False errors = 0 - with open("setup.py", "r") as f: + with open("setup.py") as f: for line in f.readlines(): if "import versioneer" in line: found.add("import") From 7f3aa18b14f678650dcef98cdebf41bb7e62f47b Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Sun, 31 Oct 2021 12:06:41 -0500 Subject: [PATCH 052/193] Fix version regex when building wheels --- suitesparse.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/suitesparse.sh b/suitesparse.sh index 3984649..77410fc 100644 --- a/suitesparse.sh +++ b/suitesparse.sh @@ -1,10 +1,11 @@ -if [[ $1 =~ refs/tags/([0-9]\.[0-9]\.[0-9]).*$ ]]; +if [[ $1 =~ refs/tags/([0-9]*\.[0-9]*\.[0-9]*)\..*$ ]]; then VERSION=${BASH_REMATCH[1]} else exit -1 fi +echo VERSION: $VERSION curl -L https://github.com/DrTimothyAldenDavis/GraphBLAS/archive/refs/tags/v${VERSION}.tar.gz | tar xzf - cd GraphBLAS-${VERSION}/build From b3479838be497b5e4f2dc922d875639b92534407 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Mon, 15 Nov 2021 14:13:59 -0800 Subject: [PATCH 053/193] Update to 6.0.0! --- .github/workflows/test.yml | 6 +- suitesparse_graphblas/create_headers.py | 1 + suitesparse_graphblas/suitesparse_graphblas.h | 69 ++++++++++++++++--- .../suitesparse_graphblas_no_complex.h | 63 ++++++++++++++--- 4 files changed, 114 insertions(+), 25 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8c8aca7..ef86994 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,9 +31,9 @@ jobs: activate-environment: suitesparse-graphblas - name: Build run: | - # sh suitesparse.sh refs/tags/6.0.0.alpha16 - curl -L https://github.com/DrTimothyAldenDavis/GraphBLAS/archive/refs/tags/v6.0.0.alpha16.tar.gz | tar xzf - - pushd GraphBLAS-6.0.0.alpha16/build + # sh suitesparse.sh refs/tags/6.0.0 + curl -L https://github.com/DrTimothyAldenDavis/GraphBLAS/archive/refs/tags/v6.0.0.tar.gz | tar xzf - + pushd GraphBLAS-6.0.0/build echo ${CONDA_PREFIX} cmake -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release .. diff --git a/suitesparse_graphblas/create_headers.py b/suitesparse_graphblas/create_headers.py index 6bc1a5a..5b8daf5 100644 --- a/suitesparse_graphblas/create_headers.py +++ b/suitesparse_graphblas/create_headers.py @@ -261,6 +261,7 @@ def groupby(index, seq): } DEFINES = { + "GrB_INDEX_MAX", "GxB_STDC_VERSION", "GxB_IMPLEMENTATION_MAJOR", "GxB_IMPLEMENTATION_MINOR", diff --git a/suitesparse_graphblas/suitesparse_graphblas.h b/suitesparse_graphblas/suitesparse_graphblas.h index a238ab3..8bec4e0 100644 --- a/suitesparse_graphblas/suitesparse_graphblas.h +++ b/suitesparse_graphblas/suitesparse_graphblas.h @@ -312,6 +312,17 @@ extern GrB_BinaryOp GrB_NE_UINT8; extern GrB_BinaryOp GrB_NE_UINT16; extern GrB_BinaryOp GrB_NE_UINT32; extern GrB_BinaryOp GrB_NE_UINT64; +extern GrB_BinaryOp GrB_ONEB_BOOL; +extern GrB_BinaryOp GrB_ONEB_FP32; +extern GrB_BinaryOp GrB_ONEB_FP64; +extern GrB_BinaryOp GrB_ONEB_INT8; +extern GrB_BinaryOp GrB_ONEB_INT16; +extern GrB_BinaryOp GrB_ONEB_INT32; +extern GrB_BinaryOp GrB_ONEB_INT64; +extern GrB_BinaryOp GrB_ONEB_UINT8; +extern GrB_BinaryOp GrB_ONEB_UINT16; +extern GrB_BinaryOp GrB_ONEB_UINT32; +extern GrB_BinaryOp GrB_ONEB_UINT64; extern GrB_BinaryOp GrB_PLUS_BOOL; extern GrB_BinaryOp GrB_PLUS_FP32; extern GrB_BinaryOp GrB_PLUS_FP64; @@ -869,6 +880,8 @@ extern GrB_BinaryOp GxB_MINUS_FC32; extern GrB_BinaryOp GxB_MINUS_FC64; extern GrB_BinaryOp GxB_NE_FC32; extern GrB_BinaryOp GxB_NE_FC64; +extern GrB_BinaryOp GxB_ONEB_FC32; +extern GrB_BinaryOp GxB_ONEB_FC64; extern GrB_BinaryOp GxB_PAIR_BOOL; extern GrB_BinaryOp GxB_PAIR_FC32; extern GrB_BinaryOp GxB_PAIR_FC64; @@ -2706,9 +2719,20 @@ extern GrB_Info GrB_Matrix_eWiseMult_BinaryOp(GrB_Matrix C, const GrB_Matrix Mas extern GrB_Info GrB_Matrix_eWiseMult_Monoid(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_eWiseMult_Semiring(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_error(const char **error, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_export(GrB_Index *Ap, GrB_Index *Ai, void *Ax, GrB_Format format, GrB_Matrix A); extern GrB_Info GrB_Matrix_exportHint(GrB_Format *format, GrB_Matrix A); extern GrB_Info GrB_Matrix_exportSize(GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +extern GrB_Info GrB_Matrix_export_BOOL(GrB_Index *Ap, GrB_Index *Ai, bool *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +extern GrB_Info GrB_Matrix_export_FP32(GrB_Index *Ap, GrB_Index *Ai, float *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +extern GrB_Info GrB_Matrix_export_FP64(GrB_Index *Ap, GrB_Index *Ai, double *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +extern GrB_Info GrB_Matrix_export_INT8(GrB_Index *Ap, GrB_Index *Ai, int8_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +extern GrB_Info GrB_Matrix_export_INT16(GrB_Index *Ap, GrB_Index *Ai, int16_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +extern GrB_Info GrB_Matrix_export_INT32(GrB_Index *Ap, GrB_Index *Ai, int32_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +extern GrB_Info GrB_Matrix_export_INT64(GrB_Index *Ap, GrB_Index *Ai, int64_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +extern GrB_Info GrB_Matrix_export_UDT(GrB_Index *Ap, GrB_Index *Ai, void *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +extern GrB_Info GrB_Matrix_export_UINT8(GrB_Index *Ap, GrB_Index *Ai, uint8_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +extern GrB_Info GrB_Matrix_export_UINT16(GrB_Index *Ap, GrB_Index *Ai, uint16_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +extern GrB_Info GrB_Matrix_export_UINT32(GrB_Index *Ap, GrB_Index *Ai, uint32_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +extern GrB_Info GrB_Matrix_export_UINT64(GrB_Index *Ap, GrB_Index *Ai, uint64_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); extern GrB_Info GrB_Matrix_extract(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_extractElement_BOOL(bool *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); extern GrB_Info GrB_Matrix_extractElement_FP32(float *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); @@ -2736,17 +2760,28 @@ extern GrB_Info GrB_Matrix_extractTuples_UINT16(GrB_Index *I, GrB_Index *J, uint extern GrB_Info GrB_Matrix_extractTuples_UINT32(GrB_Index *I, GrB_Index *J, uint32_t *X, GrB_Index *nvals, const GrB_Matrix A); extern GrB_Info GrB_Matrix_extractTuples_UINT64(GrB_Index *I, GrB_Index *J, uint64_t *X, GrB_Index *nvals, const GrB_Matrix A); extern GrB_Info GrB_Matrix_free(GrB_Matrix *A); -extern GrB_Info GrB_Matrix_import(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const void *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +extern GrB_Info GrB_Matrix_import_BOOL(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const bool *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +extern GrB_Info GrB_Matrix_import_FP32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const float *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +extern GrB_Info GrB_Matrix_import_FP64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const double *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +extern GrB_Info GrB_Matrix_import_INT8(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int8_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +extern GrB_Info GrB_Matrix_import_INT16(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int16_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +extern GrB_Info GrB_Matrix_import_INT32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int32_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +extern GrB_Info GrB_Matrix_import_INT64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int64_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +extern GrB_Info GrB_Matrix_import_UDT(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const void *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +extern GrB_Info GrB_Matrix_import_UINT8(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint8_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +extern GrB_Info GrB_Matrix_import_UINT16(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint16_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +extern GrB_Info GrB_Matrix_import_UINT32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint32_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +extern GrB_Info GrB_Matrix_import_UINT64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint64_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); extern GrB_Info GrB_Matrix_kronecker_BinaryOp(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_kronecker_Monoid(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_kronecker_Semiring(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_nameless(GrB_Scalar S, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_ncols(GrB_Index *ncols, const GrB_Matrix A); extern GrB_Info GrB_Matrix_new(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols); extern GrB_Info GrB_Matrix_nrows(GrB_Index *nrows, const GrB_Matrix A); extern GrB_Info GrB_Matrix_nvals(GrB_Index *nvals, const GrB_Matrix A); extern GrB_Info GrB_Matrix_reduce_BOOL(bool *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_reduce_BinaryOp(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_reduce_BinaryOp_Scalar(GrB_Scalar S, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_reduce_FP32(float *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_reduce_FP64(double *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_reduce_INT8(int8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); @@ -2754,7 +2789,7 @@ extern GrB_Info GrB_Matrix_reduce_INT16(int16_t *c, const GrB_BinaryOp accum, co extern GrB_Info GrB_Matrix_reduce_INT32(int32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_reduce_INT64(int64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_reduce_Monoid(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_reduce_Scalar(GrB_Scalar c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_reduce_Monoid_Scalar(GrB_Scalar c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_reduce_UDT(void *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_reduce_UINT8(uint8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_reduce_UINT16(uint16_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); @@ -2933,7 +2968,6 @@ extern GrB_Info GrB_Vector_build_UINT16(GrB_Vector w, const GrB_Index *I, const extern GrB_Info GrB_Vector_build_UINT32(GrB_Vector w, const GrB_Index *I, const uint32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); extern GrB_Info GrB_Vector_build_UINT64(GrB_Vector w, const GrB_Index *I, const uint64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); extern GrB_Info GrB_Vector_clear(GrB_Vector v); -extern GrB_Info GrB_Vector_deserialize(GrB_Vector *w, GrB_Type type, const void *blob, GrB_Index blob_size); extern GrB_Info GrB_Vector_dup(GrB_Vector *w, const GrB_Vector u); extern GrB_Info GrB_Vector_eWiseAdd_BinaryOp(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_eWiseAdd_Monoid(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); @@ -2969,17 +3003,17 @@ extern GrB_Info GrB_Vector_extractTuples_UINT16(GrB_Index *I, uint16_t *X, GrB_I extern GrB_Info GrB_Vector_extractTuples_UINT32(GrB_Index *I, uint32_t *X, GrB_Index *nvals, const GrB_Vector v); extern GrB_Info GrB_Vector_extractTuples_UINT64(GrB_Index *I, uint64_t *X, GrB_Index *nvals, const GrB_Vector v); extern GrB_Info GrB_Vector_free(GrB_Vector *v); -extern GrB_Info GrB_Vector_nameless(GrB_Scalar c, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_new(GrB_Vector *v, GrB_Type type, GrB_Index n); extern GrB_Info GrB_Vector_nvals(GrB_Index *nvals, const GrB_Vector v); extern GrB_Info GrB_Vector_reduce_BOOL(bool *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_reduce_BinaryOp_Scalar(GrB_Scalar c, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_reduce_FP32(float *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_reduce_FP64(double *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_reduce_INT8(int8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_reduce_INT16(int16_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_reduce_INT32(int32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_reduce_INT64(int64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_reduce_Scalar(GrB_Scalar c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_reduce_Monoid_Scalar(GrB_Scalar c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_reduce_UDT(void *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_reduce_UINT8(uint8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_reduce_UINT16(uint16_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); @@ -3000,8 +3034,6 @@ extern GrB_Info GrB_Vector_select_UINT8(GrB_Vector w, const GrB_Vector mask, con extern GrB_Info GrB_Vector_select_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint16_t y, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_select_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint32_t y, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_select_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint64_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_serialize(void *blob, GrB_Index *blob_size_handle, GrB_Vector u); -extern GrB_Info GrB_Vector_serializeSize(GrB_Index *blob_size_handle, GrB_Vector u); extern GrB_Info GrB_Vector_setElement_BOOL(GrB_Vector w, bool x, GrB_Index i); extern GrB_Info GrB_Vector_setElement_FP32(GrB_Vector w, float x, GrB_Index i); extern GrB_Info GrB_Vector_setElement_FP64(GrB_Vector w, double x, GrB_Index i); @@ -3022,9 +3054,18 @@ extern GrB_Info GrB_Vector_wait(GrB_Vector v, GrB_WaitMode waitmode); * GB functions * ***************/ +/* binary */ +extern GrB_Info GB_BinaryOp_new(GrB_BinaryOp *binaryop, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *binop_name); + /* selectop */ extern GrB_Info GB_SelectOp_new(GxB_SelectOp *selectop, GxB_select_function function, GrB_Type xtype, GrB_Type ttype, const char *name); +/* type */ +extern GrB_Info GB_Type_new(GrB_Type *type, size_t sizeof_ctype, const char *type_name); + +/* unary */ +extern GrB_Info GB_UnaryOp_new(GrB_UnaryOp *unaryop, GxB_unary_function function, GrB_Type ztype, GrB_Type xtype, const char *unop_name); + /**************** * GxB functions * ****************/ @@ -3078,11 +3119,13 @@ extern GrB_Info GxB_Matrix_build_Scalar(GrB_Matrix C, const GrB_Index *I, const extern GrB_Info GxB_Matrix_concat(GrB_Matrix C, const GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_deserialize(GrB_Matrix *C, GrB_Type type, const void *blob, GrB_Index blob_size, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_diag(GrB_Matrix C, const GrB_Vector v, int64_t k, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_eWiseUnion(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Matrix A, const GrB_Scalar Amissing, const GrB_Matrix B, const GrB_Scalar Bmissing, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_eWiseUnion(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Matrix A, const GrB_Scalar alpha, const GrB_Matrix B, const GrB_Scalar beta, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_export_BitmapC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_export_BitmapR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_export_CSC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_export_CSR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_export_FC32(GrB_Index *Ap, GrB_Index *Ai, GxB_FC32_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +extern GrB_Info GxB_Matrix_export_FC64(GrB_Index *Ap, GrB_Index *Ai, GxB_FC64_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); extern GrB_Info GxB_Matrix_export_FullC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_export_FullR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_export_HyperCSC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); @@ -3096,6 +3139,8 @@ extern GrB_Info GxB_Matrix_import_BitmapC(GrB_Matrix *A, GrB_Type type, GrB_Inde extern GrB_Info GxB_Matrix_import_BitmapR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_import_CSC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_import_CSR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_import_FC32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const GxB_FC32_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +extern GrB_Info GxB_Matrix_import_FC64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const GxB_FC64_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); extern GrB_Info GxB_Matrix_import_FullC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_import_FullR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_import_HyperCSC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); @@ -3210,6 +3255,7 @@ extern GrB_Info GxB_Scalar_setElement_UINT32(GrB_Scalar s, uint32_t x); extern GrB_Info GxB_Scalar_setElement_UINT64(GrB_Scalar s, uint64_t x); extern GrB_Info GxB_Scalar_type(GrB_Type *type, const GrB_Scalar s); extern GrB_Info GxB_Scalar_type_name(char *type_name, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_wait(GrB_Scalar *s); /* selectop */ extern GrB_Info GxB_SelectOp_error(const char **error, const GxB_SelectOp op); @@ -3257,7 +3303,7 @@ extern GrB_Info GxB_Vector_build_FC32(GrB_Vector w, const GrB_Index *I, const Gx extern GrB_Info GxB_Vector_build_FC64(GrB_Vector w, const GrB_Index *I, const GxB_FC64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); extern GrB_Info GxB_Vector_build_Scalar(GrB_Vector w, const GrB_Index *I, GrB_Scalar scalar, GrB_Index nvals); extern GrB_Info GxB_Vector_deserialize(GrB_Vector *w, GrB_Type type, const void *blob, GrB_Index blob_size, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_eWiseUnion(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Vector u, const GrB_Scalar umissing, const GrB_Vector v, const GrB_Scalar vmissing, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_eWiseUnion(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Vector u, const GrB_Scalar alpha, const GrB_Vector v, const GrB_Scalar beta, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_export_Bitmap(GrB_Vector *v, GrB_Type *type, GrB_Index *n, int8_t **vb, void **vx, GrB_Index *vb_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_export_CSC(GrB_Vector *v, GrB_Type *type, GrB_Index *n, GrB_Index **vi, void **vx, GrB_Index *vi_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, bool *jumbled, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_export_Full(GrB_Vector *v, GrB_Type *type, GrB_Index *n, void **vx, GrB_Index *vx_size, bool *iso, const GrB_Descriptor desc); @@ -3308,6 +3354,7 @@ extern GrB_Info GxB_Vector_unpack_Full(GrB_Vector v, void **vx, GrB_Index *vx_si /* int DEFINES */ #define GRB_SUBVERSION ... #define GRB_VERSION ... +#define GrB_INDEX_MAX ... #define GxB_ANY_SPARSITY ... #define GxB_AUTO_SPARSITY ... #define GxB_BACKWARDS ... diff --git a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h index 9cbc7df..ecfbd5e 100644 --- a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h +++ b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h @@ -310,6 +310,17 @@ extern GrB_BinaryOp GrB_NE_UINT8; extern GrB_BinaryOp GrB_NE_UINT16; extern GrB_BinaryOp GrB_NE_UINT32; extern GrB_BinaryOp GrB_NE_UINT64; +extern GrB_BinaryOp GrB_ONEB_BOOL; +extern GrB_BinaryOp GrB_ONEB_FP32; +extern GrB_BinaryOp GrB_ONEB_FP64; +extern GrB_BinaryOp GrB_ONEB_INT8; +extern GrB_BinaryOp GrB_ONEB_INT16; +extern GrB_BinaryOp GrB_ONEB_INT32; +extern GrB_BinaryOp GrB_ONEB_INT64; +extern GrB_BinaryOp GrB_ONEB_UINT8; +extern GrB_BinaryOp GrB_ONEB_UINT16; +extern GrB_BinaryOp GrB_ONEB_UINT32; +extern GrB_BinaryOp GrB_ONEB_UINT64; extern GrB_BinaryOp GrB_PLUS_BOOL; extern GrB_BinaryOp GrB_PLUS_FP32; extern GrB_BinaryOp GrB_PLUS_FP64; @@ -2534,9 +2545,20 @@ extern GrB_Info GrB_Matrix_eWiseMult_BinaryOp(GrB_Matrix C, const GrB_Matrix Mas extern GrB_Info GrB_Matrix_eWiseMult_Monoid(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_eWiseMult_Semiring(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_error(const char **error, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_export(GrB_Index *Ap, GrB_Index *Ai, void *Ax, GrB_Format format, GrB_Matrix A); extern GrB_Info GrB_Matrix_exportHint(GrB_Format *format, GrB_Matrix A); extern GrB_Info GrB_Matrix_exportSize(GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +extern GrB_Info GrB_Matrix_export_BOOL(GrB_Index *Ap, GrB_Index *Ai, bool *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +extern GrB_Info GrB_Matrix_export_FP32(GrB_Index *Ap, GrB_Index *Ai, float *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +extern GrB_Info GrB_Matrix_export_FP64(GrB_Index *Ap, GrB_Index *Ai, double *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +extern GrB_Info GrB_Matrix_export_INT8(GrB_Index *Ap, GrB_Index *Ai, int8_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +extern GrB_Info GrB_Matrix_export_INT16(GrB_Index *Ap, GrB_Index *Ai, int16_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +extern GrB_Info GrB_Matrix_export_INT32(GrB_Index *Ap, GrB_Index *Ai, int32_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +extern GrB_Info GrB_Matrix_export_INT64(GrB_Index *Ap, GrB_Index *Ai, int64_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +extern GrB_Info GrB_Matrix_export_UDT(GrB_Index *Ap, GrB_Index *Ai, void *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +extern GrB_Info GrB_Matrix_export_UINT8(GrB_Index *Ap, GrB_Index *Ai, uint8_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +extern GrB_Info GrB_Matrix_export_UINT16(GrB_Index *Ap, GrB_Index *Ai, uint16_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +extern GrB_Info GrB_Matrix_export_UINT32(GrB_Index *Ap, GrB_Index *Ai, uint32_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +extern GrB_Info GrB_Matrix_export_UINT64(GrB_Index *Ap, GrB_Index *Ai, uint64_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); extern GrB_Info GrB_Matrix_extract(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_extractElement_BOOL(bool *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); extern GrB_Info GrB_Matrix_extractElement_FP32(float *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); @@ -2564,17 +2586,28 @@ extern GrB_Info GrB_Matrix_extractTuples_UINT16(GrB_Index *I, GrB_Index *J, uint extern GrB_Info GrB_Matrix_extractTuples_UINT32(GrB_Index *I, GrB_Index *J, uint32_t *X, GrB_Index *nvals, const GrB_Matrix A); extern GrB_Info GrB_Matrix_extractTuples_UINT64(GrB_Index *I, GrB_Index *J, uint64_t *X, GrB_Index *nvals, const GrB_Matrix A); extern GrB_Info GrB_Matrix_free(GrB_Matrix *A); -extern GrB_Info GrB_Matrix_import(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const void *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +extern GrB_Info GrB_Matrix_import_BOOL(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const bool *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +extern GrB_Info GrB_Matrix_import_FP32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const float *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +extern GrB_Info GrB_Matrix_import_FP64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const double *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +extern GrB_Info GrB_Matrix_import_INT8(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int8_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +extern GrB_Info GrB_Matrix_import_INT16(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int16_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +extern GrB_Info GrB_Matrix_import_INT32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int32_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +extern GrB_Info GrB_Matrix_import_INT64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int64_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +extern GrB_Info GrB_Matrix_import_UDT(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const void *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +extern GrB_Info GrB_Matrix_import_UINT8(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint8_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +extern GrB_Info GrB_Matrix_import_UINT16(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint16_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +extern GrB_Info GrB_Matrix_import_UINT32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint32_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +extern GrB_Info GrB_Matrix_import_UINT64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint64_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); extern GrB_Info GrB_Matrix_kronecker_BinaryOp(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_kronecker_Monoid(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_kronecker_Semiring(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_nameless(GrB_Scalar S, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_ncols(GrB_Index *ncols, const GrB_Matrix A); extern GrB_Info GrB_Matrix_new(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols); extern GrB_Info GrB_Matrix_nrows(GrB_Index *nrows, const GrB_Matrix A); extern GrB_Info GrB_Matrix_nvals(GrB_Index *nvals, const GrB_Matrix A); extern GrB_Info GrB_Matrix_reduce_BOOL(bool *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_reduce_BinaryOp(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_reduce_BinaryOp_Scalar(GrB_Scalar S, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_reduce_FP32(float *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_reduce_FP64(double *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_reduce_INT8(int8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); @@ -2582,7 +2615,7 @@ extern GrB_Info GrB_Matrix_reduce_INT16(int16_t *c, const GrB_BinaryOp accum, co extern GrB_Info GrB_Matrix_reduce_INT32(int32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_reduce_INT64(int64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_reduce_Monoid(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_reduce_Scalar(GrB_Scalar c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_reduce_Monoid_Scalar(GrB_Scalar c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_reduce_UDT(void *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_reduce_UINT8(uint8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_reduce_UINT16(uint16_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); @@ -2761,7 +2794,6 @@ extern GrB_Info GrB_Vector_build_UINT16(GrB_Vector w, const GrB_Index *I, const extern GrB_Info GrB_Vector_build_UINT32(GrB_Vector w, const GrB_Index *I, const uint32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); extern GrB_Info GrB_Vector_build_UINT64(GrB_Vector w, const GrB_Index *I, const uint64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); extern GrB_Info GrB_Vector_clear(GrB_Vector v); -extern GrB_Info GrB_Vector_deserialize(GrB_Vector *w, GrB_Type type, const void *blob, GrB_Index blob_size); extern GrB_Info GrB_Vector_dup(GrB_Vector *w, const GrB_Vector u); extern GrB_Info GrB_Vector_eWiseAdd_BinaryOp(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_eWiseAdd_Monoid(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); @@ -2797,17 +2829,17 @@ extern GrB_Info GrB_Vector_extractTuples_UINT16(GrB_Index *I, uint16_t *X, GrB_I extern GrB_Info GrB_Vector_extractTuples_UINT32(GrB_Index *I, uint32_t *X, GrB_Index *nvals, const GrB_Vector v); extern GrB_Info GrB_Vector_extractTuples_UINT64(GrB_Index *I, uint64_t *X, GrB_Index *nvals, const GrB_Vector v); extern GrB_Info GrB_Vector_free(GrB_Vector *v); -extern GrB_Info GrB_Vector_nameless(GrB_Scalar c, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_new(GrB_Vector *v, GrB_Type type, GrB_Index n); extern GrB_Info GrB_Vector_nvals(GrB_Index *nvals, const GrB_Vector v); extern GrB_Info GrB_Vector_reduce_BOOL(bool *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_reduce_BinaryOp_Scalar(GrB_Scalar c, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_reduce_FP32(float *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_reduce_FP64(double *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_reduce_INT8(int8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_reduce_INT16(int16_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_reduce_INT32(int32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_reduce_INT64(int64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_reduce_Scalar(GrB_Scalar c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_reduce_Monoid_Scalar(GrB_Scalar c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_reduce_UDT(void *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_reduce_UINT8(uint8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_reduce_UINT16(uint16_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); @@ -2828,8 +2860,6 @@ extern GrB_Info GrB_Vector_select_UINT8(GrB_Vector w, const GrB_Vector mask, con extern GrB_Info GrB_Vector_select_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint16_t y, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_select_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint32_t y, const GrB_Descriptor desc); extern GrB_Info GrB_Vector_select_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint64_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_serialize(void *blob, GrB_Index *blob_size_handle, GrB_Vector u); -extern GrB_Info GrB_Vector_serializeSize(GrB_Index *blob_size_handle, GrB_Vector u); extern GrB_Info GrB_Vector_setElement_BOOL(GrB_Vector w, bool x, GrB_Index i); extern GrB_Info GrB_Vector_setElement_FP32(GrB_Vector w, float x, GrB_Index i); extern GrB_Info GrB_Vector_setElement_FP64(GrB_Vector w, double x, GrB_Index i); @@ -2850,9 +2880,18 @@ extern GrB_Info GrB_Vector_wait(GrB_Vector v, GrB_WaitMode waitmode); * GB functions * ***************/ +/* binary */ +extern GrB_Info GB_BinaryOp_new(GrB_BinaryOp *binaryop, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *binop_name); + /* selectop */ extern GrB_Info GB_SelectOp_new(GxB_SelectOp *selectop, GxB_select_function function, GrB_Type xtype, GrB_Type ttype, const char *name); +/* type */ +extern GrB_Info GB_Type_new(GrB_Type *type, size_t sizeof_ctype, const char *type_name); + +/* unary */ +extern GrB_Info GB_UnaryOp_new(GrB_UnaryOp *unaryop, GxB_unary_function function, GrB_Type ztype, GrB_Type xtype, const char *unop_name); + /**************** * GxB functions * ****************/ @@ -2896,7 +2935,7 @@ extern GrB_Info GxB_Matrix_build_Scalar(GrB_Matrix C, const GrB_Index *I, const extern GrB_Info GxB_Matrix_concat(GrB_Matrix C, const GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_deserialize(GrB_Matrix *C, GrB_Type type, const void *blob, GrB_Index blob_size, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_diag(GrB_Matrix C, const GrB_Vector v, int64_t k, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_eWiseUnion(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Matrix A, const GrB_Scalar Amissing, const GrB_Matrix B, const GrB_Scalar Bmissing, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_eWiseUnion(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Matrix A, const GrB_Scalar alpha, const GrB_Matrix B, const GrB_Scalar beta, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_export_BitmapC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_export_BitmapR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_export_CSC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); @@ -3008,6 +3047,7 @@ extern GrB_Info GxB_Scalar_setElement_UINT32(GrB_Scalar s, uint32_t x); extern GrB_Info GxB_Scalar_setElement_UINT64(GrB_Scalar s, uint64_t x); extern GrB_Info GxB_Scalar_type(GrB_Type *type, const GrB_Scalar s); extern GrB_Info GxB_Scalar_type_name(char *type_name, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_wait(GrB_Scalar *s); /* selectop */ extern GrB_Info GxB_SelectOp_error(const char **error, const GxB_SelectOp op); @@ -3045,7 +3085,7 @@ extern GrB_Info GxB_Vector_apply_BinaryOp1st(GrB_Vector w, const GrB_Vector mask extern GrB_Info GxB_Vector_apply_BinaryOp2nd(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const GrB_Scalar y, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_build_Scalar(GrB_Vector w, const GrB_Index *I, GrB_Scalar scalar, GrB_Index nvals); extern GrB_Info GxB_Vector_deserialize(GrB_Vector *w, GrB_Type type, const void *blob, GrB_Index blob_size, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_eWiseUnion(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Vector u, const GrB_Scalar umissing, const GrB_Vector v, const GrB_Scalar vmissing, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_eWiseUnion(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Vector u, const GrB_Scalar alpha, const GrB_Vector v, const GrB_Scalar beta, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_export_Bitmap(GrB_Vector *v, GrB_Type *type, GrB_Index *n, int8_t **vb, void **vx, GrB_Index *vb_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_export_CSC(GrB_Vector *v, GrB_Type *type, GrB_Index *n, GrB_Index **vi, void **vx, GrB_Index *vi_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, bool *jumbled, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_export_Full(GrB_Vector *v, GrB_Type *type, GrB_Index *n, void **vx, GrB_Index *vx_size, bool *iso, const GrB_Descriptor desc); @@ -3084,6 +3124,7 @@ extern GrB_Info GxB_Vector_unpack_Full(GrB_Vector v, void **vx, GrB_Index *vx_si /* int DEFINES */ #define GRB_SUBVERSION ... #define GRB_VERSION ... +#define GrB_INDEX_MAX ... #define GxB_ANY_SPARSITY ... #define GxB_AUTO_SPARSITY ... #define GxB_BACKWARDS ... From 7413f18bf6b3eb42ee75983341473f1f56091333 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Mon, 15 Nov 2021 14:34:15 -0800 Subject: [PATCH 054/193] Update CI to install GraphBLAS from conda-forge and/or source --- .github/workflows/test.yml | 25 +++++++++++++++---------- continuous_integration/environment.yml | 2 +- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ef86994..53cda14 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,10 +14,10 @@ jobs: strategy: fail-fast: false matrix: - # os: ["ubuntu-latest", "macos-latest", "windows-latest"] - os: ["ubuntu-latest"] - # python-version: [3.7, 3.8, 3.9] - python-version: [3.8] + os: ["ubuntu-latest", "macos-latest", "windows-latest"] + python-version: ["3.7", "3.8", "3.9", "3.10"] + source: ["source"] + graphblas-version: ["6.0.0"] steps: - name: Checkout uses: actions/checkout@v2 @@ -29,18 +29,23 @@ jobs: environment-file: continuous_integration/environment.yml channels: conda-forge activate-environment: suitesparse-graphblas - - name: Build + - name: GraphBLAS (from conda-forge) + if: (contains(matrix.source, 'conda-forge')) + run: | + conda install -c conda-forge graphblas=${{ matrix.graphblas-version }} + - name: GraphBLAS (from source) + if: (contains(matrix.source, 'source')) run: | - # sh suitesparse.sh refs/tags/6.0.0 - curl -L https://github.com/DrTimothyAldenDavis/GraphBLAS/archive/refs/tags/v6.0.0.tar.gz | tar xzf - - pushd GraphBLAS-6.0.0/build + # sh suitesparse.sh refs/tags/${{ matrix.graphblas-version }} + curl -L https://github.com/DrTimothyAldenDavis/GraphBLAS/archive/refs/tags/v${{ matrix.graphblas-version }}.tar.gz | tar xzf - + pushd GraphBLAS-${{ matrix.graphblas-version }}/build echo ${CONDA_PREFIX} - cmake -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release .. make JOBS=16 make install popd - + - name: Build + run: | python setup.py build_ext --inplace python setup.py develop - name: Test diff --git a/continuous_integration/environment.yml b/continuous_integration/environment.yml index 25c0e24..2d51f03 100644 --- a/continuous_integration/environment.yml +++ b/continuous_integration/environment.yml @@ -3,7 +3,7 @@ channels: - conda-forge - defaults dependencies: - # - graphblas=5.1.10 + # - graphblas=6.0.0 - cffi - cython - numpy From 4557d3f7deb6867caf0b9277beebf0039bfa733a Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Mon, 15 Nov 2021 17:44:25 -0800 Subject: [PATCH 055/193] make library --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 53cda14..4802a76 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -41,7 +41,7 @@ jobs: pushd GraphBLAS-${{ matrix.graphblas-version }}/build echo ${CONDA_PREFIX} cmake -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release .. - make JOBS=16 + make library JOBS=16 make install popd - name: Build From 10f7e5c7d4153efdb7a6075b3af99d17c28e7e73 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Mon, 15 Nov 2021 21:39:53 -0800 Subject: [PATCH 056/193] Install from conda-forge, and fix GxB_init --- .github/workflows/test.yml | 5 +++-- suitesparse_graphblas/utils.pxd | 1 - suitesparse_graphblas/utils.pyx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4802a76..c4565f7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,7 +16,7 @@ jobs: matrix: os: ["ubuntu-latest", "macos-latest", "windows-latest"] python-version: ["3.7", "3.8", "3.9", "3.10"] - source: ["source"] + source: ["conda-forge", "source"] graphblas-version: ["6.0.0"] steps: - name: Checkout @@ -41,7 +41,8 @@ jobs: pushd GraphBLAS-${{ matrix.graphblas-version }}/build echo ${CONDA_PREFIX} cmake -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release .. - make library JOBS=16 + cat Makefile + make all JOBS=16 make install popd - name: Build diff --git a/suitesparse_graphblas/utils.pxd b/suitesparse_graphblas/utils.pxd index 9eb4fae..776f46f 100644 --- a/suitesparse_graphblas/utils.pxd +++ b/suitesparse_graphblas/utils.pxd @@ -22,7 +22,6 @@ ctypedef uint64_t (*GxB_init)( void *(*user_calloc_function)(size_t, size_t), void *(*user_realloc_function)(void *, size_t), void (*user_free_function)(void *), - bint, # user_malloc_is_thread_safe ) cpdef int call_gxb_init(ffi, lib, int mode) diff --git a/suitesparse_graphblas/utils.pyx b/suitesparse_graphblas/utils.pyx index 371fcad..f4cc560 100644 --- a/suitesparse_graphblas/utils.pyx +++ b/suitesparse_graphblas/utils.pyx @@ -27,7 +27,7 @@ cpdef int call_gxb_init(ffi, lib, int mode): # Return: function pointer in Cython! cdef GxB_init func = int(ffi.cast("uintptr_t", ffi.addressof(lib, "GxB_init"))) - return func(mode, PyDataMem_NEW, PyDataMem_NEW_ZEROED, PyDataMem_RENEW, PyDataMem_FREE, True) + return func(mode, PyDataMem_NEW, PyDataMem_NEW_ZEROED, PyDataMem_RENEW, PyDataMem_FREE) cpdef ndarray claim_buffer(ffi, cdata, size_t size, dtype): From 8b0427c58b99ac59a88bc6e96741347ff9912a15 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Mon, 15 Nov 2021 22:14:17 -0800 Subject: [PATCH 057/193] Don't test with source install --- .github/workflows/test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c4565f7..73c3412 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,7 +16,7 @@ jobs: matrix: os: ["ubuntu-latest", "macos-latest", "windows-latest"] python-version: ["3.7", "3.8", "3.9", "3.10"] - source: ["conda-forge", "source"] + source: ["conda-forge"] graphblas-version: ["6.0.0"] steps: - name: Checkout @@ -36,6 +36,7 @@ jobs: - name: GraphBLAS (from source) if: (contains(matrix.source, 'source')) run: | + # This isn't working! Why not? # sh suitesparse.sh refs/tags/${{ matrix.graphblas-version }} curl -L https://github.com/DrTimothyAldenDavis/GraphBLAS/archive/refs/tags/v${{ matrix.graphblas-version }}.tar.gz | tar xzf - pushd GraphBLAS-${{ matrix.graphblas-version }}/build From 8dadaaae6b20159831bfff60802bc34391c51e20 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Mon, 15 Nov 2021 22:34:01 -0800 Subject: [PATCH 058/193] Fix (ignore non-G[rx]b enums) --- suitesparse_graphblas/create_headers.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/suitesparse_graphblas/create_headers.py b/suitesparse_graphblas/create_headers.py index 5b8daf5..fd4e2d6 100644 --- a/suitesparse_graphblas/create_headers.py +++ b/suitesparse_graphblas/create_headers.py @@ -329,6 +329,9 @@ def groupby(index, seq): "GxB_cuda_malloc", "GxB_cuda_free", } +IGNORE_ENUMS = { + "memory_order", +} class VisitEnumTypedef(c_generator.CGenerator): @@ -368,7 +371,7 @@ def get_groups(ast): groups["GB methods"] = sorted(vals, key=sort_key) missing_methods = {x for x in lines if "extern GrB_Info " in x} - seen - assert not missing_methods + assert not missing_methods, ", ".join(sorted(missing_methods)) vals = {x for x in lines if "extern GrB" in x} - seen seen.update(vals) @@ -387,7 +390,7 @@ def get_groups(ast): groups["GrB const"] = sorted(vals, key=sort_key) missing_const = {x for x in lines if "extern const" in x} - seen - assert not missing_const + assert not missing_const, ", ".join(sorted(missing_const)) vals = {x for x in lines if "typedef" in x and "GxB" in x and "(" not in x} - seen seen.update(vals) @@ -398,7 +401,7 @@ def get_groups(ast): groups["GrB typedef"] = sorted(vals, key=sort_key) missing_typedefs = {x for x in lines if "typedef" in x and "GB" in x and "(" not in x} - seen - assert not missing_typedefs + assert not missing_typedefs, ", ".join(sorted(missing_typedefs)) assert all(x.endswith(";") for x in seen) # sanity check g = VisitEnumTypedef() @@ -416,14 +419,15 @@ def get_groups(ast): groups["GxB typedef enums"] = sorted(vals, key=lambda x: sort_key(x.rsplit("}", 1)[-1])) missing_enums = set(enums) - set(groups["GrB typedef enums"]) - set(groups["GxB typedef enums"]) - assert not missing_enums + missing_enums = {x for x in missing_enums if not any(y in x for y in IGNORE_ENUMS)} + assert not missing_enums, ", ".join(sorted(missing_enums)) vals = {x for x in lines if "typedef" in x and "GxB" in x} - seen seen.update(vals) groups["GxB typedef funcs"] = sorted(vals, key=sort_key) vals = {x for x in lines if "typedef" in x and "GrB" in x} - seen - assert not vals + assert not vals, ", ".join(sorted(vals)) groups["not seen"] = sorted(set(lines) - seen, key=sort_key) for group in groups["not seen"]: assert "extern" not in group, group From 4578435cebe23d11029d411cb099ac707579a8e4 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Tue, 7 Dec 2021 17:20:39 -0600 Subject: [PATCH 059/193] Test with 6.0.2 --- .github/workflows/test.yml | 2 +- continuous_integration/environment.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 73c3412..98f8ca2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,7 +17,7 @@ jobs: os: ["ubuntu-latest", "macos-latest", "windows-latest"] python-version: ["3.7", "3.8", "3.9", "3.10"] source: ["conda-forge"] - graphblas-version: ["6.0.0"] + graphblas-version: ["6.0.2"] steps: - name: Checkout uses: actions/checkout@v2 diff --git a/continuous_integration/environment.yml b/continuous_integration/environment.yml index 2d51f03..22064d0 100644 --- a/continuous_integration/environment.yml +++ b/continuous_integration/environment.yml @@ -3,7 +3,7 @@ channels: - conda-forge - defaults dependencies: - # - graphblas=6.0.0 + # - graphblas=6.0.2 - cffi - cython - numpy From 7ed85ca7fe0151433361992014985d55f04caf85 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Tue, 7 Dec 2021 18:27:04 -0600 Subject: [PATCH 060/193] Update github action to `RalfG/python-wheels-manylinux-build@v0.4.0` Also, build wheels for Python 3.10 --- .github/workflows/wheels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 6141c53..8c9ee25 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -18,9 +18,9 @@ jobs: - name: Checkout uses: actions/checkout@v2 - name: Build manylinux Python wheels - uses: RalfG/python-wheels-manylinux-build@v0.3.4-manylinux2014_x86_64 + uses: RalfG/python-wheels-manylinux-build@v0.4.0-manylinux2014_x86_64 with: - python-versions: 'cp37-cp37m cp38-cp38 cp39-cp39' + python-versions: 'cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310' build-requirements: 'cffi numpy>=1.18,<1.19 cython' pre-build-command: ${{ format('sh suitesparse.sh {0}', github.ref) }} - name: Publish wheels to PyPI From 75a1ab39c7fb5c7cdf243561e28e6b4ceb718d4b Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Wed, 29 Dec 2021 15:12:31 -0600 Subject: [PATCH 061/193] Update to v6.1.1 --- suitesparse_graphblas/suitesparse_graphblas.h | 2 ++ suitesparse_graphblas/suitesparse_graphblas_no_complex.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/suitesparse_graphblas/suitesparse_graphblas.h b/suitesparse_graphblas/suitesparse_graphblas.h index 8bec4e0..ad0932f 100644 --- a/suitesparse_graphblas/suitesparse_graphblas.h +++ b/suitesparse_graphblas/suitesparse_graphblas.h @@ -122,6 +122,8 @@ typedef enum GxB_API_DATE = 17, GxB_API_ABOUT = 18, GxB_API_URL = 19, + GxB_COMPILER_VERSION = 23, + GxB_COMPILER_NAME = 24, GxB_GLOBAL_NTHREADS = 5, GxB_GLOBAL_CHUNK = 7, GxB_BURBLE = 99, diff --git a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h index ecfbd5e..af9af22 100644 --- a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h +++ b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h @@ -120,6 +120,8 @@ typedef enum GxB_API_DATE = 17, GxB_API_ABOUT = 18, GxB_API_URL = 19, + GxB_COMPILER_VERSION = 23, + GxB_COMPILER_NAME = 24, GxB_GLOBAL_NTHREADS = 5, GxB_GLOBAL_CHUNK = 7, GxB_BURBLE = 99, From 60ded041110160c4caf309654d4e1893efd7379a Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Thu, 6 Jan 2022 15:48:02 -0600 Subject: [PATCH 062/193] Use v6.1.3 in CI --- .github/workflows/test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 98f8ca2..d2fc846 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,10 +14,11 @@ jobs: strategy: fail-fast: false matrix: - os: ["ubuntu-latest", "macos-latest", "windows-latest"] + # os: ["ubuntu-latest", "macos-latest", "windows-latest"] # Waiting on builds + os: ["ubuntu-latest"] python-version: ["3.7", "3.8", "3.9", "3.10"] source: ["conda-forge"] - graphblas-version: ["6.0.2"] + graphblas-version: ["6.1.3"] steps: - name: Checkout uses: actions/checkout@v2 From 3553d19bbc6f33b086c3e8f905f3d6dcc48d2171 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Thu, 6 Jan 2022 18:57:43 -0600 Subject: [PATCH 063/193] Drop Python 3.7 and NumPy 1.18 as per NEP 29 --- .github/workflows/test.yml | 2 +- .github/workflows/wheels.yml | 6 +++--- pyproject.toml | 2 +- setup.py | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d2fc846..8a27c33 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,7 +16,7 @@ jobs: matrix: # os: ["ubuntu-latest", "macos-latest", "windows-latest"] # Waiting on builds os: ["ubuntu-latest"] - python-version: ["3.7", "3.8", "3.9", "3.10"] + python-version: ["3.8", "3.9", "3.10"] source: ["conda-forge"] graphblas-version: ["6.1.3"] steps: diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 8c9ee25..0d236c6 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -18,10 +18,10 @@ jobs: - name: Checkout uses: actions/checkout@v2 - name: Build manylinux Python wheels - uses: RalfG/python-wheels-manylinux-build@v0.4.0-manylinux2014_x86_64 + uses: RalfG/python-wheels-manylinux-build@v0.4.2-manylinux2014_x86_64 with: - python-versions: 'cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310' - build-requirements: 'cffi numpy>=1.18,<1.19 cython' + python-versions: 'cp38-cp38 cp39-cp39 cp310-cp310' + build-requirements: 'cffi numpy>=1.19,<1.20 cython' pre-build-command: ${{ format('sh suitesparse.sh {0}', github.ref) }} - name: Publish wheels to PyPI env: diff --git a/pyproject.toml b/pyproject.toml index 1cd3c4e..adbd980 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools", "wheel", "numpy>=1.17", "cython"] +requires = ["setuptools", "wheel", "numpy>=1.19", "cython"] [tool.black] line-length = 100 diff --git a/setup.py b/setup.py index 8ce3c2f..323441f 100644 --- a/setup.py +++ b/setup.py @@ -70,8 +70,8 @@ url="https://github.com/GraphBLAS/python-suitesparse-graphblas", ext_modules=ext_modules, cffi_modules=["suitesparse_graphblas/build.py:ffibuilder"], - python_requires=">=3.7", - install_requires=["cffi>=1.0.0", "numpy>=1.17"], + python_requires=">=3.8", + install_requires=["cffi>=1.0.0", "numpy>=1.19"], setup_requires=["cffi>=1.0.0", "pytest-runner"], tests_require=["pytest"], license="Apache License 2.0", From c210551412c89c949cdfd166064dbf13a1b78844 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Thu, 6 Jan 2022 20:13:47 -0600 Subject: [PATCH 064/193] Don't build wheels for Python 3.10 for now --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 0d236c6..b7339ad 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -20,7 +20,7 @@ jobs: - name: Build manylinux Python wheels uses: RalfG/python-wheels-manylinux-build@v0.4.2-manylinux2014_x86_64 with: - python-versions: 'cp38-cp38 cp39-cp39 cp310-cp310' + python-versions: 'cp38-cp38 cp39-cp39' build-requirements: 'cffi numpy>=1.19,<1.20 cython' pre-build-command: ${{ format('sh suitesparse.sh {0}', github.ref) }} - name: Publish wheels to PyPI From b0be8c43cee10ec830256175daa57033e8a5ea19 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Mon, 31 Jan 2022 18:15:52 -0600 Subject: [PATCH 065/193] Begin updating to SS:GB 6.2.0; `static inline` still WIP --- suitesparse_graphblas/build.py | 7 +- suitesparse_graphblas/create_headers.py | 79 +++- suitesparse_graphblas/source.c | 373 +++++++++++++++++- suitesparse_graphblas/source_no_complex.c | 369 +++++++++++++++++ suitesparse_graphblas/suitesparse_graphblas.h | 15 + .../suitesparse_graphblas_no_complex.h | 15 + 6 files changed, 853 insertions(+), 5 deletions(-) create mode 100644 suitesparse_graphblas/source_no_complex.c diff --git a/suitesparse_graphblas/build.py b/suitesparse_graphblas/build.py index 9a2df43..27563c4 100644 --- a/suitesparse_graphblas/build.py +++ b/suitesparse_graphblas/build.py @@ -8,7 +8,12 @@ ffibuilder = FFI() -with open(os.path.join(thisdir, "source.c")) as f: +if is_win: + source_filename = "source_no_complex.c" +else: + source_filename = "source.c" + +with open(os.path.join(thisdir, source_filename)) as f: source = f.read() include_dirs = [os.path.join(sys.prefix, "include")] diff --git a/suitesparse_graphblas/create_headers.py b/suitesparse_graphblas/create_headers.py index fd4e2d6..e23cdbe 100644 --- a/suitesparse_graphblas/create_headers.py +++ b/suitesparse_graphblas/create_headers.py @@ -315,6 +315,7 @@ def groupby(index, seq): "CMPLX", "CMPLXF", "GB_PUBLIC", + "GB_restrict", "GRAPHBLAS_H", "GrB_INVALID_HANDLE", "GrB_NULL", @@ -426,6 +427,23 @@ def get_groups(ast): seen.update(vals) groups["GxB typedef funcs"] = sorted(vals, key=sort_key) + vals = [] + next_i = -1 + for i, line in enumerate(lines): + if i < next_i or line in seen: + continue + if "inline static" in line and ("GB" in line or "GrB" in line or "GxB" in line): + val = [line] + i += 1 + while lines[i] != "}": + val.append(lines[i]) + i += 1 + val.append(lines[i]) + next_i = i + 1 + seen.update(val) + vals.append("\n".join(val)) + groups["static inline"] = vals + vals = {x for x in lines if "typedef" in x and "GrB" in x} - seen assert not vals, ", ".join(sorted(vals)) groups["not seen"] = sorted(set(lines) - seen, key=sort_key) @@ -579,6 +597,19 @@ def visit_Decl(self, node): if isinstance(node.type, c_ast.FuncDecl) and node.storage == ["extern"]: self.functions.append(node) + class FuncDefVisitorStaticInline(c_ast.NodeVisitor): + def __init__(self): + self.functions = [] + + def visit_FuncDef(self, node): + decl = node.decl + if ( + isinstance(decl.type, c_ast.FuncDecl) + and decl.storage == ["static"] + and decl.funcspec == ["inline"] + ): + self.functions.append(node) + def handle_function_node(node): if generator.visit(node.type.type) != "GrB_Info": raise ValueError(generator.visit(node)) @@ -599,6 +630,7 @@ def handle_function_node(node): group = { # Apply our naming scheme "GrB_Matrix": "matrix", + "Matrix": "matrix", "GrB_Vector": "vector", "GxB_Scalar": "scalar", "SelectOp": "selectop", @@ -610,6 +642,7 @@ def handle_function_node(node): "Type": "type", "UnaryOp": "unary", "IndexUnaryOp": "indexunary", + "Iterator": "iterator", # "everything else" is "core" "getVersion": "core", "Global": "core", @@ -636,16 +669,42 @@ def handle_function_node(node): assert len(gxb_nodes) == len(groups["GxB methods"]) assert len(gb_nodes) == len(groups["GB methods"]) + visitor = FuncDefVisitorStaticInline() + visitor.visit(ast) + static_inline_nodes = visitor.functions + assert len(static_inline_nodes) == len(groups["static inline"]) + for node in static_inline_nodes: + # Sanity check + text = generator.visit(node).strip() + assert text in groups["static inline"] + + def handle_static_inline(node): + decl = node.decl + if decl.name in DEPRECATED: + return + text = generator.visit(node).strip() + if skip_complex and has_complex(text): + return + return { + "name": decl.name, + "group": "static inline", + "node": node, + "text": text + "\n", + } + grb_funcs = (handle_function_node(node) for node in grb_nodes) gxb_funcs = (handle_function_node(node) for node in gxb_nodes) gb_funcs = (handle_function_node(node) for node in gb_nodes) + si_funcs = (handle_static_inline(node) for node in static_inline_nodes) grb_funcs = [x for x in grb_funcs if x is not None] gxb_funcs = [x for x in gxb_funcs if x is not None] gb_funcs = [x for x in gb_funcs if x is not None] + si_funcs = [x for x in si_funcs if x is not None] rv["GrB methods"] = sorted(grb_funcs, key=lambda x: sort_key(x["text"])) rv["GxB methods"] = sorted(gxb_funcs, key=lambda x: sort_key(x["text"])) rv["GB methods"] = sorted(gb_funcs, key=lambda x: sort_key(x["text"])) + rv["static inline"] = si_funcs # Should we sort these? for key in groups.keys() - rv.keys(): rv[key] = groups[key] return rv @@ -732,6 +791,10 @@ def handle_funcs(group): text.append("****************/") text.extend(handle_funcs(groups["GxB methods"])) + # Cython doesn't like compiling this; add to source.c instead (may work?) + # text.append("") + # text.extend(handle_funcs(groups["static inline"])) + text.append("") text.append("/* int DEFINES */") for item in sorted(defines, key=sort_key): @@ -744,7 +807,7 @@ def handle_funcs(group): return text -def create_source_text(*, char_defines=None): +def create_source_text(groups, *, char_defines=None): if char_defines is None: char_defines = CHAR_DEFINES text = [ @@ -753,6 +816,9 @@ def create_source_text(*, char_defines=None): ] for item in sorted(char_defines, key=sort_key): text.append(f"char *{item}_STR = {item};") + text.append("") + for node in groups["static inline"]: + text.append(node["text"]) return text @@ -780,6 +846,7 @@ def main(): final_h = os.path.join(thisdir, "suitesparse_graphblas.h") final_no_complex_h = os.path.join(thisdir, "suitesparse_graphblas_no_complex.h") source_c = os.path.join(thisdir, "source.c") + source_no_complex_c = os.path.join(thisdir, "source_no_complex.c") # Copy original file print(f"Step 1: copy {args.graphblas} to {graphblas_h}") @@ -814,12 +881,18 @@ def main(): # Create source print(f"Step 5: create {source_c}") - text = create_source_text() + text = create_source_text(groups) with open(source_c, "w") as f: f.write("\n".join(text)) + # Create source (no complex) + print(f"Step 6: create {source_no_complex_c}") + text = create_source_text(groups_no_complex) + with open(source_no_complex_c, "w") as f: + f.write("\n".join(text)) + # Check defines - print("Step 6: check #define definitions") + print("Step 7: check #define definitions") with open(graphblas_h) as f: text = f.read() define_lines = re.compile(r".*?#define\s+\w+\s+") diff --git a/suitesparse_graphblas/source.c b/suitesparse_graphblas/source.c index fa5fae3..757439d 100644 --- a/suitesparse_graphblas/source.c +++ b/suitesparse_graphblas/source.c @@ -5,4 +5,375 @@ char *GxB_IMPLEMENTATION_DATE_STR = GxB_IMPLEMENTATION_DATE; char *GxB_IMPLEMENTATION_LICENSE_STR = GxB_IMPLEMENTATION_LICENSE; char *GxB_IMPLEMENTATION_NAME_STR = GxB_IMPLEMENTATION_NAME; char *GxB_SPEC_ABOUT_STR = GxB_SPEC_ABOUT; -char *GxB_SPEC_DATE_STR = GxB_SPEC_DATE; \ No newline at end of file +char *GxB_SPEC_DATE_STR = GxB_SPEC_DATE; + +inline static GrB_Info GB_Iterator_rc_bitmap_next(GxB_Iterator iterator) +{ + for (; iterator->p < iterator->pend; iterator->p++) + { + if (iterator->Ab[iterator->p]) + { + return GrB_SUCCESS; + } + } + + return GrB_NO_VALUE; +} + +inline static GrB_Info GB_Iterator_rc_knext(GxB_Iterator iterator) +{ + if ((++iterator->k) >= iterator->anvec) + { + iterator->pstart = 0; + iterator->pend = 0; + iterator->p = 0; + iterator->k = iterator->anvec; + return GxB_EXHAUSTED; + } + switch (iterator->A_sparsity) + { + default: + + case 2: + + case 1: + { + iterator->pstart = iterator->Ap[iterator->k]; + iterator->pend = iterator->Ap[iterator->k + 1]; + iterator->p = iterator->pstart; + } + break; + + case 4: + { + iterator->pstart += iterator->avlen; + iterator->pend += iterator->avlen; + iterator->p = iterator->pstart; + return GB_Iterator_rc_bitmap_next(iterator); + } + break; + + case 8: + { + iterator->pstart += iterator->avlen; + iterator->pend += iterator->avlen; + iterator->p = iterator->pstart; + } + break; + + } + + return (iterator->p >= iterator->pend) ? (GrB_NO_VALUE) : (GrB_SUCCESS); +} + +inline static GrB_Info GB_Iterator_rc_inext(GxB_Iterator iterator) +{ + if ((++iterator->p) >= iterator->pend) + { + return GrB_NO_VALUE; + } + else + if (iterator->A_sparsity == 4) + { + return GB_Iterator_rc_bitmap_next(iterator); + } + else + { + return GrB_SUCCESS; + } +} + +inline static GrB_Index GB_Iterator_rc_getj(GxB_Iterator iterator) +{ + if (iterator->k >= iterator->anvec) + { + return iterator->avdim; + } + else + if (iterator->A_sparsity == 1) + { + return iterator->Ah[iterator->k]; + } + else + { + return iterator->k; + } +} + +inline static GrB_Index GB_Iterator_rc_geti(GxB_Iterator iterator) +{ + return (iterator->Ai != 0) ? (iterator->Ai[iterator->p]) : (iterator->p - iterator->pstart); +} + +inline static GrB_Info GxB_rowIterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc) +{ + return GB_Iterator_attach(iterator, A, GxB_BY_ROW, desc); +} + +inline static GrB_Index GxB_rowIterator_kount(GxB_Iterator iterator) +{ + return iterator->anvec; +} + +inline static GrB_Info GxB_rowIterator_seekRow(GxB_Iterator iterator, GrB_Index row) +{ + return GB_Iterator_rc_seek(iterator, row, 0); +} + +inline static GrB_Info GxB_rowIterator_kseek(GxB_Iterator iterator, GrB_Index k) +{ + return GB_Iterator_rc_seek(iterator, k, 1); +} + +inline static GrB_Info GxB_rowIterator_nextRow(GxB_Iterator iterator) +{ + return GB_Iterator_rc_knext(iterator); +} + +inline static GrB_Info GxB_rowIterator_nextCol(GxB_Iterator iterator) +{ + return GB_Iterator_rc_inext(iterator); +} + +inline static GrB_Index GxB_rowIterator_getRowIndex(GxB_Iterator iterator) +{ + return GB_Iterator_rc_getj(iterator); +} + +inline static GrB_Index GxB_rowIterator_getColIndex(GxB_Iterator iterator) +{ + return GB_Iterator_rc_geti(iterator); +} + +inline static GrB_Info GxB_colIterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc) +{ + return GB_Iterator_attach(iterator, A, GxB_BY_COL, desc); +} + +inline static GrB_Index GxB_colIterator_kount(GxB_Iterator iterator) +{ + return iterator->anvec; +} + +inline static GrB_Info GxB_colIterator_seekCol(GxB_Iterator iterator, GrB_Index col) +{ + return GB_Iterator_rc_seek(iterator, col, 0); +} + +inline static GrB_Info GxB_colIterator_kseek(GxB_Iterator iterator, GrB_Index k) +{ + return GB_Iterator_rc_seek(iterator, k, 1); +} + +inline static GrB_Info GxB_colIterator_nextCol(GxB_Iterator iterator) +{ + return GB_Iterator_rc_knext(iterator); +} + +inline static GrB_Info GxB_colIterator_nextRow(GxB_Iterator iterator) +{ + return GB_Iterator_rc_inext(iterator); +} + +inline static GrB_Index GxB_colIterator_getColIndex(GxB_Iterator iterator) +{ + return GB_Iterator_rc_getj(iterator); +} + +inline static GrB_Index GxB_colIterator_getRowIndex(GxB_Iterator iterator) +{ + return GB_Iterator_rc_geti(iterator); +} + +inline static GrB_Info GxB_Matrix_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc) +{ + return GB_Iterator_attach(iterator, A, GxB_NO_FORMAT, desc); +} + +inline static GrB_Index GxB_Matrix_Iterator_getpmax(GxB_Iterator iterator) +{ + return iterator->pmax; +} + +inline static GrB_Index GxB_Matrix_Iterator_getp(GxB_Iterator iterator) +{ + return iterator->p; +} + +inline static void GxB_Matrix_Iterator_getIndex(GxB_Iterator iterator, GrB_Index *row, GrB_Index *col) +{ + switch (iterator->A_sparsity) + { + default: + + case 2: + { + if (iterator->by_col) + { + *row = iterator->Ai[iterator->p]; + *col = iterator->k; + } + else + { + *row = iterator->k; + *col = iterator->Ai[iterator->p]; + } + } + break; + + case 1: + { + if (iterator->by_col) + { + *row = iterator->Ai[iterator->p]; + *col = iterator->Ah[iterator->k]; + } + else + { + *row = iterator->Ah[iterator->k]; + *col = iterator->Ai[iterator->p]; + } + } + break; + + case 4: + + case 8: + { + if (iterator->by_col) + { + *row = iterator->p - iterator->pstart; + *col = iterator->k; + } + else + { + *row = iterator->k; + *col = iterator->p - iterator->pstart; + } + } + break; + + } + +} + +inline static GrB_Index GxB_Vector_Iterator_getpmax(GxB_Iterator iterator) +{ + return iterator->pmax; +} + +inline static GrB_Info GxB_Vector_Iterator_seek(GxB_Iterator iterator, GrB_Index p) +{ + if (p >= iterator->pmax) + { + iterator->p = iterator->pmax; + return GxB_EXHAUSTED; + } + else + { + iterator->p = p; + if (iterator->A_sparsity == 4) + { + for (; iterator->p < iterator->pmax; iterator->p++) + { + if (iterator->Ab[iterator->p]) + { + return GrB_SUCCESS; + } + } + + return GxB_EXHAUSTED; + } + } + return GrB_SUCCESS; +} + +inline static GrB_Info GxB_Vector_Iterator_next(GxB_Iterator iterator) +{ + if ((++iterator->p) >= iterator->pmax) + { + iterator->p = iterator->pmax; + return GxB_EXHAUSTED; + } + return GrB_SUCCESS; +} + +inline static GrB_Index GxB_Vector_Iterator_getp(GxB_Iterator iterator) +{ + return iterator->p; +} + +inline static GrB_Index GxB_Vector_Iterator_getIndex(GxB_Iterator iterator) +{ + return (iterator->Ai != 0) ? (iterator->Ai[iterator->p]) : (iterator->p); +} + +inline static bool GxB_Iterator_get_BOOL(GxB_Iterator iterator) +{ + return ((bool *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +inline static int8_t GxB_Iterator_get_INT8(GxB_Iterator iterator) +{ + return ((int8_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +inline static int16_t GxB_Iterator_get_INT16(GxB_Iterator iterator) +{ + return ((int16_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +inline static int32_t GxB_Iterator_get_INT32(GxB_Iterator iterator) +{ + return ((int32_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +inline static int64_t GxB_Iterator_get_INT64(GxB_Iterator iterator) +{ + return ((uint64_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +inline static uint8_t GxB_Iterator_get_UINT8(GxB_Iterator iterator) +{ + return ((uint8_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +inline static uint16_t GxB_Iterator_get_UINT16(GxB_Iterator iterator) +{ + return ((uint16_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +inline static uint32_t GxB_Iterator_get_UINT32(GxB_Iterator iterator) +{ + return ((uint32_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +inline static uint64_t GxB_Iterator_get_UINT64(GxB_Iterator iterator) +{ + return ((uint64_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +inline static float GxB_Iterator_get_FP32(GxB_Iterator iterator) +{ + return ((float *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +inline static double GxB_Iterator_get_FP64(GxB_Iterator iterator) +{ + return ((double *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +inline static GxB_FC32_t GxB_Iterator_get_FC32(GxB_Iterator iterator) +{ + return ((GxB_FC32_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +inline static GxB_FC64_t GxB_Iterator_get_FC64(GxB_Iterator iterator) +{ + return ((GxB_FC64_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +inline static void GxB_Iterator_get_UDT(GxB_Iterator iterator, void *value) +{ + memcpy(value, iterator->Ax + ((iterator->iso) ? (0) : (iterator->type_size * iterator->p)), iterator->type_size); +} diff --git a/suitesparse_graphblas/source_no_complex.c b/suitesparse_graphblas/source_no_complex.c new file mode 100644 index 0000000..0e96968 --- /dev/null +++ b/suitesparse_graphblas/source_no_complex.c @@ -0,0 +1,369 @@ +/* This file is automatically generated */ +#include "GraphBLAS.h" +char *GxB_IMPLEMENTATION_ABOUT_STR = GxB_IMPLEMENTATION_ABOUT; +char *GxB_IMPLEMENTATION_DATE_STR = GxB_IMPLEMENTATION_DATE; +char *GxB_IMPLEMENTATION_LICENSE_STR = GxB_IMPLEMENTATION_LICENSE; +char *GxB_IMPLEMENTATION_NAME_STR = GxB_IMPLEMENTATION_NAME; +char *GxB_SPEC_ABOUT_STR = GxB_SPEC_ABOUT; +char *GxB_SPEC_DATE_STR = GxB_SPEC_DATE; + +inline static GrB_Info GB_Iterator_rc_bitmap_next(GxB_Iterator iterator) +{ + for (; iterator->p < iterator->pend; iterator->p++) + { + if (iterator->Ab[iterator->p]) + { + return GrB_SUCCESS; + } + } + + return GrB_NO_VALUE; +} + +inline static GrB_Info GB_Iterator_rc_knext(GxB_Iterator iterator) +{ + if ((++iterator->k) >= iterator->anvec) + { + iterator->pstart = 0; + iterator->pend = 0; + iterator->p = 0; + iterator->k = iterator->anvec; + return GxB_EXHAUSTED; + } + switch (iterator->A_sparsity) + { + default: + + case 2: + + case 1: + { + iterator->pstart = iterator->Ap[iterator->k]; + iterator->pend = iterator->Ap[iterator->k + 1]; + iterator->p = iterator->pstart; + } + break; + + case 4: + { + iterator->pstart += iterator->avlen; + iterator->pend += iterator->avlen; + iterator->p = iterator->pstart; + return GB_Iterator_rc_bitmap_next(iterator); + } + break; + + case 8: + { + iterator->pstart += iterator->avlen; + iterator->pend += iterator->avlen; + iterator->p = iterator->pstart; + } + break; + + } + + return (iterator->p >= iterator->pend) ? (GrB_NO_VALUE) : (GrB_SUCCESS); +} + +inline static GrB_Info GB_Iterator_rc_inext(GxB_Iterator iterator) +{ + if ((++iterator->p) >= iterator->pend) + { + return GrB_NO_VALUE; + } + else + if (iterator->A_sparsity == 4) + { + return GB_Iterator_rc_bitmap_next(iterator); + } + else + { + return GrB_SUCCESS; + } +} + +inline static GrB_Index GB_Iterator_rc_getj(GxB_Iterator iterator) +{ + if (iterator->k >= iterator->anvec) + { + return iterator->avdim; + } + else + if (iterator->A_sparsity == 1) + { + return iterator->Ah[iterator->k]; + } + else + { + return iterator->k; + } +} + +inline static GrB_Index GB_Iterator_rc_geti(GxB_Iterator iterator) +{ + return (iterator->Ai != 0) ? (iterator->Ai[iterator->p]) : (iterator->p - iterator->pstart); +} + +inline static GrB_Info GxB_rowIterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc) +{ + return GB_Iterator_attach(iterator, A, GxB_BY_ROW, desc); +} + +inline static GrB_Index GxB_rowIterator_kount(GxB_Iterator iterator) +{ + return iterator->anvec; +} + +inline static GrB_Info GxB_rowIterator_seekRow(GxB_Iterator iterator, GrB_Index row) +{ + return GB_Iterator_rc_seek(iterator, row, 0); +} + +inline static GrB_Info GxB_rowIterator_kseek(GxB_Iterator iterator, GrB_Index k) +{ + return GB_Iterator_rc_seek(iterator, k, 1); +} + +inline static GrB_Info GxB_rowIterator_nextRow(GxB_Iterator iterator) +{ + return GB_Iterator_rc_knext(iterator); +} + +inline static GrB_Info GxB_rowIterator_nextCol(GxB_Iterator iterator) +{ + return GB_Iterator_rc_inext(iterator); +} + +inline static GrB_Index GxB_rowIterator_getRowIndex(GxB_Iterator iterator) +{ + return GB_Iterator_rc_getj(iterator); +} + +inline static GrB_Index GxB_rowIterator_getColIndex(GxB_Iterator iterator) +{ + return GB_Iterator_rc_geti(iterator); +} + +inline static GrB_Info GxB_colIterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc) +{ + return GB_Iterator_attach(iterator, A, GxB_BY_COL, desc); +} + +inline static GrB_Index GxB_colIterator_kount(GxB_Iterator iterator) +{ + return iterator->anvec; +} + +inline static GrB_Info GxB_colIterator_seekCol(GxB_Iterator iterator, GrB_Index col) +{ + return GB_Iterator_rc_seek(iterator, col, 0); +} + +inline static GrB_Info GxB_colIterator_kseek(GxB_Iterator iterator, GrB_Index k) +{ + return GB_Iterator_rc_seek(iterator, k, 1); +} + +inline static GrB_Info GxB_colIterator_nextCol(GxB_Iterator iterator) +{ + return GB_Iterator_rc_knext(iterator); +} + +inline static GrB_Info GxB_colIterator_nextRow(GxB_Iterator iterator) +{ + return GB_Iterator_rc_inext(iterator); +} + +inline static GrB_Index GxB_colIterator_getColIndex(GxB_Iterator iterator) +{ + return GB_Iterator_rc_getj(iterator); +} + +inline static GrB_Index GxB_colIterator_getRowIndex(GxB_Iterator iterator) +{ + return GB_Iterator_rc_geti(iterator); +} + +inline static GrB_Info GxB_Matrix_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc) +{ + return GB_Iterator_attach(iterator, A, GxB_NO_FORMAT, desc); +} + +inline static GrB_Index GxB_Matrix_Iterator_getpmax(GxB_Iterator iterator) +{ + return iterator->pmax; +} + +inline static GrB_Index GxB_Matrix_Iterator_getp(GxB_Iterator iterator) +{ + return iterator->p; +} + +inline static void GxB_Matrix_Iterator_getIndex(GxB_Iterator iterator, GrB_Index *row, GrB_Index *col) +{ + switch (iterator->A_sparsity) + { + default: + + case 2: + { + if (iterator->by_col) + { + *row = iterator->Ai[iterator->p]; + *col = iterator->k; + } + else + { + *row = iterator->k; + *col = iterator->Ai[iterator->p]; + } + } + break; + + case 1: + { + if (iterator->by_col) + { + *row = iterator->Ai[iterator->p]; + *col = iterator->Ah[iterator->k]; + } + else + { + *row = iterator->Ah[iterator->k]; + *col = iterator->Ai[iterator->p]; + } + } + break; + + case 4: + + case 8: + { + if (iterator->by_col) + { + *row = iterator->p - iterator->pstart; + *col = iterator->k; + } + else + { + *row = iterator->k; + *col = iterator->p - iterator->pstart; + } + } + break; + + } + +} + +inline static GrB_Index GxB_Vector_Iterator_getpmax(GxB_Iterator iterator) +{ + return iterator->pmax; +} + +inline static GrB_Info GxB_Vector_Iterator_seek(GxB_Iterator iterator, GrB_Index p) +{ + if (p >= iterator->pmax) + { + iterator->p = iterator->pmax; + return GxB_EXHAUSTED; + } + else + { + iterator->p = p; + if (iterator->A_sparsity == 4) + { + for (; iterator->p < iterator->pmax; iterator->p++) + { + if (iterator->Ab[iterator->p]) + { + return GrB_SUCCESS; + } + } + + return GxB_EXHAUSTED; + } + } + return GrB_SUCCESS; +} + +inline static GrB_Info GxB_Vector_Iterator_next(GxB_Iterator iterator) +{ + if ((++iterator->p) >= iterator->pmax) + { + iterator->p = iterator->pmax; + return GxB_EXHAUSTED; + } + return GrB_SUCCESS; +} + +inline static GrB_Index GxB_Vector_Iterator_getp(GxB_Iterator iterator) +{ + return iterator->p; +} + +inline static GrB_Index GxB_Vector_Iterator_getIndex(GxB_Iterator iterator) +{ + return (iterator->Ai != 0) ? (iterator->Ai[iterator->p]) : (iterator->p); +} + +inline static bool GxB_Iterator_get_BOOL(GxB_Iterator iterator) +{ + return ((bool *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +inline static int8_t GxB_Iterator_get_INT8(GxB_Iterator iterator) +{ + return ((int8_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +inline static int16_t GxB_Iterator_get_INT16(GxB_Iterator iterator) +{ + return ((int16_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +inline static int32_t GxB_Iterator_get_INT32(GxB_Iterator iterator) +{ + return ((int32_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +inline static int64_t GxB_Iterator_get_INT64(GxB_Iterator iterator) +{ + return ((uint64_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +inline static uint8_t GxB_Iterator_get_UINT8(GxB_Iterator iterator) +{ + return ((uint8_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +inline static uint16_t GxB_Iterator_get_UINT16(GxB_Iterator iterator) +{ + return ((uint16_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +inline static uint32_t GxB_Iterator_get_UINT32(GxB_Iterator iterator) +{ + return ((uint32_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +inline static uint64_t GxB_Iterator_get_UINT64(GxB_Iterator iterator) +{ + return ((uint64_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +inline static float GxB_Iterator_get_FP32(GxB_Iterator iterator) +{ + return ((float *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +inline static double GxB_Iterator_get_FP64(GxB_Iterator iterator) +{ + return ((double *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +inline static void GxB_Iterator_get_UDT(GxB_Iterator iterator, void *value) +{ + memcpy(value, iterator->Ax + ((iterator->iso) ? (0) : (iterator->type_size * iterator->p)), iterator->type_size); +} diff --git a/suitesparse_graphblas/suitesparse_graphblas.h b/suitesparse_graphblas/suitesparse_graphblas.h index ad0932f..0c2f855 100644 --- a/suitesparse_graphblas/suitesparse_graphblas.h +++ b/suitesparse_graphblas/suitesparse_graphblas.h @@ -15,6 +15,7 @@ typedef uint64_t GrB_Index; /* GxB typedefs */ typedef double _Complex GxB_FC64_t; typedef float _Complex GxB_FC32_t; +typedef struct GB_Iterator_opaque *GxB_Iterator; typedef struct GB_Scalar_opaque *GxB_Scalar; typedef struct GB_SelectOp_opaque *GxB_SelectOp; @@ -68,6 +69,7 @@ typedef enum { GrB_SUCCESS = 0, GrB_NO_VALUE = 1, + GxB_EXHAUSTED = 2, GrB_UNINITIALIZED_OBJECT = -1, GrB_NULL_POINTER = -2, GrB_INVALID_VALUE = -3, @@ -3059,6 +3061,12 @@ extern GrB_Info GrB_Vector_wait(GrB_Vector v, GrB_WaitMode waitmode); /* binary */ extern GrB_Info GB_BinaryOp_new(GrB_BinaryOp *binaryop, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *binop_name); +/* iterator */ +extern GrB_Info GB_Iterator_rc_seek(GxB_Iterator iterator, GrB_Index j, bool jth_vector); + +/* matrix */ +extern GrB_Info GB_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GxB_Format_Value format, GrB_Descriptor desc); + /* selectop */ extern GrB_Info GB_SelectOp_new(GxB_SelectOp *selectop, GxB_select_function function, GrB_Type xtype, GrB_Type ttype, const char *name); @@ -3101,8 +3109,14 @@ extern GrB_Info GxB_IndexUnaryOp_xtype_name(char *type_name, const GrB_IndexUnar extern GrB_Info GxB_IndexUnaryOp_ytype_name(char *type_name, const GrB_IndexUnaryOp op); extern GrB_Info GxB_IndexUnaryOp_ztype_name(char *type_name, const GrB_IndexUnaryOp op); +/* iterator */ +extern GrB_Info GxB_Iterator_free(GxB_Iterator *iterator); +extern GrB_Info GxB_Iterator_new(GxB_Iterator *iterator); + /* matrix */ extern GrB_Info GxB_Col_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_Iterator_next(GxB_Iterator iterator); +extern GrB_Info GxB_Matrix_Iterator_seek(GxB_Iterator iterator, GrB_Index p); extern GrB_Info GxB_Matrix_Option_get(GrB_Matrix A, GxB_Option_Field field, ...); extern GrB_Info GxB_Matrix_Option_set(GrB_Matrix A, GxB_Option_Field field, ...); extern GrB_Info GxB_Matrix_apply_BinaryOp1st(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Matrix A, const GrB_Descriptor desc); @@ -3289,6 +3303,7 @@ extern GrB_Info GxB_UnaryOp_ztype(GrB_Type *ztype, GrB_UnaryOp unaryop); extern GrB_Info GxB_UnaryOp_ztype_name(char *type_name, const GrB_UnaryOp unaryop); /* vector */ +extern GrB_Info GxB_Vector_Iterator_attach(GxB_Iterator iterator, GrB_Vector v, GrB_Descriptor desc); extern GrB_Info GxB_Vector_Option_get(GrB_Vector A, GxB_Option_Field field, ...); extern GrB_Info GxB_Vector_Option_set(GrB_Vector A, GxB_Option_Field field, ...); extern GrB_Info GxB_Vector_apply_BinaryOp1st(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Vector u, const GrB_Descriptor desc); diff --git a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h index af9af22..a261584 100644 --- a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h +++ b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h @@ -13,6 +13,7 @@ typedef struct GB_Vector_opaque *GrB_Vector; typedef uint64_t GrB_Index; /* GxB typedefs */ +typedef struct GB_Iterator_opaque *GxB_Iterator; typedef struct GB_Scalar_opaque *GxB_Scalar; typedef struct GB_SelectOp_opaque *GxB_SelectOp; @@ -66,6 +67,7 @@ typedef enum { GrB_SUCCESS = 0, GrB_NO_VALUE = 1, + GxB_EXHAUSTED = 2, GrB_UNINITIALIZED_OBJECT = -1, GrB_NULL_POINTER = -2, GrB_INVALID_VALUE = -3, @@ -2885,6 +2887,12 @@ extern GrB_Info GrB_Vector_wait(GrB_Vector v, GrB_WaitMode waitmode); /* binary */ extern GrB_Info GB_BinaryOp_new(GrB_BinaryOp *binaryop, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *binop_name); +/* iterator */ +extern GrB_Info GB_Iterator_rc_seek(GxB_Iterator iterator, GrB_Index j, bool jth_vector); + +/* matrix */ +extern GrB_Info GB_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GxB_Format_Value format, GrB_Descriptor desc); + /* selectop */ extern GrB_Info GB_SelectOp_new(GxB_SelectOp *selectop, GxB_select_function function, GrB_Type xtype, GrB_Type ttype, const char *name); @@ -2927,8 +2935,14 @@ extern GrB_Info GxB_IndexUnaryOp_xtype_name(char *type_name, const GrB_IndexUnar extern GrB_Info GxB_IndexUnaryOp_ytype_name(char *type_name, const GrB_IndexUnaryOp op); extern GrB_Info GxB_IndexUnaryOp_ztype_name(char *type_name, const GrB_IndexUnaryOp op); +/* iterator */ +extern GrB_Info GxB_Iterator_free(GxB_Iterator *iterator); +extern GrB_Info GxB_Iterator_new(GxB_Iterator *iterator); + /* matrix */ extern GrB_Info GxB_Col_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_Iterator_next(GxB_Iterator iterator); +extern GrB_Info GxB_Matrix_Iterator_seek(GxB_Iterator iterator, GrB_Index p); extern GrB_Info GxB_Matrix_Option_get(GrB_Matrix A, GxB_Option_Field field, ...); extern GrB_Info GxB_Matrix_Option_set(GrB_Matrix A, GxB_Option_Field field, ...); extern GrB_Info GxB_Matrix_apply_BinaryOp1st(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Matrix A, const GrB_Descriptor desc); @@ -3081,6 +3095,7 @@ extern GrB_Info GxB_UnaryOp_ztype(GrB_Type *ztype, GrB_UnaryOp unaryop); extern GrB_Info GxB_UnaryOp_ztype_name(char *type_name, const GrB_UnaryOp unaryop); /* vector */ +extern GrB_Info GxB_Vector_Iterator_attach(GxB_Iterator iterator, GrB_Vector v, GrB_Descriptor desc); extern GrB_Info GxB_Vector_Option_get(GrB_Vector A, GxB_Option_Field field, ...); extern GrB_Info GxB_Vector_Option_set(GrB_Vector A, GxB_Option_Field field, ...); extern GrB_Info GxB_Vector_apply_BinaryOp1st(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Vector u, const GrB_Descriptor desc); From fdce63a0e96614d546469037b4c87a183192f99a Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Mon, 31 Jan 2022 18:54:26 -0600 Subject: [PATCH 066/193] Install from source in CI --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8a27c33..405de52 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,8 +17,8 @@ jobs: # os: ["ubuntu-latest", "macos-latest", "windows-latest"] # Waiting on builds os: ["ubuntu-latest"] python-version: ["3.8", "3.9", "3.10"] - source: ["conda-forge"] - graphblas-version: ["6.1.3"] + source: ["source"] # ["conda-forge"] + graphblas-version: ["6.2.0.beta2"] steps: - name: Checkout uses: actions/checkout@v2 From 885bbbec51352e32734af97fd55072df47c4aa61 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Mon, 31 Jan 2022 20:32:35 -0600 Subject: [PATCH 067/193] Just to see, also remove static inline from source.c --- suitesparse_graphblas/create_headers.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/suitesparse_graphblas/create_headers.py b/suitesparse_graphblas/create_headers.py index e23cdbe..fb33cfe 100644 --- a/suitesparse_graphblas/create_headers.py +++ b/suitesparse_graphblas/create_headers.py @@ -816,9 +816,10 @@ def create_source_text(groups, *, char_defines=None): ] for item in sorted(char_defines, key=sort_key): text.append(f"char *{item}_STR = {item};") - text.append("") - for node in groups["static inline"]: - text.append(node["text"]) + # Don't define static inline twice + # text.append("") + # for node in groups["static inline"]: + # text.append(node["text"]) return text From 86f3e02c17ee71467153446c75fe4a2b02f821f6 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Mon, 31 Jan 2022 22:13:24 -0600 Subject: [PATCH 068/193] oops, forgot to run --- suitesparse_graphblas/source.c | 373 +--------------------- suitesparse_graphblas/source_no_complex.c | 363 +-------------------- 2 files changed, 2 insertions(+), 734 deletions(-) diff --git a/suitesparse_graphblas/source.c b/suitesparse_graphblas/source.c index 757439d..fa5fae3 100644 --- a/suitesparse_graphblas/source.c +++ b/suitesparse_graphblas/source.c @@ -5,375 +5,4 @@ char *GxB_IMPLEMENTATION_DATE_STR = GxB_IMPLEMENTATION_DATE; char *GxB_IMPLEMENTATION_LICENSE_STR = GxB_IMPLEMENTATION_LICENSE; char *GxB_IMPLEMENTATION_NAME_STR = GxB_IMPLEMENTATION_NAME; char *GxB_SPEC_ABOUT_STR = GxB_SPEC_ABOUT; -char *GxB_SPEC_DATE_STR = GxB_SPEC_DATE; - -inline static GrB_Info GB_Iterator_rc_bitmap_next(GxB_Iterator iterator) -{ - for (; iterator->p < iterator->pend; iterator->p++) - { - if (iterator->Ab[iterator->p]) - { - return GrB_SUCCESS; - } - } - - return GrB_NO_VALUE; -} - -inline static GrB_Info GB_Iterator_rc_knext(GxB_Iterator iterator) -{ - if ((++iterator->k) >= iterator->anvec) - { - iterator->pstart = 0; - iterator->pend = 0; - iterator->p = 0; - iterator->k = iterator->anvec; - return GxB_EXHAUSTED; - } - switch (iterator->A_sparsity) - { - default: - - case 2: - - case 1: - { - iterator->pstart = iterator->Ap[iterator->k]; - iterator->pend = iterator->Ap[iterator->k + 1]; - iterator->p = iterator->pstart; - } - break; - - case 4: - { - iterator->pstart += iterator->avlen; - iterator->pend += iterator->avlen; - iterator->p = iterator->pstart; - return GB_Iterator_rc_bitmap_next(iterator); - } - break; - - case 8: - { - iterator->pstart += iterator->avlen; - iterator->pend += iterator->avlen; - iterator->p = iterator->pstart; - } - break; - - } - - return (iterator->p >= iterator->pend) ? (GrB_NO_VALUE) : (GrB_SUCCESS); -} - -inline static GrB_Info GB_Iterator_rc_inext(GxB_Iterator iterator) -{ - if ((++iterator->p) >= iterator->pend) - { - return GrB_NO_VALUE; - } - else - if (iterator->A_sparsity == 4) - { - return GB_Iterator_rc_bitmap_next(iterator); - } - else - { - return GrB_SUCCESS; - } -} - -inline static GrB_Index GB_Iterator_rc_getj(GxB_Iterator iterator) -{ - if (iterator->k >= iterator->anvec) - { - return iterator->avdim; - } - else - if (iterator->A_sparsity == 1) - { - return iterator->Ah[iterator->k]; - } - else - { - return iterator->k; - } -} - -inline static GrB_Index GB_Iterator_rc_geti(GxB_Iterator iterator) -{ - return (iterator->Ai != 0) ? (iterator->Ai[iterator->p]) : (iterator->p - iterator->pstart); -} - -inline static GrB_Info GxB_rowIterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc) -{ - return GB_Iterator_attach(iterator, A, GxB_BY_ROW, desc); -} - -inline static GrB_Index GxB_rowIterator_kount(GxB_Iterator iterator) -{ - return iterator->anvec; -} - -inline static GrB_Info GxB_rowIterator_seekRow(GxB_Iterator iterator, GrB_Index row) -{ - return GB_Iterator_rc_seek(iterator, row, 0); -} - -inline static GrB_Info GxB_rowIterator_kseek(GxB_Iterator iterator, GrB_Index k) -{ - return GB_Iterator_rc_seek(iterator, k, 1); -} - -inline static GrB_Info GxB_rowIterator_nextRow(GxB_Iterator iterator) -{ - return GB_Iterator_rc_knext(iterator); -} - -inline static GrB_Info GxB_rowIterator_nextCol(GxB_Iterator iterator) -{ - return GB_Iterator_rc_inext(iterator); -} - -inline static GrB_Index GxB_rowIterator_getRowIndex(GxB_Iterator iterator) -{ - return GB_Iterator_rc_getj(iterator); -} - -inline static GrB_Index GxB_rowIterator_getColIndex(GxB_Iterator iterator) -{ - return GB_Iterator_rc_geti(iterator); -} - -inline static GrB_Info GxB_colIterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc) -{ - return GB_Iterator_attach(iterator, A, GxB_BY_COL, desc); -} - -inline static GrB_Index GxB_colIterator_kount(GxB_Iterator iterator) -{ - return iterator->anvec; -} - -inline static GrB_Info GxB_colIterator_seekCol(GxB_Iterator iterator, GrB_Index col) -{ - return GB_Iterator_rc_seek(iterator, col, 0); -} - -inline static GrB_Info GxB_colIterator_kseek(GxB_Iterator iterator, GrB_Index k) -{ - return GB_Iterator_rc_seek(iterator, k, 1); -} - -inline static GrB_Info GxB_colIterator_nextCol(GxB_Iterator iterator) -{ - return GB_Iterator_rc_knext(iterator); -} - -inline static GrB_Info GxB_colIterator_nextRow(GxB_Iterator iterator) -{ - return GB_Iterator_rc_inext(iterator); -} - -inline static GrB_Index GxB_colIterator_getColIndex(GxB_Iterator iterator) -{ - return GB_Iterator_rc_getj(iterator); -} - -inline static GrB_Index GxB_colIterator_getRowIndex(GxB_Iterator iterator) -{ - return GB_Iterator_rc_geti(iterator); -} - -inline static GrB_Info GxB_Matrix_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc) -{ - return GB_Iterator_attach(iterator, A, GxB_NO_FORMAT, desc); -} - -inline static GrB_Index GxB_Matrix_Iterator_getpmax(GxB_Iterator iterator) -{ - return iterator->pmax; -} - -inline static GrB_Index GxB_Matrix_Iterator_getp(GxB_Iterator iterator) -{ - return iterator->p; -} - -inline static void GxB_Matrix_Iterator_getIndex(GxB_Iterator iterator, GrB_Index *row, GrB_Index *col) -{ - switch (iterator->A_sparsity) - { - default: - - case 2: - { - if (iterator->by_col) - { - *row = iterator->Ai[iterator->p]; - *col = iterator->k; - } - else - { - *row = iterator->k; - *col = iterator->Ai[iterator->p]; - } - } - break; - - case 1: - { - if (iterator->by_col) - { - *row = iterator->Ai[iterator->p]; - *col = iterator->Ah[iterator->k]; - } - else - { - *row = iterator->Ah[iterator->k]; - *col = iterator->Ai[iterator->p]; - } - } - break; - - case 4: - - case 8: - { - if (iterator->by_col) - { - *row = iterator->p - iterator->pstart; - *col = iterator->k; - } - else - { - *row = iterator->k; - *col = iterator->p - iterator->pstart; - } - } - break; - - } - -} - -inline static GrB_Index GxB_Vector_Iterator_getpmax(GxB_Iterator iterator) -{ - return iterator->pmax; -} - -inline static GrB_Info GxB_Vector_Iterator_seek(GxB_Iterator iterator, GrB_Index p) -{ - if (p >= iterator->pmax) - { - iterator->p = iterator->pmax; - return GxB_EXHAUSTED; - } - else - { - iterator->p = p; - if (iterator->A_sparsity == 4) - { - for (; iterator->p < iterator->pmax; iterator->p++) - { - if (iterator->Ab[iterator->p]) - { - return GrB_SUCCESS; - } - } - - return GxB_EXHAUSTED; - } - } - return GrB_SUCCESS; -} - -inline static GrB_Info GxB_Vector_Iterator_next(GxB_Iterator iterator) -{ - if ((++iterator->p) >= iterator->pmax) - { - iterator->p = iterator->pmax; - return GxB_EXHAUSTED; - } - return GrB_SUCCESS; -} - -inline static GrB_Index GxB_Vector_Iterator_getp(GxB_Iterator iterator) -{ - return iterator->p; -} - -inline static GrB_Index GxB_Vector_Iterator_getIndex(GxB_Iterator iterator) -{ - return (iterator->Ai != 0) ? (iterator->Ai[iterator->p]) : (iterator->p); -} - -inline static bool GxB_Iterator_get_BOOL(GxB_Iterator iterator) -{ - return ((bool *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -inline static int8_t GxB_Iterator_get_INT8(GxB_Iterator iterator) -{ - return ((int8_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -inline static int16_t GxB_Iterator_get_INT16(GxB_Iterator iterator) -{ - return ((int16_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -inline static int32_t GxB_Iterator_get_INT32(GxB_Iterator iterator) -{ - return ((int32_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -inline static int64_t GxB_Iterator_get_INT64(GxB_Iterator iterator) -{ - return ((uint64_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -inline static uint8_t GxB_Iterator_get_UINT8(GxB_Iterator iterator) -{ - return ((uint8_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -inline static uint16_t GxB_Iterator_get_UINT16(GxB_Iterator iterator) -{ - return ((uint16_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -inline static uint32_t GxB_Iterator_get_UINT32(GxB_Iterator iterator) -{ - return ((uint32_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -inline static uint64_t GxB_Iterator_get_UINT64(GxB_Iterator iterator) -{ - return ((uint64_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -inline static float GxB_Iterator_get_FP32(GxB_Iterator iterator) -{ - return ((float *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -inline static double GxB_Iterator_get_FP64(GxB_Iterator iterator) -{ - return ((double *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -inline static GxB_FC32_t GxB_Iterator_get_FC32(GxB_Iterator iterator) -{ - return ((GxB_FC32_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -inline static GxB_FC64_t GxB_Iterator_get_FC64(GxB_Iterator iterator) -{ - return ((GxB_FC64_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -inline static void GxB_Iterator_get_UDT(GxB_Iterator iterator, void *value) -{ - memcpy(value, iterator->Ax + ((iterator->iso) ? (0) : (iterator->type_size * iterator->p)), iterator->type_size); -} +char *GxB_SPEC_DATE_STR = GxB_SPEC_DATE; \ No newline at end of file diff --git a/suitesparse_graphblas/source_no_complex.c b/suitesparse_graphblas/source_no_complex.c index 0e96968..fa5fae3 100644 --- a/suitesparse_graphblas/source_no_complex.c +++ b/suitesparse_graphblas/source_no_complex.c @@ -5,365 +5,4 @@ char *GxB_IMPLEMENTATION_DATE_STR = GxB_IMPLEMENTATION_DATE; char *GxB_IMPLEMENTATION_LICENSE_STR = GxB_IMPLEMENTATION_LICENSE; char *GxB_IMPLEMENTATION_NAME_STR = GxB_IMPLEMENTATION_NAME; char *GxB_SPEC_ABOUT_STR = GxB_SPEC_ABOUT; -char *GxB_SPEC_DATE_STR = GxB_SPEC_DATE; - -inline static GrB_Info GB_Iterator_rc_bitmap_next(GxB_Iterator iterator) -{ - for (; iterator->p < iterator->pend; iterator->p++) - { - if (iterator->Ab[iterator->p]) - { - return GrB_SUCCESS; - } - } - - return GrB_NO_VALUE; -} - -inline static GrB_Info GB_Iterator_rc_knext(GxB_Iterator iterator) -{ - if ((++iterator->k) >= iterator->anvec) - { - iterator->pstart = 0; - iterator->pend = 0; - iterator->p = 0; - iterator->k = iterator->anvec; - return GxB_EXHAUSTED; - } - switch (iterator->A_sparsity) - { - default: - - case 2: - - case 1: - { - iterator->pstart = iterator->Ap[iterator->k]; - iterator->pend = iterator->Ap[iterator->k + 1]; - iterator->p = iterator->pstart; - } - break; - - case 4: - { - iterator->pstart += iterator->avlen; - iterator->pend += iterator->avlen; - iterator->p = iterator->pstart; - return GB_Iterator_rc_bitmap_next(iterator); - } - break; - - case 8: - { - iterator->pstart += iterator->avlen; - iterator->pend += iterator->avlen; - iterator->p = iterator->pstart; - } - break; - - } - - return (iterator->p >= iterator->pend) ? (GrB_NO_VALUE) : (GrB_SUCCESS); -} - -inline static GrB_Info GB_Iterator_rc_inext(GxB_Iterator iterator) -{ - if ((++iterator->p) >= iterator->pend) - { - return GrB_NO_VALUE; - } - else - if (iterator->A_sparsity == 4) - { - return GB_Iterator_rc_bitmap_next(iterator); - } - else - { - return GrB_SUCCESS; - } -} - -inline static GrB_Index GB_Iterator_rc_getj(GxB_Iterator iterator) -{ - if (iterator->k >= iterator->anvec) - { - return iterator->avdim; - } - else - if (iterator->A_sparsity == 1) - { - return iterator->Ah[iterator->k]; - } - else - { - return iterator->k; - } -} - -inline static GrB_Index GB_Iterator_rc_geti(GxB_Iterator iterator) -{ - return (iterator->Ai != 0) ? (iterator->Ai[iterator->p]) : (iterator->p - iterator->pstart); -} - -inline static GrB_Info GxB_rowIterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc) -{ - return GB_Iterator_attach(iterator, A, GxB_BY_ROW, desc); -} - -inline static GrB_Index GxB_rowIterator_kount(GxB_Iterator iterator) -{ - return iterator->anvec; -} - -inline static GrB_Info GxB_rowIterator_seekRow(GxB_Iterator iterator, GrB_Index row) -{ - return GB_Iterator_rc_seek(iterator, row, 0); -} - -inline static GrB_Info GxB_rowIterator_kseek(GxB_Iterator iterator, GrB_Index k) -{ - return GB_Iterator_rc_seek(iterator, k, 1); -} - -inline static GrB_Info GxB_rowIterator_nextRow(GxB_Iterator iterator) -{ - return GB_Iterator_rc_knext(iterator); -} - -inline static GrB_Info GxB_rowIterator_nextCol(GxB_Iterator iterator) -{ - return GB_Iterator_rc_inext(iterator); -} - -inline static GrB_Index GxB_rowIterator_getRowIndex(GxB_Iterator iterator) -{ - return GB_Iterator_rc_getj(iterator); -} - -inline static GrB_Index GxB_rowIterator_getColIndex(GxB_Iterator iterator) -{ - return GB_Iterator_rc_geti(iterator); -} - -inline static GrB_Info GxB_colIterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc) -{ - return GB_Iterator_attach(iterator, A, GxB_BY_COL, desc); -} - -inline static GrB_Index GxB_colIterator_kount(GxB_Iterator iterator) -{ - return iterator->anvec; -} - -inline static GrB_Info GxB_colIterator_seekCol(GxB_Iterator iterator, GrB_Index col) -{ - return GB_Iterator_rc_seek(iterator, col, 0); -} - -inline static GrB_Info GxB_colIterator_kseek(GxB_Iterator iterator, GrB_Index k) -{ - return GB_Iterator_rc_seek(iterator, k, 1); -} - -inline static GrB_Info GxB_colIterator_nextCol(GxB_Iterator iterator) -{ - return GB_Iterator_rc_knext(iterator); -} - -inline static GrB_Info GxB_colIterator_nextRow(GxB_Iterator iterator) -{ - return GB_Iterator_rc_inext(iterator); -} - -inline static GrB_Index GxB_colIterator_getColIndex(GxB_Iterator iterator) -{ - return GB_Iterator_rc_getj(iterator); -} - -inline static GrB_Index GxB_colIterator_getRowIndex(GxB_Iterator iterator) -{ - return GB_Iterator_rc_geti(iterator); -} - -inline static GrB_Info GxB_Matrix_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc) -{ - return GB_Iterator_attach(iterator, A, GxB_NO_FORMAT, desc); -} - -inline static GrB_Index GxB_Matrix_Iterator_getpmax(GxB_Iterator iterator) -{ - return iterator->pmax; -} - -inline static GrB_Index GxB_Matrix_Iterator_getp(GxB_Iterator iterator) -{ - return iterator->p; -} - -inline static void GxB_Matrix_Iterator_getIndex(GxB_Iterator iterator, GrB_Index *row, GrB_Index *col) -{ - switch (iterator->A_sparsity) - { - default: - - case 2: - { - if (iterator->by_col) - { - *row = iterator->Ai[iterator->p]; - *col = iterator->k; - } - else - { - *row = iterator->k; - *col = iterator->Ai[iterator->p]; - } - } - break; - - case 1: - { - if (iterator->by_col) - { - *row = iterator->Ai[iterator->p]; - *col = iterator->Ah[iterator->k]; - } - else - { - *row = iterator->Ah[iterator->k]; - *col = iterator->Ai[iterator->p]; - } - } - break; - - case 4: - - case 8: - { - if (iterator->by_col) - { - *row = iterator->p - iterator->pstart; - *col = iterator->k; - } - else - { - *row = iterator->k; - *col = iterator->p - iterator->pstart; - } - } - break; - - } - -} - -inline static GrB_Index GxB_Vector_Iterator_getpmax(GxB_Iterator iterator) -{ - return iterator->pmax; -} - -inline static GrB_Info GxB_Vector_Iterator_seek(GxB_Iterator iterator, GrB_Index p) -{ - if (p >= iterator->pmax) - { - iterator->p = iterator->pmax; - return GxB_EXHAUSTED; - } - else - { - iterator->p = p; - if (iterator->A_sparsity == 4) - { - for (; iterator->p < iterator->pmax; iterator->p++) - { - if (iterator->Ab[iterator->p]) - { - return GrB_SUCCESS; - } - } - - return GxB_EXHAUSTED; - } - } - return GrB_SUCCESS; -} - -inline static GrB_Info GxB_Vector_Iterator_next(GxB_Iterator iterator) -{ - if ((++iterator->p) >= iterator->pmax) - { - iterator->p = iterator->pmax; - return GxB_EXHAUSTED; - } - return GrB_SUCCESS; -} - -inline static GrB_Index GxB_Vector_Iterator_getp(GxB_Iterator iterator) -{ - return iterator->p; -} - -inline static GrB_Index GxB_Vector_Iterator_getIndex(GxB_Iterator iterator) -{ - return (iterator->Ai != 0) ? (iterator->Ai[iterator->p]) : (iterator->p); -} - -inline static bool GxB_Iterator_get_BOOL(GxB_Iterator iterator) -{ - return ((bool *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -inline static int8_t GxB_Iterator_get_INT8(GxB_Iterator iterator) -{ - return ((int8_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -inline static int16_t GxB_Iterator_get_INT16(GxB_Iterator iterator) -{ - return ((int16_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -inline static int32_t GxB_Iterator_get_INT32(GxB_Iterator iterator) -{ - return ((int32_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -inline static int64_t GxB_Iterator_get_INT64(GxB_Iterator iterator) -{ - return ((uint64_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -inline static uint8_t GxB_Iterator_get_UINT8(GxB_Iterator iterator) -{ - return ((uint8_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -inline static uint16_t GxB_Iterator_get_UINT16(GxB_Iterator iterator) -{ - return ((uint16_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -inline static uint32_t GxB_Iterator_get_UINT32(GxB_Iterator iterator) -{ - return ((uint32_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -inline static uint64_t GxB_Iterator_get_UINT64(GxB_Iterator iterator) -{ - return ((uint64_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -inline static float GxB_Iterator_get_FP32(GxB_Iterator iterator) -{ - return ((float *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -inline static double GxB_Iterator_get_FP64(GxB_Iterator iterator) -{ - return ((double *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -inline static void GxB_Iterator_get_UDT(GxB_Iterator iterator, void *value) -{ - memcpy(value, iterator->Ax + ((iterator->iso) ? (0) : (iterator->type_size * iterator->p)), iterator->type_size); -} +char *GxB_SPEC_DATE_STR = GxB_SPEC_DATE; \ No newline at end of file From c560991e35a027a11521f9856e9657684c0dc25c Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Tue, 1 Feb 2022 14:18:58 -0600 Subject: [PATCH 069/193] Undo changes to source.c handling --- suitesparse_graphblas/build.py | 7 +------ suitesparse_graphblas/create_headers.py | 15 ++------------- suitesparse_graphblas/source_no_complex.c | 8 -------- suitesparse_graphblas/suitesparse_graphblas.h | 15 --------------- .../suitesparse_graphblas_no_complex.h | 15 --------------- 5 files changed, 3 insertions(+), 57 deletions(-) delete mode 100644 suitesparse_graphblas/source_no_complex.c diff --git a/suitesparse_graphblas/build.py b/suitesparse_graphblas/build.py index 27563c4..9a2df43 100644 --- a/suitesparse_graphblas/build.py +++ b/suitesparse_graphblas/build.py @@ -8,12 +8,7 @@ ffibuilder = FFI() -if is_win: - source_filename = "source_no_complex.c" -else: - source_filename = "source.c" - -with open(os.path.join(thisdir, source_filename)) as f: +with open(os.path.join(thisdir, "source.c")) as f: source = f.read() include_dirs = [os.path.join(sys.prefix, "include")] diff --git a/suitesparse_graphblas/create_headers.py b/suitesparse_graphblas/create_headers.py index fb33cfe..57bbf1e 100644 --- a/suitesparse_graphblas/create_headers.py +++ b/suitesparse_graphblas/create_headers.py @@ -791,7 +791,7 @@ def handle_funcs(group): text.append("****************/") text.extend(handle_funcs(groups["GxB methods"])) - # Cython doesn't like compiling this; add to source.c instead (may work?) + # CFFI doesn't like compiling this # text.append("") # text.extend(handle_funcs(groups["static inline"])) @@ -816,10 +816,6 @@ def create_source_text(groups, *, char_defines=None): ] for item in sorted(char_defines, key=sort_key): text.append(f"char *{item}_STR = {item};") - # Don't define static inline twice - # text.append("") - # for node in groups["static inline"]: - # text.append(node["text"]) return text @@ -847,7 +843,6 @@ def main(): final_h = os.path.join(thisdir, "suitesparse_graphblas.h") final_no_complex_h = os.path.join(thisdir, "suitesparse_graphblas_no_complex.h") source_c = os.path.join(thisdir, "source.c") - source_no_complex_c = os.path.join(thisdir, "source_no_complex.c") # Copy original file print(f"Step 1: copy {args.graphblas} to {graphblas_h}") @@ -886,14 +881,8 @@ def main(): with open(source_c, "w") as f: f.write("\n".join(text)) - # Create source (no complex) - print(f"Step 6: create {source_no_complex_c}") - text = create_source_text(groups_no_complex) - with open(source_no_complex_c, "w") as f: - f.write("\n".join(text)) - # Check defines - print("Step 7: check #define definitions") + print("Step 6: check #define definitions") with open(graphblas_h) as f: text = f.read() define_lines = re.compile(r".*?#define\s+\w+\s+") diff --git a/suitesparse_graphblas/source_no_complex.c b/suitesparse_graphblas/source_no_complex.c deleted file mode 100644 index fa5fae3..0000000 --- a/suitesparse_graphblas/source_no_complex.c +++ /dev/null @@ -1,8 +0,0 @@ -/* This file is automatically generated */ -#include "GraphBLAS.h" -char *GxB_IMPLEMENTATION_ABOUT_STR = GxB_IMPLEMENTATION_ABOUT; -char *GxB_IMPLEMENTATION_DATE_STR = GxB_IMPLEMENTATION_DATE; -char *GxB_IMPLEMENTATION_LICENSE_STR = GxB_IMPLEMENTATION_LICENSE; -char *GxB_IMPLEMENTATION_NAME_STR = GxB_IMPLEMENTATION_NAME; -char *GxB_SPEC_ABOUT_STR = GxB_SPEC_ABOUT; -char *GxB_SPEC_DATE_STR = GxB_SPEC_DATE; \ No newline at end of file diff --git a/suitesparse_graphblas/suitesparse_graphblas.h b/suitesparse_graphblas/suitesparse_graphblas.h index 0c2f855..ad0932f 100644 --- a/suitesparse_graphblas/suitesparse_graphblas.h +++ b/suitesparse_graphblas/suitesparse_graphblas.h @@ -15,7 +15,6 @@ typedef uint64_t GrB_Index; /* GxB typedefs */ typedef double _Complex GxB_FC64_t; typedef float _Complex GxB_FC32_t; -typedef struct GB_Iterator_opaque *GxB_Iterator; typedef struct GB_Scalar_opaque *GxB_Scalar; typedef struct GB_SelectOp_opaque *GxB_SelectOp; @@ -69,7 +68,6 @@ typedef enum { GrB_SUCCESS = 0, GrB_NO_VALUE = 1, - GxB_EXHAUSTED = 2, GrB_UNINITIALIZED_OBJECT = -1, GrB_NULL_POINTER = -2, GrB_INVALID_VALUE = -3, @@ -3061,12 +3059,6 @@ extern GrB_Info GrB_Vector_wait(GrB_Vector v, GrB_WaitMode waitmode); /* binary */ extern GrB_Info GB_BinaryOp_new(GrB_BinaryOp *binaryop, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *binop_name); -/* iterator */ -extern GrB_Info GB_Iterator_rc_seek(GxB_Iterator iterator, GrB_Index j, bool jth_vector); - -/* matrix */ -extern GrB_Info GB_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GxB_Format_Value format, GrB_Descriptor desc); - /* selectop */ extern GrB_Info GB_SelectOp_new(GxB_SelectOp *selectop, GxB_select_function function, GrB_Type xtype, GrB_Type ttype, const char *name); @@ -3109,14 +3101,8 @@ extern GrB_Info GxB_IndexUnaryOp_xtype_name(char *type_name, const GrB_IndexUnar extern GrB_Info GxB_IndexUnaryOp_ytype_name(char *type_name, const GrB_IndexUnaryOp op); extern GrB_Info GxB_IndexUnaryOp_ztype_name(char *type_name, const GrB_IndexUnaryOp op); -/* iterator */ -extern GrB_Info GxB_Iterator_free(GxB_Iterator *iterator); -extern GrB_Info GxB_Iterator_new(GxB_Iterator *iterator); - /* matrix */ extern GrB_Info GxB_Col_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_Iterator_next(GxB_Iterator iterator); -extern GrB_Info GxB_Matrix_Iterator_seek(GxB_Iterator iterator, GrB_Index p); extern GrB_Info GxB_Matrix_Option_get(GrB_Matrix A, GxB_Option_Field field, ...); extern GrB_Info GxB_Matrix_Option_set(GrB_Matrix A, GxB_Option_Field field, ...); extern GrB_Info GxB_Matrix_apply_BinaryOp1st(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Matrix A, const GrB_Descriptor desc); @@ -3303,7 +3289,6 @@ extern GrB_Info GxB_UnaryOp_ztype(GrB_Type *ztype, GrB_UnaryOp unaryop); extern GrB_Info GxB_UnaryOp_ztype_name(char *type_name, const GrB_UnaryOp unaryop); /* vector */ -extern GrB_Info GxB_Vector_Iterator_attach(GxB_Iterator iterator, GrB_Vector v, GrB_Descriptor desc); extern GrB_Info GxB_Vector_Option_get(GrB_Vector A, GxB_Option_Field field, ...); extern GrB_Info GxB_Vector_Option_set(GrB_Vector A, GxB_Option_Field field, ...); extern GrB_Info GxB_Vector_apply_BinaryOp1st(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Vector u, const GrB_Descriptor desc); diff --git a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h index a261584..af9af22 100644 --- a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h +++ b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h @@ -13,7 +13,6 @@ typedef struct GB_Vector_opaque *GrB_Vector; typedef uint64_t GrB_Index; /* GxB typedefs */ -typedef struct GB_Iterator_opaque *GxB_Iterator; typedef struct GB_Scalar_opaque *GxB_Scalar; typedef struct GB_SelectOp_opaque *GxB_SelectOp; @@ -67,7 +66,6 @@ typedef enum { GrB_SUCCESS = 0, GrB_NO_VALUE = 1, - GxB_EXHAUSTED = 2, GrB_UNINITIALIZED_OBJECT = -1, GrB_NULL_POINTER = -2, GrB_INVALID_VALUE = -3, @@ -2887,12 +2885,6 @@ extern GrB_Info GrB_Vector_wait(GrB_Vector v, GrB_WaitMode waitmode); /* binary */ extern GrB_Info GB_BinaryOp_new(GrB_BinaryOp *binaryop, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *binop_name); -/* iterator */ -extern GrB_Info GB_Iterator_rc_seek(GxB_Iterator iterator, GrB_Index j, bool jth_vector); - -/* matrix */ -extern GrB_Info GB_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GxB_Format_Value format, GrB_Descriptor desc); - /* selectop */ extern GrB_Info GB_SelectOp_new(GxB_SelectOp *selectop, GxB_select_function function, GrB_Type xtype, GrB_Type ttype, const char *name); @@ -2935,14 +2927,8 @@ extern GrB_Info GxB_IndexUnaryOp_xtype_name(char *type_name, const GrB_IndexUnar extern GrB_Info GxB_IndexUnaryOp_ytype_name(char *type_name, const GrB_IndexUnaryOp op); extern GrB_Info GxB_IndexUnaryOp_ztype_name(char *type_name, const GrB_IndexUnaryOp op); -/* iterator */ -extern GrB_Info GxB_Iterator_free(GxB_Iterator *iterator); -extern GrB_Info GxB_Iterator_new(GxB_Iterator *iterator); - /* matrix */ extern GrB_Info GxB_Col_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_Iterator_next(GxB_Iterator iterator); -extern GrB_Info GxB_Matrix_Iterator_seek(GxB_Iterator iterator, GrB_Index p); extern GrB_Info GxB_Matrix_Option_get(GrB_Matrix A, GxB_Option_Field field, ...); extern GrB_Info GxB_Matrix_Option_set(GrB_Matrix A, GxB_Option_Field field, ...); extern GrB_Info GxB_Matrix_apply_BinaryOp1st(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Matrix A, const GrB_Descriptor desc); @@ -3095,7 +3081,6 @@ extern GrB_Info GxB_UnaryOp_ztype(GrB_Type *ztype, GrB_UnaryOp unaryop); extern GrB_Info GxB_UnaryOp_ztype_name(char *type_name, const GrB_UnaryOp unaryop); /* vector */ -extern GrB_Info GxB_Vector_Iterator_attach(GxB_Iterator iterator, GrB_Vector v, GrB_Descriptor desc); extern GrB_Info GxB_Vector_Option_get(GrB_Vector A, GxB_Option_Field field, ...); extern GrB_Info GxB_Vector_Option_set(GrB_Vector A, GxB_Option_Field field, ...); extern GrB_Info GxB_Vector_apply_BinaryOp1st(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Vector u, const GrB_Descriptor desc); From 27a58f103dba368d721d4725c3e061fb7726b39a Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Tue, 1 Feb 2022 17:31:16 -0600 Subject: [PATCH 070/193] Wrap/redefine static inline functions with '_' appended to their names --- suitesparse_graphblas/create_headers.py | 27 +- suitesparse_graphblas/source.c | 373 +++++++++++++++++- suitesparse_graphblas/source_no_complex.c | 369 +++++++++++++++++ suitesparse_graphblas/suitesparse_graphblas.h | 63 +++ .../suitesparse_graphblas_no_complex.h | 61 +++ 5 files changed, 888 insertions(+), 5 deletions(-) create mode 100644 suitesparse_graphblas/source_no_complex.c diff --git a/suitesparse_graphblas/create_headers.py b/suitesparse_graphblas/create_headers.py index 57bbf1e..cc0a273 100644 --- a/suitesparse_graphblas/create_headers.py +++ b/suitesparse_graphblas/create_headers.py @@ -682,7 +682,12 @@ def handle_static_inline(node): decl = node.decl if decl.name in DEPRECATED: return + # Append "_" to the name that we expose to Python + decl.type.type.declname += "_" + decl.storage = ["extern"] + decl.funcspec = [] text = generator.visit(node).strip() + decl_text = generator.visit(decl).strip() if skip_complex and has_complex(text): return return { @@ -690,6 +695,7 @@ def handle_static_inline(node): "group": "static inline", "node": node, "text": text + "\n", + "decl_text": decl_text + ";", } grb_funcs = (handle_function_node(node) for node in grb_nodes) @@ -791,9 +797,12 @@ def handle_funcs(group): text.append("****************/") text.extend(handle_funcs(groups["GxB methods"])) - # CFFI doesn't like compiling this - # text.append("") - # text.extend(handle_funcs(groups["static inline"])) + # Declare wrapper functions with '_' appended to the name + text.append("") + text.append("/**************************") + text.append("* static inline functions *") + text.append("**************************/") + text.extend(sorted((info["decl_text"] for info in groups["static inline"]), key=sort_key)) text.append("") text.append("/* int DEFINES */") @@ -816,6 +825,9 @@ def create_source_text(groups, *, char_defines=None): ] for item in sorted(char_defines, key=sort_key): text.append(f"char *{item}_STR = {item};") + text.append("") + for node in groups["static inline"]: + text.append(node["text"]) return text @@ -843,6 +855,7 @@ def main(): final_h = os.path.join(thisdir, "suitesparse_graphblas.h") final_no_complex_h = os.path.join(thisdir, "suitesparse_graphblas_no_complex.h") source_c = os.path.join(thisdir, "source.c") + source_no_complex_c = os.path.join(thisdir, "source_no_complex.c") # Copy original file print(f"Step 1: copy {args.graphblas} to {graphblas_h}") @@ -881,8 +894,14 @@ def main(): with open(source_c, "w") as f: f.write("\n".join(text)) + # Create source (no complex) + print(f"Step 6: create {source_no_complex_c}") + text = create_source_text(groups_no_complex) + with open(source_no_complex_c, "w") as f: + f.write("\n".join(text)) + # Check defines - print("Step 6: check #define definitions") + print("Step 7: check #define definitions") with open(graphblas_h) as f: text = f.read() define_lines = re.compile(r".*?#define\s+\w+\s+") diff --git a/suitesparse_graphblas/source.c b/suitesparse_graphblas/source.c index fa5fae3..34ed92f 100644 --- a/suitesparse_graphblas/source.c +++ b/suitesparse_graphblas/source.c @@ -5,4 +5,375 @@ char *GxB_IMPLEMENTATION_DATE_STR = GxB_IMPLEMENTATION_DATE; char *GxB_IMPLEMENTATION_LICENSE_STR = GxB_IMPLEMENTATION_LICENSE; char *GxB_IMPLEMENTATION_NAME_STR = GxB_IMPLEMENTATION_NAME; char *GxB_SPEC_ABOUT_STR = GxB_SPEC_ABOUT; -char *GxB_SPEC_DATE_STR = GxB_SPEC_DATE; \ No newline at end of file +char *GxB_SPEC_DATE_STR = GxB_SPEC_DATE; + +extern GrB_Info GB_Iterator_rc_bitmap_next_(GxB_Iterator iterator) +{ + for (; iterator->p < iterator->pend; iterator->p++) + { + if (iterator->Ab[iterator->p]) + { + return GrB_SUCCESS; + } + } + + return GrB_NO_VALUE; +} + +extern GrB_Info GB_Iterator_rc_knext_(GxB_Iterator iterator) +{ + if ((++iterator->k) >= iterator->anvec) + { + iterator->pstart = 0; + iterator->pend = 0; + iterator->p = 0; + iterator->k = iterator->anvec; + return GxB_EXHAUSTED; + } + switch (iterator->A_sparsity) + { + default: + + case 2: + + case 1: + { + iterator->pstart = iterator->Ap[iterator->k]; + iterator->pend = iterator->Ap[iterator->k + 1]; + iterator->p = iterator->pstart; + } + break; + + case 4: + { + iterator->pstart += iterator->avlen; + iterator->pend += iterator->avlen; + iterator->p = iterator->pstart; + return GB_Iterator_rc_bitmap_next(iterator); + } + break; + + case 8: + { + iterator->pstart += iterator->avlen; + iterator->pend += iterator->avlen; + iterator->p = iterator->pstart; + } + break; + + } + + return (iterator->p >= iterator->pend) ? (GrB_NO_VALUE) : (GrB_SUCCESS); +} + +extern GrB_Info GB_Iterator_rc_inext_(GxB_Iterator iterator) +{ + if ((++iterator->p) >= iterator->pend) + { + return GrB_NO_VALUE; + } + else + if (iterator->A_sparsity == 4) + { + return GB_Iterator_rc_bitmap_next(iterator); + } + else + { + return GrB_SUCCESS; + } +} + +extern GrB_Index GB_Iterator_rc_getj_(GxB_Iterator iterator) +{ + if (iterator->k >= iterator->anvec) + { + return iterator->avdim; + } + else + if (iterator->A_sparsity == 1) + { + return iterator->Ah[iterator->k]; + } + else + { + return iterator->k; + } +} + +extern GrB_Index GB_Iterator_rc_geti_(GxB_Iterator iterator) +{ + return (iterator->Ai != 0) ? (iterator->Ai[iterator->p]) : (iterator->p - iterator->pstart); +} + +extern GrB_Info GxB_rowIterator_attach_(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc) +{ + return GB_Iterator_attach(iterator, A, GxB_BY_ROW, desc); +} + +extern GrB_Index GxB_rowIterator_kount_(GxB_Iterator iterator) +{ + return iterator->anvec; +} + +extern GrB_Info GxB_rowIterator_seekRow_(GxB_Iterator iterator, GrB_Index row) +{ + return GB_Iterator_rc_seek(iterator, row, 0); +} + +extern GrB_Info GxB_rowIterator_kseek_(GxB_Iterator iterator, GrB_Index k) +{ + return GB_Iterator_rc_seek(iterator, k, 1); +} + +extern GrB_Info GxB_rowIterator_nextRow_(GxB_Iterator iterator) +{ + return GB_Iterator_rc_knext(iterator); +} + +extern GrB_Info GxB_rowIterator_nextCol_(GxB_Iterator iterator) +{ + return GB_Iterator_rc_inext(iterator); +} + +extern GrB_Index GxB_rowIterator_getRowIndex_(GxB_Iterator iterator) +{ + return GB_Iterator_rc_getj(iterator); +} + +extern GrB_Index GxB_rowIterator_getColIndex_(GxB_Iterator iterator) +{ + return GB_Iterator_rc_geti(iterator); +} + +extern GrB_Info GxB_colIterator_attach_(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc) +{ + return GB_Iterator_attach(iterator, A, GxB_BY_COL, desc); +} + +extern GrB_Index GxB_colIterator_kount_(GxB_Iterator iterator) +{ + return iterator->anvec; +} + +extern GrB_Info GxB_colIterator_seekCol_(GxB_Iterator iterator, GrB_Index col) +{ + return GB_Iterator_rc_seek(iterator, col, 0); +} + +extern GrB_Info GxB_colIterator_kseek_(GxB_Iterator iterator, GrB_Index k) +{ + return GB_Iterator_rc_seek(iterator, k, 1); +} + +extern GrB_Info GxB_colIterator_nextCol_(GxB_Iterator iterator) +{ + return GB_Iterator_rc_knext(iterator); +} + +extern GrB_Info GxB_colIterator_nextRow_(GxB_Iterator iterator) +{ + return GB_Iterator_rc_inext(iterator); +} + +extern GrB_Index GxB_colIterator_getColIndex_(GxB_Iterator iterator) +{ + return GB_Iterator_rc_getj(iterator); +} + +extern GrB_Index GxB_colIterator_getRowIndex_(GxB_Iterator iterator) +{ + return GB_Iterator_rc_geti(iterator); +} + +extern GrB_Info GxB_Matrix_Iterator_attach_(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc) +{ + return GB_Iterator_attach(iterator, A, GxB_NO_FORMAT, desc); +} + +extern GrB_Index GxB_Matrix_Iterator_getpmax_(GxB_Iterator iterator) +{ + return iterator->pmax; +} + +extern GrB_Index GxB_Matrix_Iterator_getp_(GxB_Iterator iterator) +{ + return iterator->p; +} + +extern void GxB_Matrix_Iterator_getIndex_(GxB_Iterator iterator, GrB_Index *row, GrB_Index *col) +{ + switch (iterator->A_sparsity) + { + default: + + case 2: + { + if (iterator->by_col) + { + *row = iterator->Ai[iterator->p]; + *col = iterator->k; + } + else + { + *row = iterator->k; + *col = iterator->Ai[iterator->p]; + } + } + break; + + case 1: + { + if (iterator->by_col) + { + *row = iterator->Ai[iterator->p]; + *col = iterator->Ah[iterator->k]; + } + else + { + *row = iterator->Ah[iterator->k]; + *col = iterator->Ai[iterator->p]; + } + } + break; + + case 4: + + case 8: + { + if (iterator->by_col) + { + *row = iterator->p - iterator->pstart; + *col = iterator->k; + } + else + { + *row = iterator->k; + *col = iterator->p - iterator->pstart; + } + } + break; + + } + +} + +extern GrB_Index GxB_Vector_Iterator_getpmax_(GxB_Iterator iterator) +{ + return iterator->pmax; +} + +extern GrB_Info GxB_Vector_Iterator_seek_(GxB_Iterator iterator, GrB_Index p) +{ + if (p >= iterator->pmax) + { + iterator->p = iterator->pmax; + return GxB_EXHAUSTED; + } + else + { + iterator->p = p; + if (iterator->A_sparsity == 4) + { + for (; iterator->p < iterator->pmax; iterator->p++) + { + if (iterator->Ab[iterator->p]) + { + return GrB_SUCCESS; + } + } + + return GxB_EXHAUSTED; + } + } + return GrB_SUCCESS; +} + +extern GrB_Info GxB_Vector_Iterator_next_(GxB_Iterator iterator) +{ + if ((++iterator->p) >= iterator->pmax) + { + iterator->p = iterator->pmax; + return GxB_EXHAUSTED; + } + return GrB_SUCCESS; +} + +extern GrB_Index GxB_Vector_Iterator_getp_(GxB_Iterator iterator) +{ + return iterator->p; +} + +extern GrB_Index GxB_Vector_Iterator_getIndex_(GxB_Iterator iterator) +{ + return (iterator->Ai != 0) ? (iterator->Ai[iterator->p]) : (iterator->p); +} + +extern bool GxB_Iterator_get_BOOL_(GxB_Iterator iterator) +{ + return ((bool *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +extern int8_t GxB_Iterator_get_INT8_(GxB_Iterator iterator) +{ + return ((int8_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +extern int16_t GxB_Iterator_get_INT16_(GxB_Iterator iterator) +{ + return ((int16_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +extern int32_t GxB_Iterator_get_INT32_(GxB_Iterator iterator) +{ + return ((int32_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +extern int64_t GxB_Iterator_get_INT64_(GxB_Iterator iterator) +{ + return ((uint64_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +extern uint8_t GxB_Iterator_get_UINT8_(GxB_Iterator iterator) +{ + return ((uint8_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +extern uint16_t GxB_Iterator_get_UINT16_(GxB_Iterator iterator) +{ + return ((uint16_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +extern uint32_t GxB_Iterator_get_UINT32_(GxB_Iterator iterator) +{ + return ((uint32_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +extern uint64_t GxB_Iterator_get_UINT64_(GxB_Iterator iterator) +{ + return ((uint64_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +extern float GxB_Iterator_get_FP32_(GxB_Iterator iterator) +{ + return ((float *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +extern double GxB_Iterator_get_FP64_(GxB_Iterator iterator) +{ + return ((double *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +extern GxB_FC32_t GxB_Iterator_get_FC32_(GxB_Iterator iterator) +{ + return ((GxB_FC32_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +extern GxB_FC64_t GxB_Iterator_get_FC64_(GxB_Iterator iterator) +{ + return ((GxB_FC64_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +extern void GxB_Iterator_get_UDT_(GxB_Iterator iterator, void *value) +{ + memcpy(value, iterator->Ax + ((iterator->iso) ? (0) : (iterator->type_size * iterator->p)), iterator->type_size); +} diff --git a/suitesparse_graphblas/source_no_complex.c b/suitesparse_graphblas/source_no_complex.c new file mode 100644 index 0000000..2cdf4f6 --- /dev/null +++ b/suitesparse_graphblas/source_no_complex.c @@ -0,0 +1,369 @@ +/* This file is automatically generated */ +#include "GraphBLAS.h" +char *GxB_IMPLEMENTATION_ABOUT_STR = GxB_IMPLEMENTATION_ABOUT; +char *GxB_IMPLEMENTATION_DATE_STR = GxB_IMPLEMENTATION_DATE; +char *GxB_IMPLEMENTATION_LICENSE_STR = GxB_IMPLEMENTATION_LICENSE; +char *GxB_IMPLEMENTATION_NAME_STR = GxB_IMPLEMENTATION_NAME; +char *GxB_SPEC_ABOUT_STR = GxB_SPEC_ABOUT; +char *GxB_SPEC_DATE_STR = GxB_SPEC_DATE; + +extern GrB_Info GB_Iterator_rc_bitmap_next_(GxB_Iterator iterator) +{ + for (; iterator->p < iterator->pend; iterator->p++) + { + if (iterator->Ab[iterator->p]) + { + return GrB_SUCCESS; + } + } + + return GrB_NO_VALUE; +} + +extern GrB_Info GB_Iterator_rc_knext_(GxB_Iterator iterator) +{ + if ((++iterator->k) >= iterator->anvec) + { + iterator->pstart = 0; + iterator->pend = 0; + iterator->p = 0; + iterator->k = iterator->anvec; + return GxB_EXHAUSTED; + } + switch (iterator->A_sparsity) + { + default: + + case 2: + + case 1: + { + iterator->pstart = iterator->Ap[iterator->k]; + iterator->pend = iterator->Ap[iterator->k + 1]; + iterator->p = iterator->pstart; + } + break; + + case 4: + { + iterator->pstart += iterator->avlen; + iterator->pend += iterator->avlen; + iterator->p = iterator->pstart; + return GB_Iterator_rc_bitmap_next(iterator); + } + break; + + case 8: + { + iterator->pstart += iterator->avlen; + iterator->pend += iterator->avlen; + iterator->p = iterator->pstart; + } + break; + + } + + return (iterator->p >= iterator->pend) ? (GrB_NO_VALUE) : (GrB_SUCCESS); +} + +extern GrB_Info GB_Iterator_rc_inext_(GxB_Iterator iterator) +{ + if ((++iterator->p) >= iterator->pend) + { + return GrB_NO_VALUE; + } + else + if (iterator->A_sparsity == 4) + { + return GB_Iterator_rc_bitmap_next(iterator); + } + else + { + return GrB_SUCCESS; + } +} + +extern GrB_Index GB_Iterator_rc_getj_(GxB_Iterator iterator) +{ + if (iterator->k >= iterator->anvec) + { + return iterator->avdim; + } + else + if (iterator->A_sparsity == 1) + { + return iterator->Ah[iterator->k]; + } + else + { + return iterator->k; + } +} + +extern GrB_Index GB_Iterator_rc_geti_(GxB_Iterator iterator) +{ + return (iterator->Ai != 0) ? (iterator->Ai[iterator->p]) : (iterator->p - iterator->pstart); +} + +extern GrB_Info GxB_rowIterator_attach_(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc) +{ + return GB_Iterator_attach(iterator, A, GxB_BY_ROW, desc); +} + +extern GrB_Index GxB_rowIterator_kount_(GxB_Iterator iterator) +{ + return iterator->anvec; +} + +extern GrB_Info GxB_rowIterator_seekRow_(GxB_Iterator iterator, GrB_Index row) +{ + return GB_Iterator_rc_seek(iterator, row, 0); +} + +extern GrB_Info GxB_rowIterator_kseek_(GxB_Iterator iterator, GrB_Index k) +{ + return GB_Iterator_rc_seek(iterator, k, 1); +} + +extern GrB_Info GxB_rowIterator_nextRow_(GxB_Iterator iterator) +{ + return GB_Iterator_rc_knext(iterator); +} + +extern GrB_Info GxB_rowIterator_nextCol_(GxB_Iterator iterator) +{ + return GB_Iterator_rc_inext(iterator); +} + +extern GrB_Index GxB_rowIterator_getRowIndex_(GxB_Iterator iterator) +{ + return GB_Iterator_rc_getj(iterator); +} + +extern GrB_Index GxB_rowIterator_getColIndex_(GxB_Iterator iterator) +{ + return GB_Iterator_rc_geti(iterator); +} + +extern GrB_Info GxB_colIterator_attach_(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc) +{ + return GB_Iterator_attach(iterator, A, GxB_BY_COL, desc); +} + +extern GrB_Index GxB_colIterator_kount_(GxB_Iterator iterator) +{ + return iterator->anvec; +} + +extern GrB_Info GxB_colIterator_seekCol_(GxB_Iterator iterator, GrB_Index col) +{ + return GB_Iterator_rc_seek(iterator, col, 0); +} + +extern GrB_Info GxB_colIterator_kseek_(GxB_Iterator iterator, GrB_Index k) +{ + return GB_Iterator_rc_seek(iterator, k, 1); +} + +extern GrB_Info GxB_colIterator_nextCol_(GxB_Iterator iterator) +{ + return GB_Iterator_rc_knext(iterator); +} + +extern GrB_Info GxB_colIterator_nextRow_(GxB_Iterator iterator) +{ + return GB_Iterator_rc_inext(iterator); +} + +extern GrB_Index GxB_colIterator_getColIndex_(GxB_Iterator iterator) +{ + return GB_Iterator_rc_getj(iterator); +} + +extern GrB_Index GxB_colIterator_getRowIndex_(GxB_Iterator iterator) +{ + return GB_Iterator_rc_geti(iterator); +} + +extern GrB_Info GxB_Matrix_Iterator_attach_(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc) +{ + return GB_Iterator_attach(iterator, A, GxB_NO_FORMAT, desc); +} + +extern GrB_Index GxB_Matrix_Iterator_getpmax_(GxB_Iterator iterator) +{ + return iterator->pmax; +} + +extern GrB_Index GxB_Matrix_Iterator_getp_(GxB_Iterator iterator) +{ + return iterator->p; +} + +extern void GxB_Matrix_Iterator_getIndex_(GxB_Iterator iterator, GrB_Index *row, GrB_Index *col) +{ + switch (iterator->A_sparsity) + { + default: + + case 2: + { + if (iterator->by_col) + { + *row = iterator->Ai[iterator->p]; + *col = iterator->k; + } + else + { + *row = iterator->k; + *col = iterator->Ai[iterator->p]; + } + } + break; + + case 1: + { + if (iterator->by_col) + { + *row = iterator->Ai[iterator->p]; + *col = iterator->Ah[iterator->k]; + } + else + { + *row = iterator->Ah[iterator->k]; + *col = iterator->Ai[iterator->p]; + } + } + break; + + case 4: + + case 8: + { + if (iterator->by_col) + { + *row = iterator->p - iterator->pstart; + *col = iterator->k; + } + else + { + *row = iterator->k; + *col = iterator->p - iterator->pstart; + } + } + break; + + } + +} + +extern GrB_Index GxB_Vector_Iterator_getpmax_(GxB_Iterator iterator) +{ + return iterator->pmax; +} + +extern GrB_Info GxB_Vector_Iterator_seek_(GxB_Iterator iterator, GrB_Index p) +{ + if (p >= iterator->pmax) + { + iterator->p = iterator->pmax; + return GxB_EXHAUSTED; + } + else + { + iterator->p = p; + if (iterator->A_sparsity == 4) + { + for (; iterator->p < iterator->pmax; iterator->p++) + { + if (iterator->Ab[iterator->p]) + { + return GrB_SUCCESS; + } + } + + return GxB_EXHAUSTED; + } + } + return GrB_SUCCESS; +} + +extern GrB_Info GxB_Vector_Iterator_next_(GxB_Iterator iterator) +{ + if ((++iterator->p) >= iterator->pmax) + { + iterator->p = iterator->pmax; + return GxB_EXHAUSTED; + } + return GrB_SUCCESS; +} + +extern GrB_Index GxB_Vector_Iterator_getp_(GxB_Iterator iterator) +{ + return iterator->p; +} + +extern GrB_Index GxB_Vector_Iterator_getIndex_(GxB_Iterator iterator) +{ + return (iterator->Ai != 0) ? (iterator->Ai[iterator->p]) : (iterator->p); +} + +extern bool GxB_Iterator_get_BOOL_(GxB_Iterator iterator) +{ + return ((bool *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +extern int8_t GxB_Iterator_get_INT8_(GxB_Iterator iterator) +{ + return ((int8_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +extern int16_t GxB_Iterator_get_INT16_(GxB_Iterator iterator) +{ + return ((int16_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +extern int32_t GxB_Iterator_get_INT32_(GxB_Iterator iterator) +{ + return ((int32_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +extern int64_t GxB_Iterator_get_INT64_(GxB_Iterator iterator) +{ + return ((uint64_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +extern uint8_t GxB_Iterator_get_UINT8_(GxB_Iterator iterator) +{ + return ((uint8_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +extern uint16_t GxB_Iterator_get_UINT16_(GxB_Iterator iterator) +{ + return ((uint16_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +extern uint32_t GxB_Iterator_get_UINT32_(GxB_Iterator iterator) +{ + return ((uint32_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +extern uint64_t GxB_Iterator_get_UINT64_(GxB_Iterator iterator) +{ + return ((uint64_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +extern float GxB_Iterator_get_FP32_(GxB_Iterator iterator) +{ + return ((float *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +extern double GxB_Iterator_get_FP64_(GxB_Iterator iterator) +{ + return ((double *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +extern void GxB_Iterator_get_UDT_(GxB_Iterator iterator, void *value) +{ + memcpy(value, iterator->Ax + ((iterator->iso) ? (0) : (iterator->type_size * iterator->p)), iterator->type_size); +} diff --git a/suitesparse_graphblas/suitesparse_graphblas.h b/suitesparse_graphblas/suitesparse_graphblas.h index ad0932f..9b51e28 100644 --- a/suitesparse_graphblas/suitesparse_graphblas.h +++ b/suitesparse_graphblas/suitesparse_graphblas.h @@ -15,6 +15,7 @@ typedef uint64_t GrB_Index; /* GxB typedefs */ typedef double _Complex GxB_FC64_t; typedef float _Complex GxB_FC32_t; +typedef struct GB_Iterator_opaque *GxB_Iterator; typedef struct GB_Scalar_opaque *GxB_Scalar; typedef struct GB_SelectOp_opaque *GxB_SelectOp; @@ -68,6 +69,7 @@ typedef enum { GrB_SUCCESS = 0, GrB_NO_VALUE = 1, + GxB_EXHAUSTED = 2, GrB_UNINITIALIZED_OBJECT = -1, GrB_NULL_POINTER = -2, GrB_INVALID_VALUE = -3, @@ -3059,6 +3061,12 @@ extern GrB_Info GrB_Vector_wait(GrB_Vector v, GrB_WaitMode waitmode); /* binary */ extern GrB_Info GB_BinaryOp_new(GrB_BinaryOp *binaryop, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *binop_name); +/* iterator */ +extern GrB_Info GB_Iterator_rc_seek(GxB_Iterator iterator, GrB_Index j, bool jth_vector); + +/* matrix */ +extern GrB_Info GB_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GxB_Format_Value format, GrB_Descriptor desc); + /* selectop */ extern GrB_Info GB_SelectOp_new(GxB_SelectOp *selectop, GxB_select_function function, GrB_Type xtype, GrB_Type ttype, const char *name); @@ -3101,8 +3109,14 @@ extern GrB_Info GxB_IndexUnaryOp_xtype_name(char *type_name, const GrB_IndexUnar extern GrB_Info GxB_IndexUnaryOp_ytype_name(char *type_name, const GrB_IndexUnaryOp op); extern GrB_Info GxB_IndexUnaryOp_ztype_name(char *type_name, const GrB_IndexUnaryOp op); +/* iterator */ +extern GrB_Info GxB_Iterator_free(GxB_Iterator *iterator); +extern GrB_Info GxB_Iterator_new(GxB_Iterator *iterator); + /* matrix */ extern GrB_Info GxB_Col_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_Iterator_next(GxB_Iterator iterator); +extern GrB_Info GxB_Matrix_Iterator_seek(GxB_Iterator iterator, GrB_Index p); extern GrB_Info GxB_Matrix_Option_get(GrB_Matrix A, GxB_Option_Field field, ...); extern GrB_Info GxB_Matrix_Option_set(GrB_Matrix A, GxB_Option_Field field, ...); extern GrB_Info GxB_Matrix_apply_BinaryOp1st(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Matrix A, const GrB_Descriptor desc); @@ -3289,6 +3303,7 @@ extern GrB_Info GxB_UnaryOp_ztype(GrB_Type *ztype, GrB_UnaryOp unaryop); extern GrB_Info GxB_UnaryOp_ztype_name(char *type_name, const GrB_UnaryOp unaryop); /* vector */ +extern GrB_Info GxB_Vector_Iterator_attach(GxB_Iterator iterator, GrB_Vector v, GrB_Descriptor desc); extern GrB_Info GxB_Vector_Option_get(GrB_Vector A, GxB_Option_Field field, ...); extern GrB_Info GxB_Vector_Option_set(GrB_Vector A, GxB_Option_Field field, ...); extern GrB_Info GxB_Vector_apply_BinaryOp1st(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Vector u, const GrB_Descriptor desc); @@ -3353,6 +3368,54 @@ extern GrB_Info GxB_Vector_unpack_Bitmap(GrB_Vector v, int8_t **vb, void **vx, G extern GrB_Info GxB_Vector_unpack_CSC(GrB_Vector v, GrB_Index **vi, void **vx, GrB_Index *vi_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, bool *jumbled, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_unpack_Full(GrB_Vector v, void **vx, GrB_Index *vx_size, bool *iso, const GrB_Descriptor desc); +/************************** +* static inline functions * +**************************/ +extern GrB_Index GB_Iterator_rc_geti_(GxB_Iterator iterator); +extern GrB_Index GB_Iterator_rc_getj_(GxB_Iterator iterator); +extern GrB_Index GxB_Matrix_Iterator_getp_(GxB_Iterator iterator); +extern GrB_Index GxB_Matrix_Iterator_getpmax_(GxB_Iterator iterator); +extern GrB_Index GxB_Vector_Iterator_getIndex_(GxB_Iterator iterator); +extern GrB_Index GxB_Vector_Iterator_getp_(GxB_Iterator iterator); +extern GrB_Index GxB_Vector_Iterator_getpmax_(GxB_Iterator iterator); +extern GrB_Index GxB_colIterator_getColIndex_(GxB_Iterator iterator); +extern GrB_Index GxB_colIterator_getRowIndex_(GxB_Iterator iterator); +extern GrB_Index GxB_colIterator_kount_(GxB_Iterator iterator); +extern GrB_Index GxB_rowIterator_getColIndex_(GxB_Iterator iterator); +extern GrB_Index GxB_rowIterator_getRowIndex_(GxB_Iterator iterator); +extern GrB_Index GxB_rowIterator_kount_(GxB_Iterator iterator); +extern GrB_Info GB_Iterator_rc_bitmap_next_(GxB_Iterator iterator); +extern GrB_Info GB_Iterator_rc_inext_(GxB_Iterator iterator); +extern GrB_Info GB_Iterator_rc_knext_(GxB_Iterator iterator); +extern GrB_Info GxB_Matrix_Iterator_attach_(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); +extern GrB_Info GxB_Vector_Iterator_next_(GxB_Iterator iterator); +extern GrB_Info GxB_Vector_Iterator_seek_(GxB_Iterator iterator, GrB_Index p); +extern GrB_Info GxB_colIterator_attach_(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); +extern GrB_Info GxB_colIterator_kseek_(GxB_Iterator iterator, GrB_Index k); +extern GrB_Info GxB_colIterator_nextCol_(GxB_Iterator iterator); +extern GrB_Info GxB_colIterator_nextRow_(GxB_Iterator iterator); +extern GrB_Info GxB_colIterator_seekCol_(GxB_Iterator iterator, GrB_Index col); +extern GrB_Info GxB_rowIterator_attach_(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); +extern GrB_Info GxB_rowIterator_kseek_(GxB_Iterator iterator, GrB_Index k); +extern GrB_Info GxB_rowIterator_nextCol_(GxB_Iterator iterator); +extern GrB_Info GxB_rowIterator_nextRow_(GxB_Iterator iterator); +extern GrB_Info GxB_rowIterator_seekRow_(GxB_Iterator iterator, GrB_Index row); +extern GxB_FC32_t GxB_Iterator_get_FC32_(GxB_Iterator iterator); +extern GxB_FC64_t GxB_Iterator_get_FC64_(GxB_Iterator iterator); +extern bool GxB_Iterator_get_BOOL_(GxB_Iterator iterator); +extern double GxB_Iterator_get_FP64_(GxB_Iterator iterator); +extern float GxB_Iterator_get_FP32_(GxB_Iterator iterator); +extern int8_t GxB_Iterator_get_INT8_(GxB_Iterator iterator); +extern int16_t GxB_Iterator_get_INT16_(GxB_Iterator iterator); +extern int32_t GxB_Iterator_get_INT32_(GxB_Iterator iterator); +extern int64_t GxB_Iterator_get_INT64_(GxB_Iterator iterator); +extern uint8_t GxB_Iterator_get_UINT8_(GxB_Iterator iterator); +extern uint16_t GxB_Iterator_get_UINT16_(GxB_Iterator iterator); +extern uint32_t GxB_Iterator_get_UINT32_(GxB_Iterator iterator); +extern uint64_t GxB_Iterator_get_UINT64_(GxB_Iterator iterator); +extern void GxB_Iterator_get_UDT_(GxB_Iterator iterator, void *value); +extern void GxB_Matrix_Iterator_getIndex_(GxB_Iterator iterator, GrB_Index *row, GrB_Index *col); + /* int DEFINES */ #define GRB_SUBVERSION ... #define GRB_VERSION ... diff --git a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h index af9af22..e192937 100644 --- a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h +++ b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h @@ -13,6 +13,7 @@ typedef struct GB_Vector_opaque *GrB_Vector; typedef uint64_t GrB_Index; /* GxB typedefs */ +typedef struct GB_Iterator_opaque *GxB_Iterator; typedef struct GB_Scalar_opaque *GxB_Scalar; typedef struct GB_SelectOp_opaque *GxB_SelectOp; @@ -66,6 +67,7 @@ typedef enum { GrB_SUCCESS = 0, GrB_NO_VALUE = 1, + GxB_EXHAUSTED = 2, GrB_UNINITIALIZED_OBJECT = -1, GrB_NULL_POINTER = -2, GrB_INVALID_VALUE = -3, @@ -2885,6 +2887,12 @@ extern GrB_Info GrB_Vector_wait(GrB_Vector v, GrB_WaitMode waitmode); /* binary */ extern GrB_Info GB_BinaryOp_new(GrB_BinaryOp *binaryop, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *binop_name); +/* iterator */ +extern GrB_Info GB_Iterator_rc_seek(GxB_Iterator iterator, GrB_Index j, bool jth_vector); + +/* matrix */ +extern GrB_Info GB_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GxB_Format_Value format, GrB_Descriptor desc); + /* selectop */ extern GrB_Info GB_SelectOp_new(GxB_SelectOp *selectop, GxB_select_function function, GrB_Type xtype, GrB_Type ttype, const char *name); @@ -2927,8 +2935,14 @@ extern GrB_Info GxB_IndexUnaryOp_xtype_name(char *type_name, const GrB_IndexUnar extern GrB_Info GxB_IndexUnaryOp_ytype_name(char *type_name, const GrB_IndexUnaryOp op); extern GrB_Info GxB_IndexUnaryOp_ztype_name(char *type_name, const GrB_IndexUnaryOp op); +/* iterator */ +extern GrB_Info GxB_Iterator_free(GxB_Iterator *iterator); +extern GrB_Info GxB_Iterator_new(GxB_Iterator *iterator); + /* matrix */ extern GrB_Info GxB_Col_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_Iterator_next(GxB_Iterator iterator); +extern GrB_Info GxB_Matrix_Iterator_seek(GxB_Iterator iterator, GrB_Index p); extern GrB_Info GxB_Matrix_Option_get(GrB_Matrix A, GxB_Option_Field field, ...); extern GrB_Info GxB_Matrix_Option_set(GrB_Matrix A, GxB_Option_Field field, ...); extern GrB_Info GxB_Matrix_apply_BinaryOp1st(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Matrix A, const GrB_Descriptor desc); @@ -3081,6 +3095,7 @@ extern GrB_Info GxB_UnaryOp_ztype(GrB_Type *ztype, GrB_UnaryOp unaryop); extern GrB_Info GxB_UnaryOp_ztype_name(char *type_name, const GrB_UnaryOp unaryop); /* vector */ +extern GrB_Info GxB_Vector_Iterator_attach(GxB_Iterator iterator, GrB_Vector v, GrB_Descriptor desc); extern GrB_Info GxB_Vector_Option_get(GrB_Vector A, GxB_Option_Field field, ...); extern GrB_Info GxB_Vector_Option_set(GrB_Vector A, GxB_Option_Field field, ...); extern GrB_Info GxB_Vector_apply_BinaryOp1st(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Vector u, const GrB_Descriptor desc); @@ -3123,6 +3138,52 @@ extern GrB_Info GxB_Vector_unpack_Bitmap(GrB_Vector v, int8_t **vb, void **vx, G extern GrB_Info GxB_Vector_unpack_CSC(GrB_Vector v, GrB_Index **vi, void **vx, GrB_Index *vi_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, bool *jumbled, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_unpack_Full(GrB_Vector v, void **vx, GrB_Index *vx_size, bool *iso, const GrB_Descriptor desc); +/************************** +* static inline functions * +**************************/ +extern GrB_Index GB_Iterator_rc_geti_(GxB_Iterator iterator); +extern GrB_Index GB_Iterator_rc_getj_(GxB_Iterator iterator); +extern GrB_Index GxB_Matrix_Iterator_getp_(GxB_Iterator iterator); +extern GrB_Index GxB_Matrix_Iterator_getpmax_(GxB_Iterator iterator); +extern GrB_Index GxB_Vector_Iterator_getIndex_(GxB_Iterator iterator); +extern GrB_Index GxB_Vector_Iterator_getp_(GxB_Iterator iterator); +extern GrB_Index GxB_Vector_Iterator_getpmax_(GxB_Iterator iterator); +extern GrB_Index GxB_colIterator_getColIndex_(GxB_Iterator iterator); +extern GrB_Index GxB_colIterator_getRowIndex_(GxB_Iterator iterator); +extern GrB_Index GxB_colIterator_kount_(GxB_Iterator iterator); +extern GrB_Index GxB_rowIterator_getColIndex_(GxB_Iterator iterator); +extern GrB_Index GxB_rowIterator_getRowIndex_(GxB_Iterator iterator); +extern GrB_Index GxB_rowIterator_kount_(GxB_Iterator iterator); +extern GrB_Info GB_Iterator_rc_bitmap_next_(GxB_Iterator iterator); +extern GrB_Info GB_Iterator_rc_inext_(GxB_Iterator iterator); +extern GrB_Info GB_Iterator_rc_knext_(GxB_Iterator iterator); +extern GrB_Info GxB_Matrix_Iterator_attach_(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); +extern GrB_Info GxB_Vector_Iterator_next_(GxB_Iterator iterator); +extern GrB_Info GxB_Vector_Iterator_seek_(GxB_Iterator iterator, GrB_Index p); +extern GrB_Info GxB_colIterator_attach_(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); +extern GrB_Info GxB_colIterator_kseek_(GxB_Iterator iterator, GrB_Index k); +extern GrB_Info GxB_colIterator_nextCol_(GxB_Iterator iterator); +extern GrB_Info GxB_colIterator_nextRow_(GxB_Iterator iterator); +extern GrB_Info GxB_colIterator_seekCol_(GxB_Iterator iterator, GrB_Index col); +extern GrB_Info GxB_rowIterator_attach_(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); +extern GrB_Info GxB_rowIterator_kseek_(GxB_Iterator iterator, GrB_Index k); +extern GrB_Info GxB_rowIterator_nextCol_(GxB_Iterator iterator); +extern GrB_Info GxB_rowIterator_nextRow_(GxB_Iterator iterator); +extern GrB_Info GxB_rowIterator_seekRow_(GxB_Iterator iterator, GrB_Index row); +extern bool GxB_Iterator_get_BOOL_(GxB_Iterator iterator); +extern double GxB_Iterator_get_FP64_(GxB_Iterator iterator); +extern float GxB_Iterator_get_FP32_(GxB_Iterator iterator); +extern int8_t GxB_Iterator_get_INT8_(GxB_Iterator iterator); +extern int16_t GxB_Iterator_get_INT16_(GxB_Iterator iterator); +extern int32_t GxB_Iterator_get_INT32_(GxB_Iterator iterator); +extern int64_t GxB_Iterator_get_INT64_(GxB_Iterator iterator); +extern uint8_t GxB_Iterator_get_UINT8_(GxB_Iterator iterator); +extern uint16_t GxB_Iterator_get_UINT16_(GxB_Iterator iterator); +extern uint32_t GxB_Iterator_get_UINT32_(GxB_Iterator iterator); +extern uint64_t GxB_Iterator_get_UINT64_(GxB_Iterator iterator); +extern void GxB_Iterator_get_UDT_(GxB_Iterator iterator, void *value); +extern void GxB_Matrix_Iterator_getIndex_(GxB_Iterator iterator, GrB_Index *row, GrB_Index *col); + /* int DEFINES */ #define GRB_SUBVERSION ... #define GRB_VERSION ... From 5e5ecedd1246f7fda118fa980995170d099b66ae Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Tue, 1 Feb 2022 17:38:07 -0600 Subject: [PATCH 071/193] Sure, let's sort these too --- suitesparse_graphblas/create_headers.py | 2 +- suitesparse_graphblas/source.c | 356 +++++++++++----------- suitesparse_graphblas/source_no_complex.c | 340 ++++++++++----------- 3 files changed, 349 insertions(+), 349 deletions(-) diff --git a/suitesparse_graphblas/create_headers.py b/suitesparse_graphblas/create_headers.py index cc0a273..54046da 100644 --- a/suitesparse_graphblas/create_headers.py +++ b/suitesparse_graphblas/create_headers.py @@ -710,7 +710,7 @@ def handle_static_inline(node): rv["GrB methods"] = sorted(grb_funcs, key=lambda x: sort_key(x["text"])) rv["GxB methods"] = sorted(gxb_funcs, key=lambda x: sort_key(x["text"])) rv["GB methods"] = sorted(gb_funcs, key=lambda x: sort_key(x["text"])) - rv["static inline"] = si_funcs # Should we sort these? + rv["static inline"] = sorted(si_funcs, key=lambda x: sort_key(x["text"])) for key in groups.keys() - rv.keys(): rv[key] = groups[key] return rv diff --git a/suitesparse_graphblas/source.c b/suitesparse_graphblas/source.c index 34ed92f..bda05a0 100644 --- a/suitesparse_graphblas/source.c +++ b/suitesparse_graphblas/source.c @@ -7,6 +7,83 @@ char *GxB_IMPLEMENTATION_NAME_STR = GxB_IMPLEMENTATION_NAME; char *GxB_SPEC_ABOUT_STR = GxB_SPEC_ABOUT; char *GxB_SPEC_DATE_STR = GxB_SPEC_DATE; +extern GrB_Index GB_Iterator_rc_geti_(GxB_Iterator iterator) +{ + return (iterator->Ai != 0) ? (iterator->Ai[iterator->p]) : (iterator->p - iterator->pstart); +} + +extern GrB_Index GB_Iterator_rc_getj_(GxB_Iterator iterator) +{ + if (iterator->k >= iterator->anvec) + { + return iterator->avdim; + } + else + if (iterator->A_sparsity == 1) + { + return iterator->Ah[iterator->k]; + } + else + { + return iterator->k; + } +} + +extern GrB_Index GxB_Matrix_Iterator_getp_(GxB_Iterator iterator) +{ + return iterator->p; +} + +extern GrB_Index GxB_Matrix_Iterator_getpmax_(GxB_Iterator iterator) +{ + return iterator->pmax; +} + +extern GrB_Index GxB_Vector_Iterator_getIndex_(GxB_Iterator iterator) +{ + return (iterator->Ai != 0) ? (iterator->Ai[iterator->p]) : (iterator->p); +} + +extern GrB_Index GxB_Vector_Iterator_getp_(GxB_Iterator iterator) +{ + return iterator->p; +} + +extern GrB_Index GxB_Vector_Iterator_getpmax_(GxB_Iterator iterator) +{ + return iterator->pmax; +} + +extern GrB_Index GxB_colIterator_getColIndex_(GxB_Iterator iterator) +{ + return GB_Iterator_rc_getj(iterator); +} + +extern GrB_Index GxB_colIterator_getRowIndex_(GxB_Iterator iterator) +{ + return GB_Iterator_rc_geti(iterator); +} + +extern GrB_Index GxB_colIterator_kount_(GxB_Iterator iterator) +{ + return iterator->anvec; +} + +extern GrB_Index GxB_rowIterator_getColIndex_(GxB_Iterator iterator) +{ + return GB_Iterator_rc_geti(iterator); +} + +extern GrB_Index GxB_rowIterator_getRowIndex_(GxB_Iterator iterator) +{ + return GB_Iterator_rc_getj(iterator); +} + +extern GrB_Index GxB_rowIterator_kount_(GxB_Iterator iterator) +{ + return iterator->anvec; +} + extern GrB_Info GB_Iterator_rc_bitmap_next_(GxB_Iterator iterator) { for (; iterator->p < iterator->pend; iterator->p++) @@ -20,6 +97,23 @@ extern GrB_Info GB_Iterator_rc_bitmap_next_(GxB_Iterator iterator) return GrB_NO_VALUE; } +extern GrB_Info GB_Iterator_rc_inext_(GxB_Iterator iterator) +{ + if ((++iterator->p) >= iterator->pend) + { + return GrB_NO_VALUE; + } + else + if (iterator->A_sparsity == 4) + { + return GB_Iterator_rc_bitmap_next(iterator); + } + else + { + return GrB_SUCCESS; + } +} + extern GrB_Info GB_Iterator_rc_knext_(GxB_Iterator iterator) { if ((++iterator->k) >= iterator->anvec) @@ -66,58 +160,75 @@ extern GrB_Info GB_Iterator_rc_knext_(GxB_Iterator iterator) return (iterator->p >= iterator->pend) ? (GrB_NO_VALUE) : (GrB_SUCCESS); } -extern GrB_Info GB_Iterator_rc_inext_(GxB_Iterator iterator) +extern GrB_Info GxB_Matrix_Iterator_attach_(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc) { - if ((++iterator->p) >= iterator->pend) - { - return GrB_NO_VALUE; - } - else - if (iterator->A_sparsity == 4) - { - return GB_Iterator_rc_bitmap_next(iterator); - } - else - { - return GrB_SUCCESS; - } + return GB_Iterator_attach(iterator, A, GxB_NO_FORMAT, desc); } -extern GrB_Index GB_Iterator_rc_getj_(GxB_Iterator iterator) +extern GrB_Info GxB_Vector_Iterator_next_(GxB_Iterator iterator) { - if (iterator->k >= iterator->anvec) + if ((++iterator->p) >= iterator->pmax) { - return iterator->avdim; + iterator->p = iterator->pmax; + return GxB_EXHAUSTED; } - else - if (iterator->A_sparsity == 1) + return GrB_SUCCESS; +} + +extern GrB_Info GxB_Vector_Iterator_seek_(GxB_Iterator iterator, GrB_Index p) +{ + if (p >= iterator->pmax) { - return iterator->Ah[iterator->k]; + iterator->p = iterator->pmax; + return GxB_EXHAUSTED; } else { - return iterator->k; + iterator->p = p; + if (iterator->A_sparsity == 4) + { + for (; iterator->p < iterator->pmax; iterator->p++) + { + if (iterator->Ab[iterator->p]) + { + return GrB_SUCCESS; + } + } + + return GxB_EXHAUSTED; + } } + return GrB_SUCCESS; } -extern GrB_Index GB_Iterator_rc_geti_(GxB_Iterator iterator) +extern GrB_Info GxB_colIterator_attach_(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc) { - return (iterator->Ai != 0) ? (iterator->Ai[iterator->p]) : (iterator->p - iterator->pstart); + return GB_Iterator_attach(iterator, A, GxB_BY_COL, desc); } -extern GrB_Info GxB_rowIterator_attach_(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc) +extern GrB_Info GxB_colIterator_kseek_(GxB_Iterator iterator, GrB_Index k) { - return GB_Iterator_attach(iterator, A, GxB_BY_ROW, desc); + return GB_Iterator_rc_seek(iterator, k, 1); } -extern GrB_Index GxB_rowIterator_kount_(GxB_Iterator iterator) +extern GrB_Info GxB_colIterator_nextCol_(GxB_Iterator iterator) { - return iterator->anvec; + return GB_Iterator_rc_knext(iterator); } -extern GrB_Info GxB_rowIterator_seekRow_(GxB_Iterator iterator, GrB_Index row) +extern GrB_Info GxB_colIterator_nextRow_(GxB_Iterator iterator) { - return GB_Iterator_rc_seek(iterator, row, 0); + return GB_Iterator_rc_inext(iterator); +} + +extern GrB_Info GxB_colIterator_seekCol_(GxB_Iterator iterator, GrB_Index col) +{ + return GB_Iterator_rc_seek(iterator, col, 0); +} + +extern GrB_Info GxB_rowIterator_attach_(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc) +{ + return GB_Iterator_attach(iterator, A, GxB_BY_ROW, desc); } extern GrB_Info GxB_rowIterator_kseek_(GxB_Iterator iterator, GrB_Index k) @@ -125,79 +236,89 @@ extern GrB_Info GxB_rowIterator_kseek_(GxB_Iterator iterator, GrB_Index k) return GB_Iterator_rc_seek(iterator, k, 1); } +extern GrB_Info GxB_rowIterator_nextCol_(GxB_Iterator iterator) +{ + return GB_Iterator_rc_inext(iterator); +} + extern GrB_Info GxB_rowIterator_nextRow_(GxB_Iterator iterator) { return GB_Iterator_rc_knext(iterator); } -extern GrB_Info GxB_rowIterator_nextCol_(GxB_Iterator iterator) +extern GrB_Info GxB_rowIterator_seekRow_(GxB_Iterator iterator, GrB_Index row) { - return GB_Iterator_rc_inext(iterator); + return GB_Iterator_rc_seek(iterator, row, 0); } -extern GrB_Index GxB_rowIterator_getRowIndex_(GxB_Iterator iterator) +extern GxB_FC32_t GxB_Iterator_get_FC32_(GxB_Iterator iterator) { - return GB_Iterator_rc_getj(iterator); + return ((GxB_FC32_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; } -extern GrB_Index GxB_rowIterator_getColIndex_(GxB_Iterator iterator) +extern GxB_FC64_t GxB_Iterator_get_FC64_(GxB_Iterator iterator) { - return GB_Iterator_rc_geti(iterator); + return ((GxB_FC64_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; } -extern GrB_Info GxB_colIterator_attach_(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc) +extern bool GxB_Iterator_get_BOOL_(GxB_Iterator iterator) { - return GB_Iterator_attach(iterator, A, GxB_BY_COL, desc); + return ((bool *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; } -extern GrB_Index GxB_colIterator_kount_(GxB_Iterator iterator) +extern double GxB_Iterator_get_FP64_(GxB_Iterator iterator) { - return iterator->anvec; + return ((double *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; } -extern GrB_Info GxB_colIterator_seekCol_(GxB_Iterator iterator, GrB_Index col) +extern float GxB_Iterator_get_FP32_(GxB_Iterator iterator) { - return GB_Iterator_rc_seek(iterator, col, 0); + return ((float *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; } -extern GrB_Info GxB_colIterator_kseek_(GxB_Iterator iterator, GrB_Index k) +extern int8_t GxB_Iterator_get_INT8_(GxB_Iterator iterator) { - return GB_Iterator_rc_seek(iterator, k, 1); + return ((int8_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; } -extern GrB_Info GxB_colIterator_nextCol_(GxB_Iterator iterator) +extern int16_t GxB_Iterator_get_INT16_(GxB_Iterator iterator) { - return GB_Iterator_rc_knext(iterator); + return ((int16_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; } -extern GrB_Info GxB_colIterator_nextRow_(GxB_Iterator iterator) +extern int32_t GxB_Iterator_get_INT32_(GxB_Iterator iterator) { - return GB_Iterator_rc_inext(iterator); + return ((int32_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; } -extern GrB_Index GxB_colIterator_getColIndex_(GxB_Iterator iterator) +extern int64_t GxB_Iterator_get_INT64_(GxB_Iterator iterator) { - return GB_Iterator_rc_getj(iterator); + return ((uint64_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; } -extern GrB_Index GxB_colIterator_getRowIndex_(GxB_Iterator iterator) +extern uint8_t GxB_Iterator_get_UINT8_(GxB_Iterator iterator) { - return GB_Iterator_rc_geti(iterator); + return ((uint8_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; } -extern GrB_Info GxB_Matrix_Iterator_attach_(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc) +extern uint16_t GxB_Iterator_get_UINT16_(GxB_Iterator iterator) { - return GB_Iterator_attach(iterator, A, GxB_NO_FORMAT, desc); + return ((uint16_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; } -extern GrB_Index GxB_Matrix_Iterator_getpmax_(GxB_Iterator iterator) +extern uint32_t GxB_Iterator_get_UINT32_(GxB_Iterator iterator) { - return iterator->pmax; + return ((uint32_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; } -extern GrB_Index GxB_Matrix_Iterator_getp_(GxB_Iterator iterator) +extern uint64_t GxB_Iterator_get_UINT64_(GxB_Iterator iterator) { - return iterator->p; + return ((uint64_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +extern void GxB_Iterator_get_UDT_(GxB_Iterator iterator, void *value) +{ + memcpy(value, iterator->Ax + ((iterator->iso) ? (0) : (iterator->type_size * iterator->p)), iterator->type_size); } extern void GxB_Matrix_Iterator_getIndex_(GxB_Iterator iterator, GrB_Index *row, GrB_Index *col) @@ -256,124 +377,3 @@ extern void GxB_Matrix_Iterator_getIndex_(GxB_Iterator iterator, GrB_Index *row, } } - -extern GrB_Index GxB_Vector_Iterator_getpmax_(GxB_Iterator iterator) -{ - return iterator->pmax; -} - -extern GrB_Info GxB_Vector_Iterator_seek_(GxB_Iterator iterator, GrB_Index p) -{ - if (p >= iterator->pmax) - { - iterator->p = iterator->pmax; - return GxB_EXHAUSTED; - } - else - { - iterator->p = p; - if (iterator->A_sparsity == 4) - { - for (; iterator->p < iterator->pmax; iterator->p++) - { - if (iterator->Ab[iterator->p]) - { - return GrB_SUCCESS; - } - } - - return GxB_EXHAUSTED; - } - } - return GrB_SUCCESS; -} - -extern GrB_Info GxB_Vector_Iterator_next_(GxB_Iterator iterator) -{ - if ((++iterator->p) >= iterator->pmax) - { - iterator->p = iterator->pmax; - return GxB_EXHAUSTED; - } - return GrB_SUCCESS; -} - -extern GrB_Index GxB_Vector_Iterator_getp_(GxB_Iterator iterator) -{ - return iterator->p; -} - -extern GrB_Index GxB_Vector_Iterator_getIndex_(GxB_Iterator iterator) -{ - return (iterator->Ai != 0) ? (iterator->Ai[iterator->p]) : (iterator->p); -} - -extern bool GxB_Iterator_get_BOOL_(GxB_Iterator iterator) -{ - return ((bool *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern int8_t GxB_Iterator_get_INT8_(GxB_Iterator iterator) -{ - return ((int8_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern int16_t GxB_Iterator_get_INT16_(GxB_Iterator iterator) -{ - return ((int16_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern int32_t GxB_Iterator_get_INT32_(GxB_Iterator iterator) -{ - return ((int32_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern int64_t GxB_Iterator_get_INT64_(GxB_Iterator iterator) -{ - return ((uint64_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern uint8_t GxB_Iterator_get_UINT8_(GxB_Iterator iterator) -{ - return ((uint8_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern uint16_t GxB_Iterator_get_UINT16_(GxB_Iterator iterator) -{ - return ((uint16_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern uint32_t GxB_Iterator_get_UINT32_(GxB_Iterator iterator) -{ - return ((uint32_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern uint64_t GxB_Iterator_get_UINT64_(GxB_Iterator iterator) -{ - return ((uint64_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern float GxB_Iterator_get_FP32_(GxB_Iterator iterator) -{ - return ((float *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern double GxB_Iterator_get_FP64_(GxB_Iterator iterator) -{ - return ((double *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern GxB_FC32_t GxB_Iterator_get_FC32_(GxB_Iterator iterator) -{ - return ((GxB_FC32_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern GxB_FC64_t GxB_Iterator_get_FC64_(GxB_Iterator iterator) -{ - return ((GxB_FC64_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern void GxB_Iterator_get_UDT_(GxB_Iterator iterator, void *value) -{ - memcpy(value, iterator->Ax + ((iterator->iso) ? (0) : (iterator->type_size * iterator->p)), iterator->type_size); -} diff --git a/suitesparse_graphblas/source_no_complex.c b/suitesparse_graphblas/source_no_complex.c index 2cdf4f6..19b899c 100644 --- a/suitesparse_graphblas/source_no_complex.c +++ b/suitesparse_graphblas/source_no_complex.c @@ -7,6 +7,83 @@ char *GxB_IMPLEMENTATION_NAME_STR = GxB_IMPLEMENTATION_NAME; char *GxB_SPEC_ABOUT_STR = GxB_SPEC_ABOUT; char *GxB_SPEC_DATE_STR = GxB_SPEC_DATE; +extern GrB_Index GB_Iterator_rc_geti_(GxB_Iterator iterator) +{ + return (iterator->Ai != 0) ? (iterator->Ai[iterator->p]) : (iterator->p - iterator->pstart); +} + +extern GrB_Index GB_Iterator_rc_getj_(GxB_Iterator iterator) +{ + if (iterator->k >= iterator->anvec) + { + return iterator->avdim; + } + else + if (iterator->A_sparsity == 1) + { + return iterator->Ah[iterator->k]; + } + else + { + return iterator->k; + } +} + +extern GrB_Index GxB_Matrix_Iterator_getp_(GxB_Iterator iterator) +{ + return iterator->p; +} + +extern GrB_Index GxB_Matrix_Iterator_getpmax_(GxB_Iterator iterator) +{ + return iterator->pmax; +} + +extern GrB_Index GxB_Vector_Iterator_getIndex_(GxB_Iterator iterator) +{ + return (iterator->Ai != 0) ? (iterator->Ai[iterator->p]) : (iterator->p); +} + +extern GrB_Index GxB_Vector_Iterator_getp_(GxB_Iterator iterator) +{ + return iterator->p; +} + +extern GrB_Index GxB_Vector_Iterator_getpmax_(GxB_Iterator iterator) +{ + return iterator->pmax; +} + +extern GrB_Index GxB_colIterator_getColIndex_(GxB_Iterator iterator) +{ + return GB_Iterator_rc_getj(iterator); +} + +extern GrB_Index GxB_colIterator_getRowIndex_(GxB_Iterator iterator) +{ + return GB_Iterator_rc_geti(iterator); +} + +extern GrB_Index GxB_colIterator_kount_(GxB_Iterator iterator) +{ + return iterator->anvec; +} + +extern GrB_Index GxB_rowIterator_getColIndex_(GxB_Iterator iterator) +{ + return GB_Iterator_rc_geti(iterator); +} + +extern GrB_Index GxB_rowIterator_getRowIndex_(GxB_Iterator iterator) +{ + return GB_Iterator_rc_getj(iterator); +} + +extern GrB_Index GxB_rowIterator_kount_(GxB_Iterator iterator) +{ + return iterator->anvec; +} + extern GrB_Info GB_Iterator_rc_bitmap_next_(GxB_Iterator iterator) { for (; iterator->p < iterator->pend; iterator->p++) @@ -20,6 +97,23 @@ extern GrB_Info GB_Iterator_rc_bitmap_next_(GxB_Iterator iterator) return GrB_NO_VALUE; } +extern GrB_Info GB_Iterator_rc_inext_(GxB_Iterator iterator) +{ + if ((++iterator->p) >= iterator->pend) + { + return GrB_NO_VALUE; + } + else + if (iterator->A_sparsity == 4) + { + return GB_Iterator_rc_bitmap_next(iterator); + } + else + { + return GrB_SUCCESS; + } +} + extern GrB_Info GB_Iterator_rc_knext_(GxB_Iterator iterator) { if ((++iterator->k) >= iterator->anvec) @@ -66,68 +160,80 @@ extern GrB_Info GB_Iterator_rc_knext_(GxB_Iterator iterator) return (iterator->p >= iterator->pend) ? (GrB_NO_VALUE) : (GrB_SUCCESS); } -extern GrB_Info GB_Iterator_rc_inext_(GxB_Iterator iterator) +extern GrB_Info GxB_Matrix_Iterator_attach_(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc) { - if ((++iterator->p) >= iterator->pend) - { - return GrB_NO_VALUE; - } - else - if (iterator->A_sparsity == 4) - { - return GB_Iterator_rc_bitmap_next(iterator); - } - else - { - return GrB_SUCCESS; - } + return GB_Iterator_attach(iterator, A, GxB_NO_FORMAT, desc); } -extern GrB_Index GB_Iterator_rc_getj_(GxB_Iterator iterator) +extern GrB_Info GxB_Vector_Iterator_next_(GxB_Iterator iterator) { - if (iterator->k >= iterator->anvec) + if ((++iterator->p) >= iterator->pmax) { - return iterator->avdim; + iterator->p = iterator->pmax; + return GxB_EXHAUSTED; } - else - if (iterator->A_sparsity == 1) + return GrB_SUCCESS; +} + +extern GrB_Info GxB_Vector_Iterator_seek_(GxB_Iterator iterator, GrB_Index p) +{ + if (p >= iterator->pmax) { - return iterator->Ah[iterator->k]; + iterator->p = iterator->pmax; + return GxB_EXHAUSTED; } else { - return iterator->k; + iterator->p = p; + if (iterator->A_sparsity == 4) + { + for (; iterator->p < iterator->pmax; iterator->p++) + { + if (iterator->Ab[iterator->p]) + { + return GrB_SUCCESS; + } + } + + return GxB_EXHAUSTED; + } } + return GrB_SUCCESS; } -extern GrB_Index GB_Iterator_rc_geti_(GxB_Iterator iterator) +extern GrB_Info GxB_colIterator_attach_(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc) { - return (iterator->Ai != 0) ? (iterator->Ai[iterator->p]) : (iterator->p - iterator->pstart); + return GB_Iterator_attach(iterator, A, GxB_BY_COL, desc); } -extern GrB_Info GxB_rowIterator_attach_(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc) +extern GrB_Info GxB_colIterator_kseek_(GxB_Iterator iterator, GrB_Index k) { - return GB_Iterator_attach(iterator, A, GxB_BY_ROW, desc); + return GB_Iterator_rc_seek(iterator, k, 1); } -extern GrB_Index GxB_rowIterator_kount_(GxB_Iterator iterator) +extern GrB_Info GxB_colIterator_nextCol_(GxB_Iterator iterator) { - return iterator->anvec; + return GB_Iterator_rc_knext(iterator); } -extern GrB_Info GxB_rowIterator_seekRow_(GxB_Iterator iterator, GrB_Index row) +extern GrB_Info GxB_colIterator_nextRow_(GxB_Iterator iterator) { - return GB_Iterator_rc_seek(iterator, row, 0); + return GB_Iterator_rc_inext(iterator); } -extern GrB_Info GxB_rowIterator_kseek_(GxB_Iterator iterator, GrB_Index k) +extern GrB_Info GxB_colIterator_seekCol_(GxB_Iterator iterator, GrB_Index col) { - return GB_Iterator_rc_seek(iterator, k, 1); + return GB_Iterator_rc_seek(iterator, col, 0); } -extern GrB_Info GxB_rowIterator_nextRow_(GxB_Iterator iterator) +extern GrB_Info GxB_rowIterator_attach_(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc) { - return GB_Iterator_rc_knext(iterator); + return GB_Iterator_attach(iterator, A, GxB_BY_ROW, desc); +} + +extern GrB_Info GxB_rowIterator_kseek_(GxB_Iterator iterator, GrB_Index k) +{ + return GB_Iterator_rc_seek(iterator, k, 1); } extern GrB_Info GxB_rowIterator_nextCol_(GxB_Iterator iterator) @@ -135,69 +241,74 @@ extern GrB_Info GxB_rowIterator_nextCol_(GxB_Iterator iterator) return GB_Iterator_rc_inext(iterator); } -extern GrB_Index GxB_rowIterator_getRowIndex_(GxB_Iterator iterator) +extern GrB_Info GxB_rowIterator_nextRow_(GxB_Iterator iterator) { - return GB_Iterator_rc_getj(iterator); + return GB_Iterator_rc_knext(iterator); } -extern GrB_Index GxB_rowIterator_getColIndex_(GxB_Iterator iterator) +extern GrB_Info GxB_rowIterator_seekRow_(GxB_Iterator iterator, GrB_Index row) { - return GB_Iterator_rc_geti(iterator); + return GB_Iterator_rc_seek(iterator, row, 0); } -extern GrB_Info GxB_colIterator_attach_(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc) +extern bool GxB_Iterator_get_BOOL_(GxB_Iterator iterator) { - return GB_Iterator_attach(iterator, A, GxB_BY_COL, desc); + return ((bool *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; } -extern GrB_Index GxB_colIterator_kount_(GxB_Iterator iterator) +extern double GxB_Iterator_get_FP64_(GxB_Iterator iterator) { - return iterator->anvec; + return ((double *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; } -extern GrB_Info GxB_colIterator_seekCol_(GxB_Iterator iterator, GrB_Index col) +extern float GxB_Iterator_get_FP32_(GxB_Iterator iterator) { - return GB_Iterator_rc_seek(iterator, col, 0); + return ((float *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; } -extern GrB_Info GxB_colIterator_kseek_(GxB_Iterator iterator, GrB_Index k) +extern int8_t GxB_Iterator_get_INT8_(GxB_Iterator iterator) { - return GB_Iterator_rc_seek(iterator, k, 1); + return ((int8_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; } -extern GrB_Info GxB_colIterator_nextCol_(GxB_Iterator iterator) +extern int16_t GxB_Iterator_get_INT16_(GxB_Iterator iterator) { - return GB_Iterator_rc_knext(iterator); + return ((int16_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; } -extern GrB_Info GxB_colIterator_nextRow_(GxB_Iterator iterator) +extern int32_t GxB_Iterator_get_INT32_(GxB_Iterator iterator) { - return GB_Iterator_rc_inext(iterator); + return ((int32_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; } -extern GrB_Index GxB_colIterator_getColIndex_(GxB_Iterator iterator) +extern int64_t GxB_Iterator_get_INT64_(GxB_Iterator iterator) { - return GB_Iterator_rc_getj(iterator); + return ((uint64_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; } -extern GrB_Index GxB_colIterator_getRowIndex_(GxB_Iterator iterator) +extern uint8_t GxB_Iterator_get_UINT8_(GxB_Iterator iterator) { - return GB_Iterator_rc_geti(iterator); + return ((uint8_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; } -extern GrB_Info GxB_Matrix_Iterator_attach_(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc) +extern uint16_t GxB_Iterator_get_UINT16_(GxB_Iterator iterator) { - return GB_Iterator_attach(iterator, A, GxB_NO_FORMAT, desc); + return ((uint16_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; } -extern GrB_Index GxB_Matrix_Iterator_getpmax_(GxB_Iterator iterator) +extern uint32_t GxB_Iterator_get_UINT32_(GxB_Iterator iterator) { - return iterator->pmax; + return ((uint32_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; } -extern GrB_Index GxB_Matrix_Iterator_getp_(GxB_Iterator iterator) +extern uint64_t GxB_Iterator_get_UINT64_(GxB_Iterator iterator) { - return iterator->p; + return ((uint64_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; +} + +extern void GxB_Iterator_get_UDT_(GxB_Iterator iterator, void *value) +{ + memcpy(value, iterator->Ax + ((iterator->iso) ? (0) : (iterator->type_size * iterator->p)), iterator->type_size); } extern void GxB_Matrix_Iterator_getIndex_(GxB_Iterator iterator, GrB_Index *row, GrB_Index *col) @@ -256,114 +367,3 @@ extern void GxB_Matrix_Iterator_getIndex_(GxB_Iterator iterator, GrB_Index *row, } } - -extern GrB_Index GxB_Vector_Iterator_getpmax_(GxB_Iterator iterator) -{ - return iterator->pmax; -} - -extern GrB_Info GxB_Vector_Iterator_seek_(GxB_Iterator iterator, GrB_Index p) -{ - if (p >= iterator->pmax) - { - iterator->p = iterator->pmax; - return GxB_EXHAUSTED; - } - else - { - iterator->p = p; - if (iterator->A_sparsity == 4) - { - for (; iterator->p < iterator->pmax; iterator->p++) - { - if (iterator->Ab[iterator->p]) - { - return GrB_SUCCESS; - } - } - - return GxB_EXHAUSTED; - } - } - return GrB_SUCCESS; -} - -extern GrB_Info GxB_Vector_Iterator_next_(GxB_Iterator iterator) -{ - if ((++iterator->p) >= iterator->pmax) - { - iterator->p = iterator->pmax; - return GxB_EXHAUSTED; - } - return GrB_SUCCESS; -} - -extern GrB_Index GxB_Vector_Iterator_getp_(GxB_Iterator iterator) -{ - return iterator->p; -} - -extern GrB_Index GxB_Vector_Iterator_getIndex_(GxB_Iterator iterator) -{ - return (iterator->Ai != 0) ? (iterator->Ai[iterator->p]) : (iterator->p); -} - -extern bool GxB_Iterator_get_BOOL_(GxB_Iterator iterator) -{ - return ((bool *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern int8_t GxB_Iterator_get_INT8_(GxB_Iterator iterator) -{ - return ((int8_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern int16_t GxB_Iterator_get_INT16_(GxB_Iterator iterator) -{ - return ((int16_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern int32_t GxB_Iterator_get_INT32_(GxB_Iterator iterator) -{ - return ((int32_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern int64_t GxB_Iterator_get_INT64_(GxB_Iterator iterator) -{ - return ((uint64_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern uint8_t GxB_Iterator_get_UINT8_(GxB_Iterator iterator) -{ - return ((uint8_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern uint16_t GxB_Iterator_get_UINT16_(GxB_Iterator iterator) -{ - return ((uint16_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern uint32_t GxB_Iterator_get_UINT32_(GxB_Iterator iterator) -{ - return ((uint32_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern uint64_t GxB_Iterator_get_UINT64_(GxB_Iterator iterator) -{ - return ((uint64_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern float GxB_Iterator_get_FP32_(GxB_Iterator iterator) -{ - return ((float *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern double GxB_Iterator_get_FP64_(GxB_Iterator iterator) -{ - return ((double *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern void GxB_Iterator_get_UDT_(GxB_Iterator iterator, void *value) -{ - memcpy(value, iterator->Ax + ((iterator->iso) ? (0) : (iterator->type_size * iterator->p)), iterator->type_size); -} From 3f2928301fd7ff8d6ce20ca93ac92fcfba07b801 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Tue, 1 Feb 2022 17:41:51 -0600 Subject: [PATCH 072/193] oops windows --- suitesparse_graphblas/build.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/suitesparse_graphblas/build.py b/suitesparse_graphblas/build.py index 9a2df43..27563c4 100644 --- a/suitesparse_graphblas/build.py +++ b/suitesparse_graphblas/build.py @@ -8,7 +8,12 @@ ffibuilder = FFI() -with open(os.path.join(thisdir, "source.c")) as f: +if is_win: + source_filename = "source_no_complex.c" +else: + source_filename = "source.c" + +with open(os.path.join(thisdir, source_filename)) as f: source = f.read() include_dirs = [os.path.join(sys.prefix, "include")] From 3eac1c6ccabb075c0dd7ad41c63a1fa340db9e48 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Thu, 3 Feb 2022 10:49:06 -0600 Subject: [PATCH 073/193] Update to 6.2.0.beta3 --- .github/workflows/test.yml | 2 +- suitesparse_graphblas/build.py | 7 +- suitesparse_graphblas/create_headers.py | 101 +---- suitesparse_graphblas/source.c | 373 +----------------- suitesparse_graphblas/source_no_complex.c | 369 ----------------- suitesparse_graphblas/suitesparse_graphblas.h | 93 ++--- .../suitesparse_graphblas_no_complex.h | 89 ++--- 7 files changed, 104 insertions(+), 930 deletions(-) delete mode 100644 suitesparse_graphblas/source_no_complex.c diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 405de52..d3c23f7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,7 +18,7 @@ jobs: os: ["ubuntu-latest"] python-version: ["3.8", "3.9", "3.10"] source: ["source"] # ["conda-forge"] - graphblas-version: ["6.2.0.beta2"] + graphblas-version: ["6.2.0.beta3"] steps: - name: Checkout uses: actions/checkout@v2 diff --git a/suitesparse_graphblas/build.py b/suitesparse_graphblas/build.py index 27563c4..9a2df43 100644 --- a/suitesparse_graphblas/build.py +++ b/suitesparse_graphblas/build.py @@ -8,12 +8,7 @@ ffibuilder = FFI() -if is_win: - source_filename = "source_no_complex.c" -else: - source_filename = "source.c" - -with open(os.path.join(thisdir, source_filename)) as f: +with open(os.path.join(thisdir, "source.c")) as f: source = f.read() include_dirs = [os.path.join(sys.prefix, "include")] diff --git a/suitesparse_graphblas/create_headers.py b/suitesparse_graphblas/create_headers.py index 54046da..a2e4085 100644 --- a/suitesparse_graphblas/create_headers.py +++ b/suitesparse_graphblas/create_headers.py @@ -360,6 +360,7 @@ def get_groups(ast): seen = set() groups = {} vals = {x for x in lines if "extern GrB_Info GxB" in x} - seen + vals |= {x for x in lines if "extern " in x and "GxB_Iterator" in x and "GB" not in x} - seen seen.update(vals) groups["GxB methods"] = sorted(vals, key=sort_key) @@ -368,6 +369,7 @@ def get_groups(ast): groups["GrB methods"] = sorted(vals, key=sort_key) vals = {x for x in lines if "extern GrB_Info GB" in x} - seen + vals |= {x for x in lines if "extern " in x and "GxB_Iterator" in x and "GB" in x} - seen seen.update(vals) groups["GB methods"] = sorted(vals, key=sort_key) @@ -427,23 +429,6 @@ def get_groups(ast): seen.update(vals) groups["GxB typedef funcs"] = sorted(vals, key=sort_key) - vals = [] - next_i = -1 - for i, line in enumerate(lines): - if i < next_i or line in seen: - continue - if "inline static" in line and ("GB" in line or "GrB" in line or "GxB" in line): - val = [line] - i += 1 - while lines[i] != "}": - val.append(lines[i]) - i += 1 - val.append(lines[i]) - next_i = i + 1 - seen.update(val) - vals.append("\n".join(val)) - groups["static inline"] = vals - vals = {x for x in lines if "typedef" in x and "GrB" in x} - seen assert not vals, ", ".join(sorted(vals)) groups["not seen"] = sorted(set(lines) - seen, key=sort_key) @@ -597,21 +582,10 @@ def visit_Decl(self, node): if isinstance(node.type, c_ast.FuncDecl) and node.storage == ["extern"]: self.functions.append(node) - class FuncDefVisitorStaticInline(c_ast.NodeVisitor): - def __init__(self): - self.functions = [] - - def visit_FuncDef(self, node): - decl = node.decl - if ( - isinstance(decl.type, c_ast.FuncDecl) - and decl.storage == ["static"] - and decl.funcspec == ["inline"] - ): - self.functions.append(node) - def handle_function_node(node): - if generator.visit(node.type.type) != "GrB_Info": + if generator.visit(node.type.type) != "GrB_Info" and "GxB_Iterator" not in generator.visit( + node + ): raise ValueError(generator.visit(node)) if node.name in DEPRECATED: return @@ -625,6 +599,8 @@ def handle_function_node(node): group = "vector" elif "GxB_Scalar" in text or "GrB_Scalar" in text: group = "scalar" + elif "GxB_Iterator" in text: + group = "iterator" else: group = node.name.split("_", 2)[1] group = { @@ -665,52 +641,26 @@ def handle_function_node(node): grb_nodes = [node for node in visitor.functions if node.name.startswith("GrB_")] gxb_nodes = [node for node in visitor.functions if node.name.startswith("GxB_")] gb_nodes = [node for node in visitor.functions if node.name.startswith("GB_")] - assert len(grb_nodes) == len(groups["GrB methods"]) - assert len(gxb_nodes) == len(groups["GxB methods"]) - assert len(gb_nodes) == len(groups["GB methods"]) - - visitor = FuncDefVisitorStaticInline() - visitor.visit(ast) - static_inline_nodes = visitor.functions - assert len(static_inline_nodes) == len(groups["static inline"]) - for node in static_inline_nodes: - # Sanity check - text = generator.visit(node).strip() - assert text in groups["static inline"] - - def handle_static_inline(node): - decl = node.decl - if decl.name in DEPRECATED: - return - # Append "_" to the name that we expose to Python - decl.type.type.declname += "_" - decl.storage = ["extern"] - decl.funcspec = [] - text = generator.visit(node).strip() - decl_text = generator.visit(decl).strip() - if skip_complex and has_complex(text): - return - return { - "name": decl.name, - "group": "static inline", - "node": node, - "text": text + "\n", - "decl_text": decl_text + ";", - } + assert len(grb_nodes) == len(groups["GrB methods"]), ( + len(grb_nodes), + len(groups["GrB methods"]), + ) + assert len(gxb_nodes) == len(groups["GxB methods"]), ( + len(gxb_nodes), + len(groups["GxB methods"]), + ) + assert len(gb_nodes) == len(groups["GB methods"]), (len(gb_nodes), len(groups["GB methods"])) grb_funcs = (handle_function_node(node) for node in grb_nodes) gxb_funcs = (handle_function_node(node) for node in gxb_nodes) gb_funcs = (handle_function_node(node) for node in gb_nodes) - si_funcs = (handle_static_inline(node) for node in static_inline_nodes) grb_funcs = [x for x in grb_funcs if x is not None] gxb_funcs = [x for x in gxb_funcs if x is not None] gb_funcs = [x for x in gb_funcs if x is not None] - si_funcs = [x for x in si_funcs if x is not None] rv["GrB methods"] = sorted(grb_funcs, key=lambda x: sort_key(x["text"])) rv["GxB methods"] = sorted(gxb_funcs, key=lambda x: sort_key(x["text"])) rv["GB methods"] = sorted(gb_funcs, key=lambda x: sort_key(x["text"])) - rv["static inline"] = sorted(si_funcs, key=lambda x: sort_key(x["text"])) for key in groups.keys() - rv.keys(): rv[key] = groups[key] return rv @@ -797,13 +747,6 @@ def handle_funcs(group): text.append("****************/") text.extend(handle_funcs(groups["GxB methods"])) - # Declare wrapper functions with '_' appended to the name - text.append("") - text.append("/**************************") - text.append("* static inline functions *") - text.append("**************************/") - text.extend(sorted((info["decl_text"] for info in groups["static inline"]), key=sort_key)) - text.append("") text.append("/* int DEFINES */") for item in sorted(defines, key=sort_key): @@ -825,9 +768,6 @@ def create_source_text(groups, *, char_defines=None): ] for item in sorted(char_defines, key=sort_key): text.append(f"char *{item}_STR = {item};") - text.append("") - for node in groups["static inline"]: - text.append(node["text"]) return text @@ -855,7 +795,6 @@ def main(): final_h = os.path.join(thisdir, "suitesparse_graphblas.h") final_no_complex_h = os.path.join(thisdir, "suitesparse_graphblas_no_complex.h") source_c = os.path.join(thisdir, "source.c") - source_no_complex_c = os.path.join(thisdir, "source_no_complex.c") # Copy original file print(f"Step 1: copy {args.graphblas} to {graphblas_h}") @@ -894,14 +833,8 @@ def main(): with open(source_c, "w") as f: f.write("\n".join(text)) - # Create source (no complex) - print(f"Step 6: create {source_no_complex_c}") - text = create_source_text(groups_no_complex) - with open(source_no_complex_c, "w") as f: - f.write("\n".join(text)) - # Check defines - print("Step 7: check #define definitions") + print("Step 6: check #define definitions") with open(graphblas_h) as f: text = f.read() define_lines = re.compile(r".*?#define\s+\w+\s+") diff --git a/suitesparse_graphblas/source.c b/suitesparse_graphblas/source.c index bda05a0..fa5fae3 100644 --- a/suitesparse_graphblas/source.c +++ b/suitesparse_graphblas/source.c @@ -5,375 +5,4 @@ char *GxB_IMPLEMENTATION_DATE_STR = GxB_IMPLEMENTATION_DATE; char *GxB_IMPLEMENTATION_LICENSE_STR = GxB_IMPLEMENTATION_LICENSE; char *GxB_IMPLEMENTATION_NAME_STR = GxB_IMPLEMENTATION_NAME; char *GxB_SPEC_ABOUT_STR = GxB_SPEC_ABOUT; -char *GxB_SPEC_DATE_STR = GxB_SPEC_DATE; - -extern GrB_Index GB_Iterator_rc_geti_(GxB_Iterator iterator) -{ - return (iterator->Ai != 0) ? (iterator->Ai[iterator->p]) : (iterator->p - iterator->pstart); -} - -extern GrB_Index GB_Iterator_rc_getj_(GxB_Iterator iterator) -{ - if (iterator->k >= iterator->anvec) - { - return iterator->avdim; - } - else - if (iterator->A_sparsity == 1) - { - return iterator->Ah[iterator->k]; - } - else - { - return iterator->k; - } -} - -extern GrB_Index GxB_Matrix_Iterator_getp_(GxB_Iterator iterator) -{ - return iterator->p; -} - -extern GrB_Index GxB_Matrix_Iterator_getpmax_(GxB_Iterator iterator) -{ - return iterator->pmax; -} - -extern GrB_Index GxB_Vector_Iterator_getIndex_(GxB_Iterator iterator) -{ - return (iterator->Ai != 0) ? (iterator->Ai[iterator->p]) : (iterator->p); -} - -extern GrB_Index GxB_Vector_Iterator_getp_(GxB_Iterator iterator) -{ - return iterator->p; -} - -extern GrB_Index GxB_Vector_Iterator_getpmax_(GxB_Iterator iterator) -{ - return iterator->pmax; -} - -extern GrB_Index GxB_colIterator_getColIndex_(GxB_Iterator iterator) -{ - return GB_Iterator_rc_getj(iterator); -} - -extern GrB_Index GxB_colIterator_getRowIndex_(GxB_Iterator iterator) -{ - return GB_Iterator_rc_geti(iterator); -} - -extern GrB_Index GxB_colIterator_kount_(GxB_Iterator iterator) -{ - return iterator->anvec; -} - -extern GrB_Index GxB_rowIterator_getColIndex_(GxB_Iterator iterator) -{ - return GB_Iterator_rc_geti(iterator); -} - -extern GrB_Index GxB_rowIterator_getRowIndex_(GxB_Iterator iterator) -{ - return GB_Iterator_rc_getj(iterator); -} - -extern GrB_Index GxB_rowIterator_kount_(GxB_Iterator iterator) -{ - return iterator->anvec; -} - -extern GrB_Info GB_Iterator_rc_bitmap_next_(GxB_Iterator iterator) -{ - for (; iterator->p < iterator->pend; iterator->p++) - { - if (iterator->Ab[iterator->p]) - { - return GrB_SUCCESS; - } - } - - return GrB_NO_VALUE; -} - -extern GrB_Info GB_Iterator_rc_inext_(GxB_Iterator iterator) -{ - if ((++iterator->p) >= iterator->pend) - { - return GrB_NO_VALUE; - } - else - if (iterator->A_sparsity == 4) - { - return GB_Iterator_rc_bitmap_next(iterator); - } - else - { - return GrB_SUCCESS; - } -} - -extern GrB_Info GB_Iterator_rc_knext_(GxB_Iterator iterator) -{ - if ((++iterator->k) >= iterator->anvec) - { - iterator->pstart = 0; - iterator->pend = 0; - iterator->p = 0; - iterator->k = iterator->anvec; - return GxB_EXHAUSTED; - } - switch (iterator->A_sparsity) - { - default: - - case 2: - - case 1: - { - iterator->pstart = iterator->Ap[iterator->k]; - iterator->pend = iterator->Ap[iterator->k + 1]; - iterator->p = iterator->pstart; - } - break; - - case 4: - { - iterator->pstart += iterator->avlen; - iterator->pend += iterator->avlen; - iterator->p = iterator->pstart; - return GB_Iterator_rc_bitmap_next(iterator); - } - break; - - case 8: - { - iterator->pstart += iterator->avlen; - iterator->pend += iterator->avlen; - iterator->p = iterator->pstart; - } - break; - - } - - return (iterator->p >= iterator->pend) ? (GrB_NO_VALUE) : (GrB_SUCCESS); -} - -extern GrB_Info GxB_Matrix_Iterator_attach_(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc) -{ - return GB_Iterator_attach(iterator, A, GxB_NO_FORMAT, desc); -} - -extern GrB_Info GxB_Vector_Iterator_next_(GxB_Iterator iterator) -{ - if ((++iterator->p) >= iterator->pmax) - { - iterator->p = iterator->pmax; - return GxB_EXHAUSTED; - } - return GrB_SUCCESS; -} - -extern GrB_Info GxB_Vector_Iterator_seek_(GxB_Iterator iterator, GrB_Index p) -{ - if (p >= iterator->pmax) - { - iterator->p = iterator->pmax; - return GxB_EXHAUSTED; - } - else - { - iterator->p = p; - if (iterator->A_sparsity == 4) - { - for (; iterator->p < iterator->pmax; iterator->p++) - { - if (iterator->Ab[iterator->p]) - { - return GrB_SUCCESS; - } - } - - return GxB_EXHAUSTED; - } - } - return GrB_SUCCESS; -} - -extern GrB_Info GxB_colIterator_attach_(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc) -{ - return GB_Iterator_attach(iterator, A, GxB_BY_COL, desc); -} - -extern GrB_Info GxB_colIterator_kseek_(GxB_Iterator iterator, GrB_Index k) -{ - return GB_Iterator_rc_seek(iterator, k, 1); -} - -extern GrB_Info GxB_colIterator_nextCol_(GxB_Iterator iterator) -{ - return GB_Iterator_rc_knext(iterator); -} - -extern GrB_Info GxB_colIterator_nextRow_(GxB_Iterator iterator) -{ - return GB_Iterator_rc_inext(iterator); -} - -extern GrB_Info GxB_colIterator_seekCol_(GxB_Iterator iterator, GrB_Index col) -{ - return GB_Iterator_rc_seek(iterator, col, 0); -} - -extern GrB_Info GxB_rowIterator_attach_(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc) -{ - return GB_Iterator_attach(iterator, A, GxB_BY_ROW, desc); -} - -extern GrB_Info GxB_rowIterator_kseek_(GxB_Iterator iterator, GrB_Index k) -{ - return GB_Iterator_rc_seek(iterator, k, 1); -} - -extern GrB_Info GxB_rowIterator_nextCol_(GxB_Iterator iterator) -{ - return GB_Iterator_rc_inext(iterator); -} - -extern GrB_Info GxB_rowIterator_nextRow_(GxB_Iterator iterator) -{ - return GB_Iterator_rc_knext(iterator); -} - -extern GrB_Info GxB_rowIterator_seekRow_(GxB_Iterator iterator, GrB_Index row) -{ - return GB_Iterator_rc_seek(iterator, row, 0); -} - -extern GxB_FC32_t GxB_Iterator_get_FC32_(GxB_Iterator iterator) -{ - return ((GxB_FC32_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern GxB_FC64_t GxB_Iterator_get_FC64_(GxB_Iterator iterator) -{ - return ((GxB_FC64_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern bool GxB_Iterator_get_BOOL_(GxB_Iterator iterator) -{ - return ((bool *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern double GxB_Iterator_get_FP64_(GxB_Iterator iterator) -{ - return ((double *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern float GxB_Iterator_get_FP32_(GxB_Iterator iterator) -{ - return ((float *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern int8_t GxB_Iterator_get_INT8_(GxB_Iterator iterator) -{ - return ((int8_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern int16_t GxB_Iterator_get_INT16_(GxB_Iterator iterator) -{ - return ((int16_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern int32_t GxB_Iterator_get_INT32_(GxB_Iterator iterator) -{ - return ((int32_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern int64_t GxB_Iterator_get_INT64_(GxB_Iterator iterator) -{ - return ((uint64_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern uint8_t GxB_Iterator_get_UINT8_(GxB_Iterator iterator) -{ - return ((uint8_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern uint16_t GxB_Iterator_get_UINT16_(GxB_Iterator iterator) -{ - return ((uint16_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern uint32_t GxB_Iterator_get_UINT32_(GxB_Iterator iterator) -{ - return ((uint32_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern uint64_t GxB_Iterator_get_UINT64_(GxB_Iterator iterator) -{ - return ((uint64_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern void GxB_Iterator_get_UDT_(GxB_Iterator iterator, void *value) -{ - memcpy(value, iterator->Ax + ((iterator->iso) ? (0) : (iterator->type_size * iterator->p)), iterator->type_size); -} - -extern void GxB_Matrix_Iterator_getIndex_(GxB_Iterator iterator, GrB_Index *row, GrB_Index *col) -{ - switch (iterator->A_sparsity) - { - default: - - case 2: - { - if (iterator->by_col) - { - *row = iterator->Ai[iterator->p]; - *col = iterator->k; - } - else - { - *row = iterator->k; - *col = iterator->Ai[iterator->p]; - } - } - break; - - case 1: - { - if (iterator->by_col) - { - *row = iterator->Ai[iterator->p]; - *col = iterator->Ah[iterator->k]; - } - else - { - *row = iterator->Ah[iterator->k]; - *col = iterator->Ai[iterator->p]; - } - } - break; - - case 4: - - case 8: - { - if (iterator->by_col) - { - *row = iterator->p - iterator->pstart; - *col = iterator->k; - } - else - { - *row = iterator->k; - *col = iterator->p - iterator->pstart; - } - } - break; - - } - -} +char *GxB_SPEC_DATE_STR = GxB_SPEC_DATE; \ No newline at end of file diff --git a/suitesparse_graphblas/source_no_complex.c b/suitesparse_graphblas/source_no_complex.c deleted file mode 100644 index 19b899c..0000000 --- a/suitesparse_graphblas/source_no_complex.c +++ /dev/null @@ -1,369 +0,0 @@ -/* This file is automatically generated */ -#include "GraphBLAS.h" -char *GxB_IMPLEMENTATION_ABOUT_STR = GxB_IMPLEMENTATION_ABOUT; -char *GxB_IMPLEMENTATION_DATE_STR = GxB_IMPLEMENTATION_DATE; -char *GxB_IMPLEMENTATION_LICENSE_STR = GxB_IMPLEMENTATION_LICENSE; -char *GxB_IMPLEMENTATION_NAME_STR = GxB_IMPLEMENTATION_NAME; -char *GxB_SPEC_ABOUT_STR = GxB_SPEC_ABOUT; -char *GxB_SPEC_DATE_STR = GxB_SPEC_DATE; - -extern GrB_Index GB_Iterator_rc_geti_(GxB_Iterator iterator) -{ - return (iterator->Ai != 0) ? (iterator->Ai[iterator->p]) : (iterator->p - iterator->pstart); -} - -extern GrB_Index GB_Iterator_rc_getj_(GxB_Iterator iterator) -{ - if (iterator->k >= iterator->anvec) - { - return iterator->avdim; - } - else - if (iterator->A_sparsity == 1) - { - return iterator->Ah[iterator->k]; - } - else - { - return iterator->k; - } -} - -extern GrB_Index GxB_Matrix_Iterator_getp_(GxB_Iterator iterator) -{ - return iterator->p; -} - -extern GrB_Index GxB_Matrix_Iterator_getpmax_(GxB_Iterator iterator) -{ - return iterator->pmax; -} - -extern GrB_Index GxB_Vector_Iterator_getIndex_(GxB_Iterator iterator) -{ - return (iterator->Ai != 0) ? (iterator->Ai[iterator->p]) : (iterator->p); -} - -extern GrB_Index GxB_Vector_Iterator_getp_(GxB_Iterator iterator) -{ - return iterator->p; -} - -extern GrB_Index GxB_Vector_Iterator_getpmax_(GxB_Iterator iterator) -{ - return iterator->pmax; -} - -extern GrB_Index GxB_colIterator_getColIndex_(GxB_Iterator iterator) -{ - return GB_Iterator_rc_getj(iterator); -} - -extern GrB_Index GxB_colIterator_getRowIndex_(GxB_Iterator iterator) -{ - return GB_Iterator_rc_geti(iterator); -} - -extern GrB_Index GxB_colIterator_kount_(GxB_Iterator iterator) -{ - return iterator->anvec; -} - -extern GrB_Index GxB_rowIterator_getColIndex_(GxB_Iterator iterator) -{ - return GB_Iterator_rc_geti(iterator); -} - -extern GrB_Index GxB_rowIterator_getRowIndex_(GxB_Iterator iterator) -{ - return GB_Iterator_rc_getj(iterator); -} - -extern GrB_Index GxB_rowIterator_kount_(GxB_Iterator iterator) -{ - return iterator->anvec; -} - -extern GrB_Info GB_Iterator_rc_bitmap_next_(GxB_Iterator iterator) -{ - for (; iterator->p < iterator->pend; iterator->p++) - { - if (iterator->Ab[iterator->p]) - { - return GrB_SUCCESS; - } - } - - return GrB_NO_VALUE; -} - -extern GrB_Info GB_Iterator_rc_inext_(GxB_Iterator iterator) -{ - if ((++iterator->p) >= iterator->pend) - { - return GrB_NO_VALUE; - } - else - if (iterator->A_sparsity == 4) - { - return GB_Iterator_rc_bitmap_next(iterator); - } - else - { - return GrB_SUCCESS; - } -} - -extern GrB_Info GB_Iterator_rc_knext_(GxB_Iterator iterator) -{ - if ((++iterator->k) >= iterator->anvec) - { - iterator->pstart = 0; - iterator->pend = 0; - iterator->p = 0; - iterator->k = iterator->anvec; - return GxB_EXHAUSTED; - } - switch (iterator->A_sparsity) - { - default: - - case 2: - - case 1: - { - iterator->pstart = iterator->Ap[iterator->k]; - iterator->pend = iterator->Ap[iterator->k + 1]; - iterator->p = iterator->pstart; - } - break; - - case 4: - { - iterator->pstart += iterator->avlen; - iterator->pend += iterator->avlen; - iterator->p = iterator->pstart; - return GB_Iterator_rc_bitmap_next(iterator); - } - break; - - case 8: - { - iterator->pstart += iterator->avlen; - iterator->pend += iterator->avlen; - iterator->p = iterator->pstart; - } - break; - - } - - return (iterator->p >= iterator->pend) ? (GrB_NO_VALUE) : (GrB_SUCCESS); -} - -extern GrB_Info GxB_Matrix_Iterator_attach_(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc) -{ - return GB_Iterator_attach(iterator, A, GxB_NO_FORMAT, desc); -} - -extern GrB_Info GxB_Vector_Iterator_next_(GxB_Iterator iterator) -{ - if ((++iterator->p) >= iterator->pmax) - { - iterator->p = iterator->pmax; - return GxB_EXHAUSTED; - } - return GrB_SUCCESS; -} - -extern GrB_Info GxB_Vector_Iterator_seek_(GxB_Iterator iterator, GrB_Index p) -{ - if (p >= iterator->pmax) - { - iterator->p = iterator->pmax; - return GxB_EXHAUSTED; - } - else - { - iterator->p = p; - if (iterator->A_sparsity == 4) - { - for (; iterator->p < iterator->pmax; iterator->p++) - { - if (iterator->Ab[iterator->p]) - { - return GrB_SUCCESS; - } - } - - return GxB_EXHAUSTED; - } - } - return GrB_SUCCESS; -} - -extern GrB_Info GxB_colIterator_attach_(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc) -{ - return GB_Iterator_attach(iterator, A, GxB_BY_COL, desc); -} - -extern GrB_Info GxB_colIterator_kseek_(GxB_Iterator iterator, GrB_Index k) -{ - return GB_Iterator_rc_seek(iterator, k, 1); -} - -extern GrB_Info GxB_colIterator_nextCol_(GxB_Iterator iterator) -{ - return GB_Iterator_rc_knext(iterator); -} - -extern GrB_Info GxB_colIterator_nextRow_(GxB_Iterator iterator) -{ - return GB_Iterator_rc_inext(iterator); -} - -extern GrB_Info GxB_colIterator_seekCol_(GxB_Iterator iterator, GrB_Index col) -{ - return GB_Iterator_rc_seek(iterator, col, 0); -} - -extern GrB_Info GxB_rowIterator_attach_(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc) -{ - return GB_Iterator_attach(iterator, A, GxB_BY_ROW, desc); -} - -extern GrB_Info GxB_rowIterator_kseek_(GxB_Iterator iterator, GrB_Index k) -{ - return GB_Iterator_rc_seek(iterator, k, 1); -} - -extern GrB_Info GxB_rowIterator_nextCol_(GxB_Iterator iterator) -{ - return GB_Iterator_rc_inext(iterator); -} - -extern GrB_Info GxB_rowIterator_nextRow_(GxB_Iterator iterator) -{ - return GB_Iterator_rc_knext(iterator); -} - -extern GrB_Info GxB_rowIterator_seekRow_(GxB_Iterator iterator, GrB_Index row) -{ - return GB_Iterator_rc_seek(iterator, row, 0); -} - -extern bool GxB_Iterator_get_BOOL_(GxB_Iterator iterator) -{ - return ((bool *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern double GxB_Iterator_get_FP64_(GxB_Iterator iterator) -{ - return ((double *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern float GxB_Iterator_get_FP32_(GxB_Iterator iterator) -{ - return ((float *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern int8_t GxB_Iterator_get_INT8_(GxB_Iterator iterator) -{ - return ((int8_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern int16_t GxB_Iterator_get_INT16_(GxB_Iterator iterator) -{ - return ((int16_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern int32_t GxB_Iterator_get_INT32_(GxB_Iterator iterator) -{ - return ((int32_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern int64_t GxB_Iterator_get_INT64_(GxB_Iterator iterator) -{ - return ((uint64_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern uint8_t GxB_Iterator_get_UINT8_(GxB_Iterator iterator) -{ - return ((uint8_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern uint16_t GxB_Iterator_get_UINT16_(GxB_Iterator iterator) -{ - return ((uint16_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern uint32_t GxB_Iterator_get_UINT32_(GxB_Iterator iterator) -{ - return ((uint32_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern uint64_t GxB_Iterator_get_UINT64_(GxB_Iterator iterator) -{ - return ((uint64_t *) iterator->Ax)[(iterator->iso) ? (0) : (iterator->p)]; -} - -extern void GxB_Iterator_get_UDT_(GxB_Iterator iterator, void *value) -{ - memcpy(value, iterator->Ax + ((iterator->iso) ? (0) : (iterator->type_size * iterator->p)), iterator->type_size); -} - -extern void GxB_Matrix_Iterator_getIndex_(GxB_Iterator iterator, GrB_Index *row, GrB_Index *col) -{ - switch (iterator->A_sparsity) - { - default: - - case 2: - { - if (iterator->by_col) - { - *row = iterator->Ai[iterator->p]; - *col = iterator->k; - } - else - { - *row = iterator->k; - *col = iterator->Ai[iterator->p]; - } - } - break; - - case 1: - { - if (iterator->by_col) - { - *row = iterator->Ai[iterator->p]; - *col = iterator->Ah[iterator->k]; - } - else - { - *row = iterator->Ah[iterator->k]; - *col = iterator->Ai[iterator->p]; - } - } - break; - - case 4: - - case 8: - { - if (iterator->by_col) - { - *row = iterator->p - iterator->pstart; - *col = iterator->k; - } - else - { - *row = iterator->k; - *col = iterator->p - iterator->pstart; - } - } - break; - - } - -} diff --git a/suitesparse_graphblas/suitesparse_graphblas.h b/suitesparse_graphblas/suitesparse_graphblas.h index 9b51e28..05f92d1 100644 --- a/suitesparse_graphblas/suitesparse_graphblas.h +++ b/suitesparse_graphblas/suitesparse_graphblas.h @@ -3062,7 +3062,9 @@ extern GrB_Info GrB_Vector_wait(GrB_Vector v, GrB_WaitMode waitmode); extern GrB_Info GB_BinaryOp_new(GrB_BinaryOp *binaryop, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *binop_name); /* iterator */ +extern GrB_Info GB_Iterator_rc_bitmap_next(GxB_Iterator iterator); extern GrB_Info GB_Iterator_rc_seek(GxB_Iterator iterator, GrB_Index j, bool jth_vector); +extern GrB_Info GB_Vector_Iterator_bitmap_seek(GxB_Iterator iterator, GrB_Index p); /* matrix */ extern GrB_Info GB_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GxB_Format_Value format, GrB_Descriptor desc); @@ -3110,13 +3112,50 @@ extern GrB_Info GxB_IndexUnaryOp_ytype_name(char *type_name, const GrB_IndexUnar extern GrB_Info GxB_IndexUnaryOp_ztype_name(char *type_name, const GrB_IndexUnaryOp op); /* iterator */ +extern GrB_Index GxB_Matrix_Iterator_getp(GxB_Iterator iterator); +extern GrB_Index GxB_Matrix_Iterator_getpmax(GxB_Iterator iterator); +extern GrB_Index GxB_Vector_Iterator_getIndex(GxB_Iterator iterator); +extern GrB_Index GxB_Vector_Iterator_getp(GxB_Iterator iterator); +extern GrB_Index GxB_Vector_Iterator_getpmax(GxB_Iterator iterator); +extern GrB_Index GxB_colIterator_getColIndex(GxB_Iterator iterator); +extern GrB_Index GxB_colIterator_getRowIndex(GxB_Iterator iterator); +extern GrB_Index GxB_colIterator_kount(GxB_Iterator iterator); +extern GrB_Index GxB_rowIterator_getColIndex(GxB_Iterator iterator); +extern GrB_Index GxB_rowIterator_getRowIndex(GxB_Iterator iterator); +extern GrB_Index GxB_rowIterator_kount(GxB_Iterator iterator); extern GrB_Info GxB_Iterator_free(GxB_Iterator *iterator); extern GrB_Info GxB_Iterator_new(GxB_Iterator *iterator); +extern GrB_Info GxB_Matrix_Iterator_next(GxB_Iterator iterator); +extern GrB_Info GxB_Matrix_Iterator_seek(GxB_Iterator iterator, GrB_Index p); +extern GrB_Info GxB_Vector_Iterator_next(GxB_Iterator iterator); +extern GrB_Info GxB_Vector_Iterator_seek(GxB_Iterator iterator, GrB_Index p); +extern GrB_Info GxB_colIterator_kseek(GxB_Iterator iterator, GrB_Index k); +extern GrB_Info GxB_colIterator_nextCol(GxB_Iterator iterator); +extern GrB_Info GxB_colIterator_nextRow(GxB_Iterator iterator); +extern GrB_Info GxB_colIterator_seekCol(GxB_Iterator iterator, GrB_Index col); +extern GrB_Info GxB_rowIterator_kseek(GxB_Iterator iterator, GrB_Index k); +extern GrB_Info GxB_rowIterator_nextCol(GxB_Iterator iterator); +extern GrB_Info GxB_rowIterator_nextRow(GxB_Iterator iterator); +extern GrB_Info GxB_rowIterator_seekRow(GxB_Iterator iterator, GrB_Index row); +extern GxB_FC32_t GxB_Iterator_get_FC32(GxB_Iterator iterator); +extern GxB_FC64_t GxB_Iterator_get_FC64(GxB_Iterator iterator); +extern bool GxB_Iterator_get_BOOL(GxB_Iterator iterator); +extern double GxB_Iterator_get_FP64(GxB_Iterator iterator); +extern float GxB_Iterator_get_FP32(GxB_Iterator iterator); +extern int8_t GxB_Iterator_get_INT8(GxB_Iterator iterator); +extern int16_t GxB_Iterator_get_INT16(GxB_Iterator iterator); +extern int32_t GxB_Iterator_get_INT32(GxB_Iterator iterator); +extern int64_t GxB_Iterator_get_INT64(GxB_Iterator iterator); +extern uint8_t GxB_Iterator_get_UINT8(GxB_Iterator iterator); +extern uint16_t GxB_Iterator_get_UINT16(GxB_Iterator iterator); +extern uint32_t GxB_Iterator_get_UINT32(GxB_Iterator iterator); +extern uint64_t GxB_Iterator_get_UINT64(GxB_Iterator iterator); +extern void GxB_Iterator_get_UDT(GxB_Iterator iterator, void *value); +extern void GxB_Matrix_Iterator_getIndex(GxB_Iterator iterator, GrB_Index *row, GrB_Index *col); /* matrix */ extern GrB_Info GxB_Col_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_Iterator_next(GxB_Iterator iterator); -extern GrB_Info GxB_Matrix_Iterator_seek(GxB_Iterator iterator, GrB_Index p); +extern GrB_Info GxB_Matrix_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); extern GrB_Info GxB_Matrix_Option_get(GrB_Matrix A, GxB_Option_Field field, ...); extern GrB_Info GxB_Matrix_Option_set(GrB_Matrix A, GxB_Option_Field field, ...); extern GrB_Info GxB_Matrix_apply_BinaryOp1st(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Matrix A, const GrB_Descriptor desc); @@ -3209,6 +3248,8 @@ extern GrB_Info GxB_Matrix_unpack_HyperCSC(GrB_Matrix A, GrB_Index **Ap, GrB_Ind extern GrB_Info GxB_Matrix_unpack_HyperCSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); extern GrB_Info GxB_Row_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, GrB_Index i, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_diag(GrB_Vector v, const GrB_Matrix A, int64_t k, const GrB_Descriptor desc); +extern GrB_Info GxB_colIterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); +extern GrB_Info GxB_rowIterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); /* monoid */ extern GrB_Info GxB_Monoid_fprint(GrB_Monoid monoid, const char *name, GxB_Print_Level pr, FILE *f); @@ -3368,54 +3409,6 @@ extern GrB_Info GxB_Vector_unpack_Bitmap(GrB_Vector v, int8_t **vb, void **vx, G extern GrB_Info GxB_Vector_unpack_CSC(GrB_Vector v, GrB_Index **vi, void **vx, GrB_Index *vi_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, bool *jumbled, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_unpack_Full(GrB_Vector v, void **vx, GrB_Index *vx_size, bool *iso, const GrB_Descriptor desc); -/************************** -* static inline functions * -**************************/ -extern GrB_Index GB_Iterator_rc_geti_(GxB_Iterator iterator); -extern GrB_Index GB_Iterator_rc_getj_(GxB_Iterator iterator); -extern GrB_Index GxB_Matrix_Iterator_getp_(GxB_Iterator iterator); -extern GrB_Index GxB_Matrix_Iterator_getpmax_(GxB_Iterator iterator); -extern GrB_Index GxB_Vector_Iterator_getIndex_(GxB_Iterator iterator); -extern GrB_Index GxB_Vector_Iterator_getp_(GxB_Iterator iterator); -extern GrB_Index GxB_Vector_Iterator_getpmax_(GxB_Iterator iterator); -extern GrB_Index GxB_colIterator_getColIndex_(GxB_Iterator iterator); -extern GrB_Index GxB_colIterator_getRowIndex_(GxB_Iterator iterator); -extern GrB_Index GxB_colIterator_kount_(GxB_Iterator iterator); -extern GrB_Index GxB_rowIterator_getColIndex_(GxB_Iterator iterator); -extern GrB_Index GxB_rowIterator_getRowIndex_(GxB_Iterator iterator); -extern GrB_Index GxB_rowIterator_kount_(GxB_Iterator iterator); -extern GrB_Info GB_Iterator_rc_bitmap_next_(GxB_Iterator iterator); -extern GrB_Info GB_Iterator_rc_inext_(GxB_Iterator iterator); -extern GrB_Info GB_Iterator_rc_knext_(GxB_Iterator iterator); -extern GrB_Info GxB_Matrix_Iterator_attach_(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); -extern GrB_Info GxB_Vector_Iterator_next_(GxB_Iterator iterator); -extern GrB_Info GxB_Vector_Iterator_seek_(GxB_Iterator iterator, GrB_Index p); -extern GrB_Info GxB_colIterator_attach_(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); -extern GrB_Info GxB_colIterator_kseek_(GxB_Iterator iterator, GrB_Index k); -extern GrB_Info GxB_colIterator_nextCol_(GxB_Iterator iterator); -extern GrB_Info GxB_colIterator_nextRow_(GxB_Iterator iterator); -extern GrB_Info GxB_colIterator_seekCol_(GxB_Iterator iterator, GrB_Index col); -extern GrB_Info GxB_rowIterator_attach_(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); -extern GrB_Info GxB_rowIterator_kseek_(GxB_Iterator iterator, GrB_Index k); -extern GrB_Info GxB_rowIterator_nextCol_(GxB_Iterator iterator); -extern GrB_Info GxB_rowIterator_nextRow_(GxB_Iterator iterator); -extern GrB_Info GxB_rowIterator_seekRow_(GxB_Iterator iterator, GrB_Index row); -extern GxB_FC32_t GxB_Iterator_get_FC32_(GxB_Iterator iterator); -extern GxB_FC64_t GxB_Iterator_get_FC64_(GxB_Iterator iterator); -extern bool GxB_Iterator_get_BOOL_(GxB_Iterator iterator); -extern double GxB_Iterator_get_FP64_(GxB_Iterator iterator); -extern float GxB_Iterator_get_FP32_(GxB_Iterator iterator); -extern int8_t GxB_Iterator_get_INT8_(GxB_Iterator iterator); -extern int16_t GxB_Iterator_get_INT16_(GxB_Iterator iterator); -extern int32_t GxB_Iterator_get_INT32_(GxB_Iterator iterator); -extern int64_t GxB_Iterator_get_INT64_(GxB_Iterator iterator); -extern uint8_t GxB_Iterator_get_UINT8_(GxB_Iterator iterator); -extern uint16_t GxB_Iterator_get_UINT16_(GxB_Iterator iterator); -extern uint32_t GxB_Iterator_get_UINT32_(GxB_Iterator iterator); -extern uint64_t GxB_Iterator_get_UINT64_(GxB_Iterator iterator); -extern void GxB_Iterator_get_UDT_(GxB_Iterator iterator, void *value); -extern void GxB_Matrix_Iterator_getIndex_(GxB_Iterator iterator, GrB_Index *row, GrB_Index *col); - /* int DEFINES */ #define GRB_SUBVERSION ... #define GRB_VERSION ... diff --git a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h index e192937..b68c831 100644 --- a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h +++ b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h @@ -2888,7 +2888,9 @@ extern GrB_Info GrB_Vector_wait(GrB_Vector v, GrB_WaitMode waitmode); extern GrB_Info GB_BinaryOp_new(GrB_BinaryOp *binaryop, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *binop_name); /* iterator */ +extern GrB_Info GB_Iterator_rc_bitmap_next(GxB_Iterator iterator); extern GrB_Info GB_Iterator_rc_seek(GxB_Iterator iterator, GrB_Index j, bool jth_vector); +extern GrB_Info GB_Vector_Iterator_bitmap_seek(GxB_Iterator iterator, GrB_Index p); /* matrix */ extern GrB_Info GB_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GxB_Format_Value format, GrB_Descriptor desc); @@ -2936,13 +2938,48 @@ extern GrB_Info GxB_IndexUnaryOp_ytype_name(char *type_name, const GrB_IndexUnar extern GrB_Info GxB_IndexUnaryOp_ztype_name(char *type_name, const GrB_IndexUnaryOp op); /* iterator */ +extern GrB_Index GxB_Matrix_Iterator_getp(GxB_Iterator iterator); +extern GrB_Index GxB_Matrix_Iterator_getpmax(GxB_Iterator iterator); +extern GrB_Index GxB_Vector_Iterator_getIndex(GxB_Iterator iterator); +extern GrB_Index GxB_Vector_Iterator_getp(GxB_Iterator iterator); +extern GrB_Index GxB_Vector_Iterator_getpmax(GxB_Iterator iterator); +extern GrB_Index GxB_colIterator_getColIndex(GxB_Iterator iterator); +extern GrB_Index GxB_colIterator_getRowIndex(GxB_Iterator iterator); +extern GrB_Index GxB_colIterator_kount(GxB_Iterator iterator); +extern GrB_Index GxB_rowIterator_getColIndex(GxB_Iterator iterator); +extern GrB_Index GxB_rowIterator_getRowIndex(GxB_Iterator iterator); +extern GrB_Index GxB_rowIterator_kount(GxB_Iterator iterator); extern GrB_Info GxB_Iterator_free(GxB_Iterator *iterator); extern GrB_Info GxB_Iterator_new(GxB_Iterator *iterator); +extern GrB_Info GxB_Matrix_Iterator_next(GxB_Iterator iterator); +extern GrB_Info GxB_Matrix_Iterator_seek(GxB_Iterator iterator, GrB_Index p); +extern GrB_Info GxB_Vector_Iterator_next(GxB_Iterator iterator); +extern GrB_Info GxB_Vector_Iterator_seek(GxB_Iterator iterator, GrB_Index p); +extern GrB_Info GxB_colIterator_kseek(GxB_Iterator iterator, GrB_Index k); +extern GrB_Info GxB_colIterator_nextCol(GxB_Iterator iterator); +extern GrB_Info GxB_colIterator_nextRow(GxB_Iterator iterator); +extern GrB_Info GxB_colIterator_seekCol(GxB_Iterator iterator, GrB_Index col); +extern GrB_Info GxB_rowIterator_kseek(GxB_Iterator iterator, GrB_Index k); +extern GrB_Info GxB_rowIterator_nextCol(GxB_Iterator iterator); +extern GrB_Info GxB_rowIterator_nextRow(GxB_Iterator iterator); +extern GrB_Info GxB_rowIterator_seekRow(GxB_Iterator iterator, GrB_Index row); +extern bool GxB_Iterator_get_BOOL(GxB_Iterator iterator); +extern double GxB_Iterator_get_FP64(GxB_Iterator iterator); +extern float GxB_Iterator_get_FP32(GxB_Iterator iterator); +extern int8_t GxB_Iterator_get_INT8(GxB_Iterator iterator); +extern int16_t GxB_Iterator_get_INT16(GxB_Iterator iterator); +extern int32_t GxB_Iterator_get_INT32(GxB_Iterator iterator); +extern int64_t GxB_Iterator_get_INT64(GxB_Iterator iterator); +extern uint8_t GxB_Iterator_get_UINT8(GxB_Iterator iterator); +extern uint16_t GxB_Iterator_get_UINT16(GxB_Iterator iterator); +extern uint32_t GxB_Iterator_get_UINT32(GxB_Iterator iterator); +extern uint64_t GxB_Iterator_get_UINT64(GxB_Iterator iterator); +extern void GxB_Iterator_get_UDT(GxB_Iterator iterator, void *value); +extern void GxB_Matrix_Iterator_getIndex(GxB_Iterator iterator, GrB_Index *row, GrB_Index *col); /* matrix */ extern GrB_Info GxB_Col_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_Iterator_next(GxB_Iterator iterator); -extern GrB_Info GxB_Matrix_Iterator_seek(GxB_Iterator iterator, GrB_Index p); +extern GrB_Info GxB_Matrix_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); extern GrB_Info GxB_Matrix_Option_get(GrB_Matrix A, GxB_Option_Field field, ...); extern GrB_Info GxB_Matrix_Option_set(GrB_Matrix A, GxB_Option_Field field, ...); extern GrB_Info GxB_Matrix_apply_BinaryOp1st(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Matrix A, const GrB_Descriptor desc); @@ -3009,6 +3046,8 @@ extern GrB_Info GxB_Matrix_unpack_HyperCSC(GrB_Matrix A, GrB_Index **Ap, GrB_Ind extern GrB_Info GxB_Matrix_unpack_HyperCSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); extern GrB_Info GxB_Row_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, GrB_Index i, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_diag(GrB_Vector v, const GrB_Matrix A, int64_t k, const GrB_Descriptor desc); +extern GrB_Info GxB_colIterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); +extern GrB_Info GxB_rowIterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); /* monoid */ extern GrB_Info GxB_Monoid_fprint(GrB_Monoid monoid, const char *name, GxB_Print_Level pr, FILE *f); @@ -3138,52 +3177,6 @@ extern GrB_Info GxB_Vector_unpack_Bitmap(GrB_Vector v, int8_t **vb, void **vx, G extern GrB_Info GxB_Vector_unpack_CSC(GrB_Vector v, GrB_Index **vi, void **vx, GrB_Index *vi_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, bool *jumbled, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_unpack_Full(GrB_Vector v, void **vx, GrB_Index *vx_size, bool *iso, const GrB_Descriptor desc); -/************************** -* static inline functions * -**************************/ -extern GrB_Index GB_Iterator_rc_geti_(GxB_Iterator iterator); -extern GrB_Index GB_Iterator_rc_getj_(GxB_Iterator iterator); -extern GrB_Index GxB_Matrix_Iterator_getp_(GxB_Iterator iterator); -extern GrB_Index GxB_Matrix_Iterator_getpmax_(GxB_Iterator iterator); -extern GrB_Index GxB_Vector_Iterator_getIndex_(GxB_Iterator iterator); -extern GrB_Index GxB_Vector_Iterator_getp_(GxB_Iterator iterator); -extern GrB_Index GxB_Vector_Iterator_getpmax_(GxB_Iterator iterator); -extern GrB_Index GxB_colIterator_getColIndex_(GxB_Iterator iterator); -extern GrB_Index GxB_colIterator_getRowIndex_(GxB_Iterator iterator); -extern GrB_Index GxB_colIterator_kount_(GxB_Iterator iterator); -extern GrB_Index GxB_rowIterator_getColIndex_(GxB_Iterator iterator); -extern GrB_Index GxB_rowIterator_getRowIndex_(GxB_Iterator iterator); -extern GrB_Index GxB_rowIterator_kount_(GxB_Iterator iterator); -extern GrB_Info GB_Iterator_rc_bitmap_next_(GxB_Iterator iterator); -extern GrB_Info GB_Iterator_rc_inext_(GxB_Iterator iterator); -extern GrB_Info GB_Iterator_rc_knext_(GxB_Iterator iterator); -extern GrB_Info GxB_Matrix_Iterator_attach_(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); -extern GrB_Info GxB_Vector_Iterator_next_(GxB_Iterator iterator); -extern GrB_Info GxB_Vector_Iterator_seek_(GxB_Iterator iterator, GrB_Index p); -extern GrB_Info GxB_colIterator_attach_(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); -extern GrB_Info GxB_colIterator_kseek_(GxB_Iterator iterator, GrB_Index k); -extern GrB_Info GxB_colIterator_nextCol_(GxB_Iterator iterator); -extern GrB_Info GxB_colIterator_nextRow_(GxB_Iterator iterator); -extern GrB_Info GxB_colIterator_seekCol_(GxB_Iterator iterator, GrB_Index col); -extern GrB_Info GxB_rowIterator_attach_(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); -extern GrB_Info GxB_rowIterator_kseek_(GxB_Iterator iterator, GrB_Index k); -extern GrB_Info GxB_rowIterator_nextCol_(GxB_Iterator iterator); -extern GrB_Info GxB_rowIterator_nextRow_(GxB_Iterator iterator); -extern GrB_Info GxB_rowIterator_seekRow_(GxB_Iterator iterator, GrB_Index row); -extern bool GxB_Iterator_get_BOOL_(GxB_Iterator iterator); -extern double GxB_Iterator_get_FP64_(GxB_Iterator iterator); -extern float GxB_Iterator_get_FP32_(GxB_Iterator iterator); -extern int8_t GxB_Iterator_get_INT8_(GxB_Iterator iterator); -extern int16_t GxB_Iterator_get_INT16_(GxB_Iterator iterator); -extern int32_t GxB_Iterator_get_INT32_(GxB_Iterator iterator); -extern int64_t GxB_Iterator_get_INT64_(GxB_Iterator iterator); -extern uint8_t GxB_Iterator_get_UINT8_(GxB_Iterator iterator); -extern uint16_t GxB_Iterator_get_UINT16_(GxB_Iterator iterator); -extern uint32_t GxB_Iterator_get_UINT32_(GxB_Iterator iterator); -extern uint64_t GxB_Iterator_get_UINT64_(GxB_Iterator iterator); -extern void GxB_Iterator_get_UDT_(GxB_Iterator iterator, void *value); -extern void GxB_Matrix_Iterator_getIndex_(GxB_Iterator iterator, GrB_Index *row, GrB_Index *col); - /* int DEFINES */ #define GRB_SUBVERSION ... #define GRB_VERSION ... From c3347450982eb10162099318eb4e3ba82c79fcd9 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Sun, 6 Feb 2022 10:17:41 -0600 Subject: [PATCH 074/193] Update to 6.2.0.beta5 --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d3c23f7..ce251a2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,7 +18,7 @@ jobs: os: ["ubuntu-latest"] python-version: ["3.8", "3.9", "3.10"] source: ["source"] # ["conda-forge"] - graphblas-version: ["6.2.0.beta3"] + graphblas-version: ["6.2.0.beta5"] steps: - name: Checkout uses: actions/checkout@v2 From aede6f0647bacb4f168422470321b7a3452a8895 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Wed, 16 Feb 2022 14:41:18 -0600 Subject: [PATCH 075/193] SuiteSparse:GraphBLAS 6.2.0 released --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ce251a2..83b9234 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,7 +18,7 @@ jobs: os: ["ubuntu-latest"] python-version: ["3.8", "3.9", "3.10"] source: ["source"] # ["conda-forge"] - graphblas-version: ["6.2.0.beta5"] + graphblas-version: ["6.2.0"] steps: - name: Checkout uses: actions/checkout@v2 From 113a956cfb3e0da1fad2daf86f4d8472bec864ac Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Thu, 17 Feb 2022 11:46:27 -0600 Subject: [PATCH 076/193] Update to v6.2.1 --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 83b9234..3d196a5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,7 +18,7 @@ jobs: os: ["ubuntu-latest"] python-version: ["3.8", "3.9", "3.10"] source: ["source"] # ["conda-forge"] - graphblas-version: ["6.2.0"] + graphblas-version: ["6.2.1"] steps: - name: Checkout uses: actions/checkout@v2 From 9d5b50fe9b58371eb2c865215a4017020068d1e0 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Thu, 17 Feb 2022 15:49:19 -0600 Subject: [PATCH 077/193] Update CI to install from conda-forge; also, run on Windows and OS X --- .github/workflows/test.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3d196a5..695b43f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,10 +14,11 @@ jobs: strategy: fail-fast: false matrix: - # os: ["ubuntu-latest", "macos-latest", "windows-latest"] # Waiting on builds - os: ["ubuntu-latest"] + os: ["ubuntu-latest", "macos-latest", "windows-latest"] + # os: ["ubuntu-latest"] python-version: ["3.8", "3.9", "3.10"] - source: ["source"] # ["conda-forge"] + source: ["conda-forge"] + # source: ["source"] graphblas-version: ["6.2.1"] steps: - name: Checkout From bc3bff43c84ec69f05c54716ffb3ddf4f329850e Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Thu, 17 Feb 2022 15:51:22 -0600 Subject: [PATCH 078/193] Simplify CI --- .github/workflows/test.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 695b43f..154c918 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -65,11 +65,5 @@ jobs: - name: create_headers.py check if: (! contains(matrix.os, 'windows')) run: | - # These shouldn't change, so make copies to compare to - cp suitesparse_graphblas/suitesparse_graphblas.h . - cp suitesparse_graphblas/suitesparse_graphblas_no_complex.h . - cp suitesparse_graphblas/source.c . coverage run -a --branch suitesparse_graphblas/create_headers.py - diff suitesparse_graphblas/suitesparse_graphblas.h suitesparse_graphblas.h - diff suitesparse_graphblas/suitesparse_graphblas_no_complex.h suitesparse_graphblas_no_complex.h - diff suitesparse_graphblas/source.c source.c + git diff --exit-code # error if anything changed From b0951a09394b0e1c8bf54874ebc6a1fe1169d27e Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Tue, 8 Mar 2022 12:37:54 -0600 Subject: [PATCH 079/193] Update to v6.2.3. No code changes needed. Instead, I added an easy way to add meaningless commits, which can be helpful to avoid issues with having multiple git tags and releases point to the same git hash. --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 323441f..a98ef46 100644 --- a/setup.py +++ b/setup.py @@ -1,3 +1,4 @@ +# Twiddle Dee (switch this between Dee and Dum to add meaningless git commits) import os import sys from glob import glob From 66c67e58829ceff227ee2b2c2d9c3054a6a32950 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Tue, 8 Mar 2022 12:39:57 -0600 Subject: [PATCH 080/193] Oh, wait, this is the best way to update. --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 154c918..8cfbcb8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,7 +19,7 @@ jobs: python-version: ["3.8", "3.9", "3.10"] source: ["conda-forge"] # source: ["source"] - graphblas-version: ["6.2.1"] + graphblas-version: ["6.2.3"] steps: - name: Checkout uses: actions/checkout@v2 From 2b50fa74fad65b23f5d3642687f8bcdb0b77fdbd Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Wed, 9 Mar 2022 13:09:10 -0600 Subject: [PATCH 081/193] Update to v6.2.4 --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8cfbcb8..8fe3425 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,7 +19,7 @@ jobs: python-version: ["3.8", "3.9", "3.10"] source: ["conda-forge"] # source: ["source"] - graphblas-version: ["6.2.3"] + graphblas-version: ["6.2.4"] steps: - name: Checkout uses: actions/checkout@v2 From b127e1037c2476a25d03eca5414762843a34bda1 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Tue, 15 Mar 2022 13:32:09 -0500 Subject: [PATCH 082/193] Update to v6.2.5 --- .github/workflows/test.yml | 2 +- .github/workflows/wheels.yml | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8fe3425..f70ad44 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,7 +19,7 @@ jobs: python-version: ["3.8", "3.9", "3.10"] source: ["conda-forge"] # source: ["source"] - graphblas-version: ["6.2.4"] + graphblas-version: ["6.2.5"] steps: - name: Checkout uses: actions/checkout@v2 diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index b7339ad..17250da 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -17,6 +17,13 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.8' + - name: Upgrade pip + run: | + python -m pip install --upgrade pip - name: Build manylinux Python wheels uses: RalfG/python-wheels-manylinux-build@v0.4.2-manylinux2014_x86_64 with: @@ -28,6 +35,5 @@ jobs: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} run: | - python -m pip install --upgrade pip - pip install twine + pip install twine twine upload dist/*-manylinux*.whl From e1658be1ed4cd640ad8678f3d06406c3a6168a20 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Wed, 30 Mar 2022 18:05:26 -0500 Subject: [PATCH 083/193] Update Cython code to support UDTs --- suitesparse_graphblas/utils.pyx | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/suitesparse_graphblas/utils.pyx b/suitesparse_graphblas/utils.pyx index f4cc560..bd399b8 100644 --- a/suitesparse_graphblas/utils.pyx +++ b/suitesparse_graphblas/utils.pyx @@ -5,7 +5,6 @@ from numpy cimport ( NPY_ARRAY_OWNDATA, NPY_ARRAY_WRITEABLE, PyArray_New, - PyArray_SimpleNewFromData, import_array, ndarray, npy_intp, @@ -34,8 +33,13 @@ cpdef ndarray claim_buffer(ffi, cdata, size_t size, dtype): cdef: npy_intp dims = size uintptr_t ptr = int(ffi.cast("uintptr_t", cdata)) - ndarray array = PyArray_SimpleNewFromData(1, &dims, dtype.num, ptr) + ndarray array = PyArray_New( + ndarray, 1, &dims, dtype.num, NULL, ptr, dtype.itemsize, + NPY_ARRAY_WRITEABLE, NULL + ) PyArray_ENABLEFLAGS(array, NPY_ARRAY_OWNDATA) + if dtype.num == 20: # void type, so most likely a UDT + array = array.view(dtype) return array @@ -45,18 +49,20 @@ cpdef ndarray claim_buffer_2d(ffi, cdata, size_t cdata_size, size_t nrows, size_ ndarray array uintptr_t ptr npy_intp dims[2] + int flags = NPY_ARRAY_WRITEABLE if cdata_size == size: ptr = int(ffi.cast("uintptr_t", cdata)) dims[0] = nrows dims[1] = ncols - if is_c_order: - array = PyArray_SimpleNewFromData(2, dims, dtype.num, ptr) - else: - array = PyArray_New( - ndarray, 2, dims, dtype.num, NULL, ptr, -1, - NPY_ARRAY_F_CONTIGUOUS | NPY_ARRAY_WRITEABLE, NULL - ) + if not is_c_order: + flags |= NPY_ARRAY_F_CONTIGUOUS + array = PyArray_New( + ndarray, 2, dims, dtype.num, NULL, ptr, dtype.itemsize, + flags, NULL + ) PyArray_ENABLEFLAGS(array, NPY_ARRAY_OWNDATA) + if dtype.num == 20: # void type, so most likely a UDT + array = array.view(dtype) elif cdata_size > size: # pragma: no cover array = claim_buffer(ffi, cdata, cdata_size, dtype) if is_c_order: From 556538dc691f17640eccb5ddf02980399d144d74 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Wed, 30 Mar 2022 22:20:44 -0500 Subject: [PATCH 084/193] Go ahead and use PyArray_NewFromDescr directly --- suitesparse_graphblas/utils.pxd | 26 ++++++++++++++++---------- suitesparse_graphblas/utils.pyx | 29 ++++++++++++++--------------- 2 files changed, 30 insertions(+), 25 deletions(-) diff --git a/suitesparse_graphblas/utils.pxd b/suitesparse_graphblas/utils.pxd index 776f46f..310e159 100644 --- a/suitesparse_graphblas/utils.pxd +++ b/suitesparse_graphblas/utils.pxd @@ -1,16 +1,20 @@ from libc.stdint cimport uint64_t -from numpy cimport ndarray +from numpy cimport ndarray, npy_intp, dtype as dtype_t cdef extern from "numpy/arrayobject.h" nogil: # These aren't public (i.e., "extern"), but other projects use them too - void *PyDataMem_NEW(size_t) - void *PyDataMem_NEW_ZEROED(size_t, size_t) - void *PyDataMem_RENEW(void *, size_t) - void PyDataMem_FREE(void *) + void *PyDataMem_NEW(size_t size) + void *PyDataMem_NEW_ZEROED(size_t nmemb, size_t size) + void *PyDataMem_RENEW(void *ptr, size_t size) + void PyDataMem_FREE(void *ptr) # These are available in newer Cython versions - void PyArray_ENABLEFLAGS(ndarray, int flags) - void PyArray_CLEARFLAGS(ndarray, int flags) + void PyArray_ENABLEFLAGS(ndarray array, int flags) + void PyArray_CLEARFLAGS(ndarray array, int flags) + # Not exposed by Cython (b/c it steals a reference from dtype) + ndarray PyArray_NewFromDescr( + type subtype, dtype_t dtype, int nd, npy_intp *dims, npy_intp *strides, void *data, int flags, object obj + ) ctypedef enum GrB_Mode: GrB_NONBLOCKING @@ -24,11 +28,13 @@ ctypedef uint64_t (*GxB_init)( void (*user_free_function)(void *), ) -cpdef int call_gxb_init(ffi, lib, int mode) +cpdef int call_gxb_init(object ffi, object lib, int mode) -cpdef ndarray claim_buffer(ffi, cdata, size_t size, dtype) +cpdef ndarray claim_buffer(object ffi, object cdata, size_t size, dtype_t dtype) -cpdef ndarray claim_buffer_2d(ffi, cdata, size_t cdata_size, size_t nrows, size_t ncols, dtype, bint is_c_order) +cpdef ndarray claim_buffer_2d( + object ffi, object cdata, size_t cdata_size, size_t nrows, size_t ncols, dtype_t dtype, bint is_c_order +) cpdef unclaim_buffer(ndarray array) diff --git a/suitesparse_graphblas/utils.pyx b/suitesparse_graphblas/utils.pyx index bd399b8..6378626 100644 --- a/suitesparse_graphblas/utils.pyx +++ b/suitesparse_graphblas/utils.pyx @@ -1,18 +1,19 @@ import numpy as np +from cpython.ref cimport Py_INCREF from libc.stdint cimport uintptr_t from numpy cimport ( NPY_ARRAY_F_CONTIGUOUS, NPY_ARRAY_OWNDATA, NPY_ARRAY_WRITEABLE, - PyArray_New, import_array, ndarray, npy_intp, + dtype as dtype_t, ) import_array() -cpdef int call_gxb_init(ffi, lib, int mode): +cpdef int call_gxb_init(object ffi, object lib, int mode): # We need to call `GxB_init`, but we didn't compile Cython against GraphBLAS. So, we get it from cffi. # Step 1: ffi.addressof(lib, "GxB_init") # Return type: cffi.cdata object of a function pointer. Can't cast to int. @@ -29,21 +30,22 @@ cpdef int call_gxb_init(ffi, lib, int mode): return func(mode, PyDataMem_NEW, PyDataMem_NEW_ZEROED, PyDataMem_RENEW, PyDataMem_FREE) -cpdef ndarray claim_buffer(ffi, cdata, size_t size, dtype): +cpdef ndarray claim_buffer(object ffi, object cdata, size_t size, dtype_t dtype): cdef: npy_intp dims = size uintptr_t ptr = int(ffi.cast("uintptr_t", cdata)) - ndarray array = PyArray_New( - ndarray, 1, &dims, dtype.num, NULL, ptr, dtype.itemsize, - NPY_ARRAY_WRITEABLE, NULL - ) + ndarray array + Py_INCREF(dtype) + array = PyArray_NewFromDescr( + ndarray, dtype, 1, &dims, NULL, ptr, NPY_ARRAY_WRITEABLE, NULL + ) PyArray_ENABLEFLAGS(array, NPY_ARRAY_OWNDATA) - if dtype.num == 20: # void type, so most likely a UDT - array = array.view(dtype) return array -cpdef ndarray claim_buffer_2d(ffi, cdata, size_t cdata_size, size_t nrows, size_t ncols, dtype, bint is_c_order): +cpdef ndarray claim_buffer_2d( + object ffi, object cdata, size_t cdata_size, size_t nrows, size_t ncols, dtype_t dtype, bint is_c_order +): cdef: size_t size = nrows * ncols ndarray array @@ -56,13 +58,10 @@ cpdef ndarray claim_buffer_2d(ffi, cdata, size_t cdata_size, size_t nrows, size_ dims[1] = ncols if not is_c_order: flags |= NPY_ARRAY_F_CONTIGUOUS - array = PyArray_New( - ndarray, 2, dims, dtype.num, NULL, ptr, dtype.itemsize, - flags, NULL + array = PyArray_NewFromDescr( + ndarray, dtype, 2, dims, NULL, ptr, flags, NULL ) PyArray_ENABLEFLAGS(array, NPY_ARRAY_OWNDATA) - if dtype.num == 20: # void type, so most likely a UDT - array = array.view(dtype) elif cdata_size > size: # pragma: no cover array = claim_buffer(ffi, cdata, cdata_size, dtype) if is_c_order: From 0e9ac7b5831d3bf91b38223bbac0227e135fe35d Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Mon, 4 Apr 2022 19:51:57 -0500 Subject: [PATCH 085/193] Update to v7.0.1 --- .github/workflows/test.yml | 10 +++++----- suitesparse_graphblas/create_headers.py | 2 ++ suitesparse_graphblas/suitesparse_graphblas.h | 2 +- .../suitesparse_graphblas_no_complex.h | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f70ad44..8e066e5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,12 +14,12 @@ jobs: strategy: fail-fast: false matrix: - os: ["ubuntu-latest", "macos-latest", "windows-latest"] - # os: ["ubuntu-latest"] + # os: ["ubuntu-latest", "macos-latest", "windows-latest"] + os: ["ubuntu-latest"] python-version: ["3.8", "3.9", "3.10"] - source: ["conda-forge"] - # source: ["source"] - graphblas-version: ["6.2.5"] + # source: ["conda-forge"] + source: ["source"] + graphblas-version: ["7.0.1"] steps: - name: Checkout uses: actions/checkout@v2 diff --git a/suitesparse_graphblas/create_headers.py b/suitesparse_graphblas/create_headers.py index a2e4085..e925d94 100644 --- a/suitesparse_graphblas/create_headers.py +++ b/suitesparse_graphblas/create_headers.py @@ -321,6 +321,7 @@ def groupby(index, seq): "GrB_NULL", "GxB_SUITESPARSE_GRAPHBLAS", "NMACRO", + "RMM_WRAP_H", # deprecated "GxB_HYPER", } @@ -332,6 +333,7 @@ def groupby(index, seq): } IGNORE_ENUMS = { "memory_order", + "RMM_MODE", } diff --git a/suitesparse_graphblas/suitesparse_graphblas.h b/suitesparse_graphblas/suitesparse_graphblas.h index 05f92d1..0ed1b55 100644 --- a/suitesparse_graphblas/suitesparse_graphblas.h +++ b/suitesparse_graphblas/suitesparse_graphblas.h @@ -2714,7 +2714,7 @@ extern GrB_Info GrB_Matrix_build_UINT32(GrB_Matrix C, const GrB_Index *I, const extern GrB_Info GrB_Matrix_build_UINT64(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const uint64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); extern GrB_Info GrB_Matrix_clear(GrB_Matrix A); extern GrB_Info GrB_Matrix_deserialize(GrB_Matrix *C, GrB_Type type, const void *blob, GrB_Index blob_size); -extern GrB_Info GrB_Matrix_diag(GrB_Matrix C, const GrB_Vector v, int64_t k); +extern GrB_Info GrB_Matrix_diag(GrB_Matrix *C, const GrB_Vector v, int64_t k); extern GrB_Info GrB_Matrix_dup(GrB_Matrix *C, const GrB_Matrix A); extern GrB_Info GrB_Matrix_eWiseAdd_BinaryOp(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_eWiseAdd_Monoid(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); diff --git a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h index b68c831..44105af 100644 --- a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h +++ b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h @@ -2540,7 +2540,7 @@ extern GrB_Info GrB_Matrix_build_UINT32(GrB_Matrix C, const GrB_Index *I, const extern GrB_Info GrB_Matrix_build_UINT64(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const uint64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); extern GrB_Info GrB_Matrix_clear(GrB_Matrix A); extern GrB_Info GrB_Matrix_deserialize(GrB_Matrix *C, GrB_Type type, const void *blob, GrB_Index blob_size); -extern GrB_Info GrB_Matrix_diag(GrB_Matrix C, const GrB_Vector v, int64_t k); +extern GrB_Info GrB_Matrix_diag(GrB_Matrix *C, const GrB_Vector v, int64_t k); extern GrB_Info GrB_Matrix_dup(GrB_Matrix *C, const GrB_Matrix A); extern GrB_Info GrB_Matrix_eWiseAdd_BinaryOp(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); extern GrB_Info GrB_Matrix_eWiseAdd_Monoid(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); From 3faf334b53ba8f9bf5bb46fb353ca9959db3b1b3 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Mon, 4 Apr 2022 22:45:11 -0500 Subject: [PATCH 086/193] Let's see if graphblas is available from conda-forge yet --- .github/workflows/test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8e066e5..e88b5ca 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,11 +14,11 @@ jobs: strategy: fail-fast: false matrix: - # os: ["ubuntu-latest", "macos-latest", "windows-latest"] - os: ["ubuntu-latest"] + os: ["ubuntu-latest", "macos-latest", "windows-latest"] + # os: ["ubuntu-latest"] python-version: ["3.8", "3.9", "3.10"] - # source: ["conda-forge"] - source: ["source"] + source: ["conda-forge"] + # source: ["source"] graphblas-version: ["7.0.1"] steps: - name: Checkout From a86848f588c4280c0002c3240c78fb5a034d3032 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Fri, 8 Apr 2022 16:30:07 -0500 Subject: [PATCH 087/193] Update to v7.0.2 (from source; waiting on conda-forge) --- .github/workflows/test.yml | 10 +++++----- suitesparse_graphblas/suitesparse_graphblas.h | 2 +- .../suitesparse_graphblas_no_complex.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e88b5ca..f0c0777 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,12 +14,12 @@ jobs: strategy: fail-fast: false matrix: - os: ["ubuntu-latest", "macos-latest", "windows-latest"] - # os: ["ubuntu-latest"] + # os: ["ubuntu-latest", "macos-latest", "windows-latest"] + os: ["ubuntu-latest"] python-version: ["3.8", "3.9", "3.10"] - source: ["conda-forge"] - # source: ["source"] - graphblas-version: ["7.0.1"] + # source: ["conda-forge"] + source: ["source"] + graphblas-version: ["7.0.2"] steps: - name: Checkout uses: actions/checkout@v2 diff --git a/suitesparse_graphblas/suitesparse_graphblas.h b/suitesparse_graphblas/suitesparse_graphblas.h index 0ed1b55..5650395 100644 --- a/suitesparse_graphblas/suitesparse_graphblas.h +++ b/suitesparse_graphblas/suitesparse_graphblas.h @@ -3064,7 +3064,7 @@ extern GrB_Info GB_BinaryOp_new(GrB_BinaryOp *binaryop, GxB_binary_function func /* iterator */ extern GrB_Info GB_Iterator_rc_bitmap_next(GxB_Iterator iterator); extern GrB_Info GB_Iterator_rc_seek(GxB_Iterator iterator, GrB_Index j, bool jth_vector); -extern GrB_Info GB_Vector_Iterator_bitmap_seek(GxB_Iterator iterator, GrB_Index p); +extern GrB_Info GB_Vector_Iterator_bitmap_seek(GxB_Iterator iterator, GrB_Index unused); /* matrix */ extern GrB_Info GB_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GxB_Format_Value format, GrB_Descriptor desc); diff --git a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h index 44105af..e02a1c7 100644 --- a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h +++ b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h @@ -2890,7 +2890,7 @@ extern GrB_Info GB_BinaryOp_new(GrB_BinaryOp *binaryop, GxB_binary_function func /* iterator */ extern GrB_Info GB_Iterator_rc_bitmap_next(GxB_Iterator iterator); extern GrB_Info GB_Iterator_rc_seek(GxB_Iterator iterator, GrB_Index j, bool jth_vector); -extern GrB_Info GB_Vector_Iterator_bitmap_seek(GxB_Iterator iterator, GrB_Index p); +extern GrB_Info GB_Vector_Iterator_bitmap_seek(GxB_Iterator iterator, GrB_Index unused); /* matrix */ extern GrB_Info GB_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GxB_Format_Value format, GrB_Descriptor desc); From 5581ad6073cc2ff4d586fbe7ecba8fa567afd287 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Fri, 8 Apr 2022 20:12:38 -0500 Subject: [PATCH 088/193] Try conda-forge --- .github/workflows/test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f0c0777..c568718 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,11 +14,11 @@ jobs: strategy: fail-fast: false matrix: - # os: ["ubuntu-latest", "macos-latest", "windows-latest"] - os: ["ubuntu-latest"] + os: ["ubuntu-latest", "macos-latest", "windows-latest"] + # os: ["ubuntu-latest"] python-version: ["3.8", "3.9", "3.10"] - # source: ["conda-forge"] - source: ["source"] + source: ["conda-forge"] + # source: ["source"] graphblas-version: ["7.0.2"] steps: - name: Checkout From 0da4f9fa64d90cc771519ac3332826711e976ffa Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Sun, 10 Apr 2022 00:40:48 -0500 Subject: [PATCH 089/193] Update to v7.0.3 (#39) --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c568718..92f3b80 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,7 +19,7 @@ jobs: python-version: ["3.8", "3.9", "3.10"] source: ["conda-forge"] # source: ["source"] - graphblas-version: ["7.0.2"] + graphblas-version: ["7.0.3"] steps: - name: Checkout uses: actions/checkout@v2 From b4fc05a110f273228c45d98e699332eb5bc27506 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Wed, 13 Apr 2022 18:31:32 -0500 Subject: [PATCH 090/193] Fix issue with `Scalar_setElement_FC64` with cffi voodoo magic (#41) * Fix issue with `Scalar_setElement_FC64` with cffi voodoo magic --- .github/workflows/test.yml | 2 +- suitesparse_graphblas/__init__.py | 3 +++ suitesparse_graphblas/tests/test_scalar.py | 12 ++++++++++++ suitesparse_graphblas/utils.pxd | 3 ++- suitesparse_graphblas/utils.pyx | 13 ++++--------- 5 files changed, 22 insertions(+), 11 deletions(-) create mode 100644 suitesparse_graphblas/tests/test_scalar.py diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 92f3b80..ff15e1e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,7 +34,7 @@ jobs: - name: GraphBLAS (from conda-forge) if: (contains(matrix.source, 'conda-forge')) run: | - conda install -c conda-forge graphblas=${{ matrix.graphblas-version }} + conda install -c conda-forge graphblas=${{ matrix.graphblas-version }} pytest pytest-randomly - name: GraphBLAS (from source) if: (contains(matrix.source, 'source')) run: | diff --git a/suitesparse_graphblas/__init__.py b/suitesparse_graphblas/__init__.py index 9212b0c..293a937 100644 --- a/suitesparse_graphblas/__init__.py +++ b/suitesparse_graphblas/__init__.py @@ -44,6 +44,9 @@ def initialize(*, blocking=False, memory_manager="numpy"): lib.GrB_init(blocking) else: raise ValueError(f'memory_manager argument must be "numpy" or "c"; got: {memory_manager!r}') + # See: https://github.com/GraphBLAS/python-suitesparse-graphblas/issues/40 + for attr in dir(lib): + getattr(lib, attr) def libget(name): diff --git a/suitesparse_graphblas/tests/test_scalar.py b/suitesparse_graphblas/tests/test_scalar.py new file mode 100644 index 0000000..6c1a74a --- /dev/null +++ b/suitesparse_graphblas/tests/test_scalar.py @@ -0,0 +1,12 @@ +import pytest + +from suitesparse_graphblas import ffi, lib, supports_complex # noqa + + +@pytest.mark.skipif("not supports_complex()") +def test_complex(): + s = ffi.new("GrB_Scalar*") + success = lib.GrB_SUCCESS + assert lib.GrB_Scalar_new(s, lib.GxB_FC64) == success + assert lib.GxB_Scalar_setElement_FC64(s[0], 1j) == success + assert lib.GrB_Scalar_free(s) == success diff --git a/suitesparse_graphblas/utils.pxd b/suitesparse_graphblas/utils.pxd index 310e159..9ffb23a 100644 --- a/suitesparse_graphblas/utils.pxd +++ b/suitesparse_graphblas/utils.pxd @@ -1,5 +1,6 @@ from libc.stdint cimport uint64_t -from numpy cimport ndarray, npy_intp, dtype as dtype_t +from numpy cimport dtype as dtype_t +from numpy cimport ndarray, npy_intp cdef extern from "numpy/arrayobject.h" nogil: diff --git a/suitesparse_graphblas/utils.pyx b/suitesparse_graphblas/utils.pyx index 6378626..95d2f1b 100644 --- a/suitesparse_graphblas/utils.pyx +++ b/suitesparse_graphblas/utils.pyx @@ -1,15 +1,9 @@ import numpy as np from cpython.ref cimport Py_INCREF from libc.stdint cimport uintptr_t -from numpy cimport ( - NPY_ARRAY_F_CONTIGUOUS, - NPY_ARRAY_OWNDATA, - NPY_ARRAY_WRITEABLE, - import_array, - ndarray, - npy_intp, - dtype as dtype_t, -) +from numpy cimport NPY_ARRAY_F_CONTIGUOUS, NPY_ARRAY_OWNDATA, NPY_ARRAY_WRITEABLE +from numpy cimport dtype as dtype_t +from numpy cimport import_array, ndarray, npy_intp import_array() @@ -58,6 +52,7 @@ cpdef ndarray claim_buffer_2d( dims[1] = ncols if not is_c_order: flags |= NPY_ARRAY_F_CONTIGUOUS + Py_INCREF(dtype) array = PyArray_NewFromDescr( ndarray, dtype, 2, dims, NULL, ptr, flags, NULL ) From e5f68981532aa86a95cee62fe4c03d4f536ab326 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Tue, 26 Apr 2022 21:40:39 -0500 Subject: [PATCH 091/193] Update to SuiteSparse:GraphBLAS 7.0.4 (#42) --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ff15e1e..5ef0a5e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,7 +19,7 @@ jobs: python-version: ["3.8", "3.9", "3.10"] source: ["conda-forge"] # source: ["source"] - graphblas-version: ["7.0.3"] + graphblas-version: ["7.0.4"] steps: - name: Checkout uses: actions/checkout@v2 From 6998b6103e393100ddc80c36e108efb8d8027f77 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Fri, 20 May 2022 18:14:28 -0500 Subject: [PATCH 092/193] Update to v7.1.0 (#43) * Update to v7.1.0 * From conda-forge in CI --- .github/workflows/test.yml | 2 +- suitesparse_graphblas/suitesparse_graphblas.h | 8 +++++++- suitesparse_graphblas/suitesparse_graphblas_no_complex.h | 8 +++++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5ef0a5e..9132474 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,7 +19,7 @@ jobs: python-version: ["3.8", "3.9", "3.10"] source: ["conda-forge"] # source: ["source"] - graphblas-version: ["7.0.4"] + graphblas-version: ["7.1.0"] steps: - name: Checkout uses: actions/checkout@v2 diff --git a/suitesparse_graphblas/suitesparse_graphblas.h b/suitesparse_graphblas/suitesparse_graphblas.h index 5650395..926b951 100644 --- a/suitesparse_graphblas/suitesparse_graphblas.h +++ b/suitesparse_graphblas/suitesparse_graphblas.h @@ -89,7 +89,9 @@ typedef enum typedef enum { GrB_NONBLOCKING = 0, - GrB_BLOCKING = 1 + GrB_BLOCKING = 1, + GxB_NONBLOCKING_GPU = 2, + GxB_BLOCKING_GPU = 3 } GrB_Mode; typedef enum @@ -2454,6 +2456,8 @@ extern GrB_UnaryOp GxB_ATAN_FP32; extern GrB_UnaryOp GxB_ATAN_FP64; extern GrB_UnaryOp GxB_CARG_FC32; extern GrB_UnaryOp GxB_CARG_FC64; +extern GrB_UnaryOp GxB_CBRT_FP32; +extern GrB_UnaryOp GxB_CBRT_FP64; extern GrB_UnaryOp GxB_CEIL_FC32; extern GrB_UnaryOp GxB_CEIL_FC64; extern GrB_UnaryOp GxB_CEIL_FP32; @@ -3200,6 +3204,7 @@ extern GrB_Info GxB_Matrix_import_FullC(GrB_Matrix *A, GrB_Type type, GrB_Index extern GrB_Info GxB_Matrix_import_FullR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_import_HyperCSC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_import_HyperCSR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_isStoredElement(const GrB_Matrix A, GrB_Index i, GrB_Index j); extern GrB_Info GxB_Matrix_iso(bool *iso, const GrB_Matrix A); extern GrB_Info GxB_Matrix_memoryUsage(size_t *size, const GrB_Matrix A); extern GrB_Info GxB_Matrix_pack_BitmapC(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); @@ -3373,6 +3378,7 @@ extern GrB_Info GxB_Vector_fprint(GrB_Vector v, const char *name, GxB_Print_Leve extern GrB_Info GxB_Vector_import_Bitmap(GrB_Vector *v, GrB_Type type, GrB_Index n, int8_t **vb, void **vx, GrB_Index vb_size, GrB_Index vx_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_import_CSC(GrB_Vector *v, GrB_Type type, GrB_Index n, GrB_Index **vi, void **vx, GrB_Index vi_size, GrB_Index vx_size, bool iso, GrB_Index nvals, bool jumbled, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_import_Full(GrB_Vector *v, GrB_Type type, GrB_Index n, void **vx, GrB_Index vx_size, bool iso, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_isStoredElement(const GrB_Vector v, GrB_Index i); extern GrB_Info GxB_Vector_iso(bool *iso, const GrB_Vector v); extern GrB_Info GxB_Vector_memoryUsage(size_t *size, const GrB_Vector v); extern GrB_Info GxB_Vector_pack_Bitmap(GrB_Vector v, int8_t **vb, void **vx, GrB_Index vb_size, GrB_Index vx_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); diff --git a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h index e02a1c7..850d1fa 100644 --- a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h +++ b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h @@ -87,7 +87,9 @@ typedef enum typedef enum { GrB_NONBLOCKING = 0, - GrB_BLOCKING = 1 + GrB_BLOCKING = 1, + GxB_NONBLOCKING_GPU = 2, + GxB_BLOCKING_GPU = 3 } GrB_Mode; typedef enum @@ -2336,6 +2338,8 @@ extern GrB_UnaryOp GxB_ATANH_FP32; extern GrB_UnaryOp GxB_ATANH_FP64; extern GrB_UnaryOp GxB_ATAN_FP32; extern GrB_UnaryOp GxB_ATAN_FP64; +extern GrB_UnaryOp GxB_CBRT_FP32; +extern GrB_UnaryOp GxB_CBRT_FP64; extern GrB_UnaryOp GxB_CEIL_FP32; extern GrB_UnaryOp GxB_CEIL_FP64; extern GrB_UnaryOp GxB_COSH_FP32; @@ -3006,6 +3010,7 @@ extern GrB_Info GxB_Matrix_import_FullC(GrB_Matrix *A, GrB_Type type, GrB_Index extern GrB_Info GxB_Matrix_import_FullR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_import_HyperCSC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_import_HyperCSR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_isStoredElement(const GrB_Matrix A, GrB_Index i, GrB_Index j); extern GrB_Info GxB_Matrix_iso(bool *iso, const GrB_Matrix A); extern GrB_Info GxB_Matrix_memoryUsage(size_t *size, const GrB_Matrix A); extern GrB_Info GxB_Matrix_pack_BitmapC(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); @@ -3149,6 +3154,7 @@ extern GrB_Info GxB_Vector_fprint(GrB_Vector v, const char *name, GxB_Print_Leve extern GrB_Info GxB_Vector_import_Bitmap(GrB_Vector *v, GrB_Type type, GrB_Index n, int8_t **vb, void **vx, GrB_Index vb_size, GrB_Index vx_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_import_CSC(GrB_Vector *v, GrB_Type type, GrB_Index n, GrB_Index **vi, void **vx, GrB_Index vi_size, GrB_Index vx_size, bool iso, GrB_Index nvals, bool jumbled, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_import_Full(GrB_Vector *v, GrB_Type type, GrB_Index n, void **vx, GrB_Index vx_size, bool iso, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_isStoredElement(const GrB_Vector v, GrB_Index i); extern GrB_Info GxB_Vector_iso(bool *iso, const GrB_Vector v); extern GrB_Info GxB_Vector_memoryUsage(size_t *size, const GrB_Vector v); extern GrB_Info GxB_Vector_pack_Bitmap(GrB_Vector v, int8_t **vb, void **vx, GrB_Index vb_size, GrB_Index vx_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); From 8937853a3e8b74d27eb4a7d47a1b82328804911d Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Sun, 5 Jun 2022 22:38:01 -0500 Subject: [PATCH 093/193] Add GxB serialize and deserialize for matrices and vectors. (#44) These are thin wrappers as per typical for `python-suitesparse-graphblas` --- setup.cfg | 1 + suitesparse_graphblas/__init__.py | 4 + suitesparse_graphblas/exceptions.py | 8 ++ suitesparse_graphblas/io/serialize.py | 133 +++++++++++++++++++++++++ suitesparse_graphblas/matrix.py | 3 + suitesparse_graphblas/tests/test_io.py | 48 +++++++++ suitesparse_graphblas/vector.py | 3 + 7 files changed, 200 insertions(+) create mode 100644 suitesparse_graphblas/io/serialize.py diff --git a/setup.cfg b/setup.cfg index 39f66e3..87f71bf 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,6 +3,7 @@ test=pytest [flake8] max-line-length = 100 +inline-quotes = " exclude = versioneer.py, ignore = diff --git a/suitesparse_graphblas/__init__.py b/suitesparse_graphblas/__init__.py index 293a937..7f9bd2f 100644 --- a/suitesparse_graphblas/__init__.py +++ b/suitesparse_graphblas/__init__.py @@ -117,11 +117,15 @@ def libget(name): lib.GrB_DOMAIN_MISMATCH: ex.DomainMismatch, lib.GrB_DIMENSION_MISMATCH: ex.DimensionMismatch, lib.GrB_OUTPUT_NOT_EMPTY: ex.OutputNotEmpty, + lib.GrB_EMPTY_OBJECT: ex.EmptyObject, # Execution Errors lib.GrB_OUT_OF_MEMORY: ex.OutOfMemory, lib.GrB_INSUFFICIENT_SPACE: ex.InsufficientSpace, lib.GrB_INDEX_OUT_OF_BOUNDS: ex.IndexOutOfBound, lib.GrB_PANIC: ex.Panic, + lib.GrB_NOT_IMPLEMENTED: ex.NotImplementedException, + # GxB Errors + lib.GxB_EXHAUSTED: StopIteration, } GrB_SUCCESS = lib.GrB_SUCCESS GrB_NO_VALUE = lib.GrB_NO_VALUE diff --git a/suitesparse_graphblas/exceptions.py b/suitesparse_graphblas/exceptions.py index 7002e71..f03c784 100644 --- a/suitesparse_graphblas/exceptions.py +++ b/suitesparse_graphblas/exceptions.py @@ -38,6 +38,10 @@ class OutputNotEmpty(GraphBLASException): pass +class EmptyObject(GraphBLASException): + pass + + class OutOfMemory(GraphBLASException): pass @@ -52,3 +56,7 @@ class IndexOutOfBound(GraphBLASException): class Panic(GraphBLASException): pass + + +class NotImplementedException(GraphBLASException): + pass diff --git a/suitesparse_graphblas/io/serialize.py b/suitesparse_graphblas/io/serialize.py new file mode 100644 index 0000000..19e13e0 --- /dev/null +++ b/suitesparse_graphblas/io/serialize.py @@ -0,0 +1,133 @@ +import numpy as np + +from suitesparse_graphblas import check_status, ffi, lib +from suitesparse_graphblas.utils import claim_buffer + + +def free_desc(desc): + """Free a descriptor.""" + check_status(desc, lib.GrB_Descriptor_free(desc)) + + +def get_serialize_desc(compression=lib.GxB_COMPRESSION_DEFAULT, level=None, nthreads=None): + """Create a descriptor for serializing or deserializing. + + This returns None (for NULL descriptor) or a pointer to a GrB_Descriptor. + """ + if nthreads is None and (compression is None or compression == lib.GxB_COMPRESSION_DEFAULT): + return None + desc = ffi.new("GrB_Descriptor*") + check_status(desc, lib.GrB_Descriptor_new(desc)) + desc = ffi.gc(desc, free_desc) + if nthreads is not None: + check_status(desc, lib.GxB_Desc_set(desc[0], lib.GxB_NTHREADS, ffi.cast("int", nthreads))) + if compression is not None: + if level is not None and compression == lib.GxB_COMPRESSION_LZ4HC: + compression += level + check_status( + desc, lib.GxB_Desc_set(desc[0], lib.GxB_COMPRESSION, ffi.cast("int", compression)) + ) + return desc + + +def serialize_matrix(A, compression=lib.GxB_COMPRESSION_DEFAULT, level=None, *, nthreads=None): + """Serialize a Matrix into an array of bytes. + + Parameters + ---------- + compression : int, optional + One of None, GxB_COMPRESSION_NONE, GxB_COMPRESSION_DEFAULT, + GxB_COMPRESSION_LZ4, or GxB_COMPRESSION_LZ4HC + level : int, optional + Used by GxB_COMPRESSION_LZ4HC. Should be between 1 and 9, where 9 is most compressed. + nthreads : int, optional + The maximum number of OpenMP threads to use. + """ + desc = get_serialize_desc(compression, level, nthreads) + data_ptr = ffi.new("void**") + size_ptr = ffi.new("GrB_Index*") + check_status( + A, lib.GxB_Matrix_serialize(data_ptr, size_ptr, A[0], ffi.NULL if desc is None else desc[0]) + ) + return claim_buffer(ffi, data_ptr[0], size_ptr[0], np.dtype(np.uint8)) + + +def serialize_vector(v, compression=lib.GxB_COMPRESSION_DEFAULT, level=None, *, nthreads=None): + """Serialize a Vector into an array of bytes. + + Parameters + ---------- + compression : int, optional + One of None, GxB_COMPRESSION_NONE, GxB_COMPRESSION_DEFAULT, + GxB_COMPRESSION_LZ4, or GxB_COMPRESSION_LZ4HC + level : int, optional + Used by GxB_COMPRESSION_LZ4HC. Should be between 1 and 9, where 9 is most compressed. + nthreads : int, optional + The maximum number of OpenMP threads to use. + """ + desc = get_serialize_desc(compression, level, nthreads) + data_ptr = ffi.new("void**") + size_ptr = ffi.new("GrB_Index*") + check_status( + v, lib.GxB_Vector_serialize(data_ptr, size_ptr, v[0], ffi.NULL if desc is None else desc[0]) + ) + return claim_buffer(ffi, data_ptr[0], size_ptr[0], np.dtype(np.uint8)) + + +def deserialize_matrix(data, *, free=True, nthreads=None): + """Deserialize a Matrix from bytes. + + The `free` argument is called when the object is garbage + collected, the default is `matrix.free()`. If `free` is None then + there is no automatic garbage collection and it is up to the user + to free the matrix. + """ + data = np.frombuffer(data, np.uint8) + desc = get_serialize_desc(None, nthreads) + A = ffi.new("GrB_Matrix*") + check_status( + A, + lib.GxB_Matrix_deserialize( + A, + ffi.NULL, # dtype; we don't check for now + ffi.from_buffer("void*", data), + data.nbytes, + ffi.NULL if desc is None else desc[0], + ), + ) + if free: + if callable(free): + return ffi.gc(A, free) + return ffi.gc(A, matrix.free) + return A + + +def deserialize_vector(data, *, free=True, nthreads=None): + """Deserialize a Vector from bytes. + + The `free` argument is called when the object is garbage + collected, the default is `vector.free()`. If `free` is None then + there is no automatic garbage collection and it is up to the user + to free the vector. + """ + data = np.frombuffer(data, np.uint8) + desc = get_serialize_desc(None, nthreads) + v = ffi.new("GrB_Vector*") + check_status( + v, + lib.GxB_Vector_deserialize( + v, + ffi.NULL, # dtype; we don't check for now + ffi.from_buffer("void*", data), + data.nbytes, + ffi.NULL if desc is None else desc[0], + ), + ) + if free: + if callable(free): + return ffi.gc(v, free) + return ffi.gc(v, vector.free) + return v + + +from suitesparse_graphblas import matrix, vector # noqa isort:skip diff --git a/suitesparse_graphblas/matrix.py b/suitesparse_graphblas/matrix.py index bc482af..b337b87 100644 --- a/suitesparse_graphblas/matrix.py +++ b/suitesparse_graphblas/matrix.py @@ -1,5 +1,8 @@ from suitesparse_graphblas import check_status, ffi, lib +from .io.serialize import deserialize_matrix as deserialize # noqa +from .io.serialize import serialize_matrix as serialize # noqa + def free(A): """Free a matrix.""" diff --git a/suitesparse_graphblas/tests/test_io.py b/suitesparse_graphblas/tests/test_io.py index 0b19320..00184f6 100644 --- a/suitesparse_graphblas/tests/test_io.py +++ b/suitesparse_graphblas/tests/test_io.py @@ -18,6 +18,7 @@ signed_integer_types, supports_complex, unsigned_integer_types, + vector, ) if platform.system() == "Windows": @@ -87,6 +88,53 @@ def _test_elements(T): ) +def test_serialize_matrix(): + T = lib.GrB_INT64 + A = matrix.new(T, 2, 2) + for args in zip(*_test_elements(T)): + f = _element_setters[T] + check_status(A, f(A[0], *args)) + data = matrix.serialize(A) + B = matrix.deserialize(data) + + # Test equal + C = matrix.new(lib.GrB_BOOL, 2, 2) + check_status( + C, + lib.GrB_Matrix_eWiseAdd_BinaryOp(C[0], NULL, NULL, _eq_ops[T], A[0], B[0], NULL), + ) + assert matrix.nvals(A) == matrix.nvals(B) == matrix.nvals(C) + is_eq = ffi.new("bool*") + check_status( + C, + lib.GrB_Matrix_reduce_BOOL(is_eq, NULL, lib.GrB_LAND_MONOID_BOOL, C[0], NULL), + ) + assert is_eq[0] + + +def test_serialize_vector(): + T = lib.GrB_INT64 + v = vector.new(T, 3) + check_status(v, lib.GrB_Vector_setElement_INT64(v[0], 2, 0)) + check_status(v, lib.GrB_Vector_setElement_INT64(v[0], 10, 1)) + data = vector.serialize(v, lib.GxB_COMPRESSION_LZ4HC, level=7) + w = vector.deserialize(data) + + # Test equal + x = vector.new(lib.GrB_BOOL, 3) + check_status( + x, + lib.GrB_Vector_eWiseAdd_BinaryOp(x[0], NULL, NULL, _eq_ops[T], v[0], w[0], NULL), + ) + assert vector.nvals(v) == vector.nvals(w) == vector.nvals(x) + is_eq = ffi.new("bool*") + check_status( + x, + lib.GrB_Vector_reduce_BOOL(is_eq, NULL, lib.GrB_LAND_MONOID_BOOL, x[0], NULL), + ) + assert is_eq[0] + + def test_matrix_binfile_read_write(tmp_path): for opener in (Path.open, gzip.open, bz2.open, lzma.open): for format in (lib.GxB_BY_ROW, lib.GxB_BY_COL): diff --git a/suitesparse_graphblas/vector.py b/suitesparse_graphblas/vector.py index 6d76ad5..16fd707 100644 --- a/suitesparse_graphblas/vector.py +++ b/suitesparse_graphblas/vector.py @@ -1,5 +1,8 @@ from suitesparse_graphblas import check_status, ffi, lib +from .io.serialize import deserialize_vector as deserialize # noqa +from .io.serialize import serialize_vector as serialize # noqa + def free(v): """Free a vector.""" From a62a05935288f243ff133de7d1fb7c6bfa3102c7 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Tue, 21 Jun 2022 14:48:54 -0500 Subject: [PATCH 094/193] Add helper functions to enable and disable BURBLE to print diagnostics. (#45) * Add helper functions to enable and disable BURBLE to print diagnostics. * Change to `burble` as a global object that can be used as a context manager --- suitesparse_graphblas/__init__.py | 84 +++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) diff --git a/suitesparse_graphblas/__init__.py b/suitesparse_graphblas/__init__.py index 7f9bd2f..cc27723 100644 --- a/suitesparse_graphblas/__init__.py +++ b/suitesparse_graphblas/__init__.py @@ -175,4 +175,88 @@ def check_status(obj, response_code): raise _error_code_lookup[response_code](text) +class burble: + """Control diagnostic output, and may be used as a context manager. + + Set up and simple usage: + + >>> from suitesparse_graphblas import burble, lib, matrix + >>> + >>> A = matrix.new(lib.GrB_BOOL, 3, 3) + >>> burble.is_enabled + False + >>> burble.enable() + >>> burble.is_enabled + True + >>> burble.disable() + + Example with explicit enable and disable: + + >>> burble.enable() + >>> n = matrix.nvals(A) + [ GrB_Matrix_nvals + 1.91e-06 sec ] + >>> burble.disable() + + Example as a context manager: + + >>> with burble(): + >>> n = matrix.nvals(A) + [ GrB_Matrix_nvals + 1.91e-06 sec ] + + """ + + def __init__(self): + self._states = [] + + @property + def is_enabled(self): + """Is burble enabled?""" + val_ptr = ffi.new("bool*") + info = lib.GxB_Global_Option_get(lib.GxB_BURBLE, val_ptr) + if info != lib.GrB_SUCCESS: + raise _error_code_lookup[info]( + "Failed to get burble status (has GraphBLAS been initialized?" + ) + return val_ptr[0] + + def enable(self): + """Enable diagnostic output""" + info = lib.GxB_Global_Option_set(lib.GxB_BURBLE, ffi.cast("int", 1)) + if info != lib.GrB_SUCCESS: + raise _error_code_lookup[info]( + "Failed to enable burble (has GraphBLAS been initialized?" + ) + + def disable(self): + """Disable diagnostic output""" + info = lib.GxB_Global_Option_set(lib.GxB_BURBLE, ffi.cast("int", 0)) + if info != lib.GrB_SUCCESS: + raise _error_code_lookup[info]( + "Failed to disable burble (has GraphBLAS been initialized?" + ) + + def __enter__(self): + is_enabled = self.is_enabled + if not is_enabled: + self.enable() + self._states.append(is_enabled) + return self + + def __exit__(self, type_, value, traceback): + is_enabled = self._states.pop() + if not is_enabled: + self.disable() + + def __reduce__(self): + return "burble" + + def __repr__(self): + return f"" + + +burble = burble() + + __version__ = _version.get_versions()["version"] From d31ba3a20233cda1f727ed06dbe5cce1d31efffc Mon Sep 17 00:00:00 2001 From: Jim Kitchen Date: Wed, 29 Jun 2022 22:18:43 -0500 Subject: [PATCH 095/193] Update README with renamed python-graphblas (#46) grblas->python-graphblas --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6c30a71..17f7ffa 100644 --- a/README.md +++ b/README.md @@ -11,4 +11,4 @@ Python CFFI Binding around This is a base package that exposes only the low level CFFI API bindings and symbols. This package is shared by the syntax bindings [pygraphblas](https://github.com/Graphegon/pygraphblas) and -[grblas](https://github.com/metagraph-dev/grblas). +[python-graphblas](https://github.com/python-graphblas/python-graphblas). From 17829051794347be9880d8c937c8d39885e8776f Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Tue, 9 Aug 2022 17:40:24 -0500 Subject: [PATCH 096/193] Update to 7.2.0 (#47) * Update to 7.2.0 --- .github/workflows/test.yml | 2 +- suitesparse_graphblas/create_headers.py | 1 + suitesparse_graphblas/io/serialize.py | 16 +++++++++++----- suitesparse_graphblas/suitesparse_graphblas.h | 3 +++ .../suitesparse_graphblas_no_complex.h | 3 +++ 5 files changed, 19 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9132474..c9ab930 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,7 +19,7 @@ jobs: python-version: ["3.8", "3.9", "3.10"] source: ["conda-forge"] # source: ["source"] - graphblas-version: ["7.1.0"] + graphblas-version: ["7.2.0"] steps: - name: Checkout uses: actions/checkout@v2 diff --git a/suitesparse_graphblas/create_headers.py b/suitesparse_graphblas/create_headers.py index e925d94..c586422 100644 --- a/suitesparse_graphblas/create_headers.py +++ b/suitesparse_graphblas/create_headers.py @@ -297,6 +297,7 @@ def groupby(index, seq): "GxB_COMPRESSION_INTEL", "GxB_COMPRESSION_LZ4", "GxB_COMPRESSION_LZ4HC", + "GxB_COMPRESSION_ZSTD", "GxB_COMPRESSION_NONE", } diff --git a/suitesparse_graphblas/io/serialize.py b/suitesparse_graphblas/io/serialize.py index 19e13e0..1a9027b 100644 --- a/suitesparse_graphblas/io/serialize.py +++ b/suitesparse_graphblas/io/serialize.py @@ -22,7 +22,10 @@ def get_serialize_desc(compression=lib.GxB_COMPRESSION_DEFAULT, level=None, nthr if nthreads is not None: check_status(desc, lib.GxB_Desc_set(desc[0], lib.GxB_NTHREADS, ffi.cast("int", nthreads))) if compression is not None: - if level is not None and compression == lib.GxB_COMPRESSION_LZ4HC: + if level is not None and compression in { + lib.GxB_COMPRESSION_LZ4HC, + lib.GxB_COMPRESSION_ZSTD, + }: compression += level check_status( desc, lib.GxB_Desc_set(desc[0], lib.GxB_COMPRESSION, ffi.cast("int", compression)) @@ -37,9 +40,11 @@ def serialize_matrix(A, compression=lib.GxB_COMPRESSION_DEFAULT, level=None, *, ---------- compression : int, optional One of None, GxB_COMPRESSION_NONE, GxB_COMPRESSION_DEFAULT, - GxB_COMPRESSION_LZ4, or GxB_COMPRESSION_LZ4HC + GxB_COMPRESSION_LZ4, GxB_COMPRESSION_LZ4HC, or GxB_COMPRESSION_ZSTD level : int, optional - Used by GxB_COMPRESSION_LZ4HC. Should be between 1 and 9, where 9 is most compressed. + For GxB_COMPRESSION_LZ4HC, should be between 1 and 9, where 9 is most compressed. + For GxB_COMPRESSION_ZSTD, should be between 1 and 19, where 19 is most compressed. + nthreads : int, optional The maximum number of OpenMP threads to use. """ @@ -59,9 +64,10 @@ def serialize_vector(v, compression=lib.GxB_COMPRESSION_DEFAULT, level=None, *, ---------- compression : int, optional One of None, GxB_COMPRESSION_NONE, GxB_COMPRESSION_DEFAULT, - GxB_COMPRESSION_LZ4, or GxB_COMPRESSION_LZ4HC + GxB_COMPRESSION_LZ4, GxB_COMPRESSION_LZ4HC, or GxB_COMPRESSION_ZSTD level : int, optional - Used by GxB_COMPRESSION_LZ4HC. Should be between 1 and 9, where 9 is most compressed. + For GxB_COMPRESSION_LZ4HC, should be between 1 and 9, where 9 is most compressed. + For GxB_COMPRESSION_ZSTD, should be between 1 and 19, where 19 is most compressed. nthreads : int, optional The maximum number of OpenMP threads to use. """ diff --git a/suitesparse_graphblas/suitesparse_graphblas.h b/suitesparse_graphblas/suitesparse_graphblas.h index 926b951..52f2b79 100644 --- a/suitesparse_graphblas/suitesparse_graphblas.h +++ b/suitesparse_graphblas/suitesparse_graphblas.h @@ -3217,6 +3217,8 @@ extern GrB_Info GxB_Matrix_pack_HyperCSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index extern GrB_Info GxB_Matrix_pack_HyperCSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_reduce_FC32(GxB_FC32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_reduce_FC64(GxB_FC64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_reshape(GrB_Matrix C, bool by_col, GrB_Index nrows_new, GrB_Index ncols_new, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_reshapeDup(GrB_Matrix *C, GrB_Matrix A, bool by_col, GrB_Index nrows_new, GrB_Index ncols_new, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_select(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Matrix A, const GrB_Scalar Thunk, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_select_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, GxB_FC32_t y, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_select_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, GxB_FC64_t y, const GrB_Descriptor desc); @@ -3430,6 +3432,7 @@ extern GrB_Info GxB_Vector_unpack_Full(GrB_Vector v, void **vx, GrB_Index *vx_si #define GxB_COMPRESSION_LZ4 ... #define GxB_COMPRESSION_LZ4HC ... #define GxB_COMPRESSION_NONE ... +#define GxB_COMPRESSION_ZSTD ... #define GxB_END ... #define GxB_FAST_IMPORT ... #define GxB_FULL ... diff --git a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h index 850d1fa..6c8475a 100644 --- a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h +++ b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h @@ -3021,6 +3021,8 @@ extern GrB_Info GxB_Matrix_pack_FullC(GrB_Matrix A, void **Ax, GrB_Index Ax_size extern GrB_Info GxB_Matrix_pack_FullR(GrB_Matrix A, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_pack_HyperCSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_pack_HyperCSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_reshape(GrB_Matrix C, bool by_col, GrB_Index nrows_new, GrB_Index ncols_new, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_reshapeDup(GrB_Matrix *C, GrB_Matrix A, bool by_col, GrB_Index nrows_new, GrB_Index ncols_new, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_select(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Matrix A, const GrB_Scalar Thunk, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_serialize(void **blob_handle, GrB_Index *blob_size_handle, GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_sort(GrB_Matrix C, GrB_Matrix P, GrB_BinaryOp op, GrB_Matrix A, const GrB_Descriptor desc); @@ -3198,6 +3200,7 @@ extern GrB_Info GxB_Vector_unpack_Full(GrB_Vector v, void **vx, GrB_Index *vx_si #define GxB_COMPRESSION_LZ4 ... #define GxB_COMPRESSION_LZ4HC ... #define GxB_COMPRESSION_NONE ... +#define GxB_COMPRESSION_ZSTD ... #define GxB_END ... #define GxB_FAST_IMPORT ... #define GxB_FULL ... From d911f2001add0a73011bad1dc763554af532900a Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Tue, 18 Oct 2022 13:31:44 -0500 Subject: [PATCH 097/193] Update to v7.3.0 (#49) * Update to v7.3.0 * Get SuiteSparse:GraphBLAS from conda-forge for CI --- .github/workflows/test.yml | 6 +++--- suitesparse_graphblas/suitesparse_graphblas.h | 2 ++ suitesparse_graphblas/suitesparse_graphblas_no_complex.h | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c9ab930..260c947 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,11 +15,11 @@ jobs: fail-fast: false matrix: os: ["ubuntu-latest", "macos-latest", "windows-latest"] - # os: ["ubuntu-latest"] - python-version: ["3.8", "3.9", "3.10"] source: ["conda-forge"] + # os: ["ubuntu-latest"] # source: ["source"] - graphblas-version: ["7.2.0"] + python-version: ["3.8", "3.9", "3.10"] + graphblas-version: ["7.3.0"] steps: - name: Checkout uses: actions/checkout@v2 diff --git a/suitesparse_graphblas/suitesparse_graphblas.h b/suitesparse_graphblas/suitesparse_graphblas.h index 52f2b79..5de5e6a 100644 --- a/suitesparse_graphblas/suitesparse_graphblas.h +++ b/suitesparse_graphblas/suitesparse_graphblas.h @@ -3256,7 +3256,9 @@ extern GrB_Info GxB_Matrix_unpack_HyperCSR(GrB_Matrix A, GrB_Index **Ap, GrB_Ind extern GrB_Info GxB_Row_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, GrB_Index i, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_diag(GrB_Vector v, const GrB_Matrix A, int64_t k, const GrB_Descriptor desc); extern GrB_Info GxB_colIterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); +extern GrB_Info GxB_pack_HyperHash(GrB_Matrix A, GrB_Matrix *Y, const GrB_Descriptor desc); extern GrB_Info GxB_rowIterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); +extern GrB_Info GxB_unpack_HyperHash(GrB_Matrix A, GrB_Matrix *Y, const GrB_Descriptor desc); /* monoid */ extern GrB_Info GxB_Monoid_fprint(GrB_Monoid monoid, const char *name, GxB_Print_Level pr, FILE *f); diff --git a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h index 6c8475a..f7fbb28 100644 --- a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h +++ b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h @@ -3054,7 +3054,9 @@ extern GrB_Info GxB_Matrix_unpack_HyperCSR(GrB_Matrix A, GrB_Index **Ap, GrB_Ind extern GrB_Info GxB_Row_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, GrB_Index i, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_diag(GrB_Vector v, const GrB_Matrix A, int64_t k, const GrB_Descriptor desc); extern GrB_Info GxB_colIterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); +extern GrB_Info GxB_pack_HyperHash(GrB_Matrix A, GrB_Matrix *Y, const GrB_Descriptor desc); extern GrB_Info GxB_rowIterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); +extern GrB_Info GxB_unpack_HyperHash(GrB_Matrix A, GrB_Matrix *Y, const GrB_Descriptor desc); /* monoid */ extern GrB_Info GxB_Monoid_fprint(GrB_Monoid monoid, const char *name, GxB_Print_Level pr, FILE *f); From 1da287a480bc21fdbb320c01defed868188124a7 Mon Sep 17 00:00:00 2001 From: Jim Kitchen Date: Fri, 28 Oct 2022 14:10:21 -0500 Subject: [PATCH 098/193] Add handling for variadic functions on arm64 (#50) osx-arm64 handles variadic functions differently than x86. cffi doesn't appear to handle this, so a bit of a hack is used to trick cffi into providing varargs in the expected manner for arm64. --- suitesparse_graphblas/__init__.py | 38 +- suitesparse_graphblas/build.py | 4 + suitesparse_graphblas/create_headers.py | 16 +- suitesparse_graphblas/io/binary.py | 1 - suitesparse_graphblas/io/serialize.py | 10 +- suitesparse_graphblas/matrix.py | 34 +- .../suitesparse_graphblas_arm64.h | 3468 +++++++++++++++++ 7 files changed, 3544 insertions(+), 27 deletions(-) create mode 100644 suitesparse_graphblas/suitesparse_graphblas_arm64.h diff --git a/suitesparse_graphblas/__init__.py b/suitesparse_graphblas/__init__.py index cc27723..7569034 100644 --- a/suitesparse_graphblas/__init__.py +++ b/suitesparse_graphblas/__init__.py @@ -3,10 +3,40 @@ from . import utils from ._graphblas import ffi, lib # noqa +import struct +import platform + +_is_osx_arm64 = platform.machine() == "arm64" +_c_float = ffi.typeof("float") +_c_double = ffi.typeof("double") + + +if _is_osx_arm64: + + def vararg(val): + # Interpret float as int32 and double as int64 + # https://devblogs.microsoft.com/oldnewthing/20220823-00/?p=107041 + tov = ffi.typeof(val) + if tov == _c_float: + val = struct.unpack("l", struct.pack("f", val))[0] + val = ffi.cast("int64_t", val) + elif tov == _c_double: + val = struct.unpack("q", struct.pack("d", val))[0] + val = ffi.cast("int64_t", val) + # Cast variadic argument as char * to force it onto the stack where ARM64 expects it + # https://developer.apple.com/documentation/xcode/writing-arm64-code-for-apple-platforms + return ffi.cast("char *", val) + +else: + + def vararg(val): + return val + def is_initialized(): """Is GraphBLAS initialized via GrB_init or GxB_init?""" - return lib.GxB_Global_Option_get(lib.GxB_MODE, ffi.new("GrB_Mode*")) != lib.GrB_PANIC + mode = ffi.new("GrB_Mode*") + return lib.GxB_Global_Option_get(lib.GxB_MODE, vararg(mode)) != lib.GrB_PANIC def supports_complex(): @@ -214,7 +244,7 @@ def __init__(self): def is_enabled(self): """Is burble enabled?""" val_ptr = ffi.new("bool*") - info = lib.GxB_Global_Option_get(lib.GxB_BURBLE, val_ptr) + info = lib.GxB_Global_Option_get(lib.GxB_BURBLE, vararg(val_ptr)) if info != lib.GrB_SUCCESS: raise _error_code_lookup[info]( "Failed to get burble status (has GraphBLAS been initialized?" @@ -223,7 +253,7 @@ def is_enabled(self): def enable(self): """Enable diagnostic output""" - info = lib.GxB_Global_Option_set(lib.GxB_BURBLE, ffi.cast("int", 1)) + info = lib.GxB_Global_Option_set(lib.GxB_BURBLE, vararg(ffi.cast("int", 1))) if info != lib.GrB_SUCCESS: raise _error_code_lookup[info]( "Failed to enable burble (has GraphBLAS been initialized?" @@ -231,7 +261,7 @@ def enable(self): def disable(self): """Disable diagnostic output""" - info = lib.GxB_Global_Option_set(lib.GxB_BURBLE, ffi.cast("int", 0)) + info = lib.GxB_Global_Option_set(lib.GxB_BURBLE, vararg(ffi.cast("int", 0))) if info != lib.GrB_SUCCESS: raise _error_code_lookup[info]( "Failed to disable burble (has GraphBLAS been initialized?" diff --git a/suitesparse_graphblas/build.py b/suitesparse_graphblas/build.py index 9a2df43..e8a18ee 100644 --- a/suitesparse_graphblas/build.py +++ b/suitesparse_graphblas/build.py @@ -1,9 +1,11 @@ import os import sys +import platform from cffi import FFI is_win = sys.platform.startswith("win") +is_arm64 = platform.machine() == "arm64" thisdir = os.path.dirname(__file__) ffibuilder = FFI() @@ -28,6 +30,8 @@ header = "suitesparse_graphblas.h" if is_win: header = "suitesparse_graphblas_no_complex.h" +if is_arm64: + header = "suitesparse_graphblas_arm64.h" gb_cdef = open(os.path.join(thisdir, header)) ffibuilder.cdef(gb_cdef.read()) diff --git a/suitesparse_graphblas/create_headers.py b/suitesparse_graphblas/create_headers.py index c586422..675feda 100644 --- a/suitesparse_graphblas/create_headers.py +++ b/suitesparse_graphblas/create_headers.py @@ -796,6 +796,7 @@ def main(): # final files used by cffi (with and without complex numbers) final_h = os.path.join(thisdir, "suitesparse_graphblas.h") + final_arm64_h = os.path.join(thisdir, "suitesparse_graphblas_arm64.h") final_no_complex_h = os.path.join(thisdir, "suitesparse_graphblas_no_complex.h") source_c = os.path.join(thisdir, "source.c") @@ -823,21 +824,30 @@ def main(): with open(final_h, "w") as f: f.write("\n".join(text)) + # Create final header file (arm64) + # Replace all variadic arguments (...) with "char *" + print(f"Step 4: parse header file to create {final_arm64_h}") + orig_text = text + patt = re.compile(r"^(extern GrB_Info .*\(.*)(\.\.\.)(\);)$") + text = [patt.sub(r"\1char *\3", line) for line in orig_text] + with open(final_arm64_h, "w") as f: + f.write("\n".join(text)) + # Create final header file (no complex) - print(f"Step 4: parse header file to create {final_no_complex_h}") + print(f"Step 5: parse header file to create {final_no_complex_h}") groups_no_complex = parse_header(processed_h, skip_complex=True) text = create_header_text(groups_no_complex) with open(final_no_complex_h, "w") as f: f.write("\n".join(text)) # Create source - print(f"Step 5: create {source_c}") + print(f"Step 6: create {source_c}") text = create_source_text(groups) with open(source_c, "w") as f: f.write("\n".join(text)) # Check defines - print("Step 6: check #define definitions") + print("Step 7: check #define definitions") with open(graphblas_h) as f: text = f.read() define_lines = re.compile(r".*?#define\s+\w+\s+") diff --git a/suitesparse_graphblas/io/binary.py b/suitesparse_graphblas/io/binary.py index 603a291..c3d6d9f 100644 --- a/suitesparse_graphblas/io/binary.py +++ b/suitesparse_graphblas/io/binary.py @@ -124,7 +124,6 @@ def binwrite(A, filename, comments=None, opener=Path.open): typecode = ffinew("int32_t*") matrix_type = ffi.new("GrB_Type*") - sparsity_status = ffinew("int32_t*") nrows[0] = matrix.nrows(A) ncols[0] = matrix.ncols(A) diff --git a/suitesparse_graphblas/io/serialize.py b/suitesparse_graphblas/io/serialize.py index 1a9027b..1755b81 100644 --- a/suitesparse_graphblas/io/serialize.py +++ b/suitesparse_graphblas/io/serialize.py @@ -1,6 +1,6 @@ import numpy as np -from suitesparse_graphblas import check_status, ffi, lib +from suitesparse_graphblas import check_status, ffi, lib, vararg from suitesparse_graphblas.utils import claim_buffer @@ -20,7 +20,10 @@ def get_serialize_desc(compression=lib.GxB_COMPRESSION_DEFAULT, level=None, nthr check_status(desc, lib.GrB_Descriptor_new(desc)) desc = ffi.gc(desc, free_desc) if nthreads is not None: - check_status(desc, lib.GxB_Desc_set(desc[0], lib.GxB_NTHREADS, ffi.cast("int", nthreads))) + check_status( + desc, + lib.GxB_Desc_set(desc[0], lib.GxB_NTHREADS, vararg(ffi.cast("int", nthreads))), + ) if compression is not None: if level is not None and compression in { lib.GxB_COMPRESSION_LZ4HC, @@ -28,7 +31,8 @@ def get_serialize_desc(compression=lib.GxB_COMPRESSION_DEFAULT, level=None, nthr }: compression += level check_status( - desc, lib.GxB_Desc_set(desc[0], lib.GxB_COMPRESSION, ffi.cast("int", compression)) + desc, + lib.GxB_Desc_set(desc[0], lib.GxB_COMPRESSION, vararg(ffi.cast("int", compression))), ) return desc diff --git a/suitesparse_graphblas/matrix.py b/suitesparse_graphblas/matrix.py index b337b87..0e62040 100644 --- a/suitesparse_graphblas/matrix.py +++ b/suitesparse_graphblas/matrix.py @@ -1,4 +1,4 @@ -from suitesparse_graphblas import check_status, ffi, lib +from suitesparse_graphblas import check_status, ffi, lib, vararg from .io.serialize import deserialize_matrix as deserialize # noqa from .io.serialize import serialize_matrix as serialize # noqa @@ -109,7 +109,7 @@ def format(A): """ format = ffi.new("GxB_Format_Value*") - check_status(A, lib.GxB_Matrix_Option_get(A[0], lib.GxB_FORMAT, format)) + check_status(A, lib.GxB_Matrix_Option_get(A[0], lib.GxB_FORMAT, vararg(format))) return format[0] @@ -122,58 +122,60 @@ def set_format(A, format): True """ - check_status( - A, lib.GxB_Matrix_Option_set(A[0], lib.GxB_FORMAT, ffi.cast("GxB_Format_Value", format)) - ) + format_val = ffi.cast("GxB_Format_Value", format) + check_status(A, lib.GxB_Matrix_Option_set(A[0], lib.GxB_FORMAT, vararg(format_val))) def sparsity_status(A): """Get the sparsity status of the matrix.""" sparsity_status = ffi.new("int32_t*") - check_status(A, lib.GxB_Matrix_Option_get(A[0], lib.GxB_SPARSITY_STATUS, sparsity_status)) + check_status( + A, lib.GxB_Matrix_Option_get(A[0], lib.GxB_SPARSITY_STATUS, vararg(sparsity_status)) + ) return sparsity_status[0] def sparsity_control(A): """Get the sparsity control of the matrix.""" sparsity_control = ffi.new("int32_t*") - check_status(A, lib.GxB_Matrix_Option_get(A[0], lib.GxB_SPARSITY_CONTROL, sparsity_control)) + check_status( + A, lib.GxB_Matrix_Option_get(A[0], lib.GxB_SPARSITY_CONTROL, vararg(sparsity_control)) + ) return sparsity_control[0] def set_sparsity_control(A, sparsity): """Set the sparsity control of the matrix.""" + sparsity_control = ffi.cast("int32_t", sparsity) check_status( - A, lib.GxB_Matrix_Option_set(A[0], lib.GxB_SPARSITY_CONTROL, ffi.cast("int", sparsity)) + A, lib.GxB_Matrix_Option_set(A[0], lib.GxB_SPARSITY_CONTROL, vararg(sparsity_control)) ) def hyper_switch(A): """Get the hyper switch of the matrix.""" hyper_switch = ffi.new("double*") - check_status(A, lib.GxB_Matrix_Option_get(A[0], lib.GxB_HYPER_SWITCH, hyper_switch)) + check_status(A, lib.GxB_Matrix_Option_get(A[0], lib.GxB_HYPER_SWITCH, vararg(hyper_switch))) return hyper_switch[0] def set_hyper_switch(A, hyper_switch): """Set the hyper switch of the matrix.""" - check_status( - A, lib.GxB_Matrix_Option_set(A[0], lib.GxB_HYPER_SWITCH, ffi.cast("double", hyper_switch)) - ) + hyper_switch = ffi.cast("double", hyper_switch) + check_status(A, lib.GxB_Matrix_Option_set(A[0], lib.GxB_HYPER_SWITCH, vararg(hyper_switch))) def bitmap_switch(A): """Get the bitmap switch of the matrix.""" bitmap_switch = ffi.new("double*") - check_status(A, lib.GxB_Matrix_Option_get(A[0], lib.GxB_BITMAP_SWITCH, bitmap_switch)) + check_status(A, lib.GxB_Matrix_Option_get(A[0], lib.GxB_BITMAP_SWITCH, vararg(bitmap_switch))) return bitmap_switch[0] def set_bitmap_switch(A, bitmap_switch): """Set the bitmap switch of the matrix.""" - check_status( - A, lib.GxB_Matrix_Option_set(A[0], lib.GxB_BITMAP_SWITCH, ffi.cast("double", bitmap_switch)) - ) + bitmap_switch = ffi.cast("double", bitmap_switch) + check_status(A, lib.GxB_Matrix_Option_set(A[0], lib.GxB_BITMAP_SWITCH, vararg(bitmap_switch))) def set_bool(A, value, i, j): diff --git a/suitesparse_graphblas/suitesparse_graphblas_arm64.h b/suitesparse_graphblas/suitesparse_graphblas_arm64.h new file mode 100644 index 0000000..887b5d9 --- /dev/null +++ b/suitesparse_graphblas/suitesparse_graphblas_arm64.h @@ -0,0 +1,3468 @@ +/* This file is automatically generated */ +/* GrB typedefs */ +typedef struct GB_BinaryOp_opaque *GrB_BinaryOp; +typedef struct GB_Descriptor_opaque *GrB_Descriptor; +typedef struct GB_IndexUnaryOp_opaque *GrB_IndexUnaryOp; +typedef struct GB_Matrix_opaque *GrB_Matrix; +typedef struct GB_Monoid_opaque *GrB_Monoid; +typedef struct GB_Scalar_opaque *GrB_Scalar; +typedef struct GB_Semiring_opaque *GrB_Semiring; +typedef struct GB_Type_opaque *GrB_Type; +typedef struct GB_UnaryOp_opaque *GrB_UnaryOp; +typedef struct GB_Vector_opaque *GrB_Vector; +typedef uint64_t GrB_Index; + +/* GxB typedefs */ +typedef double _Complex GxB_FC64_t; +typedef float _Complex GxB_FC32_t; +typedef struct GB_Iterator_opaque *GxB_Iterator; +typedef struct GB_Scalar_opaque *GxB_Scalar; +typedef struct GB_SelectOp_opaque *GxB_SelectOp; + +/* GxB typedefs (functions) */ +typedef bool (*GxB_select_function)(GrB_Index i, GrB_Index j, const void *x, const void *thunk); +typedef void (*GxB_binary_function)(void *, const void *, const void *); +typedef void (*GxB_index_unary_function)(void *z, const void *x, GrB_Index i, GrB_Index j, const void *y); +typedef void (*GxB_unary_function)(void *, const void *); + +/* GrB enums */ +typedef enum +{ + GrB_OUTP = 0, + GrB_MASK = 1, + GrB_INP0 = 2, + GrB_INP1 = 3, + GxB_DESCRIPTOR_NTHREADS = 5, + GxB_DESCRIPTOR_CHUNK = 7, + GxB_DESCRIPTOR_GPU_CONTROL = 21, + GxB_DESCRIPTOR_GPU_CHUNK = 22, + GxB_AxB_METHOD = 1000, + GxB_SORT = 35, + GxB_COMPRESSION = 36, + GxB_IMPORT = 37 +} GrB_Desc_Field; + +typedef enum +{ + GxB_DEFAULT = 0, + GrB_REPLACE = 1, + GrB_COMP = 2, + GrB_STRUCTURE = 4, + GrB_TRAN = 3, + GxB_GPU_ALWAYS = 2001, + GxB_GPU_NEVER = 2002, + GxB_AxB_GUSTAVSON = 1001, + GxB_AxB_DOT = 1003, + GxB_AxB_HASH = 1004, + GxB_AxB_SAXPY = 1005, + GxB_SECURE_IMPORT = 502 +} GrB_Desc_Value; + +typedef enum +{ + GrB_CSR_FORMAT = 0, + GrB_CSC_FORMAT = 1, + GrB_COO_FORMAT = 2 +} GrB_Format; + +typedef enum +{ + GrB_SUCCESS = 0, + GrB_NO_VALUE = 1, + GxB_EXHAUSTED = 2, + GrB_UNINITIALIZED_OBJECT = -1, + GrB_NULL_POINTER = -2, + GrB_INVALID_VALUE = -3, + GrB_INVALID_INDEX = -4, + GrB_DOMAIN_MISMATCH = -5, + GrB_DIMENSION_MISMATCH = -6, + GrB_OUTPUT_NOT_EMPTY = -7, + GrB_NOT_IMPLEMENTED = -8, + GrB_PANIC = -101, + GrB_OUT_OF_MEMORY = -102, + GrB_INSUFFICIENT_SPACE = -103, + GrB_INVALID_OBJECT = -104, + GrB_INDEX_OUT_OF_BOUNDS = -105, + GrB_EMPTY_OBJECT = -106 +} GrB_Info; + +typedef enum +{ + GrB_NONBLOCKING = 0, + GrB_BLOCKING = 1, + GxB_NONBLOCKING_GPU = 2, + GxB_BLOCKING_GPU = 3 +} GrB_Mode; + +typedef enum +{ + GrB_COMPLETE = 0, + GrB_MATERIALIZE = 1 +} GrB_WaitMode; + +/* GxB enums */ +typedef enum +{ + GxB_BY_ROW = 0, + GxB_BY_COL = 1, + GxB_NO_FORMAT = -1 +} GxB_Format_Value; + +typedef enum +{ + GxB_HYPER_SWITCH = 0, + GxB_BITMAP_SWITCH = 34, + GxB_FORMAT = 1, + GxB_MODE = 2, + GxB_LIBRARY_NAME = 8, + GxB_LIBRARY_VERSION = 9, + GxB_LIBRARY_DATE = 10, + GxB_LIBRARY_ABOUT = 11, + GxB_LIBRARY_URL = 12, + GxB_LIBRARY_LICENSE = 13, + GxB_LIBRARY_COMPILE_DATE = 14, + GxB_LIBRARY_COMPILE_TIME = 15, + GxB_API_VERSION = 16, + GxB_API_DATE = 17, + GxB_API_ABOUT = 18, + GxB_API_URL = 19, + GxB_COMPILER_VERSION = 23, + GxB_COMPILER_NAME = 24, + GxB_GLOBAL_NTHREADS = 5, + GxB_GLOBAL_CHUNK = 7, + GxB_BURBLE = 99, + GxB_PRINTF = 101, + GxB_FLUSH = 102, + GxB_MEMORY_POOL = 103, + GxB_PRINT_1BASED = 104, + GxB_SPARSITY_STATUS = 33, + GxB_SPARSITY_CONTROL = 32, + GxB_GLOBAL_GPU_CONTROL = 21, + GxB_GLOBAL_GPU_CHUNK = 22 +} GxB_Option_Field; + +typedef enum +{ + GxB_SILENT = 0, + GxB_SUMMARY = 1, + GxB_SHORT = 2, + GxB_COMPLETE = 3, + GxB_SHORT_VERBOSE = 4, + GxB_COMPLETE_VERBOSE = 5 +} GxB_Print_Level; + +/* GrB consts */ +extern const uint64_t *GrB_ALL; + +/* GxB consts */ +extern const GxB_Format_Value GxB_FORMAT_DEFAULT; +extern const double GxB_ALWAYS_HYPER; +extern const double GxB_HYPER_DEFAULT; +extern const double GxB_NEVER_HYPER; + +/* GrB objects */ +extern GrB_BinaryOp GrB_BAND_INT8; +extern GrB_BinaryOp GrB_BAND_INT16; +extern GrB_BinaryOp GrB_BAND_INT32; +extern GrB_BinaryOp GrB_BAND_INT64; +extern GrB_BinaryOp GrB_BAND_UINT8; +extern GrB_BinaryOp GrB_BAND_UINT16; +extern GrB_BinaryOp GrB_BAND_UINT32; +extern GrB_BinaryOp GrB_BAND_UINT64; +extern GrB_BinaryOp GrB_BOR_INT8; +extern GrB_BinaryOp GrB_BOR_INT16; +extern GrB_BinaryOp GrB_BOR_INT32; +extern GrB_BinaryOp GrB_BOR_INT64; +extern GrB_BinaryOp GrB_BOR_UINT8; +extern GrB_BinaryOp GrB_BOR_UINT16; +extern GrB_BinaryOp GrB_BOR_UINT32; +extern GrB_BinaryOp GrB_BOR_UINT64; +extern GrB_BinaryOp GrB_BXNOR_INT8; +extern GrB_BinaryOp GrB_BXNOR_INT16; +extern GrB_BinaryOp GrB_BXNOR_INT32; +extern GrB_BinaryOp GrB_BXNOR_INT64; +extern GrB_BinaryOp GrB_BXNOR_UINT8; +extern GrB_BinaryOp GrB_BXNOR_UINT16; +extern GrB_BinaryOp GrB_BXNOR_UINT32; +extern GrB_BinaryOp GrB_BXNOR_UINT64; +extern GrB_BinaryOp GrB_BXOR_INT8; +extern GrB_BinaryOp GrB_BXOR_INT16; +extern GrB_BinaryOp GrB_BXOR_INT32; +extern GrB_BinaryOp GrB_BXOR_INT64; +extern GrB_BinaryOp GrB_BXOR_UINT8; +extern GrB_BinaryOp GrB_BXOR_UINT16; +extern GrB_BinaryOp GrB_BXOR_UINT32; +extern GrB_BinaryOp GrB_BXOR_UINT64; +extern GrB_BinaryOp GrB_DIV_BOOL; +extern GrB_BinaryOp GrB_DIV_FP32; +extern GrB_BinaryOp GrB_DIV_FP64; +extern GrB_BinaryOp GrB_DIV_INT8; +extern GrB_BinaryOp GrB_DIV_INT16; +extern GrB_BinaryOp GrB_DIV_INT32; +extern GrB_BinaryOp GrB_DIV_INT64; +extern GrB_BinaryOp GrB_DIV_UINT8; +extern GrB_BinaryOp GrB_DIV_UINT16; +extern GrB_BinaryOp GrB_DIV_UINT32; +extern GrB_BinaryOp GrB_DIV_UINT64; +extern GrB_BinaryOp GrB_EQ_BOOL; +extern GrB_BinaryOp GrB_EQ_FP32; +extern GrB_BinaryOp GrB_EQ_FP64; +extern GrB_BinaryOp GrB_EQ_INT8; +extern GrB_BinaryOp GrB_EQ_INT16; +extern GrB_BinaryOp GrB_EQ_INT32; +extern GrB_BinaryOp GrB_EQ_INT64; +extern GrB_BinaryOp GrB_EQ_UINT8; +extern GrB_BinaryOp GrB_EQ_UINT16; +extern GrB_BinaryOp GrB_EQ_UINT32; +extern GrB_BinaryOp GrB_EQ_UINT64; +extern GrB_BinaryOp GrB_FIRST_BOOL; +extern GrB_BinaryOp GrB_FIRST_FP32; +extern GrB_BinaryOp GrB_FIRST_FP64; +extern GrB_BinaryOp GrB_FIRST_INT8; +extern GrB_BinaryOp GrB_FIRST_INT16; +extern GrB_BinaryOp GrB_FIRST_INT32; +extern GrB_BinaryOp GrB_FIRST_INT64; +extern GrB_BinaryOp GrB_FIRST_UINT8; +extern GrB_BinaryOp GrB_FIRST_UINT16; +extern GrB_BinaryOp GrB_FIRST_UINT32; +extern GrB_BinaryOp GrB_FIRST_UINT64; +extern GrB_BinaryOp GrB_GE_BOOL; +extern GrB_BinaryOp GrB_GE_FP32; +extern GrB_BinaryOp GrB_GE_FP64; +extern GrB_BinaryOp GrB_GE_INT8; +extern GrB_BinaryOp GrB_GE_INT16; +extern GrB_BinaryOp GrB_GE_INT32; +extern GrB_BinaryOp GrB_GE_INT64; +extern GrB_BinaryOp GrB_GE_UINT8; +extern GrB_BinaryOp GrB_GE_UINT16; +extern GrB_BinaryOp GrB_GE_UINT32; +extern GrB_BinaryOp GrB_GE_UINT64; +extern GrB_BinaryOp GrB_GT_BOOL; +extern GrB_BinaryOp GrB_GT_FP32; +extern GrB_BinaryOp GrB_GT_FP64; +extern GrB_BinaryOp GrB_GT_INT8; +extern GrB_BinaryOp GrB_GT_INT16; +extern GrB_BinaryOp GrB_GT_INT32; +extern GrB_BinaryOp GrB_GT_INT64; +extern GrB_BinaryOp GrB_GT_UINT8; +extern GrB_BinaryOp GrB_GT_UINT16; +extern GrB_BinaryOp GrB_GT_UINT32; +extern GrB_BinaryOp GrB_GT_UINT64; +extern GrB_BinaryOp GrB_LAND; +extern GrB_BinaryOp GrB_LE_BOOL; +extern GrB_BinaryOp GrB_LE_FP32; +extern GrB_BinaryOp GrB_LE_FP64; +extern GrB_BinaryOp GrB_LE_INT8; +extern GrB_BinaryOp GrB_LE_INT16; +extern GrB_BinaryOp GrB_LE_INT32; +extern GrB_BinaryOp GrB_LE_INT64; +extern GrB_BinaryOp GrB_LE_UINT8; +extern GrB_BinaryOp GrB_LE_UINT16; +extern GrB_BinaryOp GrB_LE_UINT32; +extern GrB_BinaryOp GrB_LE_UINT64; +extern GrB_BinaryOp GrB_LOR; +extern GrB_BinaryOp GrB_LT_BOOL; +extern GrB_BinaryOp GrB_LT_FP32; +extern GrB_BinaryOp GrB_LT_FP64; +extern GrB_BinaryOp GrB_LT_INT8; +extern GrB_BinaryOp GrB_LT_INT16; +extern GrB_BinaryOp GrB_LT_INT32; +extern GrB_BinaryOp GrB_LT_INT64; +extern GrB_BinaryOp GrB_LT_UINT8; +extern GrB_BinaryOp GrB_LT_UINT16; +extern GrB_BinaryOp GrB_LT_UINT32; +extern GrB_BinaryOp GrB_LT_UINT64; +extern GrB_BinaryOp GrB_LXNOR; +extern GrB_BinaryOp GrB_LXOR; +extern GrB_BinaryOp GrB_MAX_BOOL; +extern GrB_BinaryOp GrB_MAX_FP32; +extern GrB_BinaryOp GrB_MAX_FP64; +extern GrB_BinaryOp GrB_MAX_INT8; +extern GrB_BinaryOp GrB_MAX_INT16; +extern GrB_BinaryOp GrB_MAX_INT32; +extern GrB_BinaryOp GrB_MAX_INT64; +extern GrB_BinaryOp GrB_MAX_UINT8; +extern GrB_BinaryOp GrB_MAX_UINT16; +extern GrB_BinaryOp GrB_MAX_UINT32; +extern GrB_BinaryOp GrB_MAX_UINT64; +extern GrB_BinaryOp GrB_MINUS_BOOL; +extern GrB_BinaryOp GrB_MINUS_FP32; +extern GrB_BinaryOp GrB_MINUS_FP64; +extern GrB_BinaryOp GrB_MINUS_INT8; +extern GrB_BinaryOp GrB_MINUS_INT16; +extern GrB_BinaryOp GrB_MINUS_INT32; +extern GrB_BinaryOp GrB_MINUS_INT64; +extern GrB_BinaryOp GrB_MINUS_UINT8; +extern GrB_BinaryOp GrB_MINUS_UINT16; +extern GrB_BinaryOp GrB_MINUS_UINT32; +extern GrB_BinaryOp GrB_MINUS_UINT64; +extern GrB_BinaryOp GrB_MIN_BOOL; +extern GrB_BinaryOp GrB_MIN_FP32; +extern GrB_BinaryOp GrB_MIN_FP64; +extern GrB_BinaryOp GrB_MIN_INT8; +extern GrB_BinaryOp GrB_MIN_INT16; +extern GrB_BinaryOp GrB_MIN_INT32; +extern GrB_BinaryOp GrB_MIN_INT64; +extern GrB_BinaryOp GrB_MIN_UINT8; +extern GrB_BinaryOp GrB_MIN_UINT16; +extern GrB_BinaryOp GrB_MIN_UINT32; +extern GrB_BinaryOp GrB_MIN_UINT64; +extern GrB_BinaryOp GrB_NE_BOOL; +extern GrB_BinaryOp GrB_NE_FP32; +extern GrB_BinaryOp GrB_NE_FP64; +extern GrB_BinaryOp GrB_NE_INT8; +extern GrB_BinaryOp GrB_NE_INT16; +extern GrB_BinaryOp GrB_NE_INT32; +extern GrB_BinaryOp GrB_NE_INT64; +extern GrB_BinaryOp GrB_NE_UINT8; +extern GrB_BinaryOp GrB_NE_UINT16; +extern GrB_BinaryOp GrB_NE_UINT32; +extern GrB_BinaryOp GrB_NE_UINT64; +extern GrB_BinaryOp GrB_ONEB_BOOL; +extern GrB_BinaryOp GrB_ONEB_FP32; +extern GrB_BinaryOp GrB_ONEB_FP64; +extern GrB_BinaryOp GrB_ONEB_INT8; +extern GrB_BinaryOp GrB_ONEB_INT16; +extern GrB_BinaryOp GrB_ONEB_INT32; +extern GrB_BinaryOp GrB_ONEB_INT64; +extern GrB_BinaryOp GrB_ONEB_UINT8; +extern GrB_BinaryOp GrB_ONEB_UINT16; +extern GrB_BinaryOp GrB_ONEB_UINT32; +extern GrB_BinaryOp GrB_ONEB_UINT64; +extern GrB_BinaryOp GrB_PLUS_BOOL; +extern GrB_BinaryOp GrB_PLUS_FP32; +extern GrB_BinaryOp GrB_PLUS_FP64; +extern GrB_BinaryOp GrB_PLUS_INT8; +extern GrB_BinaryOp GrB_PLUS_INT16; +extern GrB_BinaryOp GrB_PLUS_INT32; +extern GrB_BinaryOp GrB_PLUS_INT64; +extern GrB_BinaryOp GrB_PLUS_UINT8; +extern GrB_BinaryOp GrB_PLUS_UINT16; +extern GrB_BinaryOp GrB_PLUS_UINT32; +extern GrB_BinaryOp GrB_PLUS_UINT64; +extern GrB_BinaryOp GrB_SECOND_BOOL; +extern GrB_BinaryOp GrB_SECOND_FP32; +extern GrB_BinaryOp GrB_SECOND_FP64; +extern GrB_BinaryOp GrB_SECOND_INT8; +extern GrB_BinaryOp GrB_SECOND_INT16; +extern GrB_BinaryOp GrB_SECOND_INT32; +extern GrB_BinaryOp GrB_SECOND_INT64; +extern GrB_BinaryOp GrB_SECOND_UINT8; +extern GrB_BinaryOp GrB_SECOND_UINT16; +extern GrB_BinaryOp GrB_SECOND_UINT32; +extern GrB_BinaryOp GrB_SECOND_UINT64; +extern GrB_BinaryOp GrB_TIMES_BOOL; +extern GrB_BinaryOp GrB_TIMES_FP32; +extern GrB_BinaryOp GrB_TIMES_FP64; +extern GrB_BinaryOp GrB_TIMES_INT8; +extern GrB_BinaryOp GrB_TIMES_INT16; +extern GrB_BinaryOp GrB_TIMES_INT32; +extern GrB_BinaryOp GrB_TIMES_INT64; +extern GrB_BinaryOp GrB_TIMES_UINT8; +extern GrB_BinaryOp GrB_TIMES_UINT16; +extern GrB_BinaryOp GrB_TIMES_UINT32; +extern GrB_BinaryOp GrB_TIMES_UINT64; +extern GrB_Descriptor GrB_DESC_C; +extern GrB_Descriptor GrB_DESC_CT0; +extern GrB_Descriptor GrB_DESC_CT0T1; +extern GrB_Descriptor GrB_DESC_CT1; +extern GrB_Descriptor GrB_DESC_R; +extern GrB_Descriptor GrB_DESC_RC; +extern GrB_Descriptor GrB_DESC_RCT0; +extern GrB_Descriptor GrB_DESC_RCT0T1; +extern GrB_Descriptor GrB_DESC_RCT1; +extern GrB_Descriptor GrB_DESC_RS; +extern GrB_Descriptor GrB_DESC_RSC; +extern GrB_Descriptor GrB_DESC_RSCT0; +extern GrB_Descriptor GrB_DESC_RSCT0T1; +extern GrB_Descriptor GrB_DESC_RSCT1; +extern GrB_Descriptor GrB_DESC_RST0; +extern GrB_Descriptor GrB_DESC_RST0T1; +extern GrB_Descriptor GrB_DESC_RST1; +extern GrB_Descriptor GrB_DESC_RT0; +extern GrB_Descriptor GrB_DESC_RT0T1; +extern GrB_Descriptor GrB_DESC_RT1; +extern GrB_Descriptor GrB_DESC_S; +extern GrB_Descriptor GrB_DESC_SC; +extern GrB_Descriptor GrB_DESC_SCT0; +extern GrB_Descriptor GrB_DESC_SCT0T1; +extern GrB_Descriptor GrB_DESC_SCT1; +extern GrB_Descriptor GrB_DESC_ST0; +extern GrB_Descriptor GrB_DESC_ST0T1; +extern GrB_Descriptor GrB_DESC_ST1; +extern GrB_Descriptor GrB_DESC_T0; +extern GrB_Descriptor GrB_DESC_T0T1; +extern GrB_Descriptor GrB_DESC_T1; +extern GrB_IndexUnaryOp GrB_COLGT; +extern GrB_IndexUnaryOp GrB_COLINDEX_INT32; +extern GrB_IndexUnaryOp GrB_COLINDEX_INT64; +extern GrB_IndexUnaryOp GrB_COLLE; +extern GrB_IndexUnaryOp GrB_DIAG; +extern GrB_IndexUnaryOp GrB_DIAGINDEX_INT32; +extern GrB_IndexUnaryOp GrB_DIAGINDEX_INT64; +extern GrB_IndexUnaryOp GrB_OFFDIAG; +extern GrB_IndexUnaryOp GrB_ROWGT; +extern GrB_IndexUnaryOp GrB_ROWINDEX_INT32; +extern GrB_IndexUnaryOp GrB_ROWINDEX_INT64; +extern GrB_IndexUnaryOp GrB_ROWLE; +extern GrB_IndexUnaryOp GrB_TRIL; +extern GrB_IndexUnaryOp GrB_TRIU; +extern GrB_IndexUnaryOp GrB_VALUEEQ_BOOL; +extern GrB_IndexUnaryOp GrB_VALUEEQ_FP32; +extern GrB_IndexUnaryOp GrB_VALUEEQ_FP64; +extern GrB_IndexUnaryOp GrB_VALUEEQ_INT8; +extern GrB_IndexUnaryOp GrB_VALUEEQ_INT16; +extern GrB_IndexUnaryOp GrB_VALUEEQ_INT32; +extern GrB_IndexUnaryOp GrB_VALUEEQ_INT64; +extern GrB_IndexUnaryOp GrB_VALUEEQ_UINT8; +extern GrB_IndexUnaryOp GrB_VALUEEQ_UINT16; +extern GrB_IndexUnaryOp GrB_VALUEEQ_UINT32; +extern GrB_IndexUnaryOp GrB_VALUEEQ_UINT64; +extern GrB_IndexUnaryOp GrB_VALUEGE_BOOL; +extern GrB_IndexUnaryOp GrB_VALUEGE_FP32; +extern GrB_IndexUnaryOp GrB_VALUEGE_FP64; +extern GrB_IndexUnaryOp GrB_VALUEGE_INT8; +extern GrB_IndexUnaryOp GrB_VALUEGE_INT16; +extern GrB_IndexUnaryOp GrB_VALUEGE_INT32; +extern GrB_IndexUnaryOp GrB_VALUEGE_INT64; +extern GrB_IndexUnaryOp GrB_VALUEGE_UINT8; +extern GrB_IndexUnaryOp GrB_VALUEGE_UINT16; +extern GrB_IndexUnaryOp GrB_VALUEGE_UINT32; +extern GrB_IndexUnaryOp GrB_VALUEGE_UINT64; +extern GrB_IndexUnaryOp GrB_VALUEGT_BOOL; +extern GrB_IndexUnaryOp GrB_VALUEGT_FP32; +extern GrB_IndexUnaryOp GrB_VALUEGT_FP64; +extern GrB_IndexUnaryOp GrB_VALUEGT_INT8; +extern GrB_IndexUnaryOp GrB_VALUEGT_INT16; +extern GrB_IndexUnaryOp GrB_VALUEGT_INT32; +extern GrB_IndexUnaryOp GrB_VALUEGT_INT64; +extern GrB_IndexUnaryOp GrB_VALUEGT_UINT8; +extern GrB_IndexUnaryOp GrB_VALUEGT_UINT16; +extern GrB_IndexUnaryOp GrB_VALUEGT_UINT32; +extern GrB_IndexUnaryOp GrB_VALUEGT_UINT64; +extern GrB_IndexUnaryOp GrB_VALUELE_BOOL; +extern GrB_IndexUnaryOp GrB_VALUELE_FP32; +extern GrB_IndexUnaryOp GrB_VALUELE_FP64; +extern GrB_IndexUnaryOp GrB_VALUELE_INT8; +extern GrB_IndexUnaryOp GrB_VALUELE_INT16; +extern GrB_IndexUnaryOp GrB_VALUELE_INT32; +extern GrB_IndexUnaryOp GrB_VALUELE_INT64; +extern GrB_IndexUnaryOp GrB_VALUELE_UINT8; +extern GrB_IndexUnaryOp GrB_VALUELE_UINT16; +extern GrB_IndexUnaryOp GrB_VALUELE_UINT32; +extern GrB_IndexUnaryOp GrB_VALUELE_UINT64; +extern GrB_IndexUnaryOp GrB_VALUELT_BOOL; +extern GrB_IndexUnaryOp GrB_VALUELT_FP32; +extern GrB_IndexUnaryOp GrB_VALUELT_FP64; +extern GrB_IndexUnaryOp GrB_VALUELT_INT8; +extern GrB_IndexUnaryOp GrB_VALUELT_INT16; +extern GrB_IndexUnaryOp GrB_VALUELT_INT32; +extern GrB_IndexUnaryOp GrB_VALUELT_INT64; +extern GrB_IndexUnaryOp GrB_VALUELT_UINT8; +extern GrB_IndexUnaryOp GrB_VALUELT_UINT16; +extern GrB_IndexUnaryOp GrB_VALUELT_UINT32; +extern GrB_IndexUnaryOp GrB_VALUELT_UINT64; +extern GrB_IndexUnaryOp GrB_VALUENE_BOOL; +extern GrB_IndexUnaryOp GrB_VALUENE_FP32; +extern GrB_IndexUnaryOp GrB_VALUENE_FP64; +extern GrB_IndexUnaryOp GrB_VALUENE_INT8; +extern GrB_IndexUnaryOp GrB_VALUENE_INT16; +extern GrB_IndexUnaryOp GrB_VALUENE_INT32; +extern GrB_IndexUnaryOp GrB_VALUENE_INT64; +extern GrB_IndexUnaryOp GrB_VALUENE_UINT8; +extern GrB_IndexUnaryOp GrB_VALUENE_UINT16; +extern GrB_IndexUnaryOp GrB_VALUENE_UINT32; +extern GrB_IndexUnaryOp GrB_VALUENE_UINT64; +extern GrB_Monoid GrB_LAND_MONOID_BOOL; +extern GrB_Monoid GrB_LOR_MONOID_BOOL; +extern GrB_Monoid GrB_LXNOR_MONOID_BOOL; +extern GrB_Monoid GrB_LXOR_MONOID_BOOL; +extern GrB_Monoid GrB_MAX_MONOID_FP32; +extern GrB_Monoid GrB_MAX_MONOID_FP64; +extern GrB_Monoid GrB_MAX_MONOID_INT8; +extern GrB_Monoid GrB_MAX_MONOID_INT16; +extern GrB_Monoid GrB_MAX_MONOID_INT32; +extern GrB_Monoid GrB_MAX_MONOID_INT64; +extern GrB_Monoid GrB_MAX_MONOID_UINT8; +extern GrB_Monoid GrB_MAX_MONOID_UINT16; +extern GrB_Monoid GrB_MAX_MONOID_UINT32; +extern GrB_Monoid GrB_MAX_MONOID_UINT64; +extern GrB_Monoid GrB_MIN_MONOID_FP32; +extern GrB_Monoid GrB_MIN_MONOID_FP64; +extern GrB_Monoid GrB_MIN_MONOID_INT8; +extern GrB_Monoid GrB_MIN_MONOID_INT16; +extern GrB_Monoid GrB_MIN_MONOID_INT32; +extern GrB_Monoid GrB_MIN_MONOID_INT64; +extern GrB_Monoid GrB_MIN_MONOID_UINT8; +extern GrB_Monoid GrB_MIN_MONOID_UINT16; +extern GrB_Monoid GrB_MIN_MONOID_UINT32; +extern GrB_Monoid GrB_MIN_MONOID_UINT64; +extern GrB_Monoid GrB_PLUS_MONOID_FP32; +extern GrB_Monoid GrB_PLUS_MONOID_FP64; +extern GrB_Monoid GrB_PLUS_MONOID_INT8; +extern GrB_Monoid GrB_PLUS_MONOID_INT16; +extern GrB_Monoid GrB_PLUS_MONOID_INT32; +extern GrB_Monoid GrB_PLUS_MONOID_INT64; +extern GrB_Monoid GrB_PLUS_MONOID_UINT8; +extern GrB_Monoid GrB_PLUS_MONOID_UINT16; +extern GrB_Monoid GrB_PLUS_MONOID_UINT32; +extern GrB_Monoid GrB_PLUS_MONOID_UINT64; +extern GrB_Monoid GrB_TIMES_MONOID_FP32; +extern GrB_Monoid GrB_TIMES_MONOID_FP64; +extern GrB_Monoid GrB_TIMES_MONOID_INT8; +extern GrB_Monoid GrB_TIMES_MONOID_INT16; +extern GrB_Monoid GrB_TIMES_MONOID_INT32; +extern GrB_Monoid GrB_TIMES_MONOID_INT64; +extern GrB_Monoid GrB_TIMES_MONOID_UINT8; +extern GrB_Monoid GrB_TIMES_MONOID_UINT16; +extern GrB_Monoid GrB_TIMES_MONOID_UINT32; +extern GrB_Monoid GrB_TIMES_MONOID_UINT64; +extern GrB_Semiring GrB_LAND_LOR_SEMIRING_BOOL; +extern GrB_Semiring GrB_LOR_LAND_SEMIRING_BOOL; +extern GrB_Semiring GrB_LXNOR_LOR_SEMIRING_BOOL; +extern GrB_Semiring GrB_LXOR_LAND_SEMIRING_BOOL; +extern GrB_Semiring GrB_MAX_FIRST_SEMIRING_FP32; +extern GrB_Semiring GrB_MAX_FIRST_SEMIRING_FP64; +extern GrB_Semiring GrB_MAX_FIRST_SEMIRING_INT8; +extern GrB_Semiring GrB_MAX_FIRST_SEMIRING_INT16; +extern GrB_Semiring GrB_MAX_FIRST_SEMIRING_INT32; +extern GrB_Semiring GrB_MAX_FIRST_SEMIRING_INT64; +extern GrB_Semiring GrB_MAX_FIRST_SEMIRING_UINT8; +extern GrB_Semiring GrB_MAX_FIRST_SEMIRING_UINT16; +extern GrB_Semiring GrB_MAX_FIRST_SEMIRING_UINT32; +extern GrB_Semiring GrB_MAX_FIRST_SEMIRING_UINT64; +extern GrB_Semiring GrB_MAX_MIN_SEMIRING_FP32; +extern GrB_Semiring GrB_MAX_MIN_SEMIRING_FP64; +extern GrB_Semiring GrB_MAX_MIN_SEMIRING_INT8; +extern GrB_Semiring GrB_MAX_MIN_SEMIRING_INT16; +extern GrB_Semiring GrB_MAX_MIN_SEMIRING_INT32; +extern GrB_Semiring GrB_MAX_MIN_SEMIRING_INT64; +extern GrB_Semiring GrB_MAX_MIN_SEMIRING_UINT8; +extern GrB_Semiring GrB_MAX_MIN_SEMIRING_UINT16; +extern GrB_Semiring GrB_MAX_MIN_SEMIRING_UINT32; +extern GrB_Semiring GrB_MAX_MIN_SEMIRING_UINT64; +extern GrB_Semiring GrB_MAX_PLUS_SEMIRING_FP32; +extern GrB_Semiring GrB_MAX_PLUS_SEMIRING_FP64; +extern GrB_Semiring GrB_MAX_PLUS_SEMIRING_INT8; +extern GrB_Semiring GrB_MAX_PLUS_SEMIRING_INT16; +extern GrB_Semiring GrB_MAX_PLUS_SEMIRING_INT32; +extern GrB_Semiring GrB_MAX_PLUS_SEMIRING_INT64; +extern GrB_Semiring GrB_MAX_PLUS_SEMIRING_UINT8; +extern GrB_Semiring GrB_MAX_PLUS_SEMIRING_UINT16; +extern GrB_Semiring GrB_MAX_PLUS_SEMIRING_UINT32; +extern GrB_Semiring GrB_MAX_PLUS_SEMIRING_UINT64; +extern GrB_Semiring GrB_MAX_SECOND_SEMIRING_FP32; +extern GrB_Semiring GrB_MAX_SECOND_SEMIRING_FP64; +extern GrB_Semiring GrB_MAX_SECOND_SEMIRING_INT8; +extern GrB_Semiring GrB_MAX_SECOND_SEMIRING_INT16; +extern GrB_Semiring GrB_MAX_SECOND_SEMIRING_INT32; +extern GrB_Semiring GrB_MAX_SECOND_SEMIRING_INT64; +extern GrB_Semiring GrB_MAX_SECOND_SEMIRING_UINT8; +extern GrB_Semiring GrB_MAX_SECOND_SEMIRING_UINT16; +extern GrB_Semiring GrB_MAX_SECOND_SEMIRING_UINT32; +extern GrB_Semiring GrB_MAX_SECOND_SEMIRING_UINT64; +extern GrB_Semiring GrB_MAX_TIMES_SEMIRING_FP32; +extern GrB_Semiring GrB_MAX_TIMES_SEMIRING_FP64; +extern GrB_Semiring GrB_MAX_TIMES_SEMIRING_INT8; +extern GrB_Semiring GrB_MAX_TIMES_SEMIRING_INT16; +extern GrB_Semiring GrB_MAX_TIMES_SEMIRING_INT32; +extern GrB_Semiring GrB_MAX_TIMES_SEMIRING_INT64; +extern GrB_Semiring GrB_MAX_TIMES_SEMIRING_UINT8; +extern GrB_Semiring GrB_MAX_TIMES_SEMIRING_UINT16; +extern GrB_Semiring GrB_MAX_TIMES_SEMIRING_UINT32; +extern GrB_Semiring GrB_MAX_TIMES_SEMIRING_UINT64; +extern GrB_Semiring GrB_MIN_FIRST_SEMIRING_FP32; +extern GrB_Semiring GrB_MIN_FIRST_SEMIRING_FP64; +extern GrB_Semiring GrB_MIN_FIRST_SEMIRING_INT8; +extern GrB_Semiring GrB_MIN_FIRST_SEMIRING_INT16; +extern GrB_Semiring GrB_MIN_FIRST_SEMIRING_INT32; +extern GrB_Semiring GrB_MIN_FIRST_SEMIRING_INT64; +extern GrB_Semiring GrB_MIN_FIRST_SEMIRING_UINT8; +extern GrB_Semiring GrB_MIN_FIRST_SEMIRING_UINT16; +extern GrB_Semiring GrB_MIN_FIRST_SEMIRING_UINT32; +extern GrB_Semiring GrB_MIN_FIRST_SEMIRING_UINT64; +extern GrB_Semiring GrB_MIN_MAX_SEMIRING_FP32; +extern GrB_Semiring GrB_MIN_MAX_SEMIRING_FP64; +extern GrB_Semiring GrB_MIN_MAX_SEMIRING_INT8; +extern GrB_Semiring GrB_MIN_MAX_SEMIRING_INT16; +extern GrB_Semiring GrB_MIN_MAX_SEMIRING_INT32; +extern GrB_Semiring GrB_MIN_MAX_SEMIRING_INT64; +extern GrB_Semiring GrB_MIN_MAX_SEMIRING_UINT8; +extern GrB_Semiring GrB_MIN_MAX_SEMIRING_UINT16; +extern GrB_Semiring GrB_MIN_MAX_SEMIRING_UINT32; +extern GrB_Semiring GrB_MIN_MAX_SEMIRING_UINT64; +extern GrB_Semiring GrB_MIN_PLUS_SEMIRING_FP32; +extern GrB_Semiring GrB_MIN_PLUS_SEMIRING_FP64; +extern GrB_Semiring GrB_MIN_PLUS_SEMIRING_INT8; +extern GrB_Semiring GrB_MIN_PLUS_SEMIRING_INT16; +extern GrB_Semiring GrB_MIN_PLUS_SEMIRING_INT32; +extern GrB_Semiring GrB_MIN_PLUS_SEMIRING_INT64; +extern GrB_Semiring GrB_MIN_PLUS_SEMIRING_UINT8; +extern GrB_Semiring GrB_MIN_PLUS_SEMIRING_UINT16; +extern GrB_Semiring GrB_MIN_PLUS_SEMIRING_UINT32; +extern GrB_Semiring GrB_MIN_PLUS_SEMIRING_UINT64; +extern GrB_Semiring GrB_MIN_SECOND_SEMIRING_FP32; +extern GrB_Semiring GrB_MIN_SECOND_SEMIRING_FP64; +extern GrB_Semiring GrB_MIN_SECOND_SEMIRING_INT8; +extern GrB_Semiring GrB_MIN_SECOND_SEMIRING_INT16; +extern GrB_Semiring GrB_MIN_SECOND_SEMIRING_INT32; +extern GrB_Semiring GrB_MIN_SECOND_SEMIRING_INT64; +extern GrB_Semiring GrB_MIN_SECOND_SEMIRING_UINT8; +extern GrB_Semiring GrB_MIN_SECOND_SEMIRING_UINT16; +extern GrB_Semiring GrB_MIN_SECOND_SEMIRING_UINT32; +extern GrB_Semiring GrB_MIN_SECOND_SEMIRING_UINT64; +extern GrB_Semiring GrB_MIN_TIMES_SEMIRING_FP32; +extern GrB_Semiring GrB_MIN_TIMES_SEMIRING_FP64; +extern GrB_Semiring GrB_MIN_TIMES_SEMIRING_INT8; +extern GrB_Semiring GrB_MIN_TIMES_SEMIRING_INT16; +extern GrB_Semiring GrB_MIN_TIMES_SEMIRING_INT32; +extern GrB_Semiring GrB_MIN_TIMES_SEMIRING_INT64; +extern GrB_Semiring GrB_MIN_TIMES_SEMIRING_UINT8; +extern GrB_Semiring GrB_MIN_TIMES_SEMIRING_UINT16; +extern GrB_Semiring GrB_MIN_TIMES_SEMIRING_UINT32; +extern GrB_Semiring GrB_MIN_TIMES_SEMIRING_UINT64; +extern GrB_Semiring GrB_PLUS_MIN_SEMIRING_FP32; +extern GrB_Semiring GrB_PLUS_MIN_SEMIRING_FP64; +extern GrB_Semiring GrB_PLUS_MIN_SEMIRING_INT8; +extern GrB_Semiring GrB_PLUS_MIN_SEMIRING_INT16; +extern GrB_Semiring GrB_PLUS_MIN_SEMIRING_INT32; +extern GrB_Semiring GrB_PLUS_MIN_SEMIRING_INT64; +extern GrB_Semiring GrB_PLUS_MIN_SEMIRING_UINT8; +extern GrB_Semiring GrB_PLUS_MIN_SEMIRING_UINT16; +extern GrB_Semiring GrB_PLUS_MIN_SEMIRING_UINT32; +extern GrB_Semiring GrB_PLUS_MIN_SEMIRING_UINT64; +extern GrB_Semiring GrB_PLUS_TIMES_SEMIRING_FP32; +extern GrB_Semiring GrB_PLUS_TIMES_SEMIRING_FP64; +extern GrB_Semiring GrB_PLUS_TIMES_SEMIRING_INT8; +extern GrB_Semiring GrB_PLUS_TIMES_SEMIRING_INT16; +extern GrB_Semiring GrB_PLUS_TIMES_SEMIRING_INT32; +extern GrB_Semiring GrB_PLUS_TIMES_SEMIRING_INT64; +extern GrB_Semiring GrB_PLUS_TIMES_SEMIRING_UINT8; +extern GrB_Semiring GrB_PLUS_TIMES_SEMIRING_UINT16; +extern GrB_Semiring GrB_PLUS_TIMES_SEMIRING_UINT32; +extern GrB_Semiring GrB_PLUS_TIMES_SEMIRING_UINT64; +extern GrB_Type GrB_BOOL; +extern GrB_Type GrB_FP32; +extern GrB_Type GrB_FP64; +extern GrB_Type GrB_INT8; +extern GrB_Type GrB_INT16; +extern GrB_Type GrB_INT32; +extern GrB_Type GrB_INT64; +extern GrB_Type GrB_UINT8; +extern GrB_Type GrB_UINT16; +extern GrB_Type GrB_UINT32; +extern GrB_Type GrB_UINT64; +extern GrB_UnaryOp GrB_ABS_BOOL; +extern GrB_UnaryOp GrB_ABS_FP32; +extern GrB_UnaryOp GrB_ABS_FP64; +extern GrB_UnaryOp GrB_ABS_INT8; +extern GrB_UnaryOp GrB_ABS_INT16; +extern GrB_UnaryOp GrB_ABS_INT32; +extern GrB_UnaryOp GrB_ABS_INT64; +extern GrB_UnaryOp GrB_ABS_UINT8; +extern GrB_UnaryOp GrB_ABS_UINT16; +extern GrB_UnaryOp GrB_ABS_UINT32; +extern GrB_UnaryOp GrB_ABS_UINT64; +extern GrB_UnaryOp GrB_AINV_BOOL; +extern GrB_UnaryOp GrB_AINV_FP32; +extern GrB_UnaryOp GrB_AINV_FP64; +extern GrB_UnaryOp GrB_AINV_INT8; +extern GrB_UnaryOp GrB_AINV_INT16; +extern GrB_UnaryOp GrB_AINV_INT32; +extern GrB_UnaryOp GrB_AINV_INT64; +extern GrB_UnaryOp GrB_AINV_UINT8; +extern GrB_UnaryOp GrB_AINV_UINT16; +extern GrB_UnaryOp GrB_AINV_UINT32; +extern GrB_UnaryOp GrB_AINV_UINT64; +extern GrB_UnaryOp GrB_BNOT_INT8; +extern GrB_UnaryOp GrB_BNOT_INT16; +extern GrB_UnaryOp GrB_BNOT_INT32; +extern GrB_UnaryOp GrB_BNOT_INT64; +extern GrB_UnaryOp GrB_BNOT_UINT8; +extern GrB_UnaryOp GrB_BNOT_UINT16; +extern GrB_UnaryOp GrB_BNOT_UINT32; +extern GrB_UnaryOp GrB_BNOT_UINT64; +extern GrB_UnaryOp GrB_IDENTITY_BOOL; +extern GrB_UnaryOp GrB_IDENTITY_FP32; +extern GrB_UnaryOp GrB_IDENTITY_FP64; +extern GrB_UnaryOp GrB_IDENTITY_INT8; +extern GrB_UnaryOp GrB_IDENTITY_INT16; +extern GrB_UnaryOp GrB_IDENTITY_INT32; +extern GrB_UnaryOp GrB_IDENTITY_INT64; +extern GrB_UnaryOp GrB_IDENTITY_UINT8; +extern GrB_UnaryOp GrB_IDENTITY_UINT16; +extern GrB_UnaryOp GrB_IDENTITY_UINT32; +extern GrB_UnaryOp GrB_IDENTITY_UINT64; +extern GrB_UnaryOp GrB_LNOT; +extern GrB_UnaryOp GrB_MINV_BOOL; +extern GrB_UnaryOp GrB_MINV_FP32; +extern GrB_UnaryOp GrB_MINV_FP64; +extern GrB_UnaryOp GrB_MINV_INT8; +extern GrB_UnaryOp GrB_MINV_INT16; +extern GrB_UnaryOp GrB_MINV_INT32; +extern GrB_UnaryOp GrB_MINV_INT64; +extern GrB_UnaryOp GrB_MINV_UINT8; +extern GrB_UnaryOp GrB_MINV_UINT16; +extern GrB_UnaryOp GrB_MINV_UINT32; +extern GrB_UnaryOp GrB_MINV_UINT64; + +/* GrB objects (extended) */ +extern GrB_BinaryOp GxB_ANY_BOOL; +extern GrB_BinaryOp GxB_ANY_FC32; +extern GrB_BinaryOp GxB_ANY_FC64; +extern GrB_BinaryOp GxB_ANY_FP32; +extern GrB_BinaryOp GxB_ANY_FP64; +extern GrB_BinaryOp GxB_ANY_INT8; +extern GrB_BinaryOp GxB_ANY_INT16; +extern GrB_BinaryOp GxB_ANY_INT32; +extern GrB_BinaryOp GxB_ANY_INT64; +extern GrB_BinaryOp GxB_ANY_UINT8; +extern GrB_BinaryOp GxB_ANY_UINT16; +extern GrB_BinaryOp GxB_ANY_UINT32; +extern GrB_BinaryOp GxB_ANY_UINT64; +extern GrB_BinaryOp GxB_ATAN2_FP32; +extern GrB_BinaryOp GxB_ATAN2_FP64; +extern GrB_BinaryOp GxB_BCLR_INT8; +extern GrB_BinaryOp GxB_BCLR_INT16; +extern GrB_BinaryOp GxB_BCLR_INT32; +extern GrB_BinaryOp GxB_BCLR_INT64; +extern GrB_BinaryOp GxB_BCLR_UINT8; +extern GrB_BinaryOp GxB_BCLR_UINT16; +extern GrB_BinaryOp GxB_BCLR_UINT32; +extern GrB_BinaryOp GxB_BCLR_UINT64; +extern GrB_BinaryOp GxB_BGET_INT8; +extern GrB_BinaryOp GxB_BGET_INT16; +extern GrB_BinaryOp GxB_BGET_INT32; +extern GrB_BinaryOp GxB_BGET_INT64; +extern GrB_BinaryOp GxB_BGET_UINT8; +extern GrB_BinaryOp GxB_BGET_UINT16; +extern GrB_BinaryOp GxB_BGET_UINT32; +extern GrB_BinaryOp GxB_BGET_UINT64; +extern GrB_BinaryOp GxB_BSET_INT8; +extern GrB_BinaryOp GxB_BSET_INT16; +extern GrB_BinaryOp GxB_BSET_INT32; +extern GrB_BinaryOp GxB_BSET_INT64; +extern GrB_BinaryOp GxB_BSET_UINT8; +extern GrB_BinaryOp GxB_BSET_UINT16; +extern GrB_BinaryOp GxB_BSET_UINT32; +extern GrB_BinaryOp GxB_BSET_UINT64; +extern GrB_BinaryOp GxB_BSHIFT_INT8; +extern GrB_BinaryOp GxB_BSHIFT_INT16; +extern GrB_BinaryOp GxB_BSHIFT_INT32; +extern GrB_BinaryOp GxB_BSHIFT_INT64; +extern GrB_BinaryOp GxB_BSHIFT_UINT8; +extern GrB_BinaryOp GxB_BSHIFT_UINT16; +extern GrB_BinaryOp GxB_BSHIFT_UINT32; +extern GrB_BinaryOp GxB_BSHIFT_UINT64; +extern GrB_BinaryOp GxB_CMPLX_FP32; +extern GrB_BinaryOp GxB_CMPLX_FP64; +extern GrB_BinaryOp GxB_COPYSIGN_FP32; +extern GrB_BinaryOp GxB_COPYSIGN_FP64; +extern GrB_BinaryOp GxB_DIV_FC32; +extern GrB_BinaryOp GxB_DIV_FC64; +extern GrB_BinaryOp GxB_EQ_FC32; +extern GrB_BinaryOp GxB_EQ_FC64; +extern GrB_BinaryOp GxB_FIRSTI1_INT32; +extern GrB_BinaryOp GxB_FIRSTI1_INT64; +extern GrB_BinaryOp GxB_FIRSTI_INT32; +extern GrB_BinaryOp GxB_FIRSTI_INT64; +extern GrB_BinaryOp GxB_FIRSTJ1_INT32; +extern GrB_BinaryOp GxB_FIRSTJ1_INT64; +extern GrB_BinaryOp GxB_FIRSTJ_INT32; +extern GrB_BinaryOp GxB_FIRSTJ_INT64; +extern GrB_BinaryOp GxB_FIRST_FC32; +extern GrB_BinaryOp GxB_FIRST_FC64; +extern GrB_BinaryOp GxB_FMOD_FP32; +extern GrB_BinaryOp GxB_FMOD_FP64; +extern GrB_BinaryOp GxB_HYPOT_FP32; +extern GrB_BinaryOp GxB_HYPOT_FP64; +extern GrB_BinaryOp GxB_IGNORE_DUP; +extern GrB_BinaryOp GxB_ISEQ_BOOL; +extern GrB_BinaryOp GxB_ISEQ_FC32; +extern GrB_BinaryOp GxB_ISEQ_FC64; +extern GrB_BinaryOp GxB_ISEQ_FP32; +extern GrB_BinaryOp GxB_ISEQ_FP64; +extern GrB_BinaryOp GxB_ISEQ_INT8; +extern GrB_BinaryOp GxB_ISEQ_INT16; +extern GrB_BinaryOp GxB_ISEQ_INT32; +extern GrB_BinaryOp GxB_ISEQ_INT64; +extern GrB_BinaryOp GxB_ISEQ_UINT8; +extern GrB_BinaryOp GxB_ISEQ_UINT16; +extern GrB_BinaryOp GxB_ISEQ_UINT32; +extern GrB_BinaryOp GxB_ISEQ_UINT64; +extern GrB_BinaryOp GxB_ISGE_BOOL; +extern GrB_BinaryOp GxB_ISGE_FP32; +extern GrB_BinaryOp GxB_ISGE_FP64; +extern GrB_BinaryOp GxB_ISGE_INT8; +extern GrB_BinaryOp GxB_ISGE_INT16; +extern GrB_BinaryOp GxB_ISGE_INT32; +extern GrB_BinaryOp GxB_ISGE_INT64; +extern GrB_BinaryOp GxB_ISGE_UINT8; +extern GrB_BinaryOp GxB_ISGE_UINT16; +extern GrB_BinaryOp GxB_ISGE_UINT32; +extern GrB_BinaryOp GxB_ISGE_UINT64; +extern GrB_BinaryOp GxB_ISGT_BOOL; +extern GrB_BinaryOp GxB_ISGT_FP32; +extern GrB_BinaryOp GxB_ISGT_FP64; +extern GrB_BinaryOp GxB_ISGT_INT8; +extern GrB_BinaryOp GxB_ISGT_INT16; +extern GrB_BinaryOp GxB_ISGT_INT32; +extern GrB_BinaryOp GxB_ISGT_INT64; +extern GrB_BinaryOp GxB_ISGT_UINT8; +extern GrB_BinaryOp GxB_ISGT_UINT16; +extern GrB_BinaryOp GxB_ISGT_UINT32; +extern GrB_BinaryOp GxB_ISGT_UINT64; +extern GrB_BinaryOp GxB_ISLE_BOOL; +extern GrB_BinaryOp GxB_ISLE_FP32; +extern GrB_BinaryOp GxB_ISLE_FP64; +extern GrB_BinaryOp GxB_ISLE_INT8; +extern GrB_BinaryOp GxB_ISLE_INT16; +extern GrB_BinaryOp GxB_ISLE_INT32; +extern GrB_BinaryOp GxB_ISLE_INT64; +extern GrB_BinaryOp GxB_ISLE_UINT8; +extern GrB_BinaryOp GxB_ISLE_UINT16; +extern GrB_BinaryOp GxB_ISLE_UINT32; +extern GrB_BinaryOp GxB_ISLE_UINT64; +extern GrB_BinaryOp GxB_ISLT_BOOL; +extern GrB_BinaryOp GxB_ISLT_FP32; +extern GrB_BinaryOp GxB_ISLT_FP64; +extern GrB_BinaryOp GxB_ISLT_INT8; +extern GrB_BinaryOp GxB_ISLT_INT16; +extern GrB_BinaryOp GxB_ISLT_INT32; +extern GrB_BinaryOp GxB_ISLT_INT64; +extern GrB_BinaryOp GxB_ISLT_UINT8; +extern GrB_BinaryOp GxB_ISLT_UINT16; +extern GrB_BinaryOp GxB_ISLT_UINT32; +extern GrB_BinaryOp GxB_ISLT_UINT64; +extern GrB_BinaryOp GxB_ISNE_BOOL; +extern GrB_BinaryOp GxB_ISNE_FC32; +extern GrB_BinaryOp GxB_ISNE_FC64; +extern GrB_BinaryOp GxB_ISNE_FP32; +extern GrB_BinaryOp GxB_ISNE_FP64; +extern GrB_BinaryOp GxB_ISNE_INT8; +extern GrB_BinaryOp GxB_ISNE_INT16; +extern GrB_BinaryOp GxB_ISNE_INT32; +extern GrB_BinaryOp GxB_ISNE_INT64; +extern GrB_BinaryOp GxB_ISNE_UINT8; +extern GrB_BinaryOp GxB_ISNE_UINT16; +extern GrB_BinaryOp GxB_ISNE_UINT32; +extern GrB_BinaryOp GxB_ISNE_UINT64; +extern GrB_BinaryOp GxB_LAND_BOOL; +extern GrB_BinaryOp GxB_LAND_FP32; +extern GrB_BinaryOp GxB_LAND_FP64; +extern GrB_BinaryOp GxB_LAND_INT8; +extern GrB_BinaryOp GxB_LAND_INT16; +extern GrB_BinaryOp GxB_LAND_INT32; +extern GrB_BinaryOp GxB_LAND_INT64; +extern GrB_BinaryOp GxB_LAND_UINT8; +extern GrB_BinaryOp GxB_LAND_UINT16; +extern GrB_BinaryOp GxB_LAND_UINT32; +extern GrB_BinaryOp GxB_LAND_UINT64; +extern GrB_BinaryOp GxB_LDEXP_FP32; +extern GrB_BinaryOp GxB_LDEXP_FP64; +extern GrB_BinaryOp GxB_LOR_BOOL; +extern GrB_BinaryOp GxB_LOR_FP32; +extern GrB_BinaryOp GxB_LOR_FP64; +extern GrB_BinaryOp GxB_LOR_INT8; +extern GrB_BinaryOp GxB_LOR_INT16; +extern GrB_BinaryOp GxB_LOR_INT32; +extern GrB_BinaryOp GxB_LOR_INT64; +extern GrB_BinaryOp GxB_LOR_UINT8; +extern GrB_BinaryOp GxB_LOR_UINT16; +extern GrB_BinaryOp GxB_LOR_UINT32; +extern GrB_BinaryOp GxB_LOR_UINT64; +extern GrB_BinaryOp GxB_LXOR_BOOL; +extern GrB_BinaryOp GxB_LXOR_FP32; +extern GrB_BinaryOp GxB_LXOR_FP64; +extern GrB_BinaryOp GxB_LXOR_INT8; +extern GrB_BinaryOp GxB_LXOR_INT16; +extern GrB_BinaryOp GxB_LXOR_INT32; +extern GrB_BinaryOp GxB_LXOR_INT64; +extern GrB_BinaryOp GxB_LXOR_UINT8; +extern GrB_BinaryOp GxB_LXOR_UINT16; +extern GrB_BinaryOp GxB_LXOR_UINT32; +extern GrB_BinaryOp GxB_LXOR_UINT64; +extern GrB_BinaryOp GxB_MINUS_FC32; +extern GrB_BinaryOp GxB_MINUS_FC64; +extern GrB_BinaryOp GxB_NE_FC32; +extern GrB_BinaryOp GxB_NE_FC64; +extern GrB_BinaryOp GxB_ONEB_FC32; +extern GrB_BinaryOp GxB_ONEB_FC64; +extern GrB_BinaryOp GxB_PAIR_BOOL; +extern GrB_BinaryOp GxB_PAIR_FC32; +extern GrB_BinaryOp GxB_PAIR_FC64; +extern GrB_BinaryOp GxB_PAIR_FP32; +extern GrB_BinaryOp GxB_PAIR_FP64; +extern GrB_BinaryOp GxB_PAIR_INT8; +extern GrB_BinaryOp GxB_PAIR_INT16; +extern GrB_BinaryOp GxB_PAIR_INT32; +extern GrB_BinaryOp GxB_PAIR_INT64; +extern GrB_BinaryOp GxB_PAIR_UINT8; +extern GrB_BinaryOp GxB_PAIR_UINT16; +extern GrB_BinaryOp GxB_PAIR_UINT32; +extern GrB_BinaryOp GxB_PAIR_UINT64; +extern GrB_BinaryOp GxB_PLUS_FC32; +extern GrB_BinaryOp GxB_PLUS_FC64; +extern GrB_BinaryOp GxB_POW_BOOL; +extern GrB_BinaryOp GxB_POW_FC32; +extern GrB_BinaryOp GxB_POW_FC64; +extern GrB_BinaryOp GxB_POW_FP32; +extern GrB_BinaryOp GxB_POW_FP64; +extern GrB_BinaryOp GxB_POW_INT8; +extern GrB_BinaryOp GxB_POW_INT16; +extern GrB_BinaryOp GxB_POW_INT32; +extern GrB_BinaryOp GxB_POW_INT64; +extern GrB_BinaryOp GxB_POW_UINT8; +extern GrB_BinaryOp GxB_POW_UINT16; +extern GrB_BinaryOp GxB_POW_UINT32; +extern GrB_BinaryOp GxB_POW_UINT64; +extern GrB_BinaryOp GxB_RDIV_BOOL; +extern GrB_BinaryOp GxB_RDIV_FC32; +extern GrB_BinaryOp GxB_RDIV_FC64; +extern GrB_BinaryOp GxB_RDIV_FP32; +extern GrB_BinaryOp GxB_RDIV_FP64; +extern GrB_BinaryOp GxB_RDIV_INT8; +extern GrB_BinaryOp GxB_RDIV_INT16; +extern GrB_BinaryOp GxB_RDIV_INT32; +extern GrB_BinaryOp GxB_RDIV_INT64; +extern GrB_BinaryOp GxB_RDIV_UINT8; +extern GrB_BinaryOp GxB_RDIV_UINT16; +extern GrB_BinaryOp GxB_RDIV_UINT32; +extern GrB_BinaryOp GxB_RDIV_UINT64; +extern GrB_BinaryOp GxB_REMAINDER_FP32; +extern GrB_BinaryOp GxB_REMAINDER_FP64; +extern GrB_BinaryOp GxB_RMINUS_BOOL; +extern GrB_BinaryOp GxB_RMINUS_FC32; +extern GrB_BinaryOp GxB_RMINUS_FC64; +extern GrB_BinaryOp GxB_RMINUS_FP32; +extern GrB_BinaryOp GxB_RMINUS_FP64; +extern GrB_BinaryOp GxB_RMINUS_INT8; +extern GrB_BinaryOp GxB_RMINUS_INT16; +extern GrB_BinaryOp GxB_RMINUS_INT32; +extern GrB_BinaryOp GxB_RMINUS_INT64; +extern GrB_BinaryOp GxB_RMINUS_UINT8; +extern GrB_BinaryOp GxB_RMINUS_UINT16; +extern GrB_BinaryOp GxB_RMINUS_UINT32; +extern GrB_BinaryOp GxB_RMINUS_UINT64; +extern GrB_BinaryOp GxB_SECONDI1_INT32; +extern GrB_BinaryOp GxB_SECONDI1_INT64; +extern GrB_BinaryOp GxB_SECONDI_INT32; +extern GrB_BinaryOp GxB_SECONDI_INT64; +extern GrB_BinaryOp GxB_SECONDJ1_INT32; +extern GrB_BinaryOp GxB_SECONDJ1_INT64; +extern GrB_BinaryOp GxB_SECONDJ_INT32; +extern GrB_BinaryOp GxB_SECONDJ_INT64; +extern GrB_BinaryOp GxB_SECOND_FC32; +extern GrB_BinaryOp GxB_SECOND_FC64; +extern GrB_BinaryOp GxB_TIMES_FC32; +extern GrB_BinaryOp GxB_TIMES_FC64; +extern GrB_IndexUnaryOp GxB_VALUEEQ_FC32; +extern GrB_IndexUnaryOp GxB_VALUEEQ_FC64; +extern GrB_IndexUnaryOp GxB_VALUENE_FC32; +extern GrB_IndexUnaryOp GxB_VALUENE_FC64; +extern GrB_Monoid GxB_ANY_BOOL_MONOID; +extern GrB_Monoid GxB_ANY_FC32_MONOID; +extern GrB_Monoid GxB_ANY_FC64_MONOID; +extern GrB_Monoid GxB_ANY_FP32_MONOID; +extern GrB_Monoid GxB_ANY_FP64_MONOID; +extern GrB_Monoid GxB_ANY_INT8_MONOID; +extern GrB_Monoid GxB_ANY_INT16_MONOID; +extern GrB_Monoid GxB_ANY_INT32_MONOID; +extern GrB_Monoid GxB_ANY_INT64_MONOID; +extern GrB_Monoid GxB_ANY_UINT8_MONOID; +extern GrB_Monoid GxB_ANY_UINT16_MONOID; +extern GrB_Monoid GxB_ANY_UINT32_MONOID; +extern GrB_Monoid GxB_ANY_UINT64_MONOID; +extern GrB_Monoid GxB_BAND_UINT8_MONOID; +extern GrB_Monoid GxB_BAND_UINT16_MONOID; +extern GrB_Monoid GxB_BAND_UINT32_MONOID; +extern GrB_Monoid GxB_BAND_UINT64_MONOID; +extern GrB_Monoid GxB_BOR_UINT8_MONOID; +extern GrB_Monoid GxB_BOR_UINT16_MONOID; +extern GrB_Monoid GxB_BOR_UINT32_MONOID; +extern GrB_Monoid GxB_BOR_UINT64_MONOID; +extern GrB_Monoid GxB_BXNOR_UINT8_MONOID; +extern GrB_Monoid GxB_BXNOR_UINT16_MONOID; +extern GrB_Monoid GxB_BXNOR_UINT32_MONOID; +extern GrB_Monoid GxB_BXNOR_UINT64_MONOID; +extern GrB_Monoid GxB_BXOR_UINT8_MONOID; +extern GrB_Monoid GxB_BXOR_UINT16_MONOID; +extern GrB_Monoid GxB_BXOR_UINT32_MONOID; +extern GrB_Monoid GxB_BXOR_UINT64_MONOID; +extern GrB_Monoid GxB_EQ_BOOL_MONOID; +extern GrB_Monoid GxB_PLUS_FC32_MONOID; +extern GrB_Monoid GxB_PLUS_FC64_MONOID; +extern GrB_Monoid GxB_TIMES_FC32_MONOID; +extern GrB_Monoid GxB_TIMES_FC64_MONOID; +extern GrB_Semiring GxB_ANY_DIV_FC32; +extern GrB_Semiring GxB_ANY_DIV_FC64; +extern GrB_Semiring GxB_ANY_DIV_FP32; +extern GrB_Semiring GxB_ANY_DIV_FP64; +extern GrB_Semiring GxB_ANY_DIV_INT8; +extern GrB_Semiring GxB_ANY_DIV_INT16; +extern GrB_Semiring GxB_ANY_DIV_INT32; +extern GrB_Semiring GxB_ANY_DIV_INT64; +extern GrB_Semiring GxB_ANY_DIV_UINT8; +extern GrB_Semiring GxB_ANY_DIV_UINT16; +extern GrB_Semiring GxB_ANY_DIV_UINT32; +extern GrB_Semiring GxB_ANY_DIV_UINT64; +extern GrB_Semiring GxB_ANY_EQ_BOOL; +extern GrB_Semiring GxB_ANY_EQ_FP32; +extern GrB_Semiring GxB_ANY_EQ_FP64; +extern GrB_Semiring GxB_ANY_EQ_INT8; +extern GrB_Semiring GxB_ANY_EQ_INT16; +extern GrB_Semiring GxB_ANY_EQ_INT32; +extern GrB_Semiring GxB_ANY_EQ_INT64; +extern GrB_Semiring GxB_ANY_EQ_UINT8; +extern GrB_Semiring GxB_ANY_EQ_UINT16; +extern GrB_Semiring GxB_ANY_EQ_UINT32; +extern GrB_Semiring GxB_ANY_EQ_UINT64; +extern GrB_Semiring GxB_ANY_FIRSTI1_INT32; +extern GrB_Semiring GxB_ANY_FIRSTI1_INT64; +extern GrB_Semiring GxB_ANY_FIRSTI_INT32; +extern GrB_Semiring GxB_ANY_FIRSTI_INT64; +extern GrB_Semiring GxB_ANY_FIRSTJ1_INT32; +extern GrB_Semiring GxB_ANY_FIRSTJ1_INT64; +extern GrB_Semiring GxB_ANY_FIRSTJ_INT32; +extern GrB_Semiring GxB_ANY_FIRSTJ_INT64; +extern GrB_Semiring GxB_ANY_FIRST_BOOL; +extern GrB_Semiring GxB_ANY_FIRST_FC32; +extern GrB_Semiring GxB_ANY_FIRST_FC64; +extern GrB_Semiring GxB_ANY_FIRST_FP32; +extern GrB_Semiring GxB_ANY_FIRST_FP64; +extern GrB_Semiring GxB_ANY_FIRST_INT8; +extern GrB_Semiring GxB_ANY_FIRST_INT16; +extern GrB_Semiring GxB_ANY_FIRST_INT32; +extern GrB_Semiring GxB_ANY_FIRST_INT64; +extern GrB_Semiring GxB_ANY_FIRST_UINT8; +extern GrB_Semiring GxB_ANY_FIRST_UINT16; +extern GrB_Semiring GxB_ANY_FIRST_UINT32; +extern GrB_Semiring GxB_ANY_FIRST_UINT64; +extern GrB_Semiring GxB_ANY_GE_BOOL; +extern GrB_Semiring GxB_ANY_GE_FP32; +extern GrB_Semiring GxB_ANY_GE_FP64; +extern GrB_Semiring GxB_ANY_GE_INT8; +extern GrB_Semiring GxB_ANY_GE_INT16; +extern GrB_Semiring GxB_ANY_GE_INT32; +extern GrB_Semiring GxB_ANY_GE_INT64; +extern GrB_Semiring GxB_ANY_GE_UINT8; +extern GrB_Semiring GxB_ANY_GE_UINT16; +extern GrB_Semiring GxB_ANY_GE_UINT32; +extern GrB_Semiring GxB_ANY_GE_UINT64; +extern GrB_Semiring GxB_ANY_GT_BOOL; +extern GrB_Semiring GxB_ANY_GT_FP32; +extern GrB_Semiring GxB_ANY_GT_FP64; +extern GrB_Semiring GxB_ANY_GT_INT8; +extern GrB_Semiring GxB_ANY_GT_INT16; +extern GrB_Semiring GxB_ANY_GT_INT32; +extern GrB_Semiring GxB_ANY_GT_INT64; +extern GrB_Semiring GxB_ANY_GT_UINT8; +extern GrB_Semiring GxB_ANY_GT_UINT16; +extern GrB_Semiring GxB_ANY_GT_UINT32; +extern GrB_Semiring GxB_ANY_GT_UINT64; +extern GrB_Semiring GxB_ANY_ISEQ_FP32; +extern GrB_Semiring GxB_ANY_ISEQ_FP64; +extern GrB_Semiring GxB_ANY_ISEQ_INT8; +extern GrB_Semiring GxB_ANY_ISEQ_INT16; +extern GrB_Semiring GxB_ANY_ISEQ_INT32; +extern GrB_Semiring GxB_ANY_ISEQ_INT64; +extern GrB_Semiring GxB_ANY_ISEQ_UINT8; +extern GrB_Semiring GxB_ANY_ISEQ_UINT16; +extern GrB_Semiring GxB_ANY_ISEQ_UINT32; +extern GrB_Semiring GxB_ANY_ISEQ_UINT64; +extern GrB_Semiring GxB_ANY_ISGE_FP32; +extern GrB_Semiring GxB_ANY_ISGE_FP64; +extern GrB_Semiring GxB_ANY_ISGE_INT8; +extern GrB_Semiring GxB_ANY_ISGE_INT16; +extern GrB_Semiring GxB_ANY_ISGE_INT32; +extern GrB_Semiring GxB_ANY_ISGE_INT64; +extern GrB_Semiring GxB_ANY_ISGE_UINT8; +extern GrB_Semiring GxB_ANY_ISGE_UINT16; +extern GrB_Semiring GxB_ANY_ISGE_UINT32; +extern GrB_Semiring GxB_ANY_ISGE_UINT64; +extern GrB_Semiring GxB_ANY_ISGT_FP32; +extern GrB_Semiring GxB_ANY_ISGT_FP64; +extern GrB_Semiring GxB_ANY_ISGT_INT8; +extern GrB_Semiring GxB_ANY_ISGT_INT16; +extern GrB_Semiring GxB_ANY_ISGT_INT32; +extern GrB_Semiring GxB_ANY_ISGT_INT64; +extern GrB_Semiring GxB_ANY_ISGT_UINT8; +extern GrB_Semiring GxB_ANY_ISGT_UINT16; +extern GrB_Semiring GxB_ANY_ISGT_UINT32; +extern GrB_Semiring GxB_ANY_ISGT_UINT64; +extern GrB_Semiring GxB_ANY_ISLE_FP32; +extern GrB_Semiring GxB_ANY_ISLE_FP64; +extern GrB_Semiring GxB_ANY_ISLE_INT8; +extern GrB_Semiring GxB_ANY_ISLE_INT16; +extern GrB_Semiring GxB_ANY_ISLE_INT32; +extern GrB_Semiring GxB_ANY_ISLE_INT64; +extern GrB_Semiring GxB_ANY_ISLE_UINT8; +extern GrB_Semiring GxB_ANY_ISLE_UINT16; +extern GrB_Semiring GxB_ANY_ISLE_UINT32; +extern GrB_Semiring GxB_ANY_ISLE_UINT64; +extern GrB_Semiring GxB_ANY_ISLT_FP32; +extern GrB_Semiring GxB_ANY_ISLT_FP64; +extern GrB_Semiring GxB_ANY_ISLT_INT8; +extern GrB_Semiring GxB_ANY_ISLT_INT16; +extern GrB_Semiring GxB_ANY_ISLT_INT32; +extern GrB_Semiring GxB_ANY_ISLT_INT64; +extern GrB_Semiring GxB_ANY_ISLT_UINT8; +extern GrB_Semiring GxB_ANY_ISLT_UINT16; +extern GrB_Semiring GxB_ANY_ISLT_UINT32; +extern GrB_Semiring GxB_ANY_ISLT_UINT64; +extern GrB_Semiring GxB_ANY_ISNE_FP32; +extern GrB_Semiring GxB_ANY_ISNE_FP64; +extern GrB_Semiring GxB_ANY_ISNE_INT8; +extern GrB_Semiring GxB_ANY_ISNE_INT16; +extern GrB_Semiring GxB_ANY_ISNE_INT32; +extern GrB_Semiring GxB_ANY_ISNE_INT64; +extern GrB_Semiring GxB_ANY_ISNE_UINT8; +extern GrB_Semiring GxB_ANY_ISNE_UINT16; +extern GrB_Semiring GxB_ANY_ISNE_UINT32; +extern GrB_Semiring GxB_ANY_ISNE_UINT64; +extern GrB_Semiring GxB_ANY_LAND_BOOL; +extern GrB_Semiring GxB_ANY_LAND_FP32; +extern GrB_Semiring GxB_ANY_LAND_FP64; +extern GrB_Semiring GxB_ANY_LAND_INT8; +extern GrB_Semiring GxB_ANY_LAND_INT16; +extern GrB_Semiring GxB_ANY_LAND_INT32; +extern GrB_Semiring GxB_ANY_LAND_INT64; +extern GrB_Semiring GxB_ANY_LAND_UINT8; +extern GrB_Semiring GxB_ANY_LAND_UINT16; +extern GrB_Semiring GxB_ANY_LAND_UINT32; +extern GrB_Semiring GxB_ANY_LAND_UINT64; +extern GrB_Semiring GxB_ANY_LE_BOOL; +extern GrB_Semiring GxB_ANY_LE_FP32; +extern GrB_Semiring GxB_ANY_LE_FP64; +extern GrB_Semiring GxB_ANY_LE_INT8; +extern GrB_Semiring GxB_ANY_LE_INT16; +extern GrB_Semiring GxB_ANY_LE_INT32; +extern GrB_Semiring GxB_ANY_LE_INT64; +extern GrB_Semiring GxB_ANY_LE_UINT8; +extern GrB_Semiring GxB_ANY_LE_UINT16; +extern GrB_Semiring GxB_ANY_LE_UINT32; +extern GrB_Semiring GxB_ANY_LE_UINT64; +extern GrB_Semiring GxB_ANY_LOR_BOOL; +extern GrB_Semiring GxB_ANY_LOR_FP32; +extern GrB_Semiring GxB_ANY_LOR_FP64; +extern GrB_Semiring GxB_ANY_LOR_INT8; +extern GrB_Semiring GxB_ANY_LOR_INT16; +extern GrB_Semiring GxB_ANY_LOR_INT32; +extern GrB_Semiring GxB_ANY_LOR_INT64; +extern GrB_Semiring GxB_ANY_LOR_UINT8; +extern GrB_Semiring GxB_ANY_LOR_UINT16; +extern GrB_Semiring GxB_ANY_LOR_UINT32; +extern GrB_Semiring GxB_ANY_LOR_UINT64; +extern GrB_Semiring GxB_ANY_LT_BOOL; +extern GrB_Semiring GxB_ANY_LT_FP32; +extern GrB_Semiring GxB_ANY_LT_FP64; +extern GrB_Semiring GxB_ANY_LT_INT8; +extern GrB_Semiring GxB_ANY_LT_INT16; +extern GrB_Semiring GxB_ANY_LT_INT32; +extern GrB_Semiring GxB_ANY_LT_INT64; +extern GrB_Semiring GxB_ANY_LT_UINT8; +extern GrB_Semiring GxB_ANY_LT_UINT16; +extern GrB_Semiring GxB_ANY_LT_UINT32; +extern GrB_Semiring GxB_ANY_LT_UINT64; +extern GrB_Semiring GxB_ANY_LXOR_BOOL; +extern GrB_Semiring GxB_ANY_LXOR_FP32; +extern GrB_Semiring GxB_ANY_LXOR_FP64; +extern GrB_Semiring GxB_ANY_LXOR_INT8; +extern GrB_Semiring GxB_ANY_LXOR_INT16; +extern GrB_Semiring GxB_ANY_LXOR_INT32; +extern GrB_Semiring GxB_ANY_LXOR_INT64; +extern GrB_Semiring GxB_ANY_LXOR_UINT8; +extern GrB_Semiring GxB_ANY_LXOR_UINT16; +extern GrB_Semiring GxB_ANY_LXOR_UINT32; +extern GrB_Semiring GxB_ANY_LXOR_UINT64; +extern GrB_Semiring GxB_ANY_MAX_FP32; +extern GrB_Semiring GxB_ANY_MAX_FP64; +extern GrB_Semiring GxB_ANY_MAX_INT8; +extern GrB_Semiring GxB_ANY_MAX_INT16; +extern GrB_Semiring GxB_ANY_MAX_INT32; +extern GrB_Semiring GxB_ANY_MAX_INT64; +extern GrB_Semiring GxB_ANY_MAX_UINT8; +extern GrB_Semiring GxB_ANY_MAX_UINT16; +extern GrB_Semiring GxB_ANY_MAX_UINT32; +extern GrB_Semiring GxB_ANY_MAX_UINT64; +extern GrB_Semiring GxB_ANY_MINUS_FC32; +extern GrB_Semiring GxB_ANY_MINUS_FC64; +extern GrB_Semiring GxB_ANY_MINUS_FP32; +extern GrB_Semiring GxB_ANY_MINUS_FP64; +extern GrB_Semiring GxB_ANY_MINUS_INT8; +extern GrB_Semiring GxB_ANY_MINUS_INT16; +extern GrB_Semiring GxB_ANY_MINUS_INT32; +extern GrB_Semiring GxB_ANY_MINUS_INT64; +extern GrB_Semiring GxB_ANY_MINUS_UINT8; +extern GrB_Semiring GxB_ANY_MINUS_UINT16; +extern GrB_Semiring GxB_ANY_MINUS_UINT32; +extern GrB_Semiring GxB_ANY_MINUS_UINT64; +extern GrB_Semiring GxB_ANY_MIN_FP32; +extern GrB_Semiring GxB_ANY_MIN_FP64; +extern GrB_Semiring GxB_ANY_MIN_INT8; +extern GrB_Semiring GxB_ANY_MIN_INT16; +extern GrB_Semiring GxB_ANY_MIN_INT32; +extern GrB_Semiring GxB_ANY_MIN_INT64; +extern GrB_Semiring GxB_ANY_MIN_UINT8; +extern GrB_Semiring GxB_ANY_MIN_UINT16; +extern GrB_Semiring GxB_ANY_MIN_UINT32; +extern GrB_Semiring GxB_ANY_MIN_UINT64; +extern GrB_Semiring GxB_ANY_NE_FP32; +extern GrB_Semiring GxB_ANY_NE_FP64; +extern GrB_Semiring GxB_ANY_NE_INT8; +extern GrB_Semiring GxB_ANY_NE_INT16; +extern GrB_Semiring GxB_ANY_NE_INT32; +extern GrB_Semiring GxB_ANY_NE_INT64; +extern GrB_Semiring GxB_ANY_NE_UINT8; +extern GrB_Semiring GxB_ANY_NE_UINT16; +extern GrB_Semiring GxB_ANY_NE_UINT32; +extern GrB_Semiring GxB_ANY_NE_UINT64; +extern GrB_Semiring GxB_ANY_PAIR_BOOL; +extern GrB_Semiring GxB_ANY_PAIR_FC32; +extern GrB_Semiring GxB_ANY_PAIR_FC64; +extern GrB_Semiring GxB_ANY_PAIR_FP32; +extern GrB_Semiring GxB_ANY_PAIR_FP64; +extern GrB_Semiring GxB_ANY_PAIR_INT8; +extern GrB_Semiring GxB_ANY_PAIR_INT16; +extern GrB_Semiring GxB_ANY_PAIR_INT32; +extern GrB_Semiring GxB_ANY_PAIR_INT64; +extern GrB_Semiring GxB_ANY_PAIR_UINT8; +extern GrB_Semiring GxB_ANY_PAIR_UINT16; +extern GrB_Semiring GxB_ANY_PAIR_UINT32; +extern GrB_Semiring GxB_ANY_PAIR_UINT64; +extern GrB_Semiring GxB_ANY_PLUS_FC32; +extern GrB_Semiring GxB_ANY_PLUS_FC64; +extern GrB_Semiring GxB_ANY_PLUS_FP32; +extern GrB_Semiring GxB_ANY_PLUS_FP64; +extern GrB_Semiring GxB_ANY_PLUS_INT8; +extern GrB_Semiring GxB_ANY_PLUS_INT16; +extern GrB_Semiring GxB_ANY_PLUS_INT32; +extern GrB_Semiring GxB_ANY_PLUS_INT64; +extern GrB_Semiring GxB_ANY_PLUS_UINT8; +extern GrB_Semiring GxB_ANY_PLUS_UINT16; +extern GrB_Semiring GxB_ANY_PLUS_UINT32; +extern GrB_Semiring GxB_ANY_PLUS_UINT64; +extern GrB_Semiring GxB_ANY_RDIV_FC32; +extern GrB_Semiring GxB_ANY_RDIV_FC64; +extern GrB_Semiring GxB_ANY_RDIV_FP32; +extern GrB_Semiring GxB_ANY_RDIV_FP64; +extern GrB_Semiring GxB_ANY_RDIV_INT8; +extern GrB_Semiring GxB_ANY_RDIV_INT16; +extern GrB_Semiring GxB_ANY_RDIV_INT32; +extern GrB_Semiring GxB_ANY_RDIV_INT64; +extern GrB_Semiring GxB_ANY_RDIV_UINT8; +extern GrB_Semiring GxB_ANY_RDIV_UINT16; +extern GrB_Semiring GxB_ANY_RDIV_UINT32; +extern GrB_Semiring GxB_ANY_RDIV_UINT64; +extern GrB_Semiring GxB_ANY_RMINUS_FC32; +extern GrB_Semiring GxB_ANY_RMINUS_FC64; +extern GrB_Semiring GxB_ANY_RMINUS_FP32; +extern GrB_Semiring GxB_ANY_RMINUS_FP64; +extern GrB_Semiring GxB_ANY_RMINUS_INT8; +extern GrB_Semiring GxB_ANY_RMINUS_INT16; +extern GrB_Semiring GxB_ANY_RMINUS_INT32; +extern GrB_Semiring GxB_ANY_RMINUS_INT64; +extern GrB_Semiring GxB_ANY_RMINUS_UINT8; +extern GrB_Semiring GxB_ANY_RMINUS_UINT16; +extern GrB_Semiring GxB_ANY_RMINUS_UINT32; +extern GrB_Semiring GxB_ANY_RMINUS_UINT64; +extern GrB_Semiring GxB_ANY_SECONDI1_INT32; +extern GrB_Semiring GxB_ANY_SECONDI1_INT64; +extern GrB_Semiring GxB_ANY_SECONDI_INT32; +extern GrB_Semiring GxB_ANY_SECONDI_INT64; +extern GrB_Semiring GxB_ANY_SECONDJ1_INT32; +extern GrB_Semiring GxB_ANY_SECONDJ1_INT64; +extern GrB_Semiring GxB_ANY_SECONDJ_INT32; +extern GrB_Semiring GxB_ANY_SECONDJ_INT64; +extern GrB_Semiring GxB_ANY_SECOND_BOOL; +extern GrB_Semiring GxB_ANY_SECOND_FC32; +extern GrB_Semiring GxB_ANY_SECOND_FC64; +extern GrB_Semiring GxB_ANY_SECOND_FP32; +extern GrB_Semiring GxB_ANY_SECOND_FP64; +extern GrB_Semiring GxB_ANY_SECOND_INT8; +extern GrB_Semiring GxB_ANY_SECOND_INT16; +extern GrB_Semiring GxB_ANY_SECOND_INT32; +extern GrB_Semiring GxB_ANY_SECOND_INT64; +extern GrB_Semiring GxB_ANY_SECOND_UINT8; +extern GrB_Semiring GxB_ANY_SECOND_UINT16; +extern GrB_Semiring GxB_ANY_SECOND_UINT32; +extern GrB_Semiring GxB_ANY_SECOND_UINT64; +extern GrB_Semiring GxB_ANY_TIMES_FC32; +extern GrB_Semiring GxB_ANY_TIMES_FC64; +extern GrB_Semiring GxB_ANY_TIMES_FP32; +extern GrB_Semiring GxB_ANY_TIMES_FP64; +extern GrB_Semiring GxB_ANY_TIMES_INT8; +extern GrB_Semiring GxB_ANY_TIMES_INT16; +extern GrB_Semiring GxB_ANY_TIMES_INT32; +extern GrB_Semiring GxB_ANY_TIMES_INT64; +extern GrB_Semiring GxB_ANY_TIMES_UINT8; +extern GrB_Semiring GxB_ANY_TIMES_UINT16; +extern GrB_Semiring GxB_ANY_TIMES_UINT32; +extern GrB_Semiring GxB_ANY_TIMES_UINT64; +extern GrB_Semiring GxB_BAND_BAND_UINT8; +extern GrB_Semiring GxB_BAND_BAND_UINT16; +extern GrB_Semiring GxB_BAND_BAND_UINT32; +extern GrB_Semiring GxB_BAND_BAND_UINT64; +extern GrB_Semiring GxB_BAND_BOR_UINT8; +extern GrB_Semiring GxB_BAND_BOR_UINT16; +extern GrB_Semiring GxB_BAND_BOR_UINT32; +extern GrB_Semiring GxB_BAND_BOR_UINT64; +extern GrB_Semiring GxB_BAND_BXNOR_UINT8; +extern GrB_Semiring GxB_BAND_BXNOR_UINT16; +extern GrB_Semiring GxB_BAND_BXNOR_UINT32; +extern GrB_Semiring GxB_BAND_BXNOR_UINT64; +extern GrB_Semiring GxB_BAND_BXOR_UINT8; +extern GrB_Semiring GxB_BAND_BXOR_UINT16; +extern GrB_Semiring GxB_BAND_BXOR_UINT32; +extern GrB_Semiring GxB_BAND_BXOR_UINT64; +extern GrB_Semiring GxB_BOR_BAND_UINT8; +extern GrB_Semiring GxB_BOR_BAND_UINT16; +extern GrB_Semiring GxB_BOR_BAND_UINT32; +extern GrB_Semiring GxB_BOR_BAND_UINT64; +extern GrB_Semiring GxB_BOR_BOR_UINT8; +extern GrB_Semiring GxB_BOR_BOR_UINT16; +extern GrB_Semiring GxB_BOR_BOR_UINT32; +extern GrB_Semiring GxB_BOR_BOR_UINT64; +extern GrB_Semiring GxB_BOR_BXNOR_UINT8; +extern GrB_Semiring GxB_BOR_BXNOR_UINT16; +extern GrB_Semiring GxB_BOR_BXNOR_UINT32; +extern GrB_Semiring GxB_BOR_BXNOR_UINT64; +extern GrB_Semiring GxB_BOR_BXOR_UINT8; +extern GrB_Semiring GxB_BOR_BXOR_UINT16; +extern GrB_Semiring GxB_BOR_BXOR_UINT32; +extern GrB_Semiring GxB_BOR_BXOR_UINT64; +extern GrB_Semiring GxB_BXNOR_BAND_UINT8; +extern GrB_Semiring GxB_BXNOR_BAND_UINT16; +extern GrB_Semiring GxB_BXNOR_BAND_UINT32; +extern GrB_Semiring GxB_BXNOR_BAND_UINT64; +extern GrB_Semiring GxB_BXNOR_BOR_UINT8; +extern GrB_Semiring GxB_BXNOR_BOR_UINT16; +extern GrB_Semiring GxB_BXNOR_BOR_UINT32; +extern GrB_Semiring GxB_BXNOR_BOR_UINT64; +extern GrB_Semiring GxB_BXNOR_BXNOR_UINT8; +extern GrB_Semiring GxB_BXNOR_BXNOR_UINT16; +extern GrB_Semiring GxB_BXNOR_BXNOR_UINT32; +extern GrB_Semiring GxB_BXNOR_BXNOR_UINT64; +extern GrB_Semiring GxB_BXNOR_BXOR_UINT8; +extern GrB_Semiring GxB_BXNOR_BXOR_UINT16; +extern GrB_Semiring GxB_BXNOR_BXOR_UINT32; +extern GrB_Semiring GxB_BXNOR_BXOR_UINT64; +extern GrB_Semiring GxB_BXOR_BAND_UINT8; +extern GrB_Semiring GxB_BXOR_BAND_UINT16; +extern GrB_Semiring GxB_BXOR_BAND_UINT32; +extern GrB_Semiring GxB_BXOR_BAND_UINT64; +extern GrB_Semiring GxB_BXOR_BOR_UINT8; +extern GrB_Semiring GxB_BXOR_BOR_UINT16; +extern GrB_Semiring GxB_BXOR_BOR_UINT32; +extern GrB_Semiring GxB_BXOR_BOR_UINT64; +extern GrB_Semiring GxB_BXOR_BXNOR_UINT8; +extern GrB_Semiring GxB_BXOR_BXNOR_UINT16; +extern GrB_Semiring GxB_BXOR_BXNOR_UINT32; +extern GrB_Semiring GxB_BXOR_BXNOR_UINT64; +extern GrB_Semiring GxB_BXOR_BXOR_UINT8; +extern GrB_Semiring GxB_BXOR_BXOR_UINT16; +extern GrB_Semiring GxB_BXOR_BXOR_UINT32; +extern GrB_Semiring GxB_BXOR_BXOR_UINT64; +extern GrB_Semiring GxB_EQ_EQ_BOOL; +extern GrB_Semiring GxB_EQ_EQ_FP32; +extern GrB_Semiring GxB_EQ_EQ_FP64; +extern GrB_Semiring GxB_EQ_EQ_INT8; +extern GrB_Semiring GxB_EQ_EQ_INT16; +extern GrB_Semiring GxB_EQ_EQ_INT32; +extern GrB_Semiring GxB_EQ_EQ_INT64; +extern GrB_Semiring GxB_EQ_EQ_UINT8; +extern GrB_Semiring GxB_EQ_EQ_UINT16; +extern GrB_Semiring GxB_EQ_EQ_UINT32; +extern GrB_Semiring GxB_EQ_EQ_UINT64; +extern GrB_Semiring GxB_EQ_FIRST_BOOL; +extern GrB_Semiring GxB_EQ_GE_BOOL; +extern GrB_Semiring GxB_EQ_GE_FP32; +extern GrB_Semiring GxB_EQ_GE_FP64; +extern GrB_Semiring GxB_EQ_GE_INT8; +extern GrB_Semiring GxB_EQ_GE_INT16; +extern GrB_Semiring GxB_EQ_GE_INT32; +extern GrB_Semiring GxB_EQ_GE_INT64; +extern GrB_Semiring GxB_EQ_GE_UINT8; +extern GrB_Semiring GxB_EQ_GE_UINT16; +extern GrB_Semiring GxB_EQ_GE_UINT32; +extern GrB_Semiring GxB_EQ_GE_UINT64; +extern GrB_Semiring GxB_EQ_GT_BOOL; +extern GrB_Semiring GxB_EQ_GT_FP32; +extern GrB_Semiring GxB_EQ_GT_FP64; +extern GrB_Semiring GxB_EQ_GT_INT8; +extern GrB_Semiring GxB_EQ_GT_INT16; +extern GrB_Semiring GxB_EQ_GT_INT32; +extern GrB_Semiring GxB_EQ_GT_INT64; +extern GrB_Semiring GxB_EQ_GT_UINT8; +extern GrB_Semiring GxB_EQ_GT_UINT16; +extern GrB_Semiring GxB_EQ_GT_UINT32; +extern GrB_Semiring GxB_EQ_GT_UINT64; +extern GrB_Semiring GxB_EQ_LAND_BOOL; +extern GrB_Semiring GxB_EQ_LE_BOOL; +extern GrB_Semiring GxB_EQ_LE_FP32; +extern GrB_Semiring GxB_EQ_LE_FP64; +extern GrB_Semiring GxB_EQ_LE_INT8; +extern GrB_Semiring GxB_EQ_LE_INT16; +extern GrB_Semiring GxB_EQ_LE_INT32; +extern GrB_Semiring GxB_EQ_LE_INT64; +extern GrB_Semiring GxB_EQ_LE_UINT8; +extern GrB_Semiring GxB_EQ_LE_UINT16; +extern GrB_Semiring GxB_EQ_LE_UINT32; +extern GrB_Semiring GxB_EQ_LE_UINT64; +extern GrB_Semiring GxB_EQ_LOR_BOOL; +extern GrB_Semiring GxB_EQ_LT_BOOL; +extern GrB_Semiring GxB_EQ_LT_FP32; +extern GrB_Semiring GxB_EQ_LT_FP64; +extern GrB_Semiring GxB_EQ_LT_INT8; +extern GrB_Semiring GxB_EQ_LT_INT16; +extern GrB_Semiring GxB_EQ_LT_INT32; +extern GrB_Semiring GxB_EQ_LT_INT64; +extern GrB_Semiring GxB_EQ_LT_UINT8; +extern GrB_Semiring GxB_EQ_LT_UINT16; +extern GrB_Semiring GxB_EQ_LT_UINT32; +extern GrB_Semiring GxB_EQ_LT_UINT64; +extern GrB_Semiring GxB_EQ_LXOR_BOOL; +extern GrB_Semiring GxB_EQ_NE_FP32; +extern GrB_Semiring GxB_EQ_NE_FP64; +extern GrB_Semiring GxB_EQ_NE_INT8; +extern GrB_Semiring GxB_EQ_NE_INT16; +extern GrB_Semiring GxB_EQ_NE_INT32; +extern GrB_Semiring GxB_EQ_NE_INT64; +extern GrB_Semiring GxB_EQ_NE_UINT8; +extern GrB_Semiring GxB_EQ_NE_UINT16; +extern GrB_Semiring GxB_EQ_NE_UINT32; +extern GrB_Semiring GxB_EQ_NE_UINT64; +extern GrB_Semiring GxB_EQ_PAIR_BOOL; +extern GrB_Semiring GxB_EQ_SECOND_BOOL; +extern GrB_Semiring GxB_LAND_EQ_BOOL; +extern GrB_Semiring GxB_LAND_EQ_FP32; +extern GrB_Semiring GxB_LAND_EQ_FP64; +extern GrB_Semiring GxB_LAND_EQ_INT8; +extern GrB_Semiring GxB_LAND_EQ_INT16; +extern GrB_Semiring GxB_LAND_EQ_INT32; +extern GrB_Semiring GxB_LAND_EQ_INT64; +extern GrB_Semiring GxB_LAND_EQ_UINT8; +extern GrB_Semiring GxB_LAND_EQ_UINT16; +extern GrB_Semiring GxB_LAND_EQ_UINT32; +extern GrB_Semiring GxB_LAND_EQ_UINT64; +extern GrB_Semiring GxB_LAND_FIRST_BOOL; +extern GrB_Semiring GxB_LAND_GE_BOOL; +extern GrB_Semiring GxB_LAND_GE_FP32; +extern GrB_Semiring GxB_LAND_GE_FP64; +extern GrB_Semiring GxB_LAND_GE_INT8; +extern GrB_Semiring GxB_LAND_GE_INT16; +extern GrB_Semiring GxB_LAND_GE_INT32; +extern GrB_Semiring GxB_LAND_GE_INT64; +extern GrB_Semiring GxB_LAND_GE_UINT8; +extern GrB_Semiring GxB_LAND_GE_UINT16; +extern GrB_Semiring GxB_LAND_GE_UINT32; +extern GrB_Semiring GxB_LAND_GE_UINT64; +extern GrB_Semiring GxB_LAND_GT_BOOL; +extern GrB_Semiring GxB_LAND_GT_FP32; +extern GrB_Semiring GxB_LAND_GT_FP64; +extern GrB_Semiring GxB_LAND_GT_INT8; +extern GrB_Semiring GxB_LAND_GT_INT16; +extern GrB_Semiring GxB_LAND_GT_INT32; +extern GrB_Semiring GxB_LAND_GT_INT64; +extern GrB_Semiring GxB_LAND_GT_UINT8; +extern GrB_Semiring GxB_LAND_GT_UINT16; +extern GrB_Semiring GxB_LAND_GT_UINT32; +extern GrB_Semiring GxB_LAND_GT_UINT64; +extern GrB_Semiring GxB_LAND_LAND_BOOL; +extern GrB_Semiring GxB_LAND_LE_BOOL; +extern GrB_Semiring GxB_LAND_LE_FP32; +extern GrB_Semiring GxB_LAND_LE_FP64; +extern GrB_Semiring GxB_LAND_LE_INT8; +extern GrB_Semiring GxB_LAND_LE_INT16; +extern GrB_Semiring GxB_LAND_LE_INT32; +extern GrB_Semiring GxB_LAND_LE_INT64; +extern GrB_Semiring GxB_LAND_LE_UINT8; +extern GrB_Semiring GxB_LAND_LE_UINT16; +extern GrB_Semiring GxB_LAND_LE_UINT32; +extern GrB_Semiring GxB_LAND_LE_UINT64; +extern GrB_Semiring GxB_LAND_LT_BOOL; +extern GrB_Semiring GxB_LAND_LT_FP32; +extern GrB_Semiring GxB_LAND_LT_FP64; +extern GrB_Semiring GxB_LAND_LT_INT8; +extern GrB_Semiring GxB_LAND_LT_INT16; +extern GrB_Semiring GxB_LAND_LT_INT32; +extern GrB_Semiring GxB_LAND_LT_INT64; +extern GrB_Semiring GxB_LAND_LT_UINT8; +extern GrB_Semiring GxB_LAND_LT_UINT16; +extern GrB_Semiring GxB_LAND_LT_UINT32; +extern GrB_Semiring GxB_LAND_LT_UINT64; +extern GrB_Semiring GxB_LAND_LXOR_BOOL; +extern GrB_Semiring GxB_LAND_NE_FP32; +extern GrB_Semiring GxB_LAND_NE_FP64; +extern GrB_Semiring GxB_LAND_NE_INT8; +extern GrB_Semiring GxB_LAND_NE_INT16; +extern GrB_Semiring GxB_LAND_NE_INT32; +extern GrB_Semiring GxB_LAND_NE_INT64; +extern GrB_Semiring GxB_LAND_NE_UINT8; +extern GrB_Semiring GxB_LAND_NE_UINT16; +extern GrB_Semiring GxB_LAND_NE_UINT32; +extern GrB_Semiring GxB_LAND_NE_UINT64; +extern GrB_Semiring GxB_LAND_PAIR_BOOL; +extern GrB_Semiring GxB_LAND_SECOND_BOOL; +extern GrB_Semiring GxB_LOR_EQ_BOOL; +extern GrB_Semiring GxB_LOR_EQ_FP32; +extern GrB_Semiring GxB_LOR_EQ_FP64; +extern GrB_Semiring GxB_LOR_EQ_INT8; +extern GrB_Semiring GxB_LOR_EQ_INT16; +extern GrB_Semiring GxB_LOR_EQ_INT32; +extern GrB_Semiring GxB_LOR_EQ_INT64; +extern GrB_Semiring GxB_LOR_EQ_UINT8; +extern GrB_Semiring GxB_LOR_EQ_UINT16; +extern GrB_Semiring GxB_LOR_EQ_UINT32; +extern GrB_Semiring GxB_LOR_EQ_UINT64; +extern GrB_Semiring GxB_LOR_FIRST_BOOL; +extern GrB_Semiring GxB_LOR_GE_BOOL; +extern GrB_Semiring GxB_LOR_GE_FP32; +extern GrB_Semiring GxB_LOR_GE_FP64; +extern GrB_Semiring GxB_LOR_GE_INT8; +extern GrB_Semiring GxB_LOR_GE_INT16; +extern GrB_Semiring GxB_LOR_GE_INT32; +extern GrB_Semiring GxB_LOR_GE_INT64; +extern GrB_Semiring GxB_LOR_GE_UINT8; +extern GrB_Semiring GxB_LOR_GE_UINT16; +extern GrB_Semiring GxB_LOR_GE_UINT32; +extern GrB_Semiring GxB_LOR_GE_UINT64; +extern GrB_Semiring GxB_LOR_GT_BOOL; +extern GrB_Semiring GxB_LOR_GT_FP32; +extern GrB_Semiring GxB_LOR_GT_FP64; +extern GrB_Semiring GxB_LOR_GT_INT8; +extern GrB_Semiring GxB_LOR_GT_INT16; +extern GrB_Semiring GxB_LOR_GT_INT32; +extern GrB_Semiring GxB_LOR_GT_INT64; +extern GrB_Semiring GxB_LOR_GT_UINT8; +extern GrB_Semiring GxB_LOR_GT_UINT16; +extern GrB_Semiring GxB_LOR_GT_UINT32; +extern GrB_Semiring GxB_LOR_GT_UINT64; +extern GrB_Semiring GxB_LOR_LE_BOOL; +extern GrB_Semiring GxB_LOR_LE_FP32; +extern GrB_Semiring GxB_LOR_LE_FP64; +extern GrB_Semiring GxB_LOR_LE_INT8; +extern GrB_Semiring GxB_LOR_LE_INT16; +extern GrB_Semiring GxB_LOR_LE_INT32; +extern GrB_Semiring GxB_LOR_LE_INT64; +extern GrB_Semiring GxB_LOR_LE_UINT8; +extern GrB_Semiring GxB_LOR_LE_UINT16; +extern GrB_Semiring GxB_LOR_LE_UINT32; +extern GrB_Semiring GxB_LOR_LE_UINT64; +extern GrB_Semiring GxB_LOR_LOR_BOOL; +extern GrB_Semiring GxB_LOR_LT_BOOL; +extern GrB_Semiring GxB_LOR_LT_FP32; +extern GrB_Semiring GxB_LOR_LT_FP64; +extern GrB_Semiring GxB_LOR_LT_INT8; +extern GrB_Semiring GxB_LOR_LT_INT16; +extern GrB_Semiring GxB_LOR_LT_INT32; +extern GrB_Semiring GxB_LOR_LT_INT64; +extern GrB_Semiring GxB_LOR_LT_UINT8; +extern GrB_Semiring GxB_LOR_LT_UINT16; +extern GrB_Semiring GxB_LOR_LT_UINT32; +extern GrB_Semiring GxB_LOR_LT_UINT64; +extern GrB_Semiring GxB_LOR_LXOR_BOOL; +extern GrB_Semiring GxB_LOR_NE_FP32; +extern GrB_Semiring GxB_LOR_NE_FP64; +extern GrB_Semiring GxB_LOR_NE_INT8; +extern GrB_Semiring GxB_LOR_NE_INT16; +extern GrB_Semiring GxB_LOR_NE_INT32; +extern GrB_Semiring GxB_LOR_NE_INT64; +extern GrB_Semiring GxB_LOR_NE_UINT8; +extern GrB_Semiring GxB_LOR_NE_UINT16; +extern GrB_Semiring GxB_LOR_NE_UINT32; +extern GrB_Semiring GxB_LOR_NE_UINT64; +extern GrB_Semiring GxB_LOR_PAIR_BOOL; +extern GrB_Semiring GxB_LOR_SECOND_BOOL; +extern GrB_Semiring GxB_LXOR_EQ_BOOL; +extern GrB_Semiring GxB_LXOR_EQ_FP32; +extern GrB_Semiring GxB_LXOR_EQ_FP64; +extern GrB_Semiring GxB_LXOR_EQ_INT8; +extern GrB_Semiring GxB_LXOR_EQ_INT16; +extern GrB_Semiring GxB_LXOR_EQ_INT32; +extern GrB_Semiring GxB_LXOR_EQ_INT64; +extern GrB_Semiring GxB_LXOR_EQ_UINT8; +extern GrB_Semiring GxB_LXOR_EQ_UINT16; +extern GrB_Semiring GxB_LXOR_EQ_UINT32; +extern GrB_Semiring GxB_LXOR_EQ_UINT64; +extern GrB_Semiring GxB_LXOR_FIRST_BOOL; +extern GrB_Semiring GxB_LXOR_GE_BOOL; +extern GrB_Semiring GxB_LXOR_GE_FP32; +extern GrB_Semiring GxB_LXOR_GE_FP64; +extern GrB_Semiring GxB_LXOR_GE_INT8; +extern GrB_Semiring GxB_LXOR_GE_INT16; +extern GrB_Semiring GxB_LXOR_GE_INT32; +extern GrB_Semiring GxB_LXOR_GE_INT64; +extern GrB_Semiring GxB_LXOR_GE_UINT8; +extern GrB_Semiring GxB_LXOR_GE_UINT16; +extern GrB_Semiring GxB_LXOR_GE_UINT32; +extern GrB_Semiring GxB_LXOR_GE_UINT64; +extern GrB_Semiring GxB_LXOR_GT_BOOL; +extern GrB_Semiring GxB_LXOR_GT_FP32; +extern GrB_Semiring GxB_LXOR_GT_FP64; +extern GrB_Semiring GxB_LXOR_GT_INT8; +extern GrB_Semiring GxB_LXOR_GT_INT16; +extern GrB_Semiring GxB_LXOR_GT_INT32; +extern GrB_Semiring GxB_LXOR_GT_INT64; +extern GrB_Semiring GxB_LXOR_GT_UINT8; +extern GrB_Semiring GxB_LXOR_GT_UINT16; +extern GrB_Semiring GxB_LXOR_GT_UINT32; +extern GrB_Semiring GxB_LXOR_GT_UINT64; +extern GrB_Semiring GxB_LXOR_LE_BOOL; +extern GrB_Semiring GxB_LXOR_LE_FP32; +extern GrB_Semiring GxB_LXOR_LE_FP64; +extern GrB_Semiring GxB_LXOR_LE_INT8; +extern GrB_Semiring GxB_LXOR_LE_INT16; +extern GrB_Semiring GxB_LXOR_LE_INT32; +extern GrB_Semiring GxB_LXOR_LE_INT64; +extern GrB_Semiring GxB_LXOR_LE_UINT8; +extern GrB_Semiring GxB_LXOR_LE_UINT16; +extern GrB_Semiring GxB_LXOR_LE_UINT32; +extern GrB_Semiring GxB_LXOR_LE_UINT64; +extern GrB_Semiring GxB_LXOR_LOR_BOOL; +extern GrB_Semiring GxB_LXOR_LT_BOOL; +extern GrB_Semiring GxB_LXOR_LT_FP32; +extern GrB_Semiring GxB_LXOR_LT_FP64; +extern GrB_Semiring GxB_LXOR_LT_INT8; +extern GrB_Semiring GxB_LXOR_LT_INT16; +extern GrB_Semiring GxB_LXOR_LT_INT32; +extern GrB_Semiring GxB_LXOR_LT_INT64; +extern GrB_Semiring GxB_LXOR_LT_UINT8; +extern GrB_Semiring GxB_LXOR_LT_UINT16; +extern GrB_Semiring GxB_LXOR_LT_UINT32; +extern GrB_Semiring GxB_LXOR_LT_UINT64; +extern GrB_Semiring GxB_LXOR_LXOR_BOOL; +extern GrB_Semiring GxB_LXOR_NE_FP32; +extern GrB_Semiring GxB_LXOR_NE_FP64; +extern GrB_Semiring GxB_LXOR_NE_INT8; +extern GrB_Semiring GxB_LXOR_NE_INT16; +extern GrB_Semiring GxB_LXOR_NE_INT32; +extern GrB_Semiring GxB_LXOR_NE_INT64; +extern GrB_Semiring GxB_LXOR_NE_UINT8; +extern GrB_Semiring GxB_LXOR_NE_UINT16; +extern GrB_Semiring GxB_LXOR_NE_UINT32; +extern GrB_Semiring GxB_LXOR_NE_UINT64; +extern GrB_Semiring GxB_LXOR_PAIR_BOOL; +extern GrB_Semiring GxB_LXOR_SECOND_BOOL; +extern GrB_Semiring GxB_MAX_DIV_FP32; +extern GrB_Semiring GxB_MAX_DIV_FP64; +extern GrB_Semiring GxB_MAX_DIV_INT8; +extern GrB_Semiring GxB_MAX_DIV_INT16; +extern GrB_Semiring GxB_MAX_DIV_INT32; +extern GrB_Semiring GxB_MAX_DIV_INT64; +extern GrB_Semiring GxB_MAX_DIV_UINT8; +extern GrB_Semiring GxB_MAX_DIV_UINT16; +extern GrB_Semiring GxB_MAX_DIV_UINT32; +extern GrB_Semiring GxB_MAX_DIV_UINT64; +extern GrB_Semiring GxB_MAX_FIRSTI1_INT32; +extern GrB_Semiring GxB_MAX_FIRSTI1_INT64; +extern GrB_Semiring GxB_MAX_FIRSTI_INT32; +extern GrB_Semiring GxB_MAX_FIRSTI_INT64; +extern GrB_Semiring GxB_MAX_FIRSTJ1_INT32; +extern GrB_Semiring GxB_MAX_FIRSTJ1_INT64; +extern GrB_Semiring GxB_MAX_FIRSTJ_INT32; +extern GrB_Semiring GxB_MAX_FIRSTJ_INT64; +extern GrB_Semiring GxB_MAX_ISEQ_FP32; +extern GrB_Semiring GxB_MAX_ISEQ_FP64; +extern GrB_Semiring GxB_MAX_ISEQ_INT8; +extern GrB_Semiring GxB_MAX_ISEQ_INT16; +extern GrB_Semiring GxB_MAX_ISEQ_INT32; +extern GrB_Semiring GxB_MAX_ISEQ_INT64; +extern GrB_Semiring GxB_MAX_ISEQ_UINT8; +extern GrB_Semiring GxB_MAX_ISEQ_UINT16; +extern GrB_Semiring GxB_MAX_ISEQ_UINT32; +extern GrB_Semiring GxB_MAX_ISEQ_UINT64; +extern GrB_Semiring GxB_MAX_ISGE_FP32; +extern GrB_Semiring GxB_MAX_ISGE_FP64; +extern GrB_Semiring GxB_MAX_ISGE_INT8; +extern GrB_Semiring GxB_MAX_ISGE_INT16; +extern GrB_Semiring GxB_MAX_ISGE_INT32; +extern GrB_Semiring GxB_MAX_ISGE_INT64; +extern GrB_Semiring GxB_MAX_ISGE_UINT8; +extern GrB_Semiring GxB_MAX_ISGE_UINT16; +extern GrB_Semiring GxB_MAX_ISGE_UINT32; +extern GrB_Semiring GxB_MAX_ISGE_UINT64; +extern GrB_Semiring GxB_MAX_ISGT_FP32; +extern GrB_Semiring GxB_MAX_ISGT_FP64; +extern GrB_Semiring GxB_MAX_ISGT_INT8; +extern GrB_Semiring GxB_MAX_ISGT_INT16; +extern GrB_Semiring GxB_MAX_ISGT_INT32; +extern GrB_Semiring GxB_MAX_ISGT_INT64; +extern GrB_Semiring GxB_MAX_ISGT_UINT8; +extern GrB_Semiring GxB_MAX_ISGT_UINT16; +extern GrB_Semiring GxB_MAX_ISGT_UINT32; +extern GrB_Semiring GxB_MAX_ISGT_UINT64; +extern GrB_Semiring GxB_MAX_ISLE_FP32; +extern GrB_Semiring GxB_MAX_ISLE_FP64; +extern GrB_Semiring GxB_MAX_ISLE_INT8; +extern GrB_Semiring GxB_MAX_ISLE_INT16; +extern GrB_Semiring GxB_MAX_ISLE_INT32; +extern GrB_Semiring GxB_MAX_ISLE_INT64; +extern GrB_Semiring GxB_MAX_ISLE_UINT8; +extern GrB_Semiring GxB_MAX_ISLE_UINT16; +extern GrB_Semiring GxB_MAX_ISLE_UINT32; +extern GrB_Semiring GxB_MAX_ISLE_UINT64; +extern GrB_Semiring GxB_MAX_ISLT_FP32; +extern GrB_Semiring GxB_MAX_ISLT_FP64; +extern GrB_Semiring GxB_MAX_ISLT_INT8; +extern GrB_Semiring GxB_MAX_ISLT_INT16; +extern GrB_Semiring GxB_MAX_ISLT_INT32; +extern GrB_Semiring GxB_MAX_ISLT_INT64; +extern GrB_Semiring GxB_MAX_ISLT_UINT8; +extern GrB_Semiring GxB_MAX_ISLT_UINT16; +extern GrB_Semiring GxB_MAX_ISLT_UINT32; +extern GrB_Semiring GxB_MAX_ISLT_UINT64; +extern GrB_Semiring GxB_MAX_ISNE_FP32; +extern GrB_Semiring GxB_MAX_ISNE_FP64; +extern GrB_Semiring GxB_MAX_ISNE_INT8; +extern GrB_Semiring GxB_MAX_ISNE_INT16; +extern GrB_Semiring GxB_MAX_ISNE_INT32; +extern GrB_Semiring GxB_MAX_ISNE_INT64; +extern GrB_Semiring GxB_MAX_ISNE_UINT8; +extern GrB_Semiring GxB_MAX_ISNE_UINT16; +extern GrB_Semiring GxB_MAX_ISNE_UINT32; +extern GrB_Semiring GxB_MAX_ISNE_UINT64; +extern GrB_Semiring GxB_MAX_LAND_FP32; +extern GrB_Semiring GxB_MAX_LAND_FP64; +extern GrB_Semiring GxB_MAX_LAND_INT8; +extern GrB_Semiring GxB_MAX_LAND_INT16; +extern GrB_Semiring GxB_MAX_LAND_INT32; +extern GrB_Semiring GxB_MAX_LAND_INT64; +extern GrB_Semiring GxB_MAX_LAND_UINT8; +extern GrB_Semiring GxB_MAX_LAND_UINT16; +extern GrB_Semiring GxB_MAX_LAND_UINT32; +extern GrB_Semiring GxB_MAX_LAND_UINT64; +extern GrB_Semiring GxB_MAX_LOR_FP32; +extern GrB_Semiring GxB_MAX_LOR_FP64; +extern GrB_Semiring GxB_MAX_LOR_INT8; +extern GrB_Semiring GxB_MAX_LOR_INT16; +extern GrB_Semiring GxB_MAX_LOR_INT32; +extern GrB_Semiring GxB_MAX_LOR_INT64; +extern GrB_Semiring GxB_MAX_LOR_UINT8; +extern GrB_Semiring GxB_MAX_LOR_UINT16; +extern GrB_Semiring GxB_MAX_LOR_UINT32; +extern GrB_Semiring GxB_MAX_LOR_UINT64; +extern GrB_Semiring GxB_MAX_LXOR_FP32; +extern GrB_Semiring GxB_MAX_LXOR_FP64; +extern GrB_Semiring GxB_MAX_LXOR_INT8; +extern GrB_Semiring GxB_MAX_LXOR_INT16; +extern GrB_Semiring GxB_MAX_LXOR_INT32; +extern GrB_Semiring GxB_MAX_LXOR_INT64; +extern GrB_Semiring GxB_MAX_LXOR_UINT8; +extern GrB_Semiring GxB_MAX_LXOR_UINT16; +extern GrB_Semiring GxB_MAX_LXOR_UINT32; +extern GrB_Semiring GxB_MAX_LXOR_UINT64; +extern GrB_Semiring GxB_MAX_MAX_FP32; +extern GrB_Semiring GxB_MAX_MAX_FP64; +extern GrB_Semiring GxB_MAX_MAX_INT8; +extern GrB_Semiring GxB_MAX_MAX_INT16; +extern GrB_Semiring GxB_MAX_MAX_INT32; +extern GrB_Semiring GxB_MAX_MAX_INT64; +extern GrB_Semiring GxB_MAX_MAX_UINT8; +extern GrB_Semiring GxB_MAX_MAX_UINT16; +extern GrB_Semiring GxB_MAX_MAX_UINT32; +extern GrB_Semiring GxB_MAX_MAX_UINT64; +extern GrB_Semiring GxB_MAX_MINUS_FP32; +extern GrB_Semiring GxB_MAX_MINUS_FP64; +extern GrB_Semiring GxB_MAX_MINUS_INT8; +extern GrB_Semiring GxB_MAX_MINUS_INT16; +extern GrB_Semiring GxB_MAX_MINUS_INT32; +extern GrB_Semiring GxB_MAX_MINUS_INT64; +extern GrB_Semiring GxB_MAX_MINUS_UINT8; +extern GrB_Semiring GxB_MAX_MINUS_UINT16; +extern GrB_Semiring GxB_MAX_MINUS_UINT32; +extern GrB_Semiring GxB_MAX_MINUS_UINT64; +extern GrB_Semiring GxB_MAX_PAIR_FP32; +extern GrB_Semiring GxB_MAX_PAIR_FP64; +extern GrB_Semiring GxB_MAX_PAIR_INT8; +extern GrB_Semiring GxB_MAX_PAIR_INT16; +extern GrB_Semiring GxB_MAX_PAIR_INT32; +extern GrB_Semiring GxB_MAX_PAIR_INT64; +extern GrB_Semiring GxB_MAX_PAIR_UINT8; +extern GrB_Semiring GxB_MAX_PAIR_UINT16; +extern GrB_Semiring GxB_MAX_PAIR_UINT32; +extern GrB_Semiring GxB_MAX_PAIR_UINT64; +extern GrB_Semiring GxB_MAX_RDIV_FP32; +extern GrB_Semiring GxB_MAX_RDIV_FP64; +extern GrB_Semiring GxB_MAX_RDIV_INT8; +extern GrB_Semiring GxB_MAX_RDIV_INT16; +extern GrB_Semiring GxB_MAX_RDIV_INT32; +extern GrB_Semiring GxB_MAX_RDIV_INT64; +extern GrB_Semiring GxB_MAX_RDIV_UINT8; +extern GrB_Semiring GxB_MAX_RDIV_UINT16; +extern GrB_Semiring GxB_MAX_RDIV_UINT32; +extern GrB_Semiring GxB_MAX_RDIV_UINT64; +extern GrB_Semiring GxB_MAX_RMINUS_FP32; +extern GrB_Semiring GxB_MAX_RMINUS_FP64; +extern GrB_Semiring GxB_MAX_RMINUS_INT8; +extern GrB_Semiring GxB_MAX_RMINUS_INT16; +extern GrB_Semiring GxB_MAX_RMINUS_INT32; +extern GrB_Semiring GxB_MAX_RMINUS_INT64; +extern GrB_Semiring GxB_MAX_RMINUS_UINT8; +extern GrB_Semiring GxB_MAX_RMINUS_UINT16; +extern GrB_Semiring GxB_MAX_RMINUS_UINT32; +extern GrB_Semiring GxB_MAX_RMINUS_UINT64; +extern GrB_Semiring GxB_MAX_SECONDI1_INT32; +extern GrB_Semiring GxB_MAX_SECONDI1_INT64; +extern GrB_Semiring GxB_MAX_SECONDI_INT32; +extern GrB_Semiring GxB_MAX_SECONDI_INT64; +extern GrB_Semiring GxB_MAX_SECONDJ1_INT32; +extern GrB_Semiring GxB_MAX_SECONDJ1_INT64; +extern GrB_Semiring GxB_MAX_SECONDJ_INT32; +extern GrB_Semiring GxB_MAX_SECONDJ_INT64; +extern GrB_Semiring GxB_MIN_DIV_FP32; +extern GrB_Semiring GxB_MIN_DIV_FP64; +extern GrB_Semiring GxB_MIN_DIV_INT8; +extern GrB_Semiring GxB_MIN_DIV_INT16; +extern GrB_Semiring GxB_MIN_DIV_INT32; +extern GrB_Semiring GxB_MIN_DIV_INT64; +extern GrB_Semiring GxB_MIN_DIV_UINT8; +extern GrB_Semiring GxB_MIN_DIV_UINT16; +extern GrB_Semiring GxB_MIN_DIV_UINT32; +extern GrB_Semiring GxB_MIN_DIV_UINT64; +extern GrB_Semiring GxB_MIN_FIRSTI1_INT32; +extern GrB_Semiring GxB_MIN_FIRSTI1_INT64; +extern GrB_Semiring GxB_MIN_FIRSTI_INT32; +extern GrB_Semiring GxB_MIN_FIRSTI_INT64; +extern GrB_Semiring GxB_MIN_FIRSTJ1_INT32; +extern GrB_Semiring GxB_MIN_FIRSTJ1_INT64; +extern GrB_Semiring GxB_MIN_FIRSTJ_INT32; +extern GrB_Semiring GxB_MIN_FIRSTJ_INT64; +extern GrB_Semiring GxB_MIN_ISEQ_FP32; +extern GrB_Semiring GxB_MIN_ISEQ_FP64; +extern GrB_Semiring GxB_MIN_ISEQ_INT8; +extern GrB_Semiring GxB_MIN_ISEQ_INT16; +extern GrB_Semiring GxB_MIN_ISEQ_INT32; +extern GrB_Semiring GxB_MIN_ISEQ_INT64; +extern GrB_Semiring GxB_MIN_ISEQ_UINT8; +extern GrB_Semiring GxB_MIN_ISEQ_UINT16; +extern GrB_Semiring GxB_MIN_ISEQ_UINT32; +extern GrB_Semiring GxB_MIN_ISEQ_UINT64; +extern GrB_Semiring GxB_MIN_ISGE_FP32; +extern GrB_Semiring GxB_MIN_ISGE_FP64; +extern GrB_Semiring GxB_MIN_ISGE_INT8; +extern GrB_Semiring GxB_MIN_ISGE_INT16; +extern GrB_Semiring GxB_MIN_ISGE_INT32; +extern GrB_Semiring GxB_MIN_ISGE_INT64; +extern GrB_Semiring GxB_MIN_ISGE_UINT8; +extern GrB_Semiring GxB_MIN_ISGE_UINT16; +extern GrB_Semiring GxB_MIN_ISGE_UINT32; +extern GrB_Semiring GxB_MIN_ISGE_UINT64; +extern GrB_Semiring GxB_MIN_ISGT_FP32; +extern GrB_Semiring GxB_MIN_ISGT_FP64; +extern GrB_Semiring GxB_MIN_ISGT_INT8; +extern GrB_Semiring GxB_MIN_ISGT_INT16; +extern GrB_Semiring GxB_MIN_ISGT_INT32; +extern GrB_Semiring GxB_MIN_ISGT_INT64; +extern GrB_Semiring GxB_MIN_ISGT_UINT8; +extern GrB_Semiring GxB_MIN_ISGT_UINT16; +extern GrB_Semiring GxB_MIN_ISGT_UINT32; +extern GrB_Semiring GxB_MIN_ISGT_UINT64; +extern GrB_Semiring GxB_MIN_ISLE_FP32; +extern GrB_Semiring GxB_MIN_ISLE_FP64; +extern GrB_Semiring GxB_MIN_ISLE_INT8; +extern GrB_Semiring GxB_MIN_ISLE_INT16; +extern GrB_Semiring GxB_MIN_ISLE_INT32; +extern GrB_Semiring GxB_MIN_ISLE_INT64; +extern GrB_Semiring GxB_MIN_ISLE_UINT8; +extern GrB_Semiring GxB_MIN_ISLE_UINT16; +extern GrB_Semiring GxB_MIN_ISLE_UINT32; +extern GrB_Semiring GxB_MIN_ISLE_UINT64; +extern GrB_Semiring GxB_MIN_ISLT_FP32; +extern GrB_Semiring GxB_MIN_ISLT_FP64; +extern GrB_Semiring GxB_MIN_ISLT_INT8; +extern GrB_Semiring GxB_MIN_ISLT_INT16; +extern GrB_Semiring GxB_MIN_ISLT_INT32; +extern GrB_Semiring GxB_MIN_ISLT_INT64; +extern GrB_Semiring GxB_MIN_ISLT_UINT8; +extern GrB_Semiring GxB_MIN_ISLT_UINT16; +extern GrB_Semiring GxB_MIN_ISLT_UINT32; +extern GrB_Semiring GxB_MIN_ISLT_UINT64; +extern GrB_Semiring GxB_MIN_ISNE_FP32; +extern GrB_Semiring GxB_MIN_ISNE_FP64; +extern GrB_Semiring GxB_MIN_ISNE_INT8; +extern GrB_Semiring GxB_MIN_ISNE_INT16; +extern GrB_Semiring GxB_MIN_ISNE_INT32; +extern GrB_Semiring GxB_MIN_ISNE_INT64; +extern GrB_Semiring GxB_MIN_ISNE_UINT8; +extern GrB_Semiring GxB_MIN_ISNE_UINT16; +extern GrB_Semiring GxB_MIN_ISNE_UINT32; +extern GrB_Semiring GxB_MIN_ISNE_UINT64; +extern GrB_Semiring GxB_MIN_LAND_FP32; +extern GrB_Semiring GxB_MIN_LAND_FP64; +extern GrB_Semiring GxB_MIN_LAND_INT8; +extern GrB_Semiring GxB_MIN_LAND_INT16; +extern GrB_Semiring GxB_MIN_LAND_INT32; +extern GrB_Semiring GxB_MIN_LAND_INT64; +extern GrB_Semiring GxB_MIN_LAND_UINT8; +extern GrB_Semiring GxB_MIN_LAND_UINT16; +extern GrB_Semiring GxB_MIN_LAND_UINT32; +extern GrB_Semiring GxB_MIN_LAND_UINT64; +extern GrB_Semiring GxB_MIN_LOR_FP32; +extern GrB_Semiring GxB_MIN_LOR_FP64; +extern GrB_Semiring GxB_MIN_LOR_INT8; +extern GrB_Semiring GxB_MIN_LOR_INT16; +extern GrB_Semiring GxB_MIN_LOR_INT32; +extern GrB_Semiring GxB_MIN_LOR_INT64; +extern GrB_Semiring GxB_MIN_LOR_UINT8; +extern GrB_Semiring GxB_MIN_LOR_UINT16; +extern GrB_Semiring GxB_MIN_LOR_UINT32; +extern GrB_Semiring GxB_MIN_LOR_UINT64; +extern GrB_Semiring GxB_MIN_LXOR_FP32; +extern GrB_Semiring GxB_MIN_LXOR_FP64; +extern GrB_Semiring GxB_MIN_LXOR_INT8; +extern GrB_Semiring GxB_MIN_LXOR_INT16; +extern GrB_Semiring GxB_MIN_LXOR_INT32; +extern GrB_Semiring GxB_MIN_LXOR_INT64; +extern GrB_Semiring GxB_MIN_LXOR_UINT8; +extern GrB_Semiring GxB_MIN_LXOR_UINT16; +extern GrB_Semiring GxB_MIN_LXOR_UINT32; +extern GrB_Semiring GxB_MIN_LXOR_UINT64; +extern GrB_Semiring GxB_MIN_MINUS_FP32; +extern GrB_Semiring GxB_MIN_MINUS_FP64; +extern GrB_Semiring GxB_MIN_MINUS_INT8; +extern GrB_Semiring GxB_MIN_MINUS_INT16; +extern GrB_Semiring GxB_MIN_MINUS_INT32; +extern GrB_Semiring GxB_MIN_MINUS_INT64; +extern GrB_Semiring GxB_MIN_MINUS_UINT8; +extern GrB_Semiring GxB_MIN_MINUS_UINT16; +extern GrB_Semiring GxB_MIN_MINUS_UINT32; +extern GrB_Semiring GxB_MIN_MINUS_UINT64; +extern GrB_Semiring GxB_MIN_MIN_FP32; +extern GrB_Semiring GxB_MIN_MIN_FP64; +extern GrB_Semiring GxB_MIN_MIN_INT8; +extern GrB_Semiring GxB_MIN_MIN_INT16; +extern GrB_Semiring GxB_MIN_MIN_INT32; +extern GrB_Semiring GxB_MIN_MIN_INT64; +extern GrB_Semiring GxB_MIN_MIN_UINT8; +extern GrB_Semiring GxB_MIN_MIN_UINT16; +extern GrB_Semiring GxB_MIN_MIN_UINT32; +extern GrB_Semiring GxB_MIN_MIN_UINT64; +extern GrB_Semiring GxB_MIN_PAIR_FP32; +extern GrB_Semiring GxB_MIN_PAIR_FP64; +extern GrB_Semiring GxB_MIN_PAIR_INT8; +extern GrB_Semiring GxB_MIN_PAIR_INT16; +extern GrB_Semiring GxB_MIN_PAIR_INT32; +extern GrB_Semiring GxB_MIN_PAIR_INT64; +extern GrB_Semiring GxB_MIN_PAIR_UINT8; +extern GrB_Semiring GxB_MIN_PAIR_UINT16; +extern GrB_Semiring GxB_MIN_PAIR_UINT32; +extern GrB_Semiring GxB_MIN_PAIR_UINT64; +extern GrB_Semiring GxB_MIN_RDIV_FP32; +extern GrB_Semiring GxB_MIN_RDIV_FP64; +extern GrB_Semiring GxB_MIN_RDIV_INT8; +extern GrB_Semiring GxB_MIN_RDIV_INT16; +extern GrB_Semiring GxB_MIN_RDIV_INT32; +extern GrB_Semiring GxB_MIN_RDIV_INT64; +extern GrB_Semiring GxB_MIN_RDIV_UINT8; +extern GrB_Semiring GxB_MIN_RDIV_UINT16; +extern GrB_Semiring GxB_MIN_RDIV_UINT32; +extern GrB_Semiring GxB_MIN_RDIV_UINT64; +extern GrB_Semiring GxB_MIN_RMINUS_FP32; +extern GrB_Semiring GxB_MIN_RMINUS_FP64; +extern GrB_Semiring GxB_MIN_RMINUS_INT8; +extern GrB_Semiring GxB_MIN_RMINUS_INT16; +extern GrB_Semiring GxB_MIN_RMINUS_INT32; +extern GrB_Semiring GxB_MIN_RMINUS_INT64; +extern GrB_Semiring GxB_MIN_RMINUS_UINT8; +extern GrB_Semiring GxB_MIN_RMINUS_UINT16; +extern GrB_Semiring GxB_MIN_RMINUS_UINT32; +extern GrB_Semiring GxB_MIN_RMINUS_UINT64; +extern GrB_Semiring GxB_MIN_SECONDI1_INT32; +extern GrB_Semiring GxB_MIN_SECONDI1_INT64; +extern GrB_Semiring GxB_MIN_SECONDI_INT32; +extern GrB_Semiring GxB_MIN_SECONDI_INT64; +extern GrB_Semiring GxB_MIN_SECONDJ1_INT32; +extern GrB_Semiring GxB_MIN_SECONDJ1_INT64; +extern GrB_Semiring GxB_MIN_SECONDJ_INT32; +extern GrB_Semiring GxB_MIN_SECONDJ_INT64; +extern GrB_Semiring GxB_PLUS_DIV_FC32; +extern GrB_Semiring GxB_PLUS_DIV_FC64; +extern GrB_Semiring GxB_PLUS_DIV_FP32; +extern GrB_Semiring GxB_PLUS_DIV_FP64; +extern GrB_Semiring GxB_PLUS_DIV_INT8; +extern GrB_Semiring GxB_PLUS_DIV_INT16; +extern GrB_Semiring GxB_PLUS_DIV_INT32; +extern GrB_Semiring GxB_PLUS_DIV_INT64; +extern GrB_Semiring GxB_PLUS_DIV_UINT8; +extern GrB_Semiring GxB_PLUS_DIV_UINT16; +extern GrB_Semiring GxB_PLUS_DIV_UINT32; +extern GrB_Semiring GxB_PLUS_DIV_UINT64; +extern GrB_Semiring GxB_PLUS_FIRSTI1_INT32; +extern GrB_Semiring GxB_PLUS_FIRSTI1_INT64; +extern GrB_Semiring GxB_PLUS_FIRSTI_INT32; +extern GrB_Semiring GxB_PLUS_FIRSTI_INT64; +extern GrB_Semiring GxB_PLUS_FIRSTJ1_INT32; +extern GrB_Semiring GxB_PLUS_FIRSTJ1_INT64; +extern GrB_Semiring GxB_PLUS_FIRSTJ_INT32; +extern GrB_Semiring GxB_PLUS_FIRSTJ_INT64; +extern GrB_Semiring GxB_PLUS_FIRST_FC32; +extern GrB_Semiring GxB_PLUS_FIRST_FC64; +extern GrB_Semiring GxB_PLUS_FIRST_FP32; +extern GrB_Semiring GxB_PLUS_FIRST_FP64; +extern GrB_Semiring GxB_PLUS_FIRST_INT8; +extern GrB_Semiring GxB_PLUS_FIRST_INT16; +extern GrB_Semiring GxB_PLUS_FIRST_INT32; +extern GrB_Semiring GxB_PLUS_FIRST_INT64; +extern GrB_Semiring GxB_PLUS_FIRST_UINT8; +extern GrB_Semiring GxB_PLUS_FIRST_UINT16; +extern GrB_Semiring GxB_PLUS_FIRST_UINT32; +extern GrB_Semiring GxB_PLUS_FIRST_UINT64; +extern GrB_Semiring GxB_PLUS_ISEQ_FP32; +extern GrB_Semiring GxB_PLUS_ISEQ_FP64; +extern GrB_Semiring GxB_PLUS_ISEQ_INT8; +extern GrB_Semiring GxB_PLUS_ISEQ_INT16; +extern GrB_Semiring GxB_PLUS_ISEQ_INT32; +extern GrB_Semiring GxB_PLUS_ISEQ_INT64; +extern GrB_Semiring GxB_PLUS_ISEQ_UINT8; +extern GrB_Semiring GxB_PLUS_ISEQ_UINT16; +extern GrB_Semiring GxB_PLUS_ISEQ_UINT32; +extern GrB_Semiring GxB_PLUS_ISEQ_UINT64; +extern GrB_Semiring GxB_PLUS_ISGE_FP32; +extern GrB_Semiring GxB_PLUS_ISGE_FP64; +extern GrB_Semiring GxB_PLUS_ISGE_INT8; +extern GrB_Semiring GxB_PLUS_ISGE_INT16; +extern GrB_Semiring GxB_PLUS_ISGE_INT32; +extern GrB_Semiring GxB_PLUS_ISGE_INT64; +extern GrB_Semiring GxB_PLUS_ISGE_UINT8; +extern GrB_Semiring GxB_PLUS_ISGE_UINT16; +extern GrB_Semiring GxB_PLUS_ISGE_UINT32; +extern GrB_Semiring GxB_PLUS_ISGE_UINT64; +extern GrB_Semiring GxB_PLUS_ISGT_FP32; +extern GrB_Semiring GxB_PLUS_ISGT_FP64; +extern GrB_Semiring GxB_PLUS_ISGT_INT8; +extern GrB_Semiring GxB_PLUS_ISGT_INT16; +extern GrB_Semiring GxB_PLUS_ISGT_INT32; +extern GrB_Semiring GxB_PLUS_ISGT_INT64; +extern GrB_Semiring GxB_PLUS_ISGT_UINT8; +extern GrB_Semiring GxB_PLUS_ISGT_UINT16; +extern GrB_Semiring GxB_PLUS_ISGT_UINT32; +extern GrB_Semiring GxB_PLUS_ISGT_UINT64; +extern GrB_Semiring GxB_PLUS_ISLE_FP32; +extern GrB_Semiring GxB_PLUS_ISLE_FP64; +extern GrB_Semiring GxB_PLUS_ISLE_INT8; +extern GrB_Semiring GxB_PLUS_ISLE_INT16; +extern GrB_Semiring GxB_PLUS_ISLE_INT32; +extern GrB_Semiring GxB_PLUS_ISLE_INT64; +extern GrB_Semiring GxB_PLUS_ISLE_UINT8; +extern GrB_Semiring GxB_PLUS_ISLE_UINT16; +extern GrB_Semiring GxB_PLUS_ISLE_UINT32; +extern GrB_Semiring GxB_PLUS_ISLE_UINT64; +extern GrB_Semiring GxB_PLUS_ISLT_FP32; +extern GrB_Semiring GxB_PLUS_ISLT_FP64; +extern GrB_Semiring GxB_PLUS_ISLT_INT8; +extern GrB_Semiring GxB_PLUS_ISLT_INT16; +extern GrB_Semiring GxB_PLUS_ISLT_INT32; +extern GrB_Semiring GxB_PLUS_ISLT_INT64; +extern GrB_Semiring GxB_PLUS_ISLT_UINT8; +extern GrB_Semiring GxB_PLUS_ISLT_UINT16; +extern GrB_Semiring GxB_PLUS_ISLT_UINT32; +extern GrB_Semiring GxB_PLUS_ISLT_UINT64; +extern GrB_Semiring GxB_PLUS_ISNE_FP32; +extern GrB_Semiring GxB_PLUS_ISNE_FP64; +extern GrB_Semiring GxB_PLUS_ISNE_INT8; +extern GrB_Semiring GxB_PLUS_ISNE_INT16; +extern GrB_Semiring GxB_PLUS_ISNE_INT32; +extern GrB_Semiring GxB_PLUS_ISNE_INT64; +extern GrB_Semiring GxB_PLUS_ISNE_UINT8; +extern GrB_Semiring GxB_PLUS_ISNE_UINT16; +extern GrB_Semiring GxB_PLUS_ISNE_UINT32; +extern GrB_Semiring GxB_PLUS_ISNE_UINT64; +extern GrB_Semiring GxB_PLUS_LAND_FP32; +extern GrB_Semiring GxB_PLUS_LAND_FP64; +extern GrB_Semiring GxB_PLUS_LAND_INT8; +extern GrB_Semiring GxB_PLUS_LAND_INT16; +extern GrB_Semiring GxB_PLUS_LAND_INT32; +extern GrB_Semiring GxB_PLUS_LAND_INT64; +extern GrB_Semiring GxB_PLUS_LAND_UINT8; +extern GrB_Semiring GxB_PLUS_LAND_UINT16; +extern GrB_Semiring GxB_PLUS_LAND_UINT32; +extern GrB_Semiring GxB_PLUS_LAND_UINT64; +extern GrB_Semiring GxB_PLUS_LOR_FP32; +extern GrB_Semiring GxB_PLUS_LOR_FP64; +extern GrB_Semiring GxB_PLUS_LOR_INT8; +extern GrB_Semiring GxB_PLUS_LOR_INT16; +extern GrB_Semiring GxB_PLUS_LOR_INT32; +extern GrB_Semiring GxB_PLUS_LOR_INT64; +extern GrB_Semiring GxB_PLUS_LOR_UINT8; +extern GrB_Semiring GxB_PLUS_LOR_UINT16; +extern GrB_Semiring GxB_PLUS_LOR_UINT32; +extern GrB_Semiring GxB_PLUS_LOR_UINT64; +extern GrB_Semiring GxB_PLUS_LXOR_FP32; +extern GrB_Semiring GxB_PLUS_LXOR_FP64; +extern GrB_Semiring GxB_PLUS_LXOR_INT8; +extern GrB_Semiring GxB_PLUS_LXOR_INT16; +extern GrB_Semiring GxB_PLUS_LXOR_INT32; +extern GrB_Semiring GxB_PLUS_LXOR_INT64; +extern GrB_Semiring GxB_PLUS_LXOR_UINT8; +extern GrB_Semiring GxB_PLUS_LXOR_UINT16; +extern GrB_Semiring GxB_PLUS_LXOR_UINT32; +extern GrB_Semiring GxB_PLUS_LXOR_UINT64; +extern GrB_Semiring GxB_PLUS_MAX_FP32; +extern GrB_Semiring GxB_PLUS_MAX_FP64; +extern GrB_Semiring GxB_PLUS_MAX_INT8; +extern GrB_Semiring GxB_PLUS_MAX_INT16; +extern GrB_Semiring GxB_PLUS_MAX_INT32; +extern GrB_Semiring GxB_PLUS_MAX_INT64; +extern GrB_Semiring GxB_PLUS_MAX_UINT8; +extern GrB_Semiring GxB_PLUS_MAX_UINT16; +extern GrB_Semiring GxB_PLUS_MAX_UINT32; +extern GrB_Semiring GxB_PLUS_MAX_UINT64; +extern GrB_Semiring GxB_PLUS_MINUS_FC32; +extern GrB_Semiring GxB_PLUS_MINUS_FC64; +extern GrB_Semiring GxB_PLUS_MINUS_FP32; +extern GrB_Semiring GxB_PLUS_MINUS_FP64; +extern GrB_Semiring GxB_PLUS_MINUS_INT8; +extern GrB_Semiring GxB_PLUS_MINUS_INT16; +extern GrB_Semiring GxB_PLUS_MINUS_INT32; +extern GrB_Semiring GxB_PLUS_MINUS_INT64; +extern GrB_Semiring GxB_PLUS_MINUS_UINT8; +extern GrB_Semiring GxB_PLUS_MINUS_UINT16; +extern GrB_Semiring GxB_PLUS_MINUS_UINT32; +extern GrB_Semiring GxB_PLUS_MINUS_UINT64; +extern GrB_Semiring GxB_PLUS_PAIR_FC32; +extern GrB_Semiring GxB_PLUS_PAIR_FC64; +extern GrB_Semiring GxB_PLUS_PAIR_FP32; +extern GrB_Semiring GxB_PLUS_PAIR_FP64; +extern GrB_Semiring GxB_PLUS_PAIR_INT8; +extern GrB_Semiring GxB_PLUS_PAIR_INT16; +extern GrB_Semiring GxB_PLUS_PAIR_INT32; +extern GrB_Semiring GxB_PLUS_PAIR_INT64; +extern GrB_Semiring GxB_PLUS_PAIR_UINT8; +extern GrB_Semiring GxB_PLUS_PAIR_UINT16; +extern GrB_Semiring GxB_PLUS_PAIR_UINT32; +extern GrB_Semiring GxB_PLUS_PAIR_UINT64; +extern GrB_Semiring GxB_PLUS_PLUS_FC32; +extern GrB_Semiring GxB_PLUS_PLUS_FC64; +extern GrB_Semiring GxB_PLUS_PLUS_FP32; +extern GrB_Semiring GxB_PLUS_PLUS_FP64; +extern GrB_Semiring GxB_PLUS_PLUS_INT8; +extern GrB_Semiring GxB_PLUS_PLUS_INT16; +extern GrB_Semiring GxB_PLUS_PLUS_INT32; +extern GrB_Semiring GxB_PLUS_PLUS_INT64; +extern GrB_Semiring GxB_PLUS_PLUS_UINT8; +extern GrB_Semiring GxB_PLUS_PLUS_UINT16; +extern GrB_Semiring GxB_PLUS_PLUS_UINT32; +extern GrB_Semiring GxB_PLUS_PLUS_UINT64; +extern GrB_Semiring GxB_PLUS_RDIV_FC32; +extern GrB_Semiring GxB_PLUS_RDIV_FC64; +extern GrB_Semiring GxB_PLUS_RDIV_FP32; +extern GrB_Semiring GxB_PLUS_RDIV_FP64; +extern GrB_Semiring GxB_PLUS_RDIV_INT8; +extern GrB_Semiring GxB_PLUS_RDIV_INT16; +extern GrB_Semiring GxB_PLUS_RDIV_INT32; +extern GrB_Semiring GxB_PLUS_RDIV_INT64; +extern GrB_Semiring GxB_PLUS_RDIV_UINT8; +extern GrB_Semiring GxB_PLUS_RDIV_UINT16; +extern GrB_Semiring GxB_PLUS_RDIV_UINT32; +extern GrB_Semiring GxB_PLUS_RDIV_UINT64; +extern GrB_Semiring GxB_PLUS_RMINUS_FC32; +extern GrB_Semiring GxB_PLUS_RMINUS_FC64; +extern GrB_Semiring GxB_PLUS_RMINUS_FP32; +extern GrB_Semiring GxB_PLUS_RMINUS_FP64; +extern GrB_Semiring GxB_PLUS_RMINUS_INT8; +extern GrB_Semiring GxB_PLUS_RMINUS_INT16; +extern GrB_Semiring GxB_PLUS_RMINUS_INT32; +extern GrB_Semiring GxB_PLUS_RMINUS_INT64; +extern GrB_Semiring GxB_PLUS_RMINUS_UINT8; +extern GrB_Semiring GxB_PLUS_RMINUS_UINT16; +extern GrB_Semiring GxB_PLUS_RMINUS_UINT32; +extern GrB_Semiring GxB_PLUS_RMINUS_UINT64; +extern GrB_Semiring GxB_PLUS_SECONDI1_INT32; +extern GrB_Semiring GxB_PLUS_SECONDI1_INT64; +extern GrB_Semiring GxB_PLUS_SECONDI_INT32; +extern GrB_Semiring GxB_PLUS_SECONDI_INT64; +extern GrB_Semiring GxB_PLUS_SECONDJ1_INT32; +extern GrB_Semiring GxB_PLUS_SECONDJ1_INT64; +extern GrB_Semiring GxB_PLUS_SECONDJ_INT32; +extern GrB_Semiring GxB_PLUS_SECONDJ_INT64; +extern GrB_Semiring GxB_PLUS_SECOND_FC32; +extern GrB_Semiring GxB_PLUS_SECOND_FC64; +extern GrB_Semiring GxB_PLUS_SECOND_FP32; +extern GrB_Semiring GxB_PLUS_SECOND_FP64; +extern GrB_Semiring GxB_PLUS_SECOND_INT8; +extern GrB_Semiring GxB_PLUS_SECOND_INT16; +extern GrB_Semiring GxB_PLUS_SECOND_INT32; +extern GrB_Semiring GxB_PLUS_SECOND_INT64; +extern GrB_Semiring GxB_PLUS_SECOND_UINT8; +extern GrB_Semiring GxB_PLUS_SECOND_UINT16; +extern GrB_Semiring GxB_PLUS_SECOND_UINT32; +extern GrB_Semiring GxB_PLUS_SECOND_UINT64; +extern GrB_Semiring GxB_PLUS_TIMES_FC32; +extern GrB_Semiring GxB_PLUS_TIMES_FC64; +extern GrB_Semiring GxB_TIMES_DIV_FC32; +extern GrB_Semiring GxB_TIMES_DIV_FC64; +extern GrB_Semiring GxB_TIMES_DIV_FP32; +extern GrB_Semiring GxB_TIMES_DIV_FP64; +extern GrB_Semiring GxB_TIMES_DIV_INT8; +extern GrB_Semiring GxB_TIMES_DIV_INT16; +extern GrB_Semiring GxB_TIMES_DIV_INT32; +extern GrB_Semiring GxB_TIMES_DIV_INT64; +extern GrB_Semiring GxB_TIMES_DIV_UINT8; +extern GrB_Semiring GxB_TIMES_DIV_UINT16; +extern GrB_Semiring GxB_TIMES_DIV_UINT32; +extern GrB_Semiring GxB_TIMES_DIV_UINT64; +extern GrB_Semiring GxB_TIMES_FIRSTI1_INT32; +extern GrB_Semiring GxB_TIMES_FIRSTI1_INT64; +extern GrB_Semiring GxB_TIMES_FIRSTI_INT32; +extern GrB_Semiring GxB_TIMES_FIRSTI_INT64; +extern GrB_Semiring GxB_TIMES_FIRSTJ1_INT32; +extern GrB_Semiring GxB_TIMES_FIRSTJ1_INT64; +extern GrB_Semiring GxB_TIMES_FIRSTJ_INT32; +extern GrB_Semiring GxB_TIMES_FIRSTJ_INT64; +extern GrB_Semiring GxB_TIMES_FIRST_FC32; +extern GrB_Semiring GxB_TIMES_FIRST_FC64; +extern GrB_Semiring GxB_TIMES_FIRST_FP32; +extern GrB_Semiring GxB_TIMES_FIRST_FP64; +extern GrB_Semiring GxB_TIMES_FIRST_INT8; +extern GrB_Semiring GxB_TIMES_FIRST_INT16; +extern GrB_Semiring GxB_TIMES_FIRST_INT32; +extern GrB_Semiring GxB_TIMES_FIRST_INT64; +extern GrB_Semiring GxB_TIMES_FIRST_UINT8; +extern GrB_Semiring GxB_TIMES_FIRST_UINT16; +extern GrB_Semiring GxB_TIMES_FIRST_UINT32; +extern GrB_Semiring GxB_TIMES_FIRST_UINT64; +extern GrB_Semiring GxB_TIMES_ISEQ_FP32; +extern GrB_Semiring GxB_TIMES_ISEQ_FP64; +extern GrB_Semiring GxB_TIMES_ISEQ_INT8; +extern GrB_Semiring GxB_TIMES_ISEQ_INT16; +extern GrB_Semiring GxB_TIMES_ISEQ_INT32; +extern GrB_Semiring GxB_TIMES_ISEQ_INT64; +extern GrB_Semiring GxB_TIMES_ISEQ_UINT8; +extern GrB_Semiring GxB_TIMES_ISEQ_UINT16; +extern GrB_Semiring GxB_TIMES_ISEQ_UINT32; +extern GrB_Semiring GxB_TIMES_ISEQ_UINT64; +extern GrB_Semiring GxB_TIMES_ISGE_FP32; +extern GrB_Semiring GxB_TIMES_ISGE_FP64; +extern GrB_Semiring GxB_TIMES_ISGE_INT8; +extern GrB_Semiring GxB_TIMES_ISGE_INT16; +extern GrB_Semiring GxB_TIMES_ISGE_INT32; +extern GrB_Semiring GxB_TIMES_ISGE_INT64; +extern GrB_Semiring GxB_TIMES_ISGE_UINT8; +extern GrB_Semiring GxB_TIMES_ISGE_UINT16; +extern GrB_Semiring GxB_TIMES_ISGE_UINT32; +extern GrB_Semiring GxB_TIMES_ISGE_UINT64; +extern GrB_Semiring GxB_TIMES_ISGT_FP32; +extern GrB_Semiring GxB_TIMES_ISGT_FP64; +extern GrB_Semiring GxB_TIMES_ISGT_INT8; +extern GrB_Semiring GxB_TIMES_ISGT_INT16; +extern GrB_Semiring GxB_TIMES_ISGT_INT32; +extern GrB_Semiring GxB_TIMES_ISGT_INT64; +extern GrB_Semiring GxB_TIMES_ISGT_UINT8; +extern GrB_Semiring GxB_TIMES_ISGT_UINT16; +extern GrB_Semiring GxB_TIMES_ISGT_UINT32; +extern GrB_Semiring GxB_TIMES_ISGT_UINT64; +extern GrB_Semiring GxB_TIMES_ISLE_FP32; +extern GrB_Semiring GxB_TIMES_ISLE_FP64; +extern GrB_Semiring GxB_TIMES_ISLE_INT8; +extern GrB_Semiring GxB_TIMES_ISLE_INT16; +extern GrB_Semiring GxB_TIMES_ISLE_INT32; +extern GrB_Semiring GxB_TIMES_ISLE_INT64; +extern GrB_Semiring GxB_TIMES_ISLE_UINT8; +extern GrB_Semiring GxB_TIMES_ISLE_UINT16; +extern GrB_Semiring GxB_TIMES_ISLE_UINT32; +extern GrB_Semiring GxB_TIMES_ISLE_UINT64; +extern GrB_Semiring GxB_TIMES_ISLT_FP32; +extern GrB_Semiring GxB_TIMES_ISLT_FP64; +extern GrB_Semiring GxB_TIMES_ISLT_INT8; +extern GrB_Semiring GxB_TIMES_ISLT_INT16; +extern GrB_Semiring GxB_TIMES_ISLT_INT32; +extern GrB_Semiring GxB_TIMES_ISLT_INT64; +extern GrB_Semiring GxB_TIMES_ISLT_UINT8; +extern GrB_Semiring GxB_TIMES_ISLT_UINT16; +extern GrB_Semiring GxB_TIMES_ISLT_UINT32; +extern GrB_Semiring GxB_TIMES_ISLT_UINT64; +extern GrB_Semiring GxB_TIMES_ISNE_FP32; +extern GrB_Semiring GxB_TIMES_ISNE_FP64; +extern GrB_Semiring GxB_TIMES_ISNE_INT8; +extern GrB_Semiring GxB_TIMES_ISNE_INT16; +extern GrB_Semiring GxB_TIMES_ISNE_INT32; +extern GrB_Semiring GxB_TIMES_ISNE_INT64; +extern GrB_Semiring GxB_TIMES_ISNE_UINT8; +extern GrB_Semiring GxB_TIMES_ISNE_UINT16; +extern GrB_Semiring GxB_TIMES_ISNE_UINT32; +extern GrB_Semiring GxB_TIMES_ISNE_UINT64; +extern GrB_Semiring GxB_TIMES_LAND_FP32; +extern GrB_Semiring GxB_TIMES_LAND_FP64; +extern GrB_Semiring GxB_TIMES_LAND_INT8; +extern GrB_Semiring GxB_TIMES_LAND_INT16; +extern GrB_Semiring GxB_TIMES_LAND_INT32; +extern GrB_Semiring GxB_TIMES_LAND_INT64; +extern GrB_Semiring GxB_TIMES_LAND_UINT8; +extern GrB_Semiring GxB_TIMES_LAND_UINT16; +extern GrB_Semiring GxB_TIMES_LAND_UINT32; +extern GrB_Semiring GxB_TIMES_LAND_UINT64; +extern GrB_Semiring GxB_TIMES_LOR_FP32; +extern GrB_Semiring GxB_TIMES_LOR_FP64; +extern GrB_Semiring GxB_TIMES_LOR_INT8; +extern GrB_Semiring GxB_TIMES_LOR_INT16; +extern GrB_Semiring GxB_TIMES_LOR_INT32; +extern GrB_Semiring GxB_TIMES_LOR_INT64; +extern GrB_Semiring GxB_TIMES_LOR_UINT8; +extern GrB_Semiring GxB_TIMES_LOR_UINT16; +extern GrB_Semiring GxB_TIMES_LOR_UINT32; +extern GrB_Semiring GxB_TIMES_LOR_UINT64; +extern GrB_Semiring GxB_TIMES_LXOR_FP32; +extern GrB_Semiring GxB_TIMES_LXOR_FP64; +extern GrB_Semiring GxB_TIMES_LXOR_INT8; +extern GrB_Semiring GxB_TIMES_LXOR_INT16; +extern GrB_Semiring GxB_TIMES_LXOR_INT32; +extern GrB_Semiring GxB_TIMES_LXOR_INT64; +extern GrB_Semiring GxB_TIMES_LXOR_UINT8; +extern GrB_Semiring GxB_TIMES_LXOR_UINT16; +extern GrB_Semiring GxB_TIMES_LXOR_UINT32; +extern GrB_Semiring GxB_TIMES_LXOR_UINT64; +extern GrB_Semiring GxB_TIMES_MAX_FP32; +extern GrB_Semiring GxB_TIMES_MAX_FP64; +extern GrB_Semiring GxB_TIMES_MAX_INT8; +extern GrB_Semiring GxB_TIMES_MAX_INT16; +extern GrB_Semiring GxB_TIMES_MAX_INT32; +extern GrB_Semiring GxB_TIMES_MAX_INT64; +extern GrB_Semiring GxB_TIMES_MAX_UINT8; +extern GrB_Semiring GxB_TIMES_MAX_UINT16; +extern GrB_Semiring GxB_TIMES_MAX_UINT32; +extern GrB_Semiring GxB_TIMES_MAX_UINT64; +extern GrB_Semiring GxB_TIMES_MINUS_FC32; +extern GrB_Semiring GxB_TIMES_MINUS_FC64; +extern GrB_Semiring GxB_TIMES_MINUS_FP32; +extern GrB_Semiring GxB_TIMES_MINUS_FP64; +extern GrB_Semiring GxB_TIMES_MINUS_INT8; +extern GrB_Semiring GxB_TIMES_MINUS_INT16; +extern GrB_Semiring GxB_TIMES_MINUS_INT32; +extern GrB_Semiring GxB_TIMES_MINUS_INT64; +extern GrB_Semiring GxB_TIMES_MINUS_UINT8; +extern GrB_Semiring GxB_TIMES_MINUS_UINT16; +extern GrB_Semiring GxB_TIMES_MINUS_UINT32; +extern GrB_Semiring GxB_TIMES_MINUS_UINT64; +extern GrB_Semiring GxB_TIMES_MIN_FP32; +extern GrB_Semiring GxB_TIMES_MIN_FP64; +extern GrB_Semiring GxB_TIMES_MIN_INT8; +extern GrB_Semiring GxB_TIMES_MIN_INT16; +extern GrB_Semiring GxB_TIMES_MIN_INT32; +extern GrB_Semiring GxB_TIMES_MIN_INT64; +extern GrB_Semiring GxB_TIMES_MIN_UINT8; +extern GrB_Semiring GxB_TIMES_MIN_UINT16; +extern GrB_Semiring GxB_TIMES_MIN_UINT32; +extern GrB_Semiring GxB_TIMES_MIN_UINT64; +extern GrB_Semiring GxB_TIMES_PAIR_FC32; +extern GrB_Semiring GxB_TIMES_PAIR_FC64; +extern GrB_Semiring GxB_TIMES_PAIR_FP32; +extern GrB_Semiring GxB_TIMES_PAIR_FP64; +extern GrB_Semiring GxB_TIMES_PAIR_INT8; +extern GrB_Semiring GxB_TIMES_PAIR_INT16; +extern GrB_Semiring GxB_TIMES_PAIR_INT32; +extern GrB_Semiring GxB_TIMES_PAIR_INT64; +extern GrB_Semiring GxB_TIMES_PAIR_UINT8; +extern GrB_Semiring GxB_TIMES_PAIR_UINT16; +extern GrB_Semiring GxB_TIMES_PAIR_UINT32; +extern GrB_Semiring GxB_TIMES_PAIR_UINT64; +extern GrB_Semiring GxB_TIMES_PLUS_FC32; +extern GrB_Semiring GxB_TIMES_PLUS_FC64; +extern GrB_Semiring GxB_TIMES_PLUS_FP32; +extern GrB_Semiring GxB_TIMES_PLUS_FP64; +extern GrB_Semiring GxB_TIMES_PLUS_INT8; +extern GrB_Semiring GxB_TIMES_PLUS_INT16; +extern GrB_Semiring GxB_TIMES_PLUS_INT32; +extern GrB_Semiring GxB_TIMES_PLUS_INT64; +extern GrB_Semiring GxB_TIMES_PLUS_UINT8; +extern GrB_Semiring GxB_TIMES_PLUS_UINT16; +extern GrB_Semiring GxB_TIMES_PLUS_UINT32; +extern GrB_Semiring GxB_TIMES_PLUS_UINT64; +extern GrB_Semiring GxB_TIMES_RDIV_FC32; +extern GrB_Semiring GxB_TIMES_RDIV_FC64; +extern GrB_Semiring GxB_TIMES_RDIV_FP32; +extern GrB_Semiring GxB_TIMES_RDIV_FP64; +extern GrB_Semiring GxB_TIMES_RDIV_INT8; +extern GrB_Semiring GxB_TIMES_RDIV_INT16; +extern GrB_Semiring GxB_TIMES_RDIV_INT32; +extern GrB_Semiring GxB_TIMES_RDIV_INT64; +extern GrB_Semiring GxB_TIMES_RDIV_UINT8; +extern GrB_Semiring GxB_TIMES_RDIV_UINT16; +extern GrB_Semiring GxB_TIMES_RDIV_UINT32; +extern GrB_Semiring GxB_TIMES_RDIV_UINT64; +extern GrB_Semiring GxB_TIMES_RMINUS_FC32; +extern GrB_Semiring GxB_TIMES_RMINUS_FC64; +extern GrB_Semiring GxB_TIMES_RMINUS_FP32; +extern GrB_Semiring GxB_TIMES_RMINUS_FP64; +extern GrB_Semiring GxB_TIMES_RMINUS_INT8; +extern GrB_Semiring GxB_TIMES_RMINUS_INT16; +extern GrB_Semiring GxB_TIMES_RMINUS_INT32; +extern GrB_Semiring GxB_TIMES_RMINUS_INT64; +extern GrB_Semiring GxB_TIMES_RMINUS_UINT8; +extern GrB_Semiring GxB_TIMES_RMINUS_UINT16; +extern GrB_Semiring GxB_TIMES_RMINUS_UINT32; +extern GrB_Semiring GxB_TIMES_RMINUS_UINT64; +extern GrB_Semiring GxB_TIMES_SECONDI1_INT32; +extern GrB_Semiring GxB_TIMES_SECONDI1_INT64; +extern GrB_Semiring GxB_TIMES_SECONDI_INT32; +extern GrB_Semiring GxB_TIMES_SECONDI_INT64; +extern GrB_Semiring GxB_TIMES_SECONDJ1_INT32; +extern GrB_Semiring GxB_TIMES_SECONDJ1_INT64; +extern GrB_Semiring GxB_TIMES_SECONDJ_INT32; +extern GrB_Semiring GxB_TIMES_SECONDJ_INT64; +extern GrB_Semiring GxB_TIMES_SECOND_FC32; +extern GrB_Semiring GxB_TIMES_SECOND_FC64; +extern GrB_Semiring GxB_TIMES_SECOND_FP32; +extern GrB_Semiring GxB_TIMES_SECOND_FP64; +extern GrB_Semiring GxB_TIMES_SECOND_INT8; +extern GrB_Semiring GxB_TIMES_SECOND_INT16; +extern GrB_Semiring GxB_TIMES_SECOND_INT32; +extern GrB_Semiring GxB_TIMES_SECOND_INT64; +extern GrB_Semiring GxB_TIMES_SECOND_UINT8; +extern GrB_Semiring GxB_TIMES_SECOND_UINT16; +extern GrB_Semiring GxB_TIMES_SECOND_UINT32; +extern GrB_Semiring GxB_TIMES_SECOND_UINT64; +extern GrB_Semiring GxB_TIMES_TIMES_FC32; +extern GrB_Semiring GxB_TIMES_TIMES_FC64; +extern GrB_Semiring GxB_TIMES_TIMES_FP32; +extern GrB_Semiring GxB_TIMES_TIMES_FP64; +extern GrB_Semiring GxB_TIMES_TIMES_INT8; +extern GrB_Semiring GxB_TIMES_TIMES_INT16; +extern GrB_Semiring GxB_TIMES_TIMES_INT32; +extern GrB_Semiring GxB_TIMES_TIMES_INT64; +extern GrB_Semiring GxB_TIMES_TIMES_UINT8; +extern GrB_Semiring GxB_TIMES_TIMES_UINT16; +extern GrB_Semiring GxB_TIMES_TIMES_UINT32; +extern GrB_Semiring GxB_TIMES_TIMES_UINT64; +extern GrB_Type GxB_FC32; +extern GrB_Type GxB_FC64; +extern GrB_UnaryOp GxB_ABS_FC32; +extern GrB_UnaryOp GxB_ABS_FC64; +extern GrB_UnaryOp GxB_ACOSH_FC32; +extern GrB_UnaryOp GxB_ACOSH_FC64; +extern GrB_UnaryOp GxB_ACOSH_FP32; +extern GrB_UnaryOp GxB_ACOSH_FP64; +extern GrB_UnaryOp GxB_ACOS_FC32; +extern GrB_UnaryOp GxB_ACOS_FC64; +extern GrB_UnaryOp GxB_ACOS_FP32; +extern GrB_UnaryOp GxB_ACOS_FP64; +extern GrB_UnaryOp GxB_AINV_FC32; +extern GrB_UnaryOp GxB_AINV_FC64; +extern GrB_UnaryOp GxB_ASINH_FC32; +extern GrB_UnaryOp GxB_ASINH_FC64; +extern GrB_UnaryOp GxB_ASINH_FP32; +extern GrB_UnaryOp GxB_ASINH_FP64; +extern GrB_UnaryOp GxB_ASIN_FC32; +extern GrB_UnaryOp GxB_ASIN_FC64; +extern GrB_UnaryOp GxB_ASIN_FP32; +extern GrB_UnaryOp GxB_ASIN_FP64; +extern GrB_UnaryOp GxB_ATANH_FC32; +extern GrB_UnaryOp GxB_ATANH_FC64; +extern GrB_UnaryOp GxB_ATANH_FP32; +extern GrB_UnaryOp GxB_ATANH_FP64; +extern GrB_UnaryOp GxB_ATAN_FC32; +extern GrB_UnaryOp GxB_ATAN_FC64; +extern GrB_UnaryOp GxB_ATAN_FP32; +extern GrB_UnaryOp GxB_ATAN_FP64; +extern GrB_UnaryOp GxB_CARG_FC32; +extern GrB_UnaryOp GxB_CARG_FC64; +extern GrB_UnaryOp GxB_CBRT_FP32; +extern GrB_UnaryOp GxB_CBRT_FP64; +extern GrB_UnaryOp GxB_CEIL_FC32; +extern GrB_UnaryOp GxB_CEIL_FC64; +extern GrB_UnaryOp GxB_CEIL_FP32; +extern GrB_UnaryOp GxB_CEIL_FP64; +extern GrB_UnaryOp GxB_CIMAG_FC32; +extern GrB_UnaryOp GxB_CIMAG_FC64; +extern GrB_UnaryOp GxB_CONJ_FC32; +extern GrB_UnaryOp GxB_CONJ_FC64; +extern GrB_UnaryOp GxB_COSH_FC32; +extern GrB_UnaryOp GxB_COSH_FC64; +extern GrB_UnaryOp GxB_COSH_FP32; +extern GrB_UnaryOp GxB_COSH_FP64; +extern GrB_UnaryOp GxB_COS_FC32; +extern GrB_UnaryOp GxB_COS_FC64; +extern GrB_UnaryOp GxB_COS_FP32; +extern GrB_UnaryOp GxB_COS_FP64; +extern GrB_UnaryOp GxB_CREAL_FC32; +extern GrB_UnaryOp GxB_CREAL_FC64; +extern GrB_UnaryOp GxB_ERFC_FP32; +extern GrB_UnaryOp GxB_ERFC_FP64; +extern GrB_UnaryOp GxB_ERF_FP32; +extern GrB_UnaryOp GxB_ERF_FP64; +extern GrB_UnaryOp GxB_EXP2_FC32; +extern GrB_UnaryOp GxB_EXP2_FC64; +extern GrB_UnaryOp GxB_EXP2_FP32; +extern GrB_UnaryOp GxB_EXP2_FP64; +extern GrB_UnaryOp GxB_EXPM1_FC32; +extern GrB_UnaryOp GxB_EXPM1_FC64; +extern GrB_UnaryOp GxB_EXPM1_FP32; +extern GrB_UnaryOp GxB_EXPM1_FP64; +extern GrB_UnaryOp GxB_EXP_FC32; +extern GrB_UnaryOp GxB_EXP_FC64; +extern GrB_UnaryOp GxB_EXP_FP32; +extern GrB_UnaryOp GxB_EXP_FP64; +extern GrB_UnaryOp GxB_FLOOR_FC32; +extern GrB_UnaryOp GxB_FLOOR_FC64; +extern GrB_UnaryOp GxB_FLOOR_FP32; +extern GrB_UnaryOp GxB_FLOOR_FP64; +extern GrB_UnaryOp GxB_FREXPE_FP32; +extern GrB_UnaryOp GxB_FREXPE_FP64; +extern GrB_UnaryOp GxB_FREXPX_FP32; +extern GrB_UnaryOp GxB_FREXPX_FP64; +extern GrB_UnaryOp GxB_IDENTITY_FC32; +extern GrB_UnaryOp GxB_IDENTITY_FC64; +extern GrB_UnaryOp GxB_ISFINITE_FC32; +extern GrB_UnaryOp GxB_ISFINITE_FC64; +extern GrB_UnaryOp GxB_ISFINITE_FP32; +extern GrB_UnaryOp GxB_ISFINITE_FP64; +extern GrB_UnaryOp GxB_ISINF_FC32; +extern GrB_UnaryOp GxB_ISINF_FC64; +extern GrB_UnaryOp GxB_ISINF_FP32; +extern GrB_UnaryOp GxB_ISINF_FP64; +extern GrB_UnaryOp GxB_ISNAN_FC32; +extern GrB_UnaryOp GxB_ISNAN_FC64; +extern GrB_UnaryOp GxB_ISNAN_FP32; +extern GrB_UnaryOp GxB_ISNAN_FP64; +extern GrB_UnaryOp GxB_LGAMMA_FP32; +extern GrB_UnaryOp GxB_LGAMMA_FP64; +extern GrB_UnaryOp GxB_LNOT_BOOL; +extern GrB_UnaryOp GxB_LNOT_FP32; +extern GrB_UnaryOp GxB_LNOT_FP64; +extern GrB_UnaryOp GxB_LNOT_INT8; +extern GrB_UnaryOp GxB_LNOT_INT16; +extern GrB_UnaryOp GxB_LNOT_INT32; +extern GrB_UnaryOp GxB_LNOT_INT64; +extern GrB_UnaryOp GxB_LNOT_UINT8; +extern GrB_UnaryOp GxB_LNOT_UINT16; +extern GrB_UnaryOp GxB_LNOT_UINT32; +extern GrB_UnaryOp GxB_LNOT_UINT64; +extern GrB_UnaryOp GxB_LOG10_FC32; +extern GrB_UnaryOp GxB_LOG10_FC64; +extern GrB_UnaryOp GxB_LOG10_FP32; +extern GrB_UnaryOp GxB_LOG10_FP64; +extern GrB_UnaryOp GxB_LOG1P_FC32; +extern GrB_UnaryOp GxB_LOG1P_FC64; +extern GrB_UnaryOp GxB_LOG1P_FP32; +extern GrB_UnaryOp GxB_LOG1P_FP64; +extern GrB_UnaryOp GxB_LOG2_FC32; +extern GrB_UnaryOp GxB_LOG2_FC64; +extern GrB_UnaryOp GxB_LOG2_FP32; +extern GrB_UnaryOp GxB_LOG2_FP64; +extern GrB_UnaryOp GxB_LOG_FC32; +extern GrB_UnaryOp GxB_LOG_FC64; +extern GrB_UnaryOp GxB_LOG_FP32; +extern GrB_UnaryOp GxB_LOG_FP64; +extern GrB_UnaryOp GxB_MINV_FC32; +extern GrB_UnaryOp GxB_MINV_FC64; +extern GrB_UnaryOp GxB_ONE_BOOL; +extern GrB_UnaryOp GxB_ONE_FC32; +extern GrB_UnaryOp GxB_ONE_FC64; +extern GrB_UnaryOp GxB_ONE_FP32; +extern GrB_UnaryOp GxB_ONE_FP64; +extern GrB_UnaryOp GxB_ONE_INT8; +extern GrB_UnaryOp GxB_ONE_INT16; +extern GrB_UnaryOp GxB_ONE_INT32; +extern GrB_UnaryOp GxB_ONE_INT64; +extern GrB_UnaryOp GxB_ONE_UINT8; +extern GrB_UnaryOp GxB_ONE_UINT16; +extern GrB_UnaryOp GxB_ONE_UINT32; +extern GrB_UnaryOp GxB_ONE_UINT64; +extern GrB_UnaryOp GxB_POSITIONI1_INT32; +extern GrB_UnaryOp GxB_POSITIONI1_INT64; +extern GrB_UnaryOp GxB_POSITIONI_INT32; +extern GrB_UnaryOp GxB_POSITIONI_INT64; +extern GrB_UnaryOp GxB_POSITIONJ1_INT32; +extern GrB_UnaryOp GxB_POSITIONJ1_INT64; +extern GrB_UnaryOp GxB_POSITIONJ_INT32; +extern GrB_UnaryOp GxB_POSITIONJ_INT64; +extern GrB_UnaryOp GxB_ROUND_FC32; +extern GrB_UnaryOp GxB_ROUND_FC64; +extern GrB_UnaryOp GxB_ROUND_FP32; +extern GrB_UnaryOp GxB_ROUND_FP64; +extern GrB_UnaryOp GxB_SIGNUM_FC32; +extern GrB_UnaryOp GxB_SIGNUM_FC64; +extern GrB_UnaryOp GxB_SIGNUM_FP32; +extern GrB_UnaryOp GxB_SIGNUM_FP64; +extern GrB_UnaryOp GxB_SINH_FC32; +extern GrB_UnaryOp GxB_SINH_FC64; +extern GrB_UnaryOp GxB_SINH_FP32; +extern GrB_UnaryOp GxB_SINH_FP64; +extern GrB_UnaryOp GxB_SIN_FC32; +extern GrB_UnaryOp GxB_SIN_FC64; +extern GrB_UnaryOp GxB_SIN_FP32; +extern GrB_UnaryOp GxB_SIN_FP64; +extern GrB_UnaryOp GxB_SQRT_FC32; +extern GrB_UnaryOp GxB_SQRT_FC64; +extern GrB_UnaryOp GxB_SQRT_FP32; +extern GrB_UnaryOp GxB_SQRT_FP64; +extern GrB_UnaryOp GxB_TANH_FC32; +extern GrB_UnaryOp GxB_TANH_FC64; +extern GrB_UnaryOp GxB_TANH_FP32; +extern GrB_UnaryOp GxB_TANH_FP64; +extern GrB_UnaryOp GxB_TAN_FC32; +extern GrB_UnaryOp GxB_TAN_FC64; +extern GrB_UnaryOp GxB_TAN_FP32; +extern GrB_UnaryOp GxB_TAN_FP64; +extern GrB_UnaryOp GxB_TGAMMA_FP32; +extern GrB_UnaryOp GxB_TGAMMA_FP64; +extern GrB_UnaryOp GxB_TRUNC_FC32; +extern GrB_UnaryOp GxB_TRUNC_FC64; +extern GrB_UnaryOp GxB_TRUNC_FP32; +extern GrB_UnaryOp GxB_TRUNC_FP64; + +/* GxB objects */ +extern GxB_SelectOp GxB_DIAG; +extern GxB_SelectOp GxB_EQ_THUNK; +extern GxB_SelectOp GxB_EQ_ZERO; +extern GxB_SelectOp GxB_GE_THUNK; +extern GxB_SelectOp GxB_GE_ZERO; +extern GxB_SelectOp GxB_GT_THUNK; +extern GxB_SelectOp GxB_GT_ZERO; +extern GxB_SelectOp GxB_LE_THUNK; +extern GxB_SelectOp GxB_LE_ZERO; +extern GxB_SelectOp GxB_LT_THUNK; +extern GxB_SelectOp GxB_LT_ZERO; +extern GxB_SelectOp GxB_NE_THUNK; +extern GxB_SelectOp GxB_NONZERO; +extern GxB_SelectOp GxB_OFFDIAG; +extern GxB_SelectOp GxB_TRIL; +extern GxB_SelectOp GxB_TRIU; + +/**************** +* GrB functions * +****************/ + +/* binary */ +extern GrB_Info GrB_BinaryOp_error(const char **error, const GrB_BinaryOp op); +extern GrB_Info GrB_BinaryOp_free(GrB_BinaryOp *binaryop); +extern GrB_Info GrB_BinaryOp_new(GrB_BinaryOp *binaryop, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype); +extern GrB_Info GrB_BinaryOp_wait(GrB_BinaryOp op, GrB_WaitMode waitmode); + +/* core */ +extern GrB_Info GrB_finalize(void); +extern GrB_Info GrB_getVersion(unsigned int *version, unsigned int *subversion); +extern GrB_Info GrB_init(GrB_Mode mode); + +/* descriptor */ +extern GrB_Info GrB_Descriptor_error(const char **error, const GrB_Descriptor d); +extern GrB_Info GrB_Descriptor_free(GrB_Descriptor *descriptor); +extern GrB_Info GrB_Descriptor_new(GrB_Descriptor *descriptor); +extern GrB_Info GrB_Descriptor_set(GrB_Descriptor desc, GrB_Desc_Field field, GrB_Desc_Value val); +extern GrB_Info GrB_Descriptor_wait(GrB_Descriptor desc, GrB_WaitMode waitmode); + +/* indexunary */ +extern GrB_Info GrB_IndexUnaryOp_error(const char **error, const GrB_IndexUnaryOp op); +extern GrB_Info GrB_IndexUnaryOp_free(GrB_IndexUnaryOp *op); +extern GrB_Info GrB_IndexUnaryOp_new(GrB_IndexUnaryOp *op, GxB_index_unary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype); +extern GrB_Info GrB_IndexUnaryOp_wait(GrB_IndexUnaryOp op, GrB_WaitMode waitmode); + +/* matrix */ +extern GrB_Info GrB_Col_assign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); +extern GrB_Info GrB_Col_extract(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_UnaryOp op, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_BinaryOp1st_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, bool x, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_BinaryOp1st_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, float x, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_BinaryOp1st_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, double x, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_BinaryOp1st_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int8_t x, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_BinaryOp1st_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int16_t x, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_BinaryOp1st_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int32_t x, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_BinaryOp1st_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int64_t x, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_BinaryOp1st_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_BinaryOp1st_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const void *x, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_BinaryOp1st_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint8_t x, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_BinaryOp1st_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint16_t x, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_BinaryOp1st_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint32_t x, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_BinaryOp1st_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint64_t x, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, bool y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, float y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, double y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, int8_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, int16_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, int32_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, int64_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Scalar y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const void *y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, uint8_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, uint16_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, uint32_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, uint64_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, bool y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, float y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, double y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int8_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int16_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int32_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int64_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const GrB_Scalar y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const void *y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint8_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint16_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint32_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_apply_IndexOp_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint64_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_assign(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_assign_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_assign_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_assign_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, double x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_assign_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_assign_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_assign_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_assign_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_assign_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_assign_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_assign_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_assign_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_assign_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_assign_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_build_BOOL(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const bool *X, GrB_Index nvals, const GrB_BinaryOp dup); +extern GrB_Info GrB_Matrix_build_FP32(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const float *X, GrB_Index nvals, const GrB_BinaryOp dup); +extern GrB_Info GrB_Matrix_build_FP64(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const double *X, GrB_Index nvals, const GrB_BinaryOp dup); +extern GrB_Info GrB_Matrix_build_INT8(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const int8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +extern GrB_Info GrB_Matrix_build_INT16(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const int16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +extern GrB_Info GrB_Matrix_build_INT32(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const int32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +extern GrB_Info GrB_Matrix_build_INT64(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const int64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +extern GrB_Info GrB_Matrix_build_UDT(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const void *X, GrB_Index nvals, const GrB_BinaryOp dup); +extern GrB_Info GrB_Matrix_build_UINT8(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const uint8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +extern GrB_Info GrB_Matrix_build_UINT16(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const uint16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +extern GrB_Info GrB_Matrix_build_UINT32(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const uint32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +extern GrB_Info GrB_Matrix_build_UINT64(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const uint64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +extern GrB_Info GrB_Matrix_clear(GrB_Matrix A); +extern GrB_Info GrB_Matrix_deserialize(GrB_Matrix *C, GrB_Type type, const void *blob, GrB_Index blob_size); +extern GrB_Info GrB_Matrix_diag(GrB_Matrix *C, const GrB_Vector v, int64_t k); +extern GrB_Info GrB_Matrix_dup(GrB_Matrix *C, const GrB_Matrix A); +extern GrB_Info GrB_Matrix_eWiseAdd_BinaryOp(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_eWiseAdd_Monoid(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_eWiseAdd_Semiring(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_eWiseMult_BinaryOp(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp mult, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_eWiseMult_Monoid(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_eWiseMult_Semiring(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_error(const char **error, const GrB_Matrix A); +extern GrB_Info GrB_Matrix_exportHint(GrB_Format *format, GrB_Matrix A); +extern GrB_Info GrB_Matrix_exportSize(GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +extern GrB_Info GrB_Matrix_export_BOOL(GrB_Index *Ap, GrB_Index *Ai, bool *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +extern GrB_Info GrB_Matrix_export_FP32(GrB_Index *Ap, GrB_Index *Ai, float *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +extern GrB_Info GrB_Matrix_export_FP64(GrB_Index *Ap, GrB_Index *Ai, double *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +extern GrB_Info GrB_Matrix_export_INT8(GrB_Index *Ap, GrB_Index *Ai, int8_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +extern GrB_Info GrB_Matrix_export_INT16(GrB_Index *Ap, GrB_Index *Ai, int16_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +extern GrB_Info GrB_Matrix_export_INT32(GrB_Index *Ap, GrB_Index *Ai, int32_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +extern GrB_Info GrB_Matrix_export_INT64(GrB_Index *Ap, GrB_Index *Ai, int64_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +extern GrB_Info GrB_Matrix_export_UDT(GrB_Index *Ap, GrB_Index *Ai, void *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +extern GrB_Info GrB_Matrix_export_UINT8(GrB_Index *Ap, GrB_Index *Ai, uint8_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +extern GrB_Info GrB_Matrix_export_UINT16(GrB_Index *Ap, GrB_Index *Ai, uint16_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +extern GrB_Info GrB_Matrix_export_UINT32(GrB_Index *Ap, GrB_Index *Ai, uint32_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +extern GrB_Info GrB_Matrix_export_UINT64(GrB_Index *Ap, GrB_Index *Ai, uint64_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +extern GrB_Info GrB_Matrix_extract(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_extractElement_BOOL(bool *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +extern GrB_Info GrB_Matrix_extractElement_FP32(float *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +extern GrB_Info GrB_Matrix_extractElement_FP64(double *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +extern GrB_Info GrB_Matrix_extractElement_INT8(int8_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +extern GrB_Info GrB_Matrix_extractElement_INT16(int16_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +extern GrB_Info GrB_Matrix_extractElement_INT32(int32_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +extern GrB_Info GrB_Matrix_extractElement_INT64(int64_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +extern GrB_Info GrB_Matrix_extractElement_Scalar(GrB_Scalar x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +extern GrB_Info GrB_Matrix_extractElement_UDT(void *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +extern GrB_Info GrB_Matrix_extractElement_UINT8(uint8_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +extern GrB_Info GrB_Matrix_extractElement_UINT16(uint16_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +extern GrB_Info GrB_Matrix_extractElement_UINT32(uint32_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +extern GrB_Info GrB_Matrix_extractElement_UINT64(uint64_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +extern GrB_Info GrB_Matrix_extractTuples_BOOL(GrB_Index *I, GrB_Index *J, bool *X, GrB_Index *nvals, const GrB_Matrix A); +extern GrB_Info GrB_Matrix_extractTuples_FP32(GrB_Index *I, GrB_Index *J, float *X, GrB_Index *nvals, const GrB_Matrix A); +extern GrB_Info GrB_Matrix_extractTuples_FP64(GrB_Index *I, GrB_Index *J, double *X, GrB_Index *nvals, const GrB_Matrix A); +extern GrB_Info GrB_Matrix_extractTuples_INT8(GrB_Index *I, GrB_Index *J, int8_t *X, GrB_Index *nvals, const GrB_Matrix A); +extern GrB_Info GrB_Matrix_extractTuples_INT16(GrB_Index *I, GrB_Index *J, int16_t *X, GrB_Index *nvals, const GrB_Matrix A); +extern GrB_Info GrB_Matrix_extractTuples_INT32(GrB_Index *I, GrB_Index *J, int32_t *X, GrB_Index *nvals, const GrB_Matrix A); +extern GrB_Info GrB_Matrix_extractTuples_INT64(GrB_Index *I, GrB_Index *J, int64_t *X, GrB_Index *nvals, const GrB_Matrix A); +extern GrB_Info GrB_Matrix_extractTuples_UDT(GrB_Index *I, GrB_Index *J, void *X, GrB_Index *nvals, const GrB_Matrix A); +extern GrB_Info GrB_Matrix_extractTuples_UINT8(GrB_Index *I, GrB_Index *J, uint8_t *X, GrB_Index *nvals, const GrB_Matrix A); +extern GrB_Info GrB_Matrix_extractTuples_UINT16(GrB_Index *I, GrB_Index *J, uint16_t *X, GrB_Index *nvals, const GrB_Matrix A); +extern GrB_Info GrB_Matrix_extractTuples_UINT32(GrB_Index *I, GrB_Index *J, uint32_t *X, GrB_Index *nvals, const GrB_Matrix A); +extern GrB_Info GrB_Matrix_extractTuples_UINT64(GrB_Index *I, GrB_Index *J, uint64_t *X, GrB_Index *nvals, const GrB_Matrix A); +extern GrB_Info GrB_Matrix_free(GrB_Matrix *A); +extern GrB_Info GrB_Matrix_import_BOOL(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const bool *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +extern GrB_Info GrB_Matrix_import_FP32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const float *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +extern GrB_Info GrB_Matrix_import_FP64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const double *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +extern GrB_Info GrB_Matrix_import_INT8(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int8_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +extern GrB_Info GrB_Matrix_import_INT16(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int16_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +extern GrB_Info GrB_Matrix_import_INT32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int32_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +extern GrB_Info GrB_Matrix_import_INT64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int64_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +extern GrB_Info GrB_Matrix_import_UDT(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const void *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +extern GrB_Info GrB_Matrix_import_UINT8(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint8_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +extern GrB_Info GrB_Matrix_import_UINT16(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint16_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +extern GrB_Info GrB_Matrix_import_UINT32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint32_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +extern GrB_Info GrB_Matrix_import_UINT64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint64_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +extern GrB_Info GrB_Matrix_kronecker_BinaryOp(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_kronecker_Monoid(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_kronecker_Semiring(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_ncols(GrB_Index *ncols, const GrB_Matrix A); +extern GrB_Info GrB_Matrix_new(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols); +extern GrB_Info GrB_Matrix_nrows(GrB_Index *nrows, const GrB_Matrix A); +extern GrB_Info GrB_Matrix_nvals(GrB_Index *nvals, const GrB_Matrix A); +extern GrB_Info GrB_Matrix_reduce_BOOL(bool *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_reduce_BinaryOp(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_reduce_BinaryOp_Scalar(GrB_Scalar S, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_reduce_FP32(float *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_reduce_FP64(double *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_reduce_INT8(int8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_reduce_INT16(int16_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_reduce_INT32(int32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_reduce_INT64(int64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_reduce_Monoid(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_reduce_Monoid_Scalar(GrB_Scalar c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_reduce_UDT(void *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_reduce_UINT8(uint8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_reduce_UINT16(uint16_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_reduce_UINT32(uint32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_reduce_UINT64(uint64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_removeElement(GrB_Matrix C, GrB_Index i, GrB_Index j); +extern GrB_Info GrB_Matrix_resize(GrB_Matrix C, GrB_Index nrows_new, GrB_Index ncols_new); +extern GrB_Info GrB_Matrix_select_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, bool y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, float y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, double y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int8_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int16_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int32_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int64_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const GrB_Scalar y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const void *y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint8_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint16_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint32_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_select_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint64_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Matrix_serialize(void *blob, GrB_Index *blob_size_handle, GrB_Matrix A); +extern GrB_Info GrB_Matrix_serializeSize(GrB_Index *blob_size_handle, GrB_Matrix A); +extern GrB_Info GrB_Matrix_setElement_BOOL(GrB_Matrix C, bool x, GrB_Index i, GrB_Index j); +extern GrB_Info GrB_Matrix_setElement_FP32(GrB_Matrix C, float x, GrB_Index i, GrB_Index j); +extern GrB_Info GrB_Matrix_setElement_FP64(GrB_Matrix C, double x, GrB_Index i, GrB_Index j); +extern GrB_Info GrB_Matrix_setElement_INT8(GrB_Matrix C, int8_t x, GrB_Index i, GrB_Index j); +extern GrB_Info GrB_Matrix_setElement_INT16(GrB_Matrix C, int16_t x, GrB_Index i, GrB_Index j); +extern GrB_Info GrB_Matrix_setElement_INT32(GrB_Matrix C, int32_t x, GrB_Index i, GrB_Index j); +extern GrB_Info GrB_Matrix_setElement_INT64(GrB_Matrix C, int64_t x, GrB_Index i, GrB_Index j); +extern GrB_Info GrB_Matrix_setElement_Scalar(GrB_Matrix C, GrB_Scalar x, GrB_Index i, GrB_Index j); +extern GrB_Info GrB_Matrix_setElement_UDT(GrB_Matrix C, void *x, GrB_Index i, GrB_Index j); +extern GrB_Info GrB_Matrix_setElement_UINT8(GrB_Matrix C, uint8_t x, GrB_Index i, GrB_Index j); +extern GrB_Info GrB_Matrix_setElement_UINT16(GrB_Matrix C, uint16_t x, GrB_Index i, GrB_Index j); +extern GrB_Info GrB_Matrix_setElement_UINT32(GrB_Matrix C, uint32_t x, GrB_Index i, GrB_Index j); +extern GrB_Info GrB_Matrix_setElement_UINT64(GrB_Matrix C, uint64_t x, GrB_Index i, GrB_Index j); +extern GrB_Info GrB_Matrix_wait(GrB_Matrix A, GrB_WaitMode waitmode); +extern GrB_Info GrB_Row_assign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, GrB_Index i, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +extern GrB_Info GrB_mxm(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); +extern GrB_Info GrB_mxv(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Vector u, const GrB_Descriptor desc); +extern GrB_Info GrB_transpose(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GrB_vxm(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Vector u, const GrB_Matrix A, const GrB_Descriptor desc); + +/* monoid */ +extern GrB_Info GrB_Monoid_error(const char **error, const GrB_Monoid monoid); +extern GrB_Info GrB_Monoid_free(GrB_Monoid *monoid); +extern GrB_Info GrB_Monoid_new_BOOL(GrB_Monoid *monoid, GrB_BinaryOp op, bool identity); +extern GrB_Info GrB_Monoid_new_FP32(GrB_Monoid *monoid, GrB_BinaryOp op, float identity); +extern GrB_Info GrB_Monoid_new_FP64(GrB_Monoid *monoid, GrB_BinaryOp op, double identity); +extern GrB_Info GrB_Monoid_new_INT8(GrB_Monoid *monoid, GrB_BinaryOp op, int8_t identity); +extern GrB_Info GrB_Monoid_new_INT16(GrB_Monoid *monoid, GrB_BinaryOp op, int16_t identity); +extern GrB_Info GrB_Monoid_new_INT32(GrB_Monoid *monoid, GrB_BinaryOp op, int32_t identity); +extern GrB_Info GrB_Monoid_new_INT64(GrB_Monoid *monoid, GrB_BinaryOp op, int64_t identity); +extern GrB_Info GrB_Monoid_new_UDT(GrB_Monoid *monoid, GrB_BinaryOp op, void *identity); +extern GrB_Info GrB_Monoid_new_UINT8(GrB_Monoid *monoid, GrB_BinaryOp op, uint8_t identity); +extern GrB_Info GrB_Monoid_new_UINT16(GrB_Monoid *monoid, GrB_BinaryOp op, uint16_t identity); +extern GrB_Info GrB_Monoid_new_UINT32(GrB_Monoid *monoid, GrB_BinaryOp op, uint32_t identity); +extern GrB_Info GrB_Monoid_new_UINT64(GrB_Monoid *monoid, GrB_BinaryOp op, uint64_t identity); +extern GrB_Info GrB_Monoid_wait(GrB_Monoid monoid, GrB_WaitMode waitmode); + +/* scalar */ +extern GrB_Info GrB_Scalar_clear(GrB_Scalar s); +extern GrB_Info GrB_Scalar_dup(GrB_Scalar *s, const GrB_Scalar t); +extern GrB_Info GrB_Scalar_error(const char **error, const GrB_Scalar s); +extern GrB_Info GrB_Scalar_extractElement_BOOL(bool *x, const GrB_Scalar s); +extern GrB_Info GrB_Scalar_extractElement_FP32(float *x, const GrB_Scalar s); +extern GrB_Info GrB_Scalar_extractElement_FP64(double *x, const GrB_Scalar s); +extern GrB_Info GrB_Scalar_extractElement_INT8(int8_t *x, const GrB_Scalar s); +extern GrB_Info GrB_Scalar_extractElement_INT16(int16_t *x, const GrB_Scalar s); +extern GrB_Info GrB_Scalar_extractElement_INT32(int32_t *x, const GrB_Scalar s); +extern GrB_Info GrB_Scalar_extractElement_INT64(int64_t *x, const GrB_Scalar s); +extern GrB_Info GrB_Scalar_extractElement_UDT(void *x, const GrB_Scalar s); +extern GrB_Info GrB_Scalar_extractElement_UINT8(uint8_t *x, const GrB_Scalar s); +extern GrB_Info GrB_Scalar_extractElement_UINT16(uint16_t *x, const GrB_Scalar s); +extern GrB_Info GrB_Scalar_extractElement_UINT32(uint32_t *x, const GrB_Scalar s); +extern GrB_Info GrB_Scalar_extractElement_UINT64(uint64_t *x, const GrB_Scalar s); +extern GrB_Info GrB_Scalar_free(GrB_Scalar *s); +extern GrB_Info GrB_Scalar_new(GrB_Scalar *s, GrB_Type type); +extern GrB_Info GrB_Scalar_nvals(GrB_Index *nvals, const GrB_Scalar s); +extern GrB_Info GrB_Scalar_setElement_BOOL(GrB_Scalar s, bool x); +extern GrB_Info GrB_Scalar_setElement_FP32(GrB_Scalar s, float x); +extern GrB_Info GrB_Scalar_setElement_FP64(GrB_Scalar s, double x); +extern GrB_Info GrB_Scalar_setElement_INT8(GrB_Scalar s, int8_t x); +extern GrB_Info GrB_Scalar_setElement_INT16(GrB_Scalar s, int16_t x); +extern GrB_Info GrB_Scalar_setElement_INT32(GrB_Scalar s, int32_t x); +extern GrB_Info GrB_Scalar_setElement_INT64(GrB_Scalar s, int64_t x); +extern GrB_Info GrB_Scalar_setElement_UDT(GrB_Scalar s, void *x); +extern GrB_Info GrB_Scalar_setElement_UINT8(GrB_Scalar s, uint8_t x); +extern GrB_Info GrB_Scalar_setElement_UINT16(GrB_Scalar s, uint16_t x); +extern GrB_Info GrB_Scalar_setElement_UINT32(GrB_Scalar s, uint32_t x); +extern GrB_Info GrB_Scalar_setElement_UINT64(GrB_Scalar s, uint64_t x); +extern GrB_Info GrB_Scalar_wait(GrB_Scalar s, GrB_WaitMode waitmode); + +/* semiring */ +extern GrB_Info GrB_Semiring_error(const char **error, const GrB_Semiring semiring); +extern GrB_Info GrB_Semiring_free(GrB_Semiring *semiring); +extern GrB_Info GrB_Semiring_new(GrB_Semiring *semiring, GrB_Monoid add, GrB_BinaryOp multiply); +extern GrB_Info GrB_Semiring_wait(GrB_Semiring semiring, GrB_WaitMode waitmode); + +/* type */ +extern GrB_Info GrB_Type_error(const char **error, const GrB_Type type); +extern GrB_Info GrB_Type_free(GrB_Type *type); +extern GrB_Info GrB_Type_new(GrB_Type *type, size_t sizeof_ctype); +extern GrB_Info GrB_Type_wait(GrB_Type type, GrB_WaitMode waitmode); + +/* unary */ +extern GrB_Info GrB_UnaryOp_error(const char **error, const GrB_UnaryOp op); +extern GrB_Info GrB_UnaryOp_free(GrB_UnaryOp *unaryop); +extern GrB_Info GrB_UnaryOp_new(GrB_UnaryOp *unaryop, GxB_unary_function function, GrB_Type ztype, GrB_Type xtype); +extern GrB_Info GrB_UnaryOp_wait(GrB_UnaryOp op, GrB_WaitMode waitmode); + +/* vector */ +extern GrB_Info GrB_Vector_apply(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_UnaryOp op, const GrB_Vector u, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_BinaryOp1st_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, bool x, const GrB_Vector u, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_BinaryOp1st_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, float x, const GrB_Vector u, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_BinaryOp1st_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, double x, const GrB_Vector u, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_BinaryOp1st_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int8_t x, const GrB_Vector u, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_BinaryOp1st_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int16_t x, const GrB_Vector u, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_BinaryOp1st_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int32_t x, const GrB_Vector u, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_BinaryOp1st_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int64_t x, const GrB_Vector u, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_BinaryOp1st_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Vector u, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_BinaryOp1st_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const void *x, const GrB_Vector u, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_BinaryOp1st_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint8_t x, const GrB_Vector u, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_BinaryOp1st_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint16_t x, const GrB_Vector u, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_BinaryOp1st_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint32_t x, const GrB_Vector u, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_BinaryOp1st_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint64_t x, const GrB_Vector u, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_BinaryOp2nd_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, bool y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_BinaryOp2nd_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, float y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_BinaryOp2nd_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, double y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_BinaryOp2nd_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, int8_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_BinaryOp2nd_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, int16_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_BinaryOp2nd_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, int32_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_BinaryOp2nd_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, int64_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_BinaryOp2nd_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const GrB_Scalar y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_BinaryOp2nd_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const void *y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, uint8_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, uint16_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, uint32_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, uint64_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, bool y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, float y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, double y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int8_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int16_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int32_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int64_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const GrB_Scalar y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const void *y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint8_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint16_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint32_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_apply_IndexOp_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint64_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_assign(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_assign_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_assign_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_assign_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, double x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_assign_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_assign_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_assign_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_assign_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_assign_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_assign_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_assign_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_assign_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_assign_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_assign_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_build_BOOL(GrB_Vector w, const GrB_Index *I, const bool *X, GrB_Index nvals, const GrB_BinaryOp dup); +extern GrB_Info GrB_Vector_build_FP32(GrB_Vector w, const GrB_Index *I, const float *X, GrB_Index nvals, const GrB_BinaryOp dup); +extern GrB_Info GrB_Vector_build_FP64(GrB_Vector w, const GrB_Index *I, const double *X, GrB_Index nvals, const GrB_BinaryOp dup); +extern GrB_Info GrB_Vector_build_INT8(GrB_Vector w, const GrB_Index *I, const int8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +extern GrB_Info GrB_Vector_build_INT16(GrB_Vector w, const GrB_Index *I, const int16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +extern GrB_Info GrB_Vector_build_INT32(GrB_Vector w, const GrB_Index *I, const int32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +extern GrB_Info GrB_Vector_build_INT64(GrB_Vector w, const GrB_Index *I, const int64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +extern GrB_Info GrB_Vector_build_UDT(GrB_Vector w, const GrB_Index *I, const void *X, GrB_Index nvals, const GrB_BinaryOp dup); +extern GrB_Info GrB_Vector_build_UINT8(GrB_Vector w, const GrB_Index *I, const uint8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +extern GrB_Info GrB_Vector_build_UINT16(GrB_Vector w, const GrB_Index *I, const uint16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +extern GrB_Info GrB_Vector_build_UINT32(GrB_Vector w, const GrB_Index *I, const uint32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +extern GrB_Info GrB_Vector_build_UINT64(GrB_Vector w, const GrB_Index *I, const uint64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +extern GrB_Info GrB_Vector_clear(GrB_Vector v); +extern GrB_Info GrB_Vector_dup(GrB_Vector *w, const GrB_Vector u); +extern GrB_Info GrB_Vector_eWiseAdd_BinaryOp(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_eWiseAdd_Monoid(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_eWiseAdd_Semiring(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_eWiseMult_BinaryOp(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp mult, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_eWiseMult_Monoid(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_eWiseMult_Semiring(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_error(const char **error, const GrB_Vector v); +extern GrB_Info GrB_Vector_extract(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_extractElement_BOOL(bool *x, const GrB_Vector v, GrB_Index i); +extern GrB_Info GrB_Vector_extractElement_FP32(float *x, const GrB_Vector v, GrB_Index i); +extern GrB_Info GrB_Vector_extractElement_FP64(double *x, const GrB_Vector v, GrB_Index i); +extern GrB_Info GrB_Vector_extractElement_INT8(int8_t *x, const GrB_Vector v, GrB_Index i); +extern GrB_Info GrB_Vector_extractElement_INT16(int16_t *x, const GrB_Vector v, GrB_Index i); +extern GrB_Info GrB_Vector_extractElement_INT32(int32_t *x, const GrB_Vector v, GrB_Index i); +extern GrB_Info GrB_Vector_extractElement_INT64(int64_t *x, const GrB_Vector v, GrB_Index i); +extern GrB_Info GrB_Vector_extractElement_Scalar(GrB_Scalar x, const GrB_Vector v, GrB_Index i); +extern GrB_Info GrB_Vector_extractElement_UDT(void *x, const GrB_Vector v, GrB_Index i); +extern GrB_Info GrB_Vector_extractElement_UINT8(uint8_t *x, const GrB_Vector v, GrB_Index i); +extern GrB_Info GrB_Vector_extractElement_UINT16(uint16_t *x, const GrB_Vector v, GrB_Index i); +extern GrB_Info GrB_Vector_extractElement_UINT32(uint32_t *x, const GrB_Vector v, GrB_Index i); +extern GrB_Info GrB_Vector_extractElement_UINT64(uint64_t *x, const GrB_Vector v, GrB_Index i); +extern GrB_Info GrB_Vector_extractTuples_BOOL(GrB_Index *I, bool *X, GrB_Index *nvals, const GrB_Vector v); +extern GrB_Info GrB_Vector_extractTuples_FP32(GrB_Index *I, float *X, GrB_Index *nvals, const GrB_Vector v); +extern GrB_Info GrB_Vector_extractTuples_FP64(GrB_Index *I, double *X, GrB_Index *nvals, const GrB_Vector v); +extern GrB_Info GrB_Vector_extractTuples_INT8(GrB_Index *I, int8_t *X, GrB_Index *nvals, const GrB_Vector v); +extern GrB_Info GrB_Vector_extractTuples_INT16(GrB_Index *I, int16_t *X, GrB_Index *nvals, const GrB_Vector v); +extern GrB_Info GrB_Vector_extractTuples_INT32(GrB_Index *I, int32_t *X, GrB_Index *nvals, const GrB_Vector v); +extern GrB_Info GrB_Vector_extractTuples_INT64(GrB_Index *I, int64_t *X, GrB_Index *nvals, const GrB_Vector v); +extern GrB_Info GrB_Vector_extractTuples_UDT(GrB_Index *I, void *X, GrB_Index *nvals, const GrB_Vector v); +extern GrB_Info GrB_Vector_extractTuples_UINT8(GrB_Index *I, uint8_t *X, GrB_Index *nvals, const GrB_Vector v); +extern GrB_Info GrB_Vector_extractTuples_UINT16(GrB_Index *I, uint16_t *X, GrB_Index *nvals, const GrB_Vector v); +extern GrB_Info GrB_Vector_extractTuples_UINT32(GrB_Index *I, uint32_t *X, GrB_Index *nvals, const GrB_Vector v); +extern GrB_Info GrB_Vector_extractTuples_UINT64(GrB_Index *I, uint64_t *X, GrB_Index *nvals, const GrB_Vector v); +extern GrB_Info GrB_Vector_free(GrB_Vector *v); +extern GrB_Info GrB_Vector_new(GrB_Vector *v, GrB_Type type, GrB_Index n); +extern GrB_Info GrB_Vector_nvals(GrB_Index *nvals, const GrB_Vector v); +extern GrB_Info GrB_Vector_reduce_BOOL(bool *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_reduce_BinaryOp_Scalar(GrB_Scalar c, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_reduce_FP32(float *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_reduce_FP64(double *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_reduce_INT8(int8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_reduce_INT16(int16_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_reduce_INT32(int32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_reduce_INT64(int64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_reduce_Monoid_Scalar(GrB_Scalar c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_reduce_UDT(void *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_reduce_UINT8(uint8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_reduce_UINT16(uint16_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_reduce_UINT32(uint32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_reduce_UINT64(uint64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_removeElement(GrB_Vector v, GrB_Index i); +extern GrB_Info GrB_Vector_resize(GrB_Vector w, GrB_Index nrows_new); +extern GrB_Info GrB_Vector_select_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, bool y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, float y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, double y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int8_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int16_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int32_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int64_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const GrB_Scalar y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const void *y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint8_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint16_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint32_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_select_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint64_t y, const GrB_Descriptor desc); +extern GrB_Info GrB_Vector_setElement_BOOL(GrB_Vector w, bool x, GrB_Index i); +extern GrB_Info GrB_Vector_setElement_FP32(GrB_Vector w, float x, GrB_Index i); +extern GrB_Info GrB_Vector_setElement_FP64(GrB_Vector w, double x, GrB_Index i); +extern GrB_Info GrB_Vector_setElement_INT8(GrB_Vector w, int8_t x, GrB_Index i); +extern GrB_Info GrB_Vector_setElement_INT16(GrB_Vector w, int16_t x, GrB_Index i); +extern GrB_Info GrB_Vector_setElement_INT32(GrB_Vector w, int32_t x, GrB_Index i); +extern GrB_Info GrB_Vector_setElement_INT64(GrB_Vector w, int64_t x, GrB_Index i); +extern GrB_Info GrB_Vector_setElement_Scalar(GrB_Vector w, GrB_Scalar x, GrB_Index i); +extern GrB_Info GrB_Vector_setElement_UDT(GrB_Vector w, void *x, GrB_Index i); +extern GrB_Info GrB_Vector_setElement_UINT8(GrB_Vector w, uint8_t x, GrB_Index i); +extern GrB_Info GrB_Vector_setElement_UINT16(GrB_Vector w, uint16_t x, GrB_Index i); +extern GrB_Info GrB_Vector_setElement_UINT32(GrB_Vector w, uint32_t x, GrB_Index i); +extern GrB_Info GrB_Vector_setElement_UINT64(GrB_Vector w, uint64_t x, GrB_Index i); +extern GrB_Info GrB_Vector_size(GrB_Index *n, const GrB_Vector v); +extern GrB_Info GrB_Vector_wait(GrB_Vector v, GrB_WaitMode waitmode); + +/*************** +* GB functions * +***************/ + +/* binary */ +extern GrB_Info GB_BinaryOp_new(GrB_BinaryOp *binaryop, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *binop_name); + +/* iterator */ +extern GrB_Info GB_Iterator_rc_bitmap_next(GxB_Iterator iterator); +extern GrB_Info GB_Iterator_rc_seek(GxB_Iterator iterator, GrB_Index j, bool jth_vector); +extern GrB_Info GB_Vector_Iterator_bitmap_seek(GxB_Iterator iterator, GrB_Index unused); + +/* matrix */ +extern GrB_Info GB_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GxB_Format_Value format, GrB_Descriptor desc); + +/* selectop */ +extern GrB_Info GB_SelectOp_new(GxB_SelectOp *selectop, GxB_select_function function, GrB_Type xtype, GrB_Type ttype, const char *name); + +/* type */ +extern GrB_Info GB_Type_new(GrB_Type *type, size_t sizeof_ctype, const char *type_name); + +/* unary */ +extern GrB_Info GB_UnaryOp_new(GrB_UnaryOp *unaryop, GxB_unary_function function, GrB_Type ztype, GrB_Type xtype, const char *unop_name); + +/**************** +* GxB functions * +****************/ + +/* binary */ +extern GrB_Info GxB_BinaryOp_fprint(GrB_BinaryOp binaryop, const char *name, GxB_Print_Level pr, FILE *f); +extern GrB_Info GxB_BinaryOp_new(GrB_BinaryOp *op, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *binop_name, const char *binop_defn); +extern GrB_Info GxB_BinaryOp_xtype(GrB_Type *xtype, GrB_BinaryOp binaryop); +extern GrB_Info GxB_BinaryOp_xtype_name(char *type_name, const GrB_BinaryOp binaryop); +extern GrB_Info GxB_BinaryOp_ytype(GrB_Type *ytype, GrB_BinaryOp binaryop); +extern GrB_Info GxB_BinaryOp_ytype_name(char *type_name, const GrB_BinaryOp binaryop); +extern GrB_Info GxB_BinaryOp_ztype(GrB_Type *ztype, GrB_BinaryOp binaryop); +extern GrB_Info GxB_BinaryOp_ztype_name(char *type_name, const GrB_BinaryOp binaryop); + +/* core */ +extern GrB_Info GxB_Global_Option_get(GxB_Option_Field field, char *); +extern GrB_Info GxB_Global_Option_set(GxB_Option_Field field, char *); +extern GrB_Info GxB_deserialize_type_name(char *type_name, const void *blob, GrB_Index blob_size); +extern GrB_Info GxB_init(GrB_Mode mode, void *(*user_malloc_function)(size_t), void *(*user_calloc_function)(size_t, size_t), void *(*user_realloc_function)(void *, size_t), void (*user_free_function)(void *)); + +/* descriptor */ +extern GrB_Info GxB_Desc_get(GrB_Descriptor desc, GrB_Desc_Field field, char *); +extern GrB_Info GxB_Desc_set(GrB_Descriptor desc, GrB_Desc_Field field, char *); +extern GrB_Info GxB_Descriptor_fprint(GrB_Descriptor descriptor, const char *name, GxB_Print_Level pr, FILE *f); +extern GrB_Info GxB_Descriptor_get(GrB_Desc_Value *val, GrB_Descriptor desc, GrB_Desc_Field field); + +/* indexunary */ +extern GrB_Info GxB_IndexUnaryOp_fprint(GrB_IndexUnaryOp op, const char *name, GxB_Print_Level pr, FILE *f); +extern GrB_Info GxB_IndexUnaryOp_new(GrB_IndexUnaryOp *op, GxB_index_unary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *idxop_name, const char *idxop_defn); +extern GrB_Info GxB_IndexUnaryOp_xtype_name(char *type_name, const GrB_IndexUnaryOp op); +extern GrB_Info GxB_IndexUnaryOp_ytype_name(char *type_name, const GrB_IndexUnaryOp op); +extern GrB_Info GxB_IndexUnaryOp_ztype_name(char *type_name, const GrB_IndexUnaryOp op); + +/* iterator */ +extern GrB_Index GxB_Matrix_Iterator_getp(GxB_Iterator iterator); +extern GrB_Index GxB_Matrix_Iterator_getpmax(GxB_Iterator iterator); +extern GrB_Index GxB_Vector_Iterator_getIndex(GxB_Iterator iterator); +extern GrB_Index GxB_Vector_Iterator_getp(GxB_Iterator iterator); +extern GrB_Index GxB_Vector_Iterator_getpmax(GxB_Iterator iterator); +extern GrB_Index GxB_colIterator_getColIndex(GxB_Iterator iterator); +extern GrB_Index GxB_colIterator_getRowIndex(GxB_Iterator iterator); +extern GrB_Index GxB_colIterator_kount(GxB_Iterator iterator); +extern GrB_Index GxB_rowIterator_getColIndex(GxB_Iterator iterator); +extern GrB_Index GxB_rowIterator_getRowIndex(GxB_Iterator iterator); +extern GrB_Index GxB_rowIterator_kount(GxB_Iterator iterator); +extern GrB_Info GxB_Iterator_free(GxB_Iterator *iterator); +extern GrB_Info GxB_Iterator_new(GxB_Iterator *iterator); +extern GrB_Info GxB_Matrix_Iterator_next(GxB_Iterator iterator); +extern GrB_Info GxB_Matrix_Iterator_seek(GxB_Iterator iterator, GrB_Index p); +extern GrB_Info GxB_Vector_Iterator_next(GxB_Iterator iterator); +extern GrB_Info GxB_Vector_Iterator_seek(GxB_Iterator iterator, GrB_Index p); +extern GrB_Info GxB_colIterator_kseek(GxB_Iterator iterator, GrB_Index k); +extern GrB_Info GxB_colIterator_nextCol(GxB_Iterator iterator); +extern GrB_Info GxB_colIterator_nextRow(GxB_Iterator iterator); +extern GrB_Info GxB_colIterator_seekCol(GxB_Iterator iterator, GrB_Index col); +extern GrB_Info GxB_rowIterator_kseek(GxB_Iterator iterator, GrB_Index k); +extern GrB_Info GxB_rowIterator_nextCol(GxB_Iterator iterator); +extern GrB_Info GxB_rowIterator_nextRow(GxB_Iterator iterator); +extern GrB_Info GxB_rowIterator_seekRow(GxB_Iterator iterator, GrB_Index row); +extern GxB_FC32_t GxB_Iterator_get_FC32(GxB_Iterator iterator); +extern GxB_FC64_t GxB_Iterator_get_FC64(GxB_Iterator iterator); +extern bool GxB_Iterator_get_BOOL(GxB_Iterator iterator); +extern double GxB_Iterator_get_FP64(GxB_Iterator iterator); +extern float GxB_Iterator_get_FP32(GxB_Iterator iterator); +extern int8_t GxB_Iterator_get_INT8(GxB_Iterator iterator); +extern int16_t GxB_Iterator_get_INT16(GxB_Iterator iterator); +extern int32_t GxB_Iterator_get_INT32(GxB_Iterator iterator); +extern int64_t GxB_Iterator_get_INT64(GxB_Iterator iterator); +extern uint8_t GxB_Iterator_get_UINT8(GxB_Iterator iterator); +extern uint16_t GxB_Iterator_get_UINT16(GxB_Iterator iterator); +extern uint32_t GxB_Iterator_get_UINT32(GxB_Iterator iterator); +extern uint64_t GxB_Iterator_get_UINT64(GxB_Iterator iterator); +extern void GxB_Iterator_get_UDT(GxB_Iterator iterator, void *value); +extern void GxB_Matrix_Iterator_getIndex(GxB_Iterator iterator, GrB_Index *row, GrB_Index *col); + +/* matrix */ +extern GrB_Info GxB_Col_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_Option_get(GrB_Matrix A, GxB_Option_Field field, char *); +extern GrB_Info GxB_Matrix_Option_set(GrB_Matrix A, GxB_Option_Field field, char *); +extern GrB_Info GxB_Matrix_apply_BinaryOp1st(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_apply_BinaryOp1st_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC32_t x, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_apply_BinaryOp1st_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC64_t x, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_apply_BinaryOp2nd(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Scalar y, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_apply_BinaryOp2nd_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, GxB_FC32_t y, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_apply_BinaryOp2nd_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, GxB_FC64_t y, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_apply_IndexOp_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, GxB_FC32_t y, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_apply_IndexOp_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, GxB_FC64_t y, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_assign_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_assign_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_build_FC32(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const GxB_FC32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +extern GrB_Info GxB_Matrix_build_FC64(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const GxB_FC64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +extern GrB_Info GxB_Matrix_build_Scalar(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, GrB_Scalar scalar, GrB_Index nvals); +extern GrB_Info GxB_Matrix_concat(GrB_Matrix C, const GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_deserialize(GrB_Matrix *C, GrB_Type type, const void *blob, GrB_Index blob_size, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_diag(GrB_Matrix C, const GrB_Vector v, int64_t k, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_eWiseUnion(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Matrix A, const GrB_Scalar alpha, const GrB_Matrix B, const GrB_Scalar beta, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_export_BitmapC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_export_BitmapR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_export_CSC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_export_CSR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_export_FC32(GrB_Index *Ap, GrB_Index *Ai, GxB_FC32_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +extern GrB_Info GxB_Matrix_export_FC64(GrB_Index *Ap, GrB_Index *Ai, GxB_FC64_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +extern GrB_Info GxB_Matrix_export_FullC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_export_FullR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_export_HyperCSC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_export_HyperCSR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_extractElement_FC32(GxB_FC32_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +extern GrB_Info GxB_Matrix_extractElement_FC64(GxB_FC64_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +extern GrB_Info GxB_Matrix_extractTuples_FC32(GrB_Index *I, GrB_Index *J, GxB_FC32_t *X, GrB_Index *nvals, const GrB_Matrix A); +extern GrB_Info GxB_Matrix_extractTuples_FC64(GrB_Index *I, GrB_Index *J, GxB_FC64_t *X, GrB_Index *nvals, const GrB_Matrix A); +extern GrB_Info GxB_Matrix_fprint(GrB_Matrix A, const char *name, GxB_Print_Level pr, FILE *f); +extern GrB_Info GxB_Matrix_import_BitmapC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_import_BitmapR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_import_CSC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_import_CSR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_import_FC32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const GxB_FC32_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +extern GrB_Info GxB_Matrix_import_FC64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const GxB_FC64_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +extern GrB_Info GxB_Matrix_import_FullC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_import_FullR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_import_HyperCSC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_import_HyperCSR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_isStoredElement(const GrB_Matrix A, GrB_Index i, GrB_Index j); +extern GrB_Info GxB_Matrix_iso(bool *iso, const GrB_Matrix A); +extern GrB_Info GxB_Matrix_memoryUsage(size_t *size, const GrB_Matrix A); +extern GrB_Info GxB_Matrix_pack_BitmapC(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_pack_BitmapR(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_pack_CSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_pack_CSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_pack_FullC(GrB_Matrix A, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_pack_FullR(GrB_Matrix A, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_pack_HyperCSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_pack_HyperCSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_reduce_FC32(GxB_FC32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_reduce_FC64(GxB_FC64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_reshape(GrB_Matrix C, bool by_col, GrB_Index nrows_new, GrB_Index ncols_new, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_reshapeDup(GrB_Matrix *C, GrB_Matrix A, bool by_col, GrB_Index nrows_new, GrB_Index ncols_new, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_select(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Matrix A, const GrB_Scalar Thunk, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_select_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, GxB_FC32_t y, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_select_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, GxB_FC64_t y, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_serialize(void **blob_handle, GrB_Index *blob_size_handle, GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_setElement_FC32(GrB_Matrix C, GxB_FC32_t x, GrB_Index i, GrB_Index j); +extern GrB_Info GxB_Matrix_setElement_FC64(GrB_Matrix C, GxB_FC64_t x, GrB_Index i, GrB_Index j); +extern GrB_Info GxB_Matrix_sort(GrB_Matrix C, GrB_Matrix P, GrB_BinaryOp op, GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_split(GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Index *Tile_nrows, const GrB_Index *Tile_ncols, const GrB_Matrix A, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_subassign(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_subassign_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_subassign_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_subassign_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_subassign_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_subassign_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, double x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_subassign_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_subassign_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_subassign_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_subassign_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_subassign_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_subassign_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_subassign_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_subassign_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_subassign_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_subassign_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_type(GrB_Type *type, const GrB_Matrix A); +extern GrB_Info GxB_Matrix_type_name(char *type_name, const GrB_Matrix A); +extern GrB_Info GxB_Matrix_unpack_BitmapC(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_unpack_BitmapR(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_unpack_CSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_unpack_CSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_unpack_FullC(GrB_Matrix A, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_unpack_FullR(GrB_Matrix A, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_unpack_HyperCSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Matrix_unpack_HyperCSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Row_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, GrB_Index i, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_diag(GrB_Vector v, const GrB_Matrix A, int64_t k, const GrB_Descriptor desc); +extern GrB_Info GxB_colIterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); +extern GrB_Info GxB_pack_HyperHash(GrB_Matrix A, GrB_Matrix *Y, const GrB_Descriptor desc); +extern GrB_Info GxB_rowIterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); +extern GrB_Info GxB_unpack_HyperHash(GrB_Matrix A, GrB_Matrix *Y, const GrB_Descriptor desc); + +/* monoid */ +extern GrB_Info GxB_Monoid_fprint(GrB_Monoid monoid, const char *name, GxB_Print_Level pr, FILE *f); +extern GrB_Info GxB_Monoid_identity(void *identity, GrB_Monoid monoid); +extern GrB_Info GxB_Monoid_new_FC32(GrB_Monoid *monoid, GrB_BinaryOp op, GxB_FC32_t identity); +extern GrB_Info GxB_Monoid_new_FC64(GrB_Monoid *monoid, GrB_BinaryOp op, GxB_FC64_t identity); +extern GrB_Info GxB_Monoid_operator(GrB_BinaryOp *op, GrB_Monoid monoid); +extern GrB_Info GxB_Monoid_terminal(bool *has_terminal, void *terminal, GrB_Monoid monoid); +extern GrB_Info GxB_Monoid_terminal_new_BOOL(GrB_Monoid *monoid, GrB_BinaryOp op, bool identity, bool terminal); +extern GrB_Info GxB_Monoid_terminal_new_FC32(GrB_Monoid *monoid, GrB_BinaryOp op, GxB_FC32_t identity, GxB_FC32_t terminal); +extern GrB_Info GxB_Monoid_terminal_new_FC64(GrB_Monoid *monoid, GrB_BinaryOp op, GxB_FC64_t identity, GxB_FC64_t terminal); +extern GrB_Info GxB_Monoid_terminal_new_FP32(GrB_Monoid *monoid, GrB_BinaryOp op, float identity, float terminal); +extern GrB_Info GxB_Monoid_terminal_new_FP64(GrB_Monoid *monoid, GrB_BinaryOp op, double identity, double terminal); +extern GrB_Info GxB_Monoid_terminal_new_INT8(GrB_Monoid *monoid, GrB_BinaryOp op, int8_t identity, int8_t terminal); +extern GrB_Info GxB_Monoid_terminal_new_INT16(GrB_Monoid *monoid, GrB_BinaryOp op, int16_t identity, int16_t terminal); +extern GrB_Info GxB_Monoid_terminal_new_INT32(GrB_Monoid *monoid, GrB_BinaryOp op, int32_t identity, int32_t terminal); +extern GrB_Info GxB_Monoid_terminal_new_INT64(GrB_Monoid *monoid, GrB_BinaryOp op, int64_t identity, int64_t terminal); +extern GrB_Info GxB_Monoid_terminal_new_UDT(GrB_Monoid *monoid, GrB_BinaryOp op, void *identity, void *terminal); +extern GrB_Info GxB_Monoid_terminal_new_UINT8(GrB_Monoid *monoid, GrB_BinaryOp op, uint8_t identity, uint8_t terminal); +extern GrB_Info GxB_Monoid_terminal_new_UINT16(GrB_Monoid *monoid, GrB_BinaryOp op, uint16_t identity, uint16_t terminal); +extern GrB_Info GxB_Monoid_terminal_new_UINT32(GrB_Monoid *monoid, GrB_BinaryOp op, uint32_t identity, uint32_t terminal); +extern GrB_Info GxB_Monoid_terminal_new_UINT64(GrB_Monoid *monoid, GrB_BinaryOp op, uint64_t identity, uint64_t terminal); + +/* scalar */ +extern GrB_Info GxB_Scalar_clear(GrB_Scalar s); +extern GrB_Info GxB_Scalar_dup(GrB_Scalar *s, const GrB_Scalar t); +extern GrB_Info GxB_Scalar_error(const char **error, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_extractElement_BOOL(bool *x, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_extractElement_FC32(GxB_FC32_t *x, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_extractElement_FC64(GxB_FC64_t *x, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_extractElement_FP32(float *x, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_extractElement_FP64(double *x, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_extractElement_INT8(int8_t *x, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_extractElement_INT16(int16_t *x, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_extractElement_INT32(int32_t *x, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_extractElement_INT64(int64_t *x, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_extractElement_UDT(void *x, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_extractElement_UINT8(uint8_t *x, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_extractElement_UINT16(uint16_t *x, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_extractElement_UINT32(uint32_t *x, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_extractElement_UINT64(uint64_t *x, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_fprint(GrB_Scalar s, const char *name, GxB_Print_Level pr, FILE *f); +extern GrB_Info GxB_Scalar_free(GrB_Scalar *s); +extern GrB_Info GxB_Scalar_memoryUsage(size_t *size, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_new(GrB_Scalar *s, GrB_Type type); +extern GrB_Info GxB_Scalar_nvals(GrB_Index *nvals, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_setElement_BOOL(GrB_Scalar s, bool x); +extern GrB_Info GxB_Scalar_setElement_FC32(GrB_Scalar s, GxB_FC32_t x); +extern GrB_Info GxB_Scalar_setElement_FC64(GrB_Scalar s, GxB_FC64_t x); +extern GrB_Info GxB_Scalar_setElement_FP32(GrB_Scalar s, float x); +extern GrB_Info GxB_Scalar_setElement_FP64(GrB_Scalar s, double x); +extern GrB_Info GxB_Scalar_setElement_INT8(GrB_Scalar s, int8_t x); +extern GrB_Info GxB_Scalar_setElement_INT16(GrB_Scalar s, int16_t x); +extern GrB_Info GxB_Scalar_setElement_INT32(GrB_Scalar s, int32_t x); +extern GrB_Info GxB_Scalar_setElement_INT64(GrB_Scalar s, int64_t x); +extern GrB_Info GxB_Scalar_setElement_UDT(GrB_Scalar s, void *x); +extern GrB_Info GxB_Scalar_setElement_UINT8(GrB_Scalar s, uint8_t x); +extern GrB_Info GxB_Scalar_setElement_UINT16(GrB_Scalar s, uint16_t x); +extern GrB_Info GxB_Scalar_setElement_UINT32(GrB_Scalar s, uint32_t x); +extern GrB_Info GxB_Scalar_setElement_UINT64(GrB_Scalar s, uint64_t x); +extern GrB_Info GxB_Scalar_type(GrB_Type *type, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_type_name(char *type_name, const GrB_Scalar s); +extern GrB_Info GxB_Scalar_wait(GrB_Scalar *s); + +/* selectop */ +extern GrB_Info GxB_SelectOp_error(const char **error, const GxB_SelectOp op); +extern GrB_Info GxB_SelectOp_fprint(GxB_SelectOp selectop, const char *name, GxB_Print_Level pr, FILE *f); +extern GrB_Info GxB_SelectOp_free(GxB_SelectOp *selectop); +extern GrB_Info GxB_SelectOp_new(GxB_SelectOp *selectop, GxB_select_function function, GrB_Type xtype, GrB_Type ttype); +extern GrB_Info GxB_SelectOp_ttype(GrB_Type *ttype, GxB_SelectOp selectop); +extern GrB_Info GxB_SelectOp_wait(GxB_SelectOp op, GrB_WaitMode waitmode); +extern GrB_Info GxB_SelectOp_xtype(GrB_Type *xtype, GxB_SelectOp selectop); + +/* semiring */ +extern GrB_Info GxB_Semiring_add(GrB_Monoid *add, GrB_Semiring semiring); +extern GrB_Info GxB_Semiring_fprint(GrB_Semiring semiring, const char *name, GxB_Print_Level pr, FILE *f); +extern GrB_Info GxB_Semiring_multiply(GrB_BinaryOp *multiply, GrB_Semiring semiring); + +/* type */ +extern GrB_Info GxB_Type_fprint(GrB_Type type, const char *name, GxB_Print_Level pr, FILE *f); +extern GrB_Info GxB_Type_from_name(GrB_Type *type, const char *type_name); +extern GrB_Info GxB_Type_name(char *type_name, const GrB_Type type); +extern GrB_Info GxB_Type_new(GrB_Type *type, size_t sizeof_ctype, const char *type_name, const char *type_defn); +extern GrB_Info GxB_Type_size(size_t *size, const GrB_Type type); + +/* unary */ +extern GrB_Info GxB_UnaryOp_fprint(GrB_UnaryOp unaryop, const char *name, GxB_Print_Level pr, FILE *f); +extern GrB_Info GxB_UnaryOp_new(GrB_UnaryOp *unaryop, GxB_unary_function function, GrB_Type ztype, GrB_Type xtype, const char *unop_name, const char *unop_defn); +extern GrB_Info GxB_UnaryOp_xtype(GrB_Type *xtype, GrB_UnaryOp unaryop); +extern GrB_Info GxB_UnaryOp_xtype_name(char *type_name, const GrB_UnaryOp unaryop); +extern GrB_Info GxB_UnaryOp_ztype(GrB_Type *ztype, GrB_UnaryOp unaryop); +extern GrB_Info GxB_UnaryOp_ztype_name(char *type_name, const GrB_UnaryOp unaryop); + +/* vector */ +extern GrB_Info GxB_Vector_Iterator_attach(GxB_Iterator iterator, GrB_Vector v, GrB_Descriptor desc); +extern GrB_Info GxB_Vector_Option_get(GrB_Vector A, GxB_Option_Field field, char *); +extern GrB_Info GxB_Vector_Option_set(GrB_Vector A, GxB_Option_Field field, char *); +extern GrB_Info GxB_Vector_apply_BinaryOp1st(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Vector u, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_apply_BinaryOp1st_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC32_t x, const GrB_Vector u, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_apply_BinaryOp1st_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC64_t x, const GrB_Vector u, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_apply_BinaryOp2nd(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const GrB_Scalar y, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_apply_BinaryOp2nd_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, GxB_FC32_t y, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_apply_BinaryOp2nd_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, GxB_FC64_t y, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_apply_IndexOp_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, GxB_FC32_t y, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_apply_IndexOp_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, GxB_FC64_t y, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_assign_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GxB_FC32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_assign_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_build_FC32(GrB_Vector w, const GrB_Index *I, const GxB_FC32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +extern GrB_Info GxB_Vector_build_FC64(GrB_Vector w, const GrB_Index *I, const GxB_FC64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +extern GrB_Info GxB_Vector_build_Scalar(GrB_Vector w, const GrB_Index *I, GrB_Scalar scalar, GrB_Index nvals); +extern GrB_Info GxB_Vector_deserialize(GrB_Vector *w, GrB_Type type, const void *blob, GrB_Index blob_size, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_eWiseUnion(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Vector u, const GrB_Scalar alpha, const GrB_Vector v, const GrB_Scalar beta, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_export_Bitmap(GrB_Vector *v, GrB_Type *type, GrB_Index *n, int8_t **vb, void **vx, GrB_Index *vb_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_export_CSC(GrB_Vector *v, GrB_Type *type, GrB_Index *n, GrB_Index **vi, void **vx, GrB_Index *vi_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, bool *jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_export_Full(GrB_Vector *v, GrB_Type *type, GrB_Index *n, void **vx, GrB_Index *vx_size, bool *iso, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_extractElement_FC32(GxB_FC32_t *x, const GrB_Vector v, GrB_Index i); +extern GrB_Info GxB_Vector_extractElement_FC64(GxB_FC64_t *x, const GrB_Vector v, GrB_Index i); +extern GrB_Info GxB_Vector_extractTuples_FC32(GrB_Index *I, GxB_FC32_t *X, GrB_Index *nvals, const GrB_Vector v); +extern GrB_Info GxB_Vector_extractTuples_FC64(GrB_Index *I, GxB_FC64_t *X, GrB_Index *nvals, const GrB_Vector v); +extern GrB_Info GxB_Vector_fprint(GrB_Vector v, const char *name, GxB_Print_Level pr, FILE *f); +extern GrB_Info GxB_Vector_import_Bitmap(GrB_Vector *v, GrB_Type type, GrB_Index n, int8_t **vb, void **vx, GrB_Index vb_size, GrB_Index vx_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_import_CSC(GrB_Vector *v, GrB_Type type, GrB_Index n, GrB_Index **vi, void **vx, GrB_Index vi_size, GrB_Index vx_size, bool iso, GrB_Index nvals, bool jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_import_Full(GrB_Vector *v, GrB_Type type, GrB_Index n, void **vx, GrB_Index vx_size, bool iso, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_isStoredElement(const GrB_Vector v, GrB_Index i); +extern GrB_Info GxB_Vector_iso(bool *iso, const GrB_Vector v); +extern GrB_Info GxB_Vector_memoryUsage(size_t *size, const GrB_Vector v); +extern GrB_Info GxB_Vector_pack_Bitmap(GrB_Vector v, int8_t **vb, void **vx, GrB_Index vb_size, GrB_Index vx_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_pack_CSC(GrB_Vector v, GrB_Index **vi, void **vx, GrB_Index vi_size, GrB_Index vx_size, bool iso, GrB_Index nvals, bool jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_pack_Full(GrB_Vector v, void **vx, GrB_Index vx_size, bool iso, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_reduce_FC32(GxB_FC32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_reduce_FC64(GxB_FC64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_select(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Vector u, const GrB_Scalar Thunk, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_select_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, GxB_FC32_t y, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_select_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, GxB_FC64_t y, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_serialize(void **blob_handle, GrB_Index *blob_size_handle, GrB_Vector u, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_setElement_FC32(GrB_Vector w, GxB_FC32_t x, GrB_Index i); +extern GrB_Info GxB_Vector_setElement_FC64(GrB_Vector w, GxB_FC64_t x, GrB_Index i); +extern GrB_Info GxB_Vector_sort(GrB_Vector w, GrB_Vector p, GrB_BinaryOp op, GrB_Vector u, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_subassign(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_subassign_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_subassign_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GxB_FC32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_subassign_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_subassign_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_subassign_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, double x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_subassign_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_subassign_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_subassign_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_subassign_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_subassign_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_subassign_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_subassign_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_subassign_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_subassign_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_subassign_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_type(GrB_Type *type, const GrB_Vector v); +extern GrB_Info GxB_Vector_type_name(char *type_name, const GrB_Vector v); +extern GrB_Info GxB_Vector_unpack_Bitmap(GrB_Vector v, int8_t **vb, void **vx, GrB_Index *vb_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_unpack_CSC(GrB_Vector v, GrB_Index **vi, void **vx, GrB_Index *vi_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, bool *jumbled, const GrB_Descriptor desc); +extern GrB_Info GxB_Vector_unpack_Full(GrB_Vector v, void **vx, GrB_Index *vx_size, bool *iso, const GrB_Descriptor desc); + +/* int DEFINES */ +#define GRB_SUBVERSION ... +#define GRB_VERSION ... +#define GrB_INDEX_MAX ... +#define GxB_ANY_SPARSITY ... +#define GxB_AUTO_SPARSITY ... +#define GxB_BACKWARDS ... +#define GxB_BEGIN ... +#define GxB_BITMAP ... +#define GxB_CHUNK ... +#define GxB_COMPRESSION_DEFAULT ... +#define GxB_COMPRESSION_INTEL ... +#define GxB_COMPRESSION_LZ4 ... +#define GxB_COMPRESSION_LZ4HC ... +#define GxB_COMPRESSION_NONE ... +#define GxB_COMPRESSION_ZSTD ... +#define GxB_END ... +#define GxB_FAST_IMPORT ... +#define GxB_FULL ... +#define GxB_GPU_CHUNK ... +#define GxB_GPU_CONTROL ... +#define GxB_HYPERSPARSE ... +#define GxB_IMPLEMENTATION ... +#define GxB_IMPLEMENTATION_MAJOR ... +#define GxB_IMPLEMENTATION_MINOR ... +#define GxB_IMPLEMENTATION_SUB ... +#define GxB_INC ... +#define GxB_INDEX_MAX ... +#define GxB_MAX_NAME_LEN ... +#define GxB_NBITMAP_SWITCH ... +#define GxB_NTHREADS ... +#define GxB_RANGE ... +#define GxB_SPARSE ... +#define GxB_SPEC_MAJOR ... +#define GxB_SPEC_MINOR ... +#define GxB_SPEC_SUB ... +#define GxB_SPEC_VERSION ... +#define GxB_STDC_VERSION ... +#define GxB_STRIDE ... + +/* char* DEFINES */ +extern char *GxB_IMPLEMENTATION_ABOUT_STR; +extern char *GxB_IMPLEMENTATION_DATE_STR; +extern char *GxB_IMPLEMENTATION_LICENSE_STR; +extern char *GxB_IMPLEMENTATION_NAME_STR; +extern char *GxB_SPEC_ABOUT_STR; +extern char *GxB_SPEC_DATE_STR; \ No newline at end of file From 29e1db8cf5455e5045cb01eadbfbb1eb3ddaa370 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Fri, 28 Oct 2022 16:27:15 -0500 Subject: [PATCH 099/193] Possible fix for ppc64le platform (#51) * Possible fix for ppc64le platform --- suitesparse_graphblas/__init__.py | 5 ++++- suitesparse_graphblas/build.py | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/suitesparse_graphblas/__init__.py b/suitesparse_graphblas/__init__.py index 7569034..269f134 100644 --- a/suitesparse_graphblas/__init__.py +++ b/suitesparse_graphblas/__init__.py @@ -7,11 +7,12 @@ import platform _is_osx_arm64 = platform.machine() == "arm64" +_is_ppc64le = platform.machine() == "ppc64le" _c_float = ffi.typeof("float") _c_double = ffi.typeof("double") -if _is_osx_arm64: +if _is_osx_arm64 or _is_ppc64le: def vararg(val): # Interpret float as int32 and double as int64 @@ -25,6 +26,8 @@ def vararg(val): val = ffi.cast("int64_t", val) # Cast variadic argument as char * to force it onto the stack where ARM64 expects it # https://developer.apple.com/documentation/xcode/writing-arm64-code-for-apple-platforms + # + # The same fix *may* work for ppc64le return ffi.cast("char *", val) else: diff --git a/suitesparse_graphblas/build.py b/suitesparse_graphblas/build.py index e8a18ee..78012c5 100644 --- a/suitesparse_graphblas/build.py +++ b/suitesparse_graphblas/build.py @@ -6,6 +6,7 @@ is_win = sys.platform.startswith("win") is_arm64 = platform.machine() == "arm64" +is_ppc64le = platform.machine() == "ppc64le" # Use same header as arm64, which *may* work thisdir = os.path.dirname(__file__) ffibuilder = FFI() @@ -30,7 +31,7 @@ header = "suitesparse_graphblas.h" if is_win: header = "suitesparse_graphblas_no_complex.h" -if is_arm64: +if is_arm64 or is_ppc64le: header = "suitesparse_graphblas_arm64.h" gb_cdef = open(os.path.join(thisdir, header)) From 089599097faca56aa68cdcf5e62dcba5e7daa9fe Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Sun, 6 Nov 2022 00:22:21 -0500 Subject: [PATCH 100/193] Add Python 3.11 to the CI test matrix (#52) --- .github/dependabot.yml | 6 ++++++ .github/workflows/test.yml | 2 +- setup.py | 17 +++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..b18fd29 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: 'github-actions' + directory: '/' + schedule: + interval: 'weekly' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 260c947..8319da4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,7 +18,7 @@ jobs: source: ["conda-forge"] # os: ["ubuntu-latest"] # source: ["source"] - python-version: ["3.8", "3.9", "3.10"] + python-version: ["3.8", "3.9", "3.10", "3.11"] graphblas-version: ["7.3.0"] steps: - name: Checkout diff --git a/setup.py b/setup.py index a98ef46..40a6b7b 100644 --- a/setup.py +++ b/setup.py @@ -78,5 +78,22 @@ license="Apache License 2.0", package_data=package_data, include_package_data=True, + classifiers=[ + "Development Status :: 4 - Beta", + "License :: OSI Approved :: Apache Software License", + "Operating System :: MacOS :: MacOS X", + "Operating System :: POSIX :: Linux", + "Operating System :: Microsoft :: Windows", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3 :: Only", + "Intended Audience :: Science/Research", + "Topic :: Scientific/Engineering", + "Topic :: Scientific/Engineering :: Mathematics", + ], zip_safe=False, ) From d519d7138b7456515082c3122e8a8c1eaca9c358 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 6 Nov 2022 00:41:15 -0500 Subject: [PATCH 101/193] Bump actions/setup-python from 2 to 4 (#53) Bumps [actions/setup-python](https://github.com/actions/setup-python) from 2 to 4. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v2...v4) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 17250da..460068c 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -18,7 +18,7 @@ jobs: - name: Checkout uses: actions/checkout@v2 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: '3.8' - name: Upgrade pip From 59a9e9bf1414589b378961a7997538b903f23681 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 6 Nov 2022 00:56:18 -0500 Subject: [PATCH 102/193] Bump actions/checkout from 2 to 3 (#54) Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/test.yml | 2 +- .github/workflows/wheels.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8319da4..114f672 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,7 +22,7 @@ jobs: graphblas-version: ["7.3.0"] steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Conda uses: conda-incubator/setup-miniconda@v2 with: diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 460068c..f2fda55 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -16,7 +16,7 @@ jobs: os: ["ubuntu-latest"] steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up Python uses: actions/setup-python@v4 with: From 95d5fdc15dc014696c36f3317ceb216fbaf04acf Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Fri, 11 Nov 2022 13:30:29 -0600 Subject: [PATCH 103/193] Update to v7.3.2 (#55) * Update to v7.3.2 Checking source build first (waiting on conda-forge) * Update headers * Use conda-forge in CI --- .github/workflows/test.yml | 2 +- suitesparse_graphblas/create_headers.py | 2 ++ suitesparse_graphblas/suitesparse_graphblas.h | 1 + suitesparse_graphblas/suitesparse_graphblas_arm64.h | 1 + suitesparse_graphblas/suitesparse_graphblas_no_complex.h | 1 + 5 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 114f672..d914301 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,7 +19,7 @@ jobs: # os: ["ubuntu-latest"] # source: ["source"] python-version: ["3.8", "3.9", "3.10", "3.11"] - graphblas-version: ["7.3.0"] + graphblas-version: ["7.3.2"] steps: - name: Checkout uses: actions/checkout@v3 diff --git a/suitesparse_graphblas/create_headers.py b/suitesparse_graphblas/create_headers.py index 675feda..c6f28e0 100644 --- a/suitesparse_graphblas/create_headers.py +++ b/suitesparse_graphblas/create_headers.py @@ -323,6 +323,8 @@ def groupby(index, seq): "GxB_SUITESPARSE_GRAPHBLAS", "NMACRO", "RMM_WRAP_H", + "GXB_COMPLEX_H", + "GxB_STATIC_INLINE_VOID", # deprecated "GxB_HYPER", } diff --git a/suitesparse_graphblas/suitesparse_graphblas.h b/suitesparse_graphblas/suitesparse_graphblas.h index 5de5e6a..951ea29 100644 --- a/suitesparse_graphblas/suitesparse_graphblas.h +++ b/suitesparse_graphblas/suitesparse_graphblas.h @@ -128,6 +128,7 @@ typedef enum GxB_API_URL = 19, GxB_COMPILER_VERSION = 23, GxB_COMPILER_NAME = 24, + GxB_LIBRARY_OPENMP = 25, GxB_GLOBAL_NTHREADS = 5, GxB_GLOBAL_CHUNK = 7, GxB_BURBLE = 99, diff --git a/suitesparse_graphblas/suitesparse_graphblas_arm64.h b/suitesparse_graphblas/suitesparse_graphblas_arm64.h index 887b5d9..5878d99 100644 --- a/suitesparse_graphblas/suitesparse_graphblas_arm64.h +++ b/suitesparse_graphblas/suitesparse_graphblas_arm64.h @@ -128,6 +128,7 @@ typedef enum GxB_API_URL = 19, GxB_COMPILER_VERSION = 23, GxB_COMPILER_NAME = 24, + GxB_LIBRARY_OPENMP = 25, GxB_GLOBAL_NTHREADS = 5, GxB_GLOBAL_CHUNK = 7, GxB_BURBLE = 99, diff --git a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h index f7fbb28..6e9d87f 100644 --- a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h +++ b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h @@ -126,6 +126,7 @@ typedef enum GxB_API_URL = 19, GxB_COMPILER_VERSION = 23, GxB_COMPILER_NAME = 24, + GxB_LIBRARY_OPENMP = 25, GxB_GLOBAL_NTHREADS = 5, GxB_GLOBAL_CHUNK = 7, GxB_BURBLE = 99, From 49acb106410fba01bec4420343909bca7219fc4a Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Mon, 19 Dec 2022 12:39:00 -0600 Subject: [PATCH 104/193] Test against graphblas 7.3.3 (#57) * Test against graphblas 7.3.3 * Make flake8 happy * oops * I like this better (add newline to end of generated files) --- .github/workflows/test.yml | 2 +- setup.cfg | 8 ++++---- suitesparse_graphblas/__init__.py | 2 +- suitesparse_graphblas/create_headers.py | 8 ++++---- suitesparse_graphblas/source.c | 2 +- suitesparse_graphblas/suitesparse_graphblas.h | 2 +- suitesparse_graphblas/suitesparse_graphblas_arm64.h | 2 +- suitesparse_graphblas/suitesparse_graphblas_no_complex.h | 2 +- suitesparse_graphblas/tests/test_io.py | 2 +- suitesparse_graphblas/utils.pxd | 1 - 10 files changed, 15 insertions(+), 16 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d914301..0fa41b9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,7 +19,7 @@ jobs: # os: ["ubuntu-latest"] # source: ["source"] python-version: ["3.8", "3.9", "3.10", "3.11"] - graphblas-version: ["7.3.2"] + graphblas-version: ["7.3.3"] steps: - name: Checkout uses: actions/checkout@v3 diff --git a/setup.cfg b/setup.cfg index 87f71bf..ba61703 100644 --- a/setup.cfg +++ b/setup.cfg @@ -6,10 +6,10 @@ max-line-length = 100 inline-quotes = " exclude = versioneer.py, -ignore = - E203, # whitespace before ':' - E231, # Multiple spaces around "," - W503, # line break before binary operator +extend-ignore = + E203, +# E203 whitespace before ':' (to be compatible with black) +per-file-ignores = suitesparse_graphblas/io/binary.py:C408 [coverage:run] source = suitesparse_graphblas diff --git a/suitesparse_graphblas/__init__.py b/suitesparse_graphblas/__init__.py index 269f134..035bf85 100644 --- a/suitesparse_graphblas/__init__.py +++ b/suitesparse_graphblas/__init__.py @@ -1,7 +1,7 @@ from . import _version from . import exceptions as ex from . import utils -from ._graphblas import ffi, lib # noqa +from ._graphblas import ffi, lib import struct import platform diff --git a/suitesparse_graphblas/create_headers.py b/suitesparse_graphblas/create_headers.py index c6f28e0..20650c3 100644 --- a/suitesparse_graphblas/create_headers.py +++ b/suitesparse_graphblas/create_headers.py @@ -824,7 +824,7 @@ def main(): groups = parse_header(processed_h, skip_complex=False) text = create_header_text(groups) with open(final_h, "w") as f: - f.write("\n".join(text)) + f.write("\n".join(text) + "\n") # Create final header file (arm64) # Replace all variadic arguments (...) with "char *" @@ -833,20 +833,20 @@ def main(): patt = re.compile(r"^(extern GrB_Info .*\(.*)(\.\.\.)(\);)$") text = [patt.sub(r"\1char *\3", line) for line in orig_text] with open(final_arm64_h, "w") as f: - f.write("\n".join(text)) + f.write("\n".join(text) + "\n") # Create final header file (no complex) print(f"Step 5: parse header file to create {final_no_complex_h}") groups_no_complex = parse_header(processed_h, skip_complex=True) text = create_header_text(groups_no_complex) with open(final_no_complex_h, "w") as f: - f.write("\n".join(text)) + f.write("\n".join(text) + "\n") # Create source print(f"Step 6: create {source_c}") text = create_source_text(groups) with open(source_c, "w") as f: - f.write("\n".join(text)) + f.write("\n".join(text) + "\n") # Check defines print("Step 7: check #define definitions") diff --git a/suitesparse_graphblas/source.c b/suitesparse_graphblas/source.c index fa5fae3..9309c64 100644 --- a/suitesparse_graphblas/source.c +++ b/suitesparse_graphblas/source.c @@ -5,4 +5,4 @@ char *GxB_IMPLEMENTATION_DATE_STR = GxB_IMPLEMENTATION_DATE; char *GxB_IMPLEMENTATION_LICENSE_STR = GxB_IMPLEMENTATION_LICENSE; char *GxB_IMPLEMENTATION_NAME_STR = GxB_IMPLEMENTATION_NAME; char *GxB_SPEC_ABOUT_STR = GxB_SPEC_ABOUT; -char *GxB_SPEC_DATE_STR = GxB_SPEC_DATE; \ No newline at end of file +char *GxB_SPEC_DATE_STR = GxB_SPEC_DATE; diff --git a/suitesparse_graphblas/suitesparse_graphblas.h b/suitesparse_graphblas/suitesparse_graphblas.h index 951ea29..b4cd4d3 100644 --- a/suitesparse_graphblas/suitesparse_graphblas.h +++ b/suitesparse_graphblas/suitesparse_graphblas.h @@ -3466,4 +3466,4 @@ extern char *GxB_IMPLEMENTATION_DATE_STR; extern char *GxB_IMPLEMENTATION_LICENSE_STR; extern char *GxB_IMPLEMENTATION_NAME_STR; extern char *GxB_SPEC_ABOUT_STR; -extern char *GxB_SPEC_DATE_STR; \ No newline at end of file +extern char *GxB_SPEC_DATE_STR; diff --git a/suitesparse_graphblas/suitesparse_graphblas_arm64.h b/suitesparse_graphblas/suitesparse_graphblas_arm64.h index 5878d99..aebc23a 100644 --- a/suitesparse_graphblas/suitesparse_graphblas_arm64.h +++ b/suitesparse_graphblas/suitesparse_graphblas_arm64.h @@ -3466,4 +3466,4 @@ extern char *GxB_IMPLEMENTATION_DATE_STR; extern char *GxB_IMPLEMENTATION_LICENSE_STR; extern char *GxB_IMPLEMENTATION_NAME_STR; extern char *GxB_SPEC_ABOUT_STR; -extern char *GxB_SPEC_DATE_STR; \ No newline at end of file +extern char *GxB_SPEC_DATE_STR; diff --git a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h index 6e9d87f..5839081 100644 --- a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h +++ b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h @@ -3234,4 +3234,4 @@ extern char *GxB_IMPLEMENTATION_DATE_STR; extern char *GxB_IMPLEMENTATION_LICENSE_STR; extern char *GxB_IMPLEMENTATION_NAME_STR; extern char *GxB_SPEC_ABOUT_STR; -extern char *GxB_SPEC_DATE_STR; \ No newline at end of file +extern char *GxB_SPEC_DATE_STR; diff --git a/suitesparse_graphblas/tests/test_io.py b/suitesparse_graphblas/tests/test_io.py index 00184f6..a5e56b9 100644 --- a/suitesparse_graphblas/tests/test_io.py +++ b/suitesparse_graphblas/tests/test_io.py @@ -24,7 +24,7 @@ if platform.system() == "Windows": pytest.skip("skipping windows-only tests", allow_module_level=True) -from suitesparse_graphblas.io import binary # noqa isort:skip +from suitesparse_graphblas.io import binary # isort:skip NULL = ffi.NULL diff --git a/suitesparse_graphblas/utils.pxd b/suitesparse_graphblas/utils.pxd index 9ffb23a..69a279e 100644 --- a/suitesparse_graphblas/utils.pxd +++ b/suitesparse_graphblas/utils.pxd @@ -38,4 +38,3 @@ cpdef ndarray claim_buffer_2d( ) cpdef unclaim_buffer(ndarray array) - From d36c2cf53d75587b20ddf11e67f48637cd530aaa Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Mon, 26 Dec 2022 14:12:04 -0600 Subject: [PATCH 105/193] SuiteSparse:GraphBLAS v740 branch (#58) * SuiteSparse:GraphBLAS v740 branch * Use non-variadic functions for get and set for greater compatibility * black * Install GraphBLAS from conda-forge --- .github/workflows/test.yml | 2 +- suitesparse_graphblas/__init__.py | 15 ++++++----- suitesparse_graphblas/io/serialize.py | 6 ++--- suitesparse_graphblas/matrix.py | 26 +++++++++---------- suitesparse_graphblas/suitesparse_graphblas.h | 22 ++++++++++++++++ .../suitesparse_graphblas_arm64.h | 22 ++++++++++++++++ .../suitesparse_graphblas_no_complex.h | 22 ++++++++++++++++ 7 files changed, 91 insertions(+), 24 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0fa41b9..1f110a9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,7 +19,7 @@ jobs: # os: ["ubuntu-latest"] # source: ["source"] python-version: ["3.8", "3.9", "3.10", "3.11"] - graphblas-version: ["7.3.3"] + graphblas-version: ["7.4.0"] steps: - name: Checkout uses: actions/checkout@v3 diff --git a/suitesparse_graphblas/__init__.py b/suitesparse_graphblas/__init__.py index 035bf85..596d31a 100644 --- a/suitesparse_graphblas/__init__.py +++ b/suitesparse_graphblas/__init__.py @@ -12,6 +12,9 @@ _c_double = ffi.typeof("double") +# It is strongly recommended to use the non-variadic version of functions to be +# compatible with the most number of architectures. For example, you should use +# GxB_Matrix_Option_get_INT32 instead of GxB_Matrix_Option_get. if _is_osx_arm64 or _is_ppc64le: def vararg(val): @@ -38,8 +41,8 @@ def vararg(val): def is_initialized(): """Is GraphBLAS initialized via GrB_init or GxB_init?""" - mode = ffi.new("GrB_Mode*") - return lib.GxB_Global_Option_get(lib.GxB_MODE, vararg(mode)) != lib.GrB_PANIC + mode = ffi.new("int32_t*") + return lib.GxB_Global_Option_get_INT32(lib.GxB_MODE, mode) != lib.GrB_PANIC def supports_complex(): @@ -246,8 +249,8 @@ def __init__(self): @property def is_enabled(self): """Is burble enabled?""" - val_ptr = ffi.new("bool*") - info = lib.GxB_Global_Option_get(lib.GxB_BURBLE, vararg(val_ptr)) + val_ptr = ffi.new("int32_t*") + info = lib.GxB_Global_Option_get_INT32(lib.GxB_BURBLE, val_ptr) if info != lib.GrB_SUCCESS: raise _error_code_lookup[info]( "Failed to get burble status (has GraphBLAS been initialized?" @@ -256,7 +259,7 @@ def is_enabled(self): def enable(self): """Enable diagnostic output""" - info = lib.GxB_Global_Option_set(lib.GxB_BURBLE, vararg(ffi.cast("int", 1))) + info = lib.GxB_Global_Option_set_INT32(lib.GxB_BURBLE, ffi.cast("int32_t", 1)) if info != lib.GrB_SUCCESS: raise _error_code_lookup[info]( "Failed to enable burble (has GraphBLAS been initialized?" @@ -264,7 +267,7 @@ def enable(self): def disable(self): """Disable diagnostic output""" - info = lib.GxB_Global_Option_set(lib.GxB_BURBLE, vararg(ffi.cast("int", 0))) + info = lib.GxB_Global_Option_set_INT32(lib.GxB_BURBLE, ffi.cast("int32_t", 0)) if info != lib.GrB_SUCCESS: raise _error_code_lookup[info]( "Failed to disable burble (has GraphBLAS been initialized?" diff --git a/suitesparse_graphblas/io/serialize.py b/suitesparse_graphblas/io/serialize.py index 1755b81..78818c0 100644 --- a/suitesparse_graphblas/io/serialize.py +++ b/suitesparse_graphblas/io/serialize.py @@ -1,6 +1,6 @@ import numpy as np -from suitesparse_graphblas import check_status, ffi, lib, vararg +from suitesparse_graphblas import check_status, ffi, lib from suitesparse_graphblas.utils import claim_buffer @@ -22,7 +22,7 @@ def get_serialize_desc(compression=lib.GxB_COMPRESSION_DEFAULT, level=None, nthr if nthreads is not None: check_status( desc, - lib.GxB_Desc_set(desc[0], lib.GxB_NTHREADS, vararg(ffi.cast("int", nthreads))), + lib.GxB_Desc_set_INT32(desc[0], lib.GxB_NTHREADS, ffi.cast("int32_t", nthreads)), ) if compression is not None: if level is not None and compression in { @@ -32,7 +32,7 @@ def get_serialize_desc(compression=lib.GxB_COMPRESSION_DEFAULT, level=None, nthr compression += level check_status( desc, - lib.GxB_Desc_set(desc[0], lib.GxB_COMPRESSION, vararg(ffi.cast("int", compression))), + lib.GxB_Desc_set_INT32(desc[0], lib.GxB_COMPRESSION, ffi.cast("int32_t", compression)), ) return desc diff --git a/suitesparse_graphblas/matrix.py b/suitesparse_graphblas/matrix.py index 0e62040..7b7aff1 100644 --- a/suitesparse_graphblas/matrix.py +++ b/suitesparse_graphblas/matrix.py @@ -1,4 +1,4 @@ -from suitesparse_graphblas import check_status, ffi, lib, vararg +from suitesparse_graphblas import check_status, ffi, lib from .io.serialize import deserialize_matrix as deserialize # noqa from .io.serialize import serialize_matrix as serialize # noqa @@ -108,8 +108,8 @@ def format(A): True """ - format = ffi.new("GxB_Format_Value*") - check_status(A, lib.GxB_Matrix_Option_get(A[0], lib.GxB_FORMAT, vararg(format))) + format = ffi.new("int32_t*") + check_status(A, lib.GxB_Matrix_Option_get_INT32(A[0], lib.GxB_FORMAT, format)) return format[0] @@ -122,16 +122,14 @@ def set_format(A, format): True """ - format_val = ffi.cast("GxB_Format_Value", format) - check_status(A, lib.GxB_Matrix_Option_set(A[0], lib.GxB_FORMAT, vararg(format_val))) + format_val = ffi.cast("int32_t", format) + check_status(A, lib.GxB_Matrix_Option_set_INT32(A[0], lib.GxB_FORMAT, format_val)) def sparsity_status(A): """Get the sparsity status of the matrix.""" sparsity_status = ffi.new("int32_t*") - check_status( - A, lib.GxB_Matrix_Option_get(A[0], lib.GxB_SPARSITY_STATUS, vararg(sparsity_status)) - ) + check_status(A, lib.GxB_Matrix_Option_get_INT32(A[0], lib.GxB_SPARSITY_STATUS, sparsity_status)) return sparsity_status[0] @@ -139,7 +137,7 @@ def sparsity_control(A): """Get the sparsity control of the matrix.""" sparsity_control = ffi.new("int32_t*") check_status( - A, lib.GxB_Matrix_Option_get(A[0], lib.GxB_SPARSITY_CONTROL, vararg(sparsity_control)) + A, lib.GxB_Matrix_Option_get_INT32(A[0], lib.GxB_SPARSITY_CONTROL, sparsity_control) ) return sparsity_control[0] @@ -148,34 +146,34 @@ def set_sparsity_control(A, sparsity): """Set the sparsity control of the matrix.""" sparsity_control = ffi.cast("int32_t", sparsity) check_status( - A, lib.GxB_Matrix_Option_set(A[0], lib.GxB_SPARSITY_CONTROL, vararg(sparsity_control)) + A, lib.GxB_Matrix_Option_set_INT32(A[0], lib.GxB_SPARSITY_CONTROL, sparsity_control) ) def hyper_switch(A): """Get the hyper switch of the matrix.""" hyper_switch = ffi.new("double*") - check_status(A, lib.GxB_Matrix_Option_get(A[0], lib.GxB_HYPER_SWITCH, vararg(hyper_switch))) + check_status(A, lib.GxB_Matrix_Option_get_FP64(A[0], lib.GxB_HYPER_SWITCH, hyper_switch)) return hyper_switch[0] def set_hyper_switch(A, hyper_switch): """Set the hyper switch of the matrix.""" hyper_switch = ffi.cast("double", hyper_switch) - check_status(A, lib.GxB_Matrix_Option_set(A[0], lib.GxB_HYPER_SWITCH, vararg(hyper_switch))) + check_status(A, lib.GxB_Matrix_Option_set_FP64(A[0], lib.GxB_HYPER_SWITCH, hyper_switch)) def bitmap_switch(A): """Get the bitmap switch of the matrix.""" bitmap_switch = ffi.new("double*") - check_status(A, lib.GxB_Matrix_Option_get(A[0], lib.GxB_BITMAP_SWITCH, vararg(bitmap_switch))) + check_status(A, lib.GxB_Matrix_Option_get_FP64(A[0], lib.GxB_BITMAP_SWITCH, bitmap_switch)) return bitmap_switch[0] def set_bitmap_switch(A, bitmap_switch): """Set the bitmap switch of the matrix.""" bitmap_switch = ffi.cast("double", bitmap_switch) - check_status(A, lib.GxB_Matrix_Option_set(A[0], lib.GxB_BITMAP_SWITCH, vararg(bitmap_switch))) + check_status(A, lib.GxB_Matrix_Option_set_FP64(A[0], lib.GxB_BITMAP_SWITCH, bitmap_switch)) def set_bool(A, value, i, j): diff --git a/suitesparse_graphblas/suitesparse_graphblas.h b/suitesparse_graphblas/suitesparse_graphblas.h index b4cd4d3..49816cf 100644 --- a/suitesparse_graphblas/suitesparse_graphblas.h +++ b/suitesparse_graphblas/suitesparse_graphblas.h @@ -3099,13 +3099,27 @@ extern GrB_Info GxB_BinaryOp_ztype_name(char *type_name, const GrB_BinaryOp bina /* core */ extern GrB_Info GxB_Global_Option_get(GxB_Option_Field field, ...); +extern GrB_Info GxB_Global_Option_get_CHAR(GxB_Option_Field field, char **value); +extern GrB_Info GxB_Global_Option_get_FP64(GxB_Option_Field field, double *value); +extern GrB_Info GxB_Global_Option_get_FUNCTION(GxB_Option_Field field, void **value); +extern GrB_Info GxB_Global_Option_get_INT32(GxB_Option_Field field, int32_t *value); +extern GrB_Info GxB_Global_Option_get_INT64(GxB_Option_Field field, int64_t *value); extern GrB_Info GxB_Global_Option_set(GxB_Option_Field field, ...); +extern GrB_Info GxB_Global_Option_set_FP64(GxB_Option_Field field, double value); +extern GrB_Info GxB_Global_Option_set_FP64_ARRAY(GxB_Option_Field field, double *value); +extern GrB_Info GxB_Global_Option_set_FUNCTION(GxB_Option_Field field, void *value); +extern GrB_Info GxB_Global_Option_set_INT32(GxB_Option_Field field, int32_t value); +extern GrB_Info GxB_Global_Option_set_INT64_ARRAY(GxB_Option_Field field, int64_t *value); extern GrB_Info GxB_deserialize_type_name(char *type_name, const void *blob, GrB_Index blob_size); extern GrB_Info GxB_init(GrB_Mode mode, void *(*user_malloc_function)(size_t), void *(*user_calloc_function)(size_t, size_t), void *(*user_realloc_function)(void *, size_t), void (*user_free_function)(void *)); /* descriptor */ extern GrB_Info GxB_Desc_get(GrB_Descriptor desc, GrB_Desc_Field field, ...); +extern GrB_Info GxB_Desc_get_FP64(GrB_Descriptor desc, GrB_Desc_Field field, double *value); +extern GrB_Info GxB_Desc_get_INT32(GrB_Descriptor desc, GrB_Desc_Field field, int32_t *value); extern GrB_Info GxB_Desc_set(GrB_Descriptor desc, GrB_Desc_Field field, ...); +extern GrB_Info GxB_Desc_set_FP64(GrB_Descriptor desc, GrB_Desc_Field field, double value); +extern GrB_Info GxB_Desc_set_INT32(GrB_Descriptor desc, GrB_Desc_Field field, int32_t value); extern GrB_Info GxB_Descriptor_fprint(GrB_Descriptor descriptor, const char *name, GxB_Print_Level pr, FILE *f); extern GrB_Info GxB_Descriptor_get(GrB_Desc_Value *val, GrB_Descriptor desc, GrB_Desc_Field field); @@ -3162,7 +3176,11 @@ extern void GxB_Matrix_Iterator_getIndex(GxB_Iterator iterator, GrB_Index *row, extern GrB_Info GxB_Col_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); extern GrB_Info GxB_Matrix_Option_get(GrB_Matrix A, GxB_Option_Field field, ...); +extern GrB_Info GxB_Matrix_Option_get_FP64(GrB_Matrix A, GxB_Option_Field field, double *value); +extern GrB_Info GxB_Matrix_Option_get_INT32(GrB_Matrix A, GxB_Option_Field field, int32_t *value); extern GrB_Info GxB_Matrix_Option_set(GrB_Matrix A, GxB_Option_Field field, ...); +extern GrB_Info GxB_Matrix_Option_set_FP64(GrB_Matrix A, GxB_Option_Field field, double value); +extern GrB_Info GxB_Matrix_Option_set_INT32(GrB_Matrix A, GxB_Option_Field field, int32_t value); extern GrB_Info GxB_Matrix_apply_BinaryOp1st(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_apply_BinaryOp1st_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC32_t x, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_apply_BinaryOp1st_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC64_t x, const GrB_Matrix A, const GrB_Descriptor desc); @@ -3356,7 +3374,11 @@ extern GrB_Info GxB_UnaryOp_ztype_name(char *type_name, const GrB_UnaryOp unaryo /* vector */ extern GrB_Info GxB_Vector_Iterator_attach(GxB_Iterator iterator, GrB_Vector v, GrB_Descriptor desc); extern GrB_Info GxB_Vector_Option_get(GrB_Vector A, GxB_Option_Field field, ...); +extern GrB_Info GxB_Vector_Option_get_FP64(GrB_Vector v, GxB_Option_Field field, double *value); +extern GrB_Info GxB_Vector_Option_get_INT32(GrB_Vector v, GxB_Option_Field field, int32_t *value); extern GrB_Info GxB_Vector_Option_set(GrB_Vector A, GxB_Option_Field field, ...); +extern GrB_Info GxB_Vector_Option_set_FP64(GrB_Vector v, GxB_Option_Field field, double value); +extern GrB_Info GxB_Vector_Option_set_INT32(GrB_Vector v, GxB_Option_Field field, int32_t value); extern GrB_Info GxB_Vector_apply_BinaryOp1st(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_apply_BinaryOp1st_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC32_t x, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_apply_BinaryOp1st_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC64_t x, const GrB_Vector u, const GrB_Descriptor desc); diff --git a/suitesparse_graphblas/suitesparse_graphblas_arm64.h b/suitesparse_graphblas/suitesparse_graphblas_arm64.h index aebc23a..99960fc 100644 --- a/suitesparse_graphblas/suitesparse_graphblas_arm64.h +++ b/suitesparse_graphblas/suitesparse_graphblas_arm64.h @@ -3099,13 +3099,27 @@ extern GrB_Info GxB_BinaryOp_ztype_name(char *type_name, const GrB_BinaryOp bina /* core */ extern GrB_Info GxB_Global_Option_get(GxB_Option_Field field, char *); +extern GrB_Info GxB_Global_Option_get_CHAR(GxB_Option_Field field, char **value); +extern GrB_Info GxB_Global_Option_get_FP64(GxB_Option_Field field, double *value); +extern GrB_Info GxB_Global_Option_get_FUNCTION(GxB_Option_Field field, void **value); +extern GrB_Info GxB_Global_Option_get_INT32(GxB_Option_Field field, int32_t *value); +extern GrB_Info GxB_Global_Option_get_INT64(GxB_Option_Field field, int64_t *value); extern GrB_Info GxB_Global_Option_set(GxB_Option_Field field, char *); +extern GrB_Info GxB_Global_Option_set_FP64(GxB_Option_Field field, double value); +extern GrB_Info GxB_Global_Option_set_FP64_ARRAY(GxB_Option_Field field, double *value); +extern GrB_Info GxB_Global_Option_set_FUNCTION(GxB_Option_Field field, void *value); +extern GrB_Info GxB_Global_Option_set_INT32(GxB_Option_Field field, int32_t value); +extern GrB_Info GxB_Global_Option_set_INT64_ARRAY(GxB_Option_Field field, int64_t *value); extern GrB_Info GxB_deserialize_type_name(char *type_name, const void *blob, GrB_Index blob_size); extern GrB_Info GxB_init(GrB_Mode mode, void *(*user_malloc_function)(size_t), void *(*user_calloc_function)(size_t, size_t), void *(*user_realloc_function)(void *, size_t), void (*user_free_function)(void *)); /* descriptor */ extern GrB_Info GxB_Desc_get(GrB_Descriptor desc, GrB_Desc_Field field, char *); +extern GrB_Info GxB_Desc_get_FP64(GrB_Descriptor desc, GrB_Desc_Field field, double *value); +extern GrB_Info GxB_Desc_get_INT32(GrB_Descriptor desc, GrB_Desc_Field field, int32_t *value); extern GrB_Info GxB_Desc_set(GrB_Descriptor desc, GrB_Desc_Field field, char *); +extern GrB_Info GxB_Desc_set_FP64(GrB_Descriptor desc, GrB_Desc_Field field, double value); +extern GrB_Info GxB_Desc_set_INT32(GrB_Descriptor desc, GrB_Desc_Field field, int32_t value); extern GrB_Info GxB_Descriptor_fprint(GrB_Descriptor descriptor, const char *name, GxB_Print_Level pr, FILE *f); extern GrB_Info GxB_Descriptor_get(GrB_Desc_Value *val, GrB_Descriptor desc, GrB_Desc_Field field); @@ -3162,7 +3176,11 @@ extern void GxB_Matrix_Iterator_getIndex(GxB_Iterator iterator, GrB_Index *row, extern GrB_Info GxB_Col_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); extern GrB_Info GxB_Matrix_Option_get(GrB_Matrix A, GxB_Option_Field field, char *); +extern GrB_Info GxB_Matrix_Option_get_FP64(GrB_Matrix A, GxB_Option_Field field, double *value); +extern GrB_Info GxB_Matrix_Option_get_INT32(GrB_Matrix A, GxB_Option_Field field, int32_t *value); extern GrB_Info GxB_Matrix_Option_set(GrB_Matrix A, GxB_Option_Field field, char *); +extern GrB_Info GxB_Matrix_Option_set_FP64(GrB_Matrix A, GxB_Option_Field field, double value); +extern GrB_Info GxB_Matrix_Option_set_INT32(GrB_Matrix A, GxB_Option_Field field, int32_t value); extern GrB_Info GxB_Matrix_apply_BinaryOp1st(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_apply_BinaryOp1st_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC32_t x, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_apply_BinaryOp1st_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC64_t x, const GrB_Matrix A, const GrB_Descriptor desc); @@ -3356,7 +3374,11 @@ extern GrB_Info GxB_UnaryOp_ztype_name(char *type_name, const GrB_UnaryOp unaryo /* vector */ extern GrB_Info GxB_Vector_Iterator_attach(GxB_Iterator iterator, GrB_Vector v, GrB_Descriptor desc); extern GrB_Info GxB_Vector_Option_get(GrB_Vector A, GxB_Option_Field field, char *); +extern GrB_Info GxB_Vector_Option_get_FP64(GrB_Vector v, GxB_Option_Field field, double *value); +extern GrB_Info GxB_Vector_Option_get_INT32(GrB_Vector v, GxB_Option_Field field, int32_t *value); extern GrB_Info GxB_Vector_Option_set(GrB_Vector A, GxB_Option_Field field, char *); +extern GrB_Info GxB_Vector_Option_set_FP64(GrB_Vector v, GxB_Option_Field field, double value); +extern GrB_Info GxB_Vector_Option_set_INT32(GrB_Vector v, GxB_Option_Field field, int32_t value); extern GrB_Info GxB_Vector_apply_BinaryOp1st(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_apply_BinaryOp1st_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC32_t x, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_apply_BinaryOp1st_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC64_t x, const GrB_Vector u, const GrB_Descriptor desc); diff --git a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h index 5839081..f8ac38f 100644 --- a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h +++ b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h @@ -2925,13 +2925,27 @@ extern GrB_Info GxB_BinaryOp_ztype_name(char *type_name, const GrB_BinaryOp bina /* core */ extern GrB_Info GxB_Global_Option_get(GxB_Option_Field field, ...); +extern GrB_Info GxB_Global_Option_get_CHAR(GxB_Option_Field field, char **value); +extern GrB_Info GxB_Global_Option_get_FP64(GxB_Option_Field field, double *value); +extern GrB_Info GxB_Global_Option_get_FUNCTION(GxB_Option_Field field, void **value); +extern GrB_Info GxB_Global_Option_get_INT32(GxB_Option_Field field, int32_t *value); +extern GrB_Info GxB_Global_Option_get_INT64(GxB_Option_Field field, int64_t *value); extern GrB_Info GxB_Global_Option_set(GxB_Option_Field field, ...); +extern GrB_Info GxB_Global_Option_set_FP64(GxB_Option_Field field, double value); +extern GrB_Info GxB_Global_Option_set_FP64_ARRAY(GxB_Option_Field field, double *value); +extern GrB_Info GxB_Global_Option_set_FUNCTION(GxB_Option_Field field, void *value); +extern GrB_Info GxB_Global_Option_set_INT32(GxB_Option_Field field, int32_t value); +extern GrB_Info GxB_Global_Option_set_INT64_ARRAY(GxB_Option_Field field, int64_t *value); extern GrB_Info GxB_deserialize_type_name(char *type_name, const void *blob, GrB_Index blob_size); extern GrB_Info GxB_init(GrB_Mode mode, void *(*user_malloc_function)(size_t), void *(*user_calloc_function)(size_t, size_t), void *(*user_realloc_function)(void *, size_t), void (*user_free_function)(void *)); /* descriptor */ extern GrB_Info GxB_Desc_get(GrB_Descriptor desc, GrB_Desc_Field field, ...); +extern GrB_Info GxB_Desc_get_FP64(GrB_Descriptor desc, GrB_Desc_Field field, double *value); +extern GrB_Info GxB_Desc_get_INT32(GrB_Descriptor desc, GrB_Desc_Field field, int32_t *value); extern GrB_Info GxB_Desc_set(GrB_Descriptor desc, GrB_Desc_Field field, ...); +extern GrB_Info GxB_Desc_set_FP64(GrB_Descriptor desc, GrB_Desc_Field field, double value); +extern GrB_Info GxB_Desc_set_INT32(GrB_Descriptor desc, GrB_Desc_Field field, int32_t value); extern GrB_Info GxB_Descriptor_fprint(GrB_Descriptor descriptor, const char *name, GxB_Print_Level pr, FILE *f); extern GrB_Info GxB_Descriptor_get(GrB_Desc_Value *val, GrB_Descriptor desc, GrB_Desc_Field field); @@ -2986,7 +3000,11 @@ extern void GxB_Matrix_Iterator_getIndex(GxB_Iterator iterator, GrB_Index *row, extern GrB_Info GxB_Col_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); extern GrB_Info GxB_Matrix_Option_get(GrB_Matrix A, GxB_Option_Field field, ...); +extern GrB_Info GxB_Matrix_Option_get_FP64(GrB_Matrix A, GxB_Option_Field field, double *value); +extern GrB_Info GxB_Matrix_Option_get_INT32(GrB_Matrix A, GxB_Option_Field field, int32_t *value); extern GrB_Info GxB_Matrix_Option_set(GrB_Matrix A, GxB_Option_Field field, ...); +extern GrB_Info GxB_Matrix_Option_set_FP64(GrB_Matrix A, GxB_Option_Field field, double value); +extern GrB_Info GxB_Matrix_Option_set_INT32(GrB_Matrix A, GxB_Option_Field field, int32_t value); extern GrB_Info GxB_Matrix_apply_BinaryOp1st(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Matrix A, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_apply_BinaryOp2nd(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Scalar y, const GrB_Descriptor desc); extern GrB_Info GxB_Matrix_build_Scalar(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, GrB_Scalar scalar, GrB_Index nvals); @@ -3146,7 +3164,11 @@ extern GrB_Info GxB_UnaryOp_ztype_name(char *type_name, const GrB_UnaryOp unaryo /* vector */ extern GrB_Info GxB_Vector_Iterator_attach(GxB_Iterator iterator, GrB_Vector v, GrB_Descriptor desc); extern GrB_Info GxB_Vector_Option_get(GrB_Vector A, GxB_Option_Field field, ...); +extern GrB_Info GxB_Vector_Option_get_FP64(GrB_Vector v, GxB_Option_Field field, double *value); +extern GrB_Info GxB_Vector_Option_get_INT32(GrB_Vector v, GxB_Option_Field field, int32_t *value); extern GrB_Info GxB_Vector_Option_set(GrB_Vector A, GxB_Option_Field field, ...); +extern GrB_Info GxB_Vector_Option_set_FP64(GrB_Vector v, GxB_Option_Field field, double value); +extern GrB_Info GxB_Vector_Option_set_INT32(GrB_Vector v, GxB_Option_Field field, int32_t value); extern GrB_Info GxB_Vector_apply_BinaryOp1st(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Vector u, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_apply_BinaryOp2nd(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const GrB_Scalar y, const GrB_Descriptor desc); extern GrB_Info GxB_Vector_build_Scalar(GrB_Vector w, const GrB_Index *I, GrB_Scalar scalar, GrB_Index nvals); From f5d6c95f2046700e0c1c791de4db70f10bd5a562 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Thu, 29 Dec 2022 20:59:26 -0600 Subject: [PATCH 106/193] Specify which `noqa` codes apply (#59) `$ ruff --line-length=100 --add-noqa suitesparse_graphblas/` --- suitesparse_graphblas/io/binary.py | 2 +- suitesparse_graphblas/io/serialize.py | 2 +- suitesparse_graphblas/matrix.py | 4 ++-- suitesparse_graphblas/tests/test_package.py | 2 +- suitesparse_graphblas/tests/test_scalar.py | 2 +- suitesparse_graphblas/vector.py | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/suitesparse_graphblas/io/binary.py b/suitesparse_graphblas/io/binary.py index c3d6d9f..0248e7b 100644 --- a/suitesparse_graphblas/io/binary.py +++ b/suitesparse_graphblas/io/binary.py @@ -242,7 +242,7 @@ def binwrite(A, filename, comments=None, opener=Path.open): f"{lib.GxB_IMPLEMENTATION_SUB}" ) - vars = dict( + vars = dict( # noqa: C408 suitesparse_version=suitesparse_version, user_agent="pygraphblas-" + __version__, nrows=nrows[0], diff --git a/suitesparse_graphblas/io/serialize.py b/suitesparse_graphblas/io/serialize.py index 78818c0..fcc7804 100644 --- a/suitesparse_graphblas/io/serialize.py +++ b/suitesparse_graphblas/io/serialize.py @@ -140,4 +140,4 @@ def deserialize_vector(data, *, free=True, nthreads=None): return v -from suitesparse_graphblas import matrix, vector # noqa isort:skip +from suitesparse_graphblas import matrix, vector # noqa: E402 isort:skip diff --git a/suitesparse_graphblas/matrix.py b/suitesparse_graphblas/matrix.py index 7b7aff1..5efa15d 100644 --- a/suitesparse_graphblas/matrix.py +++ b/suitesparse_graphblas/matrix.py @@ -1,7 +1,7 @@ from suitesparse_graphblas import check_status, ffi, lib -from .io.serialize import deserialize_matrix as deserialize # noqa -from .io.serialize import serialize_matrix as serialize # noqa +from .io.serialize import deserialize_matrix as deserialize # noqa: F401 +from .io.serialize import serialize_matrix as serialize # noqa: F401 def free(A): diff --git a/suitesparse_graphblas/tests/test_package.py b/suitesparse_graphblas/tests/test_package.py index 7a0c910..ad4d807 100644 --- a/suitesparse_graphblas/tests/test_package.py +++ b/suitesparse_graphblas/tests/test_package.py @@ -1,4 +1,4 @@ -from suitesparse_graphblas import ffi, lib # noqa +from suitesparse_graphblas import ffi, lib # noqa: F401 def test_matrix_existence(): diff --git a/suitesparse_graphblas/tests/test_scalar.py b/suitesparse_graphblas/tests/test_scalar.py index 6c1a74a..d413c29 100644 --- a/suitesparse_graphblas/tests/test_scalar.py +++ b/suitesparse_graphblas/tests/test_scalar.py @@ -1,6 +1,6 @@ import pytest -from suitesparse_graphblas import ffi, lib, supports_complex # noqa +from suitesparse_graphblas import ffi, lib, supports_complex # noqa: F401 @pytest.mark.skipif("not supports_complex()") diff --git a/suitesparse_graphblas/vector.py b/suitesparse_graphblas/vector.py index 16fd707..a6a15c6 100644 --- a/suitesparse_graphblas/vector.py +++ b/suitesparse_graphblas/vector.py @@ -1,7 +1,7 @@ from suitesparse_graphblas import check_status, ffi, lib -from .io.serialize import deserialize_vector as deserialize # noqa -from .io.serialize import serialize_vector as serialize # noqa +from .io.serialize import deserialize_vector as deserialize # noqa: F401 +from .io.serialize import serialize_vector as serialize # noqa: F401 def free(v): From faf5feef94f06b09f693da88e7d0173fa88cb4ad Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Mon, 2 Jan 2023 12:24:53 -0600 Subject: [PATCH 107/193] Process v741 branch with GB_PUBLIC as the empty string (#60) * Process v741 branch with GB_PUBLIC as the empty string * Don't use GB_PUBLIC at all (it could be removed) * with 7.4.1.beta3 --- .github/workflows/test.yml | 17 +- suitesparse_graphblas/create_headers.py | 15 +- suitesparse_graphblas/suitesparse_graphblas.h | 1500 ++++++++--------- .../suitesparse_graphblas_arm64.h | 1500 ++++++++--------- .../suitesparse_graphblas_no_complex.h | 1384 +++++++-------- 5 files changed, 2212 insertions(+), 2204 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1f110a9..ef0e116 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,12 +14,12 @@ jobs: strategy: fail-fast: false matrix: - os: ["ubuntu-latest", "macos-latest", "windows-latest"] - source: ["conda-forge"] - # os: ["ubuntu-latest"] - # source: ["source"] + # os: ["ubuntu-latest", "macos-latest", "windows-latest"] + # source: ["conda-forge"] + os: ["ubuntu-latest"] + source: ["source"] python-version: ["3.8", "3.9", "3.10", "3.11"] - graphblas-version: ["7.4.0"] + graphblas-version: ["7.4.1.beta3"] steps: - name: Checkout uses: actions/checkout@v3 @@ -40,8 +40,15 @@ jobs: run: | # This isn't working! Why not? # sh suitesparse.sh refs/tags/${{ matrix.graphblas-version }} + + # From tag curl -L https://github.com/DrTimothyAldenDavis/GraphBLAS/archive/refs/tags/v${{ matrix.graphblas-version }}.tar.gz | tar xzf - pushd GraphBLAS-${{ matrix.graphblas-version }}/build + + # From branch + # curl -L https://github.com/DrTimothyAldenDavis/GraphBLAS/tarball/${{ matrix.graphblas-version }} | tar xzf - + # pushd DrTim*/build + echo ${CONDA_PREFIX} cmake -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release .. cat Makefile diff --git a/suitesparse_graphblas/create_headers.py b/suitesparse_graphblas/create_headers.py index 20650c3..8e973a3 100644 --- a/suitesparse_graphblas/create_headers.py +++ b/suitesparse_graphblas/create_headers.py @@ -315,6 +315,7 @@ def groupby(index, seq): "GxB", "CMPLX", "CMPLXF", + "GB_GLOBAL", "GB_PUBLIC", "GB_restrict", "GRAPHBLAS_H", @@ -364,21 +365,21 @@ def get_groups(ast): seen = set() groups = {} - vals = {x for x in lines if "extern GrB_Info GxB" in x} - seen - vals |= {x for x in lines if "extern " in x and "GxB_Iterator" in x and "GB" not in x} - seen + vals = {x for x in lines if "GrB_Info GxB" in x} - seen + vals |= {x for x in lines if "GxB_Iterator" in x and "GB" not in x} - seen seen.update(vals) groups["GxB methods"] = sorted(vals, key=sort_key) - vals = {x for x in lines if "extern GrB_Info GrB" in x} - seen + vals = {x for x in lines if "GrB_Info GrB" in x} - seen seen.update(vals) groups["GrB methods"] = sorted(vals, key=sort_key) - vals = {x for x in lines if "extern GrB_Info GB" in x} - seen - vals |= {x for x in lines if "extern " in x and "GxB_Iterator" in x and "GB" in x} - seen + vals = {x for x in lines if "GrB_Info GB" in x} - seen + vals |= {x for x in lines if "GxB_Iterator" in x and "GB" in x and "typedef" not in x} - seen seen.update(vals) groups["GB methods"] = sorted(vals, key=sort_key) - missing_methods = {x for x in lines if "extern GrB_Info " in x} - seen + missing_methods = {x for x in lines if "GrB_Info " in x} - seen assert not missing_methods, ", ".join(sorted(missing_methods)) vals = {x for x in lines if "extern GrB" in x} - seen @@ -584,7 +585,7 @@ def __init__(self): self.functions = [] def visit_Decl(self, node): - if isinstance(node.type, c_ast.FuncDecl) and node.storage == ["extern"]: + if isinstance(node.type, c_ast.FuncDecl) and node.storage == []: self.functions.append(node) def handle_function_node(node): diff --git a/suitesparse_graphblas/suitesparse_graphblas.h b/suitesparse_graphblas/suitesparse_graphblas.h index 49816cf..39630af 100644 --- a/suitesparse_graphblas/suitesparse_graphblas.h +++ b/suitesparse_graphblas/suitesparse_graphblas.h @@ -2625,822 +2625,822 @@ extern GxB_SelectOp GxB_TRIU; ****************/ /* binary */ -extern GrB_Info GrB_BinaryOp_error(const char **error, const GrB_BinaryOp op); -extern GrB_Info GrB_BinaryOp_free(GrB_BinaryOp *binaryop); -extern GrB_Info GrB_BinaryOp_new(GrB_BinaryOp *binaryop, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype); -extern GrB_Info GrB_BinaryOp_wait(GrB_BinaryOp op, GrB_WaitMode waitmode); +GrB_Info GrB_BinaryOp_error(const char **error, const GrB_BinaryOp op); +GrB_Info GrB_BinaryOp_free(GrB_BinaryOp *binaryop); +GrB_Info GrB_BinaryOp_new(GrB_BinaryOp *binaryop, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype); +GrB_Info GrB_BinaryOp_wait(GrB_BinaryOp op, GrB_WaitMode waitmode); /* core */ -extern GrB_Info GrB_finalize(void); -extern GrB_Info GrB_getVersion(unsigned int *version, unsigned int *subversion); -extern GrB_Info GrB_init(GrB_Mode mode); +GrB_Info GrB_finalize(void); +GrB_Info GrB_getVersion(unsigned int *version, unsigned int *subversion); +GrB_Info GrB_init(GrB_Mode mode); /* descriptor */ -extern GrB_Info GrB_Descriptor_error(const char **error, const GrB_Descriptor d); -extern GrB_Info GrB_Descriptor_free(GrB_Descriptor *descriptor); -extern GrB_Info GrB_Descriptor_new(GrB_Descriptor *descriptor); -extern GrB_Info GrB_Descriptor_set(GrB_Descriptor desc, GrB_Desc_Field field, GrB_Desc_Value val); -extern GrB_Info GrB_Descriptor_wait(GrB_Descriptor desc, GrB_WaitMode waitmode); +GrB_Info GrB_Descriptor_error(const char **error, const GrB_Descriptor d); +GrB_Info GrB_Descriptor_free(GrB_Descriptor *descriptor); +GrB_Info GrB_Descriptor_new(GrB_Descriptor *descriptor); +GrB_Info GrB_Descriptor_set(GrB_Descriptor desc, GrB_Desc_Field field, GrB_Desc_Value val); +GrB_Info GrB_Descriptor_wait(GrB_Descriptor desc, GrB_WaitMode waitmode); /* indexunary */ -extern GrB_Info GrB_IndexUnaryOp_error(const char **error, const GrB_IndexUnaryOp op); -extern GrB_Info GrB_IndexUnaryOp_free(GrB_IndexUnaryOp *op); -extern GrB_Info GrB_IndexUnaryOp_new(GrB_IndexUnaryOp *op, GxB_index_unary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype); -extern GrB_Info GrB_IndexUnaryOp_wait(GrB_IndexUnaryOp op, GrB_WaitMode waitmode); +GrB_Info GrB_IndexUnaryOp_error(const char **error, const GrB_IndexUnaryOp op); +GrB_Info GrB_IndexUnaryOp_free(GrB_IndexUnaryOp *op); +GrB_Info GrB_IndexUnaryOp_new(GrB_IndexUnaryOp *op, GxB_index_unary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype); +GrB_Info GrB_IndexUnaryOp_wait(GrB_IndexUnaryOp op, GrB_WaitMode waitmode); /* matrix */ -extern GrB_Info GrB_Col_assign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); -extern GrB_Info GrB_Col_extract(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_UnaryOp op, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp1st_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, bool x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp1st_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, float x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp1st_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, double x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp1st_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int8_t x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp1st_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int16_t x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp1st_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int32_t x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp1st_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int64_t x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp1st_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp1st_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const void *x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp1st_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint8_t x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp1st_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint16_t x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp1st_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint32_t x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp1st_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint64_t x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, bool y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, float y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, double y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, int8_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, int16_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, int32_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, int64_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Scalar y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const void *y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, uint8_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, uint16_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, uint32_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, uint64_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, bool y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, float y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, double y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int8_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int16_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int32_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int64_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const GrB_Scalar y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const void *y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint8_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint16_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint32_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint64_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_assign(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_assign_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_assign_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_assign_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, double x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_assign_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_assign_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_assign_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_assign_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_assign_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_assign_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_assign_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_assign_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_assign_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_assign_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_build_BOOL(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const bool *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Matrix_build_FP32(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const float *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Matrix_build_FP64(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const double *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Matrix_build_INT8(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const int8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Matrix_build_INT16(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const int16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Matrix_build_INT32(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const int32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Matrix_build_INT64(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const int64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Matrix_build_UDT(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const void *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Matrix_build_UINT8(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const uint8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Matrix_build_UINT16(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const uint16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Matrix_build_UINT32(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const uint32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Matrix_build_UINT64(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const uint64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Matrix_clear(GrB_Matrix A); -extern GrB_Info GrB_Matrix_deserialize(GrB_Matrix *C, GrB_Type type, const void *blob, GrB_Index blob_size); -extern GrB_Info GrB_Matrix_diag(GrB_Matrix *C, const GrB_Vector v, int64_t k); -extern GrB_Info GrB_Matrix_dup(GrB_Matrix *C, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_eWiseAdd_BinaryOp(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_eWiseAdd_Monoid(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_eWiseAdd_Semiring(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_eWiseMult_BinaryOp(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp mult, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_eWiseMult_Monoid(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_eWiseMult_Semiring(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_error(const char **error, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_exportHint(GrB_Format *format, GrB_Matrix A); -extern GrB_Info GrB_Matrix_exportSize(GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -extern GrB_Info GrB_Matrix_export_BOOL(GrB_Index *Ap, GrB_Index *Ai, bool *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -extern GrB_Info GrB_Matrix_export_FP32(GrB_Index *Ap, GrB_Index *Ai, float *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -extern GrB_Info GrB_Matrix_export_FP64(GrB_Index *Ap, GrB_Index *Ai, double *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -extern GrB_Info GrB_Matrix_export_INT8(GrB_Index *Ap, GrB_Index *Ai, int8_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -extern GrB_Info GrB_Matrix_export_INT16(GrB_Index *Ap, GrB_Index *Ai, int16_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -extern GrB_Info GrB_Matrix_export_INT32(GrB_Index *Ap, GrB_Index *Ai, int32_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -extern GrB_Info GrB_Matrix_export_INT64(GrB_Index *Ap, GrB_Index *Ai, int64_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -extern GrB_Info GrB_Matrix_export_UDT(GrB_Index *Ap, GrB_Index *Ai, void *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -extern GrB_Info GrB_Matrix_export_UINT8(GrB_Index *Ap, GrB_Index *Ai, uint8_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -extern GrB_Info GrB_Matrix_export_UINT16(GrB_Index *Ap, GrB_Index *Ai, uint16_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -extern GrB_Info GrB_Matrix_export_UINT32(GrB_Index *Ap, GrB_Index *Ai, uint32_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -extern GrB_Info GrB_Matrix_export_UINT64(GrB_Index *Ap, GrB_Index *Ai, uint64_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -extern GrB_Info GrB_Matrix_extract(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_extractElement_BOOL(bool *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_extractElement_FP32(float *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_extractElement_FP64(double *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_extractElement_INT8(int8_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_extractElement_INT16(int16_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_extractElement_INT32(int32_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_extractElement_INT64(int64_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_extractElement_Scalar(GrB_Scalar x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_extractElement_UDT(void *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_extractElement_UINT8(uint8_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_extractElement_UINT16(uint16_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_extractElement_UINT32(uint32_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_extractElement_UINT64(uint64_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_extractTuples_BOOL(GrB_Index *I, GrB_Index *J, bool *X, GrB_Index *nvals, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_extractTuples_FP32(GrB_Index *I, GrB_Index *J, float *X, GrB_Index *nvals, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_extractTuples_FP64(GrB_Index *I, GrB_Index *J, double *X, GrB_Index *nvals, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_extractTuples_INT8(GrB_Index *I, GrB_Index *J, int8_t *X, GrB_Index *nvals, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_extractTuples_INT16(GrB_Index *I, GrB_Index *J, int16_t *X, GrB_Index *nvals, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_extractTuples_INT32(GrB_Index *I, GrB_Index *J, int32_t *X, GrB_Index *nvals, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_extractTuples_INT64(GrB_Index *I, GrB_Index *J, int64_t *X, GrB_Index *nvals, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_extractTuples_UDT(GrB_Index *I, GrB_Index *J, void *X, GrB_Index *nvals, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_extractTuples_UINT8(GrB_Index *I, GrB_Index *J, uint8_t *X, GrB_Index *nvals, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_extractTuples_UINT16(GrB_Index *I, GrB_Index *J, uint16_t *X, GrB_Index *nvals, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_extractTuples_UINT32(GrB_Index *I, GrB_Index *J, uint32_t *X, GrB_Index *nvals, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_extractTuples_UINT64(GrB_Index *I, GrB_Index *J, uint64_t *X, GrB_Index *nvals, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_free(GrB_Matrix *A); -extern GrB_Info GrB_Matrix_import_BOOL(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const bool *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -extern GrB_Info GrB_Matrix_import_FP32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const float *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -extern GrB_Info GrB_Matrix_import_FP64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const double *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -extern GrB_Info GrB_Matrix_import_INT8(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int8_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -extern GrB_Info GrB_Matrix_import_INT16(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int16_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -extern GrB_Info GrB_Matrix_import_INT32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int32_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -extern GrB_Info GrB_Matrix_import_INT64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int64_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -extern GrB_Info GrB_Matrix_import_UDT(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const void *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -extern GrB_Info GrB_Matrix_import_UINT8(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint8_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -extern GrB_Info GrB_Matrix_import_UINT16(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint16_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -extern GrB_Info GrB_Matrix_import_UINT32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint32_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -extern GrB_Info GrB_Matrix_import_UINT64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint64_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -extern GrB_Info GrB_Matrix_kronecker_BinaryOp(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_kronecker_Monoid(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_kronecker_Semiring(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_ncols(GrB_Index *ncols, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_new(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols); -extern GrB_Info GrB_Matrix_nrows(GrB_Index *nrows, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_nvals(GrB_Index *nvals, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_reduce_BOOL(bool *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_reduce_BinaryOp(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_reduce_BinaryOp_Scalar(GrB_Scalar S, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_reduce_FP32(float *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_reduce_FP64(double *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_reduce_INT8(int8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_reduce_INT16(int16_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_reduce_INT32(int32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_reduce_INT64(int64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_reduce_Monoid(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_reduce_Monoid_Scalar(GrB_Scalar c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_reduce_UDT(void *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_reduce_UINT8(uint8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_reduce_UINT16(uint16_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_reduce_UINT32(uint32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_reduce_UINT64(uint64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_removeElement(GrB_Matrix C, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_resize(GrB_Matrix C, GrB_Index nrows_new, GrB_Index ncols_new); -extern GrB_Info GrB_Matrix_select_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, bool y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, float y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, double y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int8_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int16_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int32_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int64_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const GrB_Scalar y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const void *y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint8_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint16_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint32_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint64_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_serialize(void *blob, GrB_Index *blob_size_handle, GrB_Matrix A); -extern GrB_Info GrB_Matrix_serializeSize(GrB_Index *blob_size_handle, GrB_Matrix A); -extern GrB_Info GrB_Matrix_setElement_BOOL(GrB_Matrix C, bool x, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_setElement_FP32(GrB_Matrix C, float x, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_setElement_FP64(GrB_Matrix C, double x, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_setElement_INT8(GrB_Matrix C, int8_t x, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_setElement_INT16(GrB_Matrix C, int16_t x, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_setElement_INT32(GrB_Matrix C, int32_t x, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_setElement_INT64(GrB_Matrix C, int64_t x, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_setElement_Scalar(GrB_Matrix C, GrB_Scalar x, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_setElement_UDT(GrB_Matrix C, void *x, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_setElement_UINT8(GrB_Matrix C, uint8_t x, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_setElement_UINT16(GrB_Matrix C, uint16_t x, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_setElement_UINT32(GrB_Matrix C, uint32_t x, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_setElement_UINT64(GrB_Matrix C, uint64_t x, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_wait(GrB_Matrix A, GrB_WaitMode waitmode); -extern GrB_Info GrB_Row_assign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, GrB_Index i, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_mxm(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); -extern GrB_Info GrB_mxv(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_transpose(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_vxm(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Vector u, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Col_assign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); +GrB_Info GrB_Col_extract(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_UnaryOp op, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp1st_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, bool x, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp1st_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, float x, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp1st_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, double x, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp1st_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int8_t x, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp1st_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int16_t x, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp1st_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int32_t x, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp1st_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int64_t x, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp1st_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp1st_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const void *x, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp1st_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint8_t x, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp1st_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint16_t x, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp1st_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint32_t x, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp1st_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint64_t x, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp2nd_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, bool y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp2nd_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, float y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp2nd_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, double y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, int8_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, int16_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, int32_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, int64_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp2nd_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Scalar y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp2nd_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const void *y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, uint8_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, uint16_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, uint32_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, uint64_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_IndexOp_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, bool y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_IndexOp_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, float y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_IndexOp_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, double y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_IndexOp_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int8_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_IndexOp_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int16_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_IndexOp_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int32_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_IndexOp_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int64_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_IndexOp_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const GrB_Scalar y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_IndexOp_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const void *y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_IndexOp_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint8_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_IndexOp_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint16_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_IndexOp_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint32_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_IndexOp_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint64_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, double x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_build_BOOL(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const bool *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_FP32(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const float *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_FP64(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const double *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_INT8(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const int8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_INT16(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const int16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_INT32(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const int32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_INT64(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const int64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_UDT(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const void *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_UINT8(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const uint8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_UINT16(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const uint16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_UINT32(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const uint32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_UINT64(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const uint64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_clear(GrB_Matrix A); +GrB_Info GrB_Matrix_deserialize(GrB_Matrix *C, GrB_Type type, const void *blob, GrB_Index blob_size); +GrB_Info GrB_Matrix_diag(GrB_Matrix *C, const GrB_Vector v, int64_t k); +GrB_Info GrB_Matrix_dup(GrB_Matrix *C, const GrB_Matrix A); +GrB_Info GrB_Matrix_eWiseAdd_BinaryOp(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_eWiseAdd_Monoid(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_eWiseAdd_Semiring(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_eWiseMult_BinaryOp(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp mult, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_eWiseMult_Monoid(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_eWiseMult_Semiring(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_error(const char **error, const GrB_Matrix A); +GrB_Info GrB_Matrix_exportHint(GrB_Format *format, GrB_Matrix A); +GrB_Info GrB_Matrix_exportSize(GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_BOOL(GrB_Index *Ap, GrB_Index *Ai, bool *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_FP32(GrB_Index *Ap, GrB_Index *Ai, float *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_FP64(GrB_Index *Ap, GrB_Index *Ai, double *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_INT8(GrB_Index *Ap, GrB_Index *Ai, int8_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_INT16(GrB_Index *Ap, GrB_Index *Ai, int16_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_INT32(GrB_Index *Ap, GrB_Index *Ai, int32_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_INT64(GrB_Index *Ap, GrB_Index *Ai, int64_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_UDT(GrB_Index *Ap, GrB_Index *Ai, void *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_UINT8(GrB_Index *Ap, GrB_Index *Ai, uint8_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_UINT16(GrB_Index *Ap, GrB_Index *Ai, uint16_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_UINT32(GrB_Index *Ap, GrB_Index *Ai, uint32_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_UINT64(GrB_Index *Ap, GrB_Index *Ai, uint64_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +GrB_Info GrB_Matrix_extract(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_extractElement_BOOL(bool *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_extractElement_FP32(float *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_extractElement_FP64(double *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_extractElement_INT8(int8_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_extractElement_INT16(int16_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_extractElement_INT32(int32_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_extractElement_INT64(int64_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_extractElement_Scalar(GrB_Scalar x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_extractElement_UDT(void *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_extractElement_UINT8(uint8_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_extractElement_UINT16(uint16_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_extractElement_UINT32(uint32_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_extractElement_UINT64(uint64_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_extractTuples_BOOL(GrB_Index *I, GrB_Index *J, bool *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_FP32(GrB_Index *I, GrB_Index *J, float *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_FP64(GrB_Index *I, GrB_Index *J, double *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_INT8(GrB_Index *I, GrB_Index *J, int8_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_INT16(GrB_Index *I, GrB_Index *J, int16_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_INT32(GrB_Index *I, GrB_Index *J, int32_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_INT64(GrB_Index *I, GrB_Index *J, int64_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_UDT(GrB_Index *I, GrB_Index *J, void *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_UINT8(GrB_Index *I, GrB_Index *J, uint8_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_UINT16(GrB_Index *I, GrB_Index *J, uint16_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_UINT32(GrB_Index *I, GrB_Index *J, uint32_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_UINT64(GrB_Index *I, GrB_Index *J, uint64_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_free(GrB_Matrix *A); +GrB_Info GrB_Matrix_import_BOOL(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const bool *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +GrB_Info GrB_Matrix_import_FP32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const float *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +GrB_Info GrB_Matrix_import_FP64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const double *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +GrB_Info GrB_Matrix_import_INT8(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int8_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +GrB_Info GrB_Matrix_import_INT16(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int16_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +GrB_Info GrB_Matrix_import_INT32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int32_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +GrB_Info GrB_Matrix_import_INT64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int64_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +GrB_Info GrB_Matrix_import_UDT(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const void *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +GrB_Info GrB_Matrix_import_UINT8(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint8_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +GrB_Info GrB_Matrix_import_UINT16(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint16_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +GrB_Info GrB_Matrix_import_UINT32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint32_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +GrB_Info GrB_Matrix_import_UINT64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint64_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +GrB_Info GrB_Matrix_kronecker_BinaryOp(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_kronecker_Monoid(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_kronecker_Semiring(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_ncols(GrB_Index *ncols, const GrB_Matrix A); +GrB_Info GrB_Matrix_new(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols); +GrB_Info GrB_Matrix_nrows(GrB_Index *nrows, const GrB_Matrix A); +GrB_Info GrB_Matrix_nvals(GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_reduce_BOOL(bool *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_reduce_BinaryOp(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_reduce_BinaryOp_Scalar(GrB_Scalar S, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_reduce_FP32(float *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_reduce_FP64(double *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_reduce_INT8(int8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_reduce_INT16(int16_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_reduce_INT32(int32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_reduce_INT64(int64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_reduce_Monoid(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_reduce_Monoid_Scalar(GrB_Scalar c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_reduce_UDT(void *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_reduce_UINT8(uint8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_reduce_UINT16(uint16_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_reduce_UINT32(uint32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_reduce_UINT64(uint64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_removeElement(GrB_Matrix C, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_resize(GrB_Matrix C, GrB_Index nrows_new, GrB_Index ncols_new); +GrB_Info GrB_Matrix_select_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, bool y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_select_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, float y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_select_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, double y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_select_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int8_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_select_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int16_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_select_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int32_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_select_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int64_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_select_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const GrB_Scalar y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_select_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const void *y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_select_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint8_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_select_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint16_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_select_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint32_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_select_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint64_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_serialize(void *blob, GrB_Index *blob_size_handle, GrB_Matrix A); +GrB_Info GrB_Matrix_serializeSize(GrB_Index *blob_size_handle, GrB_Matrix A); +GrB_Info GrB_Matrix_setElement_BOOL(GrB_Matrix C, bool x, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_setElement_FP32(GrB_Matrix C, float x, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_setElement_FP64(GrB_Matrix C, double x, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_setElement_INT8(GrB_Matrix C, int8_t x, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_setElement_INT16(GrB_Matrix C, int16_t x, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_setElement_INT32(GrB_Matrix C, int32_t x, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_setElement_INT64(GrB_Matrix C, int64_t x, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_setElement_Scalar(GrB_Matrix C, GrB_Scalar x, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_setElement_UDT(GrB_Matrix C, void *x, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_setElement_UINT8(GrB_Matrix C, uint8_t x, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_setElement_UINT16(GrB_Matrix C, uint16_t x, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_setElement_UINT32(GrB_Matrix C, uint32_t x, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_setElement_UINT64(GrB_Matrix C, uint64_t x, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_wait(GrB_Matrix A, GrB_WaitMode waitmode); +GrB_Info GrB_Row_assign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, GrB_Index i, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_mxm(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); +GrB_Info GrB_mxv(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_transpose(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_vxm(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Vector u, const GrB_Matrix A, const GrB_Descriptor desc); /* monoid */ -extern GrB_Info GrB_Monoid_error(const char **error, const GrB_Monoid monoid); -extern GrB_Info GrB_Monoid_free(GrB_Monoid *monoid); -extern GrB_Info GrB_Monoid_new_BOOL(GrB_Monoid *monoid, GrB_BinaryOp op, bool identity); -extern GrB_Info GrB_Monoid_new_FP32(GrB_Monoid *monoid, GrB_BinaryOp op, float identity); -extern GrB_Info GrB_Monoid_new_FP64(GrB_Monoid *monoid, GrB_BinaryOp op, double identity); -extern GrB_Info GrB_Monoid_new_INT8(GrB_Monoid *monoid, GrB_BinaryOp op, int8_t identity); -extern GrB_Info GrB_Monoid_new_INT16(GrB_Monoid *monoid, GrB_BinaryOp op, int16_t identity); -extern GrB_Info GrB_Monoid_new_INT32(GrB_Monoid *monoid, GrB_BinaryOp op, int32_t identity); -extern GrB_Info GrB_Monoid_new_INT64(GrB_Monoid *monoid, GrB_BinaryOp op, int64_t identity); -extern GrB_Info GrB_Monoid_new_UDT(GrB_Monoid *monoid, GrB_BinaryOp op, void *identity); -extern GrB_Info GrB_Monoid_new_UINT8(GrB_Monoid *monoid, GrB_BinaryOp op, uint8_t identity); -extern GrB_Info GrB_Monoid_new_UINT16(GrB_Monoid *monoid, GrB_BinaryOp op, uint16_t identity); -extern GrB_Info GrB_Monoid_new_UINT32(GrB_Monoid *monoid, GrB_BinaryOp op, uint32_t identity); -extern GrB_Info GrB_Monoid_new_UINT64(GrB_Monoid *monoid, GrB_BinaryOp op, uint64_t identity); -extern GrB_Info GrB_Monoid_wait(GrB_Monoid monoid, GrB_WaitMode waitmode); +GrB_Info GrB_Monoid_error(const char **error, const GrB_Monoid monoid); +GrB_Info GrB_Monoid_free(GrB_Monoid *monoid); +GrB_Info GrB_Monoid_new_BOOL(GrB_Monoid *monoid, GrB_BinaryOp op, bool identity); +GrB_Info GrB_Monoid_new_FP32(GrB_Monoid *monoid, GrB_BinaryOp op, float identity); +GrB_Info GrB_Monoid_new_FP64(GrB_Monoid *monoid, GrB_BinaryOp op, double identity); +GrB_Info GrB_Monoid_new_INT8(GrB_Monoid *monoid, GrB_BinaryOp op, int8_t identity); +GrB_Info GrB_Monoid_new_INT16(GrB_Monoid *monoid, GrB_BinaryOp op, int16_t identity); +GrB_Info GrB_Monoid_new_INT32(GrB_Monoid *monoid, GrB_BinaryOp op, int32_t identity); +GrB_Info GrB_Monoid_new_INT64(GrB_Monoid *monoid, GrB_BinaryOp op, int64_t identity); +GrB_Info GrB_Monoid_new_UDT(GrB_Monoid *monoid, GrB_BinaryOp op, void *identity); +GrB_Info GrB_Monoid_new_UINT8(GrB_Monoid *monoid, GrB_BinaryOp op, uint8_t identity); +GrB_Info GrB_Monoid_new_UINT16(GrB_Monoid *monoid, GrB_BinaryOp op, uint16_t identity); +GrB_Info GrB_Monoid_new_UINT32(GrB_Monoid *monoid, GrB_BinaryOp op, uint32_t identity); +GrB_Info GrB_Monoid_new_UINT64(GrB_Monoid *monoid, GrB_BinaryOp op, uint64_t identity); +GrB_Info GrB_Monoid_wait(GrB_Monoid monoid, GrB_WaitMode waitmode); /* scalar */ -extern GrB_Info GrB_Scalar_clear(GrB_Scalar s); -extern GrB_Info GrB_Scalar_dup(GrB_Scalar *s, const GrB_Scalar t); -extern GrB_Info GrB_Scalar_error(const char **error, const GrB_Scalar s); -extern GrB_Info GrB_Scalar_extractElement_BOOL(bool *x, const GrB_Scalar s); -extern GrB_Info GrB_Scalar_extractElement_FP32(float *x, const GrB_Scalar s); -extern GrB_Info GrB_Scalar_extractElement_FP64(double *x, const GrB_Scalar s); -extern GrB_Info GrB_Scalar_extractElement_INT8(int8_t *x, const GrB_Scalar s); -extern GrB_Info GrB_Scalar_extractElement_INT16(int16_t *x, const GrB_Scalar s); -extern GrB_Info GrB_Scalar_extractElement_INT32(int32_t *x, const GrB_Scalar s); -extern GrB_Info GrB_Scalar_extractElement_INT64(int64_t *x, const GrB_Scalar s); -extern GrB_Info GrB_Scalar_extractElement_UDT(void *x, const GrB_Scalar s); -extern GrB_Info GrB_Scalar_extractElement_UINT8(uint8_t *x, const GrB_Scalar s); -extern GrB_Info GrB_Scalar_extractElement_UINT16(uint16_t *x, const GrB_Scalar s); -extern GrB_Info GrB_Scalar_extractElement_UINT32(uint32_t *x, const GrB_Scalar s); -extern GrB_Info GrB_Scalar_extractElement_UINT64(uint64_t *x, const GrB_Scalar s); -extern GrB_Info GrB_Scalar_free(GrB_Scalar *s); -extern GrB_Info GrB_Scalar_new(GrB_Scalar *s, GrB_Type type); -extern GrB_Info GrB_Scalar_nvals(GrB_Index *nvals, const GrB_Scalar s); -extern GrB_Info GrB_Scalar_setElement_BOOL(GrB_Scalar s, bool x); -extern GrB_Info GrB_Scalar_setElement_FP32(GrB_Scalar s, float x); -extern GrB_Info GrB_Scalar_setElement_FP64(GrB_Scalar s, double x); -extern GrB_Info GrB_Scalar_setElement_INT8(GrB_Scalar s, int8_t x); -extern GrB_Info GrB_Scalar_setElement_INT16(GrB_Scalar s, int16_t x); -extern GrB_Info GrB_Scalar_setElement_INT32(GrB_Scalar s, int32_t x); -extern GrB_Info GrB_Scalar_setElement_INT64(GrB_Scalar s, int64_t x); -extern GrB_Info GrB_Scalar_setElement_UDT(GrB_Scalar s, void *x); -extern GrB_Info GrB_Scalar_setElement_UINT8(GrB_Scalar s, uint8_t x); -extern GrB_Info GrB_Scalar_setElement_UINT16(GrB_Scalar s, uint16_t x); -extern GrB_Info GrB_Scalar_setElement_UINT32(GrB_Scalar s, uint32_t x); -extern GrB_Info GrB_Scalar_setElement_UINT64(GrB_Scalar s, uint64_t x); -extern GrB_Info GrB_Scalar_wait(GrB_Scalar s, GrB_WaitMode waitmode); +GrB_Info GrB_Scalar_clear(GrB_Scalar s); +GrB_Info GrB_Scalar_dup(GrB_Scalar *s, const GrB_Scalar t); +GrB_Info GrB_Scalar_error(const char **error, const GrB_Scalar s); +GrB_Info GrB_Scalar_extractElement_BOOL(bool *x, const GrB_Scalar s); +GrB_Info GrB_Scalar_extractElement_FP32(float *x, const GrB_Scalar s); +GrB_Info GrB_Scalar_extractElement_FP64(double *x, const GrB_Scalar s); +GrB_Info GrB_Scalar_extractElement_INT8(int8_t *x, const GrB_Scalar s); +GrB_Info GrB_Scalar_extractElement_INT16(int16_t *x, const GrB_Scalar s); +GrB_Info GrB_Scalar_extractElement_INT32(int32_t *x, const GrB_Scalar s); +GrB_Info GrB_Scalar_extractElement_INT64(int64_t *x, const GrB_Scalar s); +GrB_Info GrB_Scalar_extractElement_UDT(void *x, const GrB_Scalar s); +GrB_Info GrB_Scalar_extractElement_UINT8(uint8_t *x, const GrB_Scalar s); +GrB_Info GrB_Scalar_extractElement_UINT16(uint16_t *x, const GrB_Scalar s); +GrB_Info GrB_Scalar_extractElement_UINT32(uint32_t *x, const GrB_Scalar s); +GrB_Info GrB_Scalar_extractElement_UINT64(uint64_t *x, const GrB_Scalar s); +GrB_Info GrB_Scalar_free(GrB_Scalar *s); +GrB_Info GrB_Scalar_new(GrB_Scalar *s, GrB_Type type); +GrB_Info GrB_Scalar_nvals(GrB_Index *nvals, const GrB_Scalar s); +GrB_Info GrB_Scalar_setElement_BOOL(GrB_Scalar s, bool x); +GrB_Info GrB_Scalar_setElement_FP32(GrB_Scalar s, float x); +GrB_Info GrB_Scalar_setElement_FP64(GrB_Scalar s, double x); +GrB_Info GrB_Scalar_setElement_INT8(GrB_Scalar s, int8_t x); +GrB_Info GrB_Scalar_setElement_INT16(GrB_Scalar s, int16_t x); +GrB_Info GrB_Scalar_setElement_INT32(GrB_Scalar s, int32_t x); +GrB_Info GrB_Scalar_setElement_INT64(GrB_Scalar s, int64_t x); +GrB_Info GrB_Scalar_setElement_UDT(GrB_Scalar s, void *x); +GrB_Info GrB_Scalar_setElement_UINT8(GrB_Scalar s, uint8_t x); +GrB_Info GrB_Scalar_setElement_UINT16(GrB_Scalar s, uint16_t x); +GrB_Info GrB_Scalar_setElement_UINT32(GrB_Scalar s, uint32_t x); +GrB_Info GrB_Scalar_setElement_UINT64(GrB_Scalar s, uint64_t x); +GrB_Info GrB_Scalar_wait(GrB_Scalar s, GrB_WaitMode waitmode); /* semiring */ -extern GrB_Info GrB_Semiring_error(const char **error, const GrB_Semiring semiring); -extern GrB_Info GrB_Semiring_free(GrB_Semiring *semiring); -extern GrB_Info GrB_Semiring_new(GrB_Semiring *semiring, GrB_Monoid add, GrB_BinaryOp multiply); -extern GrB_Info GrB_Semiring_wait(GrB_Semiring semiring, GrB_WaitMode waitmode); +GrB_Info GrB_Semiring_error(const char **error, const GrB_Semiring semiring); +GrB_Info GrB_Semiring_free(GrB_Semiring *semiring); +GrB_Info GrB_Semiring_new(GrB_Semiring *semiring, GrB_Monoid add, GrB_BinaryOp multiply); +GrB_Info GrB_Semiring_wait(GrB_Semiring semiring, GrB_WaitMode waitmode); /* type */ -extern GrB_Info GrB_Type_error(const char **error, const GrB_Type type); -extern GrB_Info GrB_Type_free(GrB_Type *type); -extern GrB_Info GrB_Type_new(GrB_Type *type, size_t sizeof_ctype); -extern GrB_Info GrB_Type_wait(GrB_Type type, GrB_WaitMode waitmode); +GrB_Info GrB_Type_error(const char **error, const GrB_Type type); +GrB_Info GrB_Type_free(GrB_Type *type); +GrB_Info GrB_Type_new(GrB_Type *type, size_t sizeof_ctype); +GrB_Info GrB_Type_wait(GrB_Type type, GrB_WaitMode waitmode); /* unary */ -extern GrB_Info GrB_UnaryOp_error(const char **error, const GrB_UnaryOp op); -extern GrB_Info GrB_UnaryOp_free(GrB_UnaryOp *unaryop); -extern GrB_Info GrB_UnaryOp_new(GrB_UnaryOp *unaryop, GxB_unary_function function, GrB_Type ztype, GrB_Type xtype); -extern GrB_Info GrB_UnaryOp_wait(GrB_UnaryOp op, GrB_WaitMode waitmode); +GrB_Info GrB_UnaryOp_error(const char **error, const GrB_UnaryOp op); +GrB_Info GrB_UnaryOp_free(GrB_UnaryOp *unaryop); +GrB_Info GrB_UnaryOp_new(GrB_UnaryOp *unaryop, GxB_unary_function function, GrB_Type ztype, GrB_Type xtype); +GrB_Info GrB_UnaryOp_wait(GrB_UnaryOp op, GrB_WaitMode waitmode); /* vector */ -extern GrB_Info GrB_Vector_apply(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_UnaryOp op, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp1st_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, bool x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp1st_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, float x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp1st_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, double x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp1st_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int8_t x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp1st_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int16_t x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp1st_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int32_t x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp1st_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int64_t x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp1st_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp1st_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const void *x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp1st_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint8_t x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp1st_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint16_t x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp1st_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint32_t x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp1st_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint64_t x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp2nd_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, bool y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp2nd_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, float y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp2nd_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, double y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp2nd_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, int8_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp2nd_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, int16_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp2nd_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, int32_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp2nd_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, int64_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp2nd_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const GrB_Scalar y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp2nd_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const void *y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, uint8_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, uint16_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, uint32_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, uint64_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, bool y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, float y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, double y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int8_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int16_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int32_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int64_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const GrB_Scalar y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const void *y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint8_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint16_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint32_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint64_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_assign(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_assign_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_assign_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_assign_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, double x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_assign_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_assign_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_assign_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_assign_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_assign_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_assign_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_assign_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_assign_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_assign_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_assign_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_build_BOOL(GrB_Vector w, const GrB_Index *I, const bool *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Vector_build_FP32(GrB_Vector w, const GrB_Index *I, const float *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Vector_build_FP64(GrB_Vector w, const GrB_Index *I, const double *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Vector_build_INT8(GrB_Vector w, const GrB_Index *I, const int8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Vector_build_INT16(GrB_Vector w, const GrB_Index *I, const int16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Vector_build_INT32(GrB_Vector w, const GrB_Index *I, const int32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Vector_build_INT64(GrB_Vector w, const GrB_Index *I, const int64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Vector_build_UDT(GrB_Vector w, const GrB_Index *I, const void *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Vector_build_UINT8(GrB_Vector w, const GrB_Index *I, const uint8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Vector_build_UINT16(GrB_Vector w, const GrB_Index *I, const uint16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Vector_build_UINT32(GrB_Vector w, const GrB_Index *I, const uint32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Vector_build_UINT64(GrB_Vector w, const GrB_Index *I, const uint64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Vector_clear(GrB_Vector v); -extern GrB_Info GrB_Vector_dup(GrB_Vector *w, const GrB_Vector u); -extern GrB_Info GrB_Vector_eWiseAdd_BinaryOp(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_eWiseAdd_Monoid(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_eWiseAdd_Semiring(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_eWiseMult_BinaryOp(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp mult, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_eWiseMult_Monoid(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_eWiseMult_Semiring(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_error(const char **error, const GrB_Vector v); -extern GrB_Info GrB_Vector_extract(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_extractElement_BOOL(bool *x, const GrB_Vector v, GrB_Index i); -extern GrB_Info GrB_Vector_extractElement_FP32(float *x, const GrB_Vector v, GrB_Index i); -extern GrB_Info GrB_Vector_extractElement_FP64(double *x, const GrB_Vector v, GrB_Index i); -extern GrB_Info GrB_Vector_extractElement_INT8(int8_t *x, const GrB_Vector v, GrB_Index i); -extern GrB_Info GrB_Vector_extractElement_INT16(int16_t *x, const GrB_Vector v, GrB_Index i); -extern GrB_Info GrB_Vector_extractElement_INT32(int32_t *x, const GrB_Vector v, GrB_Index i); -extern GrB_Info GrB_Vector_extractElement_INT64(int64_t *x, const GrB_Vector v, GrB_Index i); -extern GrB_Info GrB_Vector_extractElement_Scalar(GrB_Scalar x, const GrB_Vector v, GrB_Index i); -extern GrB_Info GrB_Vector_extractElement_UDT(void *x, const GrB_Vector v, GrB_Index i); -extern GrB_Info GrB_Vector_extractElement_UINT8(uint8_t *x, const GrB_Vector v, GrB_Index i); -extern GrB_Info GrB_Vector_extractElement_UINT16(uint16_t *x, const GrB_Vector v, GrB_Index i); -extern GrB_Info GrB_Vector_extractElement_UINT32(uint32_t *x, const GrB_Vector v, GrB_Index i); -extern GrB_Info GrB_Vector_extractElement_UINT64(uint64_t *x, const GrB_Vector v, GrB_Index i); -extern GrB_Info GrB_Vector_extractTuples_BOOL(GrB_Index *I, bool *X, GrB_Index *nvals, const GrB_Vector v); -extern GrB_Info GrB_Vector_extractTuples_FP32(GrB_Index *I, float *X, GrB_Index *nvals, const GrB_Vector v); -extern GrB_Info GrB_Vector_extractTuples_FP64(GrB_Index *I, double *X, GrB_Index *nvals, const GrB_Vector v); -extern GrB_Info GrB_Vector_extractTuples_INT8(GrB_Index *I, int8_t *X, GrB_Index *nvals, const GrB_Vector v); -extern GrB_Info GrB_Vector_extractTuples_INT16(GrB_Index *I, int16_t *X, GrB_Index *nvals, const GrB_Vector v); -extern GrB_Info GrB_Vector_extractTuples_INT32(GrB_Index *I, int32_t *X, GrB_Index *nvals, const GrB_Vector v); -extern GrB_Info GrB_Vector_extractTuples_INT64(GrB_Index *I, int64_t *X, GrB_Index *nvals, const GrB_Vector v); -extern GrB_Info GrB_Vector_extractTuples_UDT(GrB_Index *I, void *X, GrB_Index *nvals, const GrB_Vector v); -extern GrB_Info GrB_Vector_extractTuples_UINT8(GrB_Index *I, uint8_t *X, GrB_Index *nvals, const GrB_Vector v); -extern GrB_Info GrB_Vector_extractTuples_UINT16(GrB_Index *I, uint16_t *X, GrB_Index *nvals, const GrB_Vector v); -extern GrB_Info GrB_Vector_extractTuples_UINT32(GrB_Index *I, uint32_t *X, GrB_Index *nvals, const GrB_Vector v); -extern GrB_Info GrB_Vector_extractTuples_UINT64(GrB_Index *I, uint64_t *X, GrB_Index *nvals, const GrB_Vector v); -extern GrB_Info GrB_Vector_free(GrB_Vector *v); -extern GrB_Info GrB_Vector_new(GrB_Vector *v, GrB_Type type, GrB_Index n); -extern GrB_Info GrB_Vector_nvals(GrB_Index *nvals, const GrB_Vector v); -extern GrB_Info GrB_Vector_reduce_BOOL(bool *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_reduce_BinaryOp_Scalar(GrB_Scalar c, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_reduce_FP32(float *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_reduce_FP64(double *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_reduce_INT8(int8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_reduce_INT16(int16_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_reduce_INT32(int32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_reduce_INT64(int64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_reduce_Monoid_Scalar(GrB_Scalar c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_reduce_UDT(void *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_reduce_UINT8(uint8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_reduce_UINT16(uint16_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_reduce_UINT32(uint32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_reduce_UINT64(uint64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_removeElement(GrB_Vector v, GrB_Index i); -extern GrB_Info GrB_Vector_resize(GrB_Vector w, GrB_Index nrows_new); -extern GrB_Info GrB_Vector_select_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, bool y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, float y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, double y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int8_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int16_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int32_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int64_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const GrB_Scalar y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const void *y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint8_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint16_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint32_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint64_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_setElement_BOOL(GrB_Vector w, bool x, GrB_Index i); -extern GrB_Info GrB_Vector_setElement_FP32(GrB_Vector w, float x, GrB_Index i); -extern GrB_Info GrB_Vector_setElement_FP64(GrB_Vector w, double x, GrB_Index i); -extern GrB_Info GrB_Vector_setElement_INT8(GrB_Vector w, int8_t x, GrB_Index i); -extern GrB_Info GrB_Vector_setElement_INT16(GrB_Vector w, int16_t x, GrB_Index i); -extern GrB_Info GrB_Vector_setElement_INT32(GrB_Vector w, int32_t x, GrB_Index i); -extern GrB_Info GrB_Vector_setElement_INT64(GrB_Vector w, int64_t x, GrB_Index i); -extern GrB_Info GrB_Vector_setElement_Scalar(GrB_Vector w, GrB_Scalar x, GrB_Index i); -extern GrB_Info GrB_Vector_setElement_UDT(GrB_Vector w, void *x, GrB_Index i); -extern GrB_Info GrB_Vector_setElement_UINT8(GrB_Vector w, uint8_t x, GrB_Index i); -extern GrB_Info GrB_Vector_setElement_UINT16(GrB_Vector w, uint16_t x, GrB_Index i); -extern GrB_Info GrB_Vector_setElement_UINT32(GrB_Vector w, uint32_t x, GrB_Index i); -extern GrB_Info GrB_Vector_setElement_UINT64(GrB_Vector w, uint64_t x, GrB_Index i); -extern GrB_Info GrB_Vector_size(GrB_Index *n, const GrB_Vector v); -extern GrB_Info GrB_Vector_wait(GrB_Vector v, GrB_WaitMode waitmode); +GrB_Info GrB_Vector_apply(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_UnaryOp op, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp1st_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, bool x, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp1st_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, float x, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp1st_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, double x, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp1st_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int8_t x, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp1st_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int16_t x, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp1st_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int32_t x, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp1st_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int64_t x, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp1st_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp1st_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const void *x, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp1st_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint8_t x, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp1st_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint16_t x, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp1st_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint32_t x, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp1st_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint64_t x, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp2nd_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, bool y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp2nd_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, float y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp2nd_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, double y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp2nd_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, int8_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp2nd_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, int16_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp2nd_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, int32_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp2nd_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, int64_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp2nd_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const GrB_Scalar y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp2nd_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const void *y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, uint8_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, uint16_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, uint32_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, uint64_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_IndexOp_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, bool y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_IndexOp_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, float y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_IndexOp_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, double y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_IndexOp_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int8_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_IndexOp_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int16_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_IndexOp_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int32_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_IndexOp_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int64_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_IndexOp_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const GrB_Scalar y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_IndexOp_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const void *y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_IndexOp_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint8_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_IndexOp_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint16_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_IndexOp_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint32_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_IndexOp_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint64_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, double x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_build_BOOL(GrB_Vector w, const GrB_Index *I, const bool *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_FP32(GrB_Vector w, const GrB_Index *I, const float *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_FP64(GrB_Vector w, const GrB_Index *I, const double *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_INT8(GrB_Vector w, const GrB_Index *I, const int8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_INT16(GrB_Vector w, const GrB_Index *I, const int16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_INT32(GrB_Vector w, const GrB_Index *I, const int32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_INT64(GrB_Vector w, const GrB_Index *I, const int64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_UDT(GrB_Vector w, const GrB_Index *I, const void *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_UINT8(GrB_Vector w, const GrB_Index *I, const uint8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_UINT16(GrB_Vector w, const GrB_Index *I, const uint16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_UINT32(GrB_Vector w, const GrB_Index *I, const uint32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_UINT64(GrB_Vector w, const GrB_Index *I, const uint64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_clear(GrB_Vector v); +GrB_Info GrB_Vector_dup(GrB_Vector *w, const GrB_Vector u); +GrB_Info GrB_Vector_eWiseAdd_BinaryOp(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); +GrB_Info GrB_Vector_eWiseAdd_Monoid(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); +GrB_Info GrB_Vector_eWiseAdd_Semiring(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); +GrB_Info GrB_Vector_eWiseMult_BinaryOp(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp mult, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); +GrB_Info GrB_Vector_eWiseMult_Monoid(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); +GrB_Info GrB_Vector_eWiseMult_Semiring(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); +GrB_Info GrB_Vector_error(const char **error, const GrB_Vector v); +GrB_Info GrB_Vector_extract(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_extractElement_BOOL(bool *x, const GrB_Vector v, GrB_Index i); +GrB_Info GrB_Vector_extractElement_FP32(float *x, const GrB_Vector v, GrB_Index i); +GrB_Info GrB_Vector_extractElement_FP64(double *x, const GrB_Vector v, GrB_Index i); +GrB_Info GrB_Vector_extractElement_INT8(int8_t *x, const GrB_Vector v, GrB_Index i); +GrB_Info GrB_Vector_extractElement_INT16(int16_t *x, const GrB_Vector v, GrB_Index i); +GrB_Info GrB_Vector_extractElement_INT32(int32_t *x, const GrB_Vector v, GrB_Index i); +GrB_Info GrB_Vector_extractElement_INT64(int64_t *x, const GrB_Vector v, GrB_Index i); +GrB_Info GrB_Vector_extractElement_Scalar(GrB_Scalar x, const GrB_Vector v, GrB_Index i); +GrB_Info GrB_Vector_extractElement_UDT(void *x, const GrB_Vector v, GrB_Index i); +GrB_Info GrB_Vector_extractElement_UINT8(uint8_t *x, const GrB_Vector v, GrB_Index i); +GrB_Info GrB_Vector_extractElement_UINT16(uint16_t *x, const GrB_Vector v, GrB_Index i); +GrB_Info GrB_Vector_extractElement_UINT32(uint32_t *x, const GrB_Vector v, GrB_Index i); +GrB_Info GrB_Vector_extractElement_UINT64(uint64_t *x, const GrB_Vector v, GrB_Index i); +GrB_Info GrB_Vector_extractTuples_BOOL(GrB_Index *I, bool *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_FP32(GrB_Index *I, float *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_FP64(GrB_Index *I, double *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_INT8(GrB_Index *I, int8_t *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_INT16(GrB_Index *I, int16_t *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_INT32(GrB_Index *I, int32_t *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_INT64(GrB_Index *I, int64_t *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_UDT(GrB_Index *I, void *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_UINT8(GrB_Index *I, uint8_t *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_UINT16(GrB_Index *I, uint16_t *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_UINT32(GrB_Index *I, uint32_t *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_UINT64(GrB_Index *I, uint64_t *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_free(GrB_Vector *v); +GrB_Info GrB_Vector_new(GrB_Vector *v, GrB_Type type, GrB_Index n); +GrB_Info GrB_Vector_nvals(GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_reduce_BOOL(bool *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_reduce_BinaryOp_Scalar(GrB_Scalar c, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_reduce_FP32(float *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_reduce_FP64(double *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_reduce_INT8(int8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_reduce_INT16(int16_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_reduce_INT32(int32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_reduce_INT64(int64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_reduce_Monoid_Scalar(GrB_Scalar c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_reduce_UDT(void *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_reduce_UINT8(uint8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_reduce_UINT16(uint16_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_reduce_UINT32(uint32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_reduce_UINT64(uint64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_removeElement(GrB_Vector v, GrB_Index i); +GrB_Info GrB_Vector_resize(GrB_Vector w, GrB_Index nrows_new); +GrB_Info GrB_Vector_select_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, bool y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_select_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, float y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_select_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, double y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_select_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int8_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_select_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int16_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_select_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int32_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_select_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int64_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_select_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const GrB_Scalar y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_select_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const void *y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_select_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint8_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_select_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint16_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_select_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint32_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_select_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint64_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_setElement_BOOL(GrB_Vector w, bool x, GrB_Index i); +GrB_Info GrB_Vector_setElement_FP32(GrB_Vector w, float x, GrB_Index i); +GrB_Info GrB_Vector_setElement_FP64(GrB_Vector w, double x, GrB_Index i); +GrB_Info GrB_Vector_setElement_INT8(GrB_Vector w, int8_t x, GrB_Index i); +GrB_Info GrB_Vector_setElement_INT16(GrB_Vector w, int16_t x, GrB_Index i); +GrB_Info GrB_Vector_setElement_INT32(GrB_Vector w, int32_t x, GrB_Index i); +GrB_Info GrB_Vector_setElement_INT64(GrB_Vector w, int64_t x, GrB_Index i); +GrB_Info GrB_Vector_setElement_Scalar(GrB_Vector w, GrB_Scalar x, GrB_Index i); +GrB_Info GrB_Vector_setElement_UDT(GrB_Vector w, void *x, GrB_Index i); +GrB_Info GrB_Vector_setElement_UINT8(GrB_Vector w, uint8_t x, GrB_Index i); +GrB_Info GrB_Vector_setElement_UINT16(GrB_Vector w, uint16_t x, GrB_Index i); +GrB_Info GrB_Vector_setElement_UINT32(GrB_Vector w, uint32_t x, GrB_Index i); +GrB_Info GrB_Vector_setElement_UINT64(GrB_Vector w, uint64_t x, GrB_Index i); +GrB_Info GrB_Vector_size(GrB_Index *n, const GrB_Vector v); +GrB_Info GrB_Vector_wait(GrB_Vector v, GrB_WaitMode waitmode); /*************** * GB functions * ***************/ /* binary */ -extern GrB_Info GB_BinaryOp_new(GrB_BinaryOp *binaryop, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *binop_name); +GrB_Info GB_BinaryOp_new(GrB_BinaryOp *binaryop, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *binop_name); /* iterator */ -extern GrB_Info GB_Iterator_rc_bitmap_next(GxB_Iterator iterator); -extern GrB_Info GB_Iterator_rc_seek(GxB_Iterator iterator, GrB_Index j, bool jth_vector); -extern GrB_Info GB_Vector_Iterator_bitmap_seek(GxB_Iterator iterator, GrB_Index unused); +GrB_Info GB_Iterator_rc_bitmap_next(GxB_Iterator iterator); +GrB_Info GB_Iterator_rc_seek(GxB_Iterator iterator, GrB_Index j, bool jth_vector); +GrB_Info GB_Vector_Iterator_bitmap_seek(GxB_Iterator iterator, GrB_Index unused); /* matrix */ -extern GrB_Info GB_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GxB_Format_Value format, GrB_Descriptor desc); +GrB_Info GB_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GxB_Format_Value format, GrB_Descriptor desc); /* selectop */ -extern GrB_Info GB_SelectOp_new(GxB_SelectOp *selectop, GxB_select_function function, GrB_Type xtype, GrB_Type ttype, const char *name); +GrB_Info GB_SelectOp_new(GxB_SelectOp *selectop, GxB_select_function function, GrB_Type xtype, GrB_Type ttype, const char *name); /* type */ -extern GrB_Info GB_Type_new(GrB_Type *type, size_t sizeof_ctype, const char *type_name); +GrB_Info GB_Type_new(GrB_Type *type, size_t sizeof_ctype, const char *type_name); /* unary */ -extern GrB_Info GB_UnaryOp_new(GrB_UnaryOp *unaryop, GxB_unary_function function, GrB_Type ztype, GrB_Type xtype, const char *unop_name); +GrB_Info GB_UnaryOp_new(GrB_UnaryOp *unaryop, GxB_unary_function function, GrB_Type ztype, GrB_Type xtype, const char *unop_name); /**************** * GxB functions * ****************/ /* binary */ -extern GrB_Info GxB_BinaryOp_fprint(GrB_BinaryOp binaryop, const char *name, GxB_Print_Level pr, FILE *f); -extern GrB_Info GxB_BinaryOp_new(GrB_BinaryOp *op, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *binop_name, const char *binop_defn); -extern GrB_Info GxB_BinaryOp_xtype(GrB_Type *xtype, GrB_BinaryOp binaryop); -extern GrB_Info GxB_BinaryOp_xtype_name(char *type_name, const GrB_BinaryOp binaryop); -extern GrB_Info GxB_BinaryOp_ytype(GrB_Type *ytype, GrB_BinaryOp binaryop); -extern GrB_Info GxB_BinaryOp_ytype_name(char *type_name, const GrB_BinaryOp binaryop); -extern GrB_Info GxB_BinaryOp_ztype(GrB_Type *ztype, GrB_BinaryOp binaryop); -extern GrB_Info GxB_BinaryOp_ztype_name(char *type_name, const GrB_BinaryOp binaryop); +GrB_Info GxB_BinaryOp_fprint(GrB_BinaryOp binaryop, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_BinaryOp_new(GrB_BinaryOp *op, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *binop_name, const char *binop_defn); +GrB_Info GxB_BinaryOp_xtype(GrB_Type *xtype, GrB_BinaryOp binaryop); +GrB_Info GxB_BinaryOp_xtype_name(char *type_name, const GrB_BinaryOp binaryop); +GrB_Info GxB_BinaryOp_ytype(GrB_Type *ytype, GrB_BinaryOp binaryop); +GrB_Info GxB_BinaryOp_ytype_name(char *type_name, const GrB_BinaryOp binaryop); +GrB_Info GxB_BinaryOp_ztype(GrB_Type *ztype, GrB_BinaryOp binaryop); +GrB_Info GxB_BinaryOp_ztype_name(char *type_name, const GrB_BinaryOp binaryop); /* core */ -extern GrB_Info GxB_Global_Option_get(GxB_Option_Field field, ...); -extern GrB_Info GxB_Global_Option_get_CHAR(GxB_Option_Field field, char **value); -extern GrB_Info GxB_Global_Option_get_FP64(GxB_Option_Field field, double *value); -extern GrB_Info GxB_Global_Option_get_FUNCTION(GxB_Option_Field field, void **value); -extern GrB_Info GxB_Global_Option_get_INT32(GxB_Option_Field field, int32_t *value); -extern GrB_Info GxB_Global_Option_get_INT64(GxB_Option_Field field, int64_t *value); -extern GrB_Info GxB_Global_Option_set(GxB_Option_Field field, ...); -extern GrB_Info GxB_Global_Option_set_FP64(GxB_Option_Field field, double value); -extern GrB_Info GxB_Global_Option_set_FP64_ARRAY(GxB_Option_Field field, double *value); -extern GrB_Info GxB_Global_Option_set_FUNCTION(GxB_Option_Field field, void *value); -extern GrB_Info GxB_Global_Option_set_INT32(GxB_Option_Field field, int32_t value); -extern GrB_Info GxB_Global_Option_set_INT64_ARRAY(GxB_Option_Field field, int64_t *value); -extern GrB_Info GxB_deserialize_type_name(char *type_name, const void *blob, GrB_Index blob_size); -extern GrB_Info GxB_init(GrB_Mode mode, void *(*user_malloc_function)(size_t), void *(*user_calloc_function)(size_t, size_t), void *(*user_realloc_function)(void *, size_t), void (*user_free_function)(void *)); +GrB_Info GxB_Global_Option_get(GxB_Option_Field field, ...); +GrB_Info GxB_Global_Option_get_CHAR(GxB_Option_Field field, char **value); +GrB_Info GxB_Global_Option_get_FP64(GxB_Option_Field field, double *value); +GrB_Info GxB_Global_Option_get_FUNCTION(GxB_Option_Field field, void **value); +GrB_Info GxB_Global_Option_get_INT32(GxB_Option_Field field, int32_t *value); +GrB_Info GxB_Global_Option_get_INT64(GxB_Option_Field field, int64_t *value); +GrB_Info GxB_Global_Option_set(GxB_Option_Field field, ...); +GrB_Info GxB_Global_Option_set_FP64(GxB_Option_Field field, double value); +GrB_Info GxB_Global_Option_set_FP64_ARRAY(GxB_Option_Field field, double *value); +GrB_Info GxB_Global_Option_set_FUNCTION(GxB_Option_Field field, void *value); +GrB_Info GxB_Global_Option_set_INT32(GxB_Option_Field field, int32_t value); +GrB_Info GxB_Global_Option_set_INT64_ARRAY(GxB_Option_Field field, int64_t *value); +GrB_Info GxB_deserialize_type_name(char *type_name, const void *blob, GrB_Index blob_size); +GrB_Info GxB_init(GrB_Mode mode, void *(*user_malloc_function)(size_t), void *(*user_calloc_function)(size_t, size_t), void *(*user_realloc_function)(void *, size_t), void (*user_free_function)(void *)); /* descriptor */ -extern GrB_Info GxB_Desc_get(GrB_Descriptor desc, GrB_Desc_Field field, ...); -extern GrB_Info GxB_Desc_get_FP64(GrB_Descriptor desc, GrB_Desc_Field field, double *value); -extern GrB_Info GxB_Desc_get_INT32(GrB_Descriptor desc, GrB_Desc_Field field, int32_t *value); -extern GrB_Info GxB_Desc_set(GrB_Descriptor desc, GrB_Desc_Field field, ...); -extern GrB_Info GxB_Desc_set_FP64(GrB_Descriptor desc, GrB_Desc_Field field, double value); -extern GrB_Info GxB_Desc_set_INT32(GrB_Descriptor desc, GrB_Desc_Field field, int32_t value); -extern GrB_Info GxB_Descriptor_fprint(GrB_Descriptor descriptor, const char *name, GxB_Print_Level pr, FILE *f); -extern GrB_Info GxB_Descriptor_get(GrB_Desc_Value *val, GrB_Descriptor desc, GrB_Desc_Field field); +GrB_Info GxB_Desc_get(GrB_Descriptor desc, GrB_Desc_Field field, ...); +GrB_Info GxB_Desc_get_FP64(GrB_Descriptor desc, GrB_Desc_Field field, double *value); +GrB_Info GxB_Desc_get_INT32(GrB_Descriptor desc, GrB_Desc_Field field, int32_t *value); +GrB_Info GxB_Desc_set(GrB_Descriptor desc, GrB_Desc_Field field, ...); +GrB_Info GxB_Desc_set_FP64(GrB_Descriptor desc, GrB_Desc_Field field, double value); +GrB_Info GxB_Desc_set_INT32(GrB_Descriptor desc, GrB_Desc_Field field, int32_t value); +GrB_Info GxB_Descriptor_fprint(GrB_Descriptor descriptor, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_Descriptor_get(GrB_Desc_Value *val, GrB_Descriptor desc, GrB_Desc_Field field); /* indexunary */ -extern GrB_Info GxB_IndexUnaryOp_fprint(GrB_IndexUnaryOp op, const char *name, GxB_Print_Level pr, FILE *f); -extern GrB_Info GxB_IndexUnaryOp_new(GrB_IndexUnaryOp *op, GxB_index_unary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *idxop_name, const char *idxop_defn); -extern GrB_Info GxB_IndexUnaryOp_xtype_name(char *type_name, const GrB_IndexUnaryOp op); -extern GrB_Info GxB_IndexUnaryOp_ytype_name(char *type_name, const GrB_IndexUnaryOp op); -extern GrB_Info GxB_IndexUnaryOp_ztype_name(char *type_name, const GrB_IndexUnaryOp op); +GrB_Info GxB_IndexUnaryOp_fprint(GrB_IndexUnaryOp op, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_IndexUnaryOp_new(GrB_IndexUnaryOp *op, GxB_index_unary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *idxop_name, const char *idxop_defn); +GrB_Info GxB_IndexUnaryOp_xtype_name(char *type_name, const GrB_IndexUnaryOp op); +GrB_Info GxB_IndexUnaryOp_ytype_name(char *type_name, const GrB_IndexUnaryOp op); +GrB_Info GxB_IndexUnaryOp_ztype_name(char *type_name, const GrB_IndexUnaryOp op); /* iterator */ -extern GrB_Index GxB_Matrix_Iterator_getp(GxB_Iterator iterator); -extern GrB_Index GxB_Matrix_Iterator_getpmax(GxB_Iterator iterator); -extern GrB_Index GxB_Vector_Iterator_getIndex(GxB_Iterator iterator); -extern GrB_Index GxB_Vector_Iterator_getp(GxB_Iterator iterator); -extern GrB_Index GxB_Vector_Iterator_getpmax(GxB_Iterator iterator); -extern GrB_Index GxB_colIterator_getColIndex(GxB_Iterator iterator); -extern GrB_Index GxB_colIterator_getRowIndex(GxB_Iterator iterator); -extern GrB_Index GxB_colIterator_kount(GxB_Iterator iterator); -extern GrB_Index GxB_rowIterator_getColIndex(GxB_Iterator iterator); -extern GrB_Index GxB_rowIterator_getRowIndex(GxB_Iterator iterator); -extern GrB_Index GxB_rowIterator_kount(GxB_Iterator iterator); -extern GrB_Info GxB_Iterator_free(GxB_Iterator *iterator); -extern GrB_Info GxB_Iterator_new(GxB_Iterator *iterator); -extern GrB_Info GxB_Matrix_Iterator_next(GxB_Iterator iterator); -extern GrB_Info GxB_Matrix_Iterator_seek(GxB_Iterator iterator, GrB_Index p); -extern GrB_Info GxB_Vector_Iterator_next(GxB_Iterator iterator); -extern GrB_Info GxB_Vector_Iterator_seek(GxB_Iterator iterator, GrB_Index p); -extern GrB_Info GxB_colIterator_kseek(GxB_Iterator iterator, GrB_Index k); -extern GrB_Info GxB_colIterator_nextCol(GxB_Iterator iterator); -extern GrB_Info GxB_colIterator_nextRow(GxB_Iterator iterator); -extern GrB_Info GxB_colIterator_seekCol(GxB_Iterator iterator, GrB_Index col); -extern GrB_Info GxB_rowIterator_kseek(GxB_Iterator iterator, GrB_Index k); -extern GrB_Info GxB_rowIterator_nextCol(GxB_Iterator iterator); -extern GrB_Info GxB_rowIterator_nextRow(GxB_Iterator iterator); -extern GrB_Info GxB_rowIterator_seekRow(GxB_Iterator iterator, GrB_Index row); -extern GxB_FC32_t GxB_Iterator_get_FC32(GxB_Iterator iterator); -extern GxB_FC64_t GxB_Iterator_get_FC64(GxB_Iterator iterator); -extern bool GxB_Iterator_get_BOOL(GxB_Iterator iterator); -extern double GxB_Iterator_get_FP64(GxB_Iterator iterator); -extern float GxB_Iterator_get_FP32(GxB_Iterator iterator); -extern int8_t GxB_Iterator_get_INT8(GxB_Iterator iterator); -extern int16_t GxB_Iterator_get_INT16(GxB_Iterator iterator); -extern int32_t GxB_Iterator_get_INT32(GxB_Iterator iterator); -extern int64_t GxB_Iterator_get_INT64(GxB_Iterator iterator); -extern uint8_t GxB_Iterator_get_UINT8(GxB_Iterator iterator); -extern uint16_t GxB_Iterator_get_UINT16(GxB_Iterator iterator); -extern uint32_t GxB_Iterator_get_UINT32(GxB_Iterator iterator); -extern uint64_t GxB_Iterator_get_UINT64(GxB_Iterator iterator); -extern void GxB_Iterator_get_UDT(GxB_Iterator iterator, void *value); -extern void GxB_Matrix_Iterator_getIndex(GxB_Iterator iterator, GrB_Index *row, GrB_Index *col); +GrB_Index GxB_Matrix_Iterator_getp(GxB_Iterator iterator); +GrB_Index GxB_Matrix_Iterator_getpmax(GxB_Iterator iterator); +GrB_Index GxB_Vector_Iterator_getIndex(GxB_Iterator iterator); +GrB_Index GxB_Vector_Iterator_getp(GxB_Iterator iterator); +GrB_Index GxB_Vector_Iterator_getpmax(GxB_Iterator iterator); +GrB_Index GxB_colIterator_getColIndex(GxB_Iterator iterator); +GrB_Index GxB_colIterator_getRowIndex(GxB_Iterator iterator); +GrB_Index GxB_colIterator_kount(GxB_Iterator iterator); +GrB_Index GxB_rowIterator_getColIndex(GxB_Iterator iterator); +GrB_Index GxB_rowIterator_getRowIndex(GxB_Iterator iterator); +GrB_Index GxB_rowIterator_kount(GxB_Iterator iterator); +GrB_Info GxB_Iterator_free(GxB_Iterator *iterator); +GrB_Info GxB_Iterator_new(GxB_Iterator *iterator); +GrB_Info GxB_Matrix_Iterator_next(GxB_Iterator iterator); +GrB_Info GxB_Matrix_Iterator_seek(GxB_Iterator iterator, GrB_Index p); +GrB_Info GxB_Vector_Iterator_next(GxB_Iterator iterator); +GrB_Info GxB_Vector_Iterator_seek(GxB_Iterator iterator, GrB_Index p); +GrB_Info GxB_colIterator_kseek(GxB_Iterator iterator, GrB_Index k); +GrB_Info GxB_colIterator_nextCol(GxB_Iterator iterator); +GrB_Info GxB_colIterator_nextRow(GxB_Iterator iterator); +GrB_Info GxB_colIterator_seekCol(GxB_Iterator iterator, GrB_Index col); +GrB_Info GxB_rowIterator_kseek(GxB_Iterator iterator, GrB_Index k); +GrB_Info GxB_rowIterator_nextCol(GxB_Iterator iterator); +GrB_Info GxB_rowIterator_nextRow(GxB_Iterator iterator); +GrB_Info GxB_rowIterator_seekRow(GxB_Iterator iterator, GrB_Index row); +GxB_FC32_t GxB_Iterator_get_FC32(GxB_Iterator iterator); +GxB_FC64_t GxB_Iterator_get_FC64(GxB_Iterator iterator); +bool GxB_Iterator_get_BOOL(GxB_Iterator iterator); +double GxB_Iterator_get_FP64(GxB_Iterator iterator); +float GxB_Iterator_get_FP32(GxB_Iterator iterator); +int8_t GxB_Iterator_get_INT8(GxB_Iterator iterator); +int16_t GxB_Iterator_get_INT16(GxB_Iterator iterator); +int32_t GxB_Iterator_get_INT32(GxB_Iterator iterator); +int64_t GxB_Iterator_get_INT64(GxB_Iterator iterator); +uint8_t GxB_Iterator_get_UINT8(GxB_Iterator iterator); +uint16_t GxB_Iterator_get_UINT16(GxB_Iterator iterator); +uint32_t GxB_Iterator_get_UINT32(GxB_Iterator iterator); +uint64_t GxB_Iterator_get_UINT64(GxB_Iterator iterator); +void GxB_Iterator_get_UDT(GxB_Iterator iterator, void *value); +void GxB_Matrix_Iterator_getIndex(GxB_Iterator iterator, GrB_Index *row, GrB_Index *col); /* matrix */ -extern GrB_Info GxB_Col_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_Option_get(GrB_Matrix A, GxB_Option_Field field, ...); -extern GrB_Info GxB_Matrix_Option_get_FP64(GrB_Matrix A, GxB_Option_Field field, double *value); -extern GrB_Info GxB_Matrix_Option_get_INT32(GrB_Matrix A, GxB_Option_Field field, int32_t *value); -extern GrB_Info GxB_Matrix_Option_set(GrB_Matrix A, GxB_Option_Field field, ...); -extern GrB_Info GxB_Matrix_Option_set_FP64(GrB_Matrix A, GxB_Option_Field field, double value); -extern GrB_Info GxB_Matrix_Option_set_INT32(GrB_Matrix A, GxB_Option_Field field, int32_t value); -extern GrB_Info GxB_Matrix_apply_BinaryOp1st(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_apply_BinaryOp1st_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC32_t x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_apply_BinaryOp1st_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC64_t x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_apply_BinaryOp2nd(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Scalar y, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_apply_BinaryOp2nd_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, GxB_FC32_t y, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_apply_BinaryOp2nd_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, GxB_FC64_t y, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_apply_IndexOp_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, GxB_FC32_t y, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_apply_IndexOp_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, GxB_FC64_t y, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_assign_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_assign_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_build_FC32(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const GxB_FC32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GxB_Matrix_build_FC64(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const GxB_FC64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GxB_Matrix_build_Scalar(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, GrB_Scalar scalar, GrB_Index nvals); -extern GrB_Info GxB_Matrix_concat(GrB_Matrix C, const GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_deserialize(GrB_Matrix *C, GrB_Type type, const void *blob, GrB_Index blob_size, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_diag(GrB_Matrix C, const GrB_Vector v, int64_t k, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_eWiseUnion(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Matrix A, const GrB_Scalar alpha, const GrB_Matrix B, const GrB_Scalar beta, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_BitmapC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_BitmapR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_CSC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_CSR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_FC32(GrB_Index *Ap, GrB_Index *Ai, GxB_FC32_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -extern GrB_Info GxB_Matrix_export_FC64(GrB_Index *Ap, GrB_Index *Ai, GxB_FC64_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -extern GrB_Info GxB_Matrix_export_FullC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_FullR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_HyperCSC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_HyperCSR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_extractElement_FC32(GxB_FC32_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -extern GrB_Info GxB_Matrix_extractElement_FC64(GxB_FC64_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -extern GrB_Info GxB_Matrix_extractTuples_FC32(GrB_Index *I, GrB_Index *J, GxB_FC32_t *X, GrB_Index *nvals, const GrB_Matrix A); -extern GrB_Info GxB_Matrix_extractTuples_FC64(GrB_Index *I, GrB_Index *J, GxB_FC64_t *X, GrB_Index *nvals, const GrB_Matrix A); -extern GrB_Info GxB_Matrix_fprint(GrB_Matrix A, const char *name, GxB_Print_Level pr, FILE *f); -extern GrB_Info GxB_Matrix_import_BitmapC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_BitmapR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_CSC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_CSR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_FC32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const GxB_FC32_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -extern GrB_Info GxB_Matrix_import_FC64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const GxB_FC64_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -extern GrB_Info GxB_Matrix_import_FullC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_FullR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_HyperCSC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_HyperCSR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_isStoredElement(const GrB_Matrix A, GrB_Index i, GrB_Index j); -extern GrB_Info GxB_Matrix_iso(bool *iso, const GrB_Matrix A); -extern GrB_Info GxB_Matrix_memoryUsage(size_t *size, const GrB_Matrix A); -extern GrB_Info GxB_Matrix_pack_BitmapC(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_pack_BitmapR(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_pack_CSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_pack_CSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_pack_FullC(GrB_Matrix A, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_pack_FullR(GrB_Matrix A, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_pack_HyperCSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_pack_HyperCSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_reduce_FC32(GxB_FC32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_reduce_FC64(GxB_FC64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_reshape(GrB_Matrix C, bool by_col, GrB_Index nrows_new, GrB_Index ncols_new, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_reshapeDup(GrB_Matrix *C, GrB_Matrix A, bool by_col, GrB_Index nrows_new, GrB_Index ncols_new, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_select(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Matrix A, const GrB_Scalar Thunk, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_select_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, GxB_FC32_t y, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_select_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, GxB_FC64_t y, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_serialize(void **blob_handle, GrB_Index *blob_size_handle, GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_setElement_FC32(GrB_Matrix C, GxB_FC32_t x, GrB_Index i, GrB_Index j); -extern GrB_Info GxB_Matrix_setElement_FC64(GrB_Matrix C, GxB_FC64_t x, GrB_Index i, GrB_Index j); -extern GrB_Info GxB_Matrix_sort(GrB_Matrix C, GrB_Matrix P, GrB_BinaryOp op, GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_split(GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Index *Tile_nrows, const GrB_Index *Tile_ncols, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_subassign(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_subassign_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_subassign_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_subassign_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_subassign_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_subassign_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, double x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_subassign_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_subassign_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_subassign_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_subassign_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_subassign_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_subassign_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_subassign_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_subassign_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_subassign_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_subassign_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_type(GrB_Type *type, const GrB_Matrix A); -extern GrB_Info GxB_Matrix_type_name(char *type_name, const GrB_Matrix A); -extern GrB_Info GxB_Matrix_unpack_BitmapC(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_unpack_BitmapR(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_unpack_CSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_unpack_CSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_unpack_FullC(GrB_Matrix A, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_unpack_FullR(GrB_Matrix A, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_unpack_HyperCSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_unpack_HyperCSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Row_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, GrB_Index i, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_diag(GrB_Vector v, const GrB_Matrix A, int64_t k, const GrB_Descriptor desc); -extern GrB_Info GxB_colIterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); -extern GrB_Info GxB_pack_HyperHash(GrB_Matrix A, GrB_Matrix *Y, const GrB_Descriptor desc); -extern GrB_Info GxB_rowIterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); -extern GrB_Info GxB_unpack_HyperHash(GrB_Matrix A, GrB_Matrix *Y, const GrB_Descriptor desc); +GrB_Info GxB_Col_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); +GrB_Info GxB_Matrix_Option_get(GrB_Matrix A, GxB_Option_Field field, ...); +GrB_Info GxB_Matrix_Option_get_FP64(GrB_Matrix A, GxB_Option_Field field, double *value); +GrB_Info GxB_Matrix_Option_get_INT32(GrB_Matrix A, GxB_Option_Field field, int32_t *value); +GrB_Info GxB_Matrix_Option_set(GrB_Matrix A, GxB_Option_Field field, ...); +GrB_Info GxB_Matrix_Option_set_FP64(GrB_Matrix A, GxB_Option_Field field, double value); +GrB_Info GxB_Matrix_Option_set_INT32(GrB_Matrix A, GxB_Option_Field field, int32_t value); +GrB_Info GxB_Matrix_apply_BinaryOp1st(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_apply_BinaryOp1st_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC32_t x, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_apply_BinaryOp1st_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC64_t x, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_apply_BinaryOp2nd(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Scalar y, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_apply_BinaryOp2nd_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, GxB_FC32_t y, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_apply_BinaryOp2nd_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, GxB_FC64_t y, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_apply_IndexOp_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, GxB_FC32_t y, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_apply_IndexOp_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, GxB_FC64_t y, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_assign_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_assign_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_build_FC32(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const GxB_FC32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GxB_Matrix_build_FC64(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const GxB_FC64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GxB_Matrix_build_Scalar(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, GrB_Scalar scalar, GrB_Index nvals); +GrB_Info GxB_Matrix_concat(GrB_Matrix C, const GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_deserialize(GrB_Matrix *C, GrB_Type type, const void *blob, GrB_Index blob_size, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_diag(GrB_Matrix C, const GrB_Vector v, int64_t k, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_eWiseUnion(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Matrix A, const GrB_Scalar alpha, const GrB_Matrix B, const GrB_Scalar beta, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_export_BitmapC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_export_BitmapR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_export_CSC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_export_CSR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_export_FC32(GrB_Index *Ap, GrB_Index *Ai, GxB_FC32_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +GrB_Info GxB_Matrix_export_FC64(GrB_Index *Ap, GrB_Index *Ai, GxB_FC64_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +GrB_Info GxB_Matrix_export_FullC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_export_FullR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_export_HyperCSC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_export_HyperCSR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_extractElement_FC32(GxB_FC32_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +GrB_Info GxB_Matrix_extractElement_FC64(GxB_FC64_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +GrB_Info GxB_Matrix_extractTuples_FC32(GrB_Index *I, GrB_Index *J, GxB_FC32_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GxB_Matrix_extractTuples_FC64(GrB_Index *I, GrB_Index *J, GxB_FC64_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GxB_Matrix_fprint(GrB_Matrix A, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_Matrix_import_BitmapC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_import_BitmapR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_import_CSC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_import_CSR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_import_FC32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const GxB_FC32_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +GrB_Info GxB_Matrix_import_FC64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const GxB_FC64_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +GrB_Info GxB_Matrix_import_FullC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_import_FullR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_import_HyperCSC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_import_HyperCSR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_isStoredElement(const GrB_Matrix A, GrB_Index i, GrB_Index j); +GrB_Info GxB_Matrix_iso(bool *iso, const GrB_Matrix A); +GrB_Info GxB_Matrix_memoryUsage(size_t *size, const GrB_Matrix A); +GrB_Info GxB_Matrix_pack_BitmapC(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_pack_BitmapR(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_pack_CSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_pack_CSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_pack_FullC(GrB_Matrix A, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_pack_FullR(GrB_Matrix A, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_pack_HyperCSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_pack_HyperCSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_reduce_FC32(GxB_FC32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_reduce_FC64(GxB_FC64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_reshape(GrB_Matrix C, bool by_col, GrB_Index nrows_new, GrB_Index ncols_new, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_reshapeDup(GrB_Matrix *C, GrB_Matrix A, bool by_col, GrB_Index nrows_new, GrB_Index ncols_new, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_select(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Matrix A, const GrB_Scalar Thunk, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_select_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, GxB_FC32_t y, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_select_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, GxB_FC64_t y, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_serialize(void **blob_handle, GrB_Index *blob_size_handle, GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_setElement_FC32(GrB_Matrix C, GxB_FC32_t x, GrB_Index i, GrB_Index j); +GrB_Info GxB_Matrix_setElement_FC64(GrB_Matrix C, GxB_FC64_t x, GrB_Index i, GrB_Index j); +GrB_Info GxB_Matrix_sort(GrB_Matrix C, GrB_Matrix P, GrB_BinaryOp op, GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_split(GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Index *Tile_nrows, const GrB_Index *Tile_ncols, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, double x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_type(GrB_Type *type, const GrB_Matrix A); +GrB_Info GxB_Matrix_type_name(char *type_name, const GrB_Matrix A); +GrB_Info GxB_Matrix_unpack_BitmapC(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_unpack_BitmapR(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_unpack_CSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_unpack_CSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_unpack_FullC(GrB_Matrix A, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_unpack_FullR(GrB_Matrix A, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_unpack_HyperCSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_unpack_HyperCSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Row_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, GrB_Index i, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Vector_diag(GrB_Vector v, const GrB_Matrix A, int64_t k, const GrB_Descriptor desc); +GrB_Info GxB_colIterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); +GrB_Info GxB_pack_HyperHash(GrB_Matrix A, GrB_Matrix *Y, const GrB_Descriptor desc); +GrB_Info GxB_rowIterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); +GrB_Info GxB_unpack_HyperHash(GrB_Matrix A, GrB_Matrix *Y, const GrB_Descriptor desc); /* monoid */ -extern GrB_Info GxB_Monoid_fprint(GrB_Monoid monoid, const char *name, GxB_Print_Level pr, FILE *f); -extern GrB_Info GxB_Monoid_identity(void *identity, GrB_Monoid monoid); -extern GrB_Info GxB_Monoid_new_FC32(GrB_Monoid *monoid, GrB_BinaryOp op, GxB_FC32_t identity); -extern GrB_Info GxB_Monoid_new_FC64(GrB_Monoid *monoid, GrB_BinaryOp op, GxB_FC64_t identity); -extern GrB_Info GxB_Monoid_operator(GrB_BinaryOp *op, GrB_Monoid monoid); -extern GrB_Info GxB_Monoid_terminal(bool *has_terminal, void *terminal, GrB_Monoid monoid); -extern GrB_Info GxB_Monoid_terminal_new_BOOL(GrB_Monoid *monoid, GrB_BinaryOp op, bool identity, bool terminal); -extern GrB_Info GxB_Monoid_terminal_new_FC32(GrB_Monoid *monoid, GrB_BinaryOp op, GxB_FC32_t identity, GxB_FC32_t terminal); -extern GrB_Info GxB_Monoid_terminal_new_FC64(GrB_Monoid *monoid, GrB_BinaryOp op, GxB_FC64_t identity, GxB_FC64_t terminal); -extern GrB_Info GxB_Monoid_terminal_new_FP32(GrB_Monoid *monoid, GrB_BinaryOp op, float identity, float terminal); -extern GrB_Info GxB_Monoid_terminal_new_FP64(GrB_Monoid *monoid, GrB_BinaryOp op, double identity, double terminal); -extern GrB_Info GxB_Monoid_terminal_new_INT8(GrB_Monoid *monoid, GrB_BinaryOp op, int8_t identity, int8_t terminal); -extern GrB_Info GxB_Monoid_terminal_new_INT16(GrB_Monoid *monoid, GrB_BinaryOp op, int16_t identity, int16_t terminal); -extern GrB_Info GxB_Monoid_terminal_new_INT32(GrB_Monoid *monoid, GrB_BinaryOp op, int32_t identity, int32_t terminal); -extern GrB_Info GxB_Monoid_terminal_new_INT64(GrB_Monoid *monoid, GrB_BinaryOp op, int64_t identity, int64_t terminal); -extern GrB_Info GxB_Monoid_terminal_new_UDT(GrB_Monoid *monoid, GrB_BinaryOp op, void *identity, void *terminal); -extern GrB_Info GxB_Monoid_terminal_new_UINT8(GrB_Monoid *monoid, GrB_BinaryOp op, uint8_t identity, uint8_t terminal); -extern GrB_Info GxB_Monoid_terminal_new_UINT16(GrB_Monoid *monoid, GrB_BinaryOp op, uint16_t identity, uint16_t terminal); -extern GrB_Info GxB_Monoid_terminal_new_UINT32(GrB_Monoid *monoid, GrB_BinaryOp op, uint32_t identity, uint32_t terminal); -extern GrB_Info GxB_Monoid_terminal_new_UINT64(GrB_Monoid *monoid, GrB_BinaryOp op, uint64_t identity, uint64_t terminal); +GrB_Info GxB_Monoid_fprint(GrB_Monoid monoid, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_Monoid_identity(void *identity, GrB_Monoid monoid); +GrB_Info GxB_Monoid_new_FC32(GrB_Monoid *monoid, GrB_BinaryOp op, GxB_FC32_t identity); +GrB_Info GxB_Monoid_new_FC64(GrB_Monoid *monoid, GrB_BinaryOp op, GxB_FC64_t identity); +GrB_Info GxB_Monoid_operator(GrB_BinaryOp *op, GrB_Monoid monoid); +GrB_Info GxB_Monoid_terminal(bool *has_terminal, void *terminal, GrB_Monoid monoid); +GrB_Info GxB_Monoid_terminal_new_BOOL(GrB_Monoid *monoid, GrB_BinaryOp op, bool identity, bool terminal); +GrB_Info GxB_Monoid_terminal_new_FC32(GrB_Monoid *monoid, GrB_BinaryOp op, GxB_FC32_t identity, GxB_FC32_t terminal); +GrB_Info GxB_Monoid_terminal_new_FC64(GrB_Monoid *monoid, GrB_BinaryOp op, GxB_FC64_t identity, GxB_FC64_t terminal); +GrB_Info GxB_Monoid_terminal_new_FP32(GrB_Monoid *monoid, GrB_BinaryOp op, float identity, float terminal); +GrB_Info GxB_Monoid_terminal_new_FP64(GrB_Monoid *monoid, GrB_BinaryOp op, double identity, double terminal); +GrB_Info GxB_Monoid_terminal_new_INT8(GrB_Monoid *monoid, GrB_BinaryOp op, int8_t identity, int8_t terminal); +GrB_Info GxB_Monoid_terminal_new_INT16(GrB_Monoid *monoid, GrB_BinaryOp op, int16_t identity, int16_t terminal); +GrB_Info GxB_Monoid_terminal_new_INT32(GrB_Monoid *monoid, GrB_BinaryOp op, int32_t identity, int32_t terminal); +GrB_Info GxB_Monoid_terminal_new_INT64(GrB_Monoid *monoid, GrB_BinaryOp op, int64_t identity, int64_t terminal); +GrB_Info GxB_Monoid_terminal_new_UDT(GrB_Monoid *monoid, GrB_BinaryOp op, void *identity, void *terminal); +GrB_Info GxB_Monoid_terminal_new_UINT8(GrB_Monoid *monoid, GrB_BinaryOp op, uint8_t identity, uint8_t terminal); +GrB_Info GxB_Monoid_terminal_new_UINT16(GrB_Monoid *monoid, GrB_BinaryOp op, uint16_t identity, uint16_t terminal); +GrB_Info GxB_Monoid_terminal_new_UINT32(GrB_Monoid *monoid, GrB_BinaryOp op, uint32_t identity, uint32_t terminal); +GrB_Info GxB_Monoid_terminal_new_UINT64(GrB_Monoid *monoid, GrB_BinaryOp op, uint64_t identity, uint64_t terminal); /* scalar */ -extern GrB_Info GxB_Scalar_clear(GrB_Scalar s); -extern GrB_Info GxB_Scalar_dup(GrB_Scalar *s, const GrB_Scalar t); -extern GrB_Info GxB_Scalar_error(const char **error, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_BOOL(bool *x, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_FC32(GxB_FC32_t *x, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_FC64(GxB_FC64_t *x, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_FP32(float *x, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_FP64(double *x, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_INT8(int8_t *x, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_INT16(int16_t *x, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_INT32(int32_t *x, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_INT64(int64_t *x, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_UDT(void *x, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_UINT8(uint8_t *x, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_UINT16(uint16_t *x, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_UINT32(uint32_t *x, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_UINT64(uint64_t *x, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_fprint(GrB_Scalar s, const char *name, GxB_Print_Level pr, FILE *f); -extern GrB_Info GxB_Scalar_free(GrB_Scalar *s); -extern GrB_Info GxB_Scalar_memoryUsage(size_t *size, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_new(GrB_Scalar *s, GrB_Type type); -extern GrB_Info GxB_Scalar_nvals(GrB_Index *nvals, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_setElement_BOOL(GrB_Scalar s, bool x); -extern GrB_Info GxB_Scalar_setElement_FC32(GrB_Scalar s, GxB_FC32_t x); -extern GrB_Info GxB_Scalar_setElement_FC64(GrB_Scalar s, GxB_FC64_t x); -extern GrB_Info GxB_Scalar_setElement_FP32(GrB_Scalar s, float x); -extern GrB_Info GxB_Scalar_setElement_FP64(GrB_Scalar s, double x); -extern GrB_Info GxB_Scalar_setElement_INT8(GrB_Scalar s, int8_t x); -extern GrB_Info GxB_Scalar_setElement_INT16(GrB_Scalar s, int16_t x); -extern GrB_Info GxB_Scalar_setElement_INT32(GrB_Scalar s, int32_t x); -extern GrB_Info GxB_Scalar_setElement_INT64(GrB_Scalar s, int64_t x); -extern GrB_Info GxB_Scalar_setElement_UDT(GrB_Scalar s, void *x); -extern GrB_Info GxB_Scalar_setElement_UINT8(GrB_Scalar s, uint8_t x); -extern GrB_Info GxB_Scalar_setElement_UINT16(GrB_Scalar s, uint16_t x); -extern GrB_Info GxB_Scalar_setElement_UINT32(GrB_Scalar s, uint32_t x); -extern GrB_Info GxB_Scalar_setElement_UINT64(GrB_Scalar s, uint64_t x); -extern GrB_Info GxB_Scalar_type(GrB_Type *type, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_type_name(char *type_name, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_wait(GrB_Scalar *s); +GrB_Info GxB_Scalar_clear(GrB_Scalar s); +GrB_Info GxB_Scalar_dup(GrB_Scalar *s, const GrB_Scalar t); +GrB_Info GxB_Scalar_error(const char **error, const GrB_Scalar s); +GrB_Info GxB_Scalar_extractElement_BOOL(bool *x, const GrB_Scalar s); +GrB_Info GxB_Scalar_extractElement_FC32(GxB_FC32_t *x, const GrB_Scalar s); +GrB_Info GxB_Scalar_extractElement_FC64(GxB_FC64_t *x, const GrB_Scalar s); +GrB_Info GxB_Scalar_extractElement_FP32(float *x, const GrB_Scalar s); +GrB_Info GxB_Scalar_extractElement_FP64(double *x, const GrB_Scalar s); +GrB_Info GxB_Scalar_extractElement_INT8(int8_t *x, const GrB_Scalar s); +GrB_Info GxB_Scalar_extractElement_INT16(int16_t *x, const GrB_Scalar s); +GrB_Info GxB_Scalar_extractElement_INT32(int32_t *x, const GrB_Scalar s); +GrB_Info GxB_Scalar_extractElement_INT64(int64_t *x, const GrB_Scalar s); +GrB_Info GxB_Scalar_extractElement_UDT(void *x, const GrB_Scalar s); +GrB_Info GxB_Scalar_extractElement_UINT8(uint8_t *x, const GrB_Scalar s); +GrB_Info GxB_Scalar_extractElement_UINT16(uint16_t *x, const GrB_Scalar s); +GrB_Info GxB_Scalar_extractElement_UINT32(uint32_t *x, const GrB_Scalar s); +GrB_Info GxB_Scalar_extractElement_UINT64(uint64_t *x, const GrB_Scalar s); +GrB_Info GxB_Scalar_fprint(GrB_Scalar s, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_Scalar_free(GrB_Scalar *s); +GrB_Info GxB_Scalar_memoryUsage(size_t *size, const GrB_Scalar s); +GrB_Info GxB_Scalar_new(GrB_Scalar *s, GrB_Type type); +GrB_Info GxB_Scalar_nvals(GrB_Index *nvals, const GrB_Scalar s); +GrB_Info GxB_Scalar_setElement_BOOL(GrB_Scalar s, bool x); +GrB_Info GxB_Scalar_setElement_FC32(GrB_Scalar s, GxB_FC32_t x); +GrB_Info GxB_Scalar_setElement_FC64(GrB_Scalar s, GxB_FC64_t x); +GrB_Info GxB_Scalar_setElement_FP32(GrB_Scalar s, float x); +GrB_Info GxB_Scalar_setElement_FP64(GrB_Scalar s, double x); +GrB_Info GxB_Scalar_setElement_INT8(GrB_Scalar s, int8_t x); +GrB_Info GxB_Scalar_setElement_INT16(GrB_Scalar s, int16_t x); +GrB_Info GxB_Scalar_setElement_INT32(GrB_Scalar s, int32_t x); +GrB_Info GxB_Scalar_setElement_INT64(GrB_Scalar s, int64_t x); +GrB_Info GxB_Scalar_setElement_UDT(GrB_Scalar s, void *x); +GrB_Info GxB_Scalar_setElement_UINT8(GrB_Scalar s, uint8_t x); +GrB_Info GxB_Scalar_setElement_UINT16(GrB_Scalar s, uint16_t x); +GrB_Info GxB_Scalar_setElement_UINT32(GrB_Scalar s, uint32_t x); +GrB_Info GxB_Scalar_setElement_UINT64(GrB_Scalar s, uint64_t x); +GrB_Info GxB_Scalar_type(GrB_Type *type, const GrB_Scalar s); +GrB_Info GxB_Scalar_type_name(char *type_name, const GrB_Scalar s); +GrB_Info GxB_Scalar_wait(GrB_Scalar *s); /* selectop */ -extern GrB_Info GxB_SelectOp_error(const char **error, const GxB_SelectOp op); -extern GrB_Info GxB_SelectOp_fprint(GxB_SelectOp selectop, const char *name, GxB_Print_Level pr, FILE *f); -extern GrB_Info GxB_SelectOp_free(GxB_SelectOp *selectop); -extern GrB_Info GxB_SelectOp_new(GxB_SelectOp *selectop, GxB_select_function function, GrB_Type xtype, GrB_Type ttype); -extern GrB_Info GxB_SelectOp_ttype(GrB_Type *ttype, GxB_SelectOp selectop); -extern GrB_Info GxB_SelectOp_wait(GxB_SelectOp op, GrB_WaitMode waitmode); -extern GrB_Info GxB_SelectOp_xtype(GrB_Type *xtype, GxB_SelectOp selectop); +GrB_Info GxB_SelectOp_error(const char **error, const GxB_SelectOp op); +GrB_Info GxB_SelectOp_fprint(GxB_SelectOp selectop, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_SelectOp_free(GxB_SelectOp *selectop); +GrB_Info GxB_SelectOp_new(GxB_SelectOp *selectop, GxB_select_function function, GrB_Type xtype, GrB_Type ttype); +GrB_Info GxB_SelectOp_ttype(GrB_Type *ttype, GxB_SelectOp selectop); +GrB_Info GxB_SelectOp_wait(GxB_SelectOp op, GrB_WaitMode waitmode); +GrB_Info GxB_SelectOp_xtype(GrB_Type *xtype, GxB_SelectOp selectop); /* semiring */ -extern GrB_Info GxB_Semiring_add(GrB_Monoid *add, GrB_Semiring semiring); -extern GrB_Info GxB_Semiring_fprint(GrB_Semiring semiring, const char *name, GxB_Print_Level pr, FILE *f); -extern GrB_Info GxB_Semiring_multiply(GrB_BinaryOp *multiply, GrB_Semiring semiring); +GrB_Info GxB_Semiring_add(GrB_Monoid *add, GrB_Semiring semiring); +GrB_Info GxB_Semiring_fprint(GrB_Semiring semiring, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_Semiring_multiply(GrB_BinaryOp *multiply, GrB_Semiring semiring); /* type */ -extern GrB_Info GxB_Type_fprint(GrB_Type type, const char *name, GxB_Print_Level pr, FILE *f); -extern GrB_Info GxB_Type_from_name(GrB_Type *type, const char *type_name); -extern GrB_Info GxB_Type_name(char *type_name, const GrB_Type type); -extern GrB_Info GxB_Type_new(GrB_Type *type, size_t sizeof_ctype, const char *type_name, const char *type_defn); -extern GrB_Info GxB_Type_size(size_t *size, const GrB_Type type); +GrB_Info GxB_Type_fprint(GrB_Type type, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_Type_from_name(GrB_Type *type, const char *type_name); +GrB_Info GxB_Type_name(char *type_name, const GrB_Type type); +GrB_Info GxB_Type_new(GrB_Type *type, size_t sizeof_ctype, const char *type_name, const char *type_defn); +GrB_Info GxB_Type_size(size_t *size, const GrB_Type type); /* unary */ -extern GrB_Info GxB_UnaryOp_fprint(GrB_UnaryOp unaryop, const char *name, GxB_Print_Level pr, FILE *f); -extern GrB_Info GxB_UnaryOp_new(GrB_UnaryOp *unaryop, GxB_unary_function function, GrB_Type ztype, GrB_Type xtype, const char *unop_name, const char *unop_defn); -extern GrB_Info GxB_UnaryOp_xtype(GrB_Type *xtype, GrB_UnaryOp unaryop); -extern GrB_Info GxB_UnaryOp_xtype_name(char *type_name, const GrB_UnaryOp unaryop); -extern GrB_Info GxB_UnaryOp_ztype(GrB_Type *ztype, GrB_UnaryOp unaryop); -extern GrB_Info GxB_UnaryOp_ztype_name(char *type_name, const GrB_UnaryOp unaryop); +GrB_Info GxB_UnaryOp_fprint(GrB_UnaryOp unaryop, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_UnaryOp_new(GrB_UnaryOp *unaryop, GxB_unary_function function, GrB_Type ztype, GrB_Type xtype, const char *unop_name, const char *unop_defn); +GrB_Info GxB_UnaryOp_xtype(GrB_Type *xtype, GrB_UnaryOp unaryop); +GrB_Info GxB_UnaryOp_xtype_name(char *type_name, const GrB_UnaryOp unaryop); +GrB_Info GxB_UnaryOp_ztype(GrB_Type *ztype, GrB_UnaryOp unaryop); +GrB_Info GxB_UnaryOp_ztype_name(char *type_name, const GrB_UnaryOp unaryop); /* vector */ -extern GrB_Info GxB_Vector_Iterator_attach(GxB_Iterator iterator, GrB_Vector v, GrB_Descriptor desc); -extern GrB_Info GxB_Vector_Option_get(GrB_Vector A, GxB_Option_Field field, ...); -extern GrB_Info GxB_Vector_Option_get_FP64(GrB_Vector v, GxB_Option_Field field, double *value); -extern GrB_Info GxB_Vector_Option_get_INT32(GrB_Vector v, GxB_Option_Field field, int32_t *value); -extern GrB_Info GxB_Vector_Option_set(GrB_Vector A, GxB_Option_Field field, ...); -extern GrB_Info GxB_Vector_Option_set_FP64(GrB_Vector v, GxB_Option_Field field, double value); -extern GrB_Info GxB_Vector_Option_set_INT32(GrB_Vector v, GxB_Option_Field field, int32_t value); -extern GrB_Info GxB_Vector_apply_BinaryOp1st(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_apply_BinaryOp1st_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC32_t x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_apply_BinaryOp1st_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC64_t x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_apply_BinaryOp2nd(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const GrB_Scalar y, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_apply_BinaryOp2nd_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, GxB_FC32_t y, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_apply_BinaryOp2nd_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, GxB_FC64_t y, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_apply_IndexOp_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, GxB_FC32_t y, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_apply_IndexOp_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, GxB_FC64_t y, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_assign_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GxB_FC32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_assign_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_build_FC32(GrB_Vector w, const GrB_Index *I, const GxB_FC32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GxB_Vector_build_FC64(GrB_Vector w, const GrB_Index *I, const GxB_FC64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GxB_Vector_build_Scalar(GrB_Vector w, const GrB_Index *I, GrB_Scalar scalar, GrB_Index nvals); -extern GrB_Info GxB_Vector_deserialize(GrB_Vector *w, GrB_Type type, const void *blob, GrB_Index blob_size, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_eWiseUnion(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Vector u, const GrB_Scalar alpha, const GrB_Vector v, const GrB_Scalar beta, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_export_Bitmap(GrB_Vector *v, GrB_Type *type, GrB_Index *n, int8_t **vb, void **vx, GrB_Index *vb_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_export_CSC(GrB_Vector *v, GrB_Type *type, GrB_Index *n, GrB_Index **vi, void **vx, GrB_Index *vi_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, bool *jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_export_Full(GrB_Vector *v, GrB_Type *type, GrB_Index *n, void **vx, GrB_Index *vx_size, bool *iso, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_extractElement_FC32(GxB_FC32_t *x, const GrB_Vector v, GrB_Index i); -extern GrB_Info GxB_Vector_extractElement_FC64(GxB_FC64_t *x, const GrB_Vector v, GrB_Index i); -extern GrB_Info GxB_Vector_extractTuples_FC32(GrB_Index *I, GxB_FC32_t *X, GrB_Index *nvals, const GrB_Vector v); -extern GrB_Info GxB_Vector_extractTuples_FC64(GrB_Index *I, GxB_FC64_t *X, GrB_Index *nvals, const GrB_Vector v); -extern GrB_Info GxB_Vector_fprint(GrB_Vector v, const char *name, GxB_Print_Level pr, FILE *f); -extern GrB_Info GxB_Vector_import_Bitmap(GrB_Vector *v, GrB_Type type, GrB_Index n, int8_t **vb, void **vx, GrB_Index vb_size, GrB_Index vx_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_import_CSC(GrB_Vector *v, GrB_Type type, GrB_Index n, GrB_Index **vi, void **vx, GrB_Index vi_size, GrB_Index vx_size, bool iso, GrB_Index nvals, bool jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_import_Full(GrB_Vector *v, GrB_Type type, GrB_Index n, void **vx, GrB_Index vx_size, bool iso, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_isStoredElement(const GrB_Vector v, GrB_Index i); -extern GrB_Info GxB_Vector_iso(bool *iso, const GrB_Vector v); -extern GrB_Info GxB_Vector_memoryUsage(size_t *size, const GrB_Vector v); -extern GrB_Info GxB_Vector_pack_Bitmap(GrB_Vector v, int8_t **vb, void **vx, GrB_Index vb_size, GrB_Index vx_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_pack_CSC(GrB_Vector v, GrB_Index **vi, void **vx, GrB_Index vi_size, GrB_Index vx_size, bool iso, GrB_Index nvals, bool jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_pack_Full(GrB_Vector v, void **vx, GrB_Index vx_size, bool iso, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_reduce_FC32(GxB_FC32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_reduce_FC64(GxB_FC64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_select(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Vector u, const GrB_Scalar Thunk, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_select_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, GxB_FC32_t y, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_select_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, GxB_FC64_t y, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_serialize(void **blob_handle, GrB_Index *blob_size_handle, GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_setElement_FC32(GrB_Vector w, GxB_FC32_t x, GrB_Index i); -extern GrB_Info GxB_Vector_setElement_FC64(GrB_Vector w, GxB_FC64_t x, GrB_Index i); -extern GrB_Info GxB_Vector_sort(GrB_Vector w, GrB_Vector p, GrB_BinaryOp op, GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_subassign(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_subassign_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_subassign_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GxB_FC32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_subassign_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_subassign_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_subassign_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, double x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_subassign_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_subassign_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_subassign_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_subassign_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_subassign_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_subassign_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_subassign_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_subassign_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_subassign_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_subassign_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_type(GrB_Type *type, const GrB_Vector v); -extern GrB_Info GxB_Vector_type_name(char *type_name, const GrB_Vector v); -extern GrB_Info GxB_Vector_unpack_Bitmap(GrB_Vector v, int8_t **vb, void **vx, GrB_Index *vb_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_unpack_CSC(GrB_Vector v, GrB_Index **vi, void **vx, GrB_Index *vi_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, bool *jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_unpack_Full(GrB_Vector v, void **vx, GrB_Index *vx_size, bool *iso, const GrB_Descriptor desc); +GrB_Info GxB_Vector_Iterator_attach(GxB_Iterator iterator, GrB_Vector v, GrB_Descriptor desc); +GrB_Info GxB_Vector_Option_get(GrB_Vector A, GxB_Option_Field field, ...); +GrB_Info GxB_Vector_Option_get_FP64(GrB_Vector v, GxB_Option_Field field, double *value); +GrB_Info GxB_Vector_Option_get_INT32(GrB_Vector v, GxB_Option_Field field, int32_t *value); +GrB_Info GxB_Vector_Option_set(GrB_Vector A, GxB_Option_Field field, ...); +GrB_Info GxB_Vector_Option_set_FP64(GrB_Vector v, GxB_Option_Field field, double value); +GrB_Info GxB_Vector_Option_set_INT32(GrB_Vector v, GxB_Option_Field field, int32_t value); +GrB_Info GxB_Vector_apply_BinaryOp1st(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GxB_Vector_apply_BinaryOp1st_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC32_t x, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GxB_Vector_apply_BinaryOp1st_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC64_t x, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GxB_Vector_apply_BinaryOp2nd(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const GrB_Scalar y, const GrB_Descriptor desc); +GrB_Info GxB_Vector_apply_BinaryOp2nd_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, GxB_FC32_t y, const GrB_Descriptor desc); +GrB_Info GxB_Vector_apply_BinaryOp2nd_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, GxB_FC64_t y, const GrB_Descriptor desc); +GrB_Info GxB_Vector_apply_IndexOp_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, GxB_FC32_t y, const GrB_Descriptor desc); +GrB_Info GxB_Vector_apply_IndexOp_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, GxB_FC64_t y, const GrB_Descriptor desc); +GrB_Info GxB_Vector_assign_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GxB_FC32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_assign_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_build_FC32(GrB_Vector w, const GrB_Index *I, const GxB_FC32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GxB_Vector_build_FC64(GrB_Vector w, const GrB_Index *I, const GxB_FC64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GxB_Vector_build_Scalar(GrB_Vector w, const GrB_Index *I, GrB_Scalar scalar, GrB_Index nvals); +GrB_Info GxB_Vector_deserialize(GrB_Vector *w, GrB_Type type, const void *blob, GrB_Index blob_size, const GrB_Descriptor desc); +GrB_Info GxB_Vector_eWiseUnion(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Vector u, const GrB_Scalar alpha, const GrB_Vector v, const GrB_Scalar beta, const GrB_Descriptor desc); +GrB_Info GxB_Vector_export_Bitmap(GrB_Vector *v, GrB_Type *type, GrB_Index *n, int8_t **vb, void **vx, GrB_Index *vb_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); +GrB_Info GxB_Vector_export_CSC(GrB_Vector *v, GrB_Type *type, GrB_Index *n, GrB_Index **vi, void **vx, GrB_Index *vi_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, bool *jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Vector_export_Full(GrB_Vector *v, GrB_Type *type, GrB_Index *n, void **vx, GrB_Index *vx_size, bool *iso, const GrB_Descriptor desc); +GrB_Info GxB_Vector_extractElement_FC32(GxB_FC32_t *x, const GrB_Vector v, GrB_Index i); +GrB_Info GxB_Vector_extractElement_FC64(GxB_FC64_t *x, const GrB_Vector v, GrB_Index i); +GrB_Info GxB_Vector_extractTuples_FC32(GrB_Index *I, GxB_FC32_t *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GxB_Vector_extractTuples_FC64(GrB_Index *I, GxB_FC64_t *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GxB_Vector_fprint(GrB_Vector v, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_Vector_import_Bitmap(GrB_Vector *v, GrB_Type type, GrB_Index n, int8_t **vb, void **vx, GrB_Index vb_size, GrB_Index vx_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); +GrB_Info GxB_Vector_import_CSC(GrB_Vector *v, GrB_Type type, GrB_Index n, GrB_Index **vi, void **vx, GrB_Index vi_size, GrB_Index vx_size, bool iso, GrB_Index nvals, bool jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Vector_import_Full(GrB_Vector *v, GrB_Type type, GrB_Index n, void **vx, GrB_Index vx_size, bool iso, const GrB_Descriptor desc); +GrB_Info GxB_Vector_isStoredElement(const GrB_Vector v, GrB_Index i); +GrB_Info GxB_Vector_iso(bool *iso, const GrB_Vector v); +GrB_Info GxB_Vector_memoryUsage(size_t *size, const GrB_Vector v); +GrB_Info GxB_Vector_pack_Bitmap(GrB_Vector v, int8_t **vb, void **vx, GrB_Index vb_size, GrB_Index vx_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); +GrB_Info GxB_Vector_pack_CSC(GrB_Vector v, GrB_Index **vi, void **vx, GrB_Index vi_size, GrB_Index vx_size, bool iso, GrB_Index nvals, bool jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Vector_pack_Full(GrB_Vector v, void **vx, GrB_Index vx_size, bool iso, const GrB_Descriptor desc); +GrB_Info GxB_Vector_reduce_FC32(GxB_FC32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GxB_Vector_reduce_FC64(GxB_FC64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GxB_Vector_select(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Vector u, const GrB_Scalar Thunk, const GrB_Descriptor desc); +GrB_Info GxB_Vector_select_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, GxB_FC32_t y, const GrB_Descriptor desc); +GrB_Info GxB_Vector_select_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, GxB_FC64_t y, const GrB_Descriptor desc); +GrB_Info GxB_Vector_serialize(void **blob_handle, GrB_Index *blob_size_handle, GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GxB_Vector_setElement_FC32(GrB_Vector w, GxB_FC32_t x, GrB_Index i); +GrB_Info GxB_Vector_setElement_FC64(GrB_Vector w, GxB_FC64_t x, GrB_Index i); +GrB_Info GxB_Vector_sort(GrB_Vector w, GrB_Vector p, GrB_BinaryOp op, GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GxB_FC32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, double x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_type(GrB_Type *type, const GrB_Vector v); +GrB_Info GxB_Vector_type_name(char *type_name, const GrB_Vector v); +GrB_Info GxB_Vector_unpack_Bitmap(GrB_Vector v, int8_t **vb, void **vx, GrB_Index *vb_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); +GrB_Info GxB_Vector_unpack_CSC(GrB_Vector v, GrB_Index **vi, void **vx, GrB_Index *vi_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, bool *jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Vector_unpack_Full(GrB_Vector v, void **vx, GrB_Index *vx_size, bool *iso, const GrB_Descriptor desc); /* int DEFINES */ #define GRB_SUBVERSION ... diff --git a/suitesparse_graphblas/suitesparse_graphblas_arm64.h b/suitesparse_graphblas/suitesparse_graphblas_arm64.h index 99960fc..39630af 100644 --- a/suitesparse_graphblas/suitesparse_graphblas_arm64.h +++ b/suitesparse_graphblas/suitesparse_graphblas_arm64.h @@ -2625,822 +2625,822 @@ extern GxB_SelectOp GxB_TRIU; ****************/ /* binary */ -extern GrB_Info GrB_BinaryOp_error(const char **error, const GrB_BinaryOp op); -extern GrB_Info GrB_BinaryOp_free(GrB_BinaryOp *binaryop); -extern GrB_Info GrB_BinaryOp_new(GrB_BinaryOp *binaryop, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype); -extern GrB_Info GrB_BinaryOp_wait(GrB_BinaryOp op, GrB_WaitMode waitmode); +GrB_Info GrB_BinaryOp_error(const char **error, const GrB_BinaryOp op); +GrB_Info GrB_BinaryOp_free(GrB_BinaryOp *binaryop); +GrB_Info GrB_BinaryOp_new(GrB_BinaryOp *binaryop, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype); +GrB_Info GrB_BinaryOp_wait(GrB_BinaryOp op, GrB_WaitMode waitmode); /* core */ -extern GrB_Info GrB_finalize(void); -extern GrB_Info GrB_getVersion(unsigned int *version, unsigned int *subversion); -extern GrB_Info GrB_init(GrB_Mode mode); +GrB_Info GrB_finalize(void); +GrB_Info GrB_getVersion(unsigned int *version, unsigned int *subversion); +GrB_Info GrB_init(GrB_Mode mode); /* descriptor */ -extern GrB_Info GrB_Descriptor_error(const char **error, const GrB_Descriptor d); -extern GrB_Info GrB_Descriptor_free(GrB_Descriptor *descriptor); -extern GrB_Info GrB_Descriptor_new(GrB_Descriptor *descriptor); -extern GrB_Info GrB_Descriptor_set(GrB_Descriptor desc, GrB_Desc_Field field, GrB_Desc_Value val); -extern GrB_Info GrB_Descriptor_wait(GrB_Descriptor desc, GrB_WaitMode waitmode); +GrB_Info GrB_Descriptor_error(const char **error, const GrB_Descriptor d); +GrB_Info GrB_Descriptor_free(GrB_Descriptor *descriptor); +GrB_Info GrB_Descriptor_new(GrB_Descriptor *descriptor); +GrB_Info GrB_Descriptor_set(GrB_Descriptor desc, GrB_Desc_Field field, GrB_Desc_Value val); +GrB_Info GrB_Descriptor_wait(GrB_Descriptor desc, GrB_WaitMode waitmode); /* indexunary */ -extern GrB_Info GrB_IndexUnaryOp_error(const char **error, const GrB_IndexUnaryOp op); -extern GrB_Info GrB_IndexUnaryOp_free(GrB_IndexUnaryOp *op); -extern GrB_Info GrB_IndexUnaryOp_new(GrB_IndexUnaryOp *op, GxB_index_unary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype); -extern GrB_Info GrB_IndexUnaryOp_wait(GrB_IndexUnaryOp op, GrB_WaitMode waitmode); +GrB_Info GrB_IndexUnaryOp_error(const char **error, const GrB_IndexUnaryOp op); +GrB_Info GrB_IndexUnaryOp_free(GrB_IndexUnaryOp *op); +GrB_Info GrB_IndexUnaryOp_new(GrB_IndexUnaryOp *op, GxB_index_unary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype); +GrB_Info GrB_IndexUnaryOp_wait(GrB_IndexUnaryOp op, GrB_WaitMode waitmode); /* matrix */ -extern GrB_Info GrB_Col_assign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); -extern GrB_Info GrB_Col_extract(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_UnaryOp op, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp1st_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, bool x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp1st_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, float x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp1st_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, double x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp1st_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int8_t x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp1st_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int16_t x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp1st_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int32_t x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp1st_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int64_t x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp1st_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp1st_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const void *x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp1st_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint8_t x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp1st_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint16_t x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp1st_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint32_t x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp1st_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint64_t x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, bool y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, float y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, double y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, int8_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, int16_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, int32_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, int64_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Scalar y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const void *y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, uint8_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, uint16_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, uint32_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, uint64_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, bool y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, float y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, double y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int8_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int16_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int32_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int64_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const GrB_Scalar y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const void *y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint8_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint16_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint32_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint64_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_assign(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_assign_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_assign_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_assign_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, double x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_assign_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_assign_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_assign_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_assign_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_assign_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_assign_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_assign_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_assign_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_assign_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_assign_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_build_BOOL(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const bool *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Matrix_build_FP32(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const float *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Matrix_build_FP64(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const double *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Matrix_build_INT8(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const int8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Matrix_build_INT16(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const int16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Matrix_build_INT32(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const int32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Matrix_build_INT64(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const int64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Matrix_build_UDT(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const void *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Matrix_build_UINT8(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const uint8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Matrix_build_UINT16(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const uint16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Matrix_build_UINT32(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const uint32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Matrix_build_UINT64(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const uint64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Matrix_clear(GrB_Matrix A); -extern GrB_Info GrB_Matrix_deserialize(GrB_Matrix *C, GrB_Type type, const void *blob, GrB_Index blob_size); -extern GrB_Info GrB_Matrix_diag(GrB_Matrix *C, const GrB_Vector v, int64_t k); -extern GrB_Info GrB_Matrix_dup(GrB_Matrix *C, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_eWiseAdd_BinaryOp(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_eWiseAdd_Monoid(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_eWiseAdd_Semiring(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_eWiseMult_BinaryOp(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp mult, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_eWiseMult_Monoid(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_eWiseMult_Semiring(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_error(const char **error, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_exportHint(GrB_Format *format, GrB_Matrix A); -extern GrB_Info GrB_Matrix_exportSize(GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -extern GrB_Info GrB_Matrix_export_BOOL(GrB_Index *Ap, GrB_Index *Ai, bool *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -extern GrB_Info GrB_Matrix_export_FP32(GrB_Index *Ap, GrB_Index *Ai, float *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -extern GrB_Info GrB_Matrix_export_FP64(GrB_Index *Ap, GrB_Index *Ai, double *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -extern GrB_Info GrB_Matrix_export_INT8(GrB_Index *Ap, GrB_Index *Ai, int8_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -extern GrB_Info GrB_Matrix_export_INT16(GrB_Index *Ap, GrB_Index *Ai, int16_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -extern GrB_Info GrB_Matrix_export_INT32(GrB_Index *Ap, GrB_Index *Ai, int32_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -extern GrB_Info GrB_Matrix_export_INT64(GrB_Index *Ap, GrB_Index *Ai, int64_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -extern GrB_Info GrB_Matrix_export_UDT(GrB_Index *Ap, GrB_Index *Ai, void *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -extern GrB_Info GrB_Matrix_export_UINT8(GrB_Index *Ap, GrB_Index *Ai, uint8_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -extern GrB_Info GrB_Matrix_export_UINT16(GrB_Index *Ap, GrB_Index *Ai, uint16_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -extern GrB_Info GrB_Matrix_export_UINT32(GrB_Index *Ap, GrB_Index *Ai, uint32_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -extern GrB_Info GrB_Matrix_export_UINT64(GrB_Index *Ap, GrB_Index *Ai, uint64_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -extern GrB_Info GrB_Matrix_extract(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_extractElement_BOOL(bool *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_extractElement_FP32(float *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_extractElement_FP64(double *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_extractElement_INT8(int8_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_extractElement_INT16(int16_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_extractElement_INT32(int32_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_extractElement_INT64(int64_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_extractElement_Scalar(GrB_Scalar x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_extractElement_UDT(void *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_extractElement_UINT8(uint8_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_extractElement_UINT16(uint16_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_extractElement_UINT32(uint32_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_extractElement_UINT64(uint64_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_extractTuples_BOOL(GrB_Index *I, GrB_Index *J, bool *X, GrB_Index *nvals, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_extractTuples_FP32(GrB_Index *I, GrB_Index *J, float *X, GrB_Index *nvals, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_extractTuples_FP64(GrB_Index *I, GrB_Index *J, double *X, GrB_Index *nvals, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_extractTuples_INT8(GrB_Index *I, GrB_Index *J, int8_t *X, GrB_Index *nvals, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_extractTuples_INT16(GrB_Index *I, GrB_Index *J, int16_t *X, GrB_Index *nvals, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_extractTuples_INT32(GrB_Index *I, GrB_Index *J, int32_t *X, GrB_Index *nvals, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_extractTuples_INT64(GrB_Index *I, GrB_Index *J, int64_t *X, GrB_Index *nvals, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_extractTuples_UDT(GrB_Index *I, GrB_Index *J, void *X, GrB_Index *nvals, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_extractTuples_UINT8(GrB_Index *I, GrB_Index *J, uint8_t *X, GrB_Index *nvals, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_extractTuples_UINT16(GrB_Index *I, GrB_Index *J, uint16_t *X, GrB_Index *nvals, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_extractTuples_UINT32(GrB_Index *I, GrB_Index *J, uint32_t *X, GrB_Index *nvals, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_extractTuples_UINT64(GrB_Index *I, GrB_Index *J, uint64_t *X, GrB_Index *nvals, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_free(GrB_Matrix *A); -extern GrB_Info GrB_Matrix_import_BOOL(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const bool *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -extern GrB_Info GrB_Matrix_import_FP32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const float *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -extern GrB_Info GrB_Matrix_import_FP64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const double *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -extern GrB_Info GrB_Matrix_import_INT8(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int8_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -extern GrB_Info GrB_Matrix_import_INT16(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int16_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -extern GrB_Info GrB_Matrix_import_INT32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int32_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -extern GrB_Info GrB_Matrix_import_INT64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int64_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -extern GrB_Info GrB_Matrix_import_UDT(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const void *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -extern GrB_Info GrB_Matrix_import_UINT8(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint8_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -extern GrB_Info GrB_Matrix_import_UINT16(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint16_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -extern GrB_Info GrB_Matrix_import_UINT32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint32_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -extern GrB_Info GrB_Matrix_import_UINT64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint64_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -extern GrB_Info GrB_Matrix_kronecker_BinaryOp(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_kronecker_Monoid(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_kronecker_Semiring(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_ncols(GrB_Index *ncols, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_new(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols); -extern GrB_Info GrB_Matrix_nrows(GrB_Index *nrows, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_nvals(GrB_Index *nvals, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_reduce_BOOL(bool *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_reduce_BinaryOp(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_reduce_BinaryOp_Scalar(GrB_Scalar S, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_reduce_FP32(float *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_reduce_FP64(double *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_reduce_INT8(int8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_reduce_INT16(int16_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_reduce_INT32(int32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_reduce_INT64(int64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_reduce_Monoid(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_reduce_Monoid_Scalar(GrB_Scalar c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_reduce_UDT(void *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_reduce_UINT8(uint8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_reduce_UINT16(uint16_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_reduce_UINT32(uint32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_reduce_UINT64(uint64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_removeElement(GrB_Matrix C, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_resize(GrB_Matrix C, GrB_Index nrows_new, GrB_Index ncols_new); -extern GrB_Info GrB_Matrix_select_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, bool y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, float y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, double y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int8_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int16_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int32_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int64_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const GrB_Scalar y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const void *y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint8_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint16_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint32_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint64_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_serialize(void *blob, GrB_Index *blob_size_handle, GrB_Matrix A); -extern GrB_Info GrB_Matrix_serializeSize(GrB_Index *blob_size_handle, GrB_Matrix A); -extern GrB_Info GrB_Matrix_setElement_BOOL(GrB_Matrix C, bool x, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_setElement_FP32(GrB_Matrix C, float x, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_setElement_FP64(GrB_Matrix C, double x, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_setElement_INT8(GrB_Matrix C, int8_t x, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_setElement_INT16(GrB_Matrix C, int16_t x, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_setElement_INT32(GrB_Matrix C, int32_t x, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_setElement_INT64(GrB_Matrix C, int64_t x, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_setElement_Scalar(GrB_Matrix C, GrB_Scalar x, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_setElement_UDT(GrB_Matrix C, void *x, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_setElement_UINT8(GrB_Matrix C, uint8_t x, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_setElement_UINT16(GrB_Matrix C, uint16_t x, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_setElement_UINT32(GrB_Matrix C, uint32_t x, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_setElement_UINT64(GrB_Matrix C, uint64_t x, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_wait(GrB_Matrix A, GrB_WaitMode waitmode); -extern GrB_Info GrB_Row_assign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, GrB_Index i, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_mxm(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); -extern GrB_Info GrB_mxv(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_transpose(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_vxm(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Vector u, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Col_assign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); +GrB_Info GrB_Col_extract(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_UnaryOp op, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp1st_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, bool x, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp1st_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, float x, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp1st_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, double x, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp1st_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int8_t x, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp1st_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int16_t x, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp1st_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int32_t x, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp1st_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int64_t x, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp1st_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp1st_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const void *x, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp1st_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint8_t x, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp1st_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint16_t x, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp1st_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint32_t x, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp1st_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint64_t x, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp2nd_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, bool y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp2nd_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, float y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp2nd_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, double y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, int8_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, int16_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, int32_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, int64_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp2nd_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Scalar y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp2nd_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const void *y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, uint8_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, uint16_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, uint32_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, uint64_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_IndexOp_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, bool y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_IndexOp_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, float y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_IndexOp_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, double y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_IndexOp_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int8_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_IndexOp_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int16_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_IndexOp_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int32_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_IndexOp_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int64_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_IndexOp_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const GrB_Scalar y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_IndexOp_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const void *y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_IndexOp_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint8_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_IndexOp_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint16_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_IndexOp_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint32_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_IndexOp_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint64_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, double x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_build_BOOL(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const bool *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_FP32(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const float *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_FP64(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const double *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_INT8(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const int8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_INT16(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const int16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_INT32(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const int32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_INT64(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const int64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_UDT(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const void *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_UINT8(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const uint8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_UINT16(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const uint16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_UINT32(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const uint32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_UINT64(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const uint64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_clear(GrB_Matrix A); +GrB_Info GrB_Matrix_deserialize(GrB_Matrix *C, GrB_Type type, const void *blob, GrB_Index blob_size); +GrB_Info GrB_Matrix_diag(GrB_Matrix *C, const GrB_Vector v, int64_t k); +GrB_Info GrB_Matrix_dup(GrB_Matrix *C, const GrB_Matrix A); +GrB_Info GrB_Matrix_eWiseAdd_BinaryOp(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_eWiseAdd_Monoid(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_eWiseAdd_Semiring(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_eWiseMult_BinaryOp(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp mult, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_eWiseMult_Monoid(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_eWiseMult_Semiring(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_error(const char **error, const GrB_Matrix A); +GrB_Info GrB_Matrix_exportHint(GrB_Format *format, GrB_Matrix A); +GrB_Info GrB_Matrix_exportSize(GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_BOOL(GrB_Index *Ap, GrB_Index *Ai, bool *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_FP32(GrB_Index *Ap, GrB_Index *Ai, float *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_FP64(GrB_Index *Ap, GrB_Index *Ai, double *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_INT8(GrB_Index *Ap, GrB_Index *Ai, int8_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_INT16(GrB_Index *Ap, GrB_Index *Ai, int16_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_INT32(GrB_Index *Ap, GrB_Index *Ai, int32_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_INT64(GrB_Index *Ap, GrB_Index *Ai, int64_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_UDT(GrB_Index *Ap, GrB_Index *Ai, void *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_UINT8(GrB_Index *Ap, GrB_Index *Ai, uint8_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_UINT16(GrB_Index *Ap, GrB_Index *Ai, uint16_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_UINT32(GrB_Index *Ap, GrB_Index *Ai, uint32_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_UINT64(GrB_Index *Ap, GrB_Index *Ai, uint64_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +GrB_Info GrB_Matrix_extract(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_extractElement_BOOL(bool *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_extractElement_FP32(float *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_extractElement_FP64(double *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_extractElement_INT8(int8_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_extractElement_INT16(int16_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_extractElement_INT32(int32_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_extractElement_INT64(int64_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_extractElement_Scalar(GrB_Scalar x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_extractElement_UDT(void *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_extractElement_UINT8(uint8_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_extractElement_UINT16(uint16_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_extractElement_UINT32(uint32_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_extractElement_UINT64(uint64_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_extractTuples_BOOL(GrB_Index *I, GrB_Index *J, bool *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_FP32(GrB_Index *I, GrB_Index *J, float *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_FP64(GrB_Index *I, GrB_Index *J, double *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_INT8(GrB_Index *I, GrB_Index *J, int8_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_INT16(GrB_Index *I, GrB_Index *J, int16_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_INT32(GrB_Index *I, GrB_Index *J, int32_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_INT64(GrB_Index *I, GrB_Index *J, int64_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_UDT(GrB_Index *I, GrB_Index *J, void *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_UINT8(GrB_Index *I, GrB_Index *J, uint8_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_UINT16(GrB_Index *I, GrB_Index *J, uint16_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_UINT32(GrB_Index *I, GrB_Index *J, uint32_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_UINT64(GrB_Index *I, GrB_Index *J, uint64_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_free(GrB_Matrix *A); +GrB_Info GrB_Matrix_import_BOOL(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const bool *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +GrB_Info GrB_Matrix_import_FP32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const float *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +GrB_Info GrB_Matrix_import_FP64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const double *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +GrB_Info GrB_Matrix_import_INT8(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int8_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +GrB_Info GrB_Matrix_import_INT16(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int16_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +GrB_Info GrB_Matrix_import_INT32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int32_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +GrB_Info GrB_Matrix_import_INT64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int64_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +GrB_Info GrB_Matrix_import_UDT(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const void *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +GrB_Info GrB_Matrix_import_UINT8(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint8_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +GrB_Info GrB_Matrix_import_UINT16(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint16_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +GrB_Info GrB_Matrix_import_UINT32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint32_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +GrB_Info GrB_Matrix_import_UINT64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint64_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +GrB_Info GrB_Matrix_kronecker_BinaryOp(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_kronecker_Monoid(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_kronecker_Semiring(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_ncols(GrB_Index *ncols, const GrB_Matrix A); +GrB_Info GrB_Matrix_new(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols); +GrB_Info GrB_Matrix_nrows(GrB_Index *nrows, const GrB_Matrix A); +GrB_Info GrB_Matrix_nvals(GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_reduce_BOOL(bool *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_reduce_BinaryOp(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_reduce_BinaryOp_Scalar(GrB_Scalar S, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_reduce_FP32(float *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_reduce_FP64(double *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_reduce_INT8(int8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_reduce_INT16(int16_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_reduce_INT32(int32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_reduce_INT64(int64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_reduce_Monoid(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_reduce_Monoid_Scalar(GrB_Scalar c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_reduce_UDT(void *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_reduce_UINT8(uint8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_reduce_UINT16(uint16_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_reduce_UINT32(uint32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_reduce_UINT64(uint64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_removeElement(GrB_Matrix C, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_resize(GrB_Matrix C, GrB_Index nrows_new, GrB_Index ncols_new); +GrB_Info GrB_Matrix_select_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, bool y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_select_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, float y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_select_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, double y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_select_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int8_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_select_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int16_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_select_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int32_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_select_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int64_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_select_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const GrB_Scalar y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_select_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const void *y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_select_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint8_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_select_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint16_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_select_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint32_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_select_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint64_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_serialize(void *blob, GrB_Index *blob_size_handle, GrB_Matrix A); +GrB_Info GrB_Matrix_serializeSize(GrB_Index *blob_size_handle, GrB_Matrix A); +GrB_Info GrB_Matrix_setElement_BOOL(GrB_Matrix C, bool x, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_setElement_FP32(GrB_Matrix C, float x, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_setElement_FP64(GrB_Matrix C, double x, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_setElement_INT8(GrB_Matrix C, int8_t x, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_setElement_INT16(GrB_Matrix C, int16_t x, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_setElement_INT32(GrB_Matrix C, int32_t x, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_setElement_INT64(GrB_Matrix C, int64_t x, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_setElement_Scalar(GrB_Matrix C, GrB_Scalar x, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_setElement_UDT(GrB_Matrix C, void *x, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_setElement_UINT8(GrB_Matrix C, uint8_t x, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_setElement_UINT16(GrB_Matrix C, uint16_t x, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_setElement_UINT32(GrB_Matrix C, uint32_t x, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_setElement_UINT64(GrB_Matrix C, uint64_t x, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_wait(GrB_Matrix A, GrB_WaitMode waitmode); +GrB_Info GrB_Row_assign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, GrB_Index i, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_mxm(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); +GrB_Info GrB_mxv(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_transpose(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_vxm(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Vector u, const GrB_Matrix A, const GrB_Descriptor desc); /* monoid */ -extern GrB_Info GrB_Monoid_error(const char **error, const GrB_Monoid monoid); -extern GrB_Info GrB_Monoid_free(GrB_Monoid *monoid); -extern GrB_Info GrB_Monoid_new_BOOL(GrB_Monoid *monoid, GrB_BinaryOp op, bool identity); -extern GrB_Info GrB_Monoid_new_FP32(GrB_Monoid *monoid, GrB_BinaryOp op, float identity); -extern GrB_Info GrB_Monoid_new_FP64(GrB_Monoid *monoid, GrB_BinaryOp op, double identity); -extern GrB_Info GrB_Monoid_new_INT8(GrB_Monoid *monoid, GrB_BinaryOp op, int8_t identity); -extern GrB_Info GrB_Monoid_new_INT16(GrB_Monoid *monoid, GrB_BinaryOp op, int16_t identity); -extern GrB_Info GrB_Monoid_new_INT32(GrB_Monoid *monoid, GrB_BinaryOp op, int32_t identity); -extern GrB_Info GrB_Monoid_new_INT64(GrB_Monoid *monoid, GrB_BinaryOp op, int64_t identity); -extern GrB_Info GrB_Monoid_new_UDT(GrB_Monoid *monoid, GrB_BinaryOp op, void *identity); -extern GrB_Info GrB_Monoid_new_UINT8(GrB_Monoid *monoid, GrB_BinaryOp op, uint8_t identity); -extern GrB_Info GrB_Monoid_new_UINT16(GrB_Monoid *monoid, GrB_BinaryOp op, uint16_t identity); -extern GrB_Info GrB_Monoid_new_UINT32(GrB_Monoid *monoid, GrB_BinaryOp op, uint32_t identity); -extern GrB_Info GrB_Monoid_new_UINT64(GrB_Monoid *monoid, GrB_BinaryOp op, uint64_t identity); -extern GrB_Info GrB_Monoid_wait(GrB_Monoid monoid, GrB_WaitMode waitmode); +GrB_Info GrB_Monoid_error(const char **error, const GrB_Monoid monoid); +GrB_Info GrB_Monoid_free(GrB_Monoid *monoid); +GrB_Info GrB_Monoid_new_BOOL(GrB_Monoid *monoid, GrB_BinaryOp op, bool identity); +GrB_Info GrB_Monoid_new_FP32(GrB_Monoid *monoid, GrB_BinaryOp op, float identity); +GrB_Info GrB_Monoid_new_FP64(GrB_Monoid *monoid, GrB_BinaryOp op, double identity); +GrB_Info GrB_Monoid_new_INT8(GrB_Monoid *monoid, GrB_BinaryOp op, int8_t identity); +GrB_Info GrB_Monoid_new_INT16(GrB_Monoid *monoid, GrB_BinaryOp op, int16_t identity); +GrB_Info GrB_Monoid_new_INT32(GrB_Monoid *monoid, GrB_BinaryOp op, int32_t identity); +GrB_Info GrB_Monoid_new_INT64(GrB_Monoid *monoid, GrB_BinaryOp op, int64_t identity); +GrB_Info GrB_Monoid_new_UDT(GrB_Monoid *monoid, GrB_BinaryOp op, void *identity); +GrB_Info GrB_Monoid_new_UINT8(GrB_Monoid *monoid, GrB_BinaryOp op, uint8_t identity); +GrB_Info GrB_Monoid_new_UINT16(GrB_Monoid *monoid, GrB_BinaryOp op, uint16_t identity); +GrB_Info GrB_Monoid_new_UINT32(GrB_Monoid *monoid, GrB_BinaryOp op, uint32_t identity); +GrB_Info GrB_Monoid_new_UINT64(GrB_Monoid *monoid, GrB_BinaryOp op, uint64_t identity); +GrB_Info GrB_Monoid_wait(GrB_Monoid monoid, GrB_WaitMode waitmode); /* scalar */ -extern GrB_Info GrB_Scalar_clear(GrB_Scalar s); -extern GrB_Info GrB_Scalar_dup(GrB_Scalar *s, const GrB_Scalar t); -extern GrB_Info GrB_Scalar_error(const char **error, const GrB_Scalar s); -extern GrB_Info GrB_Scalar_extractElement_BOOL(bool *x, const GrB_Scalar s); -extern GrB_Info GrB_Scalar_extractElement_FP32(float *x, const GrB_Scalar s); -extern GrB_Info GrB_Scalar_extractElement_FP64(double *x, const GrB_Scalar s); -extern GrB_Info GrB_Scalar_extractElement_INT8(int8_t *x, const GrB_Scalar s); -extern GrB_Info GrB_Scalar_extractElement_INT16(int16_t *x, const GrB_Scalar s); -extern GrB_Info GrB_Scalar_extractElement_INT32(int32_t *x, const GrB_Scalar s); -extern GrB_Info GrB_Scalar_extractElement_INT64(int64_t *x, const GrB_Scalar s); -extern GrB_Info GrB_Scalar_extractElement_UDT(void *x, const GrB_Scalar s); -extern GrB_Info GrB_Scalar_extractElement_UINT8(uint8_t *x, const GrB_Scalar s); -extern GrB_Info GrB_Scalar_extractElement_UINT16(uint16_t *x, const GrB_Scalar s); -extern GrB_Info GrB_Scalar_extractElement_UINT32(uint32_t *x, const GrB_Scalar s); -extern GrB_Info GrB_Scalar_extractElement_UINT64(uint64_t *x, const GrB_Scalar s); -extern GrB_Info GrB_Scalar_free(GrB_Scalar *s); -extern GrB_Info GrB_Scalar_new(GrB_Scalar *s, GrB_Type type); -extern GrB_Info GrB_Scalar_nvals(GrB_Index *nvals, const GrB_Scalar s); -extern GrB_Info GrB_Scalar_setElement_BOOL(GrB_Scalar s, bool x); -extern GrB_Info GrB_Scalar_setElement_FP32(GrB_Scalar s, float x); -extern GrB_Info GrB_Scalar_setElement_FP64(GrB_Scalar s, double x); -extern GrB_Info GrB_Scalar_setElement_INT8(GrB_Scalar s, int8_t x); -extern GrB_Info GrB_Scalar_setElement_INT16(GrB_Scalar s, int16_t x); -extern GrB_Info GrB_Scalar_setElement_INT32(GrB_Scalar s, int32_t x); -extern GrB_Info GrB_Scalar_setElement_INT64(GrB_Scalar s, int64_t x); -extern GrB_Info GrB_Scalar_setElement_UDT(GrB_Scalar s, void *x); -extern GrB_Info GrB_Scalar_setElement_UINT8(GrB_Scalar s, uint8_t x); -extern GrB_Info GrB_Scalar_setElement_UINT16(GrB_Scalar s, uint16_t x); -extern GrB_Info GrB_Scalar_setElement_UINT32(GrB_Scalar s, uint32_t x); -extern GrB_Info GrB_Scalar_setElement_UINT64(GrB_Scalar s, uint64_t x); -extern GrB_Info GrB_Scalar_wait(GrB_Scalar s, GrB_WaitMode waitmode); +GrB_Info GrB_Scalar_clear(GrB_Scalar s); +GrB_Info GrB_Scalar_dup(GrB_Scalar *s, const GrB_Scalar t); +GrB_Info GrB_Scalar_error(const char **error, const GrB_Scalar s); +GrB_Info GrB_Scalar_extractElement_BOOL(bool *x, const GrB_Scalar s); +GrB_Info GrB_Scalar_extractElement_FP32(float *x, const GrB_Scalar s); +GrB_Info GrB_Scalar_extractElement_FP64(double *x, const GrB_Scalar s); +GrB_Info GrB_Scalar_extractElement_INT8(int8_t *x, const GrB_Scalar s); +GrB_Info GrB_Scalar_extractElement_INT16(int16_t *x, const GrB_Scalar s); +GrB_Info GrB_Scalar_extractElement_INT32(int32_t *x, const GrB_Scalar s); +GrB_Info GrB_Scalar_extractElement_INT64(int64_t *x, const GrB_Scalar s); +GrB_Info GrB_Scalar_extractElement_UDT(void *x, const GrB_Scalar s); +GrB_Info GrB_Scalar_extractElement_UINT8(uint8_t *x, const GrB_Scalar s); +GrB_Info GrB_Scalar_extractElement_UINT16(uint16_t *x, const GrB_Scalar s); +GrB_Info GrB_Scalar_extractElement_UINT32(uint32_t *x, const GrB_Scalar s); +GrB_Info GrB_Scalar_extractElement_UINT64(uint64_t *x, const GrB_Scalar s); +GrB_Info GrB_Scalar_free(GrB_Scalar *s); +GrB_Info GrB_Scalar_new(GrB_Scalar *s, GrB_Type type); +GrB_Info GrB_Scalar_nvals(GrB_Index *nvals, const GrB_Scalar s); +GrB_Info GrB_Scalar_setElement_BOOL(GrB_Scalar s, bool x); +GrB_Info GrB_Scalar_setElement_FP32(GrB_Scalar s, float x); +GrB_Info GrB_Scalar_setElement_FP64(GrB_Scalar s, double x); +GrB_Info GrB_Scalar_setElement_INT8(GrB_Scalar s, int8_t x); +GrB_Info GrB_Scalar_setElement_INT16(GrB_Scalar s, int16_t x); +GrB_Info GrB_Scalar_setElement_INT32(GrB_Scalar s, int32_t x); +GrB_Info GrB_Scalar_setElement_INT64(GrB_Scalar s, int64_t x); +GrB_Info GrB_Scalar_setElement_UDT(GrB_Scalar s, void *x); +GrB_Info GrB_Scalar_setElement_UINT8(GrB_Scalar s, uint8_t x); +GrB_Info GrB_Scalar_setElement_UINT16(GrB_Scalar s, uint16_t x); +GrB_Info GrB_Scalar_setElement_UINT32(GrB_Scalar s, uint32_t x); +GrB_Info GrB_Scalar_setElement_UINT64(GrB_Scalar s, uint64_t x); +GrB_Info GrB_Scalar_wait(GrB_Scalar s, GrB_WaitMode waitmode); /* semiring */ -extern GrB_Info GrB_Semiring_error(const char **error, const GrB_Semiring semiring); -extern GrB_Info GrB_Semiring_free(GrB_Semiring *semiring); -extern GrB_Info GrB_Semiring_new(GrB_Semiring *semiring, GrB_Monoid add, GrB_BinaryOp multiply); -extern GrB_Info GrB_Semiring_wait(GrB_Semiring semiring, GrB_WaitMode waitmode); +GrB_Info GrB_Semiring_error(const char **error, const GrB_Semiring semiring); +GrB_Info GrB_Semiring_free(GrB_Semiring *semiring); +GrB_Info GrB_Semiring_new(GrB_Semiring *semiring, GrB_Monoid add, GrB_BinaryOp multiply); +GrB_Info GrB_Semiring_wait(GrB_Semiring semiring, GrB_WaitMode waitmode); /* type */ -extern GrB_Info GrB_Type_error(const char **error, const GrB_Type type); -extern GrB_Info GrB_Type_free(GrB_Type *type); -extern GrB_Info GrB_Type_new(GrB_Type *type, size_t sizeof_ctype); -extern GrB_Info GrB_Type_wait(GrB_Type type, GrB_WaitMode waitmode); +GrB_Info GrB_Type_error(const char **error, const GrB_Type type); +GrB_Info GrB_Type_free(GrB_Type *type); +GrB_Info GrB_Type_new(GrB_Type *type, size_t sizeof_ctype); +GrB_Info GrB_Type_wait(GrB_Type type, GrB_WaitMode waitmode); /* unary */ -extern GrB_Info GrB_UnaryOp_error(const char **error, const GrB_UnaryOp op); -extern GrB_Info GrB_UnaryOp_free(GrB_UnaryOp *unaryop); -extern GrB_Info GrB_UnaryOp_new(GrB_UnaryOp *unaryop, GxB_unary_function function, GrB_Type ztype, GrB_Type xtype); -extern GrB_Info GrB_UnaryOp_wait(GrB_UnaryOp op, GrB_WaitMode waitmode); +GrB_Info GrB_UnaryOp_error(const char **error, const GrB_UnaryOp op); +GrB_Info GrB_UnaryOp_free(GrB_UnaryOp *unaryop); +GrB_Info GrB_UnaryOp_new(GrB_UnaryOp *unaryop, GxB_unary_function function, GrB_Type ztype, GrB_Type xtype); +GrB_Info GrB_UnaryOp_wait(GrB_UnaryOp op, GrB_WaitMode waitmode); /* vector */ -extern GrB_Info GrB_Vector_apply(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_UnaryOp op, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp1st_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, bool x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp1st_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, float x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp1st_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, double x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp1st_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int8_t x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp1st_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int16_t x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp1st_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int32_t x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp1st_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int64_t x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp1st_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp1st_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const void *x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp1st_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint8_t x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp1st_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint16_t x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp1st_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint32_t x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp1st_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint64_t x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp2nd_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, bool y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp2nd_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, float y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp2nd_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, double y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp2nd_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, int8_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp2nd_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, int16_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp2nd_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, int32_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp2nd_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, int64_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp2nd_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const GrB_Scalar y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp2nd_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const void *y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, uint8_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, uint16_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, uint32_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, uint64_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, bool y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, float y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, double y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int8_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int16_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int32_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int64_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const GrB_Scalar y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const void *y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint8_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint16_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint32_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint64_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_assign(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_assign_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_assign_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_assign_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, double x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_assign_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_assign_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_assign_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_assign_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_assign_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_assign_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_assign_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_assign_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_assign_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_assign_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_build_BOOL(GrB_Vector w, const GrB_Index *I, const bool *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Vector_build_FP32(GrB_Vector w, const GrB_Index *I, const float *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Vector_build_FP64(GrB_Vector w, const GrB_Index *I, const double *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Vector_build_INT8(GrB_Vector w, const GrB_Index *I, const int8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Vector_build_INT16(GrB_Vector w, const GrB_Index *I, const int16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Vector_build_INT32(GrB_Vector w, const GrB_Index *I, const int32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Vector_build_INT64(GrB_Vector w, const GrB_Index *I, const int64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Vector_build_UDT(GrB_Vector w, const GrB_Index *I, const void *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Vector_build_UINT8(GrB_Vector w, const GrB_Index *I, const uint8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Vector_build_UINT16(GrB_Vector w, const GrB_Index *I, const uint16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Vector_build_UINT32(GrB_Vector w, const GrB_Index *I, const uint32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Vector_build_UINT64(GrB_Vector w, const GrB_Index *I, const uint64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Vector_clear(GrB_Vector v); -extern GrB_Info GrB_Vector_dup(GrB_Vector *w, const GrB_Vector u); -extern GrB_Info GrB_Vector_eWiseAdd_BinaryOp(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_eWiseAdd_Monoid(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_eWiseAdd_Semiring(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_eWiseMult_BinaryOp(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp mult, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_eWiseMult_Monoid(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_eWiseMult_Semiring(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_error(const char **error, const GrB_Vector v); -extern GrB_Info GrB_Vector_extract(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_extractElement_BOOL(bool *x, const GrB_Vector v, GrB_Index i); -extern GrB_Info GrB_Vector_extractElement_FP32(float *x, const GrB_Vector v, GrB_Index i); -extern GrB_Info GrB_Vector_extractElement_FP64(double *x, const GrB_Vector v, GrB_Index i); -extern GrB_Info GrB_Vector_extractElement_INT8(int8_t *x, const GrB_Vector v, GrB_Index i); -extern GrB_Info GrB_Vector_extractElement_INT16(int16_t *x, const GrB_Vector v, GrB_Index i); -extern GrB_Info GrB_Vector_extractElement_INT32(int32_t *x, const GrB_Vector v, GrB_Index i); -extern GrB_Info GrB_Vector_extractElement_INT64(int64_t *x, const GrB_Vector v, GrB_Index i); -extern GrB_Info GrB_Vector_extractElement_Scalar(GrB_Scalar x, const GrB_Vector v, GrB_Index i); -extern GrB_Info GrB_Vector_extractElement_UDT(void *x, const GrB_Vector v, GrB_Index i); -extern GrB_Info GrB_Vector_extractElement_UINT8(uint8_t *x, const GrB_Vector v, GrB_Index i); -extern GrB_Info GrB_Vector_extractElement_UINT16(uint16_t *x, const GrB_Vector v, GrB_Index i); -extern GrB_Info GrB_Vector_extractElement_UINT32(uint32_t *x, const GrB_Vector v, GrB_Index i); -extern GrB_Info GrB_Vector_extractElement_UINT64(uint64_t *x, const GrB_Vector v, GrB_Index i); -extern GrB_Info GrB_Vector_extractTuples_BOOL(GrB_Index *I, bool *X, GrB_Index *nvals, const GrB_Vector v); -extern GrB_Info GrB_Vector_extractTuples_FP32(GrB_Index *I, float *X, GrB_Index *nvals, const GrB_Vector v); -extern GrB_Info GrB_Vector_extractTuples_FP64(GrB_Index *I, double *X, GrB_Index *nvals, const GrB_Vector v); -extern GrB_Info GrB_Vector_extractTuples_INT8(GrB_Index *I, int8_t *X, GrB_Index *nvals, const GrB_Vector v); -extern GrB_Info GrB_Vector_extractTuples_INT16(GrB_Index *I, int16_t *X, GrB_Index *nvals, const GrB_Vector v); -extern GrB_Info GrB_Vector_extractTuples_INT32(GrB_Index *I, int32_t *X, GrB_Index *nvals, const GrB_Vector v); -extern GrB_Info GrB_Vector_extractTuples_INT64(GrB_Index *I, int64_t *X, GrB_Index *nvals, const GrB_Vector v); -extern GrB_Info GrB_Vector_extractTuples_UDT(GrB_Index *I, void *X, GrB_Index *nvals, const GrB_Vector v); -extern GrB_Info GrB_Vector_extractTuples_UINT8(GrB_Index *I, uint8_t *X, GrB_Index *nvals, const GrB_Vector v); -extern GrB_Info GrB_Vector_extractTuples_UINT16(GrB_Index *I, uint16_t *X, GrB_Index *nvals, const GrB_Vector v); -extern GrB_Info GrB_Vector_extractTuples_UINT32(GrB_Index *I, uint32_t *X, GrB_Index *nvals, const GrB_Vector v); -extern GrB_Info GrB_Vector_extractTuples_UINT64(GrB_Index *I, uint64_t *X, GrB_Index *nvals, const GrB_Vector v); -extern GrB_Info GrB_Vector_free(GrB_Vector *v); -extern GrB_Info GrB_Vector_new(GrB_Vector *v, GrB_Type type, GrB_Index n); -extern GrB_Info GrB_Vector_nvals(GrB_Index *nvals, const GrB_Vector v); -extern GrB_Info GrB_Vector_reduce_BOOL(bool *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_reduce_BinaryOp_Scalar(GrB_Scalar c, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_reduce_FP32(float *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_reduce_FP64(double *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_reduce_INT8(int8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_reduce_INT16(int16_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_reduce_INT32(int32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_reduce_INT64(int64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_reduce_Monoid_Scalar(GrB_Scalar c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_reduce_UDT(void *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_reduce_UINT8(uint8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_reduce_UINT16(uint16_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_reduce_UINT32(uint32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_reduce_UINT64(uint64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_removeElement(GrB_Vector v, GrB_Index i); -extern GrB_Info GrB_Vector_resize(GrB_Vector w, GrB_Index nrows_new); -extern GrB_Info GrB_Vector_select_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, bool y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, float y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, double y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int8_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int16_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int32_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int64_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const GrB_Scalar y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const void *y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint8_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint16_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint32_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint64_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_setElement_BOOL(GrB_Vector w, bool x, GrB_Index i); -extern GrB_Info GrB_Vector_setElement_FP32(GrB_Vector w, float x, GrB_Index i); -extern GrB_Info GrB_Vector_setElement_FP64(GrB_Vector w, double x, GrB_Index i); -extern GrB_Info GrB_Vector_setElement_INT8(GrB_Vector w, int8_t x, GrB_Index i); -extern GrB_Info GrB_Vector_setElement_INT16(GrB_Vector w, int16_t x, GrB_Index i); -extern GrB_Info GrB_Vector_setElement_INT32(GrB_Vector w, int32_t x, GrB_Index i); -extern GrB_Info GrB_Vector_setElement_INT64(GrB_Vector w, int64_t x, GrB_Index i); -extern GrB_Info GrB_Vector_setElement_Scalar(GrB_Vector w, GrB_Scalar x, GrB_Index i); -extern GrB_Info GrB_Vector_setElement_UDT(GrB_Vector w, void *x, GrB_Index i); -extern GrB_Info GrB_Vector_setElement_UINT8(GrB_Vector w, uint8_t x, GrB_Index i); -extern GrB_Info GrB_Vector_setElement_UINT16(GrB_Vector w, uint16_t x, GrB_Index i); -extern GrB_Info GrB_Vector_setElement_UINT32(GrB_Vector w, uint32_t x, GrB_Index i); -extern GrB_Info GrB_Vector_setElement_UINT64(GrB_Vector w, uint64_t x, GrB_Index i); -extern GrB_Info GrB_Vector_size(GrB_Index *n, const GrB_Vector v); -extern GrB_Info GrB_Vector_wait(GrB_Vector v, GrB_WaitMode waitmode); +GrB_Info GrB_Vector_apply(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_UnaryOp op, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp1st_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, bool x, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp1st_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, float x, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp1st_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, double x, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp1st_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int8_t x, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp1st_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int16_t x, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp1st_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int32_t x, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp1st_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int64_t x, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp1st_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp1st_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const void *x, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp1st_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint8_t x, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp1st_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint16_t x, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp1st_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint32_t x, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp1st_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint64_t x, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp2nd_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, bool y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp2nd_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, float y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp2nd_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, double y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp2nd_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, int8_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp2nd_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, int16_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp2nd_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, int32_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp2nd_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, int64_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp2nd_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const GrB_Scalar y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp2nd_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const void *y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, uint8_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, uint16_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, uint32_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, uint64_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_IndexOp_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, bool y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_IndexOp_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, float y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_IndexOp_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, double y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_IndexOp_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int8_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_IndexOp_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int16_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_IndexOp_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int32_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_IndexOp_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int64_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_IndexOp_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const GrB_Scalar y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_IndexOp_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const void *y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_IndexOp_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint8_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_IndexOp_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint16_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_IndexOp_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint32_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_IndexOp_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint64_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, double x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_build_BOOL(GrB_Vector w, const GrB_Index *I, const bool *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_FP32(GrB_Vector w, const GrB_Index *I, const float *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_FP64(GrB_Vector w, const GrB_Index *I, const double *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_INT8(GrB_Vector w, const GrB_Index *I, const int8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_INT16(GrB_Vector w, const GrB_Index *I, const int16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_INT32(GrB_Vector w, const GrB_Index *I, const int32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_INT64(GrB_Vector w, const GrB_Index *I, const int64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_UDT(GrB_Vector w, const GrB_Index *I, const void *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_UINT8(GrB_Vector w, const GrB_Index *I, const uint8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_UINT16(GrB_Vector w, const GrB_Index *I, const uint16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_UINT32(GrB_Vector w, const GrB_Index *I, const uint32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_UINT64(GrB_Vector w, const GrB_Index *I, const uint64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_clear(GrB_Vector v); +GrB_Info GrB_Vector_dup(GrB_Vector *w, const GrB_Vector u); +GrB_Info GrB_Vector_eWiseAdd_BinaryOp(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); +GrB_Info GrB_Vector_eWiseAdd_Monoid(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); +GrB_Info GrB_Vector_eWiseAdd_Semiring(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); +GrB_Info GrB_Vector_eWiseMult_BinaryOp(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp mult, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); +GrB_Info GrB_Vector_eWiseMult_Monoid(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); +GrB_Info GrB_Vector_eWiseMult_Semiring(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); +GrB_Info GrB_Vector_error(const char **error, const GrB_Vector v); +GrB_Info GrB_Vector_extract(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_extractElement_BOOL(bool *x, const GrB_Vector v, GrB_Index i); +GrB_Info GrB_Vector_extractElement_FP32(float *x, const GrB_Vector v, GrB_Index i); +GrB_Info GrB_Vector_extractElement_FP64(double *x, const GrB_Vector v, GrB_Index i); +GrB_Info GrB_Vector_extractElement_INT8(int8_t *x, const GrB_Vector v, GrB_Index i); +GrB_Info GrB_Vector_extractElement_INT16(int16_t *x, const GrB_Vector v, GrB_Index i); +GrB_Info GrB_Vector_extractElement_INT32(int32_t *x, const GrB_Vector v, GrB_Index i); +GrB_Info GrB_Vector_extractElement_INT64(int64_t *x, const GrB_Vector v, GrB_Index i); +GrB_Info GrB_Vector_extractElement_Scalar(GrB_Scalar x, const GrB_Vector v, GrB_Index i); +GrB_Info GrB_Vector_extractElement_UDT(void *x, const GrB_Vector v, GrB_Index i); +GrB_Info GrB_Vector_extractElement_UINT8(uint8_t *x, const GrB_Vector v, GrB_Index i); +GrB_Info GrB_Vector_extractElement_UINT16(uint16_t *x, const GrB_Vector v, GrB_Index i); +GrB_Info GrB_Vector_extractElement_UINT32(uint32_t *x, const GrB_Vector v, GrB_Index i); +GrB_Info GrB_Vector_extractElement_UINT64(uint64_t *x, const GrB_Vector v, GrB_Index i); +GrB_Info GrB_Vector_extractTuples_BOOL(GrB_Index *I, bool *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_FP32(GrB_Index *I, float *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_FP64(GrB_Index *I, double *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_INT8(GrB_Index *I, int8_t *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_INT16(GrB_Index *I, int16_t *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_INT32(GrB_Index *I, int32_t *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_INT64(GrB_Index *I, int64_t *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_UDT(GrB_Index *I, void *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_UINT8(GrB_Index *I, uint8_t *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_UINT16(GrB_Index *I, uint16_t *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_UINT32(GrB_Index *I, uint32_t *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_UINT64(GrB_Index *I, uint64_t *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_free(GrB_Vector *v); +GrB_Info GrB_Vector_new(GrB_Vector *v, GrB_Type type, GrB_Index n); +GrB_Info GrB_Vector_nvals(GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_reduce_BOOL(bool *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_reduce_BinaryOp_Scalar(GrB_Scalar c, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_reduce_FP32(float *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_reduce_FP64(double *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_reduce_INT8(int8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_reduce_INT16(int16_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_reduce_INT32(int32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_reduce_INT64(int64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_reduce_Monoid_Scalar(GrB_Scalar c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_reduce_UDT(void *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_reduce_UINT8(uint8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_reduce_UINT16(uint16_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_reduce_UINT32(uint32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_reduce_UINT64(uint64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_removeElement(GrB_Vector v, GrB_Index i); +GrB_Info GrB_Vector_resize(GrB_Vector w, GrB_Index nrows_new); +GrB_Info GrB_Vector_select_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, bool y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_select_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, float y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_select_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, double y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_select_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int8_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_select_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int16_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_select_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int32_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_select_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int64_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_select_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const GrB_Scalar y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_select_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const void *y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_select_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint8_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_select_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint16_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_select_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint32_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_select_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint64_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_setElement_BOOL(GrB_Vector w, bool x, GrB_Index i); +GrB_Info GrB_Vector_setElement_FP32(GrB_Vector w, float x, GrB_Index i); +GrB_Info GrB_Vector_setElement_FP64(GrB_Vector w, double x, GrB_Index i); +GrB_Info GrB_Vector_setElement_INT8(GrB_Vector w, int8_t x, GrB_Index i); +GrB_Info GrB_Vector_setElement_INT16(GrB_Vector w, int16_t x, GrB_Index i); +GrB_Info GrB_Vector_setElement_INT32(GrB_Vector w, int32_t x, GrB_Index i); +GrB_Info GrB_Vector_setElement_INT64(GrB_Vector w, int64_t x, GrB_Index i); +GrB_Info GrB_Vector_setElement_Scalar(GrB_Vector w, GrB_Scalar x, GrB_Index i); +GrB_Info GrB_Vector_setElement_UDT(GrB_Vector w, void *x, GrB_Index i); +GrB_Info GrB_Vector_setElement_UINT8(GrB_Vector w, uint8_t x, GrB_Index i); +GrB_Info GrB_Vector_setElement_UINT16(GrB_Vector w, uint16_t x, GrB_Index i); +GrB_Info GrB_Vector_setElement_UINT32(GrB_Vector w, uint32_t x, GrB_Index i); +GrB_Info GrB_Vector_setElement_UINT64(GrB_Vector w, uint64_t x, GrB_Index i); +GrB_Info GrB_Vector_size(GrB_Index *n, const GrB_Vector v); +GrB_Info GrB_Vector_wait(GrB_Vector v, GrB_WaitMode waitmode); /*************** * GB functions * ***************/ /* binary */ -extern GrB_Info GB_BinaryOp_new(GrB_BinaryOp *binaryop, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *binop_name); +GrB_Info GB_BinaryOp_new(GrB_BinaryOp *binaryop, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *binop_name); /* iterator */ -extern GrB_Info GB_Iterator_rc_bitmap_next(GxB_Iterator iterator); -extern GrB_Info GB_Iterator_rc_seek(GxB_Iterator iterator, GrB_Index j, bool jth_vector); -extern GrB_Info GB_Vector_Iterator_bitmap_seek(GxB_Iterator iterator, GrB_Index unused); +GrB_Info GB_Iterator_rc_bitmap_next(GxB_Iterator iterator); +GrB_Info GB_Iterator_rc_seek(GxB_Iterator iterator, GrB_Index j, bool jth_vector); +GrB_Info GB_Vector_Iterator_bitmap_seek(GxB_Iterator iterator, GrB_Index unused); /* matrix */ -extern GrB_Info GB_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GxB_Format_Value format, GrB_Descriptor desc); +GrB_Info GB_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GxB_Format_Value format, GrB_Descriptor desc); /* selectop */ -extern GrB_Info GB_SelectOp_new(GxB_SelectOp *selectop, GxB_select_function function, GrB_Type xtype, GrB_Type ttype, const char *name); +GrB_Info GB_SelectOp_new(GxB_SelectOp *selectop, GxB_select_function function, GrB_Type xtype, GrB_Type ttype, const char *name); /* type */ -extern GrB_Info GB_Type_new(GrB_Type *type, size_t sizeof_ctype, const char *type_name); +GrB_Info GB_Type_new(GrB_Type *type, size_t sizeof_ctype, const char *type_name); /* unary */ -extern GrB_Info GB_UnaryOp_new(GrB_UnaryOp *unaryop, GxB_unary_function function, GrB_Type ztype, GrB_Type xtype, const char *unop_name); +GrB_Info GB_UnaryOp_new(GrB_UnaryOp *unaryop, GxB_unary_function function, GrB_Type ztype, GrB_Type xtype, const char *unop_name); /**************** * GxB functions * ****************/ /* binary */ -extern GrB_Info GxB_BinaryOp_fprint(GrB_BinaryOp binaryop, const char *name, GxB_Print_Level pr, FILE *f); -extern GrB_Info GxB_BinaryOp_new(GrB_BinaryOp *op, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *binop_name, const char *binop_defn); -extern GrB_Info GxB_BinaryOp_xtype(GrB_Type *xtype, GrB_BinaryOp binaryop); -extern GrB_Info GxB_BinaryOp_xtype_name(char *type_name, const GrB_BinaryOp binaryop); -extern GrB_Info GxB_BinaryOp_ytype(GrB_Type *ytype, GrB_BinaryOp binaryop); -extern GrB_Info GxB_BinaryOp_ytype_name(char *type_name, const GrB_BinaryOp binaryop); -extern GrB_Info GxB_BinaryOp_ztype(GrB_Type *ztype, GrB_BinaryOp binaryop); -extern GrB_Info GxB_BinaryOp_ztype_name(char *type_name, const GrB_BinaryOp binaryop); +GrB_Info GxB_BinaryOp_fprint(GrB_BinaryOp binaryop, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_BinaryOp_new(GrB_BinaryOp *op, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *binop_name, const char *binop_defn); +GrB_Info GxB_BinaryOp_xtype(GrB_Type *xtype, GrB_BinaryOp binaryop); +GrB_Info GxB_BinaryOp_xtype_name(char *type_name, const GrB_BinaryOp binaryop); +GrB_Info GxB_BinaryOp_ytype(GrB_Type *ytype, GrB_BinaryOp binaryop); +GrB_Info GxB_BinaryOp_ytype_name(char *type_name, const GrB_BinaryOp binaryop); +GrB_Info GxB_BinaryOp_ztype(GrB_Type *ztype, GrB_BinaryOp binaryop); +GrB_Info GxB_BinaryOp_ztype_name(char *type_name, const GrB_BinaryOp binaryop); /* core */ -extern GrB_Info GxB_Global_Option_get(GxB_Option_Field field, char *); -extern GrB_Info GxB_Global_Option_get_CHAR(GxB_Option_Field field, char **value); -extern GrB_Info GxB_Global_Option_get_FP64(GxB_Option_Field field, double *value); -extern GrB_Info GxB_Global_Option_get_FUNCTION(GxB_Option_Field field, void **value); -extern GrB_Info GxB_Global_Option_get_INT32(GxB_Option_Field field, int32_t *value); -extern GrB_Info GxB_Global_Option_get_INT64(GxB_Option_Field field, int64_t *value); -extern GrB_Info GxB_Global_Option_set(GxB_Option_Field field, char *); -extern GrB_Info GxB_Global_Option_set_FP64(GxB_Option_Field field, double value); -extern GrB_Info GxB_Global_Option_set_FP64_ARRAY(GxB_Option_Field field, double *value); -extern GrB_Info GxB_Global_Option_set_FUNCTION(GxB_Option_Field field, void *value); -extern GrB_Info GxB_Global_Option_set_INT32(GxB_Option_Field field, int32_t value); -extern GrB_Info GxB_Global_Option_set_INT64_ARRAY(GxB_Option_Field field, int64_t *value); -extern GrB_Info GxB_deserialize_type_name(char *type_name, const void *blob, GrB_Index blob_size); -extern GrB_Info GxB_init(GrB_Mode mode, void *(*user_malloc_function)(size_t), void *(*user_calloc_function)(size_t, size_t), void *(*user_realloc_function)(void *, size_t), void (*user_free_function)(void *)); +GrB_Info GxB_Global_Option_get(GxB_Option_Field field, ...); +GrB_Info GxB_Global_Option_get_CHAR(GxB_Option_Field field, char **value); +GrB_Info GxB_Global_Option_get_FP64(GxB_Option_Field field, double *value); +GrB_Info GxB_Global_Option_get_FUNCTION(GxB_Option_Field field, void **value); +GrB_Info GxB_Global_Option_get_INT32(GxB_Option_Field field, int32_t *value); +GrB_Info GxB_Global_Option_get_INT64(GxB_Option_Field field, int64_t *value); +GrB_Info GxB_Global_Option_set(GxB_Option_Field field, ...); +GrB_Info GxB_Global_Option_set_FP64(GxB_Option_Field field, double value); +GrB_Info GxB_Global_Option_set_FP64_ARRAY(GxB_Option_Field field, double *value); +GrB_Info GxB_Global_Option_set_FUNCTION(GxB_Option_Field field, void *value); +GrB_Info GxB_Global_Option_set_INT32(GxB_Option_Field field, int32_t value); +GrB_Info GxB_Global_Option_set_INT64_ARRAY(GxB_Option_Field field, int64_t *value); +GrB_Info GxB_deserialize_type_name(char *type_name, const void *blob, GrB_Index blob_size); +GrB_Info GxB_init(GrB_Mode mode, void *(*user_malloc_function)(size_t), void *(*user_calloc_function)(size_t, size_t), void *(*user_realloc_function)(void *, size_t), void (*user_free_function)(void *)); /* descriptor */ -extern GrB_Info GxB_Desc_get(GrB_Descriptor desc, GrB_Desc_Field field, char *); -extern GrB_Info GxB_Desc_get_FP64(GrB_Descriptor desc, GrB_Desc_Field field, double *value); -extern GrB_Info GxB_Desc_get_INT32(GrB_Descriptor desc, GrB_Desc_Field field, int32_t *value); -extern GrB_Info GxB_Desc_set(GrB_Descriptor desc, GrB_Desc_Field field, char *); -extern GrB_Info GxB_Desc_set_FP64(GrB_Descriptor desc, GrB_Desc_Field field, double value); -extern GrB_Info GxB_Desc_set_INT32(GrB_Descriptor desc, GrB_Desc_Field field, int32_t value); -extern GrB_Info GxB_Descriptor_fprint(GrB_Descriptor descriptor, const char *name, GxB_Print_Level pr, FILE *f); -extern GrB_Info GxB_Descriptor_get(GrB_Desc_Value *val, GrB_Descriptor desc, GrB_Desc_Field field); +GrB_Info GxB_Desc_get(GrB_Descriptor desc, GrB_Desc_Field field, ...); +GrB_Info GxB_Desc_get_FP64(GrB_Descriptor desc, GrB_Desc_Field field, double *value); +GrB_Info GxB_Desc_get_INT32(GrB_Descriptor desc, GrB_Desc_Field field, int32_t *value); +GrB_Info GxB_Desc_set(GrB_Descriptor desc, GrB_Desc_Field field, ...); +GrB_Info GxB_Desc_set_FP64(GrB_Descriptor desc, GrB_Desc_Field field, double value); +GrB_Info GxB_Desc_set_INT32(GrB_Descriptor desc, GrB_Desc_Field field, int32_t value); +GrB_Info GxB_Descriptor_fprint(GrB_Descriptor descriptor, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_Descriptor_get(GrB_Desc_Value *val, GrB_Descriptor desc, GrB_Desc_Field field); /* indexunary */ -extern GrB_Info GxB_IndexUnaryOp_fprint(GrB_IndexUnaryOp op, const char *name, GxB_Print_Level pr, FILE *f); -extern GrB_Info GxB_IndexUnaryOp_new(GrB_IndexUnaryOp *op, GxB_index_unary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *idxop_name, const char *idxop_defn); -extern GrB_Info GxB_IndexUnaryOp_xtype_name(char *type_name, const GrB_IndexUnaryOp op); -extern GrB_Info GxB_IndexUnaryOp_ytype_name(char *type_name, const GrB_IndexUnaryOp op); -extern GrB_Info GxB_IndexUnaryOp_ztype_name(char *type_name, const GrB_IndexUnaryOp op); +GrB_Info GxB_IndexUnaryOp_fprint(GrB_IndexUnaryOp op, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_IndexUnaryOp_new(GrB_IndexUnaryOp *op, GxB_index_unary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *idxop_name, const char *idxop_defn); +GrB_Info GxB_IndexUnaryOp_xtype_name(char *type_name, const GrB_IndexUnaryOp op); +GrB_Info GxB_IndexUnaryOp_ytype_name(char *type_name, const GrB_IndexUnaryOp op); +GrB_Info GxB_IndexUnaryOp_ztype_name(char *type_name, const GrB_IndexUnaryOp op); /* iterator */ -extern GrB_Index GxB_Matrix_Iterator_getp(GxB_Iterator iterator); -extern GrB_Index GxB_Matrix_Iterator_getpmax(GxB_Iterator iterator); -extern GrB_Index GxB_Vector_Iterator_getIndex(GxB_Iterator iterator); -extern GrB_Index GxB_Vector_Iterator_getp(GxB_Iterator iterator); -extern GrB_Index GxB_Vector_Iterator_getpmax(GxB_Iterator iterator); -extern GrB_Index GxB_colIterator_getColIndex(GxB_Iterator iterator); -extern GrB_Index GxB_colIterator_getRowIndex(GxB_Iterator iterator); -extern GrB_Index GxB_colIterator_kount(GxB_Iterator iterator); -extern GrB_Index GxB_rowIterator_getColIndex(GxB_Iterator iterator); -extern GrB_Index GxB_rowIterator_getRowIndex(GxB_Iterator iterator); -extern GrB_Index GxB_rowIterator_kount(GxB_Iterator iterator); -extern GrB_Info GxB_Iterator_free(GxB_Iterator *iterator); -extern GrB_Info GxB_Iterator_new(GxB_Iterator *iterator); -extern GrB_Info GxB_Matrix_Iterator_next(GxB_Iterator iterator); -extern GrB_Info GxB_Matrix_Iterator_seek(GxB_Iterator iterator, GrB_Index p); -extern GrB_Info GxB_Vector_Iterator_next(GxB_Iterator iterator); -extern GrB_Info GxB_Vector_Iterator_seek(GxB_Iterator iterator, GrB_Index p); -extern GrB_Info GxB_colIterator_kseek(GxB_Iterator iterator, GrB_Index k); -extern GrB_Info GxB_colIterator_nextCol(GxB_Iterator iterator); -extern GrB_Info GxB_colIterator_nextRow(GxB_Iterator iterator); -extern GrB_Info GxB_colIterator_seekCol(GxB_Iterator iterator, GrB_Index col); -extern GrB_Info GxB_rowIterator_kseek(GxB_Iterator iterator, GrB_Index k); -extern GrB_Info GxB_rowIterator_nextCol(GxB_Iterator iterator); -extern GrB_Info GxB_rowIterator_nextRow(GxB_Iterator iterator); -extern GrB_Info GxB_rowIterator_seekRow(GxB_Iterator iterator, GrB_Index row); -extern GxB_FC32_t GxB_Iterator_get_FC32(GxB_Iterator iterator); -extern GxB_FC64_t GxB_Iterator_get_FC64(GxB_Iterator iterator); -extern bool GxB_Iterator_get_BOOL(GxB_Iterator iterator); -extern double GxB_Iterator_get_FP64(GxB_Iterator iterator); -extern float GxB_Iterator_get_FP32(GxB_Iterator iterator); -extern int8_t GxB_Iterator_get_INT8(GxB_Iterator iterator); -extern int16_t GxB_Iterator_get_INT16(GxB_Iterator iterator); -extern int32_t GxB_Iterator_get_INT32(GxB_Iterator iterator); -extern int64_t GxB_Iterator_get_INT64(GxB_Iterator iterator); -extern uint8_t GxB_Iterator_get_UINT8(GxB_Iterator iterator); -extern uint16_t GxB_Iterator_get_UINT16(GxB_Iterator iterator); -extern uint32_t GxB_Iterator_get_UINT32(GxB_Iterator iterator); -extern uint64_t GxB_Iterator_get_UINT64(GxB_Iterator iterator); -extern void GxB_Iterator_get_UDT(GxB_Iterator iterator, void *value); -extern void GxB_Matrix_Iterator_getIndex(GxB_Iterator iterator, GrB_Index *row, GrB_Index *col); +GrB_Index GxB_Matrix_Iterator_getp(GxB_Iterator iterator); +GrB_Index GxB_Matrix_Iterator_getpmax(GxB_Iterator iterator); +GrB_Index GxB_Vector_Iterator_getIndex(GxB_Iterator iterator); +GrB_Index GxB_Vector_Iterator_getp(GxB_Iterator iterator); +GrB_Index GxB_Vector_Iterator_getpmax(GxB_Iterator iterator); +GrB_Index GxB_colIterator_getColIndex(GxB_Iterator iterator); +GrB_Index GxB_colIterator_getRowIndex(GxB_Iterator iterator); +GrB_Index GxB_colIterator_kount(GxB_Iterator iterator); +GrB_Index GxB_rowIterator_getColIndex(GxB_Iterator iterator); +GrB_Index GxB_rowIterator_getRowIndex(GxB_Iterator iterator); +GrB_Index GxB_rowIterator_kount(GxB_Iterator iterator); +GrB_Info GxB_Iterator_free(GxB_Iterator *iterator); +GrB_Info GxB_Iterator_new(GxB_Iterator *iterator); +GrB_Info GxB_Matrix_Iterator_next(GxB_Iterator iterator); +GrB_Info GxB_Matrix_Iterator_seek(GxB_Iterator iterator, GrB_Index p); +GrB_Info GxB_Vector_Iterator_next(GxB_Iterator iterator); +GrB_Info GxB_Vector_Iterator_seek(GxB_Iterator iterator, GrB_Index p); +GrB_Info GxB_colIterator_kseek(GxB_Iterator iterator, GrB_Index k); +GrB_Info GxB_colIterator_nextCol(GxB_Iterator iterator); +GrB_Info GxB_colIterator_nextRow(GxB_Iterator iterator); +GrB_Info GxB_colIterator_seekCol(GxB_Iterator iterator, GrB_Index col); +GrB_Info GxB_rowIterator_kseek(GxB_Iterator iterator, GrB_Index k); +GrB_Info GxB_rowIterator_nextCol(GxB_Iterator iterator); +GrB_Info GxB_rowIterator_nextRow(GxB_Iterator iterator); +GrB_Info GxB_rowIterator_seekRow(GxB_Iterator iterator, GrB_Index row); +GxB_FC32_t GxB_Iterator_get_FC32(GxB_Iterator iterator); +GxB_FC64_t GxB_Iterator_get_FC64(GxB_Iterator iterator); +bool GxB_Iterator_get_BOOL(GxB_Iterator iterator); +double GxB_Iterator_get_FP64(GxB_Iterator iterator); +float GxB_Iterator_get_FP32(GxB_Iterator iterator); +int8_t GxB_Iterator_get_INT8(GxB_Iterator iterator); +int16_t GxB_Iterator_get_INT16(GxB_Iterator iterator); +int32_t GxB_Iterator_get_INT32(GxB_Iterator iterator); +int64_t GxB_Iterator_get_INT64(GxB_Iterator iterator); +uint8_t GxB_Iterator_get_UINT8(GxB_Iterator iterator); +uint16_t GxB_Iterator_get_UINT16(GxB_Iterator iterator); +uint32_t GxB_Iterator_get_UINT32(GxB_Iterator iterator); +uint64_t GxB_Iterator_get_UINT64(GxB_Iterator iterator); +void GxB_Iterator_get_UDT(GxB_Iterator iterator, void *value); +void GxB_Matrix_Iterator_getIndex(GxB_Iterator iterator, GrB_Index *row, GrB_Index *col); /* matrix */ -extern GrB_Info GxB_Col_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_Option_get(GrB_Matrix A, GxB_Option_Field field, char *); -extern GrB_Info GxB_Matrix_Option_get_FP64(GrB_Matrix A, GxB_Option_Field field, double *value); -extern GrB_Info GxB_Matrix_Option_get_INT32(GrB_Matrix A, GxB_Option_Field field, int32_t *value); -extern GrB_Info GxB_Matrix_Option_set(GrB_Matrix A, GxB_Option_Field field, char *); -extern GrB_Info GxB_Matrix_Option_set_FP64(GrB_Matrix A, GxB_Option_Field field, double value); -extern GrB_Info GxB_Matrix_Option_set_INT32(GrB_Matrix A, GxB_Option_Field field, int32_t value); -extern GrB_Info GxB_Matrix_apply_BinaryOp1st(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_apply_BinaryOp1st_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC32_t x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_apply_BinaryOp1st_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC64_t x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_apply_BinaryOp2nd(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Scalar y, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_apply_BinaryOp2nd_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, GxB_FC32_t y, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_apply_BinaryOp2nd_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, GxB_FC64_t y, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_apply_IndexOp_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, GxB_FC32_t y, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_apply_IndexOp_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, GxB_FC64_t y, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_assign_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_assign_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_build_FC32(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const GxB_FC32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GxB_Matrix_build_FC64(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const GxB_FC64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GxB_Matrix_build_Scalar(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, GrB_Scalar scalar, GrB_Index nvals); -extern GrB_Info GxB_Matrix_concat(GrB_Matrix C, const GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_deserialize(GrB_Matrix *C, GrB_Type type, const void *blob, GrB_Index blob_size, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_diag(GrB_Matrix C, const GrB_Vector v, int64_t k, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_eWiseUnion(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Matrix A, const GrB_Scalar alpha, const GrB_Matrix B, const GrB_Scalar beta, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_BitmapC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_BitmapR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_CSC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_CSR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_FC32(GrB_Index *Ap, GrB_Index *Ai, GxB_FC32_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -extern GrB_Info GxB_Matrix_export_FC64(GrB_Index *Ap, GrB_Index *Ai, GxB_FC64_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -extern GrB_Info GxB_Matrix_export_FullC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_FullR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_HyperCSC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_HyperCSR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_extractElement_FC32(GxB_FC32_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -extern GrB_Info GxB_Matrix_extractElement_FC64(GxB_FC64_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -extern GrB_Info GxB_Matrix_extractTuples_FC32(GrB_Index *I, GrB_Index *J, GxB_FC32_t *X, GrB_Index *nvals, const GrB_Matrix A); -extern GrB_Info GxB_Matrix_extractTuples_FC64(GrB_Index *I, GrB_Index *J, GxB_FC64_t *X, GrB_Index *nvals, const GrB_Matrix A); -extern GrB_Info GxB_Matrix_fprint(GrB_Matrix A, const char *name, GxB_Print_Level pr, FILE *f); -extern GrB_Info GxB_Matrix_import_BitmapC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_BitmapR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_CSC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_CSR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_FC32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const GxB_FC32_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -extern GrB_Info GxB_Matrix_import_FC64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const GxB_FC64_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -extern GrB_Info GxB_Matrix_import_FullC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_FullR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_HyperCSC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_HyperCSR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_isStoredElement(const GrB_Matrix A, GrB_Index i, GrB_Index j); -extern GrB_Info GxB_Matrix_iso(bool *iso, const GrB_Matrix A); -extern GrB_Info GxB_Matrix_memoryUsage(size_t *size, const GrB_Matrix A); -extern GrB_Info GxB_Matrix_pack_BitmapC(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_pack_BitmapR(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_pack_CSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_pack_CSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_pack_FullC(GrB_Matrix A, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_pack_FullR(GrB_Matrix A, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_pack_HyperCSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_pack_HyperCSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_reduce_FC32(GxB_FC32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_reduce_FC64(GxB_FC64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_reshape(GrB_Matrix C, bool by_col, GrB_Index nrows_new, GrB_Index ncols_new, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_reshapeDup(GrB_Matrix *C, GrB_Matrix A, bool by_col, GrB_Index nrows_new, GrB_Index ncols_new, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_select(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Matrix A, const GrB_Scalar Thunk, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_select_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, GxB_FC32_t y, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_select_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, GxB_FC64_t y, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_serialize(void **blob_handle, GrB_Index *blob_size_handle, GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_setElement_FC32(GrB_Matrix C, GxB_FC32_t x, GrB_Index i, GrB_Index j); -extern GrB_Info GxB_Matrix_setElement_FC64(GrB_Matrix C, GxB_FC64_t x, GrB_Index i, GrB_Index j); -extern GrB_Info GxB_Matrix_sort(GrB_Matrix C, GrB_Matrix P, GrB_BinaryOp op, GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_split(GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Index *Tile_nrows, const GrB_Index *Tile_ncols, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_subassign(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_subassign_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_subassign_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_subassign_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_subassign_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_subassign_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, double x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_subassign_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_subassign_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_subassign_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_subassign_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_subassign_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_subassign_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_subassign_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_subassign_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_subassign_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_subassign_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_type(GrB_Type *type, const GrB_Matrix A); -extern GrB_Info GxB_Matrix_type_name(char *type_name, const GrB_Matrix A); -extern GrB_Info GxB_Matrix_unpack_BitmapC(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_unpack_BitmapR(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_unpack_CSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_unpack_CSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_unpack_FullC(GrB_Matrix A, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_unpack_FullR(GrB_Matrix A, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_unpack_HyperCSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_unpack_HyperCSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Row_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, GrB_Index i, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_diag(GrB_Vector v, const GrB_Matrix A, int64_t k, const GrB_Descriptor desc); -extern GrB_Info GxB_colIterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); -extern GrB_Info GxB_pack_HyperHash(GrB_Matrix A, GrB_Matrix *Y, const GrB_Descriptor desc); -extern GrB_Info GxB_rowIterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); -extern GrB_Info GxB_unpack_HyperHash(GrB_Matrix A, GrB_Matrix *Y, const GrB_Descriptor desc); +GrB_Info GxB_Col_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); +GrB_Info GxB_Matrix_Option_get(GrB_Matrix A, GxB_Option_Field field, ...); +GrB_Info GxB_Matrix_Option_get_FP64(GrB_Matrix A, GxB_Option_Field field, double *value); +GrB_Info GxB_Matrix_Option_get_INT32(GrB_Matrix A, GxB_Option_Field field, int32_t *value); +GrB_Info GxB_Matrix_Option_set(GrB_Matrix A, GxB_Option_Field field, ...); +GrB_Info GxB_Matrix_Option_set_FP64(GrB_Matrix A, GxB_Option_Field field, double value); +GrB_Info GxB_Matrix_Option_set_INT32(GrB_Matrix A, GxB_Option_Field field, int32_t value); +GrB_Info GxB_Matrix_apply_BinaryOp1st(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_apply_BinaryOp1st_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC32_t x, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_apply_BinaryOp1st_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC64_t x, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_apply_BinaryOp2nd(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Scalar y, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_apply_BinaryOp2nd_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, GxB_FC32_t y, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_apply_BinaryOp2nd_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, GxB_FC64_t y, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_apply_IndexOp_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, GxB_FC32_t y, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_apply_IndexOp_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, GxB_FC64_t y, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_assign_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_assign_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_build_FC32(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const GxB_FC32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GxB_Matrix_build_FC64(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const GxB_FC64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GxB_Matrix_build_Scalar(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, GrB_Scalar scalar, GrB_Index nvals); +GrB_Info GxB_Matrix_concat(GrB_Matrix C, const GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_deserialize(GrB_Matrix *C, GrB_Type type, const void *blob, GrB_Index blob_size, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_diag(GrB_Matrix C, const GrB_Vector v, int64_t k, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_eWiseUnion(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Matrix A, const GrB_Scalar alpha, const GrB_Matrix B, const GrB_Scalar beta, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_export_BitmapC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_export_BitmapR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_export_CSC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_export_CSR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_export_FC32(GrB_Index *Ap, GrB_Index *Ai, GxB_FC32_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +GrB_Info GxB_Matrix_export_FC64(GrB_Index *Ap, GrB_Index *Ai, GxB_FC64_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +GrB_Info GxB_Matrix_export_FullC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_export_FullR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_export_HyperCSC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_export_HyperCSR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_extractElement_FC32(GxB_FC32_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +GrB_Info GxB_Matrix_extractElement_FC64(GxB_FC64_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +GrB_Info GxB_Matrix_extractTuples_FC32(GrB_Index *I, GrB_Index *J, GxB_FC32_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GxB_Matrix_extractTuples_FC64(GrB_Index *I, GrB_Index *J, GxB_FC64_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GxB_Matrix_fprint(GrB_Matrix A, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_Matrix_import_BitmapC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_import_BitmapR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_import_CSC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_import_CSR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_import_FC32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const GxB_FC32_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +GrB_Info GxB_Matrix_import_FC64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const GxB_FC64_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +GrB_Info GxB_Matrix_import_FullC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_import_FullR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_import_HyperCSC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_import_HyperCSR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_isStoredElement(const GrB_Matrix A, GrB_Index i, GrB_Index j); +GrB_Info GxB_Matrix_iso(bool *iso, const GrB_Matrix A); +GrB_Info GxB_Matrix_memoryUsage(size_t *size, const GrB_Matrix A); +GrB_Info GxB_Matrix_pack_BitmapC(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_pack_BitmapR(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_pack_CSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_pack_CSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_pack_FullC(GrB_Matrix A, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_pack_FullR(GrB_Matrix A, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_pack_HyperCSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_pack_HyperCSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_reduce_FC32(GxB_FC32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_reduce_FC64(GxB_FC64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_reshape(GrB_Matrix C, bool by_col, GrB_Index nrows_new, GrB_Index ncols_new, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_reshapeDup(GrB_Matrix *C, GrB_Matrix A, bool by_col, GrB_Index nrows_new, GrB_Index ncols_new, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_select(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Matrix A, const GrB_Scalar Thunk, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_select_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, GxB_FC32_t y, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_select_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, GxB_FC64_t y, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_serialize(void **blob_handle, GrB_Index *blob_size_handle, GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_setElement_FC32(GrB_Matrix C, GxB_FC32_t x, GrB_Index i, GrB_Index j); +GrB_Info GxB_Matrix_setElement_FC64(GrB_Matrix C, GxB_FC64_t x, GrB_Index i, GrB_Index j); +GrB_Info GxB_Matrix_sort(GrB_Matrix C, GrB_Matrix P, GrB_BinaryOp op, GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_split(GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Index *Tile_nrows, const GrB_Index *Tile_ncols, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, double x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_type(GrB_Type *type, const GrB_Matrix A); +GrB_Info GxB_Matrix_type_name(char *type_name, const GrB_Matrix A); +GrB_Info GxB_Matrix_unpack_BitmapC(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_unpack_BitmapR(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_unpack_CSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_unpack_CSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_unpack_FullC(GrB_Matrix A, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_unpack_FullR(GrB_Matrix A, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_unpack_HyperCSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_unpack_HyperCSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Row_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, GrB_Index i, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Vector_diag(GrB_Vector v, const GrB_Matrix A, int64_t k, const GrB_Descriptor desc); +GrB_Info GxB_colIterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); +GrB_Info GxB_pack_HyperHash(GrB_Matrix A, GrB_Matrix *Y, const GrB_Descriptor desc); +GrB_Info GxB_rowIterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); +GrB_Info GxB_unpack_HyperHash(GrB_Matrix A, GrB_Matrix *Y, const GrB_Descriptor desc); /* monoid */ -extern GrB_Info GxB_Monoid_fprint(GrB_Monoid monoid, const char *name, GxB_Print_Level pr, FILE *f); -extern GrB_Info GxB_Monoid_identity(void *identity, GrB_Monoid monoid); -extern GrB_Info GxB_Monoid_new_FC32(GrB_Monoid *monoid, GrB_BinaryOp op, GxB_FC32_t identity); -extern GrB_Info GxB_Monoid_new_FC64(GrB_Monoid *monoid, GrB_BinaryOp op, GxB_FC64_t identity); -extern GrB_Info GxB_Monoid_operator(GrB_BinaryOp *op, GrB_Monoid monoid); -extern GrB_Info GxB_Monoid_terminal(bool *has_terminal, void *terminal, GrB_Monoid monoid); -extern GrB_Info GxB_Monoid_terminal_new_BOOL(GrB_Monoid *monoid, GrB_BinaryOp op, bool identity, bool terminal); -extern GrB_Info GxB_Monoid_terminal_new_FC32(GrB_Monoid *monoid, GrB_BinaryOp op, GxB_FC32_t identity, GxB_FC32_t terminal); -extern GrB_Info GxB_Monoid_terminal_new_FC64(GrB_Monoid *monoid, GrB_BinaryOp op, GxB_FC64_t identity, GxB_FC64_t terminal); -extern GrB_Info GxB_Monoid_terminal_new_FP32(GrB_Monoid *monoid, GrB_BinaryOp op, float identity, float terminal); -extern GrB_Info GxB_Monoid_terminal_new_FP64(GrB_Monoid *monoid, GrB_BinaryOp op, double identity, double terminal); -extern GrB_Info GxB_Monoid_terminal_new_INT8(GrB_Monoid *monoid, GrB_BinaryOp op, int8_t identity, int8_t terminal); -extern GrB_Info GxB_Monoid_terminal_new_INT16(GrB_Monoid *monoid, GrB_BinaryOp op, int16_t identity, int16_t terminal); -extern GrB_Info GxB_Monoid_terminal_new_INT32(GrB_Monoid *monoid, GrB_BinaryOp op, int32_t identity, int32_t terminal); -extern GrB_Info GxB_Monoid_terminal_new_INT64(GrB_Monoid *monoid, GrB_BinaryOp op, int64_t identity, int64_t terminal); -extern GrB_Info GxB_Monoid_terminal_new_UDT(GrB_Monoid *monoid, GrB_BinaryOp op, void *identity, void *terminal); -extern GrB_Info GxB_Monoid_terminal_new_UINT8(GrB_Monoid *monoid, GrB_BinaryOp op, uint8_t identity, uint8_t terminal); -extern GrB_Info GxB_Monoid_terminal_new_UINT16(GrB_Monoid *monoid, GrB_BinaryOp op, uint16_t identity, uint16_t terminal); -extern GrB_Info GxB_Monoid_terminal_new_UINT32(GrB_Monoid *monoid, GrB_BinaryOp op, uint32_t identity, uint32_t terminal); -extern GrB_Info GxB_Monoid_terminal_new_UINT64(GrB_Monoid *monoid, GrB_BinaryOp op, uint64_t identity, uint64_t terminal); +GrB_Info GxB_Monoid_fprint(GrB_Monoid monoid, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_Monoid_identity(void *identity, GrB_Monoid monoid); +GrB_Info GxB_Monoid_new_FC32(GrB_Monoid *monoid, GrB_BinaryOp op, GxB_FC32_t identity); +GrB_Info GxB_Monoid_new_FC64(GrB_Monoid *monoid, GrB_BinaryOp op, GxB_FC64_t identity); +GrB_Info GxB_Monoid_operator(GrB_BinaryOp *op, GrB_Monoid monoid); +GrB_Info GxB_Monoid_terminal(bool *has_terminal, void *terminal, GrB_Monoid monoid); +GrB_Info GxB_Monoid_terminal_new_BOOL(GrB_Monoid *monoid, GrB_BinaryOp op, bool identity, bool terminal); +GrB_Info GxB_Monoid_terminal_new_FC32(GrB_Monoid *monoid, GrB_BinaryOp op, GxB_FC32_t identity, GxB_FC32_t terminal); +GrB_Info GxB_Monoid_terminal_new_FC64(GrB_Monoid *monoid, GrB_BinaryOp op, GxB_FC64_t identity, GxB_FC64_t terminal); +GrB_Info GxB_Monoid_terminal_new_FP32(GrB_Monoid *monoid, GrB_BinaryOp op, float identity, float terminal); +GrB_Info GxB_Monoid_terminal_new_FP64(GrB_Monoid *monoid, GrB_BinaryOp op, double identity, double terminal); +GrB_Info GxB_Monoid_terminal_new_INT8(GrB_Monoid *monoid, GrB_BinaryOp op, int8_t identity, int8_t terminal); +GrB_Info GxB_Monoid_terminal_new_INT16(GrB_Monoid *monoid, GrB_BinaryOp op, int16_t identity, int16_t terminal); +GrB_Info GxB_Monoid_terminal_new_INT32(GrB_Monoid *monoid, GrB_BinaryOp op, int32_t identity, int32_t terminal); +GrB_Info GxB_Monoid_terminal_new_INT64(GrB_Monoid *monoid, GrB_BinaryOp op, int64_t identity, int64_t terminal); +GrB_Info GxB_Monoid_terminal_new_UDT(GrB_Monoid *monoid, GrB_BinaryOp op, void *identity, void *terminal); +GrB_Info GxB_Monoid_terminal_new_UINT8(GrB_Monoid *monoid, GrB_BinaryOp op, uint8_t identity, uint8_t terminal); +GrB_Info GxB_Monoid_terminal_new_UINT16(GrB_Monoid *monoid, GrB_BinaryOp op, uint16_t identity, uint16_t terminal); +GrB_Info GxB_Monoid_terminal_new_UINT32(GrB_Monoid *monoid, GrB_BinaryOp op, uint32_t identity, uint32_t terminal); +GrB_Info GxB_Monoid_terminal_new_UINT64(GrB_Monoid *monoid, GrB_BinaryOp op, uint64_t identity, uint64_t terminal); /* scalar */ -extern GrB_Info GxB_Scalar_clear(GrB_Scalar s); -extern GrB_Info GxB_Scalar_dup(GrB_Scalar *s, const GrB_Scalar t); -extern GrB_Info GxB_Scalar_error(const char **error, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_BOOL(bool *x, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_FC32(GxB_FC32_t *x, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_FC64(GxB_FC64_t *x, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_FP32(float *x, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_FP64(double *x, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_INT8(int8_t *x, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_INT16(int16_t *x, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_INT32(int32_t *x, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_INT64(int64_t *x, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_UDT(void *x, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_UINT8(uint8_t *x, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_UINT16(uint16_t *x, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_UINT32(uint32_t *x, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_UINT64(uint64_t *x, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_fprint(GrB_Scalar s, const char *name, GxB_Print_Level pr, FILE *f); -extern GrB_Info GxB_Scalar_free(GrB_Scalar *s); -extern GrB_Info GxB_Scalar_memoryUsage(size_t *size, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_new(GrB_Scalar *s, GrB_Type type); -extern GrB_Info GxB_Scalar_nvals(GrB_Index *nvals, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_setElement_BOOL(GrB_Scalar s, bool x); -extern GrB_Info GxB_Scalar_setElement_FC32(GrB_Scalar s, GxB_FC32_t x); -extern GrB_Info GxB_Scalar_setElement_FC64(GrB_Scalar s, GxB_FC64_t x); -extern GrB_Info GxB_Scalar_setElement_FP32(GrB_Scalar s, float x); -extern GrB_Info GxB_Scalar_setElement_FP64(GrB_Scalar s, double x); -extern GrB_Info GxB_Scalar_setElement_INT8(GrB_Scalar s, int8_t x); -extern GrB_Info GxB_Scalar_setElement_INT16(GrB_Scalar s, int16_t x); -extern GrB_Info GxB_Scalar_setElement_INT32(GrB_Scalar s, int32_t x); -extern GrB_Info GxB_Scalar_setElement_INT64(GrB_Scalar s, int64_t x); -extern GrB_Info GxB_Scalar_setElement_UDT(GrB_Scalar s, void *x); -extern GrB_Info GxB_Scalar_setElement_UINT8(GrB_Scalar s, uint8_t x); -extern GrB_Info GxB_Scalar_setElement_UINT16(GrB_Scalar s, uint16_t x); -extern GrB_Info GxB_Scalar_setElement_UINT32(GrB_Scalar s, uint32_t x); -extern GrB_Info GxB_Scalar_setElement_UINT64(GrB_Scalar s, uint64_t x); -extern GrB_Info GxB_Scalar_type(GrB_Type *type, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_type_name(char *type_name, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_wait(GrB_Scalar *s); +GrB_Info GxB_Scalar_clear(GrB_Scalar s); +GrB_Info GxB_Scalar_dup(GrB_Scalar *s, const GrB_Scalar t); +GrB_Info GxB_Scalar_error(const char **error, const GrB_Scalar s); +GrB_Info GxB_Scalar_extractElement_BOOL(bool *x, const GrB_Scalar s); +GrB_Info GxB_Scalar_extractElement_FC32(GxB_FC32_t *x, const GrB_Scalar s); +GrB_Info GxB_Scalar_extractElement_FC64(GxB_FC64_t *x, const GrB_Scalar s); +GrB_Info GxB_Scalar_extractElement_FP32(float *x, const GrB_Scalar s); +GrB_Info GxB_Scalar_extractElement_FP64(double *x, const GrB_Scalar s); +GrB_Info GxB_Scalar_extractElement_INT8(int8_t *x, const GrB_Scalar s); +GrB_Info GxB_Scalar_extractElement_INT16(int16_t *x, const GrB_Scalar s); +GrB_Info GxB_Scalar_extractElement_INT32(int32_t *x, const GrB_Scalar s); +GrB_Info GxB_Scalar_extractElement_INT64(int64_t *x, const GrB_Scalar s); +GrB_Info GxB_Scalar_extractElement_UDT(void *x, const GrB_Scalar s); +GrB_Info GxB_Scalar_extractElement_UINT8(uint8_t *x, const GrB_Scalar s); +GrB_Info GxB_Scalar_extractElement_UINT16(uint16_t *x, const GrB_Scalar s); +GrB_Info GxB_Scalar_extractElement_UINT32(uint32_t *x, const GrB_Scalar s); +GrB_Info GxB_Scalar_extractElement_UINT64(uint64_t *x, const GrB_Scalar s); +GrB_Info GxB_Scalar_fprint(GrB_Scalar s, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_Scalar_free(GrB_Scalar *s); +GrB_Info GxB_Scalar_memoryUsage(size_t *size, const GrB_Scalar s); +GrB_Info GxB_Scalar_new(GrB_Scalar *s, GrB_Type type); +GrB_Info GxB_Scalar_nvals(GrB_Index *nvals, const GrB_Scalar s); +GrB_Info GxB_Scalar_setElement_BOOL(GrB_Scalar s, bool x); +GrB_Info GxB_Scalar_setElement_FC32(GrB_Scalar s, GxB_FC32_t x); +GrB_Info GxB_Scalar_setElement_FC64(GrB_Scalar s, GxB_FC64_t x); +GrB_Info GxB_Scalar_setElement_FP32(GrB_Scalar s, float x); +GrB_Info GxB_Scalar_setElement_FP64(GrB_Scalar s, double x); +GrB_Info GxB_Scalar_setElement_INT8(GrB_Scalar s, int8_t x); +GrB_Info GxB_Scalar_setElement_INT16(GrB_Scalar s, int16_t x); +GrB_Info GxB_Scalar_setElement_INT32(GrB_Scalar s, int32_t x); +GrB_Info GxB_Scalar_setElement_INT64(GrB_Scalar s, int64_t x); +GrB_Info GxB_Scalar_setElement_UDT(GrB_Scalar s, void *x); +GrB_Info GxB_Scalar_setElement_UINT8(GrB_Scalar s, uint8_t x); +GrB_Info GxB_Scalar_setElement_UINT16(GrB_Scalar s, uint16_t x); +GrB_Info GxB_Scalar_setElement_UINT32(GrB_Scalar s, uint32_t x); +GrB_Info GxB_Scalar_setElement_UINT64(GrB_Scalar s, uint64_t x); +GrB_Info GxB_Scalar_type(GrB_Type *type, const GrB_Scalar s); +GrB_Info GxB_Scalar_type_name(char *type_name, const GrB_Scalar s); +GrB_Info GxB_Scalar_wait(GrB_Scalar *s); /* selectop */ -extern GrB_Info GxB_SelectOp_error(const char **error, const GxB_SelectOp op); -extern GrB_Info GxB_SelectOp_fprint(GxB_SelectOp selectop, const char *name, GxB_Print_Level pr, FILE *f); -extern GrB_Info GxB_SelectOp_free(GxB_SelectOp *selectop); -extern GrB_Info GxB_SelectOp_new(GxB_SelectOp *selectop, GxB_select_function function, GrB_Type xtype, GrB_Type ttype); -extern GrB_Info GxB_SelectOp_ttype(GrB_Type *ttype, GxB_SelectOp selectop); -extern GrB_Info GxB_SelectOp_wait(GxB_SelectOp op, GrB_WaitMode waitmode); -extern GrB_Info GxB_SelectOp_xtype(GrB_Type *xtype, GxB_SelectOp selectop); +GrB_Info GxB_SelectOp_error(const char **error, const GxB_SelectOp op); +GrB_Info GxB_SelectOp_fprint(GxB_SelectOp selectop, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_SelectOp_free(GxB_SelectOp *selectop); +GrB_Info GxB_SelectOp_new(GxB_SelectOp *selectop, GxB_select_function function, GrB_Type xtype, GrB_Type ttype); +GrB_Info GxB_SelectOp_ttype(GrB_Type *ttype, GxB_SelectOp selectop); +GrB_Info GxB_SelectOp_wait(GxB_SelectOp op, GrB_WaitMode waitmode); +GrB_Info GxB_SelectOp_xtype(GrB_Type *xtype, GxB_SelectOp selectop); /* semiring */ -extern GrB_Info GxB_Semiring_add(GrB_Monoid *add, GrB_Semiring semiring); -extern GrB_Info GxB_Semiring_fprint(GrB_Semiring semiring, const char *name, GxB_Print_Level pr, FILE *f); -extern GrB_Info GxB_Semiring_multiply(GrB_BinaryOp *multiply, GrB_Semiring semiring); +GrB_Info GxB_Semiring_add(GrB_Monoid *add, GrB_Semiring semiring); +GrB_Info GxB_Semiring_fprint(GrB_Semiring semiring, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_Semiring_multiply(GrB_BinaryOp *multiply, GrB_Semiring semiring); /* type */ -extern GrB_Info GxB_Type_fprint(GrB_Type type, const char *name, GxB_Print_Level pr, FILE *f); -extern GrB_Info GxB_Type_from_name(GrB_Type *type, const char *type_name); -extern GrB_Info GxB_Type_name(char *type_name, const GrB_Type type); -extern GrB_Info GxB_Type_new(GrB_Type *type, size_t sizeof_ctype, const char *type_name, const char *type_defn); -extern GrB_Info GxB_Type_size(size_t *size, const GrB_Type type); +GrB_Info GxB_Type_fprint(GrB_Type type, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_Type_from_name(GrB_Type *type, const char *type_name); +GrB_Info GxB_Type_name(char *type_name, const GrB_Type type); +GrB_Info GxB_Type_new(GrB_Type *type, size_t sizeof_ctype, const char *type_name, const char *type_defn); +GrB_Info GxB_Type_size(size_t *size, const GrB_Type type); /* unary */ -extern GrB_Info GxB_UnaryOp_fprint(GrB_UnaryOp unaryop, const char *name, GxB_Print_Level pr, FILE *f); -extern GrB_Info GxB_UnaryOp_new(GrB_UnaryOp *unaryop, GxB_unary_function function, GrB_Type ztype, GrB_Type xtype, const char *unop_name, const char *unop_defn); -extern GrB_Info GxB_UnaryOp_xtype(GrB_Type *xtype, GrB_UnaryOp unaryop); -extern GrB_Info GxB_UnaryOp_xtype_name(char *type_name, const GrB_UnaryOp unaryop); -extern GrB_Info GxB_UnaryOp_ztype(GrB_Type *ztype, GrB_UnaryOp unaryop); -extern GrB_Info GxB_UnaryOp_ztype_name(char *type_name, const GrB_UnaryOp unaryop); +GrB_Info GxB_UnaryOp_fprint(GrB_UnaryOp unaryop, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_UnaryOp_new(GrB_UnaryOp *unaryop, GxB_unary_function function, GrB_Type ztype, GrB_Type xtype, const char *unop_name, const char *unop_defn); +GrB_Info GxB_UnaryOp_xtype(GrB_Type *xtype, GrB_UnaryOp unaryop); +GrB_Info GxB_UnaryOp_xtype_name(char *type_name, const GrB_UnaryOp unaryop); +GrB_Info GxB_UnaryOp_ztype(GrB_Type *ztype, GrB_UnaryOp unaryop); +GrB_Info GxB_UnaryOp_ztype_name(char *type_name, const GrB_UnaryOp unaryop); /* vector */ -extern GrB_Info GxB_Vector_Iterator_attach(GxB_Iterator iterator, GrB_Vector v, GrB_Descriptor desc); -extern GrB_Info GxB_Vector_Option_get(GrB_Vector A, GxB_Option_Field field, char *); -extern GrB_Info GxB_Vector_Option_get_FP64(GrB_Vector v, GxB_Option_Field field, double *value); -extern GrB_Info GxB_Vector_Option_get_INT32(GrB_Vector v, GxB_Option_Field field, int32_t *value); -extern GrB_Info GxB_Vector_Option_set(GrB_Vector A, GxB_Option_Field field, char *); -extern GrB_Info GxB_Vector_Option_set_FP64(GrB_Vector v, GxB_Option_Field field, double value); -extern GrB_Info GxB_Vector_Option_set_INT32(GrB_Vector v, GxB_Option_Field field, int32_t value); -extern GrB_Info GxB_Vector_apply_BinaryOp1st(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_apply_BinaryOp1st_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC32_t x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_apply_BinaryOp1st_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC64_t x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_apply_BinaryOp2nd(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const GrB_Scalar y, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_apply_BinaryOp2nd_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, GxB_FC32_t y, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_apply_BinaryOp2nd_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, GxB_FC64_t y, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_apply_IndexOp_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, GxB_FC32_t y, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_apply_IndexOp_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, GxB_FC64_t y, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_assign_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GxB_FC32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_assign_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_build_FC32(GrB_Vector w, const GrB_Index *I, const GxB_FC32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GxB_Vector_build_FC64(GrB_Vector w, const GrB_Index *I, const GxB_FC64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GxB_Vector_build_Scalar(GrB_Vector w, const GrB_Index *I, GrB_Scalar scalar, GrB_Index nvals); -extern GrB_Info GxB_Vector_deserialize(GrB_Vector *w, GrB_Type type, const void *blob, GrB_Index blob_size, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_eWiseUnion(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Vector u, const GrB_Scalar alpha, const GrB_Vector v, const GrB_Scalar beta, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_export_Bitmap(GrB_Vector *v, GrB_Type *type, GrB_Index *n, int8_t **vb, void **vx, GrB_Index *vb_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_export_CSC(GrB_Vector *v, GrB_Type *type, GrB_Index *n, GrB_Index **vi, void **vx, GrB_Index *vi_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, bool *jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_export_Full(GrB_Vector *v, GrB_Type *type, GrB_Index *n, void **vx, GrB_Index *vx_size, bool *iso, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_extractElement_FC32(GxB_FC32_t *x, const GrB_Vector v, GrB_Index i); -extern GrB_Info GxB_Vector_extractElement_FC64(GxB_FC64_t *x, const GrB_Vector v, GrB_Index i); -extern GrB_Info GxB_Vector_extractTuples_FC32(GrB_Index *I, GxB_FC32_t *X, GrB_Index *nvals, const GrB_Vector v); -extern GrB_Info GxB_Vector_extractTuples_FC64(GrB_Index *I, GxB_FC64_t *X, GrB_Index *nvals, const GrB_Vector v); -extern GrB_Info GxB_Vector_fprint(GrB_Vector v, const char *name, GxB_Print_Level pr, FILE *f); -extern GrB_Info GxB_Vector_import_Bitmap(GrB_Vector *v, GrB_Type type, GrB_Index n, int8_t **vb, void **vx, GrB_Index vb_size, GrB_Index vx_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_import_CSC(GrB_Vector *v, GrB_Type type, GrB_Index n, GrB_Index **vi, void **vx, GrB_Index vi_size, GrB_Index vx_size, bool iso, GrB_Index nvals, bool jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_import_Full(GrB_Vector *v, GrB_Type type, GrB_Index n, void **vx, GrB_Index vx_size, bool iso, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_isStoredElement(const GrB_Vector v, GrB_Index i); -extern GrB_Info GxB_Vector_iso(bool *iso, const GrB_Vector v); -extern GrB_Info GxB_Vector_memoryUsage(size_t *size, const GrB_Vector v); -extern GrB_Info GxB_Vector_pack_Bitmap(GrB_Vector v, int8_t **vb, void **vx, GrB_Index vb_size, GrB_Index vx_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_pack_CSC(GrB_Vector v, GrB_Index **vi, void **vx, GrB_Index vi_size, GrB_Index vx_size, bool iso, GrB_Index nvals, bool jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_pack_Full(GrB_Vector v, void **vx, GrB_Index vx_size, bool iso, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_reduce_FC32(GxB_FC32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_reduce_FC64(GxB_FC64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_select(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Vector u, const GrB_Scalar Thunk, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_select_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, GxB_FC32_t y, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_select_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, GxB_FC64_t y, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_serialize(void **blob_handle, GrB_Index *blob_size_handle, GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_setElement_FC32(GrB_Vector w, GxB_FC32_t x, GrB_Index i); -extern GrB_Info GxB_Vector_setElement_FC64(GrB_Vector w, GxB_FC64_t x, GrB_Index i); -extern GrB_Info GxB_Vector_sort(GrB_Vector w, GrB_Vector p, GrB_BinaryOp op, GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_subassign(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_subassign_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_subassign_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GxB_FC32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_subassign_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_subassign_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_subassign_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, double x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_subassign_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_subassign_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_subassign_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_subassign_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_subassign_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_subassign_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_subassign_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_subassign_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_subassign_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_subassign_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_type(GrB_Type *type, const GrB_Vector v); -extern GrB_Info GxB_Vector_type_name(char *type_name, const GrB_Vector v); -extern GrB_Info GxB_Vector_unpack_Bitmap(GrB_Vector v, int8_t **vb, void **vx, GrB_Index *vb_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_unpack_CSC(GrB_Vector v, GrB_Index **vi, void **vx, GrB_Index *vi_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, bool *jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_unpack_Full(GrB_Vector v, void **vx, GrB_Index *vx_size, bool *iso, const GrB_Descriptor desc); +GrB_Info GxB_Vector_Iterator_attach(GxB_Iterator iterator, GrB_Vector v, GrB_Descriptor desc); +GrB_Info GxB_Vector_Option_get(GrB_Vector A, GxB_Option_Field field, ...); +GrB_Info GxB_Vector_Option_get_FP64(GrB_Vector v, GxB_Option_Field field, double *value); +GrB_Info GxB_Vector_Option_get_INT32(GrB_Vector v, GxB_Option_Field field, int32_t *value); +GrB_Info GxB_Vector_Option_set(GrB_Vector A, GxB_Option_Field field, ...); +GrB_Info GxB_Vector_Option_set_FP64(GrB_Vector v, GxB_Option_Field field, double value); +GrB_Info GxB_Vector_Option_set_INT32(GrB_Vector v, GxB_Option_Field field, int32_t value); +GrB_Info GxB_Vector_apply_BinaryOp1st(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GxB_Vector_apply_BinaryOp1st_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC32_t x, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GxB_Vector_apply_BinaryOp1st_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC64_t x, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GxB_Vector_apply_BinaryOp2nd(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const GrB_Scalar y, const GrB_Descriptor desc); +GrB_Info GxB_Vector_apply_BinaryOp2nd_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, GxB_FC32_t y, const GrB_Descriptor desc); +GrB_Info GxB_Vector_apply_BinaryOp2nd_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, GxB_FC64_t y, const GrB_Descriptor desc); +GrB_Info GxB_Vector_apply_IndexOp_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, GxB_FC32_t y, const GrB_Descriptor desc); +GrB_Info GxB_Vector_apply_IndexOp_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, GxB_FC64_t y, const GrB_Descriptor desc); +GrB_Info GxB_Vector_assign_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GxB_FC32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_assign_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_build_FC32(GrB_Vector w, const GrB_Index *I, const GxB_FC32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GxB_Vector_build_FC64(GrB_Vector w, const GrB_Index *I, const GxB_FC64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GxB_Vector_build_Scalar(GrB_Vector w, const GrB_Index *I, GrB_Scalar scalar, GrB_Index nvals); +GrB_Info GxB_Vector_deserialize(GrB_Vector *w, GrB_Type type, const void *blob, GrB_Index blob_size, const GrB_Descriptor desc); +GrB_Info GxB_Vector_eWiseUnion(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Vector u, const GrB_Scalar alpha, const GrB_Vector v, const GrB_Scalar beta, const GrB_Descriptor desc); +GrB_Info GxB_Vector_export_Bitmap(GrB_Vector *v, GrB_Type *type, GrB_Index *n, int8_t **vb, void **vx, GrB_Index *vb_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); +GrB_Info GxB_Vector_export_CSC(GrB_Vector *v, GrB_Type *type, GrB_Index *n, GrB_Index **vi, void **vx, GrB_Index *vi_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, bool *jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Vector_export_Full(GrB_Vector *v, GrB_Type *type, GrB_Index *n, void **vx, GrB_Index *vx_size, bool *iso, const GrB_Descriptor desc); +GrB_Info GxB_Vector_extractElement_FC32(GxB_FC32_t *x, const GrB_Vector v, GrB_Index i); +GrB_Info GxB_Vector_extractElement_FC64(GxB_FC64_t *x, const GrB_Vector v, GrB_Index i); +GrB_Info GxB_Vector_extractTuples_FC32(GrB_Index *I, GxB_FC32_t *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GxB_Vector_extractTuples_FC64(GrB_Index *I, GxB_FC64_t *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GxB_Vector_fprint(GrB_Vector v, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_Vector_import_Bitmap(GrB_Vector *v, GrB_Type type, GrB_Index n, int8_t **vb, void **vx, GrB_Index vb_size, GrB_Index vx_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); +GrB_Info GxB_Vector_import_CSC(GrB_Vector *v, GrB_Type type, GrB_Index n, GrB_Index **vi, void **vx, GrB_Index vi_size, GrB_Index vx_size, bool iso, GrB_Index nvals, bool jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Vector_import_Full(GrB_Vector *v, GrB_Type type, GrB_Index n, void **vx, GrB_Index vx_size, bool iso, const GrB_Descriptor desc); +GrB_Info GxB_Vector_isStoredElement(const GrB_Vector v, GrB_Index i); +GrB_Info GxB_Vector_iso(bool *iso, const GrB_Vector v); +GrB_Info GxB_Vector_memoryUsage(size_t *size, const GrB_Vector v); +GrB_Info GxB_Vector_pack_Bitmap(GrB_Vector v, int8_t **vb, void **vx, GrB_Index vb_size, GrB_Index vx_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); +GrB_Info GxB_Vector_pack_CSC(GrB_Vector v, GrB_Index **vi, void **vx, GrB_Index vi_size, GrB_Index vx_size, bool iso, GrB_Index nvals, bool jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Vector_pack_Full(GrB_Vector v, void **vx, GrB_Index vx_size, bool iso, const GrB_Descriptor desc); +GrB_Info GxB_Vector_reduce_FC32(GxB_FC32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GxB_Vector_reduce_FC64(GxB_FC64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GxB_Vector_select(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Vector u, const GrB_Scalar Thunk, const GrB_Descriptor desc); +GrB_Info GxB_Vector_select_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, GxB_FC32_t y, const GrB_Descriptor desc); +GrB_Info GxB_Vector_select_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, GxB_FC64_t y, const GrB_Descriptor desc); +GrB_Info GxB_Vector_serialize(void **blob_handle, GrB_Index *blob_size_handle, GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GxB_Vector_setElement_FC32(GrB_Vector w, GxB_FC32_t x, GrB_Index i); +GrB_Info GxB_Vector_setElement_FC64(GrB_Vector w, GxB_FC64_t x, GrB_Index i); +GrB_Info GxB_Vector_sort(GrB_Vector w, GrB_Vector p, GrB_BinaryOp op, GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GxB_FC32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, double x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_type(GrB_Type *type, const GrB_Vector v); +GrB_Info GxB_Vector_type_name(char *type_name, const GrB_Vector v); +GrB_Info GxB_Vector_unpack_Bitmap(GrB_Vector v, int8_t **vb, void **vx, GrB_Index *vb_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); +GrB_Info GxB_Vector_unpack_CSC(GrB_Vector v, GrB_Index **vi, void **vx, GrB_Index *vi_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, bool *jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Vector_unpack_Full(GrB_Vector v, void **vx, GrB_Index *vx_size, bool *iso, const GrB_Descriptor desc); /* int DEFINES */ #define GRB_SUBVERSION ... diff --git a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h index f8ac38f..0ce6e93 100644 --- a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h +++ b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h @@ -2451,764 +2451,764 @@ extern GxB_SelectOp GxB_TRIU; ****************/ /* binary */ -extern GrB_Info GrB_BinaryOp_error(const char **error, const GrB_BinaryOp op); -extern GrB_Info GrB_BinaryOp_free(GrB_BinaryOp *binaryop); -extern GrB_Info GrB_BinaryOp_new(GrB_BinaryOp *binaryop, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype); -extern GrB_Info GrB_BinaryOp_wait(GrB_BinaryOp op, GrB_WaitMode waitmode); +GrB_Info GrB_BinaryOp_error(const char **error, const GrB_BinaryOp op); +GrB_Info GrB_BinaryOp_free(GrB_BinaryOp *binaryop); +GrB_Info GrB_BinaryOp_new(GrB_BinaryOp *binaryop, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype); +GrB_Info GrB_BinaryOp_wait(GrB_BinaryOp op, GrB_WaitMode waitmode); /* core */ -extern GrB_Info GrB_finalize(void); -extern GrB_Info GrB_getVersion(unsigned int *version, unsigned int *subversion); -extern GrB_Info GrB_init(GrB_Mode mode); +GrB_Info GrB_finalize(void); +GrB_Info GrB_getVersion(unsigned int *version, unsigned int *subversion); +GrB_Info GrB_init(GrB_Mode mode); /* descriptor */ -extern GrB_Info GrB_Descriptor_error(const char **error, const GrB_Descriptor d); -extern GrB_Info GrB_Descriptor_free(GrB_Descriptor *descriptor); -extern GrB_Info GrB_Descriptor_new(GrB_Descriptor *descriptor); -extern GrB_Info GrB_Descriptor_set(GrB_Descriptor desc, GrB_Desc_Field field, GrB_Desc_Value val); -extern GrB_Info GrB_Descriptor_wait(GrB_Descriptor desc, GrB_WaitMode waitmode); +GrB_Info GrB_Descriptor_error(const char **error, const GrB_Descriptor d); +GrB_Info GrB_Descriptor_free(GrB_Descriptor *descriptor); +GrB_Info GrB_Descriptor_new(GrB_Descriptor *descriptor); +GrB_Info GrB_Descriptor_set(GrB_Descriptor desc, GrB_Desc_Field field, GrB_Desc_Value val); +GrB_Info GrB_Descriptor_wait(GrB_Descriptor desc, GrB_WaitMode waitmode); /* indexunary */ -extern GrB_Info GrB_IndexUnaryOp_error(const char **error, const GrB_IndexUnaryOp op); -extern GrB_Info GrB_IndexUnaryOp_free(GrB_IndexUnaryOp *op); -extern GrB_Info GrB_IndexUnaryOp_new(GrB_IndexUnaryOp *op, GxB_index_unary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype); -extern GrB_Info GrB_IndexUnaryOp_wait(GrB_IndexUnaryOp op, GrB_WaitMode waitmode); +GrB_Info GrB_IndexUnaryOp_error(const char **error, const GrB_IndexUnaryOp op); +GrB_Info GrB_IndexUnaryOp_free(GrB_IndexUnaryOp *op); +GrB_Info GrB_IndexUnaryOp_new(GrB_IndexUnaryOp *op, GxB_index_unary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype); +GrB_Info GrB_IndexUnaryOp_wait(GrB_IndexUnaryOp op, GrB_WaitMode waitmode); /* matrix */ -extern GrB_Info GrB_Col_assign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); -extern GrB_Info GrB_Col_extract(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_UnaryOp op, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp1st_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, bool x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp1st_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, float x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp1st_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, double x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp1st_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int8_t x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp1st_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int16_t x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp1st_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int32_t x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp1st_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int64_t x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp1st_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp1st_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const void *x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp1st_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint8_t x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp1st_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint16_t x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp1st_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint32_t x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp1st_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint64_t x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, bool y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, float y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, double y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, int8_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, int16_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, int32_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, int64_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Scalar y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const void *y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, uint8_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, uint16_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, uint32_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, uint64_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, bool y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, float y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, double y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int8_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int16_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int32_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int64_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const GrB_Scalar y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const void *y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint8_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint16_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint32_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_apply_IndexOp_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint64_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_assign(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_assign_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_assign_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_assign_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, double x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_assign_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_assign_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_assign_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_assign_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_assign_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_assign_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_assign_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_assign_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_assign_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_assign_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_build_BOOL(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const bool *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Matrix_build_FP32(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const float *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Matrix_build_FP64(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const double *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Matrix_build_INT8(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const int8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Matrix_build_INT16(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const int16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Matrix_build_INT32(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const int32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Matrix_build_INT64(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const int64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Matrix_build_UDT(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const void *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Matrix_build_UINT8(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const uint8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Matrix_build_UINT16(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const uint16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Matrix_build_UINT32(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const uint32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Matrix_build_UINT64(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const uint64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Matrix_clear(GrB_Matrix A); -extern GrB_Info GrB_Matrix_deserialize(GrB_Matrix *C, GrB_Type type, const void *blob, GrB_Index blob_size); -extern GrB_Info GrB_Matrix_diag(GrB_Matrix *C, const GrB_Vector v, int64_t k); -extern GrB_Info GrB_Matrix_dup(GrB_Matrix *C, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_eWiseAdd_BinaryOp(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_eWiseAdd_Monoid(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_eWiseAdd_Semiring(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_eWiseMult_BinaryOp(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp mult, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_eWiseMult_Monoid(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_eWiseMult_Semiring(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_error(const char **error, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_exportHint(GrB_Format *format, GrB_Matrix A); -extern GrB_Info GrB_Matrix_exportSize(GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -extern GrB_Info GrB_Matrix_export_BOOL(GrB_Index *Ap, GrB_Index *Ai, bool *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -extern GrB_Info GrB_Matrix_export_FP32(GrB_Index *Ap, GrB_Index *Ai, float *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -extern GrB_Info GrB_Matrix_export_FP64(GrB_Index *Ap, GrB_Index *Ai, double *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -extern GrB_Info GrB_Matrix_export_INT8(GrB_Index *Ap, GrB_Index *Ai, int8_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -extern GrB_Info GrB_Matrix_export_INT16(GrB_Index *Ap, GrB_Index *Ai, int16_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -extern GrB_Info GrB_Matrix_export_INT32(GrB_Index *Ap, GrB_Index *Ai, int32_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -extern GrB_Info GrB_Matrix_export_INT64(GrB_Index *Ap, GrB_Index *Ai, int64_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -extern GrB_Info GrB_Matrix_export_UDT(GrB_Index *Ap, GrB_Index *Ai, void *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -extern GrB_Info GrB_Matrix_export_UINT8(GrB_Index *Ap, GrB_Index *Ai, uint8_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -extern GrB_Info GrB_Matrix_export_UINT16(GrB_Index *Ap, GrB_Index *Ai, uint16_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -extern GrB_Info GrB_Matrix_export_UINT32(GrB_Index *Ap, GrB_Index *Ai, uint32_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -extern GrB_Info GrB_Matrix_export_UINT64(GrB_Index *Ap, GrB_Index *Ai, uint64_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -extern GrB_Info GrB_Matrix_extract(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_extractElement_BOOL(bool *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_extractElement_FP32(float *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_extractElement_FP64(double *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_extractElement_INT8(int8_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_extractElement_INT16(int16_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_extractElement_INT32(int32_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_extractElement_INT64(int64_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_extractElement_Scalar(GrB_Scalar x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_extractElement_UDT(void *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_extractElement_UINT8(uint8_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_extractElement_UINT16(uint16_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_extractElement_UINT32(uint32_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_extractElement_UINT64(uint64_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_extractTuples_BOOL(GrB_Index *I, GrB_Index *J, bool *X, GrB_Index *nvals, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_extractTuples_FP32(GrB_Index *I, GrB_Index *J, float *X, GrB_Index *nvals, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_extractTuples_FP64(GrB_Index *I, GrB_Index *J, double *X, GrB_Index *nvals, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_extractTuples_INT8(GrB_Index *I, GrB_Index *J, int8_t *X, GrB_Index *nvals, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_extractTuples_INT16(GrB_Index *I, GrB_Index *J, int16_t *X, GrB_Index *nvals, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_extractTuples_INT32(GrB_Index *I, GrB_Index *J, int32_t *X, GrB_Index *nvals, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_extractTuples_INT64(GrB_Index *I, GrB_Index *J, int64_t *X, GrB_Index *nvals, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_extractTuples_UDT(GrB_Index *I, GrB_Index *J, void *X, GrB_Index *nvals, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_extractTuples_UINT8(GrB_Index *I, GrB_Index *J, uint8_t *X, GrB_Index *nvals, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_extractTuples_UINT16(GrB_Index *I, GrB_Index *J, uint16_t *X, GrB_Index *nvals, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_extractTuples_UINT32(GrB_Index *I, GrB_Index *J, uint32_t *X, GrB_Index *nvals, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_extractTuples_UINT64(GrB_Index *I, GrB_Index *J, uint64_t *X, GrB_Index *nvals, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_free(GrB_Matrix *A); -extern GrB_Info GrB_Matrix_import_BOOL(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const bool *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -extern GrB_Info GrB_Matrix_import_FP32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const float *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -extern GrB_Info GrB_Matrix_import_FP64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const double *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -extern GrB_Info GrB_Matrix_import_INT8(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int8_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -extern GrB_Info GrB_Matrix_import_INT16(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int16_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -extern GrB_Info GrB_Matrix_import_INT32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int32_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -extern GrB_Info GrB_Matrix_import_INT64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int64_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -extern GrB_Info GrB_Matrix_import_UDT(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const void *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -extern GrB_Info GrB_Matrix_import_UINT8(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint8_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -extern GrB_Info GrB_Matrix_import_UINT16(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint16_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -extern GrB_Info GrB_Matrix_import_UINT32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint32_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -extern GrB_Info GrB_Matrix_import_UINT64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint64_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -extern GrB_Info GrB_Matrix_kronecker_BinaryOp(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_kronecker_Monoid(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_kronecker_Semiring(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_ncols(GrB_Index *ncols, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_new(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols); -extern GrB_Info GrB_Matrix_nrows(GrB_Index *nrows, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_nvals(GrB_Index *nvals, const GrB_Matrix A); -extern GrB_Info GrB_Matrix_reduce_BOOL(bool *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_reduce_BinaryOp(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_reduce_BinaryOp_Scalar(GrB_Scalar S, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_reduce_FP32(float *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_reduce_FP64(double *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_reduce_INT8(int8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_reduce_INT16(int16_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_reduce_INT32(int32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_reduce_INT64(int64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_reduce_Monoid(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_reduce_Monoid_Scalar(GrB_Scalar c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_reduce_UDT(void *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_reduce_UINT8(uint8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_reduce_UINT16(uint16_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_reduce_UINT32(uint32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_reduce_UINT64(uint64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_removeElement(GrB_Matrix C, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_resize(GrB_Matrix C, GrB_Index nrows_new, GrB_Index ncols_new); -extern GrB_Info GrB_Matrix_select_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, bool y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, float y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, double y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int8_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int16_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int32_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int64_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const GrB_Scalar y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const void *y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint8_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint16_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint32_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_select_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint64_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Matrix_serialize(void *blob, GrB_Index *blob_size_handle, GrB_Matrix A); -extern GrB_Info GrB_Matrix_serializeSize(GrB_Index *blob_size_handle, GrB_Matrix A); -extern GrB_Info GrB_Matrix_setElement_BOOL(GrB_Matrix C, bool x, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_setElement_FP32(GrB_Matrix C, float x, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_setElement_FP64(GrB_Matrix C, double x, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_setElement_INT8(GrB_Matrix C, int8_t x, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_setElement_INT16(GrB_Matrix C, int16_t x, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_setElement_INT32(GrB_Matrix C, int32_t x, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_setElement_INT64(GrB_Matrix C, int64_t x, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_setElement_Scalar(GrB_Matrix C, GrB_Scalar x, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_setElement_UDT(GrB_Matrix C, void *x, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_setElement_UINT8(GrB_Matrix C, uint8_t x, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_setElement_UINT16(GrB_Matrix C, uint16_t x, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_setElement_UINT32(GrB_Matrix C, uint32_t x, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_setElement_UINT64(GrB_Matrix C, uint64_t x, GrB_Index i, GrB_Index j); -extern GrB_Info GrB_Matrix_wait(GrB_Matrix A, GrB_WaitMode waitmode); -extern GrB_Info GrB_Row_assign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, GrB_Index i, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GrB_mxm(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); -extern GrB_Info GrB_mxv(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_transpose(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GrB_vxm(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Vector u, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Col_assign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); +GrB_Info GrB_Col_extract(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_UnaryOp op, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp1st_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, bool x, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp1st_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, float x, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp1st_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, double x, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp1st_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int8_t x, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp1st_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int16_t x, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp1st_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int32_t x, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp1st_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int64_t x, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp1st_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp1st_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const void *x, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp1st_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint8_t x, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp1st_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint16_t x, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp1st_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint32_t x, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp1st_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint64_t x, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp2nd_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, bool y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp2nd_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, float y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp2nd_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, double y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, int8_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, int16_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, int32_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, int64_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp2nd_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Scalar y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp2nd_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const void *y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, uint8_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, uint16_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, uint32_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, uint64_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_IndexOp_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, bool y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_IndexOp_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, float y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_IndexOp_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, double y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_IndexOp_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int8_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_IndexOp_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int16_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_IndexOp_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int32_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_IndexOp_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int64_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_IndexOp_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const GrB_Scalar y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_IndexOp_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const void *y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_IndexOp_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint8_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_IndexOp_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint16_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_IndexOp_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint32_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_apply_IndexOp_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint64_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, double x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_build_BOOL(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const bool *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_FP32(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const float *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_FP64(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const double *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_INT8(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const int8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_INT16(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const int16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_INT32(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const int32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_INT64(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const int64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_UDT(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const void *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_UINT8(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const uint8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_UINT16(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const uint16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_UINT32(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const uint32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_UINT64(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const uint64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_clear(GrB_Matrix A); +GrB_Info GrB_Matrix_deserialize(GrB_Matrix *C, GrB_Type type, const void *blob, GrB_Index blob_size); +GrB_Info GrB_Matrix_diag(GrB_Matrix *C, const GrB_Vector v, int64_t k); +GrB_Info GrB_Matrix_dup(GrB_Matrix *C, const GrB_Matrix A); +GrB_Info GrB_Matrix_eWiseAdd_BinaryOp(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_eWiseAdd_Monoid(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_eWiseAdd_Semiring(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_eWiseMult_BinaryOp(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp mult, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_eWiseMult_Monoid(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_eWiseMult_Semiring(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_error(const char **error, const GrB_Matrix A); +GrB_Info GrB_Matrix_exportHint(GrB_Format *format, GrB_Matrix A); +GrB_Info GrB_Matrix_exportSize(GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_BOOL(GrB_Index *Ap, GrB_Index *Ai, bool *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_FP32(GrB_Index *Ap, GrB_Index *Ai, float *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_FP64(GrB_Index *Ap, GrB_Index *Ai, double *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_INT8(GrB_Index *Ap, GrB_Index *Ai, int8_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_INT16(GrB_Index *Ap, GrB_Index *Ai, int16_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_INT32(GrB_Index *Ap, GrB_Index *Ai, int32_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_INT64(GrB_Index *Ap, GrB_Index *Ai, int64_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_UDT(GrB_Index *Ap, GrB_Index *Ai, void *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_UINT8(GrB_Index *Ap, GrB_Index *Ai, uint8_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_UINT16(GrB_Index *Ap, GrB_Index *Ai, uint16_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_UINT32(GrB_Index *Ap, GrB_Index *Ai, uint32_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_UINT64(GrB_Index *Ap, GrB_Index *Ai, uint64_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); +GrB_Info GrB_Matrix_extract(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_extractElement_BOOL(bool *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_extractElement_FP32(float *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_extractElement_FP64(double *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_extractElement_INT8(int8_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_extractElement_INT16(int16_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_extractElement_INT32(int32_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_extractElement_INT64(int64_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_extractElement_Scalar(GrB_Scalar x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_extractElement_UDT(void *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_extractElement_UINT8(uint8_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_extractElement_UINT16(uint16_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_extractElement_UINT32(uint32_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_extractElement_UINT64(uint64_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_extractTuples_BOOL(GrB_Index *I, GrB_Index *J, bool *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_FP32(GrB_Index *I, GrB_Index *J, float *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_FP64(GrB_Index *I, GrB_Index *J, double *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_INT8(GrB_Index *I, GrB_Index *J, int8_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_INT16(GrB_Index *I, GrB_Index *J, int16_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_INT32(GrB_Index *I, GrB_Index *J, int32_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_INT64(GrB_Index *I, GrB_Index *J, int64_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_UDT(GrB_Index *I, GrB_Index *J, void *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_UINT8(GrB_Index *I, GrB_Index *J, uint8_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_UINT16(GrB_Index *I, GrB_Index *J, uint16_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_UINT32(GrB_Index *I, GrB_Index *J, uint32_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_UINT64(GrB_Index *I, GrB_Index *J, uint64_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_free(GrB_Matrix *A); +GrB_Info GrB_Matrix_import_BOOL(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const bool *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +GrB_Info GrB_Matrix_import_FP32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const float *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +GrB_Info GrB_Matrix_import_FP64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const double *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +GrB_Info GrB_Matrix_import_INT8(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int8_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +GrB_Info GrB_Matrix_import_INT16(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int16_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +GrB_Info GrB_Matrix_import_INT32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int32_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +GrB_Info GrB_Matrix_import_INT64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int64_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +GrB_Info GrB_Matrix_import_UDT(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const void *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +GrB_Info GrB_Matrix_import_UINT8(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint8_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +GrB_Info GrB_Matrix_import_UINT16(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint16_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +GrB_Info GrB_Matrix_import_UINT32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint32_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +GrB_Info GrB_Matrix_import_UINT64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint64_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +GrB_Info GrB_Matrix_kronecker_BinaryOp(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_kronecker_Monoid(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_kronecker_Semiring(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_ncols(GrB_Index *ncols, const GrB_Matrix A); +GrB_Info GrB_Matrix_new(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols); +GrB_Info GrB_Matrix_nrows(GrB_Index *nrows, const GrB_Matrix A); +GrB_Info GrB_Matrix_nvals(GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_reduce_BOOL(bool *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_reduce_BinaryOp(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_reduce_BinaryOp_Scalar(GrB_Scalar S, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_reduce_FP32(float *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_reduce_FP64(double *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_reduce_INT8(int8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_reduce_INT16(int16_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_reduce_INT32(int32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_reduce_INT64(int64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_reduce_Monoid(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_reduce_Monoid_Scalar(GrB_Scalar c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_reduce_UDT(void *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_reduce_UINT8(uint8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_reduce_UINT16(uint16_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_reduce_UINT32(uint32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_reduce_UINT64(uint64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_removeElement(GrB_Matrix C, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_resize(GrB_Matrix C, GrB_Index nrows_new, GrB_Index ncols_new); +GrB_Info GrB_Matrix_select_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, bool y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_select_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, float y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_select_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, double y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_select_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int8_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_select_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int16_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_select_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int32_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_select_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int64_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_select_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const GrB_Scalar y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_select_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const void *y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_select_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint8_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_select_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint16_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_select_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint32_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_select_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint64_t y, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_serialize(void *blob, GrB_Index *blob_size_handle, GrB_Matrix A); +GrB_Info GrB_Matrix_serializeSize(GrB_Index *blob_size_handle, GrB_Matrix A); +GrB_Info GrB_Matrix_setElement_BOOL(GrB_Matrix C, bool x, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_setElement_FP32(GrB_Matrix C, float x, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_setElement_FP64(GrB_Matrix C, double x, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_setElement_INT8(GrB_Matrix C, int8_t x, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_setElement_INT16(GrB_Matrix C, int16_t x, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_setElement_INT32(GrB_Matrix C, int32_t x, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_setElement_INT64(GrB_Matrix C, int64_t x, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_setElement_Scalar(GrB_Matrix C, GrB_Scalar x, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_setElement_UDT(GrB_Matrix C, void *x, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_setElement_UINT8(GrB_Matrix C, uint8_t x, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_setElement_UINT16(GrB_Matrix C, uint16_t x, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_setElement_UINT32(GrB_Matrix C, uint32_t x, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_setElement_UINT64(GrB_Matrix C, uint64_t x, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_wait(GrB_Matrix A, GrB_WaitMode waitmode); +GrB_Info GrB_Row_assign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, GrB_Index i, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_mxm(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); +GrB_Info GrB_mxv(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_transpose(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_vxm(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Vector u, const GrB_Matrix A, const GrB_Descriptor desc); /* monoid */ -extern GrB_Info GrB_Monoid_error(const char **error, const GrB_Monoid monoid); -extern GrB_Info GrB_Monoid_free(GrB_Monoid *monoid); -extern GrB_Info GrB_Monoid_new_BOOL(GrB_Monoid *monoid, GrB_BinaryOp op, bool identity); -extern GrB_Info GrB_Monoid_new_FP32(GrB_Monoid *monoid, GrB_BinaryOp op, float identity); -extern GrB_Info GrB_Monoid_new_FP64(GrB_Monoid *monoid, GrB_BinaryOp op, double identity); -extern GrB_Info GrB_Monoid_new_INT8(GrB_Monoid *monoid, GrB_BinaryOp op, int8_t identity); -extern GrB_Info GrB_Monoid_new_INT16(GrB_Monoid *monoid, GrB_BinaryOp op, int16_t identity); -extern GrB_Info GrB_Monoid_new_INT32(GrB_Monoid *monoid, GrB_BinaryOp op, int32_t identity); -extern GrB_Info GrB_Monoid_new_INT64(GrB_Monoid *monoid, GrB_BinaryOp op, int64_t identity); -extern GrB_Info GrB_Monoid_new_UDT(GrB_Monoid *monoid, GrB_BinaryOp op, void *identity); -extern GrB_Info GrB_Monoid_new_UINT8(GrB_Monoid *monoid, GrB_BinaryOp op, uint8_t identity); -extern GrB_Info GrB_Monoid_new_UINT16(GrB_Monoid *monoid, GrB_BinaryOp op, uint16_t identity); -extern GrB_Info GrB_Monoid_new_UINT32(GrB_Monoid *monoid, GrB_BinaryOp op, uint32_t identity); -extern GrB_Info GrB_Monoid_new_UINT64(GrB_Monoid *monoid, GrB_BinaryOp op, uint64_t identity); -extern GrB_Info GrB_Monoid_wait(GrB_Monoid monoid, GrB_WaitMode waitmode); +GrB_Info GrB_Monoid_error(const char **error, const GrB_Monoid monoid); +GrB_Info GrB_Monoid_free(GrB_Monoid *monoid); +GrB_Info GrB_Monoid_new_BOOL(GrB_Monoid *monoid, GrB_BinaryOp op, bool identity); +GrB_Info GrB_Monoid_new_FP32(GrB_Monoid *monoid, GrB_BinaryOp op, float identity); +GrB_Info GrB_Monoid_new_FP64(GrB_Monoid *monoid, GrB_BinaryOp op, double identity); +GrB_Info GrB_Monoid_new_INT8(GrB_Monoid *monoid, GrB_BinaryOp op, int8_t identity); +GrB_Info GrB_Monoid_new_INT16(GrB_Monoid *monoid, GrB_BinaryOp op, int16_t identity); +GrB_Info GrB_Monoid_new_INT32(GrB_Monoid *monoid, GrB_BinaryOp op, int32_t identity); +GrB_Info GrB_Monoid_new_INT64(GrB_Monoid *monoid, GrB_BinaryOp op, int64_t identity); +GrB_Info GrB_Monoid_new_UDT(GrB_Monoid *monoid, GrB_BinaryOp op, void *identity); +GrB_Info GrB_Monoid_new_UINT8(GrB_Monoid *monoid, GrB_BinaryOp op, uint8_t identity); +GrB_Info GrB_Monoid_new_UINT16(GrB_Monoid *monoid, GrB_BinaryOp op, uint16_t identity); +GrB_Info GrB_Monoid_new_UINT32(GrB_Monoid *monoid, GrB_BinaryOp op, uint32_t identity); +GrB_Info GrB_Monoid_new_UINT64(GrB_Monoid *monoid, GrB_BinaryOp op, uint64_t identity); +GrB_Info GrB_Monoid_wait(GrB_Monoid monoid, GrB_WaitMode waitmode); /* scalar */ -extern GrB_Info GrB_Scalar_clear(GrB_Scalar s); -extern GrB_Info GrB_Scalar_dup(GrB_Scalar *s, const GrB_Scalar t); -extern GrB_Info GrB_Scalar_error(const char **error, const GrB_Scalar s); -extern GrB_Info GrB_Scalar_extractElement_BOOL(bool *x, const GrB_Scalar s); -extern GrB_Info GrB_Scalar_extractElement_FP32(float *x, const GrB_Scalar s); -extern GrB_Info GrB_Scalar_extractElement_FP64(double *x, const GrB_Scalar s); -extern GrB_Info GrB_Scalar_extractElement_INT8(int8_t *x, const GrB_Scalar s); -extern GrB_Info GrB_Scalar_extractElement_INT16(int16_t *x, const GrB_Scalar s); -extern GrB_Info GrB_Scalar_extractElement_INT32(int32_t *x, const GrB_Scalar s); -extern GrB_Info GrB_Scalar_extractElement_INT64(int64_t *x, const GrB_Scalar s); -extern GrB_Info GrB_Scalar_extractElement_UDT(void *x, const GrB_Scalar s); -extern GrB_Info GrB_Scalar_extractElement_UINT8(uint8_t *x, const GrB_Scalar s); -extern GrB_Info GrB_Scalar_extractElement_UINT16(uint16_t *x, const GrB_Scalar s); -extern GrB_Info GrB_Scalar_extractElement_UINT32(uint32_t *x, const GrB_Scalar s); -extern GrB_Info GrB_Scalar_extractElement_UINT64(uint64_t *x, const GrB_Scalar s); -extern GrB_Info GrB_Scalar_free(GrB_Scalar *s); -extern GrB_Info GrB_Scalar_new(GrB_Scalar *s, GrB_Type type); -extern GrB_Info GrB_Scalar_nvals(GrB_Index *nvals, const GrB_Scalar s); -extern GrB_Info GrB_Scalar_setElement_BOOL(GrB_Scalar s, bool x); -extern GrB_Info GrB_Scalar_setElement_FP32(GrB_Scalar s, float x); -extern GrB_Info GrB_Scalar_setElement_FP64(GrB_Scalar s, double x); -extern GrB_Info GrB_Scalar_setElement_INT8(GrB_Scalar s, int8_t x); -extern GrB_Info GrB_Scalar_setElement_INT16(GrB_Scalar s, int16_t x); -extern GrB_Info GrB_Scalar_setElement_INT32(GrB_Scalar s, int32_t x); -extern GrB_Info GrB_Scalar_setElement_INT64(GrB_Scalar s, int64_t x); -extern GrB_Info GrB_Scalar_setElement_UDT(GrB_Scalar s, void *x); -extern GrB_Info GrB_Scalar_setElement_UINT8(GrB_Scalar s, uint8_t x); -extern GrB_Info GrB_Scalar_setElement_UINT16(GrB_Scalar s, uint16_t x); -extern GrB_Info GrB_Scalar_setElement_UINT32(GrB_Scalar s, uint32_t x); -extern GrB_Info GrB_Scalar_setElement_UINT64(GrB_Scalar s, uint64_t x); -extern GrB_Info GrB_Scalar_wait(GrB_Scalar s, GrB_WaitMode waitmode); +GrB_Info GrB_Scalar_clear(GrB_Scalar s); +GrB_Info GrB_Scalar_dup(GrB_Scalar *s, const GrB_Scalar t); +GrB_Info GrB_Scalar_error(const char **error, const GrB_Scalar s); +GrB_Info GrB_Scalar_extractElement_BOOL(bool *x, const GrB_Scalar s); +GrB_Info GrB_Scalar_extractElement_FP32(float *x, const GrB_Scalar s); +GrB_Info GrB_Scalar_extractElement_FP64(double *x, const GrB_Scalar s); +GrB_Info GrB_Scalar_extractElement_INT8(int8_t *x, const GrB_Scalar s); +GrB_Info GrB_Scalar_extractElement_INT16(int16_t *x, const GrB_Scalar s); +GrB_Info GrB_Scalar_extractElement_INT32(int32_t *x, const GrB_Scalar s); +GrB_Info GrB_Scalar_extractElement_INT64(int64_t *x, const GrB_Scalar s); +GrB_Info GrB_Scalar_extractElement_UDT(void *x, const GrB_Scalar s); +GrB_Info GrB_Scalar_extractElement_UINT8(uint8_t *x, const GrB_Scalar s); +GrB_Info GrB_Scalar_extractElement_UINT16(uint16_t *x, const GrB_Scalar s); +GrB_Info GrB_Scalar_extractElement_UINT32(uint32_t *x, const GrB_Scalar s); +GrB_Info GrB_Scalar_extractElement_UINT64(uint64_t *x, const GrB_Scalar s); +GrB_Info GrB_Scalar_free(GrB_Scalar *s); +GrB_Info GrB_Scalar_new(GrB_Scalar *s, GrB_Type type); +GrB_Info GrB_Scalar_nvals(GrB_Index *nvals, const GrB_Scalar s); +GrB_Info GrB_Scalar_setElement_BOOL(GrB_Scalar s, bool x); +GrB_Info GrB_Scalar_setElement_FP32(GrB_Scalar s, float x); +GrB_Info GrB_Scalar_setElement_FP64(GrB_Scalar s, double x); +GrB_Info GrB_Scalar_setElement_INT8(GrB_Scalar s, int8_t x); +GrB_Info GrB_Scalar_setElement_INT16(GrB_Scalar s, int16_t x); +GrB_Info GrB_Scalar_setElement_INT32(GrB_Scalar s, int32_t x); +GrB_Info GrB_Scalar_setElement_INT64(GrB_Scalar s, int64_t x); +GrB_Info GrB_Scalar_setElement_UDT(GrB_Scalar s, void *x); +GrB_Info GrB_Scalar_setElement_UINT8(GrB_Scalar s, uint8_t x); +GrB_Info GrB_Scalar_setElement_UINT16(GrB_Scalar s, uint16_t x); +GrB_Info GrB_Scalar_setElement_UINT32(GrB_Scalar s, uint32_t x); +GrB_Info GrB_Scalar_setElement_UINT64(GrB_Scalar s, uint64_t x); +GrB_Info GrB_Scalar_wait(GrB_Scalar s, GrB_WaitMode waitmode); /* semiring */ -extern GrB_Info GrB_Semiring_error(const char **error, const GrB_Semiring semiring); -extern GrB_Info GrB_Semiring_free(GrB_Semiring *semiring); -extern GrB_Info GrB_Semiring_new(GrB_Semiring *semiring, GrB_Monoid add, GrB_BinaryOp multiply); -extern GrB_Info GrB_Semiring_wait(GrB_Semiring semiring, GrB_WaitMode waitmode); +GrB_Info GrB_Semiring_error(const char **error, const GrB_Semiring semiring); +GrB_Info GrB_Semiring_free(GrB_Semiring *semiring); +GrB_Info GrB_Semiring_new(GrB_Semiring *semiring, GrB_Monoid add, GrB_BinaryOp multiply); +GrB_Info GrB_Semiring_wait(GrB_Semiring semiring, GrB_WaitMode waitmode); /* type */ -extern GrB_Info GrB_Type_error(const char **error, const GrB_Type type); -extern GrB_Info GrB_Type_free(GrB_Type *type); -extern GrB_Info GrB_Type_new(GrB_Type *type, size_t sizeof_ctype); -extern GrB_Info GrB_Type_wait(GrB_Type type, GrB_WaitMode waitmode); +GrB_Info GrB_Type_error(const char **error, const GrB_Type type); +GrB_Info GrB_Type_free(GrB_Type *type); +GrB_Info GrB_Type_new(GrB_Type *type, size_t sizeof_ctype); +GrB_Info GrB_Type_wait(GrB_Type type, GrB_WaitMode waitmode); /* unary */ -extern GrB_Info GrB_UnaryOp_error(const char **error, const GrB_UnaryOp op); -extern GrB_Info GrB_UnaryOp_free(GrB_UnaryOp *unaryop); -extern GrB_Info GrB_UnaryOp_new(GrB_UnaryOp *unaryop, GxB_unary_function function, GrB_Type ztype, GrB_Type xtype); -extern GrB_Info GrB_UnaryOp_wait(GrB_UnaryOp op, GrB_WaitMode waitmode); +GrB_Info GrB_UnaryOp_error(const char **error, const GrB_UnaryOp op); +GrB_Info GrB_UnaryOp_free(GrB_UnaryOp *unaryop); +GrB_Info GrB_UnaryOp_new(GrB_UnaryOp *unaryop, GxB_unary_function function, GrB_Type ztype, GrB_Type xtype); +GrB_Info GrB_UnaryOp_wait(GrB_UnaryOp op, GrB_WaitMode waitmode); /* vector */ -extern GrB_Info GrB_Vector_apply(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_UnaryOp op, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp1st_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, bool x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp1st_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, float x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp1st_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, double x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp1st_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int8_t x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp1st_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int16_t x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp1st_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int32_t x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp1st_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int64_t x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp1st_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp1st_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const void *x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp1st_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint8_t x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp1st_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint16_t x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp1st_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint32_t x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp1st_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint64_t x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp2nd_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, bool y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp2nd_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, float y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp2nd_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, double y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp2nd_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, int8_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp2nd_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, int16_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp2nd_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, int32_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp2nd_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, int64_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp2nd_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const GrB_Scalar y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp2nd_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const void *y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, uint8_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, uint16_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, uint32_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, uint64_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, bool y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, float y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, double y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int8_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int16_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int32_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int64_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const GrB_Scalar y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const void *y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint8_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint16_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint32_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_apply_IndexOp_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint64_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_assign(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_assign_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_assign_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_assign_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, double x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_assign_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_assign_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_assign_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_assign_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_assign_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_assign_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_assign_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_assign_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_assign_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_assign_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_build_BOOL(GrB_Vector w, const GrB_Index *I, const bool *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Vector_build_FP32(GrB_Vector w, const GrB_Index *I, const float *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Vector_build_FP64(GrB_Vector w, const GrB_Index *I, const double *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Vector_build_INT8(GrB_Vector w, const GrB_Index *I, const int8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Vector_build_INT16(GrB_Vector w, const GrB_Index *I, const int16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Vector_build_INT32(GrB_Vector w, const GrB_Index *I, const int32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Vector_build_INT64(GrB_Vector w, const GrB_Index *I, const int64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Vector_build_UDT(GrB_Vector w, const GrB_Index *I, const void *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Vector_build_UINT8(GrB_Vector w, const GrB_Index *I, const uint8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Vector_build_UINT16(GrB_Vector w, const GrB_Index *I, const uint16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Vector_build_UINT32(GrB_Vector w, const GrB_Index *I, const uint32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Vector_build_UINT64(GrB_Vector w, const GrB_Index *I, const uint64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -extern GrB_Info GrB_Vector_clear(GrB_Vector v); -extern GrB_Info GrB_Vector_dup(GrB_Vector *w, const GrB_Vector u); -extern GrB_Info GrB_Vector_eWiseAdd_BinaryOp(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_eWiseAdd_Monoid(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_eWiseAdd_Semiring(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_eWiseMult_BinaryOp(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp mult, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_eWiseMult_Monoid(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_eWiseMult_Semiring(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_error(const char **error, const GrB_Vector v); -extern GrB_Info GrB_Vector_extract(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_extractElement_BOOL(bool *x, const GrB_Vector v, GrB_Index i); -extern GrB_Info GrB_Vector_extractElement_FP32(float *x, const GrB_Vector v, GrB_Index i); -extern GrB_Info GrB_Vector_extractElement_FP64(double *x, const GrB_Vector v, GrB_Index i); -extern GrB_Info GrB_Vector_extractElement_INT8(int8_t *x, const GrB_Vector v, GrB_Index i); -extern GrB_Info GrB_Vector_extractElement_INT16(int16_t *x, const GrB_Vector v, GrB_Index i); -extern GrB_Info GrB_Vector_extractElement_INT32(int32_t *x, const GrB_Vector v, GrB_Index i); -extern GrB_Info GrB_Vector_extractElement_INT64(int64_t *x, const GrB_Vector v, GrB_Index i); -extern GrB_Info GrB_Vector_extractElement_Scalar(GrB_Scalar x, const GrB_Vector v, GrB_Index i); -extern GrB_Info GrB_Vector_extractElement_UDT(void *x, const GrB_Vector v, GrB_Index i); -extern GrB_Info GrB_Vector_extractElement_UINT8(uint8_t *x, const GrB_Vector v, GrB_Index i); -extern GrB_Info GrB_Vector_extractElement_UINT16(uint16_t *x, const GrB_Vector v, GrB_Index i); -extern GrB_Info GrB_Vector_extractElement_UINT32(uint32_t *x, const GrB_Vector v, GrB_Index i); -extern GrB_Info GrB_Vector_extractElement_UINT64(uint64_t *x, const GrB_Vector v, GrB_Index i); -extern GrB_Info GrB_Vector_extractTuples_BOOL(GrB_Index *I, bool *X, GrB_Index *nvals, const GrB_Vector v); -extern GrB_Info GrB_Vector_extractTuples_FP32(GrB_Index *I, float *X, GrB_Index *nvals, const GrB_Vector v); -extern GrB_Info GrB_Vector_extractTuples_FP64(GrB_Index *I, double *X, GrB_Index *nvals, const GrB_Vector v); -extern GrB_Info GrB_Vector_extractTuples_INT8(GrB_Index *I, int8_t *X, GrB_Index *nvals, const GrB_Vector v); -extern GrB_Info GrB_Vector_extractTuples_INT16(GrB_Index *I, int16_t *X, GrB_Index *nvals, const GrB_Vector v); -extern GrB_Info GrB_Vector_extractTuples_INT32(GrB_Index *I, int32_t *X, GrB_Index *nvals, const GrB_Vector v); -extern GrB_Info GrB_Vector_extractTuples_INT64(GrB_Index *I, int64_t *X, GrB_Index *nvals, const GrB_Vector v); -extern GrB_Info GrB_Vector_extractTuples_UDT(GrB_Index *I, void *X, GrB_Index *nvals, const GrB_Vector v); -extern GrB_Info GrB_Vector_extractTuples_UINT8(GrB_Index *I, uint8_t *X, GrB_Index *nvals, const GrB_Vector v); -extern GrB_Info GrB_Vector_extractTuples_UINT16(GrB_Index *I, uint16_t *X, GrB_Index *nvals, const GrB_Vector v); -extern GrB_Info GrB_Vector_extractTuples_UINT32(GrB_Index *I, uint32_t *X, GrB_Index *nvals, const GrB_Vector v); -extern GrB_Info GrB_Vector_extractTuples_UINT64(GrB_Index *I, uint64_t *X, GrB_Index *nvals, const GrB_Vector v); -extern GrB_Info GrB_Vector_free(GrB_Vector *v); -extern GrB_Info GrB_Vector_new(GrB_Vector *v, GrB_Type type, GrB_Index n); -extern GrB_Info GrB_Vector_nvals(GrB_Index *nvals, const GrB_Vector v); -extern GrB_Info GrB_Vector_reduce_BOOL(bool *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_reduce_BinaryOp_Scalar(GrB_Scalar c, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_reduce_FP32(float *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_reduce_FP64(double *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_reduce_INT8(int8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_reduce_INT16(int16_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_reduce_INT32(int32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_reduce_INT64(int64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_reduce_Monoid_Scalar(GrB_Scalar c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_reduce_UDT(void *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_reduce_UINT8(uint8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_reduce_UINT16(uint16_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_reduce_UINT32(uint32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_reduce_UINT64(uint64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_removeElement(GrB_Vector v, GrB_Index i); -extern GrB_Info GrB_Vector_resize(GrB_Vector w, GrB_Index nrows_new); -extern GrB_Info GrB_Vector_select_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, bool y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, float y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, double y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int8_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int16_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int32_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int64_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const GrB_Scalar y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const void *y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint8_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint16_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint32_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_select_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint64_t y, const GrB_Descriptor desc); -extern GrB_Info GrB_Vector_setElement_BOOL(GrB_Vector w, bool x, GrB_Index i); -extern GrB_Info GrB_Vector_setElement_FP32(GrB_Vector w, float x, GrB_Index i); -extern GrB_Info GrB_Vector_setElement_FP64(GrB_Vector w, double x, GrB_Index i); -extern GrB_Info GrB_Vector_setElement_INT8(GrB_Vector w, int8_t x, GrB_Index i); -extern GrB_Info GrB_Vector_setElement_INT16(GrB_Vector w, int16_t x, GrB_Index i); -extern GrB_Info GrB_Vector_setElement_INT32(GrB_Vector w, int32_t x, GrB_Index i); -extern GrB_Info GrB_Vector_setElement_INT64(GrB_Vector w, int64_t x, GrB_Index i); -extern GrB_Info GrB_Vector_setElement_Scalar(GrB_Vector w, GrB_Scalar x, GrB_Index i); -extern GrB_Info GrB_Vector_setElement_UDT(GrB_Vector w, void *x, GrB_Index i); -extern GrB_Info GrB_Vector_setElement_UINT8(GrB_Vector w, uint8_t x, GrB_Index i); -extern GrB_Info GrB_Vector_setElement_UINT16(GrB_Vector w, uint16_t x, GrB_Index i); -extern GrB_Info GrB_Vector_setElement_UINT32(GrB_Vector w, uint32_t x, GrB_Index i); -extern GrB_Info GrB_Vector_setElement_UINT64(GrB_Vector w, uint64_t x, GrB_Index i); -extern GrB_Info GrB_Vector_size(GrB_Index *n, const GrB_Vector v); -extern GrB_Info GrB_Vector_wait(GrB_Vector v, GrB_WaitMode waitmode); +GrB_Info GrB_Vector_apply(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_UnaryOp op, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp1st_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, bool x, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp1st_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, float x, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp1st_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, double x, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp1st_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int8_t x, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp1st_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int16_t x, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp1st_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int32_t x, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp1st_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int64_t x, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp1st_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp1st_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const void *x, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp1st_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint8_t x, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp1st_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint16_t x, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp1st_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint32_t x, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp1st_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint64_t x, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp2nd_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, bool y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp2nd_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, float y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp2nd_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, double y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp2nd_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, int8_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp2nd_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, int16_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp2nd_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, int32_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp2nd_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, int64_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp2nd_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const GrB_Scalar y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp2nd_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const void *y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, uint8_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, uint16_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, uint32_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, uint64_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_IndexOp_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, bool y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_IndexOp_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, float y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_IndexOp_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, double y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_IndexOp_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int8_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_IndexOp_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int16_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_IndexOp_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int32_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_IndexOp_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int64_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_IndexOp_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const GrB_Scalar y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_IndexOp_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const void *y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_IndexOp_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint8_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_IndexOp_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint16_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_IndexOp_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint32_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_apply_IndexOp_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint64_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, double x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_build_BOOL(GrB_Vector w, const GrB_Index *I, const bool *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_FP32(GrB_Vector w, const GrB_Index *I, const float *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_FP64(GrB_Vector w, const GrB_Index *I, const double *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_INT8(GrB_Vector w, const GrB_Index *I, const int8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_INT16(GrB_Vector w, const GrB_Index *I, const int16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_INT32(GrB_Vector w, const GrB_Index *I, const int32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_INT64(GrB_Vector w, const GrB_Index *I, const int64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_UDT(GrB_Vector w, const GrB_Index *I, const void *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_UINT8(GrB_Vector w, const GrB_Index *I, const uint8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_UINT16(GrB_Vector w, const GrB_Index *I, const uint16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_UINT32(GrB_Vector w, const GrB_Index *I, const uint32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_UINT64(GrB_Vector w, const GrB_Index *I, const uint64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_clear(GrB_Vector v); +GrB_Info GrB_Vector_dup(GrB_Vector *w, const GrB_Vector u); +GrB_Info GrB_Vector_eWiseAdd_BinaryOp(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); +GrB_Info GrB_Vector_eWiseAdd_Monoid(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); +GrB_Info GrB_Vector_eWiseAdd_Semiring(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); +GrB_Info GrB_Vector_eWiseMult_BinaryOp(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp mult, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); +GrB_Info GrB_Vector_eWiseMult_Monoid(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); +GrB_Info GrB_Vector_eWiseMult_Semiring(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); +GrB_Info GrB_Vector_error(const char **error, const GrB_Vector v); +GrB_Info GrB_Vector_extract(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_extractElement_BOOL(bool *x, const GrB_Vector v, GrB_Index i); +GrB_Info GrB_Vector_extractElement_FP32(float *x, const GrB_Vector v, GrB_Index i); +GrB_Info GrB_Vector_extractElement_FP64(double *x, const GrB_Vector v, GrB_Index i); +GrB_Info GrB_Vector_extractElement_INT8(int8_t *x, const GrB_Vector v, GrB_Index i); +GrB_Info GrB_Vector_extractElement_INT16(int16_t *x, const GrB_Vector v, GrB_Index i); +GrB_Info GrB_Vector_extractElement_INT32(int32_t *x, const GrB_Vector v, GrB_Index i); +GrB_Info GrB_Vector_extractElement_INT64(int64_t *x, const GrB_Vector v, GrB_Index i); +GrB_Info GrB_Vector_extractElement_Scalar(GrB_Scalar x, const GrB_Vector v, GrB_Index i); +GrB_Info GrB_Vector_extractElement_UDT(void *x, const GrB_Vector v, GrB_Index i); +GrB_Info GrB_Vector_extractElement_UINT8(uint8_t *x, const GrB_Vector v, GrB_Index i); +GrB_Info GrB_Vector_extractElement_UINT16(uint16_t *x, const GrB_Vector v, GrB_Index i); +GrB_Info GrB_Vector_extractElement_UINT32(uint32_t *x, const GrB_Vector v, GrB_Index i); +GrB_Info GrB_Vector_extractElement_UINT64(uint64_t *x, const GrB_Vector v, GrB_Index i); +GrB_Info GrB_Vector_extractTuples_BOOL(GrB_Index *I, bool *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_FP32(GrB_Index *I, float *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_FP64(GrB_Index *I, double *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_INT8(GrB_Index *I, int8_t *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_INT16(GrB_Index *I, int16_t *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_INT32(GrB_Index *I, int32_t *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_INT64(GrB_Index *I, int64_t *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_UDT(GrB_Index *I, void *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_UINT8(GrB_Index *I, uint8_t *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_UINT16(GrB_Index *I, uint16_t *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_UINT32(GrB_Index *I, uint32_t *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_UINT64(GrB_Index *I, uint64_t *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_free(GrB_Vector *v); +GrB_Info GrB_Vector_new(GrB_Vector *v, GrB_Type type, GrB_Index n); +GrB_Info GrB_Vector_nvals(GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_reduce_BOOL(bool *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_reduce_BinaryOp_Scalar(GrB_Scalar c, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_reduce_FP32(float *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_reduce_FP64(double *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_reduce_INT8(int8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_reduce_INT16(int16_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_reduce_INT32(int32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_reduce_INT64(int64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_reduce_Monoid_Scalar(GrB_Scalar c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_reduce_UDT(void *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_reduce_UINT8(uint8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_reduce_UINT16(uint16_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_reduce_UINT32(uint32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_reduce_UINT64(uint64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_removeElement(GrB_Vector v, GrB_Index i); +GrB_Info GrB_Vector_resize(GrB_Vector w, GrB_Index nrows_new); +GrB_Info GrB_Vector_select_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, bool y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_select_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, float y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_select_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, double y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_select_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int8_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_select_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int16_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_select_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int32_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_select_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int64_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_select_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const GrB_Scalar y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_select_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const void *y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_select_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint8_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_select_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint16_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_select_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint32_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_select_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint64_t y, const GrB_Descriptor desc); +GrB_Info GrB_Vector_setElement_BOOL(GrB_Vector w, bool x, GrB_Index i); +GrB_Info GrB_Vector_setElement_FP32(GrB_Vector w, float x, GrB_Index i); +GrB_Info GrB_Vector_setElement_FP64(GrB_Vector w, double x, GrB_Index i); +GrB_Info GrB_Vector_setElement_INT8(GrB_Vector w, int8_t x, GrB_Index i); +GrB_Info GrB_Vector_setElement_INT16(GrB_Vector w, int16_t x, GrB_Index i); +GrB_Info GrB_Vector_setElement_INT32(GrB_Vector w, int32_t x, GrB_Index i); +GrB_Info GrB_Vector_setElement_INT64(GrB_Vector w, int64_t x, GrB_Index i); +GrB_Info GrB_Vector_setElement_Scalar(GrB_Vector w, GrB_Scalar x, GrB_Index i); +GrB_Info GrB_Vector_setElement_UDT(GrB_Vector w, void *x, GrB_Index i); +GrB_Info GrB_Vector_setElement_UINT8(GrB_Vector w, uint8_t x, GrB_Index i); +GrB_Info GrB_Vector_setElement_UINT16(GrB_Vector w, uint16_t x, GrB_Index i); +GrB_Info GrB_Vector_setElement_UINT32(GrB_Vector w, uint32_t x, GrB_Index i); +GrB_Info GrB_Vector_setElement_UINT64(GrB_Vector w, uint64_t x, GrB_Index i); +GrB_Info GrB_Vector_size(GrB_Index *n, const GrB_Vector v); +GrB_Info GrB_Vector_wait(GrB_Vector v, GrB_WaitMode waitmode); /*************** * GB functions * ***************/ /* binary */ -extern GrB_Info GB_BinaryOp_new(GrB_BinaryOp *binaryop, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *binop_name); +GrB_Info GB_BinaryOp_new(GrB_BinaryOp *binaryop, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *binop_name); /* iterator */ -extern GrB_Info GB_Iterator_rc_bitmap_next(GxB_Iterator iterator); -extern GrB_Info GB_Iterator_rc_seek(GxB_Iterator iterator, GrB_Index j, bool jth_vector); -extern GrB_Info GB_Vector_Iterator_bitmap_seek(GxB_Iterator iterator, GrB_Index unused); +GrB_Info GB_Iterator_rc_bitmap_next(GxB_Iterator iterator); +GrB_Info GB_Iterator_rc_seek(GxB_Iterator iterator, GrB_Index j, bool jth_vector); +GrB_Info GB_Vector_Iterator_bitmap_seek(GxB_Iterator iterator, GrB_Index unused); /* matrix */ -extern GrB_Info GB_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GxB_Format_Value format, GrB_Descriptor desc); +GrB_Info GB_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GxB_Format_Value format, GrB_Descriptor desc); /* selectop */ -extern GrB_Info GB_SelectOp_new(GxB_SelectOp *selectop, GxB_select_function function, GrB_Type xtype, GrB_Type ttype, const char *name); +GrB_Info GB_SelectOp_new(GxB_SelectOp *selectop, GxB_select_function function, GrB_Type xtype, GrB_Type ttype, const char *name); /* type */ -extern GrB_Info GB_Type_new(GrB_Type *type, size_t sizeof_ctype, const char *type_name); +GrB_Info GB_Type_new(GrB_Type *type, size_t sizeof_ctype, const char *type_name); /* unary */ -extern GrB_Info GB_UnaryOp_new(GrB_UnaryOp *unaryop, GxB_unary_function function, GrB_Type ztype, GrB_Type xtype, const char *unop_name); +GrB_Info GB_UnaryOp_new(GrB_UnaryOp *unaryop, GxB_unary_function function, GrB_Type ztype, GrB_Type xtype, const char *unop_name); /**************** * GxB functions * ****************/ /* binary */ -extern GrB_Info GxB_BinaryOp_fprint(GrB_BinaryOp binaryop, const char *name, GxB_Print_Level pr, FILE *f); -extern GrB_Info GxB_BinaryOp_new(GrB_BinaryOp *op, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *binop_name, const char *binop_defn); -extern GrB_Info GxB_BinaryOp_xtype(GrB_Type *xtype, GrB_BinaryOp binaryop); -extern GrB_Info GxB_BinaryOp_xtype_name(char *type_name, const GrB_BinaryOp binaryop); -extern GrB_Info GxB_BinaryOp_ytype(GrB_Type *ytype, GrB_BinaryOp binaryop); -extern GrB_Info GxB_BinaryOp_ytype_name(char *type_name, const GrB_BinaryOp binaryop); -extern GrB_Info GxB_BinaryOp_ztype(GrB_Type *ztype, GrB_BinaryOp binaryop); -extern GrB_Info GxB_BinaryOp_ztype_name(char *type_name, const GrB_BinaryOp binaryop); +GrB_Info GxB_BinaryOp_fprint(GrB_BinaryOp binaryop, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_BinaryOp_new(GrB_BinaryOp *op, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *binop_name, const char *binop_defn); +GrB_Info GxB_BinaryOp_xtype(GrB_Type *xtype, GrB_BinaryOp binaryop); +GrB_Info GxB_BinaryOp_xtype_name(char *type_name, const GrB_BinaryOp binaryop); +GrB_Info GxB_BinaryOp_ytype(GrB_Type *ytype, GrB_BinaryOp binaryop); +GrB_Info GxB_BinaryOp_ytype_name(char *type_name, const GrB_BinaryOp binaryop); +GrB_Info GxB_BinaryOp_ztype(GrB_Type *ztype, GrB_BinaryOp binaryop); +GrB_Info GxB_BinaryOp_ztype_name(char *type_name, const GrB_BinaryOp binaryop); /* core */ -extern GrB_Info GxB_Global_Option_get(GxB_Option_Field field, ...); -extern GrB_Info GxB_Global_Option_get_CHAR(GxB_Option_Field field, char **value); -extern GrB_Info GxB_Global_Option_get_FP64(GxB_Option_Field field, double *value); -extern GrB_Info GxB_Global_Option_get_FUNCTION(GxB_Option_Field field, void **value); -extern GrB_Info GxB_Global_Option_get_INT32(GxB_Option_Field field, int32_t *value); -extern GrB_Info GxB_Global_Option_get_INT64(GxB_Option_Field field, int64_t *value); -extern GrB_Info GxB_Global_Option_set(GxB_Option_Field field, ...); -extern GrB_Info GxB_Global_Option_set_FP64(GxB_Option_Field field, double value); -extern GrB_Info GxB_Global_Option_set_FP64_ARRAY(GxB_Option_Field field, double *value); -extern GrB_Info GxB_Global_Option_set_FUNCTION(GxB_Option_Field field, void *value); -extern GrB_Info GxB_Global_Option_set_INT32(GxB_Option_Field field, int32_t value); -extern GrB_Info GxB_Global_Option_set_INT64_ARRAY(GxB_Option_Field field, int64_t *value); -extern GrB_Info GxB_deserialize_type_name(char *type_name, const void *blob, GrB_Index blob_size); -extern GrB_Info GxB_init(GrB_Mode mode, void *(*user_malloc_function)(size_t), void *(*user_calloc_function)(size_t, size_t), void *(*user_realloc_function)(void *, size_t), void (*user_free_function)(void *)); +GrB_Info GxB_Global_Option_get(GxB_Option_Field field, ...); +GrB_Info GxB_Global_Option_get_CHAR(GxB_Option_Field field, char **value); +GrB_Info GxB_Global_Option_get_FP64(GxB_Option_Field field, double *value); +GrB_Info GxB_Global_Option_get_FUNCTION(GxB_Option_Field field, void **value); +GrB_Info GxB_Global_Option_get_INT32(GxB_Option_Field field, int32_t *value); +GrB_Info GxB_Global_Option_get_INT64(GxB_Option_Field field, int64_t *value); +GrB_Info GxB_Global_Option_set(GxB_Option_Field field, ...); +GrB_Info GxB_Global_Option_set_FP64(GxB_Option_Field field, double value); +GrB_Info GxB_Global_Option_set_FP64_ARRAY(GxB_Option_Field field, double *value); +GrB_Info GxB_Global_Option_set_FUNCTION(GxB_Option_Field field, void *value); +GrB_Info GxB_Global_Option_set_INT32(GxB_Option_Field field, int32_t value); +GrB_Info GxB_Global_Option_set_INT64_ARRAY(GxB_Option_Field field, int64_t *value); +GrB_Info GxB_deserialize_type_name(char *type_name, const void *blob, GrB_Index blob_size); +GrB_Info GxB_init(GrB_Mode mode, void *(*user_malloc_function)(size_t), void *(*user_calloc_function)(size_t, size_t), void *(*user_realloc_function)(void *, size_t), void (*user_free_function)(void *)); /* descriptor */ -extern GrB_Info GxB_Desc_get(GrB_Descriptor desc, GrB_Desc_Field field, ...); -extern GrB_Info GxB_Desc_get_FP64(GrB_Descriptor desc, GrB_Desc_Field field, double *value); -extern GrB_Info GxB_Desc_get_INT32(GrB_Descriptor desc, GrB_Desc_Field field, int32_t *value); -extern GrB_Info GxB_Desc_set(GrB_Descriptor desc, GrB_Desc_Field field, ...); -extern GrB_Info GxB_Desc_set_FP64(GrB_Descriptor desc, GrB_Desc_Field field, double value); -extern GrB_Info GxB_Desc_set_INT32(GrB_Descriptor desc, GrB_Desc_Field field, int32_t value); -extern GrB_Info GxB_Descriptor_fprint(GrB_Descriptor descriptor, const char *name, GxB_Print_Level pr, FILE *f); -extern GrB_Info GxB_Descriptor_get(GrB_Desc_Value *val, GrB_Descriptor desc, GrB_Desc_Field field); +GrB_Info GxB_Desc_get(GrB_Descriptor desc, GrB_Desc_Field field, ...); +GrB_Info GxB_Desc_get_FP64(GrB_Descriptor desc, GrB_Desc_Field field, double *value); +GrB_Info GxB_Desc_get_INT32(GrB_Descriptor desc, GrB_Desc_Field field, int32_t *value); +GrB_Info GxB_Desc_set(GrB_Descriptor desc, GrB_Desc_Field field, ...); +GrB_Info GxB_Desc_set_FP64(GrB_Descriptor desc, GrB_Desc_Field field, double value); +GrB_Info GxB_Desc_set_INT32(GrB_Descriptor desc, GrB_Desc_Field field, int32_t value); +GrB_Info GxB_Descriptor_fprint(GrB_Descriptor descriptor, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_Descriptor_get(GrB_Desc_Value *val, GrB_Descriptor desc, GrB_Desc_Field field); /* indexunary */ -extern GrB_Info GxB_IndexUnaryOp_fprint(GrB_IndexUnaryOp op, const char *name, GxB_Print_Level pr, FILE *f); -extern GrB_Info GxB_IndexUnaryOp_new(GrB_IndexUnaryOp *op, GxB_index_unary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *idxop_name, const char *idxop_defn); -extern GrB_Info GxB_IndexUnaryOp_xtype_name(char *type_name, const GrB_IndexUnaryOp op); -extern GrB_Info GxB_IndexUnaryOp_ytype_name(char *type_name, const GrB_IndexUnaryOp op); -extern GrB_Info GxB_IndexUnaryOp_ztype_name(char *type_name, const GrB_IndexUnaryOp op); +GrB_Info GxB_IndexUnaryOp_fprint(GrB_IndexUnaryOp op, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_IndexUnaryOp_new(GrB_IndexUnaryOp *op, GxB_index_unary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *idxop_name, const char *idxop_defn); +GrB_Info GxB_IndexUnaryOp_xtype_name(char *type_name, const GrB_IndexUnaryOp op); +GrB_Info GxB_IndexUnaryOp_ytype_name(char *type_name, const GrB_IndexUnaryOp op); +GrB_Info GxB_IndexUnaryOp_ztype_name(char *type_name, const GrB_IndexUnaryOp op); /* iterator */ -extern GrB_Index GxB_Matrix_Iterator_getp(GxB_Iterator iterator); -extern GrB_Index GxB_Matrix_Iterator_getpmax(GxB_Iterator iterator); -extern GrB_Index GxB_Vector_Iterator_getIndex(GxB_Iterator iterator); -extern GrB_Index GxB_Vector_Iterator_getp(GxB_Iterator iterator); -extern GrB_Index GxB_Vector_Iterator_getpmax(GxB_Iterator iterator); -extern GrB_Index GxB_colIterator_getColIndex(GxB_Iterator iterator); -extern GrB_Index GxB_colIterator_getRowIndex(GxB_Iterator iterator); -extern GrB_Index GxB_colIterator_kount(GxB_Iterator iterator); -extern GrB_Index GxB_rowIterator_getColIndex(GxB_Iterator iterator); -extern GrB_Index GxB_rowIterator_getRowIndex(GxB_Iterator iterator); -extern GrB_Index GxB_rowIterator_kount(GxB_Iterator iterator); -extern GrB_Info GxB_Iterator_free(GxB_Iterator *iterator); -extern GrB_Info GxB_Iterator_new(GxB_Iterator *iterator); -extern GrB_Info GxB_Matrix_Iterator_next(GxB_Iterator iterator); -extern GrB_Info GxB_Matrix_Iterator_seek(GxB_Iterator iterator, GrB_Index p); -extern GrB_Info GxB_Vector_Iterator_next(GxB_Iterator iterator); -extern GrB_Info GxB_Vector_Iterator_seek(GxB_Iterator iterator, GrB_Index p); -extern GrB_Info GxB_colIterator_kseek(GxB_Iterator iterator, GrB_Index k); -extern GrB_Info GxB_colIterator_nextCol(GxB_Iterator iterator); -extern GrB_Info GxB_colIterator_nextRow(GxB_Iterator iterator); -extern GrB_Info GxB_colIterator_seekCol(GxB_Iterator iterator, GrB_Index col); -extern GrB_Info GxB_rowIterator_kseek(GxB_Iterator iterator, GrB_Index k); -extern GrB_Info GxB_rowIterator_nextCol(GxB_Iterator iterator); -extern GrB_Info GxB_rowIterator_nextRow(GxB_Iterator iterator); -extern GrB_Info GxB_rowIterator_seekRow(GxB_Iterator iterator, GrB_Index row); -extern bool GxB_Iterator_get_BOOL(GxB_Iterator iterator); -extern double GxB_Iterator_get_FP64(GxB_Iterator iterator); -extern float GxB_Iterator_get_FP32(GxB_Iterator iterator); -extern int8_t GxB_Iterator_get_INT8(GxB_Iterator iterator); -extern int16_t GxB_Iterator_get_INT16(GxB_Iterator iterator); -extern int32_t GxB_Iterator_get_INT32(GxB_Iterator iterator); -extern int64_t GxB_Iterator_get_INT64(GxB_Iterator iterator); -extern uint8_t GxB_Iterator_get_UINT8(GxB_Iterator iterator); -extern uint16_t GxB_Iterator_get_UINT16(GxB_Iterator iterator); -extern uint32_t GxB_Iterator_get_UINT32(GxB_Iterator iterator); -extern uint64_t GxB_Iterator_get_UINT64(GxB_Iterator iterator); -extern void GxB_Iterator_get_UDT(GxB_Iterator iterator, void *value); -extern void GxB_Matrix_Iterator_getIndex(GxB_Iterator iterator, GrB_Index *row, GrB_Index *col); +GrB_Index GxB_Matrix_Iterator_getp(GxB_Iterator iterator); +GrB_Index GxB_Matrix_Iterator_getpmax(GxB_Iterator iterator); +GrB_Index GxB_Vector_Iterator_getIndex(GxB_Iterator iterator); +GrB_Index GxB_Vector_Iterator_getp(GxB_Iterator iterator); +GrB_Index GxB_Vector_Iterator_getpmax(GxB_Iterator iterator); +GrB_Index GxB_colIterator_getColIndex(GxB_Iterator iterator); +GrB_Index GxB_colIterator_getRowIndex(GxB_Iterator iterator); +GrB_Index GxB_colIterator_kount(GxB_Iterator iterator); +GrB_Index GxB_rowIterator_getColIndex(GxB_Iterator iterator); +GrB_Index GxB_rowIterator_getRowIndex(GxB_Iterator iterator); +GrB_Index GxB_rowIterator_kount(GxB_Iterator iterator); +GrB_Info GxB_Iterator_free(GxB_Iterator *iterator); +GrB_Info GxB_Iterator_new(GxB_Iterator *iterator); +GrB_Info GxB_Matrix_Iterator_next(GxB_Iterator iterator); +GrB_Info GxB_Matrix_Iterator_seek(GxB_Iterator iterator, GrB_Index p); +GrB_Info GxB_Vector_Iterator_next(GxB_Iterator iterator); +GrB_Info GxB_Vector_Iterator_seek(GxB_Iterator iterator, GrB_Index p); +GrB_Info GxB_colIterator_kseek(GxB_Iterator iterator, GrB_Index k); +GrB_Info GxB_colIterator_nextCol(GxB_Iterator iterator); +GrB_Info GxB_colIterator_nextRow(GxB_Iterator iterator); +GrB_Info GxB_colIterator_seekCol(GxB_Iterator iterator, GrB_Index col); +GrB_Info GxB_rowIterator_kseek(GxB_Iterator iterator, GrB_Index k); +GrB_Info GxB_rowIterator_nextCol(GxB_Iterator iterator); +GrB_Info GxB_rowIterator_nextRow(GxB_Iterator iterator); +GrB_Info GxB_rowIterator_seekRow(GxB_Iterator iterator, GrB_Index row); +bool GxB_Iterator_get_BOOL(GxB_Iterator iterator); +double GxB_Iterator_get_FP64(GxB_Iterator iterator); +float GxB_Iterator_get_FP32(GxB_Iterator iterator); +int8_t GxB_Iterator_get_INT8(GxB_Iterator iterator); +int16_t GxB_Iterator_get_INT16(GxB_Iterator iterator); +int32_t GxB_Iterator_get_INT32(GxB_Iterator iterator); +int64_t GxB_Iterator_get_INT64(GxB_Iterator iterator); +uint8_t GxB_Iterator_get_UINT8(GxB_Iterator iterator); +uint16_t GxB_Iterator_get_UINT16(GxB_Iterator iterator); +uint32_t GxB_Iterator_get_UINT32(GxB_Iterator iterator); +uint64_t GxB_Iterator_get_UINT64(GxB_Iterator iterator); +void GxB_Iterator_get_UDT(GxB_Iterator iterator, void *value); +void GxB_Matrix_Iterator_getIndex(GxB_Iterator iterator, GrB_Index *row, GrB_Index *col); /* matrix */ -extern GrB_Info GxB_Col_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_Option_get(GrB_Matrix A, GxB_Option_Field field, ...); -extern GrB_Info GxB_Matrix_Option_get_FP64(GrB_Matrix A, GxB_Option_Field field, double *value); -extern GrB_Info GxB_Matrix_Option_get_INT32(GrB_Matrix A, GxB_Option_Field field, int32_t *value); -extern GrB_Info GxB_Matrix_Option_set(GrB_Matrix A, GxB_Option_Field field, ...); -extern GrB_Info GxB_Matrix_Option_set_FP64(GrB_Matrix A, GxB_Option_Field field, double value); -extern GrB_Info GxB_Matrix_Option_set_INT32(GrB_Matrix A, GxB_Option_Field field, int32_t value); -extern GrB_Info GxB_Matrix_apply_BinaryOp1st(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_apply_BinaryOp2nd(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Scalar y, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_build_Scalar(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, GrB_Scalar scalar, GrB_Index nvals); -extern GrB_Info GxB_Matrix_concat(GrB_Matrix C, const GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_deserialize(GrB_Matrix *C, GrB_Type type, const void *blob, GrB_Index blob_size, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_diag(GrB_Matrix C, const GrB_Vector v, int64_t k, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_eWiseUnion(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Matrix A, const GrB_Scalar alpha, const GrB_Matrix B, const GrB_Scalar beta, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_BitmapC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_BitmapR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_CSC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_CSR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_FullC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_FullR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_HyperCSC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_export_HyperCSR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_fprint(GrB_Matrix A, const char *name, GxB_Print_Level pr, FILE *f); -extern GrB_Info GxB_Matrix_import_BitmapC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_BitmapR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_CSC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_CSR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_FullC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_FullR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_HyperCSC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_import_HyperCSR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_isStoredElement(const GrB_Matrix A, GrB_Index i, GrB_Index j); -extern GrB_Info GxB_Matrix_iso(bool *iso, const GrB_Matrix A); -extern GrB_Info GxB_Matrix_memoryUsage(size_t *size, const GrB_Matrix A); -extern GrB_Info GxB_Matrix_pack_BitmapC(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_pack_BitmapR(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_pack_CSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_pack_CSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_pack_FullC(GrB_Matrix A, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_pack_FullR(GrB_Matrix A, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_pack_HyperCSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_pack_HyperCSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_reshape(GrB_Matrix C, bool by_col, GrB_Index nrows_new, GrB_Index ncols_new, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_reshapeDup(GrB_Matrix *C, GrB_Matrix A, bool by_col, GrB_Index nrows_new, GrB_Index ncols_new, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_select(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Matrix A, const GrB_Scalar Thunk, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_serialize(void **blob_handle, GrB_Index *blob_size_handle, GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_sort(GrB_Matrix C, GrB_Matrix P, GrB_BinaryOp op, GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_split(GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Index *Tile_nrows, const GrB_Index *Tile_ncols, const GrB_Matrix A, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_subassign(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_subassign_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_subassign_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_subassign_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, double x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_subassign_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_subassign_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_subassign_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_subassign_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_subassign_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_subassign_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_subassign_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_subassign_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_subassign_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_subassign_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_type(GrB_Type *type, const GrB_Matrix A); -extern GrB_Info GxB_Matrix_type_name(char *type_name, const GrB_Matrix A); -extern GrB_Info GxB_Matrix_unpack_BitmapC(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_unpack_BitmapR(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_unpack_CSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_unpack_CSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_unpack_FullC(GrB_Matrix A, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_unpack_FullR(GrB_Matrix A, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_unpack_HyperCSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Matrix_unpack_HyperCSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Row_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, GrB_Index i, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_diag(GrB_Vector v, const GrB_Matrix A, int64_t k, const GrB_Descriptor desc); -extern GrB_Info GxB_colIterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); -extern GrB_Info GxB_pack_HyperHash(GrB_Matrix A, GrB_Matrix *Y, const GrB_Descriptor desc); -extern GrB_Info GxB_rowIterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); -extern GrB_Info GxB_unpack_HyperHash(GrB_Matrix A, GrB_Matrix *Y, const GrB_Descriptor desc); +GrB_Info GxB_Col_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); +GrB_Info GxB_Matrix_Option_get(GrB_Matrix A, GxB_Option_Field field, ...); +GrB_Info GxB_Matrix_Option_get_FP64(GrB_Matrix A, GxB_Option_Field field, double *value); +GrB_Info GxB_Matrix_Option_get_INT32(GrB_Matrix A, GxB_Option_Field field, int32_t *value); +GrB_Info GxB_Matrix_Option_set(GrB_Matrix A, GxB_Option_Field field, ...); +GrB_Info GxB_Matrix_Option_set_FP64(GrB_Matrix A, GxB_Option_Field field, double value); +GrB_Info GxB_Matrix_Option_set_INT32(GrB_Matrix A, GxB_Option_Field field, int32_t value); +GrB_Info GxB_Matrix_apply_BinaryOp1st(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_apply_BinaryOp2nd(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Scalar y, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_build_Scalar(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, GrB_Scalar scalar, GrB_Index nvals); +GrB_Info GxB_Matrix_concat(GrB_Matrix C, const GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_deserialize(GrB_Matrix *C, GrB_Type type, const void *blob, GrB_Index blob_size, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_diag(GrB_Matrix C, const GrB_Vector v, int64_t k, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_eWiseUnion(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Matrix A, const GrB_Scalar alpha, const GrB_Matrix B, const GrB_Scalar beta, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_export_BitmapC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_export_BitmapR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_export_CSC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_export_CSR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_export_FullC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_export_FullR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_export_HyperCSC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_export_HyperCSR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_fprint(GrB_Matrix A, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_Matrix_import_BitmapC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_import_BitmapR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_import_CSC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_import_CSR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_import_FullC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_import_FullR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_import_HyperCSC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_import_HyperCSR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_isStoredElement(const GrB_Matrix A, GrB_Index i, GrB_Index j); +GrB_Info GxB_Matrix_iso(bool *iso, const GrB_Matrix A); +GrB_Info GxB_Matrix_memoryUsage(size_t *size, const GrB_Matrix A); +GrB_Info GxB_Matrix_pack_BitmapC(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_pack_BitmapR(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_pack_CSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_pack_CSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_pack_FullC(GrB_Matrix A, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_pack_FullR(GrB_Matrix A, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_pack_HyperCSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_pack_HyperCSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_reshape(GrB_Matrix C, bool by_col, GrB_Index nrows_new, GrB_Index ncols_new, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_reshapeDup(GrB_Matrix *C, GrB_Matrix A, bool by_col, GrB_Index nrows_new, GrB_Index ncols_new, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_select(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Matrix A, const GrB_Scalar Thunk, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_serialize(void **blob_handle, GrB_Index *blob_size_handle, GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_sort(GrB_Matrix C, GrB_Matrix P, GrB_BinaryOp op, GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_split(GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Index *Tile_nrows, const GrB_Index *Tile_ncols, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, double x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_type(GrB_Type *type, const GrB_Matrix A); +GrB_Info GxB_Matrix_type_name(char *type_name, const GrB_Matrix A); +GrB_Info GxB_Matrix_unpack_BitmapC(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_unpack_BitmapR(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_unpack_CSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_unpack_CSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_unpack_FullC(GrB_Matrix A, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_unpack_FullR(GrB_Matrix A, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_unpack_HyperCSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_unpack_HyperCSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Row_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, GrB_Index i, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Vector_diag(GrB_Vector v, const GrB_Matrix A, int64_t k, const GrB_Descriptor desc); +GrB_Info GxB_colIterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); +GrB_Info GxB_pack_HyperHash(GrB_Matrix A, GrB_Matrix *Y, const GrB_Descriptor desc); +GrB_Info GxB_rowIterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); +GrB_Info GxB_unpack_HyperHash(GrB_Matrix A, GrB_Matrix *Y, const GrB_Descriptor desc); /* monoid */ -extern GrB_Info GxB_Monoid_fprint(GrB_Monoid monoid, const char *name, GxB_Print_Level pr, FILE *f); -extern GrB_Info GxB_Monoid_identity(void *identity, GrB_Monoid monoid); -extern GrB_Info GxB_Monoid_operator(GrB_BinaryOp *op, GrB_Monoid monoid); -extern GrB_Info GxB_Monoid_terminal(bool *has_terminal, void *terminal, GrB_Monoid monoid); -extern GrB_Info GxB_Monoid_terminal_new_BOOL(GrB_Monoid *monoid, GrB_BinaryOp op, bool identity, bool terminal); -extern GrB_Info GxB_Monoid_terminal_new_FP32(GrB_Monoid *monoid, GrB_BinaryOp op, float identity, float terminal); -extern GrB_Info GxB_Monoid_terminal_new_FP64(GrB_Monoid *monoid, GrB_BinaryOp op, double identity, double terminal); -extern GrB_Info GxB_Monoid_terminal_new_INT8(GrB_Monoid *monoid, GrB_BinaryOp op, int8_t identity, int8_t terminal); -extern GrB_Info GxB_Monoid_terminal_new_INT16(GrB_Monoid *monoid, GrB_BinaryOp op, int16_t identity, int16_t terminal); -extern GrB_Info GxB_Monoid_terminal_new_INT32(GrB_Monoid *monoid, GrB_BinaryOp op, int32_t identity, int32_t terminal); -extern GrB_Info GxB_Monoid_terminal_new_INT64(GrB_Monoid *monoid, GrB_BinaryOp op, int64_t identity, int64_t terminal); -extern GrB_Info GxB_Monoid_terminal_new_UDT(GrB_Monoid *monoid, GrB_BinaryOp op, void *identity, void *terminal); -extern GrB_Info GxB_Monoid_terminal_new_UINT8(GrB_Monoid *monoid, GrB_BinaryOp op, uint8_t identity, uint8_t terminal); -extern GrB_Info GxB_Monoid_terminal_new_UINT16(GrB_Monoid *monoid, GrB_BinaryOp op, uint16_t identity, uint16_t terminal); -extern GrB_Info GxB_Monoid_terminal_new_UINT32(GrB_Monoid *monoid, GrB_BinaryOp op, uint32_t identity, uint32_t terminal); -extern GrB_Info GxB_Monoid_terminal_new_UINT64(GrB_Monoid *monoid, GrB_BinaryOp op, uint64_t identity, uint64_t terminal); +GrB_Info GxB_Monoid_fprint(GrB_Monoid monoid, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_Monoid_identity(void *identity, GrB_Monoid monoid); +GrB_Info GxB_Monoid_operator(GrB_BinaryOp *op, GrB_Monoid monoid); +GrB_Info GxB_Monoid_terminal(bool *has_terminal, void *terminal, GrB_Monoid monoid); +GrB_Info GxB_Monoid_terminal_new_BOOL(GrB_Monoid *monoid, GrB_BinaryOp op, bool identity, bool terminal); +GrB_Info GxB_Monoid_terminal_new_FP32(GrB_Monoid *monoid, GrB_BinaryOp op, float identity, float terminal); +GrB_Info GxB_Monoid_terminal_new_FP64(GrB_Monoid *monoid, GrB_BinaryOp op, double identity, double terminal); +GrB_Info GxB_Monoid_terminal_new_INT8(GrB_Monoid *monoid, GrB_BinaryOp op, int8_t identity, int8_t terminal); +GrB_Info GxB_Monoid_terminal_new_INT16(GrB_Monoid *monoid, GrB_BinaryOp op, int16_t identity, int16_t terminal); +GrB_Info GxB_Monoid_terminal_new_INT32(GrB_Monoid *monoid, GrB_BinaryOp op, int32_t identity, int32_t terminal); +GrB_Info GxB_Monoid_terminal_new_INT64(GrB_Monoid *monoid, GrB_BinaryOp op, int64_t identity, int64_t terminal); +GrB_Info GxB_Monoid_terminal_new_UDT(GrB_Monoid *monoid, GrB_BinaryOp op, void *identity, void *terminal); +GrB_Info GxB_Monoid_terminal_new_UINT8(GrB_Monoid *monoid, GrB_BinaryOp op, uint8_t identity, uint8_t terminal); +GrB_Info GxB_Monoid_terminal_new_UINT16(GrB_Monoid *monoid, GrB_BinaryOp op, uint16_t identity, uint16_t terminal); +GrB_Info GxB_Monoid_terminal_new_UINT32(GrB_Monoid *monoid, GrB_BinaryOp op, uint32_t identity, uint32_t terminal); +GrB_Info GxB_Monoid_terminal_new_UINT64(GrB_Monoid *monoid, GrB_BinaryOp op, uint64_t identity, uint64_t terminal); /* scalar */ -extern GrB_Info GxB_Scalar_clear(GrB_Scalar s); -extern GrB_Info GxB_Scalar_dup(GrB_Scalar *s, const GrB_Scalar t); -extern GrB_Info GxB_Scalar_error(const char **error, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_BOOL(bool *x, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_FP32(float *x, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_FP64(double *x, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_INT8(int8_t *x, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_INT16(int16_t *x, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_INT32(int32_t *x, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_INT64(int64_t *x, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_UDT(void *x, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_UINT8(uint8_t *x, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_UINT16(uint16_t *x, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_UINT32(uint32_t *x, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_extractElement_UINT64(uint64_t *x, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_fprint(GrB_Scalar s, const char *name, GxB_Print_Level pr, FILE *f); -extern GrB_Info GxB_Scalar_free(GrB_Scalar *s); -extern GrB_Info GxB_Scalar_memoryUsage(size_t *size, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_new(GrB_Scalar *s, GrB_Type type); -extern GrB_Info GxB_Scalar_nvals(GrB_Index *nvals, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_setElement_BOOL(GrB_Scalar s, bool x); -extern GrB_Info GxB_Scalar_setElement_FP32(GrB_Scalar s, float x); -extern GrB_Info GxB_Scalar_setElement_FP64(GrB_Scalar s, double x); -extern GrB_Info GxB_Scalar_setElement_INT8(GrB_Scalar s, int8_t x); -extern GrB_Info GxB_Scalar_setElement_INT16(GrB_Scalar s, int16_t x); -extern GrB_Info GxB_Scalar_setElement_INT32(GrB_Scalar s, int32_t x); -extern GrB_Info GxB_Scalar_setElement_INT64(GrB_Scalar s, int64_t x); -extern GrB_Info GxB_Scalar_setElement_UDT(GrB_Scalar s, void *x); -extern GrB_Info GxB_Scalar_setElement_UINT8(GrB_Scalar s, uint8_t x); -extern GrB_Info GxB_Scalar_setElement_UINT16(GrB_Scalar s, uint16_t x); -extern GrB_Info GxB_Scalar_setElement_UINT32(GrB_Scalar s, uint32_t x); -extern GrB_Info GxB_Scalar_setElement_UINT64(GrB_Scalar s, uint64_t x); -extern GrB_Info GxB_Scalar_type(GrB_Type *type, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_type_name(char *type_name, const GrB_Scalar s); -extern GrB_Info GxB_Scalar_wait(GrB_Scalar *s); +GrB_Info GxB_Scalar_clear(GrB_Scalar s); +GrB_Info GxB_Scalar_dup(GrB_Scalar *s, const GrB_Scalar t); +GrB_Info GxB_Scalar_error(const char **error, const GrB_Scalar s); +GrB_Info GxB_Scalar_extractElement_BOOL(bool *x, const GrB_Scalar s); +GrB_Info GxB_Scalar_extractElement_FP32(float *x, const GrB_Scalar s); +GrB_Info GxB_Scalar_extractElement_FP64(double *x, const GrB_Scalar s); +GrB_Info GxB_Scalar_extractElement_INT8(int8_t *x, const GrB_Scalar s); +GrB_Info GxB_Scalar_extractElement_INT16(int16_t *x, const GrB_Scalar s); +GrB_Info GxB_Scalar_extractElement_INT32(int32_t *x, const GrB_Scalar s); +GrB_Info GxB_Scalar_extractElement_INT64(int64_t *x, const GrB_Scalar s); +GrB_Info GxB_Scalar_extractElement_UDT(void *x, const GrB_Scalar s); +GrB_Info GxB_Scalar_extractElement_UINT8(uint8_t *x, const GrB_Scalar s); +GrB_Info GxB_Scalar_extractElement_UINT16(uint16_t *x, const GrB_Scalar s); +GrB_Info GxB_Scalar_extractElement_UINT32(uint32_t *x, const GrB_Scalar s); +GrB_Info GxB_Scalar_extractElement_UINT64(uint64_t *x, const GrB_Scalar s); +GrB_Info GxB_Scalar_fprint(GrB_Scalar s, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_Scalar_free(GrB_Scalar *s); +GrB_Info GxB_Scalar_memoryUsage(size_t *size, const GrB_Scalar s); +GrB_Info GxB_Scalar_new(GrB_Scalar *s, GrB_Type type); +GrB_Info GxB_Scalar_nvals(GrB_Index *nvals, const GrB_Scalar s); +GrB_Info GxB_Scalar_setElement_BOOL(GrB_Scalar s, bool x); +GrB_Info GxB_Scalar_setElement_FP32(GrB_Scalar s, float x); +GrB_Info GxB_Scalar_setElement_FP64(GrB_Scalar s, double x); +GrB_Info GxB_Scalar_setElement_INT8(GrB_Scalar s, int8_t x); +GrB_Info GxB_Scalar_setElement_INT16(GrB_Scalar s, int16_t x); +GrB_Info GxB_Scalar_setElement_INT32(GrB_Scalar s, int32_t x); +GrB_Info GxB_Scalar_setElement_INT64(GrB_Scalar s, int64_t x); +GrB_Info GxB_Scalar_setElement_UDT(GrB_Scalar s, void *x); +GrB_Info GxB_Scalar_setElement_UINT8(GrB_Scalar s, uint8_t x); +GrB_Info GxB_Scalar_setElement_UINT16(GrB_Scalar s, uint16_t x); +GrB_Info GxB_Scalar_setElement_UINT32(GrB_Scalar s, uint32_t x); +GrB_Info GxB_Scalar_setElement_UINT64(GrB_Scalar s, uint64_t x); +GrB_Info GxB_Scalar_type(GrB_Type *type, const GrB_Scalar s); +GrB_Info GxB_Scalar_type_name(char *type_name, const GrB_Scalar s); +GrB_Info GxB_Scalar_wait(GrB_Scalar *s); /* selectop */ -extern GrB_Info GxB_SelectOp_error(const char **error, const GxB_SelectOp op); -extern GrB_Info GxB_SelectOp_fprint(GxB_SelectOp selectop, const char *name, GxB_Print_Level pr, FILE *f); -extern GrB_Info GxB_SelectOp_free(GxB_SelectOp *selectop); -extern GrB_Info GxB_SelectOp_new(GxB_SelectOp *selectop, GxB_select_function function, GrB_Type xtype, GrB_Type ttype); -extern GrB_Info GxB_SelectOp_ttype(GrB_Type *ttype, GxB_SelectOp selectop); -extern GrB_Info GxB_SelectOp_wait(GxB_SelectOp op, GrB_WaitMode waitmode); -extern GrB_Info GxB_SelectOp_xtype(GrB_Type *xtype, GxB_SelectOp selectop); +GrB_Info GxB_SelectOp_error(const char **error, const GxB_SelectOp op); +GrB_Info GxB_SelectOp_fprint(GxB_SelectOp selectop, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_SelectOp_free(GxB_SelectOp *selectop); +GrB_Info GxB_SelectOp_new(GxB_SelectOp *selectop, GxB_select_function function, GrB_Type xtype, GrB_Type ttype); +GrB_Info GxB_SelectOp_ttype(GrB_Type *ttype, GxB_SelectOp selectop); +GrB_Info GxB_SelectOp_wait(GxB_SelectOp op, GrB_WaitMode waitmode); +GrB_Info GxB_SelectOp_xtype(GrB_Type *xtype, GxB_SelectOp selectop); /* semiring */ -extern GrB_Info GxB_Semiring_add(GrB_Monoid *add, GrB_Semiring semiring); -extern GrB_Info GxB_Semiring_fprint(GrB_Semiring semiring, const char *name, GxB_Print_Level pr, FILE *f); -extern GrB_Info GxB_Semiring_multiply(GrB_BinaryOp *multiply, GrB_Semiring semiring); +GrB_Info GxB_Semiring_add(GrB_Monoid *add, GrB_Semiring semiring); +GrB_Info GxB_Semiring_fprint(GrB_Semiring semiring, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_Semiring_multiply(GrB_BinaryOp *multiply, GrB_Semiring semiring); /* type */ -extern GrB_Info GxB_Type_fprint(GrB_Type type, const char *name, GxB_Print_Level pr, FILE *f); -extern GrB_Info GxB_Type_from_name(GrB_Type *type, const char *type_name); -extern GrB_Info GxB_Type_name(char *type_name, const GrB_Type type); -extern GrB_Info GxB_Type_new(GrB_Type *type, size_t sizeof_ctype, const char *type_name, const char *type_defn); -extern GrB_Info GxB_Type_size(size_t *size, const GrB_Type type); +GrB_Info GxB_Type_fprint(GrB_Type type, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_Type_from_name(GrB_Type *type, const char *type_name); +GrB_Info GxB_Type_name(char *type_name, const GrB_Type type); +GrB_Info GxB_Type_new(GrB_Type *type, size_t sizeof_ctype, const char *type_name, const char *type_defn); +GrB_Info GxB_Type_size(size_t *size, const GrB_Type type); /* unary */ -extern GrB_Info GxB_UnaryOp_fprint(GrB_UnaryOp unaryop, const char *name, GxB_Print_Level pr, FILE *f); -extern GrB_Info GxB_UnaryOp_new(GrB_UnaryOp *unaryop, GxB_unary_function function, GrB_Type ztype, GrB_Type xtype, const char *unop_name, const char *unop_defn); -extern GrB_Info GxB_UnaryOp_xtype(GrB_Type *xtype, GrB_UnaryOp unaryop); -extern GrB_Info GxB_UnaryOp_xtype_name(char *type_name, const GrB_UnaryOp unaryop); -extern GrB_Info GxB_UnaryOp_ztype(GrB_Type *ztype, GrB_UnaryOp unaryop); -extern GrB_Info GxB_UnaryOp_ztype_name(char *type_name, const GrB_UnaryOp unaryop); +GrB_Info GxB_UnaryOp_fprint(GrB_UnaryOp unaryop, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_UnaryOp_new(GrB_UnaryOp *unaryop, GxB_unary_function function, GrB_Type ztype, GrB_Type xtype, const char *unop_name, const char *unop_defn); +GrB_Info GxB_UnaryOp_xtype(GrB_Type *xtype, GrB_UnaryOp unaryop); +GrB_Info GxB_UnaryOp_xtype_name(char *type_name, const GrB_UnaryOp unaryop); +GrB_Info GxB_UnaryOp_ztype(GrB_Type *ztype, GrB_UnaryOp unaryop); +GrB_Info GxB_UnaryOp_ztype_name(char *type_name, const GrB_UnaryOp unaryop); /* vector */ -extern GrB_Info GxB_Vector_Iterator_attach(GxB_Iterator iterator, GrB_Vector v, GrB_Descriptor desc); -extern GrB_Info GxB_Vector_Option_get(GrB_Vector A, GxB_Option_Field field, ...); -extern GrB_Info GxB_Vector_Option_get_FP64(GrB_Vector v, GxB_Option_Field field, double *value); -extern GrB_Info GxB_Vector_Option_get_INT32(GrB_Vector v, GxB_Option_Field field, int32_t *value); -extern GrB_Info GxB_Vector_Option_set(GrB_Vector A, GxB_Option_Field field, ...); -extern GrB_Info GxB_Vector_Option_set_FP64(GrB_Vector v, GxB_Option_Field field, double value); -extern GrB_Info GxB_Vector_Option_set_INT32(GrB_Vector v, GxB_Option_Field field, int32_t value); -extern GrB_Info GxB_Vector_apply_BinaryOp1st(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_apply_BinaryOp2nd(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const GrB_Scalar y, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_build_Scalar(GrB_Vector w, const GrB_Index *I, GrB_Scalar scalar, GrB_Index nvals); -extern GrB_Info GxB_Vector_deserialize(GrB_Vector *w, GrB_Type type, const void *blob, GrB_Index blob_size, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_eWiseUnion(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Vector u, const GrB_Scalar alpha, const GrB_Vector v, const GrB_Scalar beta, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_export_Bitmap(GrB_Vector *v, GrB_Type *type, GrB_Index *n, int8_t **vb, void **vx, GrB_Index *vb_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_export_CSC(GrB_Vector *v, GrB_Type *type, GrB_Index *n, GrB_Index **vi, void **vx, GrB_Index *vi_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, bool *jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_export_Full(GrB_Vector *v, GrB_Type *type, GrB_Index *n, void **vx, GrB_Index *vx_size, bool *iso, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_fprint(GrB_Vector v, const char *name, GxB_Print_Level pr, FILE *f); -extern GrB_Info GxB_Vector_import_Bitmap(GrB_Vector *v, GrB_Type type, GrB_Index n, int8_t **vb, void **vx, GrB_Index vb_size, GrB_Index vx_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_import_CSC(GrB_Vector *v, GrB_Type type, GrB_Index n, GrB_Index **vi, void **vx, GrB_Index vi_size, GrB_Index vx_size, bool iso, GrB_Index nvals, bool jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_import_Full(GrB_Vector *v, GrB_Type type, GrB_Index n, void **vx, GrB_Index vx_size, bool iso, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_isStoredElement(const GrB_Vector v, GrB_Index i); -extern GrB_Info GxB_Vector_iso(bool *iso, const GrB_Vector v); -extern GrB_Info GxB_Vector_memoryUsage(size_t *size, const GrB_Vector v); -extern GrB_Info GxB_Vector_pack_Bitmap(GrB_Vector v, int8_t **vb, void **vx, GrB_Index vb_size, GrB_Index vx_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_pack_CSC(GrB_Vector v, GrB_Index **vi, void **vx, GrB_Index vi_size, GrB_Index vx_size, bool iso, GrB_Index nvals, bool jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_pack_Full(GrB_Vector v, void **vx, GrB_Index vx_size, bool iso, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_select(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Vector u, const GrB_Scalar Thunk, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_serialize(void **blob_handle, GrB_Index *blob_size_handle, GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_sort(GrB_Vector w, GrB_Vector p, GrB_BinaryOp op, GrB_Vector u, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_subassign(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_subassign_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_subassign_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_subassign_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, double x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_subassign_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_subassign_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_subassign_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_subassign_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_subassign_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_subassign_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_subassign_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_subassign_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_subassign_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_subassign_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_type(GrB_Type *type, const GrB_Vector v); -extern GrB_Info GxB_Vector_type_name(char *type_name, const GrB_Vector v); -extern GrB_Info GxB_Vector_unpack_Bitmap(GrB_Vector v, int8_t **vb, void **vx, GrB_Index *vb_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_unpack_CSC(GrB_Vector v, GrB_Index **vi, void **vx, GrB_Index *vi_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, bool *jumbled, const GrB_Descriptor desc); -extern GrB_Info GxB_Vector_unpack_Full(GrB_Vector v, void **vx, GrB_Index *vx_size, bool *iso, const GrB_Descriptor desc); +GrB_Info GxB_Vector_Iterator_attach(GxB_Iterator iterator, GrB_Vector v, GrB_Descriptor desc); +GrB_Info GxB_Vector_Option_get(GrB_Vector A, GxB_Option_Field field, ...); +GrB_Info GxB_Vector_Option_get_FP64(GrB_Vector v, GxB_Option_Field field, double *value); +GrB_Info GxB_Vector_Option_get_INT32(GrB_Vector v, GxB_Option_Field field, int32_t *value); +GrB_Info GxB_Vector_Option_set(GrB_Vector A, GxB_Option_Field field, ...); +GrB_Info GxB_Vector_Option_set_FP64(GrB_Vector v, GxB_Option_Field field, double value); +GrB_Info GxB_Vector_Option_set_INT32(GrB_Vector v, GxB_Option_Field field, int32_t value); +GrB_Info GxB_Vector_apply_BinaryOp1st(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GxB_Vector_apply_BinaryOp2nd(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const GrB_Scalar y, const GrB_Descriptor desc); +GrB_Info GxB_Vector_build_Scalar(GrB_Vector w, const GrB_Index *I, GrB_Scalar scalar, GrB_Index nvals); +GrB_Info GxB_Vector_deserialize(GrB_Vector *w, GrB_Type type, const void *blob, GrB_Index blob_size, const GrB_Descriptor desc); +GrB_Info GxB_Vector_eWiseUnion(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Vector u, const GrB_Scalar alpha, const GrB_Vector v, const GrB_Scalar beta, const GrB_Descriptor desc); +GrB_Info GxB_Vector_export_Bitmap(GrB_Vector *v, GrB_Type *type, GrB_Index *n, int8_t **vb, void **vx, GrB_Index *vb_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); +GrB_Info GxB_Vector_export_CSC(GrB_Vector *v, GrB_Type *type, GrB_Index *n, GrB_Index **vi, void **vx, GrB_Index *vi_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, bool *jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Vector_export_Full(GrB_Vector *v, GrB_Type *type, GrB_Index *n, void **vx, GrB_Index *vx_size, bool *iso, const GrB_Descriptor desc); +GrB_Info GxB_Vector_fprint(GrB_Vector v, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_Vector_import_Bitmap(GrB_Vector *v, GrB_Type type, GrB_Index n, int8_t **vb, void **vx, GrB_Index vb_size, GrB_Index vx_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); +GrB_Info GxB_Vector_import_CSC(GrB_Vector *v, GrB_Type type, GrB_Index n, GrB_Index **vi, void **vx, GrB_Index vi_size, GrB_Index vx_size, bool iso, GrB_Index nvals, bool jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Vector_import_Full(GrB_Vector *v, GrB_Type type, GrB_Index n, void **vx, GrB_Index vx_size, bool iso, const GrB_Descriptor desc); +GrB_Info GxB_Vector_isStoredElement(const GrB_Vector v, GrB_Index i); +GrB_Info GxB_Vector_iso(bool *iso, const GrB_Vector v); +GrB_Info GxB_Vector_memoryUsage(size_t *size, const GrB_Vector v); +GrB_Info GxB_Vector_pack_Bitmap(GrB_Vector v, int8_t **vb, void **vx, GrB_Index vb_size, GrB_Index vx_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); +GrB_Info GxB_Vector_pack_CSC(GrB_Vector v, GrB_Index **vi, void **vx, GrB_Index vi_size, GrB_Index vx_size, bool iso, GrB_Index nvals, bool jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Vector_pack_Full(GrB_Vector v, void **vx, GrB_Index vx_size, bool iso, const GrB_Descriptor desc); +GrB_Info GxB_Vector_select(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Vector u, const GrB_Scalar Thunk, const GrB_Descriptor desc); +GrB_Info GxB_Vector_serialize(void **blob_handle, GrB_Index *blob_size_handle, GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GxB_Vector_sort(GrB_Vector w, GrB_Vector p, GrB_BinaryOp op, GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, double x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_type(GrB_Type *type, const GrB_Vector v); +GrB_Info GxB_Vector_type_name(char *type_name, const GrB_Vector v); +GrB_Info GxB_Vector_unpack_Bitmap(GrB_Vector v, int8_t **vb, void **vx, GrB_Index *vb_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); +GrB_Info GxB_Vector_unpack_CSC(GrB_Vector v, GrB_Index **vi, void **vx, GrB_Index *vi_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, bool *jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Vector_unpack_Full(GrB_Vector v, void **vx, GrB_Index *vx_size, bool *iso, const GrB_Descriptor desc); /* int DEFINES */ #define GRB_SUBVERSION ... From 9bdb4ec5b81e459bc3442d35a57cb3ab1a53deb5 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Wed, 11 Jan 2023 17:29:04 -0600 Subject: [PATCH 108/193] v7.4.1 (#61) * v7.4.1 --- .github/workflows/test.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ef0e116..cfd9a71 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,12 +14,12 @@ jobs: strategy: fail-fast: false matrix: - # os: ["ubuntu-latest", "macos-latest", "windows-latest"] - # source: ["conda-forge"] - os: ["ubuntu-latest"] - source: ["source"] + os: ["ubuntu-latest", "macos-latest", "windows-latest"] + source: ["conda-forge"] + # os: ["ubuntu-latest"] + # source: ["source"] python-version: ["3.8", "3.9", "3.10", "3.11"] - graphblas-version: ["7.4.1.beta3"] + graphblas-version: ["7.4.1"] steps: - name: Checkout uses: actions/checkout@v3 From ecd80aa5083f1b41b6d3620d51e567b3974eee45 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Thu, 19 Jan 2023 09:27:01 -0600 Subject: [PATCH 109/193] Update to v7.4.2 (#62) --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cfd9a71..828cda4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,7 +19,7 @@ jobs: # os: ["ubuntu-latest"] # source: ["source"] python-version: ["3.8", "3.9", "3.10", "3.11"] - graphblas-version: ["7.4.1"] + graphblas-version: ["7.4.2"] steps: - name: Checkout uses: actions/checkout@v3 From 86cb2f16ceca5e4dcec6f301496623c89def7169 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Sat, 21 Jan 2023 21:26:26 -0600 Subject: [PATCH 110/193] Update to v7.4.3 (#63) --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 828cda4..1cce3d8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,7 +19,7 @@ jobs: # os: ["ubuntu-latest"] # source: ["source"] python-version: ["3.8", "3.9", "3.10", "3.11"] - graphblas-version: ["7.4.2"] + graphblas-version: ["7.4.3"] steps: - name: Checkout uses: actions/checkout@v3 From 97fc4f908c7b4c702b1539bbd3063b4de6fe0339 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Fri, 10 Feb 2023 10:37:18 -0600 Subject: [PATCH 111/193] Modernize: use pyproject.toml for more things, add pre-commit; remove versioneer (#67) * Modernize: use pyproject.toml for more things, add pre-commit; remove versioneer - Move metadata and config to `pyproject.toml` (and flake8 config to `.flake8`) - Use `setuptools-git-versioning` instead of `versioneer.py` - Add `.pre-commit-config.yaml` for git pre-commit hooks - Add GitHub Action to run pre-commit hooks to check linting --- .flake8 | 8 + .gitattributes | 1 - .github/workflows/lint.yml | 21 + .github/workflows/test.yml | 9 +- .pre-commit-config.yaml | 69 + MANIFEST.in | 3 +- pyproject.toml | 103 +- setup.cfg | 45 - setup.py | 49 +- suitesparse_graphblas/__init__.py | 25 +- suitesparse_graphblas/_version.py | 674 ------ suitesparse_graphblas/build.py | 2 +- suitesparse_graphblas/tests/test_io.py | 1 - suitesparse_graphblas/tests/test_package.py | 5 + versioneer.py | 2149 ------------------- 15 files changed, 227 insertions(+), 2937 deletions(-) create mode 100644 .flake8 delete mode 100644 .gitattributes create mode 100644 .github/workflows/lint.yml create mode 100644 .pre-commit-config.yaml delete mode 100644 setup.cfg delete mode 100644 suitesparse_graphblas/_version.py delete mode 100644 versioneer.py diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..414785b --- /dev/null +++ b/.flake8 @@ -0,0 +1,8 @@ +[flake8] +max-line-length = 100 +inline-quotes = " +extend-ignore = + E203, +# E203 whitespace before ':' (to be compatible with black) +per-file-ignores = + suitesparse_graphblas/io/binary.py:C408 diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index b6e1e78..0000000 --- a/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -suitesparse_graphblas/_version.py export-subst diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..5ef2b10 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,21 @@ +name: Lint via pre-commit + +on: + pull_request: + push: + branches-ignore: + - main + +permissions: + contents: read + +jobs: + pre-commit: + name: pre-commit-hooks + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: "3.10" + - uses: pre-commit/action@v3.0.0 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1cce3d8..bbc911e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,6 +23,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: Conda uses: conda-incubator/setup-miniconda@v2 with: @@ -57,18 +59,13 @@ jobs: popd - name: Build run: | - python setup.py build_ext --inplace - python setup.py develop + pip install -e . --no-deps - name: Test env: CYTHON_COVERAGE: true run: | coverage run --branch -m pytest coverage run -a --branch suitesparse_graphblas/tests/test_initialize.py - - name: Lint - run: | - black *py suitesparse_graphblas --check --diff - flake8 *py suitesparse_graphblas - name: create_headers.py check if: (! contains(matrix.os, 'windows')) run: | diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..6f4c629 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,69 @@ +# https://pre-commit.com/ +# +# Before first use: `pre-commit install` +# To run: `pre-commit run --all-files` +# To update: `pre-commit autoupdate` +# - &flake8_dependencies below needs updated manually +fail_fast: true +default_language_version: + python: python3 +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: check-added-large-files + - id: check-ast + - id: check-toml + - id: check-yaml + - id: debug-statements + - id: end-of-file-fixer + - id: mixed-line-ending + # - id: trailing-whitespace + - repo: https://github.com/abravalheri/validate-pyproject + rev: v0.12.1 + hooks: + - id: validate-pyproject + name: Validate pyproject.toml + - repo: https://github.com/myint/autoflake + rev: v2.0.1 + hooks: + - id: autoflake + args: [--in-place] + - repo: https://github.com/pycqa/isort + rev: 5.12.0 + hooks: + - id: isort + - repo: https://github.com/asottile/pyupgrade + rev: v3.3.1 + hooks: + - id: pyupgrade + args: [--py38-plus] + # - repo: https://github.com/MarcoGorelli/auto-walrus + # rev: v0.2.2 + # hooks: + # - id: auto-walrus + # args: [--line-length, "100"] + - repo: https://github.com/psf/black + rev: 23.1.0 + hooks: + - id: black + # - id: black-jupyter + - repo: https://github.com/PyCQA/flake8 + rev: 6.0.0 + hooks: + - id: flake8 + additional_dependencies: &flake8_dependencies + # These versions need updated manually + - flake8==6.0.0 + - flake8-comprehensions==3.10.1 + - flake8-bugbear==23.1.20 + # - flake8-simplify==0.19.3 + - repo: https://github.com/asottile/yesqa + rev: v1.4.0 + hooks: + - id: yesqa + additional_dependencies: *flake8_dependencies + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: no-commit-to-branch # no commit directly to main diff --git a/MANIFEST.in b/MANIFEST.in index 3e2a1a0..4d7b6d3 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -5,5 +5,4 @@ include suitesparse_graphblas/*.pxd include suitesparse_graphblas/*.pyx include suitesparse_graphblas/*.c include suitesparse_graphblas/*.h -include versioneer.py -include suitesparse_graphblas/_version.py +include suitesparse_graphblas/tests/*.py diff --git a/pyproject.toml b/pyproject.toml index adbd980..4059c4e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,106 @@ [build-system] -requires = ["setuptools", "wheel", "numpy>=1.19", "cython"] +build-backend = "setuptools.build_meta" +requires = [ + "setuptools >=64", + "setuptools-git-versioning", + "wheel", + "cffi", + "cython", + "oldest-supported-numpy", +] + +[project] +name = "suitesparse-graphblas" +dynamic = ["version"] +description = "SuiteSparse:GraphBLAS Python bindings." +readme = "README.md" +requires-python = ">=3.8" +license = {file = "LICENSE"} +authors = [ + {name = "Erik Welch"}, + {name = "Jim Kitchen"}, + {name = "Michel Pelletier"}, +] +maintainers = [ + {name = "Erik Welch", email = "erik.n.welch@gmail.com"}, + {name = "Jim Kitchen", email = "jim22k@gmail.com"}, + {name = "Michel Pelletier", email = "michel@graphegon.com"}, +] +classifiers = [ + "Development Status :: 4 - Beta", + "License :: OSI Approved :: Apache Software License", + "Operating System :: MacOS :: MacOS X", + "Operating System :: POSIX :: Linux", + "Operating System :: Microsoft :: Windows", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3 :: Only", + "Intended Audience :: Science/Research", + "Topic :: Scientific/Engineering", + "Topic :: Scientific/Engineering :: Mathematics", +] +dependencies = [ + # These are super-old; can/should we update them? + "cffi>=1.0.0", + "numpy>=1.19", +] +[project.urls] +homepage = "https://github.com/GraphBLAS/python-suitesparse-graphblas" +repository = "https://github.com/GraphBLAS/python-suitesparse-graphblas" +changelog = "https://github.com/GraphBLAS/python-suitesparse-graphblas/releases" + +[project.optional-dependencies] +test = [ + "pytest", +] + +[tool.setuptools] +packages = [ + 'suitesparse_graphblas', + # 'suitesparse_graphblas.tests', + 'suitesparse_graphblas.io', +] + +[tool.setuptools-git-versioning] +enabled = true +dev_template = "{tag}+{ccount}.g{sha}" +dirty_template = "{tag}+{ccount}.g{sha}.dirty" [tool.black] line-length = 100 +target-version = ["py38", "py39", "py310", "py311"] + +[tool.isort] +sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"] +profile = "black" +skip_gitignore = true +float_to_top = true +default_section = "THIRDPARTY" +known_first_party = "suitesparse_graphblas" +line_length = 100 +skip_glob = ["*.pxd", "*.pyx"] + +[tool.coverage.run] +branch = true +source = ["suitesparse_graphblas"] +omit = [] +plugins = ["Cython.Coverage"] + +[tool.coverage.report] +ignore_errors = false +precision = 1 +fail_under = 0 +skip_covered = true +skip_empty = true +exclude_lines = [ + "pragma: no cover", + "raise AssertionError", + "raise NotImplementedError", +] + +[tool.pytest] +testpaths = ["suitesparse_graphblas/tests"] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index ba61703..0000000 --- a/setup.cfg +++ /dev/null @@ -1,45 +0,0 @@ -[aliases] -test=pytest - -[flake8] -max-line-length = 100 -inline-quotes = " -exclude = - versioneer.py, -extend-ignore = - E203, -# E203 whitespace before ':' (to be compatible with black) -per-file-ignores = suitesparse_graphblas/io/binary.py:C408 - -[coverage:run] -source = suitesparse_graphblas -plugins = Cython.Coverage -omit = - suitesparse_graphblas/_version.py - -[coverage:report] -# Regexes for lines to exclude from consideration -exclude_lines = - pragma: no cover - - raise AssertionError - raise NotImplementedError - -[versioneer] -VCS = git -style = pep440 -versionfile_source = suitesparse_graphblas/_version.py -versionfile_build = suitesparse_graphblas/_version.py -tag_prefix= -parentdir_prefix=suitesparse_graphblas- - -[tool:pytest] -testpaths = suitesparse_graphblas/tests - -[isort] -sections = FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER -profile = black -skip_gitignore = true -float_to_top = true -default_section = THIRDPARTY -known_first_party = suitesparse_graphblas diff --git a/setup.py b/setup.py index 40a6b7b..2312fc3 100644 --- a/setup.py +++ b/setup.py @@ -1,12 +1,9 @@ -# Twiddle Dee (switch this between Dee and Dum to add meaningless git commits) import os import sys from glob import glob import numpy as np -from setuptools import Extension, find_packages, setup - -import versioneer +from setuptools import Extension, setup try: from Cython.Build import cythonize @@ -16,8 +13,6 @@ except ImportError: use_cython = False - -is_win = sys.platform.startswith("win") define_macros = [("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")] if use_cython: @@ -51,49 +46,7 @@ if use_cython: ext_modules = cythonize(ext_modules, include_path=include_dirs) -with open("README.md") as f: - long_description = f.read() - -package_data = {"suitesparse_graphblas": ["*.pyx", "*.pxd", "*.c", "*.h"]} -if is_win: - package_data["suitesparse_graphblas"].append("*.dll") - setup( - name="suitesparse-graphblas", - version=versioneer.get_version(), - cmdclass=versioneer.get_cmdclass(), - description="SuiteSparse:GraphBLAS Python bindings.", - long_description=long_description, - long_description_content_type="text/markdown", - packages=find_packages(), - author="Michel Pelletier, James Kitchen, Erik Welch", - author_email="michel@graphegon.com,jim22k@gmail.com,erik.n.welch@gmail.com", - url="https://github.com/GraphBLAS/python-suitesparse-graphblas", ext_modules=ext_modules, cffi_modules=["suitesparse_graphblas/build.py:ffibuilder"], - python_requires=">=3.8", - install_requires=["cffi>=1.0.0", "numpy>=1.19"], - setup_requires=["cffi>=1.0.0", "pytest-runner"], - tests_require=["pytest"], - license="Apache License 2.0", - package_data=package_data, - include_package_data=True, - classifiers=[ - "Development Status :: 4 - Beta", - "License :: OSI Approved :: Apache Software License", - "Operating System :: MacOS :: MacOS X", - "Operating System :: POSIX :: Linux", - "Operating System :: Microsoft :: Windows", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3 :: Only", - "Intended Audience :: Science/Research", - "Topic :: Scientific/Engineering", - "Topic :: Scientific/Engineering :: Mathematics", - ], - zip_safe=False, ) diff --git a/suitesparse_graphblas/__init__.py b/suitesparse_graphblas/__init__.py index 596d31a..15931d7 100644 --- a/suitesparse_graphblas/__init__.py +++ b/suitesparse_graphblas/__init__.py @@ -1,16 +1,26 @@ -from . import _version +import importlib.metadata +import platform +import struct as _struct + from . import exceptions as ex from . import utils from ._graphblas import ffi, lib -import struct -import platform - _is_osx_arm64 = platform.machine() == "arm64" _is_ppc64le = platform.machine() == "ppc64le" _c_float = ffi.typeof("float") _c_double = ffi.typeof("double") +try: + __version__ = importlib.metadata.version("suitesparse-graphblas") +except Exception as exc: # pragma: no cover (safety) + raise AttributeError( + "`suitesparse_graphblas.__version__` not available. This may mean " + "suitesparse-graphblas was incorrectly installed or not installed at all. " + "For local development, you may want to do an editable install via " + "`python -m pip install -e path/to/suitesparse-graphblas`" + ) from exc +del importlib, platform # It is strongly recommended to use the non-variadic version of functions to be # compatible with the most number of architectures. For example, you should use @@ -22,10 +32,10 @@ def vararg(val): # https://devblogs.microsoft.com/oldnewthing/20220823-00/?p=107041 tov = ffi.typeof(val) if tov == _c_float: - val = struct.unpack("l", struct.pack("f", val))[0] + val = _struct.unpack("l", _struct.pack("f", val))[0] val = ffi.cast("int64_t", val) elif tov == _c_double: - val = struct.unpack("q", struct.pack("d", val))[0] + val = _struct.unpack("q", _struct.pack("d", val))[0] val = ffi.cast("int64_t", val) # Cast variadic argument as char * to force it onto the stack where ARM64 expects it # https://developer.apple.com/documentation/xcode/writing-arm64-code-for-apple-platforms @@ -293,6 +303,3 @@ def __repr__(self): burble = burble() - - -__version__ = _version.get_versions()["version"] diff --git a/suitesparse_graphblas/_version.py b/suitesparse_graphblas/_version.py deleted file mode 100644 index 4db97b4..0000000 --- a/suitesparse_graphblas/_version.py +++ /dev/null @@ -1,674 +0,0 @@ -# This file helps to compute a version number in source trees obtained from -# git-archive tarball (such as those provided by githubs download-from-tag -# feature). Distribution tarballs (built by setup.py sdist) and build -# directories (produced by setup.py build) will contain a much shorter file -# that just contains the computed version number. - -# This file is released into the public domain. Generated by -# versioneer-0.21 (https://github.com/python-versioneer/python-versioneer) - -"""Git implementation of _version.py.""" - -import errno -import os -import re -import subprocess -import sys -from typing import Callable, Dict - - -def get_keywords(): - """Get the keywords needed to look up the version information.""" - # these strings will be replaced by git during git-archive. - # setup.py/versioneer.py will grep for the variable names, so they must - # each be defined on a line of their own. _version.py will just call - # get_keywords(). - git_refnames = "$Format:%d$" - git_full = "$Format:%H$" - git_date = "$Format:%ci$" - keywords = {"refnames": git_refnames, "full": git_full, "date": git_date} - return keywords - - -class VersioneerConfig: - """Container for Versioneer configuration parameters.""" - - -def get_config(): - """Create, populate and return the VersioneerConfig() object.""" - # these strings are filled in when 'setup.py versioneer' creates - # _version.py - cfg = VersioneerConfig() - cfg.VCS = "git" - cfg.style = "pep440" - cfg.tag_prefix = "" - cfg.parentdir_prefix = "suitesparse_graphblas-" - cfg.versionfile_source = "suitesparse_graphblas/_version.py" - cfg.verbose = False - return cfg - - -class NotThisMethod(Exception): - """Exception raised if a method is not valid for the current scenario.""" - - -LONG_VERSION_PY: Dict[str, str] = {} -HANDLERS: Dict[str, Dict[str, Callable]] = {} - - -def register_vcs_handler(vcs, method): # decorator - """Create decorator to mark a method as the handler of a VCS.""" - - def decorate(f): - """Store f in HANDLERS[vcs][method].""" - if vcs not in HANDLERS: - HANDLERS[vcs] = {} - HANDLERS[vcs][method] = f - return f - - return decorate - - -def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False, env=None): - """Call the given command(s).""" - assert isinstance(commands, list) - process = None - for command in commands: - try: - dispcmd = str([command] + args) - # remember shell=False, so use git.cmd on windows, not just git - process = subprocess.Popen( - [command] + args, - cwd=cwd, - env=env, - stdout=subprocess.PIPE, - stderr=(subprocess.PIPE if hide_stderr else None), - ) - break - except OSError: - e = sys.exc_info()[1] - if e.errno == errno.ENOENT: - continue - if verbose: - print("unable to run %s" % dispcmd) - print(e) - return None, None - else: - if verbose: - print(f"unable to find command, tried {commands}") - return None, None - stdout = process.communicate()[0].strip().decode() - if process.returncode != 0: - if verbose: - print("unable to run %s (error)" % dispcmd) - print("stdout was %s" % stdout) - return None, process.returncode - return stdout, process.returncode - - -def versions_from_parentdir(parentdir_prefix, root, verbose): - """Try to determine the version from the parent directory name. - - Source tarballs conventionally unpack into a directory that includes both - the project name and a version string. We will also support searching up - two directory levels for an appropriately named parent directory - """ - rootdirs = [] - - for _ in range(3): - dirname = os.path.basename(root) - if dirname.startswith(parentdir_prefix): - return { - "version": dirname[len(parentdir_prefix) :], - "full-revisionid": None, - "dirty": False, - "error": None, - "date": None, - } - rootdirs.append(root) - root = os.path.dirname(root) # up a level - - if verbose: - print( - "Tried directories %s but none started with prefix %s" - % (str(rootdirs), parentdir_prefix) - ) - raise NotThisMethod("rootdir doesn't start with parentdir_prefix") - - -@register_vcs_handler("git", "get_keywords") -def git_get_keywords(versionfile_abs): - """Extract version information from the given file.""" - # the code embedded in _version.py can just fetch the value of these - # keywords. When used from setup.py, we don't want to import _version.py, - # so we do it with a regexp instead. This function is not used from - # _version.py. - keywords = {} - try: - with open(versionfile_abs) as fobj: - for line in fobj: - if line.strip().startswith("git_refnames ="): - mo = re.search(r'=\s*"(.*)"', line) - if mo: - keywords["refnames"] = mo.group(1) - if line.strip().startswith("git_full ="): - mo = re.search(r'=\s*"(.*)"', line) - if mo: - keywords["full"] = mo.group(1) - if line.strip().startswith("git_date ="): - mo = re.search(r'=\s*"(.*)"', line) - if mo: - keywords["date"] = mo.group(1) - except OSError: - pass - return keywords - - -@register_vcs_handler("git", "keywords") -def git_versions_from_keywords(keywords, tag_prefix, verbose): - """Get version information from git keywords.""" - if "refnames" not in keywords: - raise NotThisMethod("Short version file found") - date = keywords.get("date") - if date is not None: - # Use only the last line. Previous lines may contain GPG signature - # information. - date = date.splitlines()[-1] - - # git-2.2.0 added "%cI", which expands to an ISO-8601 -compliant - # datestamp. However we prefer "%ci" (which expands to an "ISO-8601 - # -like" string, which we must then edit to make compliant), because - # it's been around since git-1.5.3, and it's too difficult to - # discover which version we're using, or to work around using an - # older one. - date = date.strip().replace(" ", "T", 1).replace(" ", "", 1) - refnames = keywords["refnames"].strip() - if refnames.startswith("$Format"): - if verbose: - print("keywords are unexpanded, not using") - raise NotThisMethod("unexpanded keywords, not a git-archive tarball") - refs = {r.strip() for r in refnames.strip("()").split(",")} - # starting in git-1.8.3, tags are listed as "tag: foo-1.0" instead of - # just "foo-1.0". If we see a "tag: " prefix, prefer those. - TAG = "tag: " - tags = {r[len(TAG) :] for r in refs if r.startswith(TAG)} - if not tags: - # Either we're using git < 1.8.3, or there really are no tags. We use - # a heuristic: assume all version tags have a digit. The old git %d - # expansion behaves like git log --decorate=short and strips out the - # refs/heads/ and refs/tags/ prefixes that would let us distinguish - # between branches and tags. By ignoring refnames without digits, we - # filter out many common branch names like "release" and - # "stabilization", as well as "HEAD" and "master". - tags = {r for r in refs if re.search(r"\d", r)} - if verbose: - print("discarding '%s', no digits" % ",".join(refs - tags)) - if verbose: - print("likely tags: %s" % ",".join(sorted(tags))) - for ref in sorted(tags): - # sorting will prefer e.g. "2.0" over "2.0rc1" - if ref.startswith(tag_prefix): - r = ref[len(tag_prefix) :] - # Filter out refs that exactly match prefix or that don't start - # with a number once the prefix is stripped (mostly a concern - # when prefix is '') - if not re.match(r"\d", r): - continue - if verbose: - print("picking %s" % r) - return { - "version": r, - "full-revisionid": keywords["full"].strip(), - "dirty": False, - "error": None, - "date": date, - } - # no suitable tags, so version is "0+unknown", but full hex is still there - if verbose: - print("no suitable tags, using unknown + full revision id") - return { - "version": "0+unknown", - "full-revisionid": keywords["full"].strip(), - "dirty": False, - "error": "no suitable tags", - "date": None, - } - - -@register_vcs_handler("git", "pieces_from_vcs") -def git_pieces_from_vcs(tag_prefix, root, verbose, runner=run_command): - """Get version from 'git describe' in the root of the source tree. - - This only gets called if the git-archive 'subst' keywords were *not* - expanded, and _version.py hasn't already been rewritten with a short - version string, meaning we're inside a checked out source tree. - """ - GITS = ["git"] - TAG_PREFIX_REGEX = "*" - if sys.platform == "win32": - GITS = ["git.cmd", "git.exe"] - TAG_PREFIX_REGEX = r"\*" - - _, rc = runner(GITS, ["rev-parse", "--git-dir"], cwd=root, hide_stderr=True) - if rc != 0: - if verbose: - print("Directory %s not under git control" % root) - raise NotThisMethod("'git rev-parse --git-dir' returned error") - - # if there is a tag matching tag_prefix, this yields TAG-NUM-gHEX[-dirty] - # if there isn't one, this yields HEX[-dirty] (no NUM) - describe_out, rc = runner( - GITS, - [ - "describe", - "--tags", - "--dirty", - "--always", - "--long", - "--match", - f"{tag_prefix}{TAG_PREFIX_REGEX}", - ], - cwd=root, - ) - # --long was added in git-1.5.5 - if describe_out is None: - raise NotThisMethod("'git describe' failed") - describe_out = describe_out.strip() - full_out, rc = runner(GITS, ["rev-parse", "HEAD"], cwd=root) - if full_out is None: - raise NotThisMethod("'git rev-parse' failed") - full_out = full_out.strip() - - pieces = {} - pieces["long"] = full_out - pieces["short"] = full_out[:7] # maybe improved later - pieces["error"] = None - - branch_name, rc = runner(GITS, ["rev-parse", "--abbrev-ref", "HEAD"], cwd=root) - # --abbrev-ref was added in git-1.6.3 - if rc != 0 or branch_name is None: - raise NotThisMethod("'git rev-parse --abbrev-ref' returned error") - branch_name = branch_name.strip() - - if branch_name == "HEAD": - # If we aren't exactly on a branch, pick a branch which represents - # the current commit. If all else fails, we are on a branchless - # commit. - branches, rc = runner(GITS, ["branch", "--contains"], cwd=root) - # --contains was added in git-1.5.4 - if rc != 0 or branches is None: - raise NotThisMethod("'git branch --contains' returned error") - branches = branches.split("\n") - - # Remove the first line if we're running detached - if "(" in branches[0]: - branches.pop(0) - - # Strip off the leading "* " from the list of branches. - branches = [branch[2:] for branch in branches] - if "master" in branches: - branch_name = "master" - elif not branches: - branch_name = None - else: - # Pick the first branch that is returned. Good or bad. - branch_name = branches[0] - - pieces["branch"] = branch_name - - # parse describe_out. It will be like TAG-NUM-gHEX[-dirty] or HEX[-dirty] - # TAG might have hyphens. - git_describe = describe_out - - # look for -dirty suffix - dirty = git_describe.endswith("-dirty") - pieces["dirty"] = dirty - if dirty: - git_describe = git_describe[: git_describe.rindex("-dirty")] - - # now we have TAG-NUM-gHEX or HEX - - if "-" in git_describe: - # TAG-NUM-gHEX - mo = re.search(r"^(.+)-(\d+)-g([0-9a-f]+)$", git_describe) - if not mo: - # unparsable. Maybe git-describe is misbehaving? - pieces["error"] = "unable to parse git-describe output: '%s'" % describe_out - return pieces - - # tag - full_tag = mo.group(1) - if not full_tag.startswith(tag_prefix): - if verbose: - fmt = "tag '%s' doesn't start with prefix '%s'" - print(fmt % (full_tag, tag_prefix)) - pieces["error"] = f"tag '{full_tag}' doesn't start with prefix '{tag_prefix}'" - return pieces - pieces["closest-tag"] = full_tag[len(tag_prefix) :] - - # distance: number of commits since tag - pieces["distance"] = int(mo.group(2)) - - # commit: short hex revision ID - pieces["short"] = mo.group(3) - - else: - # HEX: no tags - pieces["closest-tag"] = None - count_out, rc = runner(GITS, ["rev-list", "HEAD", "--count"], cwd=root) - pieces["distance"] = int(count_out) # total number of commits - - # commit date: see ISO-8601 comment in git_versions_from_keywords() - date = runner(GITS, ["show", "-s", "--format=%ci", "HEAD"], cwd=root)[0].strip() - # Use only the last line. Previous lines may contain GPG signature - # information. - date = date.splitlines()[-1] - pieces["date"] = date.strip().replace(" ", "T", 1).replace(" ", "", 1) - - return pieces - - -def plus_or_dot(pieces): - """Return a + if we don't already have one, else return a .""" - if "+" in pieces.get("closest-tag", ""): - return "." - return "+" - - -def render_pep440(pieces): - """Build up version string, with post-release "local version identifier". - - Our goal: TAG[+DISTANCE.gHEX[.dirty]] . Note that if you - get a tagged build and then dirty it, you'll get TAG+0.gHEX.dirty - - Exceptions: - 1: no tags. git_describe was just HEX. 0+untagged.DISTANCE.gHEX[.dirty] - """ - if pieces["closest-tag"]: - rendered = pieces["closest-tag"] - if pieces["distance"] or pieces["dirty"]: - rendered += plus_or_dot(pieces) - rendered += "%d.g%s" % (pieces["distance"], pieces["short"]) - if pieces["dirty"]: - rendered += ".dirty" - else: - # exception #1 - rendered = "0+untagged.%d.g%s" % (pieces["distance"], pieces["short"]) - if pieces["dirty"]: - rendered += ".dirty" - return rendered - - -def render_pep440_branch(pieces): - """TAG[[.dev0]+DISTANCE.gHEX[.dirty]] . - - The ".dev0" means not master branch. Note that .dev0 sorts backwards - (a feature branch will appear "older" than the master branch). - - Exceptions: - 1: no tags. 0[.dev0]+untagged.DISTANCE.gHEX[.dirty] - """ - if pieces["closest-tag"]: - rendered = pieces["closest-tag"] - if pieces["distance"] or pieces["dirty"]: - if pieces["branch"] != "master": - rendered += ".dev0" - rendered += plus_or_dot(pieces) - rendered += "%d.g%s" % (pieces["distance"], pieces["short"]) - if pieces["dirty"]: - rendered += ".dirty" - else: - # exception #1 - rendered = "0" - if pieces["branch"] != "master": - rendered += ".dev0" - rendered += "+untagged.%d.g%s" % (pieces["distance"], pieces["short"]) - if pieces["dirty"]: - rendered += ".dirty" - return rendered - - -def pep440_split_post(ver): - """Split pep440 version string at the post-release segment. - - Returns the release segments before the post-release and the - post-release version number (or -1 if no post-release segment is present). - """ - vc = str.split(ver, ".post") - return vc[0], int(vc[1] or 0) if len(vc) == 2 else None - - -def render_pep440_pre(pieces): - """TAG[.postN.devDISTANCE] -- No -dirty. - - Exceptions: - 1: no tags. 0.post0.devDISTANCE - """ - if pieces["closest-tag"]: - if pieces["distance"]: - # update the post release segment - tag_version, post_version = pep440_split_post(pieces["closest-tag"]) - rendered = tag_version - if post_version is not None: - rendered += ".post%d.dev%d" % (post_version + 1, pieces["distance"]) - else: - rendered += ".post0.dev%d" % (pieces["distance"]) - else: - # no commits, use the tag as the version - rendered = pieces["closest-tag"] - else: - # exception #1 - rendered = "0.post0.dev%d" % pieces["distance"] - return rendered - - -def render_pep440_post(pieces): - """TAG[.postDISTANCE[.dev0]+gHEX] . - - The ".dev0" means dirty. Note that .dev0 sorts backwards - (a dirty tree will appear "older" than the corresponding clean one), - but you shouldn't be releasing software with -dirty anyways. - - Exceptions: - 1: no tags. 0.postDISTANCE[.dev0] - """ - if pieces["closest-tag"]: - rendered = pieces["closest-tag"] - if pieces["distance"] or pieces["dirty"]: - rendered += ".post%d" % pieces["distance"] - if pieces["dirty"]: - rendered += ".dev0" - rendered += plus_or_dot(pieces) - rendered += "g%s" % pieces["short"] - else: - # exception #1 - rendered = "0.post%d" % pieces["distance"] - if pieces["dirty"]: - rendered += ".dev0" - rendered += "+g%s" % pieces["short"] - return rendered - - -def render_pep440_post_branch(pieces): - """TAG[.postDISTANCE[.dev0]+gHEX[.dirty]] . - - The ".dev0" means not master branch. - - Exceptions: - 1: no tags. 0.postDISTANCE[.dev0]+gHEX[.dirty] - """ - if pieces["closest-tag"]: - rendered = pieces["closest-tag"] - if pieces["distance"] or pieces["dirty"]: - rendered += ".post%d" % pieces["distance"] - if pieces["branch"] != "master": - rendered += ".dev0" - rendered += plus_or_dot(pieces) - rendered += "g%s" % pieces["short"] - if pieces["dirty"]: - rendered += ".dirty" - else: - # exception #1 - rendered = "0.post%d" % pieces["distance"] - if pieces["branch"] != "master": - rendered += ".dev0" - rendered += "+g%s" % pieces["short"] - if pieces["dirty"]: - rendered += ".dirty" - return rendered - - -def render_pep440_old(pieces): - """TAG[.postDISTANCE[.dev0]] . - - The ".dev0" means dirty. - - Exceptions: - 1: no tags. 0.postDISTANCE[.dev0] - """ - if pieces["closest-tag"]: - rendered = pieces["closest-tag"] - if pieces["distance"] or pieces["dirty"]: - rendered += ".post%d" % pieces["distance"] - if pieces["dirty"]: - rendered += ".dev0" - else: - # exception #1 - rendered = "0.post%d" % pieces["distance"] - if pieces["dirty"]: - rendered += ".dev0" - return rendered - - -def render_git_describe(pieces): - """TAG[-DISTANCE-gHEX][-dirty]. - - Like 'git describe --tags --dirty --always'. - - Exceptions: - 1: no tags. HEX[-dirty] (note: no 'g' prefix) - """ - if pieces["closest-tag"]: - rendered = pieces["closest-tag"] - if pieces["distance"]: - rendered += "-%d-g%s" % (pieces["distance"], pieces["short"]) - else: - # exception #1 - rendered = pieces["short"] - if pieces["dirty"]: - rendered += "-dirty" - return rendered - - -def render_git_describe_long(pieces): - """TAG-DISTANCE-gHEX[-dirty]. - - Like 'git describe --tags --dirty --always -long'. - The distance/hash is unconditional. - - Exceptions: - 1: no tags. HEX[-dirty] (note: no 'g' prefix) - """ - if pieces["closest-tag"]: - rendered = pieces["closest-tag"] - rendered += "-%d-g%s" % (pieces["distance"], pieces["short"]) - else: - # exception #1 - rendered = pieces["short"] - if pieces["dirty"]: - rendered += "-dirty" - return rendered - - -def render(pieces, style): - """Render the given version pieces into the requested style.""" - if pieces["error"]: - return { - "version": "unknown", - "full-revisionid": pieces.get("long"), - "dirty": None, - "error": pieces["error"], - "date": None, - } - - if not style or style == "default": - style = "pep440" # the default - - if style == "pep440": - rendered = render_pep440(pieces) - elif style == "pep440-branch": - rendered = render_pep440_branch(pieces) - elif style == "pep440-pre": - rendered = render_pep440_pre(pieces) - elif style == "pep440-post": - rendered = render_pep440_post(pieces) - elif style == "pep440-post-branch": - rendered = render_pep440_post_branch(pieces) - elif style == "pep440-old": - rendered = render_pep440_old(pieces) - elif style == "git-describe": - rendered = render_git_describe(pieces) - elif style == "git-describe-long": - rendered = render_git_describe_long(pieces) - else: - raise ValueError("unknown style '%s'" % style) - - return { - "version": rendered, - "full-revisionid": pieces["long"], - "dirty": pieces["dirty"], - "error": None, - "date": pieces.get("date"), - } - - -def get_versions(): - """Get version information or return default if unable to do so.""" - # I am in _version.py, which lives at ROOT/VERSIONFILE_SOURCE. If we have - # __file__, we can work backwards from there to the root. Some - # py2exe/bbfreeze/non-CPython implementations don't do __file__, in which - # case we can only use expanded keywords. - - cfg = get_config() - verbose = cfg.verbose - - try: - return git_versions_from_keywords(get_keywords(), cfg.tag_prefix, verbose) - except NotThisMethod: - pass - - try: - root = os.path.realpath(__file__) - # versionfile_source is the relative path from the top of the source - # tree (where the .git directory might live) to this file. Invert - # this to find the root from __file__. - for _ in cfg.versionfile_source.split("/"): - root = os.path.dirname(root) - except NameError: - return { - "version": "0+unknown", - "full-revisionid": None, - "dirty": None, - "error": "unable to find root of source tree", - "date": None, - } - - try: - pieces = git_pieces_from_vcs(cfg.tag_prefix, root, verbose) - return render(pieces, cfg.style) - except NotThisMethod: - pass - - try: - if cfg.parentdir_prefix: - return versions_from_parentdir(cfg.parentdir_prefix, root, verbose) - except NotThisMethod: - pass - - return { - "version": "0+unknown", - "full-revisionid": None, - "dirty": None, - "error": "unable to compute version", - "date": None, - } diff --git a/suitesparse_graphblas/build.py b/suitesparse_graphblas/build.py index 78012c5..86a9ead 100644 --- a/suitesparse_graphblas/build.py +++ b/suitesparse_graphblas/build.py @@ -1,6 +1,6 @@ import os -import sys import platform +import sys from cffi import FFI diff --git a/suitesparse_graphblas/tests/test_io.py b/suitesparse_graphblas/tests/test_io.py index a5e56b9..dcdf857 100644 --- a/suitesparse_graphblas/tests/test_io.py +++ b/suitesparse_graphblas/tests/test_io.py @@ -140,7 +140,6 @@ def test_matrix_binfile_read_write(tmp_path): for format in (lib.GxB_BY_ROW, lib.GxB_BY_COL): for T in grb_types: for sparsity in (lib.GxB_HYPERSPARSE, lib.GxB_SPARSE, lib.GxB_BITMAP, lib.GxB_FULL): - A = matrix.new(T, 2, 2) if T is not lib.GxB_FULL: diff --git a/suitesparse_graphblas/tests/test_package.py b/suitesparse_graphblas/tests/test_package.py index ad4d807..36b83f6 100644 --- a/suitesparse_graphblas/tests/test_package.py +++ b/suitesparse_graphblas/tests/test_package.py @@ -1,5 +1,10 @@ +import suitesparse_graphblas from suitesparse_graphblas import ffi, lib # noqa: F401 def test_matrix_existence(): assert hasattr(lib, "GrB_Matrix_new") + + +def test_version(): + assert suitesparse_graphblas.__version__ > "7.4.2.0" diff --git a/versioneer.py b/versioneer.py deleted file mode 100644 index 1da8595..0000000 --- a/versioneer.py +++ /dev/null @@ -1,2149 +0,0 @@ -# Version: 0.21 - -"""The Versioneer - like a rocketeer, but for versions. - -The Versioneer -============== - -* like a rocketeer, but for versions! -* https://github.com/python-versioneer/python-versioneer -* Brian Warner -* License: Public Domain -* Compatible with: Python 3.6, 3.7, 3.8, 3.9 and pypy3 -* [![Latest Version][pypi-image]][pypi-url] -* [![Build Status][travis-image]][travis-url] - -This is a tool for managing a recorded version number in distutils-based -python projects. The goal is to remove the tedious and error-prone "update -the embedded version string" step from your release process. Making a new -release should be as easy as recording a new tag in your version-control -system, and maybe making new tarballs. - - -## Quick Install - -* `pip install versioneer` to somewhere in your $PATH -* add a `[versioneer]` section to your setup.cfg (see [Install](INSTALL.md)) -* run `versioneer install` in your source tree, commit the results -* Verify version information with `python setup.py version` - -## Version Identifiers - -Source trees come from a variety of places: - -* a version-control system checkout (mostly used by developers) -* a nightly tarball, produced by build automation -* a snapshot tarball, produced by a web-based VCS browser, like github's - "tarball from tag" feature -* a release tarball, produced by "setup.py sdist", distributed through PyPI - -Within each source tree, the version identifier (either a string or a number, -this tool is format-agnostic) can come from a variety of places: - -* ask the VCS tool itself, e.g. "git describe" (for checkouts), which knows - about recent "tags" and an absolute revision-id -* the name of the directory into which the tarball was unpacked -* an expanded VCS keyword ($Id$, etc) -* a `_version.py` created by some earlier build step - -For released software, the version identifier is closely related to a VCS -tag. Some projects use tag names that include more than just the version -string (e.g. "myproject-1.2" instead of just "1.2"), in which case the tool -needs to strip the tag prefix to extract the version identifier. For -unreleased software (between tags), the version identifier should provide -enough information to help developers recreate the same tree, while also -giving them an idea of roughly how old the tree is (after version 1.2, before -version 1.3). Many VCS systems can report a description that captures this, -for example `git describe --tags --dirty --always` reports things like -"0.7-1-g574ab98-dirty" to indicate that the checkout is one revision past the -0.7 tag, has a unique revision id of "574ab98", and is "dirty" (it has -uncommitted changes). - -The version identifier is used for multiple purposes: - -* to allow the module to self-identify its version: `myproject.__version__` -* to choose a name and prefix for a 'setup.py sdist' tarball - -## Theory of Operation - -Versioneer works by adding a special `_version.py` file into your source -tree, where your `__init__.py` can import it. This `_version.py` knows how to -dynamically ask the VCS tool for version information at import time. - -`_version.py` also contains `$Revision$` markers, and the installation -process marks `_version.py` to have this marker rewritten with a tag name -during the `git archive` command. As a result, generated tarballs will -contain enough information to get the proper version. - -To allow `setup.py` to compute a version too, a `versioneer.py` is added to -the top level of your source tree, next to `setup.py` and the `setup.cfg` -that configures it. This overrides several distutils/setuptools commands to -compute the version when invoked, and changes `setup.py build` and `setup.py -sdist` to replace `_version.py` with a small static file that contains just -the generated version data. - -## Installation - -See [INSTALL.md](./INSTALL.md) for detailed installation instructions. - -## Version-String Flavors - -Code which uses Versioneer can learn about its version string at runtime by -importing `_version` from your main `__init__.py` file and running the -`get_versions()` function. From the "outside" (e.g. in `setup.py`), you can -import the top-level `versioneer.py` and run `get_versions()`. - -Both functions return a dictionary with different flavors of version -information: - -* `['version']`: A condensed version string, rendered using the selected - style. This is the most commonly used value for the project's version - string. The default "pep440" style yields strings like `0.11`, - `0.11+2.g1076c97`, or `0.11+2.g1076c97.dirty`. See the "Styles" section - below for alternative styles. - -* `['full-revisionid']`: detailed revision identifier. For Git, this is the - full SHA1 commit id, e.g. "1076c978a8d3cfc70f408fe5974aa6c092c949ac". - -* `['date']`: Date and time of the latest `HEAD` commit. For Git, it is the - commit date in ISO 8601 format. This will be None if the date is not - available. - -* `['dirty']`: a boolean, True if the tree has uncommitted changes. Note that - this is only accurate if run in a VCS checkout, otherwise it is likely to - be False or None - -* `['error']`: if the version string could not be computed, this will be set - to a string describing the problem, otherwise it will be None. It may be - useful to throw an exception in setup.py if this is set, to avoid e.g. - creating tarballs with a version string of "unknown". - -Some variants are more useful than others. Including `full-revisionid` in a -bug report should allow developers to reconstruct the exact code being tested -(or indicate the presence of local changes that should be shared with the -developers). `version` is suitable for display in an "about" box or a CLI -`--version` output: it can be easily compared against release notes and lists -of bugs fixed in various releases. - -The installer adds the following text to your `__init__.py` to place a basic -version in `YOURPROJECT.__version__`: - - from ._version import get_versions - __version__ = get_versions()['version'] - del get_versions - -## Styles - -The setup.cfg `style=` configuration controls how the VCS information is -rendered into a version string. - -The default style, "pep440", produces a PEP440-compliant string, equal to the -un-prefixed tag name for actual releases, and containing an additional "local -version" section with more detail for in-between builds. For Git, this is -TAG[+DISTANCE.gHEX[.dirty]] , using information from `git describe --tags ---dirty --always`. For example "0.11+2.g1076c97.dirty" indicates that the -tree is like the "1076c97" commit but has uncommitted changes (".dirty"), and -that this commit is two revisions ("+2") beyond the "0.11" tag. For released -software (exactly equal to a known tag), the identifier will only contain the -stripped tag, e.g. "0.11". - -Other styles are available. See [details.md](details.md) in the Versioneer -source tree for descriptions. - -## Debugging - -Versioneer tries to avoid fatal errors: if something goes wrong, it will tend -to return a version of "0+unknown". To investigate the problem, run `setup.py -version`, which will run the version-lookup code in a verbose mode, and will -display the full contents of `get_versions()` (including the `error` string, -which may help identify what went wrong). - -## Known Limitations - -Some situations are known to cause problems for Versioneer. This details the -most significant ones. More can be found on Github -[issues page](https://github.com/python-versioneer/python-versioneer/issues). - -### Subprojects - -Versioneer has limited support for source trees in which `setup.py` is not in -the root directory (e.g. `setup.py` and `.git/` are *not* siblings). The are -two common reasons why `setup.py` might not be in the root: - -* Source trees which contain multiple subprojects, such as - [Buildbot](https://github.com/buildbot/buildbot), which contains both - "master" and "slave" subprojects, each with their own `setup.py`, - `setup.cfg`, and `tox.ini`. Projects like these produce multiple PyPI - distributions (and upload multiple independently-installable tarballs). -* Source trees whose main purpose is to contain a C library, but which also - provide bindings to Python (and perhaps other languages) in subdirectories. - -Versioneer will look for `.git` in parent directories, and most operations -should get the right version string. However `pip` and `setuptools` have bugs -and implementation details which frequently cause `pip install .` from a -subproject directory to fail to find a correct version string (so it usually -defaults to `0+unknown`). - -`pip install --editable .` should work correctly. `setup.py install` might -work too. - -Pip-8.1.1 is known to have this problem, but hopefully it will get fixed in -some later version. - -[Bug #38](https://github.com/python-versioneer/python-versioneer/issues/38) is tracking -this issue. The discussion in -[PR #61](https://github.com/python-versioneer/python-versioneer/pull/61) describes the -issue from the Versioneer side in more detail. -[pip PR#3176](https://github.com/pypa/pip/pull/3176) and -[pip PR#3615](https://github.com/pypa/pip/pull/3615) contain work to improve -pip to let Versioneer work correctly. - -Versioneer-0.16 and earlier only looked for a `.git` directory next to the -`setup.cfg`, so subprojects were completely unsupported with those releases. - -### Editable installs with setuptools <= 18.5 - -`setup.py develop` and `pip install --editable .` allow you to install a -project into a virtualenv once, then continue editing the source code (and -test) without re-installing after every change. - -"Entry-point scripts" (`setup(entry_points={"console_scripts": ..})`) are a -convenient way to specify executable scripts that should be installed along -with the python package. - -These both work as expected when using modern setuptools. When using -setuptools-18.5 or earlier, however, certain operations will cause -`pkg_resources.DistributionNotFound` errors when running the entrypoint -script, which must be resolved by re-installing the package. This happens -when the install happens with one version, then the egg_info data is -regenerated while a different version is checked out. Many setup.py commands -cause egg_info to be rebuilt (including `sdist`, `wheel`, and installing into -a different virtualenv), so this can be surprising. - -[Bug #83](https://github.com/python-versioneer/python-versioneer/issues/83) describes -this one, but upgrading to a newer version of setuptools should probably -resolve it. - - -## Updating Versioneer - -To upgrade your project to a new release of Versioneer, do the following: - -* install the new Versioneer (`pip install -U versioneer` or equivalent) -* edit `setup.cfg`, if necessary, to include any new configuration settings - indicated by the release notes. See [UPGRADING](./UPGRADING.md) for details. -* re-run `versioneer install` in your source tree, to replace - `SRC/_version.py` -* commit any changed files - -## Future Directions - -This tool is designed to make it easily extended to other version-control -systems: all VCS-specific components are in separate directories like -src/git/ . The top-level `versioneer.py` script is assembled from these -components by running make-versioneer.py . In the future, make-versioneer.py -will take a VCS name as an argument, and will construct a version of -`versioneer.py` that is specific to the given VCS. It might also take the -configuration arguments that are currently provided manually during -installation by editing setup.py . Alternatively, it might go the other -direction and include code from all supported VCS systems, reducing the -number of intermediate scripts. - -## Similar projects - -* [setuptools_scm](https://github.com/pypa/setuptools_scm/) - a non-vendored build-time - dependency -* [minver](https://github.com/jbweston/miniver) - a lightweight reimplementation of - versioneer -* [versioningit](https://github.com/jwodder/versioningit) - a PEP 518-based setuptools - plugin - -## License - -To make Versioneer easier to embed, all its code is dedicated to the public -domain. The `_version.py` that it creates is also in the public domain. -Specifically, both are released under the Creative Commons "Public Domain -Dedication" license (CC0-1.0), as described in -https://creativecommons.org/publicdomain/zero/1.0/ . - -[pypi-image]: https://img.shields.io/pypi/v/versioneer.svg -[pypi-url]: https://pypi.python.org/pypi/versioneer/ -[travis-image]: -https://img.shields.io/travis/com/python-versioneer/python-versioneer.svg -[travis-url]: https://travis-ci.com/github/python-versioneer/python-versioneer - -""" -# pylint:disable=invalid-name,import-outside-toplevel,missing-function-docstring -# pylint:disable=missing-class-docstring,too-many-branches,too-many-statements -# pylint:disable=raise-missing-from,too-many-lines,too-many-locals,import-error -# pylint:disable=too-few-public-methods,redefined-outer-name,consider-using-with -# pylint:disable=attribute-defined-outside-init,too-many-arguments - -import configparser -import errno -import json -import os -import re -import subprocess -import sys -from typing import Callable, Dict - - -class VersioneerConfig: - """Container for Versioneer configuration parameters.""" - - -def get_root(): - """Get the project root directory. - - We require that all commands are run from the project root, i.e. the - directory that contains setup.py, setup.cfg, and versioneer.py . - """ - root = os.path.realpath(os.path.abspath(os.getcwd())) - setup_py = os.path.join(root, "setup.py") - versioneer_py = os.path.join(root, "versioneer.py") - if not (os.path.exists(setup_py) or os.path.exists(versioneer_py)): - # allow 'python path/to/setup.py COMMAND' - root = os.path.dirname(os.path.realpath(os.path.abspath(sys.argv[0]))) - setup_py = os.path.join(root, "setup.py") - versioneer_py = os.path.join(root, "versioneer.py") - if not (os.path.exists(setup_py) or os.path.exists(versioneer_py)): - err = ( - "Versioneer was unable to run the project root directory. " - "Versioneer requires setup.py to be executed from " - "its immediate directory (like 'python setup.py COMMAND'), " - "or in a way that lets it use sys.argv[0] to find the root " - "(like 'python path/to/setup.py COMMAND')." - ) - raise VersioneerBadRootError(err) - try: - # Certain runtime workflows (setup.py install/develop in a setuptools - # tree) execute all dependencies in a single python process, so - # "versioneer" may be imported multiple times, and python's shared - # module-import table will cache the first one. So we can't use - # os.path.dirname(__file__), as that will find whichever - # versioneer.py was first imported, even in later projects. - my_path = os.path.realpath(os.path.abspath(__file__)) - me_dir = os.path.normcase(os.path.splitext(my_path)[0]) - vsr_dir = os.path.normcase(os.path.splitext(versioneer_py)[0]) - if me_dir != vsr_dir: - print( - "Warning: build in %s is using versioneer.py from %s" - % (os.path.dirname(my_path), versioneer_py) - ) - except NameError: - pass - return root - - -def get_config_from_root(root): - """Read the project setup.cfg file to determine Versioneer config.""" - # This might raise OSError (if setup.cfg is missing), or - # configparser.NoSectionError (if it lacks a [versioneer] section), or - # configparser.NoOptionError (if it lacks "VCS="). See the docstring at - # the top of versioneer.py for instructions on writing your setup.cfg . - setup_cfg = os.path.join(root, "setup.cfg") - parser = configparser.ConfigParser() - with open(setup_cfg) as cfg_file: - parser.read_file(cfg_file) - VCS = parser.get("versioneer", "VCS") # mandatory - - # Dict-like interface for non-mandatory entries - section = parser["versioneer"] - - cfg = VersioneerConfig() - cfg.VCS = VCS - cfg.style = section.get("style", "") - cfg.versionfile_source = section.get("versionfile_source") - cfg.versionfile_build = section.get("versionfile_build") - cfg.tag_prefix = section.get("tag_prefix") - if cfg.tag_prefix in ("''", '""'): - cfg.tag_prefix = "" - cfg.parentdir_prefix = section.get("parentdir_prefix") - cfg.verbose = section.get("verbose") - return cfg - - -class NotThisMethod(Exception): - """Exception raised if a method is not valid for the current scenario.""" - - -# these dictionaries contain VCS-specific tools -LONG_VERSION_PY: Dict[str, str] = {} -HANDLERS: Dict[str, Dict[str, Callable]] = {} - - -def register_vcs_handler(vcs, method): # decorator - """Create decorator to mark a method as the handler of a VCS.""" - - def decorate(f): - """Store f in HANDLERS[vcs][method].""" - HANDLERS.setdefault(vcs, {})[method] = f - return f - - return decorate - - -def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False, env=None): - """Call the given command(s).""" - assert isinstance(commands, list) - process = None - for command in commands: - try: - dispcmd = str([command] + args) - # remember shell=False, so use git.cmd on windows, not just git - process = subprocess.Popen( - [command] + args, - cwd=cwd, - env=env, - stdout=subprocess.PIPE, - stderr=(subprocess.PIPE if hide_stderr else None), - ) - break - except OSError: - e = sys.exc_info()[1] - if e.errno == errno.ENOENT: - continue - if verbose: - print("unable to run %s" % dispcmd) - print(e) - return None, None - else: - if verbose: - print(f"unable to find command, tried {commands}") - return None, None - stdout = process.communicate()[0].strip().decode() - if process.returncode != 0: - if verbose: - print("unable to run %s (error)" % dispcmd) - print("stdout was %s" % stdout) - return None, process.returncode - return stdout, process.returncode - - -LONG_VERSION_PY[ - "git" -] = r''' -# This file helps to compute a version number in source trees obtained from -# git-archive tarball (such as those provided by githubs download-from-tag -# feature). Distribution tarballs (built by setup.py sdist) and build -# directories (produced by setup.py build) will contain a much shorter file -# that just contains the computed version number. - -# This file is released into the public domain. Generated by -# versioneer-0.21 (https://github.com/python-versioneer/python-versioneer) - -"""Git implementation of _version.py.""" - -import errno -import os -import re -import subprocess -import sys -from typing import Callable, Dict - - -def get_keywords(): - """Get the keywords needed to look up the version information.""" - # these strings will be replaced by git during git-archive. - # setup.py/versioneer.py will grep for the variable names, so they must - # each be defined on a line of their own. _version.py will just call - # get_keywords(). - git_refnames = "%(DOLLAR)sFormat:%%d%(DOLLAR)s" - git_full = "%(DOLLAR)sFormat:%%H%(DOLLAR)s" - git_date = "%(DOLLAR)sFormat:%%ci%(DOLLAR)s" - keywords = {"refnames": git_refnames, "full": git_full, "date": git_date} - return keywords - - -class VersioneerConfig: - """Container for Versioneer configuration parameters.""" - - -def get_config(): - """Create, populate and return the VersioneerConfig() object.""" - # these strings are filled in when 'setup.py versioneer' creates - # _version.py - cfg = VersioneerConfig() - cfg.VCS = "git" - cfg.style = "%(STYLE)s" - cfg.tag_prefix = "%(TAG_PREFIX)s" - cfg.parentdir_prefix = "%(PARENTDIR_PREFIX)s" - cfg.versionfile_source = "%(VERSIONFILE_SOURCE)s" - cfg.verbose = False - return cfg - - -class NotThisMethod(Exception): - """Exception raised if a method is not valid for the current scenario.""" - - -LONG_VERSION_PY: Dict[str, str] = {} -HANDLERS: Dict[str, Dict[str, Callable]] = {} - - -def register_vcs_handler(vcs, method): # decorator - """Create decorator to mark a method as the handler of a VCS.""" - def decorate(f): - """Store f in HANDLERS[vcs][method].""" - if vcs not in HANDLERS: - HANDLERS[vcs] = {} - HANDLERS[vcs][method] = f - return f - return decorate - - -def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False, - env=None): - """Call the given command(s).""" - assert isinstance(commands, list) - process = None - for command in commands: - try: - dispcmd = str([command] + args) - # remember shell=False, so use git.cmd on windows, not just git - process = subprocess.Popen([command] + args, cwd=cwd, env=env, - stdout=subprocess.PIPE, - stderr=(subprocess.PIPE if hide_stderr - else None)) - break - except OSError: - e = sys.exc_info()[1] - if e.errno == errno.ENOENT: - continue - if verbose: - print("unable to run %%s" %% dispcmd) - print(e) - return None, None - else: - if verbose: - print("unable to find command, tried %%s" %% (commands,)) - return None, None - stdout = process.communicate()[0].strip().decode() - if process.returncode != 0: - if verbose: - print("unable to run %%s (error)" %% dispcmd) - print("stdout was %%s" %% stdout) - return None, process.returncode - return stdout, process.returncode - - -def versions_from_parentdir(parentdir_prefix, root, verbose): - """Try to determine the version from the parent directory name. - - Source tarballs conventionally unpack into a directory that includes both - the project name and a version string. We will also support searching up - two directory levels for an appropriately named parent directory - """ - rootdirs = [] - - for _ in range(3): - dirname = os.path.basename(root) - if dirname.startswith(parentdir_prefix): - return {"version": dirname[len(parentdir_prefix):], - "full-revisionid": None, - "dirty": False, "error": None, "date": None} - rootdirs.append(root) - root = os.path.dirname(root) # up a level - - if verbose: - print("Tried directories %%s but none started with prefix %%s" %% - (str(rootdirs), parentdir_prefix)) - raise NotThisMethod("rootdir doesn't start with parentdir_prefix") - - -@register_vcs_handler("git", "get_keywords") -def git_get_keywords(versionfile_abs): - """Extract version information from the given file.""" - # the code embedded in _version.py can just fetch the value of these - # keywords. When used from setup.py, we don't want to import _version.py, - # so we do it with a regexp instead. This function is not used from - # _version.py. - keywords = {} - try: - with open(versionfile_abs, "r") as fobj: - for line in fobj: - if line.strip().startswith("git_refnames ="): - mo = re.search(r'=\s*"(.*)"', line) - if mo: - keywords["refnames"] = mo.group(1) - if line.strip().startswith("git_full ="): - mo = re.search(r'=\s*"(.*)"', line) - if mo: - keywords["full"] = mo.group(1) - if line.strip().startswith("git_date ="): - mo = re.search(r'=\s*"(.*)"', line) - if mo: - keywords["date"] = mo.group(1) - except OSError: - pass - return keywords - - -@register_vcs_handler("git", "keywords") -def git_versions_from_keywords(keywords, tag_prefix, verbose): - """Get version information from git keywords.""" - if "refnames" not in keywords: - raise NotThisMethod("Short version file found") - date = keywords.get("date") - if date is not None: - # Use only the last line. Previous lines may contain GPG signature - # information. - date = date.splitlines()[-1] - - # git-2.2.0 added "%%cI", which expands to an ISO-8601 -compliant - # datestamp. However we prefer "%%ci" (which expands to an "ISO-8601 - # -like" string, which we must then edit to make compliant), because - # it's been around since git-1.5.3, and it's too difficult to - # discover which version we're using, or to work around using an - # older one. - date = date.strip().replace(" ", "T", 1).replace(" ", "", 1) - refnames = keywords["refnames"].strip() - if refnames.startswith("$Format"): - if verbose: - print("keywords are unexpanded, not using") - raise NotThisMethod("unexpanded keywords, not a git-archive tarball") - refs = {r.strip() for r in refnames.strip("()").split(",")} - # starting in git-1.8.3, tags are listed as "tag: foo-1.0" instead of - # just "foo-1.0". If we see a "tag: " prefix, prefer those. - TAG = "tag: " - tags = {r[len(TAG):] for r in refs if r.startswith(TAG)} - if not tags: - # Either we're using git < 1.8.3, or there really are no tags. We use - # a heuristic: assume all version tags have a digit. The old git %%d - # expansion behaves like git log --decorate=short and strips out the - # refs/heads/ and refs/tags/ prefixes that would let us distinguish - # between branches and tags. By ignoring refnames without digits, we - # filter out many common branch names like "release" and - # "stabilization", as well as "HEAD" and "master". - tags = {r for r in refs if re.search(r'\d', r)} - if verbose: - print("discarding '%%s', no digits" %% ",".join(refs - tags)) - if verbose: - print("likely tags: %%s" %% ",".join(sorted(tags))) - for ref in sorted(tags): - # sorting will prefer e.g. "2.0" over "2.0rc1" - if ref.startswith(tag_prefix): - r = ref[len(tag_prefix):] - # Filter out refs that exactly match prefix or that don't start - # with a number once the prefix is stripped (mostly a concern - # when prefix is '') - if not re.match(r'\d', r): - continue - if verbose: - print("picking %%s" %% r) - return {"version": r, - "full-revisionid": keywords["full"].strip(), - "dirty": False, "error": None, - "date": date} - # no suitable tags, so version is "0+unknown", but full hex is still there - if verbose: - print("no suitable tags, using unknown + full revision id") - return {"version": "0+unknown", - "full-revisionid": keywords["full"].strip(), - "dirty": False, "error": "no suitable tags", "date": None} - - -@register_vcs_handler("git", "pieces_from_vcs") -def git_pieces_from_vcs(tag_prefix, root, verbose, runner=run_command): - """Get version from 'git describe' in the root of the source tree. - - This only gets called if the git-archive 'subst' keywords were *not* - expanded, and _version.py hasn't already been rewritten with a short - version string, meaning we're inside a checked out source tree. - """ - GITS = ["git"] - TAG_PREFIX_REGEX = "*" - if sys.platform == "win32": - GITS = ["git.cmd", "git.exe"] - TAG_PREFIX_REGEX = r"\*" - - _, rc = runner(GITS, ["rev-parse", "--git-dir"], cwd=root, - hide_stderr=True) - if rc != 0: - if verbose: - print("Directory %%s not under git control" %% root) - raise NotThisMethod("'git rev-parse --git-dir' returned error") - - # if there is a tag matching tag_prefix, this yields TAG-NUM-gHEX[-dirty] - # if there isn't one, this yields HEX[-dirty] (no NUM) - describe_out, rc = runner(GITS, ["describe", "--tags", "--dirty", - "--always", "--long", - "--match", - "%%s%%s" %% (tag_prefix, TAG_PREFIX_REGEX)], - cwd=root) - # --long was added in git-1.5.5 - if describe_out is None: - raise NotThisMethod("'git describe' failed") - describe_out = describe_out.strip() - full_out, rc = runner(GITS, ["rev-parse", "HEAD"], cwd=root) - if full_out is None: - raise NotThisMethod("'git rev-parse' failed") - full_out = full_out.strip() - - pieces = {} - pieces["long"] = full_out - pieces["short"] = full_out[:7] # maybe improved later - pieces["error"] = None - - branch_name, rc = runner(GITS, ["rev-parse", "--abbrev-ref", "HEAD"], - cwd=root) - # --abbrev-ref was added in git-1.6.3 - if rc != 0 or branch_name is None: - raise NotThisMethod("'git rev-parse --abbrev-ref' returned error") - branch_name = branch_name.strip() - - if branch_name == "HEAD": - # If we aren't exactly on a branch, pick a branch which represents - # the current commit. If all else fails, we are on a branchless - # commit. - branches, rc = runner(GITS, ["branch", "--contains"], cwd=root) - # --contains was added in git-1.5.4 - if rc != 0 or branches is None: - raise NotThisMethod("'git branch --contains' returned error") - branches = branches.split("\n") - - # Remove the first line if we're running detached - if "(" in branches[0]: - branches.pop(0) - - # Strip off the leading "* " from the list of branches. - branches = [branch[2:] for branch in branches] - if "master" in branches: - branch_name = "master" - elif not branches: - branch_name = None - else: - # Pick the first branch that is returned. Good or bad. - branch_name = branches[0] - - pieces["branch"] = branch_name - - # parse describe_out. It will be like TAG-NUM-gHEX[-dirty] or HEX[-dirty] - # TAG might have hyphens. - git_describe = describe_out - - # look for -dirty suffix - dirty = git_describe.endswith("-dirty") - pieces["dirty"] = dirty - if dirty: - git_describe = git_describe[:git_describe.rindex("-dirty")] - - # now we have TAG-NUM-gHEX or HEX - - if "-" in git_describe: - # TAG-NUM-gHEX - mo = re.search(r'^(.+)-(\d+)-g([0-9a-f]+)$', git_describe) - if not mo: - # unparsable. Maybe git-describe is misbehaving? - pieces["error"] = ("unable to parse git-describe output: '%%s'" - %% describe_out) - return pieces - - # tag - full_tag = mo.group(1) - if not full_tag.startswith(tag_prefix): - if verbose: - fmt = "tag '%%s' doesn't start with prefix '%%s'" - print(fmt %% (full_tag, tag_prefix)) - pieces["error"] = ("tag '%%s' doesn't start with prefix '%%s'" - %% (full_tag, tag_prefix)) - return pieces - pieces["closest-tag"] = full_tag[len(tag_prefix):] - - # distance: number of commits since tag - pieces["distance"] = int(mo.group(2)) - - # commit: short hex revision ID - pieces["short"] = mo.group(3) - - else: - # HEX: no tags - pieces["closest-tag"] = None - count_out, rc = runner(GITS, ["rev-list", "HEAD", "--count"], cwd=root) - pieces["distance"] = int(count_out) # total number of commits - - # commit date: see ISO-8601 comment in git_versions_from_keywords() - date = runner(GITS, ["show", "-s", "--format=%%ci", "HEAD"], cwd=root)[0].strip() - # Use only the last line. Previous lines may contain GPG signature - # information. - date = date.splitlines()[-1] - pieces["date"] = date.strip().replace(" ", "T", 1).replace(" ", "", 1) - - return pieces - - -def plus_or_dot(pieces): - """Return a + if we don't already have one, else return a .""" - if "+" in pieces.get("closest-tag", ""): - return "." - return "+" - - -def render_pep440(pieces): - """Build up version string, with post-release "local version identifier". - - Our goal: TAG[+DISTANCE.gHEX[.dirty]] . Note that if you - get a tagged build and then dirty it, you'll get TAG+0.gHEX.dirty - - Exceptions: - 1: no tags. git_describe was just HEX. 0+untagged.DISTANCE.gHEX[.dirty] - """ - if pieces["closest-tag"]: - rendered = pieces["closest-tag"] - if pieces["distance"] or pieces["dirty"]: - rendered += plus_or_dot(pieces) - rendered += "%%d.g%%s" %% (pieces["distance"], pieces["short"]) - if pieces["dirty"]: - rendered += ".dirty" - else: - # exception #1 - rendered = "0+untagged.%%d.g%%s" %% (pieces["distance"], - pieces["short"]) - if pieces["dirty"]: - rendered += ".dirty" - return rendered - - -def render_pep440_branch(pieces): - """TAG[[.dev0]+DISTANCE.gHEX[.dirty]] . - - The ".dev0" means not master branch. Note that .dev0 sorts backwards - (a feature branch will appear "older" than the master branch). - - Exceptions: - 1: no tags. 0[.dev0]+untagged.DISTANCE.gHEX[.dirty] - """ - if pieces["closest-tag"]: - rendered = pieces["closest-tag"] - if pieces["distance"] or pieces["dirty"]: - if pieces["branch"] != "master": - rendered += ".dev0" - rendered += plus_or_dot(pieces) - rendered += "%%d.g%%s" %% (pieces["distance"], pieces["short"]) - if pieces["dirty"]: - rendered += ".dirty" - else: - # exception #1 - rendered = "0" - if pieces["branch"] != "master": - rendered += ".dev0" - rendered += "+untagged.%%d.g%%s" %% (pieces["distance"], - pieces["short"]) - if pieces["dirty"]: - rendered += ".dirty" - return rendered - - -def pep440_split_post(ver): - """Split pep440 version string at the post-release segment. - - Returns the release segments before the post-release and the - post-release version number (or -1 if no post-release segment is present). - """ - vc = str.split(ver, ".post") - return vc[0], int(vc[1] or 0) if len(vc) == 2 else None - - -def render_pep440_pre(pieces): - """TAG[.postN.devDISTANCE] -- No -dirty. - - Exceptions: - 1: no tags. 0.post0.devDISTANCE - """ - if pieces["closest-tag"]: - if pieces["distance"]: - # update the post release segment - tag_version, post_version = pep440_split_post(pieces["closest-tag"]) - rendered = tag_version - if post_version is not None: - rendered += ".post%%d.dev%%d" %% (post_version+1, pieces["distance"]) - else: - rendered += ".post0.dev%%d" %% (pieces["distance"]) - else: - # no commits, use the tag as the version - rendered = pieces["closest-tag"] - else: - # exception #1 - rendered = "0.post0.dev%%d" %% pieces["distance"] - return rendered - - -def render_pep440_post(pieces): - """TAG[.postDISTANCE[.dev0]+gHEX] . - - The ".dev0" means dirty. Note that .dev0 sorts backwards - (a dirty tree will appear "older" than the corresponding clean one), - but you shouldn't be releasing software with -dirty anyways. - - Exceptions: - 1: no tags. 0.postDISTANCE[.dev0] - """ - if pieces["closest-tag"]: - rendered = pieces["closest-tag"] - if pieces["distance"] or pieces["dirty"]: - rendered += ".post%%d" %% pieces["distance"] - if pieces["dirty"]: - rendered += ".dev0" - rendered += plus_or_dot(pieces) - rendered += "g%%s" %% pieces["short"] - else: - # exception #1 - rendered = "0.post%%d" %% pieces["distance"] - if pieces["dirty"]: - rendered += ".dev0" - rendered += "+g%%s" %% pieces["short"] - return rendered - - -def render_pep440_post_branch(pieces): - """TAG[.postDISTANCE[.dev0]+gHEX[.dirty]] . - - The ".dev0" means not master branch. - - Exceptions: - 1: no tags. 0.postDISTANCE[.dev0]+gHEX[.dirty] - """ - if pieces["closest-tag"]: - rendered = pieces["closest-tag"] - if pieces["distance"] or pieces["dirty"]: - rendered += ".post%%d" %% pieces["distance"] - if pieces["branch"] != "master": - rendered += ".dev0" - rendered += plus_or_dot(pieces) - rendered += "g%%s" %% pieces["short"] - if pieces["dirty"]: - rendered += ".dirty" - else: - # exception #1 - rendered = "0.post%%d" %% pieces["distance"] - if pieces["branch"] != "master": - rendered += ".dev0" - rendered += "+g%%s" %% pieces["short"] - if pieces["dirty"]: - rendered += ".dirty" - return rendered - - -def render_pep440_old(pieces): - """TAG[.postDISTANCE[.dev0]] . - - The ".dev0" means dirty. - - Exceptions: - 1: no tags. 0.postDISTANCE[.dev0] - """ - if pieces["closest-tag"]: - rendered = pieces["closest-tag"] - if pieces["distance"] or pieces["dirty"]: - rendered += ".post%%d" %% pieces["distance"] - if pieces["dirty"]: - rendered += ".dev0" - else: - # exception #1 - rendered = "0.post%%d" %% pieces["distance"] - if pieces["dirty"]: - rendered += ".dev0" - return rendered - - -def render_git_describe(pieces): - """TAG[-DISTANCE-gHEX][-dirty]. - - Like 'git describe --tags --dirty --always'. - - Exceptions: - 1: no tags. HEX[-dirty] (note: no 'g' prefix) - """ - if pieces["closest-tag"]: - rendered = pieces["closest-tag"] - if pieces["distance"]: - rendered += "-%%d-g%%s" %% (pieces["distance"], pieces["short"]) - else: - # exception #1 - rendered = pieces["short"] - if pieces["dirty"]: - rendered += "-dirty" - return rendered - - -def render_git_describe_long(pieces): - """TAG-DISTANCE-gHEX[-dirty]. - - Like 'git describe --tags --dirty --always -long'. - The distance/hash is unconditional. - - Exceptions: - 1: no tags. HEX[-dirty] (note: no 'g' prefix) - """ - if pieces["closest-tag"]: - rendered = pieces["closest-tag"] - rendered += "-%%d-g%%s" %% (pieces["distance"], pieces["short"]) - else: - # exception #1 - rendered = pieces["short"] - if pieces["dirty"]: - rendered += "-dirty" - return rendered - - -def render(pieces, style): - """Render the given version pieces into the requested style.""" - if pieces["error"]: - return {"version": "unknown", - "full-revisionid": pieces.get("long"), - "dirty": None, - "error": pieces["error"], - "date": None} - - if not style or style == "default": - style = "pep440" # the default - - if style == "pep440": - rendered = render_pep440(pieces) - elif style == "pep440-branch": - rendered = render_pep440_branch(pieces) - elif style == "pep440-pre": - rendered = render_pep440_pre(pieces) - elif style == "pep440-post": - rendered = render_pep440_post(pieces) - elif style == "pep440-post-branch": - rendered = render_pep440_post_branch(pieces) - elif style == "pep440-old": - rendered = render_pep440_old(pieces) - elif style == "git-describe": - rendered = render_git_describe(pieces) - elif style == "git-describe-long": - rendered = render_git_describe_long(pieces) - else: - raise ValueError("unknown style '%%s'" %% style) - - return {"version": rendered, "full-revisionid": pieces["long"], - "dirty": pieces["dirty"], "error": None, - "date": pieces.get("date")} - - -def get_versions(): - """Get version information or return default if unable to do so.""" - # I am in _version.py, which lives at ROOT/VERSIONFILE_SOURCE. If we have - # __file__, we can work backwards from there to the root. Some - # py2exe/bbfreeze/non-CPython implementations don't do __file__, in which - # case we can only use expanded keywords. - - cfg = get_config() - verbose = cfg.verbose - - try: - return git_versions_from_keywords(get_keywords(), cfg.tag_prefix, - verbose) - except NotThisMethod: - pass - - try: - root = os.path.realpath(__file__) - # versionfile_source is the relative path from the top of the source - # tree (where the .git directory might live) to this file. Invert - # this to find the root from __file__. - for _ in cfg.versionfile_source.split('/'): - root = os.path.dirname(root) - except NameError: - return {"version": "0+unknown", "full-revisionid": None, - "dirty": None, - "error": "unable to find root of source tree", - "date": None} - - try: - pieces = git_pieces_from_vcs(cfg.tag_prefix, root, verbose) - return render(pieces, cfg.style) - except NotThisMethod: - pass - - try: - if cfg.parentdir_prefix: - return versions_from_parentdir(cfg.parentdir_prefix, root, verbose) - except NotThisMethod: - pass - - return {"version": "0+unknown", "full-revisionid": None, - "dirty": None, - "error": "unable to compute version", "date": None} -''' - - -@register_vcs_handler("git", "get_keywords") -def git_get_keywords(versionfile_abs): - """Extract version information from the given file.""" - # the code embedded in _version.py can just fetch the value of these - # keywords. When used from setup.py, we don't want to import _version.py, - # so we do it with a regexp instead. This function is not used from - # _version.py. - keywords = {} - try: - with open(versionfile_abs) as fobj: - for line in fobj: - if line.strip().startswith("git_refnames ="): - mo = re.search(r'=\s*"(.*)"', line) - if mo: - keywords["refnames"] = mo.group(1) - if line.strip().startswith("git_full ="): - mo = re.search(r'=\s*"(.*)"', line) - if mo: - keywords["full"] = mo.group(1) - if line.strip().startswith("git_date ="): - mo = re.search(r'=\s*"(.*)"', line) - if mo: - keywords["date"] = mo.group(1) - except OSError: - pass - return keywords - - -@register_vcs_handler("git", "keywords") -def git_versions_from_keywords(keywords, tag_prefix, verbose): - """Get version information from git keywords.""" - if "refnames" not in keywords: - raise NotThisMethod("Short version file found") - date = keywords.get("date") - if date is not None: - # Use only the last line. Previous lines may contain GPG signature - # information. - date = date.splitlines()[-1] - - # git-2.2.0 added "%cI", which expands to an ISO-8601 -compliant - # datestamp. However we prefer "%ci" (which expands to an "ISO-8601 - # -like" string, which we must then edit to make compliant), because - # it's been around since git-1.5.3, and it's too difficult to - # discover which version we're using, or to work around using an - # older one. - date = date.strip().replace(" ", "T", 1).replace(" ", "", 1) - refnames = keywords["refnames"].strip() - if refnames.startswith("$Format"): - if verbose: - print("keywords are unexpanded, not using") - raise NotThisMethod("unexpanded keywords, not a git-archive tarball") - refs = {r.strip() for r in refnames.strip("()").split(",")} - # starting in git-1.8.3, tags are listed as "tag: foo-1.0" instead of - # just "foo-1.0". If we see a "tag: " prefix, prefer those. - TAG = "tag: " - tags = {r[len(TAG) :] for r in refs if r.startswith(TAG)} - if not tags: - # Either we're using git < 1.8.3, or there really are no tags. We use - # a heuristic: assume all version tags have a digit. The old git %d - # expansion behaves like git log --decorate=short and strips out the - # refs/heads/ and refs/tags/ prefixes that would let us distinguish - # between branches and tags. By ignoring refnames without digits, we - # filter out many common branch names like "release" and - # "stabilization", as well as "HEAD" and "master". - tags = {r for r in refs if re.search(r"\d", r)} - if verbose: - print("discarding '%s', no digits" % ",".join(refs - tags)) - if verbose: - print("likely tags: %s" % ",".join(sorted(tags))) - for ref in sorted(tags): - # sorting will prefer e.g. "2.0" over "2.0rc1" - if ref.startswith(tag_prefix): - r = ref[len(tag_prefix) :] - # Filter out refs that exactly match prefix or that don't start - # with a number once the prefix is stripped (mostly a concern - # when prefix is '') - if not re.match(r"\d", r): - continue - if verbose: - print("picking %s" % r) - return { - "version": r, - "full-revisionid": keywords["full"].strip(), - "dirty": False, - "error": None, - "date": date, - } - # no suitable tags, so version is "0+unknown", but full hex is still there - if verbose: - print("no suitable tags, using unknown + full revision id") - return { - "version": "0+unknown", - "full-revisionid": keywords["full"].strip(), - "dirty": False, - "error": "no suitable tags", - "date": None, - } - - -@register_vcs_handler("git", "pieces_from_vcs") -def git_pieces_from_vcs(tag_prefix, root, verbose, runner=run_command): - """Get version from 'git describe' in the root of the source tree. - - This only gets called if the git-archive 'subst' keywords were *not* - expanded, and _version.py hasn't already been rewritten with a short - version string, meaning we're inside a checked out source tree. - """ - GITS = ["git"] - TAG_PREFIX_REGEX = "*" - if sys.platform == "win32": - GITS = ["git.cmd", "git.exe"] - TAG_PREFIX_REGEX = r"\*" - - _, rc = runner(GITS, ["rev-parse", "--git-dir"], cwd=root, hide_stderr=True) - if rc != 0: - if verbose: - print("Directory %s not under git control" % root) - raise NotThisMethod("'git rev-parse --git-dir' returned error") - - # if there is a tag matching tag_prefix, this yields TAG-NUM-gHEX[-dirty] - # if there isn't one, this yields HEX[-dirty] (no NUM) - describe_out, rc = runner( - GITS, - [ - "describe", - "--tags", - "--dirty", - "--always", - "--long", - "--match", - f"{tag_prefix}{TAG_PREFIX_REGEX}", - ], - cwd=root, - ) - # --long was added in git-1.5.5 - if describe_out is None: - raise NotThisMethod("'git describe' failed") - describe_out = describe_out.strip() - full_out, rc = runner(GITS, ["rev-parse", "HEAD"], cwd=root) - if full_out is None: - raise NotThisMethod("'git rev-parse' failed") - full_out = full_out.strip() - - pieces = {} - pieces["long"] = full_out - pieces["short"] = full_out[:7] # maybe improved later - pieces["error"] = None - - branch_name, rc = runner(GITS, ["rev-parse", "--abbrev-ref", "HEAD"], cwd=root) - # --abbrev-ref was added in git-1.6.3 - if rc != 0 or branch_name is None: - raise NotThisMethod("'git rev-parse --abbrev-ref' returned error") - branch_name = branch_name.strip() - - if branch_name == "HEAD": - # If we aren't exactly on a branch, pick a branch which represents - # the current commit. If all else fails, we are on a branchless - # commit. - branches, rc = runner(GITS, ["branch", "--contains"], cwd=root) - # --contains was added in git-1.5.4 - if rc != 0 or branches is None: - raise NotThisMethod("'git branch --contains' returned error") - branches = branches.split("\n") - - # Remove the first line if we're running detached - if "(" in branches[0]: - branches.pop(0) - - # Strip off the leading "* " from the list of branches. - branches = [branch[2:] for branch in branches] - if "master" in branches: - branch_name = "master" - elif not branches: - branch_name = None - else: - # Pick the first branch that is returned. Good or bad. - branch_name = branches[0] - - pieces["branch"] = branch_name - - # parse describe_out. It will be like TAG-NUM-gHEX[-dirty] or HEX[-dirty] - # TAG might have hyphens. - git_describe = describe_out - - # look for -dirty suffix - dirty = git_describe.endswith("-dirty") - pieces["dirty"] = dirty - if dirty: - git_describe = git_describe[: git_describe.rindex("-dirty")] - - # now we have TAG-NUM-gHEX or HEX - - if "-" in git_describe: - # TAG-NUM-gHEX - mo = re.search(r"^(.+)-(\d+)-g([0-9a-f]+)$", git_describe) - if not mo: - # unparsable. Maybe git-describe is misbehaving? - pieces["error"] = "unable to parse git-describe output: '%s'" % describe_out - return pieces - - # tag - full_tag = mo.group(1) - if not full_tag.startswith(tag_prefix): - if verbose: - fmt = "tag '%s' doesn't start with prefix '%s'" - print(fmt % (full_tag, tag_prefix)) - pieces["error"] = f"tag '{full_tag}' doesn't start with prefix '{tag_prefix}'" - return pieces - pieces["closest-tag"] = full_tag[len(tag_prefix) :] - - # distance: number of commits since tag - pieces["distance"] = int(mo.group(2)) - - # commit: short hex revision ID - pieces["short"] = mo.group(3) - - else: - # HEX: no tags - pieces["closest-tag"] = None - count_out, rc = runner(GITS, ["rev-list", "HEAD", "--count"], cwd=root) - pieces["distance"] = int(count_out) # total number of commits - - # commit date: see ISO-8601 comment in git_versions_from_keywords() - date = runner(GITS, ["show", "-s", "--format=%ci", "HEAD"], cwd=root)[0].strip() - # Use only the last line. Previous lines may contain GPG signature - # information. - date = date.splitlines()[-1] - pieces["date"] = date.strip().replace(" ", "T", 1).replace(" ", "", 1) - - return pieces - - -def do_vcs_install(manifest_in, versionfile_source, ipy): - """Git-specific installation logic for Versioneer. - - For Git, this means creating/changing .gitattributes to mark _version.py - for export-subst keyword substitution. - """ - GITS = ["git"] - if sys.platform == "win32": - GITS = ["git.cmd", "git.exe"] - files = [manifest_in, versionfile_source] - if ipy: - files.append(ipy) - try: - my_path = __file__ - if my_path.endswith(".pyc") or my_path.endswith(".pyo"): - my_path = os.path.splitext(my_path)[0] + ".py" - versioneer_file = os.path.relpath(my_path) - except NameError: - versioneer_file = "versioneer.py" - files.append(versioneer_file) - present = False - try: - with open(".gitattributes") as fobj: - for line in fobj: - if line.strip().startswith(versionfile_source): - if "export-subst" in line.strip().split()[1:]: - present = True - break - except OSError: - pass - if not present: - with open(".gitattributes", "a+") as fobj: - fobj.write(f"{versionfile_source} export-subst\n") - files.append(".gitattributes") - run_command(GITS, ["add", "--"] + files) - - -def versions_from_parentdir(parentdir_prefix, root, verbose): - """Try to determine the version from the parent directory name. - - Source tarballs conventionally unpack into a directory that includes both - the project name and a version string. We will also support searching up - two directory levels for an appropriately named parent directory - """ - rootdirs = [] - - for _ in range(3): - dirname = os.path.basename(root) - if dirname.startswith(parentdir_prefix): - return { - "version": dirname[len(parentdir_prefix) :], - "full-revisionid": None, - "dirty": False, - "error": None, - "date": None, - } - rootdirs.append(root) - root = os.path.dirname(root) # up a level - - if verbose: - print( - "Tried directories %s but none started with prefix %s" - % (str(rootdirs), parentdir_prefix) - ) - raise NotThisMethod("rootdir doesn't start with parentdir_prefix") - - -SHORT_VERSION_PY = """ -# This file was generated by 'versioneer.py' (0.21) from -# revision-control system data, or from the parent directory name of an -# unpacked source archive. Distribution tarballs contain a pre-generated copy -# of this file. - -import json - -version_json = ''' -%s -''' # END VERSION_JSON - - -def get_versions(): - return json.loads(version_json) -""" - - -def versions_from_file(filename): - """Try to determine the version from _version.py if present.""" - try: - with open(filename) as f: - contents = f.read() - except OSError: - raise NotThisMethod("unable to read _version.py") - mo = re.search(r"version_json = '''\n(.*)''' # END VERSION_JSON", contents, re.M | re.S) - if not mo: - mo = re.search(r"version_json = '''\r\n(.*)''' # END VERSION_JSON", contents, re.M | re.S) - if not mo: - raise NotThisMethod("no version_json in _version.py") - return json.loads(mo.group(1)) - - -def write_to_version_file(filename, versions): - """Write the given version number to the given _version.py file.""" - os.unlink(filename) - contents = json.dumps(versions, sort_keys=True, indent=1, separators=(",", ": ")) - with open(filename, "w") as f: - f.write(SHORT_VERSION_PY % contents) - - print("set {} to '{}'".format(filename, versions["version"])) - - -def plus_or_dot(pieces): - """Return a + if we don't already have one, else return a .""" - if "+" in pieces.get("closest-tag", ""): - return "." - return "+" - - -def render_pep440(pieces): - """Build up version string, with post-release "local version identifier". - - Our goal: TAG[+DISTANCE.gHEX[.dirty]] . Note that if you - get a tagged build and then dirty it, you'll get TAG+0.gHEX.dirty - - Exceptions: - 1: no tags. git_describe was just HEX. 0+untagged.DISTANCE.gHEX[.dirty] - """ - if pieces["closest-tag"]: - rendered = pieces["closest-tag"] - if pieces["distance"] or pieces["dirty"]: - rendered += plus_or_dot(pieces) - rendered += "%d.g%s" % (pieces["distance"], pieces["short"]) - if pieces["dirty"]: - rendered += ".dirty" - else: - # exception #1 - rendered = "0+untagged.%d.g%s" % (pieces["distance"], pieces["short"]) - if pieces["dirty"]: - rendered += ".dirty" - return rendered - - -def render_pep440_branch(pieces): - """TAG[[.dev0]+DISTANCE.gHEX[.dirty]] . - - The ".dev0" means not master branch. Note that .dev0 sorts backwards - (a feature branch will appear "older" than the master branch). - - Exceptions: - 1: no tags. 0[.dev0]+untagged.DISTANCE.gHEX[.dirty] - """ - if pieces["closest-tag"]: - rendered = pieces["closest-tag"] - if pieces["distance"] or pieces["dirty"]: - if pieces["branch"] != "master": - rendered += ".dev0" - rendered += plus_or_dot(pieces) - rendered += "%d.g%s" % (pieces["distance"], pieces["short"]) - if pieces["dirty"]: - rendered += ".dirty" - else: - # exception #1 - rendered = "0" - if pieces["branch"] != "master": - rendered += ".dev0" - rendered += "+untagged.%d.g%s" % (pieces["distance"], pieces["short"]) - if pieces["dirty"]: - rendered += ".dirty" - return rendered - - -def pep440_split_post(ver): - """Split pep440 version string at the post-release segment. - - Returns the release segments before the post-release and the - post-release version number (or -1 if no post-release segment is present). - """ - vc = str.split(ver, ".post") - return vc[0], int(vc[1] or 0) if len(vc) == 2 else None - - -def render_pep440_pre(pieces): - """TAG[.postN.devDISTANCE] -- No -dirty. - - Exceptions: - 1: no tags. 0.post0.devDISTANCE - """ - if pieces["closest-tag"]: - if pieces["distance"]: - # update the post release segment - tag_version, post_version = pep440_split_post(pieces["closest-tag"]) - rendered = tag_version - if post_version is not None: - rendered += ".post%d.dev%d" % (post_version + 1, pieces["distance"]) - else: - rendered += ".post0.dev%d" % (pieces["distance"]) - else: - # no commits, use the tag as the version - rendered = pieces["closest-tag"] - else: - # exception #1 - rendered = "0.post0.dev%d" % pieces["distance"] - return rendered - - -def render_pep440_post(pieces): - """TAG[.postDISTANCE[.dev0]+gHEX] . - - The ".dev0" means dirty. Note that .dev0 sorts backwards - (a dirty tree will appear "older" than the corresponding clean one), - but you shouldn't be releasing software with -dirty anyways. - - Exceptions: - 1: no tags. 0.postDISTANCE[.dev0] - """ - if pieces["closest-tag"]: - rendered = pieces["closest-tag"] - if pieces["distance"] or pieces["dirty"]: - rendered += ".post%d" % pieces["distance"] - if pieces["dirty"]: - rendered += ".dev0" - rendered += plus_or_dot(pieces) - rendered += "g%s" % pieces["short"] - else: - # exception #1 - rendered = "0.post%d" % pieces["distance"] - if pieces["dirty"]: - rendered += ".dev0" - rendered += "+g%s" % pieces["short"] - return rendered - - -def render_pep440_post_branch(pieces): - """TAG[.postDISTANCE[.dev0]+gHEX[.dirty]] . - - The ".dev0" means not master branch. - - Exceptions: - 1: no tags. 0.postDISTANCE[.dev0]+gHEX[.dirty] - """ - if pieces["closest-tag"]: - rendered = pieces["closest-tag"] - if pieces["distance"] or pieces["dirty"]: - rendered += ".post%d" % pieces["distance"] - if pieces["branch"] != "master": - rendered += ".dev0" - rendered += plus_or_dot(pieces) - rendered += "g%s" % pieces["short"] - if pieces["dirty"]: - rendered += ".dirty" - else: - # exception #1 - rendered = "0.post%d" % pieces["distance"] - if pieces["branch"] != "master": - rendered += ".dev0" - rendered += "+g%s" % pieces["short"] - if pieces["dirty"]: - rendered += ".dirty" - return rendered - - -def render_pep440_old(pieces): - """TAG[.postDISTANCE[.dev0]] . - - The ".dev0" means dirty. - - Exceptions: - 1: no tags. 0.postDISTANCE[.dev0] - """ - if pieces["closest-tag"]: - rendered = pieces["closest-tag"] - if pieces["distance"] or pieces["dirty"]: - rendered += ".post%d" % pieces["distance"] - if pieces["dirty"]: - rendered += ".dev0" - else: - # exception #1 - rendered = "0.post%d" % pieces["distance"] - if pieces["dirty"]: - rendered += ".dev0" - return rendered - - -def render_git_describe(pieces): - """TAG[-DISTANCE-gHEX][-dirty]. - - Like 'git describe --tags --dirty --always'. - - Exceptions: - 1: no tags. HEX[-dirty] (note: no 'g' prefix) - """ - if pieces["closest-tag"]: - rendered = pieces["closest-tag"] - if pieces["distance"]: - rendered += "-%d-g%s" % (pieces["distance"], pieces["short"]) - else: - # exception #1 - rendered = pieces["short"] - if pieces["dirty"]: - rendered += "-dirty" - return rendered - - -def render_git_describe_long(pieces): - """TAG-DISTANCE-gHEX[-dirty]. - - Like 'git describe --tags --dirty --always -long'. - The distance/hash is unconditional. - - Exceptions: - 1: no tags. HEX[-dirty] (note: no 'g' prefix) - """ - if pieces["closest-tag"]: - rendered = pieces["closest-tag"] - rendered += "-%d-g%s" % (pieces["distance"], pieces["short"]) - else: - # exception #1 - rendered = pieces["short"] - if pieces["dirty"]: - rendered += "-dirty" - return rendered - - -def render(pieces, style): - """Render the given version pieces into the requested style.""" - if pieces["error"]: - return { - "version": "unknown", - "full-revisionid": pieces.get("long"), - "dirty": None, - "error": pieces["error"], - "date": None, - } - - if not style or style == "default": - style = "pep440" # the default - - if style == "pep440": - rendered = render_pep440(pieces) - elif style == "pep440-branch": - rendered = render_pep440_branch(pieces) - elif style == "pep440-pre": - rendered = render_pep440_pre(pieces) - elif style == "pep440-post": - rendered = render_pep440_post(pieces) - elif style == "pep440-post-branch": - rendered = render_pep440_post_branch(pieces) - elif style == "pep440-old": - rendered = render_pep440_old(pieces) - elif style == "git-describe": - rendered = render_git_describe(pieces) - elif style == "git-describe-long": - rendered = render_git_describe_long(pieces) - else: - raise ValueError("unknown style '%s'" % style) - - return { - "version": rendered, - "full-revisionid": pieces["long"], - "dirty": pieces["dirty"], - "error": None, - "date": pieces.get("date"), - } - - -class VersioneerBadRootError(Exception): - """The project root directory is unknown or missing key files.""" - - -def get_versions(verbose=False): - """Get the project version from whatever source is available. - - Returns dict with two keys: 'version' and 'full'. - """ - if "versioneer" in sys.modules: - # see the discussion in cmdclass.py:get_cmdclass() - del sys.modules["versioneer"] - - root = get_root() - cfg = get_config_from_root(root) - - assert cfg.VCS is not None, "please set [versioneer]VCS= in setup.cfg" - handlers = HANDLERS.get(cfg.VCS) - assert handlers, "unrecognized VCS '%s'" % cfg.VCS - verbose = verbose or cfg.verbose - assert cfg.versionfile_source is not None, "please set versioneer.versionfile_source" - assert cfg.tag_prefix is not None, "please set versioneer.tag_prefix" - - versionfile_abs = os.path.join(root, cfg.versionfile_source) - - # extract version from first of: _version.py, VCS command (e.g. 'git - # describe'), parentdir. This is meant to work for developers using a - # source checkout, for users of a tarball created by 'setup.py sdist', - # and for users of a tarball/zipball created by 'git archive' or github's - # download-from-tag feature or the equivalent in other VCSes. - - get_keywords_f = handlers.get("get_keywords") - from_keywords_f = handlers.get("keywords") - if get_keywords_f and from_keywords_f: - try: - keywords = get_keywords_f(versionfile_abs) - ver = from_keywords_f(keywords, cfg.tag_prefix, verbose) - if verbose: - print("got version from expanded keyword %s" % ver) - return ver - except NotThisMethod: - pass - - try: - ver = versions_from_file(versionfile_abs) - if verbose: - print(f"got version from file {versionfile_abs} {ver}") - return ver - except NotThisMethod: - pass - - from_vcs_f = handlers.get("pieces_from_vcs") - if from_vcs_f: - try: - pieces = from_vcs_f(cfg.tag_prefix, root, verbose) - ver = render(pieces, cfg.style) - if verbose: - print("got version from VCS %s" % ver) - return ver - except NotThisMethod: - pass - - try: - if cfg.parentdir_prefix: - ver = versions_from_parentdir(cfg.parentdir_prefix, root, verbose) - if verbose: - print("got version from parentdir %s" % ver) - return ver - except NotThisMethod: - pass - - if verbose: - print("unable to compute version") - - return { - "version": "0+unknown", - "full-revisionid": None, - "dirty": None, - "error": "unable to compute version", - "date": None, - } - - -def get_version(): - """Get the short version string for this project.""" - return get_versions()["version"] - - -def get_cmdclass(cmdclass=None): - """Get the custom setuptools/distutils subclasses used by Versioneer. - - If the package uses a different cmdclass (e.g. one from numpy), it - should be provide as an argument. - """ - if "versioneer" in sys.modules: - del sys.modules["versioneer"] - # this fixes the "python setup.py develop" case (also 'install' and - # 'easy_install .'), in which subdependencies of the main project are - # built (using setup.py bdist_egg) in the same python process. Assume - # a main project A and a dependency B, which use different versions - # of Versioneer. A's setup.py imports A's Versioneer, leaving it in - # sys.modules by the time B's setup.py is executed, causing B to run - # with the wrong versioneer. Setuptools wraps the sub-dep builds in a - # sandbox that restores sys.modules to it's pre-build state, so the - # parent is protected against the child's "import versioneer". By - # removing ourselves from sys.modules here, before the child build - # happens, we protect the child from the parent's versioneer too. - # Also see https://github.com/python-versioneer/python-versioneer/issues/52 - - cmds = {} if cmdclass is None else cmdclass.copy() - - # we add "version" to both distutils and setuptools - from distutils.core import Command - - class cmd_version(Command): - description = "report generated version string" - user_options = [] - boolean_options = [] - - def initialize_options(self): - pass - - def finalize_options(self): - pass - - def run(self): - vers = get_versions(verbose=True) - print("Version: %s" % vers["version"]) - print(" full-revisionid: %s" % vers.get("full-revisionid")) - print(" dirty: %s" % vers.get("dirty")) - print(" date: %s" % vers.get("date")) - if vers["error"]: - print(" error: %s" % vers["error"]) - - cmds["version"] = cmd_version - - # we override "build_py" in both distutils and setuptools - # - # most invocation pathways end up running build_py: - # distutils/build -> build_py - # distutils/install -> distutils/build ->.. - # setuptools/bdist_wheel -> distutils/install ->.. - # setuptools/bdist_egg -> distutils/install_lib -> build_py - # setuptools/install -> bdist_egg ->.. - # setuptools/develop -> ? - # pip install: - # copies source tree to a tempdir before running egg_info/etc - # if .git isn't copied too, 'git describe' will fail - # then does setup.py bdist_wheel, or sometimes setup.py install - # setup.py egg_info -> ? - - # we override different "build_py" commands for both environments - if "build_py" in cmds: - _build_py = cmds["build_py"] - elif "setuptools" in sys.modules: - from setuptools.command.build_py import build_py as _build_py - else: - from distutils.command.build_py import build_py as _build_py - - class cmd_build_py(_build_py): - def run(self): - root = get_root() - cfg = get_config_from_root(root) - versions = get_versions() - _build_py.run(self) - # now locate _version.py in the new build/ directory and replace - # it with an updated value - if cfg.versionfile_build: - target_versionfile = os.path.join(self.build_lib, cfg.versionfile_build) - print("UPDATING %s" % target_versionfile) - write_to_version_file(target_versionfile, versions) - - cmds["build_py"] = cmd_build_py - - if "build_ext" in cmds: - _build_ext = cmds["build_ext"] - elif "setuptools" in sys.modules: - from setuptools.command.build_ext import build_ext as _build_ext - else: - from distutils.command.build_ext import build_ext as _build_ext - - class cmd_build_ext(_build_ext): - def run(self): - root = get_root() - cfg = get_config_from_root(root) - versions = get_versions() - _build_ext.run(self) - if self.inplace: - # build_ext --inplace will only build extensions in - # build/lib<..> dir with no _version.py to write to. - # As in place builds will already have a _version.py - # in the module dir, we do not need to write one. - return - # now locate _version.py in the new build/ directory and replace - # it with an updated value - target_versionfile = os.path.join(self.build_lib, cfg.versionfile_build) - print("UPDATING %s" % target_versionfile) - write_to_version_file(target_versionfile, versions) - - cmds["build_ext"] = cmd_build_ext - - if "cx_Freeze" in sys.modules: # cx_freeze enabled? - from cx_Freeze.dist import build_exe as _build_exe - - # nczeczulin reports that py2exe won't like the pep440-style string - # as FILEVERSION, but it can be used for PRODUCTVERSION, e.g. - # setup(console=[{ - # "version": versioneer.get_version().split("+", 1)[0], # FILEVERSION - # "product_version": versioneer.get_version(), - # ... - - class cmd_build_exe(_build_exe): - def run(self): - root = get_root() - cfg = get_config_from_root(root) - versions = get_versions() - target_versionfile = cfg.versionfile_source - print("UPDATING %s" % target_versionfile) - write_to_version_file(target_versionfile, versions) - - _build_exe.run(self) - os.unlink(target_versionfile) - with open(cfg.versionfile_source, "w") as f: - LONG = LONG_VERSION_PY[cfg.VCS] - f.write( - LONG - % { - "DOLLAR": "$", - "STYLE": cfg.style, - "TAG_PREFIX": cfg.tag_prefix, - "PARENTDIR_PREFIX": cfg.parentdir_prefix, - "VERSIONFILE_SOURCE": cfg.versionfile_source, - } - ) - - cmds["build_exe"] = cmd_build_exe - del cmds["build_py"] - - if "py2exe" in sys.modules: # py2exe enabled? - from py2exe.distutils_buildexe import py2exe as _py2exe - - class cmd_py2exe(_py2exe): - def run(self): - root = get_root() - cfg = get_config_from_root(root) - versions = get_versions() - target_versionfile = cfg.versionfile_source - print("UPDATING %s" % target_versionfile) - write_to_version_file(target_versionfile, versions) - - _py2exe.run(self) - os.unlink(target_versionfile) - with open(cfg.versionfile_source, "w") as f: - LONG = LONG_VERSION_PY[cfg.VCS] - f.write( - LONG - % { - "DOLLAR": "$", - "STYLE": cfg.style, - "TAG_PREFIX": cfg.tag_prefix, - "PARENTDIR_PREFIX": cfg.parentdir_prefix, - "VERSIONFILE_SOURCE": cfg.versionfile_source, - } - ) - - cmds["py2exe"] = cmd_py2exe - - # we override different "sdist" commands for both environments - if "sdist" in cmds: - _sdist = cmds["sdist"] - elif "setuptools" in sys.modules: - from setuptools.command.sdist import sdist as _sdist - else: - from distutils.command.sdist import sdist as _sdist - - class cmd_sdist(_sdist): - def run(self): - versions = get_versions() - self._versioneer_generated_versions = versions - # unless we update this, the command will keep using the old - # version - self.distribution.metadata.version = versions["version"] - return _sdist.run(self) - - def make_release_tree(self, base_dir, files): - root = get_root() - cfg = get_config_from_root(root) - _sdist.make_release_tree(self, base_dir, files) - # now locate _version.py in the new base_dir directory - # (remembering that it may be a hardlink) and replace it with an - # updated value - target_versionfile = os.path.join(base_dir, cfg.versionfile_source) - print("UPDATING %s" % target_versionfile) - write_to_version_file(target_versionfile, self._versioneer_generated_versions) - - cmds["sdist"] = cmd_sdist - - return cmds - - -CONFIG_ERROR = """ -setup.cfg is missing the necessary Versioneer configuration. You need -a section like: - - [versioneer] - VCS = git - style = pep440 - versionfile_source = src/myproject/_version.py - versionfile_build = myproject/_version.py - tag_prefix = - parentdir_prefix = myproject- - -You will also need to edit your setup.py to use the results: - - import versioneer - setup(version=versioneer.get_version(), - cmdclass=versioneer.get_cmdclass(), ...) - -Please read the docstring in ./versioneer.py for configuration instructions, -edit setup.cfg, and re-run the installer or 'python versioneer.py setup'. -""" - -SAMPLE_CONFIG = """ -# See the docstring in versioneer.py for instructions. Note that you must -# re-run 'versioneer.py setup' after changing this section, and commit the -# resulting files. - -[versioneer] -#VCS = git -#style = pep440 -#versionfile_source = -#versionfile_build = -#tag_prefix = -#parentdir_prefix = - -""" - -OLD_SNIPPET = """ -from ._version import get_versions -__version__ = get_versions()['version'] -del get_versions -""" - -INIT_PY_SNIPPET = """ -from . import {0} -__version__ = {0}.get_versions()['version'] -""" - - -def do_setup(): - """Do main VCS-independent setup function for installing Versioneer.""" - root = get_root() - try: - cfg = get_config_from_root(root) - except (OSError, configparser.NoSectionError, configparser.NoOptionError) as e: - if isinstance(e, (OSError, configparser.NoSectionError)): - print("Adding sample versioneer config to setup.cfg", file=sys.stderr) - with open(os.path.join(root, "setup.cfg"), "a") as f: - f.write(SAMPLE_CONFIG) - print(CONFIG_ERROR, file=sys.stderr) - return 1 - - print(" creating %s" % cfg.versionfile_source) - with open(cfg.versionfile_source, "w") as f: - LONG = LONG_VERSION_PY[cfg.VCS] - f.write( - LONG - % { - "DOLLAR": "$", - "STYLE": cfg.style, - "TAG_PREFIX": cfg.tag_prefix, - "PARENTDIR_PREFIX": cfg.parentdir_prefix, - "VERSIONFILE_SOURCE": cfg.versionfile_source, - } - ) - - ipy = os.path.join(os.path.dirname(cfg.versionfile_source), "__init__.py") - if os.path.exists(ipy): - try: - with open(ipy) as f: - old = f.read() - except OSError: - old = "" - module = os.path.splitext(os.path.basename(cfg.versionfile_source))[0] - snippet = INIT_PY_SNIPPET.format(module) - if OLD_SNIPPET in old: - print(" replacing boilerplate in %s" % ipy) - with open(ipy, "w") as f: - f.write(old.replace(OLD_SNIPPET, snippet)) - elif snippet not in old: - print(" appending to %s" % ipy) - with open(ipy, "a") as f: - f.write(snippet) - else: - print(" %s unmodified" % ipy) - else: - print(" %s doesn't exist, ok" % ipy) - ipy = None - - # Make sure both the top-level "versioneer.py" and versionfile_source - # (PKG/_version.py, used by runtime code) are in MANIFEST.in, so - # they'll be copied into source distributions. Pip won't be able to - # install the package without this. - manifest_in = os.path.join(root, "MANIFEST.in") - simple_includes = set() - try: - with open(manifest_in) as f: - for line in f: - if line.startswith("include "): - for include in line.split()[1:]: - simple_includes.add(include) - except OSError: - pass - # That doesn't cover everything MANIFEST.in can do - # (http://docs.python.org/2/distutils/sourcedist.html#commands), so - # it might give some false negatives. Appending redundant 'include' - # lines is safe, though. - if "versioneer.py" not in simple_includes: - print(" appending 'versioneer.py' to MANIFEST.in") - with open(manifest_in, "a") as f: - f.write("include versioneer.py\n") - else: - print(" 'versioneer.py' already in MANIFEST.in") - if cfg.versionfile_source not in simple_includes: - print(" appending versionfile_source ('%s') to MANIFEST.in" % cfg.versionfile_source) - with open(manifest_in, "a") as f: - f.write("include %s\n" % cfg.versionfile_source) - else: - print(" versionfile_source already in MANIFEST.in") - - # Make VCS-specific changes. For git, this means creating/changing - # .gitattributes to mark _version.py for export-subst keyword - # substitution. - do_vcs_install(manifest_in, cfg.versionfile_source, ipy) - return 0 - - -def scan_setup_py(): - """Validate the contents of setup.py against Versioneer's expectations.""" - found = set() - setters = False - errors = 0 - with open("setup.py") as f: - for line in f.readlines(): - if "import versioneer" in line: - found.add("import") - if "versioneer.get_cmdclass()" in line: - found.add("cmdclass") - if "versioneer.get_version()" in line: - found.add("get_version") - if "versioneer.VCS" in line: - setters = True - if "versioneer.versionfile_source" in line: - setters = True - if len(found) != 3: - print("") - print("Your setup.py appears to be missing some important items") - print("(but I might be wrong). Please make sure it has something") - print("roughly like the following:") - print("") - print(" import versioneer") - print(" setup( version=versioneer.get_version(),") - print(" cmdclass=versioneer.get_cmdclass(), ...)") - print("") - errors += 1 - if setters: - print("You should remove lines like 'versioneer.VCS = ' and") - print("'versioneer.versionfile_source = ' . This configuration") - print("now lives in setup.cfg, and should be removed from setup.py") - print("") - errors += 1 - return errors - - -if __name__ == "__main__": - cmd = sys.argv[1] - if cmd == "setup": - errors = do_setup() - errors += scan_setup_py() - if errors: - sys.exit(1) From 67043d120e011509cdebeb99f4c13b2c8c99d0b2 Mon Sep 17 00:00:00 2001 From: Adam Lugowski Date: Sun, 12 Feb 2023 16:48:43 -0800 Subject: [PATCH 112/193] MSVC complex values (#68) * MSVC complex values * Give build.py a more unique name --- MANIFEST.in | 1 + build_graphblas_cffi.py | 70 ++++++++++++++++++++++++++++++++++ setup.py | 15 +++++++- suitesparse_graphblas/build.py | 41 -------------------- 4 files changed, 85 insertions(+), 42 deletions(-) create mode 100644 build_graphblas_cffi.py delete mode 100644 suitesparse_graphblas/build.py diff --git a/MANIFEST.in b/MANIFEST.in index 4d7b6d3..c2e230d 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,5 @@ include setup.py +include build_graphblas_cffi.py include README.md include LICENSE include suitesparse_graphblas/*.pxd diff --git a/build_graphblas_cffi.py b/build_graphblas_cffi.py new file mode 100644 index 0000000..0de462b --- /dev/null +++ b/build_graphblas_cffi.py @@ -0,0 +1,70 @@ +import os +import sys +from pathlib import Path + +from cffi import FFI +from setuptools import Extension + +is_win = sys.platform.startswith("win") +ss_g = Path(__file__).parent / "suitesparse_graphblas" + +ffibuilder = FFI() + +include_dirs = [os.path.join(sys.prefix, "include")] +library_dirs = [os.path.join(sys.prefix, "lib")] +if is_win: + include_dirs.append(os.path.join(sys.prefix, "Library", "include")) + library_dirs.append(os.path.join(sys.prefix, "Library", "lib")) + +ffibuilder.set_source( + "suitesparse_graphblas._graphblas", + (ss_g / "source.c").read_text(), + libraries=["graphblas"], + include_dirs=include_dirs, + library_dirs=library_dirs, +) + +ffibuilder.cdef((ss_g / "suitesparse_graphblas.h").read_text()) + + +def get_extension(apply_msvc_patch: bool = None, extra_compile_args=()): + """ + Get a setuptools.Extension version of this CFFI builder. + + In other words, enables `setup(ext_modules=[get_extension()])` + instead of `setup(cffi_modules=["build_graphblas_cffi.py:ffibuilder"])`. + + The main reason for this is to allow a patch for complex values when compiling on MSVC. + MSVC famously lacks support for standard C complex types like `double _Complex` and + `float _Complex`. Instead, MSVC has its own `_Dcomplex` and `_Fcomplex` types. + Cffi's machinery cannot be made to work with these types, so we instead + emit the regular standard C code and patch it manually. + + :param apply_msvc_patch: whether to apply the MSVC patch. + If None then auto-detect based on platform. + :param extra_compile_args: forwarded to Extension constructor. + """ + code_path = ss_g / "_graphblas.c" + ffibuilder.emit_c_code(str(code_path)) + + if apply_msvc_patch is None: + apply_msvc_patch = is_win + + if apply_msvc_patch: + msvc_code = code_path.read_text() + msvc_code = msvc_code.replace("float _Complex", "_Fcomplex") + msvc_code = msvc_code.replace("double _Complex", "_Dcomplex") + code_path.write_text(msvc_code) + + return Extension( + "suitesparse_graphblas._graphblas", + [os.path.join("suitesparse_graphblas", "_graphblas.c")], + libraries=["graphblas"], + include_dirs=include_dirs, + library_dirs=library_dirs, + extra_compile_args=extra_compile_args, + ) + + +if __name__ == "__main__": + ffibuilder.compile(verbose=True) diff --git a/setup.py b/setup.py index 2312fc3..53d4d58 100644 --- a/setup.py +++ b/setup.py @@ -5,6 +5,10 @@ import numpy as np from setuptools import Extension, setup +# Add current directory to the Python path because it's not present when running `pip install .` +sys.path.append(os.path.dirname(__file__)) +import build_graphblas_cffi # noqa: E402 # isort:skip + try: from Cython.Build import cythonize from Cython.Compiler.Options import get_directive_defaults @@ -15,6 +19,13 @@ define_macros = [("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")] +# /d2FH4- flag needed only for early Python 3.8 builds on Windows. +# See https://cibuildwheel.readthedocs.io/en/stable/faq/ +# (Search for flag on page. Full link is long and causes the linter to fail the tests.) +# +# The /std:c11 flag is because the MSVC default is C89. +extra_compile_args = ["/d2FH4-", "/std:c11"] if sys.platform == "win32" else [] + if use_cython: suffix = ".pyx" directive_defaults = get_directive_defaults() @@ -40,13 +51,15 @@ [name], include_dirs=include_dirs, define_macros=define_macros, + extra_compile_args=extra_compile_args, ) for name in glob(f"suitesparse_graphblas/**/*{suffix}", recursive=True) ] if use_cython: ext_modules = cythonize(ext_modules, include_path=include_dirs) +ext_modules.append(build_graphblas_cffi.get_extension(extra_compile_args=extra_compile_args)) + setup( ext_modules=ext_modules, - cffi_modules=["suitesparse_graphblas/build.py:ffibuilder"], ) diff --git a/suitesparse_graphblas/build.py b/suitesparse_graphblas/build.py deleted file mode 100644 index 86a9ead..0000000 --- a/suitesparse_graphblas/build.py +++ /dev/null @@ -1,41 +0,0 @@ -import os -import platform -import sys - -from cffi import FFI - -is_win = sys.platform.startswith("win") -is_arm64 = platform.machine() == "arm64" -is_ppc64le = platform.machine() == "ppc64le" # Use same header as arm64, which *may* work -thisdir = os.path.dirname(__file__) - -ffibuilder = FFI() - -with open(os.path.join(thisdir, "source.c")) as f: - source = f.read() - -include_dirs = [os.path.join(sys.prefix, "include")] -library_dirs = [os.path.join(sys.prefix, "lib")] -if is_win: - include_dirs.append(os.path.join(sys.prefix, "Library", "include")) - library_dirs.append(os.path.join(sys.prefix, "Library", "lib")) - -ffibuilder.set_source( - "suitesparse_graphblas._graphblas", - source, - libraries=["graphblas"], - include_dirs=include_dirs, - library_dirs=library_dirs, -) - -header = "suitesparse_graphblas.h" -if is_win: - header = "suitesparse_graphblas_no_complex.h" -if is_arm64 or is_ppc64le: - header = "suitesparse_graphblas_arm64.h" -gb_cdef = open(os.path.join(thisdir, header)) - -ffibuilder.cdef(gb_cdef.read()) - -if __name__ == "__main__": - ffibuilder.compile(verbose=True) From 49f1b70092cc79134c4005b1d9b09adb338e1171 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Sun, 26 Feb 2023 13:31:00 -0600 Subject: [PATCH 113/193] Add `*.c` files to `.gitignore` to keep `setuptools_git_versioning` happy (#69) --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 2b09537..609ca66 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,9 @@ __pycache__/ *$py.class # C extensions +*.c *.so +*.dll # Distribution / packaging .Python @@ -26,6 +28,7 @@ share/python-wheels/ .installed.cfg *.egg MANIFEST +wheelhouse # PyInstaller # Usually these files are written by a python script from a template From 252f1359bccc0978ad2014b017e9dcf4bb1482a2 Mon Sep 17 00:00:00 2001 From: Jim Kitchen Date: Thu, 30 Mar 2023 11:44:44 -0500 Subject: [PATCH 114/193] Build non-Arm wheels using CI (#73) * Setup cibuildwheel with Linux, macOS, Windows wheels * Ignore GraphBLAS-{version}/ checkout folder to avoid modifying the version * Disable less common dtypes for smaller package * Remove mac arm options --------- Co-authored-by: Adam Lugowski --- .github/workflows/wheels.yml | 183 ++++++++++++++++++++---- .gitignore | 3 + add_arm_to_libomp_dylib.sh | 18 +++ build_graphblas_cffi.py | 6 + pyproject.toml | 6 +- setup.py | 4 +- suitesparse.sh | 77 +++++++++- suitesparse_graphblas/tests/__init__.py | 0 8 files changed, 264 insertions(+), 33 deletions(-) create mode 100755 add_arm_to_libomp_dylib.sh mode change 100644 => 100755 suitesparse.sh delete mode 100644 suitesparse_graphblas/tests/__init__.py diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index f2fda55..7d59053 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -4,36 +4,165 @@ on: release: types: [created] + # Enable Run Workflow button in GitHub UI + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: - wheels: + build_sdist: + name: Build SDist + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Build SDist + run: pipx run build --sdist + + - name: Check metadata + run: pipx run twine check dist/* + + - uses: actions/upload-artifact@v3 + with: + path: dist/*.tar.gz + + + build_wheels: + name: Wheels on ${{ matrix.platform_id }} - ${{ matrix.os }} runs-on: ${{ matrix.os }} - defaults: - run: - shell: bash -l {0} strategy: fail-fast: false matrix: - os: ["ubuntu-latest"] + # Loosely based on scikit-learn's config: + # https://github.com/scikit-learn/scikit-learn/blob/main/.github/workflows/wheels.yml + include: + - os: windows-latest + python-version: "3.8" + platform_id: win_amd64 + + # Linux 64 bit manylinux2014 + - os: ubuntu-latest + python-version: "3.8" + platform_id: manylinux_x86_64 + manylinux_image: manylinux2014 + + # Use x86 macOS runner to build both x86 and ARM. GitHub does not offer M1/M2 yet (only self-hosted). + - os: macos-latest + python-version: "3.8" + platform_id: macosx_x86_64 + steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.8' - - name: Upgrade pip - run: | - python -m pip install --upgrade pip - - name: Build manylinux Python wheels - uses: RalfG/python-wheels-manylinux-build@v0.4.2-manylinux2014_x86_64 - with: - python-versions: 'cp38-cp38 cp39-cp39' - build-requirements: 'cffi numpy>=1.19,<1.20 cython' - pre-build-command: ${{ format('sh suitesparse.sh {0}', github.ref) }} - - name: Publish wheels to PyPI - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} - run: | - pip install twine - twine upload dist/*-manylinux*.whl + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + +# - name: Install tools (macOS) +# if: contains(matrix.os, 'macos') +# # Install coreutils which includes `nproc` used by `make -j` in suitesparse.sh +# # +# # GitHub actions comes with libomp already installed, but for its native arch only. Must build universal one +# # manually so that both x86 and arm builds can be built. +# run: | +# brew install coreutils +# brew install libomp +# sh add_arm_to_libomp_dylib.sh + + - name: Build Wheels + env: + # very verbose + CIBW_BUILD_VERBOSITY: 3 + + # Build SuiteSparse + CIBW_BEFORE_ALL: bash suitesparse.sh ${{ github.ref }} + + # CMAKE_GNUtoMS=ON asks suitesparse.sh to build libraries in MSVC style on Windows. + CIBW_ENVIRONMENT_WINDOWS: CMAKE_GNUtoMS=ON GRAPHBLAS_PREFIX="C:/GraphBLAS" + + # macOS libomp requires special configs. BREW_LIBOMP=1 asks suitesparse.sh to include them. + CIBW_ENVIRONMENT_MACOS: BREW_LIBOMP="1" + + # Uncomment to only build CPython wheels +# CIBW_BUILD: "cp*" + + # macOS: build x86_64 and arm64 + #CIBW_ARCHS_MACOS: "x86_64 arm64" + + # No 32-bit builds + CIBW_SKIP: "*-win32 *_i686 *musl*" + + # Use delvewheel on Windows. + # This copies graphblas.dll into the wheel. "repair" in cibuildwheel parlance includes copying any shared + # libraries from the build host into the wheel to make the wheel self-contained. + # Cibuildwheel includes tools for this for Linux and macOS, and they recommend delvewheel for Windows. + # Note: Currently using a workaround: --no-mangle instead of stripping graphblas.dll + # see https://github.com/adang1345/delvewheel/issues/33 + CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel" + CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair --add-path \"C:\\GraphBLAS\\bin\" --no-mangle \"libgomp-1.dll;libgcc_s_seh-1.dll\" -w {dest_dir} {wheel}" + + # make cibuildwheel install test dependencies from pyproject.toml + CIBW_TEST_EXTRAS: "test" + + # run tests + CIBW_TEST_COMMAND: "pytest {project}/suitesparse_graphblas/tests" + + # GitHub Actions macOS Intel runner cannot run ARM tests. + CIBW_TEST_SKIP: "*-macosx_arm64" + + run: | + python -m pip install cibuildwheel + python -m cibuildwheel --output-dir wheelhouse . + shell: bash + + - uses: actions/upload-artifact@v3 + id: uploadAttempt1 + continue-on-error: true + with: + path: wheelhouse/*.whl + if-no-files-found: error + + # Retry upload if first attempt failed. This happens somewhat randomly and for irregular reasons. + # Logic is a duplicate of previous step. + - uses: actions/upload-artifact@v3 + id: uploadAttempt2 + if: steps.uploadAttempt1.outcome == 'failure' + continue-on-error: false + with: + path: wheelhouse/*.whl + if-no-files-found: error + + upload_all: + name: Upload to PyPI + needs: [build_wheels, build_sdist] + runs-on: ubuntu-latest + if: github.repository == 'GraphBLAS/python-suitesparse-graphblas' +# if: github.event_name == 'release' && github.event.action == 'published' + + steps: + - uses: actions/setup-python@v4 + with: + python-version: "3.x" + + - uses: actions/download-artifact@v3 + with: + name: artifact + path: dist + + - uses: pypa/gh-action-pypi-publish@release/v1 + with: + # PyPI does not allow replacing a file. Without this flag the entire action fails if even a single duplicate exists. + skip_existing: true + verbose: true + # Real PyPI: + password: ${{ secrets.PYPI_TOKEN }} + + # Test PyPI: +# password: ${{ secrets.TEST_PYPI_API_TOKEN }} +# repository_url: https://test.pypi.org/legacy/ diff --git a/.gitignore b/.gitignore index 609ca66..e382cda 100644 --- a/.gitignore +++ b/.gitignore @@ -30,6 +30,9 @@ share/python-wheels/ MANIFEST wheelhouse +# Wheel building stuff +GraphBLAS-*/ + # PyInstaller # Usually these files are written by a python script from a template # before PyInstaller builds the exe, so as to inject date/other infos into it. diff --git a/add_arm_to_libomp_dylib.sh b/add_arm_to_libomp_dylib.sh new file mode 100755 index 0000000..8492c7c --- /dev/null +++ b/add_arm_to_libomp_dylib.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +#mkdir x86lib +mkdir armlib + +# download and unzip both x86 and arm libomp tarballs +#brew fetch --force --bottle-tag=x86_64_monterey libomp +brew fetch --force --bottle-tag=arm64_big_sur libomp + +# untar +#tar -xzf $(brew --cache --bottle-tag=x86_64_monterey libomp) --strip-components 2 -C x86lib +tar -xzf $(brew --cache --bottle-tag=arm64_big_sur libomp) --strip-components 2 -C armlib + +# merge +lipo armlib/lib/libomp.dylib $(brew --prefix libomp)/lib/libomp.dylib -output libomp.dylib -create +cp -f libomp.dylib $(brew --prefix libomp)/lib +rm libomp.dylib +rm -rf armlib diff --git a/build_graphblas_cffi.py b/build_graphblas_cffi.py index 0de462b..dff21e6 100644 --- a/build_graphblas_cffi.py +++ b/build_graphblas_cffi.py @@ -16,6 +16,12 @@ include_dirs.append(os.path.join(sys.prefix, "Library", "include")) library_dirs.append(os.path.join(sys.prefix, "Library", "lib")) + # wheels.yml configures suitesparse.sh to install GraphBLAS here. + prefix = "C:\\GraphBLAS" + include_dirs.append(os.path.join(prefix, "include")) + library_dirs.append(os.path.join(prefix, "lib")) + library_dirs.append(os.path.join(prefix, "bin")) + ffibuilder.set_source( "suitesparse_graphblas._graphblas", (ss_g / "source.c").read_text(), diff --git a/pyproject.toml b/pyproject.toml index 4059c4e..beccc7a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ requires = [ "setuptools >=64", "setuptools-git-versioning", "wheel", - "cffi", + "cffi>=1.11", "cython", "oldest-supported-numpy", ] @@ -27,7 +27,7 @@ maintainers = [ {name = "Michel Pelletier", email = "michel@graphegon.com"}, ] classifiers = [ - "Development Status :: 4 - Beta", + "Development Status :: 5 - Production/Stable", "License :: OSI Approved :: Apache Software License", "Operating System :: MacOS :: MacOS X", "Operating System :: POSIX :: Linux", @@ -45,7 +45,7 @@ classifiers = [ ] dependencies = [ # These are super-old; can/should we update them? - "cffi>=1.0.0", + "cffi>=1.11", "numpy>=1.19", ] [project.urls] diff --git a/setup.py b/setup.py index 53d4d58..860cd3a 100644 --- a/setup.py +++ b/setup.py @@ -58,8 +58,10 @@ if use_cython: ext_modules = cythonize(ext_modules, include_path=include_dirs) -ext_modules.append(build_graphblas_cffi.get_extension(extra_compile_args=extra_compile_args)) +if build_graphblas_cffi.is_win: + ext_modules.append(build_graphblas_cffi.get_extension(extra_compile_args=extra_compile_args)) setup( ext_modules=ext_modules, + cffi_modules=None if build_graphblas_cffi.is_win else ["build_graphblas_cffi.py:ffibuilder"], ) diff --git a/suitesparse.sh b/suitesparse.sh old mode 100644 new mode 100755 index 77410fc..72d805f --- a/suitesparse.sh +++ b/suitesparse.sh @@ -1,14 +1,87 @@ +#!/bin/bash +# parse SuiteSparse version from first argument, a git tag that ends in the version (no leading v) if [[ $1 =~ refs/tags/([0-9]*\.[0-9]*\.[0-9]*)\..*$ ]]; then VERSION=${BASH_REMATCH[1]} else + echo "Specify a SuiteSparse version, such as: $0 refs/tags/7.4.3.0" exit -1 fi echo VERSION: $VERSION +NPROC="$(nproc)" +if [ -z "${NPROC}" ]; then + # Default for platforms that don't have nproc. Mostly Windows. + NPROC="2" +fi + +cmake_params=() +if [ -n "${BREW_LIBOMP}" ]; then + # macOS OpenMP flags. + # FindOpenMP doesn't find brew's libomp, so set the necessary configs manually. + cmake_params+=(-DOpenMP_C_FLAGS="-Xclang -fopenmp -I$(brew --prefix libomp)/include") + cmake_params+=(-DOpenMP_C_LIB_NAMES="libomp") + cmake_params+=(-DOpenMP_libomp_LIBRARY="omp") + export LDFLAGS="-L$(brew --prefix libomp)/lib" + + export CFLAGS="-arch x86_64" +# # build both x86 and ARM +# export CFLAGS="-arch x86_64 -arch arm64" +fi + +if [ -n "${CMAKE_GNUtoMS}" ]; then + # Windows needs .lib libraries, not .a + cmake_params+=(-DCMAKE_GNUtoMS=ON) + # Windows expects 'graphblas.lib', not 'libgraphblas.lib' + cmake_params+=(-DCMAKE_SHARED_LIBRARY_PREFIX=) + cmake_params+=(-DCMAKE_STATIC_LIBRARY_PREFIX=) +fi + +if [ -n "${GRAPHBLAS_PREFIX}" ]; then + echo "GRAPHBLAS_PREFIX=${GRAPHBLAS_PREFIX}" + cmake_params+=(-DCMAKE_INSTALL_PREFIX="${GRAPHBLAS_PREFIX}") +fi + curl -L https://github.com/DrTimothyAldenDavis/GraphBLAS/archive/refs/tags/v${VERSION}.tar.gz | tar xzf - cd GraphBLAS-${VERSION}/build -cmake .. -DCMAKE_BUILD_TYPE=Release -make -j$(nproc) + +# Disable optimizing some rarely-used types for significantly faster builds and significantly smaller wheel size. +# Also the build with all types enabled sometimes stalls on GitHub Actions. Probably due to exceeded resource limits. +# These can still be used, they'll just have reduced performance (AFAIK similar to UDTs). +# echo "#define GxB_NO_BOOL 1" >> ../Source/GB_control.h # +# echo "#define GxB_NO_FP32 1" >> ../Source/GB_control.h # +# echo "#define GxB_NO_FP64 1" >> ../Source/GB_control.h # +echo "#define GxB_NO_FC32 1" >> ../Source/GB_control.h # +echo "#define GxB_NO_FC64 1" >> ../Source/GB_control.h # +# echo "#define GxB_NO_INT16 1" >> ../Source/GB_control.h +# echo "#define GxB_NO_INT32 1" >> ../Source/GB_control.h +# echo "#define GxB_NO_INT64 1" >> ../Source/GB_control.h # +# echo "#define GxB_NO_INT8 1" >> ../Source/GB_control.h +echo "#define GxB_NO_UINT16 1" >> ../Source/GB_control.h +echo "#define GxB_NO_UINT32 1" >> ../Source/GB_control.h +# echo "#define GxB_NO_UINT64 1" >> ../Source/GB_control.h +echo "#define GxB_NO_UINT8 1" >> ../Source/GB_control.h + +# Disable all Source/Generated2 kernels. For workflow development only. +#cmake_params+=(-DCMAKE_CUDA_DEV=1) + +cmake .. -DCMAKE_BUILD_TYPE=Release -G 'Unix Makefiles' "${cmake_params[@]}" +make -j$NPROC make install + +if [ -n "${CMAKE_GNUtoMS}" ]; then + if [ -z "${GRAPHBLAS_PREFIX}" ]; then + # Windows default + GRAPHBLAS_PREFIX="C:/Program Files (x86)" + fi + + # Windows: + # CMAKE_STATIC_LIBRARY_PREFIX is sometimes ignored, possibly when the MinGW toolchain is selected. + # Drop the 'lib' prefix manually. + echo "manually removing lib prefix" + mv "${GRAPHBLAS_PREFIX}/lib/libgraphblas.lib" "${GRAPHBLAS_PREFIX}/lib/graphblas.lib" + mv "${GRAPHBLAS_PREFIX}/lib/libgraphblas.dll.a" "${GRAPHBLAS_PREFIX}/lib/graphblas.dll.a" + # cp instead of mv because the GNU tools expect libgraphblas.dll and the MS tools expect graphblas.dll. + cp "${GRAPHBLAS_PREFIX}/bin/libgraphblas.dll" "${GRAPHBLAS_PREFIX}/bin/graphblas.dll" +fi diff --git a/suitesparse_graphblas/tests/__init__.py b/suitesparse_graphblas/tests/__init__.py deleted file mode 100644 index e69de29..0000000 From 611bb442a4a42f78cd8fd43cfb7ea5622886b77f Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Thu, 30 Mar 2023 16:20:56 -0500 Subject: [PATCH 115/193] Include tests as a module in the package (#75) * Include tests as a module in the package * consistently mark the dtypes we do/don't support --- .github/workflows/wheels.yml | 2 +- MANIFEST.in | 1 - pyproject.toml | 2 +- suitesparse.sh | 12 ++++++------ suitesparse_graphblas/tests/__init__.py | 0 5 files changed, 8 insertions(+), 9 deletions(-) create mode 100644 suitesparse_graphblas/tests/__init__.py diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 7d59053..f8ade8f 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -111,7 +111,7 @@ jobs: CIBW_TEST_EXTRAS: "test" # run tests - CIBW_TEST_COMMAND: "pytest {project}/suitesparse_graphblas/tests" + CIBW_TEST_COMMAND: "pytest --pyargs suitesparse_graphblas" # GitHub Actions macOS Intel runner cannot run ARM tests. CIBW_TEST_SKIP: "*-macosx_arm64" diff --git a/MANIFEST.in b/MANIFEST.in index c2e230d..61cd04d 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -6,4 +6,3 @@ include suitesparse_graphblas/*.pxd include suitesparse_graphblas/*.pyx include suitesparse_graphblas/*.c include suitesparse_graphblas/*.h -include suitesparse_graphblas/tests/*.py diff --git a/pyproject.toml b/pyproject.toml index beccc7a..1a5d5fd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -61,7 +61,7 @@ test = [ [tool.setuptools] packages = [ 'suitesparse_graphblas', - # 'suitesparse_graphblas.tests', + 'suitesparse_graphblas.tests', 'suitesparse_graphblas.io', ] diff --git a/suitesparse.sh b/suitesparse.sh index 72d805f..26b29fb 100755 --- a/suitesparse.sh +++ b/suitesparse.sh @@ -52,15 +52,15 @@ cd GraphBLAS-${VERSION}/build # echo "#define GxB_NO_BOOL 1" >> ../Source/GB_control.h # # echo "#define GxB_NO_FP32 1" >> ../Source/GB_control.h # # echo "#define GxB_NO_FP64 1" >> ../Source/GB_control.h # -echo "#define GxB_NO_FC32 1" >> ../Source/GB_control.h # -echo "#define GxB_NO_FC64 1" >> ../Source/GB_control.h # -# echo "#define GxB_NO_INT16 1" >> ../Source/GB_control.h -# echo "#define GxB_NO_INT32 1" >> ../Source/GB_control.h +echo "#define GxB_NO_FC32 1" >> ../Source/GB_control.h +echo "#define GxB_NO_FC64 1" >> ../Source/GB_control.h +# echo "#define GxB_NO_INT16 1" >> ../Source/GB_control.h # +# echo "#define GxB_NO_INT32 1" >> ../Source/GB_control.h # # echo "#define GxB_NO_INT64 1" >> ../Source/GB_control.h # -# echo "#define GxB_NO_INT8 1" >> ../Source/GB_control.h +# echo "#define GxB_NO_INT8 1" >> ../Source/GB_control.h # echo "#define GxB_NO_UINT16 1" >> ../Source/GB_control.h echo "#define GxB_NO_UINT32 1" >> ../Source/GB_control.h -# echo "#define GxB_NO_UINT64 1" >> ../Source/GB_control.h +# echo "#define GxB_NO_UINT64 1" >> ../Source/GB_control.h # echo "#define GxB_NO_UINT8 1" >> ../Source/GB_control.h # Disable all Source/Generated2 kernels. For workflow development only. diff --git a/suitesparse_graphblas/tests/__init__.py b/suitesparse_graphblas/tests/__init__.py new file mode 100644 index 0000000..e69de29 From 1a5e9f4eafd70b084dd5c31d027f53adcec6b57f Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Fri, 31 Mar 2023 07:39:32 -0500 Subject: [PATCH 116/193] s/skip_existing/skip-existing/g (#77) --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index f8ade8f..0799d87 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -158,7 +158,7 @@ jobs: - uses: pypa/gh-action-pypi-publish@release/v1 with: # PyPI does not allow replacing a file. Without this flag the entire action fails if even a single duplicate exists. - skip_existing: true + skip-existing: true verbose: true # Real PyPI: password: ${{ secrets.PYPI_TOKEN }} From 40fd47ddc8af3004107517cd54e05789dc9bba5d Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Fri, 31 Mar 2023 09:20:20 -0500 Subject: [PATCH 117/193] We no longer need suitesparse_graphblas_arm64.h (#78) --- suitesparse_graphblas/create_headers.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/suitesparse_graphblas/create_headers.py b/suitesparse_graphblas/create_headers.py index 8e973a3..cd9c0b9 100644 --- a/suitesparse_graphblas/create_headers.py +++ b/suitesparse_graphblas/create_headers.py @@ -799,7 +799,7 @@ def main(): # final files used by cffi (with and without complex numbers) final_h = os.path.join(thisdir, "suitesparse_graphblas.h") - final_arm64_h = os.path.join(thisdir, "suitesparse_graphblas_arm64.h") + # final_arm64_h = os.path.join(thisdir, "suitesparse_graphblas_arm64.h") final_no_complex_h = os.path.join(thisdir, "suitesparse_graphblas_no_complex.h") source_c = os.path.join(thisdir, "source.c") @@ -827,30 +827,31 @@ def main(): with open(final_h, "w") as f: f.write("\n".join(text) + "\n") - # Create final header file (arm64) - # Replace all variadic arguments (...) with "char *" - print(f"Step 4: parse header file to create {final_arm64_h}") - orig_text = text - patt = re.compile(r"^(extern GrB_Info .*\(.*)(\.\.\.)(\);)$") - text = [patt.sub(r"\1char *\3", line) for line in orig_text] - with open(final_arm64_h, "w") as f: - f.write("\n".join(text) + "\n") + # NOTE:suitesparse_graphblas.h and suitesparse_graphblas_arm64.h are the same now + # # Create final header file (arm64) + # # Replace all variadic arguments (...) with "char *" + # print(f"Step 4: parse header file to create {final_arm64_h}") + # orig_text = text + # patt = re.compile(r"^(extern GrB_Info .*\(.*)(\.\.\.)(\);)$") + # text = [patt.sub(r"\1char *\3", line) for line in orig_text] + # with open(final_arm64_h, "w") as f: + # f.write("\n".join(text) + "\n") # Create final header file (no complex) - print(f"Step 5: parse header file to create {final_no_complex_h}") + print(f"Step 4: parse header file to create {final_no_complex_h}") groups_no_complex = parse_header(processed_h, skip_complex=True) text = create_header_text(groups_no_complex) with open(final_no_complex_h, "w") as f: f.write("\n".join(text) + "\n") # Create source - print(f"Step 6: create {source_c}") + print(f"Step 5: create {source_c}") text = create_source_text(groups) with open(source_c, "w") as f: f.write("\n".join(text) + "\n") # Check defines - print("Step 7: check #define definitions") + print("Step 6: check #define definitions") with open(graphblas_h) as f: text = f.read() define_lines = re.compile(r".*?#define\s+\w+\s+") From 0062aecd267777242ad73a4f7bf74295a744481f Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Fri, 31 Mar 2023 16:48:56 -0500 Subject: [PATCH 118/193] Update versions in pre-commit (#80) --- .pre-commit-config.yaml | 19 +++++++++++++------ pyproject.toml | 21 ++++++++++++++++++++- 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6f4c629..9ece09c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,12 +20,12 @@ repos: - id: mixed-line-ending # - id: trailing-whitespace - repo: https://github.com/abravalheri/validate-pyproject - rev: v0.12.1 + rev: v0.12.2 hooks: - id: validate-pyproject name: Validate pyproject.toml - repo: https://github.com/myint/autoflake - rev: v2.0.1 + rev: v2.0.2 hooks: - id: autoflake args: [--in-place] @@ -44,7 +44,7 @@ repos: # - id: auto-walrus # args: [--line-length, "100"] - repo: https://github.com/psf/black - rev: 23.1.0 + rev: 23.3.0 hooks: - id: black # - id: black-jupyter @@ -55,14 +55,21 @@ repos: additional_dependencies: &flake8_dependencies # These versions need updated manually - flake8==6.0.0 - - flake8-comprehensions==3.10.1 - - flake8-bugbear==23.1.20 - # - flake8-simplify==0.19.3 + - flake8-comprehensions==3.11.1 + - flake8-bugbear==23.3.23 + # - flake8-simplify==0.20.0 - repo: https://github.com/asottile/yesqa rev: v1.4.0 hooks: - id: yesqa additional_dependencies: *flake8_dependencies + # `pyroma` may help keep our package standards up to date if best practices change. + # This is a "low value" check though and too slow to run as part of pre-commit. + # - repo: https://github.com/regebro/pyroma + # rev: "4.2" + # hooks: + # - id: pyroma + # args: [-n, "10", .] - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.4.0 hooks: diff --git a/pyproject.toml b/pyproject.toml index 1a5d5fd..7265a23 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,15 +17,30 @@ readme = "README.md" requires-python = ">=3.8" license = {file = "LICENSE"} authors = [ - {name = "Erik Welch"}, + {name = "Erik Welch", email = "erik.n.welch@gmail.com"}, {name = "Jim Kitchen"}, {name = "Michel Pelletier"}, + {name = "suitesparse-graphblas contributors"}, ] maintainers = [ {name = "Erik Welch", email = "erik.n.welch@gmail.com"}, {name = "Jim Kitchen", email = "jim22k@gmail.com"}, {name = "Michel Pelletier", email = "michel@graphegon.com"}, ] +keywords = [ + "graphblas", + "graph", + "sparse", + "matrix", + "lagraph", + "suitesparse", + "Networks", + "Graph Theory", + "Mathematics", + "network", + "discrete mathematics", + "math", +] classifiers = [ "Development Status :: 5 - Production/Stable", "License :: OSI Approved :: Apache Software License", @@ -39,9 +54,13 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3 :: Only", + "Intended Audience :: Developers", + "Intended Audience :: Other Audience", "Intended Audience :: Science/Research", "Topic :: Scientific/Engineering", + "Topic :: Scientific/Engineering :: Information Analysis", "Topic :: Scientific/Engineering :: Mathematics", + "Topic :: Software Development :: Libraries :: Python Modules", ] dependencies = [ # These are super-old; can/should we update them? From 7bc3e93852b4291e7b00503999cda02a32628022 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Thu, 20 Apr 2023 09:19:28 -0500 Subject: [PATCH 119/193] Update to SuiteSparse:GraphBLAS v7.4.4 (#82) --- .github/workflows/test.yml | 2 +- .pre-commit-config.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bbc911e..78f5f44 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,7 +19,7 @@ jobs: # os: ["ubuntu-latest"] # source: ["source"] python-version: ["3.8", "3.9", "3.10", "3.11"] - graphblas-version: ["7.4.3"] + graphblas-version: ["7.4.4"] steps: - name: Checkout uses: actions/checkout@v3 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9ece09c..d8ef4a1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,7 +25,7 @@ repos: - id: validate-pyproject name: Validate pyproject.toml - repo: https://github.com/myint/autoflake - rev: v2.0.2 + rev: v2.1.1 hooks: - id: autoflake args: [--in-place] From 1d266a945860682b84d7404f563a8193a2c882dc Mon Sep 17 00:00:00 2001 From: Adam Lugowski Date: Wed, 3 May 2023 07:38:47 -0700 Subject: [PATCH 120/193] Linux aarch64 wheels (#84) * Mac ARM wheels * Linux aarch64 wheels Uses cibuildwheel's QEMU mechanism. --- .github/workflows/wheels.yml | 62 ++++++++++++++++++++++++++---------- add_arm_to_libomp_dylib.sh | 34 +++++++++++++++++++- suitesparse.sh | 25 +++++++++++++-- 3 files changed, 101 insertions(+), 20 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 0799d87..a0b6c9b 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -32,7 +32,7 @@ jobs: build_wheels: - name: Wheels on ${{ matrix.platform_id }} - ${{ matrix.os }} + name: Wheels - ${{ matrix.cibw_archs }} - ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -43,17 +43,30 @@ jobs: - os: windows-latest python-version: "3.8" platform_id: win_amd64 + cibw_archs: "auto" # Linux 64 bit manylinux2014 - os: ubuntu-latest python-version: "3.8" platform_id: manylinux_x86_64 manylinux_image: manylinux2014 + cibw_archs: "native" - # Use x86 macOS runner to build both x86 and ARM. GitHub does not offer M1/M2 yet (only self-hosted). + # Linux 64 bit manylinux2014 for aarch64 + # Separate runner because this requires emulation (only x86 runners are available) and is very slow. + - os: ubuntu-latest + python-version: "3.8" + platform_id: manylinux_x86_64 + manylinux_image: manylinux2014 + cibw_archs: "aarch64" + + # Use x86 macOS runner to build both x86 and ARM. + # GitHub does not offer Apple Silicon yet (only for self-hosted). + # See https://github.com/github/roadmap/issues/528 - os: macos-latest python-version: "3.8" platform_id: macosx_x86_64 + cibw_archs: "x86_64 arm64" steps: - uses: actions/checkout@v3 @@ -64,16 +77,31 @@ jobs: with: python-version: ${{ matrix.python-version }} -# - name: Install tools (macOS) -# if: contains(matrix.os, 'macos') -# # Install coreutils which includes `nproc` used by `make -j` in suitesparse.sh -# # -# # GitHub actions comes with libomp already installed, but for its native arch only. Must build universal one -# # manually so that both x86 and arm builds can be built. -# run: | -# brew install coreutils -# brew install libomp -# sh add_arm_to_libomp_dylib.sh + # aarch64 Linux builds are cross-compiled on x86 runners using emulation + # see https://cibuildwheel.readthedocs.io/en/stable/faq/#emulation + - name: Setup QEMU (for aarch64) + if: matrix.cibw_archs == 'aarch64' + uses: docker/setup-qemu-action@v2 + with: + platforms: arm64 + + - name: Setup env (for aarch64) + if: matrix.cibw_archs == 'aarch64' + # Ask suitesparse.sh to compile faster by optimizing fewer types. Otherwise, the build takes too long to finish + # in 6 hour limit. + run: | + echo "SUITESPARSE_FAST_BUILD=1" >> $GITHUB_ENV + + - name: Install tools (macOS) + if: contains(matrix.os, 'macos') + # Install coreutils which includes `nproc` used by `make -j` in suitesparse.sh + # + # GitHub actions comes with libomp already installed, but for its native arch only. Must build universal one + # manually so that both x86 and arm builds can be built. + run: | + brew install coreutils + brew install libomp + sh add_arm_to_libomp_dylib.sh - name: Build Wheels env: @@ -83,6 +111,8 @@ jobs: # Build SuiteSparse CIBW_BEFORE_ALL: bash suitesparse.sh ${{ github.ref }} + CIBW_ENVIRONMENT_LINUX: SUITESPARSE_FAST_BUILD=${{ env.SUITESPARSE_FAST_BUILD }} + # CMAKE_GNUtoMS=ON asks suitesparse.sh to build libraries in MSVC style on Windows. CIBW_ENVIRONMENT_WINDOWS: CMAKE_GNUtoMS=ON GRAPHBLAS_PREFIX="C:/GraphBLAS" @@ -92,11 +122,11 @@ jobs: # Uncomment to only build CPython wheels # CIBW_BUILD: "cp*" - # macOS: build x86_64 and arm64 - #CIBW_ARCHS_MACOS: "x86_64 arm64" + # Architectures to build specified in matrix + CIBW_ARCHS: ${{ matrix.cibw_archs }} - # No 32-bit builds - CIBW_SKIP: "*-win32 *_i686 *musl*" + # No 32-bit builds, no musllinux, no PyPy aarch64 (only due to build speed, numpy does not ship aarch64 pypy wheels) + CIBW_SKIP: "*-win32 *_i686 *musl* pp*aarch64" # Use delvewheel on Windows. # This copies graphblas.dll into the wheel. "repair" in cibuildwheel parlance includes copying any shared diff --git a/add_arm_to_libomp_dylib.sh b/add_arm_to_libomp_dylib.sh index 8492c7c..5109f98 100755 --- a/add_arm_to_libomp_dylib.sh +++ b/add_arm_to_libomp_dylib.sh @@ -1,4 +1,23 @@ #!/bin/sh +# Construct a universal2 version of homebrew's libomp. +# +# Homebrew's libomp works well to patch Apple clang's missing OpenMP support. The problem is a combination of: +# - Brew installs libomp built for x86 *or* ARM, matching the architecture of the machine it is running on. +# - GitHub Actions only has x86 runners as of now. Check back in Q4 2023. https://github.com/github/roadmap/issues/528 +# - The linker will select the first found libomp, and if that version does not include the expected architecture then +# linking will fail. +# +# One solution is to build a universal2 version of libomp that includes both architectures. That's what this script +# does. It adds the ARM version of libomp to the x86 version. +# +# This script assumes it is running on x86 with x86 libomp already installed. + +if [ "$(arch)" != "x86_64" ] && [ "$(arch)" != "i386" ]; then + echo "Not running on x86 as expected. Running on:" + arch + echo "If the above says arm64 then this hack is no longer necessary. Remove this script from the build." + exit 1; +fi #mkdir x86lib mkdir armlib @@ -11,8 +30,21 @@ brew fetch --force --bottle-tag=arm64_big_sur libomp #tar -xzf $(brew --cache --bottle-tag=x86_64_monterey libomp) --strip-components 2 -C x86lib tar -xzf $(brew --cache --bottle-tag=arm64_big_sur libomp) --strip-components 2 -C armlib -# merge +# ARM and x86 dylibs have different install names due to different brew install directories. +# The x86 install name will be expected so make the ARM install name match. +X86_INSTALL_NAME="$(otool -X -D $(brew --prefix libomp)/lib/libomp.dylib)" +install_name_tool -id "${X86_INSTALL_NAME}" armlib/lib/libomp.dylib +codesign --force -s - armlib/lib/libomp.dylib + +# merge the downloaded (arm) libomp with the already installed (x86) libomp to create a universal libomp lipo armlib/lib/libomp.dylib $(brew --prefix libomp)/lib/libomp.dylib -output libomp.dylib -create + +# print contents of universal library for reference +otool -arch all -L libomp.dylib + +# replace the x86-only libomp with the newly-created universal one cp -f libomp.dylib $(brew --prefix libomp)/lib + +# clean up rm libomp.dylib rm -rf armlib diff --git a/suitesparse.sh b/suitesparse.sh index 26b29fb..5d930dc 100755 --- a/suitesparse.sh +++ b/suitesparse.sh @@ -25,9 +25,8 @@ if [ -n "${BREW_LIBOMP}" ]; then cmake_params+=(-DOpenMP_libomp_LIBRARY="omp") export LDFLAGS="-L$(brew --prefix libomp)/lib" - export CFLAGS="-arch x86_64" -# # build both x86 and ARM -# export CFLAGS="-arch x86_64 -arch arm64" + # build both x86 and ARM + export CFLAGS="-arch x86_64 -arch arm64" fi if [ -n "${CMAKE_GNUtoMS}" ]; then @@ -63,6 +62,26 @@ echo "#define GxB_NO_UINT32 1" >> ../Source/GB_control.h # echo "#define GxB_NO_UINT64 1" >> ../Source/GB_control.h # echo "#define GxB_NO_UINT8 1" >> ../Source/GB_control.h +if [ -n "${SUITESPARSE_FAST_BUILD}" ]; then + echo "suitesparse.sh: Fast build requested." + # Disable optimizing even more types. This is for builds that don't finish in runner resource limits, + # such as emulated aarm64. + + echo "#define GxB_NO_BOOL 1" >> ../Source/GB_control.h +# echo "#define GxB_NO_FP32 1" >> ../Source/GB_control.h +# echo "#define GxB_NO_FP64 1" >> ../Source/GB_control.h + echo "#define GxB_NO_FC32 1" >> ../Source/GB_control.h + echo "#define GxB_NO_FC64 1" >> ../Source/GB_control.h + echo "#define GxB_NO_INT16 1" >> ../Source/GB_control.h + echo "#define GxB_NO_INT32 1" >> ../Source/GB_control.h +# echo "#define GxB_NO_INT64 1" >> ../Source/GB_control.h +# echo "#define GxB_NO_INT8 1" >> ../Source/GB_control.h + echo "#define GxB_NO_UINT16 1" >> ../Source/GB_control.h + echo "#define GxB_NO_UINT32 1" >> ../Source/GB_control.h + echo "#define GxB_NO_UINT64 1" >> ../Source/GB_control.h + echo "#define GxB_NO_UINT8 1" >> ../Source/GB_control.h +fi + # Disable all Source/Generated2 kernels. For workflow development only. #cmake_params+=(-DCMAKE_CUDA_DEV=1) From 329f944cb645078eb70380f6a37a0a0bdd64ff8f Mon Sep 17 00:00:00 2001 From: Adam Lugowski Date: Wed, 3 May 2023 12:45:06 -0700 Subject: [PATCH 121/193] Support building from source with user-specified GraphBLAS (#85) * Support building from source with user-specified GraphBLAS Look for GraphBLAS first in GraphBLAS_ROOT env var, if empty then fallback to current paths * Add note about LD_LIBRARY_PATH --- README.md | 30 ++++++++++++++++++++++++++++++ build_graphblas_cffi.py | 20 +++++++++++++------- 2 files changed, 43 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 17f7ffa..2d15f15 100644 --- a/README.md +++ b/README.md @@ -12,3 +12,33 @@ This is a base package that exposes only the low level CFFI API bindings and symbols. This package is shared by the syntax bindings [pygraphblas](https://github.com/Graphegon/pygraphblas) and [python-graphblas](https://github.com/python-graphblas/python-graphblas). + + +## Installation from pre-built wheels +Pre-built wheels for common platforms are available from PyPI and conda. These bundle a compiled copy of SuiteSparse:GraphBLAS. + +```bash +pip install suitesparse-graphblas +``` + +or + +```bash +conda install -c conda-forge python-suitesparse-graphblas +``` + +## Installation from source +If you wish to link against your own copy of SuiteSparse:GraphBLAS you may build from source. + +Specify the location of your SuiteSparse:GraphBLAS installation in the `GraphBLAS_ROOT` environment variable then use the standard pip build from source mechanism. This location must contain `include/GraphBLAS.h` and `lib/`. + +```bash +export GraphBLAS_ROOT="/path/to/graphblas" +pip install suitesparse-graphblas-*.tar.gz +``` +You may also have to appropriately set `LD_LIBRARY_PATH` to find `libgraphblas` at runtime. + +For example, to use Homebrew's SuiteSparse:GraphBLAS on macOS, with the sdist from PyPI, and with all dependencies using wheels: +```bash +GraphBLAS_ROOT="$(brew --prefix suitesparse)" pip install --no-binary suitesparse-graphblas suitesparse-graphblas +``` diff --git a/build_graphblas_cffi.py b/build_graphblas_cffi.py index dff21e6..1c73e1c 100644 --- a/build_graphblas_cffi.py +++ b/build_graphblas_cffi.py @@ -10,17 +10,23 @@ ffibuilder = FFI() -include_dirs = [os.path.join(sys.prefix, "include")] -library_dirs = [os.path.join(sys.prefix, "lib")] +# GraphBLAS_ROOT env var can point to the root directory of GraphBLAS to link against. +# Expected subdirectories: include/ (contains GraphBLAS.h), lib/, and bin/ (on Windows only) +# Otherwise fallback to default system folders. +graphblas_root = os.environ.get("GraphBLAS_ROOT", None) +if not graphblas_root: + # Windows wheels.yml configures suitesparse.sh to install GraphBLAS to "C:\\GraphBLAS". + graphblas_root = "C:\\GraphBLAS" if is_win else sys.prefix + +include_dirs = [os.path.join(graphblas_root, "include")] +library_dirs = [os.path.join(graphblas_root, "lib")] if is_win: include_dirs.append(os.path.join(sys.prefix, "Library", "include")) library_dirs.append(os.path.join(sys.prefix, "Library", "lib")) - # wheels.yml configures suitesparse.sh to install GraphBLAS here. - prefix = "C:\\GraphBLAS" - include_dirs.append(os.path.join(prefix, "include")) - library_dirs.append(os.path.join(prefix, "lib")) - library_dirs.append(os.path.join(prefix, "bin")) + include_dirs.append(os.path.join(graphblas_root, "include")) + library_dirs.append(os.path.join(graphblas_root, "lib")) + library_dirs.append(os.path.join(graphblas_root, "bin")) ffibuilder.set_source( "suitesparse_graphblas._graphblas", From 79522ce3c4e47a86c30a84a3ac1ff7088e7d4433 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Thu, 4 May 2023 20:59:04 -0500 Subject: [PATCH 122/193] Replace INT8 with BOOL for SUITESPARSE_FAST_BUILD (#86) This should hopefully allow aarch64 wheel builds to build faster in CI. --- .pre-commit-config.yaml | 4 ++-- suitesparse.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d8ef4a1..1ec8879 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ repos: hooks: - id: validate-pyproject name: Validate pyproject.toml - - repo: https://github.com/myint/autoflake + - repo: https://github.com/PyCQA/autoflake rev: v2.1.1 hooks: - id: autoflake @@ -34,7 +34,7 @@ repos: hooks: - id: isort - repo: https://github.com/asottile/pyupgrade - rev: v3.3.1 + rev: v3.3.2 hooks: - id: pyupgrade args: [--py38-plus] diff --git a/suitesparse.sh b/suitesparse.sh index 5d930dc..12a42e9 100755 --- a/suitesparse.sh +++ b/suitesparse.sh @@ -67,7 +67,7 @@ if [ -n "${SUITESPARSE_FAST_BUILD}" ]; then # Disable optimizing even more types. This is for builds that don't finish in runner resource limits, # such as emulated aarm64. - echo "#define GxB_NO_BOOL 1" >> ../Source/GB_control.h +# echo "#define GxB_NO_BOOL 1" >> ../Source/GB_control.h # echo "#define GxB_NO_FP32 1" >> ../Source/GB_control.h # echo "#define GxB_NO_FP64 1" >> ../Source/GB_control.h echo "#define GxB_NO_FC32 1" >> ../Source/GB_control.h @@ -75,7 +75,7 @@ if [ -n "${SUITESPARSE_FAST_BUILD}" ]; then echo "#define GxB_NO_INT16 1" >> ../Source/GB_control.h echo "#define GxB_NO_INT32 1" >> ../Source/GB_control.h # echo "#define GxB_NO_INT64 1" >> ../Source/GB_control.h -# echo "#define GxB_NO_INT8 1" >> ../Source/GB_control.h + echo "#define GxB_NO_INT8 1" >> ../Source/GB_control.h echo "#define GxB_NO_UINT16 1" >> ../Source/GB_control.h echo "#define GxB_NO_UINT32 1" >> ../Source/GB_control.h echo "#define GxB_NO_UINT64 1" >> ../Source/GB_control.h From 892e2d2514d70b1ee01d1494e8640cc44a1ff8f5 Mon Sep 17 00:00:00 2001 From: Adam Lugowski Date: Thu, 4 May 2023 19:00:18 -0700 Subject: [PATCH 123/193] Split macos architectures (#87) --- .github/workflows/wheels.yml | 17 ++++++++++++----- suitesparse.sh | 8 ++++++-- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index a0b6c9b..98b8ab6 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -60,13 +60,19 @@ jobs: manylinux_image: manylinux2014 cibw_archs: "aarch64" - # Use x86 macOS runner to build both x86 and ARM. + # macOS x86 + - os: macos-latest + python-version: "3.8" + platform_id: macosx_x86_64 + cibw_archs: "x86_64" + + # Use x86 macOS runner to build ARM. # GitHub does not offer Apple Silicon yet (only for self-hosted). # See https://github.com/github/roadmap/issues/528 - os: macos-latest python-version: "3.8" platform_id: macosx_x86_64 - cibw_archs: "x86_64 arm64" + cibw_archs: "arm64" steps: - uses: actions/checkout@v3 @@ -117,7 +123,8 @@ jobs: CIBW_ENVIRONMENT_WINDOWS: CMAKE_GNUtoMS=ON GRAPHBLAS_PREFIX="C:/GraphBLAS" # macOS libomp requires special configs. BREW_LIBOMP=1 asks suitesparse.sh to include them. - CIBW_ENVIRONMENT_MACOS: BREW_LIBOMP="1" + # SUITESPARSE_MACOS_ARCH asks to build a particular architecture. Either x86 or arm64. + CIBW_ENVIRONMENT_MACOS: BREW_LIBOMP="1" SUITESPARSE_MACOS_ARCH=${{ matrix.cibw_archs }} # Uncomment to only build CPython wheels # CIBW_BUILD: "cp*" @@ -143,8 +150,8 @@ jobs: # run tests CIBW_TEST_COMMAND: "pytest --pyargs suitesparse_graphblas" - # GitHub Actions macOS Intel runner cannot run ARM tests. - CIBW_TEST_SKIP: "*-macosx_arm64" + # GitHub Actions macOS Intel runner cannot run ARM tests. Uncomment to silence warning. +# CIBW_TEST_SKIP: "*-macosx_arm64" run: | python -m pip install cibuildwheel diff --git a/suitesparse.sh b/suitesparse.sh index 12a42e9..2dd719b 100755 --- a/suitesparse.sh +++ b/suitesparse.sh @@ -25,8 +25,12 @@ if [ -n "${BREW_LIBOMP}" ]; then cmake_params+=(-DOpenMP_libomp_LIBRARY="omp") export LDFLAGS="-L$(brew --prefix libomp)/lib" - # build both x86 and ARM - export CFLAGS="-arch x86_64 -arch arm64" + if [ -n "${SUITESPARSE_MACOS_ARCH}" ]; then + export CFLAGS="-arch ${SUITESPARSE_MACOS_ARCH}" + else + # build both x86 and ARM + export CFLAGS="-arch x86_64 -arch arm64" + fi fi if [ -n "${CMAKE_GNUtoMS}" ]; then From 7e746165c0edcfa300b27052b8280f171937d0ff Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Fri, 19 May 2023 17:03:06 -0500 Subject: [PATCH 124/193] Update to SuiteSparse:GraphBLAS v8.0.0 (#76) * Update to v8.0.0! --- .github/workflows/test.yml | 23 +- suitesparse.sh | 3 +- suitesparse_graphblas/__init__.py | 1 - suitesparse_graphblas/create_headers.py | 6 +- suitesparse_graphblas/suitesparse_graphblas.h | 160 +- .../suitesparse_graphblas_arm64.h | 3491 ----------------- .../suitesparse_graphblas_no_complex.h | 160 +- 7 files changed, 195 insertions(+), 3649 deletions(-) delete mode 100644 suitesparse_graphblas/suitesparse_graphblas_arm64.h diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 78f5f44..07d7016 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,7 +19,7 @@ jobs: # os: ["ubuntu-latest"] # source: ["source"] python-version: ["3.8", "3.9", "3.10", "3.11"] - graphblas-version: ["7.4.4"] + graphblas-version: ["8.0.0"] steps: - name: Checkout uses: actions/checkout@v3 @@ -36,27 +36,26 @@ jobs: - name: GraphBLAS (from conda-forge) if: (contains(matrix.source, 'conda-forge')) run: | - conda install -c conda-forge graphblas=${{ matrix.graphblas-version }} pytest pytest-randomly + conda install -c conda-forge graphblas=${{ matrix.graphblas-version }} pytest-randomly - name: GraphBLAS (from source) if: (contains(matrix.source, 'source')) run: | - # This isn't working! Why not? - # sh suitesparse.sh refs/tags/${{ matrix.graphblas-version }} + GRAPHBLAS_PREFIX=${CONDA_PREFIX} bash suitesparse.sh refs/tags/${{ matrix.graphblas-version }}.0 # From tag - curl -L https://github.com/DrTimothyAldenDavis/GraphBLAS/archive/refs/tags/v${{ matrix.graphblas-version }}.tar.gz | tar xzf - - pushd GraphBLAS-${{ matrix.graphblas-version }}/build + # curl -L https://github.com/DrTimothyAldenDavis/GraphBLAS/archive/refs/tags/v${{ matrix.graphblas-version }}.tar.gz | tar xzf - + # pushd GraphBLAS-${{ matrix.graphblas-version }}/build # From branch # curl -L https://github.com/DrTimothyAldenDavis/GraphBLAS/tarball/${{ matrix.graphblas-version }} | tar xzf - # pushd DrTim*/build - echo ${CONDA_PREFIX} - cmake -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release .. - cat Makefile - make all JOBS=16 - make install - popd + # echo ${CONDA_PREFIX} + # cmake -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release .. + # cat Makefile + # make all JOBS=16 + # make install + # popd - name: Build run: | pip install -e . --no-deps diff --git a/suitesparse.sh b/suitesparse.sh index 2dd719b..080201a 100755 --- a/suitesparse.sh +++ b/suitesparse.sh @@ -1,8 +1,7 @@ #!/bin/bash # parse SuiteSparse version from first argument, a git tag that ends in the version (no leading v) -if [[ $1 =~ refs/tags/([0-9]*\.[0-9]*\.[0-9]*)\..*$ ]]; -then +if [[ $1 =~ refs/tags/([0-9]*\.[0-9]*\.[0-9]*)\..*$ ]]; then VERSION=${BASH_REMATCH[1]} else echo "Specify a SuiteSparse version, such as: $0 refs/tags/7.4.3.0" diff --git a/suitesparse_graphblas/__init__.py b/suitesparse_graphblas/__init__.py index 15931d7..c61a6b9 100644 --- a/suitesparse_graphblas/__init__.py +++ b/suitesparse_graphblas/__init__.py @@ -181,7 +181,6 @@ def libget(name): "struct GB_Type_opaque *": lib.GrB_Type_error, "struct GB_UnaryOp_opaque *": lib.GrB_UnaryOp_error, "struct GB_BinaryOp_opaque *": lib.GrB_BinaryOp_error, - "struct GB_SelectOp_opaque *": lib.GxB_SelectOp_error, "struct GB_Monoid_opaque *": lib.GrB_Monoid_error, "struct GB_Semiring_opaque *": lib.GrB_Semiring_error, "struct GB_Scalar_opaque *": lib.GxB_Scalar_error, diff --git a/suitesparse_graphblas/create_headers.py b/suitesparse_graphblas/create_headers.py index cd9c0b9..89c199c 100644 --- a/suitesparse_graphblas/create_headers.py +++ b/suitesparse_graphblas/create_headers.py @@ -276,8 +276,7 @@ def groupby(index, seq): "GRB_SUBVERSION", "GxB_NTHREADS", "GxB_CHUNK", - "GxB_GPU_CONTROL", - "GxB_GPU_CHUNK", + "GxB_GPU_ID", "GxB_HYPERSPARSE", "GxB_SPARSE", "GxB_BITMAP", @@ -294,7 +293,6 @@ def groupby(index, seq): "GxB_FAST_IMPORT", "GxB_MAX_NAME_LEN", "GxB_COMPRESSION_DEFAULT", - "GxB_COMPRESSION_INTEL", "GxB_COMPRESSION_LZ4", "GxB_COMPRESSION_LZ4HC", "GxB_COMPRESSION_ZSTD", @@ -316,6 +314,7 @@ def groupby(index, seq): "CMPLX", "CMPLXF", "GB_GLOBAL", + "GB_HAS_CMPLX_MACROS", "GB_PUBLIC", "GB_restrict", "GRAPHBLAS_H", @@ -625,6 +624,7 @@ def handle_function_node(node): "UnaryOp": "unary", "IndexUnaryOp": "indexunary", "Iterator": "iterator", + "Context": "context", # "everything else" is "core" "getVersion": "core", "Global": "core", diff --git a/suitesparse_graphblas/suitesparse_graphblas.h b/suitesparse_graphblas/suitesparse_graphblas.h index 39630af..4fcb6d0 100644 --- a/suitesparse_graphblas/suitesparse_graphblas.h +++ b/suitesparse_graphblas/suitesparse_graphblas.h @@ -15,12 +15,12 @@ typedef uint64_t GrB_Index; /* GxB typedefs */ typedef double _Complex GxB_FC64_t; typedef float _Complex GxB_FC32_t; +typedef struct GB_Context_opaque *GxB_Context; typedef struct GB_Iterator_opaque *GxB_Iterator; typedef struct GB_Scalar_opaque *GxB_Scalar; typedef struct GB_SelectOp_opaque *GxB_SelectOp; /* GxB typedefs (functions) */ -typedef bool (*GxB_select_function)(GrB_Index i, GrB_Index j, const void *x, const void *thunk); typedef void (*GxB_binary_function)(void *, const void *, const void *); typedef void (*GxB_index_unary_function)(void *z, const void *x, GrB_Index i, GrB_Index j, const void *y); typedef void (*GxB_unary_function)(void *, const void *); @@ -32,14 +32,10 @@ typedef enum GrB_MASK = 1, GrB_INP0 = 2, GrB_INP1 = 3, - GxB_DESCRIPTOR_NTHREADS = 5, - GxB_DESCRIPTOR_CHUNK = 7, - GxB_DESCRIPTOR_GPU_CONTROL = 21, - GxB_DESCRIPTOR_GPU_CHUNK = 22, - GxB_AxB_METHOD = 1000, - GxB_SORT = 35, - GxB_COMPRESSION = 36, - GxB_IMPORT = 37 + GxB_AxB_METHOD = 7090, + GxB_SORT = 7091, + GxB_COMPRESSION = 7092, + GxB_IMPORT = 7093 } GrB_Desc_Field; typedef enum @@ -49,13 +45,11 @@ typedef enum GrB_COMP = 2, GrB_STRUCTURE = 4, GrB_TRAN = 3, - GxB_GPU_ALWAYS = 2001, - GxB_GPU_NEVER = 2002, - GxB_AxB_GUSTAVSON = 1001, - GxB_AxB_DOT = 1003, - GxB_AxB_HASH = 1004, - GxB_AxB_SAXPY = 1005, - GxB_SECURE_IMPORT = 502 + GxB_AxB_GUSTAVSON = 7081, + GxB_AxB_DOT = 7083, + GxB_AxB_HASH = 7084, + GxB_AxB_SAXPY = 7085, + GxB_SECURE_IMPORT = 7080 } GrB_Desc_Value; typedef enum @@ -69,7 +63,7 @@ typedef enum { GrB_SUCCESS = 0, GrB_NO_VALUE = 1, - GxB_EXHAUSTED = 2, + GxB_EXHAUSTED = 7089, GrB_UNINITIALIZED_OBJECT = -1, GrB_NULL_POINTER = -2, GrB_INVALID_VALUE = -3, @@ -90,8 +84,8 @@ typedef enum { GrB_NONBLOCKING = 0, GrB_BLOCKING = 1, - GxB_NONBLOCKING_GPU = 2, - GxB_BLOCKING_GPU = 3 + GxB_NONBLOCKING_GPU = 7099, + GxB_BLOCKING_GPU = 7098 } GrB_Mode; typedef enum @@ -101,6 +95,13 @@ typedef enum } GrB_WaitMode; /* GxB enums */ +typedef enum +{ + GxB_CONTEXT_NTHREADS = 7086, + GxB_CONTEXT_CHUNK = 7087, + GxB_CONTEXT_GPU_ID = 7088 +} GxB_Context_Field; + typedef enum { GxB_BY_ROW = 0, @@ -110,36 +111,58 @@ typedef enum typedef enum { - GxB_HYPER_SWITCH = 0, - GxB_BITMAP_SWITCH = 34, - GxB_FORMAT = 1, - GxB_MODE = 2, - GxB_LIBRARY_NAME = 8, - GxB_LIBRARY_VERSION = 9, - GxB_LIBRARY_DATE = 10, - GxB_LIBRARY_ABOUT = 11, - GxB_LIBRARY_URL = 12, - GxB_LIBRARY_LICENSE = 13, - GxB_LIBRARY_COMPILE_DATE = 14, - GxB_LIBRARY_COMPILE_TIME = 15, - GxB_API_VERSION = 16, - GxB_API_DATE = 17, - GxB_API_ABOUT = 18, - GxB_API_URL = 19, - GxB_COMPILER_VERSION = 23, - GxB_COMPILER_NAME = 24, - GxB_LIBRARY_OPENMP = 25, - GxB_GLOBAL_NTHREADS = 5, - GxB_GLOBAL_CHUNK = 7, - GxB_BURBLE = 99, - GxB_PRINTF = 101, - GxB_FLUSH = 102, - GxB_MEMORY_POOL = 103, - GxB_PRINT_1BASED = 104, - GxB_SPARSITY_STATUS = 33, - GxB_SPARSITY_CONTROL = 32, - GxB_GLOBAL_GPU_CONTROL = 21, - GxB_GLOBAL_GPU_CHUNK = 22 + GxB_JIT_OFF = 0, + GxB_JIT_PAUSE = 1, + GxB_JIT_RUN = 2, + GxB_JIT_LOAD = 3, + GxB_JIT_ON = 4 +} GxB_JIT_Control; + +typedef enum +{ + GxB_HYPER_SWITCH = 7000, + GxB_BITMAP_SWITCH = 7001, + GxB_FORMAT = 7002, + GxB_MODE = 7003, + GxB_LIBRARY_NAME = 7004, + GxB_LIBRARY_VERSION = 7005, + GxB_LIBRARY_DATE = 7006, + GxB_LIBRARY_ABOUT = 7007, + GxB_LIBRARY_URL = 7008, + GxB_LIBRARY_LICENSE = 7009, + GxB_LIBRARY_COMPILE_DATE = 7010, + GxB_LIBRARY_COMPILE_TIME = 7011, + GxB_API_VERSION = 7012, + GxB_API_DATE = 7013, + GxB_API_ABOUT = 7014, + GxB_API_URL = 7015, + GxB_COMPILER_VERSION = 7016, + GxB_COMPILER_NAME = 7017, + GxB_LIBRARY_OPENMP = 7018, + GxB_GLOBAL_NTHREADS = 7086, + GxB_GLOBAL_CHUNK = 7087, + GxB_GLOBAL_GPU_ID = 7088, + GxB_BURBLE = 7019, + GxB_PRINTF = 7020, + GxB_FLUSH = 7021, + GxB_MEMORY_POOL = 7022, + GxB_PRINT_1BASED = 7023, + GxB_JIT_C_COMPILER_NAME = 7024, + GxB_JIT_C_COMPILER_FLAGS = 7025, + GxB_JIT_C_LINKER_FLAGS = 7026, + GxB_JIT_C_LIBRARIES = 7027, + GxB_JIT_C_PREFACE = 7028, + GxB_JIT_C_CONTROL = 7029, + GxB_JIT_CACHE_PATH = 7030, + GxB_JIT_C_CMAKE_LIBS = 7031, + GxB_JIT_USE_CMAKE = 7032, + GxB_JIT_ERROR_LOG = 7033, + GxB_SPARSITY_STATUS = 7034, + GxB_SPARSITY_CONTROL = 7036, + GxB_MALLOC_FUNCTION = 7037, + GxB_CALLOC_FUNCTION = 7038, + GxB_REALLOC_FUNCTION = 7039, + GxB_FREE_FUNCTION = 7040 } GxB_Option_Field; typedef enum @@ -2603,6 +2626,7 @@ extern GrB_UnaryOp GxB_TRUNC_FP32; extern GrB_UnaryOp GxB_TRUNC_FP64; /* GxB objects */ +extern GxB_Context GxB_CONTEXT_WORLD; extern GxB_SelectOp GxB_DIAG; extern GxB_SelectOp GxB_EQ_THUNK; extern GxB_SelectOp GxB_EQ_ZERO; @@ -3063,9 +3087,6 @@ GrB_Info GrB_Vector_wait(GrB_Vector v, GrB_WaitMode waitmode); * GB functions * ***************/ -/* binary */ -GrB_Info GB_BinaryOp_new(GrB_BinaryOp *binaryop, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *binop_name); - /* iterator */ GrB_Info GB_Iterator_rc_bitmap_next(GxB_Iterator iterator); GrB_Info GB_Iterator_rc_seek(GxB_Iterator iterator, GrB_Index j, bool jth_vector); @@ -3074,15 +3095,6 @@ GrB_Info GB_Vector_Iterator_bitmap_seek(GxB_Iterator iterator, GrB_Index unused) /* matrix */ GrB_Info GB_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GxB_Format_Value format, GrB_Descriptor desc); -/* selectop */ -GrB_Info GB_SelectOp_new(GxB_SelectOp *selectop, GxB_select_function function, GrB_Type xtype, GrB_Type ttype, const char *name); - -/* type */ -GrB_Info GB_Type_new(GrB_Type *type, size_t sizeof_ctype, const char *type_name); - -/* unary */ -GrB_Info GB_UnaryOp_new(GrB_UnaryOp *unaryop, GxB_unary_function function, GrB_Type ztype, GrB_Type xtype, const char *unop_name); - /**************** * GxB functions * ****************/ @@ -3097,14 +3109,28 @@ GrB_Info GxB_BinaryOp_ytype_name(char *type_name, const GrB_BinaryOp binaryop); GrB_Info GxB_BinaryOp_ztype(GrB_Type *ztype, GrB_BinaryOp binaryop); GrB_Info GxB_BinaryOp_ztype_name(char *type_name, const GrB_BinaryOp binaryop); +/* context */ +GrB_Info GxB_Context_disengage(GxB_Context Context); +GrB_Info GxB_Context_engage(GxB_Context Context); +GrB_Info GxB_Context_fprint(GxB_Context Context, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_Context_free(GxB_Context *Context); +GrB_Info GxB_Context_get(GxB_Context Context, GxB_Context_Field field, ...); +GrB_Info GxB_Context_get_FP64(GxB_Context Context, GxB_Context_Field field, double *value); +GrB_Info GxB_Context_get_INT32(GxB_Context Context, GxB_Context_Field field, int32_t *value); +GrB_Info GxB_Context_new(GxB_Context *Context); +GrB_Info GxB_Context_set(GxB_Context Context, GxB_Context_Field field, ...); +GrB_Info GxB_Context_set_FP64(GxB_Context Context, GxB_Context_Field field, double value); +GrB_Info GxB_Context_set_INT32(GxB_Context Context, GxB_Context_Field field, int32_t value); + /* core */ GrB_Info GxB_Global_Option_get(GxB_Option_Field field, ...); -GrB_Info GxB_Global_Option_get_CHAR(GxB_Option_Field field, char **value); +GrB_Info GxB_Global_Option_get_CHAR(GxB_Option_Field field, const char **value); GrB_Info GxB_Global_Option_get_FP64(GxB_Option_Field field, double *value); GrB_Info GxB_Global_Option_get_FUNCTION(GxB_Option_Field field, void **value); GrB_Info GxB_Global_Option_get_INT32(GxB_Option_Field field, int32_t *value); GrB_Info GxB_Global_Option_get_INT64(GxB_Option_Field field, int64_t *value); GrB_Info GxB_Global_Option_set(GxB_Option_Field field, ...); +GrB_Info GxB_Global_Option_set_CHAR(GxB_Option_Field field, const char *value); GrB_Info GxB_Global_Option_set_FP64(GxB_Option_Field field, double value); GrB_Info GxB_Global_Option_set_FP64_ARRAY(GxB_Option_Field field, double *value); GrB_Info GxB_Global_Option_set_FUNCTION(GxB_Option_Field field, void *value); @@ -3343,12 +3369,8 @@ GrB_Info GxB_Scalar_type_name(char *type_name, const GrB_Scalar s); GrB_Info GxB_Scalar_wait(GrB_Scalar *s); /* selectop */ -GrB_Info GxB_SelectOp_error(const char **error, const GxB_SelectOp op); -GrB_Info GxB_SelectOp_fprint(GxB_SelectOp selectop, const char *name, GxB_Print_Level pr, FILE *f); -GrB_Info GxB_SelectOp_free(GxB_SelectOp *selectop); -GrB_Info GxB_SelectOp_new(GxB_SelectOp *selectop, GxB_select_function function, GrB_Type xtype, GrB_Type ttype); +GrB_Info GxB_SelectOp_fprint(GxB_SelectOp op, const char *name, GxB_Print_Level pr, FILE *f); GrB_Info GxB_SelectOp_ttype(GrB_Type *ttype, GxB_SelectOp selectop); -GrB_Info GxB_SelectOp_wait(GxB_SelectOp op, GrB_WaitMode waitmode); GrB_Info GxB_SelectOp_xtype(GrB_Type *xtype, GxB_SelectOp selectop); /* semiring */ @@ -3453,7 +3475,6 @@ GrB_Info GxB_Vector_unpack_Full(GrB_Vector v, void **vx, GrB_Index *vx_size, boo #define GxB_BITMAP ... #define GxB_CHUNK ... #define GxB_COMPRESSION_DEFAULT ... -#define GxB_COMPRESSION_INTEL ... #define GxB_COMPRESSION_LZ4 ... #define GxB_COMPRESSION_LZ4HC ... #define GxB_COMPRESSION_NONE ... @@ -3461,8 +3482,7 @@ GrB_Info GxB_Vector_unpack_Full(GrB_Vector v, void **vx, GrB_Index *vx_size, boo #define GxB_END ... #define GxB_FAST_IMPORT ... #define GxB_FULL ... -#define GxB_GPU_CHUNK ... -#define GxB_GPU_CONTROL ... +#define GxB_GPU_ID ... #define GxB_HYPERSPARSE ... #define GxB_IMPLEMENTATION ... #define GxB_IMPLEMENTATION_MAJOR ... diff --git a/suitesparse_graphblas/suitesparse_graphblas_arm64.h b/suitesparse_graphblas/suitesparse_graphblas_arm64.h deleted file mode 100644 index 39630af..0000000 --- a/suitesparse_graphblas/suitesparse_graphblas_arm64.h +++ /dev/null @@ -1,3491 +0,0 @@ -/* This file is automatically generated */ -/* GrB typedefs */ -typedef struct GB_BinaryOp_opaque *GrB_BinaryOp; -typedef struct GB_Descriptor_opaque *GrB_Descriptor; -typedef struct GB_IndexUnaryOp_opaque *GrB_IndexUnaryOp; -typedef struct GB_Matrix_opaque *GrB_Matrix; -typedef struct GB_Monoid_opaque *GrB_Monoid; -typedef struct GB_Scalar_opaque *GrB_Scalar; -typedef struct GB_Semiring_opaque *GrB_Semiring; -typedef struct GB_Type_opaque *GrB_Type; -typedef struct GB_UnaryOp_opaque *GrB_UnaryOp; -typedef struct GB_Vector_opaque *GrB_Vector; -typedef uint64_t GrB_Index; - -/* GxB typedefs */ -typedef double _Complex GxB_FC64_t; -typedef float _Complex GxB_FC32_t; -typedef struct GB_Iterator_opaque *GxB_Iterator; -typedef struct GB_Scalar_opaque *GxB_Scalar; -typedef struct GB_SelectOp_opaque *GxB_SelectOp; - -/* GxB typedefs (functions) */ -typedef bool (*GxB_select_function)(GrB_Index i, GrB_Index j, const void *x, const void *thunk); -typedef void (*GxB_binary_function)(void *, const void *, const void *); -typedef void (*GxB_index_unary_function)(void *z, const void *x, GrB_Index i, GrB_Index j, const void *y); -typedef void (*GxB_unary_function)(void *, const void *); - -/* GrB enums */ -typedef enum -{ - GrB_OUTP = 0, - GrB_MASK = 1, - GrB_INP0 = 2, - GrB_INP1 = 3, - GxB_DESCRIPTOR_NTHREADS = 5, - GxB_DESCRIPTOR_CHUNK = 7, - GxB_DESCRIPTOR_GPU_CONTROL = 21, - GxB_DESCRIPTOR_GPU_CHUNK = 22, - GxB_AxB_METHOD = 1000, - GxB_SORT = 35, - GxB_COMPRESSION = 36, - GxB_IMPORT = 37 -} GrB_Desc_Field; - -typedef enum -{ - GxB_DEFAULT = 0, - GrB_REPLACE = 1, - GrB_COMP = 2, - GrB_STRUCTURE = 4, - GrB_TRAN = 3, - GxB_GPU_ALWAYS = 2001, - GxB_GPU_NEVER = 2002, - GxB_AxB_GUSTAVSON = 1001, - GxB_AxB_DOT = 1003, - GxB_AxB_HASH = 1004, - GxB_AxB_SAXPY = 1005, - GxB_SECURE_IMPORT = 502 -} GrB_Desc_Value; - -typedef enum -{ - GrB_CSR_FORMAT = 0, - GrB_CSC_FORMAT = 1, - GrB_COO_FORMAT = 2 -} GrB_Format; - -typedef enum -{ - GrB_SUCCESS = 0, - GrB_NO_VALUE = 1, - GxB_EXHAUSTED = 2, - GrB_UNINITIALIZED_OBJECT = -1, - GrB_NULL_POINTER = -2, - GrB_INVALID_VALUE = -3, - GrB_INVALID_INDEX = -4, - GrB_DOMAIN_MISMATCH = -5, - GrB_DIMENSION_MISMATCH = -6, - GrB_OUTPUT_NOT_EMPTY = -7, - GrB_NOT_IMPLEMENTED = -8, - GrB_PANIC = -101, - GrB_OUT_OF_MEMORY = -102, - GrB_INSUFFICIENT_SPACE = -103, - GrB_INVALID_OBJECT = -104, - GrB_INDEX_OUT_OF_BOUNDS = -105, - GrB_EMPTY_OBJECT = -106 -} GrB_Info; - -typedef enum -{ - GrB_NONBLOCKING = 0, - GrB_BLOCKING = 1, - GxB_NONBLOCKING_GPU = 2, - GxB_BLOCKING_GPU = 3 -} GrB_Mode; - -typedef enum -{ - GrB_COMPLETE = 0, - GrB_MATERIALIZE = 1 -} GrB_WaitMode; - -/* GxB enums */ -typedef enum -{ - GxB_BY_ROW = 0, - GxB_BY_COL = 1, - GxB_NO_FORMAT = -1 -} GxB_Format_Value; - -typedef enum -{ - GxB_HYPER_SWITCH = 0, - GxB_BITMAP_SWITCH = 34, - GxB_FORMAT = 1, - GxB_MODE = 2, - GxB_LIBRARY_NAME = 8, - GxB_LIBRARY_VERSION = 9, - GxB_LIBRARY_DATE = 10, - GxB_LIBRARY_ABOUT = 11, - GxB_LIBRARY_URL = 12, - GxB_LIBRARY_LICENSE = 13, - GxB_LIBRARY_COMPILE_DATE = 14, - GxB_LIBRARY_COMPILE_TIME = 15, - GxB_API_VERSION = 16, - GxB_API_DATE = 17, - GxB_API_ABOUT = 18, - GxB_API_URL = 19, - GxB_COMPILER_VERSION = 23, - GxB_COMPILER_NAME = 24, - GxB_LIBRARY_OPENMP = 25, - GxB_GLOBAL_NTHREADS = 5, - GxB_GLOBAL_CHUNK = 7, - GxB_BURBLE = 99, - GxB_PRINTF = 101, - GxB_FLUSH = 102, - GxB_MEMORY_POOL = 103, - GxB_PRINT_1BASED = 104, - GxB_SPARSITY_STATUS = 33, - GxB_SPARSITY_CONTROL = 32, - GxB_GLOBAL_GPU_CONTROL = 21, - GxB_GLOBAL_GPU_CHUNK = 22 -} GxB_Option_Field; - -typedef enum -{ - GxB_SILENT = 0, - GxB_SUMMARY = 1, - GxB_SHORT = 2, - GxB_COMPLETE = 3, - GxB_SHORT_VERBOSE = 4, - GxB_COMPLETE_VERBOSE = 5 -} GxB_Print_Level; - -/* GrB consts */ -extern const uint64_t *GrB_ALL; - -/* GxB consts */ -extern const GxB_Format_Value GxB_FORMAT_DEFAULT; -extern const double GxB_ALWAYS_HYPER; -extern const double GxB_HYPER_DEFAULT; -extern const double GxB_NEVER_HYPER; - -/* GrB objects */ -extern GrB_BinaryOp GrB_BAND_INT8; -extern GrB_BinaryOp GrB_BAND_INT16; -extern GrB_BinaryOp GrB_BAND_INT32; -extern GrB_BinaryOp GrB_BAND_INT64; -extern GrB_BinaryOp GrB_BAND_UINT8; -extern GrB_BinaryOp GrB_BAND_UINT16; -extern GrB_BinaryOp GrB_BAND_UINT32; -extern GrB_BinaryOp GrB_BAND_UINT64; -extern GrB_BinaryOp GrB_BOR_INT8; -extern GrB_BinaryOp GrB_BOR_INT16; -extern GrB_BinaryOp GrB_BOR_INT32; -extern GrB_BinaryOp GrB_BOR_INT64; -extern GrB_BinaryOp GrB_BOR_UINT8; -extern GrB_BinaryOp GrB_BOR_UINT16; -extern GrB_BinaryOp GrB_BOR_UINT32; -extern GrB_BinaryOp GrB_BOR_UINT64; -extern GrB_BinaryOp GrB_BXNOR_INT8; -extern GrB_BinaryOp GrB_BXNOR_INT16; -extern GrB_BinaryOp GrB_BXNOR_INT32; -extern GrB_BinaryOp GrB_BXNOR_INT64; -extern GrB_BinaryOp GrB_BXNOR_UINT8; -extern GrB_BinaryOp GrB_BXNOR_UINT16; -extern GrB_BinaryOp GrB_BXNOR_UINT32; -extern GrB_BinaryOp GrB_BXNOR_UINT64; -extern GrB_BinaryOp GrB_BXOR_INT8; -extern GrB_BinaryOp GrB_BXOR_INT16; -extern GrB_BinaryOp GrB_BXOR_INT32; -extern GrB_BinaryOp GrB_BXOR_INT64; -extern GrB_BinaryOp GrB_BXOR_UINT8; -extern GrB_BinaryOp GrB_BXOR_UINT16; -extern GrB_BinaryOp GrB_BXOR_UINT32; -extern GrB_BinaryOp GrB_BXOR_UINT64; -extern GrB_BinaryOp GrB_DIV_BOOL; -extern GrB_BinaryOp GrB_DIV_FP32; -extern GrB_BinaryOp GrB_DIV_FP64; -extern GrB_BinaryOp GrB_DIV_INT8; -extern GrB_BinaryOp GrB_DIV_INT16; -extern GrB_BinaryOp GrB_DIV_INT32; -extern GrB_BinaryOp GrB_DIV_INT64; -extern GrB_BinaryOp GrB_DIV_UINT8; -extern GrB_BinaryOp GrB_DIV_UINT16; -extern GrB_BinaryOp GrB_DIV_UINT32; -extern GrB_BinaryOp GrB_DIV_UINT64; -extern GrB_BinaryOp GrB_EQ_BOOL; -extern GrB_BinaryOp GrB_EQ_FP32; -extern GrB_BinaryOp GrB_EQ_FP64; -extern GrB_BinaryOp GrB_EQ_INT8; -extern GrB_BinaryOp GrB_EQ_INT16; -extern GrB_BinaryOp GrB_EQ_INT32; -extern GrB_BinaryOp GrB_EQ_INT64; -extern GrB_BinaryOp GrB_EQ_UINT8; -extern GrB_BinaryOp GrB_EQ_UINT16; -extern GrB_BinaryOp GrB_EQ_UINT32; -extern GrB_BinaryOp GrB_EQ_UINT64; -extern GrB_BinaryOp GrB_FIRST_BOOL; -extern GrB_BinaryOp GrB_FIRST_FP32; -extern GrB_BinaryOp GrB_FIRST_FP64; -extern GrB_BinaryOp GrB_FIRST_INT8; -extern GrB_BinaryOp GrB_FIRST_INT16; -extern GrB_BinaryOp GrB_FIRST_INT32; -extern GrB_BinaryOp GrB_FIRST_INT64; -extern GrB_BinaryOp GrB_FIRST_UINT8; -extern GrB_BinaryOp GrB_FIRST_UINT16; -extern GrB_BinaryOp GrB_FIRST_UINT32; -extern GrB_BinaryOp GrB_FIRST_UINT64; -extern GrB_BinaryOp GrB_GE_BOOL; -extern GrB_BinaryOp GrB_GE_FP32; -extern GrB_BinaryOp GrB_GE_FP64; -extern GrB_BinaryOp GrB_GE_INT8; -extern GrB_BinaryOp GrB_GE_INT16; -extern GrB_BinaryOp GrB_GE_INT32; -extern GrB_BinaryOp GrB_GE_INT64; -extern GrB_BinaryOp GrB_GE_UINT8; -extern GrB_BinaryOp GrB_GE_UINT16; -extern GrB_BinaryOp GrB_GE_UINT32; -extern GrB_BinaryOp GrB_GE_UINT64; -extern GrB_BinaryOp GrB_GT_BOOL; -extern GrB_BinaryOp GrB_GT_FP32; -extern GrB_BinaryOp GrB_GT_FP64; -extern GrB_BinaryOp GrB_GT_INT8; -extern GrB_BinaryOp GrB_GT_INT16; -extern GrB_BinaryOp GrB_GT_INT32; -extern GrB_BinaryOp GrB_GT_INT64; -extern GrB_BinaryOp GrB_GT_UINT8; -extern GrB_BinaryOp GrB_GT_UINT16; -extern GrB_BinaryOp GrB_GT_UINT32; -extern GrB_BinaryOp GrB_GT_UINT64; -extern GrB_BinaryOp GrB_LAND; -extern GrB_BinaryOp GrB_LE_BOOL; -extern GrB_BinaryOp GrB_LE_FP32; -extern GrB_BinaryOp GrB_LE_FP64; -extern GrB_BinaryOp GrB_LE_INT8; -extern GrB_BinaryOp GrB_LE_INT16; -extern GrB_BinaryOp GrB_LE_INT32; -extern GrB_BinaryOp GrB_LE_INT64; -extern GrB_BinaryOp GrB_LE_UINT8; -extern GrB_BinaryOp GrB_LE_UINT16; -extern GrB_BinaryOp GrB_LE_UINT32; -extern GrB_BinaryOp GrB_LE_UINT64; -extern GrB_BinaryOp GrB_LOR; -extern GrB_BinaryOp GrB_LT_BOOL; -extern GrB_BinaryOp GrB_LT_FP32; -extern GrB_BinaryOp GrB_LT_FP64; -extern GrB_BinaryOp GrB_LT_INT8; -extern GrB_BinaryOp GrB_LT_INT16; -extern GrB_BinaryOp GrB_LT_INT32; -extern GrB_BinaryOp GrB_LT_INT64; -extern GrB_BinaryOp GrB_LT_UINT8; -extern GrB_BinaryOp GrB_LT_UINT16; -extern GrB_BinaryOp GrB_LT_UINT32; -extern GrB_BinaryOp GrB_LT_UINT64; -extern GrB_BinaryOp GrB_LXNOR; -extern GrB_BinaryOp GrB_LXOR; -extern GrB_BinaryOp GrB_MAX_BOOL; -extern GrB_BinaryOp GrB_MAX_FP32; -extern GrB_BinaryOp GrB_MAX_FP64; -extern GrB_BinaryOp GrB_MAX_INT8; -extern GrB_BinaryOp GrB_MAX_INT16; -extern GrB_BinaryOp GrB_MAX_INT32; -extern GrB_BinaryOp GrB_MAX_INT64; -extern GrB_BinaryOp GrB_MAX_UINT8; -extern GrB_BinaryOp GrB_MAX_UINT16; -extern GrB_BinaryOp GrB_MAX_UINT32; -extern GrB_BinaryOp GrB_MAX_UINT64; -extern GrB_BinaryOp GrB_MINUS_BOOL; -extern GrB_BinaryOp GrB_MINUS_FP32; -extern GrB_BinaryOp GrB_MINUS_FP64; -extern GrB_BinaryOp GrB_MINUS_INT8; -extern GrB_BinaryOp GrB_MINUS_INT16; -extern GrB_BinaryOp GrB_MINUS_INT32; -extern GrB_BinaryOp GrB_MINUS_INT64; -extern GrB_BinaryOp GrB_MINUS_UINT8; -extern GrB_BinaryOp GrB_MINUS_UINT16; -extern GrB_BinaryOp GrB_MINUS_UINT32; -extern GrB_BinaryOp GrB_MINUS_UINT64; -extern GrB_BinaryOp GrB_MIN_BOOL; -extern GrB_BinaryOp GrB_MIN_FP32; -extern GrB_BinaryOp GrB_MIN_FP64; -extern GrB_BinaryOp GrB_MIN_INT8; -extern GrB_BinaryOp GrB_MIN_INT16; -extern GrB_BinaryOp GrB_MIN_INT32; -extern GrB_BinaryOp GrB_MIN_INT64; -extern GrB_BinaryOp GrB_MIN_UINT8; -extern GrB_BinaryOp GrB_MIN_UINT16; -extern GrB_BinaryOp GrB_MIN_UINT32; -extern GrB_BinaryOp GrB_MIN_UINT64; -extern GrB_BinaryOp GrB_NE_BOOL; -extern GrB_BinaryOp GrB_NE_FP32; -extern GrB_BinaryOp GrB_NE_FP64; -extern GrB_BinaryOp GrB_NE_INT8; -extern GrB_BinaryOp GrB_NE_INT16; -extern GrB_BinaryOp GrB_NE_INT32; -extern GrB_BinaryOp GrB_NE_INT64; -extern GrB_BinaryOp GrB_NE_UINT8; -extern GrB_BinaryOp GrB_NE_UINT16; -extern GrB_BinaryOp GrB_NE_UINT32; -extern GrB_BinaryOp GrB_NE_UINT64; -extern GrB_BinaryOp GrB_ONEB_BOOL; -extern GrB_BinaryOp GrB_ONEB_FP32; -extern GrB_BinaryOp GrB_ONEB_FP64; -extern GrB_BinaryOp GrB_ONEB_INT8; -extern GrB_BinaryOp GrB_ONEB_INT16; -extern GrB_BinaryOp GrB_ONEB_INT32; -extern GrB_BinaryOp GrB_ONEB_INT64; -extern GrB_BinaryOp GrB_ONEB_UINT8; -extern GrB_BinaryOp GrB_ONEB_UINT16; -extern GrB_BinaryOp GrB_ONEB_UINT32; -extern GrB_BinaryOp GrB_ONEB_UINT64; -extern GrB_BinaryOp GrB_PLUS_BOOL; -extern GrB_BinaryOp GrB_PLUS_FP32; -extern GrB_BinaryOp GrB_PLUS_FP64; -extern GrB_BinaryOp GrB_PLUS_INT8; -extern GrB_BinaryOp GrB_PLUS_INT16; -extern GrB_BinaryOp GrB_PLUS_INT32; -extern GrB_BinaryOp GrB_PLUS_INT64; -extern GrB_BinaryOp GrB_PLUS_UINT8; -extern GrB_BinaryOp GrB_PLUS_UINT16; -extern GrB_BinaryOp GrB_PLUS_UINT32; -extern GrB_BinaryOp GrB_PLUS_UINT64; -extern GrB_BinaryOp GrB_SECOND_BOOL; -extern GrB_BinaryOp GrB_SECOND_FP32; -extern GrB_BinaryOp GrB_SECOND_FP64; -extern GrB_BinaryOp GrB_SECOND_INT8; -extern GrB_BinaryOp GrB_SECOND_INT16; -extern GrB_BinaryOp GrB_SECOND_INT32; -extern GrB_BinaryOp GrB_SECOND_INT64; -extern GrB_BinaryOp GrB_SECOND_UINT8; -extern GrB_BinaryOp GrB_SECOND_UINT16; -extern GrB_BinaryOp GrB_SECOND_UINT32; -extern GrB_BinaryOp GrB_SECOND_UINT64; -extern GrB_BinaryOp GrB_TIMES_BOOL; -extern GrB_BinaryOp GrB_TIMES_FP32; -extern GrB_BinaryOp GrB_TIMES_FP64; -extern GrB_BinaryOp GrB_TIMES_INT8; -extern GrB_BinaryOp GrB_TIMES_INT16; -extern GrB_BinaryOp GrB_TIMES_INT32; -extern GrB_BinaryOp GrB_TIMES_INT64; -extern GrB_BinaryOp GrB_TIMES_UINT8; -extern GrB_BinaryOp GrB_TIMES_UINT16; -extern GrB_BinaryOp GrB_TIMES_UINT32; -extern GrB_BinaryOp GrB_TIMES_UINT64; -extern GrB_Descriptor GrB_DESC_C; -extern GrB_Descriptor GrB_DESC_CT0; -extern GrB_Descriptor GrB_DESC_CT0T1; -extern GrB_Descriptor GrB_DESC_CT1; -extern GrB_Descriptor GrB_DESC_R; -extern GrB_Descriptor GrB_DESC_RC; -extern GrB_Descriptor GrB_DESC_RCT0; -extern GrB_Descriptor GrB_DESC_RCT0T1; -extern GrB_Descriptor GrB_DESC_RCT1; -extern GrB_Descriptor GrB_DESC_RS; -extern GrB_Descriptor GrB_DESC_RSC; -extern GrB_Descriptor GrB_DESC_RSCT0; -extern GrB_Descriptor GrB_DESC_RSCT0T1; -extern GrB_Descriptor GrB_DESC_RSCT1; -extern GrB_Descriptor GrB_DESC_RST0; -extern GrB_Descriptor GrB_DESC_RST0T1; -extern GrB_Descriptor GrB_DESC_RST1; -extern GrB_Descriptor GrB_DESC_RT0; -extern GrB_Descriptor GrB_DESC_RT0T1; -extern GrB_Descriptor GrB_DESC_RT1; -extern GrB_Descriptor GrB_DESC_S; -extern GrB_Descriptor GrB_DESC_SC; -extern GrB_Descriptor GrB_DESC_SCT0; -extern GrB_Descriptor GrB_DESC_SCT0T1; -extern GrB_Descriptor GrB_DESC_SCT1; -extern GrB_Descriptor GrB_DESC_ST0; -extern GrB_Descriptor GrB_DESC_ST0T1; -extern GrB_Descriptor GrB_DESC_ST1; -extern GrB_Descriptor GrB_DESC_T0; -extern GrB_Descriptor GrB_DESC_T0T1; -extern GrB_Descriptor GrB_DESC_T1; -extern GrB_IndexUnaryOp GrB_COLGT; -extern GrB_IndexUnaryOp GrB_COLINDEX_INT32; -extern GrB_IndexUnaryOp GrB_COLINDEX_INT64; -extern GrB_IndexUnaryOp GrB_COLLE; -extern GrB_IndexUnaryOp GrB_DIAG; -extern GrB_IndexUnaryOp GrB_DIAGINDEX_INT32; -extern GrB_IndexUnaryOp GrB_DIAGINDEX_INT64; -extern GrB_IndexUnaryOp GrB_OFFDIAG; -extern GrB_IndexUnaryOp GrB_ROWGT; -extern GrB_IndexUnaryOp GrB_ROWINDEX_INT32; -extern GrB_IndexUnaryOp GrB_ROWINDEX_INT64; -extern GrB_IndexUnaryOp GrB_ROWLE; -extern GrB_IndexUnaryOp GrB_TRIL; -extern GrB_IndexUnaryOp GrB_TRIU; -extern GrB_IndexUnaryOp GrB_VALUEEQ_BOOL; -extern GrB_IndexUnaryOp GrB_VALUEEQ_FP32; -extern GrB_IndexUnaryOp GrB_VALUEEQ_FP64; -extern GrB_IndexUnaryOp GrB_VALUEEQ_INT8; -extern GrB_IndexUnaryOp GrB_VALUEEQ_INT16; -extern GrB_IndexUnaryOp GrB_VALUEEQ_INT32; -extern GrB_IndexUnaryOp GrB_VALUEEQ_INT64; -extern GrB_IndexUnaryOp GrB_VALUEEQ_UINT8; -extern GrB_IndexUnaryOp GrB_VALUEEQ_UINT16; -extern GrB_IndexUnaryOp GrB_VALUEEQ_UINT32; -extern GrB_IndexUnaryOp GrB_VALUEEQ_UINT64; -extern GrB_IndexUnaryOp GrB_VALUEGE_BOOL; -extern GrB_IndexUnaryOp GrB_VALUEGE_FP32; -extern GrB_IndexUnaryOp GrB_VALUEGE_FP64; -extern GrB_IndexUnaryOp GrB_VALUEGE_INT8; -extern GrB_IndexUnaryOp GrB_VALUEGE_INT16; -extern GrB_IndexUnaryOp GrB_VALUEGE_INT32; -extern GrB_IndexUnaryOp GrB_VALUEGE_INT64; -extern GrB_IndexUnaryOp GrB_VALUEGE_UINT8; -extern GrB_IndexUnaryOp GrB_VALUEGE_UINT16; -extern GrB_IndexUnaryOp GrB_VALUEGE_UINT32; -extern GrB_IndexUnaryOp GrB_VALUEGE_UINT64; -extern GrB_IndexUnaryOp GrB_VALUEGT_BOOL; -extern GrB_IndexUnaryOp GrB_VALUEGT_FP32; -extern GrB_IndexUnaryOp GrB_VALUEGT_FP64; -extern GrB_IndexUnaryOp GrB_VALUEGT_INT8; -extern GrB_IndexUnaryOp GrB_VALUEGT_INT16; -extern GrB_IndexUnaryOp GrB_VALUEGT_INT32; -extern GrB_IndexUnaryOp GrB_VALUEGT_INT64; -extern GrB_IndexUnaryOp GrB_VALUEGT_UINT8; -extern GrB_IndexUnaryOp GrB_VALUEGT_UINT16; -extern GrB_IndexUnaryOp GrB_VALUEGT_UINT32; -extern GrB_IndexUnaryOp GrB_VALUEGT_UINT64; -extern GrB_IndexUnaryOp GrB_VALUELE_BOOL; -extern GrB_IndexUnaryOp GrB_VALUELE_FP32; -extern GrB_IndexUnaryOp GrB_VALUELE_FP64; -extern GrB_IndexUnaryOp GrB_VALUELE_INT8; -extern GrB_IndexUnaryOp GrB_VALUELE_INT16; -extern GrB_IndexUnaryOp GrB_VALUELE_INT32; -extern GrB_IndexUnaryOp GrB_VALUELE_INT64; -extern GrB_IndexUnaryOp GrB_VALUELE_UINT8; -extern GrB_IndexUnaryOp GrB_VALUELE_UINT16; -extern GrB_IndexUnaryOp GrB_VALUELE_UINT32; -extern GrB_IndexUnaryOp GrB_VALUELE_UINT64; -extern GrB_IndexUnaryOp GrB_VALUELT_BOOL; -extern GrB_IndexUnaryOp GrB_VALUELT_FP32; -extern GrB_IndexUnaryOp GrB_VALUELT_FP64; -extern GrB_IndexUnaryOp GrB_VALUELT_INT8; -extern GrB_IndexUnaryOp GrB_VALUELT_INT16; -extern GrB_IndexUnaryOp GrB_VALUELT_INT32; -extern GrB_IndexUnaryOp GrB_VALUELT_INT64; -extern GrB_IndexUnaryOp GrB_VALUELT_UINT8; -extern GrB_IndexUnaryOp GrB_VALUELT_UINT16; -extern GrB_IndexUnaryOp GrB_VALUELT_UINT32; -extern GrB_IndexUnaryOp GrB_VALUELT_UINT64; -extern GrB_IndexUnaryOp GrB_VALUENE_BOOL; -extern GrB_IndexUnaryOp GrB_VALUENE_FP32; -extern GrB_IndexUnaryOp GrB_VALUENE_FP64; -extern GrB_IndexUnaryOp GrB_VALUENE_INT8; -extern GrB_IndexUnaryOp GrB_VALUENE_INT16; -extern GrB_IndexUnaryOp GrB_VALUENE_INT32; -extern GrB_IndexUnaryOp GrB_VALUENE_INT64; -extern GrB_IndexUnaryOp GrB_VALUENE_UINT8; -extern GrB_IndexUnaryOp GrB_VALUENE_UINT16; -extern GrB_IndexUnaryOp GrB_VALUENE_UINT32; -extern GrB_IndexUnaryOp GrB_VALUENE_UINT64; -extern GrB_Monoid GrB_LAND_MONOID_BOOL; -extern GrB_Monoid GrB_LOR_MONOID_BOOL; -extern GrB_Monoid GrB_LXNOR_MONOID_BOOL; -extern GrB_Monoid GrB_LXOR_MONOID_BOOL; -extern GrB_Monoid GrB_MAX_MONOID_FP32; -extern GrB_Monoid GrB_MAX_MONOID_FP64; -extern GrB_Monoid GrB_MAX_MONOID_INT8; -extern GrB_Monoid GrB_MAX_MONOID_INT16; -extern GrB_Monoid GrB_MAX_MONOID_INT32; -extern GrB_Monoid GrB_MAX_MONOID_INT64; -extern GrB_Monoid GrB_MAX_MONOID_UINT8; -extern GrB_Monoid GrB_MAX_MONOID_UINT16; -extern GrB_Monoid GrB_MAX_MONOID_UINT32; -extern GrB_Monoid GrB_MAX_MONOID_UINT64; -extern GrB_Monoid GrB_MIN_MONOID_FP32; -extern GrB_Monoid GrB_MIN_MONOID_FP64; -extern GrB_Monoid GrB_MIN_MONOID_INT8; -extern GrB_Monoid GrB_MIN_MONOID_INT16; -extern GrB_Monoid GrB_MIN_MONOID_INT32; -extern GrB_Monoid GrB_MIN_MONOID_INT64; -extern GrB_Monoid GrB_MIN_MONOID_UINT8; -extern GrB_Monoid GrB_MIN_MONOID_UINT16; -extern GrB_Monoid GrB_MIN_MONOID_UINT32; -extern GrB_Monoid GrB_MIN_MONOID_UINT64; -extern GrB_Monoid GrB_PLUS_MONOID_FP32; -extern GrB_Monoid GrB_PLUS_MONOID_FP64; -extern GrB_Monoid GrB_PLUS_MONOID_INT8; -extern GrB_Monoid GrB_PLUS_MONOID_INT16; -extern GrB_Monoid GrB_PLUS_MONOID_INT32; -extern GrB_Monoid GrB_PLUS_MONOID_INT64; -extern GrB_Monoid GrB_PLUS_MONOID_UINT8; -extern GrB_Monoid GrB_PLUS_MONOID_UINT16; -extern GrB_Monoid GrB_PLUS_MONOID_UINT32; -extern GrB_Monoid GrB_PLUS_MONOID_UINT64; -extern GrB_Monoid GrB_TIMES_MONOID_FP32; -extern GrB_Monoid GrB_TIMES_MONOID_FP64; -extern GrB_Monoid GrB_TIMES_MONOID_INT8; -extern GrB_Monoid GrB_TIMES_MONOID_INT16; -extern GrB_Monoid GrB_TIMES_MONOID_INT32; -extern GrB_Monoid GrB_TIMES_MONOID_INT64; -extern GrB_Monoid GrB_TIMES_MONOID_UINT8; -extern GrB_Monoid GrB_TIMES_MONOID_UINT16; -extern GrB_Monoid GrB_TIMES_MONOID_UINT32; -extern GrB_Monoid GrB_TIMES_MONOID_UINT64; -extern GrB_Semiring GrB_LAND_LOR_SEMIRING_BOOL; -extern GrB_Semiring GrB_LOR_LAND_SEMIRING_BOOL; -extern GrB_Semiring GrB_LXNOR_LOR_SEMIRING_BOOL; -extern GrB_Semiring GrB_LXOR_LAND_SEMIRING_BOOL; -extern GrB_Semiring GrB_MAX_FIRST_SEMIRING_FP32; -extern GrB_Semiring GrB_MAX_FIRST_SEMIRING_FP64; -extern GrB_Semiring GrB_MAX_FIRST_SEMIRING_INT8; -extern GrB_Semiring GrB_MAX_FIRST_SEMIRING_INT16; -extern GrB_Semiring GrB_MAX_FIRST_SEMIRING_INT32; -extern GrB_Semiring GrB_MAX_FIRST_SEMIRING_INT64; -extern GrB_Semiring GrB_MAX_FIRST_SEMIRING_UINT8; -extern GrB_Semiring GrB_MAX_FIRST_SEMIRING_UINT16; -extern GrB_Semiring GrB_MAX_FIRST_SEMIRING_UINT32; -extern GrB_Semiring GrB_MAX_FIRST_SEMIRING_UINT64; -extern GrB_Semiring GrB_MAX_MIN_SEMIRING_FP32; -extern GrB_Semiring GrB_MAX_MIN_SEMIRING_FP64; -extern GrB_Semiring GrB_MAX_MIN_SEMIRING_INT8; -extern GrB_Semiring GrB_MAX_MIN_SEMIRING_INT16; -extern GrB_Semiring GrB_MAX_MIN_SEMIRING_INT32; -extern GrB_Semiring GrB_MAX_MIN_SEMIRING_INT64; -extern GrB_Semiring GrB_MAX_MIN_SEMIRING_UINT8; -extern GrB_Semiring GrB_MAX_MIN_SEMIRING_UINT16; -extern GrB_Semiring GrB_MAX_MIN_SEMIRING_UINT32; -extern GrB_Semiring GrB_MAX_MIN_SEMIRING_UINT64; -extern GrB_Semiring GrB_MAX_PLUS_SEMIRING_FP32; -extern GrB_Semiring GrB_MAX_PLUS_SEMIRING_FP64; -extern GrB_Semiring GrB_MAX_PLUS_SEMIRING_INT8; -extern GrB_Semiring GrB_MAX_PLUS_SEMIRING_INT16; -extern GrB_Semiring GrB_MAX_PLUS_SEMIRING_INT32; -extern GrB_Semiring GrB_MAX_PLUS_SEMIRING_INT64; -extern GrB_Semiring GrB_MAX_PLUS_SEMIRING_UINT8; -extern GrB_Semiring GrB_MAX_PLUS_SEMIRING_UINT16; -extern GrB_Semiring GrB_MAX_PLUS_SEMIRING_UINT32; -extern GrB_Semiring GrB_MAX_PLUS_SEMIRING_UINT64; -extern GrB_Semiring GrB_MAX_SECOND_SEMIRING_FP32; -extern GrB_Semiring GrB_MAX_SECOND_SEMIRING_FP64; -extern GrB_Semiring GrB_MAX_SECOND_SEMIRING_INT8; -extern GrB_Semiring GrB_MAX_SECOND_SEMIRING_INT16; -extern GrB_Semiring GrB_MAX_SECOND_SEMIRING_INT32; -extern GrB_Semiring GrB_MAX_SECOND_SEMIRING_INT64; -extern GrB_Semiring GrB_MAX_SECOND_SEMIRING_UINT8; -extern GrB_Semiring GrB_MAX_SECOND_SEMIRING_UINT16; -extern GrB_Semiring GrB_MAX_SECOND_SEMIRING_UINT32; -extern GrB_Semiring GrB_MAX_SECOND_SEMIRING_UINT64; -extern GrB_Semiring GrB_MAX_TIMES_SEMIRING_FP32; -extern GrB_Semiring GrB_MAX_TIMES_SEMIRING_FP64; -extern GrB_Semiring GrB_MAX_TIMES_SEMIRING_INT8; -extern GrB_Semiring GrB_MAX_TIMES_SEMIRING_INT16; -extern GrB_Semiring GrB_MAX_TIMES_SEMIRING_INT32; -extern GrB_Semiring GrB_MAX_TIMES_SEMIRING_INT64; -extern GrB_Semiring GrB_MAX_TIMES_SEMIRING_UINT8; -extern GrB_Semiring GrB_MAX_TIMES_SEMIRING_UINT16; -extern GrB_Semiring GrB_MAX_TIMES_SEMIRING_UINT32; -extern GrB_Semiring GrB_MAX_TIMES_SEMIRING_UINT64; -extern GrB_Semiring GrB_MIN_FIRST_SEMIRING_FP32; -extern GrB_Semiring GrB_MIN_FIRST_SEMIRING_FP64; -extern GrB_Semiring GrB_MIN_FIRST_SEMIRING_INT8; -extern GrB_Semiring GrB_MIN_FIRST_SEMIRING_INT16; -extern GrB_Semiring GrB_MIN_FIRST_SEMIRING_INT32; -extern GrB_Semiring GrB_MIN_FIRST_SEMIRING_INT64; -extern GrB_Semiring GrB_MIN_FIRST_SEMIRING_UINT8; -extern GrB_Semiring GrB_MIN_FIRST_SEMIRING_UINT16; -extern GrB_Semiring GrB_MIN_FIRST_SEMIRING_UINT32; -extern GrB_Semiring GrB_MIN_FIRST_SEMIRING_UINT64; -extern GrB_Semiring GrB_MIN_MAX_SEMIRING_FP32; -extern GrB_Semiring GrB_MIN_MAX_SEMIRING_FP64; -extern GrB_Semiring GrB_MIN_MAX_SEMIRING_INT8; -extern GrB_Semiring GrB_MIN_MAX_SEMIRING_INT16; -extern GrB_Semiring GrB_MIN_MAX_SEMIRING_INT32; -extern GrB_Semiring GrB_MIN_MAX_SEMIRING_INT64; -extern GrB_Semiring GrB_MIN_MAX_SEMIRING_UINT8; -extern GrB_Semiring GrB_MIN_MAX_SEMIRING_UINT16; -extern GrB_Semiring GrB_MIN_MAX_SEMIRING_UINT32; -extern GrB_Semiring GrB_MIN_MAX_SEMIRING_UINT64; -extern GrB_Semiring GrB_MIN_PLUS_SEMIRING_FP32; -extern GrB_Semiring GrB_MIN_PLUS_SEMIRING_FP64; -extern GrB_Semiring GrB_MIN_PLUS_SEMIRING_INT8; -extern GrB_Semiring GrB_MIN_PLUS_SEMIRING_INT16; -extern GrB_Semiring GrB_MIN_PLUS_SEMIRING_INT32; -extern GrB_Semiring GrB_MIN_PLUS_SEMIRING_INT64; -extern GrB_Semiring GrB_MIN_PLUS_SEMIRING_UINT8; -extern GrB_Semiring GrB_MIN_PLUS_SEMIRING_UINT16; -extern GrB_Semiring GrB_MIN_PLUS_SEMIRING_UINT32; -extern GrB_Semiring GrB_MIN_PLUS_SEMIRING_UINT64; -extern GrB_Semiring GrB_MIN_SECOND_SEMIRING_FP32; -extern GrB_Semiring GrB_MIN_SECOND_SEMIRING_FP64; -extern GrB_Semiring GrB_MIN_SECOND_SEMIRING_INT8; -extern GrB_Semiring GrB_MIN_SECOND_SEMIRING_INT16; -extern GrB_Semiring GrB_MIN_SECOND_SEMIRING_INT32; -extern GrB_Semiring GrB_MIN_SECOND_SEMIRING_INT64; -extern GrB_Semiring GrB_MIN_SECOND_SEMIRING_UINT8; -extern GrB_Semiring GrB_MIN_SECOND_SEMIRING_UINT16; -extern GrB_Semiring GrB_MIN_SECOND_SEMIRING_UINT32; -extern GrB_Semiring GrB_MIN_SECOND_SEMIRING_UINT64; -extern GrB_Semiring GrB_MIN_TIMES_SEMIRING_FP32; -extern GrB_Semiring GrB_MIN_TIMES_SEMIRING_FP64; -extern GrB_Semiring GrB_MIN_TIMES_SEMIRING_INT8; -extern GrB_Semiring GrB_MIN_TIMES_SEMIRING_INT16; -extern GrB_Semiring GrB_MIN_TIMES_SEMIRING_INT32; -extern GrB_Semiring GrB_MIN_TIMES_SEMIRING_INT64; -extern GrB_Semiring GrB_MIN_TIMES_SEMIRING_UINT8; -extern GrB_Semiring GrB_MIN_TIMES_SEMIRING_UINT16; -extern GrB_Semiring GrB_MIN_TIMES_SEMIRING_UINT32; -extern GrB_Semiring GrB_MIN_TIMES_SEMIRING_UINT64; -extern GrB_Semiring GrB_PLUS_MIN_SEMIRING_FP32; -extern GrB_Semiring GrB_PLUS_MIN_SEMIRING_FP64; -extern GrB_Semiring GrB_PLUS_MIN_SEMIRING_INT8; -extern GrB_Semiring GrB_PLUS_MIN_SEMIRING_INT16; -extern GrB_Semiring GrB_PLUS_MIN_SEMIRING_INT32; -extern GrB_Semiring GrB_PLUS_MIN_SEMIRING_INT64; -extern GrB_Semiring GrB_PLUS_MIN_SEMIRING_UINT8; -extern GrB_Semiring GrB_PLUS_MIN_SEMIRING_UINT16; -extern GrB_Semiring GrB_PLUS_MIN_SEMIRING_UINT32; -extern GrB_Semiring GrB_PLUS_MIN_SEMIRING_UINT64; -extern GrB_Semiring GrB_PLUS_TIMES_SEMIRING_FP32; -extern GrB_Semiring GrB_PLUS_TIMES_SEMIRING_FP64; -extern GrB_Semiring GrB_PLUS_TIMES_SEMIRING_INT8; -extern GrB_Semiring GrB_PLUS_TIMES_SEMIRING_INT16; -extern GrB_Semiring GrB_PLUS_TIMES_SEMIRING_INT32; -extern GrB_Semiring GrB_PLUS_TIMES_SEMIRING_INT64; -extern GrB_Semiring GrB_PLUS_TIMES_SEMIRING_UINT8; -extern GrB_Semiring GrB_PLUS_TIMES_SEMIRING_UINT16; -extern GrB_Semiring GrB_PLUS_TIMES_SEMIRING_UINT32; -extern GrB_Semiring GrB_PLUS_TIMES_SEMIRING_UINT64; -extern GrB_Type GrB_BOOL; -extern GrB_Type GrB_FP32; -extern GrB_Type GrB_FP64; -extern GrB_Type GrB_INT8; -extern GrB_Type GrB_INT16; -extern GrB_Type GrB_INT32; -extern GrB_Type GrB_INT64; -extern GrB_Type GrB_UINT8; -extern GrB_Type GrB_UINT16; -extern GrB_Type GrB_UINT32; -extern GrB_Type GrB_UINT64; -extern GrB_UnaryOp GrB_ABS_BOOL; -extern GrB_UnaryOp GrB_ABS_FP32; -extern GrB_UnaryOp GrB_ABS_FP64; -extern GrB_UnaryOp GrB_ABS_INT8; -extern GrB_UnaryOp GrB_ABS_INT16; -extern GrB_UnaryOp GrB_ABS_INT32; -extern GrB_UnaryOp GrB_ABS_INT64; -extern GrB_UnaryOp GrB_ABS_UINT8; -extern GrB_UnaryOp GrB_ABS_UINT16; -extern GrB_UnaryOp GrB_ABS_UINT32; -extern GrB_UnaryOp GrB_ABS_UINT64; -extern GrB_UnaryOp GrB_AINV_BOOL; -extern GrB_UnaryOp GrB_AINV_FP32; -extern GrB_UnaryOp GrB_AINV_FP64; -extern GrB_UnaryOp GrB_AINV_INT8; -extern GrB_UnaryOp GrB_AINV_INT16; -extern GrB_UnaryOp GrB_AINV_INT32; -extern GrB_UnaryOp GrB_AINV_INT64; -extern GrB_UnaryOp GrB_AINV_UINT8; -extern GrB_UnaryOp GrB_AINV_UINT16; -extern GrB_UnaryOp GrB_AINV_UINT32; -extern GrB_UnaryOp GrB_AINV_UINT64; -extern GrB_UnaryOp GrB_BNOT_INT8; -extern GrB_UnaryOp GrB_BNOT_INT16; -extern GrB_UnaryOp GrB_BNOT_INT32; -extern GrB_UnaryOp GrB_BNOT_INT64; -extern GrB_UnaryOp GrB_BNOT_UINT8; -extern GrB_UnaryOp GrB_BNOT_UINT16; -extern GrB_UnaryOp GrB_BNOT_UINT32; -extern GrB_UnaryOp GrB_BNOT_UINT64; -extern GrB_UnaryOp GrB_IDENTITY_BOOL; -extern GrB_UnaryOp GrB_IDENTITY_FP32; -extern GrB_UnaryOp GrB_IDENTITY_FP64; -extern GrB_UnaryOp GrB_IDENTITY_INT8; -extern GrB_UnaryOp GrB_IDENTITY_INT16; -extern GrB_UnaryOp GrB_IDENTITY_INT32; -extern GrB_UnaryOp GrB_IDENTITY_INT64; -extern GrB_UnaryOp GrB_IDENTITY_UINT8; -extern GrB_UnaryOp GrB_IDENTITY_UINT16; -extern GrB_UnaryOp GrB_IDENTITY_UINT32; -extern GrB_UnaryOp GrB_IDENTITY_UINT64; -extern GrB_UnaryOp GrB_LNOT; -extern GrB_UnaryOp GrB_MINV_BOOL; -extern GrB_UnaryOp GrB_MINV_FP32; -extern GrB_UnaryOp GrB_MINV_FP64; -extern GrB_UnaryOp GrB_MINV_INT8; -extern GrB_UnaryOp GrB_MINV_INT16; -extern GrB_UnaryOp GrB_MINV_INT32; -extern GrB_UnaryOp GrB_MINV_INT64; -extern GrB_UnaryOp GrB_MINV_UINT8; -extern GrB_UnaryOp GrB_MINV_UINT16; -extern GrB_UnaryOp GrB_MINV_UINT32; -extern GrB_UnaryOp GrB_MINV_UINT64; - -/* GrB objects (extended) */ -extern GrB_BinaryOp GxB_ANY_BOOL; -extern GrB_BinaryOp GxB_ANY_FC32; -extern GrB_BinaryOp GxB_ANY_FC64; -extern GrB_BinaryOp GxB_ANY_FP32; -extern GrB_BinaryOp GxB_ANY_FP64; -extern GrB_BinaryOp GxB_ANY_INT8; -extern GrB_BinaryOp GxB_ANY_INT16; -extern GrB_BinaryOp GxB_ANY_INT32; -extern GrB_BinaryOp GxB_ANY_INT64; -extern GrB_BinaryOp GxB_ANY_UINT8; -extern GrB_BinaryOp GxB_ANY_UINT16; -extern GrB_BinaryOp GxB_ANY_UINT32; -extern GrB_BinaryOp GxB_ANY_UINT64; -extern GrB_BinaryOp GxB_ATAN2_FP32; -extern GrB_BinaryOp GxB_ATAN2_FP64; -extern GrB_BinaryOp GxB_BCLR_INT8; -extern GrB_BinaryOp GxB_BCLR_INT16; -extern GrB_BinaryOp GxB_BCLR_INT32; -extern GrB_BinaryOp GxB_BCLR_INT64; -extern GrB_BinaryOp GxB_BCLR_UINT8; -extern GrB_BinaryOp GxB_BCLR_UINT16; -extern GrB_BinaryOp GxB_BCLR_UINT32; -extern GrB_BinaryOp GxB_BCLR_UINT64; -extern GrB_BinaryOp GxB_BGET_INT8; -extern GrB_BinaryOp GxB_BGET_INT16; -extern GrB_BinaryOp GxB_BGET_INT32; -extern GrB_BinaryOp GxB_BGET_INT64; -extern GrB_BinaryOp GxB_BGET_UINT8; -extern GrB_BinaryOp GxB_BGET_UINT16; -extern GrB_BinaryOp GxB_BGET_UINT32; -extern GrB_BinaryOp GxB_BGET_UINT64; -extern GrB_BinaryOp GxB_BSET_INT8; -extern GrB_BinaryOp GxB_BSET_INT16; -extern GrB_BinaryOp GxB_BSET_INT32; -extern GrB_BinaryOp GxB_BSET_INT64; -extern GrB_BinaryOp GxB_BSET_UINT8; -extern GrB_BinaryOp GxB_BSET_UINT16; -extern GrB_BinaryOp GxB_BSET_UINT32; -extern GrB_BinaryOp GxB_BSET_UINT64; -extern GrB_BinaryOp GxB_BSHIFT_INT8; -extern GrB_BinaryOp GxB_BSHIFT_INT16; -extern GrB_BinaryOp GxB_BSHIFT_INT32; -extern GrB_BinaryOp GxB_BSHIFT_INT64; -extern GrB_BinaryOp GxB_BSHIFT_UINT8; -extern GrB_BinaryOp GxB_BSHIFT_UINT16; -extern GrB_BinaryOp GxB_BSHIFT_UINT32; -extern GrB_BinaryOp GxB_BSHIFT_UINT64; -extern GrB_BinaryOp GxB_CMPLX_FP32; -extern GrB_BinaryOp GxB_CMPLX_FP64; -extern GrB_BinaryOp GxB_COPYSIGN_FP32; -extern GrB_BinaryOp GxB_COPYSIGN_FP64; -extern GrB_BinaryOp GxB_DIV_FC32; -extern GrB_BinaryOp GxB_DIV_FC64; -extern GrB_BinaryOp GxB_EQ_FC32; -extern GrB_BinaryOp GxB_EQ_FC64; -extern GrB_BinaryOp GxB_FIRSTI1_INT32; -extern GrB_BinaryOp GxB_FIRSTI1_INT64; -extern GrB_BinaryOp GxB_FIRSTI_INT32; -extern GrB_BinaryOp GxB_FIRSTI_INT64; -extern GrB_BinaryOp GxB_FIRSTJ1_INT32; -extern GrB_BinaryOp GxB_FIRSTJ1_INT64; -extern GrB_BinaryOp GxB_FIRSTJ_INT32; -extern GrB_BinaryOp GxB_FIRSTJ_INT64; -extern GrB_BinaryOp GxB_FIRST_FC32; -extern GrB_BinaryOp GxB_FIRST_FC64; -extern GrB_BinaryOp GxB_FMOD_FP32; -extern GrB_BinaryOp GxB_FMOD_FP64; -extern GrB_BinaryOp GxB_HYPOT_FP32; -extern GrB_BinaryOp GxB_HYPOT_FP64; -extern GrB_BinaryOp GxB_IGNORE_DUP; -extern GrB_BinaryOp GxB_ISEQ_BOOL; -extern GrB_BinaryOp GxB_ISEQ_FC32; -extern GrB_BinaryOp GxB_ISEQ_FC64; -extern GrB_BinaryOp GxB_ISEQ_FP32; -extern GrB_BinaryOp GxB_ISEQ_FP64; -extern GrB_BinaryOp GxB_ISEQ_INT8; -extern GrB_BinaryOp GxB_ISEQ_INT16; -extern GrB_BinaryOp GxB_ISEQ_INT32; -extern GrB_BinaryOp GxB_ISEQ_INT64; -extern GrB_BinaryOp GxB_ISEQ_UINT8; -extern GrB_BinaryOp GxB_ISEQ_UINT16; -extern GrB_BinaryOp GxB_ISEQ_UINT32; -extern GrB_BinaryOp GxB_ISEQ_UINT64; -extern GrB_BinaryOp GxB_ISGE_BOOL; -extern GrB_BinaryOp GxB_ISGE_FP32; -extern GrB_BinaryOp GxB_ISGE_FP64; -extern GrB_BinaryOp GxB_ISGE_INT8; -extern GrB_BinaryOp GxB_ISGE_INT16; -extern GrB_BinaryOp GxB_ISGE_INT32; -extern GrB_BinaryOp GxB_ISGE_INT64; -extern GrB_BinaryOp GxB_ISGE_UINT8; -extern GrB_BinaryOp GxB_ISGE_UINT16; -extern GrB_BinaryOp GxB_ISGE_UINT32; -extern GrB_BinaryOp GxB_ISGE_UINT64; -extern GrB_BinaryOp GxB_ISGT_BOOL; -extern GrB_BinaryOp GxB_ISGT_FP32; -extern GrB_BinaryOp GxB_ISGT_FP64; -extern GrB_BinaryOp GxB_ISGT_INT8; -extern GrB_BinaryOp GxB_ISGT_INT16; -extern GrB_BinaryOp GxB_ISGT_INT32; -extern GrB_BinaryOp GxB_ISGT_INT64; -extern GrB_BinaryOp GxB_ISGT_UINT8; -extern GrB_BinaryOp GxB_ISGT_UINT16; -extern GrB_BinaryOp GxB_ISGT_UINT32; -extern GrB_BinaryOp GxB_ISGT_UINT64; -extern GrB_BinaryOp GxB_ISLE_BOOL; -extern GrB_BinaryOp GxB_ISLE_FP32; -extern GrB_BinaryOp GxB_ISLE_FP64; -extern GrB_BinaryOp GxB_ISLE_INT8; -extern GrB_BinaryOp GxB_ISLE_INT16; -extern GrB_BinaryOp GxB_ISLE_INT32; -extern GrB_BinaryOp GxB_ISLE_INT64; -extern GrB_BinaryOp GxB_ISLE_UINT8; -extern GrB_BinaryOp GxB_ISLE_UINT16; -extern GrB_BinaryOp GxB_ISLE_UINT32; -extern GrB_BinaryOp GxB_ISLE_UINT64; -extern GrB_BinaryOp GxB_ISLT_BOOL; -extern GrB_BinaryOp GxB_ISLT_FP32; -extern GrB_BinaryOp GxB_ISLT_FP64; -extern GrB_BinaryOp GxB_ISLT_INT8; -extern GrB_BinaryOp GxB_ISLT_INT16; -extern GrB_BinaryOp GxB_ISLT_INT32; -extern GrB_BinaryOp GxB_ISLT_INT64; -extern GrB_BinaryOp GxB_ISLT_UINT8; -extern GrB_BinaryOp GxB_ISLT_UINT16; -extern GrB_BinaryOp GxB_ISLT_UINT32; -extern GrB_BinaryOp GxB_ISLT_UINT64; -extern GrB_BinaryOp GxB_ISNE_BOOL; -extern GrB_BinaryOp GxB_ISNE_FC32; -extern GrB_BinaryOp GxB_ISNE_FC64; -extern GrB_BinaryOp GxB_ISNE_FP32; -extern GrB_BinaryOp GxB_ISNE_FP64; -extern GrB_BinaryOp GxB_ISNE_INT8; -extern GrB_BinaryOp GxB_ISNE_INT16; -extern GrB_BinaryOp GxB_ISNE_INT32; -extern GrB_BinaryOp GxB_ISNE_INT64; -extern GrB_BinaryOp GxB_ISNE_UINT8; -extern GrB_BinaryOp GxB_ISNE_UINT16; -extern GrB_BinaryOp GxB_ISNE_UINT32; -extern GrB_BinaryOp GxB_ISNE_UINT64; -extern GrB_BinaryOp GxB_LAND_BOOL; -extern GrB_BinaryOp GxB_LAND_FP32; -extern GrB_BinaryOp GxB_LAND_FP64; -extern GrB_BinaryOp GxB_LAND_INT8; -extern GrB_BinaryOp GxB_LAND_INT16; -extern GrB_BinaryOp GxB_LAND_INT32; -extern GrB_BinaryOp GxB_LAND_INT64; -extern GrB_BinaryOp GxB_LAND_UINT8; -extern GrB_BinaryOp GxB_LAND_UINT16; -extern GrB_BinaryOp GxB_LAND_UINT32; -extern GrB_BinaryOp GxB_LAND_UINT64; -extern GrB_BinaryOp GxB_LDEXP_FP32; -extern GrB_BinaryOp GxB_LDEXP_FP64; -extern GrB_BinaryOp GxB_LOR_BOOL; -extern GrB_BinaryOp GxB_LOR_FP32; -extern GrB_BinaryOp GxB_LOR_FP64; -extern GrB_BinaryOp GxB_LOR_INT8; -extern GrB_BinaryOp GxB_LOR_INT16; -extern GrB_BinaryOp GxB_LOR_INT32; -extern GrB_BinaryOp GxB_LOR_INT64; -extern GrB_BinaryOp GxB_LOR_UINT8; -extern GrB_BinaryOp GxB_LOR_UINT16; -extern GrB_BinaryOp GxB_LOR_UINT32; -extern GrB_BinaryOp GxB_LOR_UINT64; -extern GrB_BinaryOp GxB_LXOR_BOOL; -extern GrB_BinaryOp GxB_LXOR_FP32; -extern GrB_BinaryOp GxB_LXOR_FP64; -extern GrB_BinaryOp GxB_LXOR_INT8; -extern GrB_BinaryOp GxB_LXOR_INT16; -extern GrB_BinaryOp GxB_LXOR_INT32; -extern GrB_BinaryOp GxB_LXOR_INT64; -extern GrB_BinaryOp GxB_LXOR_UINT8; -extern GrB_BinaryOp GxB_LXOR_UINT16; -extern GrB_BinaryOp GxB_LXOR_UINT32; -extern GrB_BinaryOp GxB_LXOR_UINT64; -extern GrB_BinaryOp GxB_MINUS_FC32; -extern GrB_BinaryOp GxB_MINUS_FC64; -extern GrB_BinaryOp GxB_NE_FC32; -extern GrB_BinaryOp GxB_NE_FC64; -extern GrB_BinaryOp GxB_ONEB_FC32; -extern GrB_BinaryOp GxB_ONEB_FC64; -extern GrB_BinaryOp GxB_PAIR_BOOL; -extern GrB_BinaryOp GxB_PAIR_FC32; -extern GrB_BinaryOp GxB_PAIR_FC64; -extern GrB_BinaryOp GxB_PAIR_FP32; -extern GrB_BinaryOp GxB_PAIR_FP64; -extern GrB_BinaryOp GxB_PAIR_INT8; -extern GrB_BinaryOp GxB_PAIR_INT16; -extern GrB_BinaryOp GxB_PAIR_INT32; -extern GrB_BinaryOp GxB_PAIR_INT64; -extern GrB_BinaryOp GxB_PAIR_UINT8; -extern GrB_BinaryOp GxB_PAIR_UINT16; -extern GrB_BinaryOp GxB_PAIR_UINT32; -extern GrB_BinaryOp GxB_PAIR_UINT64; -extern GrB_BinaryOp GxB_PLUS_FC32; -extern GrB_BinaryOp GxB_PLUS_FC64; -extern GrB_BinaryOp GxB_POW_BOOL; -extern GrB_BinaryOp GxB_POW_FC32; -extern GrB_BinaryOp GxB_POW_FC64; -extern GrB_BinaryOp GxB_POW_FP32; -extern GrB_BinaryOp GxB_POW_FP64; -extern GrB_BinaryOp GxB_POW_INT8; -extern GrB_BinaryOp GxB_POW_INT16; -extern GrB_BinaryOp GxB_POW_INT32; -extern GrB_BinaryOp GxB_POW_INT64; -extern GrB_BinaryOp GxB_POW_UINT8; -extern GrB_BinaryOp GxB_POW_UINT16; -extern GrB_BinaryOp GxB_POW_UINT32; -extern GrB_BinaryOp GxB_POW_UINT64; -extern GrB_BinaryOp GxB_RDIV_BOOL; -extern GrB_BinaryOp GxB_RDIV_FC32; -extern GrB_BinaryOp GxB_RDIV_FC64; -extern GrB_BinaryOp GxB_RDIV_FP32; -extern GrB_BinaryOp GxB_RDIV_FP64; -extern GrB_BinaryOp GxB_RDIV_INT8; -extern GrB_BinaryOp GxB_RDIV_INT16; -extern GrB_BinaryOp GxB_RDIV_INT32; -extern GrB_BinaryOp GxB_RDIV_INT64; -extern GrB_BinaryOp GxB_RDIV_UINT8; -extern GrB_BinaryOp GxB_RDIV_UINT16; -extern GrB_BinaryOp GxB_RDIV_UINT32; -extern GrB_BinaryOp GxB_RDIV_UINT64; -extern GrB_BinaryOp GxB_REMAINDER_FP32; -extern GrB_BinaryOp GxB_REMAINDER_FP64; -extern GrB_BinaryOp GxB_RMINUS_BOOL; -extern GrB_BinaryOp GxB_RMINUS_FC32; -extern GrB_BinaryOp GxB_RMINUS_FC64; -extern GrB_BinaryOp GxB_RMINUS_FP32; -extern GrB_BinaryOp GxB_RMINUS_FP64; -extern GrB_BinaryOp GxB_RMINUS_INT8; -extern GrB_BinaryOp GxB_RMINUS_INT16; -extern GrB_BinaryOp GxB_RMINUS_INT32; -extern GrB_BinaryOp GxB_RMINUS_INT64; -extern GrB_BinaryOp GxB_RMINUS_UINT8; -extern GrB_BinaryOp GxB_RMINUS_UINT16; -extern GrB_BinaryOp GxB_RMINUS_UINT32; -extern GrB_BinaryOp GxB_RMINUS_UINT64; -extern GrB_BinaryOp GxB_SECONDI1_INT32; -extern GrB_BinaryOp GxB_SECONDI1_INT64; -extern GrB_BinaryOp GxB_SECONDI_INT32; -extern GrB_BinaryOp GxB_SECONDI_INT64; -extern GrB_BinaryOp GxB_SECONDJ1_INT32; -extern GrB_BinaryOp GxB_SECONDJ1_INT64; -extern GrB_BinaryOp GxB_SECONDJ_INT32; -extern GrB_BinaryOp GxB_SECONDJ_INT64; -extern GrB_BinaryOp GxB_SECOND_FC32; -extern GrB_BinaryOp GxB_SECOND_FC64; -extern GrB_BinaryOp GxB_TIMES_FC32; -extern GrB_BinaryOp GxB_TIMES_FC64; -extern GrB_IndexUnaryOp GxB_VALUEEQ_FC32; -extern GrB_IndexUnaryOp GxB_VALUEEQ_FC64; -extern GrB_IndexUnaryOp GxB_VALUENE_FC32; -extern GrB_IndexUnaryOp GxB_VALUENE_FC64; -extern GrB_Monoid GxB_ANY_BOOL_MONOID; -extern GrB_Monoid GxB_ANY_FC32_MONOID; -extern GrB_Monoid GxB_ANY_FC64_MONOID; -extern GrB_Monoid GxB_ANY_FP32_MONOID; -extern GrB_Monoid GxB_ANY_FP64_MONOID; -extern GrB_Monoid GxB_ANY_INT8_MONOID; -extern GrB_Monoid GxB_ANY_INT16_MONOID; -extern GrB_Monoid GxB_ANY_INT32_MONOID; -extern GrB_Monoid GxB_ANY_INT64_MONOID; -extern GrB_Monoid GxB_ANY_UINT8_MONOID; -extern GrB_Monoid GxB_ANY_UINT16_MONOID; -extern GrB_Monoid GxB_ANY_UINT32_MONOID; -extern GrB_Monoid GxB_ANY_UINT64_MONOID; -extern GrB_Monoid GxB_BAND_UINT8_MONOID; -extern GrB_Monoid GxB_BAND_UINT16_MONOID; -extern GrB_Monoid GxB_BAND_UINT32_MONOID; -extern GrB_Monoid GxB_BAND_UINT64_MONOID; -extern GrB_Monoid GxB_BOR_UINT8_MONOID; -extern GrB_Monoid GxB_BOR_UINT16_MONOID; -extern GrB_Monoid GxB_BOR_UINT32_MONOID; -extern GrB_Monoid GxB_BOR_UINT64_MONOID; -extern GrB_Monoid GxB_BXNOR_UINT8_MONOID; -extern GrB_Monoid GxB_BXNOR_UINT16_MONOID; -extern GrB_Monoid GxB_BXNOR_UINT32_MONOID; -extern GrB_Monoid GxB_BXNOR_UINT64_MONOID; -extern GrB_Monoid GxB_BXOR_UINT8_MONOID; -extern GrB_Monoid GxB_BXOR_UINT16_MONOID; -extern GrB_Monoid GxB_BXOR_UINT32_MONOID; -extern GrB_Monoid GxB_BXOR_UINT64_MONOID; -extern GrB_Monoid GxB_EQ_BOOL_MONOID; -extern GrB_Monoid GxB_PLUS_FC32_MONOID; -extern GrB_Monoid GxB_PLUS_FC64_MONOID; -extern GrB_Monoid GxB_TIMES_FC32_MONOID; -extern GrB_Monoid GxB_TIMES_FC64_MONOID; -extern GrB_Semiring GxB_ANY_DIV_FC32; -extern GrB_Semiring GxB_ANY_DIV_FC64; -extern GrB_Semiring GxB_ANY_DIV_FP32; -extern GrB_Semiring GxB_ANY_DIV_FP64; -extern GrB_Semiring GxB_ANY_DIV_INT8; -extern GrB_Semiring GxB_ANY_DIV_INT16; -extern GrB_Semiring GxB_ANY_DIV_INT32; -extern GrB_Semiring GxB_ANY_DIV_INT64; -extern GrB_Semiring GxB_ANY_DIV_UINT8; -extern GrB_Semiring GxB_ANY_DIV_UINT16; -extern GrB_Semiring GxB_ANY_DIV_UINT32; -extern GrB_Semiring GxB_ANY_DIV_UINT64; -extern GrB_Semiring GxB_ANY_EQ_BOOL; -extern GrB_Semiring GxB_ANY_EQ_FP32; -extern GrB_Semiring GxB_ANY_EQ_FP64; -extern GrB_Semiring GxB_ANY_EQ_INT8; -extern GrB_Semiring GxB_ANY_EQ_INT16; -extern GrB_Semiring GxB_ANY_EQ_INT32; -extern GrB_Semiring GxB_ANY_EQ_INT64; -extern GrB_Semiring GxB_ANY_EQ_UINT8; -extern GrB_Semiring GxB_ANY_EQ_UINT16; -extern GrB_Semiring GxB_ANY_EQ_UINT32; -extern GrB_Semiring GxB_ANY_EQ_UINT64; -extern GrB_Semiring GxB_ANY_FIRSTI1_INT32; -extern GrB_Semiring GxB_ANY_FIRSTI1_INT64; -extern GrB_Semiring GxB_ANY_FIRSTI_INT32; -extern GrB_Semiring GxB_ANY_FIRSTI_INT64; -extern GrB_Semiring GxB_ANY_FIRSTJ1_INT32; -extern GrB_Semiring GxB_ANY_FIRSTJ1_INT64; -extern GrB_Semiring GxB_ANY_FIRSTJ_INT32; -extern GrB_Semiring GxB_ANY_FIRSTJ_INT64; -extern GrB_Semiring GxB_ANY_FIRST_BOOL; -extern GrB_Semiring GxB_ANY_FIRST_FC32; -extern GrB_Semiring GxB_ANY_FIRST_FC64; -extern GrB_Semiring GxB_ANY_FIRST_FP32; -extern GrB_Semiring GxB_ANY_FIRST_FP64; -extern GrB_Semiring GxB_ANY_FIRST_INT8; -extern GrB_Semiring GxB_ANY_FIRST_INT16; -extern GrB_Semiring GxB_ANY_FIRST_INT32; -extern GrB_Semiring GxB_ANY_FIRST_INT64; -extern GrB_Semiring GxB_ANY_FIRST_UINT8; -extern GrB_Semiring GxB_ANY_FIRST_UINT16; -extern GrB_Semiring GxB_ANY_FIRST_UINT32; -extern GrB_Semiring GxB_ANY_FIRST_UINT64; -extern GrB_Semiring GxB_ANY_GE_BOOL; -extern GrB_Semiring GxB_ANY_GE_FP32; -extern GrB_Semiring GxB_ANY_GE_FP64; -extern GrB_Semiring GxB_ANY_GE_INT8; -extern GrB_Semiring GxB_ANY_GE_INT16; -extern GrB_Semiring GxB_ANY_GE_INT32; -extern GrB_Semiring GxB_ANY_GE_INT64; -extern GrB_Semiring GxB_ANY_GE_UINT8; -extern GrB_Semiring GxB_ANY_GE_UINT16; -extern GrB_Semiring GxB_ANY_GE_UINT32; -extern GrB_Semiring GxB_ANY_GE_UINT64; -extern GrB_Semiring GxB_ANY_GT_BOOL; -extern GrB_Semiring GxB_ANY_GT_FP32; -extern GrB_Semiring GxB_ANY_GT_FP64; -extern GrB_Semiring GxB_ANY_GT_INT8; -extern GrB_Semiring GxB_ANY_GT_INT16; -extern GrB_Semiring GxB_ANY_GT_INT32; -extern GrB_Semiring GxB_ANY_GT_INT64; -extern GrB_Semiring GxB_ANY_GT_UINT8; -extern GrB_Semiring GxB_ANY_GT_UINT16; -extern GrB_Semiring GxB_ANY_GT_UINT32; -extern GrB_Semiring GxB_ANY_GT_UINT64; -extern GrB_Semiring GxB_ANY_ISEQ_FP32; -extern GrB_Semiring GxB_ANY_ISEQ_FP64; -extern GrB_Semiring GxB_ANY_ISEQ_INT8; -extern GrB_Semiring GxB_ANY_ISEQ_INT16; -extern GrB_Semiring GxB_ANY_ISEQ_INT32; -extern GrB_Semiring GxB_ANY_ISEQ_INT64; -extern GrB_Semiring GxB_ANY_ISEQ_UINT8; -extern GrB_Semiring GxB_ANY_ISEQ_UINT16; -extern GrB_Semiring GxB_ANY_ISEQ_UINT32; -extern GrB_Semiring GxB_ANY_ISEQ_UINT64; -extern GrB_Semiring GxB_ANY_ISGE_FP32; -extern GrB_Semiring GxB_ANY_ISGE_FP64; -extern GrB_Semiring GxB_ANY_ISGE_INT8; -extern GrB_Semiring GxB_ANY_ISGE_INT16; -extern GrB_Semiring GxB_ANY_ISGE_INT32; -extern GrB_Semiring GxB_ANY_ISGE_INT64; -extern GrB_Semiring GxB_ANY_ISGE_UINT8; -extern GrB_Semiring GxB_ANY_ISGE_UINT16; -extern GrB_Semiring GxB_ANY_ISGE_UINT32; -extern GrB_Semiring GxB_ANY_ISGE_UINT64; -extern GrB_Semiring GxB_ANY_ISGT_FP32; -extern GrB_Semiring GxB_ANY_ISGT_FP64; -extern GrB_Semiring GxB_ANY_ISGT_INT8; -extern GrB_Semiring GxB_ANY_ISGT_INT16; -extern GrB_Semiring GxB_ANY_ISGT_INT32; -extern GrB_Semiring GxB_ANY_ISGT_INT64; -extern GrB_Semiring GxB_ANY_ISGT_UINT8; -extern GrB_Semiring GxB_ANY_ISGT_UINT16; -extern GrB_Semiring GxB_ANY_ISGT_UINT32; -extern GrB_Semiring GxB_ANY_ISGT_UINT64; -extern GrB_Semiring GxB_ANY_ISLE_FP32; -extern GrB_Semiring GxB_ANY_ISLE_FP64; -extern GrB_Semiring GxB_ANY_ISLE_INT8; -extern GrB_Semiring GxB_ANY_ISLE_INT16; -extern GrB_Semiring GxB_ANY_ISLE_INT32; -extern GrB_Semiring GxB_ANY_ISLE_INT64; -extern GrB_Semiring GxB_ANY_ISLE_UINT8; -extern GrB_Semiring GxB_ANY_ISLE_UINT16; -extern GrB_Semiring GxB_ANY_ISLE_UINT32; -extern GrB_Semiring GxB_ANY_ISLE_UINT64; -extern GrB_Semiring GxB_ANY_ISLT_FP32; -extern GrB_Semiring GxB_ANY_ISLT_FP64; -extern GrB_Semiring GxB_ANY_ISLT_INT8; -extern GrB_Semiring GxB_ANY_ISLT_INT16; -extern GrB_Semiring GxB_ANY_ISLT_INT32; -extern GrB_Semiring GxB_ANY_ISLT_INT64; -extern GrB_Semiring GxB_ANY_ISLT_UINT8; -extern GrB_Semiring GxB_ANY_ISLT_UINT16; -extern GrB_Semiring GxB_ANY_ISLT_UINT32; -extern GrB_Semiring GxB_ANY_ISLT_UINT64; -extern GrB_Semiring GxB_ANY_ISNE_FP32; -extern GrB_Semiring GxB_ANY_ISNE_FP64; -extern GrB_Semiring GxB_ANY_ISNE_INT8; -extern GrB_Semiring GxB_ANY_ISNE_INT16; -extern GrB_Semiring GxB_ANY_ISNE_INT32; -extern GrB_Semiring GxB_ANY_ISNE_INT64; -extern GrB_Semiring GxB_ANY_ISNE_UINT8; -extern GrB_Semiring GxB_ANY_ISNE_UINT16; -extern GrB_Semiring GxB_ANY_ISNE_UINT32; -extern GrB_Semiring GxB_ANY_ISNE_UINT64; -extern GrB_Semiring GxB_ANY_LAND_BOOL; -extern GrB_Semiring GxB_ANY_LAND_FP32; -extern GrB_Semiring GxB_ANY_LAND_FP64; -extern GrB_Semiring GxB_ANY_LAND_INT8; -extern GrB_Semiring GxB_ANY_LAND_INT16; -extern GrB_Semiring GxB_ANY_LAND_INT32; -extern GrB_Semiring GxB_ANY_LAND_INT64; -extern GrB_Semiring GxB_ANY_LAND_UINT8; -extern GrB_Semiring GxB_ANY_LAND_UINT16; -extern GrB_Semiring GxB_ANY_LAND_UINT32; -extern GrB_Semiring GxB_ANY_LAND_UINT64; -extern GrB_Semiring GxB_ANY_LE_BOOL; -extern GrB_Semiring GxB_ANY_LE_FP32; -extern GrB_Semiring GxB_ANY_LE_FP64; -extern GrB_Semiring GxB_ANY_LE_INT8; -extern GrB_Semiring GxB_ANY_LE_INT16; -extern GrB_Semiring GxB_ANY_LE_INT32; -extern GrB_Semiring GxB_ANY_LE_INT64; -extern GrB_Semiring GxB_ANY_LE_UINT8; -extern GrB_Semiring GxB_ANY_LE_UINT16; -extern GrB_Semiring GxB_ANY_LE_UINT32; -extern GrB_Semiring GxB_ANY_LE_UINT64; -extern GrB_Semiring GxB_ANY_LOR_BOOL; -extern GrB_Semiring GxB_ANY_LOR_FP32; -extern GrB_Semiring GxB_ANY_LOR_FP64; -extern GrB_Semiring GxB_ANY_LOR_INT8; -extern GrB_Semiring GxB_ANY_LOR_INT16; -extern GrB_Semiring GxB_ANY_LOR_INT32; -extern GrB_Semiring GxB_ANY_LOR_INT64; -extern GrB_Semiring GxB_ANY_LOR_UINT8; -extern GrB_Semiring GxB_ANY_LOR_UINT16; -extern GrB_Semiring GxB_ANY_LOR_UINT32; -extern GrB_Semiring GxB_ANY_LOR_UINT64; -extern GrB_Semiring GxB_ANY_LT_BOOL; -extern GrB_Semiring GxB_ANY_LT_FP32; -extern GrB_Semiring GxB_ANY_LT_FP64; -extern GrB_Semiring GxB_ANY_LT_INT8; -extern GrB_Semiring GxB_ANY_LT_INT16; -extern GrB_Semiring GxB_ANY_LT_INT32; -extern GrB_Semiring GxB_ANY_LT_INT64; -extern GrB_Semiring GxB_ANY_LT_UINT8; -extern GrB_Semiring GxB_ANY_LT_UINT16; -extern GrB_Semiring GxB_ANY_LT_UINT32; -extern GrB_Semiring GxB_ANY_LT_UINT64; -extern GrB_Semiring GxB_ANY_LXOR_BOOL; -extern GrB_Semiring GxB_ANY_LXOR_FP32; -extern GrB_Semiring GxB_ANY_LXOR_FP64; -extern GrB_Semiring GxB_ANY_LXOR_INT8; -extern GrB_Semiring GxB_ANY_LXOR_INT16; -extern GrB_Semiring GxB_ANY_LXOR_INT32; -extern GrB_Semiring GxB_ANY_LXOR_INT64; -extern GrB_Semiring GxB_ANY_LXOR_UINT8; -extern GrB_Semiring GxB_ANY_LXOR_UINT16; -extern GrB_Semiring GxB_ANY_LXOR_UINT32; -extern GrB_Semiring GxB_ANY_LXOR_UINT64; -extern GrB_Semiring GxB_ANY_MAX_FP32; -extern GrB_Semiring GxB_ANY_MAX_FP64; -extern GrB_Semiring GxB_ANY_MAX_INT8; -extern GrB_Semiring GxB_ANY_MAX_INT16; -extern GrB_Semiring GxB_ANY_MAX_INT32; -extern GrB_Semiring GxB_ANY_MAX_INT64; -extern GrB_Semiring GxB_ANY_MAX_UINT8; -extern GrB_Semiring GxB_ANY_MAX_UINT16; -extern GrB_Semiring GxB_ANY_MAX_UINT32; -extern GrB_Semiring GxB_ANY_MAX_UINT64; -extern GrB_Semiring GxB_ANY_MINUS_FC32; -extern GrB_Semiring GxB_ANY_MINUS_FC64; -extern GrB_Semiring GxB_ANY_MINUS_FP32; -extern GrB_Semiring GxB_ANY_MINUS_FP64; -extern GrB_Semiring GxB_ANY_MINUS_INT8; -extern GrB_Semiring GxB_ANY_MINUS_INT16; -extern GrB_Semiring GxB_ANY_MINUS_INT32; -extern GrB_Semiring GxB_ANY_MINUS_INT64; -extern GrB_Semiring GxB_ANY_MINUS_UINT8; -extern GrB_Semiring GxB_ANY_MINUS_UINT16; -extern GrB_Semiring GxB_ANY_MINUS_UINT32; -extern GrB_Semiring GxB_ANY_MINUS_UINT64; -extern GrB_Semiring GxB_ANY_MIN_FP32; -extern GrB_Semiring GxB_ANY_MIN_FP64; -extern GrB_Semiring GxB_ANY_MIN_INT8; -extern GrB_Semiring GxB_ANY_MIN_INT16; -extern GrB_Semiring GxB_ANY_MIN_INT32; -extern GrB_Semiring GxB_ANY_MIN_INT64; -extern GrB_Semiring GxB_ANY_MIN_UINT8; -extern GrB_Semiring GxB_ANY_MIN_UINT16; -extern GrB_Semiring GxB_ANY_MIN_UINT32; -extern GrB_Semiring GxB_ANY_MIN_UINT64; -extern GrB_Semiring GxB_ANY_NE_FP32; -extern GrB_Semiring GxB_ANY_NE_FP64; -extern GrB_Semiring GxB_ANY_NE_INT8; -extern GrB_Semiring GxB_ANY_NE_INT16; -extern GrB_Semiring GxB_ANY_NE_INT32; -extern GrB_Semiring GxB_ANY_NE_INT64; -extern GrB_Semiring GxB_ANY_NE_UINT8; -extern GrB_Semiring GxB_ANY_NE_UINT16; -extern GrB_Semiring GxB_ANY_NE_UINT32; -extern GrB_Semiring GxB_ANY_NE_UINT64; -extern GrB_Semiring GxB_ANY_PAIR_BOOL; -extern GrB_Semiring GxB_ANY_PAIR_FC32; -extern GrB_Semiring GxB_ANY_PAIR_FC64; -extern GrB_Semiring GxB_ANY_PAIR_FP32; -extern GrB_Semiring GxB_ANY_PAIR_FP64; -extern GrB_Semiring GxB_ANY_PAIR_INT8; -extern GrB_Semiring GxB_ANY_PAIR_INT16; -extern GrB_Semiring GxB_ANY_PAIR_INT32; -extern GrB_Semiring GxB_ANY_PAIR_INT64; -extern GrB_Semiring GxB_ANY_PAIR_UINT8; -extern GrB_Semiring GxB_ANY_PAIR_UINT16; -extern GrB_Semiring GxB_ANY_PAIR_UINT32; -extern GrB_Semiring GxB_ANY_PAIR_UINT64; -extern GrB_Semiring GxB_ANY_PLUS_FC32; -extern GrB_Semiring GxB_ANY_PLUS_FC64; -extern GrB_Semiring GxB_ANY_PLUS_FP32; -extern GrB_Semiring GxB_ANY_PLUS_FP64; -extern GrB_Semiring GxB_ANY_PLUS_INT8; -extern GrB_Semiring GxB_ANY_PLUS_INT16; -extern GrB_Semiring GxB_ANY_PLUS_INT32; -extern GrB_Semiring GxB_ANY_PLUS_INT64; -extern GrB_Semiring GxB_ANY_PLUS_UINT8; -extern GrB_Semiring GxB_ANY_PLUS_UINT16; -extern GrB_Semiring GxB_ANY_PLUS_UINT32; -extern GrB_Semiring GxB_ANY_PLUS_UINT64; -extern GrB_Semiring GxB_ANY_RDIV_FC32; -extern GrB_Semiring GxB_ANY_RDIV_FC64; -extern GrB_Semiring GxB_ANY_RDIV_FP32; -extern GrB_Semiring GxB_ANY_RDIV_FP64; -extern GrB_Semiring GxB_ANY_RDIV_INT8; -extern GrB_Semiring GxB_ANY_RDIV_INT16; -extern GrB_Semiring GxB_ANY_RDIV_INT32; -extern GrB_Semiring GxB_ANY_RDIV_INT64; -extern GrB_Semiring GxB_ANY_RDIV_UINT8; -extern GrB_Semiring GxB_ANY_RDIV_UINT16; -extern GrB_Semiring GxB_ANY_RDIV_UINT32; -extern GrB_Semiring GxB_ANY_RDIV_UINT64; -extern GrB_Semiring GxB_ANY_RMINUS_FC32; -extern GrB_Semiring GxB_ANY_RMINUS_FC64; -extern GrB_Semiring GxB_ANY_RMINUS_FP32; -extern GrB_Semiring GxB_ANY_RMINUS_FP64; -extern GrB_Semiring GxB_ANY_RMINUS_INT8; -extern GrB_Semiring GxB_ANY_RMINUS_INT16; -extern GrB_Semiring GxB_ANY_RMINUS_INT32; -extern GrB_Semiring GxB_ANY_RMINUS_INT64; -extern GrB_Semiring GxB_ANY_RMINUS_UINT8; -extern GrB_Semiring GxB_ANY_RMINUS_UINT16; -extern GrB_Semiring GxB_ANY_RMINUS_UINT32; -extern GrB_Semiring GxB_ANY_RMINUS_UINT64; -extern GrB_Semiring GxB_ANY_SECONDI1_INT32; -extern GrB_Semiring GxB_ANY_SECONDI1_INT64; -extern GrB_Semiring GxB_ANY_SECONDI_INT32; -extern GrB_Semiring GxB_ANY_SECONDI_INT64; -extern GrB_Semiring GxB_ANY_SECONDJ1_INT32; -extern GrB_Semiring GxB_ANY_SECONDJ1_INT64; -extern GrB_Semiring GxB_ANY_SECONDJ_INT32; -extern GrB_Semiring GxB_ANY_SECONDJ_INT64; -extern GrB_Semiring GxB_ANY_SECOND_BOOL; -extern GrB_Semiring GxB_ANY_SECOND_FC32; -extern GrB_Semiring GxB_ANY_SECOND_FC64; -extern GrB_Semiring GxB_ANY_SECOND_FP32; -extern GrB_Semiring GxB_ANY_SECOND_FP64; -extern GrB_Semiring GxB_ANY_SECOND_INT8; -extern GrB_Semiring GxB_ANY_SECOND_INT16; -extern GrB_Semiring GxB_ANY_SECOND_INT32; -extern GrB_Semiring GxB_ANY_SECOND_INT64; -extern GrB_Semiring GxB_ANY_SECOND_UINT8; -extern GrB_Semiring GxB_ANY_SECOND_UINT16; -extern GrB_Semiring GxB_ANY_SECOND_UINT32; -extern GrB_Semiring GxB_ANY_SECOND_UINT64; -extern GrB_Semiring GxB_ANY_TIMES_FC32; -extern GrB_Semiring GxB_ANY_TIMES_FC64; -extern GrB_Semiring GxB_ANY_TIMES_FP32; -extern GrB_Semiring GxB_ANY_TIMES_FP64; -extern GrB_Semiring GxB_ANY_TIMES_INT8; -extern GrB_Semiring GxB_ANY_TIMES_INT16; -extern GrB_Semiring GxB_ANY_TIMES_INT32; -extern GrB_Semiring GxB_ANY_TIMES_INT64; -extern GrB_Semiring GxB_ANY_TIMES_UINT8; -extern GrB_Semiring GxB_ANY_TIMES_UINT16; -extern GrB_Semiring GxB_ANY_TIMES_UINT32; -extern GrB_Semiring GxB_ANY_TIMES_UINT64; -extern GrB_Semiring GxB_BAND_BAND_UINT8; -extern GrB_Semiring GxB_BAND_BAND_UINT16; -extern GrB_Semiring GxB_BAND_BAND_UINT32; -extern GrB_Semiring GxB_BAND_BAND_UINT64; -extern GrB_Semiring GxB_BAND_BOR_UINT8; -extern GrB_Semiring GxB_BAND_BOR_UINT16; -extern GrB_Semiring GxB_BAND_BOR_UINT32; -extern GrB_Semiring GxB_BAND_BOR_UINT64; -extern GrB_Semiring GxB_BAND_BXNOR_UINT8; -extern GrB_Semiring GxB_BAND_BXNOR_UINT16; -extern GrB_Semiring GxB_BAND_BXNOR_UINT32; -extern GrB_Semiring GxB_BAND_BXNOR_UINT64; -extern GrB_Semiring GxB_BAND_BXOR_UINT8; -extern GrB_Semiring GxB_BAND_BXOR_UINT16; -extern GrB_Semiring GxB_BAND_BXOR_UINT32; -extern GrB_Semiring GxB_BAND_BXOR_UINT64; -extern GrB_Semiring GxB_BOR_BAND_UINT8; -extern GrB_Semiring GxB_BOR_BAND_UINT16; -extern GrB_Semiring GxB_BOR_BAND_UINT32; -extern GrB_Semiring GxB_BOR_BAND_UINT64; -extern GrB_Semiring GxB_BOR_BOR_UINT8; -extern GrB_Semiring GxB_BOR_BOR_UINT16; -extern GrB_Semiring GxB_BOR_BOR_UINT32; -extern GrB_Semiring GxB_BOR_BOR_UINT64; -extern GrB_Semiring GxB_BOR_BXNOR_UINT8; -extern GrB_Semiring GxB_BOR_BXNOR_UINT16; -extern GrB_Semiring GxB_BOR_BXNOR_UINT32; -extern GrB_Semiring GxB_BOR_BXNOR_UINT64; -extern GrB_Semiring GxB_BOR_BXOR_UINT8; -extern GrB_Semiring GxB_BOR_BXOR_UINT16; -extern GrB_Semiring GxB_BOR_BXOR_UINT32; -extern GrB_Semiring GxB_BOR_BXOR_UINT64; -extern GrB_Semiring GxB_BXNOR_BAND_UINT8; -extern GrB_Semiring GxB_BXNOR_BAND_UINT16; -extern GrB_Semiring GxB_BXNOR_BAND_UINT32; -extern GrB_Semiring GxB_BXNOR_BAND_UINT64; -extern GrB_Semiring GxB_BXNOR_BOR_UINT8; -extern GrB_Semiring GxB_BXNOR_BOR_UINT16; -extern GrB_Semiring GxB_BXNOR_BOR_UINT32; -extern GrB_Semiring GxB_BXNOR_BOR_UINT64; -extern GrB_Semiring GxB_BXNOR_BXNOR_UINT8; -extern GrB_Semiring GxB_BXNOR_BXNOR_UINT16; -extern GrB_Semiring GxB_BXNOR_BXNOR_UINT32; -extern GrB_Semiring GxB_BXNOR_BXNOR_UINT64; -extern GrB_Semiring GxB_BXNOR_BXOR_UINT8; -extern GrB_Semiring GxB_BXNOR_BXOR_UINT16; -extern GrB_Semiring GxB_BXNOR_BXOR_UINT32; -extern GrB_Semiring GxB_BXNOR_BXOR_UINT64; -extern GrB_Semiring GxB_BXOR_BAND_UINT8; -extern GrB_Semiring GxB_BXOR_BAND_UINT16; -extern GrB_Semiring GxB_BXOR_BAND_UINT32; -extern GrB_Semiring GxB_BXOR_BAND_UINT64; -extern GrB_Semiring GxB_BXOR_BOR_UINT8; -extern GrB_Semiring GxB_BXOR_BOR_UINT16; -extern GrB_Semiring GxB_BXOR_BOR_UINT32; -extern GrB_Semiring GxB_BXOR_BOR_UINT64; -extern GrB_Semiring GxB_BXOR_BXNOR_UINT8; -extern GrB_Semiring GxB_BXOR_BXNOR_UINT16; -extern GrB_Semiring GxB_BXOR_BXNOR_UINT32; -extern GrB_Semiring GxB_BXOR_BXNOR_UINT64; -extern GrB_Semiring GxB_BXOR_BXOR_UINT8; -extern GrB_Semiring GxB_BXOR_BXOR_UINT16; -extern GrB_Semiring GxB_BXOR_BXOR_UINT32; -extern GrB_Semiring GxB_BXOR_BXOR_UINT64; -extern GrB_Semiring GxB_EQ_EQ_BOOL; -extern GrB_Semiring GxB_EQ_EQ_FP32; -extern GrB_Semiring GxB_EQ_EQ_FP64; -extern GrB_Semiring GxB_EQ_EQ_INT8; -extern GrB_Semiring GxB_EQ_EQ_INT16; -extern GrB_Semiring GxB_EQ_EQ_INT32; -extern GrB_Semiring GxB_EQ_EQ_INT64; -extern GrB_Semiring GxB_EQ_EQ_UINT8; -extern GrB_Semiring GxB_EQ_EQ_UINT16; -extern GrB_Semiring GxB_EQ_EQ_UINT32; -extern GrB_Semiring GxB_EQ_EQ_UINT64; -extern GrB_Semiring GxB_EQ_FIRST_BOOL; -extern GrB_Semiring GxB_EQ_GE_BOOL; -extern GrB_Semiring GxB_EQ_GE_FP32; -extern GrB_Semiring GxB_EQ_GE_FP64; -extern GrB_Semiring GxB_EQ_GE_INT8; -extern GrB_Semiring GxB_EQ_GE_INT16; -extern GrB_Semiring GxB_EQ_GE_INT32; -extern GrB_Semiring GxB_EQ_GE_INT64; -extern GrB_Semiring GxB_EQ_GE_UINT8; -extern GrB_Semiring GxB_EQ_GE_UINT16; -extern GrB_Semiring GxB_EQ_GE_UINT32; -extern GrB_Semiring GxB_EQ_GE_UINT64; -extern GrB_Semiring GxB_EQ_GT_BOOL; -extern GrB_Semiring GxB_EQ_GT_FP32; -extern GrB_Semiring GxB_EQ_GT_FP64; -extern GrB_Semiring GxB_EQ_GT_INT8; -extern GrB_Semiring GxB_EQ_GT_INT16; -extern GrB_Semiring GxB_EQ_GT_INT32; -extern GrB_Semiring GxB_EQ_GT_INT64; -extern GrB_Semiring GxB_EQ_GT_UINT8; -extern GrB_Semiring GxB_EQ_GT_UINT16; -extern GrB_Semiring GxB_EQ_GT_UINT32; -extern GrB_Semiring GxB_EQ_GT_UINT64; -extern GrB_Semiring GxB_EQ_LAND_BOOL; -extern GrB_Semiring GxB_EQ_LE_BOOL; -extern GrB_Semiring GxB_EQ_LE_FP32; -extern GrB_Semiring GxB_EQ_LE_FP64; -extern GrB_Semiring GxB_EQ_LE_INT8; -extern GrB_Semiring GxB_EQ_LE_INT16; -extern GrB_Semiring GxB_EQ_LE_INT32; -extern GrB_Semiring GxB_EQ_LE_INT64; -extern GrB_Semiring GxB_EQ_LE_UINT8; -extern GrB_Semiring GxB_EQ_LE_UINT16; -extern GrB_Semiring GxB_EQ_LE_UINT32; -extern GrB_Semiring GxB_EQ_LE_UINT64; -extern GrB_Semiring GxB_EQ_LOR_BOOL; -extern GrB_Semiring GxB_EQ_LT_BOOL; -extern GrB_Semiring GxB_EQ_LT_FP32; -extern GrB_Semiring GxB_EQ_LT_FP64; -extern GrB_Semiring GxB_EQ_LT_INT8; -extern GrB_Semiring GxB_EQ_LT_INT16; -extern GrB_Semiring GxB_EQ_LT_INT32; -extern GrB_Semiring GxB_EQ_LT_INT64; -extern GrB_Semiring GxB_EQ_LT_UINT8; -extern GrB_Semiring GxB_EQ_LT_UINT16; -extern GrB_Semiring GxB_EQ_LT_UINT32; -extern GrB_Semiring GxB_EQ_LT_UINT64; -extern GrB_Semiring GxB_EQ_LXOR_BOOL; -extern GrB_Semiring GxB_EQ_NE_FP32; -extern GrB_Semiring GxB_EQ_NE_FP64; -extern GrB_Semiring GxB_EQ_NE_INT8; -extern GrB_Semiring GxB_EQ_NE_INT16; -extern GrB_Semiring GxB_EQ_NE_INT32; -extern GrB_Semiring GxB_EQ_NE_INT64; -extern GrB_Semiring GxB_EQ_NE_UINT8; -extern GrB_Semiring GxB_EQ_NE_UINT16; -extern GrB_Semiring GxB_EQ_NE_UINT32; -extern GrB_Semiring GxB_EQ_NE_UINT64; -extern GrB_Semiring GxB_EQ_PAIR_BOOL; -extern GrB_Semiring GxB_EQ_SECOND_BOOL; -extern GrB_Semiring GxB_LAND_EQ_BOOL; -extern GrB_Semiring GxB_LAND_EQ_FP32; -extern GrB_Semiring GxB_LAND_EQ_FP64; -extern GrB_Semiring GxB_LAND_EQ_INT8; -extern GrB_Semiring GxB_LAND_EQ_INT16; -extern GrB_Semiring GxB_LAND_EQ_INT32; -extern GrB_Semiring GxB_LAND_EQ_INT64; -extern GrB_Semiring GxB_LAND_EQ_UINT8; -extern GrB_Semiring GxB_LAND_EQ_UINT16; -extern GrB_Semiring GxB_LAND_EQ_UINT32; -extern GrB_Semiring GxB_LAND_EQ_UINT64; -extern GrB_Semiring GxB_LAND_FIRST_BOOL; -extern GrB_Semiring GxB_LAND_GE_BOOL; -extern GrB_Semiring GxB_LAND_GE_FP32; -extern GrB_Semiring GxB_LAND_GE_FP64; -extern GrB_Semiring GxB_LAND_GE_INT8; -extern GrB_Semiring GxB_LAND_GE_INT16; -extern GrB_Semiring GxB_LAND_GE_INT32; -extern GrB_Semiring GxB_LAND_GE_INT64; -extern GrB_Semiring GxB_LAND_GE_UINT8; -extern GrB_Semiring GxB_LAND_GE_UINT16; -extern GrB_Semiring GxB_LAND_GE_UINT32; -extern GrB_Semiring GxB_LAND_GE_UINT64; -extern GrB_Semiring GxB_LAND_GT_BOOL; -extern GrB_Semiring GxB_LAND_GT_FP32; -extern GrB_Semiring GxB_LAND_GT_FP64; -extern GrB_Semiring GxB_LAND_GT_INT8; -extern GrB_Semiring GxB_LAND_GT_INT16; -extern GrB_Semiring GxB_LAND_GT_INT32; -extern GrB_Semiring GxB_LAND_GT_INT64; -extern GrB_Semiring GxB_LAND_GT_UINT8; -extern GrB_Semiring GxB_LAND_GT_UINT16; -extern GrB_Semiring GxB_LAND_GT_UINT32; -extern GrB_Semiring GxB_LAND_GT_UINT64; -extern GrB_Semiring GxB_LAND_LAND_BOOL; -extern GrB_Semiring GxB_LAND_LE_BOOL; -extern GrB_Semiring GxB_LAND_LE_FP32; -extern GrB_Semiring GxB_LAND_LE_FP64; -extern GrB_Semiring GxB_LAND_LE_INT8; -extern GrB_Semiring GxB_LAND_LE_INT16; -extern GrB_Semiring GxB_LAND_LE_INT32; -extern GrB_Semiring GxB_LAND_LE_INT64; -extern GrB_Semiring GxB_LAND_LE_UINT8; -extern GrB_Semiring GxB_LAND_LE_UINT16; -extern GrB_Semiring GxB_LAND_LE_UINT32; -extern GrB_Semiring GxB_LAND_LE_UINT64; -extern GrB_Semiring GxB_LAND_LT_BOOL; -extern GrB_Semiring GxB_LAND_LT_FP32; -extern GrB_Semiring GxB_LAND_LT_FP64; -extern GrB_Semiring GxB_LAND_LT_INT8; -extern GrB_Semiring GxB_LAND_LT_INT16; -extern GrB_Semiring GxB_LAND_LT_INT32; -extern GrB_Semiring GxB_LAND_LT_INT64; -extern GrB_Semiring GxB_LAND_LT_UINT8; -extern GrB_Semiring GxB_LAND_LT_UINT16; -extern GrB_Semiring GxB_LAND_LT_UINT32; -extern GrB_Semiring GxB_LAND_LT_UINT64; -extern GrB_Semiring GxB_LAND_LXOR_BOOL; -extern GrB_Semiring GxB_LAND_NE_FP32; -extern GrB_Semiring GxB_LAND_NE_FP64; -extern GrB_Semiring GxB_LAND_NE_INT8; -extern GrB_Semiring GxB_LAND_NE_INT16; -extern GrB_Semiring GxB_LAND_NE_INT32; -extern GrB_Semiring GxB_LAND_NE_INT64; -extern GrB_Semiring GxB_LAND_NE_UINT8; -extern GrB_Semiring GxB_LAND_NE_UINT16; -extern GrB_Semiring GxB_LAND_NE_UINT32; -extern GrB_Semiring GxB_LAND_NE_UINT64; -extern GrB_Semiring GxB_LAND_PAIR_BOOL; -extern GrB_Semiring GxB_LAND_SECOND_BOOL; -extern GrB_Semiring GxB_LOR_EQ_BOOL; -extern GrB_Semiring GxB_LOR_EQ_FP32; -extern GrB_Semiring GxB_LOR_EQ_FP64; -extern GrB_Semiring GxB_LOR_EQ_INT8; -extern GrB_Semiring GxB_LOR_EQ_INT16; -extern GrB_Semiring GxB_LOR_EQ_INT32; -extern GrB_Semiring GxB_LOR_EQ_INT64; -extern GrB_Semiring GxB_LOR_EQ_UINT8; -extern GrB_Semiring GxB_LOR_EQ_UINT16; -extern GrB_Semiring GxB_LOR_EQ_UINT32; -extern GrB_Semiring GxB_LOR_EQ_UINT64; -extern GrB_Semiring GxB_LOR_FIRST_BOOL; -extern GrB_Semiring GxB_LOR_GE_BOOL; -extern GrB_Semiring GxB_LOR_GE_FP32; -extern GrB_Semiring GxB_LOR_GE_FP64; -extern GrB_Semiring GxB_LOR_GE_INT8; -extern GrB_Semiring GxB_LOR_GE_INT16; -extern GrB_Semiring GxB_LOR_GE_INT32; -extern GrB_Semiring GxB_LOR_GE_INT64; -extern GrB_Semiring GxB_LOR_GE_UINT8; -extern GrB_Semiring GxB_LOR_GE_UINT16; -extern GrB_Semiring GxB_LOR_GE_UINT32; -extern GrB_Semiring GxB_LOR_GE_UINT64; -extern GrB_Semiring GxB_LOR_GT_BOOL; -extern GrB_Semiring GxB_LOR_GT_FP32; -extern GrB_Semiring GxB_LOR_GT_FP64; -extern GrB_Semiring GxB_LOR_GT_INT8; -extern GrB_Semiring GxB_LOR_GT_INT16; -extern GrB_Semiring GxB_LOR_GT_INT32; -extern GrB_Semiring GxB_LOR_GT_INT64; -extern GrB_Semiring GxB_LOR_GT_UINT8; -extern GrB_Semiring GxB_LOR_GT_UINT16; -extern GrB_Semiring GxB_LOR_GT_UINT32; -extern GrB_Semiring GxB_LOR_GT_UINT64; -extern GrB_Semiring GxB_LOR_LE_BOOL; -extern GrB_Semiring GxB_LOR_LE_FP32; -extern GrB_Semiring GxB_LOR_LE_FP64; -extern GrB_Semiring GxB_LOR_LE_INT8; -extern GrB_Semiring GxB_LOR_LE_INT16; -extern GrB_Semiring GxB_LOR_LE_INT32; -extern GrB_Semiring GxB_LOR_LE_INT64; -extern GrB_Semiring GxB_LOR_LE_UINT8; -extern GrB_Semiring GxB_LOR_LE_UINT16; -extern GrB_Semiring GxB_LOR_LE_UINT32; -extern GrB_Semiring GxB_LOR_LE_UINT64; -extern GrB_Semiring GxB_LOR_LOR_BOOL; -extern GrB_Semiring GxB_LOR_LT_BOOL; -extern GrB_Semiring GxB_LOR_LT_FP32; -extern GrB_Semiring GxB_LOR_LT_FP64; -extern GrB_Semiring GxB_LOR_LT_INT8; -extern GrB_Semiring GxB_LOR_LT_INT16; -extern GrB_Semiring GxB_LOR_LT_INT32; -extern GrB_Semiring GxB_LOR_LT_INT64; -extern GrB_Semiring GxB_LOR_LT_UINT8; -extern GrB_Semiring GxB_LOR_LT_UINT16; -extern GrB_Semiring GxB_LOR_LT_UINT32; -extern GrB_Semiring GxB_LOR_LT_UINT64; -extern GrB_Semiring GxB_LOR_LXOR_BOOL; -extern GrB_Semiring GxB_LOR_NE_FP32; -extern GrB_Semiring GxB_LOR_NE_FP64; -extern GrB_Semiring GxB_LOR_NE_INT8; -extern GrB_Semiring GxB_LOR_NE_INT16; -extern GrB_Semiring GxB_LOR_NE_INT32; -extern GrB_Semiring GxB_LOR_NE_INT64; -extern GrB_Semiring GxB_LOR_NE_UINT8; -extern GrB_Semiring GxB_LOR_NE_UINT16; -extern GrB_Semiring GxB_LOR_NE_UINT32; -extern GrB_Semiring GxB_LOR_NE_UINT64; -extern GrB_Semiring GxB_LOR_PAIR_BOOL; -extern GrB_Semiring GxB_LOR_SECOND_BOOL; -extern GrB_Semiring GxB_LXOR_EQ_BOOL; -extern GrB_Semiring GxB_LXOR_EQ_FP32; -extern GrB_Semiring GxB_LXOR_EQ_FP64; -extern GrB_Semiring GxB_LXOR_EQ_INT8; -extern GrB_Semiring GxB_LXOR_EQ_INT16; -extern GrB_Semiring GxB_LXOR_EQ_INT32; -extern GrB_Semiring GxB_LXOR_EQ_INT64; -extern GrB_Semiring GxB_LXOR_EQ_UINT8; -extern GrB_Semiring GxB_LXOR_EQ_UINT16; -extern GrB_Semiring GxB_LXOR_EQ_UINT32; -extern GrB_Semiring GxB_LXOR_EQ_UINT64; -extern GrB_Semiring GxB_LXOR_FIRST_BOOL; -extern GrB_Semiring GxB_LXOR_GE_BOOL; -extern GrB_Semiring GxB_LXOR_GE_FP32; -extern GrB_Semiring GxB_LXOR_GE_FP64; -extern GrB_Semiring GxB_LXOR_GE_INT8; -extern GrB_Semiring GxB_LXOR_GE_INT16; -extern GrB_Semiring GxB_LXOR_GE_INT32; -extern GrB_Semiring GxB_LXOR_GE_INT64; -extern GrB_Semiring GxB_LXOR_GE_UINT8; -extern GrB_Semiring GxB_LXOR_GE_UINT16; -extern GrB_Semiring GxB_LXOR_GE_UINT32; -extern GrB_Semiring GxB_LXOR_GE_UINT64; -extern GrB_Semiring GxB_LXOR_GT_BOOL; -extern GrB_Semiring GxB_LXOR_GT_FP32; -extern GrB_Semiring GxB_LXOR_GT_FP64; -extern GrB_Semiring GxB_LXOR_GT_INT8; -extern GrB_Semiring GxB_LXOR_GT_INT16; -extern GrB_Semiring GxB_LXOR_GT_INT32; -extern GrB_Semiring GxB_LXOR_GT_INT64; -extern GrB_Semiring GxB_LXOR_GT_UINT8; -extern GrB_Semiring GxB_LXOR_GT_UINT16; -extern GrB_Semiring GxB_LXOR_GT_UINT32; -extern GrB_Semiring GxB_LXOR_GT_UINT64; -extern GrB_Semiring GxB_LXOR_LE_BOOL; -extern GrB_Semiring GxB_LXOR_LE_FP32; -extern GrB_Semiring GxB_LXOR_LE_FP64; -extern GrB_Semiring GxB_LXOR_LE_INT8; -extern GrB_Semiring GxB_LXOR_LE_INT16; -extern GrB_Semiring GxB_LXOR_LE_INT32; -extern GrB_Semiring GxB_LXOR_LE_INT64; -extern GrB_Semiring GxB_LXOR_LE_UINT8; -extern GrB_Semiring GxB_LXOR_LE_UINT16; -extern GrB_Semiring GxB_LXOR_LE_UINT32; -extern GrB_Semiring GxB_LXOR_LE_UINT64; -extern GrB_Semiring GxB_LXOR_LOR_BOOL; -extern GrB_Semiring GxB_LXOR_LT_BOOL; -extern GrB_Semiring GxB_LXOR_LT_FP32; -extern GrB_Semiring GxB_LXOR_LT_FP64; -extern GrB_Semiring GxB_LXOR_LT_INT8; -extern GrB_Semiring GxB_LXOR_LT_INT16; -extern GrB_Semiring GxB_LXOR_LT_INT32; -extern GrB_Semiring GxB_LXOR_LT_INT64; -extern GrB_Semiring GxB_LXOR_LT_UINT8; -extern GrB_Semiring GxB_LXOR_LT_UINT16; -extern GrB_Semiring GxB_LXOR_LT_UINT32; -extern GrB_Semiring GxB_LXOR_LT_UINT64; -extern GrB_Semiring GxB_LXOR_LXOR_BOOL; -extern GrB_Semiring GxB_LXOR_NE_FP32; -extern GrB_Semiring GxB_LXOR_NE_FP64; -extern GrB_Semiring GxB_LXOR_NE_INT8; -extern GrB_Semiring GxB_LXOR_NE_INT16; -extern GrB_Semiring GxB_LXOR_NE_INT32; -extern GrB_Semiring GxB_LXOR_NE_INT64; -extern GrB_Semiring GxB_LXOR_NE_UINT8; -extern GrB_Semiring GxB_LXOR_NE_UINT16; -extern GrB_Semiring GxB_LXOR_NE_UINT32; -extern GrB_Semiring GxB_LXOR_NE_UINT64; -extern GrB_Semiring GxB_LXOR_PAIR_BOOL; -extern GrB_Semiring GxB_LXOR_SECOND_BOOL; -extern GrB_Semiring GxB_MAX_DIV_FP32; -extern GrB_Semiring GxB_MAX_DIV_FP64; -extern GrB_Semiring GxB_MAX_DIV_INT8; -extern GrB_Semiring GxB_MAX_DIV_INT16; -extern GrB_Semiring GxB_MAX_DIV_INT32; -extern GrB_Semiring GxB_MAX_DIV_INT64; -extern GrB_Semiring GxB_MAX_DIV_UINT8; -extern GrB_Semiring GxB_MAX_DIV_UINT16; -extern GrB_Semiring GxB_MAX_DIV_UINT32; -extern GrB_Semiring GxB_MAX_DIV_UINT64; -extern GrB_Semiring GxB_MAX_FIRSTI1_INT32; -extern GrB_Semiring GxB_MAX_FIRSTI1_INT64; -extern GrB_Semiring GxB_MAX_FIRSTI_INT32; -extern GrB_Semiring GxB_MAX_FIRSTI_INT64; -extern GrB_Semiring GxB_MAX_FIRSTJ1_INT32; -extern GrB_Semiring GxB_MAX_FIRSTJ1_INT64; -extern GrB_Semiring GxB_MAX_FIRSTJ_INT32; -extern GrB_Semiring GxB_MAX_FIRSTJ_INT64; -extern GrB_Semiring GxB_MAX_ISEQ_FP32; -extern GrB_Semiring GxB_MAX_ISEQ_FP64; -extern GrB_Semiring GxB_MAX_ISEQ_INT8; -extern GrB_Semiring GxB_MAX_ISEQ_INT16; -extern GrB_Semiring GxB_MAX_ISEQ_INT32; -extern GrB_Semiring GxB_MAX_ISEQ_INT64; -extern GrB_Semiring GxB_MAX_ISEQ_UINT8; -extern GrB_Semiring GxB_MAX_ISEQ_UINT16; -extern GrB_Semiring GxB_MAX_ISEQ_UINT32; -extern GrB_Semiring GxB_MAX_ISEQ_UINT64; -extern GrB_Semiring GxB_MAX_ISGE_FP32; -extern GrB_Semiring GxB_MAX_ISGE_FP64; -extern GrB_Semiring GxB_MAX_ISGE_INT8; -extern GrB_Semiring GxB_MAX_ISGE_INT16; -extern GrB_Semiring GxB_MAX_ISGE_INT32; -extern GrB_Semiring GxB_MAX_ISGE_INT64; -extern GrB_Semiring GxB_MAX_ISGE_UINT8; -extern GrB_Semiring GxB_MAX_ISGE_UINT16; -extern GrB_Semiring GxB_MAX_ISGE_UINT32; -extern GrB_Semiring GxB_MAX_ISGE_UINT64; -extern GrB_Semiring GxB_MAX_ISGT_FP32; -extern GrB_Semiring GxB_MAX_ISGT_FP64; -extern GrB_Semiring GxB_MAX_ISGT_INT8; -extern GrB_Semiring GxB_MAX_ISGT_INT16; -extern GrB_Semiring GxB_MAX_ISGT_INT32; -extern GrB_Semiring GxB_MAX_ISGT_INT64; -extern GrB_Semiring GxB_MAX_ISGT_UINT8; -extern GrB_Semiring GxB_MAX_ISGT_UINT16; -extern GrB_Semiring GxB_MAX_ISGT_UINT32; -extern GrB_Semiring GxB_MAX_ISGT_UINT64; -extern GrB_Semiring GxB_MAX_ISLE_FP32; -extern GrB_Semiring GxB_MAX_ISLE_FP64; -extern GrB_Semiring GxB_MAX_ISLE_INT8; -extern GrB_Semiring GxB_MAX_ISLE_INT16; -extern GrB_Semiring GxB_MAX_ISLE_INT32; -extern GrB_Semiring GxB_MAX_ISLE_INT64; -extern GrB_Semiring GxB_MAX_ISLE_UINT8; -extern GrB_Semiring GxB_MAX_ISLE_UINT16; -extern GrB_Semiring GxB_MAX_ISLE_UINT32; -extern GrB_Semiring GxB_MAX_ISLE_UINT64; -extern GrB_Semiring GxB_MAX_ISLT_FP32; -extern GrB_Semiring GxB_MAX_ISLT_FP64; -extern GrB_Semiring GxB_MAX_ISLT_INT8; -extern GrB_Semiring GxB_MAX_ISLT_INT16; -extern GrB_Semiring GxB_MAX_ISLT_INT32; -extern GrB_Semiring GxB_MAX_ISLT_INT64; -extern GrB_Semiring GxB_MAX_ISLT_UINT8; -extern GrB_Semiring GxB_MAX_ISLT_UINT16; -extern GrB_Semiring GxB_MAX_ISLT_UINT32; -extern GrB_Semiring GxB_MAX_ISLT_UINT64; -extern GrB_Semiring GxB_MAX_ISNE_FP32; -extern GrB_Semiring GxB_MAX_ISNE_FP64; -extern GrB_Semiring GxB_MAX_ISNE_INT8; -extern GrB_Semiring GxB_MAX_ISNE_INT16; -extern GrB_Semiring GxB_MAX_ISNE_INT32; -extern GrB_Semiring GxB_MAX_ISNE_INT64; -extern GrB_Semiring GxB_MAX_ISNE_UINT8; -extern GrB_Semiring GxB_MAX_ISNE_UINT16; -extern GrB_Semiring GxB_MAX_ISNE_UINT32; -extern GrB_Semiring GxB_MAX_ISNE_UINT64; -extern GrB_Semiring GxB_MAX_LAND_FP32; -extern GrB_Semiring GxB_MAX_LAND_FP64; -extern GrB_Semiring GxB_MAX_LAND_INT8; -extern GrB_Semiring GxB_MAX_LAND_INT16; -extern GrB_Semiring GxB_MAX_LAND_INT32; -extern GrB_Semiring GxB_MAX_LAND_INT64; -extern GrB_Semiring GxB_MAX_LAND_UINT8; -extern GrB_Semiring GxB_MAX_LAND_UINT16; -extern GrB_Semiring GxB_MAX_LAND_UINT32; -extern GrB_Semiring GxB_MAX_LAND_UINT64; -extern GrB_Semiring GxB_MAX_LOR_FP32; -extern GrB_Semiring GxB_MAX_LOR_FP64; -extern GrB_Semiring GxB_MAX_LOR_INT8; -extern GrB_Semiring GxB_MAX_LOR_INT16; -extern GrB_Semiring GxB_MAX_LOR_INT32; -extern GrB_Semiring GxB_MAX_LOR_INT64; -extern GrB_Semiring GxB_MAX_LOR_UINT8; -extern GrB_Semiring GxB_MAX_LOR_UINT16; -extern GrB_Semiring GxB_MAX_LOR_UINT32; -extern GrB_Semiring GxB_MAX_LOR_UINT64; -extern GrB_Semiring GxB_MAX_LXOR_FP32; -extern GrB_Semiring GxB_MAX_LXOR_FP64; -extern GrB_Semiring GxB_MAX_LXOR_INT8; -extern GrB_Semiring GxB_MAX_LXOR_INT16; -extern GrB_Semiring GxB_MAX_LXOR_INT32; -extern GrB_Semiring GxB_MAX_LXOR_INT64; -extern GrB_Semiring GxB_MAX_LXOR_UINT8; -extern GrB_Semiring GxB_MAX_LXOR_UINT16; -extern GrB_Semiring GxB_MAX_LXOR_UINT32; -extern GrB_Semiring GxB_MAX_LXOR_UINT64; -extern GrB_Semiring GxB_MAX_MAX_FP32; -extern GrB_Semiring GxB_MAX_MAX_FP64; -extern GrB_Semiring GxB_MAX_MAX_INT8; -extern GrB_Semiring GxB_MAX_MAX_INT16; -extern GrB_Semiring GxB_MAX_MAX_INT32; -extern GrB_Semiring GxB_MAX_MAX_INT64; -extern GrB_Semiring GxB_MAX_MAX_UINT8; -extern GrB_Semiring GxB_MAX_MAX_UINT16; -extern GrB_Semiring GxB_MAX_MAX_UINT32; -extern GrB_Semiring GxB_MAX_MAX_UINT64; -extern GrB_Semiring GxB_MAX_MINUS_FP32; -extern GrB_Semiring GxB_MAX_MINUS_FP64; -extern GrB_Semiring GxB_MAX_MINUS_INT8; -extern GrB_Semiring GxB_MAX_MINUS_INT16; -extern GrB_Semiring GxB_MAX_MINUS_INT32; -extern GrB_Semiring GxB_MAX_MINUS_INT64; -extern GrB_Semiring GxB_MAX_MINUS_UINT8; -extern GrB_Semiring GxB_MAX_MINUS_UINT16; -extern GrB_Semiring GxB_MAX_MINUS_UINT32; -extern GrB_Semiring GxB_MAX_MINUS_UINT64; -extern GrB_Semiring GxB_MAX_PAIR_FP32; -extern GrB_Semiring GxB_MAX_PAIR_FP64; -extern GrB_Semiring GxB_MAX_PAIR_INT8; -extern GrB_Semiring GxB_MAX_PAIR_INT16; -extern GrB_Semiring GxB_MAX_PAIR_INT32; -extern GrB_Semiring GxB_MAX_PAIR_INT64; -extern GrB_Semiring GxB_MAX_PAIR_UINT8; -extern GrB_Semiring GxB_MAX_PAIR_UINT16; -extern GrB_Semiring GxB_MAX_PAIR_UINT32; -extern GrB_Semiring GxB_MAX_PAIR_UINT64; -extern GrB_Semiring GxB_MAX_RDIV_FP32; -extern GrB_Semiring GxB_MAX_RDIV_FP64; -extern GrB_Semiring GxB_MAX_RDIV_INT8; -extern GrB_Semiring GxB_MAX_RDIV_INT16; -extern GrB_Semiring GxB_MAX_RDIV_INT32; -extern GrB_Semiring GxB_MAX_RDIV_INT64; -extern GrB_Semiring GxB_MAX_RDIV_UINT8; -extern GrB_Semiring GxB_MAX_RDIV_UINT16; -extern GrB_Semiring GxB_MAX_RDIV_UINT32; -extern GrB_Semiring GxB_MAX_RDIV_UINT64; -extern GrB_Semiring GxB_MAX_RMINUS_FP32; -extern GrB_Semiring GxB_MAX_RMINUS_FP64; -extern GrB_Semiring GxB_MAX_RMINUS_INT8; -extern GrB_Semiring GxB_MAX_RMINUS_INT16; -extern GrB_Semiring GxB_MAX_RMINUS_INT32; -extern GrB_Semiring GxB_MAX_RMINUS_INT64; -extern GrB_Semiring GxB_MAX_RMINUS_UINT8; -extern GrB_Semiring GxB_MAX_RMINUS_UINT16; -extern GrB_Semiring GxB_MAX_RMINUS_UINT32; -extern GrB_Semiring GxB_MAX_RMINUS_UINT64; -extern GrB_Semiring GxB_MAX_SECONDI1_INT32; -extern GrB_Semiring GxB_MAX_SECONDI1_INT64; -extern GrB_Semiring GxB_MAX_SECONDI_INT32; -extern GrB_Semiring GxB_MAX_SECONDI_INT64; -extern GrB_Semiring GxB_MAX_SECONDJ1_INT32; -extern GrB_Semiring GxB_MAX_SECONDJ1_INT64; -extern GrB_Semiring GxB_MAX_SECONDJ_INT32; -extern GrB_Semiring GxB_MAX_SECONDJ_INT64; -extern GrB_Semiring GxB_MIN_DIV_FP32; -extern GrB_Semiring GxB_MIN_DIV_FP64; -extern GrB_Semiring GxB_MIN_DIV_INT8; -extern GrB_Semiring GxB_MIN_DIV_INT16; -extern GrB_Semiring GxB_MIN_DIV_INT32; -extern GrB_Semiring GxB_MIN_DIV_INT64; -extern GrB_Semiring GxB_MIN_DIV_UINT8; -extern GrB_Semiring GxB_MIN_DIV_UINT16; -extern GrB_Semiring GxB_MIN_DIV_UINT32; -extern GrB_Semiring GxB_MIN_DIV_UINT64; -extern GrB_Semiring GxB_MIN_FIRSTI1_INT32; -extern GrB_Semiring GxB_MIN_FIRSTI1_INT64; -extern GrB_Semiring GxB_MIN_FIRSTI_INT32; -extern GrB_Semiring GxB_MIN_FIRSTI_INT64; -extern GrB_Semiring GxB_MIN_FIRSTJ1_INT32; -extern GrB_Semiring GxB_MIN_FIRSTJ1_INT64; -extern GrB_Semiring GxB_MIN_FIRSTJ_INT32; -extern GrB_Semiring GxB_MIN_FIRSTJ_INT64; -extern GrB_Semiring GxB_MIN_ISEQ_FP32; -extern GrB_Semiring GxB_MIN_ISEQ_FP64; -extern GrB_Semiring GxB_MIN_ISEQ_INT8; -extern GrB_Semiring GxB_MIN_ISEQ_INT16; -extern GrB_Semiring GxB_MIN_ISEQ_INT32; -extern GrB_Semiring GxB_MIN_ISEQ_INT64; -extern GrB_Semiring GxB_MIN_ISEQ_UINT8; -extern GrB_Semiring GxB_MIN_ISEQ_UINT16; -extern GrB_Semiring GxB_MIN_ISEQ_UINT32; -extern GrB_Semiring GxB_MIN_ISEQ_UINT64; -extern GrB_Semiring GxB_MIN_ISGE_FP32; -extern GrB_Semiring GxB_MIN_ISGE_FP64; -extern GrB_Semiring GxB_MIN_ISGE_INT8; -extern GrB_Semiring GxB_MIN_ISGE_INT16; -extern GrB_Semiring GxB_MIN_ISGE_INT32; -extern GrB_Semiring GxB_MIN_ISGE_INT64; -extern GrB_Semiring GxB_MIN_ISGE_UINT8; -extern GrB_Semiring GxB_MIN_ISGE_UINT16; -extern GrB_Semiring GxB_MIN_ISGE_UINT32; -extern GrB_Semiring GxB_MIN_ISGE_UINT64; -extern GrB_Semiring GxB_MIN_ISGT_FP32; -extern GrB_Semiring GxB_MIN_ISGT_FP64; -extern GrB_Semiring GxB_MIN_ISGT_INT8; -extern GrB_Semiring GxB_MIN_ISGT_INT16; -extern GrB_Semiring GxB_MIN_ISGT_INT32; -extern GrB_Semiring GxB_MIN_ISGT_INT64; -extern GrB_Semiring GxB_MIN_ISGT_UINT8; -extern GrB_Semiring GxB_MIN_ISGT_UINT16; -extern GrB_Semiring GxB_MIN_ISGT_UINT32; -extern GrB_Semiring GxB_MIN_ISGT_UINT64; -extern GrB_Semiring GxB_MIN_ISLE_FP32; -extern GrB_Semiring GxB_MIN_ISLE_FP64; -extern GrB_Semiring GxB_MIN_ISLE_INT8; -extern GrB_Semiring GxB_MIN_ISLE_INT16; -extern GrB_Semiring GxB_MIN_ISLE_INT32; -extern GrB_Semiring GxB_MIN_ISLE_INT64; -extern GrB_Semiring GxB_MIN_ISLE_UINT8; -extern GrB_Semiring GxB_MIN_ISLE_UINT16; -extern GrB_Semiring GxB_MIN_ISLE_UINT32; -extern GrB_Semiring GxB_MIN_ISLE_UINT64; -extern GrB_Semiring GxB_MIN_ISLT_FP32; -extern GrB_Semiring GxB_MIN_ISLT_FP64; -extern GrB_Semiring GxB_MIN_ISLT_INT8; -extern GrB_Semiring GxB_MIN_ISLT_INT16; -extern GrB_Semiring GxB_MIN_ISLT_INT32; -extern GrB_Semiring GxB_MIN_ISLT_INT64; -extern GrB_Semiring GxB_MIN_ISLT_UINT8; -extern GrB_Semiring GxB_MIN_ISLT_UINT16; -extern GrB_Semiring GxB_MIN_ISLT_UINT32; -extern GrB_Semiring GxB_MIN_ISLT_UINT64; -extern GrB_Semiring GxB_MIN_ISNE_FP32; -extern GrB_Semiring GxB_MIN_ISNE_FP64; -extern GrB_Semiring GxB_MIN_ISNE_INT8; -extern GrB_Semiring GxB_MIN_ISNE_INT16; -extern GrB_Semiring GxB_MIN_ISNE_INT32; -extern GrB_Semiring GxB_MIN_ISNE_INT64; -extern GrB_Semiring GxB_MIN_ISNE_UINT8; -extern GrB_Semiring GxB_MIN_ISNE_UINT16; -extern GrB_Semiring GxB_MIN_ISNE_UINT32; -extern GrB_Semiring GxB_MIN_ISNE_UINT64; -extern GrB_Semiring GxB_MIN_LAND_FP32; -extern GrB_Semiring GxB_MIN_LAND_FP64; -extern GrB_Semiring GxB_MIN_LAND_INT8; -extern GrB_Semiring GxB_MIN_LAND_INT16; -extern GrB_Semiring GxB_MIN_LAND_INT32; -extern GrB_Semiring GxB_MIN_LAND_INT64; -extern GrB_Semiring GxB_MIN_LAND_UINT8; -extern GrB_Semiring GxB_MIN_LAND_UINT16; -extern GrB_Semiring GxB_MIN_LAND_UINT32; -extern GrB_Semiring GxB_MIN_LAND_UINT64; -extern GrB_Semiring GxB_MIN_LOR_FP32; -extern GrB_Semiring GxB_MIN_LOR_FP64; -extern GrB_Semiring GxB_MIN_LOR_INT8; -extern GrB_Semiring GxB_MIN_LOR_INT16; -extern GrB_Semiring GxB_MIN_LOR_INT32; -extern GrB_Semiring GxB_MIN_LOR_INT64; -extern GrB_Semiring GxB_MIN_LOR_UINT8; -extern GrB_Semiring GxB_MIN_LOR_UINT16; -extern GrB_Semiring GxB_MIN_LOR_UINT32; -extern GrB_Semiring GxB_MIN_LOR_UINT64; -extern GrB_Semiring GxB_MIN_LXOR_FP32; -extern GrB_Semiring GxB_MIN_LXOR_FP64; -extern GrB_Semiring GxB_MIN_LXOR_INT8; -extern GrB_Semiring GxB_MIN_LXOR_INT16; -extern GrB_Semiring GxB_MIN_LXOR_INT32; -extern GrB_Semiring GxB_MIN_LXOR_INT64; -extern GrB_Semiring GxB_MIN_LXOR_UINT8; -extern GrB_Semiring GxB_MIN_LXOR_UINT16; -extern GrB_Semiring GxB_MIN_LXOR_UINT32; -extern GrB_Semiring GxB_MIN_LXOR_UINT64; -extern GrB_Semiring GxB_MIN_MINUS_FP32; -extern GrB_Semiring GxB_MIN_MINUS_FP64; -extern GrB_Semiring GxB_MIN_MINUS_INT8; -extern GrB_Semiring GxB_MIN_MINUS_INT16; -extern GrB_Semiring GxB_MIN_MINUS_INT32; -extern GrB_Semiring GxB_MIN_MINUS_INT64; -extern GrB_Semiring GxB_MIN_MINUS_UINT8; -extern GrB_Semiring GxB_MIN_MINUS_UINT16; -extern GrB_Semiring GxB_MIN_MINUS_UINT32; -extern GrB_Semiring GxB_MIN_MINUS_UINT64; -extern GrB_Semiring GxB_MIN_MIN_FP32; -extern GrB_Semiring GxB_MIN_MIN_FP64; -extern GrB_Semiring GxB_MIN_MIN_INT8; -extern GrB_Semiring GxB_MIN_MIN_INT16; -extern GrB_Semiring GxB_MIN_MIN_INT32; -extern GrB_Semiring GxB_MIN_MIN_INT64; -extern GrB_Semiring GxB_MIN_MIN_UINT8; -extern GrB_Semiring GxB_MIN_MIN_UINT16; -extern GrB_Semiring GxB_MIN_MIN_UINT32; -extern GrB_Semiring GxB_MIN_MIN_UINT64; -extern GrB_Semiring GxB_MIN_PAIR_FP32; -extern GrB_Semiring GxB_MIN_PAIR_FP64; -extern GrB_Semiring GxB_MIN_PAIR_INT8; -extern GrB_Semiring GxB_MIN_PAIR_INT16; -extern GrB_Semiring GxB_MIN_PAIR_INT32; -extern GrB_Semiring GxB_MIN_PAIR_INT64; -extern GrB_Semiring GxB_MIN_PAIR_UINT8; -extern GrB_Semiring GxB_MIN_PAIR_UINT16; -extern GrB_Semiring GxB_MIN_PAIR_UINT32; -extern GrB_Semiring GxB_MIN_PAIR_UINT64; -extern GrB_Semiring GxB_MIN_RDIV_FP32; -extern GrB_Semiring GxB_MIN_RDIV_FP64; -extern GrB_Semiring GxB_MIN_RDIV_INT8; -extern GrB_Semiring GxB_MIN_RDIV_INT16; -extern GrB_Semiring GxB_MIN_RDIV_INT32; -extern GrB_Semiring GxB_MIN_RDIV_INT64; -extern GrB_Semiring GxB_MIN_RDIV_UINT8; -extern GrB_Semiring GxB_MIN_RDIV_UINT16; -extern GrB_Semiring GxB_MIN_RDIV_UINT32; -extern GrB_Semiring GxB_MIN_RDIV_UINT64; -extern GrB_Semiring GxB_MIN_RMINUS_FP32; -extern GrB_Semiring GxB_MIN_RMINUS_FP64; -extern GrB_Semiring GxB_MIN_RMINUS_INT8; -extern GrB_Semiring GxB_MIN_RMINUS_INT16; -extern GrB_Semiring GxB_MIN_RMINUS_INT32; -extern GrB_Semiring GxB_MIN_RMINUS_INT64; -extern GrB_Semiring GxB_MIN_RMINUS_UINT8; -extern GrB_Semiring GxB_MIN_RMINUS_UINT16; -extern GrB_Semiring GxB_MIN_RMINUS_UINT32; -extern GrB_Semiring GxB_MIN_RMINUS_UINT64; -extern GrB_Semiring GxB_MIN_SECONDI1_INT32; -extern GrB_Semiring GxB_MIN_SECONDI1_INT64; -extern GrB_Semiring GxB_MIN_SECONDI_INT32; -extern GrB_Semiring GxB_MIN_SECONDI_INT64; -extern GrB_Semiring GxB_MIN_SECONDJ1_INT32; -extern GrB_Semiring GxB_MIN_SECONDJ1_INT64; -extern GrB_Semiring GxB_MIN_SECONDJ_INT32; -extern GrB_Semiring GxB_MIN_SECONDJ_INT64; -extern GrB_Semiring GxB_PLUS_DIV_FC32; -extern GrB_Semiring GxB_PLUS_DIV_FC64; -extern GrB_Semiring GxB_PLUS_DIV_FP32; -extern GrB_Semiring GxB_PLUS_DIV_FP64; -extern GrB_Semiring GxB_PLUS_DIV_INT8; -extern GrB_Semiring GxB_PLUS_DIV_INT16; -extern GrB_Semiring GxB_PLUS_DIV_INT32; -extern GrB_Semiring GxB_PLUS_DIV_INT64; -extern GrB_Semiring GxB_PLUS_DIV_UINT8; -extern GrB_Semiring GxB_PLUS_DIV_UINT16; -extern GrB_Semiring GxB_PLUS_DIV_UINT32; -extern GrB_Semiring GxB_PLUS_DIV_UINT64; -extern GrB_Semiring GxB_PLUS_FIRSTI1_INT32; -extern GrB_Semiring GxB_PLUS_FIRSTI1_INT64; -extern GrB_Semiring GxB_PLUS_FIRSTI_INT32; -extern GrB_Semiring GxB_PLUS_FIRSTI_INT64; -extern GrB_Semiring GxB_PLUS_FIRSTJ1_INT32; -extern GrB_Semiring GxB_PLUS_FIRSTJ1_INT64; -extern GrB_Semiring GxB_PLUS_FIRSTJ_INT32; -extern GrB_Semiring GxB_PLUS_FIRSTJ_INT64; -extern GrB_Semiring GxB_PLUS_FIRST_FC32; -extern GrB_Semiring GxB_PLUS_FIRST_FC64; -extern GrB_Semiring GxB_PLUS_FIRST_FP32; -extern GrB_Semiring GxB_PLUS_FIRST_FP64; -extern GrB_Semiring GxB_PLUS_FIRST_INT8; -extern GrB_Semiring GxB_PLUS_FIRST_INT16; -extern GrB_Semiring GxB_PLUS_FIRST_INT32; -extern GrB_Semiring GxB_PLUS_FIRST_INT64; -extern GrB_Semiring GxB_PLUS_FIRST_UINT8; -extern GrB_Semiring GxB_PLUS_FIRST_UINT16; -extern GrB_Semiring GxB_PLUS_FIRST_UINT32; -extern GrB_Semiring GxB_PLUS_FIRST_UINT64; -extern GrB_Semiring GxB_PLUS_ISEQ_FP32; -extern GrB_Semiring GxB_PLUS_ISEQ_FP64; -extern GrB_Semiring GxB_PLUS_ISEQ_INT8; -extern GrB_Semiring GxB_PLUS_ISEQ_INT16; -extern GrB_Semiring GxB_PLUS_ISEQ_INT32; -extern GrB_Semiring GxB_PLUS_ISEQ_INT64; -extern GrB_Semiring GxB_PLUS_ISEQ_UINT8; -extern GrB_Semiring GxB_PLUS_ISEQ_UINT16; -extern GrB_Semiring GxB_PLUS_ISEQ_UINT32; -extern GrB_Semiring GxB_PLUS_ISEQ_UINT64; -extern GrB_Semiring GxB_PLUS_ISGE_FP32; -extern GrB_Semiring GxB_PLUS_ISGE_FP64; -extern GrB_Semiring GxB_PLUS_ISGE_INT8; -extern GrB_Semiring GxB_PLUS_ISGE_INT16; -extern GrB_Semiring GxB_PLUS_ISGE_INT32; -extern GrB_Semiring GxB_PLUS_ISGE_INT64; -extern GrB_Semiring GxB_PLUS_ISGE_UINT8; -extern GrB_Semiring GxB_PLUS_ISGE_UINT16; -extern GrB_Semiring GxB_PLUS_ISGE_UINT32; -extern GrB_Semiring GxB_PLUS_ISGE_UINT64; -extern GrB_Semiring GxB_PLUS_ISGT_FP32; -extern GrB_Semiring GxB_PLUS_ISGT_FP64; -extern GrB_Semiring GxB_PLUS_ISGT_INT8; -extern GrB_Semiring GxB_PLUS_ISGT_INT16; -extern GrB_Semiring GxB_PLUS_ISGT_INT32; -extern GrB_Semiring GxB_PLUS_ISGT_INT64; -extern GrB_Semiring GxB_PLUS_ISGT_UINT8; -extern GrB_Semiring GxB_PLUS_ISGT_UINT16; -extern GrB_Semiring GxB_PLUS_ISGT_UINT32; -extern GrB_Semiring GxB_PLUS_ISGT_UINT64; -extern GrB_Semiring GxB_PLUS_ISLE_FP32; -extern GrB_Semiring GxB_PLUS_ISLE_FP64; -extern GrB_Semiring GxB_PLUS_ISLE_INT8; -extern GrB_Semiring GxB_PLUS_ISLE_INT16; -extern GrB_Semiring GxB_PLUS_ISLE_INT32; -extern GrB_Semiring GxB_PLUS_ISLE_INT64; -extern GrB_Semiring GxB_PLUS_ISLE_UINT8; -extern GrB_Semiring GxB_PLUS_ISLE_UINT16; -extern GrB_Semiring GxB_PLUS_ISLE_UINT32; -extern GrB_Semiring GxB_PLUS_ISLE_UINT64; -extern GrB_Semiring GxB_PLUS_ISLT_FP32; -extern GrB_Semiring GxB_PLUS_ISLT_FP64; -extern GrB_Semiring GxB_PLUS_ISLT_INT8; -extern GrB_Semiring GxB_PLUS_ISLT_INT16; -extern GrB_Semiring GxB_PLUS_ISLT_INT32; -extern GrB_Semiring GxB_PLUS_ISLT_INT64; -extern GrB_Semiring GxB_PLUS_ISLT_UINT8; -extern GrB_Semiring GxB_PLUS_ISLT_UINT16; -extern GrB_Semiring GxB_PLUS_ISLT_UINT32; -extern GrB_Semiring GxB_PLUS_ISLT_UINT64; -extern GrB_Semiring GxB_PLUS_ISNE_FP32; -extern GrB_Semiring GxB_PLUS_ISNE_FP64; -extern GrB_Semiring GxB_PLUS_ISNE_INT8; -extern GrB_Semiring GxB_PLUS_ISNE_INT16; -extern GrB_Semiring GxB_PLUS_ISNE_INT32; -extern GrB_Semiring GxB_PLUS_ISNE_INT64; -extern GrB_Semiring GxB_PLUS_ISNE_UINT8; -extern GrB_Semiring GxB_PLUS_ISNE_UINT16; -extern GrB_Semiring GxB_PLUS_ISNE_UINT32; -extern GrB_Semiring GxB_PLUS_ISNE_UINT64; -extern GrB_Semiring GxB_PLUS_LAND_FP32; -extern GrB_Semiring GxB_PLUS_LAND_FP64; -extern GrB_Semiring GxB_PLUS_LAND_INT8; -extern GrB_Semiring GxB_PLUS_LAND_INT16; -extern GrB_Semiring GxB_PLUS_LAND_INT32; -extern GrB_Semiring GxB_PLUS_LAND_INT64; -extern GrB_Semiring GxB_PLUS_LAND_UINT8; -extern GrB_Semiring GxB_PLUS_LAND_UINT16; -extern GrB_Semiring GxB_PLUS_LAND_UINT32; -extern GrB_Semiring GxB_PLUS_LAND_UINT64; -extern GrB_Semiring GxB_PLUS_LOR_FP32; -extern GrB_Semiring GxB_PLUS_LOR_FP64; -extern GrB_Semiring GxB_PLUS_LOR_INT8; -extern GrB_Semiring GxB_PLUS_LOR_INT16; -extern GrB_Semiring GxB_PLUS_LOR_INT32; -extern GrB_Semiring GxB_PLUS_LOR_INT64; -extern GrB_Semiring GxB_PLUS_LOR_UINT8; -extern GrB_Semiring GxB_PLUS_LOR_UINT16; -extern GrB_Semiring GxB_PLUS_LOR_UINT32; -extern GrB_Semiring GxB_PLUS_LOR_UINT64; -extern GrB_Semiring GxB_PLUS_LXOR_FP32; -extern GrB_Semiring GxB_PLUS_LXOR_FP64; -extern GrB_Semiring GxB_PLUS_LXOR_INT8; -extern GrB_Semiring GxB_PLUS_LXOR_INT16; -extern GrB_Semiring GxB_PLUS_LXOR_INT32; -extern GrB_Semiring GxB_PLUS_LXOR_INT64; -extern GrB_Semiring GxB_PLUS_LXOR_UINT8; -extern GrB_Semiring GxB_PLUS_LXOR_UINT16; -extern GrB_Semiring GxB_PLUS_LXOR_UINT32; -extern GrB_Semiring GxB_PLUS_LXOR_UINT64; -extern GrB_Semiring GxB_PLUS_MAX_FP32; -extern GrB_Semiring GxB_PLUS_MAX_FP64; -extern GrB_Semiring GxB_PLUS_MAX_INT8; -extern GrB_Semiring GxB_PLUS_MAX_INT16; -extern GrB_Semiring GxB_PLUS_MAX_INT32; -extern GrB_Semiring GxB_PLUS_MAX_INT64; -extern GrB_Semiring GxB_PLUS_MAX_UINT8; -extern GrB_Semiring GxB_PLUS_MAX_UINT16; -extern GrB_Semiring GxB_PLUS_MAX_UINT32; -extern GrB_Semiring GxB_PLUS_MAX_UINT64; -extern GrB_Semiring GxB_PLUS_MINUS_FC32; -extern GrB_Semiring GxB_PLUS_MINUS_FC64; -extern GrB_Semiring GxB_PLUS_MINUS_FP32; -extern GrB_Semiring GxB_PLUS_MINUS_FP64; -extern GrB_Semiring GxB_PLUS_MINUS_INT8; -extern GrB_Semiring GxB_PLUS_MINUS_INT16; -extern GrB_Semiring GxB_PLUS_MINUS_INT32; -extern GrB_Semiring GxB_PLUS_MINUS_INT64; -extern GrB_Semiring GxB_PLUS_MINUS_UINT8; -extern GrB_Semiring GxB_PLUS_MINUS_UINT16; -extern GrB_Semiring GxB_PLUS_MINUS_UINT32; -extern GrB_Semiring GxB_PLUS_MINUS_UINT64; -extern GrB_Semiring GxB_PLUS_PAIR_FC32; -extern GrB_Semiring GxB_PLUS_PAIR_FC64; -extern GrB_Semiring GxB_PLUS_PAIR_FP32; -extern GrB_Semiring GxB_PLUS_PAIR_FP64; -extern GrB_Semiring GxB_PLUS_PAIR_INT8; -extern GrB_Semiring GxB_PLUS_PAIR_INT16; -extern GrB_Semiring GxB_PLUS_PAIR_INT32; -extern GrB_Semiring GxB_PLUS_PAIR_INT64; -extern GrB_Semiring GxB_PLUS_PAIR_UINT8; -extern GrB_Semiring GxB_PLUS_PAIR_UINT16; -extern GrB_Semiring GxB_PLUS_PAIR_UINT32; -extern GrB_Semiring GxB_PLUS_PAIR_UINT64; -extern GrB_Semiring GxB_PLUS_PLUS_FC32; -extern GrB_Semiring GxB_PLUS_PLUS_FC64; -extern GrB_Semiring GxB_PLUS_PLUS_FP32; -extern GrB_Semiring GxB_PLUS_PLUS_FP64; -extern GrB_Semiring GxB_PLUS_PLUS_INT8; -extern GrB_Semiring GxB_PLUS_PLUS_INT16; -extern GrB_Semiring GxB_PLUS_PLUS_INT32; -extern GrB_Semiring GxB_PLUS_PLUS_INT64; -extern GrB_Semiring GxB_PLUS_PLUS_UINT8; -extern GrB_Semiring GxB_PLUS_PLUS_UINT16; -extern GrB_Semiring GxB_PLUS_PLUS_UINT32; -extern GrB_Semiring GxB_PLUS_PLUS_UINT64; -extern GrB_Semiring GxB_PLUS_RDIV_FC32; -extern GrB_Semiring GxB_PLUS_RDIV_FC64; -extern GrB_Semiring GxB_PLUS_RDIV_FP32; -extern GrB_Semiring GxB_PLUS_RDIV_FP64; -extern GrB_Semiring GxB_PLUS_RDIV_INT8; -extern GrB_Semiring GxB_PLUS_RDIV_INT16; -extern GrB_Semiring GxB_PLUS_RDIV_INT32; -extern GrB_Semiring GxB_PLUS_RDIV_INT64; -extern GrB_Semiring GxB_PLUS_RDIV_UINT8; -extern GrB_Semiring GxB_PLUS_RDIV_UINT16; -extern GrB_Semiring GxB_PLUS_RDIV_UINT32; -extern GrB_Semiring GxB_PLUS_RDIV_UINT64; -extern GrB_Semiring GxB_PLUS_RMINUS_FC32; -extern GrB_Semiring GxB_PLUS_RMINUS_FC64; -extern GrB_Semiring GxB_PLUS_RMINUS_FP32; -extern GrB_Semiring GxB_PLUS_RMINUS_FP64; -extern GrB_Semiring GxB_PLUS_RMINUS_INT8; -extern GrB_Semiring GxB_PLUS_RMINUS_INT16; -extern GrB_Semiring GxB_PLUS_RMINUS_INT32; -extern GrB_Semiring GxB_PLUS_RMINUS_INT64; -extern GrB_Semiring GxB_PLUS_RMINUS_UINT8; -extern GrB_Semiring GxB_PLUS_RMINUS_UINT16; -extern GrB_Semiring GxB_PLUS_RMINUS_UINT32; -extern GrB_Semiring GxB_PLUS_RMINUS_UINT64; -extern GrB_Semiring GxB_PLUS_SECONDI1_INT32; -extern GrB_Semiring GxB_PLUS_SECONDI1_INT64; -extern GrB_Semiring GxB_PLUS_SECONDI_INT32; -extern GrB_Semiring GxB_PLUS_SECONDI_INT64; -extern GrB_Semiring GxB_PLUS_SECONDJ1_INT32; -extern GrB_Semiring GxB_PLUS_SECONDJ1_INT64; -extern GrB_Semiring GxB_PLUS_SECONDJ_INT32; -extern GrB_Semiring GxB_PLUS_SECONDJ_INT64; -extern GrB_Semiring GxB_PLUS_SECOND_FC32; -extern GrB_Semiring GxB_PLUS_SECOND_FC64; -extern GrB_Semiring GxB_PLUS_SECOND_FP32; -extern GrB_Semiring GxB_PLUS_SECOND_FP64; -extern GrB_Semiring GxB_PLUS_SECOND_INT8; -extern GrB_Semiring GxB_PLUS_SECOND_INT16; -extern GrB_Semiring GxB_PLUS_SECOND_INT32; -extern GrB_Semiring GxB_PLUS_SECOND_INT64; -extern GrB_Semiring GxB_PLUS_SECOND_UINT8; -extern GrB_Semiring GxB_PLUS_SECOND_UINT16; -extern GrB_Semiring GxB_PLUS_SECOND_UINT32; -extern GrB_Semiring GxB_PLUS_SECOND_UINT64; -extern GrB_Semiring GxB_PLUS_TIMES_FC32; -extern GrB_Semiring GxB_PLUS_TIMES_FC64; -extern GrB_Semiring GxB_TIMES_DIV_FC32; -extern GrB_Semiring GxB_TIMES_DIV_FC64; -extern GrB_Semiring GxB_TIMES_DIV_FP32; -extern GrB_Semiring GxB_TIMES_DIV_FP64; -extern GrB_Semiring GxB_TIMES_DIV_INT8; -extern GrB_Semiring GxB_TIMES_DIV_INT16; -extern GrB_Semiring GxB_TIMES_DIV_INT32; -extern GrB_Semiring GxB_TIMES_DIV_INT64; -extern GrB_Semiring GxB_TIMES_DIV_UINT8; -extern GrB_Semiring GxB_TIMES_DIV_UINT16; -extern GrB_Semiring GxB_TIMES_DIV_UINT32; -extern GrB_Semiring GxB_TIMES_DIV_UINT64; -extern GrB_Semiring GxB_TIMES_FIRSTI1_INT32; -extern GrB_Semiring GxB_TIMES_FIRSTI1_INT64; -extern GrB_Semiring GxB_TIMES_FIRSTI_INT32; -extern GrB_Semiring GxB_TIMES_FIRSTI_INT64; -extern GrB_Semiring GxB_TIMES_FIRSTJ1_INT32; -extern GrB_Semiring GxB_TIMES_FIRSTJ1_INT64; -extern GrB_Semiring GxB_TIMES_FIRSTJ_INT32; -extern GrB_Semiring GxB_TIMES_FIRSTJ_INT64; -extern GrB_Semiring GxB_TIMES_FIRST_FC32; -extern GrB_Semiring GxB_TIMES_FIRST_FC64; -extern GrB_Semiring GxB_TIMES_FIRST_FP32; -extern GrB_Semiring GxB_TIMES_FIRST_FP64; -extern GrB_Semiring GxB_TIMES_FIRST_INT8; -extern GrB_Semiring GxB_TIMES_FIRST_INT16; -extern GrB_Semiring GxB_TIMES_FIRST_INT32; -extern GrB_Semiring GxB_TIMES_FIRST_INT64; -extern GrB_Semiring GxB_TIMES_FIRST_UINT8; -extern GrB_Semiring GxB_TIMES_FIRST_UINT16; -extern GrB_Semiring GxB_TIMES_FIRST_UINT32; -extern GrB_Semiring GxB_TIMES_FIRST_UINT64; -extern GrB_Semiring GxB_TIMES_ISEQ_FP32; -extern GrB_Semiring GxB_TIMES_ISEQ_FP64; -extern GrB_Semiring GxB_TIMES_ISEQ_INT8; -extern GrB_Semiring GxB_TIMES_ISEQ_INT16; -extern GrB_Semiring GxB_TIMES_ISEQ_INT32; -extern GrB_Semiring GxB_TIMES_ISEQ_INT64; -extern GrB_Semiring GxB_TIMES_ISEQ_UINT8; -extern GrB_Semiring GxB_TIMES_ISEQ_UINT16; -extern GrB_Semiring GxB_TIMES_ISEQ_UINT32; -extern GrB_Semiring GxB_TIMES_ISEQ_UINT64; -extern GrB_Semiring GxB_TIMES_ISGE_FP32; -extern GrB_Semiring GxB_TIMES_ISGE_FP64; -extern GrB_Semiring GxB_TIMES_ISGE_INT8; -extern GrB_Semiring GxB_TIMES_ISGE_INT16; -extern GrB_Semiring GxB_TIMES_ISGE_INT32; -extern GrB_Semiring GxB_TIMES_ISGE_INT64; -extern GrB_Semiring GxB_TIMES_ISGE_UINT8; -extern GrB_Semiring GxB_TIMES_ISGE_UINT16; -extern GrB_Semiring GxB_TIMES_ISGE_UINT32; -extern GrB_Semiring GxB_TIMES_ISGE_UINT64; -extern GrB_Semiring GxB_TIMES_ISGT_FP32; -extern GrB_Semiring GxB_TIMES_ISGT_FP64; -extern GrB_Semiring GxB_TIMES_ISGT_INT8; -extern GrB_Semiring GxB_TIMES_ISGT_INT16; -extern GrB_Semiring GxB_TIMES_ISGT_INT32; -extern GrB_Semiring GxB_TIMES_ISGT_INT64; -extern GrB_Semiring GxB_TIMES_ISGT_UINT8; -extern GrB_Semiring GxB_TIMES_ISGT_UINT16; -extern GrB_Semiring GxB_TIMES_ISGT_UINT32; -extern GrB_Semiring GxB_TIMES_ISGT_UINT64; -extern GrB_Semiring GxB_TIMES_ISLE_FP32; -extern GrB_Semiring GxB_TIMES_ISLE_FP64; -extern GrB_Semiring GxB_TIMES_ISLE_INT8; -extern GrB_Semiring GxB_TIMES_ISLE_INT16; -extern GrB_Semiring GxB_TIMES_ISLE_INT32; -extern GrB_Semiring GxB_TIMES_ISLE_INT64; -extern GrB_Semiring GxB_TIMES_ISLE_UINT8; -extern GrB_Semiring GxB_TIMES_ISLE_UINT16; -extern GrB_Semiring GxB_TIMES_ISLE_UINT32; -extern GrB_Semiring GxB_TIMES_ISLE_UINT64; -extern GrB_Semiring GxB_TIMES_ISLT_FP32; -extern GrB_Semiring GxB_TIMES_ISLT_FP64; -extern GrB_Semiring GxB_TIMES_ISLT_INT8; -extern GrB_Semiring GxB_TIMES_ISLT_INT16; -extern GrB_Semiring GxB_TIMES_ISLT_INT32; -extern GrB_Semiring GxB_TIMES_ISLT_INT64; -extern GrB_Semiring GxB_TIMES_ISLT_UINT8; -extern GrB_Semiring GxB_TIMES_ISLT_UINT16; -extern GrB_Semiring GxB_TIMES_ISLT_UINT32; -extern GrB_Semiring GxB_TIMES_ISLT_UINT64; -extern GrB_Semiring GxB_TIMES_ISNE_FP32; -extern GrB_Semiring GxB_TIMES_ISNE_FP64; -extern GrB_Semiring GxB_TIMES_ISNE_INT8; -extern GrB_Semiring GxB_TIMES_ISNE_INT16; -extern GrB_Semiring GxB_TIMES_ISNE_INT32; -extern GrB_Semiring GxB_TIMES_ISNE_INT64; -extern GrB_Semiring GxB_TIMES_ISNE_UINT8; -extern GrB_Semiring GxB_TIMES_ISNE_UINT16; -extern GrB_Semiring GxB_TIMES_ISNE_UINT32; -extern GrB_Semiring GxB_TIMES_ISNE_UINT64; -extern GrB_Semiring GxB_TIMES_LAND_FP32; -extern GrB_Semiring GxB_TIMES_LAND_FP64; -extern GrB_Semiring GxB_TIMES_LAND_INT8; -extern GrB_Semiring GxB_TIMES_LAND_INT16; -extern GrB_Semiring GxB_TIMES_LAND_INT32; -extern GrB_Semiring GxB_TIMES_LAND_INT64; -extern GrB_Semiring GxB_TIMES_LAND_UINT8; -extern GrB_Semiring GxB_TIMES_LAND_UINT16; -extern GrB_Semiring GxB_TIMES_LAND_UINT32; -extern GrB_Semiring GxB_TIMES_LAND_UINT64; -extern GrB_Semiring GxB_TIMES_LOR_FP32; -extern GrB_Semiring GxB_TIMES_LOR_FP64; -extern GrB_Semiring GxB_TIMES_LOR_INT8; -extern GrB_Semiring GxB_TIMES_LOR_INT16; -extern GrB_Semiring GxB_TIMES_LOR_INT32; -extern GrB_Semiring GxB_TIMES_LOR_INT64; -extern GrB_Semiring GxB_TIMES_LOR_UINT8; -extern GrB_Semiring GxB_TIMES_LOR_UINT16; -extern GrB_Semiring GxB_TIMES_LOR_UINT32; -extern GrB_Semiring GxB_TIMES_LOR_UINT64; -extern GrB_Semiring GxB_TIMES_LXOR_FP32; -extern GrB_Semiring GxB_TIMES_LXOR_FP64; -extern GrB_Semiring GxB_TIMES_LXOR_INT8; -extern GrB_Semiring GxB_TIMES_LXOR_INT16; -extern GrB_Semiring GxB_TIMES_LXOR_INT32; -extern GrB_Semiring GxB_TIMES_LXOR_INT64; -extern GrB_Semiring GxB_TIMES_LXOR_UINT8; -extern GrB_Semiring GxB_TIMES_LXOR_UINT16; -extern GrB_Semiring GxB_TIMES_LXOR_UINT32; -extern GrB_Semiring GxB_TIMES_LXOR_UINT64; -extern GrB_Semiring GxB_TIMES_MAX_FP32; -extern GrB_Semiring GxB_TIMES_MAX_FP64; -extern GrB_Semiring GxB_TIMES_MAX_INT8; -extern GrB_Semiring GxB_TIMES_MAX_INT16; -extern GrB_Semiring GxB_TIMES_MAX_INT32; -extern GrB_Semiring GxB_TIMES_MAX_INT64; -extern GrB_Semiring GxB_TIMES_MAX_UINT8; -extern GrB_Semiring GxB_TIMES_MAX_UINT16; -extern GrB_Semiring GxB_TIMES_MAX_UINT32; -extern GrB_Semiring GxB_TIMES_MAX_UINT64; -extern GrB_Semiring GxB_TIMES_MINUS_FC32; -extern GrB_Semiring GxB_TIMES_MINUS_FC64; -extern GrB_Semiring GxB_TIMES_MINUS_FP32; -extern GrB_Semiring GxB_TIMES_MINUS_FP64; -extern GrB_Semiring GxB_TIMES_MINUS_INT8; -extern GrB_Semiring GxB_TIMES_MINUS_INT16; -extern GrB_Semiring GxB_TIMES_MINUS_INT32; -extern GrB_Semiring GxB_TIMES_MINUS_INT64; -extern GrB_Semiring GxB_TIMES_MINUS_UINT8; -extern GrB_Semiring GxB_TIMES_MINUS_UINT16; -extern GrB_Semiring GxB_TIMES_MINUS_UINT32; -extern GrB_Semiring GxB_TIMES_MINUS_UINT64; -extern GrB_Semiring GxB_TIMES_MIN_FP32; -extern GrB_Semiring GxB_TIMES_MIN_FP64; -extern GrB_Semiring GxB_TIMES_MIN_INT8; -extern GrB_Semiring GxB_TIMES_MIN_INT16; -extern GrB_Semiring GxB_TIMES_MIN_INT32; -extern GrB_Semiring GxB_TIMES_MIN_INT64; -extern GrB_Semiring GxB_TIMES_MIN_UINT8; -extern GrB_Semiring GxB_TIMES_MIN_UINT16; -extern GrB_Semiring GxB_TIMES_MIN_UINT32; -extern GrB_Semiring GxB_TIMES_MIN_UINT64; -extern GrB_Semiring GxB_TIMES_PAIR_FC32; -extern GrB_Semiring GxB_TIMES_PAIR_FC64; -extern GrB_Semiring GxB_TIMES_PAIR_FP32; -extern GrB_Semiring GxB_TIMES_PAIR_FP64; -extern GrB_Semiring GxB_TIMES_PAIR_INT8; -extern GrB_Semiring GxB_TIMES_PAIR_INT16; -extern GrB_Semiring GxB_TIMES_PAIR_INT32; -extern GrB_Semiring GxB_TIMES_PAIR_INT64; -extern GrB_Semiring GxB_TIMES_PAIR_UINT8; -extern GrB_Semiring GxB_TIMES_PAIR_UINT16; -extern GrB_Semiring GxB_TIMES_PAIR_UINT32; -extern GrB_Semiring GxB_TIMES_PAIR_UINT64; -extern GrB_Semiring GxB_TIMES_PLUS_FC32; -extern GrB_Semiring GxB_TIMES_PLUS_FC64; -extern GrB_Semiring GxB_TIMES_PLUS_FP32; -extern GrB_Semiring GxB_TIMES_PLUS_FP64; -extern GrB_Semiring GxB_TIMES_PLUS_INT8; -extern GrB_Semiring GxB_TIMES_PLUS_INT16; -extern GrB_Semiring GxB_TIMES_PLUS_INT32; -extern GrB_Semiring GxB_TIMES_PLUS_INT64; -extern GrB_Semiring GxB_TIMES_PLUS_UINT8; -extern GrB_Semiring GxB_TIMES_PLUS_UINT16; -extern GrB_Semiring GxB_TIMES_PLUS_UINT32; -extern GrB_Semiring GxB_TIMES_PLUS_UINT64; -extern GrB_Semiring GxB_TIMES_RDIV_FC32; -extern GrB_Semiring GxB_TIMES_RDIV_FC64; -extern GrB_Semiring GxB_TIMES_RDIV_FP32; -extern GrB_Semiring GxB_TIMES_RDIV_FP64; -extern GrB_Semiring GxB_TIMES_RDIV_INT8; -extern GrB_Semiring GxB_TIMES_RDIV_INT16; -extern GrB_Semiring GxB_TIMES_RDIV_INT32; -extern GrB_Semiring GxB_TIMES_RDIV_INT64; -extern GrB_Semiring GxB_TIMES_RDIV_UINT8; -extern GrB_Semiring GxB_TIMES_RDIV_UINT16; -extern GrB_Semiring GxB_TIMES_RDIV_UINT32; -extern GrB_Semiring GxB_TIMES_RDIV_UINT64; -extern GrB_Semiring GxB_TIMES_RMINUS_FC32; -extern GrB_Semiring GxB_TIMES_RMINUS_FC64; -extern GrB_Semiring GxB_TIMES_RMINUS_FP32; -extern GrB_Semiring GxB_TIMES_RMINUS_FP64; -extern GrB_Semiring GxB_TIMES_RMINUS_INT8; -extern GrB_Semiring GxB_TIMES_RMINUS_INT16; -extern GrB_Semiring GxB_TIMES_RMINUS_INT32; -extern GrB_Semiring GxB_TIMES_RMINUS_INT64; -extern GrB_Semiring GxB_TIMES_RMINUS_UINT8; -extern GrB_Semiring GxB_TIMES_RMINUS_UINT16; -extern GrB_Semiring GxB_TIMES_RMINUS_UINT32; -extern GrB_Semiring GxB_TIMES_RMINUS_UINT64; -extern GrB_Semiring GxB_TIMES_SECONDI1_INT32; -extern GrB_Semiring GxB_TIMES_SECONDI1_INT64; -extern GrB_Semiring GxB_TIMES_SECONDI_INT32; -extern GrB_Semiring GxB_TIMES_SECONDI_INT64; -extern GrB_Semiring GxB_TIMES_SECONDJ1_INT32; -extern GrB_Semiring GxB_TIMES_SECONDJ1_INT64; -extern GrB_Semiring GxB_TIMES_SECONDJ_INT32; -extern GrB_Semiring GxB_TIMES_SECONDJ_INT64; -extern GrB_Semiring GxB_TIMES_SECOND_FC32; -extern GrB_Semiring GxB_TIMES_SECOND_FC64; -extern GrB_Semiring GxB_TIMES_SECOND_FP32; -extern GrB_Semiring GxB_TIMES_SECOND_FP64; -extern GrB_Semiring GxB_TIMES_SECOND_INT8; -extern GrB_Semiring GxB_TIMES_SECOND_INT16; -extern GrB_Semiring GxB_TIMES_SECOND_INT32; -extern GrB_Semiring GxB_TIMES_SECOND_INT64; -extern GrB_Semiring GxB_TIMES_SECOND_UINT8; -extern GrB_Semiring GxB_TIMES_SECOND_UINT16; -extern GrB_Semiring GxB_TIMES_SECOND_UINT32; -extern GrB_Semiring GxB_TIMES_SECOND_UINT64; -extern GrB_Semiring GxB_TIMES_TIMES_FC32; -extern GrB_Semiring GxB_TIMES_TIMES_FC64; -extern GrB_Semiring GxB_TIMES_TIMES_FP32; -extern GrB_Semiring GxB_TIMES_TIMES_FP64; -extern GrB_Semiring GxB_TIMES_TIMES_INT8; -extern GrB_Semiring GxB_TIMES_TIMES_INT16; -extern GrB_Semiring GxB_TIMES_TIMES_INT32; -extern GrB_Semiring GxB_TIMES_TIMES_INT64; -extern GrB_Semiring GxB_TIMES_TIMES_UINT8; -extern GrB_Semiring GxB_TIMES_TIMES_UINT16; -extern GrB_Semiring GxB_TIMES_TIMES_UINT32; -extern GrB_Semiring GxB_TIMES_TIMES_UINT64; -extern GrB_Type GxB_FC32; -extern GrB_Type GxB_FC64; -extern GrB_UnaryOp GxB_ABS_FC32; -extern GrB_UnaryOp GxB_ABS_FC64; -extern GrB_UnaryOp GxB_ACOSH_FC32; -extern GrB_UnaryOp GxB_ACOSH_FC64; -extern GrB_UnaryOp GxB_ACOSH_FP32; -extern GrB_UnaryOp GxB_ACOSH_FP64; -extern GrB_UnaryOp GxB_ACOS_FC32; -extern GrB_UnaryOp GxB_ACOS_FC64; -extern GrB_UnaryOp GxB_ACOS_FP32; -extern GrB_UnaryOp GxB_ACOS_FP64; -extern GrB_UnaryOp GxB_AINV_FC32; -extern GrB_UnaryOp GxB_AINV_FC64; -extern GrB_UnaryOp GxB_ASINH_FC32; -extern GrB_UnaryOp GxB_ASINH_FC64; -extern GrB_UnaryOp GxB_ASINH_FP32; -extern GrB_UnaryOp GxB_ASINH_FP64; -extern GrB_UnaryOp GxB_ASIN_FC32; -extern GrB_UnaryOp GxB_ASIN_FC64; -extern GrB_UnaryOp GxB_ASIN_FP32; -extern GrB_UnaryOp GxB_ASIN_FP64; -extern GrB_UnaryOp GxB_ATANH_FC32; -extern GrB_UnaryOp GxB_ATANH_FC64; -extern GrB_UnaryOp GxB_ATANH_FP32; -extern GrB_UnaryOp GxB_ATANH_FP64; -extern GrB_UnaryOp GxB_ATAN_FC32; -extern GrB_UnaryOp GxB_ATAN_FC64; -extern GrB_UnaryOp GxB_ATAN_FP32; -extern GrB_UnaryOp GxB_ATAN_FP64; -extern GrB_UnaryOp GxB_CARG_FC32; -extern GrB_UnaryOp GxB_CARG_FC64; -extern GrB_UnaryOp GxB_CBRT_FP32; -extern GrB_UnaryOp GxB_CBRT_FP64; -extern GrB_UnaryOp GxB_CEIL_FC32; -extern GrB_UnaryOp GxB_CEIL_FC64; -extern GrB_UnaryOp GxB_CEIL_FP32; -extern GrB_UnaryOp GxB_CEIL_FP64; -extern GrB_UnaryOp GxB_CIMAG_FC32; -extern GrB_UnaryOp GxB_CIMAG_FC64; -extern GrB_UnaryOp GxB_CONJ_FC32; -extern GrB_UnaryOp GxB_CONJ_FC64; -extern GrB_UnaryOp GxB_COSH_FC32; -extern GrB_UnaryOp GxB_COSH_FC64; -extern GrB_UnaryOp GxB_COSH_FP32; -extern GrB_UnaryOp GxB_COSH_FP64; -extern GrB_UnaryOp GxB_COS_FC32; -extern GrB_UnaryOp GxB_COS_FC64; -extern GrB_UnaryOp GxB_COS_FP32; -extern GrB_UnaryOp GxB_COS_FP64; -extern GrB_UnaryOp GxB_CREAL_FC32; -extern GrB_UnaryOp GxB_CREAL_FC64; -extern GrB_UnaryOp GxB_ERFC_FP32; -extern GrB_UnaryOp GxB_ERFC_FP64; -extern GrB_UnaryOp GxB_ERF_FP32; -extern GrB_UnaryOp GxB_ERF_FP64; -extern GrB_UnaryOp GxB_EXP2_FC32; -extern GrB_UnaryOp GxB_EXP2_FC64; -extern GrB_UnaryOp GxB_EXP2_FP32; -extern GrB_UnaryOp GxB_EXP2_FP64; -extern GrB_UnaryOp GxB_EXPM1_FC32; -extern GrB_UnaryOp GxB_EXPM1_FC64; -extern GrB_UnaryOp GxB_EXPM1_FP32; -extern GrB_UnaryOp GxB_EXPM1_FP64; -extern GrB_UnaryOp GxB_EXP_FC32; -extern GrB_UnaryOp GxB_EXP_FC64; -extern GrB_UnaryOp GxB_EXP_FP32; -extern GrB_UnaryOp GxB_EXP_FP64; -extern GrB_UnaryOp GxB_FLOOR_FC32; -extern GrB_UnaryOp GxB_FLOOR_FC64; -extern GrB_UnaryOp GxB_FLOOR_FP32; -extern GrB_UnaryOp GxB_FLOOR_FP64; -extern GrB_UnaryOp GxB_FREXPE_FP32; -extern GrB_UnaryOp GxB_FREXPE_FP64; -extern GrB_UnaryOp GxB_FREXPX_FP32; -extern GrB_UnaryOp GxB_FREXPX_FP64; -extern GrB_UnaryOp GxB_IDENTITY_FC32; -extern GrB_UnaryOp GxB_IDENTITY_FC64; -extern GrB_UnaryOp GxB_ISFINITE_FC32; -extern GrB_UnaryOp GxB_ISFINITE_FC64; -extern GrB_UnaryOp GxB_ISFINITE_FP32; -extern GrB_UnaryOp GxB_ISFINITE_FP64; -extern GrB_UnaryOp GxB_ISINF_FC32; -extern GrB_UnaryOp GxB_ISINF_FC64; -extern GrB_UnaryOp GxB_ISINF_FP32; -extern GrB_UnaryOp GxB_ISINF_FP64; -extern GrB_UnaryOp GxB_ISNAN_FC32; -extern GrB_UnaryOp GxB_ISNAN_FC64; -extern GrB_UnaryOp GxB_ISNAN_FP32; -extern GrB_UnaryOp GxB_ISNAN_FP64; -extern GrB_UnaryOp GxB_LGAMMA_FP32; -extern GrB_UnaryOp GxB_LGAMMA_FP64; -extern GrB_UnaryOp GxB_LNOT_BOOL; -extern GrB_UnaryOp GxB_LNOT_FP32; -extern GrB_UnaryOp GxB_LNOT_FP64; -extern GrB_UnaryOp GxB_LNOT_INT8; -extern GrB_UnaryOp GxB_LNOT_INT16; -extern GrB_UnaryOp GxB_LNOT_INT32; -extern GrB_UnaryOp GxB_LNOT_INT64; -extern GrB_UnaryOp GxB_LNOT_UINT8; -extern GrB_UnaryOp GxB_LNOT_UINT16; -extern GrB_UnaryOp GxB_LNOT_UINT32; -extern GrB_UnaryOp GxB_LNOT_UINT64; -extern GrB_UnaryOp GxB_LOG10_FC32; -extern GrB_UnaryOp GxB_LOG10_FC64; -extern GrB_UnaryOp GxB_LOG10_FP32; -extern GrB_UnaryOp GxB_LOG10_FP64; -extern GrB_UnaryOp GxB_LOG1P_FC32; -extern GrB_UnaryOp GxB_LOG1P_FC64; -extern GrB_UnaryOp GxB_LOG1P_FP32; -extern GrB_UnaryOp GxB_LOG1P_FP64; -extern GrB_UnaryOp GxB_LOG2_FC32; -extern GrB_UnaryOp GxB_LOG2_FC64; -extern GrB_UnaryOp GxB_LOG2_FP32; -extern GrB_UnaryOp GxB_LOG2_FP64; -extern GrB_UnaryOp GxB_LOG_FC32; -extern GrB_UnaryOp GxB_LOG_FC64; -extern GrB_UnaryOp GxB_LOG_FP32; -extern GrB_UnaryOp GxB_LOG_FP64; -extern GrB_UnaryOp GxB_MINV_FC32; -extern GrB_UnaryOp GxB_MINV_FC64; -extern GrB_UnaryOp GxB_ONE_BOOL; -extern GrB_UnaryOp GxB_ONE_FC32; -extern GrB_UnaryOp GxB_ONE_FC64; -extern GrB_UnaryOp GxB_ONE_FP32; -extern GrB_UnaryOp GxB_ONE_FP64; -extern GrB_UnaryOp GxB_ONE_INT8; -extern GrB_UnaryOp GxB_ONE_INT16; -extern GrB_UnaryOp GxB_ONE_INT32; -extern GrB_UnaryOp GxB_ONE_INT64; -extern GrB_UnaryOp GxB_ONE_UINT8; -extern GrB_UnaryOp GxB_ONE_UINT16; -extern GrB_UnaryOp GxB_ONE_UINT32; -extern GrB_UnaryOp GxB_ONE_UINT64; -extern GrB_UnaryOp GxB_POSITIONI1_INT32; -extern GrB_UnaryOp GxB_POSITIONI1_INT64; -extern GrB_UnaryOp GxB_POSITIONI_INT32; -extern GrB_UnaryOp GxB_POSITIONI_INT64; -extern GrB_UnaryOp GxB_POSITIONJ1_INT32; -extern GrB_UnaryOp GxB_POSITIONJ1_INT64; -extern GrB_UnaryOp GxB_POSITIONJ_INT32; -extern GrB_UnaryOp GxB_POSITIONJ_INT64; -extern GrB_UnaryOp GxB_ROUND_FC32; -extern GrB_UnaryOp GxB_ROUND_FC64; -extern GrB_UnaryOp GxB_ROUND_FP32; -extern GrB_UnaryOp GxB_ROUND_FP64; -extern GrB_UnaryOp GxB_SIGNUM_FC32; -extern GrB_UnaryOp GxB_SIGNUM_FC64; -extern GrB_UnaryOp GxB_SIGNUM_FP32; -extern GrB_UnaryOp GxB_SIGNUM_FP64; -extern GrB_UnaryOp GxB_SINH_FC32; -extern GrB_UnaryOp GxB_SINH_FC64; -extern GrB_UnaryOp GxB_SINH_FP32; -extern GrB_UnaryOp GxB_SINH_FP64; -extern GrB_UnaryOp GxB_SIN_FC32; -extern GrB_UnaryOp GxB_SIN_FC64; -extern GrB_UnaryOp GxB_SIN_FP32; -extern GrB_UnaryOp GxB_SIN_FP64; -extern GrB_UnaryOp GxB_SQRT_FC32; -extern GrB_UnaryOp GxB_SQRT_FC64; -extern GrB_UnaryOp GxB_SQRT_FP32; -extern GrB_UnaryOp GxB_SQRT_FP64; -extern GrB_UnaryOp GxB_TANH_FC32; -extern GrB_UnaryOp GxB_TANH_FC64; -extern GrB_UnaryOp GxB_TANH_FP32; -extern GrB_UnaryOp GxB_TANH_FP64; -extern GrB_UnaryOp GxB_TAN_FC32; -extern GrB_UnaryOp GxB_TAN_FC64; -extern GrB_UnaryOp GxB_TAN_FP32; -extern GrB_UnaryOp GxB_TAN_FP64; -extern GrB_UnaryOp GxB_TGAMMA_FP32; -extern GrB_UnaryOp GxB_TGAMMA_FP64; -extern GrB_UnaryOp GxB_TRUNC_FC32; -extern GrB_UnaryOp GxB_TRUNC_FC64; -extern GrB_UnaryOp GxB_TRUNC_FP32; -extern GrB_UnaryOp GxB_TRUNC_FP64; - -/* GxB objects */ -extern GxB_SelectOp GxB_DIAG; -extern GxB_SelectOp GxB_EQ_THUNK; -extern GxB_SelectOp GxB_EQ_ZERO; -extern GxB_SelectOp GxB_GE_THUNK; -extern GxB_SelectOp GxB_GE_ZERO; -extern GxB_SelectOp GxB_GT_THUNK; -extern GxB_SelectOp GxB_GT_ZERO; -extern GxB_SelectOp GxB_LE_THUNK; -extern GxB_SelectOp GxB_LE_ZERO; -extern GxB_SelectOp GxB_LT_THUNK; -extern GxB_SelectOp GxB_LT_ZERO; -extern GxB_SelectOp GxB_NE_THUNK; -extern GxB_SelectOp GxB_NONZERO; -extern GxB_SelectOp GxB_OFFDIAG; -extern GxB_SelectOp GxB_TRIL; -extern GxB_SelectOp GxB_TRIU; - -/**************** -* GrB functions * -****************/ - -/* binary */ -GrB_Info GrB_BinaryOp_error(const char **error, const GrB_BinaryOp op); -GrB_Info GrB_BinaryOp_free(GrB_BinaryOp *binaryop); -GrB_Info GrB_BinaryOp_new(GrB_BinaryOp *binaryop, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype); -GrB_Info GrB_BinaryOp_wait(GrB_BinaryOp op, GrB_WaitMode waitmode); - -/* core */ -GrB_Info GrB_finalize(void); -GrB_Info GrB_getVersion(unsigned int *version, unsigned int *subversion); -GrB_Info GrB_init(GrB_Mode mode); - -/* descriptor */ -GrB_Info GrB_Descriptor_error(const char **error, const GrB_Descriptor d); -GrB_Info GrB_Descriptor_free(GrB_Descriptor *descriptor); -GrB_Info GrB_Descriptor_new(GrB_Descriptor *descriptor); -GrB_Info GrB_Descriptor_set(GrB_Descriptor desc, GrB_Desc_Field field, GrB_Desc_Value val); -GrB_Info GrB_Descriptor_wait(GrB_Descriptor desc, GrB_WaitMode waitmode); - -/* indexunary */ -GrB_Info GrB_IndexUnaryOp_error(const char **error, const GrB_IndexUnaryOp op); -GrB_Info GrB_IndexUnaryOp_free(GrB_IndexUnaryOp *op); -GrB_Info GrB_IndexUnaryOp_new(GrB_IndexUnaryOp *op, GxB_index_unary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype); -GrB_Info GrB_IndexUnaryOp_wait(GrB_IndexUnaryOp op, GrB_WaitMode waitmode); - -/* matrix */ -GrB_Info GrB_Col_assign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); -GrB_Info GrB_Col_extract(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_apply(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_UnaryOp op, const GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_apply_BinaryOp1st_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, bool x, const GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_apply_BinaryOp1st_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, float x, const GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_apply_BinaryOp1st_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, double x, const GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_apply_BinaryOp1st_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int8_t x, const GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_apply_BinaryOp1st_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int16_t x, const GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_apply_BinaryOp1st_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int32_t x, const GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_apply_BinaryOp1st_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int64_t x, const GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_apply_BinaryOp1st_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_apply_BinaryOp1st_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const void *x, const GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_apply_BinaryOp1st_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint8_t x, const GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_apply_BinaryOp1st_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint16_t x, const GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_apply_BinaryOp1st_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint32_t x, const GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_apply_BinaryOp1st_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint64_t x, const GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_apply_BinaryOp2nd_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, bool y, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_apply_BinaryOp2nd_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, float y, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_apply_BinaryOp2nd_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, double y, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, int8_t y, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, int16_t y, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, int32_t y, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_apply_BinaryOp2nd_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, int64_t y, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_apply_BinaryOp2nd_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Scalar y, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_apply_BinaryOp2nd_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const void *y, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, uint8_t y, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, uint16_t y, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, uint32_t y, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_apply_BinaryOp2nd_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, uint64_t y, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_apply_IndexOp_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, bool y, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_apply_IndexOp_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, float y, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_apply_IndexOp_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, double y, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_apply_IndexOp_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int8_t y, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_apply_IndexOp_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int16_t y, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_apply_IndexOp_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int32_t y, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_apply_IndexOp_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int64_t y, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_apply_IndexOp_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const GrB_Scalar y, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_apply_IndexOp_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const void *y, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_apply_IndexOp_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint8_t y, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_apply_IndexOp_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint16_t y, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_apply_IndexOp_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint32_t y, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_apply_IndexOp_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint64_t y, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, double x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_build_BOOL(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const bool *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_FP32(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const float *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_FP64(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const double *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_INT8(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const int8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_INT16(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const int16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_INT32(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const int32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_INT64(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const int64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_UDT(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const void *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_UINT8(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const uint8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_UINT16(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const uint16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_UINT32(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const uint32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_UINT64(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const uint64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_clear(GrB_Matrix A); -GrB_Info GrB_Matrix_deserialize(GrB_Matrix *C, GrB_Type type, const void *blob, GrB_Index blob_size); -GrB_Info GrB_Matrix_diag(GrB_Matrix *C, const GrB_Vector v, int64_t k); -GrB_Info GrB_Matrix_dup(GrB_Matrix *C, const GrB_Matrix A); -GrB_Info GrB_Matrix_eWiseAdd_BinaryOp(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_eWiseAdd_Monoid(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_eWiseAdd_Semiring(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_eWiseMult_BinaryOp(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp mult, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_eWiseMult_Monoid(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_eWiseMult_Semiring(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_error(const char **error, const GrB_Matrix A); -GrB_Info GrB_Matrix_exportHint(GrB_Format *format, GrB_Matrix A); -GrB_Info GrB_Matrix_exportSize(GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -GrB_Info GrB_Matrix_export_BOOL(GrB_Index *Ap, GrB_Index *Ai, bool *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -GrB_Info GrB_Matrix_export_FP32(GrB_Index *Ap, GrB_Index *Ai, float *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -GrB_Info GrB_Matrix_export_FP64(GrB_Index *Ap, GrB_Index *Ai, double *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -GrB_Info GrB_Matrix_export_INT8(GrB_Index *Ap, GrB_Index *Ai, int8_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -GrB_Info GrB_Matrix_export_INT16(GrB_Index *Ap, GrB_Index *Ai, int16_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -GrB_Info GrB_Matrix_export_INT32(GrB_Index *Ap, GrB_Index *Ai, int32_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -GrB_Info GrB_Matrix_export_INT64(GrB_Index *Ap, GrB_Index *Ai, int64_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -GrB_Info GrB_Matrix_export_UDT(GrB_Index *Ap, GrB_Index *Ai, void *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -GrB_Info GrB_Matrix_export_UINT8(GrB_Index *Ap, GrB_Index *Ai, uint8_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -GrB_Info GrB_Matrix_export_UINT16(GrB_Index *Ap, GrB_Index *Ai, uint16_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -GrB_Info GrB_Matrix_export_UINT32(GrB_Index *Ap, GrB_Index *Ai, uint32_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -GrB_Info GrB_Matrix_export_UINT64(GrB_Index *Ap, GrB_Index *Ai, uint64_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -GrB_Info GrB_Matrix_extract(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_extractElement_BOOL(bool *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -GrB_Info GrB_Matrix_extractElement_FP32(float *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -GrB_Info GrB_Matrix_extractElement_FP64(double *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -GrB_Info GrB_Matrix_extractElement_INT8(int8_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -GrB_Info GrB_Matrix_extractElement_INT16(int16_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -GrB_Info GrB_Matrix_extractElement_INT32(int32_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -GrB_Info GrB_Matrix_extractElement_INT64(int64_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -GrB_Info GrB_Matrix_extractElement_Scalar(GrB_Scalar x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -GrB_Info GrB_Matrix_extractElement_UDT(void *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -GrB_Info GrB_Matrix_extractElement_UINT8(uint8_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -GrB_Info GrB_Matrix_extractElement_UINT16(uint16_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -GrB_Info GrB_Matrix_extractElement_UINT32(uint32_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -GrB_Info GrB_Matrix_extractElement_UINT64(uint64_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -GrB_Info GrB_Matrix_extractTuples_BOOL(GrB_Index *I, GrB_Index *J, bool *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_FP32(GrB_Index *I, GrB_Index *J, float *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_FP64(GrB_Index *I, GrB_Index *J, double *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_INT8(GrB_Index *I, GrB_Index *J, int8_t *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_INT16(GrB_Index *I, GrB_Index *J, int16_t *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_INT32(GrB_Index *I, GrB_Index *J, int32_t *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_INT64(GrB_Index *I, GrB_Index *J, int64_t *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_UDT(GrB_Index *I, GrB_Index *J, void *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_UINT8(GrB_Index *I, GrB_Index *J, uint8_t *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_UINT16(GrB_Index *I, GrB_Index *J, uint16_t *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_UINT32(GrB_Index *I, GrB_Index *J, uint32_t *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_UINT64(GrB_Index *I, GrB_Index *J, uint64_t *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_free(GrB_Matrix *A); -GrB_Info GrB_Matrix_import_BOOL(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const bool *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -GrB_Info GrB_Matrix_import_FP32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const float *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -GrB_Info GrB_Matrix_import_FP64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const double *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -GrB_Info GrB_Matrix_import_INT8(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int8_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -GrB_Info GrB_Matrix_import_INT16(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int16_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -GrB_Info GrB_Matrix_import_INT32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int32_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -GrB_Info GrB_Matrix_import_INT64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int64_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -GrB_Info GrB_Matrix_import_UDT(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const void *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -GrB_Info GrB_Matrix_import_UINT8(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint8_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -GrB_Info GrB_Matrix_import_UINT16(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint16_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -GrB_Info GrB_Matrix_import_UINT32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint32_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -GrB_Info GrB_Matrix_import_UINT64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint64_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -GrB_Info GrB_Matrix_kronecker_BinaryOp(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_kronecker_Monoid(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_kronecker_Semiring(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_ncols(GrB_Index *ncols, const GrB_Matrix A); -GrB_Info GrB_Matrix_new(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols); -GrB_Info GrB_Matrix_nrows(GrB_Index *nrows, const GrB_Matrix A); -GrB_Info GrB_Matrix_nvals(GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_reduce_BOOL(bool *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_reduce_BinaryOp(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_reduce_BinaryOp_Scalar(GrB_Scalar S, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_reduce_FP32(float *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_reduce_FP64(double *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_reduce_INT8(int8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_reduce_INT16(int16_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_reduce_INT32(int32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_reduce_INT64(int64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_reduce_Monoid(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_reduce_Monoid_Scalar(GrB_Scalar c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_reduce_UDT(void *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_reduce_UINT8(uint8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_reduce_UINT16(uint16_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_reduce_UINT32(uint32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_reduce_UINT64(uint64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_removeElement(GrB_Matrix C, GrB_Index i, GrB_Index j); -GrB_Info GrB_Matrix_resize(GrB_Matrix C, GrB_Index nrows_new, GrB_Index ncols_new); -GrB_Info GrB_Matrix_select_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, bool y, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_select_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, float y, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_select_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, double y, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_select_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int8_t y, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_select_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int16_t y, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_select_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int32_t y, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_select_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, int64_t y, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_select_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const GrB_Scalar y, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_select_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, const void *y, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_select_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint8_t y, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_select_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint16_t y, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_select_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint32_t y, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_select_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint64_t y, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_serialize(void *blob, GrB_Index *blob_size_handle, GrB_Matrix A); -GrB_Info GrB_Matrix_serializeSize(GrB_Index *blob_size_handle, GrB_Matrix A); -GrB_Info GrB_Matrix_setElement_BOOL(GrB_Matrix C, bool x, GrB_Index i, GrB_Index j); -GrB_Info GrB_Matrix_setElement_FP32(GrB_Matrix C, float x, GrB_Index i, GrB_Index j); -GrB_Info GrB_Matrix_setElement_FP64(GrB_Matrix C, double x, GrB_Index i, GrB_Index j); -GrB_Info GrB_Matrix_setElement_INT8(GrB_Matrix C, int8_t x, GrB_Index i, GrB_Index j); -GrB_Info GrB_Matrix_setElement_INT16(GrB_Matrix C, int16_t x, GrB_Index i, GrB_Index j); -GrB_Info GrB_Matrix_setElement_INT32(GrB_Matrix C, int32_t x, GrB_Index i, GrB_Index j); -GrB_Info GrB_Matrix_setElement_INT64(GrB_Matrix C, int64_t x, GrB_Index i, GrB_Index j); -GrB_Info GrB_Matrix_setElement_Scalar(GrB_Matrix C, GrB_Scalar x, GrB_Index i, GrB_Index j); -GrB_Info GrB_Matrix_setElement_UDT(GrB_Matrix C, void *x, GrB_Index i, GrB_Index j); -GrB_Info GrB_Matrix_setElement_UINT8(GrB_Matrix C, uint8_t x, GrB_Index i, GrB_Index j); -GrB_Info GrB_Matrix_setElement_UINT16(GrB_Matrix C, uint16_t x, GrB_Index i, GrB_Index j); -GrB_Info GrB_Matrix_setElement_UINT32(GrB_Matrix C, uint32_t x, GrB_Index i, GrB_Index j); -GrB_Info GrB_Matrix_setElement_UINT64(GrB_Matrix C, uint64_t x, GrB_Index i, GrB_Index j); -GrB_Info GrB_Matrix_wait(GrB_Matrix A, GrB_WaitMode waitmode); -GrB_Info GrB_Row_assign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, GrB_Index i, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_mxm(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); -GrB_Info GrB_mxv(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Vector u, const GrB_Descriptor desc); -GrB_Info GrB_transpose(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GrB_vxm(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Vector u, const GrB_Matrix A, const GrB_Descriptor desc); - -/* monoid */ -GrB_Info GrB_Monoid_error(const char **error, const GrB_Monoid monoid); -GrB_Info GrB_Monoid_free(GrB_Monoid *monoid); -GrB_Info GrB_Monoid_new_BOOL(GrB_Monoid *monoid, GrB_BinaryOp op, bool identity); -GrB_Info GrB_Monoid_new_FP32(GrB_Monoid *monoid, GrB_BinaryOp op, float identity); -GrB_Info GrB_Monoid_new_FP64(GrB_Monoid *monoid, GrB_BinaryOp op, double identity); -GrB_Info GrB_Monoid_new_INT8(GrB_Monoid *monoid, GrB_BinaryOp op, int8_t identity); -GrB_Info GrB_Monoid_new_INT16(GrB_Monoid *monoid, GrB_BinaryOp op, int16_t identity); -GrB_Info GrB_Monoid_new_INT32(GrB_Monoid *monoid, GrB_BinaryOp op, int32_t identity); -GrB_Info GrB_Monoid_new_INT64(GrB_Monoid *monoid, GrB_BinaryOp op, int64_t identity); -GrB_Info GrB_Monoid_new_UDT(GrB_Monoid *monoid, GrB_BinaryOp op, void *identity); -GrB_Info GrB_Monoid_new_UINT8(GrB_Monoid *monoid, GrB_BinaryOp op, uint8_t identity); -GrB_Info GrB_Monoid_new_UINT16(GrB_Monoid *monoid, GrB_BinaryOp op, uint16_t identity); -GrB_Info GrB_Monoid_new_UINT32(GrB_Monoid *monoid, GrB_BinaryOp op, uint32_t identity); -GrB_Info GrB_Monoid_new_UINT64(GrB_Monoid *monoid, GrB_BinaryOp op, uint64_t identity); -GrB_Info GrB_Monoid_wait(GrB_Monoid monoid, GrB_WaitMode waitmode); - -/* scalar */ -GrB_Info GrB_Scalar_clear(GrB_Scalar s); -GrB_Info GrB_Scalar_dup(GrB_Scalar *s, const GrB_Scalar t); -GrB_Info GrB_Scalar_error(const char **error, const GrB_Scalar s); -GrB_Info GrB_Scalar_extractElement_BOOL(bool *x, const GrB_Scalar s); -GrB_Info GrB_Scalar_extractElement_FP32(float *x, const GrB_Scalar s); -GrB_Info GrB_Scalar_extractElement_FP64(double *x, const GrB_Scalar s); -GrB_Info GrB_Scalar_extractElement_INT8(int8_t *x, const GrB_Scalar s); -GrB_Info GrB_Scalar_extractElement_INT16(int16_t *x, const GrB_Scalar s); -GrB_Info GrB_Scalar_extractElement_INT32(int32_t *x, const GrB_Scalar s); -GrB_Info GrB_Scalar_extractElement_INT64(int64_t *x, const GrB_Scalar s); -GrB_Info GrB_Scalar_extractElement_UDT(void *x, const GrB_Scalar s); -GrB_Info GrB_Scalar_extractElement_UINT8(uint8_t *x, const GrB_Scalar s); -GrB_Info GrB_Scalar_extractElement_UINT16(uint16_t *x, const GrB_Scalar s); -GrB_Info GrB_Scalar_extractElement_UINT32(uint32_t *x, const GrB_Scalar s); -GrB_Info GrB_Scalar_extractElement_UINT64(uint64_t *x, const GrB_Scalar s); -GrB_Info GrB_Scalar_free(GrB_Scalar *s); -GrB_Info GrB_Scalar_new(GrB_Scalar *s, GrB_Type type); -GrB_Info GrB_Scalar_nvals(GrB_Index *nvals, const GrB_Scalar s); -GrB_Info GrB_Scalar_setElement_BOOL(GrB_Scalar s, bool x); -GrB_Info GrB_Scalar_setElement_FP32(GrB_Scalar s, float x); -GrB_Info GrB_Scalar_setElement_FP64(GrB_Scalar s, double x); -GrB_Info GrB_Scalar_setElement_INT8(GrB_Scalar s, int8_t x); -GrB_Info GrB_Scalar_setElement_INT16(GrB_Scalar s, int16_t x); -GrB_Info GrB_Scalar_setElement_INT32(GrB_Scalar s, int32_t x); -GrB_Info GrB_Scalar_setElement_INT64(GrB_Scalar s, int64_t x); -GrB_Info GrB_Scalar_setElement_UDT(GrB_Scalar s, void *x); -GrB_Info GrB_Scalar_setElement_UINT8(GrB_Scalar s, uint8_t x); -GrB_Info GrB_Scalar_setElement_UINT16(GrB_Scalar s, uint16_t x); -GrB_Info GrB_Scalar_setElement_UINT32(GrB_Scalar s, uint32_t x); -GrB_Info GrB_Scalar_setElement_UINT64(GrB_Scalar s, uint64_t x); -GrB_Info GrB_Scalar_wait(GrB_Scalar s, GrB_WaitMode waitmode); - -/* semiring */ -GrB_Info GrB_Semiring_error(const char **error, const GrB_Semiring semiring); -GrB_Info GrB_Semiring_free(GrB_Semiring *semiring); -GrB_Info GrB_Semiring_new(GrB_Semiring *semiring, GrB_Monoid add, GrB_BinaryOp multiply); -GrB_Info GrB_Semiring_wait(GrB_Semiring semiring, GrB_WaitMode waitmode); - -/* type */ -GrB_Info GrB_Type_error(const char **error, const GrB_Type type); -GrB_Info GrB_Type_free(GrB_Type *type); -GrB_Info GrB_Type_new(GrB_Type *type, size_t sizeof_ctype); -GrB_Info GrB_Type_wait(GrB_Type type, GrB_WaitMode waitmode); - -/* unary */ -GrB_Info GrB_UnaryOp_error(const char **error, const GrB_UnaryOp op); -GrB_Info GrB_UnaryOp_free(GrB_UnaryOp *unaryop); -GrB_Info GrB_UnaryOp_new(GrB_UnaryOp *unaryop, GxB_unary_function function, GrB_Type ztype, GrB_Type xtype); -GrB_Info GrB_UnaryOp_wait(GrB_UnaryOp op, GrB_WaitMode waitmode); - -/* vector */ -GrB_Info GrB_Vector_apply(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_UnaryOp op, const GrB_Vector u, const GrB_Descriptor desc); -GrB_Info GrB_Vector_apply_BinaryOp1st_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, bool x, const GrB_Vector u, const GrB_Descriptor desc); -GrB_Info GrB_Vector_apply_BinaryOp1st_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, float x, const GrB_Vector u, const GrB_Descriptor desc); -GrB_Info GrB_Vector_apply_BinaryOp1st_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, double x, const GrB_Vector u, const GrB_Descriptor desc); -GrB_Info GrB_Vector_apply_BinaryOp1st_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int8_t x, const GrB_Vector u, const GrB_Descriptor desc); -GrB_Info GrB_Vector_apply_BinaryOp1st_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int16_t x, const GrB_Vector u, const GrB_Descriptor desc); -GrB_Info GrB_Vector_apply_BinaryOp1st_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int32_t x, const GrB_Vector u, const GrB_Descriptor desc); -GrB_Info GrB_Vector_apply_BinaryOp1st_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, int64_t x, const GrB_Vector u, const GrB_Descriptor desc); -GrB_Info GrB_Vector_apply_BinaryOp1st_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Vector u, const GrB_Descriptor desc); -GrB_Info GrB_Vector_apply_BinaryOp1st_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const void *x, const GrB_Vector u, const GrB_Descriptor desc); -GrB_Info GrB_Vector_apply_BinaryOp1st_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint8_t x, const GrB_Vector u, const GrB_Descriptor desc); -GrB_Info GrB_Vector_apply_BinaryOp1st_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint16_t x, const GrB_Vector u, const GrB_Descriptor desc); -GrB_Info GrB_Vector_apply_BinaryOp1st_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint32_t x, const GrB_Vector u, const GrB_Descriptor desc); -GrB_Info GrB_Vector_apply_BinaryOp1st_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, uint64_t x, const GrB_Vector u, const GrB_Descriptor desc); -GrB_Info GrB_Vector_apply_BinaryOp2nd_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, bool y, const GrB_Descriptor desc); -GrB_Info GrB_Vector_apply_BinaryOp2nd_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, float y, const GrB_Descriptor desc); -GrB_Info GrB_Vector_apply_BinaryOp2nd_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, double y, const GrB_Descriptor desc); -GrB_Info GrB_Vector_apply_BinaryOp2nd_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, int8_t y, const GrB_Descriptor desc); -GrB_Info GrB_Vector_apply_BinaryOp2nd_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, int16_t y, const GrB_Descriptor desc); -GrB_Info GrB_Vector_apply_BinaryOp2nd_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, int32_t y, const GrB_Descriptor desc); -GrB_Info GrB_Vector_apply_BinaryOp2nd_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, int64_t y, const GrB_Descriptor desc); -GrB_Info GrB_Vector_apply_BinaryOp2nd_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const GrB_Scalar y, const GrB_Descriptor desc); -GrB_Info GrB_Vector_apply_BinaryOp2nd_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const void *y, const GrB_Descriptor desc); -GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, uint8_t y, const GrB_Descriptor desc); -GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, uint16_t y, const GrB_Descriptor desc); -GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, uint32_t y, const GrB_Descriptor desc); -GrB_Info GrB_Vector_apply_BinaryOp2nd_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, uint64_t y, const GrB_Descriptor desc); -GrB_Info GrB_Vector_apply_IndexOp_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, bool y, const GrB_Descriptor desc); -GrB_Info GrB_Vector_apply_IndexOp_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, float y, const GrB_Descriptor desc); -GrB_Info GrB_Vector_apply_IndexOp_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, double y, const GrB_Descriptor desc); -GrB_Info GrB_Vector_apply_IndexOp_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int8_t y, const GrB_Descriptor desc); -GrB_Info GrB_Vector_apply_IndexOp_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int16_t y, const GrB_Descriptor desc); -GrB_Info GrB_Vector_apply_IndexOp_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int32_t y, const GrB_Descriptor desc); -GrB_Info GrB_Vector_apply_IndexOp_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int64_t y, const GrB_Descriptor desc); -GrB_Info GrB_Vector_apply_IndexOp_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const GrB_Scalar y, const GrB_Descriptor desc); -GrB_Info GrB_Vector_apply_IndexOp_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const void *y, const GrB_Descriptor desc); -GrB_Info GrB_Vector_apply_IndexOp_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint8_t y, const GrB_Descriptor desc); -GrB_Info GrB_Vector_apply_IndexOp_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint16_t y, const GrB_Descriptor desc); -GrB_Info GrB_Vector_apply_IndexOp_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint32_t y, const GrB_Descriptor desc); -GrB_Info GrB_Vector_apply_IndexOp_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint64_t y, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, double x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_build_BOOL(GrB_Vector w, const GrB_Index *I, const bool *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_FP32(GrB_Vector w, const GrB_Index *I, const float *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_FP64(GrB_Vector w, const GrB_Index *I, const double *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_INT8(GrB_Vector w, const GrB_Index *I, const int8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_INT16(GrB_Vector w, const GrB_Index *I, const int16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_INT32(GrB_Vector w, const GrB_Index *I, const int32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_INT64(GrB_Vector w, const GrB_Index *I, const int64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_UDT(GrB_Vector w, const GrB_Index *I, const void *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_UINT8(GrB_Vector w, const GrB_Index *I, const uint8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_UINT16(GrB_Vector w, const GrB_Index *I, const uint16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_UINT32(GrB_Vector w, const GrB_Index *I, const uint32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_UINT64(GrB_Vector w, const GrB_Index *I, const uint64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_clear(GrB_Vector v); -GrB_Info GrB_Vector_dup(GrB_Vector *w, const GrB_Vector u); -GrB_Info GrB_Vector_eWiseAdd_BinaryOp(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); -GrB_Info GrB_Vector_eWiseAdd_Monoid(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); -GrB_Info GrB_Vector_eWiseAdd_Semiring(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); -GrB_Info GrB_Vector_eWiseMult_BinaryOp(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp mult, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); -GrB_Info GrB_Vector_eWiseMult_Monoid(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); -GrB_Info GrB_Vector_eWiseMult_Semiring(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); -GrB_Info GrB_Vector_error(const char **error, const GrB_Vector v); -GrB_Info GrB_Vector_extract(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_extractElement_BOOL(bool *x, const GrB_Vector v, GrB_Index i); -GrB_Info GrB_Vector_extractElement_FP32(float *x, const GrB_Vector v, GrB_Index i); -GrB_Info GrB_Vector_extractElement_FP64(double *x, const GrB_Vector v, GrB_Index i); -GrB_Info GrB_Vector_extractElement_INT8(int8_t *x, const GrB_Vector v, GrB_Index i); -GrB_Info GrB_Vector_extractElement_INT16(int16_t *x, const GrB_Vector v, GrB_Index i); -GrB_Info GrB_Vector_extractElement_INT32(int32_t *x, const GrB_Vector v, GrB_Index i); -GrB_Info GrB_Vector_extractElement_INT64(int64_t *x, const GrB_Vector v, GrB_Index i); -GrB_Info GrB_Vector_extractElement_Scalar(GrB_Scalar x, const GrB_Vector v, GrB_Index i); -GrB_Info GrB_Vector_extractElement_UDT(void *x, const GrB_Vector v, GrB_Index i); -GrB_Info GrB_Vector_extractElement_UINT8(uint8_t *x, const GrB_Vector v, GrB_Index i); -GrB_Info GrB_Vector_extractElement_UINT16(uint16_t *x, const GrB_Vector v, GrB_Index i); -GrB_Info GrB_Vector_extractElement_UINT32(uint32_t *x, const GrB_Vector v, GrB_Index i); -GrB_Info GrB_Vector_extractElement_UINT64(uint64_t *x, const GrB_Vector v, GrB_Index i); -GrB_Info GrB_Vector_extractTuples_BOOL(GrB_Index *I, bool *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_FP32(GrB_Index *I, float *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_FP64(GrB_Index *I, double *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_INT8(GrB_Index *I, int8_t *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_INT16(GrB_Index *I, int16_t *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_INT32(GrB_Index *I, int32_t *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_INT64(GrB_Index *I, int64_t *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_UDT(GrB_Index *I, void *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_UINT8(GrB_Index *I, uint8_t *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_UINT16(GrB_Index *I, uint16_t *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_UINT32(GrB_Index *I, uint32_t *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_UINT64(GrB_Index *I, uint64_t *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_free(GrB_Vector *v); -GrB_Info GrB_Vector_new(GrB_Vector *v, GrB_Type type, GrB_Index n); -GrB_Info GrB_Vector_nvals(GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_reduce_BOOL(bool *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -GrB_Info GrB_Vector_reduce_BinaryOp_Scalar(GrB_Scalar c, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const GrB_Descriptor desc); -GrB_Info GrB_Vector_reduce_FP32(float *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -GrB_Info GrB_Vector_reduce_FP64(double *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -GrB_Info GrB_Vector_reduce_INT8(int8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -GrB_Info GrB_Vector_reduce_INT16(int16_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -GrB_Info GrB_Vector_reduce_INT32(int32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -GrB_Info GrB_Vector_reduce_INT64(int64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -GrB_Info GrB_Vector_reduce_Monoid_Scalar(GrB_Scalar c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -GrB_Info GrB_Vector_reduce_UDT(void *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -GrB_Info GrB_Vector_reduce_UINT8(uint8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -GrB_Info GrB_Vector_reduce_UINT16(uint16_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -GrB_Info GrB_Vector_reduce_UINT32(uint32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -GrB_Info GrB_Vector_reduce_UINT64(uint64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -GrB_Info GrB_Vector_removeElement(GrB_Vector v, GrB_Index i); -GrB_Info GrB_Vector_resize(GrB_Vector w, GrB_Index nrows_new); -GrB_Info GrB_Vector_select_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, bool y, const GrB_Descriptor desc); -GrB_Info GrB_Vector_select_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, float y, const GrB_Descriptor desc); -GrB_Info GrB_Vector_select_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, double y, const GrB_Descriptor desc); -GrB_Info GrB_Vector_select_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int8_t y, const GrB_Descriptor desc); -GrB_Info GrB_Vector_select_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int16_t y, const GrB_Descriptor desc); -GrB_Info GrB_Vector_select_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int32_t y, const GrB_Descriptor desc); -GrB_Info GrB_Vector_select_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, int64_t y, const GrB_Descriptor desc); -GrB_Info GrB_Vector_select_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const GrB_Scalar y, const GrB_Descriptor desc); -GrB_Info GrB_Vector_select_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, const void *y, const GrB_Descriptor desc); -GrB_Info GrB_Vector_select_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint8_t y, const GrB_Descriptor desc); -GrB_Info GrB_Vector_select_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint16_t y, const GrB_Descriptor desc); -GrB_Info GrB_Vector_select_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint32_t y, const GrB_Descriptor desc); -GrB_Info GrB_Vector_select_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint64_t y, const GrB_Descriptor desc); -GrB_Info GrB_Vector_setElement_BOOL(GrB_Vector w, bool x, GrB_Index i); -GrB_Info GrB_Vector_setElement_FP32(GrB_Vector w, float x, GrB_Index i); -GrB_Info GrB_Vector_setElement_FP64(GrB_Vector w, double x, GrB_Index i); -GrB_Info GrB_Vector_setElement_INT8(GrB_Vector w, int8_t x, GrB_Index i); -GrB_Info GrB_Vector_setElement_INT16(GrB_Vector w, int16_t x, GrB_Index i); -GrB_Info GrB_Vector_setElement_INT32(GrB_Vector w, int32_t x, GrB_Index i); -GrB_Info GrB_Vector_setElement_INT64(GrB_Vector w, int64_t x, GrB_Index i); -GrB_Info GrB_Vector_setElement_Scalar(GrB_Vector w, GrB_Scalar x, GrB_Index i); -GrB_Info GrB_Vector_setElement_UDT(GrB_Vector w, void *x, GrB_Index i); -GrB_Info GrB_Vector_setElement_UINT8(GrB_Vector w, uint8_t x, GrB_Index i); -GrB_Info GrB_Vector_setElement_UINT16(GrB_Vector w, uint16_t x, GrB_Index i); -GrB_Info GrB_Vector_setElement_UINT32(GrB_Vector w, uint32_t x, GrB_Index i); -GrB_Info GrB_Vector_setElement_UINT64(GrB_Vector w, uint64_t x, GrB_Index i); -GrB_Info GrB_Vector_size(GrB_Index *n, const GrB_Vector v); -GrB_Info GrB_Vector_wait(GrB_Vector v, GrB_WaitMode waitmode); - -/*************** -* GB functions * -***************/ - -/* binary */ -GrB_Info GB_BinaryOp_new(GrB_BinaryOp *binaryop, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *binop_name); - -/* iterator */ -GrB_Info GB_Iterator_rc_bitmap_next(GxB_Iterator iterator); -GrB_Info GB_Iterator_rc_seek(GxB_Iterator iterator, GrB_Index j, bool jth_vector); -GrB_Info GB_Vector_Iterator_bitmap_seek(GxB_Iterator iterator, GrB_Index unused); - -/* matrix */ -GrB_Info GB_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GxB_Format_Value format, GrB_Descriptor desc); - -/* selectop */ -GrB_Info GB_SelectOp_new(GxB_SelectOp *selectop, GxB_select_function function, GrB_Type xtype, GrB_Type ttype, const char *name); - -/* type */ -GrB_Info GB_Type_new(GrB_Type *type, size_t sizeof_ctype, const char *type_name); - -/* unary */ -GrB_Info GB_UnaryOp_new(GrB_UnaryOp *unaryop, GxB_unary_function function, GrB_Type ztype, GrB_Type xtype, const char *unop_name); - -/**************** -* GxB functions * -****************/ - -/* binary */ -GrB_Info GxB_BinaryOp_fprint(GrB_BinaryOp binaryop, const char *name, GxB_Print_Level pr, FILE *f); -GrB_Info GxB_BinaryOp_new(GrB_BinaryOp *op, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *binop_name, const char *binop_defn); -GrB_Info GxB_BinaryOp_xtype(GrB_Type *xtype, GrB_BinaryOp binaryop); -GrB_Info GxB_BinaryOp_xtype_name(char *type_name, const GrB_BinaryOp binaryop); -GrB_Info GxB_BinaryOp_ytype(GrB_Type *ytype, GrB_BinaryOp binaryop); -GrB_Info GxB_BinaryOp_ytype_name(char *type_name, const GrB_BinaryOp binaryop); -GrB_Info GxB_BinaryOp_ztype(GrB_Type *ztype, GrB_BinaryOp binaryop); -GrB_Info GxB_BinaryOp_ztype_name(char *type_name, const GrB_BinaryOp binaryop); - -/* core */ -GrB_Info GxB_Global_Option_get(GxB_Option_Field field, ...); -GrB_Info GxB_Global_Option_get_CHAR(GxB_Option_Field field, char **value); -GrB_Info GxB_Global_Option_get_FP64(GxB_Option_Field field, double *value); -GrB_Info GxB_Global_Option_get_FUNCTION(GxB_Option_Field field, void **value); -GrB_Info GxB_Global_Option_get_INT32(GxB_Option_Field field, int32_t *value); -GrB_Info GxB_Global_Option_get_INT64(GxB_Option_Field field, int64_t *value); -GrB_Info GxB_Global_Option_set(GxB_Option_Field field, ...); -GrB_Info GxB_Global_Option_set_FP64(GxB_Option_Field field, double value); -GrB_Info GxB_Global_Option_set_FP64_ARRAY(GxB_Option_Field field, double *value); -GrB_Info GxB_Global_Option_set_FUNCTION(GxB_Option_Field field, void *value); -GrB_Info GxB_Global_Option_set_INT32(GxB_Option_Field field, int32_t value); -GrB_Info GxB_Global_Option_set_INT64_ARRAY(GxB_Option_Field field, int64_t *value); -GrB_Info GxB_deserialize_type_name(char *type_name, const void *blob, GrB_Index blob_size); -GrB_Info GxB_init(GrB_Mode mode, void *(*user_malloc_function)(size_t), void *(*user_calloc_function)(size_t, size_t), void *(*user_realloc_function)(void *, size_t), void (*user_free_function)(void *)); - -/* descriptor */ -GrB_Info GxB_Desc_get(GrB_Descriptor desc, GrB_Desc_Field field, ...); -GrB_Info GxB_Desc_get_FP64(GrB_Descriptor desc, GrB_Desc_Field field, double *value); -GrB_Info GxB_Desc_get_INT32(GrB_Descriptor desc, GrB_Desc_Field field, int32_t *value); -GrB_Info GxB_Desc_set(GrB_Descriptor desc, GrB_Desc_Field field, ...); -GrB_Info GxB_Desc_set_FP64(GrB_Descriptor desc, GrB_Desc_Field field, double value); -GrB_Info GxB_Desc_set_INT32(GrB_Descriptor desc, GrB_Desc_Field field, int32_t value); -GrB_Info GxB_Descriptor_fprint(GrB_Descriptor descriptor, const char *name, GxB_Print_Level pr, FILE *f); -GrB_Info GxB_Descriptor_get(GrB_Desc_Value *val, GrB_Descriptor desc, GrB_Desc_Field field); - -/* indexunary */ -GrB_Info GxB_IndexUnaryOp_fprint(GrB_IndexUnaryOp op, const char *name, GxB_Print_Level pr, FILE *f); -GrB_Info GxB_IndexUnaryOp_new(GrB_IndexUnaryOp *op, GxB_index_unary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *idxop_name, const char *idxop_defn); -GrB_Info GxB_IndexUnaryOp_xtype_name(char *type_name, const GrB_IndexUnaryOp op); -GrB_Info GxB_IndexUnaryOp_ytype_name(char *type_name, const GrB_IndexUnaryOp op); -GrB_Info GxB_IndexUnaryOp_ztype_name(char *type_name, const GrB_IndexUnaryOp op); - -/* iterator */ -GrB_Index GxB_Matrix_Iterator_getp(GxB_Iterator iterator); -GrB_Index GxB_Matrix_Iterator_getpmax(GxB_Iterator iterator); -GrB_Index GxB_Vector_Iterator_getIndex(GxB_Iterator iterator); -GrB_Index GxB_Vector_Iterator_getp(GxB_Iterator iterator); -GrB_Index GxB_Vector_Iterator_getpmax(GxB_Iterator iterator); -GrB_Index GxB_colIterator_getColIndex(GxB_Iterator iterator); -GrB_Index GxB_colIterator_getRowIndex(GxB_Iterator iterator); -GrB_Index GxB_colIterator_kount(GxB_Iterator iterator); -GrB_Index GxB_rowIterator_getColIndex(GxB_Iterator iterator); -GrB_Index GxB_rowIterator_getRowIndex(GxB_Iterator iterator); -GrB_Index GxB_rowIterator_kount(GxB_Iterator iterator); -GrB_Info GxB_Iterator_free(GxB_Iterator *iterator); -GrB_Info GxB_Iterator_new(GxB_Iterator *iterator); -GrB_Info GxB_Matrix_Iterator_next(GxB_Iterator iterator); -GrB_Info GxB_Matrix_Iterator_seek(GxB_Iterator iterator, GrB_Index p); -GrB_Info GxB_Vector_Iterator_next(GxB_Iterator iterator); -GrB_Info GxB_Vector_Iterator_seek(GxB_Iterator iterator, GrB_Index p); -GrB_Info GxB_colIterator_kseek(GxB_Iterator iterator, GrB_Index k); -GrB_Info GxB_colIterator_nextCol(GxB_Iterator iterator); -GrB_Info GxB_colIterator_nextRow(GxB_Iterator iterator); -GrB_Info GxB_colIterator_seekCol(GxB_Iterator iterator, GrB_Index col); -GrB_Info GxB_rowIterator_kseek(GxB_Iterator iterator, GrB_Index k); -GrB_Info GxB_rowIterator_nextCol(GxB_Iterator iterator); -GrB_Info GxB_rowIterator_nextRow(GxB_Iterator iterator); -GrB_Info GxB_rowIterator_seekRow(GxB_Iterator iterator, GrB_Index row); -GxB_FC32_t GxB_Iterator_get_FC32(GxB_Iterator iterator); -GxB_FC64_t GxB_Iterator_get_FC64(GxB_Iterator iterator); -bool GxB_Iterator_get_BOOL(GxB_Iterator iterator); -double GxB_Iterator_get_FP64(GxB_Iterator iterator); -float GxB_Iterator_get_FP32(GxB_Iterator iterator); -int8_t GxB_Iterator_get_INT8(GxB_Iterator iterator); -int16_t GxB_Iterator_get_INT16(GxB_Iterator iterator); -int32_t GxB_Iterator_get_INT32(GxB_Iterator iterator); -int64_t GxB_Iterator_get_INT64(GxB_Iterator iterator); -uint8_t GxB_Iterator_get_UINT8(GxB_Iterator iterator); -uint16_t GxB_Iterator_get_UINT16(GxB_Iterator iterator); -uint32_t GxB_Iterator_get_UINT32(GxB_Iterator iterator); -uint64_t GxB_Iterator_get_UINT64(GxB_Iterator iterator); -void GxB_Iterator_get_UDT(GxB_Iterator iterator, void *value); -void GxB_Matrix_Iterator_getIndex(GxB_Iterator iterator, GrB_Index *row, GrB_Index *col); - -/* matrix */ -GrB_Info GxB_Col_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); -GrB_Info GxB_Matrix_Option_get(GrB_Matrix A, GxB_Option_Field field, ...); -GrB_Info GxB_Matrix_Option_get_FP64(GrB_Matrix A, GxB_Option_Field field, double *value); -GrB_Info GxB_Matrix_Option_get_INT32(GrB_Matrix A, GxB_Option_Field field, int32_t *value); -GrB_Info GxB_Matrix_Option_set(GrB_Matrix A, GxB_Option_Field field, ...); -GrB_Info GxB_Matrix_Option_set_FP64(GrB_Matrix A, GxB_Option_Field field, double value); -GrB_Info GxB_Matrix_Option_set_INT32(GrB_Matrix A, GxB_Option_Field field, int32_t value); -GrB_Info GxB_Matrix_apply_BinaryOp1st(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_apply_BinaryOp1st_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC32_t x, const GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_apply_BinaryOp1st_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC64_t x, const GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_apply_BinaryOp2nd(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Scalar y, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_apply_BinaryOp2nd_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, GxB_FC32_t y, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_apply_BinaryOp2nd_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, GxB_FC64_t y, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_apply_IndexOp_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, GxB_FC32_t y, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_apply_IndexOp_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, GxB_FC64_t y, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_assign_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_assign_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_build_FC32(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const GxB_FC32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GxB_Matrix_build_FC64(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const GxB_FC64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GxB_Matrix_build_Scalar(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, GrB_Scalar scalar, GrB_Index nvals); -GrB_Info GxB_Matrix_concat(GrB_Matrix C, const GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_deserialize(GrB_Matrix *C, GrB_Type type, const void *blob, GrB_Index blob_size, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_diag(GrB_Matrix C, const GrB_Vector v, int64_t k, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_eWiseUnion(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Matrix A, const GrB_Scalar alpha, const GrB_Matrix B, const GrB_Scalar beta, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_export_BitmapC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_export_BitmapR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_export_CSC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_export_CSR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_export_FC32(GrB_Index *Ap, GrB_Index *Ai, GxB_FC32_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -GrB_Info GxB_Matrix_export_FC64(GrB_Index *Ap, GrB_Index *Ai, GxB_FC64_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -GrB_Info GxB_Matrix_export_FullC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_export_FullR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_export_HyperCSC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_export_HyperCSR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_extractElement_FC32(GxB_FC32_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -GrB_Info GxB_Matrix_extractElement_FC64(GxB_FC64_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -GrB_Info GxB_Matrix_extractTuples_FC32(GrB_Index *I, GrB_Index *J, GxB_FC32_t *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GxB_Matrix_extractTuples_FC64(GrB_Index *I, GrB_Index *J, GxB_FC64_t *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GxB_Matrix_fprint(GrB_Matrix A, const char *name, GxB_Print_Level pr, FILE *f); -GrB_Info GxB_Matrix_import_BitmapC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_import_BitmapR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_import_CSC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_import_CSR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_import_FC32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const GxB_FC32_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -GrB_Info GxB_Matrix_import_FC64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const GxB_FC64_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -GrB_Info GxB_Matrix_import_FullC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_import_FullR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_import_HyperCSC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_import_HyperCSR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_isStoredElement(const GrB_Matrix A, GrB_Index i, GrB_Index j); -GrB_Info GxB_Matrix_iso(bool *iso, const GrB_Matrix A); -GrB_Info GxB_Matrix_memoryUsage(size_t *size, const GrB_Matrix A); -GrB_Info GxB_Matrix_pack_BitmapC(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_pack_BitmapR(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_pack_CSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_pack_CSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_pack_FullC(GrB_Matrix A, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_pack_FullR(GrB_Matrix A, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_pack_HyperCSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_pack_HyperCSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_reduce_FC32(GxB_FC32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_reduce_FC64(GxB_FC64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_reshape(GrB_Matrix C, bool by_col, GrB_Index nrows_new, GrB_Index ncols_new, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_reshapeDup(GrB_Matrix *C, GrB_Matrix A, bool by_col, GrB_Index nrows_new, GrB_Index ncols_new, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_select(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Matrix A, const GrB_Scalar Thunk, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_select_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, GxB_FC32_t y, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_select_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, GxB_FC64_t y, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_serialize(void **blob_handle, GrB_Index *blob_size_handle, GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_setElement_FC32(GrB_Matrix C, GxB_FC32_t x, GrB_Index i, GrB_Index j); -GrB_Info GxB_Matrix_setElement_FC64(GrB_Matrix C, GxB_FC64_t x, GrB_Index i, GrB_Index j); -GrB_Info GxB_Matrix_sort(GrB_Matrix C, GrB_Matrix P, GrB_BinaryOp op, GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_split(GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Index *Tile_nrows, const GrB_Index *Tile_ncols, const GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, double x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_type(GrB_Type *type, const GrB_Matrix A); -GrB_Info GxB_Matrix_type_name(char *type_name, const GrB_Matrix A); -GrB_Info GxB_Matrix_unpack_BitmapC(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_unpack_BitmapR(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_unpack_CSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_unpack_CSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_unpack_FullC(GrB_Matrix A, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_unpack_FullR(GrB_Matrix A, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_unpack_HyperCSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_unpack_HyperCSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Row_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, GrB_Index i, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Vector_diag(GrB_Vector v, const GrB_Matrix A, int64_t k, const GrB_Descriptor desc); -GrB_Info GxB_colIterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); -GrB_Info GxB_pack_HyperHash(GrB_Matrix A, GrB_Matrix *Y, const GrB_Descriptor desc); -GrB_Info GxB_rowIterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); -GrB_Info GxB_unpack_HyperHash(GrB_Matrix A, GrB_Matrix *Y, const GrB_Descriptor desc); - -/* monoid */ -GrB_Info GxB_Monoid_fprint(GrB_Monoid monoid, const char *name, GxB_Print_Level pr, FILE *f); -GrB_Info GxB_Monoid_identity(void *identity, GrB_Monoid monoid); -GrB_Info GxB_Monoid_new_FC32(GrB_Monoid *monoid, GrB_BinaryOp op, GxB_FC32_t identity); -GrB_Info GxB_Monoid_new_FC64(GrB_Monoid *monoid, GrB_BinaryOp op, GxB_FC64_t identity); -GrB_Info GxB_Monoid_operator(GrB_BinaryOp *op, GrB_Monoid monoid); -GrB_Info GxB_Monoid_terminal(bool *has_terminal, void *terminal, GrB_Monoid monoid); -GrB_Info GxB_Monoid_terminal_new_BOOL(GrB_Monoid *monoid, GrB_BinaryOp op, bool identity, bool terminal); -GrB_Info GxB_Monoid_terminal_new_FC32(GrB_Monoid *monoid, GrB_BinaryOp op, GxB_FC32_t identity, GxB_FC32_t terminal); -GrB_Info GxB_Monoid_terminal_new_FC64(GrB_Monoid *monoid, GrB_BinaryOp op, GxB_FC64_t identity, GxB_FC64_t terminal); -GrB_Info GxB_Monoid_terminal_new_FP32(GrB_Monoid *monoid, GrB_BinaryOp op, float identity, float terminal); -GrB_Info GxB_Monoid_terminal_new_FP64(GrB_Monoid *monoid, GrB_BinaryOp op, double identity, double terminal); -GrB_Info GxB_Monoid_terminal_new_INT8(GrB_Monoid *monoid, GrB_BinaryOp op, int8_t identity, int8_t terminal); -GrB_Info GxB_Monoid_terminal_new_INT16(GrB_Monoid *monoid, GrB_BinaryOp op, int16_t identity, int16_t terminal); -GrB_Info GxB_Monoid_terminal_new_INT32(GrB_Monoid *monoid, GrB_BinaryOp op, int32_t identity, int32_t terminal); -GrB_Info GxB_Monoid_terminal_new_INT64(GrB_Monoid *monoid, GrB_BinaryOp op, int64_t identity, int64_t terminal); -GrB_Info GxB_Monoid_terminal_new_UDT(GrB_Monoid *monoid, GrB_BinaryOp op, void *identity, void *terminal); -GrB_Info GxB_Monoid_terminal_new_UINT8(GrB_Monoid *monoid, GrB_BinaryOp op, uint8_t identity, uint8_t terminal); -GrB_Info GxB_Monoid_terminal_new_UINT16(GrB_Monoid *monoid, GrB_BinaryOp op, uint16_t identity, uint16_t terminal); -GrB_Info GxB_Monoid_terminal_new_UINT32(GrB_Monoid *monoid, GrB_BinaryOp op, uint32_t identity, uint32_t terminal); -GrB_Info GxB_Monoid_terminal_new_UINT64(GrB_Monoid *monoid, GrB_BinaryOp op, uint64_t identity, uint64_t terminal); - -/* scalar */ -GrB_Info GxB_Scalar_clear(GrB_Scalar s); -GrB_Info GxB_Scalar_dup(GrB_Scalar *s, const GrB_Scalar t); -GrB_Info GxB_Scalar_error(const char **error, const GrB_Scalar s); -GrB_Info GxB_Scalar_extractElement_BOOL(bool *x, const GrB_Scalar s); -GrB_Info GxB_Scalar_extractElement_FC32(GxB_FC32_t *x, const GrB_Scalar s); -GrB_Info GxB_Scalar_extractElement_FC64(GxB_FC64_t *x, const GrB_Scalar s); -GrB_Info GxB_Scalar_extractElement_FP32(float *x, const GrB_Scalar s); -GrB_Info GxB_Scalar_extractElement_FP64(double *x, const GrB_Scalar s); -GrB_Info GxB_Scalar_extractElement_INT8(int8_t *x, const GrB_Scalar s); -GrB_Info GxB_Scalar_extractElement_INT16(int16_t *x, const GrB_Scalar s); -GrB_Info GxB_Scalar_extractElement_INT32(int32_t *x, const GrB_Scalar s); -GrB_Info GxB_Scalar_extractElement_INT64(int64_t *x, const GrB_Scalar s); -GrB_Info GxB_Scalar_extractElement_UDT(void *x, const GrB_Scalar s); -GrB_Info GxB_Scalar_extractElement_UINT8(uint8_t *x, const GrB_Scalar s); -GrB_Info GxB_Scalar_extractElement_UINT16(uint16_t *x, const GrB_Scalar s); -GrB_Info GxB_Scalar_extractElement_UINT32(uint32_t *x, const GrB_Scalar s); -GrB_Info GxB_Scalar_extractElement_UINT64(uint64_t *x, const GrB_Scalar s); -GrB_Info GxB_Scalar_fprint(GrB_Scalar s, const char *name, GxB_Print_Level pr, FILE *f); -GrB_Info GxB_Scalar_free(GrB_Scalar *s); -GrB_Info GxB_Scalar_memoryUsage(size_t *size, const GrB_Scalar s); -GrB_Info GxB_Scalar_new(GrB_Scalar *s, GrB_Type type); -GrB_Info GxB_Scalar_nvals(GrB_Index *nvals, const GrB_Scalar s); -GrB_Info GxB_Scalar_setElement_BOOL(GrB_Scalar s, bool x); -GrB_Info GxB_Scalar_setElement_FC32(GrB_Scalar s, GxB_FC32_t x); -GrB_Info GxB_Scalar_setElement_FC64(GrB_Scalar s, GxB_FC64_t x); -GrB_Info GxB_Scalar_setElement_FP32(GrB_Scalar s, float x); -GrB_Info GxB_Scalar_setElement_FP64(GrB_Scalar s, double x); -GrB_Info GxB_Scalar_setElement_INT8(GrB_Scalar s, int8_t x); -GrB_Info GxB_Scalar_setElement_INT16(GrB_Scalar s, int16_t x); -GrB_Info GxB_Scalar_setElement_INT32(GrB_Scalar s, int32_t x); -GrB_Info GxB_Scalar_setElement_INT64(GrB_Scalar s, int64_t x); -GrB_Info GxB_Scalar_setElement_UDT(GrB_Scalar s, void *x); -GrB_Info GxB_Scalar_setElement_UINT8(GrB_Scalar s, uint8_t x); -GrB_Info GxB_Scalar_setElement_UINT16(GrB_Scalar s, uint16_t x); -GrB_Info GxB_Scalar_setElement_UINT32(GrB_Scalar s, uint32_t x); -GrB_Info GxB_Scalar_setElement_UINT64(GrB_Scalar s, uint64_t x); -GrB_Info GxB_Scalar_type(GrB_Type *type, const GrB_Scalar s); -GrB_Info GxB_Scalar_type_name(char *type_name, const GrB_Scalar s); -GrB_Info GxB_Scalar_wait(GrB_Scalar *s); - -/* selectop */ -GrB_Info GxB_SelectOp_error(const char **error, const GxB_SelectOp op); -GrB_Info GxB_SelectOp_fprint(GxB_SelectOp selectop, const char *name, GxB_Print_Level pr, FILE *f); -GrB_Info GxB_SelectOp_free(GxB_SelectOp *selectop); -GrB_Info GxB_SelectOp_new(GxB_SelectOp *selectop, GxB_select_function function, GrB_Type xtype, GrB_Type ttype); -GrB_Info GxB_SelectOp_ttype(GrB_Type *ttype, GxB_SelectOp selectop); -GrB_Info GxB_SelectOp_wait(GxB_SelectOp op, GrB_WaitMode waitmode); -GrB_Info GxB_SelectOp_xtype(GrB_Type *xtype, GxB_SelectOp selectop); - -/* semiring */ -GrB_Info GxB_Semiring_add(GrB_Monoid *add, GrB_Semiring semiring); -GrB_Info GxB_Semiring_fprint(GrB_Semiring semiring, const char *name, GxB_Print_Level pr, FILE *f); -GrB_Info GxB_Semiring_multiply(GrB_BinaryOp *multiply, GrB_Semiring semiring); - -/* type */ -GrB_Info GxB_Type_fprint(GrB_Type type, const char *name, GxB_Print_Level pr, FILE *f); -GrB_Info GxB_Type_from_name(GrB_Type *type, const char *type_name); -GrB_Info GxB_Type_name(char *type_name, const GrB_Type type); -GrB_Info GxB_Type_new(GrB_Type *type, size_t sizeof_ctype, const char *type_name, const char *type_defn); -GrB_Info GxB_Type_size(size_t *size, const GrB_Type type); - -/* unary */ -GrB_Info GxB_UnaryOp_fprint(GrB_UnaryOp unaryop, const char *name, GxB_Print_Level pr, FILE *f); -GrB_Info GxB_UnaryOp_new(GrB_UnaryOp *unaryop, GxB_unary_function function, GrB_Type ztype, GrB_Type xtype, const char *unop_name, const char *unop_defn); -GrB_Info GxB_UnaryOp_xtype(GrB_Type *xtype, GrB_UnaryOp unaryop); -GrB_Info GxB_UnaryOp_xtype_name(char *type_name, const GrB_UnaryOp unaryop); -GrB_Info GxB_UnaryOp_ztype(GrB_Type *ztype, GrB_UnaryOp unaryop); -GrB_Info GxB_UnaryOp_ztype_name(char *type_name, const GrB_UnaryOp unaryop); - -/* vector */ -GrB_Info GxB_Vector_Iterator_attach(GxB_Iterator iterator, GrB_Vector v, GrB_Descriptor desc); -GrB_Info GxB_Vector_Option_get(GrB_Vector A, GxB_Option_Field field, ...); -GrB_Info GxB_Vector_Option_get_FP64(GrB_Vector v, GxB_Option_Field field, double *value); -GrB_Info GxB_Vector_Option_get_INT32(GrB_Vector v, GxB_Option_Field field, int32_t *value); -GrB_Info GxB_Vector_Option_set(GrB_Vector A, GxB_Option_Field field, ...); -GrB_Info GxB_Vector_Option_set_FP64(GrB_Vector v, GxB_Option_Field field, double value); -GrB_Info GxB_Vector_Option_set_INT32(GrB_Vector v, GxB_Option_Field field, int32_t value); -GrB_Info GxB_Vector_apply_BinaryOp1st(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Vector u, const GrB_Descriptor desc); -GrB_Info GxB_Vector_apply_BinaryOp1st_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC32_t x, const GrB_Vector u, const GrB_Descriptor desc); -GrB_Info GxB_Vector_apply_BinaryOp1st_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC64_t x, const GrB_Vector u, const GrB_Descriptor desc); -GrB_Info GxB_Vector_apply_BinaryOp2nd(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const GrB_Scalar y, const GrB_Descriptor desc); -GrB_Info GxB_Vector_apply_BinaryOp2nd_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, GxB_FC32_t y, const GrB_Descriptor desc); -GrB_Info GxB_Vector_apply_BinaryOp2nd_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, GxB_FC64_t y, const GrB_Descriptor desc); -GrB_Info GxB_Vector_apply_IndexOp_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, GxB_FC32_t y, const GrB_Descriptor desc); -GrB_Info GxB_Vector_apply_IndexOp_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, GxB_FC64_t y, const GrB_Descriptor desc); -GrB_Info GxB_Vector_assign_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GxB_FC32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_assign_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_build_FC32(GrB_Vector w, const GrB_Index *I, const GxB_FC32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GxB_Vector_build_FC64(GrB_Vector w, const GrB_Index *I, const GxB_FC64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GxB_Vector_build_Scalar(GrB_Vector w, const GrB_Index *I, GrB_Scalar scalar, GrB_Index nvals); -GrB_Info GxB_Vector_deserialize(GrB_Vector *w, GrB_Type type, const void *blob, GrB_Index blob_size, const GrB_Descriptor desc); -GrB_Info GxB_Vector_eWiseUnion(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Vector u, const GrB_Scalar alpha, const GrB_Vector v, const GrB_Scalar beta, const GrB_Descriptor desc); -GrB_Info GxB_Vector_export_Bitmap(GrB_Vector *v, GrB_Type *type, GrB_Index *n, int8_t **vb, void **vx, GrB_Index *vb_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); -GrB_Info GxB_Vector_export_CSC(GrB_Vector *v, GrB_Type *type, GrB_Index *n, GrB_Index **vi, void **vx, GrB_Index *vi_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, bool *jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Vector_export_Full(GrB_Vector *v, GrB_Type *type, GrB_Index *n, void **vx, GrB_Index *vx_size, bool *iso, const GrB_Descriptor desc); -GrB_Info GxB_Vector_extractElement_FC32(GxB_FC32_t *x, const GrB_Vector v, GrB_Index i); -GrB_Info GxB_Vector_extractElement_FC64(GxB_FC64_t *x, const GrB_Vector v, GrB_Index i); -GrB_Info GxB_Vector_extractTuples_FC32(GrB_Index *I, GxB_FC32_t *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GxB_Vector_extractTuples_FC64(GrB_Index *I, GxB_FC64_t *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GxB_Vector_fprint(GrB_Vector v, const char *name, GxB_Print_Level pr, FILE *f); -GrB_Info GxB_Vector_import_Bitmap(GrB_Vector *v, GrB_Type type, GrB_Index n, int8_t **vb, void **vx, GrB_Index vb_size, GrB_Index vx_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); -GrB_Info GxB_Vector_import_CSC(GrB_Vector *v, GrB_Type type, GrB_Index n, GrB_Index **vi, void **vx, GrB_Index vi_size, GrB_Index vx_size, bool iso, GrB_Index nvals, bool jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Vector_import_Full(GrB_Vector *v, GrB_Type type, GrB_Index n, void **vx, GrB_Index vx_size, bool iso, const GrB_Descriptor desc); -GrB_Info GxB_Vector_isStoredElement(const GrB_Vector v, GrB_Index i); -GrB_Info GxB_Vector_iso(bool *iso, const GrB_Vector v); -GrB_Info GxB_Vector_memoryUsage(size_t *size, const GrB_Vector v); -GrB_Info GxB_Vector_pack_Bitmap(GrB_Vector v, int8_t **vb, void **vx, GrB_Index vb_size, GrB_Index vx_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); -GrB_Info GxB_Vector_pack_CSC(GrB_Vector v, GrB_Index **vi, void **vx, GrB_Index vi_size, GrB_Index vx_size, bool iso, GrB_Index nvals, bool jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Vector_pack_Full(GrB_Vector v, void **vx, GrB_Index vx_size, bool iso, const GrB_Descriptor desc); -GrB_Info GxB_Vector_reduce_FC32(GxB_FC32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -GrB_Info GxB_Vector_reduce_FC64(GxB_FC64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -GrB_Info GxB_Vector_select(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Vector u, const GrB_Scalar Thunk, const GrB_Descriptor desc); -GrB_Info GxB_Vector_select_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, GxB_FC32_t y, const GrB_Descriptor desc); -GrB_Info GxB_Vector_select_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, GxB_FC64_t y, const GrB_Descriptor desc); -GrB_Info GxB_Vector_serialize(void **blob_handle, GrB_Index *blob_size_handle, GrB_Vector u, const GrB_Descriptor desc); -GrB_Info GxB_Vector_setElement_FC32(GrB_Vector w, GxB_FC32_t x, GrB_Index i); -GrB_Info GxB_Vector_setElement_FC64(GrB_Vector w, GxB_FC64_t x, GrB_Index i); -GrB_Info GxB_Vector_sort(GrB_Vector w, GrB_Vector p, GrB_BinaryOp op, GrB_Vector u, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GxB_FC32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, double x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_type(GrB_Type *type, const GrB_Vector v); -GrB_Info GxB_Vector_type_name(char *type_name, const GrB_Vector v); -GrB_Info GxB_Vector_unpack_Bitmap(GrB_Vector v, int8_t **vb, void **vx, GrB_Index *vb_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); -GrB_Info GxB_Vector_unpack_CSC(GrB_Vector v, GrB_Index **vi, void **vx, GrB_Index *vi_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, bool *jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Vector_unpack_Full(GrB_Vector v, void **vx, GrB_Index *vx_size, bool *iso, const GrB_Descriptor desc); - -/* int DEFINES */ -#define GRB_SUBVERSION ... -#define GRB_VERSION ... -#define GrB_INDEX_MAX ... -#define GxB_ANY_SPARSITY ... -#define GxB_AUTO_SPARSITY ... -#define GxB_BACKWARDS ... -#define GxB_BEGIN ... -#define GxB_BITMAP ... -#define GxB_CHUNK ... -#define GxB_COMPRESSION_DEFAULT ... -#define GxB_COMPRESSION_INTEL ... -#define GxB_COMPRESSION_LZ4 ... -#define GxB_COMPRESSION_LZ4HC ... -#define GxB_COMPRESSION_NONE ... -#define GxB_COMPRESSION_ZSTD ... -#define GxB_END ... -#define GxB_FAST_IMPORT ... -#define GxB_FULL ... -#define GxB_GPU_CHUNK ... -#define GxB_GPU_CONTROL ... -#define GxB_HYPERSPARSE ... -#define GxB_IMPLEMENTATION ... -#define GxB_IMPLEMENTATION_MAJOR ... -#define GxB_IMPLEMENTATION_MINOR ... -#define GxB_IMPLEMENTATION_SUB ... -#define GxB_INC ... -#define GxB_INDEX_MAX ... -#define GxB_MAX_NAME_LEN ... -#define GxB_NBITMAP_SWITCH ... -#define GxB_NTHREADS ... -#define GxB_RANGE ... -#define GxB_SPARSE ... -#define GxB_SPEC_MAJOR ... -#define GxB_SPEC_MINOR ... -#define GxB_SPEC_SUB ... -#define GxB_SPEC_VERSION ... -#define GxB_STDC_VERSION ... -#define GxB_STRIDE ... - -/* char* DEFINES */ -extern char *GxB_IMPLEMENTATION_ABOUT_STR; -extern char *GxB_IMPLEMENTATION_DATE_STR; -extern char *GxB_IMPLEMENTATION_LICENSE_STR; -extern char *GxB_IMPLEMENTATION_NAME_STR; -extern char *GxB_SPEC_ABOUT_STR; -extern char *GxB_SPEC_DATE_STR; diff --git a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h index 0ce6e93..7d1ff46 100644 --- a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h +++ b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h @@ -13,12 +13,12 @@ typedef struct GB_Vector_opaque *GrB_Vector; typedef uint64_t GrB_Index; /* GxB typedefs */ +typedef struct GB_Context_opaque *GxB_Context; typedef struct GB_Iterator_opaque *GxB_Iterator; typedef struct GB_Scalar_opaque *GxB_Scalar; typedef struct GB_SelectOp_opaque *GxB_SelectOp; /* GxB typedefs (functions) */ -typedef bool (*GxB_select_function)(GrB_Index i, GrB_Index j, const void *x, const void *thunk); typedef void (*GxB_binary_function)(void *, const void *, const void *); typedef void (*GxB_index_unary_function)(void *z, const void *x, GrB_Index i, GrB_Index j, const void *y); typedef void (*GxB_unary_function)(void *, const void *); @@ -30,14 +30,10 @@ typedef enum GrB_MASK = 1, GrB_INP0 = 2, GrB_INP1 = 3, - GxB_DESCRIPTOR_NTHREADS = 5, - GxB_DESCRIPTOR_CHUNK = 7, - GxB_DESCRIPTOR_GPU_CONTROL = 21, - GxB_DESCRIPTOR_GPU_CHUNK = 22, - GxB_AxB_METHOD = 1000, - GxB_SORT = 35, - GxB_COMPRESSION = 36, - GxB_IMPORT = 37 + GxB_AxB_METHOD = 7090, + GxB_SORT = 7091, + GxB_COMPRESSION = 7092, + GxB_IMPORT = 7093 } GrB_Desc_Field; typedef enum @@ -47,13 +43,11 @@ typedef enum GrB_COMP = 2, GrB_STRUCTURE = 4, GrB_TRAN = 3, - GxB_GPU_ALWAYS = 2001, - GxB_GPU_NEVER = 2002, - GxB_AxB_GUSTAVSON = 1001, - GxB_AxB_DOT = 1003, - GxB_AxB_HASH = 1004, - GxB_AxB_SAXPY = 1005, - GxB_SECURE_IMPORT = 502 + GxB_AxB_GUSTAVSON = 7081, + GxB_AxB_DOT = 7083, + GxB_AxB_HASH = 7084, + GxB_AxB_SAXPY = 7085, + GxB_SECURE_IMPORT = 7080 } GrB_Desc_Value; typedef enum @@ -67,7 +61,7 @@ typedef enum { GrB_SUCCESS = 0, GrB_NO_VALUE = 1, - GxB_EXHAUSTED = 2, + GxB_EXHAUSTED = 7089, GrB_UNINITIALIZED_OBJECT = -1, GrB_NULL_POINTER = -2, GrB_INVALID_VALUE = -3, @@ -88,8 +82,8 @@ typedef enum { GrB_NONBLOCKING = 0, GrB_BLOCKING = 1, - GxB_NONBLOCKING_GPU = 2, - GxB_BLOCKING_GPU = 3 + GxB_NONBLOCKING_GPU = 7099, + GxB_BLOCKING_GPU = 7098 } GrB_Mode; typedef enum @@ -99,6 +93,13 @@ typedef enum } GrB_WaitMode; /* GxB enums */ +typedef enum +{ + GxB_CONTEXT_NTHREADS = 7086, + GxB_CONTEXT_CHUNK = 7087, + GxB_CONTEXT_GPU_ID = 7088 +} GxB_Context_Field; + typedef enum { GxB_BY_ROW = 0, @@ -108,36 +109,58 @@ typedef enum typedef enum { - GxB_HYPER_SWITCH = 0, - GxB_BITMAP_SWITCH = 34, - GxB_FORMAT = 1, - GxB_MODE = 2, - GxB_LIBRARY_NAME = 8, - GxB_LIBRARY_VERSION = 9, - GxB_LIBRARY_DATE = 10, - GxB_LIBRARY_ABOUT = 11, - GxB_LIBRARY_URL = 12, - GxB_LIBRARY_LICENSE = 13, - GxB_LIBRARY_COMPILE_DATE = 14, - GxB_LIBRARY_COMPILE_TIME = 15, - GxB_API_VERSION = 16, - GxB_API_DATE = 17, - GxB_API_ABOUT = 18, - GxB_API_URL = 19, - GxB_COMPILER_VERSION = 23, - GxB_COMPILER_NAME = 24, - GxB_LIBRARY_OPENMP = 25, - GxB_GLOBAL_NTHREADS = 5, - GxB_GLOBAL_CHUNK = 7, - GxB_BURBLE = 99, - GxB_PRINTF = 101, - GxB_FLUSH = 102, - GxB_MEMORY_POOL = 103, - GxB_PRINT_1BASED = 104, - GxB_SPARSITY_STATUS = 33, - GxB_SPARSITY_CONTROL = 32, - GxB_GLOBAL_GPU_CONTROL = 21, - GxB_GLOBAL_GPU_CHUNK = 22 + GxB_JIT_OFF = 0, + GxB_JIT_PAUSE = 1, + GxB_JIT_RUN = 2, + GxB_JIT_LOAD = 3, + GxB_JIT_ON = 4 +} GxB_JIT_Control; + +typedef enum +{ + GxB_HYPER_SWITCH = 7000, + GxB_BITMAP_SWITCH = 7001, + GxB_FORMAT = 7002, + GxB_MODE = 7003, + GxB_LIBRARY_NAME = 7004, + GxB_LIBRARY_VERSION = 7005, + GxB_LIBRARY_DATE = 7006, + GxB_LIBRARY_ABOUT = 7007, + GxB_LIBRARY_URL = 7008, + GxB_LIBRARY_LICENSE = 7009, + GxB_LIBRARY_COMPILE_DATE = 7010, + GxB_LIBRARY_COMPILE_TIME = 7011, + GxB_API_VERSION = 7012, + GxB_API_DATE = 7013, + GxB_API_ABOUT = 7014, + GxB_API_URL = 7015, + GxB_COMPILER_VERSION = 7016, + GxB_COMPILER_NAME = 7017, + GxB_LIBRARY_OPENMP = 7018, + GxB_GLOBAL_NTHREADS = 7086, + GxB_GLOBAL_CHUNK = 7087, + GxB_GLOBAL_GPU_ID = 7088, + GxB_BURBLE = 7019, + GxB_PRINTF = 7020, + GxB_FLUSH = 7021, + GxB_MEMORY_POOL = 7022, + GxB_PRINT_1BASED = 7023, + GxB_JIT_C_COMPILER_NAME = 7024, + GxB_JIT_C_COMPILER_FLAGS = 7025, + GxB_JIT_C_LINKER_FLAGS = 7026, + GxB_JIT_C_LIBRARIES = 7027, + GxB_JIT_C_PREFACE = 7028, + GxB_JIT_C_CONTROL = 7029, + GxB_JIT_CACHE_PATH = 7030, + GxB_JIT_C_CMAKE_LIBS = 7031, + GxB_JIT_USE_CMAKE = 7032, + GxB_JIT_ERROR_LOG = 7033, + GxB_SPARSITY_STATUS = 7034, + GxB_SPARSITY_CONTROL = 7036, + GxB_MALLOC_FUNCTION = 7037, + GxB_CALLOC_FUNCTION = 7038, + GxB_REALLOC_FUNCTION = 7039, + GxB_FREE_FUNCTION = 7040 } GxB_Option_Field; typedef enum @@ -2429,6 +2452,7 @@ extern GrB_UnaryOp GxB_TRUNC_FP32; extern GrB_UnaryOp GxB_TRUNC_FP64; /* GxB objects */ +extern GxB_Context GxB_CONTEXT_WORLD; extern GxB_SelectOp GxB_DIAG; extern GxB_SelectOp GxB_EQ_THUNK; extern GxB_SelectOp GxB_EQ_ZERO; @@ -2889,9 +2913,6 @@ GrB_Info GrB_Vector_wait(GrB_Vector v, GrB_WaitMode waitmode); * GB functions * ***************/ -/* binary */ -GrB_Info GB_BinaryOp_new(GrB_BinaryOp *binaryop, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *binop_name); - /* iterator */ GrB_Info GB_Iterator_rc_bitmap_next(GxB_Iterator iterator); GrB_Info GB_Iterator_rc_seek(GxB_Iterator iterator, GrB_Index j, bool jth_vector); @@ -2900,15 +2921,6 @@ GrB_Info GB_Vector_Iterator_bitmap_seek(GxB_Iterator iterator, GrB_Index unused) /* matrix */ GrB_Info GB_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GxB_Format_Value format, GrB_Descriptor desc); -/* selectop */ -GrB_Info GB_SelectOp_new(GxB_SelectOp *selectop, GxB_select_function function, GrB_Type xtype, GrB_Type ttype, const char *name); - -/* type */ -GrB_Info GB_Type_new(GrB_Type *type, size_t sizeof_ctype, const char *type_name); - -/* unary */ -GrB_Info GB_UnaryOp_new(GrB_UnaryOp *unaryop, GxB_unary_function function, GrB_Type ztype, GrB_Type xtype, const char *unop_name); - /**************** * GxB functions * ****************/ @@ -2923,14 +2935,28 @@ GrB_Info GxB_BinaryOp_ytype_name(char *type_name, const GrB_BinaryOp binaryop); GrB_Info GxB_BinaryOp_ztype(GrB_Type *ztype, GrB_BinaryOp binaryop); GrB_Info GxB_BinaryOp_ztype_name(char *type_name, const GrB_BinaryOp binaryop); +/* context */ +GrB_Info GxB_Context_disengage(GxB_Context Context); +GrB_Info GxB_Context_engage(GxB_Context Context); +GrB_Info GxB_Context_fprint(GxB_Context Context, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_Context_free(GxB_Context *Context); +GrB_Info GxB_Context_get(GxB_Context Context, GxB_Context_Field field, ...); +GrB_Info GxB_Context_get_FP64(GxB_Context Context, GxB_Context_Field field, double *value); +GrB_Info GxB_Context_get_INT32(GxB_Context Context, GxB_Context_Field field, int32_t *value); +GrB_Info GxB_Context_new(GxB_Context *Context); +GrB_Info GxB_Context_set(GxB_Context Context, GxB_Context_Field field, ...); +GrB_Info GxB_Context_set_FP64(GxB_Context Context, GxB_Context_Field field, double value); +GrB_Info GxB_Context_set_INT32(GxB_Context Context, GxB_Context_Field field, int32_t value); + /* core */ GrB_Info GxB_Global_Option_get(GxB_Option_Field field, ...); -GrB_Info GxB_Global_Option_get_CHAR(GxB_Option_Field field, char **value); +GrB_Info GxB_Global_Option_get_CHAR(GxB_Option_Field field, const char **value); GrB_Info GxB_Global_Option_get_FP64(GxB_Option_Field field, double *value); GrB_Info GxB_Global_Option_get_FUNCTION(GxB_Option_Field field, void **value); GrB_Info GxB_Global_Option_get_INT32(GxB_Option_Field field, int32_t *value); GrB_Info GxB_Global_Option_get_INT64(GxB_Option_Field field, int64_t *value); GrB_Info GxB_Global_Option_set(GxB_Option_Field field, ...); +GrB_Info GxB_Global_Option_set_CHAR(GxB_Option_Field field, const char *value); GrB_Info GxB_Global_Option_set_FP64(GxB_Option_Field field, double value); GrB_Info GxB_Global_Option_set_FP64_ARRAY(GxB_Option_Field field, double *value); GrB_Info GxB_Global_Option_set_FUNCTION(GxB_Option_Field field, void *value); @@ -3133,12 +3159,8 @@ GrB_Info GxB_Scalar_type_name(char *type_name, const GrB_Scalar s); GrB_Info GxB_Scalar_wait(GrB_Scalar *s); /* selectop */ -GrB_Info GxB_SelectOp_error(const char **error, const GxB_SelectOp op); -GrB_Info GxB_SelectOp_fprint(GxB_SelectOp selectop, const char *name, GxB_Print_Level pr, FILE *f); -GrB_Info GxB_SelectOp_free(GxB_SelectOp *selectop); -GrB_Info GxB_SelectOp_new(GxB_SelectOp *selectop, GxB_select_function function, GrB_Type xtype, GrB_Type ttype); +GrB_Info GxB_SelectOp_fprint(GxB_SelectOp op, const char *name, GxB_Print_Level pr, FILE *f); GrB_Info GxB_SelectOp_ttype(GrB_Type *ttype, GxB_SelectOp selectop); -GrB_Info GxB_SelectOp_wait(GxB_SelectOp op, GrB_WaitMode waitmode); GrB_Info GxB_SelectOp_xtype(GrB_Type *xtype, GxB_SelectOp selectop); /* semiring */ @@ -3221,7 +3243,6 @@ GrB_Info GxB_Vector_unpack_Full(GrB_Vector v, void **vx, GrB_Index *vx_size, boo #define GxB_BITMAP ... #define GxB_CHUNK ... #define GxB_COMPRESSION_DEFAULT ... -#define GxB_COMPRESSION_INTEL ... #define GxB_COMPRESSION_LZ4 ... #define GxB_COMPRESSION_LZ4HC ... #define GxB_COMPRESSION_NONE ... @@ -3229,8 +3250,7 @@ GrB_Info GxB_Vector_unpack_Full(GrB_Vector v, void **vx, GrB_Index *vx_size, boo #define GxB_END ... #define GxB_FAST_IMPORT ... #define GxB_FULL ... -#define GxB_GPU_CHUNK ... -#define GxB_GPU_CONTROL ... +#define GxB_GPU_ID ... #define GxB_HYPERSPARSE ... #define GxB_IMPLEMENTATION ... #define GxB_IMPLEMENTATION_MAJOR ... From c45d27d3e7d9f2b0cc5b3f21b3f701d10fe0a816 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Sat, 20 May 2023 13:42:24 -0500 Subject: [PATCH 125/193] Make tests verbose when building wheels (#88) --- .github/workflows/wheels.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 98b8ab6..793f58a 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -148,12 +148,13 @@ jobs: CIBW_TEST_EXTRAS: "test" # run tests - CIBW_TEST_COMMAND: "pytest --pyargs suitesparse_graphblas" + CIBW_TEST_COMMAND: "pytest -v --pyargs suitesparse_graphblas" # GitHub Actions macOS Intel runner cannot run ARM tests. Uncomment to silence warning. # CIBW_TEST_SKIP: "*-macosx_arm64" run: | + python -m pip install --upgrade pip python -m pip install cibuildwheel python -m cibuildwheel --output-dir wheelhouse . shell: bash From f7b630092ef91c16514a443ec8f5a8f694c914f8 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Fri, 2 Jun 2023 21:06:17 -0500 Subject: [PATCH 126/193] Test against v8.0.1.beta1 (#90) * Update to v8.0.1 * Print default JIT configs in CI (tests and wheels) --- .github/workflows/test.yml | 4 +- .github/workflows/wheels.yml | 2 +- .pre-commit-config.yaml | 8 ++-- suitesparse_graphblas/suitesparse_graphblas.h | 2 + .../suitesparse_graphblas_no_complex.h | 2 + suitesparse_graphblas/tests/test_jit.py | 39 +++++++++++++++++++ 6 files changed, 51 insertions(+), 6 deletions(-) create mode 100644 suitesparse_graphblas/tests/test_jit.py diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 07d7016..6a83376 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,7 +19,7 @@ jobs: # os: ["ubuntu-latest"] # source: ["source"] python-version: ["3.8", "3.9", "3.10", "3.11"] - graphblas-version: ["8.0.0"] + graphblas-version: ["8.0.1"] steps: - name: Checkout uses: actions/checkout@v3 @@ -40,6 +40,7 @@ jobs: - name: GraphBLAS (from source) if: (contains(matrix.source, 'source')) run: | + # From release (does not work with beta versions) GRAPHBLAS_PREFIX=${CONDA_PREFIX} bash suitesparse.sh refs/tags/${{ matrix.graphblas-version }}.0 # From tag @@ -63,6 +64,7 @@ jobs: env: CYTHON_COVERAGE: true run: | + pytest -s -k test_print_jit_config coverage run --branch -m pytest coverage run -a --branch suitesparse_graphblas/tests/test_initialize.py - name: create_headers.py check diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 793f58a..31c6db3 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -148,7 +148,7 @@ jobs: CIBW_TEST_EXTRAS: "test" # run tests - CIBW_TEST_COMMAND: "pytest -v --pyargs suitesparse_graphblas" + CIBW_TEST_COMMAND: "pytest --pyargs suitesparse_graphblas -s -k test_print_jit_config && pytest -v --pyargs suitesparse_graphblas" # GitHub Actions macOS Intel runner cannot run ARM tests. Uncomment to silence warning. # CIBW_TEST_SKIP: "*-macosx_arm64" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1ec8879..541c75b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,7 +20,7 @@ repos: - id: mixed-line-ending # - id: trailing-whitespace - repo: https://github.com/abravalheri/validate-pyproject - rev: v0.12.2 + rev: v0.13 hooks: - id: validate-pyproject name: Validate pyproject.toml @@ -34,7 +34,7 @@ repos: hooks: - id: isort - repo: https://github.com/asottile/pyupgrade - rev: v3.3.2 + rev: v3.4.0 hooks: - id: pyupgrade args: [--py38-plus] @@ -55,8 +55,8 @@ repos: additional_dependencies: &flake8_dependencies # These versions need updated manually - flake8==6.0.0 - - flake8-comprehensions==3.11.1 - - flake8-bugbear==23.3.23 + - flake8-comprehensions==3.12.0 + - flake8-bugbear==23.5.9 # - flake8-simplify==0.20.0 - repo: https://github.com/asottile/yesqa rev: v1.4.0 diff --git a/suitesparse_graphblas/suitesparse_graphblas.h b/suitesparse_graphblas/suitesparse_graphblas.h index 4fcb6d0..eb5db2f 100644 --- a/suitesparse_graphblas/suitesparse_graphblas.h +++ b/suitesparse_graphblas/suitesparse_graphblas.h @@ -3112,6 +3112,7 @@ GrB_Info GxB_BinaryOp_ztype_name(char *type_name, const GrB_BinaryOp binaryop); /* context */ GrB_Info GxB_Context_disengage(GxB_Context Context); GrB_Info GxB_Context_engage(GxB_Context Context); +GrB_Info GxB_Context_error(const char **error, const GxB_Context Context); GrB_Info GxB_Context_fprint(GxB_Context Context, const char *name, GxB_Print_Level pr, FILE *f); GrB_Info GxB_Context_free(GxB_Context *Context); GrB_Info GxB_Context_get(GxB_Context Context, GxB_Context_Field field, ...); @@ -3121,6 +3122,7 @@ GrB_Info GxB_Context_new(GxB_Context *Context); GrB_Info GxB_Context_set(GxB_Context Context, GxB_Context_Field field, ...); GrB_Info GxB_Context_set_FP64(GxB_Context Context, GxB_Context_Field field, double value); GrB_Info GxB_Context_set_INT32(GxB_Context Context, GxB_Context_Field field, int32_t value); +GrB_Info GxB_Context_wait(GxB_Context Context, GrB_WaitMode waitmode); /* core */ GrB_Info GxB_Global_Option_get(GxB_Option_Field field, ...); diff --git a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h index 7d1ff46..5c49c31 100644 --- a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h +++ b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h @@ -2938,6 +2938,7 @@ GrB_Info GxB_BinaryOp_ztype_name(char *type_name, const GrB_BinaryOp binaryop); /* context */ GrB_Info GxB_Context_disengage(GxB_Context Context); GrB_Info GxB_Context_engage(GxB_Context Context); +GrB_Info GxB_Context_error(const char **error, const GxB_Context Context); GrB_Info GxB_Context_fprint(GxB_Context Context, const char *name, GxB_Print_Level pr, FILE *f); GrB_Info GxB_Context_free(GxB_Context *Context); GrB_Info GxB_Context_get(GxB_Context Context, GxB_Context_Field field, ...); @@ -2947,6 +2948,7 @@ GrB_Info GxB_Context_new(GxB_Context *Context); GrB_Info GxB_Context_set(GxB_Context Context, GxB_Context_Field field, ...); GrB_Info GxB_Context_set_FP64(GxB_Context Context, GxB_Context_Field field, double value); GrB_Info GxB_Context_set_INT32(GxB_Context Context, GxB_Context_Field field, int32_t value); +GrB_Info GxB_Context_wait(GxB_Context Context, GrB_WaitMode waitmode); /* core */ GrB_Info GxB_Global_Option_get(GxB_Option_Field field, ...); diff --git a/suitesparse_graphblas/tests/test_jit.py b/suitesparse_graphblas/tests/test_jit.py new file mode 100644 index 0000000..1921928 --- /dev/null +++ b/suitesparse_graphblas/tests/test_jit.py @@ -0,0 +1,39 @@ +from suitesparse_graphblas import ffi, lib + + +def test_print_jit_config(): + print() + print("===================================") + print("Printing default JIT configurations") + print("-----------------------------------") + jit_c_control = { + lib.GxB_JIT_OFF: "off", + lib.GxB_JIT_PAUSE: "pause", + lib.GxB_JIT_RUN: "run", + lib.GxB_JIT_LOAD: "load", + lib.GxB_JIT_ON: "on", + } + val_ptr = ffi.new("int32_t*") + assert lib.GxB_Global_Option_get_INT32(lib.GxB_JIT_C_CONTROL, val_ptr) == lib.GrB_SUCCESS + print("JIT_C_CONTROL", jit_c_control[val_ptr[0]]) + + assert lib.GxB_Global_Option_get_INT32(lib.GxB_JIT_USE_CMAKE, val_ptr) == lib.GrB_SUCCESS + print("JIT_USE_CMAKE", bool(val_ptr[0])) + + func = lib.GxB_Global_Option_get_CHAR + names = [ + "JIT_C_COMPILER_NAME", + "JIT_C_COMPILER_FLAGS", + "JIT_C_LINKER_FLAGS", + "JIT_C_LIBRARIES", + "JIT_C_CMAKE_LIBS", + "JIT_C_PREFACE", + "JIT_ERROR_LOG", + "JIT_CACHE_PATH", + ] + val_ptr = ffi.new("char**") + for name in names: + obj = getattr(lib, f"GxB_{name}") + assert func(obj, val_ptr) == lib.GrB_SUCCESS + print(name, ffi.string(val_ptr[0]).decode()) + print("===================================") From aaa0c0c7a85793261493bf3b6f67a645c9b1a429 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Fri, 2 Jun 2023 22:28:12 -0500 Subject: [PATCH 127/193] Run add_arm_to_libomp_dylib.sh only on arm64 (#91) --- .github/workflows/wheels.yml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 31c6db3..306200d 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -106,8 +106,11 @@ jobs: # manually so that both x86 and arm builds can be built. run: | brew install coreutils - brew install libomp - sh add_arm_to_libomp_dylib.sh + if [[ ${{ matrix.cibw_archs }} == "arm64" ]] ; then + echo "Building universal libomp manually" + brew install libomp + sh add_arm_to_libomp_dylib.sh + fi - name: Build Wheels env: @@ -127,7 +130,7 @@ jobs: CIBW_ENVIRONMENT_MACOS: BREW_LIBOMP="1" SUITESPARSE_MACOS_ARCH=${{ matrix.cibw_archs }} # Uncomment to only build CPython wheels -# CIBW_BUILD: "cp*" + # CIBW_BUILD: "cp*" # Architectures to build specified in matrix CIBW_ARCHS: ${{ matrix.cibw_archs }} @@ -151,7 +154,9 @@ jobs: CIBW_TEST_COMMAND: "pytest --pyargs suitesparse_graphblas -s -k test_print_jit_config && pytest -v --pyargs suitesparse_graphblas" # GitHub Actions macOS Intel runner cannot run ARM tests. Uncomment to silence warning. -# CIBW_TEST_SKIP: "*-macosx_arm64" + # CIBW_TEST_SKIP: "*-macosx_arm64" + # XXX: tests are failing for macos_x86_64; let's see if we can figure out what's wrong by releasing a broken package... (sorry!) + # CIBW_TEST_SKIP: "*-macosx_*" run: | python -m pip install --upgrade pip @@ -181,7 +186,7 @@ jobs: needs: [build_wheels, build_sdist] runs-on: ubuntu-latest if: github.repository == 'GraphBLAS/python-suitesparse-graphblas' -# if: github.event_name == 'release' && github.event.action == 'published' + # if: github.event_name == 'release' && github.event.action == 'published' steps: - uses: actions/setup-python@v4 @@ -202,5 +207,5 @@ jobs: password: ${{ secrets.PYPI_TOKEN }} # Test PyPI: -# password: ${{ secrets.TEST_PYPI_API_TOKEN }} -# repository_url: https://test.pypi.org/legacy/ + # password: ${{ secrets.TEST_PYPI_API_TOKEN }} + # repository_url: https://test.pypi.org/legacy/ From d0182481dc0f058d3b755df1adaa7fa98b5f5b52 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Fri, 2 Jun 2023 23:20:30 -0500 Subject: [PATCH 128/193] Skip tests on macos when building wheels. (#92) This is probably a bad idea. --- .github/workflows/wheels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 306200d..7540025 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -106,9 +106,9 @@ jobs: # manually so that both x86 and arm builds can be built. run: | brew install coreutils + brew install libomp if [[ ${{ matrix.cibw_archs }} == "arm64" ]] ; then echo "Building universal libomp manually" - brew install libomp sh add_arm_to_libomp_dylib.sh fi @@ -156,7 +156,7 @@ jobs: # GitHub Actions macOS Intel runner cannot run ARM tests. Uncomment to silence warning. # CIBW_TEST_SKIP: "*-macosx_arm64" # XXX: tests are failing for macos_x86_64; let's see if we can figure out what's wrong by releasing a broken package... (sorry!) - # CIBW_TEST_SKIP: "*-macosx_*" + CIBW_TEST_SKIP: "*-macosx_*" run: | python -m pip install --upgrade pip From 9fc49900262a91486c45a43e9b21d9aad2fb6946 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Fri, 30 Jun 2023 14:31:39 -0500 Subject: [PATCH 129/193] Update to 8.0.2 (#93) * Update to 8.0.2 and turn off JIT by default (but it's still usable) --- .github/workflows/test.yml | 4 ++-- suitesparse.sh | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6a83376..7b47a63 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,7 +19,7 @@ jobs: # os: ["ubuntu-latest"] # source: ["source"] python-version: ["3.8", "3.9", "3.10", "3.11"] - graphblas-version: ["8.0.1"] + graphblas-version: ["8.0.2"] steps: - name: Checkout uses: actions/checkout@v3 @@ -52,7 +52,7 @@ jobs: # pushd DrTim*/build # echo ${CONDA_PREFIX} - # cmake -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release .. + # cmake -DJITINIT=2 -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release .. # cat Makefile # make all JOBS=16 # make install diff --git a/suitesparse.sh b/suitesparse.sh index 080201a..891391e 100755 --- a/suitesparse.sh +++ b/suitesparse.sh @@ -88,7 +88,9 @@ fi # Disable all Source/Generated2 kernels. For workflow development only. #cmake_params+=(-DCMAKE_CUDA_DEV=1) -cmake .. -DCMAKE_BUILD_TYPE=Release -G 'Unix Makefiles' "${cmake_params[@]}" +# Use `-DJITINIT=2` so that the JIT functionality is available, but disabled by default. +# Level 2, "run", means that pre-JIT kernels may be used, which does not require a compiler at runtime. +cmake .. -DJITINIT=2 -DCMAKE_BUILD_TYPE=Release -G 'Unix Makefiles' "${cmake_params[@]}" make -j$NPROC make install From 1a59a040c6c9243b1d3d64b915d608bc675475ee Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Fri, 30 Jun 2023 15:09:17 -0500 Subject: [PATCH 130/193] Enable echo when running `suitesparse.sh` (#94) * Enable echo when running `suitesparse.sh` * Make conda faster in CI --- .github/workflows/test.yml | 6 ++++-- continuous_integration/environment.yml | 5 ++--- suitesparse.sh | 4 +++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7b47a63..2da86ba 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,12 +31,14 @@ jobs: auto-update-conda: true python-version: ${{ matrix.python-version }} environment-file: continuous_integration/environment.yml - channels: conda-forge + channels: conda-forge,nodefaults + channel-priority: strict activate-environment: suitesparse-graphblas + auto-activate-base: false - name: GraphBLAS (from conda-forge) if: (contains(matrix.source, 'conda-forge')) run: | - conda install -c conda-forge graphblas=${{ matrix.graphblas-version }} pytest-randomly + conda install graphblas=${{ matrix.graphblas-version }} - name: GraphBLAS (from source) if: (contains(matrix.source, 'source')) run: | diff --git a/continuous_integration/environment.yml b/continuous_integration/environment.yml index 22064d0..a5c0d41 100644 --- a/continuous_integration/environment.yml +++ b/continuous_integration/environment.yml @@ -1,13 +1,12 @@ name: suitesparse-graphblas channels: - conda-forge - - defaults + - nodefaults # Only install packages from conda-forge for faster solving dependencies: # - graphblas=6.0.2 - cffi - cython - numpy - pytest + - pytest-randomly - coverage - - black - - flake8 diff --git a/suitesparse.sh b/suitesparse.sh index 891391e..56c6784 100755 --- a/suitesparse.sh +++ b/suitesparse.sh @@ -1,10 +1,12 @@ #!/bin/bash +set -x # echo on + # parse SuiteSparse version from first argument, a git tag that ends in the version (no leading v) if [[ $1 =~ refs/tags/([0-9]*\.[0-9]*\.[0-9]*)\..*$ ]]; then VERSION=${BASH_REMATCH[1]} else - echo "Specify a SuiteSparse version, such as: $0 refs/tags/7.4.3.0" + echo "Specify a SuiteSparse version, such as: $0 refs/tags/7.4.3.0 (got: $1)" exit -1 fi echo VERSION: $VERSION From e3569b82b84431cd536550d0cc5f086d6ad5dd8a Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Fri, 30 Jun 2023 23:04:28 -0500 Subject: [PATCH 131/193] Bump versions in pre-commit (#95) --- .pre-commit-config.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 541c75b..535fee8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,7 +25,7 @@ repos: - id: validate-pyproject name: Validate pyproject.toml - repo: https://github.com/PyCQA/autoflake - rev: v2.1.1 + rev: v2.2.0 hooks: - id: autoflake args: [--in-place] @@ -34,7 +34,7 @@ repos: hooks: - id: isort - repo: https://github.com/asottile/pyupgrade - rev: v3.4.0 + rev: v3.7.0 hooks: - id: pyupgrade args: [--py38-plus] @@ -55,11 +55,11 @@ repos: additional_dependencies: &flake8_dependencies # These versions need updated manually - flake8==6.0.0 - - flake8-comprehensions==3.12.0 - - flake8-bugbear==23.5.9 + - flake8-comprehensions==3.13.0 + - flake8-bugbear==23.6.5 # - flake8-simplify==0.20.0 - repo: https://github.com/asottile/yesqa - rev: v1.4.0 + rev: v1.5.0 hooks: - id: yesqa additional_dependencies: *flake8_dependencies From c231ca0b9618f3ba7b5181a1c5b24b20975b3867 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Oct 2023 15:32:58 -0500 Subject: [PATCH 132/193] Bump actions/checkout from 3 to 4 (#96) Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/lint.yml | 2 +- .github/workflows/test.yml | 2 +- .github/workflows/wheels.yml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 5ef2b10..7e85047 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -14,7 +14,7 @@ jobs: name: pre-commit-hooks runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: "3.10" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2da86ba..4505b2a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,7 +22,7 @@ jobs: graphblas-version: ["8.0.2"] steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Conda diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 7540025..d2846f1 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -16,7 +16,7 @@ jobs: name: Build SDist runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 @@ -75,7 +75,7 @@ jobs: cibw_archs: "arm64" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 From d2faa2129033c5ad440ea9664f880bb1b746c2b7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Oct 2023 15:33:20 -0500 Subject: [PATCH 133/193] Bump docker/setup-qemu-action from 2 to 3 (#97) Bumps [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) from 2 to 3. - [Release notes](https://github.com/docker/setup-qemu-action/releases) - [Commits](https://github.com/docker/setup-qemu-action/compare/v2...v3) --- updated-dependencies: - dependency-name: docker/setup-qemu-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index d2846f1..8f619a1 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -87,7 +87,7 @@ jobs: # see https://cibuildwheel.readthedocs.io/en/stable/faq/#emulation - name: Setup QEMU (for aarch64) if: matrix.cibw_archs == 'aarch64' - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 with: platforms: arm64 From fb6b33ad0fd6c3ee12eabd7ca225c7a17b3c4659 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Mon, 2 Oct 2023 15:58:55 -0500 Subject: [PATCH 134/193] Update to 8.2.0 (#98) No changes to the C API --- .flake8 | 3 ++- .github/workflows/test.yml | 2 +- .pre-commit-config.yaml | 16 ++++++++-------- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.flake8 b/.flake8 index 414785b..efbe9a5 100644 --- a/.flake8 +++ b/.flake8 @@ -5,4 +5,5 @@ extend-ignore = E203, # E203 whitespace before ':' (to be compatible with black) per-file-ignores = - suitesparse_graphblas/io/binary.py:C408 + suitesparse_graphblas/io/binary.py:C408, + suitesparse_graphblas/tests/test_io.py:E721, diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4505b2a..7fd09f6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,7 +19,7 @@ jobs: # os: ["ubuntu-latest"] # source: ["source"] python-version: ["3.8", "3.9", "3.10", "3.11"] - graphblas-version: ["8.0.2"] + graphblas-version: ["8.2.0"] steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 535fee8..64bed06 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,12 +20,12 @@ repos: - id: mixed-line-ending # - id: trailing-whitespace - repo: https://github.com/abravalheri/validate-pyproject - rev: v0.13 + rev: v0.14 hooks: - id: validate-pyproject name: Validate pyproject.toml - repo: https://github.com/PyCQA/autoflake - rev: v2.2.0 + rev: v2.2.1 hooks: - id: autoflake args: [--in-place] @@ -34,7 +34,7 @@ repos: hooks: - id: isort - repo: https://github.com/asottile/pyupgrade - rev: v3.7.0 + rev: v3.13.0 hooks: - id: pyupgrade args: [--py38-plus] @@ -44,19 +44,19 @@ repos: # - id: auto-walrus # args: [--line-length, "100"] - repo: https://github.com/psf/black - rev: 23.3.0 + rev: 23.9.1 hooks: - id: black # - id: black-jupyter - repo: https://github.com/PyCQA/flake8 - rev: 6.0.0 + rev: 6.1.0 hooks: - id: flake8 additional_dependencies: &flake8_dependencies # These versions need updated manually - - flake8==6.0.0 - - flake8-comprehensions==3.13.0 - - flake8-bugbear==23.6.5 + - flake8==6.1.0 + - flake8-comprehensions==3.14.0 + - flake8-bugbear==23.9.16 # - flake8-simplify==0.20.0 - repo: https://github.com/asottile/yesqa rev: v1.5.0 From 8d55769669b8cda4e095e5077782c31bacf80dad Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Mon, 2 Oct 2023 17:21:50 -0500 Subject: [PATCH 135/193] Try building with cffi <1.16 (#99) Our automatic wheel builds failed --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 7265a23..35f3211 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ requires = [ "setuptools >=64", "setuptools-git-versioning", "wheel", - "cffi>=1.11", + "cffi>=1.11,<1.16", "cython", "oldest-supported-numpy", ] From 35393b10c755324f410215f5941bf293ee3282a3 Mon Sep 17 00:00:00 2001 From: Adam Lugowski Date: Wed, 4 Oct 2023 19:30:56 -0700 Subject: [PATCH 136/193] Fix Linux Python 3.12 wheel build (#102) * Install libffi-dev for Ubuntu Python 3.12 wheel * Drop 3.12 from regular tests as it's not available from Conda yet --- .github/workflows/wheels.yml | 3 +++ pyproject.toml | 1 + 2 files changed, 4 insertions(+) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 8f619a1..0651373 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -120,6 +120,9 @@ jobs: # Build SuiteSparse CIBW_BEFORE_ALL: bash suitesparse.sh ${{ github.ref }} + # Install FFI dev library, needed for Python 3.12 + CIBW_BEFORE_BUILD_LINUX: yum install -y libffi-devel + CIBW_ENVIRONMENT_LINUX: SUITESPARSE_FAST_BUILD=${{ env.SUITESPARSE_FAST_BUILD }} # CMAKE_GNUtoMS=ON asks suitesparse.sh to build libraries in MSVC style on Windows. diff --git a/pyproject.toml b/pyproject.toml index 35f3211..e2aaaee 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,6 +53,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3 :: Only", "Intended Audience :: Developers", "Intended Audience :: Other Audience", From cdc1a5cf6757c4c45b0ab5b3767ae19531d70ca2 Mon Sep 17 00:00:00 2001 From: Adam Lugowski Date: Wed, 4 Oct 2023 19:31:49 -0700 Subject: [PATCH 137/193] Make PyPy wheels work (#100) * Unpin numpy version for PyPy wheels * Skip PyPy 3.10 due to lack of numpy wheels --- .github/workflows/wheels.yml | 7 +++++-- pyproject.toml | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 0651373..1bc5145 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -138,8 +138,11 @@ jobs: # Architectures to build specified in matrix CIBW_ARCHS: ${{ matrix.cibw_archs }} - # No 32-bit builds, no musllinux, no PyPy aarch64 (only due to build speed, numpy does not ship aarch64 pypy wheels) - CIBW_SKIP: "*-win32 *_i686 *musl* pp*aarch64" + # No 32-bit builds + # no musllinux + # no PyPy aarch64 (only due to build speed, numpy does not ship aarch64 pypy wheels) + # as of writing numpy does not support pypy 3.10 + CIBW_SKIP: "*-win32 *_i686 *musl* pp*aarch64 pp310*" # Use delvewheel on Windows. # This copies graphblas.dll into the wheel. "repair" in cibuildwheel parlance includes copying any shared diff --git a/pyproject.toml b/pyproject.toml index e2aaaee..7e97dd8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,10 @@ requires = [ "wheel", "cffi>=1.11,<1.16", "cython", - "oldest-supported-numpy", + "oldest-supported-numpy; platform_python_implementation != 'PyPy'", + # Inspired by SciPy: unpin numpy version for PyPy builds, + # as oldest-supported-numpy does not take PyPy into account. + "numpy; platform_python_implementation=='PyPy'", ] [project] From f7402c540027726d3d4b8eab74a4e4cf3c769fa1 Mon Sep 17 00:00:00 2001 From: Adam Lugowski Date: Wed, 4 Oct 2023 19:33:05 -0700 Subject: [PATCH 138/193] Enable testing macOS wheels (#101) --- .github/workflows/wheels.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 1bc5145..6911bf0 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -160,9 +160,7 @@ jobs: CIBW_TEST_COMMAND: "pytest --pyargs suitesparse_graphblas -s -k test_print_jit_config && pytest -v --pyargs suitesparse_graphblas" # GitHub Actions macOS Intel runner cannot run ARM tests. Uncomment to silence warning. - # CIBW_TEST_SKIP: "*-macosx_arm64" - # XXX: tests are failing for macos_x86_64; let's see if we can figure out what's wrong by releasing a broken package... (sorry!) - CIBW_TEST_SKIP: "*-macosx_*" + CIBW_TEST_SKIP: "*-macosx_arm64" run: | python -m pip install --upgrade pip From f83627a3c83178a2513592979cda32921e55f352 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Thu, 5 Oct 2023 09:01:56 -0500 Subject: [PATCH 139/193] Test Python 3.12 in CI (#103) --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7fd09f6..2a7d795 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,7 +18,7 @@ jobs: source: ["conda-forge"] # os: ["ubuntu-latest"] # source: ["source"] - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] graphblas-version: ["8.2.0"] steps: - name: Checkout From a317886b4535de1be86a09dfc1b0952228eaef3e Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Thu, 5 Oct 2023 16:35:51 -0500 Subject: [PATCH 140/193] Revert #99 (#104) --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 7e97dd8..e6312d1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ requires = [ "setuptools >=64", "setuptools-git-versioning", "wheel", - "cffi>=1.11,<1.16", + "cffi>=1.11", "cython", "oldest-supported-numpy; platform_python_implementation != 'PyPy'", # Inspired by SciPy: unpin numpy version for PyPy builds, From 84e41c2deab8f1e2cbe3a4aac53a7d84e92c9552 Mon Sep 17 00:00:00 2001 From: Adam Lugowski Date: Fri, 6 Oct 2023 08:06:14 -0700 Subject: [PATCH 141/193] Run wheels workflow on PR and cibuildwheel github action (#105) * Add SUITESPARSE_FASTEST_BUILD option * Build wheels on PR * Switch to cibuildwheel github action * Limit push wheels action run to only main branch --- .github/workflows/wheels.yml | 85 +++++++++++++++++++----------------- suitesparse.sh | 23 +++++++++- 2 files changed, 65 insertions(+), 43 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 6911bf0..24c440a 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -7,6 +7,11 @@ on: # Enable Run Workflow button in GitHub UI workflow_dispatch: + push: + branches: [ main ] + + pull_request: + concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true @@ -34,55 +39,47 @@ jobs: build_wheels: name: Wheels - ${{ matrix.cibw_archs }} - ${{ matrix.os }} runs-on: ${{ matrix.os }} + env: + # graphblas version to use if another one is not provided + default-graphblas-version: "8.2.0" + strategy: fail-fast: false matrix: - # Loosely based on scikit-learn's config: - # https://github.com/scikit-learn/scikit-learn/blob/main/.github/workflows/wheels.yml include: - os: windows-latest - python-version: "3.8" - platform_id: win_amd64 - cibw_archs: "auto" + cibw_archs: "auto64" - # Linux 64 bit manylinux2014 + # Linux x86 - os: ubuntu-latest - python-version: "3.8" - platform_id: manylinux_x86_64 - manylinux_image: manylinux2014 - cibw_archs: "native" + cibw_archs: "x86_64" + # skip musllinux + cibw_skip: "*musl*" - # Linux 64 bit manylinux2014 for aarch64 + # Linux aarch64 # Separate runner because this requires emulation (only x86 runners are available) and is very slow. - os: ubuntu-latest - python-version: "3.8" - platform_id: manylinux_x86_64 - manylinux_image: manylinux2014 cibw_archs: "aarch64" + # numpy wheels not available for aarch64 PyPy or musllinux + cibw_skip: "pp* *musl*" # macOS x86 - os: macos-latest - python-version: "3.8" - platform_id: macosx_x86_64 cibw_archs: "x86_64" - # Use x86 macOS runner to build ARM. + # macOS Apple Silicon cross-compiled on x86 macOS runner. # GitHub does not offer Apple Silicon yet (only for self-hosted). # See https://github.com/github/roadmap/issues/528 - os: macos-latest - python-version: "3.8" - platform_id: macosx_x86_64 cibw_archs: "arm64" + # Skip macOS ARM tests on Intel runner. + cibw_test_skip: "*-macosx_arm64" steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - # aarch64 Linux builds are cross-compiled on x86 runners using emulation # see https://cibuildwheel.readthedocs.io/en/stable/faq/#emulation - name: Setup QEMU (for aarch64) @@ -98,6 +95,20 @@ jobs: run: | echo "SUITESPARSE_FAST_BUILD=1" >> $GITHUB_ENV + - name: Setup for testing + if: github.event_name == 'push' || github.event_name == 'pull_request' + # Ask suitesparse.sh to compile in the fastest way possible and provide a GB version to build + run: | + echo "SUITESPARSE_FASTEST_BUILD=1" >> $GITHUB_ENV + echo "GB_VERSION_REF=refs/tags/${{ env.default-graphblas-version }}.0" >> $GITHUB_ENV + shell: bash + + - name: Setup GraphBLAS version from git tag + if: ${{ startsWith(github.ref, 'refs/tags/') }} + # If this is a tagged ref, like a release, then use the tag for the graphblas version + run: echo "GB_VERSION_REF=${{ github.ref }}" >> $GITHUB_ENV + shell: bash + - name: Install tools (macOS) if: contains(matrix.os, 'macos') # Install coreutils which includes `nproc` used by `make -j` in suitesparse.sh @@ -112,18 +123,20 @@ jobs: sh add_arm_to_libomp_dylib.sh fi - - name: Build Wheels + - uses: pypa/cibuildwheel@v2.16 + with: + output-dir: wheelhouse env: # very verbose CIBW_BUILD_VERBOSITY: 3 # Build SuiteSparse - CIBW_BEFORE_ALL: bash suitesparse.sh ${{ github.ref }} + CIBW_BEFORE_ALL: bash suitesparse.sh ${{ env.GB_VERSION_REF }} # Install FFI dev library, needed for Python 3.12 CIBW_BEFORE_BUILD_LINUX: yum install -y libffi-devel - CIBW_ENVIRONMENT_LINUX: SUITESPARSE_FAST_BUILD=${{ env.SUITESPARSE_FAST_BUILD }} + CIBW_ENVIRONMENT_PASS_LINUX: SUITESPARSE_FAST_BUILD SUITESPARSE_FASTEST_BUILD # CMAKE_GNUtoMS=ON asks suitesparse.sh to build libraries in MSVC style on Windows. CIBW_ENVIRONMENT_WINDOWS: CMAKE_GNUtoMS=ON GRAPHBLAS_PREFIX="C:/GraphBLAS" @@ -138,11 +151,8 @@ jobs: # Architectures to build specified in matrix CIBW_ARCHS: ${{ matrix.cibw_archs }} - # No 32-bit builds - # no musllinux - # no PyPy aarch64 (only due to build speed, numpy does not ship aarch64 pypy wheels) # as of writing numpy does not support pypy 3.10 - CIBW_SKIP: "*-win32 *_i686 *musl* pp*aarch64 pp310*" + CIBW_SKIP: "${{ matrix.cibw_skip }} pp310*" # Use delvewheel on Windows. # This copies graphblas.dll into the wheel. "repair" in cibuildwheel parlance includes copying any shared @@ -159,14 +169,7 @@ jobs: # run tests CIBW_TEST_COMMAND: "pytest --pyargs suitesparse_graphblas -s -k test_print_jit_config && pytest -v --pyargs suitesparse_graphblas" - # GitHub Actions macOS Intel runner cannot run ARM tests. Uncomment to silence warning. - CIBW_TEST_SKIP: "*-macosx_arm64" - - run: | - python -m pip install --upgrade pip - python -m pip install cibuildwheel - python -m cibuildwheel --output-dir wheelhouse . - shell: bash + CIBW_TEST_SKIP: ${{ matrix.cibw_test_skip }} - uses: actions/upload-artifact@v3 id: uploadAttempt1 @@ -189,8 +192,8 @@ jobs: name: Upload to PyPI needs: [build_wheels, build_sdist] runs-on: ubuntu-latest - if: github.repository == 'GraphBLAS/python-suitesparse-graphblas' - # if: github.event_name == 'release' && github.event.action == 'published' + # only upload releases to PyPI + if: github.repository == 'GraphBLAS/python-suitesparse-graphblas' && github.event_name == 'release' && github.event.action == 'published' steps: - uses: actions/setup-python@v4 @@ -212,4 +215,4 @@ jobs: # Test PyPI: # password: ${{ secrets.TEST_PYPI_API_TOKEN }} - # repository_url: https://test.pypi.org/legacy/ + # repository-url: https://test.pypi.org/legacy/ diff --git a/suitesparse.sh b/suitesparse.sh index 56c6784..1376bb3 100755 --- a/suitesparse.sh +++ b/suitesparse.sh @@ -87,8 +87,27 @@ if [ -n "${SUITESPARSE_FAST_BUILD}" ]; then echo "#define GxB_NO_UINT8 1" >> ../Source/GB_control.h fi -# Disable all Source/Generated2 kernels. For workflow development only. -#cmake_params+=(-DCMAKE_CUDA_DEV=1) +if [ -n "${SUITESPARSE_FASTEST_BUILD}" ]; then + echo "suitesparse.sh: Fastest build requested." + # Fastest build possible. For use in development and automated tests that do not depend on performance. + + echo "#define GxB_NO_BOOL 1" >> ../Source/GB_control.h + echo "#define GxB_NO_FP32 1" >> ../Source/GB_control.h + echo "#define GxB_NO_FP64 1" >> ../Source/GB_control.h + echo "#define GxB_NO_FC32 1" >> ../Source/GB_control.h + echo "#define GxB_NO_FC64 1" >> ../Source/GB_control.h + echo "#define GxB_NO_INT16 1" >> ../Source/GB_control.h + echo "#define GxB_NO_INT32 1" >> ../Source/GB_control.h + echo "#define GxB_NO_INT64 1" >> ../Source/GB_control.h + echo "#define GxB_NO_INT8 1" >> ../Source/GB_control.h + echo "#define GxB_NO_UINT16 1" >> ../Source/GB_control.h + echo "#define GxB_NO_UINT32 1" >> ../Source/GB_control.h + echo "#define GxB_NO_UINT64 1" >> ../Source/GB_control.h + echo "#define GxB_NO_UINT8 1" >> ../Source/GB_control.h + + # Disable all Source/Generated2 kernels. For workflow development only. + cmake_params+=(-DCMAKE_CUDA_DEV=1) +fi # Use `-DJITINIT=2` so that the JIT functionality is available, but disabled by default. # Level 2, "run", means that pre-JIT kernels may be used, which does not require a compiler at runtime. From 98394c704904e03497c814dfb3f29dffd6fa5602 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Fri, 6 Oct 2023 12:12:47 -0500 Subject: [PATCH 142/193] Set COMPACT for fastest build (#107) --- suitesparse.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/suitesparse.sh b/suitesparse.sh index 1376bb3..2264ef0 100755 --- a/suitesparse.sh +++ b/suitesparse.sh @@ -105,6 +105,10 @@ if [ -n "${SUITESPARSE_FASTEST_BUILD}" ]; then echo "#define GxB_NO_UINT64 1" >> ../Source/GB_control.h echo "#define GxB_NO_UINT8 1" >> ../Source/GB_control.h + # Setting COMPACT probably makes setting config in GB_control.h above unnecessary + cmake_params+=(-DCOMPACT=1) + # Also no JIT for the fastest possible build + cmake_params+=(-DNJIT=1) # Disable all Source/Generated2 kernels. For workflow development only. cmake_params+=(-DCMAKE_CUDA_DEV=1) fi From fc4d14dc636cdcd4b4170f04a7fd4574230b6293 Mon Sep 17 00:00:00 2001 From: Adam Lugowski Date: Fri, 6 Oct 2023 13:01:11 -0700 Subject: [PATCH 143/193] Add musllinux wheels (#106) --- .github/workflows/wheels.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 24c440a..ccb699a 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -37,7 +37,7 @@ jobs: build_wheels: - name: Wheels - ${{ matrix.cibw_archs }} - ${{ matrix.os }} + name: Wheels - ${{ matrix.cibw_archs }} ${{ matrix.arch_note}} - ${{ matrix.os }} runs-on: ${{ matrix.os }} env: # graphblas version to use if another one is not provided @@ -50,12 +50,22 @@ jobs: - os: windows-latest cibw_archs: "auto64" - # Linux x86 + # Linux x86 manylinux - os: ubuntu-latest cibw_archs: "x86_64" + # Python 3.12 wheel requires libffi-devel to be installed. manylinux container uses yum + cibw_before_build_linux: "yum install -y libffi-devel" # skip musllinux cibw_skip: "*musl*" + # Linux x86 musllinux + # Separate runner for a Musl build of graphblas. The glibc build is not guaranteed to be compatible. + - os: ubuntu-latest + cibw_archs: "x86_64" + arch_note: "musl" + # skip manylinux (built elsewhere), PyPy (no musl numpy wheels), CPython 3.8 (no musl numpy wheels) + cibw_skip: "*many* pp* cp38*" + # Linux aarch64 # Separate runner because this requires emulation (only x86 runners are available) and is very slow. - os: ubuntu-latest @@ -133,8 +143,7 @@ jobs: # Build SuiteSparse CIBW_BEFORE_ALL: bash suitesparse.sh ${{ env.GB_VERSION_REF }} - # Install FFI dev library, needed for Python 3.12 - CIBW_BEFORE_BUILD_LINUX: yum install -y libffi-devel + CIBW_BEFORE_BUILD_LINUX: ${{ matrix.cibw_before_build_linux }} CIBW_ENVIRONMENT_PASS_LINUX: SUITESPARSE_FAST_BUILD SUITESPARSE_FASTEST_BUILD From 78456b5402e3a5c36792597a9ee60f35821c7d0f Mon Sep 17 00:00:00 2001 From: Adam Lugowski Date: Sat, 7 Oct 2023 08:21:38 -0700 Subject: [PATCH 144/193] Add Adam as maintainer (#108) --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index e6312d1..bff0249 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,6 +29,7 @@ maintainers = [ {name = "Erik Welch", email = "erik.n.welch@gmail.com"}, {name = "Jim Kitchen", email = "jim22k@gmail.com"}, {name = "Michel Pelletier", email = "michel@graphegon.com"}, + {name = "Adam Lugowski", email = "alugowski@gmail.com"}, ] keywords = [ "graphblas", From 0b92b85747284a8d089ad1009066f7b5b914ac3e Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Fri, 13 Oct 2023 18:27:31 -0500 Subject: [PATCH 145/193] Update to SuiteSparse:GraphBLAS 8.2.1 (#110) * Update to SuiteSparse:GraphBLAS 8.2.1 * turn on echo in add_arm_to_libomp_dylib.sh --- .github/workflows/test.yml | 2 +- .github/workflows/wheels.yml | 4 ++-- add_arm_to_libomp_dylib.sh | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2a7d795..24498e8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,7 +19,7 @@ jobs: # os: ["ubuntu-latest"] # source: ["source"] python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] - graphblas-version: ["8.2.0"] + graphblas-version: ["8.2.1"] steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index ccb699a..32c8efb 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -2,7 +2,7 @@ name: Python wheel package build and publish on: release: - types: [created] + types: [published] # Enable Run Workflow button in GitHub UI workflow_dispatch: @@ -41,7 +41,7 @@ jobs: runs-on: ${{ matrix.os }} env: # graphblas version to use if another one is not provided - default-graphblas-version: "8.2.0" + default-graphblas-version: "8.2.1" strategy: fail-fast: false diff --git a/add_arm_to_libomp_dylib.sh b/add_arm_to_libomp_dylib.sh index 5109f98..99e32b0 100755 --- a/add_arm_to_libomp_dylib.sh +++ b/add_arm_to_libomp_dylib.sh @@ -19,6 +19,8 @@ if [ "$(arch)" != "x86_64" ] && [ "$(arch)" != "i386" ]; then exit 1; fi +set -x # echo on + #mkdir x86lib mkdir armlib From f8cd3b48ebe2ca0a8680fb47f4b0596bc86e71b6 Mon Sep 17 00:00:00 2001 From: Adam Lugowski Date: Sat, 14 Oct 2023 09:19:26 -0700 Subject: [PATCH 146/193] Add retry to brew calls (#111) --- .github/workflows/wheels.yml | 6 +++--- add_arm_to_libomp_dylib.sh | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 32c8efb..8c02dc5 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -126,11 +126,11 @@ jobs: # GitHub actions comes with libomp already installed, but for its native arch only. Must build universal one # manually so that both x86 and arm builds can be built. run: | - brew install coreutils - brew install libomp + brew fetch --retry coreutils && brew install coreutils + brew fetch --retry libomp && brew install libomp if [[ ${{ matrix.cibw_archs }} == "arm64" ]] ; then echo "Building universal libomp manually" - sh add_arm_to_libomp_dylib.sh + sh add_arm_to_libomp_dylib.sh || exit 1 fi - uses: pypa/cibuildwheel@v2.16 diff --git a/add_arm_to_libomp_dylib.sh b/add_arm_to_libomp_dylib.sh index 99e32b0..40f657c 100755 --- a/add_arm_to_libomp_dylib.sh +++ b/add_arm_to_libomp_dylib.sh @@ -20,13 +20,14 @@ if [ "$(arch)" != "x86_64" ] && [ "$(arch)" != "i386" ]; then fi set -x # echo on +set -e # fail fast #mkdir x86lib mkdir armlib # download and unzip both x86 and arm libomp tarballs -#brew fetch --force --bottle-tag=x86_64_monterey libomp -brew fetch --force --bottle-tag=arm64_big_sur libomp +#brew fetch --retry --force --bottle-tag=x86_64_monterey libomp +brew fetch --retry --force --bottle-tag=arm64_big_sur libomp # untar #tar -xzf $(brew --cache --bottle-tag=x86_64_monterey libomp) --strip-components 2 -C x86lib From 093c2ad81de29454011b6cc47829b4a03367b401 Mon Sep 17 00:00:00 2001 From: Adam Lugowski Date: Sat, 14 Oct 2023 18:20:18 -0700 Subject: [PATCH 147/193] Add an upload destination input to wheels workflow manual dispatch (#112) Add an upload destination input to wheels workflow manual dispatch --- .github/workflows/wheels.yml | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 8c02dc5..be6bfd8 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -6,6 +6,15 @@ on: # Enable Run Workflow button in GitHub UI workflow_dispatch: + inputs: + # Manual dispatch allows optional upload of wheels to PyPI + upload_dest: + type: choice + description: Upload wheels to + options: + - No Upload + - PyPI + - Test PyPI push: branches: [ main ] @@ -202,7 +211,7 @@ jobs: needs: [build_wheels, build_sdist] runs-on: ubuntu-latest # only upload releases to PyPI - if: github.repository == 'GraphBLAS/python-suitesparse-graphblas' && github.event_name == 'release' && github.event.action == 'published' + if: github.repository == 'GraphBLAS/python-suitesparse-graphblas' && ((github.event_name == 'release' && github.event.action == 'published') || (github.event_name == 'workflow_dispatch' && github.event.inputs.upload_dest != 'No Upload')) steps: - uses: actions/setup-python@v4 @@ -214,14 +223,20 @@ jobs: name: artifact path: dist + # Upload to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 + if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.upload_dest == 'PyPI') with: # PyPI does not allow replacing a file. Without this flag the entire action fails if even a single duplicate exists. skip-existing: true verbose: true - # Real PyPI: password: ${{ secrets.PYPI_TOKEN }} - # Test PyPI: - # password: ${{ secrets.TEST_PYPI_API_TOKEN }} - # repository-url: https://test.pypi.org/legacy/ + # Upload to Test PyPI + - uses: pypa/gh-action-pypi-publish@release/v1 + if: github.event_name == 'workflow_dispatch' && github.event.inputs.upload_dest == 'Test PyPI' + with: + # PyPI does not allow replacing a file. Without this flag the entire action fails if even a single duplicate exists. + skip-existing: true + verbose: true + repository-url: https://test.pypi.org/legacy/ From decaf1502d1a6053ba7b829e61b5ed796139ff2a Mon Sep 17 00:00:00 2001 From: Adam Lugowski Date: Sun, 15 Oct 2023 19:24:02 -0700 Subject: [PATCH 148/193] Add id-token permission for PyPI trusted publishing (#113) --- .github/workflows/wheels.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index be6bfd8..6127d17 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -25,6 +25,10 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true +permissions: + # For PyPI Trusted Publisher + id-token: write + jobs: build_sdist: name: Build SDist @@ -225,6 +229,7 @@ jobs: # Upload to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 + name: Upload to PyPI if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.upload_dest == 'PyPI') with: # PyPI does not allow replacing a file. Without this flag the entire action fails if even a single duplicate exists. @@ -234,6 +239,7 @@ jobs: # Upload to Test PyPI - uses: pypa/gh-action-pypi-publish@release/v1 + name: Upload to Test PyPI if: github.event_name == 'workflow_dispatch' && github.event.inputs.upload_dest == 'Test PyPI' with: # PyPI does not allow replacing a file. Without this flag the entire action fails if even a single duplicate exists. From 70fe2043a1082e494e7ee1d0b3b5461951dbeb5b Mon Sep 17 00:00:00 2001 From: Adam Lugowski Date: Wed, 1 Nov 2023 14:47:29 -0700 Subject: [PATCH 149/193] Manage GraphBLAS version with GB_VERSION.txt file (#114) * Manage GraphBLAS version with GB_VERSION.txt file Also include a script to fetch latest upstream GraphBLAS version, as well as a workflow that can auto-update this file on a schedule. * Add shebang and drop unnecessary variable --- .github/workflows/test.yml | 11 ++--- .github/workflows/update_graphblas.yml | 61 +++++++++++++++++++++++++ .github/workflows/wheels.yml | 12 +++-- GB_VERSION.txt | 1 + latest_suitesparse_graphblas_version.py | 27 +++++++++++ 5 files changed, 101 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/update_graphblas.yml create mode 100644 GB_VERSION.txt create mode 100644 latest_suitesparse_graphblas_version.py diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 24498e8..8c6249f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,7 +19,6 @@ jobs: # os: ["ubuntu-latest"] # source: ["source"] python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] - graphblas-version: ["8.2.1"] steps: - name: Checkout uses: actions/checkout@v4 @@ -38,19 +37,19 @@ jobs: - name: GraphBLAS (from conda-forge) if: (contains(matrix.source, 'conda-forge')) run: | - conda install graphblas=${{ matrix.graphblas-version }} + conda install graphblas=$(cat GB_VERSION.txt) - name: GraphBLAS (from source) if: (contains(matrix.source, 'source')) run: | # From release (does not work with beta versions) - GRAPHBLAS_PREFIX=${CONDA_PREFIX} bash suitesparse.sh refs/tags/${{ matrix.graphblas-version }}.0 + GRAPHBLAS_PREFIX=${CONDA_PREFIX} bash suitesparse.sh refs/tags/$(cat GB_VERSION.txt).0 # From tag - # curl -L https://github.com/DrTimothyAldenDavis/GraphBLAS/archive/refs/tags/v${{ matrix.graphblas-version }}.tar.gz | tar xzf - - # pushd GraphBLAS-${{ matrix.graphblas-version }}/build + # curl -L https://github.com/DrTimothyAldenDavis/GraphBLAS/archive/refs/tags/v$(cat GB_VERSION.txt).tar.gz | tar xzf - + # pushd GraphBLAS-$(cat GB_VERSION.txt)/build # From branch - # curl -L https://github.com/DrTimothyAldenDavis/GraphBLAS/tarball/${{ matrix.graphblas-version }} | tar xzf - + # curl -L https://github.com/DrTimothyAldenDavis/GraphBLAS/tarball/$(cat GB_VERSION.txt) | tar xzf - # pushd DrTim*/build # echo ${CONDA_PREFIX} diff --git a/.github/workflows/update_graphblas.yml b/.github/workflows/update_graphblas.yml new file mode 100644 index 0000000..b2ecb47 --- /dev/null +++ b/.github/workflows/update_graphblas.yml @@ -0,0 +1,61 @@ +# Checks for latest SuiteSparse:GraphBLAS version on GitHub and creates a PR to update the version used by this repo. +name: Check for GraphBLAS updates + +# In addition to permissions below, must explicitly allow GitHub Actions to create pull requests. +# This setting can be found in a repository's settings under Actions > General > Workflow permissions. +# https://github.com/peter-evans/create-pull-request#workflow-permissions +permissions: + contents: write + pull-requests: write + +on: + # Note: Workflow must run at least once to appear in workflows list. + # Push to the bot's branch to trigger workflow. + push: + branches: [ auto_update_gb_version ] + + # Note: Workflow must exist in main branch for workflow dispatch option to appear + workflow_dispatch: + + # Enable cron to check for updates once a day: +# schedule: +# - cron: '0 0 * * *' + +jobs: + gb_version_check: + name: Check for GraphBLAS update + if: github.repository == 'GraphBLAS/python-suitesparse-graphblas' || github.repository == 'alugowski/python-suitesparse-graphblas' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: actions/setup-python@v4 + with: + python-version: "3.11" + + - name: Get latest GraphBLAS version + run: | + python latest_suitesparse_graphblas_version.py > GB_VERSION.txt + echo "GB_VERSION=$(cat GB_VERSION.txt)" >> $GITHUB_ENV + shell: bash + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v5 + with: + # See documentation: https://github.com/peter-evans/create-pull-request + # Action behavior: https://github.com/peter-evans/create-pull-request#action-behaviour + # TL;DR: create a PR if there is a diff and keep it up to date with changes as they arrive. + # + # To trigger tests with this PR set up a Personal Access Token as in the docs above. +# token: ${{ secrets.PAT }} + add-paths: GB_VERSION.txt + commit-message: Update to GraphBLAS ${{ env.GB_VERSION }} + title: Update to SuiteSparse:GraphBLAS ${{ env.GB_VERSION }} + body: | + Auto-generated by `update_graphblas.yml` + + Close then reopen this PR to trigger tests. See [here](https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs) for why automatic triggers do not work. + branch: auto_update_gb_version + delete-branch: true diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 6127d17..3955c35 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -52,10 +52,6 @@ jobs: build_wheels: name: Wheels - ${{ matrix.cibw_archs }} ${{ matrix.arch_note}} - ${{ matrix.os }} runs-on: ${{ matrix.os }} - env: - # graphblas version to use if another one is not provided - default-graphblas-version: "8.2.1" - strategy: fail-fast: false matrix: @@ -123,7 +119,13 @@ jobs: # Ask suitesparse.sh to compile in the fastest way possible and provide a GB version to build run: | echo "SUITESPARSE_FASTEST_BUILD=1" >> $GITHUB_ENV - echo "GB_VERSION_REF=refs/tags/${{ env.default-graphblas-version }}.0" >> $GITHUB_ENV + shell: bash + + - name: Setup GraphBLAS version from GB_VERSION.txt + # Use GraphBLAS version specified in GB_VERSION.txt unless specified in a git tag (next workflow step). + # Git tag method required for uploads to PyPI. + if: github.event_name != 'release' && github.event.inputs.upload_dest != 'PyPI' + run: echo "GB_VERSION_REF=refs/tags/$(cat GB_VERSION.txt).0" >> $GITHUB_ENV shell: bash - name: Setup GraphBLAS version from git tag diff --git a/GB_VERSION.txt b/GB_VERSION.txt new file mode 100644 index 0000000..2b0aa21 --- /dev/null +++ b/GB_VERSION.txt @@ -0,0 +1 @@ +8.2.1 diff --git a/latest_suitesparse_graphblas_version.py b/latest_suitesparse_graphblas_version.py new file mode 100644 index 0000000..dbcc310 --- /dev/null +++ b/latest_suitesparse_graphblas_version.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python + +""" +Find and print the latest version of SuiteSparse:GraphBLAS as published in this repo: +https://github.com/DrTimothyAldenDavis/GraphBLAS +""" + +import json +from urllib.error import URLError +from urllib.request import urlopen + +# fetch release data from GraphBLAS repo +for _ in range(5): + try: + with urlopen( + "https://api.github.com/repos/DrTimothyAldenDavis/GraphBLAS/releases/latest" + ) as url: + latest_release = json.load(url) + break + except URLError: + # sleep before trying again + from time import sleep + + sleep(1) + +version = latest_release["tag_name"].lstrip("v") +print(version) From 8020eb1eadbe830e5b49517c9bc8e65a13f69232 Mon Sep 17 00:00:00 2001 From: Adam Lugowski Date: Fri, 15 Dec 2023 13:20:40 -0800 Subject: [PATCH 150/193] Move libomp script to monterey (#117) --- add_arm_to_libomp_dylib.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/add_arm_to_libomp_dylib.sh b/add_arm_to_libomp_dylib.sh index 40f657c..d452ac1 100755 --- a/add_arm_to_libomp_dylib.sh +++ b/add_arm_to_libomp_dylib.sh @@ -27,11 +27,11 @@ mkdir armlib # download and unzip both x86 and arm libomp tarballs #brew fetch --retry --force --bottle-tag=x86_64_monterey libomp -brew fetch --retry --force --bottle-tag=arm64_big_sur libomp +brew fetch --retry --force --bottle-tag=arm64_monterey libomp # untar #tar -xzf $(brew --cache --bottle-tag=x86_64_monterey libomp) --strip-components 2 -C x86lib -tar -xzf $(brew --cache --bottle-tag=arm64_big_sur libomp) --strip-components 2 -C armlib +tar -xzf $(brew --cache --bottle-tag=arm64_monterey libomp) --strip-components 2 -C armlib # ARM and x86 dylibs have different install names due to different brew install directories. # The x86 install name will be expected so make the ARM install name match. From a955997332c897c14841d96ae1225901b0c9fea7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 15 Dec 2023 21:22:51 +0000 Subject: [PATCH 151/193] Bump conda-incubator/setup-miniconda from 2 to 3 (#115) --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8c6249f..8bbc36a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,7 +25,7 @@ jobs: with: fetch-depth: 0 - name: Conda - uses: conda-incubator/setup-miniconda@v2 + uses: conda-incubator/setup-miniconda@v3 with: auto-update-conda: true python-version: ${{ matrix.python-version }} From 95e97bddb35983054fdaf453299c822b36b291cb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 15 Dec 2023 22:25:33 +0000 Subject: [PATCH 152/193] Bump actions/setup-python from 4 to 5 (#116) --- .github/workflows/lint.yml | 2 +- .github/workflows/update_graphblas.yml | 2 +- .github/workflows/wheels.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 7e85047..595d77e 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: "3.10" - uses: pre-commit/action@v3.0.0 diff --git a/.github/workflows/update_graphblas.yml b/.github/workflows/update_graphblas.yml index b2ecb47..6963532 100644 --- a/.github/workflows/update_graphblas.yml +++ b/.github/workflows/update_graphblas.yml @@ -31,7 +31,7 @@ jobs: with: fetch-depth: 0 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: "3.11" diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 3955c35..123a017 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -220,7 +220,7 @@ jobs: if: github.repository == 'GraphBLAS/python-suitesparse-graphblas' && ((github.event_name == 'release' && github.event.action == 'published') || (github.event_name == 'workflow_dispatch' && github.event.inputs.upload_dest != 'No Upload')) steps: - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: "3.x" From 9bc5787c4ae23c0a1736768dd286bd42ad0f629e Mon Sep 17 00:00:00 2001 From: Adam Lugowski Date: Mon, 18 Dec 2023 00:13:46 -0800 Subject: [PATCH 153/193] Bump actions/upload-artifact and download-artifact from 3 to 4 (#121) --- .github/workflows/wheels.yml | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 123a017..d9f3bee 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -44,8 +44,9 @@ jobs: - name: Check metadata run: pipx run twine check dist/* - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: + name: sdist path: dist/*.tar.gz @@ -195,22 +196,12 @@ jobs: CIBW_TEST_SKIP: ${{ matrix.cibw_test_skip }} - - uses: actions/upload-artifact@v3 - id: uploadAttempt1 - continue-on-error: true + - uses: actions/upload-artifact@v4 with: + name: wheels-${{ matrix.os }}-${{ matrix.cibw_archs }}${{ matrix.arch_note}} path: wheelhouse/*.whl if-no-files-found: error - # Retry upload if first attempt failed. This happens somewhat randomly and for irregular reasons. - # Logic is a duplicate of previous step. - - uses: actions/upload-artifact@v3 - id: uploadAttempt2 - if: steps.uploadAttempt1.outcome == 'failure' - continue-on-error: false - with: - path: wheelhouse/*.whl - if-no-files-found: error upload_all: name: Upload to PyPI @@ -224,10 +215,12 @@ jobs: with: python-version: "3.x" - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: - name: artifact - path: dist + path: dist_artifacts + + - name: Flatten artifacts to dist/ + run: mkdir dist && find dist_artifacts -type f -exec mv {} dist \; # Upload to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 From 8379cfa4e1a2c346fb4c9ad76db737ebafd86247 Mon Sep 17 00:00:00 2001 From: Adam Lugowski Date: Mon, 18 Dec 2023 21:59:38 -0800 Subject: [PATCH 154/193] Simplify download-artifact usage thanks to v4.1 `merge-multipole` input (#122) --- .github/workflows/wheels.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index d9f3bee..fb7acdf 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -217,10 +217,8 @@ jobs: - uses: actions/download-artifact@v4 with: - path: dist_artifacts - - - name: Flatten artifacts to dist/ - run: mkdir dist && find dist_artifacts -type f -exec mv {} dist \; + path: dist + merge-multiple: true # Upload to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 From 2dc37779a95efea0889776eb633a69a8c355e89b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 12:54:50 -0800 Subject: [PATCH 155/193] Bump pre-commit/action from 3.0.0 to 3.0.1 (#124) * Bump pre-commit/action from 3.0.0 to 3.0.1 Bumps [pre-commit/action](https://github.com/pre-commit/action) from 3.0.0 to 3.0.1. - [Release notes](https://github.com/pre-commit/action/releases) - [Commits](https://github.com/pre-commit/action/compare/v3.0.0...v3.0.1) --- updated-dependencies: - dependency-name: pre-commit/action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Add pycparser to environment.yml --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Adam Lugowski --- .github/workflows/lint.yml | 2 +- continuous_integration/environment.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 595d77e..4140839 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -18,4 +18,4 @@ jobs: - uses: actions/setup-python@v5 with: python-version: "3.10" - - uses: pre-commit/action@v3.0.0 + - uses: pre-commit/action@v3.0.1 diff --git a/continuous_integration/environment.yml b/continuous_integration/environment.yml index a5c0d41..00cf29e 100644 --- a/continuous_integration/environment.yml +++ b/continuous_integration/environment.yml @@ -10,3 +10,4 @@ dependencies: - pytest - pytest-randomly - coverage + - pycparser From 045d489732638ce416c007bfdad102ce61d7de53 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 12:55:08 -0800 Subject: [PATCH 156/193] Bump peter-evans/create-pull-request from 5 to 6 (#123) Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 5 to 6. - [Release notes](https://github.com/peter-evans/create-pull-request/releases) - [Commits](https://github.com/peter-evans/create-pull-request/compare/v5...v6) --- updated-dependencies: - dependency-name: peter-evans/create-pull-request dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/update_graphblas.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update_graphblas.yml b/.github/workflows/update_graphblas.yml index 6963532..c524aa0 100644 --- a/.github/workflows/update_graphblas.yml +++ b/.github/workflows/update_graphblas.yml @@ -42,7 +42,7 @@ jobs: shell: bash - name: Create Pull Request - uses: peter-evans/create-pull-request@v5 + uses: peter-evans/create-pull-request@v6 with: # See documentation: https://github.com/peter-evans/create-pull-request # Action behavior: https://github.com/peter-evans/create-pull-request#action-behaviour From 4bf5c725aa19f50949abf28cf9e181d79de3329a Mon Sep 17 00:00:00 2001 From: Adam Lugowski Date: Mon, 14 Oct 2024 06:14:58 -0700 Subject: [PATCH 157/193] Update9.1.0 (#128) * Update to SuiteSparse:GraphBLAS 9.1.0 * maybe fix? (path and extra constant) * Update default include path to include "suitesparse" * Try this * Maybe don't need this anymore for arm on mac os * Explicit macos x86 and arm runners * Add dir dump * Look in "/usr/local" * Try installing to prefix * Cmake from . * Add lib64 * Try installing to . instead of /tmp * Set MACOSX_DEPLOYMENT_TARGET * Try installing to /usr/local/graphblas * Try installing to {package} * Fix * Add prints * Add print * Try installing to . * parent * retry * Disable JIT on Windows * retry * Fix if * Revert to sys install * Fix sudo * Disable JIT on Windows * tweaks * MSVC complex values * Revert prints * Silence workflow warnings * Delete no longer used script * Undo run tests on push * Make linter happy * Linter * Support both suitesparse.sh and conda install paths * Fix cibw_test_skip typo * Build with numpy 2; add Python 3.13; drop Python 3.8 * Bump * Try setuptools<74 * experiment w/ setuptools as runtime dep * undo * Update cibuildwheel We need https://github.com/pypa/cibuildwheel/issues/1915 to `yum install` * Use cibuildwheel 2.21, not 2.21.3 * Delete unnecessary code b/c we dropped Python 3.8 --------- Co-authored-by: Erik Welch --- .github/workflows/test.yml | 2 +- .github/workflows/wheels.yml | 26 +- .pre-commit-config.yaml | 24 +- GB_VERSION.txt | 2 +- add_arm_to_libomp_dylib.sh | 53 -- build_graphblas_cffi.py | 24 +- pyproject.toml | 19 +- suitesparse.sh | 26 +- suitesparse_graphblas/create_headers.py | 5 +- suitesparse_graphblas/suitesparse_graphblas.h | 543 ++++++++++++------ .../suitesparse_graphblas_no_complex.h | 509 ++++++++++------ 11 files changed, 783 insertions(+), 450 deletions(-) delete mode 100755 add_arm_to_libomp_dylib.sh diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8bbc36a..b79df03 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,7 +18,7 @@ jobs: source: ["conda-forge"] # os: ["ubuntu-latest"] # source: ["source"] - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index fb7acdf..2565b10 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -84,16 +84,14 @@ jobs: cibw_skip: "pp* *musl*" # macOS x86 - - os: macos-latest + # Note: keep as old as possible as due to libomp this will be the oldest supported macOS version. + - os: macos-12 cibw_archs: "x86_64" - # macOS Apple Silicon cross-compiled on x86 macOS runner. - # GitHub does not offer Apple Silicon yet (only for self-hosted). - # See https://github.com/github/roadmap/issues/528 - - os: macos-latest + # macOS Apple Silicon + # Note: keep as old as possible as due to libomp this will be the oldest supported macOS version. + - os: macos-14 cibw_archs: "arm64" - # Skip macOS ARM tests on Intel runner. - cibw_test_skip: "*-macosx_arm64" steps: - uses: actions/checkout@v4 @@ -139,17 +137,15 @@ jobs: if: contains(matrix.os, 'macos') # Install coreutils which includes `nproc` used by `make -j` in suitesparse.sh # - # GitHub actions comes with libomp already installed, but for its native arch only. Must build universal one - # manually so that both x86 and arm builds can be built. + # Explicitly install libomp to be clear about the dependency. + # + # libomp determines the minimum macOS version that we can build for run: | brew fetch --retry coreutils && brew install coreutils - brew fetch --retry libomp && brew install libomp - if [[ ${{ matrix.cibw_archs }} == "arm64" ]] ; then - echo "Building universal libomp manually" - sh add_arm_to_libomp_dylib.sh || exit 1 - fi + brew fetch --retry libomp && brew reinstall libomp + echo MACOSX_DEPLOYMENT_TARGET=$(otool -l $(brew --prefix libomp)/lib/libomp.dylib | grep minos | awk '{print $2}') >> $GITHUB_ENV - - uses: pypa/cibuildwheel@v2.16 + - uses: pypa/cibuildwheel@v2.21 with: output-dir: wheelhouse env: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 64bed06..0565220 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,7 @@ default_language_version: python: python3 repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v5.0.0 hooks: - id: check-added-large-files - id: check-ast @@ -20,43 +20,43 @@ repos: - id: mixed-line-ending # - id: trailing-whitespace - repo: https://github.com/abravalheri/validate-pyproject - rev: v0.14 + rev: v0.20.2 hooks: - id: validate-pyproject name: Validate pyproject.toml - repo: https://github.com/PyCQA/autoflake - rev: v2.2.1 + rev: v2.3.1 hooks: - id: autoflake args: [--in-place] - repo: https://github.com/pycqa/isort - rev: 5.12.0 + rev: 5.13.2 hooks: - id: isort - repo: https://github.com/asottile/pyupgrade - rev: v3.13.0 + rev: v3.18.0 hooks: - id: pyupgrade - args: [--py38-plus] + args: [--py39-plus] # - repo: https://github.com/MarcoGorelli/auto-walrus # rev: v0.2.2 # hooks: # - id: auto-walrus # args: [--line-length, "100"] - repo: https://github.com/psf/black - rev: 23.9.1 + rev: 24.10.0 hooks: - id: black # - id: black-jupyter - repo: https://github.com/PyCQA/flake8 - rev: 6.1.0 + rev: 7.1.1 hooks: - id: flake8 additional_dependencies: &flake8_dependencies # These versions need updated manually - - flake8==6.1.0 - - flake8-comprehensions==3.14.0 - - flake8-bugbear==23.9.16 + - flake8==7.1.1 + - flake8-comprehensions==3.15.0 + - flake8-bugbear==24.8.19 # - flake8-simplify==0.20.0 - repo: https://github.com/asottile/yesqa rev: v1.5.0 @@ -71,6 +71,6 @@ repos: # - id: pyroma # args: [-n, "10", .] - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v5.0.0 hooks: - id: no-commit-to-branch # no commit directly to main diff --git a/GB_VERSION.txt b/GB_VERSION.txt index 2b0aa21..47da986 100644 --- a/GB_VERSION.txt +++ b/GB_VERSION.txt @@ -1 +1 @@ -8.2.1 +9.1.0 diff --git a/add_arm_to_libomp_dylib.sh b/add_arm_to_libomp_dylib.sh deleted file mode 100755 index d452ac1..0000000 --- a/add_arm_to_libomp_dylib.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh -# Construct a universal2 version of homebrew's libomp. -# -# Homebrew's libomp works well to patch Apple clang's missing OpenMP support. The problem is a combination of: -# - Brew installs libomp built for x86 *or* ARM, matching the architecture of the machine it is running on. -# - GitHub Actions only has x86 runners as of now. Check back in Q4 2023. https://github.com/github/roadmap/issues/528 -# - The linker will select the first found libomp, and if that version does not include the expected architecture then -# linking will fail. -# -# One solution is to build a universal2 version of libomp that includes both architectures. That's what this script -# does. It adds the ARM version of libomp to the x86 version. -# -# This script assumes it is running on x86 with x86 libomp already installed. - -if [ "$(arch)" != "x86_64" ] && [ "$(arch)" != "i386" ]; then - echo "Not running on x86 as expected. Running on:" - arch - echo "If the above says arm64 then this hack is no longer necessary. Remove this script from the build." - exit 1; -fi - -set -x # echo on -set -e # fail fast - -#mkdir x86lib -mkdir armlib - -# download and unzip both x86 and arm libomp tarballs -#brew fetch --retry --force --bottle-tag=x86_64_monterey libomp -brew fetch --retry --force --bottle-tag=arm64_monterey libomp - -# untar -#tar -xzf $(brew --cache --bottle-tag=x86_64_monterey libomp) --strip-components 2 -C x86lib -tar -xzf $(brew --cache --bottle-tag=arm64_monterey libomp) --strip-components 2 -C armlib - -# ARM and x86 dylibs have different install names due to different brew install directories. -# The x86 install name will be expected so make the ARM install name match. -X86_INSTALL_NAME="$(otool -X -D $(brew --prefix libomp)/lib/libomp.dylib)" -install_name_tool -id "${X86_INSTALL_NAME}" armlib/lib/libomp.dylib -codesign --force -s - armlib/lib/libomp.dylib - -# merge the downloaded (arm) libomp with the already installed (x86) libomp to create a universal libomp -lipo armlib/lib/libomp.dylib $(brew --prefix libomp)/lib/libomp.dylib -output libomp.dylib -create - -# print contents of universal library for reference -otool -arch all -L libomp.dylib - -# replace the x86-only libomp with the newly-created universal one -cp -f libomp.dylib $(brew --prefix libomp)/lib - -# clean up -rm libomp.dylib -rm -rf armlib diff --git a/build_graphblas_cffi.py b/build_graphblas_cffi.py index 1c73e1c..7548102 100644 --- a/build_graphblas_cffi.py +++ b/build_graphblas_cffi.py @@ -14,17 +14,30 @@ # Expected subdirectories: include/ (contains GraphBLAS.h), lib/, and bin/ (on Windows only) # Otherwise fallback to default system folders. graphblas_root = os.environ.get("GraphBLAS_ROOT", None) + if not graphblas_root: # Windows wheels.yml configures suitesparse.sh to install GraphBLAS to "C:\\GraphBLAS". - graphblas_root = "C:\\GraphBLAS" if is_win else sys.prefix - -include_dirs = [os.path.join(graphblas_root, "include")] -library_dirs = [os.path.join(graphblas_root, "lib")] + if is_win: + graphblas_root = "C:\\GraphBLAS" + elif Path("/usr/local/include/suitesparse").exists(): + # SuiteSparse:GraphBLAS 9.1+ built by suitesparse.sh + graphblas_root = "/usr/local" + else: + # Conda install + graphblas_root = sys.prefix + +include_dirs = [ + os.path.join(graphblas_root, "include"), + os.path.join(graphblas_root, "include", "suitesparse"), +] +library_dirs = [os.path.join(graphblas_root, "lib"), os.path.join(graphblas_root, "lib64")] if is_win: include_dirs.append(os.path.join(sys.prefix, "Library", "include")) + include_dirs.append(os.path.join(sys.prefix, "Library", "include", "suitesparse")) library_dirs.append(os.path.join(sys.prefix, "Library", "lib")) include_dirs.append(os.path.join(graphblas_root, "include")) + include_dirs.append(os.path.join(graphblas_root, "include", "suitesparse")) library_dirs.append(os.path.join(graphblas_root, "lib")) library_dirs.append(os.path.join(graphblas_root, "bin")) @@ -68,6 +81,9 @@ def get_extension(apply_msvc_patch: bool = None, extra_compile_args=()): msvc_code = msvc_code.replace("double _Complex", "_Dcomplex") code_path.write_text(msvc_code) + # Hack: tell GraphBLAS.h that we need MSVC-style complex values + extra_compile_args = list(extra_compile_args) + ["-DGxB_HAVE_COMPLEX_MSVC"] + return Extension( "suitesparse_graphblas._graphblas", [os.path.join("suitesparse_graphblas", "_graphblas.c")], diff --git a/pyproject.toml b/pyproject.toml index bff0249..3a47125 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,15 +1,13 @@ [build-system] build-backend = "setuptools.build_meta" requires = [ - "setuptools >=64", + # setuptools<74 until PyPy vendors cffi 1.15.1 + "setuptools >=64, <74", "setuptools-git-versioning", "wheel", "cffi>=1.11", "cython", - "oldest-supported-numpy; platform_python_implementation != 'PyPy'", - # Inspired by SciPy: unpin numpy version for PyPy builds, - # as oldest-supported-numpy does not take PyPy into account. - "numpy; platform_python_implementation=='PyPy'", + "numpy>=2.0", ] [project] @@ -17,7 +15,7 @@ name = "suitesparse-graphblas" dynamic = ["version"] description = "SuiteSparse:GraphBLAS Python bindings." readme = "README.md" -requires-python = ">=3.8" +requires-python = ">=3.9" license = {file = "LICENSE"} authors = [ {name = "Erik Welch", email = "erik.n.welch@gmail.com"}, @@ -53,11 +51,11 @@ classifiers = [ "Operating System :: Microsoft :: Windows", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3 :: Only", "Intended Audience :: Developers", "Intended Audience :: Other Audience", @@ -68,9 +66,8 @@ classifiers = [ "Topic :: Software Development :: Libraries :: Python Modules", ] dependencies = [ - # These are super-old; can/should we update them? - "cffi>=1.11", - "numpy>=1.19", + "cffi>=1.15", + "numpy>=1.23", ] [project.urls] homepage = "https://github.com/GraphBLAS/python-suitesparse-graphblas" @@ -96,7 +93,7 @@ dirty_template = "{tag}+{ccount}.g{sha}.dirty" [tool.black] line-length = 100 -target-version = ["py38", "py39", "py310", "py311"] +target-version = ["py39", "py310", "py311", "py312", "py313"] [tool.isort] sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"] diff --git a/suitesparse.sh b/suitesparse.sh index 2264ef0..7385206 100755 --- a/suitesparse.sh +++ b/suitesparse.sh @@ -113,11 +113,29 @@ if [ -n "${SUITESPARSE_FASTEST_BUILD}" ]; then cmake_params+=(-DCMAKE_CUDA_DEV=1) fi -# Use `-DJITINIT=2` so that the JIT functionality is available, but disabled by default. -# Level 2, "run", means that pre-JIT kernels may be used, which does not require a compiler at runtime. -cmake .. -DJITINIT=2 -DCMAKE_BUILD_TYPE=Release -G 'Unix Makefiles' "${cmake_params[@]}" +if [ -n "${CMAKE_GNUtoMS}" ]; then + # Windows options + echo "Skipping JIT on Windows for now because it fails to build." + cmake_params+=(-DGRAPHBLAS_USE_JIT=OFF) +else + # Use `-DJITINIT=2` so that the JIT functionality is available, but disabled by default. + # Level 2, "run", means that pre-JIT kernels may be used, which does not require a compiler at runtime. + cmake_params+=(-DJITINIT=2) + + # Disable JIT here too to not segfault in tests + cmake_params+=(-DGRAPHBLAS_USE_JIT=OFF) +fi + +# some platforms require sudo for installation, some don't have sudo at all +if [ "$(uname)" == "Darwin" ]; then + SUDO=sudo +else + SUDO="" +fi + +cmake .. -DCMAKE_BUILD_TYPE=Release -G 'Unix Makefiles' "${cmake_params[@]}" make -j$NPROC -make install +$SUDO make install if [ -n "${CMAKE_GNUtoMS}" ]; then if [ -z "${GRAPHBLAS_PREFIX}" ]; then diff --git a/suitesparse_graphblas/create_headers.py b/suitesparse_graphblas/create_headers.py index 89c199c..d4d6afd 100644 --- a/suitesparse_graphblas/create_headers.py +++ b/suitesparse_graphblas/create_headers.py @@ -21,6 +21,7 @@ Run `python create_headers.py --help` to see more help. """ + import argparse import os import re @@ -325,6 +326,7 @@ def groupby(index, seq): "RMM_WRAP_H", "GXB_COMPLEX_H", "GxB_STATIC_INLINE_VOID", + "GxB_HAVE_COMPLEX_C99", # deprecated "GxB_HYPER", } @@ -633,6 +635,7 @@ def handle_function_node(node): "init": "core", "wait": "core", "deserialize": "core", + "Serialized": "core", # Added in version 9 }[group] return { "name": node.name, @@ -782,7 +785,7 @@ def main(): parser.add_argument( "--graphblas", help="Path to GraphBLAS.h of SuiteSparse. Default will look in Python prefix path.", - default=os.path.join(sys.prefix, "include", "GraphBLAS.h"), + default=os.path.join(sys.prefix, "include", "suitesparse", "GraphBLAS.h"), ) parser.add_argument( "--show-skipped", diff --git a/suitesparse_graphblas/suitesparse_graphblas.h b/suitesparse_graphblas/suitesparse_graphblas.h index eb5db2f..7aebc0b 100644 --- a/suitesparse_graphblas/suitesparse_graphblas.h +++ b/suitesparse_graphblas/suitesparse_graphblas.h @@ -2,6 +2,7 @@ /* GrB typedefs */ typedef struct GB_BinaryOp_opaque *GrB_BinaryOp; typedef struct GB_Descriptor_opaque *GrB_Descriptor; +typedef struct GB_Global_opaque *GrB_Global; typedef struct GB_IndexUnaryOp_opaque *GrB_IndexUnaryOp; typedef struct GB_Matrix_opaque *GrB_Matrix; typedef struct GB_Monoid_opaque *GrB_Monoid; @@ -40,10 +41,12 @@ typedef enum typedef enum { + GrB_DEFAULT = 0, GxB_DEFAULT = 0, GrB_REPLACE = 1, GrB_COMP = 2, GrB_STRUCTURE = 4, + GrB_COMP_STRUCTURE = 6, GrB_TRAN = 3, GxB_AxB_GUSTAVSON = 7081, GxB_AxB_DOT = 7083, @@ -52,6 +55,39 @@ typedef enum GxB_SECURE_IMPORT = 7080 } GrB_Desc_Value; +typedef enum +{ + GrB_OUTP_FIELD = 0, + GrB_MASK_FIELD = 1, + GrB_INP0_FIELD = 2, + GrB_INP1_FIELD = 3, + GrB_NAME = 10, + GrB_LIBRARY_VER_MAJOR = 11, + GrB_LIBRARY_VER_MINOR = 12, + GrB_LIBRARY_VER_PATCH = 13, + GrB_API_VER_MAJOR = 14, + GrB_API_VER_MINOR = 15, + GrB_API_VER_PATCH = 16, + GrB_BLOCKING_MODE = 17, + GrB_STORAGE_ORIENTATION_HINT = 100, + GrB_EL_TYPE_CODE = 102, + GrB_EL_TYPE_STRING = 106, + GrB_INP0_TYPE_CODE = 103, + GrB_INP1_TYPE_CODE = 104, + GrB_OUTP_TYPE_CODE = 105, + GrB_INP0_TYPE_STRING = 107, + GrB_INP1_TYPE_STRING = 108, + GrB_OUTP_TYPE_STRING = 109, + GrB_SIZE = 110, + GxB_JIT_C_NAME = 7041, + GxB_JIT_C_DEFINITION = 7042, + GxB_MONOID_IDENTITY = 7043, + GxB_MONOID_TERMINAL = 7044, + GxB_MONOID_OPERATOR = 7045, + GxB_SEMIRING_MONOID = 7046, + GxB_SEMIRING_MULTIPLY = 7047 +} GrB_Field; + typedef enum { GrB_CSR_FORMAT = 0, @@ -72,6 +108,7 @@ typedef enum GrB_DIMENSION_MISMATCH = -6, GrB_OUTPUT_NOT_EMPTY = -7, GrB_NOT_IMPLEMENTED = -8, + GrB_ALREADY_SET = -9, GrB_PANIC = -101, GrB_OUT_OF_MEMORY = -102, GrB_INSUFFICIENT_SPACE = -103, @@ -88,6 +125,32 @@ typedef enum GxB_BLOCKING_GPU = 7098 } GrB_Mode; +typedef enum +{ + GrB_ROWMAJOR = 0, + GrB_COLMAJOR = 1, + GrB_BOTH = 2, + GrB_UNKNOWN = 3 +} GrB_Orientation; + +typedef enum +{ + GrB_UDT_CODE = 0, + GrB_BOOL_CODE = 1, + GrB_INT8_CODE = 2, + GrB_UINT8_CODE = 3, + GrB_INT16_CODE = 4, + GrB_UINT16_CODE = 5, + GrB_INT32_CODE = 6, + GrB_UINT32_CODE = 7, + GrB_INT64_CODE = 8, + GrB_UINT64_CODE = 9, + GrB_FP32_CODE = 10, + GrB_FP64_CODE = 11, + GxB_FC32_CODE = 7070, + GxB_FC64_CODE = 7071 +} GrB_Type_Code; + typedef enum { GrB_COMPLETE = 0, @@ -121,6 +184,7 @@ typedef enum typedef enum { GxB_HYPER_SWITCH = 7000, + GxB_HYPER_HASH = 7048, GxB_BITMAP_SWITCH = 7001, GxB_FORMAT = 7002, GxB_MODE = 7003, @@ -139,6 +203,10 @@ typedef enum GxB_COMPILER_VERSION = 7016, GxB_COMPILER_NAME = 7017, GxB_LIBRARY_OPENMP = 7018, + GxB_MALLOC_FUNCTION = 7037, + GxB_CALLOC_FUNCTION = 7038, + GxB_REALLOC_FUNCTION = 7039, + GxB_FREE_FUNCTION = 7040, GxB_GLOBAL_NTHREADS = 7086, GxB_GLOBAL_CHUNK = 7087, GxB_GLOBAL_GPU_ID = 7088, @@ -157,12 +225,9 @@ typedef enum GxB_JIT_C_CMAKE_LIBS = 7031, GxB_JIT_USE_CMAKE = 7032, GxB_JIT_ERROR_LOG = 7033, + GxB_JIT_CUDA_PREFACE = 7100, GxB_SPARSITY_STATUS = 7034, - GxB_SPARSITY_CONTROL = 7036, - GxB_MALLOC_FUNCTION = 7037, - GxB_CALLOC_FUNCTION = 7038, - GxB_REALLOC_FUNCTION = 7039, - GxB_FREE_FUNCTION = 7040 + GxB_SPARSITY_CONTROL = 7036 } GxB_Option_Field; typedef enum @@ -176,6 +241,7 @@ typedef enum } GxB_Print_Level; /* GrB consts */ +extern const GrB_Global GrB_GLOBAL; extern const uint64_t *GrB_ALL; /* GxB consts */ @@ -2651,10 +2717,24 @@ extern GxB_SelectOp GxB_TRIU; /* binary */ GrB_Info GrB_BinaryOp_error(const char **error, const GrB_BinaryOp op); GrB_Info GrB_BinaryOp_free(GrB_BinaryOp *binaryop); +GrB_Info GrB_BinaryOp_get_INT32(GrB_BinaryOp, int32_t *, GrB_Field); +GrB_Info GrB_BinaryOp_get_SIZE(GrB_BinaryOp, size_t *, GrB_Field); +GrB_Info GrB_BinaryOp_get_String(GrB_BinaryOp, char *, GrB_Field); +GrB_Info GrB_BinaryOp_get_VOID(GrB_BinaryOp, void *, GrB_Field); GrB_Info GrB_BinaryOp_new(GrB_BinaryOp *binaryop, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype); +GrB_Info GrB_BinaryOp_set_INT32(GrB_BinaryOp, int32_t, GrB_Field); +GrB_Info GrB_BinaryOp_set_String(GrB_BinaryOp, char *, GrB_Field); +GrB_Info GrB_BinaryOp_set_VOID(GrB_BinaryOp, void *, GrB_Field, size_t); GrB_Info GrB_BinaryOp_wait(GrB_BinaryOp op, GrB_WaitMode waitmode); /* core */ +GrB_Info GrB_Global_get_INT32(GrB_Global, int32_t *, GrB_Field); +GrB_Info GrB_Global_get_SIZE(GrB_Global, size_t *, GrB_Field); +GrB_Info GrB_Global_get_String(GrB_Global, char *, GrB_Field); +GrB_Info GrB_Global_get_VOID(GrB_Global, void *, GrB_Field); +GrB_Info GrB_Global_set_INT32(GrB_Global, int32_t, GrB_Field); +GrB_Info GrB_Global_set_String(GrB_Global, char *, GrB_Field); +GrB_Info GrB_Global_set_VOID(GrB_Global, void *, GrB_Field, size_t); GrB_Info GrB_finalize(void); GrB_Info GrB_getVersion(unsigned int *version, unsigned int *subversion); GrB_Info GrB_init(GrB_Mode mode); @@ -2662,19 +2742,33 @@ GrB_Info GrB_init(GrB_Mode mode); /* descriptor */ GrB_Info GrB_Descriptor_error(const char **error, const GrB_Descriptor d); GrB_Info GrB_Descriptor_free(GrB_Descriptor *descriptor); +GrB_Info GrB_Descriptor_get_INT32(GrB_Descriptor, int32_t *, GrB_Field); +GrB_Info GrB_Descriptor_get_SIZE(GrB_Descriptor, size_t *, GrB_Field); +GrB_Info GrB_Descriptor_get_String(GrB_Descriptor, char *, GrB_Field); +GrB_Info GrB_Descriptor_get_VOID(GrB_Descriptor, void *, GrB_Field); GrB_Info GrB_Descriptor_new(GrB_Descriptor *descriptor); -GrB_Info GrB_Descriptor_set(GrB_Descriptor desc, GrB_Desc_Field field, GrB_Desc_Value val); +GrB_Info GrB_Descriptor_set(GrB_Descriptor, GrB_Desc_Field, GrB_Desc_Value); +GrB_Info GrB_Descriptor_set_INT32(GrB_Descriptor, int32_t, GrB_Field); +GrB_Info GrB_Descriptor_set_String(GrB_Descriptor, char *, GrB_Field); +GrB_Info GrB_Descriptor_set_VOID(GrB_Descriptor, void *, GrB_Field, size_t); GrB_Info GrB_Descriptor_wait(GrB_Descriptor desc, GrB_WaitMode waitmode); /* indexunary */ GrB_Info GrB_IndexUnaryOp_error(const char **error, const GrB_IndexUnaryOp op); GrB_Info GrB_IndexUnaryOp_free(GrB_IndexUnaryOp *op); +GrB_Info GrB_IndexUnaryOp_get_INT32(GrB_IndexUnaryOp, int32_t *, GrB_Field); +GrB_Info GrB_IndexUnaryOp_get_SIZE(GrB_IndexUnaryOp, size_t *, GrB_Field); +GrB_Info GrB_IndexUnaryOp_get_String(GrB_IndexUnaryOp, char *, GrB_Field); +GrB_Info GrB_IndexUnaryOp_get_VOID(GrB_IndexUnaryOp, void *, GrB_Field); GrB_Info GrB_IndexUnaryOp_new(GrB_IndexUnaryOp *op, GxB_index_unary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype); +GrB_Info GrB_IndexUnaryOp_set_INT32(GrB_IndexUnaryOp, int32_t, GrB_Field); +GrB_Info GrB_IndexUnaryOp_set_String(GrB_IndexUnaryOp, char *, GrB_Field); +GrB_Info GrB_IndexUnaryOp_set_VOID(GrB_IndexUnaryOp, void *, GrB_Field, size_t); GrB_Info GrB_IndexUnaryOp_wait(GrB_IndexUnaryOp op, GrB_WaitMode waitmode); /* matrix */ -GrB_Info GrB_Col_assign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); -GrB_Info GrB_Col_extract(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); +GrB_Info GrB_Col_assign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *Ilist, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); +GrB_Info GrB_Col_extract(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *Ilist, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); GrB_Info GrB_Matrix_apply(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_UnaryOp op, const GrB_Matrix A, const GrB_Descriptor desc); GrB_Info GrB_Matrix_apply_BinaryOp1st_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, bool x, const GrB_Matrix A, const GrB_Descriptor desc); GrB_Info GrB_Matrix_apply_BinaryOp1st_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, float x, const GrB_Matrix A, const GrB_Descriptor desc); @@ -2715,32 +2809,32 @@ GrB_Info GrB_Matrix_apply_IndexOp_UINT8(GrB_Matrix C, const GrB_Matrix Mask, con GrB_Info GrB_Matrix_apply_IndexOp_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint16_t y, const GrB_Descriptor desc); GrB_Info GrB_Matrix_apply_IndexOp_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint32_t y, const GrB_Descriptor desc); GrB_Info GrB_Matrix_apply_IndexOp_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint64_t y, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, double x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_build_BOOL(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const bool *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_FP32(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const float *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_FP64(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const double *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_INT8(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const int8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_INT16(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const int16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_INT32(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const int32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_INT64(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const int64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_UDT(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const void *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_UINT8(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const uint8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_UINT16(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const uint16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_UINT32(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const uint32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_UINT64(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const uint64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_assign(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, bool x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, float x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, double x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, void *x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_build_BOOL(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const bool *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_FP32(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const float *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_FP64(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const double *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_INT8(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const int8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_INT16(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const int16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_INT32(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const int32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_INT64(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const int64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_UDT(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const void *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_UINT8(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const uint8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_UINT16(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const uint16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_UINT32(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const uint32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_UINT64(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const uint64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); GrB_Info GrB_Matrix_clear(GrB_Matrix A); GrB_Info GrB_Matrix_deserialize(GrB_Matrix *C, GrB_Type type, const void *blob, GrB_Index blob_size); GrB_Info GrB_Matrix_diag(GrB_Matrix *C, const GrB_Vector v, int64_t k); @@ -2766,7 +2860,7 @@ GrB_Info GrB_Matrix_export_UINT8(GrB_Index *Ap, GrB_Index *Ai, uint8_t *Ax, GrB_ GrB_Info GrB_Matrix_export_UINT16(GrB_Index *Ap, GrB_Index *Ai, uint16_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); GrB_Info GrB_Matrix_export_UINT32(GrB_Index *Ap, GrB_Index *Ai, uint32_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); GrB_Info GrB_Matrix_export_UINT64(GrB_Index *Ap, GrB_Index *Ai, uint64_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -GrB_Info GrB_Matrix_extract(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_extract(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); GrB_Info GrB_Matrix_extractElement_BOOL(bool *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); GrB_Info GrB_Matrix_extractElement_FP32(float *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); GrB_Info GrB_Matrix_extractElement_FP64(double *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); @@ -2780,19 +2874,24 @@ GrB_Info GrB_Matrix_extractElement_UINT8(uint8_t *x, const GrB_Matrix A, GrB_Ind GrB_Info GrB_Matrix_extractElement_UINT16(uint16_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); GrB_Info GrB_Matrix_extractElement_UINT32(uint32_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); GrB_Info GrB_Matrix_extractElement_UINT64(uint64_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -GrB_Info GrB_Matrix_extractTuples_BOOL(GrB_Index *I, GrB_Index *J, bool *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_FP32(GrB_Index *I, GrB_Index *J, float *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_FP64(GrB_Index *I, GrB_Index *J, double *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_INT8(GrB_Index *I, GrB_Index *J, int8_t *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_INT16(GrB_Index *I, GrB_Index *J, int16_t *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_INT32(GrB_Index *I, GrB_Index *J, int32_t *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_INT64(GrB_Index *I, GrB_Index *J, int64_t *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_UDT(GrB_Index *I, GrB_Index *J, void *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_UINT8(GrB_Index *I, GrB_Index *J, uint8_t *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_UINT16(GrB_Index *I, GrB_Index *J, uint16_t *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_UINT32(GrB_Index *I, GrB_Index *J, uint32_t *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_UINT64(GrB_Index *I, GrB_Index *J, uint64_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_BOOL(GrB_Index *Ilist, GrB_Index *J, bool *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_FP32(GrB_Index *Ilist, GrB_Index *J, float *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_FP64(GrB_Index *Ilist, GrB_Index *J, double *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_INT8(GrB_Index *Ilist, GrB_Index *J, int8_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_INT16(GrB_Index *Ilist, GrB_Index *J, int16_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_INT32(GrB_Index *Ilist, GrB_Index *J, int32_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_INT64(GrB_Index *Ilist, GrB_Index *J, int64_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_UDT(GrB_Index *Ilist, GrB_Index *J, void *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_UINT8(GrB_Index *Ilist, GrB_Index *J, uint8_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_UINT16(GrB_Index *Ilist, GrB_Index *J, uint16_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_UINT32(GrB_Index *Ilist, GrB_Index *J, uint32_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_UINT64(GrB_Index *Ilist, GrB_Index *J, uint64_t *X, GrB_Index *nvals, const GrB_Matrix A); GrB_Info GrB_Matrix_free(GrB_Matrix *A); +GrB_Info GrB_Matrix_get_INT32(GrB_Matrix, int32_t *, GrB_Field); +GrB_Info GrB_Matrix_get_SIZE(GrB_Matrix, size_t *, GrB_Field); +GrB_Info GrB_Matrix_get_Scalar(GrB_Matrix, GrB_Scalar, GrB_Field); +GrB_Info GrB_Matrix_get_String(GrB_Matrix, char *, GrB_Field); +GrB_Info GrB_Matrix_get_VOID(GrB_Matrix, void *, GrB_Field); GrB_Info GrB_Matrix_import_BOOL(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const bool *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); GrB_Info GrB_Matrix_import_FP32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const float *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); GrB_Info GrB_Matrix_import_FP64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const double *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); @@ -2858,6 +2957,10 @@ GrB_Info GrB_Matrix_setElement_UINT8(GrB_Matrix C, uint8_t x, GrB_Index i, GrB_I GrB_Info GrB_Matrix_setElement_UINT16(GrB_Matrix C, uint16_t x, GrB_Index i, GrB_Index j); GrB_Info GrB_Matrix_setElement_UINT32(GrB_Matrix C, uint32_t x, GrB_Index i, GrB_Index j); GrB_Info GrB_Matrix_setElement_UINT64(GrB_Matrix C, uint64_t x, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_set_INT32(GrB_Matrix, int32_t, GrB_Field); +GrB_Info GrB_Matrix_set_Scalar(GrB_Matrix, GrB_Scalar, GrB_Field); +GrB_Info GrB_Matrix_set_String(GrB_Matrix, char *, GrB_Field); +GrB_Info GrB_Matrix_set_VOID(GrB_Matrix, void *, GrB_Field, size_t); GrB_Info GrB_Matrix_wait(GrB_Matrix A, GrB_WaitMode waitmode); GrB_Info GrB_Row_assign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, GrB_Index i, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); GrB_Info GrB_mxm(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); @@ -2868,6 +2971,10 @@ GrB_Info GrB_vxm(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, /* monoid */ GrB_Info GrB_Monoid_error(const char **error, const GrB_Monoid monoid); GrB_Info GrB_Monoid_free(GrB_Monoid *monoid); +GrB_Info GrB_Monoid_get_INT32(GrB_Monoid, int32_t *, GrB_Field); +GrB_Info GrB_Monoid_get_SIZE(GrB_Monoid, size_t *, GrB_Field); +GrB_Info GrB_Monoid_get_String(GrB_Monoid, char *, GrB_Field); +GrB_Info GrB_Monoid_get_VOID(GrB_Monoid, void *, GrB_Field); GrB_Info GrB_Monoid_new_BOOL(GrB_Monoid *monoid, GrB_BinaryOp op, bool identity); GrB_Info GrB_Monoid_new_FP32(GrB_Monoid *monoid, GrB_BinaryOp op, float identity); GrB_Info GrB_Monoid_new_FP64(GrB_Monoid *monoid, GrB_BinaryOp op, double identity); @@ -2880,9 +2987,22 @@ GrB_Info GrB_Monoid_new_UINT8(GrB_Monoid *monoid, GrB_BinaryOp op, uint8_t ident GrB_Info GrB_Monoid_new_UINT16(GrB_Monoid *monoid, GrB_BinaryOp op, uint16_t identity); GrB_Info GrB_Monoid_new_UINT32(GrB_Monoid *monoid, GrB_BinaryOp op, uint32_t identity); GrB_Info GrB_Monoid_new_UINT64(GrB_Monoid *monoid, GrB_BinaryOp op, uint64_t identity); +GrB_Info GrB_Monoid_set_INT32(GrB_Monoid, int32_t, GrB_Field); +GrB_Info GrB_Monoid_set_String(GrB_Monoid, char *, GrB_Field); +GrB_Info GrB_Monoid_set_VOID(GrB_Monoid, void *, GrB_Field, size_t); GrB_Info GrB_Monoid_wait(GrB_Monoid monoid, GrB_WaitMode waitmode); /* scalar */ +GrB_Info GrB_BinaryOp_get_Scalar(GrB_BinaryOp, GrB_Scalar, GrB_Field); +GrB_Info GrB_BinaryOp_set_Scalar(GrB_BinaryOp, GrB_Scalar, GrB_Field); +GrB_Info GrB_Descriptor_get_Scalar(GrB_Descriptor, GrB_Scalar, GrB_Field); +GrB_Info GrB_Descriptor_set_Scalar(GrB_Descriptor, GrB_Scalar, GrB_Field); +GrB_Info GrB_Global_get_Scalar(GrB_Global, GrB_Scalar, GrB_Field); +GrB_Info GrB_Global_set_Scalar(GrB_Global, GrB_Scalar, GrB_Field); +GrB_Info GrB_IndexUnaryOp_get_Scalar(GrB_IndexUnaryOp, GrB_Scalar, GrB_Field); +GrB_Info GrB_IndexUnaryOp_set_Scalar(GrB_IndexUnaryOp, GrB_Scalar, GrB_Field); +GrB_Info GrB_Monoid_get_Scalar(GrB_Monoid, GrB_Scalar, GrB_Field); +GrB_Info GrB_Monoid_set_Scalar(GrB_Monoid, GrB_Scalar, GrB_Field); GrB_Info GrB_Scalar_clear(GrB_Scalar s); GrB_Info GrB_Scalar_dup(GrB_Scalar *s, const GrB_Scalar t); GrB_Info GrB_Scalar_error(const char **error, const GrB_Scalar s); @@ -2899,6 +3019,11 @@ GrB_Info GrB_Scalar_extractElement_UINT16(uint16_t *x, const GrB_Scalar s); GrB_Info GrB_Scalar_extractElement_UINT32(uint32_t *x, const GrB_Scalar s); GrB_Info GrB_Scalar_extractElement_UINT64(uint64_t *x, const GrB_Scalar s); GrB_Info GrB_Scalar_free(GrB_Scalar *s); +GrB_Info GrB_Scalar_get_INT32(GrB_Scalar, int32_t *, GrB_Field); +GrB_Info GrB_Scalar_get_SIZE(GrB_Scalar, size_t *, GrB_Field); +GrB_Info GrB_Scalar_get_Scalar(GrB_Scalar, GrB_Scalar, GrB_Field); +GrB_Info GrB_Scalar_get_String(GrB_Scalar, char *, GrB_Field); +GrB_Info GrB_Scalar_get_VOID(GrB_Scalar, void *, GrB_Field); GrB_Info GrB_Scalar_new(GrB_Scalar *s, GrB_Type type); GrB_Info GrB_Scalar_nvals(GrB_Index *nvals, const GrB_Scalar s); GrB_Info GrB_Scalar_setElement_BOOL(GrB_Scalar s, bool x); @@ -2913,24 +3038,55 @@ GrB_Info GrB_Scalar_setElement_UINT8(GrB_Scalar s, uint8_t x); GrB_Info GrB_Scalar_setElement_UINT16(GrB_Scalar s, uint16_t x); GrB_Info GrB_Scalar_setElement_UINT32(GrB_Scalar s, uint32_t x); GrB_Info GrB_Scalar_setElement_UINT64(GrB_Scalar s, uint64_t x); +GrB_Info GrB_Scalar_set_INT32(GrB_Scalar, int32_t, GrB_Field); +GrB_Info GrB_Scalar_set_Scalar(GrB_Scalar, GrB_Scalar, GrB_Field); +GrB_Info GrB_Scalar_set_String(GrB_Scalar, char *, GrB_Field); +GrB_Info GrB_Scalar_set_VOID(GrB_Scalar, void *, GrB_Field, size_t); GrB_Info GrB_Scalar_wait(GrB_Scalar s, GrB_WaitMode waitmode); +GrB_Info GrB_Semiring_get_Scalar(GrB_Semiring, GrB_Scalar, GrB_Field); +GrB_Info GrB_Semiring_set_Scalar(GrB_Semiring, GrB_Scalar, GrB_Field); +GrB_Info GrB_Type_get_Scalar(GrB_Type, GrB_Scalar, GrB_Field); +GrB_Info GrB_Type_set_Scalar(GrB_Type, GrB_Scalar, GrB_Field); +GrB_Info GrB_UnaryOp_get_Scalar(GrB_UnaryOp, GrB_Scalar, GrB_Field); +GrB_Info GrB_UnaryOp_set_Scalar(GrB_UnaryOp, GrB_Scalar, GrB_Field); /* semiring */ GrB_Info GrB_Semiring_error(const char **error, const GrB_Semiring semiring); GrB_Info GrB_Semiring_free(GrB_Semiring *semiring); +GrB_Info GrB_Semiring_get_INT32(GrB_Semiring, int32_t *, GrB_Field); +GrB_Info GrB_Semiring_get_SIZE(GrB_Semiring, size_t *, GrB_Field); +GrB_Info GrB_Semiring_get_String(GrB_Semiring, char *, GrB_Field); +GrB_Info GrB_Semiring_get_VOID(GrB_Semiring, void *, GrB_Field); GrB_Info GrB_Semiring_new(GrB_Semiring *semiring, GrB_Monoid add, GrB_BinaryOp multiply); +GrB_Info GrB_Semiring_set_INT32(GrB_Semiring, int32_t, GrB_Field); +GrB_Info GrB_Semiring_set_String(GrB_Semiring, char *, GrB_Field); +GrB_Info GrB_Semiring_set_VOID(GrB_Semiring, void *, GrB_Field, size_t); GrB_Info GrB_Semiring_wait(GrB_Semiring semiring, GrB_WaitMode waitmode); /* type */ GrB_Info GrB_Type_error(const char **error, const GrB_Type type); GrB_Info GrB_Type_free(GrB_Type *type); +GrB_Info GrB_Type_get_INT32(GrB_Type, int32_t *, GrB_Field); +GrB_Info GrB_Type_get_SIZE(GrB_Type, size_t *, GrB_Field); +GrB_Info GrB_Type_get_String(GrB_Type, char *, GrB_Field); +GrB_Info GrB_Type_get_VOID(GrB_Type, void *, GrB_Field); GrB_Info GrB_Type_new(GrB_Type *type, size_t sizeof_ctype); +GrB_Info GrB_Type_set_INT32(GrB_Type, int32_t, GrB_Field); +GrB_Info GrB_Type_set_String(GrB_Type, char *, GrB_Field); +GrB_Info GrB_Type_set_VOID(GrB_Type, void *, GrB_Field, size_t); GrB_Info GrB_Type_wait(GrB_Type type, GrB_WaitMode waitmode); /* unary */ GrB_Info GrB_UnaryOp_error(const char **error, const GrB_UnaryOp op); GrB_Info GrB_UnaryOp_free(GrB_UnaryOp *unaryop); +GrB_Info GrB_UnaryOp_get_INT32(GrB_UnaryOp, int32_t *, GrB_Field); +GrB_Info GrB_UnaryOp_get_SIZE(GrB_UnaryOp, size_t *, GrB_Field); +GrB_Info GrB_UnaryOp_get_String(GrB_UnaryOp, char *, GrB_Field); +GrB_Info GrB_UnaryOp_get_VOID(GrB_UnaryOp, void *, GrB_Field); GrB_Info GrB_UnaryOp_new(GrB_UnaryOp *unaryop, GxB_unary_function function, GrB_Type ztype, GrB_Type xtype); +GrB_Info GrB_UnaryOp_set_INT32(GrB_UnaryOp, int32_t, GrB_Field); +GrB_Info GrB_UnaryOp_set_String(GrB_UnaryOp, char *, GrB_Field); +GrB_Info GrB_UnaryOp_set_VOID(GrB_UnaryOp, void *, GrB_Field, size_t); GrB_Info GrB_UnaryOp_wait(GrB_UnaryOp op, GrB_WaitMode waitmode); /* vector */ @@ -2974,32 +3130,32 @@ GrB_Info GrB_Vector_apply_IndexOp_UINT8(GrB_Vector w, const GrB_Vector mask, con GrB_Info GrB_Vector_apply_IndexOp_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint16_t y, const GrB_Descriptor desc); GrB_Info GrB_Vector_apply_IndexOp_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint32_t y, const GrB_Descriptor desc); GrB_Info GrB_Vector_apply_IndexOp_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint64_t y, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, double x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_build_BOOL(GrB_Vector w, const GrB_Index *I, const bool *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_FP32(GrB_Vector w, const GrB_Index *I, const float *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_FP64(GrB_Vector w, const GrB_Index *I, const double *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_INT8(GrB_Vector w, const GrB_Index *I, const int8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_INT16(GrB_Vector w, const GrB_Index *I, const int16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_INT32(GrB_Vector w, const GrB_Index *I, const int32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_INT64(GrB_Vector w, const GrB_Index *I, const int64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_UDT(GrB_Vector w, const GrB_Index *I, const void *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_UINT8(GrB_Vector w, const GrB_Index *I, const uint8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_UINT16(GrB_Vector w, const GrB_Index *I, const uint16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_UINT32(GrB_Vector w, const GrB_Index *I, const uint32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_UINT64(GrB_Vector w, const GrB_Index *I, const uint64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_assign(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, bool x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, float x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, double x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, void *x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_build_BOOL(GrB_Vector w, const GrB_Index *Ilist, const bool *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_FP32(GrB_Vector w, const GrB_Index *Ilist, const float *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_FP64(GrB_Vector w, const GrB_Index *Ilist, const double *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_INT8(GrB_Vector w, const GrB_Index *Ilist, const int8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_INT16(GrB_Vector w, const GrB_Index *Ilist, const int16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_INT32(GrB_Vector w, const GrB_Index *Ilist, const int32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_INT64(GrB_Vector w, const GrB_Index *Ilist, const int64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_UDT(GrB_Vector w, const GrB_Index *Ilist, const void *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_UINT8(GrB_Vector w, const GrB_Index *Ilist, const uint8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_UINT16(GrB_Vector w, const GrB_Index *Ilist, const uint16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_UINT32(GrB_Vector w, const GrB_Index *Ilist, const uint32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_UINT64(GrB_Vector w, const GrB_Index *Ilist, const uint64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); GrB_Info GrB_Vector_clear(GrB_Vector v); GrB_Info GrB_Vector_dup(GrB_Vector *w, const GrB_Vector u); GrB_Info GrB_Vector_eWiseAdd_BinaryOp(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); @@ -3009,7 +3165,7 @@ GrB_Info GrB_Vector_eWiseMult_BinaryOp(GrB_Vector w, const GrB_Vector mask, cons GrB_Info GrB_Vector_eWiseMult_Monoid(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); GrB_Info GrB_Vector_eWiseMult_Semiring(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); GrB_Info GrB_Vector_error(const char **error, const GrB_Vector v); -GrB_Info GrB_Vector_extract(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_extract(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); GrB_Info GrB_Vector_extractElement_BOOL(bool *x, const GrB_Vector v, GrB_Index i); GrB_Info GrB_Vector_extractElement_FP32(float *x, const GrB_Vector v, GrB_Index i); GrB_Info GrB_Vector_extractElement_FP64(double *x, const GrB_Vector v, GrB_Index i); @@ -3023,19 +3179,24 @@ GrB_Info GrB_Vector_extractElement_UINT8(uint8_t *x, const GrB_Vector v, GrB_Ind GrB_Info GrB_Vector_extractElement_UINT16(uint16_t *x, const GrB_Vector v, GrB_Index i); GrB_Info GrB_Vector_extractElement_UINT32(uint32_t *x, const GrB_Vector v, GrB_Index i); GrB_Info GrB_Vector_extractElement_UINT64(uint64_t *x, const GrB_Vector v, GrB_Index i); -GrB_Info GrB_Vector_extractTuples_BOOL(GrB_Index *I, bool *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_FP32(GrB_Index *I, float *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_FP64(GrB_Index *I, double *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_INT8(GrB_Index *I, int8_t *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_INT16(GrB_Index *I, int16_t *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_INT32(GrB_Index *I, int32_t *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_INT64(GrB_Index *I, int64_t *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_UDT(GrB_Index *I, void *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_UINT8(GrB_Index *I, uint8_t *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_UINT16(GrB_Index *I, uint16_t *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_UINT32(GrB_Index *I, uint32_t *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_UINT64(GrB_Index *I, uint64_t *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_BOOL(GrB_Index *Ilist, bool *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_FP32(GrB_Index *Ilist, float *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_FP64(GrB_Index *Ilist, double *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_INT8(GrB_Index *Ilist, int8_t *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_INT16(GrB_Index *Ilist, int16_t *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_INT32(GrB_Index *Ilist, int32_t *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_INT64(GrB_Index *Ilist, int64_t *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_UDT(GrB_Index *Ilist, void *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_UINT8(GrB_Index *Ilist, uint8_t *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_UINT16(GrB_Index *Ilist, uint16_t *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_UINT32(GrB_Index *Ilist, uint32_t *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_UINT64(GrB_Index *Ilist, uint64_t *X, GrB_Index *nvals, const GrB_Vector v); GrB_Info GrB_Vector_free(GrB_Vector *v); +GrB_Info GrB_Vector_get_INT32(GrB_Vector, int32_t *, GrB_Field); +GrB_Info GrB_Vector_get_SIZE(GrB_Vector, size_t *, GrB_Field); +GrB_Info GrB_Vector_get_Scalar(GrB_Vector, GrB_Scalar, GrB_Field); +GrB_Info GrB_Vector_get_String(GrB_Vector, char *, GrB_Field); +GrB_Info GrB_Vector_get_VOID(GrB_Vector, void *, GrB_Field); GrB_Info GrB_Vector_new(GrB_Vector *v, GrB_Type type, GrB_Index n); GrB_Info GrB_Vector_nvals(GrB_Index *nvals, const GrB_Vector v); GrB_Info GrB_Vector_reduce_BOOL(bool *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); @@ -3080,6 +3241,10 @@ GrB_Info GrB_Vector_setElement_UINT8(GrB_Vector w, uint8_t x, GrB_Index i); GrB_Info GrB_Vector_setElement_UINT16(GrB_Vector w, uint16_t x, GrB_Index i); GrB_Info GrB_Vector_setElement_UINT32(GrB_Vector w, uint32_t x, GrB_Index i); GrB_Info GrB_Vector_setElement_UINT64(GrB_Vector w, uint64_t x, GrB_Index i); +GrB_Info GrB_Vector_set_INT32(GrB_Vector, int32_t, GrB_Field); +GrB_Info GrB_Vector_set_Scalar(GrB_Vector, GrB_Scalar, GrB_Field); +GrB_Info GrB_Vector_set_String(GrB_Vector, char *, GrB_Field); +GrB_Info GrB_Vector_set_VOID(GrB_Vector, void *, GrB_Field, size_t); GrB_Info GrB_Vector_size(GrB_Index *n, const GrB_Vector v); GrB_Info GrB_Vector_wait(GrB_Vector v, GrB_WaitMode waitmode); @@ -3102,12 +3267,12 @@ GrB_Info GB_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GxB_Format_Valu /* binary */ GrB_Info GxB_BinaryOp_fprint(GrB_BinaryOp binaryop, const char *name, GxB_Print_Level pr, FILE *f); GrB_Info GxB_BinaryOp_new(GrB_BinaryOp *op, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *binop_name, const char *binop_defn); -GrB_Info GxB_BinaryOp_xtype(GrB_Type *xtype, GrB_BinaryOp binaryop); -GrB_Info GxB_BinaryOp_xtype_name(char *type_name, const GrB_BinaryOp binaryop); -GrB_Info GxB_BinaryOp_ytype(GrB_Type *ytype, GrB_BinaryOp binaryop); -GrB_Info GxB_BinaryOp_ytype_name(char *type_name, const GrB_BinaryOp binaryop); -GrB_Info GxB_BinaryOp_ztype(GrB_Type *ztype, GrB_BinaryOp binaryop); -GrB_Info GxB_BinaryOp_ztype_name(char *type_name, const GrB_BinaryOp binaryop); +GrB_Info GxB_BinaryOp_xtype(GrB_Type *xtype, GrB_BinaryOp op); +GrB_Info GxB_BinaryOp_xtype_name(char *type_name, const GrB_BinaryOp op); +GrB_Info GxB_BinaryOp_ytype(GrB_Type *ytype, GrB_BinaryOp op); +GrB_Info GxB_BinaryOp_ytype_name(char *type_name, const GrB_BinaryOp op); +GrB_Info GxB_BinaryOp_ztype(GrB_Type *ztype, GrB_BinaryOp op); +GrB_Info GxB_BinaryOp_ztype_name(char *type_name, const GrB_BinaryOp op); /* context */ GrB_Info GxB_Context_disengage(GxB_Context Context); @@ -3115,48 +3280,59 @@ GrB_Info GxB_Context_engage(GxB_Context Context); GrB_Info GxB_Context_error(const char **error, const GxB_Context Context); GrB_Info GxB_Context_fprint(GxB_Context Context, const char *name, GxB_Print_Level pr, FILE *f); GrB_Info GxB_Context_free(GxB_Context *Context); -GrB_Info GxB_Context_get(GxB_Context Context, GxB_Context_Field field, ...); -GrB_Info GxB_Context_get_FP64(GxB_Context Context, GxB_Context_Field field, double *value); -GrB_Info GxB_Context_get_INT32(GxB_Context Context, GxB_Context_Field field, int32_t *value); +GrB_Info GxB_Context_get(GxB_Context, GxB_Context_Field, ...); +GrB_Info GxB_Context_get_FP64(GxB_Context, GxB_Context_Field, double *); +GrB_Info GxB_Context_get_INT(GxB_Context, int32_t *, GrB_Field); +GrB_Info GxB_Context_get_INT32(GxB_Context, GxB_Context_Field, int32_t *); +GrB_Info GxB_Context_get_SIZE(GxB_Context, size_t *, GrB_Field); +GrB_Info GxB_Context_get_String(GxB_Context, char *, GrB_Field); +GrB_Info GxB_Context_get_VOID(GxB_Context, void *, GrB_Field); GrB_Info GxB_Context_new(GxB_Context *Context); -GrB_Info GxB_Context_set(GxB_Context Context, GxB_Context_Field field, ...); -GrB_Info GxB_Context_set_FP64(GxB_Context Context, GxB_Context_Field field, double value); -GrB_Info GxB_Context_set_INT32(GxB_Context Context, GxB_Context_Field field, int32_t value); +GrB_Info GxB_Context_set(GxB_Context, GxB_Context_Field, ...); +GrB_Info GxB_Context_set_FP64(GxB_Context, GxB_Context_Field, double); +GrB_Info GxB_Context_set_INT(GxB_Context, int32_t, GrB_Field); +GrB_Info GxB_Context_set_INT32(GxB_Context, GxB_Context_Field, int32_t); +GrB_Info GxB_Context_set_String(GxB_Context, char *, GrB_Field); +GrB_Info GxB_Context_set_VOID(GxB_Context, void *, GrB_Field, size_t); GrB_Info GxB_Context_wait(GxB_Context Context, GrB_WaitMode waitmode); /* core */ -GrB_Info GxB_Global_Option_get(GxB_Option_Field field, ...); -GrB_Info GxB_Global_Option_get_CHAR(GxB_Option_Field field, const char **value); -GrB_Info GxB_Global_Option_get_FP64(GxB_Option_Field field, double *value); -GrB_Info GxB_Global_Option_get_FUNCTION(GxB_Option_Field field, void **value); -GrB_Info GxB_Global_Option_get_INT32(GxB_Option_Field field, int32_t *value); -GrB_Info GxB_Global_Option_get_INT64(GxB_Option_Field field, int64_t *value); -GrB_Info GxB_Global_Option_set(GxB_Option_Field field, ...); -GrB_Info GxB_Global_Option_set_CHAR(GxB_Option_Field field, const char *value); -GrB_Info GxB_Global_Option_set_FP64(GxB_Option_Field field, double value); -GrB_Info GxB_Global_Option_set_FP64_ARRAY(GxB_Option_Field field, double *value); -GrB_Info GxB_Global_Option_set_FUNCTION(GxB_Option_Field field, void *value); -GrB_Info GxB_Global_Option_set_INT32(GxB_Option_Field field, int32_t value); -GrB_Info GxB_Global_Option_set_INT64_ARRAY(GxB_Option_Field field, int64_t *value); -GrB_Info GxB_deserialize_type_name(char *type_name, const void *blob, GrB_Index blob_size); +GrB_Info GxB_Global_Option_get(GxB_Option_Field, ...); +GrB_Info GxB_Global_Option_get_CHAR(GxB_Option_Field, const char **); +GrB_Info GxB_Global_Option_get_FP64(GxB_Option_Field, double *); +GrB_Info GxB_Global_Option_get_FUNCTION(GxB_Option_Field, void **); +GrB_Info GxB_Global_Option_get_INT32(GxB_Option_Field, int32_t *); +GrB_Info GxB_Global_Option_get_INT64(GxB_Option_Field, int64_t *); +GrB_Info GxB_Global_Option_set(GxB_Option_Field, ...); +GrB_Info GxB_Global_Option_set_CHAR(GxB_Option_Field, const char *); +GrB_Info GxB_Global_Option_set_FP64(GxB_Option_Field, double); +GrB_Info GxB_Global_Option_set_FP64_ARRAY(GxB_Option_Field, double *); +GrB_Info GxB_Global_Option_set_FUNCTION(GxB_Option_Field, void *); +GrB_Info GxB_Global_Option_set_INT32(GxB_Option_Field, int32_t); +GrB_Info GxB_Global_Option_set_INT64_ARRAY(GxB_Option_Field, int64_t *); +GrB_Info GxB_Serialized_get_INT32(const void *, int32_t *, GrB_Field, size_t); +GrB_Info GxB_Serialized_get_SIZE(const void *, size_t *, GrB_Field, size_t); +GrB_Info GxB_Serialized_get_String(const void *, char *, GrB_Field, size_t); +GrB_Info GxB_Serialized_get_VOID(const void *, void *, GrB_Field, size_t); +GrB_Info GxB_deserialize_type_name(char *, const void *, GrB_Index); GrB_Info GxB_init(GrB_Mode mode, void *(*user_malloc_function)(size_t), void *(*user_calloc_function)(size_t, size_t), void *(*user_realloc_function)(void *, size_t), void (*user_free_function)(void *)); /* descriptor */ -GrB_Info GxB_Desc_get(GrB_Descriptor desc, GrB_Desc_Field field, ...); -GrB_Info GxB_Desc_get_FP64(GrB_Descriptor desc, GrB_Desc_Field field, double *value); -GrB_Info GxB_Desc_get_INT32(GrB_Descriptor desc, GrB_Desc_Field field, int32_t *value); -GrB_Info GxB_Desc_set(GrB_Descriptor desc, GrB_Desc_Field field, ...); -GrB_Info GxB_Desc_set_FP64(GrB_Descriptor desc, GrB_Desc_Field field, double value); -GrB_Info GxB_Desc_set_INT32(GrB_Descriptor desc, GrB_Desc_Field field, int32_t value); +GrB_Info GxB_Desc_get(GrB_Descriptor, GrB_Desc_Field, ...); +GrB_Info GxB_Desc_get_FP64(GrB_Descriptor, GrB_Desc_Field, double *); +GrB_Info GxB_Desc_get_INT32(GrB_Descriptor, GrB_Desc_Field, int32_t *); +GrB_Info GxB_Desc_set(GrB_Descriptor, GrB_Desc_Field, ...); +GrB_Info GxB_Desc_set_FP64(GrB_Descriptor, GrB_Desc_Field, double); +GrB_Info GxB_Desc_set_INT32(GrB_Descriptor, GrB_Desc_Field, int32_t); GrB_Info GxB_Descriptor_fprint(GrB_Descriptor descriptor, const char *name, GxB_Print_Level pr, FILE *f); -GrB_Info GxB_Descriptor_get(GrB_Desc_Value *val, GrB_Descriptor desc, GrB_Desc_Field field); +GrB_Info GxB_Descriptor_get(GrB_Desc_Value *, GrB_Descriptor, GrB_Desc_Field); /* indexunary */ GrB_Info GxB_IndexUnaryOp_fprint(GrB_IndexUnaryOp op, const char *name, GxB_Print_Level pr, FILE *f); GrB_Info GxB_IndexUnaryOp_new(GrB_IndexUnaryOp *op, GxB_index_unary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *idxop_name, const char *idxop_defn); -GrB_Info GxB_IndexUnaryOp_xtype_name(char *type_name, const GrB_IndexUnaryOp op); -GrB_Info GxB_IndexUnaryOp_ytype_name(char *type_name, const GrB_IndexUnaryOp op); -GrB_Info GxB_IndexUnaryOp_ztype_name(char *type_name, const GrB_IndexUnaryOp op); +GrB_Info GxB_IndexUnaryOp_xtype_name(char *, const GrB_IndexUnaryOp op); +GrB_Info GxB_IndexUnaryOp_ytype_name(char *, const GrB_IndexUnaryOp op); +GrB_Info GxB_IndexUnaryOp_ztype_name(char *, const GrB_IndexUnaryOp op); /* iterator */ GrB_Index GxB_Matrix_Iterator_getp(GxB_Iterator iterator); @@ -3201,14 +3377,14 @@ void GxB_Iterator_get_UDT(GxB_Iterator iterator, void *value); void GxB_Matrix_Iterator_getIndex(GxB_Iterator iterator, GrB_Index *row, GrB_Index *col); /* matrix */ -GrB_Info GxB_Col_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); +GrB_Info GxB_Col_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *Ilist, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); GrB_Info GxB_Matrix_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); -GrB_Info GxB_Matrix_Option_get(GrB_Matrix A, GxB_Option_Field field, ...); -GrB_Info GxB_Matrix_Option_get_FP64(GrB_Matrix A, GxB_Option_Field field, double *value); -GrB_Info GxB_Matrix_Option_get_INT32(GrB_Matrix A, GxB_Option_Field field, int32_t *value); -GrB_Info GxB_Matrix_Option_set(GrB_Matrix A, GxB_Option_Field field, ...); -GrB_Info GxB_Matrix_Option_set_FP64(GrB_Matrix A, GxB_Option_Field field, double value); -GrB_Info GxB_Matrix_Option_set_INT32(GrB_Matrix A, GxB_Option_Field field, int32_t value); +GrB_Info GxB_Matrix_Option_get(GrB_Matrix, GxB_Option_Field, ...); +GrB_Info GxB_Matrix_Option_get_FP64(GrB_Matrix, GxB_Option_Field, double *); +GrB_Info GxB_Matrix_Option_get_INT32(GrB_Matrix, GxB_Option_Field, int32_t *); +GrB_Info GxB_Matrix_Option_set(GrB_Matrix, GxB_Option_Field, ...); +GrB_Info GxB_Matrix_Option_set_FP64(GrB_Matrix, GxB_Option_Field, double); +GrB_Info GxB_Matrix_Option_set_INT32(GrB_Matrix, GxB_Option_Field, int32_t); GrB_Info GxB_Matrix_apply_BinaryOp1st(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Matrix A, const GrB_Descriptor desc); GrB_Info GxB_Matrix_apply_BinaryOp1st_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC32_t x, const GrB_Matrix A, const GrB_Descriptor desc); GrB_Info GxB_Matrix_apply_BinaryOp1st_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC64_t x, const GrB_Matrix A, const GrB_Descriptor desc); @@ -3217,11 +3393,11 @@ GrB_Info GxB_Matrix_apply_BinaryOp2nd_FC32(GrB_Matrix C, const GrB_Matrix Mask, GrB_Info GxB_Matrix_apply_BinaryOp2nd_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, GxB_FC64_t y, const GrB_Descriptor desc); GrB_Info GxB_Matrix_apply_IndexOp_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, GxB_FC32_t y, const GrB_Descriptor desc); GrB_Info GxB_Matrix_apply_IndexOp_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, GxB_FC64_t y, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_assign_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_assign_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_build_FC32(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const GxB_FC32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GxB_Matrix_build_FC64(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const GxB_FC64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GxB_Matrix_build_Scalar(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, GrB_Scalar scalar, GrB_Index nvals); +GrB_Info GxB_Matrix_assign_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC32_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_assign_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_build_FC32(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const GxB_FC32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GxB_Matrix_build_FC64(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const GxB_FC64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GxB_Matrix_build_Scalar(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, GrB_Scalar scalar, GrB_Index nvals); GrB_Info GxB_Matrix_concat(GrB_Matrix C, const GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Descriptor desc); GrB_Info GxB_Matrix_deserialize(GrB_Matrix *C, GrB_Type type, const void *blob, GrB_Index blob_size, const GrB_Descriptor desc); GrB_Info GxB_Matrix_diag(GrB_Matrix C, const GrB_Vector v, int64_t k, const GrB_Descriptor desc); @@ -3238,8 +3414,8 @@ GrB_Info GxB_Matrix_export_HyperCSC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nr GrB_Info GxB_Matrix_export_HyperCSR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); GrB_Info GxB_Matrix_extractElement_FC32(GxB_FC32_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); GrB_Info GxB_Matrix_extractElement_FC64(GxB_FC64_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -GrB_Info GxB_Matrix_extractTuples_FC32(GrB_Index *I, GrB_Index *J, GxB_FC32_t *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GxB_Matrix_extractTuples_FC64(GrB_Index *I, GrB_Index *J, GxB_FC64_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GxB_Matrix_extractTuples_FC32(GrB_Index *Ilist, GrB_Index *J, GxB_FC32_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GxB_Matrix_extractTuples_FC64(GrB_Index *Ilist, GrB_Index *J, GxB_FC64_t *X, GrB_Index *nvals, const GrB_Matrix A); GrB_Info GxB_Matrix_fprint(GrB_Matrix A, const char *name, GxB_Print_Level pr, FILE *f); GrB_Info GxB_Matrix_import_BitmapC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); GrB_Info GxB_Matrix_import_BitmapR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); @@ -3274,22 +3450,22 @@ GrB_Info GxB_Matrix_setElement_FC32(GrB_Matrix C, GxB_FC32_t x, GrB_Index i, GrB GrB_Info GxB_Matrix_setElement_FC64(GrB_Matrix C, GxB_FC64_t x, GrB_Index i, GrB_Index j); GrB_Info GxB_Matrix_sort(GrB_Matrix C, GrB_Matrix P, GrB_BinaryOp op, GrB_Matrix A, const GrB_Descriptor desc); GrB_Info GxB_Matrix_split(GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Index *Tile_nrows, const GrB_Index *Tile_ncols, const GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, double x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, bool x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC32_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, float x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, double x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, void *x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); GrB_Info GxB_Matrix_type(GrB_Type *type, const GrB_Matrix A); GrB_Info GxB_Matrix_type_name(char *type_name, const GrB_Matrix A); GrB_Info GxB_Matrix_unpack_BitmapC(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); @@ -3313,7 +3489,7 @@ GrB_Info GxB_Monoid_identity(void *identity, GrB_Monoid monoid); GrB_Info GxB_Monoid_new_FC32(GrB_Monoid *monoid, GrB_BinaryOp op, GxB_FC32_t identity); GrB_Info GxB_Monoid_new_FC64(GrB_Monoid *monoid, GrB_BinaryOp op, GxB_FC64_t identity); GrB_Info GxB_Monoid_operator(GrB_BinaryOp *op, GrB_Monoid monoid); -GrB_Info GxB_Monoid_terminal(bool *has_terminal, void *terminal, GrB_Monoid monoid); +GrB_Info GxB_Monoid_terminal(bool *, void *terminal, GrB_Monoid monoid); GrB_Info GxB_Monoid_terminal_new_BOOL(GrB_Monoid *monoid, GrB_BinaryOp op, bool identity, bool terminal); GrB_Info GxB_Monoid_terminal_new_FC32(GrB_Monoid *monoid, GrB_BinaryOp op, GxB_FC32_t identity, GxB_FC32_t terminal); GrB_Info GxB_Monoid_terminal_new_FC64(GrB_Monoid *monoid, GrB_BinaryOp op, GxB_FC64_t identity, GxB_FC64_t terminal); @@ -3330,6 +3506,8 @@ GrB_Info GxB_Monoid_terminal_new_UINT32(GrB_Monoid *monoid, GrB_BinaryOp op, uin GrB_Info GxB_Monoid_terminal_new_UINT64(GrB_Monoid *monoid, GrB_BinaryOp op, uint64_t identity, uint64_t terminal); /* scalar */ +GrB_Info GxB_Context_get_Scalar(GxB_Context, GrB_Scalar, GrB_Field); +GrB_Info GxB_Context_set_Scalar(GxB_Context, GrB_Scalar, GrB_Field); GrB_Info GxB_Scalar_clear(GrB_Scalar s); GrB_Info GxB_Scalar_dup(GrB_Scalar *s, const GrB_Scalar t); GrB_Info GxB_Scalar_error(const char **error, const GrB_Scalar s); @@ -3369,6 +3547,7 @@ GrB_Info GxB_Scalar_setElement_UINT64(GrB_Scalar s, uint64_t x); GrB_Info GxB_Scalar_type(GrB_Type *type, const GrB_Scalar s); GrB_Info GxB_Scalar_type_name(char *type_name, const GrB_Scalar s); GrB_Info GxB_Scalar_wait(GrB_Scalar *s); +GrB_Info GxB_Serialized_get_Scalar(const void *, GrB_Scalar, GrB_Field, size_t); /* selectop */ GrB_Info GxB_SelectOp_fprint(GxB_SelectOp op, const char *name, GxB_Print_Level pr, FILE *f); @@ -3397,12 +3576,12 @@ GrB_Info GxB_UnaryOp_ztype_name(char *type_name, const GrB_UnaryOp unaryop); /* vector */ GrB_Info GxB_Vector_Iterator_attach(GxB_Iterator iterator, GrB_Vector v, GrB_Descriptor desc); -GrB_Info GxB_Vector_Option_get(GrB_Vector A, GxB_Option_Field field, ...); -GrB_Info GxB_Vector_Option_get_FP64(GrB_Vector v, GxB_Option_Field field, double *value); -GrB_Info GxB_Vector_Option_get_INT32(GrB_Vector v, GxB_Option_Field field, int32_t *value); -GrB_Info GxB_Vector_Option_set(GrB_Vector A, GxB_Option_Field field, ...); -GrB_Info GxB_Vector_Option_set_FP64(GrB_Vector v, GxB_Option_Field field, double value); -GrB_Info GxB_Vector_Option_set_INT32(GrB_Vector v, GxB_Option_Field field, int32_t value); +GrB_Info GxB_Vector_Option_get(GrB_Vector, GxB_Option_Field, ...); +GrB_Info GxB_Vector_Option_get_FP64(GrB_Vector, GxB_Option_Field, double *); +GrB_Info GxB_Vector_Option_get_INT32(GrB_Vector, GxB_Option_Field, int32_t *); +GrB_Info GxB_Vector_Option_set(GrB_Vector, GxB_Option_Field, ...); +GrB_Info GxB_Vector_Option_set_FP64(GrB_Vector, GxB_Option_Field, double); +GrB_Info GxB_Vector_Option_set_INT32(GrB_Vector, GxB_Option_Field, int32_t); GrB_Info GxB_Vector_apply_BinaryOp1st(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Vector u, const GrB_Descriptor desc); GrB_Info GxB_Vector_apply_BinaryOp1st_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC32_t x, const GrB_Vector u, const GrB_Descriptor desc); GrB_Info GxB_Vector_apply_BinaryOp1st_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC64_t x, const GrB_Vector u, const GrB_Descriptor desc); @@ -3411,11 +3590,11 @@ GrB_Info GxB_Vector_apply_BinaryOp2nd_FC32(GrB_Vector w, const GrB_Vector mask, GrB_Info GxB_Vector_apply_BinaryOp2nd_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, GxB_FC64_t y, const GrB_Descriptor desc); GrB_Info GxB_Vector_apply_IndexOp_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, GxB_FC32_t y, const GrB_Descriptor desc); GrB_Info GxB_Vector_apply_IndexOp_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, GxB_FC64_t y, const GrB_Descriptor desc); -GrB_Info GxB_Vector_assign_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GxB_FC32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_assign_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_build_FC32(GrB_Vector w, const GrB_Index *I, const GxB_FC32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GxB_Vector_build_FC64(GrB_Vector w, const GrB_Index *I, const GxB_FC64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GxB_Vector_build_Scalar(GrB_Vector w, const GrB_Index *I, GrB_Scalar scalar, GrB_Index nvals); +GrB_Info GxB_Vector_assign_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GxB_FC32_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_assign_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_build_FC32(GrB_Vector w, const GrB_Index *Ilist, const GxB_FC32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GxB_Vector_build_FC64(GrB_Vector w, const GrB_Index *Ilist, const GxB_FC64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GxB_Vector_build_Scalar(GrB_Vector w, const GrB_Index *Ilist, GrB_Scalar scalar, GrB_Index nvals); GrB_Info GxB_Vector_deserialize(GrB_Vector *w, GrB_Type type, const void *blob, GrB_Index blob_size, const GrB_Descriptor desc); GrB_Info GxB_Vector_eWiseUnion(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Vector u, const GrB_Scalar alpha, const GrB_Vector v, const GrB_Scalar beta, const GrB_Descriptor desc); GrB_Info GxB_Vector_export_Bitmap(GrB_Vector *v, GrB_Type *type, GrB_Index *n, int8_t **vb, void **vx, GrB_Index *vb_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); @@ -3423,8 +3602,8 @@ GrB_Info GxB_Vector_export_CSC(GrB_Vector *v, GrB_Type *type, GrB_Index *n, GrB_ GrB_Info GxB_Vector_export_Full(GrB_Vector *v, GrB_Type *type, GrB_Index *n, void **vx, GrB_Index *vx_size, bool *iso, const GrB_Descriptor desc); GrB_Info GxB_Vector_extractElement_FC32(GxB_FC32_t *x, const GrB_Vector v, GrB_Index i); GrB_Info GxB_Vector_extractElement_FC64(GxB_FC64_t *x, const GrB_Vector v, GrB_Index i); -GrB_Info GxB_Vector_extractTuples_FC32(GrB_Index *I, GxB_FC32_t *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GxB_Vector_extractTuples_FC64(GrB_Index *I, GxB_FC64_t *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GxB_Vector_extractTuples_FC32(GrB_Index *Ilist, GxB_FC32_t *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GxB_Vector_extractTuples_FC64(GrB_Index *Ilist, GxB_FC64_t *X, GrB_Index *nvals, const GrB_Vector v); GrB_Info GxB_Vector_fprint(GrB_Vector v, const char *name, GxB_Print_Level pr, FILE *f); GrB_Info GxB_Vector_import_Bitmap(GrB_Vector *v, GrB_Type type, GrB_Index n, int8_t **vb, void **vx, GrB_Index vb_size, GrB_Index vx_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); GrB_Info GxB_Vector_import_CSC(GrB_Vector *v, GrB_Type type, GrB_Index n, GrB_Index **vi, void **vx, GrB_Index vi_size, GrB_Index vx_size, bool iso, GrB_Index nvals, bool jumbled, const GrB_Descriptor desc); @@ -3444,22 +3623,22 @@ GrB_Info GxB_Vector_serialize(void **blob_handle, GrB_Index *blob_size_handle, G GrB_Info GxB_Vector_setElement_FC32(GrB_Vector w, GxB_FC32_t x, GrB_Index i); GrB_Info GxB_Vector_setElement_FC64(GrB_Vector w, GxB_FC64_t x, GrB_Index i); GrB_Info GxB_Vector_sort(GrB_Vector w, GrB_Vector p, GrB_BinaryOp op, GrB_Vector u, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GxB_FC32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, double x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, bool x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GxB_FC32_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, float x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, double x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, void *x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); GrB_Info GxB_Vector_type(GrB_Type *type, const GrB_Vector v); GrB_Info GxB_Vector_type_name(char *type_name, const GrB_Vector v); GrB_Info GxB_Vector_unpack_Bitmap(GrB_Vector v, int8_t **vb, void **vx, GrB_Index *vb_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); diff --git a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h index 5c49c31..a3bf947 100644 --- a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h +++ b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h @@ -2,6 +2,7 @@ /* GrB typedefs */ typedef struct GB_BinaryOp_opaque *GrB_BinaryOp; typedef struct GB_Descriptor_opaque *GrB_Descriptor; +typedef struct GB_Global_opaque *GrB_Global; typedef struct GB_IndexUnaryOp_opaque *GrB_IndexUnaryOp; typedef struct GB_Matrix_opaque *GrB_Matrix; typedef struct GB_Monoid_opaque *GrB_Monoid; @@ -38,10 +39,12 @@ typedef enum typedef enum { + GrB_DEFAULT = 0, GxB_DEFAULT = 0, GrB_REPLACE = 1, GrB_COMP = 2, GrB_STRUCTURE = 4, + GrB_COMP_STRUCTURE = 6, GrB_TRAN = 3, GxB_AxB_GUSTAVSON = 7081, GxB_AxB_DOT = 7083, @@ -50,6 +53,39 @@ typedef enum GxB_SECURE_IMPORT = 7080 } GrB_Desc_Value; +typedef enum +{ + GrB_OUTP_FIELD = 0, + GrB_MASK_FIELD = 1, + GrB_INP0_FIELD = 2, + GrB_INP1_FIELD = 3, + GrB_NAME = 10, + GrB_LIBRARY_VER_MAJOR = 11, + GrB_LIBRARY_VER_MINOR = 12, + GrB_LIBRARY_VER_PATCH = 13, + GrB_API_VER_MAJOR = 14, + GrB_API_VER_MINOR = 15, + GrB_API_VER_PATCH = 16, + GrB_BLOCKING_MODE = 17, + GrB_STORAGE_ORIENTATION_HINT = 100, + GrB_EL_TYPE_CODE = 102, + GrB_EL_TYPE_STRING = 106, + GrB_INP0_TYPE_CODE = 103, + GrB_INP1_TYPE_CODE = 104, + GrB_OUTP_TYPE_CODE = 105, + GrB_INP0_TYPE_STRING = 107, + GrB_INP1_TYPE_STRING = 108, + GrB_OUTP_TYPE_STRING = 109, + GrB_SIZE = 110, + GxB_JIT_C_NAME = 7041, + GxB_JIT_C_DEFINITION = 7042, + GxB_MONOID_IDENTITY = 7043, + GxB_MONOID_TERMINAL = 7044, + GxB_MONOID_OPERATOR = 7045, + GxB_SEMIRING_MONOID = 7046, + GxB_SEMIRING_MULTIPLY = 7047 +} GrB_Field; + typedef enum { GrB_CSR_FORMAT = 0, @@ -70,6 +106,7 @@ typedef enum GrB_DIMENSION_MISMATCH = -6, GrB_OUTPUT_NOT_EMPTY = -7, GrB_NOT_IMPLEMENTED = -8, + GrB_ALREADY_SET = -9, GrB_PANIC = -101, GrB_OUT_OF_MEMORY = -102, GrB_INSUFFICIENT_SPACE = -103, @@ -86,6 +123,30 @@ typedef enum GxB_BLOCKING_GPU = 7098 } GrB_Mode; +typedef enum +{ + GrB_ROWMAJOR = 0, + GrB_COLMAJOR = 1, + GrB_BOTH = 2, + GrB_UNKNOWN = 3 +} GrB_Orientation; + +typedef enum +{ + GrB_UDT_CODE = 0, + GrB_BOOL_CODE = 1, + GrB_INT8_CODE = 2, + GrB_UINT8_CODE = 3, + GrB_INT16_CODE = 4, + GrB_UINT16_CODE = 5, + GrB_INT32_CODE = 6, + GrB_UINT32_CODE = 7, + GrB_INT64_CODE = 8, + GrB_UINT64_CODE = 9, + GrB_FP32_CODE = 10, + GrB_FP64_CODE = 11 +} GrB_Type_Code; + typedef enum { GrB_COMPLETE = 0, @@ -119,6 +180,7 @@ typedef enum typedef enum { GxB_HYPER_SWITCH = 7000, + GxB_HYPER_HASH = 7048, GxB_BITMAP_SWITCH = 7001, GxB_FORMAT = 7002, GxB_MODE = 7003, @@ -137,6 +199,10 @@ typedef enum GxB_COMPILER_VERSION = 7016, GxB_COMPILER_NAME = 7017, GxB_LIBRARY_OPENMP = 7018, + GxB_MALLOC_FUNCTION = 7037, + GxB_CALLOC_FUNCTION = 7038, + GxB_REALLOC_FUNCTION = 7039, + GxB_FREE_FUNCTION = 7040, GxB_GLOBAL_NTHREADS = 7086, GxB_GLOBAL_CHUNK = 7087, GxB_GLOBAL_GPU_ID = 7088, @@ -155,12 +221,9 @@ typedef enum GxB_JIT_C_CMAKE_LIBS = 7031, GxB_JIT_USE_CMAKE = 7032, GxB_JIT_ERROR_LOG = 7033, + GxB_JIT_CUDA_PREFACE = 7100, GxB_SPARSITY_STATUS = 7034, - GxB_SPARSITY_CONTROL = 7036, - GxB_MALLOC_FUNCTION = 7037, - GxB_CALLOC_FUNCTION = 7038, - GxB_REALLOC_FUNCTION = 7039, - GxB_FREE_FUNCTION = 7040 + GxB_SPARSITY_CONTROL = 7036 } GxB_Option_Field; typedef enum @@ -174,6 +237,7 @@ typedef enum } GxB_Print_Level; /* GrB consts */ +extern const GrB_Global GrB_GLOBAL; extern const uint64_t *GrB_ALL; /* GxB consts */ @@ -2477,10 +2541,24 @@ extern GxB_SelectOp GxB_TRIU; /* binary */ GrB_Info GrB_BinaryOp_error(const char **error, const GrB_BinaryOp op); GrB_Info GrB_BinaryOp_free(GrB_BinaryOp *binaryop); +GrB_Info GrB_BinaryOp_get_INT32(GrB_BinaryOp, int32_t *, GrB_Field); +GrB_Info GrB_BinaryOp_get_SIZE(GrB_BinaryOp, size_t *, GrB_Field); +GrB_Info GrB_BinaryOp_get_String(GrB_BinaryOp, char *, GrB_Field); +GrB_Info GrB_BinaryOp_get_VOID(GrB_BinaryOp, void *, GrB_Field); GrB_Info GrB_BinaryOp_new(GrB_BinaryOp *binaryop, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype); +GrB_Info GrB_BinaryOp_set_INT32(GrB_BinaryOp, int32_t, GrB_Field); +GrB_Info GrB_BinaryOp_set_String(GrB_BinaryOp, char *, GrB_Field); +GrB_Info GrB_BinaryOp_set_VOID(GrB_BinaryOp, void *, GrB_Field, size_t); GrB_Info GrB_BinaryOp_wait(GrB_BinaryOp op, GrB_WaitMode waitmode); /* core */ +GrB_Info GrB_Global_get_INT32(GrB_Global, int32_t *, GrB_Field); +GrB_Info GrB_Global_get_SIZE(GrB_Global, size_t *, GrB_Field); +GrB_Info GrB_Global_get_String(GrB_Global, char *, GrB_Field); +GrB_Info GrB_Global_get_VOID(GrB_Global, void *, GrB_Field); +GrB_Info GrB_Global_set_INT32(GrB_Global, int32_t, GrB_Field); +GrB_Info GrB_Global_set_String(GrB_Global, char *, GrB_Field); +GrB_Info GrB_Global_set_VOID(GrB_Global, void *, GrB_Field, size_t); GrB_Info GrB_finalize(void); GrB_Info GrB_getVersion(unsigned int *version, unsigned int *subversion); GrB_Info GrB_init(GrB_Mode mode); @@ -2488,19 +2566,33 @@ GrB_Info GrB_init(GrB_Mode mode); /* descriptor */ GrB_Info GrB_Descriptor_error(const char **error, const GrB_Descriptor d); GrB_Info GrB_Descriptor_free(GrB_Descriptor *descriptor); +GrB_Info GrB_Descriptor_get_INT32(GrB_Descriptor, int32_t *, GrB_Field); +GrB_Info GrB_Descriptor_get_SIZE(GrB_Descriptor, size_t *, GrB_Field); +GrB_Info GrB_Descriptor_get_String(GrB_Descriptor, char *, GrB_Field); +GrB_Info GrB_Descriptor_get_VOID(GrB_Descriptor, void *, GrB_Field); GrB_Info GrB_Descriptor_new(GrB_Descriptor *descriptor); -GrB_Info GrB_Descriptor_set(GrB_Descriptor desc, GrB_Desc_Field field, GrB_Desc_Value val); +GrB_Info GrB_Descriptor_set(GrB_Descriptor, GrB_Desc_Field, GrB_Desc_Value); +GrB_Info GrB_Descriptor_set_INT32(GrB_Descriptor, int32_t, GrB_Field); +GrB_Info GrB_Descriptor_set_String(GrB_Descriptor, char *, GrB_Field); +GrB_Info GrB_Descriptor_set_VOID(GrB_Descriptor, void *, GrB_Field, size_t); GrB_Info GrB_Descriptor_wait(GrB_Descriptor desc, GrB_WaitMode waitmode); /* indexunary */ GrB_Info GrB_IndexUnaryOp_error(const char **error, const GrB_IndexUnaryOp op); GrB_Info GrB_IndexUnaryOp_free(GrB_IndexUnaryOp *op); +GrB_Info GrB_IndexUnaryOp_get_INT32(GrB_IndexUnaryOp, int32_t *, GrB_Field); +GrB_Info GrB_IndexUnaryOp_get_SIZE(GrB_IndexUnaryOp, size_t *, GrB_Field); +GrB_Info GrB_IndexUnaryOp_get_String(GrB_IndexUnaryOp, char *, GrB_Field); +GrB_Info GrB_IndexUnaryOp_get_VOID(GrB_IndexUnaryOp, void *, GrB_Field); GrB_Info GrB_IndexUnaryOp_new(GrB_IndexUnaryOp *op, GxB_index_unary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype); +GrB_Info GrB_IndexUnaryOp_set_INT32(GrB_IndexUnaryOp, int32_t, GrB_Field); +GrB_Info GrB_IndexUnaryOp_set_String(GrB_IndexUnaryOp, char *, GrB_Field); +GrB_Info GrB_IndexUnaryOp_set_VOID(GrB_IndexUnaryOp, void *, GrB_Field, size_t); GrB_Info GrB_IndexUnaryOp_wait(GrB_IndexUnaryOp op, GrB_WaitMode waitmode); /* matrix */ -GrB_Info GrB_Col_assign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); -GrB_Info GrB_Col_extract(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); +GrB_Info GrB_Col_assign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *Ilist, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); +GrB_Info GrB_Col_extract(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *Ilist, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); GrB_Info GrB_Matrix_apply(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_UnaryOp op, const GrB_Matrix A, const GrB_Descriptor desc); GrB_Info GrB_Matrix_apply_BinaryOp1st_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, bool x, const GrB_Matrix A, const GrB_Descriptor desc); GrB_Info GrB_Matrix_apply_BinaryOp1st_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, float x, const GrB_Matrix A, const GrB_Descriptor desc); @@ -2541,32 +2633,32 @@ GrB_Info GrB_Matrix_apply_IndexOp_UINT8(GrB_Matrix C, const GrB_Matrix Mask, con GrB_Info GrB_Matrix_apply_IndexOp_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint16_t y, const GrB_Descriptor desc); GrB_Info GrB_Matrix_apply_IndexOp_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint32_t y, const GrB_Descriptor desc); GrB_Info GrB_Matrix_apply_IndexOp_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint64_t y, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, double x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_build_BOOL(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const bool *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_FP32(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const float *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_FP64(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const double *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_INT8(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const int8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_INT16(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const int16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_INT32(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const int32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_INT64(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const int64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_UDT(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const void *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_UINT8(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const uint8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_UINT16(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const uint16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_UINT32(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const uint32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_UINT64(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, const uint64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_assign(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, bool x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, float x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, double x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, void *x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_build_BOOL(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const bool *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_FP32(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const float *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_FP64(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const double *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_INT8(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const int8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_INT16(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const int16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_INT32(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const int32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_INT64(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const int64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_UDT(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const void *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_UINT8(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const uint8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_UINT16(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const uint16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_UINT32(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const uint32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_UINT64(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const uint64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); GrB_Info GrB_Matrix_clear(GrB_Matrix A); GrB_Info GrB_Matrix_deserialize(GrB_Matrix *C, GrB_Type type, const void *blob, GrB_Index blob_size); GrB_Info GrB_Matrix_diag(GrB_Matrix *C, const GrB_Vector v, int64_t k); @@ -2592,7 +2684,7 @@ GrB_Info GrB_Matrix_export_UINT8(GrB_Index *Ap, GrB_Index *Ai, uint8_t *Ax, GrB_ GrB_Info GrB_Matrix_export_UINT16(GrB_Index *Ap, GrB_Index *Ai, uint16_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); GrB_Info GrB_Matrix_export_UINT32(GrB_Index *Ap, GrB_Index *Ai, uint32_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); GrB_Info GrB_Matrix_export_UINT64(GrB_Index *Ap, GrB_Index *Ai, uint64_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -GrB_Info GrB_Matrix_extract(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_extract(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); GrB_Info GrB_Matrix_extractElement_BOOL(bool *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); GrB_Info GrB_Matrix_extractElement_FP32(float *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); GrB_Info GrB_Matrix_extractElement_FP64(double *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); @@ -2606,19 +2698,24 @@ GrB_Info GrB_Matrix_extractElement_UINT8(uint8_t *x, const GrB_Matrix A, GrB_Ind GrB_Info GrB_Matrix_extractElement_UINT16(uint16_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); GrB_Info GrB_Matrix_extractElement_UINT32(uint32_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); GrB_Info GrB_Matrix_extractElement_UINT64(uint64_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -GrB_Info GrB_Matrix_extractTuples_BOOL(GrB_Index *I, GrB_Index *J, bool *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_FP32(GrB_Index *I, GrB_Index *J, float *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_FP64(GrB_Index *I, GrB_Index *J, double *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_INT8(GrB_Index *I, GrB_Index *J, int8_t *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_INT16(GrB_Index *I, GrB_Index *J, int16_t *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_INT32(GrB_Index *I, GrB_Index *J, int32_t *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_INT64(GrB_Index *I, GrB_Index *J, int64_t *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_UDT(GrB_Index *I, GrB_Index *J, void *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_UINT8(GrB_Index *I, GrB_Index *J, uint8_t *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_UINT16(GrB_Index *I, GrB_Index *J, uint16_t *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_UINT32(GrB_Index *I, GrB_Index *J, uint32_t *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_UINT64(GrB_Index *I, GrB_Index *J, uint64_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_BOOL(GrB_Index *Ilist, GrB_Index *J, bool *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_FP32(GrB_Index *Ilist, GrB_Index *J, float *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_FP64(GrB_Index *Ilist, GrB_Index *J, double *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_INT8(GrB_Index *Ilist, GrB_Index *J, int8_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_INT16(GrB_Index *Ilist, GrB_Index *J, int16_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_INT32(GrB_Index *Ilist, GrB_Index *J, int32_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_INT64(GrB_Index *Ilist, GrB_Index *J, int64_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_UDT(GrB_Index *Ilist, GrB_Index *J, void *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_UINT8(GrB_Index *Ilist, GrB_Index *J, uint8_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_UINT16(GrB_Index *Ilist, GrB_Index *J, uint16_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_UINT32(GrB_Index *Ilist, GrB_Index *J, uint32_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_UINT64(GrB_Index *Ilist, GrB_Index *J, uint64_t *X, GrB_Index *nvals, const GrB_Matrix A); GrB_Info GrB_Matrix_free(GrB_Matrix *A); +GrB_Info GrB_Matrix_get_INT32(GrB_Matrix, int32_t *, GrB_Field); +GrB_Info GrB_Matrix_get_SIZE(GrB_Matrix, size_t *, GrB_Field); +GrB_Info GrB_Matrix_get_Scalar(GrB_Matrix, GrB_Scalar, GrB_Field); +GrB_Info GrB_Matrix_get_String(GrB_Matrix, char *, GrB_Field); +GrB_Info GrB_Matrix_get_VOID(GrB_Matrix, void *, GrB_Field); GrB_Info GrB_Matrix_import_BOOL(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const bool *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); GrB_Info GrB_Matrix_import_FP32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const float *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); GrB_Info GrB_Matrix_import_FP64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const double *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); @@ -2684,6 +2781,10 @@ GrB_Info GrB_Matrix_setElement_UINT8(GrB_Matrix C, uint8_t x, GrB_Index i, GrB_I GrB_Info GrB_Matrix_setElement_UINT16(GrB_Matrix C, uint16_t x, GrB_Index i, GrB_Index j); GrB_Info GrB_Matrix_setElement_UINT32(GrB_Matrix C, uint32_t x, GrB_Index i, GrB_Index j); GrB_Info GrB_Matrix_setElement_UINT64(GrB_Matrix C, uint64_t x, GrB_Index i, GrB_Index j); +GrB_Info GrB_Matrix_set_INT32(GrB_Matrix, int32_t, GrB_Field); +GrB_Info GrB_Matrix_set_Scalar(GrB_Matrix, GrB_Scalar, GrB_Field); +GrB_Info GrB_Matrix_set_String(GrB_Matrix, char *, GrB_Field); +GrB_Info GrB_Matrix_set_VOID(GrB_Matrix, void *, GrB_Field, size_t); GrB_Info GrB_Matrix_wait(GrB_Matrix A, GrB_WaitMode waitmode); GrB_Info GrB_Row_assign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, GrB_Index i, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); GrB_Info GrB_mxm(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); @@ -2694,6 +2795,10 @@ GrB_Info GrB_vxm(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, /* monoid */ GrB_Info GrB_Monoid_error(const char **error, const GrB_Monoid monoid); GrB_Info GrB_Monoid_free(GrB_Monoid *monoid); +GrB_Info GrB_Monoid_get_INT32(GrB_Monoid, int32_t *, GrB_Field); +GrB_Info GrB_Monoid_get_SIZE(GrB_Monoid, size_t *, GrB_Field); +GrB_Info GrB_Monoid_get_String(GrB_Monoid, char *, GrB_Field); +GrB_Info GrB_Monoid_get_VOID(GrB_Monoid, void *, GrB_Field); GrB_Info GrB_Monoid_new_BOOL(GrB_Monoid *monoid, GrB_BinaryOp op, bool identity); GrB_Info GrB_Monoid_new_FP32(GrB_Monoid *monoid, GrB_BinaryOp op, float identity); GrB_Info GrB_Monoid_new_FP64(GrB_Monoid *monoid, GrB_BinaryOp op, double identity); @@ -2706,9 +2811,22 @@ GrB_Info GrB_Monoid_new_UINT8(GrB_Monoid *monoid, GrB_BinaryOp op, uint8_t ident GrB_Info GrB_Monoid_new_UINT16(GrB_Monoid *monoid, GrB_BinaryOp op, uint16_t identity); GrB_Info GrB_Monoid_new_UINT32(GrB_Monoid *monoid, GrB_BinaryOp op, uint32_t identity); GrB_Info GrB_Monoid_new_UINT64(GrB_Monoid *monoid, GrB_BinaryOp op, uint64_t identity); +GrB_Info GrB_Monoid_set_INT32(GrB_Monoid, int32_t, GrB_Field); +GrB_Info GrB_Monoid_set_String(GrB_Monoid, char *, GrB_Field); +GrB_Info GrB_Monoid_set_VOID(GrB_Monoid, void *, GrB_Field, size_t); GrB_Info GrB_Monoid_wait(GrB_Monoid monoid, GrB_WaitMode waitmode); /* scalar */ +GrB_Info GrB_BinaryOp_get_Scalar(GrB_BinaryOp, GrB_Scalar, GrB_Field); +GrB_Info GrB_BinaryOp_set_Scalar(GrB_BinaryOp, GrB_Scalar, GrB_Field); +GrB_Info GrB_Descriptor_get_Scalar(GrB_Descriptor, GrB_Scalar, GrB_Field); +GrB_Info GrB_Descriptor_set_Scalar(GrB_Descriptor, GrB_Scalar, GrB_Field); +GrB_Info GrB_Global_get_Scalar(GrB_Global, GrB_Scalar, GrB_Field); +GrB_Info GrB_Global_set_Scalar(GrB_Global, GrB_Scalar, GrB_Field); +GrB_Info GrB_IndexUnaryOp_get_Scalar(GrB_IndexUnaryOp, GrB_Scalar, GrB_Field); +GrB_Info GrB_IndexUnaryOp_set_Scalar(GrB_IndexUnaryOp, GrB_Scalar, GrB_Field); +GrB_Info GrB_Monoid_get_Scalar(GrB_Monoid, GrB_Scalar, GrB_Field); +GrB_Info GrB_Monoid_set_Scalar(GrB_Monoid, GrB_Scalar, GrB_Field); GrB_Info GrB_Scalar_clear(GrB_Scalar s); GrB_Info GrB_Scalar_dup(GrB_Scalar *s, const GrB_Scalar t); GrB_Info GrB_Scalar_error(const char **error, const GrB_Scalar s); @@ -2725,6 +2843,11 @@ GrB_Info GrB_Scalar_extractElement_UINT16(uint16_t *x, const GrB_Scalar s); GrB_Info GrB_Scalar_extractElement_UINT32(uint32_t *x, const GrB_Scalar s); GrB_Info GrB_Scalar_extractElement_UINT64(uint64_t *x, const GrB_Scalar s); GrB_Info GrB_Scalar_free(GrB_Scalar *s); +GrB_Info GrB_Scalar_get_INT32(GrB_Scalar, int32_t *, GrB_Field); +GrB_Info GrB_Scalar_get_SIZE(GrB_Scalar, size_t *, GrB_Field); +GrB_Info GrB_Scalar_get_Scalar(GrB_Scalar, GrB_Scalar, GrB_Field); +GrB_Info GrB_Scalar_get_String(GrB_Scalar, char *, GrB_Field); +GrB_Info GrB_Scalar_get_VOID(GrB_Scalar, void *, GrB_Field); GrB_Info GrB_Scalar_new(GrB_Scalar *s, GrB_Type type); GrB_Info GrB_Scalar_nvals(GrB_Index *nvals, const GrB_Scalar s); GrB_Info GrB_Scalar_setElement_BOOL(GrB_Scalar s, bool x); @@ -2739,24 +2862,55 @@ GrB_Info GrB_Scalar_setElement_UINT8(GrB_Scalar s, uint8_t x); GrB_Info GrB_Scalar_setElement_UINT16(GrB_Scalar s, uint16_t x); GrB_Info GrB_Scalar_setElement_UINT32(GrB_Scalar s, uint32_t x); GrB_Info GrB_Scalar_setElement_UINT64(GrB_Scalar s, uint64_t x); +GrB_Info GrB_Scalar_set_INT32(GrB_Scalar, int32_t, GrB_Field); +GrB_Info GrB_Scalar_set_Scalar(GrB_Scalar, GrB_Scalar, GrB_Field); +GrB_Info GrB_Scalar_set_String(GrB_Scalar, char *, GrB_Field); +GrB_Info GrB_Scalar_set_VOID(GrB_Scalar, void *, GrB_Field, size_t); GrB_Info GrB_Scalar_wait(GrB_Scalar s, GrB_WaitMode waitmode); +GrB_Info GrB_Semiring_get_Scalar(GrB_Semiring, GrB_Scalar, GrB_Field); +GrB_Info GrB_Semiring_set_Scalar(GrB_Semiring, GrB_Scalar, GrB_Field); +GrB_Info GrB_Type_get_Scalar(GrB_Type, GrB_Scalar, GrB_Field); +GrB_Info GrB_Type_set_Scalar(GrB_Type, GrB_Scalar, GrB_Field); +GrB_Info GrB_UnaryOp_get_Scalar(GrB_UnaryOp, GrB_Scalar, GrB_Field); +GrB_Info GrB_UnaryOp_set_Scalar(GrB_UnaryOp, GrB_Scalar, GrB_Field); /* semiring */ GrB_Info GrB_Semiring_error(const char **error, const GrB_Semiring semiring); GrB_Info GrB_Semiring_free(GrB_Semiring *semiring); +GrB_Info GrB_Semiring_get_INT32(GrB_Semiring, int32_t *, GrB_Field); +GrB_Info GrB_Semiring_get_SIZE(GrB_Semiring, size_t *, GrB_Field); +GrB_Info GrB_Semiring_get_String(GrB_Semiring, char *, GrB_Field); +GrB_Info GrB_Semiring_get_VOID(GrB_Semiring, void *, GrB_Field); GrB_Info GrB_Semiring_new(GrB_Semiring *semiring, GrB_Monoid add, GrB_BinaryOp multiply); +GrB_Info GrB_Semiring_set_INT32(GrB_Semiring, int32_t, GrB_Field); +GrB_Info GrB_Semiring_set_String(GrB_Semiring, char *, GrB_Field); +GrB_Info GrB_Semiring_set_VOID(GrB_Semiring, void *, GrB_Field, size_t); GrB_Info GrB_Semiring_wait(GrB_Semiring semiring, GrB_WaitMode waitmode); /* type */ GrB_Info GrB_Type_error(const char **error, const GrB_Type type); GrB_Info GrB_Type_free(GrB_Type *type); +GrB_Info GrB_Type_get_INT32(GrB_Type, int32_t *, GrB_Field); +GrB_Info GrB_Type_get_SIZE(GrB_Type, size_t *, GrB_Field); +GrB_Info GrB_Type_get_String(GrB_Type, char *, GrB_Field); +GrB_Info GrB_Type_get_VOID(GrB_Type, void *, GrB_Field); GrB_Info GrB_Type_new(GrB_Type *type, size_t sizeof_ctype); +GrB_Info GrB_Type_set_INT32(GrB_Type, int32_t, GrB_Field); +GrB_Info GrB_Type_set_String(GrB_Type, char *, GrB_Field); +GrB_Info GrB_Type_set_VOID(GrB_Type, void *, GrB_Field, size_t); GrB_Info GrB_Type_wait(GrB_Type type, GrB_WaitMode waitmode); /* unary */ GrB_Info GrB_UnaryOp_error(const char **error, const GrB_UnaryOp op); GrB_Info GrB_UnaryOp_free(GrB_UnaryOp *unaryop); +GrB_Info GrB_UnaryOp_get_INT32(GrB_UnaryOp, int32_t *, GrB_Field); +GrB_Info GrB_UnaryOp_get_SIZE(GrB_UnaryOp, size_t *, GrB_Field); +GrB_Info GrB_UnaryOp_get_String(GrB_UnaryOp, char *, GrB_Field); +GrB_Info GrB_UnaryOp_get_VOID(GrB_UnaryOp, void *, GrB_Field); GrB_Info GrB_UnaryOp_new(GrB_UnaryOp *unaryop, GxB_unary_function function, GrB_Type ztype, GrB_Type xtype); +GrB_Info GrB_UnaryOp_set_INT32(GrB_UnaryOp, int32_t, GrB_Field); +GrB_Info GrB_UnaryOp_set_String(GrB_UnaryOp, char *, GrB_Field); +GrB_Info GrB_UnaryOp_set_VOID(GrB_UnaryOp, void *, GrB_Field, size_t); GrB_Info GrB_UnaryOp_wait(GrB_UnaryOp op, GrB_WaitMode waitmode); /* vector */ @@ -2800,32 +2954,32 @@ GrB_Info GrB_Vector_apply_IndexOp_UINT8(GrB_Vector w, const GrB_Vector mask, con GrB_Info GrB_Vector_apply_IndexOp_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint16_t y, const GrB_Descriptor desc); GrB_Info GrB_Vector_apply_IndexOp_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint32_t y, const GrB_Descriptor desc); GrB_Info GrB_Vector_apply_IndexOp_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint64_t y, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, double x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_build_BOOL(GrB_Vector w, const GrB_Index *I, const bool *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_FP32(GrB_Vector w, const GrB_Index *I, const float *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_FP64(GrB_Vector w, const GrB_Index *I, const double *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_INT8(GrB_Vector w, const GrB_Index *I, const int8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_INT16(GrB_Vector w, const GrB_Index *I, const int16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_INT32(GrB_Vector w, const GrB_Index *I, const int32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_INT64(GrB_Vector w, const GrB_Index *I, const int64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_UDT(GrB_Vector w, const GrB_Index *I, const void *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_UINT8(GrB_Vector w, const GrB_Index *I, const uint8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_UINT16(GrB_Vector w, const GrB_Index *I, const uint16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_UINT32(GrB_Vector w, const GrB_Index *I, const uint32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_UINT64(GrB_Vector w, const GrB_Index *I, const uint64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_assign(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, bool x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, float x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, double x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, void *x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_build_BOOL(GrB_Vector w, const GrB_Index *Ilist, const bool *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_FP32(GrB_Vector w, const GrB_Index *Ilist, const float *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_FP64(GrB_Vector w, const GrB_Index *Ilist, const double *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_INT8(GrB_Vector w, const GrB_Index *Ilist, const int8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_INT16(GrB_Vector w, const GrB_Index *Ilist, const int16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_INT32(GrB_Vector w, const GrB_Index *Ilist, const int32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_INT64(GrB_Vector w, const GrB_Index *Ilist, const int64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_UDT(GrB_Vector w, const GrB_Index *Ilist, const void *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_UINT8(GrB_Vector w, const GrB_Index *Ilist, const uint8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_UINT16(GrB_Vector w, const GrB_Index *Ilist, const uint16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_UINT32(GrB_Vector w, const GrB_Index *Ilist, const uint32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_UINT64(GrB_Vector w, const GrB_Index *Ilist, const uint64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); GrB_Info GrB_Vector_clear(GrB_Vector v); GrB_Info GrB_Vector_dup(GrB_Vector *w, const GrB_Vector u); GrB_Info GrB_Vector_eWiseAdd_BinaryOp(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); @@ -2835,7 +2989,7 @@ GrB_Info GrB_Vector_eWiseMult_BinaryOp(GrB_Vector w, const GrB_Vector mask, cons GrB_Info GrB_Vector_eWiseMult_Monoid(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); GrB_Info GrB_Vector_eWiseMult_Semiring(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); GrB_Info GrB_Vector_error(const char **error, const GrB_Vector v); -GrB_Info GrB_Vector_extract(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_extract(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); GrB_Info GrB_Vector_extractElement_BOOL(bool *x, const GrB_Vector v, GrB_Index i); GrB_Info GrB_Vector_extractElement_FP32(float *x, const GrB_Vector v, GrB_Index i); GrB_Info GrB_Vector_extractElement_FP64(double *x, const GrB_Vector v, GrB_Index i); @@ -2849,19 +3003,24 @@ GrB_Info GrB_Vector_extractElement_UINT8(uint8_t *x, const GrB_Vector v, GrB_Ind GrB_Info GrB_Vector_extractElement_UINT16(uint16_t *x, const GrB_Vector v, GrB_Index i); GrB_Info GrB_Vector_extractElement_UINT32(uint32_t *x, const GrB_Vector v, GrB_Index i); GrB_Info GrB_Vector_extractElement_UINT64(uint64_t *x, const GrB_Vector v, GrB_Index i); -GrB_Info GrB_Vector_extractTuples_BOOL(GrB_Index *I, bool *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_FP32(GrB_Index *I, float *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_FP64(GrB_Index *I, double *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_INT8(GrB_Index *I, int8_t *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_INT16(GrB_Index *I, int16_t *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_INT32(GrB_Index *I, int32_t *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_INT64(GrB_Index *I, int64_t *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_UDT(GrB_Index *I, void *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_UINT8(GrB_Index *I, uint8_t *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_UINT16(GrB_Index *I, uint16_t *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_UINT32(GrB_Index *I, uint32_t *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_UINT64(GrB_Index *I, uint64_t *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_BOOL(GrB_Index *Ilist, bool *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_FP32(GrB_Index *Ilist, float *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_FP64(GrB_Index *Ilist, double *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_INT8(GrB_Index *Ilist, int8_t *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_INT16(GrB_Index *Ilist, int16_t *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_INT32(GrB_Index *Ilist, int32_t *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_INT64(GrB_Index *Ilist, int64_t *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_UDT(GrB_Index *Ilist, void *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_UINT8(GrB_Index *Ilist, uint8_t *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_UINT16(GrB_Index *Ilist, uint16_t *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_UINT32(GrB_Index *Ilist, uint32_t *X, GrB_Index *nvals, const GrB_Vector v); +GrB_Info GrB_Vector_extractTuples_UINT64(GrB_Index *Ilist, uint64_t *X, GrB_Index *nvals, const GrB_Vector v); GrB_Info GrB_Vector_free(GrB_Vector *v); +GrB_Info GrB_Vector_get_INT32(GrB_Vector, int32_t *, GrB_Field); +GrB_Info GrB_Vector_get_SIZE(GrB_Vector, size_t *, GrB_Field); +GrB_Info GrB_Vector_get_Scalar(GrB_Vector, GrB_Scalar, GrB_Field); +GrB_Info GrB_Vector_get_String(GrB_Vector, char *, GrB_Field); +GrB_Info GrB_Vector_get_VOID(GrB_Vector, void *, GrB_Field); GrB_Info GrB_Vector_new(GrB_Vector *v, GrB_Type type, GrB_Index n); GrB_Info GrB_Vector_nvals(GrB_Index *nvals, const GrB_Vector v); GrB_Info GrB_Vector_reduce_BOOL(bool *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); @@ -2906,6 +3065,10 @@ GrB_Info GrB_Vector_setElement_UINT8(GrB_Vector w, uint8_t x, GrB_Index i); GrB_Info GrB_Vector_setElement_UINT16(GrB_Vector w, uint16_t x, GrB_Index i); GrB_Info GrB_Vector_setElement_UINT32(GrB_Vector w, uint32_t x, GrB_Index i); GrB_Info GrB_Vector_setElement_UINT64(GrB_Vector w, uint64_t x, GrB_Index i); +GrB_Info GrB_Vector_set_INT32(GrB_Vector, int32_t, GrB_Field); +GrB_Info GrB_Vector_set_Scalar(GrB_Vector, GrB_Scalar, GrB_Field); +GrB_Info GrB_Vector_set_String(GrB_Vector, char *, GrB_Field); +GrB_Info GrB_Vector_set_VOID(GrB_Vector, void *, GrB_Field, size_t); GrB_Info GrB_Vector_size(GrB_Index *n, const GrB_Vector v); GrB_Info GrB_Vector_wait(GrB_Vector v, GrB_WaitMode waitmode); @@ -2928,12 +3091,12 @@ GrB_Info GB_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GxB_Format_Valu /* binary */ GrB_Info GxB_BinaryOp_fprint(GrB_BinaryOp binaryop, const char *name, GxB_Print_Level pr, FILE *f); GrB_Info GxB_BinaryOp_new(GrB_BinaryOp *op, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *binop_name, const char *binop_defn); -GrB_Info GxB_BinaryOp_xtype(GrB_Type *xtype, GrB_BinaryOp binaryop); -GrB_Info GxB_BinaryOp_xtype_name(char *type_name, const GrB_BinaryOp binaryop); -GrB_Info GxB_BinaryOp_ytype(GrB_Type *ytype, GrB_BinaryOp binaryop); -GrB_Info GxB_BinaryOp_ytype_name(char *type_name, const GrB_BinaryOp binaryop); -GrB_Info GxB_BinaryOp_ztype(GrB_Type *ztype, GrB_BinaryOp binaryop); -GrB_Info GxB_BinaryOp_ztype_name(char *type_name, const GrB_BinaryOp binaryop); +GrB_Info GxB_BinaryOp_xtype(GrB_Type *xtype, GrB_BinaryOp op); +GrB_Info GxB_BinaryOp_xtype_name(char *type_name, const GrB_BinaryOp op); +GrB_Info GxB_BinaryOp_ytype(GrB_Type *ytype, GrB_BinaryOp op); +GrB_Info GxB_BinaryOp_ytype_name(char *type_name, const GrB_BinaryOp op); +GrB_Info GxB_BinaryOp_ztype(GrB_Type *ztype, GrB_BinaryOp op); +GrB_Info GxB_BinaryOp_ztype_name(char *type_name, const GrB_BinaryOp op); /* context */ GrB_Info GxB_Context_disengage(GxB_Context Context); @@ -2941,48 +3104,59 @@ GrB_Info GxB_Context_engage(GxB_Context Context); GrB_Info GxB_Context_error(const char **error, const GxB_Context Context); GrB_Info GxB_Context_fprint(GxB_Context Context, const char *name, GxB_Print_Level pr, FILE *f); GrB_Info GxB_Context_free(GxB_Context *Context); -GrB_Info GxB_Context_get(GxB_Context Context, GxB_Context_Field field, ...); -GrB_Info GxB_Context_get_FP64(GxB_Context Context, GxB_Context_Field field, double *value); -GrB_Info GxB_Context_get_INT32(GxB_Context Context, GxB_Context_Field field, int32_t *value); +GrB_Info GxB_Context_get(GxB_Context, GxB_Context_Field, ...); +GrB_Info GxB_Context_get_FP64(GxB_Context, GxB_Context_Field, double *); +GrB_Info GxB_Context_get_INT(GxB_Context, int32_t *, GrB_Field); +GrB_Info GxB_Context_get_INT32(GxB_Context, GxB_Context_Field, int32_t *); +GrB_Info GxB_Context_get_SIZE(GxB_Context, size_t *, GrB_Field); +GrB_Info GxB_Context_get_String(GxB_Context, char *, GrB_Field); +GrB_Info GxB_Context_get_VOID(GxB_Context, void *, GrB_Field); GrB_Info GxB_Context_new(GxB_Context *Context); -GrB_Info GxB_Context_set(GxB_Context Context, GxB_Context_Field field, ...); -GrB_Info GxB_Context_set_FP64(GxB_Context Context, GxB_Context_Field field, double value); -GrB_Info GxB_Context_set_INT32(GxB_Context Context, GxB_Context_Field field, int32_t value); +GrB_Info GxB_Context_set(GxB_Context, GxB_Context_Field, ...); +GrB_Info GxB_Context_set_FP64(GxB_Context, GxB_Context_Field, double); +GrB_Info GxB_Context_set_INT(GxB_Context, int32_t, GrB_Field); +GrB_Info GxB_Context_set_INT32(GxB_Context, GxB_Context_Field, int32_t); +GrB_Info GxB_Context_set_String(GxB_Context, char *, GrB_Field); +GrB_Info GxB_Context_set_VOID(GxB_Context, void *, GrB_Field, size_t); GrB_Info GxB_Context_wait(GxB_Context Context, GrB_WaitMode waitmode); /* core */ -GrB_Info GxB_Global_Option_get(GxB_Option_Field field, ...); -GrB_Info GxB_Global_Option_get_CHAR(GxB_Option_Field field, const char **value); -GrB_Info GxB_Global_Option_get_FP64(GxB_Option_Field field, double *value); -GrB_Info GxB_Global_Option_get_FUNCTION(GxB_Option_Field field, void **value); -GrB_Info GxB_Global_Option_get_INT32(GxB_Option_Field field, int32_t *value); -GrB_Info GxB_Global_Option_get_INT64(GxB_Option_Field field, int64_t *value); -GrB_Info GxB_Global_Option_set(GxB_Option_Field field, ...); -GrB_Info GxB_Global_Option_set_CHAR(GxB_Option_Field field, const char *value); -GrB_Info GxB_Global_Option_set_FP64(GxB_Option_Field field, double value); -GrB_Info GxB_Global_Option_set_FP64_ARRAY(GxB_Option_Field field, double *value); -GrB_Info GxB_Global_Option_set_FUNCTION(GxB_Option_Field field, void *value); -GrB_Info GxB_Global_Option_set_INT32(GxB_Option_Field field, int32_t value); -GrB_Info GxB_Global_Option_set_INT64_ARRAY(GxB_Option_Field field, int64_t *value); -GrB_Info GxB_deserialize_type_name(char *type_name, const void *blob, GrB_Index blob_size); +GrB_Info GxB_Global_Option_get(GxB_Option_Field, ...); +GrB_Info GxB_Global_Option_get_CHAR(GxB_Option_Field, const char **); +GrB_Info GxB_Global_Option_get_FP64(GxB_Option_Field, double *); +GrB_Info GxB_Global_Option_get_FUNCTION(GxB_Option_Field, void **); +GrB_Info GxB_Global_Option_get_INT32(GxB_Option_Field, int32_t *); +GrB_Info GxB_Global_Option_get_INT64(GxB_Option_Field, int64_t *); +GrB_Info GxB_Global_Option_set(GxB_Option_Field, ...); +GrB_Info GxB_Global_Option_set_CHAR(GxB_Option_Field, const char *); +GrB_Info GxB_Global_Option_set_FP64(GxB_Option_Field, double); +GrB_Info GxB_Global_Option_set_FP64_ARRAY(GxB_Option_Field, double *); +GrB_Info GxB_Global_Option_set_FUNCTION(GxB_Option_Field, void *); +GrB_Info GxB_Global_Option_set_INT32(GxB_Option_Field, int32_t); +GrB_Info GxB_Global_Option_set_INT64_ARRAY(GxB_Option_Field, int64_t *); +GrB_Info GxB_Serialized_get_INT32(const void *, int32_t *, GrB_Field, size_t); +GrB_Info GxB_Serialized_get_SIZE(const void *, size_t *, GrB_Field, size_t); +GrB_Info GxB_Serialized_get_String(const void *, char *, GrB_Field, size_t); +GrB_Info GxB_Serialized_get_VOID(const void *, void *, GrB_Field, size_t); +GrB_Info GxB_deserialize_type_name(char *, const void *, GrB_Index); GrB_Info GxB_init(GrB_Mode mode, void *(*user_malloc_function)(size_t), void *(*user_calloc_function)(size_t, size_t), void *(*user_realloc_function)(void *, size_t), void (*user_free_function)(void *)); /* descriptor */ -GrB_Info GxB_Desc_get(GrB_Descriptor desc, GrB_Desc_Field field, ...); -GrB_Info GxB_Desc_get_FP64(GrB_Descriptor desc, GrB_Desc_Field field, double *value); -GrB_Info GxB_Desc_get_INT32(GrB_Descriptor desc, GrB_Desc_Field field, int32_t *value); -GrB_Info GxB_Desc_set(GrB_Descriptor desc, GrB_Desc_Field field, ...); -GrB_Info GxB_Desc_set_FP64(GrB_Descriptor desc, GrB_Desc_Field field, double value); -GrB_Info GxB_Desc_set_INT32(GrB_Descriptor desc, GrB_Desc_Field field, int32_t value); +GrB_Info GxB_Desc_get(GrB_Descriptor, GrB_Desc_Field, ...); +GrB_Info GxB_Desc_get_FP64(GrB_Descriptor, GrB_Desc_Field, double *); +GrB_Info GxB_Desc_get_INT32(GrB_Descriptor, GrB_Desc_Field, int32_t *); +GrB_Info GxB_Desc_set(GrB_Descriptor, GrB_Desc_Field, ...); +GrB_Info GxB_Desc_set_FP64(GrB_Descriptor, GrB_Desc_Field, double); +GrB_Info GxB_Desc_set_INT32(GrB_Descriptor, GrB_Desc_Field, int32_t); GrB_Info GxB_Descriptor_fprint(GrB_Descriptor descriptor, const char *name, GxB_Print_Level pr, FILE *f); -GrB_Info GxB_Descriptor_get(GrB_Desc_Value *val, GrB_Descriptor desc, GrB_Desc_Field field); +GrB_Info GxB_Descriptor_get(GrB_Desc_Value *, GrB_Descriptor, GrB_Desc_Field); /* indexunary */ GrB_Info GxB_IndexUnaryOp_fprint(GrB_IndexUnaryOp op, const char *name, GxB_Print_Level pr, FILE *f); GrB_Info GxB_IndexUnaryOp_new(GrB_IndexUnaryOp *op, GxB_index_unary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *idxop_name, const char *idxop_defn); -GrB_Info GxB_IndexUnaryOp_xtype_name(char *type_name, const GrB_IndexUnaryOp op); -GrB_Info GxB_IndexUnaryOp_ytype_name(char *type_name, const GrB_IndexUnaryOp op); -GrB_Info GxB_IndexUnaryOp_ztype_name(char *type_name, const GrB_IndexUnaryOp op); +GrB_Info GxB_IndexUnaryOp_xtype_name(char *, const GrB_IndexUnaryOp op); +GrB_Info GxB_IndexUnaryOp_ytype_name(char *, const GrB_IndexUnaryOp op); +GrB_Info GxB_IndexUnaryOp_ztype_name(char *, const GrB_IndexUnaryOp op); /* iterator */ GrB_Index GxB_Matrix_Iterator_getp(GxB_Iterator iterator); @@ -3025,17 +3199,17 @@ void GxB_Iterator_get_UDT(GxB_Iterator iterator, void *value); void GxB_Matrix_Iterator_getIndex(GxB_Iterator iterator, GrB_Index *row, GrB_Index *col); /* matrix */ -GrB_Info GxB_Col_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); +GrB_Info GxB_Col_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *Ilist, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); GrB_Info GxB_Matrix_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); -GrB_Info GxB_Matrix_Option_get(GrB_Matrix A, GxB_Option_Field field, ...); -GrB_Info GxB_Matrix_Option_get_FP64(GrB_Matrix A, GxB_Option_Field field, double *value); -GrB_Info GxB_Matrix_Option_get_INT32(GrB_Matrix A, GxB_Option_Field field, int32_t *value); -GrB_Info GxB_Matrix_Option_set(GrB_Matrix A, GxB_Option_Field field, ...); -GrB_Info GxB_Matrix_Option_set_FP64(GrB_Matrix A, GxB_Option_Field field, double value); -GrB_Info GxB_Matrix_Option_set_INT32(GrB_Matrix A, GxB_Option_Field field, int32_t value); +GrB_Info GxB_Matrix_Option_get(GrB_Matrix, GxB_Option_Field, ...); +GrB_Info GxB_Matrix_Option_get_FP64(GrB_Matrix, GxB_Option_Field, double *); +GrB_Info GxB_Matrix_Option_get_INT32(GrB_Matrix, GxB_Option_Field, int32_t *); +GrB_Info GxB_Matrix_Option_set(GrB_Matrix, GxB_Option_Field, ...); +GrB_Info GxB_Matrix_Option_set_FP64(GrB_Matrix, GxB_Option_Field, double); +GrB_Info GxB_Matrix_Option_set_INT32(GrB_Matrix, GxB_Option_Field, int32_t); GrB_Info GxB_Matrix_apply_BinaryOp1st(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Matrix A, const GrB_Descriptor desc); GrB_Info GxB_Matrix_apply_BinaryOp2nd(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Scalar y, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_build_Scalar(GrB_Matrix C, const GrB_Index *I, const GrB_Index *J, GrB_Scalar scalar, GrB_Index nvals); +GrB_Info GxB_Matrix_build_Scalar(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, GrB_Scalar scalar, GrB_Index nvals); GrB_Info GxB_Matrix_concat(GrB_Matrix C, const GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Descriptor desc); GrB_Info GxB_Matrix_deserialize(GrB_Matrix *C, GrB_Type type, const void *blob, GrB_Index blob_size, const GrB_Descriptor desc); GrB_Info GxB_Matrix_diag(GrB_Matrix C, const GrB_Vector v, int64_t k, const GrB_Descriptor desc); @@ -3074,20 +3248,20 @@ GrB_Info GxB_Matrix_select(GrB_Matrix C, const GrB_Matrix Mask, const GrB_Binary GrB_Info GxB_Matrix_serialize(void **blob_handle, GrB_Index *blob_size_handle, GrB_Matrix A, const GrB_Descriptor desc); GrB_Info GxB_Matrix_sort(GrB_Matrix C, GrB_Matrix P, GrB_BinaryOp op, GrB_Matrix A, const GrB_Descriptor desc); GrB_Info GxB_Matrix_split(GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Index *Tile_nrows, const GrB_Index *Tile_ncols, const GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, double x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, bool x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, float x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, double x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, void *x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); GrB_Info GxB_Matrix_type(GrB_Type *type, const GrB_Matrix A); GrB_Info GxB_Matrix_type_name(char *type_name, const GrB_Matrix A); GrB_Info GxB_Matrix_unpack_BitmapC(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); @@ -3109,7 +3283,7 @@ GrB_Info GxB_unpack_HyperHash(GrB_Matrix A, GrB_Matrix *Y, const GrB_Descriptor GrB_Info GxB_Monoid_fprint(GrB_Monoid monoid, const char *name, GxB_Print_Level pr, FILE *f); GrB_Info GxB_Monoid_identity(void *identity, GrB_Monoid monoid); GrB_Info GxB_Monoid_operator(GrB_BinaryOp *op, GrB_Monoid monoid); -GrB_Info GxB_Monoid_terminal(bool *has_terminal, void *terminal, GrB_Monoid monoid); +GrB_Info GxB_Monoid_terminal(bool *, void *terminal, GrB_Monoid monoid); GrB_Info GxB_Monoid_terminal_new_BOOL(GrB_Monoid *monoid, GrB_BinaryOp op, bool identity, bool terminal); GrB_Info GxB_Monoid_terminal_new_FP32(GrB_Monoid *monoid, GrB_BinaryOp op, float identity, float terminal); GrB_Info GxB_Monoid_terminal_new_FP64(GrB_Monoid *monoid, GrB_BinaryOp op, double identity, double terminal); @@ -3124,6 +3298,8 @@ GrB_Info GxB_Monoid_terminal_new_UINT32(GrB_Monoid *monoid, GrB_BinaryOp op, uin GrB_Info GxB_Monoid_terminal_new_UINT64(GrB_Monoid *monoid, GrB_BinaryOp op, uint64_t identity, uint64_t terminal); /* scalar */ +GrB_Info GxB_Context_get_Scalar(GxB_Context, GrB_Scalar, GrB_Field); +GrB_Info GxB_Context_set_Scalar(GxB_Context, GrB_Scalar, GrB_Field); GrB_Info GxB_Scalar_clear(GrB_Scalar s); GrB_Info GxB_Scalar_dup(GrB_Scalar *s, const GrB_Scalar t); GrB_Info GxB_Scalar_error(const char **error, const GrB_Scalar s); @@ -3159,6 +3335,7 @@ GrB_Info GxB_Scalar_setElement_UINT64(GrB_Scalar s, uint64_t x); GrB_Info GxB_Scalar_type(GrB_Type *type, const GrB_Scalar s); GrB_Info GxB_Scalar_type_name(char *type_name, const GrB_Scalar s); GrB_Info GxB_Scalar_wait(GrB_Scalar *s); +GrB_Info GxB_Serialized_get_Scalar(const void *, GrB_Scalar, GrB_Field, size_t); /* selectop */ GrB_Info GxB_SelectOp_fprint(GxB_SelectOp op, const char *name, GxB_Print_Level pr, FILE *f); @@ -3187,15 +3364,15 @@ GrB_Info GxB_UnaryOp_ztype_name(char *type_name, const GrB_UnaryOp unaryop); /* vector */ GrB_Info GxB_Vector_Iterator_attach(GxB_Iterator iterator, GrB_Vector v, GrB_Descriptor desc); -GrB_Info GxB_Vector_Option_get(GrB_Vector A, GxB_Option_Field field, ...); -GrB_Info GxB_Vector_Option_get_FP64(GrB_Vector v, GxB_Option_Field field, double *value); -GrB_Info GxB_Vector_Option_get_INT32(GrB_Vector v, GxB_Option_Field field, int32_t *value); -GrB_Info GxB_Vector_Option_set(GrB_Vector A, GxB_Option_Field field, ...); -GrB_Info GxB_Vector_Option_set_FP64(GrB_Vector v, GxB_Option_Field field, double value); -GrB_Info GxB_Vector_Option_set_INT32(GrB_Vector v, GxB_Option_Field field, int32_t value); +GrB_Info GxB_Vector_Option_get(GrB_Vector, GxB_Option_Field, ...); +GrB_Info GxB_Vector_Option_get_FP64(GrB_Vector, GxB_Option_Field, double *); +GrB_Info GxB_Vector_Option_get_INT32(GrB_Vector, GxB_Option_Field, int32_t *); +GrB_Info GxB_Vector_Option_set(GrB_Vector, GxB_Option_Field, ...); +GrB_Info GxB_Vector_Option_set_FP64(GrB_Vector, GxB_Option_Field, double); +GrB_Info GxB_Vector_Option_set_INT32(GrB_Vector, GxB_Option_Field, int32_t); GrB_Info GxB_Vector_apply_BinaryOp1st(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Vector u, const GrB_Descriptor desc); GrB_Info GxB_Vector_apply_BinaryOp2nd(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const GrB_Scalar y, const GrB_Descriptor desc); -GrB_Info GxB_Vector_build_Scalar(GrB_Vector w, const GrB_Index *I, GrB_Scalar scalar, GrB_Index nvals); +GrB_Info GxB_Vector_build_Scalar(GrB_Vector w, const GrB_Index *Ilist, GrB_Scalar scalar, GrB_Index nvals); GrB_Info GxB_Vector_deserialize(GrB_Vector *w, GrB_Type type, const void *blob, GrB_Index blob_size, const GrB_Descriptor desc); GrB_Info GxB_Vector_eWiseUnion(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Vector u, const GrB_Scalar alpha, const GrB_Vector v, const GrB_Scalar beta, const GrB_Descriptor desc); GrB_Info GxB_Vector_export_Bitmap(GrB_Vector *v, GrB_Type *type, GrB_Index *n, int8_t **vb, void **vx, GrB_Index *vb_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); @@ -3214,20 +3391,20 @@ GrB_Info GxB_Vector_pack_Full(GrB_Vector v, void **vx, GrB_Index vx_size, bool i GrB_Info GxB_Vector_select(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Vector u, const GrB_Scalar Thunk, const GrB_Descriptor desc); GrB_Info GxB_Vector_serialize(void **blob_handle, GrB_Index *blob_size_handle, GrB_Vector u, const GrB_Descriptor desc); GrB_Info GxB_Vector_sort(GrB_Vector w, GrB_Vector p, GrB_BinaryOp op, GrB_Vector u, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, float x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, double x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, bool x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, float x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, double x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, void *x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); GrB_Info GxB_Vector_type(GrB_Type *type, const GrB_Vector v); GrB_Info GxB_Vector_type_name(char *type_name, const GrB_Vector v); GrB_Info GxB_Vector_unpack_Bitmap(GrB_Vector v, int8_t **vb, void **vx, GrB_Index *vb_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); From a7ad1bb4b3b045f549bb302cee44cc5493c0fc34 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Thu, 17 Oct 2024 13:07:08 -0500 Subject: [PATCH 158/193] Update to SuiteSparse:GraphBLAS 9.3.1 (the latest) (#132) --- GB_VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GB_VERSION.txt b/GB_VERSION.txt index 47da986..3b74042 100644 --- a/GB_VERSION.txt +++ b/GB_VERSION.txt @@ -1 +1 @@ -9.1.0 +9.3.1 From 1509b4943cc4b3858aecd11eb3e7678b3ae9c0c3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 12:33:18 -0800 Subject: [PATCH 159/193] Bump peter-evans/create-pull-request from 6 to 7 (#134) Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 6 to 7. - [Release notes](https://github.com/peter-evans/create-pull-request/releases) - [Commits](https://github.com/peter-evans/create-pull-request/compare/v6...v7) --- updated-dependencies: - dependency-name: peter-evans/create-pull-request dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/update_graphblas.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update_graphblas.yml b/.github/workflows/update_graphblas.yml index c524aa0..153f1a7 100644 --- a/.github/workflows/update_graphblas.yml +++ b/.github/workflows/update_graphblas.yml @@ -42,7 +42,7 @@ jobs: shell: bash - name: Create Pull Request - uses: peter-evans/create-pull-request@v6 + uses: peter-evans/create-pull-request@v7 with: # See documentation: https://github.com/peter-evans/create-pull-request # Action behavior: https://github.com/peter-evans/create-pull-request#action-behaviour From 03a9eff3a423f2069ad59ac39a9de549cfd81cf8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 30 Nov 2024 16:41:16 -0600 Subject: [PATCH 160/193] Bump pypa/cibuildwheel from 2.21 to 2.22 (#135) Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 2.21 to 2.22. - [Release notes](https://github.com/pypa/cibuildwheel/releases) - [Changelog](https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md) - [Commits](https://github.com/pypa/cibuildwheel/compare/v2.21...v2.22) --- updated-dependencies: - dependency-name: pypa/cibuildwheel dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 2565b10..c61dce8 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -145,7 +145,7 @@ jobs: brew fetch --retry libomp && brew reinstall libomp echo MACOSX_DEPLOYMENT_TARGET=$(otool -l $(brew --prefix libomp)/lib/libomp.dylib | grep minos | awk '{print $2}') >> $GITHUB_ENV - - uses: pypa/cibuildwheel@v2.21 + - uses: pypa/cibuildwheel@v2.22 with: output-dir: wheelhouse env: From ddb8a4c7511096b8aa93fd4235a5a66a9701a6dd Mon Sep 17 00:00:00 2001 From: Adam Lugowski Date: Wed, 19 Feb 2025 16:56:40 -0800 Subject: [PATCH 161/193] Move from macos-12 to macos-13 runner (#137) GitHub removed macos-12. --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index c61dce8..20434c0 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -85,7 +85,7 @@ jobs: # macOS x86 # Note: keep as old as possible as due to libomp this will be the oldest supported macOS version. - - os: macos-12 + - os: macos-13 cibw_archs: "x86_64" # macOS Apple Silicon From 2e6920ea44b50292cdcd69b9aa9c4dd097403139 Mon Sep 17 00:00:00 2001 From: Jim Kitchen <2807270+jim22k@users.noreply.github.com> Date: Mon, 24 Feb 2025 09:44:34 -0600 Subject: [PATCH 162/193] Upgrade to 9.4.5 -- Add IndexBinaryOp (#136) --- .github/workflows/test.yml | 2 +- GB_VERSION.txt | 2 +- suitesparse.sh | 5 +- suitesparse_graphblas/__init__.py | 1 + suitesparse_graphblas/create_headers.py | 1 + suitesparse_graphblas/exceptions.py | 4 + suitesparse_graphblas/suitesparse_graphblas.h | 201 ++++++++++-------- .../suitesparse_graphblas_no_complex.h | 201 ++++++++++-------- 8 files changed, 236 insertions(+), 181 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b79df03..508d4a7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -41,7 +41,7 @@ jobs: - name: GraphBLAS (from source) if: (contains(matrix.source, 'source')) run: | - # From release (does not work with beta versions) + # From release (also works with beta versions) GRAPHBLAS_PREFIX=${CONDA_PREFIX} bash suitesparse.sh refs/tags/$(cat GB_VERSION.txt).0 # From tag diff --git a/GB_VERSION.txt b/GB_VERSION.txt index 3b74042..3a535e6 100644 --- a/GB_VERSION.txt +++ b/GB_VERSION.txt @@ -1 +1 @@ -9.3.1 +9.4.5 diff --git a/suitesparse.sh b/suitesparse.sh index 7385206..f804f40 100755 --- a/suitesparse.sh +++ b/suitesparse.sh @@ -3,7 +3,10 @@ set -x # echo on # parse SuiteSparse version from first argument, a git tag that ends in the version (no leading v) -if [[ $1 =~ refs/tags/([0-9]*\.[0-9]*\.[0-9]*)\..*$ ]]; then +if [[ $1 =~ refs/tags/([0-9]*\.[0-9]*\.[0-9]*\.beta[0-9]*).*$ ]]; then + echo "Beta version detected" + VERSION=${BASH_REMATCH[1]} +elif [[ $1 =~ refs/tags/([0-9]*\.[0-9]*\.[0-9]*)\..*$ ]]; then VERSION=${BASH_REMATCH[1]} else echo "Specify a SuiteSparse version, such as: $0 refs/tags/7.4.3.0 (got: $1)" diff --git a/suitesparse_graphblas/__init__.py b/suitesparse_graphblas/__init__.py index c61a6b9..72838b0 100644 --- a/suitesparse_graphblas/__init__.py +++ b/suitesparse_graphblas/__init__.py @@ -172,6 +172,7 @@ def libget(name): lib.GrB_NOT_IMPLEMENTED: ex.NotImplementedException, # GxB Errors lib.GxB_EXHAUSTED: StopIteration, + lib.GxB_JIT_ERROR: ex.JitError, } GrB_SUCCESS = lib.GrB_SUCCESS GrB_NO_VALUE = lib.GrB_NO_VALUE diff --git a/suitesparse_graphblas/create_headers.py b/suitesparse_graphblas/create_headers.py index d4d6afd..b5e9621 100644 --- a/suitesparse_graphblas/create_headers.py +++ b/suitesparse_graphblas/create_headers.py @@ -625,6 +625,7 @@ def handle_function_node(node): "Type": "type", "UnaryOp": "unary", "IndexUnaryOp": "indexunary", + "IndexBinaryOp": "indexbinary", "Iterator": "iterator", "Context": "context", # "everything else" is "core" diff --git a/suitesparse_graphblas/exceptions.py b/suitesparse_graphblas/exceptions.py index f03c784..3761228 100644 --- a/suitesparse_graphblas/exceptions.py +++ b/suitesparse_graphblas/exceptions.py @@ -60,3 +60,7 @@ class Panic(GraphBLASException): class NotImplementedException(GraphBLASException): pass + + +class JitError(GraphBLASException): + pass diff --git a/suitesparse_graphblas/suitesparse_graphblas.h b/suitesparse_graphblas/suitesparse_graphblas.h index 7aebc0b..902bd81 100644 --- a/suitesparse_graphblas/suitesparse_graphblas.h +++ b/suitesparse_graphblas/suitesparse_graphblas.h @@ -17,12 +17,14 @@ typedef uint64_t GrB_Index; typedef double _Complex GxB_FC64_t; typedef float _Complex GxB_FC32_t; typedef struct GB_Context_opaque *GxB_Context; +typedef struct GB_IndexBinaryOp_opaque *GxB_IndexBinaryOp; typedef struct GB_Iterator_opaque *GxB_Iterator; typedef struct GB_Scalar_opaque *GxB_Scalar; typedef struct GB_SelectOp_opaque *GxB_SelectOp; /* GxB typedefs (functions) */ typedef void (*GxB_binary_function)(void *, const void *, const void *); +typedef void (*GxB_index_binary_function)(void *, const void *, GrB_Index, GrB_Index, const void *, GrB_Index, GrB_Index, const void *); typedef void (*GxB_index_unary_function)(void *z, const void *x, GrB_Index i, GrB_Index j, const void *y); typedef void (*GxB_unary_function)(void *, const void *); @@ -85,7 +87,10 @@ typedef enum GxB_MONOID_TERMINAL = 7044, GxB_MONOID_OPERATOR = 7045, GxB_SEMIRING_MONOID = 7046, - GxB_SEMIRING_MULTIPLY = 7047 + GxB_SEMIRING_MULTIPLY = 7047, + GxB_THETA_TYPE_CODE = 7050, + GxB_THETA_TYPE_STRING = 7051, + GxB_THETA = 7052 } GrB_Field; typedef enum @@ -114,7 +119,8 @@ typedef enum GrB_INSUFFICIENT_SPACE = -103, GrB_INVALID_OBJECT = -104, GrB_INDEX_OUT_OF_BOUNDS = -105, - GrB_EMPTY_OBJECT = -106 + GrB_EMPTY_OBJECT = -106, + GxB_JIT_ERROR = -1001 } GrB_Info; typedef enum @@ -2736,7 +2742,7 @@ GrB_Info GrB_Global_set_INT32(GrB_Global, int32_t, GrB_Field); GrB_Info GrB_Global_set_String(GrB_Global, char *, GrB_Field); GrB_Info GrB_Global_set_VOID(GrB_Global, void *, GrB_Field, size_t); GrB_Info GrB_finalize(void); -GrB_Info GrB_getVersion(unsigned int *version, unsigned int *subversion); +GrB_Info GrB_getVersion(unsigned int *, unsigned int *); GrB_Info GrB_init(GrB_Mode mode); /* descriptor */ @@ -3267,17 +3273,17 @@ GrB_Info GB_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GxB_Format_Valu /* binary */ GrB_Info GxB_BinaryOp_fprint(GrB_BinaryOp binaryop, const char *name, GxB_Print_Level pr, FILE *f); GrB_Info GxB_BinaryOp_new(GrB_BinaryOp *op, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *binop_name, const char *binop_defn); -GrB_Info GxB_BinaryOp_xtype(GrB_Type *xtype, GrB_BinaryOp op); -GrB_Info GxB_BinaryOp_xtype_name(char *type_name, const GrB_BinaryOp op); -GrB_Info GxB_BinaryOp_ytype(GrB_Type *ytype, GrB_BinaryOp op); -GrB_Info GxB_BinaryOp_ytype_name(char *type_name, const GrB_BinaryOp op); -GrB_Info GxB_BinaryOp_ztype(GrB_Type *ztype, GrB_BinaryOp op); -GrB_Info GxB_BinaryOp_ztype_name(char *type_name, const GrB_BinaryOp op); +GrB_Info GxB_BinaryOp_xtype(GrB_Type *, GrB_BinaryOp); +GrB_Info GxB_BinaryOp_xtype_name(char *, const GrB_BinaryOp); +GrB_Info GxB_BinaryOp_ytype(GrB_Type *, GrB_BinaryOp); +GrB_Info GxB_BinaryOp_ytype_name(char *, const GrB_BinaryOp); +GrB_Info GxB_BinaryOp_ztype(GrB_Type *, GrB_BinaryOp); +GrB_Info GxB_BinaryOp_ztype_name(char *, const GrB_BinaryOp); /* context */ GrB_Info GxB_Context_disengage(GxB_Context Context); GrB_Info GxB_Context_engage(GxB_Context Context); -GrB_Info GxB_Context_error(const char **error, const GxB_Context Context); +GrB_Info GxB_Context_error(const char **error, const GxB_Context c); GrB_Info GxB_Context_fprint(GxB_Context Context, const char *name, GxB_Print_Level pr, FILE *f); GrB_Info GxB_Context_free(GxB_Context *Context); GrB_Info GxB_Context_get(GxB_Context, GxB_Context_Field, ...); @@ -3327,12 +3333,26 @@ GrB_Info GxB_Desc_set_INT32(GrB_Descriptor, GrB_Desc_Field, int32_t); GrB_Info GxB_Descriptor_fprint(GrB_Descriptor descriptor, const char *name, GxB_Print_Level pr, FILE *f); GrB_Info GxB_Descriptor_get(GrB_Desc_Value *, GrB_Descriptor, GrB_Desc_Field); +/* indexbinary */ +GrB_Info GxB_IndexBinaryOp_error(const char **error, const GxB_IndexBinaryOp op); +GrB_Info GxB_IndexBinaryOp_fprint(GxB_IndexBinaryOp op, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_IndexBinaryOp_free(GxB_IndexBinaryOp *op); +GrB_Info GxB_IndexBinaryOp_get_INT32(GxB_IndexBinaryOp, int32_t *, GrB_Field); +GrB_Info GxB_IndexBinaryOp_get_SIZE(GxB_IndexBinaryOp, size_t *, GrB_Field); +GrB_Info GxB_IndexBinaryOp_get_String(GxB_IndexBinaryOp, char *, GrB_Field); +GrB_Info GxB_IndexBinaryOp_get_VOID(GxB_IndexBinaryOp, void *, GrB_Field); +GrB_Info GxB_IndexBinaryOp_new(GxB_IndexBinaryOp *op, GxB_index_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, GrB_Type theta_type, const char *idxbinop_name, const char *idxbinop_defn); +GrB_Info GxB_IndexBinaryOp_set_INT32(GxB_IndexBinaryOp, int32_t, GrB_Field); +GrB_Info GxB_IndexBinaryOp_set_String(GxB_IndexBinaryOp, char *, GrB_Field); +GrB_Info GxB_IndexBinaryOp_set_VOID(GxB_IndexBinaryOp, void *, GrB_Field, size_t); +GrB_Info GxB_IndexBinaryOp_wait(GxB_IndexBinaryOp op, GrB_WaitMode waitmode); + /* indexunary */ GrB_Info GxB_IndexUnaryOp_fprint(GrB_IndexUnaryOp op, const char *name, GxB_Print_Level pr, FILE *f); GrB_Info GxB_IndexUnaryOp_new(GrB_IndexUnaryOp *op, GxB_index_unary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *idxop_name, const char *idxop_defn); -GrB_Info GxB_IndexUnaryOp_xtype_name(char *, const GrB_IndexUnaryOp op); -GrB_Info GxB_IndexUnaryOp_ytype_name(char *, const GrB_IndexUnaryOp op); -GrB_Info GxB_IndexUnaryOp_ztype_name(char *, const GrB_IndexUnaryOp op); +GrB_Info GxB_IndexUnaryOp_xtype_name(char *, const GrB_IndexUnaryOp); +GrB_Info GxB_IndexUnaryOp_ytype_name(char *, const GrB_IndexUnaryOp); +GrB_Info GxB_IndexUnaryOp_ztype_name(char *, const GrB_IndexUnaryOp); /* iterator */ GrB_Index GxB_Matrix_Iterator_getp(GxB_Iterator iterator); @@ -3385,10 +3405,10 @@ GrB_Info GxB_Matrix_Option_get_INT32(GrB_Matrix, GxB_Option_Field, int32_t *); GrB_Info GxB_Matrix_Option_set(GrB_Matrix, GxB_Option_Field, ...); GrB_Info GxB_Matrix_Option_set_FP64(GrB_Matrix, GxB_Option_Field, double); GrB_Info GxB_Matrix_Option_set_INT32(GrB_Matrix, GxB_Option_Field, int32_t); -GrB_Info GxB_Matrix_apply_BinaryOp1st(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_apply_BinaryOp1st(GrB_Matrix, const GrB_Matrix, const GrB_BinaryOp, const GrB_BinaryOp, const GrB_Scalar, const GrB_Matrix, const GrB_Descriptor); GrB_Info GxB_Matrix_apply_BinaryOp1st_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC32_t x, const GrB_Matrix A, const GrB_Descriptor desc); GrB_Info GxB_Matrix_apply_BinaryOp1st_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC64_t x, const GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_apply_BinaryOp2nd(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Scalar y, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_apply_BinaryOp2nd(GrB_Matrix, const GrB_Matrix, const GrB_BinaryOp, const GrB_BinaryOp, const GrB_Matrix, const GrB_Scalar, const GrB_Descriptor); GrB_Info GxB_Matrix_apply_BinaryOp2nd_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, GxB_FC32_t y, const GrB_Descriptor desc); GrB_Info GxB_Matrix_apply_BinaryOp2nd_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, GxB_FC64_t y, const GrB_Descriptor desc); GrB_Info GxB_Matrix_apply_IndexOp_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, GxB_FC32_t y, const GrB_Descriptor desc); @@ -3402,31 +3422,31 @@ GrB_Info GxB_Matrix_concat(GrB_Matrix C, const GrB_Matrix *Tiles, const GrB_Inde GrB_Info GxB_Matrix_deserialize(GrB_Matrix *C, GrB_Type type, const void *blob, GrB_Index blob_size, const GrB_Descriptor desc); GrB_Info GxB_Matrix_diag(GrB_Matrix C, const GrB_Vector v, int64_t k, const GrB_Descriptor desc); GrB_Info GxB_Matrix_eWiseUnion(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Matrix A, const GrB_Scalar alpha, const GrB_Matrix B, const GrB_Scalar beta, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_export_BitmapC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_export_BitmapR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_export_CSC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_export_CSR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_export_BitmapC(GrB_Matrix *, GrB_Type *, GrB_Index *, GrB_Index *, int8_t **, void **, GrB_Index *, GrB_Index *, bool *, GrB_Index *, const GrB_Descriptor); +GrB_Info GxB_Matrix_export_BitmapR(GrB_Matrix *, GrB_Type *, GrB_Index *, GrB_Index *, int8_t **, void **, GrB_Index *, GrB_Index *, bool *, GrB_Index *, const GrB_Descriptor); +GrB_Info GxB_Matrix_export_CSC(GrB_Matrix *, GrB_Type *, GrB_Index *, GrB_Index *, GrB_Index **, GrB_Index **, void **, GrB_Index *, GrB_Index *, GrB_Index *, bool *, bool *, const GrB_Descriptor); +GrB_Info GxB_Matrix_export_CSR(GrB_Matrix *, GrB_Type *, GrB_Index *, GrB_Index *, GrB_Index **, GrB_Index **, void **, GrB_Index *, GrB_Index *, GrB_Index *, bool *, bool *, const GrB_Descriptor); GrB_Info GxB_Matrix_export_FC32(GrB_Index *Ap, GrB_Index *Ai, GxB_FC32_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); GrB_Info GxB_Matrix_export_FC64(GrB_Index *Ap, GrB_Index *Ai, GxB_FC64_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -GrB_Info GxB_Matrix_export_FullC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_export_FullR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_export_HyperCSC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_export_HyperCSR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_export_FullC(GrB_Matrix *, GrB_Type *, GrB_Index *, GrB_Index *, void **, GrB_Index *, bool *, const GrB_Descriptor); +GrB_Info GxB_Matrix_export_FullR(GrB_Matrix *, GrB_Type *, GrB_Index *, GrB_Index *, void **, GrB_Index *, bool *, const GrB_Descriptor); +GrB_Info GxB_Matrix_export_HyperCSC(GrB_Matrix *, GrB_Type *, GrB_Index *, GrB_Index *, GrB_Index **, GrB_Index **, GrB_Index **, void **, GrB_Index *, GrB_Index *, GrB_Index *, GrB_Index *, bool *, GrB_Index *, bool *, const GrB_Descriptor); +GrB_Info GxB_Matrix_export_HyperCSR(GrB_Matrix *, GrB_Type *, GrB_Index *, GrB_Index *, GrB_Index **, GrB_Index **, GrB_Index **, void **, GrB_Index *, GrB_Index *, GrB_Index *, GrB_Index *, bool *, GrB_Index *, bool *, const GrB_Descriptor); GrB_Info GxB_Matrix_extractElement_FC32(GxB_FC32_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); GrB_Info GxB_Matrix_extractElement_FC64(GxB_FC64_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); GrB_Info GxB_Matrix_extractTuples_FC32(GrB_Index *Ilist, GrB_Index *J, GxB_FC32_t *X, GrB_Index *nvals, const GrB_Matrix A); GrB_Info GxB_Matrix_extractTuples_FC64(GrB_Index *Ilist, GrB_Index *J, GxB_FC64_t *X, GrB_Index *nvals, const GrB_Matrix A); GrB_Info GxB_Matrix_fprint(GrB_Matrix A, const char *name, GxB_Print_Level pr, FILE *f); -GrB_Info GxB_Matrix_import_BitmapC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_import_BitmapR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_import_CSC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_import_CSR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_import_BitmapC(GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, int8_t **, void **, GrB_Index, GrB_Index, bool, GrB_Index, const GrB_Descriptor); +GrB_Info GxB_Matrix_import_BitmapR(GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, int8_t **, void **, GrB_Index, GrB_Index, bool, GrB_Index, const GrB_Descriptor); +GrB_Info GxB_Matrix_import_CSC(GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, GrB_Index **, GrB_Index **, void **, GrB_Index, GrB_Index, GrB_Index, bool, bool, const GrB_Descriptor); +GrB_Info GxB_Matrix_import_CSR(GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, GrB_Index **, GrB_Index **, void **, GrB_Index, GrB_Index, GrB_Index, bool, bool, const GrB_Descriptor); GrB_Info GxB_Matrix_import_FC32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const GxB_FC32_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); GrB_Info GxB_Matrix_import_FC64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const GxB_FC64_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -GrB_Info GxB_Matrix_import_FullC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_import_FullR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_import_HyperCSC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_import_HyperCSR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_import_FullC(GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, void **, GrB_Index, bool, const GrB_Descriptor); +GrB_Info GxB_Matrix_import_FullR(GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, void **, GrB_Index, bool, const GrB_Descriptor); +GrB_Info GxB_Matrix_import_HyperCSC(GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, GrB_Index **, GrB_Index **, GrB_Index **, void **, GrB_Index, GrB_Index, GrB_Index, GrB_Index, bool, GrB_Index, bool, const GrB_Descriptor); +GrB_Info GxB_Matrix_import_HyperCSR(GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, GrB_Index **, GrB_Index **, GrB_Index **, void **, GrB_Index, GrB_Index, GrB_Index, GrB_Index, bool, GrB_Index, bool, const GrB_Descriptor); GrB_Info GxB_Matrix_isStoredElement(const GrB_Matrix A, GrB_Index i, GrB_Index j); GrB_Info GxB_Matrix_iso(bool *iso, const GrB_Matrix A); GrB_Info GxB_Matrix_memoryUsage(size_t *size, const GrB_Matrix A); @@ -3466,8 +3486,8 @@ GrB_Info GxB_Matrix_subassign_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const G GrB_Info GxB_Matrix_subassign_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); GrB_Info GxB_Matrix_subassign_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); GrB_Info GxB_Matrix_subassign_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_type(GrB_Type *type, const GrB_Matrix A); -GrB_Info GxB_Matrix_type_name(char *type_name, const GrB_Matrix A); +GrB_Info GxB_Matrix_type(GrB_Type *, const GrB_Matrix); +GrB_Info GxB_Matrix_type_name(char *, const GrB_Matrix); GrB_Info GxB_Matrix_unpack_BitmapC(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); GrB_Info GxB_Matrix_unpack_BitmapR(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); GrB_Info GxB_Matrix_unpack_CSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); @@ -3485,11 +3505,11 @@ GrB_Info GxB_unpack_HyperHash(GrB_Matrix A, GrB_Matrix *Y, const GrB_Descriptor /* monoid */ GrB_Info GxB_Monoid_fprint(GrB_Monoid monoid, const char *name, GxB_Print_Level pr, FILE *f); -GrB_Info GxB_Monoid_identity(void *identity, GrB_Monoid monoid); +GrB_Info GxB_Monoid_identity(void *, GrB_Monoid); GrB_Info GxB_Monoid_new_FC32(GrB_Monoid *monoid, GrB_BinaryOp op, GxB_FC32_t identity); GrB_Info GxB_Monoid_new_FC64(GrB_Monoid *monoid, GrB_BinaryOp op, GxB_FC64_t identity); -GrB_Info GxB_Monoid_operator(GrB_BinaryOp *op, GrB_Monoid monoid); -GrB_Info GxB_Monoid_terminal(bool *, void *terminal, GrB_Monoid monoid); +GrB_Info GxB_Monoid_operator(GrB_BinaryOp *, GrB_Monoid); +GrB_Info GxB_Monoid_terminal(bool *, void *, GrB_Monoid); GrB_Info GxB_Monoid_terminal_new_BOOL(GrB_Monoid *monoid, GrB_BinaryOp op, bool identity, bool terminal); GrB_Info GxB_Monoid_terminal_new_FC32(GrB_Monoid *monoid, GrB_BinaryOp op, GxB_FC32_t identity, GxB_FC32_t terminal); GrB_Info GxB_Monoid_terminal_new_FC64(GrB_Monoid *monoid, GrB_BinaryOp op, GxB_FC64_t identity, GxB_FC64_t terminal); @@ -3506,73 +3526,76 @@ GrB_Info GxB_Monoid_terminal_new_UINT32(GrB_Monoid *monoid, GrB_BinaryOp op, uin GrB_Info GxB_Monoid_terminal_new_UINT64(GrB_Monoid *monoid, GrB_BinaryOp op, uint64_t identity, uint64_t terminal); /* scalar */ +GrB_Info GxB_BinaryOp_new_IndexOp(GrB_BinaryOp *binop, GxB_IndexBinaryOp idxbinop, GrB_Scalar theta); GrB_Info GxB_Context_get_Scalar(GxB_Context, GrB_Scalar, GrB_Field); GrB_Info GxB_Context_set_Scalar(GxB_Context, GrB_Scalar, GrB_Field); -GrB_Info GxB_Scalar_clear(GrB_Scalar s); -GrB_Info GxB_Scalar_dup(GrB_Scalar *s, const GrB_Scalar t); -GrB_Info GxB_Scalar_error(const char **error, const GrB_Scalar s); -GrB_Info GxB_Scalar_extractElement_BOOL(bool *x, const GrB_Scalar s); +GrB_Info GxB_IndexBinaryOp_get_Scalar(GxB_IndexBinaryOp, GrB_Scalar, GrB_Field); +GrB_Info GxB_IndexBinaryOp_set_Scalar(GxB_IndexBinaryOp, GrB_Scalar, GrB_Field); +GrB_Info GxB_Scalar_clear(GrB_Scalar); +GrB_Info GxB_Scalar_dup(GrB_Scalar *, const GrB_Scalar); +GrB_Info GxB_Scalar_error(const char **, const GrB_Scalar); +GrB_Info GxB_Scalar_extractElement_BOOL(bool *, const GrB_Scalar); GrB_Info GxB_Scalar_extractElement_FC32(GxB_FC32_t *x, const GrB_Scalar s); GrB_Info GxB_Scalar_extractElement_FC64(GxB_FC64_t *x, const GrB_Scalar s); -GrB_Info GxB_Scalar_extractElement_FP32(float *x, const GrB_Scalar s); -GrB_Info GxB_Scalar_extractElement_FP64(double *x, const GrB_Scalar s); -GrB_Info GxB_Scalar_extractElement_INT8(int8_t *x, const GrB_Scalar s); -GrB_Info GxB_Scalar_extractElement_INT16(int16_t *x, const GrB_Scalar s); -GrB_Info GxB_Scalar_extractElement_INT32(int32_t *x, const GrB_Scalar s); -GrB_Info GxB_Scalar_extractElement_INT64(int64_t *x, const GrB_Scalar s); -GrB_Info GxB_Scalar_extractElement_UDT(void *x, const GrB_Scalar s); -GrB_Info GxB_Scalar_extractElement_UINT8(uint8_t *x, const GrB_Scalar s); -GrB_Info GxB_Scalar_extractElement_UINT16(uint16_t *x, const GrB_Scalar s); -GrB_Info GxB_Scalar_extractElement_UINT32(uint32_t *x, const GrB_Scalar s); -GrB_Info GxB_Scalar_extractElement_UINT64(uint64_t *x, const GrB_Scalar s); +GrB_Info GxB_Scalar_extractElement_FP32(float *, const GrB_Scalar); +GrB_Info GxB_Scalar_extractElement_FP64(double *, const GrB_Scalar); +GrB_Info GxB_Scalar_extractElement_INT8(int8_t *, const GrB_Scalar); +GrB_Info GxB_Scalar_extractElement_INT16(int16_t *, const GrB_Scalar); +GrB_Info GxB_Scalar_extractElement_INT32(int32_t *, const GrB_Scalar); +GrB_Info GxB_Scalar_extractElement_INT64(int64_t *, const GrB_Scalar); +GrB_Info GxB_Scalar_extractElement_UDT(void *, const GrB_Scalar); +GrB_Info GxB_Scalar_extractElement_UINT8(uint8_t *, const GrB_Scalar); +GrB_Info GxB_Scalar_extractElement_UINT16(uint16_t *, const GrB_Scalar); +GrB_Info GxB_Scalar_extractElement_UINT32(uint32_t *, const GrB_Scalar); +GrB_Info GxB_Scalar_extractElement_UINT64(uint64_t *, const GrB_Scalar); GrB_Info GxB_Scalar_fprint(GrB_Scalar s, const char *name, GxB_Print_Level pr, FILE *f); -GrB_Info GxB_Scalar_free(GrB_Scalar *s); +GrB_Info GxB_Scalar_free(GrB_Scalar *); GrB_Info GxB_Scalar_memoryUsage(size_t *size, const GrB_Scalar s); -GrB_Info GxB_Scalar_new(GrB_Scalar *s, GrB_Type type); -GrB_Info GxB_Scalar_nvals(GrB_Index *nvals, const GrB_Scalar s); -GrB_Info GxB_Scalar_setElement_BOOL(GrB_Scalar s, bool x); +GrB_Info GxB_Scalar_new(GrB_Scalar *, GrB_Type); +GrB_Info GxB_Scalar_nvals(GrB_Index *, const GrB_Scalar); +GrB_Info GxB_Scalar_setElement_BOOL(GrB_Scalar, bool); GrB_Info GxB_Scalar_setElement_FC32(GrB_Scalar s, GxB_FC32_t x); GrB_Info GxB_Scalar_setElement_FC64(GrB_Scalar s, GxB_FC64_t x); -GrB_Info GxB_Scalar_setElement_FP32(GrB_Scalar s, float x); -GrB_Info GxB_Scalar_setElement_FP64(GrB_Scalar s, double x); -GrB_Info GxB_Scalar_setElement_INT8(GrB_Scalar s, int8_t x); -GrB_Info GxB_Scalar_setElement_INT16(GrB_Scalar s, int16_t x); -GrB_Info GxB_Scalar_setElement_INT32(GrB_Scalar s, int32_t x); -GrB_Info GxB_Scalar_setElement_INT64(GrB_Scalar s, int64_t x); -GrB_Info GxB_Scalar_setElement_UDT(GrB_Scalar s, void *x); -GrB_Info GxB_Scalar_setElement_UINT8(GrB_Scalar s, uint8_t x); -GrB_Info GxB_Scalar_setElement_UINT16(GrB_Scalar s, uint16_t x); -GrB_Info GxB_Scalar_setElement_UINT32(GrB_Scalar s, uint32_t x); -GrB_Info GxB_Scalar_setElement_UINT64(GrB_Scalar s, uint64_t x); -GrB_Info GxB_Scalar_type(GrB_Type *type, const GrB_Scalar s); -GrB_Info GxB_Scalar_type_name(char *type_name, const GrB_Scalar s); -GrB_Info GxB_Scalar_wait(GrB_Scalar *s); +GrB_Info GxB_Scalar_setElement_FP32(GrB_Scalar, float); +GrB_Info GxB_Scalar_setElement_FP64(GrB_Scalar, double); +GrB_Info GxB_Scalar_setElement_INT8(GrB_Scalar, int8_t); +GrB_Info GxB_Scalar_setElement_INT16(GrB_Scalar, int16_t); +GrB_Info GxB_Scalar_setElement_INT32(GrB_Scalar, int32_t); +GrB_Info GxB_Scalar_setElement_INT64(GrB_Scalar, int64_t); +GrB_Info GxB_Scalar_setElement_UDT(GrB_Scalar, void *); +GrB_Info GxB_Scalar_setElement_UINT8(GrB_Scalar, uint8_t); +GrB_Info GxB_Scalar_setElement_UINT16(GrB_Scalar, uint16_t); +GrB_Info GxB_Scalar_setElement_UINT32(GrB_Scalar, uint32_t); +GrB_Info GxB_Scalar_setElement_UINT64(GrB_Scalar, uint64_t); +GrB_Info GxB_Scalar_type(GrB_Type *, const GrB_Scalar); +GrB_Info GxB_Scalar_type_name(char *, const GrB_Scalar); +GrB_Info GxB_Scalar_wait(GrB_Scalar *); GrB_Info GxB_Serialized_get_Scalar(const void *, GrB_Scalar, GrB_Field, size_t); /* selectop */ GrB_Info GxB_SelectOp_fprint(GxB_SelectOp op, const char *name, GxB_Print_Level pr, FILE *f); -GrB_Info GxB_SelectOp_ttype(GrB_Type *ttype, GxB_SelectOp selectop); -GrB_Info GxB_SelectOp_xtype(GrB_Type *xtype, GxB_SelectOp selectop); +GrB_Info GxB_SelectOp_ttype(GrB_Type *, GxB_SelectOp); +GrB_Info GxB_SelectOp_xtype(GrB_Type *, GxB_SelectOp); /* semiring */ -GrB_Info GxB_Semiring_add(GrB_Monoid *add, GrB_Semiring semiring); +GrB_Info GxB_Semiring_add(GrB_Monoid *, GrB_Semiring); GrB_Info GxB_Semiring_fprint(GrB_Semiring semiring, const char *name, GxB_Print_Level pr, FILE *f); -GrB_Info GxB_Semiring_multiply(GrB_BinaryOp *multiply, GrB_Semiring semiring); +GrB_Info GxB_Semiring_multiply(GrB_BinaryOp *, GrB_Semiring); /* type */ GrB_Info GxB_Type_fprint(GrB_Type type, const char *name, GxB_Print_Level pr, FILE *f); GrB_Info GxB_Type_from_name(GrB_Type *type, const char *type_name); -GrB_Info GxB_Type_name(char *type_name, const GrB_Type type); +GrB_Info GxB_Type_name(char *, const GrB_Type); GrB_Info GxB_Type_new(GrB_Type *type, size_t sizeof_ctype, const char *type_name, const char *type_defn); -GrB_Info GxB_Type_size(size_t *size, const GrB_Type type); +GrB_Info GxB_Type_size(size_t *, const GrB_Type); /* unary */ GrB_Info GxB_UnaryOp_fprint(GrB_UnaryOp unaryop, const char *name, GxB_Print_Level pr, FILE *f); GrB_Info GxB_UnaryOp_new(GrB_UnaryOp *unaryop, GxB_unary_function function, GrB_Type ztype, GrB_Type xtype, const char *unop_name, const char *unop_defn); -GrB_Info GxB_UnaryOp_xtype(GrB_Type *xtype, GrB_UnaryOp unaryop); -GrB_Info GxB_UnaryOp_xtype_name(char *type_name, const GrB_UnaryOp unaryop); -GrB_Info GxB_UnaryOp_ztype(GrB_Type *ztype, GrB_UnaryOp unaryop); -GrB_Info GxB_UnaryOp_ztype_name(char *type_name, const GrB_UnaryOp unaryop); +GrB_Info GxB_UnaryOp_xtype(GrB_Type *, GrB_UnaryOp); +GrB_Info GxB_UnaryOp_xtype_name(char *, const GrB_UnaryOp); +GrB_Info GxB_UnaryOp_ztype(GrB_Type *, GrB_UnaryOp); +GrB_Info GxB_UnaryOp_ztype_name(char *, const GrB_UnaryOp); /* vector */ GrB_Info GxB_Vector_Iterator_attach(GxB_Iterator iterator, GrB_Vector v, GrB_Descriptor desc); @@ -3582,10 +3605,10 @@ GrB_Info GxB_Vector_Option_get_INT32(GrB_Vector, GxB_Option_Field, int32_t *); GrB_Info GxB_Vector_Option_set(GrB_Vector, GxB_Option_Field, ...); GrB_Info GxB_Vector_Option_set_FP64(GrB_Vector, GxB_Option_Field, double); GrB_Info GxB_Vector_Option_set_INT32(GrB_Vector, GxB_Option_Field, int32_t); -GrB_Info GxB_Vector_apply_BinaryOp1st(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GxB_Vector_apply_BinaryOp1st(GrB_Vector, const GrB_Vector, const GrB_BinaryOp, const GrB_BinaryOp, const GrB_Scalar, const GrB_Vector, const GrB_Descriptor); GrB_Info GxB_Vector_apply_BinaryOp1st_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC32_t x, const GrB_Vector u, const GrB_Descriptor desc); GrB_Info GxB_Vector_apply_BinaryOp1st_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC64_t x, const GrB_Vector u, const GrB_Descriptor desc); -GrB_Info GxB_Vector_apply_BinaryOp2nd(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const GrB_Scalar y, const GrB_Descriptor desc); +GrB_Info GxB_Vector_apply_BinaryOp2nd(GrB_Vector, const GrB_Vector, const GrB_BinaryOp, const GrB_BinaryOp, const GrB_Vector, const GrB_Scalar, const GrB_Descriptor); GrB_Info GxB_Vector_apply_BinaryOp2nd_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, GxB_FC32_t y, const GrB_Descriptor desc); GrB_Info GxB_Vector_apply_BinaryOp2nd_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, GxB_FC64_t y, const GrB_Descriptor desc); GrB_Info GxB_Vector_apply_IndexOp_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, GxB_FC32_t y, const GrB_Descriptor desc); @@ -3597,17 +3620,17 @@ GrB_Info GxB_Vector_build_FC64(GrB_Vector w, const GrB_Index *Ilist, const GxB_F GrB_Info GxB_Vector_build_Scalar(GrB_Vector w, const GrB_Index *Ilist, GrB_Scalar scalar, GrB_Index nvals); GrB_Info GxB_Vector_deserialize(GrB_Vector *w, GrB_Type type, const void *blob, GrB_Index blob_size, const GrB_Descriptor desc); GrB_Info GxB_Vector_eWiseUnion(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Vector u, const GrB_Scalar alpha, const GrB_Vector v, const GrB_Scalar beta, const GrB_Descriptor desc); -GrB_Info GxB_Vector_export_Bitmap(GrB_Vector *v, GrB_Type *type, GrB_Index *n, int8_t **vb, void **vx, GrB_Index *vb_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); -GrB_Info GxB_Vector_export_CSC(GrB_Vector *v, GrB_Type *type, GrB_Index *n, GrB_Index **vi, void **vx, GrB_Index *vi_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, bool *jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Vector_export_Full(GrB_Vector *v, GrB_Type *type, GrB_Index *n, void **vx, GrB_Index *vx_size, bool *iso, const GrB_Descriptor desc); +GrB_Info GxB_Vector_export_Bitmap(GrB_Vector *, GrB_Type *, GrB_Index *, int8_t **, void **, GrB_Index *, GrB_Index *, bool *, GrB_Index *, const GrB_Descriptor); +GrB_Info GxB_Vector_export_CSC(GrB_Vector *, GrB_Type *, GrB_Index *, GrB_Index **, void **, GrB_Index *, GrB_Index *, bool *, GrB_Index *, bool *, const GrB_Descriptor); +GrB_Info GxB_Vector_export_Full(GrB_Vector *, GrB_Type *, GrB_Index *, void **, GrB_Index *, bool *, const GrB_Descriptor); GrB_Info GxB_Vector_extractElement_FC32(GxB_FC32_t *x, const GrB_Vector v, GrB_Index i); GrB_Info GxB_Vector_extractElement_FC64(GxB_FC64_t *x, const GrB_Vector v, GrB_Index i); GrB_Info GxB_Vector_extractTuples_FC32(GrB_Index *Ilist, GxB_FC32_t *X, GrB_Index *nvals, const GrB_Vector v); GrB_Info GxB_Vector_extractTuples_FC64(GrB_Index *Ilist, GxB_FC64_t *X, GrB_Index *nvals, const GrB_Vector v); GrB_Info GxB_Vector_fprint(GrB_Vector v, const char *name, GxB_Print_Level pr, FILE *f); -GrB_Info GxB_Vector_import_Bitmap(GrB_Vector *v, GrB_Type type, GrB_Index n, int8_t **vb, void **vx, GrB_Index vb_size, GrB_Index vx_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); -GrB_Info GxB_Vector_import_CSC(GrB_Vector *v, GrB_Type type, GrB_Index n, GrB_Index **vi, void **vx, GrB_Index vi_size, GrB_Index vx_size, bool iso, GrB_Index nvals, bool jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Vector_import_Full(GrB_Vector *v, GrB_Type type, GrB_Index n, void **vx, GrB_Index vx_size, bool iso, const GrB_Descriptor desc); +GrB_Info GxB_Vector_import_Bitmap(GrB_Vector *, GrB_Type, GrB_Index, int8_t **, void **, GrB_Index, GrB_Index, bool, GrB_Index, const GrB_Descriptor); +GrB_Info GxB_Vector_import_CSC(GrB_Vector *, GrB_Type, GrB_Index, GrB_Index **, void **, GrB_Index, GrB_Index, bool, GrB_Index, bool, const GrB_Descriptor); +GrB_Info GxB_Vector_import_Full(GrB_Vector *, GrB_Type, GrB_Index, void **, GrB_Index, bool, const GrB_Descriptor); GrB_Info GxB_Vector_isStoredElement(const GrB_Vector v, GrB_Index i); GrB_Info GxB_Vector_iso(bool *iso, const GrB_Vector v); GrB_Info GxB_Vector_memoryUsage(size_t *size, const GrB_Vector v); @@ -3639,8 +3662,8 @@ GrB_Info GxB_Vector_subassign_UINT8(GrB_Vector w, const GrB_Vector mask, const G GrB_Info GxB_Vector_subassign_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); GrB_Info GxB_Vector_subassign_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); GrB_Info GxB_Vector_subassign_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_type(GrB_Type *type, const GrB_Vector v); -GrB_Info GxB_Vector_type_name(char *type_name, const GrB_Vector v); +GrB_Info GxB_Vector_type(GrB_Type *, const GrB_Vector); +GrB_Info GxB_Vector_type_name(char *, const GrB_Vector); GrB_Info GxB_Vector_unpack_Bitmap(GrB_Vector v, int8_t **vb, void **vx, GrB_Index *vb_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); GrB_Info GxB_Vector_unpack_CSC(GrB_Vector v, GrB_Index **vi, void **vx, GrB_Index *vi_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, bool *jumbled, const GrB_Descriptor desc); GrB_Info GxB_Vector_unpack_Full(GrB_Vector v, void **vx, GrB_Index *vx_size, bool *iso, const GrB_Descriptor desc); diff --git a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h index a3bf947..508b60e 100644 --- a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h +++ b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h @@ -15,12 +15,14 @@ typedef uint64_t GrB_Index; /* GxB typedefs */ typedef struct GB_Context_opaque *GxB_Context; +typedef struct GB_IndexBinaryOp_opaque *GxB_IndexBinaryOp; typedef struct GB_Iterator_opaque *GxB_Iterator; typedef struct GB_Scalar_opaque *GxB_Scalar; typedef struct GB_SelectOp_opaque *GxB_SelectOp; /* GxB typedefs (functions) */ typedef void (*GxB_binary_function)(void *, const void *, const void *); +typedef void (*GxB_index_binary_function)(void *, const void *, GrB_Index, GrB_Index, const void *, GrB_Index, GrB_Index, const void *); typedef void (*GxB_index_unary_function)(void *z, const void *x, GrB_Index i, GrB_Index j, const void *y); typedef void (*GxB_unary_function)(void *, const void *); @@ -83,7 +85,10 @@ typedef enum GxB_MONOID_TERMINAL = 7044, GxB_MONOID_OPERATOR = 7045, GxB_SEMIRING_MONOID = 7046, - GxB_SEMIRING_MULTIPLY = 7047 + GxB_SEMIRING_MULTIPLY = 7047, + GxB_THETA_TYPE_CODE = 7050, + GxB_THETA_TYPE_STRING = 7051, + GxB_THETA = 7052 } GrB_Field; typedef enum @@ -112,7 +117,8 @@ typedef enum GrB_INSUFFICIENT_SPACE = -103, GrB_INVALID_OBJECT = -104, GrB_INDEX_OUT_OF_BOUNDS = -105, - GrB_EMPTY_OBJECT = -106 + GrB_EMPTY_OBJECT = -106, + GxB_JIT_ERROR = -1001 } GrB_Info; typedef enum @@ -2560,7 +2566,7 @@ GrB_Info GrB_Global_set_INT32(GrB_Global, int32_t, GrB_Field); GrB_Info GrB_Global_set_String(GrB_Global, char *, GrB_Field); GrB_Info GrB_Global_set_VOID(GrB_Global, void *, GrB_Field, size_t); GrB_Info GrB_finalize(void); -GrB_Info GrB_getVersion(unsigned int *version, unsigned int *subversion); +GrB_Info GrB_getVersion(unsigned int *, unsigned int *); GrB_Info GrB_init(GrB_Mode mode); /* descriptor */ @@ -3091,17 +3097,17 @@ GrB_Info GB_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GxB_Format_Valu /* binary */ GrB_Info GxB_BinaryOp_fprint(GrB_BinaryOp binaryop, const char *name, GxB_Print_Level pr, FILE *f); GrB_Info GxB_BinaryOp_new(GrB_BinaryOp *op, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *binop_name, const char *binop_defn); -GrB_Info GxB_BinaryOp_xtype(GrB_Type *xtype, GrB_BinaryOp op); -GrB_Info GxB_BinaryOp_xtype_name(char *type_name, const GrB_BinaryOp op); -GrB_Info GxB_BinaryOp_ytype(GrB_Type *ytype, GrB_BinaryOp op); -GrB_Info GxB_BinaryOp_ytype_name(char *type_name, const GrB_BinaryOp op); -GrB_Info GxB_BinaryOp_ztype(GrB_Type *ztype, GrB_BinaryOp op); -GrB_Info GxB_BinaryOp_ztype_name(char *type_name, const GrB_BinaryOp op); +GrB_Info GxB_BinaryOp_xtype(GrB_Type *, GrB_BinaryOp); +GrB_Info GxB_BinaryOp_xtype_name(char *, const GrB_BinaryOp); +GrB_Info GxB_BinaryOp_ytype(GrB_Type *, GrB_BinaryOp); +GrB_Info GxB_BinaryOp_ytype_name(char *, const GrB_BinaryOp); +GrB_Info GxB_BinaryOp_ztype(GrB_Type *, GrB_BinaryOp); +GrB_Info GxB_BinaryOp_ztype_name(char *, const GrB_BinaryOp); /* context */ GrB_Info GxB_Context_disengage(GxB_Context Context); GrB_Info GxB_Context_engage(GxB_Context Context); -GrB_Info GxB_Context_error(const char **error, const GxB_Context Context); +GrB_Info GxB_Context_error(const char **error, const GxB_Context c); GrB_Info GxB_Context_fprint(GxB_Context Context, const char *name, GxB_Print_Level pr, FILE *f); GrB_Info GxB_Context_free(GxB_Context *Context); GrB_Info GxB_Context_get(GxB_Context, GxB_Context_Field, ...); @@ -3151,12 +3157,26 @@ GrB_Info GxB_Desc_set_INT32(GrB_Descriptor, GrB_Desc_Field, int32_t); GrB_Info GxB_Descriptor_fprint(GrB_Descriptor descriptor, const char *name, GxB_Print_Level pr, FILE *f); GrB_Info GxB_Descriptor_get(GrB_Desc_Value *, GrB_Descriptor, GrB_Desc_Field); +/* indexbinary */ +GrB_Info GxB_IndexBinaryOp_error(const char **error, const GxB_IndexBinaryOp op); +GrB_Info GxB_IndexBinaryOp_fprint(GxB_IndexBinaryOp op, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_IndexBinaryOp_free(GxB_IndexBinaryOp *op); +GrB_Info GxB_IndexBinaryOp_get_INT32(GxB_IndexBinaryOp, int32_t *, GrB_Field); +GrB_Info GxB_IndexBinaryOp_get_SIZE(GxB_IndexBinaryOp, size_t *, GrB_Field); +GrB_Info GxB_IndexBinaryOp_get_String(GxB_IndexBinaryOp, char *, GrB_Field); +GrB_Info GxB_IndexBinaryOp_get_VOID(GxB_IndexBinaryOp, void *, GrB_Field); +GrB_Info GxB_IndexBinaryOp_new(GxB_IndexBinaryOp *op, GxB_index_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, GrB_Type theta_type, const char *idxbinop_name, const char *idxbinop_defn); +GrB_Info GxB_IndexBinaryOp_set_INT32(GxB_IndexBinaryOp, int32_t, GrB_Field); +GrB_Info GxB_IndexBinaryOp_set_String(GxB_IndexBinaryOp, char *, GrB_Field); +GrB_Info GxB_IndexBinaryOp_set_VOID(GxB_IndexBinaryOp, void *, GrB_Field, size_t); +GrB_Info GxB_IndexBinaryOp_wait(GxB_IndexBinaryOp op, GrB_WaitMode waitmode); + /* indexunary */ GrB_Info GxB_IndexUnaryOp_fprint(GrB_IndexUnaryOp op, const char *name, GxB_Print_Level pr, FILE *f); GrB_Info GxB_IndexUnaryOp_new(GrB_IndexUnaryOp *op, GxB_index_unary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *idxop_name, const char *idxop_defn); -GrB_Info GxB_IndexUnaryOp_xtype_name(char *, const GrB_IndexUnaryOp op); -GrB_Info GxB_IndexUnaryOp_ytype_name(char *, const GrB_IndexUnaryOp op); -GrB_Info GxB_IndexUnaryOp_ztype_name(char *, const GrB_IndexUnaryOp op); +GrB_Info GxB_IndexUnaryOp_xtype_name(char *, const GrB_IndexUnaryOp); +GrB_Info GxB_IndexUnaryOp_ytype_name(char *, const GrB_IndexUnaryOp); +GrB_Info GxB_IndexUnaryOp_ztype_name(char *, const GrB_IndexUnaryOp); /* iterator */ GrB_Index GxB_Matrix_Iterator_getp(GxB_Iterator iterator); @@ -3207,30 +3227,30 @@ GrB_Info GxB_Matrix_Option_get_INT32(GrB_Matrix, GxB_Option_Field, int32_t *); GrB_Info GxB_Matrix_Option_set(GrB_Matrix, GxB_Option_Field, ...); GrB_Info GxB_Matrix_Option_set_FP64(GrB_Matrix, GxB_Option_Field, double); GrB_Info GxB_Matrix_Option_set_INT32(GrB_Matrix, GxB_Option_Field, int32_t); -GrB_Info GxB_Matrix_apply_BinaryOp1st(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_apply_BinaryOp2nd(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Scalar y, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_apply_BinaryOp1st(GrB_Matrix, const GrB_Matrix, const GrB_BinaryOp, const GrB_BinaryOp, const GrB_Scalar, const GrB_Matrix, const GrB_Descriptor); +GrB_Info GxB_Matrix_apply_BinaryOp2nd(GrB_Matrix, const GrB_Matrix, const GrB_BinaryOp, const GrB_BinaryOp, const GrB_Matrix, const GrB_Scalar, const GrB_Descriptor); GrB_Info GxB_Matrix_build_Scalar(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, GrB_Scalar scalar, GrB_Index nvals); GrB_Info GxB_Matrix_concat(GrB_Matrix C, const GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Descriptor desc); GrB_Info GxB_Matrix_deserialize(GrB_Matrix *C, GrB_Type type, const void *blob, GrB_Index blob_size, const GrB_Descriptor desc); GrB_Info GxB_Matrix_diag(GrB_Matrix C, const GrB_Vector v, int64_t k, const GrB_Descriptor desc); GrB_Info GxB_Matrix_eWiseUnion(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Matrix A, const GrB_Scalar alpha, const GrB_Matrix B, const GrB_Scalar beta, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_export_BitmapC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_export_BitmapR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_export_CSC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_export_CSR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_export_FullC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_export_FullR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_export_HyperCSC(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_export_HyperCSR(GrB_Matrix *A, GrB_Type *type, GrB_Index *nrows, GrB_Index *ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_export_BitmapC(GrB_Matrix *, GrB_Type *, GrB_Index *, GrB_Index *, int8_t **, void **, GrB_Index *, GrB_Index *, bool *, GrB_Index *, const GrB_Descriptor); +GrB_Info GxB_Matrix_export_BitmapR(GrB_Matrix *, GrB_Type *, GrB_Index *, GrB_Index *, int8_t **, void **, GrB_Index *, GrB_Index *, bool *, GrB_Index *, const GrB_Descriptor); +GrB_Info GxB_Matrix_export_CSC(GrB_Matrix *, GrB_Type *, GrB_Index *, GrB_Index *, GrB_Index **, GrB_Index **, void **, GrB_Index *, GrB_Index *, GrB_Index *, bool *, bool *, const GrB_Descriptor); +GrB_Info GxB_Matrix_export_CSR(GrB_Matrix *, GrB_Type *, GrB_Index *, GrB_Index *, GrB_Index **, GrB_Index **, void **, GrB_Index *, GrB_Index *, GrB_Index *, bool *, bool *, const GrB_Descriptor); +GrB_Info GxB_Matrix_export_FullC(GrB_Matrix *, GrB_Type *, GrB_Index *, GrB_Index *, void **, GrB_Index *, bool *, const GrB_Descriptor); +GrB_Info GxB_Matrix_export_FullR(GrB_Matrix *, GrB_Type *, GrB_Index *, GrB_Index *, void **, GrB_Index *, bool *, const GrB_Descriptor); +GrB_Info GxB_Matrix_export_HyperCSC(GrB_Matrix *, GrB_Type *, GrB_Index *, GrB_Index *, GrB_Index **, GrB_Index **, GrB_Index **, void **, GrB_Index *, GrB_Index *, GrB_Index *, GrB_Index *, bool *, GrB_Index *, bool *, const GrB_Descriptor); +GrB_Info GxB_Matrix_export_HyperCSR(GrB_Matrix *, GrB_Type *, GrB_Index *, GrB_Index *, GrB_Index **, GrB_Index **, GrB_Index **, void **, GrB_Index *, GrB_Index *, GrB_Index *, GrB_Index *, bool *, GrB_Index *, bool *, const GrB_Descriptor); GrB_Info GxB_Matrix_fprint(GrB_Matrix A, const char *name, GxB_Print_Level pr, FILE *f); -GrB_Info GxB_Matrix_import_BitmapC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_import_BitmapR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_import_CSC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_import_CSR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_import_FullC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_import_FullR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_import_HyperCSC(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_import_HyperCSR(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_import_BitmapC(GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, int8_t **, void **, GrB_Index, GrB_Index, bool, GrB_Index, const GrB_Descriptor); +GrB_Info GxB_Matrix_import_BitmapR(GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, int8_t **, void **, GrB_Index, GrB_Index, bool, GrB_Index, const GrB_Descriptor); +GrB_Info GxB_Matrix_import_CSC(GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, GrB_Index **, GrB_Index **, void **, GrB_Index, GrB_Index, GrB_Index, bool, bool, const GrB_Descriptor); +GrB_Info GxB_Matrix_import_CSR(GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, GrB_Index **, GrB_Index **, void **, GrB_Index, GrB_Index, GrB_Index, bool, bool, const GrB_Descriptor); +GrB_Info GxB_Matrix_import_FullC(GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, void **, GrB_Index, bool, const GrB_Descriptor); +GrB_Info GxB_Matrix_import_FullR(GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, void **, GrB_Index, bool, const GrB_Descriptor); +GrB_Info GxB_Matrix_import_HyperCSC(GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, GrB_Index **, GrB_Index **, GrB_Index **, void **, GrB_Index, GrB_Index, GrB_Index, GrB_Index, bool, GrB_Index, bool, const GrB_Descriptor); +GrB_Info GxB_Matrix_import_HyperCSR(GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, GrB_Index **, GrB_Index **, GrB_Index **, void **, GrB_Index, GrB_Index, GrB_Index, GrB_Index, bool, GrB_Index, bool, const GrB_Descriptor); GrB_Info GxB_Matrix_isStoredElement(const GrB_Matrix A, GrB_Index i, GrB_Index j); GrB_Info GxB_Matrix_iso(bool *iso, const GrB_Matrix A); GrB_Info GxB_Matrix_memoryUsage(size_t *size, const GrB_Matrix A); @@ -3262,8 +3282,8 @@ GrB_Info GxB_Matrix_subassign_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const G GrB_Info GxB_Matrix_subassign_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); GrB_Info GxB_Matrix_subassign_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); GrB_Info GxB_Matrix_subassign_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_type(GrB_Type *type, const GrB_Matrix A); -GrB_Info GxB_Matrix_type_name(char *type_name, const GrB_Matrix A); +GrB_Info GxB_Matrix_type(GrB_Type *, const GrB_Matrix); +GrB_Info GxB_Matrix_type_name(char *, const GrB_Matrix); GrB_Info GxB_Matrix_unpack_BitmapC(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); GrB_Info GxB_Matrix_unpack_BitmapR(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); GrB_Info GxB_Matrix_unpack_CSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); @@ -3281,9 +3301,9 @@ GrB_Info GxB_unpack_HyperHash(GrB_Matrix A, GrB_Matrix *Y, const GrB_Descriptor /* monoid */ GrB_Info GxB_Monoid_fprint(GrB_Monoid monoid, const char *name, GxB_Print_Level pr, FILE *f); -GrB_Info GxB_Monoid_identity(void *identity, GrB_Monoid monoid); -GrB_Info GxB_Monoid_operator(GrB_BinaryOp *op, GrB_Monoid monoid); -GrB_Info GxB_Monoid_terminal(bool *, void *terminal, GrB_Monoid monoid); +GrB_Info GxB_Monoid_identity(void *, GrB_Monoid); +GrB_Info GxB_Monoid_operator(GrB_BinaryOp *, GrB_Monoid); +GrB_Info GxB_Monoid_terminal(bool *, void *, GrB_Monoid); GrB_Info GxB_Monoid_terminal_new_BOOL(GrB_Monoid *monoid, GrB_BinaryOp op, bool identity, bool terminal); GrB_Info GxB_Monoid_terminal_new_FP32(GrB_Monoid *monoid, GrB_BinaryOp op, float identity, float terminal); GrB_Info GxB_Monoid_terminal_new_FP64(GrB_Monoid *monoid, GrB_BinaryOp op, double identity, double terminal); @@ -3298,69 +3318,72 @@ GrB_Info GxB_Monoid_terminal_new_UINT32(GrB_Monoid *monoid, GrB_BinaryOp op, uin GrB_Info GxB_Monoid_terminal_new_UINT64(GrB_Monoid *monoid, GrB_BinaryOp op, uint64_t identity, uint64_t terminal); /* scalar */ +GrB_Info GxB_BinaryOp_new_IndexOp(GrB_BinaryOp *binop, GxB_IndexBinaryOp idxbinop, GrB_Scalar theta); GrB_Info GxB_Context_get_Scalar(GxB_Context, GrB_Scalar, GrB_Field); GrB_Info GxB_Context_set_Scalar(GxB_Context, GrB_Scalar, GrB_Field); -GrB_Info GxB_Scalar_clear(GrB_Scalar s); -GrB_Info GxB_Scalar_dup(GrB_Scalar *s, const GrB_Scalar t); -GrB_Info GxB_Scalar_error(const char **error, const GrB_Scalar s); -GrB_Info GxB_Scalar_extractElement_BOOL(bool *x, const GrB_Scalar s); -GrB_Info GxB_Scalar_extractElement_FP32(float *x, const GrB_Scalar s); -GrB_Info GxB_Scalar_extractElement_FP64(double *x, const GrB_Scalar s); -GrB_Info GxB_Scalar_extractElement_INT8(int8_t *x, const GrB_Scalar s); -GrB_Info GxB_Scalar_extractElement_INT16(int16_t *x, const GrB_Scalar s); -GrB_Info GxB_Scalar_extractElement_INT32(int32_t *x, const GrB_Scalar s); -GrB_Info GxB_Scalar_extractElement_INT64(int64_t *x, const GrB_Scalar s); -GrB_Info GxB_Scalar_extractElement_UDT(void *x, const GrB_Scalar s); -GrB_Info GxB_Scalar_extractElement_UINT8(uint8_t *x, const GrB_Scalar s); -GrB_Info GxB_Scalar_extractElement_UINT16(uint16_t *x, const GrB_Scalar s); -GrB_Info GxB_Scalar_extractElement_UINT32(uint32_t *x, const GrB_Scalar s); -GrB_Info GxB_Scalar_extractElement_UINT64(uint64_t *x, const GrB_Scalar s); +GrB_Info GxB_IndexBinaryOp_get_Scalar(GxB_IndexBinaryOp, GrB_Scalar, GrB_Field); +GrB_Info GxB_IndexBinaryOp_set_Scalar(GxB_IndexBinaryOp, GrB_Scalar, GrB_Field); +GrB_Info GxB_Scalar_clear(GrB_Scalar); +GrB_Info GxB_Scalar_dup(GrB_Scalar *, const GrB_Scalar); +GrB_Info GxB_Scalar_error(const char **, const GrB_Scalar); +GrB_Info GxB_Scalar_extractElement_BOOL(bool *, const GrB_Scalar); +GrB_Info GxB_Scalar_extractElement_FP32(float *, const GrB_Scalar); +GrB_Info GxB_Scalar_extractElement_FP64(double *, const GrB_Scalar); +GrB_Info GxB_Scalar_extractElement_INT8(int8_t *, const GrB_Scalar); +GrB_Info GxB_Scalar_extractElement_INT16(int16_t *, const GrB_Scalar); +GrB_Info GxB_Scalar_extractElement_INT32(int32_t *, const GrB_Scalar); +GrB_Info GxB_Scalar_extractElement_INT64(int64_t *, const GrB_Scalar); +GrB_Info GxB_Scalar_extractElement_UDT(void *, const GrB_Scalar); +GrB_Info GxB_Scalar_extractElement_UINT8(uint8_t *, const GrB_Scalar); +GrB_Info GxB_Scalar_extractElement_UINT16(uint16_t *, const GrB_Scalar); +GrB_Info GxB_Scalar_extractElement_UINT32(uint32_t *, const GrB_Scalar); +GrB_Info GxB_Scalar_extractElement_UINT64(uint64_t *, const GrB_Scalar); GrB_Info GxB_Scalar_fprint(GrB_Scalar s, const char *name, GxB_Print_Level pr, FILE *f); -GrB_Info GxB_Scalar_free(GrB_Scalar *s); +GrB_Info GxB_Scalar_free(GrB_Scalar *); GrB_Info GxB_Scalar_memoryUsage(size_t *size, const GrB_Scalar s); -GrB_Info GxB_Scalar_new(GrB_Scalar *s, GrB_Type type); -GrB_Info GxB_Scalar_nvals(GrB_Index *nvals, const GrB_Scalar s); -GrB_Info GxB_Scalar_setElement_BOOL(GrB_Scalar s, bool x); -GrB_Info GxB_Scalar_setElement_FP32(GrB_Scalar s, float x); -GrB_Info GxB_Scalar_setElement_FP64(GrB_Scalar s, double x); -GrB_Info GxB_Scalar_setElement_INT8(GrB_Scalar s, int8_t x); -GrB_Info GxB_Scalar_setElement_INT16(GrB_Scalar s, int16_t x); -GrB_Info GxB_Scalar_setElement_INT32(GrB_Scalar s, int32_t x); -GrB_Info GxB_Scalar_setElement_INT64(GrB_Scalar s, int64_t x); -GrB_Info GxB_Scalar_setElement_UDT(GrB_Scalar s, void *x); -GrB_Info GxB_Scalar_setElement_UINT8(GrB_Scalar s, uint8_t x); -GrB_Info GxB_Scalar_setElement_UINT16(GrB_Scalar s, uint16_t x); -GrB_Info GxB_Scalar_setElement_UINT32(GrB_Scalar s, uint32_t x); -GrB_Info GxB_Scalar_setElement_UINT64(GrB_Scalar s, uint64_t x); -GrB_Info GxB_Scalar_type(GrB_Type *type, const GrB_Scalar s); -GrB_Info GxB_Scalar_type_name(char *type_name, const GrB_Scalar s); -GrB_Info GxB_Scalar_wait(GrB_Scalar *s); +GrB_Info GxB_Scalar_new(GrB_Scalar *, GrB_Type); +GrB_Info GxB_Scalar_nvals(GrB_Index *, const GrB_Scalar); +GrB_Info GxB_Scalar_setElement_BOOL(GrB_Scalar, bool); +GrB_Info GxB_Scalar_setElement_FP32(GrB_Scalar, float); +GrB_Info GxB_Scalar_setElement_FP64(GrB_Scalar, double); +GrB_Info GxB_Scalar_setElement_INT8(GrB_Scalar, int8_t); +GrB_Info GxB_Scalar_setElement_INT16(GrB_Scalar, int16_t); +GrB_Info GxB_Scalar_setElement_INT32(GrB_Scalar, int32_t); +GrB_Info GxB_Scalar_setElement_INT64(GrB_Scalar, int64_t); +GrB_Info GxB_Scalar_setElement_UDT(GrB_Scalar, void *); +GrB_Info GxB_Scalar_setElement_UINT8(GrB_Scalar, uint8_t); +GrB_Info GxB_Scalar_setElement_UINT16(GrB_Scalar, uint16_t); +GrB_Info GxB_Scalar_setElement_UINT32(GrB_Scalar, uint32_t); +GrB_Info GxB_Scalar_setElement_UINT64(GrB_Scalar, uint64_t); +GrB_Info GxB_Scalar_type(GrB_Type *, const GrB_Scalar); +GrB_Info GxB_Scalar_type_name(char *, const GrB_Scalar); +GrB_Info GxB_Scalar_wait(GrB_Scalar *); GrB_Info GxB_Serialized_get_Scalar(const void *, GrB_Scalar, GrB_Field, size_t); /* selectop */ GrB_Info GxB_SelectOp_fprint(GxB_SelectOp op, const char *name, GxB_Print_Level pr, FILE *f); -GrB_Info GxB_SelectOp_ttype(GrB_Type *ttype, GxB_SelectOp selectop); -GrB_Info GxB_SelectOp_xtype(GrB_Type *xtype, GxB_SelectOp selectop); +GrB_Info GxB_SelectOp_ttype(GrB_Type *, GxB_SelectOp); +GrB_Info GxB_SelectOp_xtype(GrB_Type *, GxB_SelectOp); /* semiring */ -GrB_Info GxB_Semiring_add(GrB_Monoid *add, GrB_Semiring semiring); +GrB_Info GxB_Semiring_add(GrB_Monoid *, GrB_Semiring); GrB_Info GxB_Semiring_fprint(GrB_Semiring semiring, const char *name, GxB_Print_Level pr, FILE *f); -GrB_Info GxB_Semiring_multiply(GrB_BinaryOp *multiply, GrB_Semiring semiring); +GrB_Info GxB_Semiring_multiply(GrB_BinaryOp *, GrB_Semiring); /* type */ GrB_Info GxB_Type_fprint(GrB_Type type, const char *name, GxB_Print_Level pr, FILE *f); GrB_Info GxB_Type_from_name(GrB_Type *type, const char *type_name); -GrB_Info GxB_Type_name(char *type_name, const GrB_Type type); +GrB_Info GxB_Type_name(char *, const GrB_Type); GrB_Info GxB_Type_new(GrB_Type *type, size_t sizeof_ctype, const char *type_name, const char *type_defn); -GrB_Info GxB_Type_size(size_t *size, const GrB_Type type); +GrB_Info GxB_Type_size(size_t *, const GrB_Type); /* unary */ GrB_Info GxB_UnaryOp_fprint(GrB_UnaryOp unaryop, const char *name, GxB_Print_Level pr, FILE *f); GrB_Info GxB_UnaryOp_new(GrB_UnaryOp *unaryop, GxB_unary_function function, GrB_Type ztype, GrB_Type xtype, const char *unop_name, const char *unop_defn); -GrB_Info GxB_UnaryOp_xtype(GrB_Type *xtype, GrB_UnaryOp unaryop); -GrB_Info GxB_UnaryOp_xtype_name(char *type_name, const GrB_UnaryOp unaryop); -GrB_Info GxB_UnaryOp_ztype(GrB_Type *ztype, GrB_UnaryOp unaryop); -GrB_Info GxB_UnaryOp_ztype_name(char *type_name, const GrB_UnaryOp unaryop); +GrB_Info GxB_UnaryOp_xtype(GrB_Type *, GrB_UnaryOp); +GrB_Info GxB_UnaryOp_xtype_name(char *, const GrB_UnaryOp); +GrB_Info GxB_UnaryOp_ztype(GrB_Type *, GrB_UnaryOp); +GrB_Info GxB_UnaryOp_ztype_name(char *, const GrB_UnaryOp); /* vector */ GrB_Info GxB_Vector_Iterator_attach(GxB_Iterator iterator, GrB_Vector v, GrB_Descriptor desc); @@ -3370,18 +3393,18 @@ GrB_Info GxB_Vector_Option_get_INT32(GrB_Vector, GxB_Option_Field, int32_t *); GrB_Info GxB_Vector_Option_set(GrB_Vector, GxB_Option_Field, ...); GrB_Info GxB_Vector_Option_set_FP64(GrB_Vector, GxB_Option_Field, double); GrB_Info GxB_Vector_Option_set_INT32(GrB_Vector, GxB_Option_Field, int32_t); -GrB_Info GxB_Vector_apply_BinaryOp1st(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Scalar x, const GrB_Vector u, const GrB_Descriptor desc); -GrB_Info GxB_Vector_apply_BinaryOp2nd(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const GrB_Scalar y, const GrB_Descriptor desc); +GrB_Info GxB_Vector_apply_BinaryOp1st(GrB_Vector, const GrB_Vector, const GrB_BinaryOp, const GrB_BinaryOp, const GrB_Scalar, const GrB_Vector, const GrB_Descriptor); +GrB_Info GxB_Vector_apply_BinaryOp2nd(GrB_Vector, const GrB_Vector, const GrB_BinaryOp, const GrB_BinaryOp, const GrB_Vector, const GrB_Scalar, const GrB_Descriptor); GrB_Info GxB_Vector_build_Scalar(GrB_Vector w, const GrB_Index *Ilist, GrB_Scalar scalar, GrB_Index nvals); GrB_Info GxB_Vector_deserialize(GrB_Vector *w, GrB_Type type, const void *blob, GrB_Index blob_size, const GrB_Descriptor desc); GrB_Info GxB_Vector_eWiseUnion(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Vector u, const GrB_Scalar alpha, const GrB_Vector v, const GrB_Scalar beta, const GrB_Descriptor desc); -GrB_Info GxB_Vector_export_Bitmap(GrB_Vector *v, GrB_Type *type, GrB_Index *n, int8_t **vb, void **vx, GrB_Index *vb_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); -GrB_Info GxB_Vector_export_CSC(GrB_Vector *v, GrB_Type *type, GrB_Index *n, GrB_Index **vi, void **vx, GrB_Index *vi_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, bool *jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Vector_export_Full(GrB_Vector *v, GrB_Type *type, GrB_Index *n, void **vx, GrB_Index *vx_size, bool *iso, const GrB_Descriptor desc); +GrB_Info GxB_Vector_export_Bitmap(GrB_Vector *, GrB_Type *, GrB_Index *, int8_t **, void **, GrB_Index *, GrB_Index *, bool *, GrB_Index *, const GrB_Descriptor); +GrB_Info GxB_Vector_export_CSC(GrB_Vector *, GrB_Type *, GrB_Index *, GrB_Index **, void **, GrB_Index *, GrB_Index *, bool *, GrB_Index *, bool *, const GrB_Descriptor); +GrB_Info GxB_Vector_export_Full(GrB_Vector *, GrB_Type *, GrB_Index *, void **, GrB_Index *, bool *, const GrB_Descriptor); GrB_Info GxB_Vector_fprint(GrB_Vector v, const char *name, GxB_Print_Level pr, FILE *f); -GrB_Info GxB_Vector_import_Bitmap(GrB_Vector *v, GrB_Type type, GrB_Index n, int8_t **vb, void **vx, GrB_Index vb_size, GrB_Index vx_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); -GrB_Info GxB_Vector_import_CSC(GrB_Vector *v, GrB_Type type, GrB_Index n, GrB_Index **vi, void **vx, GrB_Index vi_size, GrB_Index vx_size, bool iso, GrB_Index nvals, bool jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Vector_import_Full(GrB_Vector *v, GrB_Type type, GrB_Index n, void **vx, GrB_Index vx_size, bool iso, const GrB_Descriptor desc); +GrB_Info GxB_Vector_import_Bitmap(GrB_Vector *, GrB_Type, GrB_Index, int8_t **, void **, GrB_Index, GrB_Index, bool, GrB_Index, const GrB_Descriptor); +GrB_Info GxB_Vector_import_CSC(GrB_Vector *, GrB_Type, GrB_Index, GrB_Index **, void **, GrB_Index, GrB_Index, bool, GrB_Index, bool, const GrB_Descriptor); +GrB_Info GxB_Vector_import_Full(GrB_Vector *, GrB_Type, GrB_Index, void **, GrB_Index, bool, const GrB_Descriptor); GrB_Info GxB_Vector_isStoredElement(const GrB_Vector v, GrB_Index i); GrB_Info GxB_Vector_iso(bool *iso, const GrB_Vector v); GrB_Info GxB_Vector_memoryUsage(size_t *size, const GrB_Vector v); @@ -3405,8 +3428,8 @@ GrB_Info GxB_Vector_subassign_UINT8(GrB_Vector w, const GrB_Vector mask, const G GrB_Info GxB_Vector_subassign_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); GrB_Info GxB_Vector_subassign_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); GrB_Info GxB_Vector_subassign_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_type(GrB_Type *type, const GrB_Vector v); -GrB_Info GxB_Vector_type_name(char *type_name, const GrB_Vector v); +GrB_Info GxB_Vector_type(GrB_Type *, const GrB_Vector); +GrB_Info GxB_Vector_type_name(char *, const GrB_Vector); GrB_Info GxB_Vector_unpack_Bitmap(GrB_Vector v, int8_t **vb, void **vx, GrB_Index *vb_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); GrB_Info GxB_Vector_unpack_CSC(GrB_Vector v, GrB_Index **vi, void **vx, GrB_Index *vi_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, bool *jumbled, const GrB_Descriptor desc); GrB_Info GxB_Vector_unpack_Full(GrB_Vector v, void **vx, GrB_Index *vx_size, bool *iso, const GrB_Descriptor desc); From e22b23fff355251c7fa1913e2e2ce625630d4aa9 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Sun, 16 Mar 2025 20:23:20 -0500 Subject: [PATCH 163/193] Update to SuiteSparse:GraphBLAS 10.0.1 (#139) --- .pre-commit-config.yaml | 45 +- Dockerfile | 2 +- GB_VERSION.txt | 2 +- docker_build.sh | 4 +- suitesparse_graphblas/create_headers.py | 52 + suitesparse_graphblas/suitesparse_graphblas.h | 1018 +++++++++-------- .../suitesparse_graphblas_no_complex.h | 978 ++++++++-------- 7 files changed, 1154 insertions(+), 947 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0565220..62cdd5c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,21 +6,28 @@ # - &flake8_dependencies below needs updated manually fail_fast: true default_language_version: - python: python3 + python: python3 repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v5.0.0 hooks: - id: check-added-large-files + - id: check-case-conflict + - id: check-merge-conflict - id: check-ast - id: check-toml - id: check-yaml + # - id: check-executables-have-shebangs + - id: check-vcs-permalinks + - id: destroyed-symlinks + - id: detect-private-key - id: debug-statements - id: end-of-file-fixer - id: mixed-line-ending - # - id: trailing-whitespace + args: [--fix=lf] + - id: trailing-whitespace - repo: https://github.com/abravalheri/validate-pyproject - rev: v0.20.2 + rev: v0.24 hooks: - id: validate-pyproject name: Validate pyproject.toml @@ -30,34 +37,29 @@ repos: - id: autoflake args: [--in-place] - repo: https://github.com/pycqa/isort - rev: 5.13.2 + rev: 6.0.1 hooks: - id: isort - repo: https://github.com/asottile/pyupgrade - rev: v3.18.0 + rev: v3.19.1 hooks: - id: pyupgrade args: [--py39-plus] - # - repo: https://github.com/MarcoGorelli/auto-walrus - # rev: v0.2.2 - # hooks: - # - id: auto-walrus - # args: [--line-length, "100"] - repo: https://github.com/psf/black - rev: 24.10.0 + rev: 25.1.0 hooks: - id: black - # - id: black-jupyter - repo: https://github.com/PyCQA/flake8 - rev: 7.1.1 + rev: 7.1.2 hooks: - id: flake8 + args: ["--config=.flake8"] additional_dependencies: &flake8_dependencies # These versions need updated manually - - flake8==7.1.1 - - flake8-comprehensions==3.15.0 - - flake8-bugbear==24.8.19 - # - flake8-simplify==0.20.0 + - flake8==7.1.2 + - flake8-comprehensions==3.16.0 + - flake8-bugbear==24.12.12 + # - flake8-simplify==0.21.0 - repo: https://github.com/asottile/yesqa rev: v1.5.0 hooks: @@ -70,6 +72,15 @@ repos: # hooks: # - id: pyroma # args: [-n, "10", .] + - repo: https://github.com/python-jsonschema/check-jsonschema + rev: 0.31.3 + hooks: + - id: check-dependabot + - id: check-github-workflows + - repo: meta + hooks: + - id: check-hooks-apply + - id: check-useless-excludes - repo: https://github.com/pre-commit/pre-commit-hooks rev: v5.0.0 hooks: diff --git a/Dockerfile b/Dockerfile index a34e989..fa101e5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,7 +28,7 @@ COPY --from=suitesparse /build/pycparser/utils/fake_libc_include/* /usr/local/li RUN apt-get update && apt-get install -yq build-essential git RUN pip3 install numpy cffi pytest cython - + RUN mkdir -p /psg ADD . /psg diff --git a/GB_VERSION.txt b/GB_VERSION.txt index 3a535e6..1532420 100644 --- a/GB_VERSION.txt +++ b/GB_VERSION.txt @@ -1 +1 @@ -9.4.5 +10.0.1 diff --git a/docker_build.sh b/docker_build.sh index c1ae7db..31e2b25 100755 --- a/docker_build.sh +++ b/docker_build.sh @@ -4,7 +4,7 @@ if [ $# -eq 0 ] Example: ./docker_build.sh v5.1.3 5.1.3.1 main clone push -If location is clone then a fresh git clone will be used. +If location is clone then a fresh git clone will be used. If push is provided then the script will attempt to push to dockerhub." exit 1 fi @@ -27,7 +27,7 @@ then fi trap "exit 1" HUP INT PIPE QUIT TERM trap 'rm -rf "$TMPDIR"' EXIT - + cd $TMPDIR git clone --branch $BRANCH https://github.com/GraphBLAS/python-suitesparse-graphblas.git cd python-suitesparse-graphblas diff --git a/suitesparse_graphblas/create_headers.py b/suitesparse_graphblas/create_headers.py index b5e9621..fbfbd0f 100644 --- a/suitesparse_graphblas/create_headers.py +++ b/suitesparse_graphblas/create_headers.py @@ -56,6 +56,8 @@ def groupby(index, seq): AUTO = "/* This file is automatically generated */" DEPRECATED = { + # Strongly deprecated in SuiteSparse:GraphBLAS 10; will be removed in 11 + "GrB_Field", # enums "GxB_IS_HYPER", "GrB_SCMP", @@ -298,6 +300,7 @@ def groupby(index, seq): "GxB_COMPRESSION_LZ4HC", "GxB_COMPRESSION_ZSTD", "GxB_COMPRESSION_NONE", + "GxB_USE_VALUES", } CHAR_DEFINES = { @@ -354,6 +357,22 @@ def visit_Typedef(self, node): return rv +class VisitStruct(c_generator.CGenerator): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self.results = [] + + def visit_Struct(self, node): + rv = super().visit_Struct(node) + if ( + ("GxB_" in node.name or "GrB_" in node.name) + and "_struct" in node.name + and node.decls is not None + ): + self.results.append(rv + ";") + return rv + + def get_ast(filename): fake_include = os.path.dirname(pycparser.__file__) + "utils/fake_libc_include" ast = parse_file(filename, cpp_args=f"-I{fake_include}") @@ -428,6 +447,21 @@ def get_groups(ast): seen.update(val.splitlines()) groups["GxB typedef enums"] = sorted(vals, key=lambda x: sort_key(x.rsplit("}", 1)[-1])) + g = VisitStruct() + _ = g.visit(ast) + structs = g.results + + # No non-opaque GrB structs yet + # vals = {x for x in structs if "struct GrB" in x} + # for val in vals: + # seen.update(val.splitlines()) + # groups["GrB struct"] = sorted(vals) + + vals = {x for x in structs if "struct GxB" in x} + for val in vals: + seen.update(val.splitlines()) + groups["GxB struct"] = sorted(vals) + missing_enums = set(enums) - set(groups["GrB typedef enums"]) - set(groups["GxB typedef enums"]) missing_enums = {x for x in missing_enums if not any(y in x for y in IGNORE_ENUMS)} assert not missing_enums, ", ".join(sorted(missing_enums)) @@ -581,6 +615,12 @@ def handle_typedef_funcs(group): rv["GxB typedef funcs"] = list(handle_typedef_funcs(groups["GxB typedef funcs"])) + def handle_structs(group): + for text in group: + yield {"text": text} + + rv["GxB struct"] = list(handle_structs(groups["GxB struct"])) + class FuncDeclVisitor(c_ast.NodeVisitor): def __init__(self): self.functions = [] @@ -628,6 +668,7 @@ def handle_function_node(node): "IndexBinaryOp": "indexbinary", "Iterator": "iterator", "Context": "context", + "Container": "container", # "everything else" is "core" "getVersion": "core", "Global": "core", @@ -655,6 +696,13 @@ def handle_function_node(node): len(grb_nodes), len(groups["GrB methods"]), ) + + # Temporary hack for v10.0.1, which duplicates `GxB_Serialized_get_Scalar` + temp_seen = set() + gxb_nodes = [ + temp_seen.add(node.name) or node for node in gxb_nodes if node.name not in temp_seen + ] + assert len(gxb_nodes) == len(groups["GxB methods"]), ( len(gxb_nodes), len(groups["GxB methods"]), @@ -701,6 +749,10 @@ def create_header_text(groups, *, char_defines=None, defines=None): for group in groups["GxB typedef funcs"]: text.append(group["text"]) text.append("") + text.append("/* GxB structs */") + for group in groups["GxB struct"]: + text.append(group["text"]) + text.append("") text.append("/* GrB enums */") for group in groups["GrB typedef enums"]: text.append(group["text"]) diff --git a/suitesparse_graphblas/suitesparse_graphblas.h b/suitesparse_graphblas/suitesparse_graphblas.h index 902bd81..f0a4b44 100644 --- a/suitesparse_graphblas/suitesparse_graphblas.h +++ b/suitesparse_graphblas/suitesparse_graphblas.h @@ -21,6 +21,7 @@ typedef struct GB_IndexBinaryOp_opaque *GxB_IndexBinaryOp; typedef struct GB_Iterator_opaque *GxB_Iterator; typedef struct GB_Scalar_opaque *GxB_Scalar; typedef struct GB_SelectOp_opaque *GxB_SelectOp; +typedef struct GxB_Container_struct *GxB_Container; /* GxB typedefs (functions) */ typedef void (*GxB_binary_function)(void *, const void *, const void *); @@ -28,6 +29,32 @@ typedef void (*GxB_index_binary_function)(void *, const void *, GrB_Index, GrB_I typedef void (*GxB_index_unary_function)(void *z, const void *x, GrB_Index i, GrB_Index j, const void *y); typedef void (*GxB_unary_function)(void *, const void *); +/* GxB structs */ +struct GxB_Container_struct +{ + uint64_t nrows; + uint64_t ncols; + int64_t nrows_nonempty; + int64_t ncols_nonempty; + uint64_t nvals; + uint64_t u64_future[11]; + int32_t format; + int32_t orientation; + uint32_t u32_future[14]; + GrB_Vector p; + GrB_Vector h; + GrB_Vector b; + GrB_Vector i; + GrB_Vector x; + GrB_Vector vector_future[11]; + GrB_Matrix Y; + GrB_Matrix matrix_future[15]; + bool iso; + bool jumbled; + bool bool_future[30]; + void *void_future[16]; +}; + /* GrB enums */ typedef enum { @@ -38,7 +65,10 @@ typedef enum GxB_AxB_METHOD = 7090, GxB_SORT = 7091, GxB_COMPRESSION = 7092, - GxB_IMPORT = 7093 + GxB_IMPORT = 7093, + GxB_ROWINDEX_LIST = 7094, + GxB_COLINDEX_LIST = 7095, + GxB_VALUE_LIST = 7096 } GrB_Desc_Field; typedef enum @@ -54,45 +84,11 @@ typedef enum GxB_AxB_DOT = 7083, GxB_AxB_HASH = 7084, GxB_AxB_SAXPY = 7085, - GxB_SECURE_IMPORT = 7080 + GxB_SECURE_IMPORT = 7080, + GxB_USE_INDICES = 7060, + GxB_IS_STRIDE = 7061 } GrB_Desc_Value; -typedef enum -{ - GrB_OUTP_FIELD = 0, - GrB_MASK_FIELD = 1, - GrB_INP0_FIELD = 2, - GrB_INP1_FIELD = 3, - GrB_NAME = 10, - GrB_LIBRARY_VER_MAJOR = 11, - GrB_LIBRARY_VER_MINOR = 12, - GrB_LIBRARY_VER_PATCH = 13, - GrB_API_VER_MAJOR = 14, - GrB_API_VER_MINOR = 15, - GrB_API_VER_PATCH = 16, - GrB_BLOCKING_MODE = 17, - GrB_STORAGE_ORIENTATION_HINT = 100, - GrB_EL_TYPE_CODE = 102, - GrB_EL_TYPE_STRING = 106, - GrB_INP0_TYPE_CODE = 103, - GrB_INP1_TYPE_CODE = 104, - GrB_OUTP_TYPE_CODE = 105, - GrB_INP0_TYPE_STRING = 107, - GrB_INP1_TYPE_STRING = 108, - GrB_OUTP_TYPE_STRING = 109, - GrB_SIZE = 110, - GxB_JIT_C_NAME = 7041, - GxB_JIT_C_DEFINITION = 7042, - GxB_MONOID_IDENTITY = 7043, - GxB_MONOID_TERMINAL = 7044, - GxB_MONOID_OPERATOR = 7045, - GxB_SEMIRING_MONOID = 7046, - GxB_SEMIRING_MULTIPLY = 7047, - GxB_THETA_TYPE_CODE = 7050, - GxB_THETA_TYPE_STRING = 7051, - GxB_THETA = 7052 -} GrB_Field; - typedef enum { GrB_CSR_FORMAT = 0, @@ -120,7 +116,9 @@ typedef enum GrB_INVALID_OBJECT = -104, GrB_INDEX_OUT_OF_BOUNDS = -105, GrB_EMPTY_OBJECT = -106, - GxB_JIT_ERROR = -1001 + GxB_JIT_ERROR = -7001, + GxB_GPU_ERROR = -7002, + GxB_OUTPUT_IS_READONLY = -7003 } GrB_Info; typedef enum @@ -189,10 +187,53 @@ typedef enum typedef enum { + GrB_OUTP_FIELD = 0, + GrB_MASK_FIELD = 1, + GrB_INP0_FIELD = 2, + GrB_INP1_FIELD = 3, + GrB_NAME = 10, + GrB_LIBRARY_VER_MAJOR = 11, + GrB_LIBRARY_VER_MINOR = 12, + GrB_LIBRARY_VER_PATCH = 13, + GrB_API_VER_MAJOR = 14, + GrB_API_VER_MINOR = 15, + GrB_API_VER_PATCH = 16, + GrB_BLOCKING_MODE = 17, + GrB_STORAGE_ORIENTATION_HINT = 100, + GrB_EL_TYPE_CODE = 102, + GrB_EL_TYPE_STRING = 106, + GrB_INP0_TYPE_CODE = 103, + GrB_INP1_TYPE_CODE = 104, + GrB_OUTP_TYPE_CODE = 105, + GrB_INP0_TYPE_STRING = 107, + GrB_INP1_TYPE_STRING = 108, + GrB_OUTP_TYPE_STRING = 109, + GrB_SIZE = 110, + GxB_JIT_C_NAME = 7041, + GxB_JIT_C_DEFINITION = 7042, + GxB_MONOID_IDENTITY = 7043, + GxB_MONOID_TERMINAL = 7044, + GxB_MONOID_OPERATOR = 7045, + GxB_SEMIRING_MONOID = 7046, + GxB_SEMIRING_MULTIPLY = 7047, + GxB_THETA_TYPE_CODE = 7050, + GxB_THETA_TYPE_STRING = 7051, + GxB_THETA = 7052, + GxB_ROWINDEX_INTEGER_HINT = 7053, + GxB_COLINDEX_INTEGER_HINT = 7054, + GxB_OFFSET_INTEGER_HINT = 7056, GxB_HYPER_SWITCH = 7000, GxB_HYPER_HASH = 7048, GxB_BITMAP_SWITCH = 7001, GxB_FORMAT = 7002, + GxB_ISO = 7079, + GxB_SPARSITY_CONTROL = 7036, + GxB_ROWINDEX_INTEGER_BITS = 7057, + GxB_COLINDEX_INTEGER_BITS = 7058, + GxB_OFFSET_INTEGER_BITS = 7059, + GxB_SPARSITY_STATUS = 7034, + GxB_IS_READONLY = 7078, + GxB_WILL_WAIT = 7076, GxB_MODE = 7003, GxB_LIBRARY_NAME = 7004, GxB_LIBRARY_VERSION = 7005, @@ -221,6 +262,7 @@ typedef enum GxB_FLUSH = 7021, GxB_MEMORY_POOL = 7022, GxB_PRINT_1BASED = 7023, + GxB_INCLUDE_READONLY_STATISTICS = 7077, GxB_JIT_C_COMPILER_NAME = 7024, GxB_JIT_C_COMPILER_FLAGS = 7025, GxB_JIT_C_LINKER_FLAGS = 7026, @@ -231,9 +273,7 @@ typedef enum GxB_JIT_C_CMAKE_LIBS = 7031, GxB_JIT_USE_CMAKE = 7032, GxB_JIT_ERROR_LOG = 7033, - GxB_JIT_CUDA_PREFACE = 7100, - GxB_SPARSITY_STATUS = 7034, - GxB_SPARSITY_CONTROL = 7036 + GxB_JIT_CUDA_PREFACE = 7100 } GxB_Option_Field; typedef enum @@ -251,10 +291,10 @@ extern const GrB_Global GrB_GLOBAL; extern const uint64_t *GrB_ALL; /* GxB consts */ -extern const GxB_Format_Value GxB_FORMAT_DEFAULT; extern const double GxB_ALWAYS_HYPER; extern const double GxB_HYPER_DEFAULT; extern const double GxB_NEVER_HYPER; +extern const int GxB_FORMAT_DEFAULT; /* GrB objects */ extern GrB_BinaryOp GrB_BAND_INT8; @@ -2721,60 +2761,60 @@ extern GxB_SelectOp GxB_TRIU; ****************/ /* binary */ -GrB_Info GrB_BinaryOp_error(const char **error, const GrB_BinaryOp op); -GrB_Info GrB_BinaryOp_free(GrB_BinaryOp *binaryop); -GrB_Info GrB_BinaryOp_get_INT32(GrB_BinaryOp, int32_t *, GrB_Field); -GrB_Info GrB_BinaryOp_get_SIZE(GrB_BinaryOp, size_t *, GrB_Field); -GrB_Info GrB_BinaryOp_get_String(GrB_BinaryOp, char *, GrB_Field); -GrB_Info GrB_BinaryOp_get_VOID(GrB_BinaryOp, void *, GrB_Field); +GrB_Info GrB_BinaryOp_error(const char **error, const GrB_BinaryOp object); +GrB_Info GrB_BinaryOp_free(GrB_BinaryOp *object); +GrB_Info GrB_BinaryOp_get_INT32(GrB_BinaryOp object, int32_t *, int); +GrB_Info GrB_BinaryOp_get_SIZE(GrB_BinaryOp object, size_t *, int); +GrB_Info GrB_BinaryOp_get_String(GrB_BinaryOp object, char *, int); +GrB_Info GrB_BinaryOp_get_VOID(GrB_BinaryOp object, void *, int); GrB_Info GrB_BinaryOp_new(GrB_BinaryOp *binaryop, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype); -GrB_Info GrB_BinaryOp_set_INT32(GrB_BinaryOp, int32_t, GrB_Field); -GrB_Info GrB_BinaryOp_set_String(GrB_BinaryOp, char *, GrB_Field); -GrB_Info GrB_BinaryOp_set_VOID(GrB_BinaryOp, void *, GrB_Field, size_t); -GrB_Info GrB_BinaryOp_wait(GrB_BinaryOp op, GrB_WaitMode waitmode); +GrB_Info GrB_BinaryOp_set_INT32(GrB_BinaryOp object, int32_t, int); +GrB_Info GrB_BinaryOp_set_String(GrB_BinaryOp object, char *, int); +GrB_Info GrB_BinaryOp_set_VOID(GrB_BinaryOp object, void *, int, size_t); +GrB_Info GrB_BinaryOp_wait(GrB_BinaryOp object, int waitmode); /* core */ -GrB_Info GrB_Global_get_INT32(GrB_Global, int32_t *, GrB_Field); -GrB_Info GrB_Global_get_SIZE(GrB_Global, size_t *, GrB_Field); -GrB_Info GrB_Global_get_String(GrB_Global, char *, GrB_Field); -GrB_Info GrB_Global_get_VOID(GrB_Global, void *, GrB_Field); -GrB_Info GrB_Global_set_INT32(GrB_Global, int32_t, GrB_Field); -GrB_Info GrB_Global_set_String(GrB_Global, char *, GrB_Field); -GrB_Info GrB_Global_set_VOID(GrB_Global, void *, GrB_Field, size_t); +GrB_Info GrB_Global_get_INT32(GrB_Global object, int32_t *, int); +GrB_Info GrB_Global_get_SIZE(GrB_Global object, size_t *, int); +GrB_Info GrB_Global_get_String(GrB_Global object, char *, int); +GrB_Info GrB_Global_get_VOID(GrB_Global object, void *, int); +GrB_Info GrB_Global_set_INT32(GrB_Global object, int32_t, int); +GrB_Info GrB_Global_set_String(GrB_Global object, char *, int); +GrB_Info GrB_Global_set_VOID(GrB_Global object, void *, int, size_t); GrB_Info GrB_finalize(void); GrB_Info GrB_getVersion(unsigned int *, unsigned int *); -GrB_Info GrB_init(GrB_Mode mode); +GrB_Info GrB_init(int mode); /* descriptor */ -GrB_Info GrB_Descriptor_error(const char **error, const GrB_Descriptor d); -GrB_Info GrB_Descriptor_free(GrB_Descriptor *descriptor); -GrB_Info GrB_Descriptor_get_INT32(GrB_Descriptor, int32_t *, GrB_Field); -GrB_Info GrB_Descriptor_get_SIZE(GrB_Descriptor, size_t *, GrB_Field); -GrB_Info GrB_Descriptor_get_String(GrB_Descriptor, char *, GrB_Field); -GrB_Info GrB_Descriptor_get_VOID(GrB_Descriptor, void *, GrB_Field); +GrB_Info GrB_Descriptor_error(const char **error, const GrB_Descriptor object); +GrB_Info GrB_Descriptor_free(GrB_Descriptor *object); +GrB_Info GrB_Descriptor_get_INT32(GrB_Descriptor object, int32_t *, int); +GrB_Info GrB_Descriptor_get_SIZE(GrB_Descriptor object, size_t *, int); +GrB_Info GrB_Descriptor_get_String(GrB_Descriptor object, char *, int); +GrB_Info GrB_Descriptor_get_VOID(GrB_Descriptor object, void *, int); GrB_Info GrB_Descriptor_new(GrB_Descriptor *descriptor); -GrB_Info GrB_Descriptor_set(GrB_Descriptor, GrB_Desc_Field, GrB_Desc_Value); -GrB_Info GrB_Descriptor_set_INT32(GrB_Descriptor, int32_t, GrB_Field); -GrB_Info GrB_Descriptor_set_String(GrB_Descriptor, char *, GrB_Field); -GrB_Info GrB_Descriptor_set_VOID(GrB_Descriptor, void *, GrB_Field, size_t); -GrB_Info GrB_Descriptor_wait(GrB_Descriptor desc, GrB_WaitMode waitmode); +GrB_Info GrB_Descriptor_set(GrB_Descriptor, int, int); +GrB_Info GrB_Descriptor_set_INT32(GrB_Descriptor object, int32_t, int); +GrB_Info GrB_Descriptor_set_String(GrB_Descriptor object, char *, int); +GrB_Info GrB_Descriptor_set_VOID(GrB_Descriptor object, void *, int, size_t); +GrB_Info GrB_Descriptor_wait(GrB_Descriptor object, int waitmode); /* indexunary */ -GrB_Info GrB_IndexUnaryOp_error(const char **error, const GrB_IndexUnaryOp op); -GrB_Info GrB_IndexUnaryOp_free(GrB_IndexUnaryOp *op); -GrB_Info GrB_IndexUnaryOp_get_INT32(GrB_IndexUnaryOp, int32_t *, GrB_Field); -GrB_Info GrB_IndexUnaryOp_get_SIZE(GrB_IndexUnaryOp, size_t *, GrB_Field); -GrB_Info GrB_IndexUnaryOp_get_String(GrB_IndexUnaryOp, char *, GrB_Field); -GrB_Info GrB_IndexUnaryOp_get_VOID(GrB_IndexUnaryOp, void *, GrB_Field); +GrB_Info GrB_IndexUnaryOp_error(const char **error, const GrB_IndexUnaryOp object); +GrB_Info GrB_IndexUnaryOp_free(GrB_IndexUnaryOp *object); +GrB_Info GrB_IndexUnaryOp_get_INT32(GrB_IndexUnaryOp object, int32_t *, int); +GrB_Info GrB_IndexUnaryOp_get_SIZE(GrB_IndexUnaryOp object, size_t *, int); +GrB_Info GrB_IndexUnaryOp_get_String(GrB_IndexUnaryOp object, char *, int); +GrB_Info GrB_IndexUnaryOp_get_VOID(GrB_IndexUnaryOp object, void *, int); GrB_Info GrB_IndexUnaryOp_new(GrB_IndexUnaryOp *op, GxB_index_unary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype); -GrB_Info GrB_IndexUnaryOp_set_INT32(GrB_IndexUnaryOp, int32_t, GrB_Field); -GrB_Info GrB_IndexUnaryOp_set_String(GrB_IndexUnaryOp, char *, GrB_Field); -GrB_Info GrB_IndexUnaryOp_set_VOID(GrB_IndexUnaryOp, void *, GrB_Field, size_t); -GrB_Info GrB_IndexUnaryOp_wait(GrB_IndexUnaryOp op, GrB_WaitMode waitmode); +GrB_Info GrB_IndexUnaryOp_set_INT32(GrB_IndexUnaryOp object, int32_t, int); +GrB_Info GrB_IndexUnaryOp_set_String(GrB_IndexUnaryOp object, char *, int); +GrB_Info GrB_IndexUnaryOp_set_VOID(GrB_IndexUnaryOp object, void *, int, size_t); +GrB_Info GrB_IndexUnaryOp_wait(GrB_IndexUnaryOp object, int waitmode); /* matrix */ -GrB_Info GrB_Col_assign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *Ilist, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); -GrB_Info GrB_Col_extract(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *Ilist, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); +GrB_Info GrB_Col_assign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I_, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); +GrB_Info GrB_Col_extract(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I_, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); GrB_Info GrB_Matrix_apply(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_UnaryOp op, const GrB_Matrix A, const GrB_Descriptor desc); GrB_Info GrB_Matrix_apply_BinaryOp1st_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, bool x, const GrB_Matrix A, const GrB_Descriptor desc); GrB_Info GrB_Matrix_apply_BinaryOp1st_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, float x, const GrB_Matrix A, const GrB_Descriptor desc); @@ -2815,32 +2855,32 @@ GrB_Info GrB_Matrix_apply_IndexOp_UINT8(GrB_Matrix C, const GrB_Matrix Mask, con GrB_Info GrB_Matrix_apply_IndexOp_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint16_t y, const GrB_Descriptor desc); GrB_Info GrB_Matrix_apply_IndexOp_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint32_t y, const GrB_Descriptor desc); GrB_Info GrB_Matrix_apply_IndexOp_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint64_t y, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, bool x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, float x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, double x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, void *x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_build_BOOL(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const bool *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_FP32(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const float *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_FP64(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const double *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_INT8(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const int8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_INT16(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const int16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_INT32(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const int32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_INT64(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const int64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_UDT(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const void *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_UINT8(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const uint8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_UINT16(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const uint16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_UINT32(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const uint32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_UINT64(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const uint64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_assign(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, float x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, double x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Scalar x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_build_BOOL(GrB_Matrix C, const GrB_Index *I_, const GrB_Index *J, const bool *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_FP32(GrB_Matrix C, const GrB_Index *I_, const GrB_Index *J, const float *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_FP64(GrB_Matrix C, const GrB_Index *I_, const GrB_Index *J, const double *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_INT8(GrB_Matrix C, const GrB_Index *I_, const GrB_Index *J, const int8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_INT16(GrB_Matrix C, const GrB_Index *I_, const GrB_Index *J, const int16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_INT32(GrB_Matrix C, const GrB_Index *I_, const GrB_Index *J, const int32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_INT64(GrB_Matrix C, const GrB_Index *I_, const GrB_Index *J, const int64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_UDT(GrB_Matrix C, const GrB_Index *I_, const GrB_Index *J, const void *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_UINT8(GrB_Matrix C, const GrB_Index *I_, const GrB_Index *J, const uint8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_UINT16(GrB_Matrix C, const GrB_Index *I_, const GrB_Index *J, const uint16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_UINT32(GrB_Matrix C, const GrB_Index *I_, const GrB_Index *J, const uint32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_UINT64(GrB_Matrix C, const GrB_Index *I_, const GrB_Index *J, const uint64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); GrB_Info GrB_Matrix_clear(GrB_Matrix A); GrB_Info GrB_Matrix_deserialize(GrB_Matrix *C, GrB_Type type, const void *blob, GrB_Index blob_size); GrB_Info GrB_Matrix_diag(GrB_Matrix *C, const GrB_Vector v, int64_t k); @@ -2851,22 +2891,22 @@ GrB_Info GrB_Matrix_eWiseAdd_Semiring(GrB_Matrix C, const GrB_Matrix Mask, const GrB_Info GrB_Matrix_eWiseMult_BinaryOp(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp mult, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); GrB_Info GrB_Matrix_eWiseMult_Monoid(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); GrB_Info GrB_Matrix_eWiseMult_Semiring(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_error(const char **error, const GrB_Matrix A); -GrB_Info GrB_Matrix_exportHint(GrB_Format *format, GrB_Matrix A); -GrB_Info GrB_Matrix_exportSize(GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -GrB_Info GrB_Matrix_export_BOOL(GrB_Index *Ap, GrB_Index *Ai, bool *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -GrB_Info GrB_Matrix_export_FP32(GrB_Index *Ap, GrB_Index *Ai, float *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -GrB_Info GrB_Matrix_export_FP64(GrB_Index *Ap, GrB_Index *Ai, double *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -GrB_Info GrB_Matrix_export_INT8(GrB_Index *Ap, GrB_Index *Ai, int8_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -GrB_Info GrB_Matrix_export_INT16(GrB_Index *Ap, GrB_Index *Ai, int16_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -GrB_Info GrB_Matrix_export_INT32(GrB_Index *Ap, GrB_Index *Ai, int32_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -GrB_Info GrB_Matrix_export_INT64(GrB_Index *Ap, GrB_Index *Ai, int64_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -GrB_Info GrB_Matrix_export_UDT(GrB_Index *Ap, GrB_Index *Ai, void *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -GrB_Info GrB_Matrix_export_UINT8(GrB_Index *Ap, GrB_Index *Ai, uint8_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -GrB_Info GrB_Matrix_export_UINT16(GrB_Index *Ap, GrB_Index *Ai, uint16_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -GrB_Info GrB_Matrix_export_UINT32(GrB_Index *Ap, GrB_Index *Ai, uint32_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -GrB_Info GrB_Matrix_export_UINT64(GrB_Index *Ap, GrB_Index *Ai, uint64_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -GrB_Info GrB_Matrix_extract(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_error(const char **error, const GrB_Matrix object); +GrB_Info GrB_Matrix_exportHint(int *format, GrB_Matrix A); +GrB_Info GrB_Matrix_exportSize(GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, int format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_BOOL(GrB_Index *Ap, GrB_Index *Ai, bool *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, int format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_FP32(GrB_Index *Ap, GrB_Index *Ai, float *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, int format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_FP64(GrB_Index *Ap, GrB_Index *Ai, double *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, int format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_INT8(GrB_Index *Ap, GrB_Index *Ai, int8_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, int format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_INT16(GrB_Index *Ap, GrB_Index *Ai, int16_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, int format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_INT32(GrB_Index *Ap, GrB_Index *Ai, int32_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, int format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_INT64(GrB_Index *Ap, GrB_Index *Ai, int64_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, int format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_UDT(GrB_Index *Ap, GrB_Index *Ai, void *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, int format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_UINT8(GrB_Index *Ap, GrB_Index *Ai, uint8_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, int format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_UINT16(GrB_Index *Ap, GrB_Index *Ai, uint16_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, int format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_UINT32(GrB_Index *Ap, GrB_Index *Ai, uint32_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, int format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_UINT64(GrB_Index *Ap, GrB_Index *Ai, uint64_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, int format, GrB_Matrix A); +GrB_Info GrB_Matrix_extract(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); GrB_Info GrB_Matrix_extractElement_BOOL(bool *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); GrB_Info GrB_Matrix_extractElement_FP32(float *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); GrB_Info GrB_Matrix_extractElement_FP64(double *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); @@ -2880,36 +2920,36 @@ GrB_Info GrB_Matrix_extractElement_UINT8(uint8_t *x, const GrB_Matrix A, GrB_Ind GrB_Info GrB_Matrix_extractElement_UINT16(uint16_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); GrB_Info GrB_Matrix_extractElement_UINT32(uint32_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); GrB_Info GrB_Matrix_extractElement_UINT64(uint64_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -GrB_Info GrB_Matrix_extractTuples_BOOL(GrB_Index *Ilist, GrB_Index *J, bool *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_FP32(GrB_Index *Ilist, GrB_Index *J, float *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_FP64(GrB_Index *Ilist, GrB_Index *J, double *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_INT8(GrB_Index *Ilist, GrB_Index *J, int8_t *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_INT16(GrB_Index *Ilist, GrB_Index *J, int16_t *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_INT32(GrB_Index *Ilist, GrB_Index *J, int32_t *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_INT64(GrB_Index *Ilist, GrB_Index *J, int64_t *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_UDT(GrB_Index *Ilist, GrB_Index *J, void *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_UINT8(GrB_Index *Ilist, GrB_Index *J, uint8_t *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_UINT16(GrB_Index *Ilist, GrB_Index *J, uint16_t *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_UINT32(GrB_Index *Ilist, GrB_Index *J, uint32_t *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_UINT64(GrB_Index *Ilist, GrB_Index *J, uint64_t *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_free(GrB_Matrix *A); -GrB_Info GrB_Matrix_get_INT32(GrB_Matrix, int32_t *, GrB_Field); -GrB_Info GrB_Matrix_get_SIZE(GrB_Matrix, size_t *, GrB_Field); -GrB_Info GrB_Matrix_get_Scalar(GrB_Matrix, GrB_Scalar, GrB_Field); -GrB_Info GrB_Matrix_get_String(GrB_Matrix, char *, GrB_Field); -GrB_Info GrB_Matrix_get_VOID(GrB_Matrix, void *, GrB_Field); -GrB_Info GrB_Matrix_import_BOOL(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const bool *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -GrB_Info GrB_Matrix_import_FP32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const float *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -GrB_Info GrB_Matrix_import_FP64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const double *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -GrB_Info GrB_Matrix_import_INT8(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int8_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -GrB_Info GrB_Matrix_import_INT16(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int16_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -GrB_Info GrB_Matrix_import_INT32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int32_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -GrB_Info GrB_Matrix_import_INT64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int64_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -GrB_Info GrB_Matrix_import_UDT(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const void *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -GrB_Info GrB_Matrix_import_UINT8(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint8_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -GrB_Info GrB_Matrix_import_UINT16(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint16_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -GrB_Info GrB_Matrix_import_UINT32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint32_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -GrB_Info GrB_Matrix_import_UINT64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint64_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +GrB_Info GrB_Matrix_extractTuples_BOOL(GrB_Index *I_, GrB_Index *J, bool *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_FP32(GrB_Index *I_, GrB_Index *J, float *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_FP64(GrB_Index *I_, GrB_Index *J, double *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_INT8(GrB_Index *I_, GrB_Index *J, int8_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_INT16(GrB_Index *I_, GrB_Index *J, int16_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_INT32(GrB_Index *I_, GrB_Index *J, int32_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_INT64(GrB_Index *I_, GrB_Index *J, int64_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_UDT(GrB_Index *I_, GrB_Index *J, void *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_UINT8(GrB_Index *I_, GrB_Index *J, uint8_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_UINT16(GrB_Index *I_, GrB_Index *J, uint16_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_UINT32(GrB_Index *I_, GrB_Index *J, uint32_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_UINT64(GrB_Index *I_, GrB_Index *J, uint64_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_free(GrB_Matrix *object); +GrB_Info GrB_Matrix_get_INT32(GrB_Matrix object, int32_t *, int); +GrB_Info GrB_Matrix_get_SIZE(GrB_Matrix object, size_t *, int); +GrB_Info GrB_Matrix_get_Scalar(GrB_Matrix object, GrB_Scalar, int); +GrB_Info GrB_Matrix_get_String(GrB_Matrix object, char *, int); +GrB_Info GrB_Matrix_get_VOID(GrB_Matrix object, void *, int); +GrB_Info GrB_Matrix_import_BOOL(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const bool *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, int format); +GrB_Info GrB_Matrix_import_FP32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const float *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, int format); +GrB_Info GrB_Matrix_import_FP64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const double *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, int format); +GrB_Info GrB_Matrix_import_INT8(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int8_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, int format); +GrB_Info GrB_Matrix_import_INT16(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int16_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, int format); +GrB_Info GrB_Matrix_import_INT32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int32_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, int format); +GrB_Info GrB_Matrix_import_INT64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int64_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, int format); +GrB_Info GrB_Matrix_import_UDT(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const void *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, int format); +GrB_Info GrB_Matrix_import_UINT8(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint8_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, int format); +GrB_Info GrB_Matrix_import_UINT16(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint16_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, int format); +GrB_Info GrB_Matrix_import_UINT32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint32_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, int format); +GrB_Info GrB_Matrix_import_UINT64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint64_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, int format); GrB_Info GrB_Matrix_kronecker_BinaryOp(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); GrB_Info GrB_Matrix_kronecker_Monoid(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); GrB_Info GrB_Matrix_kronecker_Semiring(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); @@ -2918,8 +2958,8 @@ GrB_Info GrB_Matrix_new(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index GrB_Info GrB_Matrix_nrows(GrB_Index *nrows, const GrB_Matrix A); GrB_Info GrB_Matrix_nvals(GrB_Index *nvals, const GrB_Matrix A); GrB_Info GrB_Matrix_reduce_BOOL(bool *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_reduce_BinaryOp(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_reduce_BinaryOp_Scalar(GrB_Scalar S, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_reduce_BinaryOp(GrB_Vector, const GrB_Vector, const GrB_BinaryOp, const GrB_BinaryOp, const GrB_Matrix, const GrB_Descriptor); +GrB_Info GrB_Matrix_reduce_BinaryOp_Scalar(GrB_Scalar, const GrB_BinaryOp, const GrB_BinaryOp, const GrB_Matrix, const GrB_Descriptor); GrB_Info GrB_Matrix_reduce_FP32(float *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); GrB_Info GrB_Matrix_reduce_FP64(double *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); GrB_Info GrB_Matrix_reduce_INT8(int8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); @@ -2963,11 +3003,11 @@ GrB_Info GrB_Matrix_setElement_UINT8(GrB_Matrix C, uint8_t x, GrB_Index i, GrB_I GrB_Info GrB_Matrix_setElement_UINT16(GrB_Matrix C, uint16_t x, GrB_Index i, GrB_Index j); GrB_Info GrB_Matrix_setElement_UINT32(GrB_Matrix C, uint32_t x, GrB_Index i, GrB_Index j); GrB_Info GrB_Matrix_setElement_UINT64(GrB_Matrix C, uint64_t x, GrB_Index i, GrB_Index j); -GrB_Info GrB_Matrix_set_INT32(GrB_Matrix, int32_t, GrB_Field); -GrB_Info GrB_Matrix_set_Scalar(GrB_Matrix, GrB_Scalar, GrB_Field); -GrB_Info GrB_Matrix_set_String(GrB_Matrix, char *, GrB_Field); -GrB_Info GrB_Matrix_set_VOID(GrB_Matrix, void *, GrB_Field, size_t); -GrB_Info GrB_Matrix_wait(GrB_Matrix A, GrB_WaitMode waitmode); +GrB_Info GrB_Matrix_set_INT32(GrB_Matrix object, int32_t, int); +GrB_Info GrB_Matrix_set_Scalar(GrB_Matrix object, GrB_Scalar, int); +GrB_Info GrB_Matrix_set_String(GrB_Matrix object, char *, int); +GrB_Info GrB_Matrix_set_VOID(GrB_Matrix object, void *, int, size_t); +GrB_Info GrB_Matrix_wait(GrB_Matrix object, int waitmode); GrB_Info GrB_Row_assign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, GrB_Index i, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); GrB_Info GrB_mxm(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); GrB_Info GrB_mxv(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Vector u, const GrB_Descriptor desc); @@ -2975,12 +3015,12 @@ GrB_Info GrB_transpose(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp a GrB_Info GrB_vxm(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Vector u, const GrB_Matrix A, const GrB_Descriptor desc); /* monoid */ -GrB_Info GrB_Monoid_error(const char **error, const GrB_Monoid monoid); -GrB_Info GrB_Monoid_free(GrB_Monoid *monoid); -GrB_Info GrB_Monoid_get_INT32(GrB_Monoid, int32_t *, GrB_Field); -GrB_Info GrB_Monoid_get_SIZE(GrB_Monoid, size_t *, GrB_Field); -GrB_Info GrB_Monoid_get_String(GrB_Monoid, char *, GrB_Field); -GrB_Info GrB_Monoid_get_VOID(GrB_Monoid, void *, GrB_Field); +GrB_Info GrB_Monoid_error(const char **error, const GrB_Monoid object); +GrB_Info GrB_Monoid_free(GrB_Monoid *object); +GrB_Info GrB_Monoid_get_INT32(GrB_Monoid object, int32_t *, int); +GrB_Info GrB_Monoid_get_SIZE(GrB_Monoid object, size_t *, int); +GrB_Info GrB_Monoid_get_String(GrB_Monoid object, char *, int); +GrB_Info GrB_Monoid_get_VOID(GrB_Monoid object, void *, int); GrB_Info GrB_Monoid_new_BOOL(GrB_Monoid *monoid, GrB_BinaryOp op, bool identity); GrB_Info GrB_Monoid_new_FP32(GrB_Monoid *monoid, GrB_BinaryOp op, float identity); GrB_Info GrB_Monoid_new_FP64(GrB_Monoid *monoid, GrB_BinaryOp op, double identity); @@ -2993,25 +3033,25 @@ GrB_Info GrB_Monoid_new_UINT8(GrB_Monoid *monoid, GrB_BinaryOp op, uint8_t ident GrB_Info GrB_Monoid_new_UINT16(GrB_Monoid *monoid, GrB_BinaryOp op, uint16_t identity); GrB_Info GrB_Monoid_new_UINT32(GrB_Monoid *monoid, GrB_BinaryOp op, uint32_t identity); GrB_Info GrB_Monoid_new_UINT64(GrB_Monoid *monoid, GrB_BinaryOp op, uint64_t identity); -GrB_Info GrB_Monoid_set_INT32(GrB_Monoid, int32_t, GrB_Field); -GrB_Info GrB_Monoid_set_String(GrB_Monoid, char *, GrB_Field); -GrB_Info GrB_Monoid_set_VOID(GrB_Monoid, void *, GrB_Field, size_t); -GrB_Info GrB_Monoid_wait(GrB_Monoid monoid, GrB_WaitMode waitmode); +GrB_Info GrB_Monoid_set_INT32(GrB_Monoid object, int32_t, int); +GrB_Info GrB_Monoid_set_String(GrB_Monoid object, char *, int); +GrB_Info GrB_Monoid_set_VOID(GrB_Monoid object, void *, int, size_t); +GrB_Info GrB_Monoid_wait(GrB_Monoid object, int waitmode); /* scalar */ -GrB_Info GrB_BinaryOp_get_Scalar(GrB_BinaryOp, GrB_Scalar, GrB_Field); -GrB_Info GrB_BinaryOp_set_Scalar(GrB_BinaryOp, GrB_Scalar, GrB_Field); -GrB_Info GrB_Descriptor_get_Scalar(GrB_Descriptor, GrB_Scalar, GrB_Field); -GrB_Info GrB_Descriptor_set_Scalar(GrB_Descriptor, GrB_Scalar, GrB_Field); -GrB_Info GrB_Global_get_Scalar(GrB_Global, GrB_Scalar, GrB_Field); -GrB_Info GrB_Global_set_Scalar(GrB_Global, GrB_Scalar, GrB_Field); -GrB_Info GrB_IndexUnaryOp_get_Scalar(GrB_IndexUnaryOp, GrB_Scalar, GrB_Field); -GrB_Info GrB_IndexUnaryOp_set_Scalar(GrB_IndexUnaryOp, GrB_Scalar, GrB_Field); -GrB_Info GrB_Monoid_get_Scalar(GrB_Monoid, GrB_Scalar, GrB_Field); -GrB_Info GrB_Monoid_set_Scalar(GrB_Monoid, GrB_Scalar, GrB_Field); +GrB_Info GrB_BinaryOp_get_Scalar(GrB_BinaryOp object, GrB_Scalar, int); +GrB_Info GrB_BinaryOp_set_Scalar(GrB_BinaryOp object, GrB_Scalar, int); +GrB_Info GrB_Descriptor_get_Scalar(GrB_Descriptor object, GrB_Scalar, int); +GrB_Info GrB_Descriptor_set_Scalar(GrB_Descriptor object, GrB_Scalar, int); +GrB_Info GrB_Global_get_Scalar(GrB_Global object, GrB_Scalar, int); +GrB_Info GrB_Global_set_Scalar(GrB_Global object, GrB_Scalar, int); +GrB_Info GrB_IndexUnaryOp_get_Scalar(GrB_IndexUnaryOp object, GrB_Scalar, int); +GrB_Info GrB_IndexUnaryOp_set_Scalar(GrB_IndexUnaryOp object, GrB_Scalar, int); +GrB_Info GrB_Monoid_get_Scalar(GrB_Monoid object, GrB_Scalar, int); +GrB_Info GrB_Monoid_set_Scalar(GrB_Monoid object, GrB_Scalar, int); GrB_Info GrB_Scalar_clear(GrB_Scalar s); GrB_Info GrB_Scalar_dup(GrB_Scalar *s, const GrB_Scalar t); -GrB_Info GrB_Scalar_error(const char **error, const GrB_Scalar s); +GrB_Info GrB_Scalar_error(const char **error, const GrB_Scalar object); GrB_Info GrB_Scalar_extractElement_BOOL(bool *x, const GrB_Scalar s); GrB_Info GrB_Scalar_extractElement_FP32(float *x, const GrB_Scalar s); GrB_Info GrB_Scalar_extractElement_FP64(double *x, const GrB_Scalar s); @@ -3024,12 +3064,12 @@ GrB_Info GrB_Scalar_extractElement_UINT8(uint8_t *x, const GrB_Scalar s); GrB_Info GrB_Scalar_extractElement_UINT16(uint16_t *x, const GrB_Scalar s); GrB_Info GrB_Scalar_extractElement_UINT32(uint32_t *x, const GrB_Scalar s); GrB_Info GrB_Scalar_extractElement_UINT64(uint64_t *x, const GrB_Scalar s); -GrB_Info GrB_Scalar_free(GrB_Scalar *s); -GrB_Info GrB_Scalar_get_INT32(GrB_Scalar, int32_t *, GrB_Field); -GrB_Info GrB_Scalar_get_SIZE(GrB_Scalar, size_t *, GrB_Field); -GrB_Info GrB_Scalar_get_Scalar(GrB_Scalar, GrB_Scalar, GrB_Field); -GrB_Info GrB_Scalar_get_String(GrB_Scalar, char *, GrB_Field); -GrB_Info GrB_Scalar_get_VOID(GrB_Scalar, void *, GrB_Field); +GrB_Info GrB_Scalar_free(GrB_Scalar *object); +GrB_Info GrB_Scalar_get_INT32(GrB_Scalar object, int32_t *, int); +GrB_Info GrB_Scalar_get_SIZE(GrB_Scalar object, size_t *, int); +GrB_Info GrB_Scalar_get_Scalar(GrB_Scalar object, GrB_Scalar, int); +GrB_Info GrB_Scalar_get_String(GrB_Scalar object, char *, int); +GrB_Info GrB_Scalar_get_VOID(GrB_Scalar object, void *, int); GrB_Info GrB_Scalar_new(GrB_Scalar *s, GrB_Type type); GrB_Info GrB_Scalar_nvals(GrB_Index *nvals, const GrB_Scalar s); GrB_Info GrB_Scalar_setElement_BOOL(GrB_Scalar s, bool x); @@ -3044,56 +3084,56 @@ GrB_Info GrB_Scalar_setElement_UINT8(GrB_Scalar s, uint8_t x); GrB_Info GrB_Scalar_setElement_UINT16(GrB_Scalar s, uint16_t x); GrB_Info GrB_Scalar_setElement_UINT32(GrB_Scalar s, uint32_t x); GrB_Info GrB_Scalar_setElement_UINT64(GrB_Scalar s, uint64_t x); -GrB_Info GrB_Scalar_set_INT32(GrB_Scalar, int32_t, GrB_Field); -GrB_Info GrB_Scalar_set_Scalar(GrB_Scalar, GrB_Scalar, GrB_Field); -GrB_Info GrB_Scalar_set_String(GrB_Scalar, char *, GrB_Field); -GrB_Info GrB_Scalar_set_VOID(GrB_Scalar, void *, GrB_Field, size_t); -GrB_Info GrB_Scalar_wait(GrB_Scalar s, GrB_WaitMode waitmode); -GrB_Info GrB_Semiring_get_Scalar(GrB_Semiring, GrB_Scalar, GrB_Field); -GrB_Info GrB_Semiring_set_Scalar(GrB_Semiring, GrB_Scalar, GrB_Field); -GrB_Info GrB_Type_get_Scalar(GrB_Type, GrB_Scalar, GrB_Field); -GrB_Info GrB_Type_set_Scalar(GrB_Type, GrB_Scalar, GrB_Field); -GrB_Info GrB_UnaryOp_get_Scalar(GrB_UnaryOp, GrB_Scalar, GrB_Field); -GrB_Info GrB_UnaryOp_set_Scalar(GrB_UnaryOp, GrB_Scalar, GrB_Field); +GrB_Info GrB_Scalar_set_INT32(GrB_Scalar object, int32_t, int); +GrB_Info GrB_Scalar_set_Scalar(GrB_Scalar object, GrB_Scalar, int); +GrB_Info GrB_Scalar_set_String(GrB_Scalar object, char *, int); +GrB_Info GrB_Scalar_set_VOID(GrB_Scalar object, void *, int, size_t); +GrB_Info GrB_Scalar_wait(GrB_Scalar object, int waitmode); +GrB_Info GrB_Semiring_get_Scalar(GrB_Semiring object, GrB_Scalar, int); +GrB_Info GrB_Semiring_set_Scalar(GrB_Semiring object, GrB_Scalar, int); +GrB_Info GrB_Type_get_Scalar(GrB_Type object, GrB_Scalar, int); +GrB_Info GrB_Type_set_Scalar(GrB_Type object, GrB_Scalar, int); +GrB_Info GrB_UnaryOp_get_Scalar(GrB_UnaryOp object, GrB_Scalar, int); +GrB_Info GrB_UnaryOp_set_Scalar(GrB_UnaryOp object, GrB_Scalar, int); /* semiring */ -GrB_Info GrB_Semiring_error(const char **error, const GrB_Semiring semiring); -GrB_Info GrB_Semiring_free(GrB_Semiring *semiring); -GrB_Info GrB_Semiring_get_INT32(GrB_Semiring, int32_t *, GrB_Field); -GrB_Info GrB_Semiring_get_SIZE(GrB_Semiring, size_t *, GrB_Field); -GrB_Info GrB_Semiring_get_String(GrB_Semiring, char *, GrB_Field); -GrB_Info GrB_Semiring_get_VOID(GrB_Semiring, void *, GrB_Field); +GrB_Info GrB_Semiring_error(const char **error, const GrB_Semiring object); +GrB_Info GrB_Semiring_free(GrB_Semiring *object); +GrB_Info GrB_Semiring_get_INT32(GrB_Semiring object, int32_t *, int); +GrB_Info GrB_Semiring_get_SIZE(GrB_Semiring object, size_t *, int); +GrB_Info GrB_Semiring_get_String(GrB_Semiring object, char *, int); +GrB_Info GrB_Semiring_get_VOID(GrB_Semiring object, void *, int); GrB_Info GrB_Semiring_new(GrB_Semiring *semiring, GrB_Monoid add, GrB_BinaryOp multiply); -GrB_Info GrB_Semiring_set_INT32(GrB_Semiring, int32_t, GrB_Field); -GrB_Info GrB_Semiring_set_String(GrB_Semiring, char *, GrB_Field); -GrB_Info GrB_Semiring_set_VOID(GrB_Semiring, void *, GrB_Field, size_t); -GrB_Info GrB_Semiring_wait(GrB_Semiring semiring, GrB_WaitMode waitmode); +GrB_Info GrB_Semiring_set_INT32(GrB_Semiring object, int32_t, int); +GrB_Info GrB_Semiring_set_String(GrB_Semiring object, char *, int); +GrB_Info GrB_Semiring_set_VOID(GrB_Semiring object, void *, int, size_t); +GrB_Info GrB_Semiring_wait(GrB_Semiring object, int waitmode); /* type */ -GrB_Info GrB_Type_error(const char **error, const GrB_Type type); -GrB_Info GrB_Type_free(GrB_Type *type); -GrB_Info GrB_Type_get_INT32(GrB_Type, int32_t *, GrB_Field); -GrB_Info GrB_Type_get_SIZE(GrB_Type, size_t *, GrB_Field); -GrB_Info GrB_Type_get_String(GrB_Type, char *, GrB_Field); -GrB_Info GrB_Type_get_VOID(GrB_Type, void *, GrB_Field); +GrB_Info GrB_Type_error(const char **error, const GrB_Type object); +GrB_Info GrB_Type_free(GrB_Type *object); +GrB_Info GrB_Type_get_INT32(GrB_Type object, int32_t *, int); +GrB_Info GrB_Type_get_SIZE(GrB_Type object, size_t *, int); +GrB_Info GrB_Type_get_String(GrB_Type object, char *, int); +GrB_Info GrB_Type_get_VOID(GrB_Type object, void *, int); GrB_Info GrB_Type_new(GrB_Type *type, size_t sizeof_ctype); -GrB_Info GrB_Type_set_INT32(GrB_Type, int32_t, GrB_Field); -GrB_Info GrB_Type_set_String(GrB_Type, char *, GrB_Field); -GrB_Info GrB_Type_set_VOID(GrB_Type, void *, GrB_Field, size_t); -GrB_Info GrB_Type_wait(GrB_Type type, GrB_WaitMode waitmode); +GrB_Info GrB_Type_set_INT32(GrB_Type object, int32_t, int); +GrB_Info GrB_Type_set_String(GrB_Type object, char *, int); +GrB_Info GrB_Type_set_VOID(GrB_Type object, void *, int, size_t); +GrB_Info GrB_Type_wait(GrB_Type object, int waitmode); /* unary */ -GrB_Info GrB_UnaryOp_error(const char **error, const GrB_UnaryOp op); -GrB_Info GrB_UnaryOp_free(GrB_UnaryOp *unaryop); -GrB_Info GrB_UnaryOp_get_INT32(GrB_UnaryOp, int32_t *, GrB_Field); -GrB_Info GrB_UnaryOp_get_SIZE(GrB_UnaryOp, size_t *, GrB_Field); -GrB_Info GrB_UnaryOp_get_String(GrB_UnaryOp, char *, GrB_Field); -GrB_Info GrB_UnaryOp_get_VOID(GrB_UnaryOp, void *, GrB_Field); +GrB_Info GrB_UnaryOp_error(const char **error, const GrB_UnaryOp object); +GrB_Info GrB_UnaryOp_free(GrB_UnaryOp *object); +GrB_Info GrB_UnaryOp_get_INT32(GrB_UnaryOp object, int32_t *, int); +GrB_Info GrB_UnaryOp_get_SIZE(GrB_UnaryOp object, size_t *, int); +GrB_Info GrB_UnaryOp_get_String(GrB_UnaryOp object, char *, int); +GrB_Info GrB_UnaryOp_get_VOID(GrB_UnaryOp object, void *, int); GrB_Info GrB_UnaryOp_new(GrB_UnaryOp *unaryop, GxB_unary_function function, GrB_Type ztype, GrB_Type xtype); -GrB_Info GrB_UnaryOp_set_INT32(GrB_UnaryOp, int32_t, GrB_Field); -GrB_Info GrB_UnaryOp_set_String(GrB_UnaryOp, char *, GrB_Field); -GrB_Info GrB_UnaryOp_set_VOID(GrB_UnaryOp, void *, GrB_Field, size_t); -GrB_Info GrB_UnaryOp_wait(GrB_UnaryOp op, GrB_WaitMode waitmode); +GrB_Info GrB_UnaryOp_set_INT32(GrB_UnaryOp object, int32_t, int); +GrB_Info GrB_UnaryOp_set_String(GrB_UnaryOp object, char *, int); +GrB_Info GrB_UnaryOp_set_VOID(GrB_UnaryOp object, void *, int, size_t); +GrB_Info GrB_UnaryOp_wait(GrB_UnaryOp object, int waitmode); /* vector */ GrB_Info GrB_Vector_apply(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_UnaryOp op, const GrB_Vector u, const GrB_Descriptor desc); @@ -3136,32 +3176,32 @@ GrB_Info GrB_Vector_apply_IndexOp_UINT8(GrB_Vector w, const GrB_Vector mask, con GrB_Info GrB_Vector_apply_IndexOp_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint16_t y, const GrB_Descriptor desc); GrB_Info GrB_Vector_apply_IndexOp_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint32_t y, const GrB_Descriptor desc); GrB_Info GrB_Vector_apply_IndexOp_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint64_t y, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, bool x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, float x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, double x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, void *x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_build_BOOL(GrB_Vector w, const GrB_Index *Ilist, const bool *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_FP32(GrB_Vector w, const GrB_Index *Ilist, const float *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_FP64(GrB_Vector w, const GrB_Index *Ilist, const double *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_INT8(GrB_Vector w, const GrB_Index *Ilist, const int8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_INT16(GrB_Vector w, const GrB_Index *Ilist, const int16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_INT32(GrB_Vector w, const GrB_Index *Ilist, const int32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_INT64(GrB_Vector w, const GrB_Index *Ilist, const int64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_UDT(GrB_Vector w, const GrB_Index *Ilist, const void *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_UINT8(GrB_Vector w, const GrB_Index *Ilist, const uint8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_UINT16(GrB_Vector w, const GrB_Index *Ilist, const uint16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_UINT32(GrB_Vector w, const GrB_Index *Ilist, const uint32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_UINT64(GrB_Vector w, const GrB_Index *Ilist, const uint64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_assign(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, float x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, double x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Scalar x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_build_BOOL(GrB_Vector w, const GrB_Index *I_, const bool *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_FP32(GrB_Vector w, const GrB_Index *I_, const float *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_FP64(GrB_Vector w, const GrB_Index *I_, const double *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_INT8(GrB_Vector w, const GrB_Index *I_, const int8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_INT16(GrB_Vector w, const GrB_Index *I_, const int16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_INT32(GrB_Vector w, const GrB_Index *I_, const int32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_INT64(GrB_Vector w, const GrB_Index *I_, const int64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_UDT(GrB_Vector w, const GrB_Index *I_, const void *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_UINT8(GrB_Vector w, const GrB_Index *I_, const uint8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_UINT16(GrB_Vector w, const GrB_Index *I_, const uint16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_UINT32(GrB_Vector w, const GrB_Index *I_, const uint32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_UINT64(GrB_Vector w, const GrB_Index *I_, const uint64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); GrB_Info GrB_Vector_clear(GrB_Vector v); GrB_Info GrB_Vector_dup(GrB_Vector *w, const GrB_Vector u); GrB_Info GrB_Vector_eWiseAdd_BinaryOp(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); @@ -3170,8 +3210,8 @@ GrB_Info GrB_Vector_eWiseAdd_Semiring(GrB_Vector w, const GrB_Vector mask, const GrB_Info GrB_Vector_eWiseMult_BinaryOp(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp mult, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); GrB_Info GrB_Vector_eWiseMult_Monoid(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); GrB_Info GrB_Vector_eWiseMult_Semiring(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); -GrB_Info GrB_Vector_error(const char **error, const GrB_Vector v); -GrB_Info GrB_Vector_extract(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_error(const char **error, const GrB_Vector object); +GrB_Info GrB_Vector_extract(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); GrB_Info GrB_Vector_extractElement_BOOL(bool *x, const GrB_Vector v, GrB_Index i); GrB_Info GrB_Vector_extractElement_FP32(float *x, const GrB_Vector v, GrB_Index i); GrB_Info GrB_Vector_extractElement_FP64(double *x, const GrB_Vector v, GrB_Index i); @@ -3185,28 +3225,28 @@ GrB_Info GrB_Vector_extractElement_UINT8(uint8_t *x, const GrB_Vector v, GrB_Ind GrB_Info GrB_Vector_extractElement_UINT16(uint16_t *x, const GrB_Vector v, GrB_Index i); GrB_Info GrB_Vector_extractElement_UINT32(uint32_t *x, const GrB_Vector v, GrB_Index i); GrB_Info GrB_Vector_extractElement_UINT64(uint64_t *x, const GrB_Vector v, GrB_Index i); -GrB_Info GrB_Vector_extractTuples_BOOL(GrB_Index *Ilist, bool *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_FP32(GrB_Index *Ilist, float *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_FP64(GrB_Index *Ilist, double *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_INT8(GrB_Index *Ilist, int8_t *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_INT16(GrB_Index *Ilist, int16_t *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_INT32(GrB_Index *Ilist, int32_t *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_INT64(GrB_Index *Ilist, int64_t *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_UDT(GrB_Index *Ilist, void *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_UINT8(GrB_Index *Ilist, uint8_t *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_UINT16(GrB_Index *Ilist, uint16_t *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_UINT32(GrB_Index *Ilist, uint32_t *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_UINT64(GrB_Index *Ilist, uint64_t *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_free(GrB_Vector *v); -GrB_Info GrB_Vector_get_INT32(GrB_Vector, int32_t *, GrB_Field); -GrB_Info GrB_Vector_get_SIZE(GrB_Vector, size_t *, GrB_Field); -GrB_Info GrB_Vector_get_Scalar(GrB_Vector, GrB_Scalar, GrB_Field); -GrB_Info GrB_Vector_get_String(GrB_Vector, char *, GrB_Field); -GrB_Info GrB_Vector_get_VOID(GrB_Vector, void *, GrB_Field); +GrB_Info GrB_Vector_extractTuples_BOOL(GrB_Index *I_, bool *X, GrB_Index *nvals, const GrB_Vector V); +GrB_Info GrB_Vector_extractTuples_FP32(GrB_Index *I_, float *X, GrB_Index *nvals, const GrB_Vector V); +GrB_Info GrB_Vector_extractTuples_FP64(GrB_Index *I_, double *X, GrB_Index *nvals, const GrB_Vector V); +GrB_Info GrB_Vector_extractTuples_INT8(GrB_Index *I_, int8_t *X, GrB_Index *nvals, const GrB_Vector V); +GrB_Info GrB_Vector_extractTuples_INT16(GrB_Index *I_, int16_t *X, GrB_Index *nvals, const GrB_Vector V); +GrB_Info GrB_Vector_extractTuples_INT32(GrB_Index *I_, int32_t *X, GrB_Index *nvals, const GrB_Vector V); +GrB_Info GrB_Vector_extractTuples_INT64(GrB_Index *I_, int64_t *X, GrB_Index *nvals, const GrB_Vector V); +GrB_Info GrB_Vector_extractTuples_UDT(GrB_Index *I_, void *X, GrB_Index *nvals, const GrB_Vector V); +GrB_Info GrB_Vector_extractTuples_UINT8(GrB_Index *I_, uint8_t *X, GrB_Index *nvals, const GrB_Vector V); +GrB_Info GrB_Vector_extractTuples_UINT16(GrB_Index *I_, uint16_t *X, GrB_Index *nvals, const GrB_Vector V); +GrB_Info GrB_Vector_extractTuples_UINT32(GrB_Index *I_, uint32_t *X, GrB_Index *nvals, const GrB_Vector V); +GrB_Info GrB_Vector_extractTuples_UINT64(GrB_Index *I_, uint64_t *X, GrB_Index *nvals, const GrB_Vector V); +GrB_Info GrB_Vector_free(GrB_Vector *object); +GrB_Info GrB_Vector_get_INT32(GrB_Vector object, int32_t *, int); +GrB_Info GrB_Vector_get_SIZE(GrB_Vector object, size_t *, int); +GrB_Info GrB_Vector_get_Scalar(GrB_Vector object, GrB_Scalar, int); +GrB_Info GrB_Vector_get_String(GrB_Vector object, char *, int); +GrB_Info GrB_Vector_get_VOID(GrB_Vector object, void *, int); GrB_Info GrB_Vector_new(GrB_Vector *v, GrB_Type type, GrB_Index n); GrB_Info GrB_Vector_nvals(GrB_Index *nvals, const GrB_Vector v); GrB_Info GrB_Vector_reduce_BOOL(bool *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -GrB_Info GrB_Vector_reduce_BinaryOp_Scalar(GrB_Scalar c, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_reduce_BinaryOp_Scalar(GrB_Scalar, const GrB_BinaryOp, const GrB_BinaryOp, const GrB_Vector, const GrB_Descriptor); GrB_Info GrB_Vector_reduce_FP32(float *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); GrB_Info GrB_Vector_reduce_FP64(double *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); GrB_Info GrB_Vector_reduce_INT8(int8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); @@ -3247,12 +3287,12 @@ GrB_Info GrB_Vector_setElement_UINT8(GrB_Vector w, uint8_t x, GrB_Index i); GrB_Info GrB_Vector_setElement_UINT16(GrB_Vector w, uint16_t x, GrB_Index i); GrB_Info GrB_Vector_setElement_UINT32(GrB_Vector w, uint32_t x, GrB_Index i); GrB_Info GrB_Vector_setElement_UINT64(GrB_Vector w, uint64_t x, GrB_Index i); -GrB_Info GrB_Vector_set_INT32(GrB_Vector, int32_t, GrB_Field); -GrB_Info GrB_Vector_set_Scalar(GrB_Vector, GrB_Scalar, GrB_Field); -GrB_Info GrB_Vector_set_String(GrB_Vector, char *, GrB_Field); -GrB_Info GrB_Vector_set_VOID(GrB_Vector, void *, GrB_Field, size_t); +GrB_Info GrB_Vector_set_INT32(GrB_Vector object, int32_t, int); +GrB_Info GrB_Vector_set_Scalar(GrB_Vector object, GrB_Scalar, int); +GrB_Info GrB_Vector_set_String(GrB_Vector object, char *, int); +GrB_Info GrB_Vector_set_VOID(GrB_Vector object, void *, int, size_t); GrB_Info GrB_Vector_size(GrB_Index *n, const GrB_Vector v); -GrB_Info GrB_Vector_wait(GrB_Vector v, GrB_WaitMode waitmode); +GrB_Info GrB_Vector_wait(GrB_Vector object, int waitmode); /*************** * GB functions * @@ -3261,17 +3301,17 @@ GrB_Info GrB_Vector_wait(GrB_Vector v, GrB_WaitMode waitmode); /* iterator */ GrB_Info GB_Iterator_rc_bitmap_next(GxB_Iterator iterator); GrB_Info GB_Iterator_rc_seek(GxB_Iterator iterator, GrB_Index j, bool jth_vector); -GrB_Info GB_Vector_Iterator_bitmap_seek(GxB_Iterator iterator, GrB_Index unused); +GrB_Info GB_Vector_Iterator_bitmap_seek(GxB_Iterator iterator); /* matrix */ -GrB_Info GB_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GxB_Format_Value format, GrB_Descriptor desc); +GrB_Info GB_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, int format, GrB_Descriptor desc); /**************** * GxB functions * ****************/ /* binary */ -GrB_Info GxB_BinaryOp_fprint(GrB_BinaryOp binaryop, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_BinaryOp_fprint(GrB_BinaryOp binaryop, const char *name, int pr, FILE *f); GrB_Info GxB_BinaryOp_new(GrB_BinaryOp *op, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *binop_name, const char *binop_defn); GrB_Info GxB_BinaryOp_xtype(GrB_Type *, GrB_BinaryOp); GrB_Info GxB_BinaryOp_xtype_name(char *, const GrB_BinaryOp); @@ -3280,75 +3320,79 @@ GrB_Info GxB_BinaryOp_ytype_name(char *, const GrB_BinaryOp); GrB_Info GxB_BinaryOp_ztype(GrB_Type *, GrB_BinaryOp); GrB_Info GxB_BinaryOp_ztype_name(char *, const GrB_BinaryOp); +/* container */ +GrB_Info GxB_Container_free(GxB_Container *object); +GrB_Info GxB_Container_new(GxB_Container *Container); + /* context */ GrB_Info GxB_Context_disengage(GxB_Context Context); GrB_Info GxB_Context_engage(GxB_Context Context); -GrB_Info GxB_Context_error(const char **error, const GxB_Context c); -GrB_Info GxB_Context_fprint(GxB_Context Context, const char *name, GxB_Print_Level pr, FILE *f); -GrB_Info GxB_Context_free(GxB_Context *Context); -GrB_Info GxB_Context_get(GxB_Context, GxB_Context_Field, ...); -GrB_Info GxB_Context_get_FP64(GxB_Context, GxB_Context_Field, double *); -GrB_Info GxB_Context_get_INT(GxB_Context, int32_t *, GrB_Field); -GrB_Info GxB_Context_get_INT32(GxB_Context, GxB_Context_Field, int32_t *); -GrB_Info GxB_Context_get_SIZE(GxB_Context, size_t *, GrB_Field); -GrB_Info GxB_Context_get_String(GxB_Context, char *, GrB_Field); -GrB_Info GxB_Context_get_VOID(GxB_Context, void *, GrB_Field); +GrB_Info GxB_Context_error(const char **error, const GxB_Context object); +GrB_Info GxB_Context_fprint(GxB_Context Context, const char *name, int pr, FILE *f); +GrB_Info GxB_Context_free(GxB_Context *object); +GrB_Info GxB_Context_get(GxB_Context, int, ...); +GrB_Info GxB_Context_get_FP64(GxB_Context, int, double *); +GrB_Info GxB_Context_get_INT(GxB_Context, int32_t *, int); +GrB_Info GxB_Context_get_INT32(GxB_Context, int, int32_t *); +GrB_Info GxB_Context_get_SIZE(GxB_Context, size_t *, int); +GrB_Info GxB_Context_get_String(GxB_Context, char *, int); +GrB_Info GxB_Context_get_VOID(GxB_Context, void *, int); GrB_Info GxB_Context_new(GxB_Context *Context); -GrB_Info GxB_Context_set(GxB_Context, GxB_Context_Field, ...); -GrB_Info GxB_Context_set_FP64(GxB_Context, GxB_Context_Field, double); -GrB_Info GxB_Context_set_INT(GxB_Context, int32_t, GrB_Field); -GrB_Info GxB_Context_set_INT32(GxB_Context, GxB_Context_Field, int32_t); -GrB_Info GxB_Context_set_String(GxB_Context, char *, GrB_Field); -GrB_Info GxB_Context_set_VOID(GxB_Context, void *, GrB_Field, size_t); -GrB_Info GxB_Context_wait(GxB_Context Context, GrB_WaitMode waitmode); +GrB_Info GxB_Context_set(GxB_Context, int, ...); +GrB_Info GxB_Context_set_FP64(GxB_Context, int, double); +GrB_Info GxB_Context_set_INT(GxB_Context, int32_t, int); +GrB_Info GxB_Context_set_INT32(GxB_Context, int, int32_t); +GrB_Info GxB_Context_set_String(GxB_Context, char *, int); +GrB_Info GxB_Context_set_VOID(GxB_Context, void *, int, size_t); +GrB_Info GxB_Context_wait(GxB_Context object, int waitmode); /* core */ -GrB_Info GxB_Global_Option_get(GxB_Option_Field, ...); -GrB_Info GxB_Global_Option_get_CHAR(GxB_Option_Field, const char **); -GrB_Info GxB_Global_Option_get_FP64(GxB_Option_Field, double *); -GrB_Info GxB_Global_Option_get_FUNCTION(GxB_Option_Field, void **); -GrB_Info GxB_Global_Option_get_INT32(GxB_Option_Field, int32_t *); -GrB_Info GxB_Global_Option_get_INT64(GxB_Option_Field, int64_t *); -GrB_Info GxB_Global_Option_set(GxB_Option_Field, ...); -GrB_Info GxB_Global_Option_set_CHAR(GxB_Option_Field, const char *); -GrB_Info GxB_Global_Option_set_FP64(GxB_Option_Field, double); -GrB_Info GxB_Global_Option_set_FP64_ARRAY(GxB_Option_Field, double *); -GrB_Info GxB_Global_Option_set_FUNCTION(GxB_Option_Field, void *); -GrB_Info GxB_Global_Option_set_INT32(GxB_Option_Field, int32_t); -GrB_Info GxB_Global_Option_set_INT64_ARRAY(GxB_Option_Field, int64_t *); -GrB_Info GxB_Serialized_get_INT32(const void *, int32_t *, GrB_Field, size_t); -GrB_Info GxB_Serialized_get_SIZE(const void *, size_t *, GrB_Field, size_t); -GrB_Info GxB_Serialized_get_String(const void *, char *, GrB_Field, size_t); -GrB_Info GxB_Serialized_get_VOID(const void *, void *, GrB_Field, size_t); -GrB_Info GxB_deserialize_type_name(char *, const void *, GrB_Index); -GrB_Info GxB_init(GrB_Mode mode, void *(*user_malloc_function)(size_t), void *(*user_calloc_function)(size_t, size_t), void *(*user_realloc_function)(void *, size_t), void (*user_free_function)(void *)); +GrB_Info GxB_Global_Option_get(int, ...); +GrB_Info GxB_Global_Option_get_CHAR(int, const char **); +GrB_Info GxB_Global_Option_get_FP64(int, double *); +GrB_Info GxB_Global_Option_get_FUNCTION(int, void **); +GrB_Info GxB_Global_Option_get_INT32(int, int32_t *); +GrB_Info GxB_Global_Option_get_INT64(int, int64_t *); +GrB_Info GxB_Global_Option_set(int, ...); +GrB_Info GxB_Global_Option_set_CHAR(int, const char *); +GrB_Info GxB_Global_Option_set_FP64(int, double); +GrB_Info GxB_Global_Option_set_FP64_ARRAY(int, double *); +GrB_Info GxB_Global_Option_set_FUNCTION(int, void *); +GrB_Info GxB_Global_Option_set_INT32(int, int32_t); +GrB_Info GxB_Global_Option_set_INT64_ARRAY(int, int64_t *); +GrB_Info GxB_Serialized_get_INT32(const void *, int32_t *, int, size_t); +GrB_Info GxB_Serialized_get_SIZE(const void *, size_t *, int, size_t); +GrB_Info GxB_Serialized_get_String(const void *, char *, int, size_t); +GrB_Info GxB_Serialized_get_VOID(const void *, void *, int, size_t); +GrB_Info GxB_deserialize_type_name(char *, const void *, uint64_t); +GrB_Info GxB_init(int mode, void *(*user_malloc_function)(size_t), void *(*user_calloc_function)(size_t, size_t), void *(*user_realloc_function)(void *, size_t), void (*user_free_function)(void *)); /* descriptor */ -GrB_Info GxB_Desc_get(GrB_Descriptor, GrB_Desc_Field, ...); -GrB_Info GxB_Desc_get_FP64(GrB_Descriptor, GrB_Desc_Field, double *); -GrB_Info GxB_Desc_get_INT32(GrB_Descriptor, GrB_Desc_Field, int32_t *); -GrB_Info GxB_Desc_set(GrB_Descriptor, GrB_Desc_Field, ...); -GrB_Info GxB_Desc_set_FP64(GrB_Descriptor, GrB_Desc_Field, double); -GrB_Info GxB_Desc_set_INT32(GrB_Descriptor, GrB_Desc_Field, int32_t); -GrB_Info GxB_Descriptor_fprint(GrB_Descriptor descriptor, const char *name, GxB_Print_Level pr, FILE *f); -GrB_Info GxB_Descriptor_get(GrB_Desc_Value *, GrB_Descriptor, GrB_Desc_Field); +GrB_Info GxB_Desc_get(GrB_Descriptor, int, ...); +GrB_Info GxB_Desc_get_FP64(GrB_Descriptor, int, double *); +GrB_Info GxB_Desc_get_INT32(GrB_Descriptor, int, int32_t *); +GrB_Info GxB_Desc_set(GrB_Descriptor, int, ...); +GrB_Info GxB_Desc_set_FP64(GrB_Descriptor, int, double); +GrB_Info GxB_Desc_set_INT32(GrB_Descriptor, int, int32_t); +GrB_Info GxB_Descriptor_fprint(GrB_Descriptor descriptor, const char *name, int pr, FILE *f); +GrB_Info GxB_Descriptor_get(int32_t *, GrB_Descriptor, int); /* indexbinary */ -GrB_Info GxB_IndexBinaryOp_error(const char **error, const GxB_IndexBinaryOp op); -GrB_Info GxB_IndexBinaryOp_fprint(GxB_IndexBinaryOp op, const char *name, GxB_Print_Level pr, FILE *f); -GrB_Info GxB_IndexBinaryOp_free(GxB_IndexBinaryOp *op); -GrB_Info GxB_IndexBinaryOp_get_INT32(GxB_IndexBinaryOp, int32_t *, GrB_Field); -GrB_Info GxB_IndexBinaryOp_get_SIZE(GxB_IndexBinaryOp, size_t *, GrB_Field); -GrB_Info GxB_IndexBinaryOp_get_String(GxB_IndexBinaryOp, char *, GrB_Field); -GrB_Info GxB_IndexBinaryOp_get_VOID(GxB_IndexBinaryOp, void *, GrB_Field); +GrB_Info GxB_IndexBinaryOp_error(const char **error, const GxB_IndexBinaryOp object); +GrB_Info GxB_IndexBinaryOp_fprint(GxB_IndexBinaryOp op, const char *name, int pr, FILE *f); +GrB_Info GxB_IndexBinaryOp_free(GxB_IndexBinaryOp *object); +GrB_Info GxB_IndexBinaryOp_get_INT32(GxB_IndexBinaryOp object, int32_t *, int); +GrB_Info GxB_IndexBinaryOp_get_SIZE(GxB_IndexBinaryOp object, size_t *, int); +GrB_Info GxB_IndexBinaryOp_get_String(GxB_IndexBinaryOp object, char *, int); +GrB_Info GxB_IndexBinaryOp_get_VOID(GxB_IndexBinaryOp object, void *, int); GrB_Info GxB_IndexBinaryOp_new(GxB_IndexBinaryOp *op, GxB_index_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, GrB_Type theta_type, const char *idxbinop_name, const char *idxbinop_defn); -GrB_Info GxB_IndexBinaryOp_set_INT32(GxB_IndexBinaryOp, int32_t, GrB_Field); -GrB_Info GxB_IndexBinaryOp_set_String(GxB_IndexBinaryOp, char *, GrB_Field); -GrB_Info GxB_IndexBinaryOp_set_VOID(GxB_IndexBinaryOp, void *, GrB_Field, size_t); -GrB_Info GxB_IndexBinaryOp_wait(GxB_IndexBinaryOp op, GrB_WaitMode waitmode); +GrB_Info GxB_IndexBinaryOp_set_INT32(GxB_IndexBinaryOp object, int32_t, int); +GrB_Info GxB_IndexBinaryOp_set_String(GxB_IndexBinaryOp object, char *, int); +GrB_Info GxB_IndexBinaryOp_set_VOID(GxB_IndexBinaryOp object, void *, int, size_t); +GrB_Info GxB_IndexBinaryOp_wait(GxB_IndexBinaryOp object, int waitmode); /* indexunary */ -GrB_Info GxB_IndexUnaryOp_fprint(GrB_IndexUnaryOp op, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_IndexUnaryOp_fprint(GrB_IndexUnaryOp op, const char *name, int pr, FILE *f); GrB_Info GxB_IndexUnaryOp_new(GrB_IndexUnaryOp *op, GxB_index_unary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *idxop_name, const char *idxop_defn); GrB_Info GxB_IndexUnaryOp_xtype_name(char *, const GrB_IndexUnaryOp); GrB_Info GxB_IndexUnaryOp_ytype_name(char *, const GrB_IndexUnaryOp); @@ -3366,7 +3410,7 @@ GrB_Index GxB_colIterator_kount(GxB_Iterator iterator); GrB_Index GxB_rowIterator_getColIndex(GxB_Iterator iterator); GrB_Index GxB_rowIterator_getRowIndex(GxB_Iterator iterator); GrB_Index GxB_rowIterator_kount(GxB_Iterator iterator); -GrB_Info GxB_Iterator_free(GxB_Iterator *iterator); +GrB_Info GxB_Iterator_free(GxB_Iterator *object); GrB_Info GxB_Iterator_new(GxB_Iterator *iterator); GrB_Info GxB_Matrix_Iterator_next(GxB_Iterator iterator); GrB_Info GxB_Matrix_Iterator_seek(GxB_Iterator iterator, GrB_Index p); @@ -3397,14 +3441,17 @@ void GxB_Iterator_get_UDT(GxB_Iterator iterator, void *value); void GxB_Matrix_Iterator_getIndex(GxB_Iterator iterator, GrB_Index *row, GrB_Index *col); /* matrix */ -GrB_Info GxB_Col_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *Ilist, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); +GrB_Info GxB_Col_assign_Vector(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Vector I_vector, GrB_Index j, const GrB_Descriptor desc); +GrB_Info GxB_Col_extract_Vector(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Vector I_vector, GrB_Index j, const GrB_Descriptor desc); +GrB_Info GxB_Col_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I_, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); +GrB_Info GxB_Col_subassign_Vector(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Vector I_vector, GrB_Index j, const GrB_Descriptor desc); GrB_Info GxB_Matrix_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); -GrB_Info GxB_Matrix_Option_get(GrB_Matrix, GxB_Option_Field, ...); -GrB_Info GxB_Matrix_Option_get_FP64(GrB_Matrix, GxB_Option_Field, double *); -GrB_Info GxB_Matrix_Option_get_INT32(GrB_Matrix, GxB_Option_Field, int32_t *); -GrB_Info GxB_Matrix_Option_set(GrB_Matrix, GxB_Option_Field, ...); -GrB_Info GxB_Matrix_Option_set_FP64(GrB_Matrix, GxB_Option_Field, double); -GrB_Info GxB_Matrix_Option_set_INT32(GrB_Matrix, GxB_Option_Field, int32_t); +GrB_Info GxB_Matrix_Option_get(GrB_Matrix, int, ...); +GrB_Info GxB_Matrix_Option_get_FP64(GrB_Matrix, int, double *); +GrB_Info GxB_Matrix_Option_get_INT32(GrB_Matrix, int, int32_t *); +GrB_Info GxB_Matrix_Option_set(GrB_Matrix, int, ...); +GrB_Info GxB_Matrix_Option_set_FP64(GrB_Matrix, int, double); +GrB_Info GxB_Matrix_Option_set_INT32(GrB_Matrix, int, int32_t); GrB_Info GxB_Matrix_apply_BinaryOp1st(GrB_Matrix, const GrB_Matrix, const GrB_BinaryOp, const GrB_BinaryOp, const GrB_Scalar, const GrB_Matrix, const GrB_Descriptor); GrB_Info GxB_Matrix_apply_BinaryOp1st_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC32_t x, const GrB_Matrix A, const GrB_Descriptor desc); GrB_Info GxB_Matrix_apply_BinaryOp1st_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC64_t x, const GrB_Matrix A, const GrB_Descriptor desc); @@ -3413,56 +3460,62 @@ GrB_Info GxB_Matrix_apply_BinaryOp2nd_FC32(GrB_Matrix C, const GrB_Matrix Mask, GrB_Info GxB_Matrix_apply_BinaryOp2nd_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, GxB_FC64_t y, const GrB_Descriptor desc); GrB_Info GxB_Matrix_apply_IndexOp_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, GxB_FC32_t y, const GrB_Descriptor desc); GrB_Info GxB_Matrix_apply_IndexOp_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, GxB_FC64_t y, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_assign_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC32_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_assign_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_build_FC32(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const GxB_FC32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GxB_Matrix_build_FC64(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const GxB_FC64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GxB_Matrix_build_Scalar(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, GrB_Scalar scalar, GrB_Index nvals); +GrB_Info GxB_Matrix_assign_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC32_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_assign_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_assign_Scalar_Vector(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Scalar x, const GrB_Vector I_vector, const GrB_Vector J_vector, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_assign_Vector(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Vector I_vector, const GrB_Vector J_vector, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_build_FC32(GrB_Matrix C, const GrB_Index *I_, const GrB_Index *J, const GxB_FC32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GxB_Matrix_build_FC64(GrB_Matrix C, const GrB_Index *I_, const GrB_Index *J, const GxB_FC64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GxB_Matrix_build_Scalar(GrB_Matrix C, const GrB_Index *I_, const GrB_Index *J, GrB_Scalar scalar, GrB_Index nvals); +GrB_Info GxB_Matrix_build_Scalar_Vector(GrB_Matrix C, const GrB_Vector I_vector, const GrB_Vector J_vector, GrB_Scalar scalar, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_build_Vector(GrB_Matrix C, const GrB_Vector I_vector, const GrB_Vector J_vector, const GrB_Vector X_vector, const GrB_BinaryOp dup, const GrB_Descriptor desc); GrB_Info GxB_Matrix_concat(GrB_Matrix C, const GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Descriptor desc); GrB_Info GxB_Matrix_deserialize(GrB_Matrix *C, GrB_Type type, const void *blob, GrB_Index blob_size, const GrB_Descriptor desc); GrB_Info GxB_Matrix_diag(GrB_Matrix C, const GrB_Vector v, int64_t k, const GrB_Descriptor desc); GrB_Info GxB_Matrix_eWiseUnion(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Matrix A, const GrB_Scalar alpha, const GrB_Matrix B, const GrB_Scalar beta, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_export_BitmapC(GrB_Matrix *, GrB_Type *, GrB_Index *, GrB_Index *, int8_t **, void **, GrB_Index *, GrB_Index *, bool *, GrB_Index *, const GrB_Descriptor); -GrB_Info GxB_Matrix_export_BitmapR(GrB_Matrix *, GrB_Type *, GrB_Index *, GrB_Index *, int8_t **, void **, GrB_Index *, GrB_Index *, bool *, GrB_Index *, const GrB_Descriptor); -GrB_Info GxB_Matrix_export_CSC(GrB_Matrix *, GrB_Type *, GrB_Index *, GrB_Index *, GrB_Index **, GrB_Index **, void **, GrB_Index *, GrB_Index *, GrB_Index *, bool *, bool *, const GrB_Descriptor); -GrB_Info GxB_Matrix_export_CSR(GrB_Matrix *, GrB_Type *, GrB_Index *, GrB_Index *, GrB_Index **, GrB_Index **, void **, GrB_Index *, GrB_Index *, GrB_Index *, bool *, bool *, const GrB_Descriptor); -GrB_Info GxB_Matrix_export_FC32(GrB_Index *Ap, GrB_Index *Ai, GxB_FC32_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -GrB_Info GxB_Matrix_export_FC64(GrB_Index *Ap, GrB_Index *Ai, GxB_FC64_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -GrB_Info GxB_Matrix_export_FullC(GrB_Matrix *, GrB_Type *, GrB_Index *, GrB_Index *, void **, GrB_Index *, bool *, const GrB_Descriptor); -GrB_Info GxB_Matrix_export_FullR(GrB_Matrix *, GrB_Type *, GrB_Index *, GrB_Index *, void **, GrB_Index *, bool *, const GrB_Descriptor); -GrB_Info GxB_Matrix_export_HyperCSC(GrB_Matrix *, GrB_Type *, GrB_Index *, GrB_Index *, GrB_Index **, GrB_Index **, GrB_Index **, void **, GrB_Index *, GrB_Index *, GrB_Index *, GrB_Index *, bool *, GrB_Index *, bool *, const GrB_Descriptor); -GrB_Info GxB_Matrix_export_HyperCSR(GrB_Matrix *, GrB_Type *, GrB_Index *, GrB_Index *, GrB_Index **, GrB_Index **, GrB_Index **, void **, GrB_Index *, GrB_Index *, GrB_Index *, GrB_Index *, bool *, GrB_Index *, bool *, const GrB_Descriptor); +GrB_Info GxB_Matrix_export_BitmapC(GrB_Matrix *, GrB_Type *, uint64_t *, uint64_t *, int8_t **, void **, uint64_t *, uint64_t *, bool *, uint64_t *, const GrB_Descriptor); +GrB_Info GxB_Matrix_export_BitmapR(GrB_Matrix *, GrB_Type *, uint64_t *, uint64_t *, int8_t **, void **, uint64_t *, uint64_t *, bool *, uint64_t *, const GrB_Descriptor); +GrB_Info GxB_Matrix_export_CSC(GrB_Matrix *, GrB_Type *, uint64_t *, uint64_t *, uint64_t **, uint64_t **, void **, uint64_t *, uint64_t *, uint64_t *, bool *, bool *, const GrB_Descriptor); +GrB_Info GxB_Matrix_export_CSR(GrB_Matrix *, GrB_Type *, uint64_t *, uint64_t *, uint64_t **, uint64_t **, void **, uint64_t *, uint64_t *, uint64_t *, bool *, bool *, const GrB_Descriptor); +GrB_Info GxB_Matrix_export_FC32(GrB_Index *Ap, GrB_Index *Ai, GxB_FC32_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, int format, GrB_Matrix A); +GrB_Info GxB_Matrix_export_FC64(GrB_Index *Ap, GrB_Index *Ai, GxB_FC64_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, int format, GrB_Matrix A); +GrB_Info GxB_Matrix_export_FullC(GrB_Matrix *, GrB_Type *, uint64_t *, uint64_t *, void **, uint64_t *, bool *, const GrB_Descriptor); +GrB_Info GxB_Matrix_export_FullR(GrB_Matrix *, GrB_Type *, uint64_t *, uint64_t *, void **, uint64_t *, bool *, const GrB_Descriptor); +GrB_Info GxB_Matrix_export_HyperCSC(GrB_Matrix *, GrB_Type *, uint64_t *, uint64_t *, uint64_t **, uint64_t **, uint64_t **, void **, uint64_t *, uint64_t *, uint64_t *, uint64_t *, bool *, uint64_t *, bool *, const GrB_Descriptor); +GrB_Info GxB_Matrix_export_HyperCSR(GrB_Matrix *, GrB_Type *, uint64_t *, uint64_t *, uint64_t **, uint64_t **, uint64_t **, void **, uint64_t *, uint64_t *, uint64_t *, uint64_t *, bool *, uint64_t *, bool *, const GrB_Descriptor); GrB_Info GxB_Matrix_extractElement_FC32(GxB_FC32_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); GrB_Info GxB_Matrix_extractElement_FC64(GxB_FC64_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -GrB_Info GxB_Matrix_extractTuples_FC32(GrB_Index *Ilist, GrB_Index *J, GxB_FC32_t *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GxB_Matrix_extractTuples_FC64(GrB_Index *Ilist, GrB_Index *J, GxB_FC64_t *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GxB_Matrix_fprint(GrB_Matrix A, const char *name, GxB_Print_Level pr, FILE *f); -GrB_Info GxB_Matrix_import_BitmapC(GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, int8_t **, void **, GrB_Index, GrB_Index, bool, GrB_Index, const GrB_Descriptor); -GrB_Info GxB_Matrix_import_BitmapR(GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, int8_t **, void **, GrB_Index, GrB_Index, bool, GrB_Index, const GrB_Descriptor); -GrB_Info GxB_Matrix_import_CSC(GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, GrB_Index **, GrB_Index **, void **, GrB_Index, GrB_Index, GrB_Index, bool, bool, const GrB_Descriptor); -GrB_Info GxB_Matrix_import_CSR(GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, GrB_Index **, GrB_Index **, void **, GrB_Index, GrB_Index, GrB_Index, bool, bool, const GrB_Descriptor); -GrB_Info GxB_Matrix_import_FC32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const GxB_FC32_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -GrB_Info GxB_Matrix_import_FC64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const GxB_FC64_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -GrB_Info GxB_Matrix_import_FullC(GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, void **, GrB_Index, bool, const GrB_Descriptor); -GrB_Info GxB_Matrix_import_FullR(GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, void **, GrB_Index, bool, const GrB_Descriptor); -GrB_Info GxB_Matrix_import_HyperCSC(GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, GrB_Index **, GrB_Index **, GrB_Index **, void **, GrB_Index, GrB_Index, GrB_Index, GrB_Index, bool, GrB_Index, bool, const GrB_Descriptor); -GrB_Info GxB_Matrix_import_HyperCSR(GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, GrB_Index **, GrB_Index **, GrB_Index **, void **, GrB_Index, GrB_Index, GrB_Index, GrB_Index, bool, GrB_Index, bool, const GrB_Descriptor); +GrB_Info GxB_Matrix_extractTuples_FC32(GrB_Index *I_, GrB_Index *J, GxB_FC32_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GxB_Matrix_extractTuples_FC64(GrB_Index *I_, GrB_Index *J, GxB_FC64_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GxB_Matrix_extractTuples_Vector(GrB_Vector I_vector, GrB_Vector J_vector, GrB_Vector X_vector, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_extract_Vector(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Vector I_vector, const GrB_Vector J_vector, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_fprint(GrB_Matrix A, const char *name, int pr, FILE *f); +GrB_Info GxB_Matrix_import_BitmapC(GrB_Matrix *, GrB_Type, uint64_t, uint64_t, int8_t **, void **, uint64_t, uint64_t, bool, uint64_t, const GrB_Descriptor); +GrB_Info GxB_Matrix_import_BitmapR(GrB_Matrix *, GrB_Type, uint64_t, uint64_t, int8_t **, void **, uint64_t, uint64_t, bool, uint64_t, const GrB_Descriptor); +GrB_Info GxB_Matrix_import_CSC(GrB_Matrix *, GrB_Type, uint64_t, uint64_t, uint64_t **, uint64_t **, void **, uint64_t, uint64_t, uint64_t, bool, bool, const GrB_Descriptor); +GrB_Info GxB_Matrix_import_CSR(GrB_Matrix *, GrB_Type, uint64_t, uint64_t, uint64_t **, uint64_t **, void **, uint64_t, uint64_t, uint64_t, bool, bool, const GrB_Descriptor); +GrB_Info GxB_Matrix_import_FC32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const GxB_FC32_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, int format); +GrB_Info GxB_Matrix_import_FC64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const GxB_FC64_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, int format); +GrB_Info GxB_Matrix_import_FullC(GrB_Matrix *, GrB_Type, uint64_t, uint64_t, void **, uint64_t, bool, const GrB_Descriptor); +GrB_Info GxB_Matrix_import_FullR(GrB_Matrix *, GrB_Type, uint64_t, uint64_t, void **, uint64_t, bool, const GrB_Descriptor); +GrB_Info GxB_Matrix_import_HyperCSC(GrB_Matrix *, GrB_Type, uint64_t, uint64_t, uint64_t **, uint64_t **, uint64_t **, void **, uint64_t, uint64_t, uint64_t, uint64_t, bool, uint64_t, bool, const GrB_Descriptor); +GrB_Info GxB_Matrix_import_HyperCSR(GrB_Matrix *, GrB_Type, uint64_t, uint64_t, uint64_t **, uint64_t **, uint64_t **, void **, uint64_t, uint64_t, uint64_t, uint64_t, bool, uint64_t, bool, const GrB_Descriptor); GrB_Info GxB_Matrix_isStoredElement(const GrB_Matrix A, GrB_Index i, GrB_Index j); -GrB_Info GxB_Matrix_iso(bool *iso, const GrB_Matrix A); +GrB_Info GxB_Matrix_iso(bool *, const GrB_Matrix); GrB_Info GxB_Matrix_memoryUsage(size_t *size, const GrB_Matrix A); -GrB_Info GxB_Matrix_pack_BitmapC(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_pack_BitmapR(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_pack_CSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_pack_CSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_pack_FullC(GrB_Matrix A, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_pack_FullR(GrB_Matrix A, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_pack_HyperCSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_pack_HyperCSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_pack_BitmapC(GrB_Matrix, int8_t **, void **, uint64_t, uint64_t, bool, uint64_t, const GrB_Descriptor); +GrB_Info GxB_Matrix_pack_BitmapR(GrB_Matrix, int8_t **, void **, uint64_t, uint64_t, bool, uint64_t, const GrB_Descriptor); +GrB_Info GxB_Matrix_pack_CSC(GrB_Matrix, uint64_t **, uint64_t **, void **, uint64_t, uint64_t, uint64_t, bool, bool, const GrB_Descriptor); +GrB_Info GxB_Matrix_pack_CSR(GrB_Matrix, uint64_t **, uint64_t **, void **, uint64_t, uint64_t, uint64_t, bool, bool, const GrB_Descriptor); +GrB_Info GxB_Matrix_pack_FullC(GrB_Matrix, void **, uint64_t, bool, const GrB_Descriptor); +GrB_Info GxB_Matrix_pack_FullR(GrB_Matrix, void **, uint64_t, bool, const GrB_Descriptor); +GrB_Info GxB_Matrix_pack_HyperCSC(GrB_Matrix, uint64_t **, uint64_t **, uint64_t **, void **, uint64_t, uint64_t, uint64_t, uint64_t, bool, uint64_t, bool, const GrB_Descriptor); +GrB_Info GxB_Matrix_pack_HyperCSR(GrB_Matrix, uint64_t **, uint64_t **, uint64_t **, void **, uint64_t, uint64_t, uint64_t, uint64_t, bool, uint64_t, bool, const GrB_Descriptor); GrB_Info GxB_Matrix_reduce_FC32(GxB_FC32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); GrB_Info GxB_Matrix_reduce_FC64(GxB_FC64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); GrB_Info GxB_Matrix_reshape(GrB_Matrix C, bool by_col, GrB_Index nrows_new, GrB_Index ncols_new, const GrB_Descriptor desc); GrB_Info GxB_Matrix_reshapeDup(GrB_Matrix *C, GrB_Matrix A, bool by_col, GrB_Index nrows_new, GrB_Index ncols_new, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_select(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Matrix A, const GrB_Scalar Thunk, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_select(GrB_Matrix, const GrB_Matrix, const GrB_BinaryOp, const GxB_SelectOp, const GrB_Matrix, const GrB_Scalar, const GrB_Descriptor); GrB_Info GxB_Matrix_select_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, GxB_FC32_t y, const GrB_Descriptor desc); GrB_Info GxB_Matrix_select_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, GxB_FC64_t y, const GrB_Descriptor desc); GrB_Info GxB_Matrix_serialize(void **blob_handle, GrB_Index *blob_size_handle, GrB_Matrix A, const GrB_Descriptor desc); @@ -3470,41 +3523,47 @@ GrB_Info GxB_Matrix_setElement_FC32(GrB_Matrix C, GxB_FC32_t x, GrB_Index i, GrB GrB_Info GxB_Matrix_setElement_FC64(GrB_Matrix C, GxB_FC64_t x, GrB_Index i, GrB_Index j); GrB_Info GxB_Matrix_sort(GrB_Matrix C, GrB_Matrix P, GrB_BinaryOp op, GrB_Matrix A, const GrB_Descriptor desc); GrB_Info GxB_Matrix_split(GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Index *Tile_nrows, const GrB_Index *Tile_ncols, const GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, bool x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC32_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, float x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, double x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, void *x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_type(GrB_Type *, const GrB_Matrix); +GrB_Info GxB_Matrix_subassign(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC32_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, float x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, double x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Scalar x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_Scalar_Vector(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Scalar scalar, const GrB_Vector I_vector, const GrB_Vector J_vector, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_Vector(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Vector I_vector, const GrB_Vector J_vector, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_type(GrB_Type *type, const GrB_Matrix A); GrB_Info GxB_Matrix_type_name(char *, const GrB_Matrix); -GrB_Info GxB_Matrix_unpack_BitmapC(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_unpack_BitmapR(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_unpack_CSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_unpack_CSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_unpack_FullC(GrB_Matrix A, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_unpack_FullR(GrB_Matrix A, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_unpack_HyperCSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_unpack_HyperCSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_unpack_BitmapC(GrB_Matrix, int8_t **, void **, uint64_t *, uint64_t *, bool *, uint64_t *, const GrB_Descriptor); +GrB_Info GxB_Matrix_unpack_BitmapR(GrB_Matrix, int8_t **, void **, uint64_t *, uint64_t *, bool *, uint64_t *, const GrB_Descriptor); +GrB_Info GxB_Matrix_unpack_CSC(GrB_Matrix, uint64_t **, uint64_t **, void **, uint64_t *, uint64_t *, uint64_t *, bool *, bool *, const GrB_Descriptor); +GrB_Info GxB_Matrix_unpack_CSR(GrB_Matrix, uint64_t **, uint64_t **, void **, uint64_t *, uint64_t *, uint64_t *, bool *, bool *, const GrB_Descriptor); +GrB_Info GxB_Matrix_unpack_FullC(GrB_Matrix, void **, uint64_t *, bool *, const GrB_Descriptor); +GrB_Info GxB_Matrix_unpack_FullR(GrB_Matrix, void **, uint64_t *, bool *, const GrB_Descriptor); +GrB_Info GxB_Matrix_unpack_HyperCSC(GrB_Matrix, uint64_t **, uint64_t **, uint64_t **, void **, uint64_t *, uint64_t *, uint64_t *, uint64_t *, bool *, uint64_t *, bool *, const GrB_Descriptor); +GrB_Info GxB_Matrix_unpack_HyperCSR(GrB_Matrix, uint64_t **, uint64_t **, uint64_t **, void **, uint64_t *, uint64_t *, uint64_t *, uint64_t *, bool *, uint64_t *, bool *, const GrB_Descriptor); +GrB_Info GxB_Row_assign_Vector(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, GrB_Index i, const GrB_Vector J_vector, const GrB_Descriptor desc); GrB_Info GxB_Row_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, GrB_Index i, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Row_subassign_Vector(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, GrB_Index i, const GrB_Vector J_vector, const GrB_Descriptor desc); GrB_Info GxB_Vector_diag(GrB_Vector v, const GrB_Matrix A, int64_t k, const GrB_Descriptor desc); GrB_Info GxB_colIterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); -GrB_Info GxB_pack_HyperHash(GrB_Matrix A, GrB_Matrix *Y, const GrB_Descriptor desc); +GrB_Info GxB_load_Matrix_from_Container(GrB_Matrix A, GxB_Container Container, const GrB_Descriptor desc); +GrB_Info GxB_pack_HyperHash(GrB_Matrix, GrB_Matrix *, const GrB_Descriptor); GrB_Info GxB_rowIterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); -GrB_Info GxB_unpack_HyperHash(GrB_Matrix A, GrB_Matrix *Y, const GrB_Descriptor desc); +GrB_Info GxB_unload_Matrix_into_Container(GrB_Matrix A, GxB_Container Container, const GrB_Descriptor desc); +GrB_Info GxB_unpack_HyperHash(GrB_Matrix, GrB_Matrix *, const GrB_Descriptor); /* monoid */ -GrB_Info GxB_Monoid_fprint(GrB_Monoid monoid, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_Monoid_fprint(GrB_Monoid monoid, const char *name, int pr, FILE *f); GrB_Info GxB_Monoid_identity(void *, GrB_Monoid); GrB_Info GxB_Monoid_new_FC32(GrB_Monoid *monoid, GrB_BinaryOp op, GxB_FC32_t identity); GrB_Info GxB_Monoid_new_FC64(GrB_Monoid *monoid, GrB_BinaryOp op, GxB_FC64_t identity); @@ -3527,10 +3586,10 @@ GrB_Info GxB_Monoid_terminal_new_UINT64(GrB_Monoid *monoid, GrB_BinaryOp op, uin /* scalar */ GrB_Info GxB_BinaryOp_new_IndexOp(GrB_BinaryOp *binop, GxB_IndexBinaryOp idxbinop, GrB_Scalar theta); -GrB_Info GxB_Context_get_Scalar(GxB_Context, GrB_Scalar, GrB_Field); -GrB_Info GxB_Context_set_Scalar(GxB_Context, GrB_Scalar, GrB_Field); -GrB_Info GxB_IndexBinaryOp_get_Scalar(GxB_IndexBinaryOp, GrB_Scalar, GrB_Field); -GrB_Info GxB_IndexBinaryOp_set_Scalar(GxB_IndexBinaryOp, GrB_Scalar, GrB_Field); +GrB_Info GxB_Context_get_Scalar(GxB_Context, GrB_Scalar, int); +GrB_Info GxB_Context_set_Scalar(GxB_Context, GrB_Scalar, int); +GrB_Info GxB_IndexBinaryOp_get_Scalar(GxB_IndexBinaryOp object, GrB_Scalar, int); +GrB_Info GxB_IndexBinaryOp_set_Scalar(GxB_IndexBinaryOp object, GrB_Scalar, int); GrB_Info GxB_Scalar_clear(GrB_Scalar); GrB_Info GxB_Scalar_dup(GrB_Scalar *, const GrB_Scalar); GrB_Info GxB_Scalar_error(const char **, const GrB_Scalar); @@ -3548,11 +3607,11 @@ GrB_Info GxB_Scalar_extractElement_UINT8(uint8_t *, const GrB_Scalar); GrB_Info GxB_Scalar_extractElement_UINT16(uint16_t *, const GrB_Scalar); GrB_Info GxB_Scalar_extractElement_UINT32(uint32_t *, const GrB_Scalar); GrB_Info GxB_Scalar_extractElement_UINT64(uint64_t *, const GrB_Scalar); -GrB_Info GxB_Scalar_fprint(GrB_Scalar s, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_Scalar_fprint(GrB_Scalar s, const char *name, int pr, FILE *f); GrB_Info GxB_Scalar_free(GrB_Scalar *); GrB_Info GxB_Scalar_memoryUsage(size_t *size, const GrB_Scalar s); GrB_Info GxB_Scalar_new(GrB_Scalar *, GrB_Type); -GrB_Info GxB_Scalar_nvals(GrB_Index *, const GrB_Scalar); +GrB_Info GxB_Scalar_nvals(uint64_t *, const GrB_Scalar); GrB_Info GxB_Scalar_setElement_BOOL(GrB_Scalar, bool); GrB_Info GxB_Scalar_setElement_FC32(GrB_Scalar s, GxB_FC32_t x); GrB_Info GxB_Scalar_setElement_FC64(GrB_Scalar s, GxB_FC64_t x); @@ -3567,30 +3626,30 @@ GrB_Info GxB_Scalar_setElement_UINT8(GrB_Scalar, uint8_t); GrB_Info GxB_Scalar_setElement_UINT16(GrB_Scalar, uint16_t); GrB_Info GxB_Scalar_setElement_UINT32(GrB_Scalar, uint32_t); GrB_Info GxB_Scalar_setElement_UINT64(GrB_Scalar, uint64_t); -GrB_Info GxB_Scalar_type(GrB_Type *, const GrB_Scalar); +GrB_Info GxB_Scalar_type(GrB_Type *type, const GrB_Scalar s); GrB_Info GxB_Scalar_type_name(char *, const GrB_Scalar); GrB_Info GxB_Scalar_wait(GrB_Scalar *); -GrB_Info GxB_Serialized_get_Scalar(const void *, GrB_Scalar, GrB_Field, size_t); +GrB_Info GxB_Serialized_get_Scalar(const void *, GrB_Scalar, int, size_t); /* selectop */ -GrB_Info GxB_SelectOp_fprint(GxB_SelectOp op, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_SelectOp_fprint(GxB_SelectOp, const char *, int, FILE *); GrB_Info GxB_SelectOp_ttype(GrB_Type *, GxB_SelectOp); GrB_Info GxB_SelectOp_xtype(GrB_Type *, GxB_SelectOp); /* semiring */ GrB_Info GxB_Semiring_add(GrB_Monoid *, GrB_Semiring); -GrB_Info GxB_Semiring_fprint(GrB_Semiring semiring, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_Semiring_fprint(GrB_Semiring semiring, const char *name, int pr, FILE *f); GrB_Info GxB_Semiring_multiply(GrB_BinaryOp *, GrB_Semiring); /* type */ -GrB_Info GxB_Type_fprint(GrB_Type type, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_Type_fprint(GrB_Type type, const char *name, int pr, FILE *f); GrB_Info GxB_Type_from_name(GrB_Type *type, const char *type_name); GrB_Info GxB_Type_name(char *, const GrB_Type); GrB_Info GxB_Type_new(GrB_Type *type, size_t sizeof_ctype, const char *type_name, const char *type_defn); GrB_Info GxB_Type_size(size_t *, const GrB_Type); /* unary */ -GrB_Info GxB_UnaryOp_fprint(GrB_UnaryOp unaryop, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_UnaryOp_fprint(GrB_UnaryOp unaryop, const char *name, int pr, FILE *f); GrB_Info GxB_UnaryOp_new(GrB_UnaryOp *unaryop, GxB_unary_function function, GrB_Type ztype, GrB_Type xtype, const char *unop_name, const char *unop_defn); GrB_Info GxB_UnaryOp_xtype(GrB_Type *, GrB_UnaryOp); GrB_Info GxB_UnaryOp_xtype_name(char *, const GrB_UnaryOp); @@ -3599,12 +3658,12 @@ GrB_Info GxB_UnaryOp_ztype_name(char *, const GrB_UnaryOp); /* vector */ GrB_Info GxB_Vector_Iterator_attach(GxB_Iterator iterator, GrB_Vector v, GrB_Descriptor desc); -GrB_Info GxB_Vector_Option_get(GrB_Vector, GxB_Option_Field, ...); -GrB_Info GxB_Vector_Option_get_FP64(GrB_Vector, GxB_Option_Field, double *); -GrB_Info GxB_Vector_Option_get_INT32(GrB_Vector, GxB_Option_Field, int32_t *); -GrB_Info GxB_Vector_Option_set(GrB_Vector, GxB_Option_Field, ...); -GrB_Info GxB_Vector_Option_set_FP64(GrB_Vector, GxB_Option_Field, double); -GrB_Info GxB_Vector_Option_set_INT32(GrB_Vector, GxB_Option_Field, int32_t); +GrB_Info GxB_Vector_Option_get(GrB_Vector, int, ...); +GrB_Info GxB_Vector_Option_get_FP64(GrB_Vector, int, double *); +GrB_Info GxB_Vector_Option_get_INT32(GrB_Vector, int, int32_t *); +GrB_Info GxB_Vector_Option_set(GrB_Vector, int, ...); +GrB_Info GxB_Vector_Option_set_FP64(GrB_Vector, int, double); +GrB_Info GxB_Vector_Option_set_INT32(GrB_Vector, int, int32_t); GrB_Info GxB_Vector_apply_BinaryOp1st(GrB_Vector, const GrB_Vector, const GrB_BinaryOp, const GrB_BinaryOp, const GrB_Scalar, const GrB_Vector, const GrB_Descriptor); GrB_Info GxB_Vector_apply_BinaryOp1st_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC32_t x, const GrB_Vector u, const GrB_Descriptor desc); GrB_Info GxB_Vector_apply_BinaryOp1st_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, GxB_FC64_t x, const GrB_Vector u, const GrB_Descriptor desc); @@ -3613,60 +3672,72 @@ GrB_Info GxB_Vector_apply_BinaryOp2nd_FC32(GrB_Vector w, const GrB_Vector mask, GrB_Info GxB_Vector_apply_BinaryOp2nd_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, GxB_FC64_t y, const GrB_Descriptor desc); GrB_Info GxB_Vector_apply_IndexOp_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, GxB_FC32_t y, const GrB_Descriptor desc); GrB_Info GxB_Vector_apply_IndexOp_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, GxB_FC64_t y, const GrB_Descriptor desc); -GrB_Info GxB_Vector_assign_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GxB_FC32_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_assign_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_build_FC32(GrB_Vector w, const GrB_Index *Ilist, const GxB_FC32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GxB_Vector_build_FC64(GrB_Vector w, const GrB_Index *Ilist, const GxB_FC64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GxB_Vector_build_Scalar(GrB_Vector w, const GrB_Index *Ilist, GrB_Scalar scalar, GrB_Index nvals); +GrB_Info GxB_Vector_assign_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GxB_FC32_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_assign_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_assign_Scalar_Vector(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Scalar x, const GrB_Vector I_vector, const GrB_Descriptor desc); +GrB_Info GxB_Vector_assign_Vector(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Vector I_vector, const GrB_Descriptor desc); +GrB_Info GxB_Vector_build_FC32(GrB_Vector w, const GrB_Index *I_, const GxB_FC32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GxB_Vector_build_FC64(GrB_Vector w, const GrB_Index *I_, const GxB_FC64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GxB_Vector_build_Scalar(GrB_Vector w, const GrB_Index *I_, const GrB_Scalar scalar, GrB_Index nvals); +GrB_Info GxB_Vector_build_Scalar_Vector(GrB_Vector w, const GrB_Vector I_vector, const GrB_Scalar scalar, const GrB_Descriptor desc); +GrB_Info GxB_Vector_build_Vector(GrB_Vector w, const GrB_Vector I_vector, const GrB_Vector X_vector, const GrB_BinaryOp dup, const GrB_Descriptor desc); GrB_Info GxB_Vector_deserialize(GrB_Vector *w, GrB_Type type, const void *blob, GrB_Index blob_size, const GrB_Descriptor desc); GrB_Info GxB_Vector_eWiseUnion(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Vector u, const GrB_Scalar alpha, const GrB_Vector v, const GrB_Scalar beta, const GrB_Descriptor desc); -GrB_Info GxB_Vector_export_Bitmap(GrB_Vector *, GrB_Type *, GrB_Index *, int8_t **, void **, GrB_Index *, GrB_Index *, bool *, GrB_Index *, const GrB_Descriptor); -GrB_Info GxB_Vector_export_CSC(GrB_Vector *, GrB_Type *, GrB_Index *, GrB_Index **, void **, GrB_Index *, GrB_Index *, bool *, GrB_Index *, bool *, const GrB_Descriptor); -GrB_Info GxB_Vector_export_Full(GrB_Vector *, GrB_Type *, GrB_Index *, void **, GrB_Index *, bool *, const GrB_Descriptor); +GrB_Info GxB_Vector_export_Bitmap(GrB_Vector *, GrB_Type *, uint64_t *, int8_t **, void **, uint64_t *, uint64_t *, bool *, uint64_t *, const GrB_Descriptor); +GrB_Info GxB_Vector_export_CSC(GrB_Vector *, GrB_Type *, uint64_t *, uint64_t **, void **, uint64_t *, uint64_t *, bool *, uint64_t *, bool *, const GrB_Descriptor); +GrB_Info GxB_Vector_export_Full(GrB_Vector *, GrB_Type *, uint64_t *, void **, uint64_t *, bool *, const GrB_Descriptor); GrB_Info GxB_Vector_extractElement_FC32(GxB_FC32_t *x, const GrB_Vector v, GrB_Index i); GrB_Info GxB_Vector_extractElement_FC64(GxB_FC64_t *x, const GrB_Vector v, GrB_Index i); -GrB_Info GxB_Vector_extractTuples_FC32(GrB_Index *Ilist, GxB_FC32_t *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GxB_Vector_extractTuples_FC64(GrB_Index *Ilist, GxB_FC64_t *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GxB_Vector_fprint(GrB_Vector v, const char *name, GxB_Print_Level pr, FILE *f); -GrB_Info GxB_Vector_import_Bitmap(GrB_Vector *, GrB_Type, GrB_Index, int8_t **, void **, GrB_Index, GrB_Index, bool, GrB_Index, const GrB_Descriptor); -GrB_Info GxB_Vector_import_CSC(GrB_Vector *, GrB_Type, GrB_Index, GrB_Index **, void **, GrB_Index, GrB_Index, bool, GrB_Index, bool, const GrB_Descriptor); -GrB_Info GxB_Vector_import_Full(GrB_Vector *, GrB_Type, GrB_Index, void **, GrB_Index, bool, const GrB_Descriptor); +GrB_Info GxB_Vector_extractTuples_FC32(GrB_Index *I_, GxB_FC32_t *X, GrB_Index *nvals, const GrB_Vector V); +GrB_Info GxB_Vector_extractTuples_FC64(GrB_Index *I_, GxB_FC64_t *X, GrB_Index *nvals, const GrB_Vector V); +GrB_Info GxB_Vector_extractTuples_Vector(GrB_Vector I_vector, GrB_Vector X_vector, const GrB_Vector V, const GrB_Descriptor desc); +GrB_Info GxB_Vector_extract_Vector(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Vector I_vector, const GrB_Descriptor desc); +GrB_Info GxB_Vector_fprint(GrB_Vector v, const char *name, int pr, FILE *f); +GrB_Info GxB_Vector_import_Bitmap(GrB_Vector *, GrB_Type, uint64_t, int8_t **, void **, uint64_t, uint64_t, bool, uint64_t, const GrB_Descriptor); +GrB_Info GxB_Vector_import_CSC(GrB_Vector *, GrB_Type, uint64_t, uint64_t **, void **, uint64_t, uint64_t, bool, uint64_t, bool, const GrB_Descriptor); +GrB_Info GxB_Vector_import_Full(GrB_Vector *, GrB_Type, uint64_t, void **, uint64_t, bool, const GrB_Descriptor); GrB_Info GxB_Vector_isStoredElement(const GrB_Vector v, GrB_Index i); -GrB_Info GxB_Vector_iso(bool *iso, const GrB_Vector v); +GrB_Info GxB_Vector_iso(bool *, const GrB_Vector); +GrB_Info GxB_Vector_load(GrB_Vector V, void **X, GrB_Type type, uint64_t n, uint64_t X_size, int handling, const GrB_Descriptor desc); GrB_Info GxB_Vector_memoryUsage(size_t *size, const GrB_Vector v); -GrB_Info GxB_Vector_pack_Bitmap(GrB_Vector v, int8_t **vb, void **vx, GrB_Index vb_size, GrB_Index vx_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); -GrB_Info GxB_Vector_pack_CSC(GrB_Vector v, GrB_Index **vi, void **vx, GrB_Index vi_size, GrB_Index vx_size, bool iso, GrB_Index nvals, bool jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Vector_pack_Full(GrB_Vector v, void **vx, GrB_Index vx_size, bool iso, const GrB_Descriptor desc); +GrB_Info GxB_Vector_pack_Bitmap(GrB_Vector, int8_t **, void **, uint64_t, uint64_t, bool, uint64_t, const GrB_Descriptor); +GrB_Info GxB_Vector_pack_CSC(GrB_Vector, uint64_t **, void **, uint64_t, uint64_t, bool, uint64_t, bool, const GrB_Descriptor); +GrB_Info GxB_Vector_pack_Full(GrB_Vector, void **, uint64_t, bool, const GrB_Descriptor); GrB_Info GxB_Vector_reduce_FC32(GxB_FC32_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); GrB_Info GxB_Vector_reduce_FC64(GxB_FC64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -GrB_Info GxB_Vector_select(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Vector u, const GrB_Scalar Thunk, const GrB_Descriptor desc); +GrB_Info GxB_Vector_select(GrB_Vector, const GrB_Vector, const GrB_BinaryOp, const GxB_SelectOp, const GrB_Vector, const GrB_Scalar, const GrB_Descriptor); GrB_Info GxB_Vector_select_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, GxB_FC32_t y, const GrB_Descriptor desc); GrB_Info GxB_Vector_select_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, GxB_FC64_t y, const GrB_Descriptor desc); GrB_Info GxB_Vector_serialize(void **blob_handle, GrB_Index *blob_size_handle, GrB_Vector u, const GrB_Descriptor desc); GrB_Info GxB_Vector_setElement_FC32(GrB_Vector w, GxB_FC32_t x, GrB_Index i); GrB_Info GxB_Vector_setElement_FC64(GrB_Vector w, GxB_FC64_t x, GrB_Index i); GrB_Info GxB_Vector_sort(GrB_Vector w, GrB_Vector p, GrB_BinaryOp op, GrB_Vector u, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, bool x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GxB_FC32_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, float x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, double x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, void *x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_type(GrB_Type *, const GrB_Vector); +GrB_Info GxB_Vector_subassign(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GxB_FC32_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GxB_FC64_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, float x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, double x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Scalar x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_Scalar_Vector(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Scalar scalar, const GrB_Vector I_vector, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_Vector(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Vector I_vector, const GrB_Descriptor desc); +GrB_Info GxB_Vector_type(GrB_Type *type, const GrB_Vector v); GrB_Info GxB_Vector_type_name(char *, const GrB_Vector); -GrB_Info GxB_Vector_unpack_Bitmap(GrB_Vector v, int8_t **vb, void **vx, GrB_Index *vb_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); -GrB_Info GxB_Vector_unpack_CSC(GrB_Vector v, GrB_Index **vi, void **vx, GrB_Index *vi_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, bool *jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Vector_unpack_Full(GrB_Vector v, void **vx, GrB_Index *vx_size, bool *iso, const GrB_Descriptor desc); +GrB_Info GxB_Vector_unload(GrB_Vector V, void **X, GrB_Type *type, uint64_t *n, uint64_t *X_size, int *handling, const GrB_Descriptor desc); +GrB_Info GxB_Vector_unpack_Bitmap(GrB_Vector, int8_t **, void **, uint64_t *, uint64_t *, bool *, uint64_t *, const GrB_Descriptor); +GrB_Info GxB_Vector_unpack_CSC(GrB_Vector, uint64_t **, void **, uint64_t *, uint64_t *, bool *, uint64_t *, bool *, const GrB_Descriptor); +GrB_Info GxB_Vector_unpack_Full(GrB_Vector, void **, uint64_t *, bool *, const GrB_Descriptor); +GrB_Info GxB_load_Vector_from_Container(GrB_Vector V, GxB_Container Container, const GrB_Descriptor desc); +GrB_Info GxB_unload_Vector_into_Container(GrB_Vector V, GxB_Container Container, const GrB_Descriptor desc); /* int DEFINES */ #define GRB_SUBVERSION ... @@ -3705,6 +3776,7 @@ GrB_Info GxB_Vector_unpack_Full(GrB_Vector v, void **vx, GrB_Index *vx_size, boo #define GxB_SPEC_VERSION ... #define GxB_STDC_VERSION ... #define GxB_STRIDE ... +#define GxB_USE_VALUES ... /* char* DEFINES */ extern char *GxB_IMPLEMENTATION_ABOUT_STR; diff --git a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h index 508b60e..86a6798 100644 --- a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h +++ b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h @@ -19,6 +19,7 @@ typedef struct GB_IndexBinaryOp_opaque *GxB_IndexBinaryOp; typedef struct GB_Iterator_opaque *GxB_Iterator; typedef struct GB_Scalar_opaque *GxB_Scalar; typedef struct GB_SelectOp_opaque *GxB_SelectOp; +typedef struct GxB_Container_struct *GxB_Container; /* GxB typedefs (functions) */ typedef void (*GxB_binary_function)(void *, const void *, const void *); @@ -26,6 +27,32 @@ typedef void (*GxB_index_binary_function)(void *, const void *, GrB_Index, GrB_I typedef void (*GxB_index_unary_function)(void *z, const void *x, GrB_Index i, GrB_Index j, const void *y); typedef void (*GxB_unary_function)(void *, const void *); +/* GxB structs */ +struct GxB_Container_struct +{ + uint64_t nrows; + uint64_t ncols; + int64_t nrows_nonempty; + int64_t ncols_nonempty; + uint64_t nvals; + uint64_t u64_future[11]; + int32_t format; + int32_t orientation; + uint32_t u32_future[14]; + GrB_Vector p; + GrB_Vector h; + GrB_Vector b; + GrB_Vector i; + GrB_Vector x; + GrB_Vector vector_future[11]; + GrB_Matrix Y; + GrB_Matrix matrix_future[15]; + bool iso; + bool jumbled; + bool bool_future[30]; + void *void_future[16]; +}; + /* GrB enums */ typedef enum { @@ -36,7 +63,10 @@ typedef enum GxB_AxB_METHOD = 7090, GxB_SORT = 7091, GxB_COMPRESSION = 7092, - GxB_IMPORT = 7093 + GxB_IMPORT = 7093, + GxB_ROWINDEX_LIST = 7094, + GxB_COLINDEX_LIST = 7095, + GxB_VALUE_LIST = 7096 } GrB_Desc_Field; typedef enum @@ -52,45 +82,11 @@ typedef enum GxB_AxB_DOT = 7083, GxB_AxB_HASH = 7084, GxB_AxB_SAXPY = 7085, - GxB_SECURE_IMPORT = 7080 + GxB_SECURE_IMPORT = 7080, + GxB_USE_INDICES = 7060, + GxB_IS_STRIDE = 7061 } GrB_Desc_Value; -typedef enum -{ - GrB_OUTP_FIELD = 0, - GrB_MASK_FIELD = 1, - GrB_INP0_FIELD = 2, - GrB_INP1_FIELD = 3, - GrB_NAME = 10, - GrB_LIBRARY_VER_MAJOR = 11, - GrB_LIBRARY_VER_MINOR = 12, - GrB_LIBRARY_VER_PATCH = 13, - GrB_API_VER_MAJOR = 14, - GrB_API_VER_MINOR = 15, - GrB_API_VER_PATCH = 16, - GrB_BLOCKING_MODE = 17, - GrB_STORAGE_ORIENTATION_HINT = 100, - GrB_EL_TYPE_CODE = 102, - GrB_EL_TYPE_STRING = 106, - GrB_INP0_TYPE_CODE = 103, - GrB_INP1_TYPE_CODE = 104, - GrB_OUTP_TYPE_CODE = 105, - GrB_INP0_TYPE_STRING = 107, - GrB_INP1_TYPE_STRING = 108, - GrB_OUTP_TYPE_STRING = 109, - GrB_SIZE = 110, - GxB_JIT_C_NAME = 7041, - GxB_JIT_C_DEFINITION = 7042, - GxB_MONOID_IDENTITY = 7043, - GxB_MONOID_TERMINAL = 7044, - GxB_MONOID_OPERATOR = 7045, - GxB_SEMIRING_MONOID = 7046, - GxB_SEMIRING_MULTIPLY = 7047, - GxB_THETA_TYPE_CODE = 7050, - GxB_THETA_TYPE_STRING = 7051, - GxB_THETA = 7052 -} GrB_Field; - typedef enum { GrB_CSR_FORMAT = 0, @@ -118,7 +114,9 @@ typedef enum GrB_INVALID_OBJECT = -104, GrB_INDEX_OUT_OF_BOUNDS = -105, GrB_EMPTY_OBJECT = -106, - GxB_JIT_ERROR = -1001 + GxB_JIT_ERROR = -7001, + GxB_GPU_ERROR = -7002, + GxB_OUTPUT_IS_READONLY = -7003 } GrB_Info; typedef enum @@ -185,10 +183,53 @@ typedef enum typedef enum { + GrB_OUTP_FIELD = 0, + GrB_MASK_FIELD = 1, + GrB_INP0_FIELD = 2, + GrB_INP1_FIELD = 3, + GrB_NAME = 10, + GrB_LIBRARY_VER_MAJOR = 11, + GrB_LIBRARY_VER_MINOR = 12, + GrB_LIBRARY_VER_PATCH = 13, + GrB_API_VER_MAJOR = 14, + GrB_API_VER_MINOR = 15, + GrB_API_VER_PATCH = 16, + GrB_BLOCKING_MODE = 17, + GrB_STORAGE_ORIENTATION_HINT = 100, + GrB_EL_TYPE_CODE = 102, + GrB_EL_TYPE_STRING = 106, + GrB_INP0_TYPE_CODE = 103, + GrB_INP1_TYPE_CODE = 104, + GrB_OUTP_TYPE_CODE = 105, + GrB_INP0_TYPE_STRING = 107, + GrB_INP1_TYPE_STRING = 108, + GrB_OUTP_TYPE_STRING = 109, + GrB_SIZE = 110, + GxB_JIT_C_NAME = 7041, + GxB_JIT_C_DEFINITION = 7042, + GxB_MONOID_IDENTITY = 7043, + GxB_MONOID_TERMINAL = 7044, + GxB_MONOID_OPERATOR = 7045, + GxB_SEMIRING_MONOID = 7046, + GxB_SEMIRING_MULTIPLY = 7047, + GxB_THETA_TYPE_CODE = 7050, + GxB_THETA_TYPE_STRING = 7051, + GxB_THETA = 7052, + GxB_ROWINDEX_INTEGER_HINT = 7053, + GxB_COLINDEX_INTEGER_HINT = 7054, + GxB_OFFSET_INTEGER_HINT = 7056, GxB_HYPER_SWITCH = 7000, GxB_HYPER_HASH = 7048, GxB_BITMAP_SWITCH = 7001, GxB_FORMAT = 7002, + GxB_ISO = 7079, + GxB_SPARSITY_CONTROL = 7036, + GxB_ROWINDEX_INTEGER_BITS = 7057, + GxB_COLINDEX_INTEGER_BITS = 7058, + GxB_OFFSET_INTEGER_BITS = 7059, + GxB_SPARSITY_STATUS = 7034, + GxB_IS_READONLY = 7078, + GxB_WILL_WAIT = 7076, GxB_MODE = 7003, GxB_LIBRARY_NAME = 7004, GxB_LIBRARY_VERSION = 7005, @@ -217,6 +258,7 @@ typedef enum GxB_FLUSH = 7021, GxB_MEMORY_POOL = 7022, GxB_PRINT_1BASED = 7023, + GxB_INCLUDE_READONLY_STATISTICS = 7077, GxB_JIT_C_COMPILER_NAME = 7024, GxB_JIT_C_COMPILER_FLAGS = 7025, GxB_JIT_C_LINKER_FLAGS = 7026, @@ -227,9 +269,7 @@ typedef enum GxB_JIT_C_CMAKE_LIBS = 7031, GxB_JIT_USE_CMAKE = 7032, GxB_JIT_ERROR_LOG = 7033, - GxB_JIT_CUDA_PREFACE = 7100, - GxB_SPARSITY_STATUS = 7034, - GxB_SPARSITY_CONTROL = 7036 + GxB_JIT_CUDA_PREFACE = 7100 } GxB_Option_Field; typedef enum @@ -247,10 +287,10 @@ extern const GrB_Global GrB_GLOBAL; extern const uint64_t *GrB_ALL; /* GxB consts */ -extern const GxB_Format_Value GxB_FORMAT_DEFAULT; extern const double GxB_ALWAYS_HYPER; extern const double GxB_HYPER_DEFAULT; extern const double GxB_NEVER_HYPER; +extern const int GxB_FORMAT_DEFAULT; /* GrB objects */ extern GrB_BinaryOp GrB_BAND_INT8; @@ -2545,60 +2585,60 @@ extern GxB_SelectOp GxB_TRIU; ****************/ /* binary */ -GrB_Info GrB_BinaryOp_error(const char **error, const GrB_BinaryOp op); -GrB_Info GrB_BinaryOp_free(GrB_BinaryOp *binaryop); -GrB_Info GrB_BinaryOp_get_INT32(GrB_BinaryOp, int32_t *, GrB_Field); -GrB_Info GrB_BinaryOp_get_SIZE(GrB_BinaryOp, size_t *, GrB_Field); -GrB_Info GrB_BinaryOp_get_String(GrB_BinaryOp, char *, GrB_Field); -GrB_Info GrB_BinaryOp_get_VOID(GrB_BinaryOp, void *, GrB_Field); +GrB_Info GrB_BinaryOp_error(const char **error, const GrB_BinaryOp object); +GrB_Info GrB_BinaryOp_free(GrB_BinaryOp *object); +GrB_Info GrB_BinaryOp_get_INT32(GrB_BinaryOp object, int32_t *, int); +GrB_Info GrB_BinaryOp_get_SIZE(GrB_BinaryOp object, size_t *, int); +GrB_Info GrB_BinaryOp_get_String(GrB_BinaryOp object, char *, int); +GrB_Info GrB_BinaryOp_get_VOID(GrB_BinaryOp object, void *, int); GrB_Info GrB_BinaryOp_new(GrB_BinaryOp *binaryop, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype); -GrB_Info GrB_BinaryOp_set_INT32(GrB_BinaryOp, int32_t, GrB_Field); -GrB_Info GrB_BinaryOp_set_String(GrB_BinaryOp, char *, GrB_Field); -GrB_Info GrB_BinaryOp_set_VOID(GrB_BinaryOp, void *, GrB_Field, size_t); -GrB_Info GrB_BinaryOp_wait(GrB_BinaryOp op, GrB_WaitMode waitmode); +GrB_Info GrB_BinaryOp_set_INT32(GrB_BinaryOp object, int32_t, int); +GrB_Info GrB_BinaryOp_set_String(GrB_BinaryOp object, char *, int); +GrB_Info GrB_BinaryOp_set_VOID(GrB_BinaryOp object, void *, int, size_t); +GrB_Info GrB_BinaryOp_wait(GrB_BinaryOp object, int waitmode); /* core */ -GrB_Info GrB_Global_get_INT32(GrB_Global, int32_t *, GrB_Field); -GrB_Info GrB_Global_get_SIZE(GrB_Global, size_t *, GrB_Field); -GrB_Info GrB_Global_get_String(GrB_Global, char *, GrB_Field); -GrB_Info GrB_Global_get_VOID(GrB_Global, void *, GrB_Field); -GrB_Info GrB_Global_set_INT32(GrB_Global, int32_t, GrB_Field); -GrB_Info GrB_Global_set_String(GrB_Global, char *, GrB_Field); -GrB_Info GrB_Global_set_VOID(GrB_Global, void *, GrB_Field, size_t); +GrB_Info GrB_Global_get_INT32(GrB_Global object, int32_t *, int); +GrB_Info GrB_Global_get_SIZE(GrB_Global object, size_t *, int); +GrB_Info GrB_Global_get_String(GrB_Global object, char *, int); +GrB_Info GrB_Global_get_VOID(GrB_Global object, void *, int); +GrB_Info GrB_Global_set_INT32(GrB_Global object, int32_t, int); +GrB_Info GrB_Global_set_String(GrB_Global object, char *, int); +GrB_Info GrB_Global_set_VOID(GrB_Global object, void *, int, size_t); GrB_Info GrB_finalize(void); GrB_Info GrB_getVersion(unsigned int *, unsigned int *); -GrB_Info GrB_init(GrB_Mode mode); +GrB_Info GrB_init(int mode); /* descriptor */ -GrB_Info GrB_Descriptor_error(const char **error, const GrB_Descriptor d); -GrB_Info GrB_Descriptor_free(GrB_Descriptor *descriptor); -GrB_Info GrB_Descriptor_get_INT32(GrB_Descriptor, int32_t *, GrB_Field); -GrB_Info GrB_Descriptor_get_SIZE(GrB_Descriptor, size_t *, GrB_Field); -GrB_Info GrB_Descriptor_get_String(GrB_Descriptor, char *, GrB_Field); -GrB_Info GrB_Descriptor_get_VOID(GrB_Descriptor, void *, GrB_Field); +GrB_Info GrB_Descriptor_error(const char **error, const GrB_Descriptor object); +GrB_Info GrB_Descriptor_free(GrB_Descriptor *object); +GrB_Info GrB_Descriptor_get_INT32(GrB_Descriptor object, int32_t *, int); +GrB_Info GrB_Descriptor_get_SIZE(GrB_Descriptor object, size_t *, int); +GrB_Info GrB_Descriptor_get_String(GrB_Descriptor object, char *, int); +GrB_Info GrB_Descriptor_get_VOID(GrB_Descriptor object, void *, int); GrB_Info GrB_Descriptor_new(GrB_Descriptor *descriptor); -GrB_Info GrB_Descriptor_set(GrB_Descriptor, GrB_Desc_Field, GrB_Desc_Value); -GrB_Info GrB_Descriptor_set_INT32(GrB_Descriptor, int32_t, GrB_Field); -GrB_Info GrB_Descriptor_set_String(GrB_Descriptor, char *, GrB_Field); -GrB_Info GrB_Descriptor_set_VOID(GrB_Descriptor, void *, GrB_Field, size_t); -GrB_Info GrB_Descriptor_wait(GrB_Descriptor desc, GrB_WaitMode waitmode); +GrB_Info GrB_Descriptor_set(GrB_Descriptor, int, int); +GrB_Info GrB_Descriptor_set_INT32(GrB_Descriptor object, int32_t, int); +GrB_Info GrB_Descriptor_set_String(GrB_Descriptor object, char *, int); +GrB_Info GrB_Descriptor_set_VOID(GrB_Descriptor object, void *, int, size_t); +GrB_Info GrB_Descriptor_wait(GrB_Descriptor object, int waitmode); /* indexunary */ -GrB_Info GrB_IndexUnaryOp_error(const char **error, const GrB_IndexUnaryOp op); -GrB_Info GrB_IndexUnaryOp_free(GrB_IndexUnaryOp *op); -GrB_Info GrB_IndexUnaryOp_get_INT32(GrB_IndexUnaryOp, int32_t *, GrB_Field); -GrB_Info GrB_IndexUnaryOp_get_SIZE(GrB_IndexUnaryOp, size_t *, GrB_Field); -GrB_Info GrB_IndexUnaryOp_get_String(GrB_IndexUnaryOp, char *, GrB_Field); -GrB_Info GrB_IndexUnaryOp_get_VOID(GrB_IndexUnaryOp, void *, GrB_Field); +GrB_Info GrB_IndexUnaryOp_error(const char **error, const GrB_IndexUnaryOp object); +GrB_Info GrB_IndexUnaryOp_free(GrB_IndexUnaryOp *object); +GrB_Info GrB_IndexUnaryOp_get_INT32(GrB_IndexUnaryOp object, int32_t *, int); +GrB_Info GrB_IndexUnaryOp_get_SIZE(GrB_IndexUnaryOp object, size_t *, int); +GrB_Info GrB_IndexUnaryOp_get_String(GrB_IndexUnaryOp object, char *, int); +GrB_Info GrB_IndexUnaryOp_get_VOID(GrB_IndexUnaryOp object, void *, int); GrB_Info GrB_IndexUnaryOp_new(GrB_IndexUnaryOp *op, GxB_index_unary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype); -GrB_Info GrB_IndexUnaryOp_set_INT32(GrB_IndexUnaryOp, int32_t, GrB_Field); -GrB_Info GrB_IndexUnaryOp_set_String(GrB_IndexUnaryOp, char *, GrB_Field); -GrB_Info GrB_IndexUnaryOp_set_VOID(GrB_IndexUnaryOp, void *, GrB_Field, size_t); -GrB_Info GrB_IndexUnaryOp_wait(GrB_IndexUnaryOp op, GrB_WaitMode waitmode); +GrB_Info GrB_IndexUnaryOp_set_INT32(GrB_IndexUnaryOp object, int32_t, int); +GrB_Info GrB_IndexUnaryOp_set_String(GrB_IndexUnaryOp object, char *, int); +GrB_Info GrB_IndexUnaryOp_set_VOID(GrB_IndexUnaryOp object, void *, int, size_t); +GrB_Info GrB_IndexUnaryOp_wait(GrB_IndexUnaryOp object, int waitmode); /* matrix */ -GrB_Info GrB_Col_assign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *Ilist, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); -GrB_Info GrB_Col_extract(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *Ilist, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); +GrB_Info GrB_Col_assign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I_, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); +GrB_Info GrB_Col_extract(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I_, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); GrB_Info GrB_Matrix_apply(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_UnaryOp op, const GrB_Matrix A, const GrB_Descriptor desc); GrB_Info GrB_Matrix_apply_BinaryOp1st_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, bool x, const GrB_Matrix A, const GrB_Descriptor desc); GrB_Info GrB_Matrix_apply_BinaryOp1st_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, float x, const GrB_Matrix A, const GrB_Descriptor desc); @@ -2639,32 +2679,32 @@ GrB_Info GrB_Matrix_apply_IndexOp_UINT8(GrB_Matrix C, const GrB_Matrix Mask, con GrB_Info GrB_Matrix_apply_IndexOp_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint16_t y, const GrB_Descriptor desc); GrB_Info GrB_Matrix_apply_IndexOp_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint32_t y, const GrB_Descriptor desc); GrB_Info GrB_Matrix_apply_IndexOp_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint64_t y, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, bool x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, float x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, double x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, void *x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_assign_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_build_BOOL(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const bool *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_FP32(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const float *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_FP64(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const double *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_INT8(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const int8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_INT16(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const int16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_INT32(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const int32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_INT64(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const int64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_UDT(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const void *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_UINT8(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const uint8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_UINT16(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const uint16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_UINT32(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const uint32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Matrix_build_UINT64(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, const uint64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_assign(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, float x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, double x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Scalar x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_assign_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_build_BOOL(GrB_Matrix C, const GrB_Index *I_, const GrB_Index *J, const bool *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_FP32(GrB_Matrix C, const GrB_Index *I_, const GrB_Index *J, const float *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_FP64(GrB_Matrix C, const GrB_Index *I_, const GrB_Index *J, const double *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_INT8(GrB_Matrix C, const GrB_Index *I_, const GrB_Index *J, const int8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_INT16(GrB_Matrix C, const GrB_Index *I_, const GrB_Index *J, const int16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_INT32(GrB_Matrix C, const GrB_Index *I_, const GrB_Index *J, const int32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_INT64(GrB_Matrix C, const GrB_Index *I_, const GrB_Index *J, const int64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_UDT(GrB_Matrix C, const GrB_Index *I_, const GrB_Index *J, const void *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_UINT8(GrB_Matrix C, const GrB_Index *I_, const GrB_Index *J, const uint8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_UINT16(GrB_Matrix C, const GrB_Index *I_, const GrB_Index *J, const uint16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_UINT32(GrB_Matrix C, const GrB_Index *I_, const GrB_Index *J, const uint32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Matrix_build_UINT64(GrB_Matrix C, const GrB_Index *I_, const GrB_Index *J, const uint64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); GrB_Info GrB_Matrix_clear(GrB_Matrix A); GrB_Info GrB_Matrix_deserialize(GrB_Matrix *C, GrB_Type type, const void *blob, GrB_Index blob_size); GrB_Info GrB_Matrix_diag(GrB_Matrix *C, const GrB_Vector v, int64_t k); @@ -2675,22 +2715,22 @@ GrB_Info GrB_Matrix_eWiseAdd_Semiring(GrB_Matrix C, const GrB_Matrix Mask, const GrB_Info GrB_Matrix_eWiseMult_BinaryOp(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp mult, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); GrB_Info GrB_Matrix_eWiseMult_Monoid(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); GrB_Info GrB_Matrix_eWiseMult_Semiring(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_error(const char **error, const GrB_Matrix A); -GrB_Info GrB_Matrix_exportHint(GrB_Format *format, GrB_Matrix A); -GrB_Info GrB_Matrix_exportSize(GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -GrB_Info GrB_Matrix_export_BOOL(GrB_Index *Ap, GrB_Index *Ai, bool *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -GrB_Info GrB_Matrix_export_FP32(GrB_Index *Ap, GrB_Index *Ai, float *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -GrB_Info GrB_Matrix_export_FP64(GrB_Index *Ap, GrB_Index *Ai, double *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -GrB_Info GrB_Matrix_export_INT8(GrB_Index *Ap, GrB_Index *Ai, int8_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -GrB_Info GrB_Matrix_export_INT16(GrB_Index *Ap, GrB_Index *Ai, int16_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -GrB_Info GrB_Matrix_export_INT32(GrB_Index *Ap, GrB_Index *Ai, int32_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -GrB_Info GrB_Matrix_export_INT64(GrB_Index *Ap, GrB_Index *Ai, int64_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -GrB_Info GrB_Matrix_export_UDT(GrB_Index *Ap, GrB_Index *Ai, void *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -GrB_Info GrB_Matrix_export_UINT8(GrB_Index *Ap, GrB_Index *Ai, uint8_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -GrB_Info GrB_Matrix_export_UINT16(GrB_Index *Ap, GrB_Index *Ai, uint16_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -GrB_Info GrB_Matrix_export_UINT32(GrB_Index *Ap, GrB_Index *Ai, uint32_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -GrB_Info GrB_Matrix_export_UINT64(GrB_Index *Ap, GrB_Index *Ai, uint64_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, GrB_Format format, GrB_Matrix A); -GrB_Info GrB_Matrix_extract(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_error(const char **error, const GrB_Matrix object); +GrB_Info GrB_Matrix_exportHint(int *format, GrB_Matrix A); +GrB_Info GrB_Matrix_exportSize(GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, int format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_BOOL(GrB_Index *Ap, GrB_Index *Ai, bool *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, int format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_FP32(GrB_Index *Ap, GrB_Index *Ai, float *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, int format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_FP64(GrB_Index *Ap, GrB_Index *Ai, double *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, int format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_INT8(GrB_Index *Ap, GrB_Index *Ai, int8_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, int format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_INT16(GrB_Index *Ap, GrB_Index *Ai, int16_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, int format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_INT32(GrB_Index *Ap, GrB_Index *Ai, int32_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, int format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_INT64(GrB_Index *Ap, GrB_Index *Ai, int64_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, int format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_UDT(GrB_Index *Ap, GrB_Index *Ai, void *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, int format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_UINT8(GrB_Index *Ap, GrB_Index *Ai, uint8_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, int format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_UINT16(GrB_Index *Ap, GrB_Index *Ai, uint16_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, int format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_UINT32(GrB_Index *Ap, GrB_Index *Ai, uint32_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, int format, GrB_Matrix A); +GrB_Info GrB_Matrix_export_UINT64(GrB_Index *Ap, GrB_Index *Ai, uint64_t *Ax, GrB_Index *Ap_len, GrB_Index *Ai_len, GrB_Index *Ax_len, int format, GrB_Matrix A); +GrB_Info GrB_Matrix_extract(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); GrB_Info GrB_Matrix_extractElement_BOOL(bool *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); GrB_Info GrB_Matrix_extractElement_FP32(float *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); GrB_Info GrB_Matrix_extractElement_FP64(double *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); @@ -2704,36 +2744,36 @@ GrB_Info GrB_Matrix_extractElement_UINT8(uint8_t *x, const GrB_Matrix A, GrB_Ind GrB_Info GrB_Matrix_extractElement_UINT16(uint16_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); GrB_Info GrB_Matrix_extractElement_UINT32(uint32_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); GrB_Info GrB_Matrix_extractElement_UINT64(uint64_t *x, const GrB_Matrix A, GrB_Index i, GrB_Index j); -GrB_Info GrB_Matrix_extractTuples_BOOL(GrB_Index *Ilist, GrB_Index *J, bool *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_FP32(GrB_Index *Ilist, GrB_Index *J, float *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_FP64(GrB_Index *Ilist, GrB_Index *J, double *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_INT8(GrB_Index *Ilist, GrB_Index *J, int8_t *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_INT16(GrB_Index *Ilist, GrB_Index *J, int16_t *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_INT32(GrB_Index *Ilist, GrB_Index *J, int32_t *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_INT64(GrB_Index *Ilist, GrB_Index *J, int64_t *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_UDT(GrB_Index *Ilist, GrB_Index *J, void *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_UINT8(GrB_Index *Ilist, GrB_Index *J, uint8_t *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_UINT16(GrB_Index *Ilist, GrB_Index *J, uint16_t *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_UINT32(GrB_Index *Ilist, GrB_Index *J, uint32_t *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_extractTuples_UINT64(GrB_Index *Ilist, GrB_Index *J, uint64_t *X, GrB_Index *nvals, const GrB_Matrix A); -GrB_Info GrB_Matrix_free(GrB_Matrix *A); -GrB_Info GrB_Matrix_get_INT32(GrB_Matrix, int32_t *, GrB_Field); -GrB_Info GrB_Matrix_get_SIZE(GrB_Matrix, size_t *, GrB_Field); -GrB_Info GrB_Matrix_get_Scalar(GrB_Matrix, GrB_Scalar, GrB_Field); -GrB_Info GrB_Matrix_get_String(GrB_Matrix, char *, GrB_Field); -GrB_Info GrB_Matrix_get_VOID(GrB_Matrix, void *, GrB_Field); -GrB_Info GrB_Matrix_import_BOOL(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const bool *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -GrB_Info GrB_Matrix_import_FP32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const float *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -GrB_Info GrB_Matrix_import_FP64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const double *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -GrB_Info GrB_Matrix_import_INT8(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int8_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -GrB_Info GrB_Matrix_import_INT16(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int16_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -GrB_Info GrB_Matrix_import_INT32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int32_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -GrB_Info GrB_Matrix_import_INT64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int64_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -GrB_Info GrB_Matrix_import_UDT(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const void *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -GrB_Info GrB_Matrix_import_UINT8(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint8_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -GrB_Info GrB_Matrix_import_UINT16(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint16_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -GrB_Info GrB_Matrix_import_UINT32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint32_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); -GrB_Info GrB_Matrix_import_UINT64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint64_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, GrB_Format format); +GrB_Info GrB_Matrix_extractTuples_BOOL(GrB_Index *I_, GrB_Index *J, bool *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_FP32(GrB_Index *I_, GrB_Index *J, float *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_FP64(GrB_Index *I_, GrB_Index *J, double *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_INT8(GrB_Index *I_, GrB_Index *J, int8_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_INT16(GrB_Index *I_, GrB_Index *J, int16_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_INT32(GrB_Index *I_, GrB_Index *J, int32_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_INT64(GrB_Index *I_, GrB_Index *J, int64_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_UDT(GrB_Index *I_, GrB_Index *J, void *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_UINT8(GrB_Index *I_, GrB_Index *J, uint8_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_UINT16(GrB_Index *I_, GrB_Index *J, uint16_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_UINT32(GrB_Index *I_, GrB_Index *J, uint32_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_extractTuples_UINT64(GrB_Index *I_, GrB_Index *J, uint64_t *X, GrB_Index *nvals, const GrB_Matrix A); +GrB_Info GrB_Matrix_free(GrB_Matrix *object); +GrB_Info GrB_Matrix_get_INT32(GrB_Matrix object, int32_t *, int); +GrB_Info GrB_Matrix_get_SIZE(GrB_Matrix object, size_t *, int); +GrB_Info GrB_Matrix_get_Scalar(GrB_Matrix object, GrB_Scalar, int); +GrB_Info GrB_Matrix_get_String(GrB_Matrix object, char *, int); +GrB_Info GrB_Matrix_get_VOID(GrB_Matrix object, void *, int); +GrB_Info GrB_Matrix_import_BOOL(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const bool *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, int format); +GrB_Info GrB_Matrix_import_FP32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const float *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, int format); +GrB_Info GrB_Matrix_import_FP64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const double *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, int format); +GrB_Info GrB_Matrix_import_INT8(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int8_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, int format); +GrB_Info GrB_Matrix_import_INT16(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int16_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, int format); +GrB_Info GrB_Matrix_import_INT32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int32_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, int format); +GrB_Info GrB_Matrix_import_INT64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const int64_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, int format); +GrB_Info GrB_Matrix_import_UDT(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const void *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, int format); +GrB_Info GrB_Matrix_import_UINT8(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint8_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, int format); +GrB_Info GrB_Matrix_import_UINT16(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint16_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, int format); +GrB_Info GrB_Matrix_import_UINT32(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint32_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, int format); +GrB_Info GrB_Matrix_import_UINT64(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const GrB_Index *Ap, const GrB_Index *Ai, const uint64_t *Ax, GrB_Index Ap_len, GrB_Index Ai_len, GrB_Index Ax_len, int format); GrB_Info GrB_Matrix_kronecker_BinaryOp(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); GrB_Info GrB_Matrix_kronecker_Monoid(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); GrB_Info GrB_Matrix_kronecker_Semiring(GrB_Matrix C, const GrB_Matrix M, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); @@ -2742,8 +2782,8 @@ GrB_Info GrB_Matrix_new(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index GrB_Info GrB_Matrix_nrows(GrB_Index *nrows, const GrB_Matrix A); GrB_Info GrB_Matrix_nvals(GrB_Index *nvals, const GrB_Matrix A); GrB_Info GrB_Matrix_reduce_BOOL(bool *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_reduce_BinaryOp(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_reduce_BinaryOp_Scalar(GrB_Scalar S, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GrB_Matrix_reduce_BinaryOp(GrB_Vector, const GrB_Vector, const GrB_BinaryOp, const GrB_BinaryOp, const GrB_Matrix, const GrB_Descriptor); +GrB_Info GrB_Matrix_reduce_BinaryOp_Scalar(GrB_Scalar, const GrB_BinaryOp, const GrB_BinaryOp, const GrB_Matrix, const GrB_Descriptor); GrB_Info GrB_Matrix_reduce_FP32(float *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); GrB_Info GrB_Matrix_reduce_FP64(double *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); GrB_Info GrB_Matrix_reduce_INT8(int8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); @@ -2787,11 +2827,11 @@ GrB_Info GrB_Matrix_setElement_UINT8(GrB_Matrix C, uint8_t x, GrB_Index i, GrB_I GrB_Info GrB_Matrix_setElement_UINT16(GrB_Matrix C, uint16_t x, GrB_Index i, GrB_Index j); GrB_Info GrB_Matrix_setElement_UINT32(GrB_Matrix C, uint32_t x, GrB_Index i, GrB_Index j); GrB_Info GrB_Matrix_setElement_UINT64(GrB_Matrix C, uint64_t x, GrB_Index i, GrB_Index j); -GrB_Info GrB_Matrix_set_INT32(GrB_Matrix, int32_t, GrB_Field); -GrB_Info GrB_Matrix_set_Scalar(GrB_Matrix, GrB_Scalar, GrB_Field); -GrB_Info GrB_Matrix_set_String(GrB_Matrix, char *, GrB_Field); -GrB_Info GrB_Matrix_set_VOID(GrB_Matrix, void *, GrB_Field, size_t); -GrB_Info GrB_Matrix_wait(GrB_Matrix A, GrB_WaitMode waitmode); +GrB_Info GrB_Matrix_set_INT32(GrB_Matrix object, int32_t, int); +GrB_Info GrB_Matrix_set_Scalar(GrB_Matrix object, GrB_Scalar, int); +GrB_Info GrB_Matrix_set_String(GrB_Matrix object, char *, int); +GrB_Info GrB_Matrix_set_VOID(GrB_Matrix object, void *, int, size_t); +GrB_Info GrB_Matrix_wait(GrB_Matrix object, int waitmode); GrB_Info GrB_Row_assign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, GrB_Index i, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); GrB_Info GrB_mxm(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Matrix B, const GrB_Descriptor desc); GrB_Info GrB_mxv(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Matrix A, const GrB_Vector u, const GrB_Descriptor desc); @@ -2799,12 +2839,12 @@ GrB_Info GrB_transpose(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp a GrB_Info GrB_vxm(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Vector u, const GrB_Matrix A, const GrB_Descriptor desc); /* monoid */ -GrB_Info GrB_Monoid_error(const char **error, const GrB_Monoid monoid); -GrB_Info GrB_Monoid_free(GrB_Monoid *monoid); -GrB_Info GrB_Monoid_get_INT32(GrB_Monoid, int32_t *, GrB_Field); -GrB_Info GrB_Monoid_get_SIZE(GrB_Monoid, size_t *, GrB_Field); -GrB_Info GrB_Monoid_get_String(GrB_Monoid, char *, GrB_Field); -GrB_Info GrB_Monoid_get_VOID(GrB_Monoid, void *, GrB_Field); +GrB_Info GrB_Monoid_error(const char **error, const GrB_Monoid object); +GrB_Info GrB_Monoid_free(GrB_Monoid *object); +GrB_Info GrB_Monoid_get_INT32(GrB_Monoid object, int32_t *, int); +GrB_Info GrB_Monoid_get_SIZE(GrB_Monoid object, size_t *, int); +GrB_Info GrB_Monoid_get_String(GrB_Monoid object, char *, int); +GrB_Info GrB_Monoid_get_VOID(GrB_Monoid object, void *, int); GrB_Info GrB_Monoid_new_BOOL(GrB_Monoid *monoid, GrB_BinaryOp op, bool identity); GrB_Info GrB_Monoid_new_FP32(GrB_Monoid *monoid, GrB_BinaryOp op, float identity); GrB_Info GrB_Monoid_new_FP64(GrB_Monoid *monoid, GrB_BinaryOp op, double identity); @@ -2817,25 +2857,25 @@ GrB_Info GrB_Monoid_new_UINT8(GrB_Monoid *monoid, GrB_BinaryOp op, uint8_t ident GrB_Info GrB_Monoid_new_UINT16(GrB_Monoid *monoid, GrB_BinaryOp op, uint16_t identity); GrB_Info GrB_Monoid_new_UINT32(GrB_Monoid *monoid, GrB_BinaryOp op, uint32_t identity); GrB_Info GrB_Monoid_new_UINT64(GrB_Monoid *monoid, GrB_BinaryOp op, uint64_t identity); -GrB_Info GrB_Monoid_set_INT32(GrB_Monoid, int32_t, GrB_Field); -GrB_Info GrB_Monoid_set_String(GrB_Monoid, char *, GrB_Field); -GrB_Info GrB_Monoid_set_VOID(GrB_Monoid, void *, GrB_Field, size_t); -GrB_Info GrB_Monoid_wait(GrB_Monoid monoid, GrB_WaitMode waitmode); +GrB_Info GrB_Monoid_set_INT32(GrB_Monoid object, int32_t, int); +GrB_Info GrB_Monoid_set_String(GrB_Monoid object, char *, int); +GrB_Info GrB_Monoid_set_VOID(GrB_Monoid object, void *, int, size_t); +GrB_Info GrB_Monoid_wait(GrB_Monoid object, int waitmode); /* scalar */ -GrB_Info GrB_BinaryOp_get_Scalar(GrB_BinaryOp, GrB_Scalar, GrB_Field); -GrB_Info GrB_BinaryOp_set_Scalar(GrB_BinaryOp, GrB_Scalar, GrB_Field); -GrB_Info GrB_Descriptor_get_Scalar(GrB_Descriptor, GrB_Scalar, GrB_Field); -GrB_Info GrB_Descriptor_set_Scalar(GrB_Descriptor, GrB_Scalar, GrB_Field); -GrB_Info GrB_Global_get_Scalar(GrB_Global, GrB_Scalar, GrB_Field); -GrB_Info GrB_Global_set_Scalar(GrB_Global, GrB_Scalar, GrB_Field); -GrB_Info GrB_IndexUnaryOp_get_Scalar(GrB_IndexUnaryOp, GrB_Scalar, GrB_Field); -GrB_Info GrB_IndexUnaryOp_set_Scalar(GrB_IndexUnaryOp, GrB_Scalar, GrB_Field); -GrB_Info GrB_Monoid_get_Scalar(GrB_Monoid, GrB_Scalar, GrB_Field); -GrB_Info GrB_Monoid_set_Scalar(GrB_Monoid, GrB_Scalar, GrB_Field); +GrB_Info GrB_BinaryOp_get_Scalar(GrB_BinaryOp object, GrB_Scalar, int); +GrB_Info GrB_BinaryOp_set_Scalar(GrB_BinaryOp object, GrB_Scalar, int); +GrB_Info GrB_Descriptor_get_Scalar(GrB_Descriptor object, GrB_Scalar, int); +GrB_Info GrB_Descriptor_set_Scalar(GrB_Descriptor object, GrB_Scalar, int); +GrB_Info GrB_Global_get_Scalar(GrB_Global object, GrB_Scalar, int); +GrB_Info GrB_Global_set_Scalar(GrB_Global object, GrB_Scalar, int); +GrB_Info GrB_IndexUnaryOp_get_Scalar(GrB_IndexUnaryOp object, GrB_Scalar, int); +GrB_Info GrB_IndexUnaryOp_set_Scalar(GrB_IndexUnaryOp object, GrB_Scalar, int); +GrB_Info GrB_Monoid_get_Scalar(GrB_Monoid object, GrB_Scalar, int); +GrB_Info GrB_Monoid_set_Scalar(GrB_Monoid object, GrB_Scalar, int); GrB_Info GrB_Scalar_clear(GrB_Scalar s); GrB_Info GrB_Scalar_dup(GrB_Scalar *s, const GrB_Scalar t); -GrB_Info GrB_Scalar_error(const char **error, const GrB_Scalar s); +GrB_Info GrB_Scalar_error(const char **error, const GrB_Scalar object); GrB_Info GrB_Scalar_extractElement_BOOL(bool *x, const GrB_Scalar s); GrB_Info GrB_Scalar_extractElement_FP32(float *x, const GrB_Scalar s); GrB_Info GrB_Scalar_extractElement_FP64(double *x, const GrB_Scalar s); @@ -2848,12 +2888,12 @@ GrB_Info GrB_Scalar_extractElement_UINT8(uint8_t *x, const GrB_Scalar s); GrB_Info GrB_Scalar_extractElement_UINT16(uint16_t *x, const GrB_Scalar s); GrB_Info GrB_Scalar_extractElement_UINT32(uint32_t *x, const GrB_Scalar s); GrB_Info GrB_Scalar_extractElement_UINT64(uint64_t *x, const GrB_Scalar s); -GrB_Info GrB_Scalar_free(GrB_Scalar *s); -GrB_Info GrB_Scalar_get_INT32(GrB_Scalar, int32_t *, GrB_Field); -GrB_Info GrB_Scalar_get_SIZE(GrB_Scalar, size_t *, GrB_Field); -GrB_Info GrB_Scalar_get_Scalar(GrB_Scalar, GrB_Scalar, GrB_Field); -GrB_Info GrB_Scalar_get_String(GrB_Scalar, char *, GrB_Field); -GrB_Info GrB_Scalar_get_VOID(GrB_Scalar, void *, GrB_Field); +GrB_Info GrB_Scalar_free(GrB_Scalar *object); +GrB_Info GrB_Scalar_get_INT32(GrB_Scalar object, int32_t *, int); +GrB_Info GrB_Scalar_get_SIZE(GrB_Scalar object, size_t *, int); +GrB_Info GrB_Scalar_get_Scalar(GrB_Scalar object, GrB_Scalar, int); +GrB_Info GrB_Scalar_get_String(GrB_Scalar object, char *, int); +GrB_Info GrB_Scalar_get_VOID(GrB_Scalar object, void *, int); GrB_Info GrB_Scalar_new(GrB_Scalar *s, GrB_Type type); GrB_Info GrB_Scalar_nvals(GrB_Index *nvals, const GrB_Scalar s); GrB_Info GrB_Scalar_setElement_BOOL(GrB_Scalar s, bool x); @@ -2868,56 +2908,56 @@ GrB_Info GrB_Scalar_setElement_UINT8(GrB_Scalar s, uint8_t x); GrB_Info GrB_Scalar_setElement_UINT16(GrB_Scalar s, uint16_t x); GrB_Info GrB_Scalar_setElement_UINT32(GrB_Scalar s, uint32_t x); GrB_Info GrB_Scalar_setElement_UINT64(GrB_Scalar s, uint64_t x); -GrB_Info GrB_Scalar_set_INT32(GrB_Scalar, int32_t, GrB_Field); -GrB_Info GrB_Scalar_set_Scalar(GrB_Scalar, GrB_Scalar, GrB_Field); -GrB_Info GrB_Scalar_set_String(GrB_Scalar, char *, GrB_Field); -GrB_Info GrB_Scalar_set_VOID(GrB_Scalar, void *, GrB_Field, size_t); -GrB_Info GrB_Scalar_wait(GrB_Scalar s, GrB_WaitMode waitmode); -GrB_Info GrB_Semiring_get_Scalar(GrB_Semiring, GrB_Scalar, GrB_Field); -GrB_Info GrB_Semiring_set_Scalar(GrB_Semiring, GrB_Scalar, GrB_Field); -GrB_Info GrB_Type_get_Scalar(GrB_Type, GrB_Scalar, GrB_Field); -GrB_Info GrB_Type_set_Scalar(GrB_Type, GrB_Scalar, GrB_Field); -GrB_Info GrB_UnaryOp_get_Scalar(GrB_UnaryOp, GrB_Scalar, GrB_Field); -GrB_Info GrB_UnaryOp_set_Scalar(GrB_UnaryOp, GrB_Scalar, GrB_Field); +GrB_Info GrB_Scalar_set_INT32(GrB_Scalar object, int32_t, int); +GrB_Info GrB_Scalar_set_Scalar(GrB_Scalar object, GrB_Scalar, int); +GrB_Info GrB_Scalar_set_String(GrB_Scalar object, char *, int); +GrB_Info GrB_Scalar_set_VOID(GrB_Scalar object, void *, int, size_t); +GrB_Info GrB_Scalar_wait(GrB_Scalar object, int waitmode); +GrB_Info GrB_Semiring_get_Scalar(GrB_Semiring object, GrB_Scalar, int); +GrB_Info GrB_Semiring_set_Scalar(GrB_Semiring object, GrB_Scalar, int); +GrB_Info GrB_Type_get_Scalar(GrB_Type object, GrB_Scalar, int); +GrB_Info GrB_Type_set_Scalar(GrB_Type object, GrB_Scalar, int); +GrB_Info GrB_UnaryOp_get_Scalar(GrB_UnaryOp object, GrB_Scalar, int); +GrB_Info GrB_UnaryOp_set_Scalar(GrB_UnaryOp object, GrB_Scalar, int); /* semiring */ -GrB_Info GrB_Semiring_error(const char **error, const GrB_Semiring semiring); -GrB_Info GrB_Semiring_free(GrB_Semiring *semiring); -GrB_Info GrB_Semiring_get_INT32(GrB_Semiring, int32_t *, GrB_Field); -GrB_Info GrB_Semiring_get_SIZE(GrB_Semiring, size_t *, GrB_Field); -GrB_Info GrB_Semiring_get_String(GrB_Semiring, char *, GrB_Field); -GrB_Info GrB_Semiring_get_VOID(GrB_Semiring, void *, GrB_Field); +GrB_Info GrB_Semiring_error(const char **error, const GrB_Semiring object); +GrB_Info GrB_Semiring_free(GrB_Semiring *object); +GrB_Info GrB_Semiring_get_INT32(GrB_Semiring object, int32_t *, int); +GrB_Info GrB_Semiring_get_SIZE(GrB_Semiring object, size_t *, int); +GrB_Info GrB_Semiring_get_String(GrB_Semiring object, char *, int); +GrB_Info GrB_Semiring_get_VOID(GrB_Semiring object, void *, int); GrB_Info GrB_Semiring_new(GrB_Semiring *semiring, GrB_Monoid add, GrB_BinaryOp multiply); -GrB_Info GrB_Semiring_set_INT32(GrB_Semiring, int32_t, GrB_Field); -GrB_Info GrB_Semiring_set_String(GrB_Semiring, char *, GrB_Field); -GrB_Info GrB_Semiring_set_VOID(GrB_Semiring, void *, GrB_Field, size_t); -GrB_Info GrB_Semiring_wait(GrB_Semiring semiring, GrB_WaitMode waitmode); +GrB_Info GrB_Semiring_set_INT32(GrB_Semiring object, int32_t, int); +GrB_Info GrB_Semiring_set_String(GrB_Semiring object, char *, int); +GrB_Info GrB_Semiring_set_VOID(GrB_Semiring object, void *, int, size_t); +GrB_Info GrB_Semiring_wait(GrB_Semiring object, int waitmode); /* type */ -GrB_Info GrB_Type_error(const char **error, const GrB_Type type); -GrB_Info GrB_Type_free(GrB_Type *type); -GrB_Info GrB_Type_get_INT32(GrB_Type, int32_t *, GrB_Field); -GrB_Info GrB_Type_get_SIZE(GrB_Type, size_t *, GrB_Field); -GrB_Info GrB_Type_get_String(GrB_Type, char *, GrB_Field); -GrB_Info GrB_Type_get_VOID(GrB_Type, void *, GrB_Field); +GrB_Info GrB_Type_error(const char **error, const GrB_Type object); +GrB_Info GrB_Type_free(GrB_Type *object); +GrB_Info GrB_Type_get_INT32(GrB_Type object, int32_t *, int); +GrB_Info GrB_Type_get_SIZE(GrB_Type object, size_t *, int); +GrB_Info GrB_Type_get_String(GrB_Type object, char *, int); +GrB_Info GrB_Type_get_VOID(GrB_Type object, void *, int); GrB_Info GrB_Type_new(GrB_Type *type, size_t sizeof_ctype); -GrB_Info GrB_Type_set_INT32(GrB_Type, int32_t, GrB_Field); -GrB_Info GrB_Type_set_String(GrB_Type, char *, GrB_Field); -GrB_Info GrB_Type_set_VOID(GrB_Type, void *, GrB_Field, size_t); -GrB_Info GrB_Type_wait(GrB_Type type, GrB_WaitMode waitmode); +GrB_Info GrB_Type_set_INT32(GrB_Type object, int32_t, int); +GrB_Info GrB_Type_set_String(GrB_Type object, char *, int); +GrB_Info GrB_Type_set_VOID(GrB_Type object, void *, int, size_t); +GrB_Info GrB_Type_wait(GrB_Type object, int waitmode); /* unary */ -GrB_Info GrB_UnaryOp_error(const char **error, const GrB_UnaryOp op); -GrB_Info GrB_UnaryOp_free(GrB_UnaryOp *unaryop); -GrB_Info GrB_UnaryOp_get_INT32(GrB_UnaryOp, int32_t *, GrB_Field); -GrB_Info GrB_UnaryOp_get_SIZE(GrB_UnaryOp, size_t *, GrB_Field); -GrB_Info GrB_UnaryOp_get_String(GrB_UnaryOp, char *, GrB_Field); -GrB_Info GrB_UnaryOp_get_VOID(GrB_UnaryOp, void *, GrB_Field); +GrB_Info GrB_UnaryOp_error(const char **error, const GrB_UnaryOp object); +GrB_Info GrB_UnaryOp_free(GrB_UnaryOp *object); +GrB_Info GrB_UnaryOp_get_INT32(GrB_UnaryOp object, int32_t *, int); +GrB_Info GrB_UnaryOp_get_SIZE(GrB_UnaryOp object, size_t *, int); +GrB_Info GrB_UnaryOp_get_String(GrB_UnaryOp object, char *, int); +GrB_Info GrB_UnaryOp_get_VOID(GrB_UnaryOp object, void *, int); GrB_Info GrB_UnaryOp_new(GrB_UnaryOp *unaryop, GxB_unary_function function, GrB_Type ztype, GrB_Type xtype); -GrB_Info GrB_UnaryOp_set_INT32(GrB_UnaryOp, int32_t, GrB_Field); -GrB_Info GrB_UnaryOp_set_String(GrB_UnaryOp, char *, GrB_Field); -GrB_Info GrB_UnaryOp_set_VOID(GrB_UnaryOp, void *, GrB_Field, size_t); -GrB_Info GrB_UnaryOp_wait(GrB_UnaryOp op, GrB_WaitMode waitmode); +GrB_Info GrB_UnaryOp_set_INT32(GrB_UnaryOp object, int32_t, int); +GrB_Info GrB_UnaryOp_set_String(GrB_UnaryOp object, char *, int); +GrB_Info GrB_UnaryOp_set_VOID(GrB_UnaryOp object, void *, int, size_t); +GrB_Info GrB_UnaryOp_wait(GrB_UnaryOp object, int waitmode); /* vector */ GrB_Info GrB_Vector_apply(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_UnaryOp op, const GrB_Vector u, const GrB_Descriptor desc); @@ -2960,32 +3000,32 @@ GrB_Info GrB_Vector_apply_IndexOp_UINT8(GrB_Vector w, const GrB_Vector mask, con GrB_Info GrB_Vector_apply_IndexOp_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint16_t y, const GrB_Descriptor desc); GrB_Info GrB_Vector_apply_IndexOp_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint32_t y, const GrB_Descriptor desc); GrB_Info GrB_Vector_apply_IndexOp_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, uint64_t y, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, bool x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, float x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, double x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, void *x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_assign_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GrB_Vector_build_BOOL(GrB_Vector w, const GrB_Index *Ilist, const bool *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_FP32(GrB_Vector w, const GrB_Index *Ilist, const float *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_FP64(GrB_Vector w, const GrB_Index *Ilist, const double *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_INT8(GrB_Vector w, const GrB_Index *Ilist, const int8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_INT16(GrB_Vector w, const GrB_Index *Ilist, const int16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_INT32(GrB_Vector w, const GrB_Index *Ilist, const int32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_INT64(GrB_Vector w, const GrB_Index *Ilist, const int64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_UDT(GrB_Vector w, const GrB_Index *Ilist, const void *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_UINT8(GrB_Vector w, const GrB_Index *Ilist, const uint8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_UINT16(GrB_Vector w, const GrB_Index *Ilist, const uint16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_UINT32(GrB_Vector w, const GrB_Index *Ilist, const uint32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); -GrB_Info GrB_Vector_build_UINT64(GrB_Vector w, const GrB_Index *Ilist, const uint64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_assign(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, float x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, double x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Scalar x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_assign_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_build_BOOL(GrB_Vector w, const GrB_Index *I_, const bool *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_FP32(GrB_Vector w, const GrB_Index *I_, const float *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_FP64(GrB_Vector w, const GrB_Index *I_, const double *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_INT8(GrB_Vector w, const GrB_Index *I_, const int8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_INT16(GrB_Vector w, const GrB_Index *I_, const int16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_INT32(GrB_Vector w, const GrB_Index *I_, const int32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_INT64(GrB_Vector w, const GrB_Index *I_, const int64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_UDT(GrB_Vector w, const GrB_Index *I_, const void *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_UINT8(GrB_Vector w, const GrB_Index *I_, const uint8_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_UINT16(GrB_Vector w, const GrB_Index *I_, const uint16_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_UINT32(GrB_Vector w, const GrB_Index *I_, const uint32_t *X, GrB_Index nvals, const GrB_BinaryOp dup); +GrB_Info GrB_Vector_build_UINT64(GrB_Vector w, const GrB_Index *I_, const uint64_t *X, GrB_Index nvals, const GrB_BinaryOp dup); GrB_Info GrB_Vector_clear(GrB_Vector v); GrB_Info GrB_Vector_dup(GrB_Vector *w, const GrB_Vector u); GrB_Info GrB_Vector_eWiseAdd_BinaryOp(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); @@ -2994,8 +3034,8 @@ GrB_Info GrB_Vector_eWiseAdd_Semiring(GrB_Vector w, const GrB_Vector mask, const GrB_Info GrB_Vector_eWiseMult_BinaryOp(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp mult, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); GrB_Info GrB_Vector_eWiseMult_Monoid(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); GrB_Info GrB_Vector_eWiseMult_Semiring(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Semiring semiring, const GrB_Vector u, const GrB_Vector v, const GrB_Descriptor desc); -GrB_Info GrB_Vector_error(const char **error, const GrB_Vector v); -GrB_Info GrB_Vector_extract(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GrB_Vector_error(const char **error, const GrB_Vector object); +GrB_Info GrB_Vector_extract(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); GrB_Info GrB_Vector_extractElement_BOOL(bool *x, const GrB_Vector v, GrB_Index i); GrB_Info GrB_Vector_extractElement_FP32(float *x, const GrB_Vector v, GrB_Index i); GrB_Info GrB_Vector_extractElement_FP64(double *x, const GrB_Vector v, GrB_Index i); @@ -3009,28 +3049,28 @@ GrB_Info GrB_Vector_extractElement_UINT8(uint8_t *x, const GrB_Vector v, GrB_Ind GrB_Info GrB_Vector_extractElement_UINT16(uint16_t *x, const GrB_Vector v, GrB_Index i); GrB_Info GrB_Vector_extractElement_UINT32(uint32_t *x, const GrB_Vector v, GrB_Index i); GrB_Info GrB_Vector_extractElement_UINT64(uint64_t *x, const GrB_Vector v, GrB_Index i); -GrB_Info GrB_Vector_extractTuples_BOOL(GrB_Index *Ilist, bool *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_FP32(GrB_Index *Ilist, float *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_FP64(GrB_Index *Ilist, double *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_INT8(GrB_Index *Ilist, int8_t *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_INT16(GrB_Index *Ilist, int16_t *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_INT32(GrB_Index *Ilist, int32_t *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_INT64(GrB_Index *Ilist, int64_t *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_UDT(GrB_Index *Ilist, void *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_UINT8(GrB_Index *Ilist, uint8_t *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_UINT16(GrB_Index *Ilist, uint16_t *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_UINT32(GrB_Index *Ilist, uint32_t *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_extractTuples_UINT64(GrB_Index *Ilist, uint64_t *X, GrB_Index *nvals, const GrB_Vector v); -GrB_Info GrB_Vector_free(GrB_Vector *v); -GrB_Info GrB_Vector_get_INT32(GrB_Vector, int32_t *, GrB_Field); -GrB_Info GrB_Vector_get_SIZE(GrB_Vector, size_t *, GrB_Field); -GrB_Info GrB_Vector_get_Scalar(GrB_Vector, GrB_Scalar, GrB_Field); -GrB_Info GrB_Vector_get_String(GrB_Vector, char *, GrB_Field); -GrB_Info GrB_Vector_get_VOID(GrB_Vector, void *, GrB_Field); +GrB_Info GrB_Vector_extractTuples_BOOL(GrB_Index *I_, bool *X, GrB_Index *nvals, const GrB_Vector V); +GrB_Info GrB_Vector_extractTuples_FP32(GrB_Index *I_, float *X, GrB_Index *nvals, const GrB_Vector V); +GrB_Info GrB_Vector_extractTuples_FP64(GrB_Index *I_, double *X, GrB_Index *nvals, const GrB_Vector V); +GrB_Info GrB_Vector_extractTuples_INT8(GrB_Index *I_, int8_t *X, GrB_Index *nvals, const GrB_Vector V); +GrB_Info GrB_Vector_extractTuples_INT16(GrB_Index *I_, int16_t *X, GrB_Index *nvals, const GrB_Vector V); +GrB_Info GrB_Vector_extractTuples_INT32(GrB_Index *I_, int32_t *X, GrB_Index *nvals, const GrB_Vector V); +GrB_Info GrB_Vector_extractTuples_INT64(GrB_Index *I_, int64_t *X, GrB_Index *nvals, const GrB_Vector V); +GrB_Info GrB_Vector_extractTuples_UDT(GrB_Index *I_, void *X, GrB_Index *nvals, const GrB_Vector V); +GrB_Info GrB_Vector_extractTuples_UINT8(GrB_Index *I_, uint8_t *X, GrB_Index *nvals, const GrB_Vector V); +GrB_Info GrB_Vector_extractTuples_UINT16(GrB_Index *I_, uint16_t *X, GrB_Index *nvals, const GrB_Vector V); +GrB_Info GrB_Vector_extractTuples_UINT32(GrB_Index *I_, uint32_t *X, GrB_Index *nvals, const GrB_Vector V); +GrB_Info GrB_Vector_extractTuples_UINT64(GrB_Index *I_, uint64_t *X, GrB_Index *nvals, const GrB_Vector V); +GrB_Info GrB_Vector_free(GrB_Vector *object); +GrB_Info GrB_Vector_get_INT32(GrB_Vector object, int32_t *, int); +GrB_Info GrB_Vector_get_SIZE(GrB_Vector object, size_t *, int); +GrB_Info GrB_Vector_get_Scalar(GrB_Vector object, GrB_Scalar, int); +GrB_Info GrB_Vector_get_String(GrB_Vector object, char *, int); +GrB_Info GrB_Vector_get_VOID(GrB_Vector object, void *, int); GrB_Info GrB_Vector_new(GrB_Vector *v, GrB_Type type, GrB_Index n); GrB_Info GrB_Vector_nvals(GrB_Index *nvals, const GrB_Vector v); GrB_Info GrB_Vector_reduce_BOOL(bool *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); -GrB_Info GrB_Vector_reduce_BinaryOp_Scalar(GrB_Scalar c, const GrB_BinaryOp accum, const GrB_BinaryOp op, const GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GrB_Vector_reduce_BinaryOp_Scalar(GrB_Scalar, const GrB_BinaryOp, const GrB_BinaryOp, const GrB_Vector, const GrB_Descriptor); GrB_Info GrB_Vector_reduce_FP32(float *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); GrB_Info GrB_Vector_reduce_FP64(double *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); GrB_Info GrB_Vector_reduce_INT8(int8_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Vector u, const GrB_Descriptor desc); @@ -3071,12 +3111,12 @@ GrB_Info GrB_Vector_setElement_UINT8(GrB_Vector w, uint8_t x, GrB_Index i); GrB_Info GrB_Vector_setElement_UINT16(GrB_Vector w, uint16_t x, GrB_Index i); GrB_Info GrB_Vector_setElement_UINT32(GrB_Vector w, uint32_t x, GrB_Index i); GrB_Info GrB_Vector_setElement_UINT64(GrB_Vector w, uint64_t x, GrB_Index i); -GrB_Info GrB_Vector_set_INT32(GrB_Vector, int32_t, GrB_Field); -GrB_Info GrB_Vector_set_Scalar(GrB_Vector, GrB_Scalar, GrB_Field); -GrB_Info GrB_Vector_set_String(GrB_Vector, char *, GrB_Field); -GrB_Info GrB_Vector_set_VOID(GrB_Vector, void *, GrB_Field, size_t); +GrB_Info GrB_Vector_set_INT32(GrB_Vector object, int32_t, int); +GrB_Info GrB_Vector_set_Scalar(GrB_Vector object, GrB_Scalar, int); +GrB_Info GrB_Vector_set_String(GrB_Vector object, char *, int); +GrB_Info GrB_Vector_set_VOID(GrB_Vector object, void *, int, size_t); GrB_Info GrB_Vector_size(GrB_Index *n, const GrB_Vector v); -GrB_Info GrB_Vector_wait(GrB_Vector v, GrB_WaitMode waitmode); +GrB_Info GrB_Vector_wait(GrB_Vector object, int waitmode); /*************** * GB functions * @@ -3085,17 +3125,17 @@ GrB_Info GrB_Vector_wait(GrB_Vector v, GrB_WaitMode waitmode); /* iterator */ GrB_Info GB_Iterator_rc_bitmap_next(GxB_Iterator iterator); GrB_Info GB_Iterator_rc_seek(GxB_Iterator iterator, GrB_Index j, bool jth_vector); -GrB_Info GB_Vector_Iterator_bitmap_seek(GxB_Iterator iterator, GrB_Index unused); +GrB_Info GB_Vector_Iterator_bitmap_seek(GxB_Iterator iterator); /* matrix */ -GrB_Info GB_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GxB_Format_Value format, GrB_Descriptor desc); +GrB_Info GB_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, int format, GrB_Descriptor desc); /**************** * GxB functions * ****************/ /* binary */ -GrB_Info GxB_BinaryOp_fprint(GrB_BinaryOp binaryop, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_BinaryOp_fprint(GrB_BinaryOp binaryop, const char *name, int pr, FILE *f); GrB_Info GxB_BinaryOp_new(GrB_BinaryOp *op, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *binop_name, const char *binop_defn); GrB_Info GxB_BinaryOp_xtype(GrB_Type *, GrB_BinaryOp); GrB_Info GxB_BinaryOp_xtype_name(char *, const GrB_BinaryOp); @@ -3104,75 +3144,79 @@ GrB_Info GxB_BinaryOp_ytype_name(char *, const GrB_BinaryOp); GrB_Info GxB_BinaryOp_ztype(GrB_Type *, GrB_BinaryOp); GrB_Info GxB_BinaryOp_ztype_name(char *, const GrB_BinaryOp); +/* container */ +GrB_Info GxB_Container_free(GxB_Container *object); +GrB_Info GxB_Container_new(GxB_Container *Container); + /* context */ GrB_Info GxB_Context_disengage(GxB_Context Context); GrB_Info GxB_Context_engage(GxB_Context Context); -GrB_Info GxB_Context_error(const char **error, const GxB_Context c); -GrB_Info GxB_Context_fprint(GxB_Context Context, const char *name, GxB_Print_Level pr, FILE *f); -GrB_Info GxB_Context_free(GxB_Context *Context); -GrB_Info GxB_Context_get(GxB_Context, GxB_Context_Field, ...); -GrB_Info GxB_Context_get_FP64(GxB_Context, GxB_Context_Field, double *); -GrB_Info GxB_Context_get_INT(GxB_Context, int32_t *, GrB_Field); -GrB_Info GxB_Context_get_INT32(GxB_Context, GxB_Context_Field, int32_t *); -GrB_Info GxB_Context_get_SIZE(GxB_Context, size_t *, GrB_Field); -GrB_Info GxB_Context_get_String(GxB_Context, char *, GrB_Field); -GrB_Info GxB_Context_get_VOID(GxB_Context, void *, GrB_Field); +GrB_Info GxB_Context_error(const char **error, const GxB_Context object); +GrB_Info GxB_Context_fprint(GxB_Context Context, const char *name, int pr, FILE *f); +GrB_Info GxB_Context_free(GxB_Context *object); +GrB_Info GxB_Context_get(GxB_Context, int, ...); +GrB_Info GxB_Context_get_FP64(GxB_Context, int, double *); +GrB_Info GxB_Context_get_INT(GxB_Context, int32_t *, int); +GrB_Info GxB_Context_get_INT32(GxB_Context, int, int32_t *); +GrB_Info GxB_Context_get_SIZE(GxB_Context, size_t *, int); +GrB_Info GxB_Context_get_String(GxB_Context, char *, int); +GrB_Info GxB_Context_get_VOID(GxB_Context, void *, int); GrB_Info GxB_Context_new(GxB_Context *Context); -GrB_Info GxB_Context_set(GxB_Context, GxB_Context_Field, ...); -GrB_Info GxB_Context_set_FP64(GxB_Context, GxB_Context_Field, double); -GrB_Info GxB_Context_set_INT(GxB_Context, int32_t, GrB_Field); -GrB_Info GxB_Context_set_INT32(GxB_Context, GxB_Context_Field, int32_t); -GrB_Info GxB_Context_set_String(GxB_Context, char *, GrB_Field); -GrB_Info GxB_Context_set_VOID(GxB_Context, void *, GrB_Field, size_t); -GrB_Info GxB_Context_wait(GxB_Context Context, GrB_WaitMode waitmode); +GrB_Info GxB_Context_set(GxB_Context, int, ...); +GrB_Info GxB_Context_set_FP64(GxB_Context, int, double); +GrB_Info GxB_Context_set_INT(GxB_Context, int32_t, int); +GrB_Info GxB_Context_set_INT32(GxB_Context, int, int32_t); +GrB_Info GxB_Context_set_String(GxB_Context, char *, int); +GrB_Info GxB_Context_set_VOID(GxB_Context, void *, int, size_t); +GrB_Info GxB_Context_wait(GxB_Context object, int waitmode); /* core */ -GrB_Info GxB_Global_Option_get(GxB_Option_Field, ...); -GrB_Info GxB_Global_Option_get_CHAR(GxB_Option_Field, const char **); -GrB_Info GxB_Global_Option_get_FP64(GxB_Option_Field, double *); -GrB_Info GxB_Global_Option_get_FUNCTION(GxB_Option_Field, void **); -GrB_Info GxB_Global_Option_get_INT32(GxB_Option_Field, int32_t *); -GrB_Info GxB_Global_Option_get_INT64(GxB_Option_Field, int64_t *); -GrB_Info GxB_Global_Option_set(GxB_Option_Field, ...); -GrB_Info GxB_Global_Option_set_CHAR(GxB_Option_Field, const char *); -GrB_Info GxB_Global_Option_set_FP64(GxB_Option_Field, double); -GrB_Info GxB_Global_Option_set_FP64_ARRAY(GxB_Option_Field, double *); -GrB_Info GxB_Global_Option_set_FUNCTION(GxB_Option_Field, void *); -GrB_Info GxB_Global_Option_set_INT32(GxB_Option_Field, int32_t); -GrB_Info GxB_Global_Option_set_INT64_ARRAY(GxB_Option_Field, int64_t *); -GrB_Info GxB_Serialized_get_INT32(const void *, int32_t *, GrB_Field, size_t); -GrB_Info GxB_Serialized_get_SIZE(const void *, size_t *, GrB_Field, size_t); -GrB_Info GxB_Serialized_get_String(const void *, char *, GrB_Field, size_t); -GrB_Info GxB_Serialized_get_VOID(const void *, void *, GrB_Field, size_t); -GrB_Info GxB_deserialize_type_name(char *, const void *, GrB_Index); -GrB_Info GxB_init(GrB_Mode mode, void *(*user_malloc_function)(size_t), void *(*user_calloc_function)(size_t, size_t), void *(*user_realloc_function)(void *, size_t), void (*user_free_function)(void *)); +GrB_Info GxB_Global_Option_get(int, ...); +GrB_Info GxB_Global_Option_get_CHAR(int, const char **); +GrB_Info GxB_Global_Option_get_FP64(int, double *); +GrB_Info GxB_Global_Option_get_FUNCTION(int, void **); +GrB_Info GxB_Global_Option_get_INT32(int, int32_t *); +GrB_Info GxB_Global_Option_get_INT64(int, int64_t *); +GrB_Info GxB_Global_Option_set(int, ...); +GrB_Info GxB_Global_Option_set_CHAR(int, const char *); +GrB_Info GxB_Global_Option_set_FP64(int, double); +GrB_Info GxB_Global_Option_set_FP64_ARRAY(int, double *); +GrB_Info GxB_Global_Option_set_FUNCTION(int, void *); +GrB_Info GxB_Global_Option_set_INT32(int, int32_t); +GrB_Info GxB_Global_Option_set_INT64_ARRAY(int, int64_t *); +GrB_Info GxB_Serialized_get_INT32(const void *, int32_t *, int, size_t); +GrB_Info GxB_Serialized_get_SIZE(const void *, size_t *, int, size_t); +GrB_Info GxB_Serialized_get_String(const void *, char *, int, size_t); +GrB_Info GxB_Serialized_get_VOID(const void *, void *, int, size_t); +GrB_Info GxB_deserialize_type_name(char *, const void *, uint64_t); +GrB_Info GxB_init(int mode, void *(*user_malloc_function)(size_t), void *(*user_calloc_function)(size_t, size_t), void *(*user_realloc_function)(void *, size_t), void (*user_free_function)(void *)); /* descriptor */ -GrB_Info GxB_Desc_get(GrB_Descriptor, GrB_Desc_Field, ...); -GrB_Info GxB_Desc_get_FP64(GrB_Descriptor, GrB_Desc_Field, double *); -GrB_Info GxB_Desc_get_INT32(GrB_Descriptor, GrB_Desc_Field, int32_t *); -GrB_Info GxB_Desc_set(GrB_Descriptor, GrB_Desc_Field, ...); -GrB_Info GxB_Desc_set_FP64(GrB_Descriptor, GrB_Desc_Field, double); -GrB_Info GxB_Desc_set_INT32(GrB_Descriptor, GrB_Desc_Field, int32_t); -GrB_Info GxB_Descriptor_fprint(GrB_Descriptor descriptor, const char *name, GxB_Print_Level pr, FILE *f); -GrB_Info GxB_Descriptor_get(GrB_Desc_Value *, GrB_Descriptor, GrB_Desc_Field); +GrB_Info GxB_Desc_get(GrB_Descriptor, int, ...); +GrB_Info GxB_Desc_get_FP64(GrB_Descriptor, int, double *); +GrB_Info GxB_Desc_get_INT32(GrB_Descriptor, int, int32_t *); +GrB_Info GxB_Desc_set(GrB_Descriptor, int, ...); +GrB_Info GxB_Desc_set_FP64(GrB_Descriptor, int, double); +GrB_Info GxB_Desc_set_INT32(GrB_Descriptor, int, int32_t); +GrB_Info GxB_Descriptor_fprint(GrB_Descriptor descriptor, const char *name, int pr, FILE *f); +GrB_Info GxB_Descriptor_get(int32_t *, GrB_Descriptor, int); /* indexbinary */ -GrB_Info GxB_IndexBinaryOp_error(const char **error, const GxB_IndexBinaryOp op); -GrB_Info GxB_IndexBinaryOp_fprint(GxB_IndexBinaryOp op, const char *name, GxB_Print_Level pr, FILE *f); -GrB_Info GxB_IndexBinaryOp_free(GxB_IndexBinaryOp *op); -GrB_Info GxB_IndexBinaryOp_get_INT32(GxB_IndexBinaryOp, int32_t *, GrB_Field); -GrB_Info GxB_IndexBinaryOp_get_SIZE(GxB_IndexBinaryOp, size_t *, GrB_Field); -GrB_Info GxB_IndexBinaryOp_get_String(GxB_IndexBinaryOp, char *, GrB_Field); -GrB_Info GxB_IndexBinaryOp_get_VOID(GxB_IndexBinaryOp, void *, GrB_Field); +GrB_Info GxB_IndexBinaryOp_error(const char **error, const GxB_IndexBinaryOp object); +GrB_Info GxB_IndexBinaryOp_fprint(GxB_IndexBinaryOp op, const char *name, int pr, FILE *f); +GrB_Info GxB_IndexBinaryOp_free(GxB_IndexBinaryOp *object); +GrB_Info GxB_IndexBinaryOp_get_INT32(GxB_IndexBinaryOp object, int32_t *, int); +GrB_Info GxB_IndexBinaryOp_get_SIZE(GxB_IndexBinaryOp object, size_t *, int); +GrB_Info GxB_IndexBinaryOp_get_String(GxB_IndexBinaryOp object, char *, int); +GrB_Info GxB_IndexBinaryOp_get_VOID(GxB_IndexBinaryOp object, void *, int); GrB_Info GxB_IndexBinaryOp_new(GxB_IndexBinaryOp *op, GxB_index_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, GrB_Type theta_type, const char *idxbinop_name, const char *idxbinop_defn); -GrB_Info GxB_IndexBinaryOp_set_INT32(GxB_IndexBinaryOp, int32_t, GrB_Field); -GrB_Info GxB_IndexBinaryOp_set_String(GxB_IndexBinaryOp, char *, GrB_Field); -GrB_Info GxB_IndexBinaryOp_set_VOID(GxB_IndexBinaryOp, void *, GrB_Field, size_t); -GrB_Info GxB_IndexBinaryOp_wait(GxB_IndexBinaryOp op, GrB_WaitMode waitmode); +GrB_Info GxB_IndexBinaryOp_set_INT32(GxB_IndexBinaryOp object, int32_t, int); +GrB_Info GxB_IndexBinaryOp_set_String(GxB_IndexBinaryOp object, char *, int); +GrB_Info GxB_IndexBinaryOp_set_VOID(GxB_IndexBinaryOp object, void *, int, size_t); +GrB_Info GxB_IndexBinaryOp_wait(GxB_IndexBinaryOp object, int waitmode); /* indexunary */ -GrB_Info GxB_IndexUnaryOp_fprint(GrB_IndexUnaryOp op, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_IndexUnaryOp_fprint(GrB_IndexUnaryOp op, const char *name, int pr, FILE *f); GrB_Info GxB_IndexUnaryOp_new(GrB_IndexUnaryOp *op, GxB_index_unary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *idxop_name, const char *idxop_defn); GrB_Info GxB_IndexUnaryOp_xtype_name(char *, const GrB_IndexUnaryOp); GrB_Info GxB_IndexUnaryOp_ytype_name(char *, const GrB_IndexUnaryOp); @@ -3190,7 +3234,7 @@ GrB_Index GxB_colIterator_kount(GxB_Iterator iterator); GrB_Index GxB_rowIterator_getColIndex(GxB_Iterator iterator); GrB_Index GxB_rowIterator_getRowIndex(GxB_Iterator iterator); GrB_Index GxB_rowIterator_kount(GxB_Iterator iterator); -GrB_Info GxB_Iterator_free(GxB_Iterator *iterator); +GrB_Info GxB_Iterator_free(GxB_Iterator *object); GrB_Info GxB_Iterator_new(GxB_Iterator *iterator); GrB_Info GxB_Matrix_Iterator_next(GxB_Iterator iterator); GrB_Info GxB_Matrix_Iterator_seek(GxB_Iterator iterator, GrB_Index p); @@ -3219,88 +3263,103 @@ void GxB_Iterator_get_UDT(GxB_Iterator iterator, void *value); void GxB_Matrix_Iterator_getIndex(GxB_Iterator iterator, GrB_Index *row, GrB_Index *col); /* matrix */ -GrB_Info GxB_Col_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *Ilist, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); +GrB_Info GxB_Col_assign_Vector(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Vector I_vector, GrB_Index j, const GrB_Descriptor desc); +GrB_Info GxB_Col_extract_Vector(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Vector I_vector, GrB_Index j, const GrB_Descriptor desc); +GrB_Info GxB_Col_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I_, GrB_Index ni, GrB_Index j, const GrB_Descriptor desc); +GrB_Info GxB_Col_subassign_Vector(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Vector I_vector, GrB_Index j, const GrB_Descriptor desc); GrB_Info GxB_Matrix_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); -GrB_Info GxB_Matrix_Option_get(GrB_Matrix, GxB_Option_Field, ...); -GrB_Info GxB_Matrix_Option_get_FP64(GrB_Matrix, GxB_Option_Field, double *); -GrB_Info GxB_Matrix_Option_get_INT32(GrB_Matrix, GxB_Option_Field, int32_t *); -GrB_Info GxB_Matrix_Option_set(GrB_Matrix, GxB_Option_Field, ...); -GrB_Info GxB_Matrix_Option_set_FP64(GrB_Matrix, GxB_Option_Field, double); -GrB_Info GxB_Matrix_Option_set_INT32(GrB_Matrix, GxB_Option_Field, int32_t); +GrB_Info GxB_Matrix_Option_get(GrB_Matrix, int, ...); +GrB_Info GxB_Matrix_Option_get_FP64(GrB_Matrix, int, double *); +GrB_Info GxB_Matrix_Option_get_INT32(GrB_Matrix, int, int32_t *); +GrB_Info GxB_Matrix_Option_set(GrB_Matrix, int, ...); +GrB_Info GxB_Matrix_Option_set_FP64(GrB_Matrix, int, double); +GrB_Info GxB_Matrix_Option_set_INT32(GrB_Matrix, int, int32_t); GrB_Info GxB_Matrix_apply_BinaryOp1st(GrB_Matrix, const GrB_Matrix, const GrB_BinaryOp, const GrB_BinaryOp, const GrB_Scalar, const GrB_Matrix, const GrB_Descriptor); GrB_Info GxB_Matrix_apply_BinaryOp2nd(GrB_Matrix, const GrB_Matrix, const GrB_BinaryOp, const GrB_BinaryOp, const GrB_Matrix, const GrB_Scalar, const GrB_Descriptor); -GrB_Info GxB_Matrix_build_Scalar(GrB_Matrix C, const GrB_Index *Ilist, const GrB_Index *J, GrB_Scalar scalar, GrB_Index nvals); +GrB_Info GxB_Matrix_assign_Scalar_Vector(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Scalar x, const GrB_Vector I_vector, const GrB_Vector J_vector, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_assign_Vector(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Vector I_vector, const GrB_Vector J_vector, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_build_Scalar(GrB_Matrix C, const GrB_Index *I_, const GrB_Index *J, GrB_Scalar scalar, GrB_Index nvals); +GrB_Info GxB_Matrix_build_Scalar_Vector(GrB_Matrix C, const GrB_Vector I_vector, const GrB_Vector J_vector, GrB_Scalar scalar, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_build_Vector(GrB_Matrix C, const GrB_Vector I_vector, const GrB_Vector J_vector, const GrB_Vector X_vector, const GrB_BinaryOp dup, const GrB_Descriptor desc); GrB_Info GxB_Matrix_concat(GrB_Matrix C, const GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Descriptor desc); GrB_Info GxB_Matrix_deserialize(GrB_Matrix *C, GrB_Type type, const void *blob, GrB_Index blob_size, const GrB_Descriptor desc); GrB_Info GxB_Matrix_diag(GrB_Matrix C, const GrB_Vector v, int64_t k, const GrB_Descriptor desc); GrB_Info GxB_Matrix_eWiseUnion(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Matrix A, const GrB_Scalar alpha, const GrB_Matrix B, const GrB_Scalar beta, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_export_BitmapC(GrB_Matrix *, GrB_Type *, GrB_Index *, GrB_Index *, int8_t **, void **, GrB_Index *, GrB_Index *, bool *, GrB_Index *, const GrB_Descriptor); -GrB_Info GxB_Matrix_export_BitmapR(GrB_Matrix *, GrB_Type *, GrB_Index *, GrB_Index *, int8_t **, void **, GrB_Index *, GrB_Index *, bool *, GrB_Index *, const GrB_Descriptor); -GrB_Info GxB_Matrix_export_CSC(GrB_Matrix *, GrB_Type *, GrB_Index *, GrB_Index *, GrB_Index **, GrB_Index **, void **, GrB_Index *, GrB_Index *, GrB_Index *, bool *, bool *, const GrB_Descriptor); -GrB_Info GxB_Matrix_export_CSR(GrB_Matrix *, GrB_Type *, GrB_Index *, GrB_Index *, GrB_Index **, GrB_Index **, void **, GrB_Index *, GrB_Index *, GrB_Index *, bool *, bool *, const GrB_Descriptor); -GrB_Info GxB_Matrix_export_FullC(GrB_Matrix *, GrB_Type *, GrB_Index *, GrB_Index *, void **, GrB_Index *, bool *, const GrB_Descriptor); -GrB_Info GxB_Matrix_export_FullR(GrB_Matrix *, GrB_Type *, GrB_Index *, GrB_Index *, void **, GrB_Index *, bool *, const GrB_Descriptor); -GrB_Info GxB_Matrix_export_HyperCSC(GrB_Matrix *, GrB_Type *, GrB_Index *, GrB_Index *, GrB_Index **, GrB_Index **, GrB_Index **, void **, GrB_Index *, GrB_Index *, GrB_Index *, GrB_Index *, bool *, GrB_Index *, bool *, const GrB_Descriptor); -GrB_Info GxB_Matrix_export_HyperCSR(GrB_Matrix *, GrB_Type *, GrB_Index *, GrB_Index *, GrB_Index **, GrB_Index **, GrB_Index **, void **, GrB_Index *, GrB_Index *, GrB_Index *, GrB_Index *, bool *, GrB_Index *, bool *, const GrB_Descriptor); -GrB_Info GxB_Matrix_fprint(GrB_Matrix A, const char *name, GxB_Print_Level pr, FILE *f); -GrB_Info GxB_Matrix_import_BitmapC(GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, int8_t **, void **, GrB_Index, GrB_Index, bool, GrB_Index, const GrB_Descriptor); -GrB_Info GxB_Matrix_import_BitmapR(GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, int8_t **, void **, GrB_Index, GrB_Index, bool, GrB_Index, const GrB_Descriptor); -GrB_Info GxB_Matrix_import_CSC(GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, GrB_Index **, GrB_Index **, void **, GrB_Index, GrB_Index, GrB_Index, bool, bool, const GrB_Descriptor); -GrB_Info GxB_Matrix_import_CSR(GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, GrB_Index **, GrB_Index **, void **, GrB_Index, GrB_Index, GrB_Index, bool, bool, const GrB_Descriptor); -GrB_Info GxB_Matrix_import_FullC(GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, void **, GrB_Index, bool, const GrB_Descriptor); -GrB_Info GxB_Matrix_import_FullR(GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, void **, GrB_Index, bool, const GrB_Descriptor); -GrB_Info GxB_Matrix_import_HyperCSC(GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, GrB_Index **, GrB_Index **, GrB_Index **, void **, GrB_Index, GrB_Index, GrB_Index, GrB_Index, bool, GrB_Index, bool, const GrB_Descriptor); -GrB_Info GxB_Matrix_import_HyperCSR(GrB_Matrix *, GrB_Type, GrB_Index, GrB_Index, GrB_Index **, GrB_Index **, GrB_Index **, void **, GrB_Index, GrB_Index, GrB_Index, GrB_Index, bool, GrB_Index, bool, const GrB_Descriptor); +GrB_Info GxB_Matrix_export_BitmapC(GrB_Matrix *, GrB_Type *, uint64_t *, uint64_t *, int8_t **, void **, uint64_t *, uint64_t *, bool *, uint64_t *, const GrB_Descriptor); +GrB_Info GxB_Matrix_export_BitmapR(GrB_Matrix *, GrB_Type *, uint64_t *, uint64_t *, int8_t **, void **, uint64_t *, uint64_t *, bool *, uint64_t *, const GrB_Descriptor); +GrB_Info GxB_Matrix_export_CSC(GrB_Matrix *, GrB_Type *, uint64_t *, uint64_t *, uint64_t **, uint64_t **, void **, uint64_t *, uint64_t *, uint64_t *, bool *, bool *, const GrB_Descriptor); +GrB_Info GxB_Matrix_export_CSR(GrB_Matrix *, GrB_Type *, uint64_t *, uint64_t *, uint64_t **, uint64_t **, void **, uint64_t *, uint64_t *, uint64_t *, bool *, bool *, const GrB_Descriptor); +GrB_Info GxB_Matrix_export_FullC(GrB_Matrix *, GrB_Type *, uint64_t *, uint64_t *, void **, uint64_t *, bool *, const GrB_Descriptor); +GrB_Info GxB_Matrix_export_FullR(GrB_Matrix *, GrB_Type *, uint64_t *, uint64_t *, void **, uint64_t *, bool *, const GrB_Descriptor); +GrB_Info GxB_Matrix_export_HyperCSC(GrB_Matrix *, GrB_Type *, uint64_t *, uint64_t *, uint64_t **, uint64_t **, uint64_t **, void **, uint64_t *, uint64_t *, uint64_t *, uint64_t *, bool *, uint64_t *, bool *, const GrB_Descriptor); +GrB_Info GxB_Matrix_export_HyperCSR(GrB_Matrix *, GrB_Type *, uint64_t *, uint64_t *, uint64_t **, uint64_t **, uint64_t **, void **, uint64_t *, uint64_t *, uint64_t *, uint64_t *, bool *, uint64_t *, bool *, const GrB_Descriptor); +GrB_Info GxB_Matrix_extractTuples_Vector(GrB_Vector I_vector, GrB_Vector J_vector, GrB_Vector X_vector, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_extract_Vector(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Vector I_vector, const GrB_Vector J_vector, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_fprint(GrB_Matrix A, const char *name, int pr, FILE *f); +GrB_Info GxB_Matrix_import_BitmapC(GrB_Matrix *, GrB_Type, uint64_t, uint64_t, int8_t **, void **, uint64_t, uint64_t, bool, uint64_t, const GrB_Descriptor); +GrB_Info GxB_Matrix_import_BitmapR(GrB_Matrix *, GrB_Type, uint64_t, uint64_t, int8_t **, void **, uint64_t, uint64_t, bool, uint64_t, const GrB_Descriptor); +GrB_Info GxB_Matrix_import_CSC(GrB_Matrix *, GrB_Type, uint64_t, uint64_t, uint64_t **, uint64_t **, void **, uint64_t, uint64_t, uint64_t, bool, bool, const GrB_Descriptor); +GrB_Info GxB_Matrix_import_CSR(GrB_Matrix *, GrB_Type, uint64_t, uint64_t, uint64_t **, uint64_t **, void **, uint64_t, uint64_t, uint64_t, bool, bool, const GrB_Descriptor); +GrB_Info GxB_Matrix_import_FullC(GrB_Matrix *, GrB_Type, uint64_t, uint64_t, void **, uint64_t, bool, const GrB_Descriptor); +GrB_Info GxB_Matrix_import_FullR(GrB_Matrix *, GrB_Type, uint64_t, uint64_t, void **, uint64_t, bool, const GrB_Descriptor); +GrB_Info GxB_Matrix_import_HyperCSC(GrB_Matrix *, GrB_Type, uint64_t, uint64_t, uint64_t **, uint64_t **, uint64_t **, void **, uint64_t, uint64_t, uint64_t, uint64_t, bool, uint64_t, bool, const GrB_Descriptor); +GrB_Info GxB_Matrix_import_HyperCSR(GrB_Matrix *, GrB_Type, uint64_t, uint64_t, uint64_t **, uint64_t **, uint64_t **, void **, uint64_t, uint64_t, uint64_t, uint64_t, bool, uint64_t, bool, const GrB_Descriptor); GrB_Info GxB_Matrix_isStoredElement(const GrB_Matrix A, GrB_Index i, GrB_Index j); -GrB_Info GxB_Matrix_iso(bool *iso, const GrB_Matrix A); +GrB_Info GxB_Matrix_iso(bool *, const GrB_Matrix); GrB_Info GxB_Matrix_memoryUsage(size_t *size, const GrB_Matrix A); -GrB_Info GxB_Matrix_pack_BitmapC(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_pack_BitmapR(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index Ab_size, GrB_Index Ax_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_pack_CSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_pack_CSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, bool jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_pack_FullC(GrB_Matrix A, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_pack_FullR(GrB_Matrix A, void **Ax, GrB_Index Ax_size, bool iso, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_pack_HyperCSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Ai_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_pack_HyperCSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index Ap_size, GrB_Index Ah_size, GrB_Index Aj_size, GrB_Index Ax_size, bool iso, GrB_Index nvec, bool jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_pack_BitmapC(GrB_Matrix, int8_t **, void **, uint64_t, uint64_t, bool, uint64_t, const GrB_Descriptor); +GrB_Info GxB_Matrix_pack_BitmapR(GrB_Matrix, int8_t **, void **, uint64_t, uint64_t, bool, uint64_t, const GrB_Descriptor); +GrB_Info GxB_Matrix_pack_CSC(GrB_Matrix, uint64_t **, uint64_t **, void **, uint64_t, uint64_t, uint64_t, bool, bool, const GrB_Descriptor); +GrB_Info GxB_Matrix_pack_CSR(GrB_Matrix, uint64_t **, uint64_t **, void **, uint64_t, uint64_t, uint64_t, bool, bool, const GrB_Descriptor); +GrB_Info GxB_Matrix_pack_FullC(GrB_Matrix, void **, uint64_t, bool, const GrB_Descriptor); +GrB_Info GxB_Matrix_pack_FullR(GrB_Matrix, void **, uint64_t, bool, const GrB_Descriptor); +GrB_Info GxB_Matrix_pack_HyperCSC(GrB_Matrix, uint64_t **, uint64_t **, uint64_t **, void **, uint64_t, uint64_t, uint64_t, uint64_t, bool, uint64_t, bool, const GrB_Descriptor); +GrB_Info GxB_Matrix_pack_HyperCSR(GrB_Matrix, uint64_t **, uint64_t **, uint64_t **, void **, uint64_t, uint64_t, uint64_t, uint64_t, bool, uint64_t, bool, const GrB_Descriptor); GrB_Info GxB_Matrix_reshape(GrB_Matrix C, bool by_col, GrB_Index nrows_new, GrB_Index ncols_new, const GrB_Descriptor desc); GrB_Info GxB_Matrix_reshapeDup(GrB_Matrix *C, GrB_Matrix A, bool by_col, GrB_Index nrows_new, GrB_Index ncols_new, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_select(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Matrix A, const GrB_Scalar Thunk, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_select(GrB_Matrix, const GrB_Matrix, const GrB_BinaryOp, const GxB_SelectOp, const GrB_Matrix, const GrB_Scalar, const GrB_Descriptor); GrB_Info GxB_Matrix_serialize(void **blob_handle, GrB_Index *blob_size_handle, GrB_Matrix A, const GrB_Descriptor desc); GrB_Info GxB_Matrix_sort(GrB_Matrix C, GrB_Matrix P, GrB_BinaryOp op, GrB_Matrix A, const GrB_Descriptor desc); GrB_Info GxB_Matrix_split(GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Index *Tile_nrows, const GrB_Index *Tile_ncols, const GrB_Matrix A, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, bool x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, float x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, double x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, void *x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_subassign_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_type(GrB_Type *, const GrB_Matrix); +GrB_Info GxB_Matrix_subassign(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, float x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_FP64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, double x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_INT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_INT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_INT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_INT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_Scalar(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Scalar x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_Scalar_Vector(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Scalar scalar, const GrB_Vector I_vector, const GrB_Vector J_vector, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_UDT(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_subassign_Vector(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Vector I_vector, const GrB_Vector J_vector, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_type(GrB_Type *type, const GrB_Matrix A); GrB_Info GxB_Matrix_type_name(char *, const GrB_Matrix); -GrB_Info GxB_Matrix_unpack_BitmapC(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_unpack_BitmapR(GrB_Matrix A, int8_t **Ab, void **Ax, GrB_Index *Ab_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_unpack_CSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_unpack_CSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, bool *jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_unpack_FullC(GrB_Matrix A, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_unpack_FullR(GrB_Matrix A, void **Ax, GrB_Index *Ax_size, bool *iso, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_unpack_HyperCSC(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Ai, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Ai_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_unpack_HyperCSR(GrB_Matrix A, GrB_Index **Ap, GrB_Index **Ah, GrB_Index **Aj, void **Ax, GrB_Index *Ap_size, GrB_Index *Ah_size, GrB_Index *Aj_size, GrB_Index *Ax_size, bool *iso, GrB_Index *nvec, bool *jumbled, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_unpack_BitmapC(GrB_Matrix, int8_t **, void **, uint64_t *, uint64_t *, bool *, uint64_t *, const GrB_Descriptor); +GrB_Info GxB_Matrix_unpack_BitmapR(GrB_Matrix, int8_t **, void **, uint64_t *, uint64_t *, bool *, uint64_t *, const GrB_Descriptor); +GrB_Info GxB_Matrix_unpack_CSC(GrB_Matrix, uint64_t **, uint64_t **, void **, uint64_t *, uint64_t *, uint64_t *, bool *, bool *, const GrB_Descriptor); +GrB_Info GxB_Matrix_unpack_CSR(GrB_Matrix, uint64_t **, uint64_t **, void **, uint64_t *, uint64_t *, uint64_t *, bool *, bool *, const GrB_Descriptor); +GrB_Info GxB_Matrix_unpack_FullC(GrB_Matrix, void **, uint64_t *, bool *, const GrB_Descriptor); +GrB_Info GxB_Matrix_unpack_FullR(GrB_Matrix, void **, uint64_t *, bool *, const GrB_Descriptor); +GrB_Info GxB_Matrix_unpack_HyperCSC(GrB_Matrix, uint64_t **, uint64_t **, uint64_t **, void **, uint64_t *, uint64_t *, uint64_t *, uint64_t *, bool *, uint64_t *, bool *, const GrB_Descriptor); +GrB_Info GxB_Matrix_unpack_HyperCSR(GrB_Matrix, uint64_t **, uint64_t **, uint64_t **, void **, uint64_t *, uint64_t *, uint64_t *, uint64_t *, bool *, uint64_t *, bool *, const GrB_Descriptor); +GrB_Info GxB_Row_assign_Vector(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, GrB_Index i, const GrB_Vector J_vector, const GrB_Descriptor desc); GrB_Info GxB_Row_subassign(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, GrB_Index i, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); +GrB_Info GxB_Row_subassign_Vector(GrB_Matrix C, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, GrB_Index i, const GrB_Vector J_vector, const GrB_Descriptor desc); GrB_Info GxB_Vector_diag(GrB_Vector v, const GrB_Matrix A, int64_t k, const GrB_Descriptor desc); GrB_Info GxB_colIterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); -GrB_Info GxB_pack_HyperHash(GrB_Matrix A, GrB_Matrix *Y, const GrB_Descriptor desc); +GrB_Info GxB_load_Matrix_from_Container(GrB_Matrix A, GxB_Container Container, const GrB_Descriptor desc); +GrB_Info GxB_pack_HyperHash(GrB_Matrix, GrB_Matrix *, const GrB_Descriptor); GrB_Info GxB_rowIterator_attach(GxB_Iterator iterator, GrB_Matrix A, GrB_Descriptor desc); -GrB_Info GxB_unpack_HyperHash(GrB_Matrix A, GrB_Matrix *Y, const GrB_Descriptor desc); +GrB_Info GxB_unload_Matrix_into_Container(GrB_Matrix A, GxB_Container Container, const GrB_Descriptor desc); +GrB_Info GxB_unpack_HyperHash(GrB_Matrix, GrB_Matrix *, const GrB_Descriptor); /* monoid */ -GrB_Info GxB_Monoid_fprint(GrB_Monoid monoid, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_Monoid_fprint(GrB_Monoid monoid, const char *name, int pr, FILE *f); GrB_Info GxB_Monoid_identity(void *, GrB_Monoid); GrB_Info GxB_Monoid_operator(GrB_BinaryOp *, GrB_Monoid); GrB_Info GxB_Monoid_terminal(bool *, void *, GrB_Monoid); @@ -3319,10 +3378,10 @@ GrB_Info GxB_Monoid_terminal_new_UINT64(GrB_Monoid *monoid, GrB_BinaryOp op, uin /* scalar */ GrB_Info GxB_BinaryOp_new_IndexOp(GrB_BinaryOp *binop, GxB_IndexBinaryOp idxbinop, GrB_Scalar theta); -GrB_Info GxB_Context_get_Scalar(GxB_Context, GrB_Scalar, GrB_Field); -GrB_Info GxB_Context_set_Scalar(GxB_Context, GrB_Scalar, GrB_Field); -GrB_Info GxB_IndexBinaryOp_get_Scalar(GxB_IndexBinaryOp, GrB_Scalar, GrB_Field); -GrB_Info GxB_IndexBinaryOp_set_Scalar(GxB_IndexBinaryOp, GrB_Scalar, GrB_Field); +GrB_Info GxB_Context_get_Scalar(GxB_Context, GrB_Scalar, int); +GrB_Info GxB_Context_set_Scalar(GxB_Context, GrB_Scalar, int); +GrB_Info GxB_IndexBinaryOp_get_Scalar(GxB_IndexBinaryOp object, GrB_Scalar, int); +GrB_Info GxB_IndexBinaryOp_set_Scalar(GxB_IndexBinaryOp object, GrB_Scalar, int); GrB_Info GxB_Scalar_clear(GrB_Scalar); GrB_Info GxB_Scalar_dup(GrB_Scalar *, const GrB_Scalar); GrB_Info GxB_Scalar_error(const char **, const GrB_Scalar); @@ -3338,11 +3397,11 @@ GrB_Info GxB_Scalar_extractElement_UINT8(uint8_t *, const GrB_Scalar); GrB_Info GxB_Scalar_extractElement_UINT16(uint16_t *, const GrB_Scalar); GrB_Info GxB_Scalar_extractElement_UINT32(uint32_t *, const GrB_Scalar); GrB_Info GxB_Scalar_extractElement_UINT64(uint64_t *, const GrB_Scalar); -GrB_Info GxB_Scalar_fprint(GrB_Scalar s, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_Scalar_fprint(GrB_Scalar s, const char *name, int pr, FILE *f); GrB_Info GxB_Scalar_free(GrB_Scalar *); GrB_Info GxB_Scalar_memoryUsage(size_t *size, const GrB_Scalar s); GrB_Info GxB_Scalar_new(GrB_Scalar *, GrB_Type); -GrB_Info GxB_Scalar_nvals(GrB_Index *, const GrB_Scalar); +GrB_Info GxB_Scalar_nvals(uint64_t *, const GrB_Scalar); GrB_Info GxB_Scalar_setElement_BOOL(GrB_Scalar, bool); GrB_Info GxB_Scalar_setElement_FP32(GrB_Scalar, float); GrB_Info GxB_Scalar_setElement_FP64(GrB_Scalar, double); @@ -3355,30 +3414,30 @@ GrB_Info GxB_Scalar_setElement_UINT8(GrB_Scalar, uint8_t); GrB_Info GxB_Scalar_setElement_UINT16(GrB_Scalar, uint16_t); GrB_Info GxB_Scalar_setElement_UINT32(GrB_Scalar, uint32_t); GrB_Info GxB_Scalar_setElement_UINT64(GrB_Scalar, uint64_t); -GrB_Info GxB_Scalar_type(GrB_Type *, const GrB_Scalar); +GrB_Info GxB_Scalar_type(GrB_Type *type, const GrB_Scalar s); GrB_Info GxB_Scalar_type_name(char *, const GrB_Scalar); GrB_Info GxB_Scalar_wait(GrB_Scalar *); -GrB_Info GxB_Serialized_get_Scalar(const void *, GrB_Scalar, GrB_Field, size_t); +GrB_Info GxB_Serialized_get_Scalar(const void *, GrB_Scalar, int, size_t); /* selectop */ -GrB_Info GxB_SelectOp_fprint(GxB_SelectOp op, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_SelectOp_fprint(GxB_SelectOp, const char *, int, FILE *); GrB_Info GxB_SelectOp_ttype(GrB_Type *, GxB_SelectOp); GrB_Info GxB_SelectOp_xtype(GrB_Type *, GxB_SelectOp); /* semiring */ GrB_Info GxB_Semiring_add(GrB_Monoid *, GrB_Semiring); -GrB_Info GxB_Semiring_fprint(GrB_Semiring semiring, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_Semiring_fprint(GrB_Semiring semiring, const char *name, int pr, FILE *f); GrB_Info GxB_Semiring_multiply(GrB_BinaryOp *, GrB_Semiring); /* type */ -GrB_Info GxB_Type_fprint(GrB_Type type, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_Type_fprint(GrB_Type type, const char *name, int pr, FILE *f); GrB_Info GxB_Type_from_name(GrB_Type *type, const char *type_name); GrB_Info GxB_Type_name(char *, const GrB_Type); GrB_Info GxB_Type_new(GrB_Type *type, size_t sizeof_ctype, const char *type_name, const char *type_defn); GrB_Info GxB_Type_size(size_t *, const GrB_Type); /* unary */ -GrB_Info GxB_UnaryOp_fprint(GrB_UnaryOp unaryop, const char *name, GxB_Print_Level pr, FILE *f); +GrB_Info GxB_UnaryOp_fprint(GrB_UnaryOp unaryop, const char *name, int pr, FILE *f); GrB_Info GxB_UnaryOp_new(GrB_UnaryOp *unaryop, GxB_unary_function function, GrB_Type ztype, GrB_Type xtype, const char *unop_name, const char *unop_defn); GrB_Info GxB_UnaryOp_xtype(GrB_Type *, GrB_UnaryOp); GrB_Info GxB_UnaryOp_xtype_name(char *, const GrB_UnaryOp); @@ -3387,52 +3446,64 @@ GrB_Info GxB_UnaryOp_ztype_name(char *, const GrB_UnaryOp); /* vector */ GrB_Info GxB_Vector_Iterator_attach(GxB_Iterator iterator, GrB_Vector v, GrB_Descriptor desc); -GrB_Info GxB_Vector_Option_get(GrB_Vector, GxB_Option_Field, ...); -GrB_Info GxB_Vector_Option_get_FP64(GrB_Vector, GxB_Option_Field, double *); -GrB_Info GxB_Vector_Option_get_INT32(GrB_Vector, GxB_Option_Field, int32_t *); -GrB_Info GxB_Vector_Option_set(GrB_Vector, GxB_Option_Field, ...); -GrB_Info GxB_Vector_Option_set_FP64(GrB_Vector, GxB_Option_Field, double); -GrB_Info GxB_Vector_Option_set_INT32(GrB_Vector, GxB_Option_Field, int32_t); +GrB_Info GxB_Vector_Option_get(GrB_Vector, int, ...); +GrB_Info GxB_Vector_Option_get_FP64(GrB_Vector, int, double *); +GrB_Info GxB_Vector_Option_get_INT32(GrB_Vector, int, int32_t *); +GrB_Info GxB_Vector_Option_set(GrB_Vector, int, ...); +GrB_Info GxB_Vector_Option_set_FP64(GrB_Vector, int, double); +GrB_Info GxB_Vector_Option_set_INT32(GrB_Vector, int, int32_t); GrB_Info GxB_Vector_apply_BinaryOp1st(GrB_Vector, const GrB_Vector, const GrB_BinaryOp, const GrB_BinaryOp, const GrB_Scalar, const GrB_Vector, const GrB_Descriptor); GrB_Info GxB_Vector_apply_BinaryOp2nd(GrB_Vector, const GrB_Vector, const GrB_BinaryOp, const GrB_BinaryOp, const GrB_Vector, const GrB_Scalar, const GrB_Descriptor); -GrB_Info GxB_Vector_build_Scalar(GrB_Vector w, const GrB_Index *Ilist, GrB_Scalar scalar, GrB_Index nvals); +GrB_Info GxB_Vector_assign_Scalar_Vector(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Scalar x, const GrB_Vector I_vector, const GrB_Descriptor desc); +GrB_Info GxB_Vector_assign_Vector(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Vector I_vector, const GrB_Descriptor desc); +GrB_Info GxB_Vector_build_Scalar(GrB_Vector w, const GrB_Index *I_, const GrB_Scalar scalar, GrB_Index nvals); +GrB_Info GxB_Vector_build_Scalar_Vector(GrB_Vector w, const GrB_Vector I_vector, const GrB_Scalar scalar, const GrB_Descriptor desc); +GrB_Info GxB_Vector_build_Vector(GrB_Vector w, const GrB_Vector I_vector, const GrB_Vector X_vector, const GrB_BinaryOp dup, const GrB_Descriptor desc); GrB_Info GxB_Vector_deserialize(GrB_Vector *w, GrB_Type type, const void *blob, GrB_Index blob_size, const GrB_Descriptor desc); GrB_Info GxB_Vector_eWiseUnion(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Vector u, const GrB_Scalar alpha, const GrB_Vector v, const GrB_Scalar beta, const GrB_Descriptor desc); -GrB_Info GxB_Vector_export_Bitmap(GrB_Vector *, GrB_Type *, GrB_Index *, int8_t **, void **, GrB_Index *, GrB_Index *, bool *, GrB_Index *, const GrB_Descriptor); -GrB_Info GxB_Vector_export_CSC(GrB_Vector *, GrB_Type *, GrB_Index *, GrB_Index **, void **, GrB_Index *, GrB_Index *, bool *, GrB_Index *, bool *, const GrB_Descriptor); -GrB_Info GxB_Vector_export_Full(GrB_Vector *, GrB_Type *, GrB_Index *, void **, GrB_Index *, bool *, const GrB_Descriptor); -GrB_Info GxB_Vector_fprint(GrB_Vector v, const char *name, GxB_Print_Level pr, FILE *f); -GrB_Info GxB_Vector_import_Bitmap(GrB_Vector *, GrB_Type, GrB_Index, int8_t **, void **, GrB_Index, GrB_Index, bool, GrB_Index, const GrB_Descriptor); -GrB_Info GxB_Vector_import_CSC(GrB_Vector *, GrB_Type, GrB_Index, GrB_Index **, void **, GrB_Index, GrB_Index, bool, GrB_Index, bool, const GrB_Descriptor); -GrB_Info GxB_Vector_import_Full(GrB_Vector *, GrB_Type, GrB_Index, void **, GrB_Index, bool, const GrB_Descriptor); +GrB_Info GxB_Vector_export_Bitmap(GrB_Vector *, GrB_Type *, uint64_t *, int8_t **, void **, uint64_t *, uint64_t *, bool *, uint64_t *, const GrB_Descriptor); +GrB_Info GxB_Vector_export_CSC(GrB_Vector *, GrB_Type *, uint64_t *, uint64_t **, void **, uint64_t *, uint64_t *, bool *, uint64_t *, bool *, const GrB_Descriptor); +GrB_Info GxB_Vector_export_Full(GrB_Vector *, GrB_Type *, uint64_t *, void **, uint64_t *, bool *, const GrB_Descriptor); +GrB_Info GxB_Vector_extractTuples_Vector(GrB_Vector I_vector, GrB_Vector X_vector, const GrB_Vector V, const GrB_Descriptor desc); +GrB_Info GxB_Vector_extract_Vector(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Vector I_vector, const GrB_Descriptor desc); +GrB_Info GxB_Vector_fprint(GrB_Vector v, const char *name, int pr, FILE *f); +GrB_Info GxB_Vector_import_Bitmap(GrB_Vector *, GrB_Type, uint64_t, int8_t **, void **, uint64_t, uint64_t, bool, uint64_t, const GrB_Descriptor); +GrB_Info GxB_Vector_import_CSC(GrB_Vector *, GrB_Type, uint64_t, uint64_t **, void **, uint64_t, uint64_t, bool, uint64_t, bool, const GrB_Descriptor); +GrB_Info GxB_Vector_import_Full(GrB_Vector *, GrB_Type, uint64_t, void **, uint64_t, bool, const GrB_Descriptor); GrB_Info GxB_Vector_isStoredElement(const GrB_Vector v, GrB_Index i); -GrB_Info GxB_Vector_iso(bool *iso, const GrB_Vector v); +GrB_Info GxB_Vector_iso(bool *, const GrB_Vector); +GrB_Info GxB_Vector_load(GrB_Vector V, void **X, GrB_Type type, uint64_t n, uint64_t X_size, int handling, const GrB_Descriptor desc); GrB_Info GxB_Vector_memoryUsage(size_t *size, const GrB_Vector v); -GrB_Info GxB_Vector_pack_Bitmap(GrB_Vector v, int8_t **vb, void **vx, GrB_Index vb_size, GrB_Index vx_size, bool iso, GrB_Index nvals, const GrB_Descriptor desc); -GrB_Info GxB_Vector_pack_CSC(GrB_Vector v, GrB_Index **vi, void **vx, GrB_Index vi_size, GrB_Index vx_size, bool iso, GrB_Index nvals, bool jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Vector_pack_Full(GrB_Vector v, void **vx, GrB_Index vx_size, bool iso, const GrB_Descriptor desc); -GrB_Info GxB_Vector_select(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GxB_SelectOp op, const GrB_Vector u, const GrB_Scalar Thunk, const GrB_Descriptor desc); +GrB_Info GxB_Vector_pack_Bitmap(GrB_Vector, int8_t **, void **, uint64_t, uint64_t, bool, uint64_t, const GrB_Descriptor); +GrB_Info GxB_Vector_pack_CSC(GrB_Vector, uint64_t **, void **, uint64_t, uint64_t, bool, uint64_t, bool, const GrB_Descriptor); +GrB_Info GxB_Vector_pack_Full(GrB_Vector, void **, uint64_t, bool, const GrB_Descriptor); +GrB_Info GxB_Vector_select(GrB_Vector, const GrB_Vector, const GrB_BinaryOp, const GxB_SelectOp, const GrB_Vector, const GrB_Scalar, const GrB_Descriptor); GrB_Info GxB_Vector_serialize(void **blob_handle, GrB_Index *blob_size_handle, GrB_Vector u, const GrB_Descriptor desc); GrB_Info GxB_Vector_sort(GrB_Vector w, GrB_Vector p, GrB_BinaryOp op, GrB_Vector u, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, bool x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, float x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, double x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, GrB_Scalar x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, void *x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_subassign_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *Ilist, GrB_Index ni, const GrB_Descriptor desc); -GrB_Info GxB_Vector_type(GrB_Type *, const GrB_Vector); +GrB_Info GxB_Vector_subassign(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_FP32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, float x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_FP64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, double x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_INT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int8_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_INT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int16_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_INT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int32_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_INT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, int64_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_Scalar(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Scalar x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_Scalar_Vector(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Scalar scalar, const GrB_Vector I_vector, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_UDT(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, void *x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_UINT8(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint8_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_UINT16(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint16_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_UINT32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint32_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, uint64_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); +GrB_Info GxB_Vector_subassign_Vector(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Vector I_vector, const GrB_Descriptor desc); +GrB_Info GxB_Vector_type(GrB_Type *type, const GrB_Vector v); GrB_Info GxB_Vector_type_name(char *, const GrB_Vector); -GrB_Info GxB_Vector_unpack_Bitmap(GrB_Vector v, int8_t **vb, void **vx, GrB_Index *vb_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, const GrB_Descriptor desc); -GrB_Info GxB_Vector_unpack_CSC(GrB_Vector v, GrB_Index **vi, void **vx, GrB_Index *vi_size, GrB_Index *vx_size, bool *iso, GrB_Index *nvals, bool *jumbled, const GrB_Descriptor desc); -GrB_Info GxB_Vector_unpack_Full(GrB_Vector v, void **vx, GrB_Index *vx_size, bool *iso, const GrB_Descriptor desc); +GrB_Info GxB_Vector_unload(GrB_Vector V, void **X, GrB_Type *type, uint64_t *n, uint64_t *X_size, int *handling, const GrB_Descriptor desc); +GrB_Info GxB_Vector_unpack_Bitmap(GrB_Vector, int8_t **, void **, uint64_t *, uint64_t *, bool *, uint64_t *, const GrB_Descriptor); +GrB_Info GxB_Vector_unpack_CSC(GrB_Vector, uint64_t **, void **, uint64_t *, uint64_t *, bool *, uint64_t *, bool *, const GrB_Descriptor); +GrB_Info GxB_Vector_unpack_Full(GrB_Vector, void **, uint64_t *, bool *, const GrB_Descriptor); +GrB_Info GxB_load_Vector_from_Container(GrB_Vector V, GxB_Container Container, const GrB_Descriptor desc); +GrB_Info GxB_unload_Vector_into_Container(GrB_Vector V, GxB_Container Container, const GrB_Descriptor desc); /* int DEFINES */ #define GRB_SUBVERSION ... @@ -3471,6 +3542,7 @@ GrB_Info GxB_Vector_unpack_Full(GrB_Vector v, void **vx, GrB_Index *vx_size, boo #define GxB_SPEC_VERSION ... #define GxB_STDC_VERSION ... #define GxB_STRIDE ... +#define GxB_USE_VALUES ... /* char* DEFINES */ extern char *GxB_IMPLEMENTATION_ABOUT_STR; From 74c45cc0e9ca2f454cb518a3df09b573b151bca1 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Sun, 16 Mar 2025 21:01:01 -0500 Subject: [PATCH 164/193] Fix test version (#140) --- suitesparse_graphblas/tests/test_package.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/suitesparse_graphblas/tests/test_package.py b/suitesparse_graphblas/tests/test_package.py index 36b83f6..77086a6 100644 --- a/suitesparse_graphblas/tests/test_package.py +++ b/suitesparse_graphblas/tests/test_package.py @@ -7,4 +7,8 @@ def test_matrix_existence(): def test_version(): - assert suitesparse_graphblas.__version__ > "7.4.2.0" + # Example dev version: 9.4.5.0+2.g5590dba8.dirty + # Example reslease version: 9.4.5.0 + version = suitesparse_graphblas.__version__ + version = [int(x) for x in version.split("+")[0].split(".")] + assert version > [9, 4, 4, 0] From 4e49ec4d7c54451283b5875fe7a2b6f9466a411e Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Sat, 13 Sep 2025 19:23:44 -0500 Subject: [PATCH 165/193] Update to SuiteSparse:GraphBLAS 10.1.1 (#141) --- .pre-commit-config.yaml | 22 ++++++++++++---------- GB_VERSION.txt | 2 +- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 62cdd5c..2a8fd94 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,25 +9,27 @@ default_language_version: python: python3 repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: check-added-large-files - id: check-case-conflict + - id: check-illegal-windows-names - id: check-merge-conflict - id: check-ast - id: check-toml - id: check-yaml # - id: check-executables-have-shebangs - id: check-vcs-permalinks + - id: debug-statements - id: destroyed-symlinks - id: detect-private-key - - id: debug-statements + - id: forbid-submodules - id: end-of-file-fixer - id: mixed-line-ending args: [--fix=lf] - id: trailing-whitespace - repo: https://github.com/abravalheri/validate-pyproject - rev: v0.24 + rev: v0.24.1 hooks: - id: validate-pyproject name: Validate pyproject.toml @@ -41,23 +43,23 @@ repos: hooks: - id: isort - repo: https://github.com/asottile/pyupgrade - rev: v3.19.1 + rev: v3.20.0 hooks: - id: pyupgrade args: [--py39-plus] - - repo: https://github.com/psf/black + - repo: https://github.com/psf/black-pre-commit-mirror rev: 25.1.0 hooks: - id: black - repo: https://github.com/PyCQA/flake8 - rev: 7.1.2 + rev: 7.3.0 hooks: - id: flake8 args: ["--config=.flake8"] additional_dependencies: &flake8_dependencies # These versions need updated manually - - flake8==7.1.2 - - flake8-comprehensions==3.16.0 + - flake8==7.3.0 + - flake8-comprehensions==3.17.0 - flake8-bugbear==24.12.12 # - flake8-simplify==0.21.0 - repo: https://github.com/asottile/yesqa @@ -73,7 +75,7 @@ repos: # - id: pyroma # args: [-n, "10", .] - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.31.3 + rev: 0.33.3 hooks: - id: check-dependabot - id: check-github-workflows @@ -82,6 +84,6 @@ repos: - id: check-hooks-apply - id: check-useless-excludes - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: no-commit-to-branch # no commit directly to main diff --git a/GB_VERSION.txt b/GB_VERSION.txt index 1532420..2312799 100644 --- a/GB_VERSION.txt +++ b/GB_VERSION.txt @@ -1 +1 @@ -10.0.1 +10.1.1 From 292dc06b91211f8e2dc6bc378c70031de633bf1f Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Fri, 27 Mar 2026 17:32:31 -0500 Subject: [PATCH 166/193] Support Python 3.14 (and drop Python 3.9 and 3.10) (#142) * Support Python 3.14 (and drop Python 3.9) * Update pypa/cibuildwheel from 2.22 to 3.2.1 (and others) * Change cibuildwheel back to v2.22 * Don't run pyroma * persist-credentials: false * Update to GraphBLAS 10.3.1, drop Python 3.10, modernize packaging and CI - Update SuiteSparse:GraphBLAS from 10.1.1 to 10.3.1 - Regenerate headers (GPU_ID -> GPU_IDS, add NGPUS, PRINT_FUNCTION) - Drop Python 3.10 support (minimum now 3.11) - PEP 639: license = "Apache-2.0" with license-files - Bump setuptools >= 77, numpy >= 1.24 - Update CI: cibuildwheel v2 -> v3.4, checkout v6, QEMU v4, create-pull-request v8 - Enable PyPy and free-threading explicitly (CIBW_ENABLE) - Fix manylinux_2_28 package manager (dnf instead of yum) - Update pre-commit hooks (black 26.3.1, isort 8.0.1, pyupgrade 3.21.2, etc.) - Add shellcheck, pygrep-hooks; enable check-executables-have-shebangs - Fix shellcheck warnings in docker_build.sh and suitesparse.sh * Don't enable cpython-freethreading wheels yet * Update wheel build matrix: native ARM runner, macOS 15 - Replace QEMU-emulated aarch64 with native ubuntu-24.04-arm runner - Replace deprecated macos-13 with macos-15-intel - Remove QEMU setup and SUITESPARSE_FAST_BUILD (no longer needed) --- .github/workflows/lint.yml | 9 ++- .github/workflows/test.yml | 5 +- .github/workflows/update_graphblas.yml | 7 +- .github/workflows/wheels.yml | 71 ++++++++----------- .pre-commit-config.yaml | 36 +++++++--- Dockerfile | 6 +- GB_VERSION.txt | 2 +- build_graphblas_cffi.py | 2 +- docker_build.sh | 23 +++--- pyproject.toml | 21 +++--- suitesparse.sh | 16 +++-- suitesparse_graphblas/create_headers.py | 3 +- suitesparse_graphblas/io/binary.py | 6 +- suitesparse_graphblas/suitesparse_graphblas.h | 14 ++-- .../suitesparse_graphblas_no_complex.h | 14 ++-- suitesparse_graphblas/utils.pyx | 6 ++ 16 files changed, 136 insertions(+), 105 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 4140839..63644a1 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -14,8 +14,11 @@ jobs: name: pre-commit-hooks runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - uses: actions/checkout@v6 with: - python-version: "3.10" + fetch-depth: 0 + persist-credentials: false + - uses: actions/setup-python@v6 + with: + python-version: "3.11" - uses: pre-commit/action@v3.0.1 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 508d4a7..0c93034 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,12 +18,13 @@ jobs: source: ["conda-forge"] # os: ["ubuntu-latest"] # source: ["source"] - python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + python-version: ["3.11", "3.12", "3.13", "3.14"] steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: fetch-depth: 0 + persist-credentials: false - name: Conda uses: conda-incubator/setup-miniconda@v3 with: diff --git a/.github/workflows/update_graphblas.yml b/.github/workflows/update_graphblas.yml index 153f1a7..532072f 100644 --- a/.github/workflows/update_graphblas.yml +++ b/.github/workflows/update_graphblas.yml @@ -27,11 +27,12 @@ jobs: if: github.repository == 'GraphBLAS/python-suitesparse-graphblas' || github.repository == 'alugowski/python-suitesparse-graphblas' runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-depth: 0 + persist-credentials: false - - uses: actions/setup-python@v5 + - uses: actions/setup-python@v6 with: python-version: "3.11" @@ -42,7 +43,7 @@ jobs: shell: bash - name: Create Pull Request - uses: peter-evans/create-pull-request@v7 + uses: peter-evans/create-pull-request@v8 with: # See documentation: https://github.com/peter-evans/create-pull-request # Action behavior: https://github.com/peter-evans/create-pull-request#action-behaviour diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 20434c0..05bebdd 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -34,9 +34,10 @@ jobs: name: Build SDist runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-depth: 0 + persist-credentials: false - name: Build SDist run: pipx run build --sdist @@ -60,58 +61,43 @@ jobs: - os: windows-latest cibw_archs: "auto64" - # Linux x86 manylinux + # Linux x86_64 manylinux - os: ubuntu-latest cibw_archs: "x86_64" - # Python 3.12 wheel requires libffi-devel to be installed. manylinux container uses yum - cibw_before_build_linux: "yum install -y libffi-devel" + # manylinux_2_28 uses dnf (not yum). libffi-devel needed for Python 3.12+ cffi. + cibw_before_build_linux: "dnf install -y libffi-devel || yum install -y libffi-devel || true" # skip musllinux cibw_skip: "*musl*" - # Linux x86 musllinux + # Linux x86_64 musllinux # Separate runner for a Musl build of graphblas. The glibc build is not guaranteed to be compatible. - os: ubuntu-latest cibw_archs: "x86_64" arch_note: "musl" - # skip manylinux (built elsewhere), PyPy (no musl numpy wheels), CPython 3.8 (no musl numpy wheels) - cibw_skip: "*many* pp* cp38*" + # skip manylinux (built elsewhere) + cibw_skip: "*many*" - # Linux aarch64 - # Separate runner because this requires emulation (only x86 runners are available) and is very slow. - - os: ubuntu-latest - cibw_archs: "aarch64" - # numpy wheels not available for aarch64 PyPy or musllinux - cibw_skip: "pp* *musl*" + # Linux aarch64 — native ARM runner (no QEMU emulation needed) + - os: ubuntu-24.04-arm + cibw_archs: "auto" + # numpy wheels not available for aarch64 musllinux + cibw_skip: "*musl*" - # macOS x86 - # Note: keep as old as possible as due to libomp this will be the oldest supported macOS version. - - os: macos-13 + # macOS x86_64 — macos-15-intel is the last Intel macOS runner. + # libomp from Homebrew determines the minimum supported macOS version. + - os: macos-15-intel cibw_archs: "x86_64" # macOS Apple Silicon - # Note: keep as old as possible as due to libomp this will be the oldest supported macOS version. + # Keep runner version as old as possible: libomp determines minimum macOS version. - os: macos-14 cibw_archs: "arm64" steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-depth: 0 - - # aarch64 Linux builds are cross-compiled on x86 runners using emulation - # see https://cibuildwheel.readthedocs.io/en/stable/faq/#emulation - - name: Setup QEMU (for aarch64) - if: matrix.cibw_archs == 'aarch64' - uses: docker/setup-qemu-action@v3 - with: - platforms: arm64 - - - name: Setup env (for aarch64) - if: matrix.cibw_archs == 'aarch64' - # Ask suitesparse.sh to compile faster by optimizing fewer types. Otherwise, the build takes too long to finish - # in 6 hour limit. - run: | - echo "SUITESPARSE_FAST_BUILD=1" >> $GITHUB_ENV + persist-credentials: false - name: Setup for testing if: github.event_name == 'push' || github.event_name == 'pull_request' @@ -145,19 +131,23 @@ jobs: brew fetch --retry libomp && brew reinstall libomp echo MACOSX_DEPLOYMENT_TARGET=$(otool -l $(brew --prefix libomp)/lib/libomp.dylib | grep minos | awk '{print $2}') >> $GITHUB_ENV - - uses: pypa/cibuildwheel@v2.22 + - uses: pypa/cibuildwheel@v3.4 with: output-dir: wheelhouse env: # very verbose CIBW_BUILD_VERBOSITY: 3 + # cibuildwheel v3: PyPy no longer built by default; enable explicitly + # Note: cpython-freethreading not enabled because cffi doesn't support it yet + CIBW_ENABLE: "pypy" + # Build SuiteSparse CIBW_BEFORE_ALL: bash suitesparse.sh ${{ env.GB_VERSION_REF }} CIBW_BEFORE_BUILD_LINUX: ${{ matrix.cibw_before_build_linux }} - CIBW_ENVIRONMENT_PASS_LINUX: SUITESPARSE_FAST_BUILD SUITESPARSE_FASTEST_BUILD + CIBW_ENVIRONMENT_PASS_LINUX: SUITESPARSE_FASTEST_BUILD # CMAKE_GNUtoMS=ON asks suitesparse.sh to build libraries in MSVC style on Windows. CIBW_ENVIRONMENT_WINDOWS: CMAKE_GNUtoMS=ON GRAPHBLAS_PREFIX="C:/GraphBLAS" @@ -172,8 +162,7 @@ jobs: # Architectures to build specified in matrix CIBW_ARCHS: ${{ matrix.cibw_archs }} - # as of writing numpy does not support pypy 3.10 - CIBW_SKIP: "${{ matrix.cibw_skip }} pp310*" + CIBW_SKIP: "${{ matrix.cibw_skip }}" # Use delvewheel on Windows. # This copies graphblas.dll into the wheel. "repair" in cibuildwheel parlance includes copying any shared @@ -207,17 +196,17 @@ jobs: if: github.repository == 'GraphBLAS/python-suitesparse-graphblas' && ((github.event_name == 'release' && github.event.action == 'published') || (github.event_name == 'workflow_dispatch' && github.event.inputs.upload_dest != 'No Upload')) steps: - - uses: actions/setup-python@v5 + - uses: actions/setup-python@v6 with: python-version: "3.x" - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v5 with: path: dist merge-multiple: true # Upload to PyPI - - uses: pypa/gh-action-pypi-publish@release/v1 + - uses: pypa/gh-action-pypi-publish@v1.13.0 name: Upload to PyPI if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.upload_dest == 'PyPI') with: @@ -227,7 +216,7 @@ jobs: password: ${{ secrets.PYPI_TOKEN }} # Upload to Test PyPI - - uses: pypa/gh-action-pypi-publish@release/v1 + - uses: pypa/gh-action-pypi-publish@v1.13.0 name: Upload to Test PyPI if: github.event_name == 'workflow_dispatch' && github.event.inputs.upload_dest == 'Test PyPI' with: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2a8fd94..a88a72c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,12 +13,12 @@ repos: hooks: - id: check-added-large-files - id: check-case-conflict + - id: check-executables-have-shebangs - id: check-illegal-windows-names - id: check-merge-conflict - id: check-ast - id: check-toml - id: check-yaml - # - id: check-executables-have-shebangs - id: check-vcs-permalinks - id: debug-statements - id: destroyed-symlinks @@ -28,27 +28,29 @@ repos: - id: mixed-line-ending args: [--fix=lf] - id: trailing-whitespace + - id: name-tests-test + args: ["--pytest-test-first"] - repo: https://github.com/abravalheri/validate-pyproject - rev: v0.24.1 + rev: v0.25 hooks: - id: validate-pyproject name: Validate pyproject.toml - repo: https://github.com/PyCQA/autoflake - rev: v2.3.1 + rev: v2.3.3 hooks: - id: autoflake args: [--in-place] - repo: https://github.com/pycqa/isort - rev: 6.0.1 + rev: 8.0.1 hooks: - id: isort - repo: https://github.com/asottile/pyupgrade - rev: v3.20.0 + rev: v3.21.2 hooks: - id: pyupgrade - args: [--py39-plus] + args: [--py311-plus] - repo: https://github.com/psf/black-pre-commit-mirror - rev: 25.1.0 + rev: 26.3.1 hooks: - id: black - repo: https://github.com/PyCQA/flake8 @@ -60,8 +62,8 @@ repos: # These versions need updated manually - flake8==7.3.0 - flake8-comprehensions==3.17.0 - - flake8-bugbear==24.12.12 - # - flake8-simplify==0.21.0 + - flake8-bugbear==25.11.29 + # - flake8-simplify==0.22.0 - repo: https://github.com/asottile/yesqa rev: v1.5.0 hooks: @@ -70,12 +72,24 @@ repos: # `pyroma` may help keep our package standards up to date if best practices change. # This is a "low value" check though and too slow to run as part of pre-commit. # - repo: https://github.com/regebro/pyroma - # rev: "4.2" + # rev: "5.0.1" # hooks: # - id: pyroma # args: [-n, "10", .] + - repo: https://github.com/shellcheck-py/shellcheck-py + rev: "v0.11.0.1" + hooks: + - id: shellcheck + - repo: https://github.com/pre-commit/pygrep-hooks + rev: v1.10.0 + hooks: + - id: python-check-blanket-noqa + - id: python-check-blanket-type-ignore + - id: python-no-eval + - id: python-no-log-warn + - id: text-unicode-replacement-char - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.33.3 + rev: 0.37.0 hooks: - id: check-dependabot - id: check-github-workflows diff --git a/Dockerfile b/Dockerfile index fa101e5..f20e91f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -ARG BASE_CONTAINER=python:3.9-slim-buster +ARG BASE_CONTAINER=python:3.10-slim-buster FROM ${BASE_CONTAINER} as suitesparse ENV DEBIAN_FRONTEND=noninteractive @@ -24,7 +24,7 @@ ENV PYTHONUNBUFFERED 1 COPY --from=suitesparse /usr/include/GraphBLAS.h /usr/local/include/ COPY --from=suitesparse /usr/lib/x86_64-linux-gnu/libgraphblas* /usr/lib/x86_64-linux-gnu/ -COPY --from=suitesparse /build/pycparser/utils/fake_libc_include/* /usr/local/lib/python3.9/site-packages/pycparser/utils/fake_libc_include/ +COPY --from=suitesparse /build/pycparser/utils/fake_libc_include/* /usr/local/lib/python3.10/site-packages/pycparser/utils/fake_libc_include/ RUN apt-get update && apt-get install -yq build-essential git RUN pip3 install numpy cffi pytest cython @@ -44,4 +44,4 @@ RUN apt-get -y --purge remove git python3-pip && apt-get clean FROM ${BASE_CONTAINER} COPY --from=suitesparse /usr/lib/x86_64-linux-gnu/libgraphblas* /usr/lib/x86_64-linux-gnu/ COPY --from=suitesparse /usr/lib/x86_64-linux-gnu/libgomp* /usr/lib/x86_64-linux-gnu/ -COPY --from=psg /usr/local/lib/python3.9/site-packages /usr/local/lib/python3.9/site-packages +COPY --from=psg /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages diff --git a/GB_VERSION.txt b/GB_VERSION.txt index 2312799..a936832 100644 --- a/GB_VERSION.txt +++ b/GB_VERSION.txt @@ -1 +1 @@ -10.1.1 +10.3.1 diff --git a/build_graphblas_cffi.py b/build_graphblas_cffi.py index 7548102..94594e6 100644 --- a/build_graphblas_cffi.py +++ b/build_graphblas_cffi.py @@ -13,7 +13,7 @@ # GraphBLAS_ROOT env var can point to the root directory of GraphBLAS to link against. # Expected subdirectories: include/ (contains GraphBLAS.h), lib/, and bin/ (on Windows only) # Otherwise fallback to default system folders. -graphblas_root = os.environ.get("GraphBLAS_ROOT", None) +graphblas_root = os.environ.get("GraphBLAS_ROOT") if not graphblas_root: # Windows wheels.yml configures suitesparse.sh to install GraphBLAS to "C:\\GraphBLAS". diff --git a/docker_build.sh b/docker_build.sh index 31e2b25..77d3d80 100755 --- a/docker_build.sh +++ b/docker_build.sh @@ -1,3 +1,4 @@ +#!/usr/bin/env bash if [ $# -eq 0 ] then echo "Usage: ./docker_build.sh SUITESPARSE_BRANCH VERSION [BRANCH LOCATION PUSH] @@ -21,29 +22,29 @@ COMPACT=${COMPACT:-0} if [ "$LOCATION" = "clone" ] then TMPDIR=$(mktemp -d) - if [ ! -e $TMPDIR ]; then + if [ ! -e "$TMPDIR" ]; then >&2 echo "Failed to create temp directory" exit 1 fi trap "exit 1" HUP INT PIPE QUIT TERM trap 'rm -rf "$TMPDIR"' EXIT - cd $TMPDIR - git clone --branch $BRANCH https://github.com/GraphBLAS/python-suitesparse-graphblas.git - cd python-suitesparse-graphblas + cd "$TMPDIR" || exit + git clone --branch "$BRANCH" https://github.com/GraphBLAS/python-suitesparse-graphblas.git + cd python-suitesparse-graphblas || exit fi docker build \ - --build-arg SUITESPARSE=${SUITESPARSE} \ - --build-arg VERSION=${VERSION} \ - --build-arg COMPACT=${COMPACT} \ - -t $IMAGE:$VERSION \ + --build-arg SUITESPARSE="${SUITESPARSE}" \ + --build-arg VERSION="${VERSION}" \ + --build-arg COMPACT="${COMPACT}" \ + -t "$IMAGE:$VERSION" \ . -docker tag $IMAGE:$VERSION $IMAGE:latest +docker tag "$IMAGE:$VERSION" "$IMAGE:latest" if [ "$PUSH" = "push" ] then - docker push $IMAGE:$VERSION - docker push $IMAGE:latest + docker push "$IMAGE:$VERSION" + docker push "$IMAGE:latest" fi diff --git a/pyproject.toml b/pyproject.toml index 3a47125..976de9b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,12 +1,13 @@ [build-system] build-backend = "setuptools.build_meta" requires = [ - # setuptools<74 until PyPy vendors cffi 1.15.1 - "setuptools >=64, <74", + "setuptools >=77", "setuptools-git-versioning", "wheel", "cffi>=1.11", - "cython", + # Free-threading in Python 3.14 requires Cython >=3.1 + "cython; python_version<'3.14'", + "cython>=3.1; python_version>='3.14'", "numpy>=2.0", ] @@ -15,8 +16,9 @@ name = "suitesparse-graphblas" dynamic = ["version"] description = "SuiteSparse:GraphBLAS Python bindings." readme = "README.md" -requires-python = ">=3.9" -license = {file = "LICENSE"} +requires-python = ">=3.11" +license = "Apache-2.0" +license-files = ["LICENSE"] authors = [ {name = "Erik Welch", email = "erik.n.welch@gmail.com"}, {name = "Jim Kitchen"}, @@ -45,18 +47,17 @@ keywords = [ ] classifiers = [ "Development Status :: 5 - Production/Stable", - "License :: OSI Approved :: Apache Software License", "Operating System :: MacOS :: MacOS X", "Operating System :: POSIX :: Linux", "Operating System :: Microsoft :: Windows", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: Free Threading :: 2 - Beta", "Intended Audience :: Developers", "Intended Audience :: Other Audience", "Intended Audience :: Science/Research", @@ -67,7 +68,7 @@ classifiers = [ ] dependencies = [ "cffi>=1.15", - "numpy>=1.23", + "numpy>=1.24", ] [project.urls] homepage = "https://github.com/GraphBLAS/python-suitesparse-graphblas" @@ -93,7 +94,7 @@ dirty_template = "{tag}+{ccount}.g{sha}.dirty" [tool.black] line-length = 100 -target-version = ["py39", "py310", "py311", "py312", "py313"] +target-version = ["py311", "py312", "py313", "py314"] [tool.isort] sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"] diff --git a/suitesparse.sh b/suitesparse.sh index f804f40..0b47855 100755 --- a/suitesparse.sh +++ b/suitesparse.sh @@ -10,9 +10,9 @@ elif [[ $1 =~ refs/tags/([0-9]*\.[0-9]*\.[0-9]*)\..*$ ]]; then VERSION=${BASH_REMATCH[1]} else echo "Specify a SuiteSparse version, such as: $0 refs/tags/7.4.3.0 (got: $1)" - exit -1 + exit 1 fi -echo VERSION: $VERSION +echo VERSION: "$VERSION" NPROC="$(nproc)" if [ -z "${NPROC}" ]; then @@ -27,7 +27,8 @@ if [ -n "${BREW_LIBOMP}" ]; then cmake_params+=(-DOpenMP_C_FLAGS="-Xclang -fopenmp -I$(brew --prefix libomp)/include") cmake_params+=(-DOpenMP_C_LIB_NAMES="libomp") cmake_params+=(-DOpenMP_libomp_LIBRARY="omp") - export LDFLAGS="-L$(brew --prefix libomp)/lib" + LDFLAGS="-L$(brew --prefix libomp)/lib" + export LDFLAGS if [ -n "${SUITESPARSE_MACOS_ARCH}" ]; then export CFLAGS="-arch ${SUITESPARSE_MACOS_ARCH}" @@ -50,12 +51,13 @@ if [ -n "${GRAPHBLAS_PREFIX}" ]; then cmake_params+=(-DCMAKE_INSTALL_PREFIX="${GRAPHBLAS_PREFIX}") fi -curl -L https://github.com/DrTimothyAldenDavis/GraphBLAS/archive/refs/tags/v${VERSION}.tar.gz | tar xzf - -cd GraphBLAS-${VERSION}/build +curl -L "https://github.com/DrTimothyAldenDavis/GraphBLAS/archive/refs/tags/v${VERSION}.tar.gz" | tar xzf - +cd "GraphBLAS-${VERSION}/build" || exit # Disable optimizing some rarely-used types for significantly faster builds and significantly smaller wheel size. # Also the build with all types enabled sometimes stalls on GitHub Actions. Probably due to exceeded resource limits. # These can still be used, they'll just have reduced performance (AFAIK similar to UDTs). +# shellcheck disable=SC2129 # echo "#define GxB_NO_BOOL 1" >> ../Source/GB_control.h # # echo "#define GxB_NO_FP32 1" >> ../Source/GB_control.h # # echo "#define GxB_NO_FP64 1" >> ../Source/GB_control.h # @@ -74,6 +76,7 @@ if [ -n "${SUITESPARSE_FAST_BUILD}" ]; then echo "suitesparse.sh: Fast build requested." # Disable optimizing even more types. This is for builds that don't finish in runner resource limits, # such as emulated aarm64. + # shellcheck disable=SC2129 # echo "#define GxB_NO_BOOL 1" >> ../Source/GB_control.h # echo "#define GxB_NO_FP32 1" >> ../Source/GB_control.h @@ -93,6 +96,7 @@ fi if [ -n "${SUITESPARSE_FASTEST_BUILD}" ]; then echo "suitesparse.sh: Fastest build requested." # Fastest build possible. For use in development and automated tests that do not depend on performance. + # shellcheck disable=SC2129 echo "#define GxB_NO_BOOL 1" >> ../Source/GB_control.h echo "#define GxB_NO_FP32 1" >> ../Source/GB_control.h @@ -137,7 +141,7 @@ else fi cmake .. -DCMAKE_BUILD_TYPE=Release -G 'Unix Makefiles' "${cmake_params[@]}" -make -j$NPROC +make -j"$NPROC" $SUDO make install if [ -n "${CMAKE_GNUtoMS}" ]; then diff --git a/suitesparse_graphblas/create_headers.py b/suitesparse_graphblas/create_headers.py index fbfbd0f..0ec57fb 100644 --- a/suitesparse_graphblas/create_headers.py +++ b/suitesparse_graphblas/create_headers.py @@ -279,7 +279,8 @@ def groupby(index, seq): "GRB_SUBVERSION", "GxB_NTHREADS", "GxB_CHUNK", - "GxB_GPU_ID", + "GxB_GPU_IDS", + "GxB_NGPUS", "GxB_HYPERSPARSE", "GxB_SPARSE", "GxB_BITMAP", diff --git a/suitesparse_graphblas/io/binary.py b/suitesparse_graphblas/io/binary.py index 0248e7b..4e95931 100644 --- a/suitesparse_graphblas/io/binary.py +++ b/suitesparse_graphblas/io/binary.py @@ -6,11 +6,9 @@ from suitesparse_graphblas import __version__, check_status, ffi, lib, matrix stdffi = FFI() -stdffi.cdef( - """ +stdffi.cdef(""" void *malloc(size_t size); -""" -) +""") stdlib = stdffi.dlopen(find_library("c")) # When "packing" a matrix the owner of the memory buffer is transfered diff --git a/suitesparse_graphblas/suitesparse_graphblas.h b/suitesparse_graphblas/suitesparse_graphblas.h index f0a4b44..2e3e66b 100644 --- a/suitesparse_graphblas/suitesparse_graphblas.h +++ b/suitesparse_graphblas/suitesparse_graphblas.h @@ -24,6 +24,7 @@ typedef struct GB_SelectOp_opaque *GxB_SelectOp; typedef struct GxB_Container_struct *GxB_Container; /* GxB typedefs (functions) */ +typedef int64_t (*GxB_print_function)(char *string, size_t string_size, const void *value, int verbose); typedef void (*GxB_binary_function)(void *, const void *, const void *); typedef void (*GxB_index_binary_function)(void *, const void *, GrB_Index, GrB_Index, const void *, GrB_Index, GrB_Index, const void *); typedef void (*GxB_index_unary_function)(void *z, const void *x, GrB_Index i, GrB_Index j, const void *y); @@ -166,7 +167,8 @@ typedef enum { GxB_CONTEXT_NTHREADS = 7086, GxB_CONTEXT_CHUNK = 7087, - GxB_CONTEXT_GPU_ID = 7088 + GxB_CONTEXT_NGPUS = 7102, + GxB_CONTEXT_GPU_IDS = 7101 } GxB_Context_Field; typedef enum @@ -256,7 +258,9 @@ typedef enum GxB_FREE_FUNCTION = 7040, GxB_GLOBAL_NTHREADS = 7086, GxB_GLOBAL_CHUNK = 7087, - GxB_GLOBAL_GPU_ID = 7088, + GxB_GLOBAL_NGPUS = 7102, + GxB_GLOBAL_GPU_IDS = 7101, + GxB_NGPUS_MAX = 7103, GxB_BURBLE = 7019, GxB_PRINTF = 7020, GxB_FLUSH = 7021, @@ -273,7 +277,8 @@ typedef enum GxB_JIT_C_CMAKE_LIBS = 7031, GxB_JIT_USE_CMAKE = 7032, GxB_JIT_ERROR_LOG = 7033, - GxB_JIT_CUDA_PREFACE = 7100 + GxB_JIT_CUDA_PREFACE = 7100, + GxB_PRINT_FUNCTION = 7104 } GxB_Option_Field; typedef enum @@ -3757,7 +3762,7 @@ GrB_Info GxB_unload_Vector_into_Container(GrB_Vector V, GxB_Container Container, #define GxB_END ... #define GxB_FAST_IMPORT ... #define GxB_FULL ... -#define GxB_GPU_ID ... +#define GxB_GPU_IDS ... #define GxB_HYPERSPARSE ... #define GxB_IMPLEMENTATION ... #define GxB_IMPLEMENTATION_MAJOR ... @@ -3767,6 +3772,7 @@ GrB_Info GxB_unload_Vector_into_Container(GrB_Vector V, GxB_Container Container, #define GxB_INDEX_MAX ... #define GxB_MAX_NAME_LEN ... #define GxB_NBITMAP_SWITCH ... +#define GxB_NGPUS ... #define GxB_NTHREADS ... #define GxB_RANGE ... #define GxB_SPARSE ... diff --git a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h index 86a6798..4376bec 100644 --- a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h +++ b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h @@ -22,6 +22,7 @@ typedef struct GB_SelectOp_opaque *GxB_SelectOp; typedef struct GxB_Container_struct *GxB_Container; /* GxB typedefs (functions) */ +typedef int64_t (*GxB_print_function)(char *string, size_t string_size, const void *value, int verbose); typedef void (*GxB_binary_function)(void *, const void *, const void *); typedef void (*GxB_index_binary_function)(void *, const void *, GrB_Index, GrB_Index, const void *, GrB_Index, GrB_Index, const void *); typedef void (*GxB_index_unary_function)(void *z, const void *x, GrB_Index i, GrB_Index j, const void *y); @@ -162,7 +163,8 @@ typedef enum { GxB_CONTEXT_NTHREADS = 7086, GxB_CONTEXT_CHUNK = 7087, - GxB_CONTEXT_GPU_ID = 7088 + GxB_CONTEXT_NGPUS = 7102, + GxB_CONTEXT_GPU_IDS = 7101 } GxB_Context_Field; typedef enum @@ -252,7 +254,9 @@ typedef enum GxB_FREE_FUNCTION = 7040, GxB_GLOBAL_NTHREADS = 7086, GxB_GLOBAL_CHUNK = 7087, - GxB_GLOBAL_GPU_ID = 7088, + GxB_GLOBAL_NGPUS = 7102, + GxB_GLOBAL_GPU_IDS = 7101, + GxB_NGPUS_MAX = 7103, GxB_BURBLE = 7019, GxB_PRINTF = 7020, GxB_FLUSH = 7021, @@ -269,7 +273,8 @@ typedef enum GxB_JIT_C_CMAKE_LIBS = 7031, GxB_JIT_USE_CMAKE = 7032, GxB_JIT_ERROR_LOG = 7033, - GxB_JIT_CUDA_PREFACE = 7100 + GxB_JIT_CUDA_PREFACE = 7100, + GxB_PRINT_FUNCTION = 7104 } GxB_Option_Field; typedef enum @@ -3523,7 +3528,7 @@ GrB_Info GxB_unload_Vector_into_Container(GrB_Vector V, GxB_Container Container, #define GxB_END ... #define GxB_FAST_IMPORT ... #define GxB_FULL ... -#define GxB_GPU_ID ... +#define GxB_GPU_IDS ... #define GxB_HYPERSPARSE ... #define GxB_IMPLEMENTATION ... #define GxB_IMPLEMENTATION_MAJOR ... @@ -3533,6 +3538,7 @@ GrB_Info GxB_unload_Vector_into_Container(GrB_Vector V, GxB_Container Container, #define GxB_INDEX_MAX ... #define GxB_MAX_NAME_LEN ... #define GxB_NBITMAP_SWITCH ... +#define GxB_NGPUS ... #define GxB_NTHREADS ... #define GxB_RANGE ... #define GxB_SPARSE ... diff --git a/suitesparse_graphblas/utils.pyx b/suitesparse_graphblas/utils.pyx index 95d2f1b..5c9ae99 100644 --- a/suitesparse_graphblas/utils.pyx +++ b/suitesparse_graphblas/utils.pyx @@ -1,3 +1,9 @@ +# cython: freethreading_compatible=True +# +# We don't do anything special to support free-threading, but GraphBLAS C +# libraries are required to be thread-safe, so things should "just work". +# Of course, users writing multithreaded code can find many creative ways +# to fail, but python-suitesparse-graphblas shouldn't crash. import numpy as np from cpython.ref cimport Py_INCREF from libc.stdint cimport uintptr_t From be8b246c3be51300fa24ad56d5ddade890fd28ad Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 Apr 2026 08:25:16 -0700 Subject: [PATCH 167/193] Bump actions/upload-artifact from 4 to 7 (#144) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 7. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v4...v7) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/wheels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 05bebdd..042ab0d 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -45,7 +45,7 @@ jobs: - name: Check metadata run: pipx run twine check dist/* - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v7 with: name: sdist path: dist/*.tar.gz @@ -181,7 +181,7 @@ jobs: CIBW_TEST_SKIP: ${{ matrix.cibw_test_skip }} - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v7 with: name: wheels-${{ matrix.os }}-${{ matrix.cibw_archs }}${{ matrix.arch_note}} path: wheelhouse/*.whl From 2f536cbcc80c9d51553f4d264e11b22e6edc2764 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 Apr 2026 08:26:05 -0700 Subject: [PATCH 168/193] Bump actions/download-artifact from 5 to 8 (#143) Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 5 to 8. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v5...v8) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-version: '8' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 042ab0d..591ca63 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -200,7 +200,7 @@ jobs: with: python-version: "3.x" - - uses: actions/download-artifact@v5 + - uses: actions/download-artifact@v8 with: path: dist merge-multiple: true From de3da783ce427e99a048296ba92330f3f7488474 Mon Sep 17 00:00:00 2001 From: Michel Pelletier Date: Tue, 7 Apr 2026 13:55:23 -0700 Subject: [PATCH 169/193] Complete element setter/getter functional API for all GraphBLAS types Previously matrix.py, vector.py, and scalar.py only exposed `set_bool` and `bool` functions for accessing elements, even though SuiteSparse:GraphBLAS supports many more types. This fills out the functional API to cover every type the C library supports, following the existing `set_bool` / `bool` pattern exactly. Adds setter/getter pairs for: int8, int16, int32, int64, uint8, uint16, uint32, uint64, fp32, fp64, fc32, fc64. The complex types (fc32, fc64) are gated on `supports_complex()` so the functions are only defined on builds compiled with SuiteSparse complex support enabled (fc32/fc64 are GxB extensions, and the standard suitesparse.sh build disables them via GxB_NO_FC32 / GxB_NO_FC64). Each new function carries a doctest that round-trips a value through its setter and getter. Doctest counts after this change: matrix: 97 attempted, 0 failed vector: 90 attempted, 0 failed scalar: 81 attempted, 0 failed total: 268 attempted, 0 failed --- suitesparse_graphblas/matrix.py | 313 ++++++++++++++++++++++++++++- suitesparse_graphblas/scalar.py | 337 +++++++++++++++++++++++++++++++- suitesparse_graphblas/vector.py | 313 ++++++++++++++++++++++++++++- 3 files changed, 960 insertions(+), 3 deletions(-) diff --git a/suitesparse_graphblas/matrix.py b/suitesparse_graphblas/matrix.py index 5efa15d..9f8d10a 100644 --- a/suitesparse_graphblas/matrix.py +++ b/suitesparse_graphblas/matrix.py @@ -1,4 +1,4 @@ -from suitesparse_graphblas import check_status, ffi, lib +from suitesparse_graphblas import check_status, ffi, lib, supports_complex from .io.serialize import deserialize_matrix as deserialize # noqa: F401 from .io.serialize import serialize_matrix as serialize # noqa: F401 @@ -200,3 +200,314 @@ def bool(A, i, j): value = ffi.new("bool*") check_status(A, lib.GrB_Matrix_extractElement_BOOL(value, A[0], i, j)) return value[0] + + +def set_int8(A, value, i, j): + """Set an int8 value to the matrix at row `i` column `j`. + + >>> A = new(lib.GrB_INT8, 3, 3) + >>> set_int8(A, 7, 2, 2) + >>> int8(A, 2, 2) == 7 + True + + """ + check_status(A, lib.GrB_Matrix_setElement_INT8(A[0], value, i, j)) + + +def int8(A, i, j): + """Get an int8 value from the matrix at row `i` column `j`. + + >>> A = new(lib.GrB_INT8, 3, 3) + >>> set_int8(A, 7, 2, 2) + >>> int8(A, 2, 2) == 7 + True + + """ + value = ffi.new("int8_t*") + check_status(A, lib.GrB_Matrix_extractElement_INT8(value, A[0], i, j)) + return value[0] + + +def set_int16(A, value, i, j): + """Set an int16 value to the matrix at row `i` column `j`. + + >>> A = new(lib.GrB_INT16, 3, 3) + >>> set_int16(A, 7, 2, 2) + >>> int16(A, 2, 2) == 7 + True + + """ + check_status(A, lib.GrB_Matrix_setElement_INT16(A[0], value, i, j)) + + +def int16(A, i, j): + """Get an int16 value from the matrix at row `i` column `j`. + + >>> A = new(lib.GrB_INT16, 3, 3) + >>> set_int16(A, 7, 2, 2) + >>> int16(A, 2, 2) == 7 + True + + """ + value = ffi.new("int16_t*") + check_status(A, lib.GrB_Matrix_extractElement_INT16(value, A[0], i, j)) + return value[0] + + +def set_int32(A, value, i, j): + """Set an int32 value to the matrix at row `i` column `j`. + + >>> A = new(lib.GrB_INT32, 3, 3) + >>> set_int32(A, 7, 2, 2) + >>> int32(A, 2, 2) == 7 + True + + """ + check_status(A, lib.GrB_Matrix_setElement_INT32(A[0], value, i, j)) + + +def int32(A, i, j): + """Get an int32 value from the matrix at row `i` column `j`. + + >>> A = new(lib.GrB_INT32, 3, 3) + >>> set_int32(A, 7, 2, 2) + >>> int32(A, 2, 2) == 7 + True + + """ + value = ffi.new("int32_t*") + check_status(A, lib.GrB_Matrix_extractElement_INT32(value, A[0], i, j)) + return value[0] + + +def set_int64(A, value, i, j): + """Set an int64 value to the matrix at row `i` column `j`. + + >>> A = new(lib.GrB_INT64, 3, 3) + >>> set_int64(A, 7, 2, 2) + >>> int64(A, 2, 2) == 7 + True + + """ + check_status(A, lib.GrB_Matrix_setElement_INT64(A[0], value, i, j)) + + +def int64(A, i, j): + """Get an int64 value from the matrix at row `i` column `j`. + + >>> A = new(lib.GrB_INT64, 3, 3) + >>> set_int64(A, 7, 2, 2) + >>> int64(A, 2, 2) == 7 + True + + """ + value = ffi.new("int64_t*") + check_status(A, lib.GrB_Matrix_extractElement_INT64(value, A[0], i, j)) + return value[0] + + +def set_uint8(A, value, i, j): + """Set a uint8 value to the matrix at row `i` column `j`. + + >>> A = new(lib.GrB_UINT8, 3, 3) + >>> set_uint8(A, 7, 2, 2) + >>> uint8(A, 2, 2) == 7 + True + + """ + check_status(A, lib.GrB_Matrix_setElement_UINT8(A[0], value, i, j)) + + +def uint8(A, i, j): + """Get a uint8 value from the matrix at row `i` column `j`. + + >>> A = new(lib.GrB_UINT8, 3, 3) + >>> set_uint8(A, 7, 2, 2) + >>> uint8(A, 2, 2) == 7 + True + + """ + value = ffi.new("uint8_t*") + check_status(A, lib.GrB_Matrix_extractElement_UINT8(value, A[0], i, j)) + return value[0] + + +def set_uint16(A, value, i, j): + """Set a uint16 value to the matrix at row `i` column `j`. + + >>> A = new(lib.GrB_UINT16, 3, 3) + >>> set_uint16(A, 7, 2, 2) + >>> uint16(A, 2, 2) == 7 + True + + """ + check_status(A, lib.GrB_Matrix_setElement_UINT16(A[0], value, i, j)) + + +def uint16(A, i, j): + """Get a uint16 value from the matrix at row `i` column `j`. + + >>> A = new(lib.GrB_UINT16, 3, 3) + >>> set_uint16(A, 7, 2, 2) + >>> uint16(A, 2, 2) == 7 + True + + """ + value = ffi.new("uint16_t*") + check_status(A, lib.GrB_Matrix_extractElement_UINT16(value, A[0], i, j)) + return value[0] + + +def set_uint32(A, value, i, j): + """Set a uint32 value to the matrix at row `i` column `j`. + + >>> A = new(lib.GrB_UINT32, 3, 3) + >>> set_uint32(A, 7, 2, 2) + >>> uint32(A, 2, 2) == 7 + True + + """ + check_status(A, lib.GrB_Matrix_setElement_UINT32(A[0], value, i, j)) + + +def uint32(A, i, j): + """Get a uint32 value from the matrix at row `i` column `j`. + + >>> A = new(lib.GrB_UINT32, 3, 3) + >>> set_uint32(A, 7, 2, 2) + >>> uint32(A, 2, 2) == 7 + True + + """ + value = ffi.new("uint32_t*") + check_status(A, lib.GrB_Matrix_extractElement_UINT32(value, A[0], i, j)) + return value[0] + + +def set_uint64(A, value, i, j): + """Set a uint64 value to the matrix at row `i` column `j`. + + >>> A = new(lib.GrB_UINT64, 3, 3) + >>> set_uint64(A, 7, 2, 2) + >>> uint64(A, 2, 2) == 7 + True + + """ + check_status(A, lib.GrB_Matrix_setElement_UINT64(A[0], value, i, j)) + + +def uint64(A, i, j): + """Get a uint64 value from the matrix at row `i` column `j`. + + >>> A = new(lib.GrB_UINT64, 3, 3) + >>> set_uint64(A, 7, 2, 2) + >>> uint64(A, 2, 2) == 7 + True + + """ + value = ffi.new("uint64_t*") + check_status(A, lib.GrB_Matrix_extractElement_UINT64(value, A[0], i, j)) + return value[0] + + +def set_fp32(A, value, i, j): + """Set an fp32 value to the matrix at row `i` column `j`. + + >>> A = new(lib.GrB_FP32, 3, 3) + >>> set_fp32(A, 1.5, 2, 2) + >>> fp32(A, 2, 2) == 1.5 + True + + """ + check_status(A, lib.GrB_Matrix_setElement_FP32(A[0], value, i, j)) + + +def fp32(A, i, j): + """Get an fp32 value from the matrix at row `i` column `j`. + + >>> A = new(lib.GrB_FP32, 3, 3) + >>> set_fp32(A, 1.5, 2, 2) + >>> fp32(A, 2, 2) == 1.5 + True + + """ + value = ffi.new("float*") + check_status(A, lib.GrB_Matrix_extractElement_FP32(value, A[0], i, j)) + return value[0] + + +def set_fp64(A, value, i, j): + """Set an fp64 value to the matrix at row `i` column `j`. + + >>> A = new(lib.GrB_FP64, 3, 3) + >>> set_fp64(A, 1.5, 2, 2) + >>> fp64(A, 2, 2) == 1.5 + True + + """ + check_status(A, lib.GrB_Matrix_setElement_FP64(A[0], value, i, j)) + + +def fp64(A, i, j): + """Get an fp64 value from the matrix at row `i` column `j`. + + >>> A = new(lib.GrB_FP64, 3, 3) + >>> set_fp64(A, 1.5, 2, 2) + >>> fp64(A, 2, 2) == 1.5 + True + + """ + value = ffi.new("double*") + check_status(A, lib.GrB_Matrix_extractElement_FP64(value, A[0], i, j)) + return value[0] + + +if supports_complex(): + + def set_fc32(A, value, i, j): + """Set an fc32 value to the matrix at row `i` column `j`. + + >>> A = new(lib.GxB_FC32, 3, 3) + >>> set_fc32(A, 2+3j, 2, 2) + >>> fc32(A, 2, 2) == 2+3j + True + + """ + check_status(A, lib.GxB_Matrix_setElement_FC32(A[0], value, i, j)) + + def fc32(A, i, j): + """Get an fc32 value from the matrix at row `i` column `j`. + + >>> A = new(lib.GxB_FC32, 3, 3) + >>> set_fc32(A, 2+3j, 2, 2) + >>> fc32(A, 2, 2) == 2+3j + True + + """ + value = ffi.new("GxB_FC32_t*") + check_status(A, lib.GxB_Matrix_extractElement_FC32(value, A[0], i, j)) + return value[0] + + def set_fc64(A, value, i, j): + """Set an fc64 value to the matrix at row `i` column `j`. + + >>> A = new(lib.GxB_FC64, 3, 3) + >>> set_fc64(A, 2+3j, 2, 2) + >>> fc64(A, 2, 2) == 2+3j + True + + """ + check_status(A, lib.GxB_Matrix_setElement_FC64(A[0], value, i, j)) + + def fc64(A, i, j): + """Get an fc64 value from the matrix at row `i` column `j`. + + >>> A = new(lib.GxB_FC64, 3, 3) + >>> set_fc64(A, 2+3j, 2, 2) + >>> fc64(A, 2, 2) == 2+3j + True + + """ + value = ffi.new("GxB_FC64_t*") + check_status(A, lib.GxB_Matrix_extractElement_FC64(value, A[0], i, j)) + return value[0] diff --git a/suitesparse_graphblas/scalar.py b/suitesparse_graphblas/scalar.py index c0d5747..e072a8f 100644 --- a/suitesparse_graphblas/scalar.py +++ b/suitesparse_graphblas/scalar.py @@ -1,4 +1,4 @@ -from suitesparse_graphblas import check_status, exceptions, ffi, lib +from suitesparse_graphblas import check_status, exceptions, ffi, lib, supports_complex def free(v): @@ -63,3 +63,338 @@ def bool(s): if res == exceptions.NoValue: return None return value[0] + + +def set_int8(s, value): + """Set an int8 value to the scalar. + + >>> s = new(lib.GrB_INT8) + >>> set_int8(s, 7) + >>> int8(s) == 7 + True + + """ + check_status(s, lib.GxB_Scalar_setElement_INT8(s[0], value)) + + +def int8(s): + """Get an int8 value from the scalar. + + >>> s = new(lib.GrB_INT8) + >>> set_int8(s, 7) + >>> int8(s) == 7 + True + + """ + value = ffi.new("int8_t*") + res = check_status(s, lib.GxB_Scalar_extractElement_INT8(value, s[0])) + if res == exceptions.NoValue: + return None + return value[0] + + +def set_int16(s, value): + """Set an int16 value to the scalar. + + >>> s = new(lib.GrB_INT16) + >>> set_int16(s, 7) + >>> int16(s) == 7 + True + + """ + check_status(s, lib.GxB_Scalar_setElement_INT16(s[0], value)) + + +def int16(s): + """Get an int16 value from the scalar. + + >>> s = new(lib.GrB_INT16) + >>> set_int16(s, 7) + >>> int16(s) == 7 + True + + """ + value = ffi.new("int16_t*") + res = check_status(s, lib.GxB_Scalar_extractElement_INT16(value, s[0])) + if res == exceptions.NoValue: + return None + return value[0] + + +def set_int32(s, value): + """Set an int32 value to the scalar. + + >>> s = new(lib.GrB_INT32) + >>> set_int32(s, 7) + >>> int32(s) == 7 + True + + """ + check_status(s, lib.GxB_Scalar_setElement_INT32(s[0], value)) + + +def int32(s): + """Get an int32 value from the scalar. + + >>> s = new(lib.GrB_INT32) + >>> set_int32(s, 7) + >>> int32(s) == 7 + True + + """ + value = ffi.new("int32_t*") + res = check_status(s, lib.GxB_Scalar_extractElement_INT32(value, s[0])) + if res == exceptions.NoValue: + return None + return value[0] + + +def set_int64(s, value): + """Set an int64 value to the scalar. + + >>> s = new(lib.GrB_INT64) + >>> set_int64(s, 7) + >>> int64(s) == 7 + True + + """ + check_status(s, lib.GxB_Scalar_setElement_INT64(s[0], value)) + + +def int64(s): + """Get an int64 value from the scalar. + + >>> s = new(lib.GrB_INT64) + >>> set_int64(s, 7) + >>> int64(s) == 7 + True + + """ + value = ffi.new("int64_t*") + res = check_status(s, lib.GxB_Scalar_extractElement_INT64(value, s[0])) + if res == exceptions.NoValue: + return None + return value[0] + + +def set_uint8(s, value): + """Set a uint8 value to the scalar. + + >>> s = new(lib.GrB_UINT8) + >>> set_uint8(s, 7) + >>> uint8(s) == 7 + True + + """ + check_status(s, lib.GxB_Scalar_setElement_UINT8(s[0], value)) + + +def uint8(s): + """Get a uint8 value from the scalar. + + >>> s = new(lib.GrB_UINT8) + >>> set_uint8(s, 7) + >>> uint8(s) == 7 + True + + """ + value = ffi.new("uint8_t*") + res = check_status(s, lib.GxB_Scalar_extractElement_UINT8(value, s[0])) + if res == exceptions.NoValue: + return None + return value[0] + + +def set_uint16(s, value): + """Set a uint16 value to the scalar. + + >>> s = new(lib.GrB_UINT16) + >>> set_uint16(s, 7) + >>> uint16(s) == 7 + True + + """ + check_status(s, lib.GxB_Scalar_setElement_UINT16(s[0], value)) + + +def uint16(s): + """Get a uint16 value from the scalar. + + >>> s = new(lib.GrB_UINT16) + >>> set_uint16(s, 7) + >>> uint16(s) == 7 + True + + """ + value = ffi.new("uint16_t*") + res = check_status(s, lib.GxB_Scalar_extractElement_UINT16(value, s[0])) + if res == exceptions.NoValue: + return None + return value[0] + + +def set_uint32(s, value): + """Set a uint32 value to the scalar. + + >>> s = new(lib.GrB_UINT32) + >>> set_uint32(s, 7) + >>> uint32(s) == 7 + True + + """ + check_status(s, lib.GxB_Scalar_setElement_UINT32(s[0], value)) + + +def uint32(s): + """Get a uint32 value from the scalar. + + >>> s = new(lib.GrB_UINT32) + >>> set_uint32(s, 7) + >>> uint32(s) == 7 + True + + """ + value = ffi.new("uint32_t*") + res = check_status(s, lib.GxB_Scalar_extractElement_UINT32(value, s[0])) + if res == exceptions.NoValue: + return None + return value[0] + + +def set_uint64(s, value): + """Set a uint64 value to the scalar. + + >>> s = new(lib.GrB_UINT64) + >>> set_uint64(s, 7) + >>> uint64(s) == 7 + True + + """ + check_status(s, lib.GxB_Scalar_setElement_UINT64(s[0], value)) + + +def uint64(s): + """Get a uint64 value from the scalar. + + >>> s = new(lib.GrB_UINT64) + >>> set_uint64(s, 7) + >>> uint64(s) == 7 + True + + """ + value = ffi.new("uint64_t*") + res = check_status(s, lib.GxB_Scalar_extractElement_UINT64(value, s[0])) + if res == exceptions.NoValue: + return None + return value[0] + + +def set_fp32(s, value): + """Set an fp32 value to the scalar. + + >>> s = new(lib.GrB_FP32) + >>> set_fp32(s, 1.5) + >>> fp32(s) == 1.5 + True + + """ + check_status(s, lib.GxB_Scalar_setElement_FP32(s[0], value)) + + +def fp32(s): + """Get an fp32 value from the scalar. + + >>> s = new(lib.GrB_FP32) + >>> set_fp32(s, 1.5) + >>> fp32(s) == 1.5 + True + + """ + value = ffi.new("float*") + res = check_status(s, lib.GxB_Scalar_extractElement_FP32(value, s[0])) + if res == exceptions.NoValue: + return None + return value[0] + + +def set_fp64(s, value): + """Set an fp64 value to the scalar. + + >>> s = new(lib.GrB_FP64) + >>> set_fp64(s, 1.5) + >>> fp64(s) == 1.5 + True + + """ + check_status(s, lib.GxB_Scalar_setElement_FP64(s[0], value)) + + +def fp64(s): + """Get an fp64 value from the scalar. + + >>> s = new(lib.GrB_FP64) + >>> set_fp64(s, 1.5) + >>> fp64(s) == 1.5 + True + + """ + value = ffi.new("double*") + res = check_status(s, lib.GxB_Scalar_extractElement_FP64(value, s[0])) + if res == exceptions.NoValue: + return None + return value[0] + + +if supports_complex(): + + def set_fc32(s, value): + """Set an fc32 value to the scalar. + + >>> s = new(lib.GxB_FC32) + >>> set_fc32(s, 2+3j) + >>> fc32(s) == 2+3j + True + + """ + check_status(s, lib.GxB_Scalar_setElement_FC32(s[0], value)) + + def fc32(s): + """Get an fc32 value from the scalar. + + >>> s = new(lib.GxB_FC32) + >>> set_fc32(s, 2+3j) + >>> fc32(s) == 2+3j + True + + """ + value = ffi.new("GxB_FC32_t*") + res = check_status(s, lib.GxB_Scalar_extractElement_FC32(value, s[0])) + if res == exceptions.NoValue: + return None + return value[0] + + def set_fc64(s, value): + """Set an fc64 value to the scalar. + + >>> s = new(lib.GxB_FC64) + >>> set_fc64(s, 2+3j) + >>> fc64(s) == 2+3j + True + + """ + check_status(s, lib.GxB_Scalar_setElement_FC64(s[0], value)) + + def fc64(s): + """Get an fc64 value from the scalar. + + >>> s = new(lib.GxB_FC64) + >>> set_fc64(s, 2+3j) + >>> fc64(s) == 2+3j + True + + """ + value = ffi.new("GxB_FC64_t*") + res = check_status(s, lib.GxB_Scalar_extractElement_FC64(value, s[0])) + if res == exceptions.NoValue: + return None + return value[0] diff --git a/suitesparse_graphblas/vector.py b/suitesparse_graphblas/vector.py index a6a15c6..412b9da 100644 --- a/suitesparse_graphblas/vector.py +++ b/suitesparse_graphblas/vector.py @@ -1,4 +1,4 @@ -from suitesparse_graphblas import check_status, ffi, lib +from suitesparse_graphblas import check_status, ffi, lib, supports_complex from .io.serialize import deserialize_vector as deserialize # noqa: F401 from .io.serialize import serialize_vector as serialize # noqa: F401 @@ -101,3 +101,314 @@ def bool(v, i): value = ffi.new("bool*") check_status(v, lib.GrB_Vector_extractElement_BOOL(value, v[0], i)) return value[0] + + +def set_int8(v, value, i): + """Set an int8 value to the vector at position `i`. + + >>> v = new(lib.GrB_INT8, 3) + >>> set_int8(v, 7, 2) + >>> int8(v, 2) == 7 + True + + """ + check_status(v, lib.GrB_Vector_setElement_INT8(v[0], value, i)) + + +def int8(v, i): + """Get an int8 value from the vector at position `i`. + + >>> v = new(lib.GrB_INT8, 3) + >>> set_int8(v, 7, 2) + >>> int8(v, 2) == 7 + True + + """ + value = ffi.new("int8_t*") + check_status(v, lib.GrB_Vector_extractElement_INT8(value, v[0], i)) + return value[0] + + +def set_int16(v, value, i): + """Set an int16 value to the vector at position `i`. + + >>> v = new(lib.GrB_INT16, 3) + >>> set_int16(v, 7, 2) + >>> int16(v, 2) == 7 + True + + """ + check_status(v, lib.GrB_Vector_setElement_INT16(v[0], value, i)) + + +def int16(v, i): + """Get an int16 value from the vector at position `i`. + + >>> v = new(lib.GrB_INT16, 3) + >>> set_int16(v, 7, 2) + >>> int16(v, 2) == 7 + True + + """ + value = ffi.new("int16_t*") + check_status(v, lib.GrB_Vector_extractElement_INT16(value, v[0], i)) + return value[0] + + +def set_int32(v, value, i): + """Set an int32 value to the vector at position `i`. + + >>> v = new(lib.GrB_INT32, 3) + >>> set_int32(v, 7, 2) + >>> int32(v, 2) == 7 + True + + """ + check_status(v, lib.GrB_Vector_setElement_INT32(v[0], value, i)) + + +def int32(v, i): + """Get an int32 value from the vector at position `i`. + + >>> v = new(lib.GrB_INT32, 3) + >>> set_int32(v, 7, 2) + >>> int32(v, 2) == 7 + True + + """ + value = ffi.new("int32_t*") + check_status(v, lib.GrB_Vector_extractElement_INT32(value, v[0], i)) + return value[0] + + +def set_int64(v, value, i): + """Set an int64 value to the vector at position `i`. + + >>> v = new(lib.GrB_INT64, 3) + >>> set_int64(v, 7, 2) + >>> int64(v, 2) == 7 + True + + """ + check_status(v, lib.GrB_Vector_setElement_INT64(v[0], value, i)) + + +def int64(v, i): + """Get an int64 value from the vector at position `i`. + + >>> v = new(lib.GrB_INT64, 3) + >>> set_int64(v, 7, 2) + >>> int64(v, 2) == 7 + True + + """ + value = ffi.new("int64_t*") + check_status(v, lib.GrB_Vector_extractElement_INT64(value, v[0], i)) + return value[0] + + +def set_uint8(v, value, i): + """Set a uint8 value to the vector at position `i`. + + >>> v = new(lib.GrB_UINT8, 3) + >>> set_uint8(v, 7, 2) + >>> uint8(v, 2) == 7 + True + + """ + check_status(v, lib.GrB_Vector_setElement_UINT8(v[0], value, i)) + + +def uint8(v, i): + """Get a uint8 value from the vector at position `i`. + + >>> v = new(lib.GrB_UINT8, 3) + >>> set_uint8(v, 7, 2) + >>> uint8(v, 2) == 7 + True + + """ + value = ffi.new("uint8_t*") + check_status(v, lib.GrB_Vector_extractElement_UINT8(value, v[0], i)) + return value[0] + + +def set_uint16(v, value, i): + """Set a uint16 value to the vector at position `i`. + + >>> v = new(lib.GrB_UINT16, 3) + >>> set_uint16(v, 7, 2) + >>> uint16(v, 2) == 7 + True + + """ + check_status(v, lib.GrB_Vector_setElement_UINT16(v[0], value, i)) + + +def uint16(v, i): + """Get a uint16 value from the vector at position `i`. + + >>> v = new(lib.GrB_UINT16, 3) + >>> set_uint16(v, 7, 2) + >>> uint16(v, 2) == 7 + True + + """ + value = ffi.new("uint16_t*") + check_status(v, lib.GrB_Vector_extractElement_UINT16(value, v[0], i)) + return value[0] + + +def set_uint32(v, value, i): + """Set a uint32 value to the vector at position `i`. + + >>> v = new(lib.GrB_UINT32, 3) + >>> set_uint32(v, 7, 2) + >>> uint32(v, 2) == 7 + True + + """ + check_status(v, lib.GrB_Vector_setElement_UINT32(v[0], value, i)) + + +def uint32(v, i): + """Get a uint32 value from the vector at position `i`. + + >>> v = new(lib.GrB_UINT32, 3) + >>> set_uint32(v, 7, 2) + >>> uint32(v, 2) == 7 + True + + """ + value = ffi.new("uint32_t*") + check_status(v, lib.GrB_Vector_extractElement_UINT32(value, v[0], i)) + return value[0] + + +def set_uint64(v, value, i): + """Set a uint64 value to the vector at position `i`. + + >>> v = new(lib.GrB_UINT64, 3) + >>> set_uint64(v, 7, 2) + >>> uint64(v, 2) == 7 + True + + """ + check_status(v, lib.GrB_Vector_setElement_UINT64(v[0], value, i)) + + +def uint64(v, i): + """Get a uint64 value from the vector at position `i`. + + >>> v = new(lib.GrB_UINT64, 3) + >>> set_uint64(v, 7, 2) + >>> uint64(v, 2) == 7 + True + + """ + value = ffi.new("uint64_t*") + check_status(v, lib.GrB_Vector_extractElement_UINT64(value, v[0], i)) + return value[0] + + +def set_fp32(v, value, i): + """Set an fp32 value to the vector at position `i`. + + >>> v = new(lib.GrB_FP32, 3) + >>> set_fp32(v, 1.5, 2) + >>> fp32(v, 2) == 1.5 + True + + """ + check_status(v, lib.GrB_Vector_setElement_FP32(v[0], value, i)) + + +def fp32(v, i): + """Get an fp32 value from the vector at position `i`. + + >>> v = new(lib.GrB_FP32, 3) + >>> set_fp32(v, 1.5, 2) + >>> fp32(v, 2) == 1.5 + True + + """ + value = ffi.new("float*") + check_status(v, lib.GrB_Vector_extractElement_FP32(value, v[0], i)) + return value[0] + + +def set_fp64(v, value, i): + """Set an fp64 value to the vector at position `i`. + + >>> v = new(lib.GrB_FP64, 3) + >>> set_fp64(v, 1.5, 2) + >>> fp64(v, 2) == 1.5 + True + + """ + check_status(v, lib.GrB_Vector_setElement_FP64(v[0], value, i)) + + +def fp64(v, i): + """Get an fp64 value from the vector at position `i`. + + >>> v = new(lib.GrB_FP64, 3) + >>> set_fp64(v, 1.5, 2) + >>> fp64(v, 2) == 1.5 + True + + """ + value = ffi.new("double*") + check_status(v, lib.GrB_Vector_extractElement_FP64(value, v[0], i)) + return value[0] + + +if supports_complex(): + + def set_fc32(v, value, i): + """Set an fc32 value to the vector at position `i`. + + >>> v = new(lib.GxB_FC32, 3) + >>> set_fc32(v, 2+3j, 2) + >>> fc32(v, 2) == 2+3j + True + + """ + check_status(v, lib.GxB_Vector_setElement_FC32(v[0], value, i)) + + def fc32(v, i): + """Get an fc32 value from the vector at position `i`. + + >>> v = new(lib.GxB_FC32, 3) + >>> set_fc32(v, 2+3j, 2) + >>> fc32(v, 2) == 2+3j + True + + """ + value = ffi.new("GxB_FC32_t*") + check_status(v, lib.GxB_Vector_extractElement_FC32(value, v[0], i)) + return value[0] + + def set_fc64(v, value, i): + """Set an fc64 value to the vector at position `i`. + + >>> v = new(lib.GxB_FC64, 3) + >>> set_fc64(v, 2+3j, 2) + >>> fc64(v, 2) == 2+3j + True + + """ + check_status(v, lib.GxB_Vector_setElement_FC64(v[0], value, i)) + + def fc64(v, i): + """Get an fc64 value from the vector at position `i`. + + >>> v = new(lib.GxB_FC64, 3) + >>> set_fc64(v, 2+3j, 2) + >>> fc64(v, 2) == 2+3j + True + + """ + value = ffi.new("GxB_FC64_t*") + check_status(v, lib.GxB_Vector_extractElement_FC64(value, v[0], i)) + return value[0] From 8d9738e4161df5a1e7e2033a7166117bcdf54f59 Mon Sep 17 00:00:00 2001 From: Michel Pelletier Date: Tue, 7 Apr 2026 13:55:53 -0700 Subject: [PATCH 170/193] Modernize Dockerfile to build against current Python and GraphBLAS The Dockerfile had bit-rotted: the python:3.10-slim-buster base image no longer builds (Debian buster apt repos are gone), and the most recent commit simultaneously dropped Python <=3.10 support in pyproject.toml while leaving the Dockerfile pinned to Python 3.10. Several install paths and cmake flags were also out of date for SuiteSparse:GraphBLAS 10.x. Changes: - Bump base image from python:3.10-slim-buster (EOL) to python:3.12-slim-bookworm. Update hardcoded python3.10 site-packages paths to python3.12 in three places. - Update GraphBLAS header copy: 10.x installs the header at /usr/include/suitesparse/GraphBLAS.h, not /usr/include/GraphBLAS.h, and create_headers.py looks for it at ${sys.prefix}/include/suitesparse/GraphBLAS.h. - Replace deprecated `python3 setup.py install` with `pip install --no-build-isolation --no-deps .`. The pip-driven path is required by modern setuptools, and pip is added to the build-time install list along with pycparser/setuptools/wheel/setuptools-git-versioning which the build now needs explicitly. - Add cmake flags matching CI in suitesparse.sh: -DCMAKE_BUILD_TYPE=Release, -DJITINIT=2, -DGRAPHBLAS_USE_JIT=OFF. The JIT flags avoid segfaults in tests; without them GraphBLAS may attempt JIT compilation at runtime. - Replace stale -DGBCOMPACT cmake flag with the current name -DCOMPACT, and give ARG COMPACT a default of 0 so the substitution is non-empty when the build-arg is omitted. - Make `git tag ${VERSION}` idempotent: wrap with `(... || true)` so the build does not fail when ${VERSION} matches an existing tag in the source tree (which is now the case for the current 10.3.1.0 release tag). - Fix Docker COPY collapsing the libgraphblas symlink chain (libgraphblas.so -> .so.10 -> .so.10.3.1) into three identical 67MB regular files. Copy only the real versioned library (libgraphblas.so.*.*.*) and recreate symlinks via `ln -sf` in a RUN step. Apply the same fix to libgomp in the final stage. This removes the `ldconfig: ... is not a symbolic link` warnings and saves ~130MB. - Cleanup: remove unused `ARG SUITESPARSE` redeclaration in the psg stage, fix the lowercase `as` -> `AS` for FromAsCasing warnings, and switch `ENV PYTHONUNBUFFERED 1` to the modern `ENV key=value` form. - Drop the bizarre `WORKDIR /build/GraphBLAS/build` that was set *before* the GraphBLAS git clone, producing the path /build/GraphBLAS/build/GraphBLAS/build. The clone now happens directly under /build. Built and verified by running the doctests inside the produced image: $ docker build --build-arg SUITESPARSE=v10.3.1 \\ --build-arg VERSION=10.3.1.0 \\ -t psg-test:latest . $ docker run --rm psg-test:latest python3 -c " import suitesparse_graphblas; suitesparse_graphblas.initialize() from suitesparse_graphblas.tests.test_doctest import test_run_doctests test_run_doctests()" -> 268 doctests pass, supports_complex=True --- Dockerfile | 58 ++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 17 deletions(-) diff --git a/Dockerfile b/Dockerfile index f20e91f..e20d1b6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,47 +1,71 @@ -ARG BASE_CONTAINER=python:3.10-slim-buster -FROM ${BASE_CONTAINER} as suitesparse +ARG BASE_CONTAINER=python:3.12-slim-bookworm +FROM ${BASE_CONTAINER} AS suitesparse ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install -yq build-essential cmake git ARG SUITESPARSE -ARG COMPACT +ARG COMPACT=0 WORKDIR /build RUN git clone https://github.com/eliben/pycparser.git --depth 1 -WORKDIR /build/GraphBLAS/build +# Use `-DJITINIT=2` so that the JIT functionality is available, but disabled by default. +# Level 2, "run", means that pre-JIT kernels may be used, which does not require a compiler at runtime. +# Disable JIT entirely to avoid segfaulting in tests (matches CI in suitesparse.sh). RUN git clone https://github.com/DrTimothyAldenDavis/GraphBLAS.git --depth 1 --branch ${SUITESPARSE} \ && cd GraphBLAS/build \ - && cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DGBCOMPACT=${COMPACT} \ + && cmake .. \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCOMPACT=${COMPACT} \ + -DJITINIT=2 \ + -DGRAPHBLAS_USE_JIT=OFF \ && make -j$(nproc) \ && make install -FROM ${BASE_CONTAINER} as psg -ARG SUITESPARSE +FROM ${BASE_CONTAINER} AS psg ARG VERSION -ENV PYTHONUNBUFFERED 1 +ENV PYTHONUNBUFFERED=1 -COPY --from=suitesparse /usr/include/GraphBLAS.h /usr/local/include/ -COPY --from=suitesparse /usr/lib/x86_64-linux-gnu/libgraphblas* /usr/lib/x86_64-linux-gnu/ -COPY --from=suitesparse /build/pycparser/utils/fake_libc_include/* /usr/local/lib/python3.10/site-packages/pycparser/utils/fake_libc_include/ +COPY --from=suitesparse /usr/include/suitesparse/GraphBLAS.h /usr/local/include/suitesparse/GraphBLAS.h +# Copy only the real versioned library; recreate symlinks (Docker COPY collapses cross-stage symlinks). +COPY --from=suitesparse /usr/lib/x86_64-linux-gnu/libgraphblas.so.*.*.* /usr/lib/x86_64-linux-gnu/ +RUN cd /usr/lib/x86_64-linux-gnu \ + && REAL=$(ls libgraphblas.so.*.*.*) \ + && SOMAJOR=libgraphblas.so.$(echo "$REAL" | sed -E 's/libgraphblas\.so\.([0-9]+).*/\1/') \ + && ln -sf "$REAL" "$SOMAJOR" \ + && ln -sf "$SOMAJOR" libgraphblas.so \ + && ldconfig RUN apt-get update && apt-get install -yq build-essential git -RUN pip3 install numpy cffi pytest cython +RUN pip3 install --break-system-packages numpy cffi pytest cython pycparser setuptools wheel setuptools-git-versioning + +COPY --from=suitesparse /build/pycparser/utils/fake_libc_include/* /usr/local/lib/python3.12/site-packages/pycparser/utils/fake_libc_include/ RUN mkdir -p /psg ADD . /psg WORKDIR /psg -RUN git tag ${VERSION} && \ +# `git tag || true` so the build is idempotent when ${VERSION} already matches an existing tag in the source tree. +RUN (git tag ${VERSION} || true) && \ python3 suitesparse_graphblas/create_headers.py && \ - python3 setup.py install && \ + pip3 install --break-system-packages --no-build-isolation --no-deps . && \ ldconfig #RUN pytest --pyargs suitesparse_graphblas.tests RUN apt-get -y --purge remove git python3-pip && apt-get clean FROM ${BASE_CONTAINER} -COPY --from=suitesparse /usr/lib/x86_64-linux-gnu/libgraphblas* /usr/lib/x86_64-linux-gnu/ -COPY --from=suitesparse /usr/lib/x86_64-linux-gnu/libgomp* /usr/lib/x86_64-linux-gnu/ -COPY --from=psg /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages +COPY --from=suitesparse /usr/lib/x86_64-linux-gnu/libgraphblas.so.*.*.* /usr/lib/x86_64-linux-gnu/ +COPY --from=suitesparse /usr/lib/x86_64-linux-gnu/libgomp.so.*.*.* /usr/lib/x86_64-linux-gnu/ +COPY --from=psg /usr/local/lib/python3.12/site-packages /usr/local/lib/python3.12/site-packages +RUN cd /usr/lib/x86_64-linux-gnu \ + && GBREAL=$(ls libgraphblas.so.*.*.*) \ + && GBSOMAJOR=libgraphblas.so.$(echo "$GBREAL" | sed -E 's/libgraphblas\.so\.([0-9]+).*/\1/') \ + && ln -sf "$GBREAL" "$GBSOMAJOR" \ + && ln -sf "$GBSOMAJOR" libgraphblas.so \ + && GMREAL=$(ls libgomp.so.*.*.*) \ + && GMSOMAJOR=libgomp.so.$(echo "$GMREAL" | sed -E 's/libgomp\.so\.([0-9]+).*/\1/') \ + && ln -sf "$GMREAL" "$GMSOMAJOR" \ + && ldconfig From 20664f0a41c302348bb721b65868ead5b3a4aef1 Mon Sep 17 00:00:00 2001 From: Michel Pelletier Date: Tue, 7 Apr 2026 16:30:24 -0700 Subject: [PATCH 171/193] Rename element getters to `get_*` in functional API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The element getter functions in matrix.py, vector.py, and scalar.py were named after their GraphBLAS type suffix — `bool`, `int8`, `fp32`, `fc64`, etc. — which can be confused with concrete type objects (e.g. NumPy's `int8` dtype). Prefix every getter with `get_`, mirroring the existing `set_` prefix on the corresponding setters: `bool` -> `get_bool`, `int32` -> `get_int32`, `fc64` -> `get_fc64`, etc. The setters (`set_bool`, `set_int8`, ...) are NOT renamed. This is a pure rename, not an API redesign. Implementations and doctests are otherwise unchanged. Each setter's doctest already referenced its corresponding getter for round-trip verification, so both setter and getter docstrings were updated. Affected: - 13 getter `def` lines per file (one per element type) - 26 doctest references per file (one in each setter doctest, one in each getter doctest) - 3 files * (13 + 26) = 117 line replacements total Verified by rebuilding the Docker test image and rerunning the full doctest suite inside the container: matrix: 97 attempted, 0 failed vector: 90 attempted, 0 failed scalar: 81 attempted, 0 failed TOTAL: 268 attempted, 0 failed test_run_doctests: OK Both the direct `doctest.testmod` invocation and the official `tests/test_doctest.py::test_run_doctests` entry point pass, including the complex `get_fc32` / `get_fc64` doctests that depend on `supports_complex()`. --- suitesparse_graphblas/matrix.py | 78 ++++++++++++++++----------------- suitesparse_graphblas/scalar.py | 78 ++++++++++++++++----------------- suitesparse_graphblas/vector.py | 78 ++++++++++++++++----------------- 3 files changed, 117 insertions(+), 117 deletions(-) diff --git a/suitesparse_graphblas/matrix.py b/suitesparse_graphblas/matrix.py index 9f8d10a..192085b 100644 --- a/suitesparse_graphblas/matrix.py +++ b/suitesparse_graphblas/matrix.py @@ -181,19 +181,19 @@ def set_bool(A, value, i, j): >>> A = new(lib.GrB_BOOL, 3, 3) >>> set_bool(A, True, 2, 2) - >>> bool(A, 2, 2) == True + >>> get_bool(A, 2, 2) == True True """ check_status(A, lib.GrB_Matrix_setElement_BOOL(A[0], value, i, j)) -def bool(A, i, j): +def get_bool(A, i, j): """Get a boolean value from the matrix at row `i` column `j`. >>> A = new(lib.GrB_BOOL, 3, 3) >>> set_bool(A, True, 2, 2) - >>> bool(A, 2, 2) == True + >>> get_bool(A, 2, 2) == True True """ @@ -207,19 +207,19 @@ def set_int8(A, value, i, j): >>> A = new(lib.GrB_INT8, 3, 3) >>> set_int8(A, 7, 2, 2) - >>> int8(A, 2, 2) == 7 + >>> get_int8(A, 2, 2) == 7 True """ check_status(A, lib.GrB_Matrix_setElement_INT8(A[0], value, i, j)) -def int8(A, i, j): +def get_int8(A, i, j): """Get an int8 value from the matrix at row `i` column `j`. >>> A = new(lib.GrB_INT8, 3, 3) >>> set_int8(A, 7, 2, 2) - >>> int8(A, 2, 2) == 7 + >>> get_int8(A, 2, 2) == 7 True """ @@ -233,19 +233,19 @@ def set_int16(A, value, i, j): >>> A = new(lib.GrB_INT16, 3, 3) >>> set_int16(A, 7, 2, 2) - >>> int16(A, 2, 2) == 7 + >>> get_int16(A, 2, 2) == 7 True """ check_status(A, lib.GrB_Matrix_setElement_INT16(A[0], value, i, j)) -def int16(A, i, j): +def get_int16(A, i, j): """Get an int16 value from the matrix at row `i` column `j`. >>> A = new(lib.GrB_INT16, 3, 3) >>> set_int16(A, 7, 2, 2) - >>> int16(A, 2, 2) == 7 + >>> get_int16(A, 2, 2) == 7 True """ @@ -259,19 +259,19 @@ def set_int32(A, value, i, j): >>> A = new(lib.GrB_INT32, 3, 3) >>> set_int32(A, 7, 2, 2) - >>> int32(A, 2, 2) == 7 + >>> get_int32(A, 2, 2) == 7 True """ check_status(A, lib.GrB_Matrix_setElement_INT32(A[0], value, i, j)) -def int32(A, i, j): +def get_int32(A, i, j): """Get an int32 value from the matrix at row `i` column `j`. >>> A = new(lib.GrB_INT32, 3, 3) >>> set_int32(A, 7, 2, 2) - >>> int32(A, 2, 2) == 7 + >>> get_int32(A, 2, 2) == 7 True """ @@ -285,19 +285,19 @@ def set_int64(A, value, i, j): >>> A = new(lib.GrB_INT64, 3, 3) >>> set_int64(A, 7, 2, 2) - >>> int64(A, 2, 2) == 7 + >>> get_int64(A, 2, 2) == 7 True """ check_status(A, lib.GrB_Matrix_setElement_INT64(A[0], value, i, j)) -def int64(A, i, j): +def get_int64(A, i, j): """Get an int64 value from the matrix at row `i` column `j`. >>> A = new(lib.GrB_INT64, 3, 3) >>> set_int64(A, 7, 2, 2) - >>> int64(A, 2, 2) == 7 + >>> get_int64(A, 2, 2) == 7 True """ @@ -311,19 +311,19 @@ def set_uint8(A, value, i, j): >>> A = new(lib.GrB_UINT8, 3, 3) >>> set_uint8(A, 7, 2, 2) - >>> uint8(A, 2, 2) == 7 + >>> get_uint8(A, 2, 2) == 7 True """ check_status(A, lib.GrB_Matrix_setElement_UINT8(A[0], value, i, j)) -def uint8(A, i, j): +def get_uint8(A, i, j): """Get a uint8 value from the matrix at row `i` column `j`. >>> A = new(lib.GrB_UINT8, 3, 3) >>> set_uint8(A, 7, 2, 2) - >>> uint8(A, 2, 2) == 7 + >>> get_uint8(A, 2, 2) == 7 True """ @@ -337,19 +337,19 @@ def set_uint16(A, value, i, j): >>> A = new(lib.GrB_UINT16, 3, 3) >>> set_uint16(A, 7, 2, 2) - >>> uint16(A, 2, 2) == 7 + >>> get_uint16(A, 2, 2) == 7 True """ check_status(A, lib.GrB_Matrix_setElement_UINT16(A[0], value, i, j)) -def uint16(A, i, j): +def get_uint16(A, i, j): """Get a uint16 value from the matrix at row `i` column `j`. >>> A = new(lib.GrB_UINT16, 3, 3) >>> set_uint16(A, 7, 2, 2) - >>> uint16(A, 2, 2) == 7 + >>> get_uint16(A, 2, 2) == 7 True """ @@ -363,19 +363,19 @@ def set_uint32(A, value, i, j): >>> A = new(lib.GrB_UINT32, 3, 3) >>> set_uint32(A, 7, 2, 2) - >>> uint32(A, 2, 2) == 7 + >>> get_uint32(A, 2, 2) == 7 True """ check_status(A, lib.GrB_Matrix_setElement_UINT32(A[0], value, i, j)) -def uint32(A, i, j): +def get_uint32(A, i, j): """Get a uint32 value from the matrix at row `i` column `j`. >>> A = new(lib.GrB_UINT32, 3, 3) >>> set_uint32(A, 7, 2, 2) - >>> uint32(A, 2, 2) == 7 + >>> get_uint32(A, 2, 2) == 7 True """ @@ -389,19 +389,19 @@ def set_uint64(A, value, i, j): >>> A = new(lib.GrB_UINT64, 3, 3) >>> set_uint64(A, 7, 2, 2) - >>> uint64(A, 2, 2) == 7 + >>> get_uint64(A, 2, 2) == 7 True """ check_status(A, lib.GrB_Matrix_setElement_UINT64(A[0], value, i, j)) -def uint64(A, i, j): +def get_uint64(A, i, j): """Get a uint64 value from the matrix at row `i` column `j`. >>> A = new(lib.GrB_UINT64, 3, 3) >>> set_uint64(A, 7, 2, 2) - >>> uint64(A, 2, 2) == 7 + >>> get_uint64(A, 2, 2) == 7 True """ @@ -415,19 +415,19 @@ def set_fp32(A, value, i, j): >>> A = new(lib.GrB_FP32, 3, 3) >>> set_fp32(A, 1.5, 2, 2) - >>> fp32(A, 2, 2) == 1.5 + >>> get_fp32(A, 2, 2) == 1.5 True """ check_status(A, lib.GrB_Matrix_setElement_FP32(A[0], value, i, j)) -def fp32(A, i, j): +def get_fp32(A, i, j): """Get an fp32 value from the matrix at row `i` column `j`. >>> A = new(lib.GrB_FP32, 3, 3) >>> set_fp32(A, 1.5, 2, 2) - >>> fp32(A, 2, 2) == 1.5 + >>> get_fp32(A, 2, 2) == 1.5 True """ @@ -441,19 +441,19 @@ def set_fp64(A, value, i, j): >>> A = new(lib.GrB_FP64, 3, 3) >>> set_fp64(A, 1.5, 2, 2) - >>> fp64(A, 2, 2) == 1.5 + >>> get_fp64(A, 2, 2) == 1.5 True """ check_status(A, lib.GrB_Matrix_setElement_FP64(A[0], value, i, j)) -def fp64(A, i, j): +def get_fp64(A, i, j): """Get an fp64 value from the matrix at row `i` column `j`. >>> A = new(lib.GrB_FP64, 3, 3) >>> set_fp64(A, 1.5, 2, 2) - >>> fp64(A, 2, 2) == 1.5 + >>> get_fp64(A, 2, 2) == 1.5 True """ @@ -469,18 +469,18 @@ def set_fc32(A, value, i, j): >>> A = new(lib.GxB_FC32, 3, 3) >>> set_fc32(A, 2+3j, 2, 2) - >>> fc32(A, 2, 2) == 2+3j + >>> get_fc32(A, 2, 2) == 2+3j True """ check_status(A, lib.GxB_Matrix_setElement_FC32(A[0], value, i, j)) - def fc32(A, i, j): + def get_fc32(A, i, j): """Get an fc32 value from the matrix at row `i` column `j`. >>> A = new(lib.GxB_FC32, 3, 3) >>> set_fc32(A, 2+3j, 2, 2) - >>> fc32(A, 2, 2) == 2+3j + >>> get_fc32(A, 2, 2) == 2+3j True """ @@ -493,18 +493,18 @@ def set_fc64(A, value, i, j): >>> A = new(lib.GxB_FC64, 3, 3) >>> set_fc64(A, 2+3j, 2, 2) - >>> fc64(A, 2, 2) == 2+3j + >>> get_fc64(A, 2, 2) == 2+3j True """ check_status(A, lib.GxB_Matrix_setElement_FC64(A[0], value, i, j)) - def fc64(A, i, j): + def get_fc64(A, i, j): """Get an fc64 value from the matrix at row `i` column `j`. >>> A = new(lib.GxB_FC64, 3, 3) >>> set_fc64(A, 2+3j, 2, 2) - >>> fc64(A, 2, 2) == 2+3j + >>> get_fc64(A, 2, 2) == 2+3j True """ diff --git a/suitesparse_graphblas/scalar.py b/suitesparse_graphblas/scalar.py index e072a8f..4be4816 100644 --- a/suitesparse_graphblas/scalar.py +++ b/suitesparse_graphblas/scalar.py @@ -42,19 +42,19 @@ def set_bool(s, value): >>> s = new(lib.GrB_BOOL) >>> set_bool(s, True) - >>> bool(s) == True + >>> get_bool(s) == True True """ check_status(s, lib.GxB_Scalar_setElement_BOOL(s[0], value)) -def bool(s): +def get_bool(s): """Get a boolean value from the scalar. >>> s = new(lib.GrB_BOOL) >>> set_bool(s, True) - >>> bool(s) == True + >>> get_bool(s) == True True """ @@ -70,19 +70,19 @@ def set_int8(s, value): >>> s = new(lib.GrB_INT8) >>> set_int8(s, 7) - >>> int8(s) == 7 + >>> get_int8(s) == 7 True """ check_status(s, lib.GxB_Scalar_setElement_INT8(s[0], value)) -def int8(s): +def get_int8(s): """Get an int8 value from the scalar. >>> s = new(lib.GrB_INT8) >>> set_int8(s, 7) - >>> int8(s) == 7 + >>> get_int8(s) == 7 True """ @@ -98,19 +98,19 @@ def set_int16(s, value): >>> s = new(lib.GrB_INT16) >>> set_int16(s, 7) - >>> int16(s) == 7 + >>> get_int16(s) == 7 True """ check_status(s, lib.GxB_Scalar_setElement_INT16(s[0], value)) -def int16(s): +def get_int16(s): """Get an int16 value from the scalar. >>> s = new(lib.GrB_INT16) >>> set_int16(s, 7) - >>> int16(s) == 7 + >>> get_int16(s) == 7 True """ @@ -126,19 +126,19 @@ def set_int32(s, value): >>> s = new(lib.GrB_INT32) >>> set_int32(s, 7) - >>> int32(s) == 7 + >>> get_int32(s) == 7 True """ check_status(s, lib.GxB_Scalar_setElement_INT32(s[0], value)) -def int32(s): +def get_int32(s): """Get an int32 value from the scalar. >>> s = new(lib.GrB_INT32) >>> set_int32(s, 7) - >>> int32(s) == 7 + >>> get_int32(s) == 7 True """ @@ -154,19 +154,19 @@ def set_int64(s, value): >>> s = new(lib.GrB_INT64) >>> set_int64(s, 7) - >>> int64(s) == 7 + >>> get_int64(s) == 7 True """ check_status(s, lib.GxB_Scalar_setElement_INT64(s[0], value)) -def int64(s): +def get_int64(s): """Get an int64 value from the scalar. >>> s = new(lib.GrB_INT64) >>> set_int64(s, 7) - >>> int64(s) == 7 + >>> get_int64(s) == 7 True """ @@ -182,19 +182,19 @@ def set_uint8(s, value): >>> s = new(lib.GrB_UINT8) >>> set_uint8(s, 7) - >>> uint8(s) == 7 + >>> get_uint8(s) == 7 True """ check_status(s, lib.GxB_Scalar_setElement_UINT8(s[0], value)) -def uint8(s): +def get_uint8(s): """Get a uint8 value from the scalar. >>> s = new(lib.GrB_UINT8) >>> set_uint8(s, 7) - >>> uint8(s) == 7 + >>> get_uint8(s) == 7 True """ @@ -210,19 +210,19 @@ def set_uint16(s, value): >>> s = new(lib.GrB_UINT16) >>> set_uint16(s, 7) - >>> uint16(s) == 7 + >>> get_uint16(s) == 7 True """ check_status(s, lib.GxB_Scalar_setElement_UINT16(s[0], value)) -def uint16(s): +def get_uint16(s): """Get a uint16 value from the scalar. >>> s = new(lib.GrB_UINT16) >>> set_uint16(s, 7) - >>> uint16(s) == 7 + >>> get_uint16(s) == 7 True """ @@ -238,19 +238,19 @@ def set_uint32(s, value): >>> s = new(lib.GrB_UINT32) >>> set_uint32(s, 7) - >>> uint32(s) == 7 + >>> get_uint32(s) == 7 True """ check_status(s, lib.GxB_Scalar_setElement_UINT32(s[0], value)) -def uint32(s): +def get_uint32(s): """Get a uint32 value from the scalar. >>> s = new(lib.GrB_UINT32) >>> set_uint32(s, 7) - >>> uint32(s) == 7 + >>> get_uint32(s) == 7 True """ @@ -266,19 +266,19 @@ def set_uint64(s, value): >>> s = new(lib.GrB_UINT64) >>> set_uint64(s, 7) - >>> uint64(s) == 7 + >>> get_uint64(s) == 7 True """ check_status(s, lib.GxB_Scalar_setElement_UINT64(s[0], value)) -def uint64(s): +def get_uint64(s): """Get a uint64 value from the scalar. >>> s = new(lib.GrB_UINT64) >>> set_uint64(s, 7) - >>> uint64(s) == 7 + >>> get_uint64(s) == 7 True """ @@ -294,19 +294,19 @@ def set_fp32(s, value): >>> s = new(lib.GrB_FP32) >>> set_fp32(s, 1.5) - >>> fp32(s) == 1.5 + >>> get_fp32(s) == 1.5 True """ check_status(s, lib.GxB_Scalar_setElement_FP32(s[0], value)) -def fp32(s): +def get_fp32(s): """Get an fp32 value from the scalar. >>> s = new(lib.GrB_FP32) >>> set_fp32(s, 1.5) - >>> fp32(s) == 1.5 + >>> get_fp32(s) == 1.5 True """ @@ -322,19 +322,19 @@ def set_fp64(s, value): >>> s = new(lib.GrB_FP64) >>> set_fp64(s, 1.5) - >>> fp64(s) == 1.5 + >>> get_fp64(s) == 1.5 True """ check_status(s, lib.GxB_Scalar_setElement_FP64(s[0], value)) -def fp64(s): +def get_fp64(s): """Get an fp64 value from the scalar. >>> s = new(lib.GrB_FP64) >>> set_fp64(s, 1.5) - >>> fp64(s) == 1.5 + >>> get_fp64(s) == 1.5 True """ @@ -352,18 +352,18 @@ def set_fc32(s, value): >>> s = new(lib.GxB_FC32) >>> set_fc32(s, 2+3j) - >>> fc32(s) == 2+3j + >>> get_fc32(s) == 2+3j True """ check_status(s, lib.GxB_Scalar_setElement_FC32(s[0], value)) - def fc32(s): + def get_fc32(s): """Get an fc32 value from the scalar. >>> s = new(lib.GxB_FC32) >>> set_fc32(s, 2+3j) - >>> fc32(s) == 2+3j + >>> get_fc32(s) == 2+3j True """ @@ -378,18 +378,18 @@ def set_fc64(s, value): >>> s = new(lib.GxB_FC64) >>> set_fc64(s, 2+3j) - >>> fc64(s) == 2+3j + >>> get_fc64(s) == 2+3j True """ check_status(s, lib.GxB_Scalar_setElement_FC64(s[0], value)) - def fc64(s): + def get_fc64(s): """Get an fc64 value from the scalar. >>> s = new(lib.GxB_FC64) >>> set_fc64(s, 2+3j) - >>> fc64(s) == 2+3j + >>> get_fc64(s) == 2+3j True """ diff --git a/suitesparse_graphblas/vector.py b/suitesparse_graphblas/vector.py index 412b9da..bd7b73c 100644 --- a/suitesparse_graphblas/vector.py +++ b/suitesparse_graphblas/vector.py @@ -82,19 +82,19 @@ def set_bool(v, value, i): >>> v = new(lib.GrB_BOOL, 3) >>> set_bool(v, True, 2) - >>> bool(v, 2) == True + >>> get_bool(v, 2) == True True """ check_status(v, lib.GrB_Vector_setElement_BOOL(v[0], value, i)) -def bool(v, i): +def get_bool(v, i): """Get a boolean value from the vector at position `i`. >>> v = new(lib.GrB_BOOL, 3) >>> set_bool(v, True, 2) - >>> bool(v, 2) == True + >>> get_bool(v, 2) == True True """ @@ -108,19 +108,19 @@ def set_int8(v, value, i): >>> v = new(lib.GrB_INT8, 3) >>> set_int8(v, 7, 2) - >>> int8(v, 2) == 7 + >>> get_int8(v, 2) == 7 True """ check_status(v, lib.GrB_Vector_setElement_INT8(v[0], value, i)) -def int8(v, i): +def get_int8(v, i): """Get an int8 value from the vector at position `i`. >>> v = new(lib.GrB_INT8, 3) >>> set_int8(v, 7, 2) - >>> int8(v, 2) == 7 + >>> get_int8(v, 2) == 7 True """ @@ -134,19 +134,19 @@ def set_int16(v, value, i): >>> v = new(lib.GrB_INT16, 3) >>> set_int16(v, 7, 2) - >>> int16(v, 2) == 7 + >>> get_int16(v, 2) == 7 True """ check_status(v, lib.GrB_Vector_setElement_INT16(v[0], value, i)) -def int16(v, i): +def get_int16(v, i): """Get an int16 value from the vector at position `i`. >>> v = new(lib.GrB_INT16, 3) >>> set_int16(v, 7, 2) - >>> int16(v, 2) == 7 + >>> get_int16(v, 2) == 7 True """ @@ -160,19 +160,19 @@ def set_int32(v, value, i): >>> v = new(lib.GrB_INT32, 3) >>> set_int32(v, 7, 2) - >>> int32(v, 2) == 7 + >>> get_int32(v, 2) == 7 True """ check_status(v, lib.GrB_Vector_setElement_INT32(v[0], value, i)) -def int32(v, i): +def get_int32(v, i): """Get an int32 value from the vector at position `i`. >>> v = new(lib.GrB_INT32, 3) >>> set_int32(v, 7, 2) - >>> int32(v, 2) == 7 + >>> get_int32(v, 2) == 7 True """ @@ -186,19 +186,19 @@ def set_int64(v, value, i): >>> v = new(lib.GrB_INT64, 3) >>> set_int64(v, 7, 2) - >>> int64(v, 2) == 7 + >>> get_int64(v, 2) == 7 True """ check_status(v, lib.GrB_Vector_setElement_INT64(v[0], value, i)) -def int64(v, i): +def get_int64(v, i): """Get an int64 value from the vector at position `i`. >>> v = new(lib.GrB_INT64, 3) >>> set_int64(v, 7, 2) - >>> int64(v, 2) == 7 + >>> get_int64(v, 2) == 7 True """ @@ -212,19 +212,19 @@ def set_uint8(v, value, i): >>> v = new(lib.GrB_UINT8, 3) >>> set_uint8(v, 7, 2) - >>> uint8(v, 2) == 7 + >>> get_uint8(v, 2) == 7 True """ check_status(v, lib.GrB_Vector_setElement_UINT8(v[0], value, i)) -def uint8(v, i): +def get_uint8(v, i): """Get a uint8 value from the vector at position `i`. >>> v = new(lib.GrB_UINT8, 3) >>> set_uint8(v, 7, 2) - >>> uint8(v, 2) == 7 + >>> get_uint8(v, 2) == 7 True """ @@ -238,19 +238,19 @@ def set_uint16(v, value, i): >>> v = new(lib.GrB_UINT16, 3) >>> set_uint16(v, 7, 2) - >>> uint16(v, 2) == 7 + >>> get_uint16(v, 2) == 7 True """ check_status(v, lib.GrB_Vector_setElement_UINT16(v[0], value, i)) -def uint16(v, i): +def get_uint16(v, i): """Get a uint16 value from the vector at position `i`. >>> v = new(lib.GrB_UINT16, 3) >>> set_uint16(v, 7, 2) - >>> uint16(v, 2) == 7 + >>> get_uint16(v, 2) == 7 True """ @@ -264,19 +264,19 @@ def set_uint32(v, value, i): >>> v = new(lib.GrB_UINT32, 3) >>> set_uint32(v, 7, 2) - >>> uint32(v, 2) == 7 + >>> get_uint32(v, 2) == 7 True """ check_status(v, lib.GrB_Vector_setElement_UINT32(v[0], value, i)) -def uint32(v, i): +def get_uint32(v, i): """Get a uint32 value from the vector at position `i`. >>> v = new(lib.GrB_UINT32, 3) >>> set_uint32(v, 7, 2) - >>> uint32(v, 2) == 7 + >>> get_uint32(v, 2) == 7 True """ @@ -290,19 +290,19 @@ def set_uint64(v, value, i): >>> v = new(lib.GrB_UINT64, 3) >>> set_uint64(v, 7, 2) - >>> uint64(v, 2) == 7 + >>> get_uint64(v, 2) == 7 True """ check_status(v, lib.GrB_Vector_setElement_UINT64(v[0], value, i)) -def uint64(v, i): +def get_uint64(v, i): """Get a uint64 value from the vector at position `i`. >>> v = new(lib.GrB_UINT64, 3) >>> set_uint64(v, 7, 2) - >>> uint64(v, 2) == 7 + >>> get_uint64(v, 2) == 7 True """ @@ -316,19 +316,19 @@ def set_fp32(v, value, i): >>> v = new(lib.GrB_FP32, 3) >>> set_fp32(v, 1.5, 2) - >>> fp32(v, 2) == 1.5 + >>> get_fp32(v, 2) == 1.5 True """ check_status(v, lib.GrB_Vector_setElement_FP32(v[0], value, i)) -def fp32(v, i): +def get_fp32(v, i): """Get an fp32 value from the vector at position `i`. >>> v = new(lib.GrB_FP32, 3) >>> set_fp32(v, 1.5, 2) - >>> fp32(v, 2) == 1.5 + >>> get_fp32(v, 2) == 1.5 True """ @@ -342,19 +342,19 @@ def set_fp64(v, value, i): >>> v = new(lib.GrB_FP64, 3) >>> set_fp64(v, 1.5, 2) - >>> fp64(v, 2) == 1.5 + >>> get_fp64(v, 2) == 1.5 True """ check_status(v, lib.GrB_Vector_setElement_FP64(v[0], value, i)) -def fp64(v, i): +def get_fp64(v, i): """Get an fp64 value from the vector at position `i`. >>> v = new(lib.GrB_FP64, 3) >>> set_fp64(v, 1.5, 2) - >>> fp64(v, 2) == 1.5 + >>> get_fp64(v, 2) == 1.5 True """ @@ -370,18 +370,18 @@ def set_fc32(v, value, i): >>> v = new(lib.GxB_FC32, 3) >>> set_fc32(v, 2+3j, 2) - >>> fc32(v, 2) == 2+3j + >>> get_fc32(v, 2) == 2+3j True """ check_status(v, lib.GxB_Vector_setElement_FC32(v[0], value, i)) - def fc32(v, i): + def get_fc32(v, i): """Get an fc32 value from the vector at position `i`. >>> v = new(lib.GxB_FC32, 3) >>> set_fc32(v, 2+3j, 2) - >>> fc32(v, 2) == 2+3j + >>> get_fc32(v, 2) == 2+3j True """ @@ -394,18 +394,18 @@ def set_fc64(v, value, i): >>> v = new(lib.GxB_FC64, 3) >>> set_fc64(v, 2+3j, 2) - >>> fc64(v, 2) == 2+3j + >>> get_fc64(v, 2) == 2+3j True """ check_status(v, lib.GxB_Vector_setElement_FC64(v[0], value, i)) - def fc64(v, i): + def get_fc64(v, i): """Get an fc64 value from the vector at position `i`. >>> v = new(lib.GxB_FC64, 3) >>> set_fc64(v, 2+3j, 2) - >>> fc64(v, 2) == 2+3j + >>> get_fc64(v, 2) == 2+3j True """ From 4fa5720307d604808c6241616aa2ff50e3fe7dfa Mon Sep 17 00:00:00 2001 From: Michel Pelletier Date: Wed, 8 Apr 2026 16:08:03 -0700 Subject: [PATCH 172/193] Prefix matrix/vector/scalar helper functions with module name The metadata/utility helpers in matrix.py, vector.py, and scalar.py were named after generic concepts (`new`, `free`, `type`, `format`, `shape`, `size`, etc.). Several of those names shadow Python builtins (`type`, `format`) or collide with common variables, making bare imports awkward (`from suitesparse_graphblas.matrix import type` is asking for trouble). Prefix every helper with its module name so each function is unambiguous on import: matrix.py (16 helpers): free / new / type / nrows / ncols / nvals / shape / format / set_format / sparsity_status / sparsity_control / set_sparsity_control / hyper_switch / set_hyper_switch / bitmap_switch / set_bitmap_switch -> matrix_free, matrix_new, matrix_type, ..., matrix_set_bitmap_switch vector.py (5 helpers): free / new / type / size / nvals -> vector_free, vector_new, vector_type, vector_size, vector_nvals scalar.py (3 helpers): free / new / type -> scalar_free, scalar_new, scalar_type The element setters/getters (set_bool, get_bool, set_int8, get_int8, ..., set_fc64, get_fc64) are NOT renamed -- they already have a clear set_*/get_* naming convention. Internal cross-references updated: - `def matrix_new(T, ..., *, free=matrix_free)` -- the default value of the `free` keyword argument now references the renamed module-level function. The kwarg parameter name itself stays as `free` so existing callers passing `free=None` or `free=my_func` still work. - `matrix_shape()` body now calls `matrix_nrows(A)` and `matrix_ncols(A)`. - All in-module doctests updated: `>>> A = new(...)` -> `>>> A = matrix_new(...)`, `>>> nrows(A)` -> `>>> matrix_nrows(A)`, etc. Element setter/getter doctests that call `new(...)` to construct test instances are also updated to use the prefixed name. - Local variable shadows (e.g. `format = ffi.new(...)` inside `matrix_format()`) and kwarg parameter names (e.g. `format` in `matrix_set_format(A, format)`) are intentionally left alone -- they are local and don't reference the renamed functions. - `ffi.new(...)` (cffi calls) is preserved -- distinguished from the renamed `new(...)` via a negative lookbehind in the rename pattern. External call sites updated: - `suitesparse_graphblas/__init__.py`: `burble` class doctest references `matrix.matrix_new(...)` and `matrix.matrix_nvals(...)`. - `suitesparse_graphblas/io/binary.py`: 13 `matrix.X(...)` call sites in the binread/binwrite serialization paths now call `matrix.matrix_X(...)`. - `suitesparse_graphblas/io/serialize.py`: 2 docstring prose mentions plus 2 attribute references (`matrix.free` -> `matrix.matrix_free`, `vector.free` -> `vector.vector_free`) used as the default GC callback in `deserialize_matrix` / `deserialize_vector`. - `suitesparse_graphblas/tests/test_io.py`: 17 external call sites updated to the prefixed names. Verified by rebuilding the Docker test image and running both the full doctest suite and the pytest suite inside the container: matrix: 97 attempted, 0 failed vector: 90 attempted, 0 failed scalar: 81 attempted, 0 failed TOTAL doctest: 268 attempted, 0 failed pytest: 9 passed test_doctest, test_exceptions, test_io (matrix and vector serialization round-trip), test_jit, test_package, test_scalar --- suitesparse_graphblas/__init__.py | 6 +- suitesparse_graphblas/io/binary.py | 26 ++--- suitesparse_graphblas/io/serialize.py | 8 +- suitesparse_graphblas/matrix.py | 126 ++++++++++++------------- suitesparse_graphblas/scalar.py | 66 ++++++------- suitesparse_graphblas/tests/test_io.py | 34 +++---- suitesparse_graphblas/vector.py | 86 ++++++++--------- 7 files changed, 176 insertions(+), 176 deletions(-) diff --git a/suitesparse_graphblas/__init__.py b/suitesparse_graphblas/__init__.py index 72838b0..e57ca27 100644 --- a/suitesparse_graphblas/__init__.py +++ b/suitesparse_graphblas/__init__.py @@ -228,7 +228,7 @@ class burble: >>> from suitesparse_graphblas import burble, lib, matrix >>> - >>> A = matrix.new(lib.GrB_BOOL, 3, 3) + >>> A = matrix.matrix_new(lib.GrB_BOOL, 3, 3) >>> burble.is_enabled False >>> burble.enable() @@ -239,7 +239,7 @@ class burble: Example with explicit enable and disable: >>> burble.enable() - >>> n = matrix.nvals(A) + >>> n = matrix.matrix_nvals(A) [ GrB_Matrix_nvals 1.91e-06 sec ] >>> burble.disable() @@ -247,7 +247,7 @@ class burble: Example as a context manager: >>> with burble(): - >>> n = matrix.nvals(A) + >>> n = matrix.matrix_nvals(A) [ GrB_Matrix_nvals 1.91e-06 sec ] diff --git a/suitesparse_graphblas/io/binary.py b/suitesparse_graphblas/io/binary.py index 4e95931..190cc28 100644 --- a/suitesparse_graphblas/io/binary.py +++ b/suitesparse_graphblas/io/binary.py @@ -123,19 +123,19 @@ def binwrite(A, filename, comments=None, opener=Path.open): typecode = ffinew("int32_t*") matrix_type = ffi.new("GrB_Type*") - nrows[0] = matrix.nrows(A) - ncols[0] = matrix.ncols(A) - nvals[0] = matrix.nvals(A) - matrix_type[0] = matrix.type(A) + nrows[0] = matrix.matrix_nrows(A) + ncols[0] = matrix.matrix_ncols(A) + nvals[0] = matrix.matrix_nvals(A) + matrix_type[0] = matrix.matrix_type(A) check_status(A, lib.GxB_Type_size(typesize, matrix_type[0])) typecode[0] = _ss_typecodes[matrix_type[0]] - format[0] = matrix.format(A) - hyper_switch[0] = matrix.hyper_switch(A) - bitmap_switch[0] = matrix.bitmap_switch(A) - sparsity_status[0] = matrix.sparsity_status(A) - sparsity_control[0] = matrix.sparsity_control(A) + format[0] = matrix.matrix_format(A) + hyper_switch[0] = matrix.matrix_hyper_switch(A) + bitmap_switch[0] = matrix.matrix_bitmap_switch(A) + sparsity_status[0] = matrix.matrix_sparsity_status(A) + sparsity_control[0] = matrix.matrix_sparsity_control(A) by_row = format[0] == lib.GxB_BY_ROW by_col = format[0] == lib.GxB_BY_COL @@ -446,7 +446,7 @@ def binread(filename, opener=Path.open): Ax[0] = readinto_new_buffer(f, "uint8_t*", typesize[0] if is_iso[0] else Ax_size[0]) - A = matrix.new(atype, nrows[0], ncols[0]) + A = matrix.matrix_new(atype, nrows[0], ncols[0]) if by_col and is_hyper: check_status( @@ -546,7 +546,7 @@ def binread(filename, opener=Path.open): else: raise TypeError("Unknown format {format[0]}") - matrix.set_sparsity_control(A, sparsity_control[0]) - matrix.set_hyper_switch(A, hyper_switch[0]) - matrix.set_bitmap_switch(A, bitmap_switch[0]) + matrix.matrix_set_sparsity_control(A, sparsity_control[0]) + matrix.matrix_set_hyper_switch(A, hyper_switch[0]) + matrix.matrix_set_bitmap_switch(A, bitmap_switch[0]) return A diff --git a/suitesparse_graphblas/io/serialize.py b/suitesparse_graphblas/io/serialize.py index fcc7804..63e2e3d 100644 --- a/suitesparse_graphblas/io/serialize.py +++ b/suitesparse_graphblas/io/serialize.py @@ -88,7 +88,7 @@ def deserialize_matrix(data, *, free=True, nthreads=None): """Deserialize a Matrix from bytes. The `free` argument is called when the object is garbage - collected, the default is `matrix.free()`. If `free` is None then + collected, the default is `matrix.matrix_free()`. If `free` is None then there is no automatic garbage collection and it is up to the user to free the matrix. """ @@ -108,7 +108,7 @@ def deserialize_matrix(data, *, free=True, nthreads=None): if free: if callable(free): return ffi.gc(A, free) - return ffi.gc(A, matrix.free) + return ffi.gc(A, matrix.matrix_free) return A @@ -116,7 +116,7 @@ def deserialize_vector(data, *, free=True, nthreads=None): """Deserialize a Vector from bytes. The `free` argument is called when the object is garbage - collected, the default is `vector.free()`. If `free` is None then + collected, the default is `vector.vector_free()`. If `free` is None then there is no automatic garbage collection and it is up to the user to free the vector. """ @@ -136,7 +136,7 @@ def deserialize_vector(data, *, free=True, nthreads=None): if free: if callable(free): return ffi.gc(v, free) - return ffi.gc(v, vector.free) + return ffi.gc(v, vector.vector_free) return v diff --git a/suitesparse_graphblas/matrix.py b/suitesparse_graphblas/matrix.py index 192085b..7646090 100644 --- a/suitesparse_graphblas/matrix.py +++ b/suitesparse_graphblas/matrix.py @@ -4,28 +4,28 @@ from .io.serialize import serialize_matrix as serialize # noqa: F401 -def free(A): +def matrix_free(A): """Free a matrix.""" check_status(A, lib.GrB_Matrix_free(A)) -def new(T, nrows=lib.GxB_INDEX_MAX, ncols=lib.GxB_INDEX_MAX, *, free=free): +def matrix_new(T, nrows=lib.GxB_INDEX_MAX, ncols=lib.GxB_INDEX_MAX, *, free=matrix_free): """Create a new `GrB_Matrix` of type `T` and initialize it. The following example creates an eight bit unsigned 2x2 matrix: - >>> A = new(lib.GrB_UINT8, 2, 2) - >>> shape(A) + >>> A = matrix_new(lib.GrB_UINT8, 2, 2) + >>> matrix_shape(A) (2, 2) The default value for `nrows` and `ncols` is `lib.GxB_INDEX_MAX` which creates a Matrix with maximal bounds: - >>> A = new(lib.GrB_UINT8) - >>> shape(A) == (lib.GxB_INDEX_MAX, lib.GxB_INDEX_MAX) + >>> A = matrix_new(lib.GrB_UINT8) + >>> matrix_shape(A) == (lib.GxB_INDEX_MAX, lib.GxB_INDEX_MAX) True The `free` argument is called when the object is garbage - collected, the default is `matrix.free()`. If `free` is None then + collected, the default is `matrix.matrix_free()`. If `free` is None then there is no automatic garbage collection and it is up to the user to free the matrix. @@ -37,11 +37,11 @@ def new(T, nrows=lib.GxB_INDEX_MAX, ncols=lib.GxB_INDEX_MAX, *, free=free): return A -def type(A): +def matrix_type(A): """Return the GraphBLAS type of the vector. - >>> A = new(lib.GrB_UINT8) - >>> type(A) == lib.GrB_UINT8 + >>> A = matrix_new(lib.GrB_UINT8) + >>> matrix_type(A) == lib.GrB_UINT8 True """ @@ -50,11 +50,11 @@ def type(A): return T[0] -def nrows(A): +def matrix_nrows(A): """Return the number of rows in the matrix. - >>> A = new(lib.GrB_UINT8, 2, 3) - >>> nrows(A) + >>> A = matrix_new(lib.GrB_UINT8, 2, 3) + >>> matrix_nrows(A) 2 """ @@ -63,11 +63,11 @@ def nrows(A): return n[0] -def ncols(A): +def matrix_ncols(A): """Return the number of columns in the matrix. - >>> A = new(lib.GrB_UINT8, 2, 3) - >>> ncols(A) + >>> A = matrix_new(lib.GrB_UINT8, 2, 3) + >>> matrix_ncols(A) 3 """ @@ -76,11 +76,11 @@ def ncols(A): return n[0] -def nvals(A): +def matrix_nvals(A): """Return the number of stored elements in the matrix. - >>> A = new(lib.GrB_UINT8, 2, 3) - >>> nvals(A) + >>> A = matrix_new(lib.GrB_UINT8, 2, 3) + >>> matrix_nvals(A) 0 """ @@ -89,22 +89,22 @@ def nvals(A): return n[0] -def shape(A): +def matrix_shape(A): """Return the shape of the matrix as a two tuple `(nrows, ncols)` - >>> A = new(lib.GrB_UINT8, 2, 2) - >>> shape(A) + >>> A = matrix_new(lib.GrB_UINT8, 2, 2) + >>> matrix_shape(A) (2, 2) """ - return (nrows(A), ncols(A)) + return (matrix_nrows(A), matrix_ncols(A)) -def format(A): +def matrix_format(A): """Return the format of the matrix. - >>> A = new(lib.GrB_UINT8, 2, 2) - >>> format(A) == lib.GxB_BY_ROW + >>> A = matrix_new(lib.GrB_UINT8, 2, 2) + >>> matrix_format(A) == lib.GxB_BY_ROW True """ @@ -113,12 +113,12 @@ def format(A): return format[0] -def set_format(A, format): +def matrix_set_format(A, format): """Set the format of the matrix. - >>> A = new(lib.GrB_UINT8, 2, 2) - >>> set_format(A, lib.GxB_BY_COL) - >>> format(A) == lib.GxB_BY_COL + >>> A = matrix_new(lib.GrB_UINT8, 2, 2) + >>> matrix_set_format(A, lib.GxB_BY_COL) + >>> matrix_format(A) == lib.GxB_BY_COL True """ @@ -126,14 +126,14 @@ def set_format(A, format): check_status(A, lib.GxB_Matrix_Option_set_INT32(A[0], lib.GxB_FORMAT, format_val)) -def sparsity_status(A): +def matrix_sparsity_status(A): """Get the sparsity status of the matrix.""" sparsity_status = ffi.new("int32_t*") check_status(A, lib.GxB_Matrix_Option_get_INT32(A[0], lib.GxB_SPARSITY_STATUS, sparsity_status)) return sparsity_status[0] -def sparsity_control(A): +def matrix_sparsity_control(A): """Get the sparsity control of the matrix.""" sparsity_control = ffi.new("int32_t*") check_status( @@ -142,7 +142,7 @@ def sparsity_control(A): return sparsity_control[0] -def set_sparsity_control(A, sparsity): +def matrix_set_sparsity_control(A, sparsity): """Set the sparsity control of the matrix.""" sparsity_control = ffi.cast("int32_t", sparsity) check_status( @@ -150,27 +150,27 @@ def set_sparsity_control(A, sparsity): ) -def hyper_switch(A): +def matrix_hyper_switch(A): """Get the hyper switch of the matrix.""" hyper_switch = ffi.new("double*") check_status(A, lib.GxB_Matrix_Option_get_FP64(A[0], lib.GxB_HYPER_SWITCH, hyper_switch)) return hyper_switch[0] -def set_hyper_switch(A, hyper_switch): +def matrix_set_hyper_switch(A, hyper_switch): """Set the hyper switch of the matrix.""" hyper_switch = ffi.cast("double", hyper_switch) check_status(A, lib.GxB_Matrix_Option_set_FP64(A[0], lib.GxB_HYPER_SWITCH, hyper_switch)) -def bitmap_switch(A): +def matrix_bitmap_switch(A): """Get the bitmap switch of the matrix.""" bitmap_switch = ffi.new("double*") check_status(A, lib.GxB_Matrix_Option_get_FP64(A[0], lib.GxB_BITMAP_SWITCH, bitmap_switch)) return bitmap_switch[0] -def set_bitmap_switch(A, bitmap_switch): +def matrix_set_bitmap_switch(A, bitmap_switch): """Set the bitmap switch of the matrix.""" bitmap_switch = ffi.cast("double", bitmap_switch) check_status(A, lib.GxB_Matrix_Option_set_FP64(A[0], lib.GxB_BITMAP_SWITCH, bitmap_switch)) @@ -179,7 +179,7 @@ def set_bitmap_switch(A, bitmap_switch): def set_bool(A, value, i, j): """Set a boolean value to the matrix at row `i` column `j`. - >>> A = new(lib.GrB_BOOL, 3, 3) + >>> A = matrix_new(lib.GrB_BOOL, 3, 3) >>> set_bool(A, True, 2, 2) >>> get_bool(A, 2, 2) == True True @@ -191,7 +191,7 @@ def set_bool(A, value, i, j): def get_bool(A, i, j): """Get a boolean value from the matrix at row `i` column `j`. - >>> A = new(lib.GrB_BOOL, 3, 3) + >>> A = matrix_new(lib.GrB_BOOL, 3, 3) >>> set_bool(A, True, 2, 2) >>> get_bool(A, 2, 2) == True True @@ -205,7 +205,7 @@ def get_bool(A, i, j): def set_int8(A, value, i, j): """Set an int8 value to the matrix at row `i` column `j`. - >>> A = new(lib.GrB_INT8, 3, 3) + >>> A = matrix_new(lib.GrB_INT8, 3, 3) >>> set_int8(A, 7, 2, 2) >>> get_int8(A, 2, 2) == 7 True @@ -217,7 +217,7 @@ def set_int8(A, value, i, j): def get_int8(A, i, j): """Get an int8 value from the matrix at row `i` column `j`. - >>> A = new(lib.GrB_INT8, 3, 3) + >>> A = matrix_new(lib.GrB_INT8, 3, 3) >>> set_int8(A, 7, 2, 2) >>> get_int8(A, 2, 2) == 7 True @@ -231,7 +231,7 @@ def get_int8(A, i, j): def set_int16(A, value, i, j): """Set an int16 value to the matrix at row `i` column `j`. - >>> A = new(lib.GrB_INT16, 3, 3) + >>> A = matrix_new(lib.GrB_INT16, 3, 3) >>> set_int16(A, 7, 2, 2) >>> get_int16(A, 2, 2) == 7 True @@ -243,7 +243,7 @@ def set_int16(A, value, i, j): def get_int16(A, i, j): """Get an int16 value from the matrix at row `i` column `j`. - >>> A = new(lib.GrB_INT16, 3, 3) + >>> A = matrix_new(lib.GrB_INT16, 3, 3) >>> set_int16(A, 7, 2, 2) >>> get_int16(A, 2, 2) == 7 True @@ -257,7 +257,7 @@ def get_int16(A, i, j): def set_int32(A, value, i, j): """Set an int32 value to the matrix at row `i` column `j`. - >>> A = new(lib.GrB_INT32, 3, 3) + >>> A = matrix_new(lib.GrB_INT32, 3, 3) >>> set_int32(A, 7, 2, 2) >>> get_int32(A, 2, 2) == 7 True @@ -269,7 +269,7 @@ def set_int32(A, value, i, j): def get_int32(A, i, j): """Get an int32 value from the matrix at row `i` column `j`. - >>> A = new(lib.GrB_INT32, 3, 3) + >>> A = matrix_new(lib.GrB_INT32, 3, 3) >>> set_int32(A, 7, 2, 2) >>> get_int32(A, 2, 2) == 7 True @@ -283,7 +283,7 @@ def get_int32(A, i, j): def set_int64(A, value, i, j): """Set an int64 value to the matrix at row `i` column `j`. - >>> A = new(lib.GrB_INT64, 3, 3) + >>> A = matrix_new(lib.GrB_INT64, 3, 3) >>> set_int64(A, 7, 2, 2) >>> get_int64(A, 2, 2) == 7 True @@ -295,7 +295,7 @@ def set_int64(A, value, i, j): def get_int64(A, i, j): """Get an int64 value from the matrix at row `i` column `j`. - >>> A = new(lib.GrB_INT64, 3, 3) + >>> A = matrix_new(lib.GrB_INT64, 3, 3) >>> set_int64(A, 7, 2, 2) >>> get_int64(A, 2, 2) == 7 True @@ -309,7 +309,7 @@ def get_int64(A, i, j): def set_uint8(A, value, i, j): """Set a uint8 value to the matrix at row `i` column `j`. - >>> A = new(lib.GrB_UINT8, 3, 3) + >>> A = matrix_new(lib.GrB_UINT8, 3, 3) >>> set_uint8(A, 7, 2, 2) >>> get_uint8(A, 2, 2) == 7 True @@ -321,7 +321,7 @@ def set_uint8(A, value, i, j): def get_uint8(A, i, j): """Get a uint8 value from the matrix at row `i` column `j`. - >>> A = new(lib.GrB_UINT8, 3, 3) + >>> A = matrix_new(lib.GrB_UINT8, 3, 3) >>> set_uint8(A, 7, 2, 2) >>> get_uint8(A, 2, 2) == 7 True @@ -335,7 +335,7 @@ def get_uint8(A, i, j): def set_uint16(A, value, i, j): """Set a uint16 value to the matrix at row `i` column `j`. - >>> A = new(lib.GrB_UINT16, 3, 3) + >>> A = matrix_new(lib.GrB_UINT16, 3, 3) >>> set_uint16(A, 7, 2, 2) >>> get_uint16(A, 2, 2) == 7 True @@ -347,7 +347,7 @@ def set_uint16(A, value, i, j): def get_uint16(A, i, j): """Get a uint16 value from the matrix at row `i` column `j`. - >>> A = new(lib.GrB_UINT16, 3, 3) + >>> A = matrix_new(lib.GrB_UINT16, 3, 3) >>> set_uint16(A, 7, 2, 2) >>> get_uint16(A, 2, 2) == 7 True @@ -361,7 +361,7 @@ def get_uint16(A, i, j): def set_uint32(A, value, i, j): """Set a uint32 value to the matrix at row `i` column `j`. - >>> A = new(lib.GrB_UINT32, 3, 3) + >>> A = matrix_new(lib.GrB_UINT32, 3, 3) >>> set_uint32(A, 7, 2, 2) >>> get_uint32(A, 2, 2) == 7 True @@ -373,7 +373,7 @@ def set_uint32(A, value, i, j): def get_uint32(A, i, j): """Get a uint32 value from the matrix at row `i` column `j`. - >>> A = new(lib.GrB_UINT32, 3, 3) + >>> A = matrix_new(lib.GrB_UINT32, 3, 3) >>> set_uint32(A, 7, 2, 2) >>> get_uint32(A, 2, 2) == 7 True @@ -387,7 +387,7 @@ def get_uint32(A, i, j): def set_uint64(A, value, i, j): """Set a uint64 value to the matrix at row `i` column `j`. - >>> A = new(lib.GrB_UINT64, 3, 3) + >>> A = matrix_new(lib.GrB_UINT64, 3, 3) >>> set_uint64(A, 7, 2, 2) >>> get_uint64(A, 2, 2) == 7 True @@ -399,7 +399,7 @@ def set_uint64(A, value, i, j): def get_uint64(A, i, j): """Get a uint64 value from the matrix at row `i` column `j`. - >>> A = new(lib.GrB_UINT64, 3, 3) + >>> A = matrix_new(lib.GrB_UINT64, 3, 3) >>> set_uint64(A, 7, 2, 2) >>> get_uint64(A, 2, 2) == 7 True @@ -413,7 +413,7 @@ def get_uint64(A, i, j): def set_fp32(A, value, i, j): """Set an fp32 value to the matrix at row `i` column `j`. - >>> A = new(lib.GrB_FP32, 3, 3) + >>> A = matrix_new(lib.GrB_FP32, 3, 3) >>> set_fp32(A, 1.5, 2, 2) >>> get_fp32(A, 2, 2) == 1.5 True @@ -425,7 +425,7 @@ def set_fp32(A, value, i, j): def get_fp32(A, i, j): """Get an fp32 value from the matrix at row `i` column `j`. - >>> A = new(lib.GrB_FP32, 3, 3) + >>> A = matrix_new(lib.GrB_FP32, 3, 3) >>> set_fp32(A, 1.5, 2, 2) >>> get_fp32(A, 2, 2) == 1.5 True @@ -439,7 +439,7 @@ def get_fp32(A, i, j): def set_fp64(A, value, i, j): """Set an fp64 value to the matrix at row `i` column `j`. - >>> A = new(lib.GrB_FP64, 3, 3) + >>> A = matrix_new(lib.GrB_FP64, 3, 3) >>> set_fp64(A, 1.5, 2, 2) >>> get_fp64(A, 2, 2) == 1.5 True @@ -451,7 +451,7 @@ def set_fp64(A, value, i, j): def get_fp64(A, i, j): """Get an fp64 value from the matrix at row `i` column `j`. - >>> A = new(lib.GrB_FP64, 3, 3) + >>> A = matrix_new(lib.GrB_FP64, 3, 3) >>> set_fp64(A, 1.5, 2, 2) >>> get_fp64(A, 2, 2) == 1.5 True @@ -467,7 +467,7 @@ def get_fp64(A, i, j): def set_fc32(A, value, i, j): """Set an fc32 value to the matrix at row `i` column `j`. - >>> A = new(lib.GxB_FC32, 3, 3) + >>> A = matrix_new(lib.GxB_FC32, 3, 3) >>> set_fc32(A, 2+3j, 2, 2) >>> get_fc32(A, 2, 2) == 2+3j True @@ -478,7 +478,7 @@ def set_fc32(A, value, i, j): def get_fc32(A, i, j): """Get an fc32 value from the matrix at row `i` column `j`. - >>> A = new(lib.GxB_FC32, 3, 3) + >>> A = matrix_new(lib.GxB_FC32, 3, 3) >>> set_fc32(A, 2+3j, 2, 2) >>> get_fc32(A, 2, 2) == 2+3j True @@ -491,7 +491,7 @@ def get_fc32(A, i, j): def set_fc64(A, value, i, j): """Set an fc64 value to the matrix at row `i` column `j`. - >>> A = new(lib.GxB_FC64, 3, 3) + >>> A = matrix_new(lib.GxB_FC64, 3, 3) >>> set_fc64(A, 2+3j, 2, 2) >>> get_fc64(A, 2, 2) == 2+3j True @@ -502,7 +502,7 @@ def set_fc64(A, value, i, j): def get_fc64(A, i, j): """Get an fc64 value from the matrix at row `i` column `j`. - >>> A = new(lib.GxB_FC64, 3, 3) + >>> A = matrix_new(lib.GxB_FC64, 3, 3) >>> set_fc64(A, 2+3j, 2, 2) >>> get_fc64(A, 2, 2) == 2+3j True diff --git a/suitesparse_graphblas/scalar.py b/suitesparse_graphblas/scalar.py index 4be4816..289ca51 100644 --- a/suitesparse_graphblas/scalar.py +++ b/suitesparse_graphblas/scalar.py @@ -1,20 +1,20 @@ from suitesparse_graphblas import check_status, exceptions, ffi, lib, supports_complex -def free(v): +def scalar_free(v): """Free a scalar.""" check_status(v, lib.GxB_Scalar_free(v)) -def new(T, *, free=free): +def scalar_new(T, *, free=scalar_free): """Create a new `GxB_Scalar` of type `T` and initialize it. The `free` argument is called when the object is garbage - collected, the default is `scalar.free()`. If `free` is None then + collected, the default is `scalar.scalar_free()`. If `free` is None then there is no automatic garbage collection and it is up to the user to free the scalar. - >>> S = new(lib.GrB_UINT8) + >>> S = scalar_new(lib.GrB_UINT8) """ s = ffi.new("GxB_Scalar*") @@ -24,11 +24,11 @@ def new(T, *, free=free): return s -def type(s): +def scalar_type(s): """Return the GraphBLAS type of the scalar. - >>> S = new(lib.GrB_UINT8) - >>> type(S) == lib.GrB_UINT8 + >>> S = scalar_new(lib.GrB_UINT8) + >>> scalar_type(S) == lib.GrB_UINT8 True """ @@ -40,7 +40,7 @@ def type(s): def set_bool(s, value): """Set a boolean value to the scalar. - >>> s = new(lib.GrB_BOOL) + >>> s = scalar_new(lib.GrB_BOOL) >>> set_bool(s, True) >>> get_bool(s) == True True @@ -52,7 +52,7 @@ def set_bool(s, value): def get_bool(s): """Get a boolean value from the scalar. - >>> s = new(lib.GrB_BOOL) + >>> s = scalar_new(lib.GrB_BOOL) >>> set_bool(s, True) >>> get_bool(s) == True True @@ -68,7 +68,7 @@ def get_bool(s): def set_int8(s, value): """Set an int8 value to the scalar. - >>> s = new(lib.GrB_INT8) + >>> s = scalar_new(lib.GrB_INT8) >>> set_int8(s, 7) >>> get_int8(s) == 7 True @@ -80,7 +80,7 @@ def set_int8(s, value): def get_int8(s): """Get an int8 value from the scalar. - >>> s = new(lib.GrB_INT8) + >>> s = scalar_new(lib.GrB_INT8) >>> set_int8(s, 7) >>> get_int8(s) == 7 True @@ -96,7 +96,7 @@ def get_int8(s): def set_int16(s, value): """Set an int16 value to the scalar. - >>> s = new(lib.GrB_INT16) + >>> s = scalar_new(lib.GrB_INT16) >>> set_int16(s, 7) >>> get_int16(s) == 7 True @@ -108,7 +108,7 @@ def set_int16(s, value): def get_int16(s): """Get an int16 value from the scalar. - >>> s = new(lib.GrB_INT16) + >>> s = scalar_new(lib.GrB_INT16) >>> set_int16(s, 7) >>> get_int16(s) == 7 True @@ -124,7 +124,7 @@ def get_int16(s): def set_int32(s, value): """Set an int32 value to the scalar. - >>> s = new(lib.GrB_INT32) + >>> s = scalar_new(lib.GrB_INT32) >>> set_int32(s, 7) >>> get_int32(s) == 7 True @@ -136,7 +136,7 @@ def set_int32(s, value): def get_int32(s): """Get an int32 value from the scalar. - >>> s = new(lib.GrB_INT32) + >>> s = scalar_new(lib.GrB_INT32) >>> set_int32(s, 7) >>> get_int32(s) == 7 True @@ -152,7 +152,7 @@ def get_int32(s): def set_int64(s, value): """Set an int64 value to the scalar. - >>> s = new(lib.GrB_INT64) + >>> s = scalar_new(lib.GrB_INT64) >>> set_int64(s, 7) >>> get_int64(s) == 7 True @@ -164,7 +164,7 @@ def set_int64(s, value): def get_int64(s): """Get an int64 value from the scalar. - >>> s = new(lib.GrB_INT64) + >>> s = scalar_new(lib.GrB_INT64) >>> set_int64(s, 7) >>> get_int64(s) == 7 True @@ -180,7 +180,7 @@ def get_int64(s): def set_uint8(s, value): """Set a uint8 value to the scalar. - >>> s = new(lib.GrB_UINT8) + >>> s = scalar_new(lib.GrB_UINT8) >>> set_uint8(s, 7) >>> get_uint8(s) == 7 True @@ -192,7 +192,7 @@ def set_uint8(s, value): def get_uint8(s): """Get a uint8 value from the scalar. - >>> s = new(lib.GrB_UINT8) + >>> s = scalar_new(lib.GrB_UINT8) >>> set_uint8(s, 7) >>> get_uint8(s) == 7 True @@ -208,7 +208,7 @@ def get_uint8(s): def set_uint16(s, value): """Set a uint16 value to the scalar. - >>> s = new(lib.GrB_UINT16) + >>> s = scalar_new(lib.GrB_UINT16) >>> set_uint16(s, 7) >>> get_uint16(s) == 7 True @@ -220,7 +220,7 @@ def set_uint16(s, value): def get_uint16(s): """Get a uint16 value from the scalar. - >>> s = new(lib.GrB_UINT16) + >>> s = scalar_new(lib.GrB_UINT16) >>> set_uint16(s, 7) >>> get_uint16(s) == 7 True @@ -236,7 +236,7 @@ def get_uint16(s): def set_uint32(s, value): """Set a uint32 value to the scalar. - >>> s = new(lib.GrB_UINT32) + >>> s = scalar_new(lib.GrB_UINT32) >>> set_uint32(s, 7) >>> get_uint32(s) == 7 True @@ -248,7 +248,7 @@ def set_uint32(s, value): def get_uint32(s): """Get a uint32 value from the scalar. - >>> s = new(lib.GrB_UINT32) + >>> s = scalar_new(lib.GrB_UINT32) >>> set_uint32(s, 7) >>> get_uint32(s) == 7 True @@ -264,7 +264,7 @@ def get_uint32(s): def set_uint64(s, value): """Set a uint64 value to the scalar. - >>> s = new(lib.GrB_UINT64) + >>> s = scalar_new(lib.GrB_UINT64) >>> set_uint64(s, 7) >>> get_uint64(s) == 7 True @@ -276,7 +276,7 @@ def set_uint64(s, value): def get_uint64(s): """Get a uint64 value from the scalar. - >>> s = new(lib.GrB_UINT64) + >>> s = scalar_new(lib.GrB_UINT64) >>> set_uint64(s, 7) >>> get_uint64(s) == 7 True @@ -292,7 +292,7 @@ def get_uint64(s): def set_fp32(s, value): """Set an fp32 value to the scalar. - >>> s = new(lib.GrB_FP32) + >>> s = scalar_new(lib.GrB_FP32) >>> set_fp32(s, 1.5) >>> get_fp32(s) == 1.5 True @@ -304,7 +304,7 @@ def set_fp32(s, value): def get_fp32(s): """Get an fp32 value from the scalar. - >>> s = new(lib.GrB_FP32) + >>> s = scalar_new(lib.GrB_FP32) >>> set_fp32(s, 1.5) >>> get_fp32(s) == 1.5 True @@ -320,7 +320,7 @@ def get_fp32(s): def set_fp64(s, value): """Set an fp64 value to the scalar. - >>> s = new(lib.GrB_FP64) + >>> s = scalar_new(lib.GrB_FP64) >>> set_fp64(s, 1.5) >>> get_fp64(s) == 1.5 True @@ -332,7 +332,7 @@ def set_fp64(s, value): def get_fp64(s): """Get an fp64 value from the scalar. - >>> s = new(lib.GrB_FP64) + >>> s = scalar_new(lib.GrB_FP64) >>> set_fp64(s, 1.5) >>> get_fp64(s) == 1.5 True @@ -350,7 +350,7 @@ def get_fp64(s): def set_fc32(s, value): """Set an fc32 value to the scalar. - >>> s = new(lib.GxB_FC32) + >>> s = scalar_new(lib.GxB_FC32) >>> set_fc32(s, 2+3j) >>> get_fc32(s) == 2+3j True @@ -361,7 +361,7 @@ def set_fc32(s, value): def get_fc32(s): """Get an fc32 value from the scalar. - >>> s = new(lib.GxB_FC32) + >>> s = scalar_new(lib.GxB_FC32) >>> set_fc32(s, 2+3j) >>> get_fc32(s) == 2+3j True @@ -376,7 +376,7 @@ def get_fc32(s): def set_fc64(s, value): """Set an fc64 value to the scalar. - >>> s = new(lib.GxB_FC64) + >>> s = scalar_new(lib.GxB_FC64) >>> set_fc64(s, 2+3j) >>> get_fc64(s) == 2+3j True @@ -387,7 +387,7 @@ def set_fc64(s, value): def get_fc64(s): """Get an fc64 value from the scalar. - >>> s = new(lib.GxB_FC64) + >>> s = scalar_new(lib.GxB_FC64) >>> set_fc64(s, 2+3j) >>> get_fc64(s) == 2+3j True diff --git a/suitesparse_graphblas/tests/test_io.py b/suitesparse_graphblas/tests/test_io.py index dcdf857..7b4c899 100644 --- a/suitesparse_graphblas/tests/test_io.py +++ b/suitesparse_graphblas/tests/test_io.py @@ -90,7 +90,7 @@ def _test_elements(T): def test_serialize_matrix(): T = lib.GrB_INT64 - A = matrix.new(T, 2, 2) + A = matrix.matrix_new(T, 2, 2) for args in zip(*_test_elements(T)): f = _element_setters[T] check_status(A, f(A[0], *args)) @@ -98,12 +98,12 @@ def test_serialize_matrix(): B = matrix.deserialize(data) # Test equal - C = matrix.new(lib.GrB_BOOL, 2, 2) + C = matrix.matrix_new(lib.GrB_BOOL, 2, 2) check_status( C, lib.GrB_Matrix_eWiseAdd_BinaryOp(C[0], NULL, NULL, _eq_ops[T], A[0], B[0], NULL), ) - assert matrix.nvals(A) == matrix.nvals(B) == matrix.nvals(C) + assert matrix.matrix_nvals(A) == matrix.matrix_nvals(B) == matrix.matrix_nvals(C) is_eq = ffi.new("bool*") check_status( C, @@ -114,19 +114,19 @@ def test_serialize_matrix(): def test_serialize_vector(): T = lib.GrB_INT64 - v = vector.new(T, 3) + v = vector.vector_new(T, 3) check_status(v, lib.GrB_Vector_setElement_INT64(v[0], 2, 0)) check_status(v, lib.GrB_Vector_setElement_INT64(v[0], 10, 1)) data = vector.serialize(v, lib.GxB_COMPRESSION_LZ4HC, level=7) w = vector.deserialize(data) # Test equal - x = vector.new(lib.GrB_BOOL, 3) + x = vector.vector_new(lib.GrB_BOOL, 3) check_status( x, lib.GrB_Vector_eWiseAdd_BinaryOp(x[0], NULL, NULL, _eq_ops[T], v[0], w[0], NULL), ) - assert vector.nvals(v) == vector.nvals(w) == vector.nvals(x) + assert vector.vector_nvals(v) == vector.vector_nvals(w) == vector.vector_nvals(x) is_eq = ffi.new("bool*") check_status( x, @@ -140,7 +140,7 @@ def test_matrix_binfile_read_write(tmp_path): for format in (lib.GxB_BY_ROW, lib.GxB_BY_COL): for T in grb_types: for sparsity in (lib.GxB_HYPERSPARSE, lib.GxB_SPARSE, lib.GxB_BITMAP, lib.GxB_FULL): - A = matrix.new(T, 2, 2) + A = matrix.matrix_new(T, 2, 2) if T is not lib.GxB_FULL: for args in zip(*_test_elements(T)): @@ -162,21 +162,21 @@ def test_matrix_binfile_read_write(tmp_path): NULL, ), ) - matrix.set_sparsity_control(A, sparsity) - matrix.set_format(A, format) + matrix.matrix_set_sparsity_control(A, sparsity) + matrix.matrix_set_format(A, format) binfilef = tmp_path / "binfilewrite_test.binfile" binary.binwrite(A, binfilef, opener=opener) B = binary.binread(binfilef, opener=opener) - assert matrix.type(A) == matrix.type(B) - assert matrix.nrows(A) == matrix.nrows(B) - assert matrix.ncols(A) == matrix.ncols(B) - assert matrix.hyper_switch(A) == matrix.hyper_switch(B) - assert matrix.bitmap_switch(A) == matrix.bitmap_switch(B) - # assert matrix.sparsity_control(A) == matrix.sparsity_control(B) + assert matrix.matrix_type(A) == matrix.matrix_type(B) + assert matrix.matrix_nrows(A) == matrix.matrix_nrows(B) + assert matrix.matrix_ncols(A) == matrix.matrix_ncols(B) + assert matrix.matrix_hyper_switch(A) == matrix.matrix_hyper_switch(B) + assert matrix.matrix_bitmap_switch(A) == matrix.matrix_bitmap_switch(B) + # assert matrix.matrix_sparsity_control(A) == matrix.matrix_sparsity_control(B) - C = matrix.new(lib.GrB_BOOL, 2, 2) + C = matrix.matrix_new(lib.GrB_BOOL, 2, 2) check_status( C, @@ -185,7 +185,7 @@ def test_matrix_binfile_read_write(tmp_path): ), ) - assert matrix.nvals(A) == matrix.nvals(B) == matrix.nvals(C) + assert matrix.matrix_nvals(A) == matrix.matrix_nvals(B) == matrix.matrix_nvals(C) is_eq = ffi.new("bool*") check_status( diff --git a/suitesparse_graphblas/vector.py b/suitesparse_graphblas/vector.py index bd7b73c..66f9a5e 100644 --- a/suitesparse_graphblas/vector.py +++ b/suitesparse_graphblas/vector.py @@ -4,26 +4,26 @@ from .io.serialize import serialize_vector as serialize # noqa: F401 -def free(v): +def vector_free(v): """Free a vector.""" check_status(v, lib.GrB_Vector_free(v)) -def new(T, size=lib.GxB_INDEX_MAX, *, free=free): +def vector_new(T, size=lib.GxB_INDEX_MAX, *, free=vector_free): """Create a new `GrB_Vector` of type `T` and initialize it. - >>> A = new(lib.GrB_UINT8, 2) - >>> size(A) + >>> A = vector_new(lib.GrB_UINT8, 2) + >>> vector_size(A) 2 The default `size` is `lib.GxB_INDEX_MAX`. - >>> A = new(lib.GrB_UINT8) - >>> size(A) == lib.GxB_INDEX_MAX + >>> A = vector_new(lib.GrB_UINT8) + >>> vector_size(A) == lib.GxB_INDEX_MAX True The `free` argument is called when the object is garbage - collected, the default is `vector.free()`. If `free` is None then + collected, the default is `vector.vector_free()`. If `free` is None then there is no automatic garbage collection and it is up to the user to free the vector. """ @@ -34,11 +34,11 @@ def new(T, size=lib.GxB_INDEX_MAX, *, free=free): return v -def type(v): +def vector_type(v): """Return the GraphBLAS type of the vector. - >>> v = new(lib.GrB_UINT8, 2) - >>> type(v) == lib.GrB_UINT8 + >>> v = vector_new(lib.GrB_UINT8, 2) + >>> vector_type(v) == lib.GrB_UINT8 True @@ -48,11 +48,11 @@ def type(v): return T[0] -def size(v): +def vector_size(v): """Return the size of the vector. - >>> v = new(lib.GrB_UINT8, 2) - >>> size(v) == 2 + >>> v = vector_new(lib.GrB_UINT8, 2) + >>> vector_size(v) == 2 True """ @@ -61,14 +61,14 @@ def size(v): return n[0] -def nvals(v): +def vector_nvals(v): """Return the number of stored elements in the vector. - >>> v = new(lib.GrB_BOOL, 2) - >>> nvals(v) + >>> v = vector_new(lib.GrB_BOOL, 2) + >>> vector_nvals(v) 0 >>> set_bool(v, True, 1) - >>> nvals(v) + >>> vector_nvals(v) 1 """ @@ -80,7 +80,7 @@ def nvals(v): def set_bool(v, value, i): """Set a boolean value to the vector at position `i`. - >>> v = new(lib.GrB_BOOL, 3) + >>> v = vector_new(lib.GrB_BOOL, 3) >>> set_bool(v, True, 2) >>> get_bool(v, 2) == True True @@ -92,7 +92,7 @@ def set_bool(v, value, i): def get_bool(v, i): """Get a boolean value from the vector at position `i`. - >>> v = new(lib.GrB_BOOL, 3) + >>> v = vector_new(lib.GrB_BOOL, 3) >>> set_bool(v, True, 2) >>> get_bool(v, 2) == True True @@ -106,7 +106,7 @@ def get_bool(v, i): def set_int8(v, value, i): """Set an int8 value to the vector at position `i`. - >>> v = new(lib.GrB_INT8, 3) + >>> v = vector_new(lib.GrB_INT8, 3) >>> set_int8(v, 7, 2) >>> get_int8(v, 2) == 7 True @@ -118,7 +118,7 @@ def set_int8(v, value, i): def get_int8(v, i): """Get an int8 value from the vector at position `i`. - >>> v = new(lib.GrB_INT8, 3) + >>> v = vector_new(lib.GrB_INT8, 3) >>> set_int8(v, 7, 2) >>> get_int8(v, 2) == 7 True @@ -132,7 +132,7 @@ def get_int8(v, i): def set_int16(v, value, i): """Set an int16 value to the vector at position `i`. - >>> v = new(lib.GrB_INT16, 3) + >>> v = vector_new(lib.GrB_INT16, 3) >>> set_int16(v, 7, 2) >>> get_int16(v, 2) == 7 True @@ -144,7 +144,7 @@ def set_int16(v, value, i): def get_int16(v, i): """Get an int16 value from the vector at position `i`. - >>> v = new(lib.GrB_INT16, 3) + >>> v = vector_new(lib.GrB_INT16, 3) >>> set_int16(v, 7, 2) >>> get_int16(v, 2) == 7 True @@ -158,7 +158,7 @@ def get_int16(v, i): def set_int32(v, value, i): """Set an int32 value to the vector at position `i`. - >>> v = new(lib.GrB_INT32, 3) + >>> v = vector_new(lib.GrB_INT32, 3) >>> set_int32(v, 7, 2) >>> get_int32(v, 2) == 7 True @@ -170,7 +170,7 @@ def set_int32(v, value, i): def get_int32(v, i): """Get an int32 value from the vector at position `i`. - >>> v = new(lib.GrB_INT32, 3) + >>> v = vector_new(lib.GrB_INT32, 3) >>> set_int32(v, 7, 2) >>> get_int32(v, 2) == 7 True @@ -184,7 +184,7 @@ def get_int32(v, i): def set_int64(v, value, i): """Set an int64 value to the vector at position `i`. - >>> v = new(lib.GrB_INT64, 3) + >>> v = vector_new(lib.GrB_INT64, 3) >>> set_int64(v, 7, 2) >>> get_int64(v, 2) == 7 True @@ -196,7 +196,7 @@ def set_int64(v, value, i): def get_int64(v, i): """Get an int64 value from the vector at position `i`. - >>> v = new(lib.GrB_INT64, 3) + >>> v = vector_new(lib.GrB_INT64, 3) >>> set_int64(v, 7, 2) >>> get_int64(v, 2) == 7 True @@ -210,7 +210,7 @@ def get_int64(v, i): def set_uint8(v, value, i): """Set a uint8 value to the vector at position `i`. - >>> v = new(lib.GrB_UINT8, 3) + >>> v = vector_new(lib.GrB_UINT8, 3) >>> set_uint8(v, 7, 2) >>> get_uint8(v, 2) == 7 True @@ -222,7 +222,7 @@ def set_uint8(v, value, i): def get_uint8(v, i): """Get a uint8 value from the vector at position `i`. - >>> v = new(lib.GrB_UINT8, 3) + >>> v = vector_new(lib.GrB_UINT8, 3) >>> set_uint8(v, 7, 2) >>> get_uint8(v, 2) == 7 True @@ -236,7 +236,7 @@ def get_uint8(v, i): def set_uint16(v, value, i): """Set a uint16 value to the vector at position `i`. - >>> v = new(lib.GrB_UINT16, 3) + >>> v = vector_new(lib.GrB_UINT16, 3) >>> set_uint16(v, 7, 2) >>> get_uint16(v, 2) == 7 True @@ -248,7 +248,7 @@ def set_uint16(v, value, i): def get_uint16(v, i): """Get a uint16 value from the vector at position `i`. - >>> v = new(lib.GrB_UINT16, 3) + >>> v = vector_new(lib.GrB_UINT16, 3) >>> set_uint16(v, 7, 2) >>> get_uint16(v, 2) == 7 True @@ -262,7 +262,7 @@ def get_uint16(v, i): def set_uint32(v, value, i): """Set a uint32 value to the vector at position `i`. - >>> v = new(lib.GrB_UINT32, 3) + >>> v = vector_new(lib.GrB_UINT32, 3) >>> set_uint32(v, 7, 2) >>> get_uint32(v, 2) == 7 True @@ -274,7 +274,7 @@ def set_uint32(v, value, i): def get_uint32(v, i): """Get a uint32 value from the vector at position `i`. - >>> v = new(lib.GrB_UINT32, 3) + >>> v = vector_new(lib.GrB_UINT32, 3) >>> set_uint32(v, 7, 2) >>> get_uint32(v, 2) == 7 True @@ -288,7 +288,7 @@ def get_uint32(v, i): def set_uint64(v, value, i): """Set a uint64 value to the vector at position `i`. - >>> v = new(lib.GrB_UINT64, 3) + >>> v = vector_new(lib.GrB_UINT64, 3) >>> set_uint64(v, 7, 2) >>> get_uint64(v, 2) == 7 True @@ -300,7 +300,7 @@ def set_uint64(v, value, i): def get_uint64(v, i): """Get a uint64 value from the vector at position `i`. - >>> v = new(lib.GrB_UINT64, 3) + >>> v = vector_new(lib.GrB_UINT64, 3) >>> set_uint64(v, 7, 2) >>> get_uint64(v, 2) == 7 True @@ -314,7 +314,7 @@ def get_uint64(v, i): def set_fp32(v, value, i): """Set an fp32 value to the vector at position `i`. - >>> v = new(lib.GrB_FP32, 3) + >>> v = vector_new(lib.GrB_FP32, 3) >>> set_fp32(v, 1.5, 2) >>> get_fp32(v, 2) == 1.5 True @@ -326,7 +326,7 @@ def set_fp32(v, value, i): def get_fp32(v, i): """Get an fp32 value from the vector at position `i`. - >>> v = new(lib.GrB_FP32, 3) + >>> v = vector_new(lib.GrB_FP32, 3) >>> set_fp32(v, 1.5, 2) >>> get_fp32(v, 2) == 1.5 True @@ -340,7 +340,7 @@ def get_fp32(v, i): def set_fp64(v, value, i): """Set an fp64 value to the vector at position `i`. - >>> v = new(lib.GrB_FP64, 3) + >>> v = vector_new(lib.GrB_FP64, 3) >>> set_fp64(v, 1.5, 2) >>> get_fp64(v, 2) == 1.5 True @@ -352,7 +352,7 @@ def set_fp64(v, value, i): def get_fp64(v, i): """Get an fp64 value from the vector at position `i`. - >>> v = new(lib.GrB_FP64, 3) + >>> v = vector_new(lib.GrB_FP64, 3) >>> set_fp64(v, 1.5, 2) >>> get_fp64(v, 2) == 1.5 True @@ -368,7 +368,7 @@ def get_fp64(v, i): def set_fc32(v, value, i): """Set an fc32 value to the vector at position `i`. - >>> v = new(lib.GxB_FC32, 3) + >>> v = vector_new(lib.GxB_FC32, 3) >>> set_fc32(v, 2+3j, 2) >>> get_fc32(v, 2) == 2+3j True @@ -379,7 +379,7 @@ def set_fc32(v, value, i): def get_fc32(v, i): """Get an fc32 value from the vector at position `i`. - >>> v = new(lib.GxB_FC32, 3) + >>> v = vector_new(lib.GxB_FC32, 3) >>> set_fc32(v, 2+3j, 2) >>> get_fc32(v, 2) == 2+3j True @@ -392,7 +392,7 @@ def get_fc32(v, i): def set_fc64(v, value, i): """Set an fc64 value to the vector at position `i`. - >>> v = new(lib.GxB_FC64, 3) + >>> v = vector_new(lib.GxB_FC64, 3) >>> set_fc64(v, 2+3j, 2) >>> get_fc64(v, 2) == 2+3j True @@ -403,7 +403,7 @@ def set_fc64(v, value, i): def get_fc64(v, i): """Get an fc64 value from the vector at position `i`. - >>> v = new(lib.GxB_FC64, 3) + >>> v = vector_new(lib.GxB_FC64, 3) >>> set_fc64(v, 2+3j, 2) >>> get_fc64(v, 2) == 2+3j True From 5989360e0b3ec27f8129a723d5c8d3273a8de29f Mon Sep 17 00:00:00 2001 From: Michel Pelletier Date: Thu, 9 Apr 2026 07:13:10 -0700 Subject: [PATCH 173/193] Wrap long assert line in test_io.py for Black The `matrix.nvals` -> `matrix.matrix_nvals` rename pushed the triple equality in `test_matrix_binfile_read_write` to 101 characters, exceeding the project's 100-char line length. Apply Black's suggested parenthesized wrap to bring it back under the limit. --- suitesparse_graphblas/tests/test_io.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/suitesparse_graphblas/tests/test_io.py b/suitesparse_graphblas/tests/test_io.py index 7b4c899..a06afb9 100644 --- a/suitesparse_graphblas/tests/test_io.py +++ b/suitesparse_graphblas/tests/test_io.py @@ -185,7 +185,9 @@ def test_matrix_binfile_read_write(tmp_path): ), ) - assert matrix.matrix_nvals(A) == matrix.matrix_nvals(B) == matrix.matrix_nvals(C) + assert ( + matrix.matrix_nvals(A) == matrix.matrix_nvals(B) == matrix.matrix_nvals(C) + ) is_eq = ffi.new("bool*") check_status( From 442c63a6f63703f8cb8e4b9227bfbbc7f6fa0987 Mon Sep 17 00:00:00 2001 From: Michel Pelletier Date: Thu, 9 Apr 2026 21:46:29 -0700 Subject: [PATCH 174/193] Add GraphBLAS operations, iterators, and option accessors to functional API Operations (matrix.py / vector.py): - mxm, mxv, vxm, transpose, kronecker - eWiseAdd, eWiseMult, eWiseUnion - apply, apply_first, apply_second, select - reduce (to vector and scalar), vector reduce - assign, assign_scalar, extract, col_extract, row/col_assign - build and extractTuples for all 13 element types - concat, diag (matrix), diag (vector) - dup, clear, wait, print, fprint Scalar operations (scalar.py): - dup, clear, wait, print, fprint Iterator module (new file iterator.py): - iterator_new / iterator_free - matrix entry, row, column, and vector iterator attach/seek/next - Row/column index getters, kount, getp/getpmax - Type-specific value getters for all 13 types - Column iterators require GxB_BY_COL matrix format Global and per-object option accessors (__init__.py, matrix.py, vector.py): - global_option_get/set for INT32, FP64, CHAR - matrix_option_get/set for INT32, FP64 - vector_option_get/set for INT32, FP64 All 1046 doctests pass. 9 pytest tests pass. --- suitesparse_graphblas/__init__.py | 80 ++ suitesparse_graphblas/iterator.py | 563 ++++++++ suitesparse_graphblas/matrix.py | 1291 +++++++++++++++++++ suitesparse_graphblas/scalar.py | 107 ++ suitesparse_graphblas/tests/test_doctest.py | 3 +- suitesparse_graphblas/vector.py | 1093 ++++++++++++++++ 6 files changed, 3136 insertions(+), 1 deletion(-) create mode 100644 suitesparse_graphblas/iterator.py diff --git a/suitesparse_graphblas/__init__.py b/suitesparse_graphblas/__init__.py index e57ca27..92e1e33 100644 --- a/suitesparse_graphblas/__init__.py +++ b/suitesparse_graphblas/__init__.py @@ -108,6 +108,86 @@ def libget(name): raise +# --------------------------------------------------------------------------- +# Global option get/set +# --------------------------------------------------------------------------- + + +def global_option_get_int32(field): + """Get a global option as an int32. + + >>> global_option_get_int32(lib.GxB_BURBLE) in (0, 1) + True + + """ + val = ffi.new("int32_t*") + info = lib.GxB_Global_Option_get_INT32(field, val) + if info != lib.GrB_SUCCESS: + raise _error_code_lookup.get(info, RuntimeError)( + f"GxB_Global_Option_get_INT32 failed with info={info}" + ) + return val[0] + + +def global_option_set_int32(field, value): + """Set a global option from an int32. + + >>> global_option_set_int32(lib.GxB_BURBLE, 0) + + """ + info = lib.GxB_Global_Option_set_INT32(field, ffi.cast("int32_t", value)) + if info != lib.GrB_SUCCESS: + raise _error_code_lookup.get(info, RuntimeError)( + f"GxB_Global_Option_set_INT32 failed with info={info}" + ) + + +def global_option_get_fp64(field): + """Get a global option as a float64. + + >>> isinstance(global_option_get_fp64(lib.GxB_HYPER_SWITCH), float) + True + + """ + val = ffi.new("double*") + info = lib.GxB_Global_Option_get_FP64(field, val) + if info != lib.GrB_SUCCESS: + raise _error_code_lookup.get(info, RuntimeError)( + f"GxB_Global_Option_get_FP64 failed with info={info}" + ) + return val[0] + + +def global_option_set_fp64(field, value): + """Set a global option from a float64. + + >>> default = global_option_get_fp64(lib.GxB_HYPER_SWITCH) + >>> global_option_set_fp64(lib.GxB_HYPER_SWITCH, default) + + """ + info = lib.GxB_Global_Option_set_FP64(field, ffi.cast("double", value)) + if info != lib.GrB_SUCCESS: + raise _error_code_lookup.get(info, RuntimeError)( + f"GxB_Global_Option_set_FP64 failed with info={info}" + ) + + +def global_option_get_char(field): + """Get a global option as a string. + + >>> 'SuiteSparse:GraphBLAS' in global_option_get_char(lib.GxB_LIBRARY_NAME) + True + + """ + val = ffi.new("char**") + info = lib.GxB_Global_Option_get_CHAR(field, val) + if info != lib.GrB_SUCCESS: + raise _error_code_lookup.get(info, RuntimeError)( + f"GxB_Global_Option_get_CHAR failed with info={info}" + ) + return ffi.string(val[0]).decode() + + bool_types = frozenset((lib.GrB_BOOL,)) signed_integer_types = frozenset( diff --git a/suitesparse_graphblas/iterator.py b/suitesparse_graphblas/iterator.py new file mode 100644 index 0000000..f94d8f0 --- /dev/null +++ b/suitesparse_graphblas/iterator.py @@ -0,0 +1,563 @@ +from suitesparse_graphblas import _error_code_lookup, check_status, ffi, lib, supports_complex + + +def _check_info(info): + """Check a GrB_Info code, returning it on SUCCESS/EXHAUSTED/NO_VALUE, raising otherwise.""" + if info == lib.GrB_SUCCESS or info == lib.GxB_EXHAUSTED or info == lib.GrB_NO_VALUE: + return info + exc_class = _error_code_lookup.get(info, RuntimeError) + raise exc_class(f"GraphBLAS error: info={info}") + + +# --------------------------------------------------------------------------- +# Iterator lifecycle +# --------------------------------------------------------------------------- + + +def iterator_free(it): + """Free an iterator.""" + check_status(it, lib.GxB_Iterator_free(it)) + + +def iterator_new(*, free=iterator_free): + """Create a new GxB_Iterator. + + >>> it = iterator_new() + + """ + it = ffi.new("GxB_Iterator*") + check_status(it, lib.GxB_Iterator_new(it)) + if free: + return ffi.gc(it, free) + return it + + +# --------------------------------------------------------------------------- +# Attach +# --------------------------------------------------------------------------- + + +def matrix_iterator_attach(it, A, desc=None): + """Attach an iterator to a matrix for entry-wise iteration. + + Returns ``lib.GrB_SUCCESS`` or ``lib.GxB_EXHAUSTED`` (if the matrix + has no entries). Raises on other errors. + + >>> from suitesparse_graphblas import matrix + >>> A = matrix.matrix_new(lib.GrB_INT64, 2, 2) + >>> matrix.matrix_option_set_int32(A, lib.GxB_SPARSITY_CONTROL, lib.GxB_SPARSE) + >>> matrix.set_int64(A, 10, 0, 0) + >>> matrix.set_int64(A, 20, 1, 1) + >>> matrix.matrix_wait(A, lib.GrB_MATERIALIZE) + >>> it = iterator_new() + >>> info = matrix_iterator_attach(it, A) + >>> info == lib.GrB_SUCCESS + True + + """ + info = lib.GxB_Matrix_Iterator_attach( + it[0], A[0], ffi.NULL if desc is None else desc[0], + ) + return _check_info(info) + + +def row_iterator_attach(it, A, desc=None): + """Attach an iterator to a matrix for row-wise iteration. + + Returns ``lib.GrB_SUCCESS`` or ``lib.GxB_EXHAUSTED``. + + >>> from suitesparse_graphblas import matrix + >>> A = matrix.matrix_new(lib.GrB_INT64, 2, 2) + >>> matrix.matrix_option_set_int32(A, lib.GxB_SPARSITY_CONTROL, lib.GxB_SPARSE) + >>> matrix.set_int64(A, 10, 0, 0) + >>> matrix.set_int64(A, 20, 1, 1) + >>> matrix.matrix_wait(A, lib.GrB_MATERIALIZE) + >>> it = iterator_new() + >>> info = row_iterator_attach(it, A) + >>> info == lib.GrB_SUCCESS + True + + """ + info = lib.GxB_rowIterator_attach( + it[0], A[0], ffi.NULL if desc is None else desc[0], + ) + return _check_info(info) + + +def col_iterator_attach(it, A, desc=None): + """Attach an iterator to a matrix for column-wise iteration. + + Returns ``lib.GrB_SUCCESS`` or ``lib.GxB_EXHAUSTED``. + + >>> from suitesparse_graphblas import matrix + >>> A = matrix.matrix_new(lib.GrB_INT64, 2, 2) + >>> matrix.matrix_set_format(A, lib.GxB_BY_COL) + >>> matrix.matrix_option_set_int32(A, lib.GxB_SPARSITY_CONTROL, lib.GxB_SPARSE) + >>> matrix.set_int64(A, 10, 0, 0) + >>> matrix.matrix_wait(A, lib.GrB_MATERIALIZE) + >>> it = iterator_new() + >>> info = col_iterator_attach(it, A) + >>> info == lib.GrB_SUCCESS + True + + """ + info = lib.GxB_colIterator_attach( + it[0], A[0], ffi.NULL if desc is None else desc[0], + ) + return _check_info(info) + + +def vector_iterator_attach(it, v, desc=None): + """Attach an iterator to a vector. + + Returns ``lib.GrB_SUCCESS`` or ``lib.GxB_EXHAUSTED``. + + >>> from suitesparse_graphblas import vector + >>> v = vector.vector_new(lib.GrB_INT64, 3) + >>> vector.set_int64(v, 42, 0) + >>> vector.set_int64(v, 7, 2) + >>> vector.vector_wait(v, lib.GrB_MATERIALIZE) + >>> it = iterator_new() + >>> info = vector_iterator_attach(it, v) + >>> info == lib.GrB_SUCCESS + True + + """ + info = lib.GxB_Vector_Iterator_attach( + it[0], v[0], ffi.NULL if desc is None else desc[0], + ) + return _check_info(info) + + +# --------------------------------------------------------------------------- +# Matrix entry iterator +# --------------------------------------------------------------------------- + + +def matrix_iterator_seek(it, p): + """Seek the matrix entry iterator to position p. + + Returns ``lib.GrB_SUCCESS`` or ``lib.GxB_EXHAUSTED``. + + >>> from suitesparse_graphblas import matrix + >>> A = matrix.matrix_new(lib.GrB_INT64, 2, 2) + >>> matrix.matrix_option_set_int32(A, lib.GxB_SPARSITY_CONTROL, lib.GxB_SPARSE) + >>> matrix.set_int64(A, 10, 0, 0) + >>> matrix.matrix_wait(A, lib.GrB_MATERIALIZE) + >>> it = iterator_new() + >>> matrix_iterator_attach(it, A) == lib.GrB_SUCCESS + True + >>> matrix_iterator_seek(it, 0) == lib.GrB_SUCCESS + True + + """ + info = lib.GxB_Matrix_Iterator_seek(it[0], p) + return _check_info(info) + + +def matrix_iterator_next(it): + """Advance the matrix entry iterator to the next entry. + + Returns ``lib.GrB_SUCCESS`` or ``lib.GxB_EXHAUSTED``. + + >>> from suitesparse_graphblas import matrix + >>> A = matrix.matrix_new(lib.GrB_INT64, 2, 2) + >>> matrix.matrix_option_set_int32(A, lib.GxB_SPARSITY_CONTROL, lib.GxB_SPARSE) + >>> matrix.set_int64(A, 10, 0, 0) + >>> matrix.set_int64(A, 20, 1, 1) + >>> matrix.matrix_wait(A, lib.GrB_MATERIALIZE) + >>> it = iterator_new() + >>> matrix_iterator_attach(it, A) == lib.GrB_SUCCESS + True + >>> matrix_iterator_seek(it, 0) == lib.GrB_SUCCESS + True + >>> iterator_get_int64(it) + 10 + >>> matrix_iterator_next(it) == lib.GrB_SUCCESS + True + >>> iterator_get_int64(it) + 20 + >>> matrix_iterator_next(it) == lib.GxB_EXHAUSTED + True + + """ + info = lib.GxB_Matrix_Iterator_next(it[0]) + return _check_info(info) + + +def matrix_iterator_get_index(it): + """Get the row and column index of the current matrix entry. + + Returns a ``(row, col)`` tuple. + + >>> from suitesparse_graphblas import matrix + >>> A = matrix.matrix_new(lib.GrB_INT64, 2, 2) + >>> matrix.matrix_option_set_int32(A, lib.GxB_SPARSITY_CONTROL, lib.GxB_SPARSE) + >>> matrix.set_int64(A, 10, 0, 1) + >>> matrix.matrix_wait(A, lib.GrB_MATERIALIZE) + >>> it = iterator_new() + >>> matrix_iterator_attach(it, A) == lib.GrB_SUCCESS + True + >>> matrix_iterator_seek(it, 0) == lib.GrB_SUCCESS + True + >>> matrix_iterator_get_index(it) + (0, 1) + + """ + row = ffi.new("GrB_Index*") + col = ffi.new("GrB_Index*") + lib.GxB_Matrix_Iterator_getIndex(it[0], row, col) + return (row[0], col[0]) + + +def matrix_iterator_getp(it): + """Get the current position of the matrix entry iterator.""" + return lib.GxB_Matrix_Iterator_getp(it[0]) + + +def matrix_iterator_getpmax(it): + """Get the maximum position of the matrix entry iterator.""" + return lib.GxB_Matrix_Iterator_getpmax(it[0]) + + +# --------------------------------------------------------------------------- +# Row iterator +# --------------------------------------------------------------------------- + + +def row_iterator_seek_row(it, row): + """Seek the row iterator to a specific row. + + Returns ``lib.GrB_SUCCESS`` or ``lib.GxB_EXHAUSTED``. + + >>> from suitesparse_graphblas import matrix + >>> A = matrix.matrix_new(lib.GrB_INT64, 2, 2) + >>> matrix.matrix_option_set_int32(A, lib.GxB_SPARSITY_CONTROL, lib.GxB_SPARSE) + >>> matrix.set_int64(A, 10, 0, 0) + >>> matrix.set_int64(A, 20, 1, 1) + >>> matrix.matrix_wait(A, lib.GrB_MATERIALIZE) + >>> it = iterator_new() + >>> row_iterator_attach(it, A) == lib.GrB_SUCCESS + True + >>> row_iterator_seek_row(it, 1) == lib.GrB_SUCCESS + True + >>> iterator_get_int64(it) + 20 + + """ + info = lib.GxB_rowIterator_seekRow(it[0], row) + return _check_info(info) + + +def row_iterator_next_row(it): + """Advance the row iterator to the next non-empty row. + + Returns ``lib.GrB_SUCCESS`` or ``lib.GxB_EXHAUSTED``. + + >>> from suitesparse_graphblas import matrix + >>> A = matrix.matrix_new(lib.GrB_INT64, 2, 2) + >>> matrix.matrix_option_set_int32(A, lib.GxB_SPARSITY_CONTROL, lib.GxB_SPARSE) + >>> matrix.set_int64(A, 10, 0, 0) + >>> matrix.set_int64(A, 20, 1, 1) + >>> matrix.matrix_wait(A, lib.GrB_MATERIALIZE) + >>> it = iterator_new() + >>> row_iterator_attach(it, A) == lib.GrB_SUCCESS + True + >>> row_iterator_get_row_index(it) + 0 + >>> row_iterator_next_row(it) == lib.GrB_SUCCESS + True + >>> row_iterator_get_row_index(it) + 1 + + """ + info = lib.GxB_rowIterator_nextRow(it[0]) + return _check_info(info) + + +def row_iterator_next_col(it): + """Advance the row iterator to the next entry in the current row. + + Returns ``lib.GrB_SUCCESS`` or ``lib.GxB_EXHAUSTED``. + + >>> from suitesparse_graphblas import matrix + >>> A = matrix.matrix_new(lib.GrB_INT64, 2, 2) + >>> matrix.matrix_option_set_int32(A, lib.GxB_SPARSITY_CONTROL, lib.GxB_SPARSE) + >>> matrix.set_int64(A, 10, 0, 0) + >>> matrix.set_int64(A, 20, 0, 1) + >>> matrix.matrix_wait(A, lib.GrB_MATERIALIZE) + >>> it = iterator_new() + >>> row_iterator_attach(it, A) == lib.GrB_SUCCESS + True + >>> iterator_get_int64(it) + 10 + >>> _ = row_iterator_next_col(it) + >>> iterator_get_int64(it) + 20 + >>> row_iterator_get_col_index(it) + 1 + + """ + info = lib.GxB_rowIterator_nextCol(it[0]) + return _check_info(info) + + +def row_iterator_kseek(it, k): + """Seek the row iterator to the k-th entry in the current row. + + Returns ``lib.GrB_SUCCESS`` or ``lib.GxB_EXHAUSTED``. + """ + info = lib.GxB_rowIterator_kseek(it[0], k) + return _check_info(info) + + +def row_iterator_get_row_index(it): + """Get the current row index of the row iterator.""" + return lib.GxB_rowIterator_getRowIndex(it[0]) + + +def row_iterator_get_col_index(it): + """Get the current column index of the row iterator.""" + return lib.GxB_rowIterator_getColIndex(it[0]) + + +def row_iterator_kount(it): + """Get the number of entries in the current row.""" + return lib.GxB_rowIterator_kount(it[0]) + + +# --------------------------------------------------------------------------- +# Column iterator +# --------------------------------------------------------------------------- + + +def col_iterator_seek_col(it, col): + """Seek the column iterator to a specific column. + + Returns ``lib.GrB_SUCCESS`` or ``lib.GxB_EXHAUSTED``. + + >>> from suitesparse_graphblas import matrix + >>> A = matrix.matrix_new(lib.GrB_INT64, 2, 2) + >>> matrix.matrix_set_format(A, lib.GxB_BY_COL) + >>> matrix.matrix_option_set_int32(A, lib.GxB_SPARSITY_CONTROL, lib.GxB_SPARSE) + >>> matrix.set_int64(A, 10, 0, 0) + >>> matrix.set_int64(A, 20, 1, 1) + >>> matrix.matrix_wait(A, lib.GrB_MATERIALIZE) + >>> it = iterator_new() + >>> col_iterator_attach(it, A) == lib.GrB_SUCCESS + True + >>> col_iterator_seek_col(it, 1) == lib.GrB_SUCCESS + True + >>> iterator_get_int64(it) + 20 + + """ + info = lib.GxB_colIterator_seekCol(it[0], col) + return _check_info(info) + + +def col_iterator_next_col(it): + """Advance the column iterator to the next non-empty column. + + Returns ``lib.GrB_SUCCESS`` or ``lib.GxB_EXHAUSTED``. + + >>> from suitesparse_graphblas import matrix + >>> A = matrix.matrix_new(lib.GrB_INT64, 2, 2) + >>> matrix.matrix_set_format(A, lib.GxB_BY_COL) + >>> matrix.matrix_option_set_int32(A, lib.GxB_SPARSITY_CONTROL, lib.GxB_SPARSE) + >>> matrix.set_int64(A, 10, 0, 0) + >>> matrix.set_int64(A, 20, 1, 1) + >>> matrix.matrix_wait(A, lib.GrB_MATERIALIZE) + >>> it = iterator_new() + >>> col_iterator_attach(it, A) == lib.GrB_SUCCESS + True + >>> col_iterator_get_col_index(it) + 0 + >>> col_iterator_next_col(it) == lib.GrB_SUCCESS + True + >>> col_iterator_get_col_index(it) + 1 + + """ + info = lib.GxB_colIterator_nextCol(it[0]) + return _check_info(info) + + +def col_iterator_next_row(it): + """Advance the column iterator to the next entry in the current column. + + Returns ``lib.GrB_SUCCESS`` or ``lib.GxB_EXHAUSTED``. + """ + info = lib.GxB_colIterator_nextRow(it[0]) + return _check_info(info) + + +def col_iterator_kseek(it, k): + """Seek the column iterator to the k-th entry in the current column. + + Returns ``lib.GrB_SUCCESS`` or ``lib.GxB_EXHAUSTED``. + """ + info = lib.GxB_colIterator_kseek(it[0], k) + return _check_info(info) + + +def col_iterator_get_col_index(it): + """Get the current column index of the column iterator.""" + return lib.GxB_colIterator_getColIndex(it[0]) + + +def col_iterator_get_row_index(it): + """Get the current row index of the column iterator.""" + return lib.GxB_colIterator_getRowIndex(it[0]) + + +def col_iterator_kount(it): + """Get the number of entries in the current column.""" + return lib.GxB_colIterator_kount(it[0]) + + +# --------------------------------------------------------------------------- +# Vector iterator +# --------------------------------------------------------------------------- + + +def vector_iterator_seek(it, p): + """Seek the vector iterator to position p. + + Returns ``lib.GrB_SUCCESS`` or ``lib.GxB_EXHAUSTED``. + + >>> from suitesparse_graphblas import vector + >>> v = vector.vector_new(lib.GrB_INT64, 3) + >>> vector.set_int64(v, 42, 0) + >>> vector.set_int64(v, 7, 2) + >>> vector.vector_wait(v, lib.GrB_MATERIALIZE) + >>> it = iterator_new() + >>> vector_iterator_attach(it, v) == lib.GrB_SUCCESS + True + >>> vector_iterator_seek(it, 0) == lib.GrB_SUCCESS + True + >>> iterator_get_int64(it) + 42 + + """ + info = lib.GxB_Vector_Iterator_seek(it[0], p) + return _check_info(info) + + +def vector_iterator_next(it): + """Advance the vector iterator to the next entry. + + Returns ``lib.GrB_SUCCESS`` or ``lib.GxB_EXHAUSTED``. + + >>> from suitesparse_graphblas import vector + >>> v = vector.vector_new(lib.GrB_INT64, 3) + >>> vector.set_int64(v, 42, 0) + >>> vector.set_int64(v, 7, 2) + >>> vector.vector_wait(v, lib.GrB_MATERIALIZE) + >>> it = iterator_new() + >>> vector_iterator_attach(it, v) == lib.GrB_SUCCESS + True + >>> vector_iterator_seek(it, 0) == lib.GrB_SUCCESS + True + >>> vector_iterator_get_index(it) + 0 + >>> iterator_get_int64(it) + 42 + >>> vector_iterator_next(it) == lib.GrB_SUCCESS + True + >>> vector_iterator_get_index(it) + 2 + >>> iterator_get_int64(it) + 7 + >>> vector_iterator_next(it) == lib.GxB_EXHAUSTED + True + + """ + info = lib.GxB_Vector_Iterator_next(it[0]) + return _check_info(info) + + +def vector_iterator_get_index(it): + """Get the current index of the vector iterator.""" + return lib.GxB_Vector_Iterator_getIndex(it[0]) + + +def vector_iterator_getp(it): + """Get the current position of the vector iterator.""" + return lib.GxB_Vector_Iterator_getp(it[0]) + + +def vector_iterator_getpmax(it): + """Get the maximum position of the vector iterator.""" + return lib.GxB_Vector_Iterator_getpmax(it[0]) + + +# --------------------------------------------------------------------------- +# Value getters (shared across all iteration modes) +# --------------------------------------------------------------------------- + + +def iterator_get_bool(it): + """Get the current boolean value from the iterator.""" + return lib.GxB_Iterator_get_BOOL(it[0]) + + +def iterator_get_int8(it): + """Get the current int8 value from the iterator.""" + return lib.GxB_Iterator_get_INT8(it[0]) + + +def iterator_get_int16(it): + """Get the current int16 value from the iterator.""" + return lib.GxB_Iterator_get_INT16(it[0]) + + +def iterator_get_int32(it): + """Get the current int32 value from the iterator.""" + return lib.GxB_Iterator_get_INT32(it[0]) + + +def iterator_get_int64(it): + """Get the current int64 value from the iterator.""" + return lib.GxB_Iterator_get_INT64(it[0]) + + +def iterator_get_uint8(it): + """Get the current uint8 value from the iterator.""" + return lib.GxB_Iterator_get_UINT8(it[0]) + + +def iterator_get_uint16(it): + """Get the current uint16 value from the iterator.""" + return lib.GxB_Iterator_get_UINT16(it[0]) + + +def iterator_get_uint32(it): + """Get the current uint32 value from the iterator.""" + return lib.GxB_Iterator_get_UINT32(it[0]) + + +def iterator_get_uint64(it): + """Get the current uint64 value from the iterator.""" + return lib.GxB_Iterator_get_UINT64(it[0]) + + +def iterator_get_fp32(it): + """Get the current fp32 value from the iterator.""" + return lib.GxB_Iterator_get_FP32(it[0]) + + +def iterator_get_fp64(it): + """Get the current fp64 value from the iterator.""" + return lib.GxB_Iterator_get_FP64(it[0]) + + +if supports_complex(): + + def iterator_get_fc32(it): + """Get the current fc32 value from the iterator.""" + return lib.GxB_Iterator_get_FC32(it[0]) + + def iterator_get_fc64(it): + """Get the current fc64 value from the iterator.""" + return lib.GxB_Iterator_get_FC64(it[0]) diff --git a/suitesparse_graphblas/matrix.py b/suitesparse_graphblas/matrix.py index 7646090..7e70907 100644 --- a/suitesparse_graphblas/matrix.py +++ b/suitesparse_graphblas/matrix.py @@ -1,5 +1,24 @@ +import os +import sys + +import numpy as np + from suitesparse_graphblas import check_status, ffi, lib, supports_complex + +def _capture_c_output(fn, *args): + """Capture C-level stdout output from a function call.""" + sys.stdout.flush() + r, w = os.pipe() + old = os.dup(1) + os.dup2(w, 1) + fn(*args) + os.dup2(old, 1) + os.close(w) + out = os.read(r, 100000).decode() + os.close(r) + return out + from .io.serialize import deserialize_matrix as deserialize # noqa: F401 from .io.serialize import serialize_matrix as serialize # noqa: F401 @@ -176,6 +195,1182 @@ def matrix_set_bitmap_switch(A, bitmap_switch): check_status(A, lib.GxB_Matrix_Option_set_FP64(A[0], lib.GxB_BITMAP_SWITCH, bitmap_switch)) +def matrix_option_get_int32(A, field): + """Get a matrix option as an int32. + + >>> A = matrix_new(lib.GrB_INT64, 2, 2) + >>> matrix_option_get_int32(A, lib.GxB_FORMAT) == lib.GxB_BY_ROW + True + + """ + val = ffi.new("int32_t*") + check_status(A, lib.GxB_Matrix_Option_get_INT32(A[0], field, val)) + return val[0] + + +def matrix_option_set_int32(A, field, value): + """Set a matrix option from an int32. + + >>> A = matrix_new(lib.GrB_INT64, 2, 2) + >>> matrix_option_set_int32(A, lib.GxB_FORMAT, lib.GxB_BY_COL) + >>> matrix_option_get_int32(A, lib.GxB_FORMAT) == lib.GxB_BY_COL + True + + """ + check_status(A, lib.GxB_Matrix_Option_set_INT32( + A[0], field, ffi.cast("int32_t", value), + )) + + +def matrix_option_get_fp64(A, field): + """Get a matrix option as a float64. + + >>> A = matrix_new(lib.GrB_INT64, 2, 2) + >>> isinstance(matrix_option_get_fp64(A, lib.GxB_HYPER_SWITCH), float) + True + + """ + val = ffi.new("double*") + check_status(A, lib.GxB_Matrix_Option_get_FP64(A[0], field, val)) + return val[0] + + +def matrix_option_set_fp64(A, field, value): + """Set a matrix option from a float64. + + >>> A = matrix_new(lib.GrB_INT64, 2, 2) + >>> matrix_option_set_fp64(A, lib.GxB_HYPER_SWITCH, 0.5) + >>> matrix_option_get_fp64(A, lib.GxB_HYPER_SWITCH) == 0.5 + True + + """ + check_status(A, lib.GxB_Matrix_Option_set_FP64( + A[0], field, ffi.cast("double", value), + )) + + +# --------------------------------------------------------------------------- +# GraphBLAS operations +# --------------------------------------------------------------------------- + + +def matrix_dup(A, *, free=matrix_free): + """Duplicate a matrix. + + >>> A = matrix_new(lib.GrB_INT64, 2, 2) + >>> set_int64(A, 42, 0, 0) + >>> B = matrix_dup(A) + >>> get_int64(B, 0, 0) == 42 + True + + """ + C = ffi.new("GrB_Matrix*") + check_status(C, lib.GrB_Matrix_dup(C, A[0])) + if free: + return ffi.gc(C, free) + return C + + +def matrix_clear(A): + """Remove all entries from a matrix. + + >>> A = matrix_new(lib.GrB_INT64, 2, 2) + >>> set_int64(A, 42, 0, 0) + >>> matrix_nvals(A) == 1 + True + >>> matrix_clear(A) + >>> matrix_nvals(A) == 0 + True + + """ + check_status(A, lib.GrB_Matrix_clear(A[0])) + + +def matrix_wait(A, waitmode=lib.GrB_COMPLETE): + """Wait for a matrix to complete pending operations. + + >>> A = matrix_new(lib.GrB_INT64, 2, 2) + >>> matrix_wait(A) + + """ + check_status(A, lib.GrB_Matrix_wait(A[0], waitmode)) + + +def matrix_print(A, name="", level=lib.GxB_COMPLETE): + """Print a matrix to stdout. + + ``level`` controls verbosity: ``lib.GxB_SILENT``, ``lib.GxB_SUMMARY``, + ``lib.GxB_SHORT``, ``lib.GxB_COMPLETE``, ``lib.GxB_SHORT_VERBOSE``, + or ``lib.GxB_COMPLETE_VERBOSE``. + + >>> A = matrix_new(lib.GrB_INT64, 2, 2) + >>> set_int64(A, 42, 0, 0) + >>> matrix_wait(A, lib.GrB_MATERIALIZE) + >>> out = _capture_c_output(matrix_print, A, 'A', lib.GxB_SHORT) + >>> '2x2 GraphBLAS int64_t matrix' in out + True + >>> '(0,0) 42' in out + True + + """ + check_status(A, lib.GxB_Matrix_fprint( + A[0], name.encode() if isinstance(name, str) else name, + level, ffi.NULL, + )) + + +def matrix_fprint(A, f, name="", level=lib.GxB_COMPLETE): + """Print a matrix to a C FILE* stream. + + Pass ``ffi.NULL`` for ``f`` to print to stdout. + ``level`` controls verbosity (see :func:`matrix_print`). + + >>> A = matrix_new(lib.GrB_INT64, 2, 2) + >>> set_int64(A, 7, 1, 1) + >>> matrix_wait(A, lib.GrB_MATERIALIZE) + >>> out = _capture_c_output(matrix_fprint, A, ffi.NULL, 'A', lib.GxB_SHORT) + >>> '2x2 GraphBLAS int64_t matrix' in out + True + >>> '(1,1) 7' in out + True + + """ + check_status(A, lib.GxB_Matrix_fprint( + A[0], name.encode() if isinstance(name, str) else name, + level, f, + )) + + +def matrix_mxm(C, semiring, A, B, mask=None, accum=None, desc=None): + """Multiply two matrices using a semiring: C = A (+.*) B. + + >>> C = matrix_new(lib.GrB_INT64, 2, 2) + >>> A = matrix_new(lib.GrB_INT64, 2, 2) + >>> B = matrix_new(lib.GrB_INT64, 2, 2) + >>> set_int64(A, 2, 0, 0) + >>> set_int64(B, 3, 0, 0) + >>> matrix_mxm(C, lib.GrB_PLUS_TIMES_SEMIRING_INT64, A, B) + >>> get_int64(C, 0, 0) == 6 + True + + """ + check_status(C, lib.GrB_mxm( + C[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + semiring, + A[0], + B[0], + ffi.NULL if desc is None else desc[0], + )) + + +def matrix_ewise_add(C, op, A, B, mask=None, accum=None, desc=None): + """Element-wise addition of two matrices using a binary operator. + + >>> C = matrix_new(lib.GrB_INT64, 2, 2) + >>> A = matrix_new(lib.GrB_INT64, 2, 2) + >>> B = matrix_new(lib.GrB_INT64, 2, 2) + >>> set_int64(A, 2, 0, 0) + >>> set_int64(B, 3, 0, 0) + >>> matrix_ewise_add(C, lib.GrB_PLUS_INT64, A, B) + >>> get_int64(C, 0, 0) == 5 + True + + """ + check_status(C, lib.GrB_Matrix_eWiseAdd_BinaryOp( + C[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + op, + A[0], + B[0], + ffi.NULL if desc is None else desc[0], + )) + + +def matrix_ewise_mult(C, op, A, B, mask=None, accum=None, desc=None): + """Element-wise multiplication of two matrices using a binary operator. + + >>> C = matrix_new(lib.GrB_INT64, 2, 2) + >>> A = matrix_new(lib.GrB_INT64, 2, 2) + >>> B = matrix_new(lib.GrB_INT64, 2, 2) + >>> set_int64(A, 2, 0, 0) + >>> set_int64(B, 3, 0, 0) + >>> matrix_ewise_mult(C, lib.GrB_TIMES_INT64, A, B) + >>> get_int64(C, 0, 0) == 6 + True + + """ + check_status(C, lib.GrB_Matrix_eWiseMult_BinaryOp( + C[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + op, + A[0], + B[0], + ffi.NULL if desc is None else desc[0], + )) + + +def matrix_ewise_union(C, op, A, alpha, B, beta, mask=None, accum=None, desc=None): + """Element-wise union of two matrices using a binary operator. + + Unlike eWiseAdd, entries present in only one operand use the + corresponding default scalar (``alpha`` for A, ``beta`` for B). + + >>> from suitesparse_graphblas import scalar + >>> C = matrix_new(lib.GrB_INT64, 2, 2) + >>> A = matrix_new(lib.GrB_INT64, 2, 2) + >>> B = matrix_new(lib.GrB_INT64, 2, 2) + >>> set_int64(A, 2, 0, 0) + >>> set_int64(B, 3, 1, 1) + >>> a = scalar.scalar_new(lib.GrB_INT64) + >>> b = scalar.scalar_new(lib.GrB_INT64) + >>> scalar.set_int64(a, 0) + >>> scalar.set_int64(b, 0) + >>> matrix_ewise_union(C, lib.GrB_PLUS_INT64, A, a, B, b) + >>> get_int64(C, 0, 0) == 2 + True + >>> get_int64(C, 1, 1) == 3 + True + + """ + check_status(C, lib.GxB_Matrix_eWiseUnion( + C[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + op, + A[0], alpha[0], + B[0], beta[0], + ffi.NULL if desc is None else desc[0], + )) + + +def matrix_apply(C, op, A, mask=None, accum=None, desc=None): + """Apply a unary operator to each entry of a matrix. + + >>> C = matrix_new(lib.GrB_INT64, 2, 2) + >>> A = matrix_new(lib.GrB_INT64, 2, 2) + >>> set_int64(A, -5, 0, 0) + >>> matrix_apply(C, lib.GrB_ABS_INT64, A) + >>> get_int64(C, 0, 0) == 5 + True + + """ + check_status(C, lib.GrB_Matrix_apply( + C[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + op, + A[0], + ffi.NULL if desc is None else desc[0], + )) + + +def matrix_apply_first(C, op, x, A, mask=None, accum=None, desc=None): + """Apply a binary operator with a scalar bound to the first argument: C = op(x, A). + + >>> from suitesparse_graphblas import scalar + >>> C = matrix_new(lib.GrB_INT64, 2, 2) + >>> A = matrix_new(lib.GrB_INT64, 2, 2) + >>> set_int64(A, 3, 0, 0) + >>> s = scalar.scalar_new(lib.GrB_INT64) + >>> scalar.set_int64(s, 10) + >>> matrix_apply_first(C, lib.GrB_TIMES_INT64, s, A) + >>> get_int64(C, 0, 0) == 30 + True + + """ + check_status(C, lib.GrB_Matrix_apply_BinaryOp1st_Scalar( + C[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + op, + x[0], + A[0], + ffi.NULL if desc is None else desc[0], + )) + + +def matrix_apply_second(C, op, A, y, mask=None, accum=None, desc=None): + """Apply a binary operator with a scalar bound to the second argument: C = op(A, y). + + >>> from suitesparse_graphblas import scalar + >>> C = matrix_new(lib.GrB_INT64, 2, 2) + >>> A = matrix_new(lib.GrB_INT64, 2, 2) + >>> set_int64(A, 10, 0, 0) + >>> s = scalar.scalar_new(lib.GrB_INT64) + >>> scalar.set_int64(s, 3) + >>> matrix_apply_second(C, lib.GrB_TIMES_INT64, A, s) + >>> get_int64(C, 0, 0) == 30 + True + + """ + check_status(C, lib.GrB_Matrix_apply_BinaryOp2nd_Scalar( + C[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + op, + A[0], + y[0], + ffi.NULL if desc is None else desc[0], + )) + + +def matrix_select(C, op, A, thunk, mask=None, accum=None, desc=None): + """Select entries from a matrix using an index unary operator and scalar thunk. + + >>> from suitesparse_graphblas import scalar + >>> C = matrix_new(lib.GrB_INT64, 2, 2) + >>> A = matrix_new(lib.GrB_INT64, 2, 2) + >>> set_int64(A, 5, 0, 0) + >>> set_int64(A, 1, 1, 1) + >>> s = scalar.scalar_new(lib.GrB_INT64) + >>> scalar.set_int64(s, 3) + >>> matrix_select(C, lib.GrB_VALUEGT_INT64, A, s) + >>> matrix_nvals(C) == 1 + True + >>> get_int64(C, 0, 0) == 5 + True + + """ + check_status(C, lib.GrB_Matrix_select_Scalar( + C[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + op, + A[0], + thunk[0], + ffi.NULL if desc is None else desc[0], + )) + + +def matrix_reduce(w, monoid, A, mask=None, accum=None, desc=None): + """Reduce a matrix to a vector using a monoid (row-wise reduction). + + >>> from suitesparse_graphblas import vector + >>> A = matrix_new(lib.GrB_INT64, 2, 2) + >>> set_int64(A, 2, 0, 0) + >>> set_int64(A, 3, 0, 1) + >>> w = vector.vector_new(lib.GrB_INT64, 2) + >>> matrix_reduce(w, lib.GrB_PLUS_MONOID_INT64, A) + >>> vector.get_int64(w, 0) == 5 + True + + """ + check_status(w, lib.GrB_Matrix_reduce_Monoid( + w[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + monoid, + A[0], + ffi.NULL if desc is None else desc[0], + )) + + +def matrix_reduce_scalar(s, monoid, A, accum=None, desc=None): + """Reduce a matrix to a scalar using a monoid. + + >>> from suitesparse_graphblas import scalar + >>> A = matrix_new(lib.GrB_INT64, 2, 2) + >>> set_int64(A, 2, 0, 0) + >>> set_int64(A, 3, 1, 1) + >>> s = scalar.scalar_new(lib.GrB_INT64) + >>> matrix_reduce_scalar(s, lib.GrB_PLUS_MONOID_INT64, A) + >>> scalar.get_int64(s) == 5 + True + + """ + check_status(s, lib.GrB_Matrix_reduce_Monoid_Scalar( + s[0], + ffi.NULL if accum is None else accum, + monoid, + A[0], + ffi.NULL if desc is None else desc[0], + )) + + +def matrix_transpose(C, A, mask=None, accum=None, desc=None): + """Transpose a matrix. + + >>> C = matrix_new(lib.GrB_INT64, 3, 2) + >>> A = matrix_new(lib.GrB_INT64, 2, 3) + >>> set_int64(A, 7, 0, 2) + >>> matrix_transpose(C, A) + >>> get_int64(C, 2, 0) == 7 + True + + """ + check_status(C, lib.GrB_transpose( + C[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + A[0], + ffi.NULL if desc is None else desc[0], + )) + + +def matrix_kronecker(C, op, A, B, mask=None, accum=None, desc=None): + """Kronecker product of two matrices using a binary operator. + + >>> C = matrix_new(lib.GrB_INT64, 4, 4) + >>> A = matrix_new(lib.GrB_INT64, 2, 2) + >>> B = matrix_new(lib.GrB_INT64, 2, 2) + >>> set_int64(A, 2, 0, 0) + >>> set_int64(B, 3, 0, 0) + >>> matrix_kronecker(C, lib.GrB_TIMES_INT64, A, B) + >>> get_int64(C, 0, 0) == 6 + True + + """ + check_status(C, lib.GrB_Matrix_kronecker_BinaryOp( + C[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + op, + A[0], + B[0], + ffi.NULL if desc is None else desc[0], + )) + + +def matrix_diag(C, v, k=0, desc=None): + """Build a diagonal matrix from a vector. + + The vector ``v`` is placed on the ``k``-th diagonal of ``C`` + (``k=0`` is the main diagonal, positive is above, negative below). + + >>> from suitesparse_graphblas import vector + >>> C = matrix_new(lib.GrB_INT64, 3, 3) + >>> v = vector.vector_new(lib.GrB_INT64, 3) + >>> vector.set_int64(v, 1, 0) + >>> vector.set_int64(v, 2, 1) + >>> vector.set_int64(v, 3, 2) + >>> matrix_diag(C, v, 0) + >>> get_int64(C, 0, 0) == 1 + True + >>> get_int64(C, 1, 1) == 2 + True + >>> get_int64(C, 2, 2) == 3 + True + + """ + check_status(C, lib.GxB_Matrix_diag( + C[0], v[0], k, + ffi.NULL if desc is None else desc[0], + )) + + +def matrix_concat(C, tiles, m, n, desc=None): + """Concatenate an m-by-n grid of tile matrices into C. + + ``tiles`` is a flat list of matrix handles in row-major order, + representing an m-by-n grid of submatrices. + + >>> A = matrix_new(lib.GrB_INT64, 1, 2) + >>> B = matrix_new(lib.GrB_INT64, 1, 2) + >>> set_int64(A, 1, 0, 0) + >>> set_int64(A, 2, 0, 1) + >>> set_int64(B, 3, 0, 0) + >>> set_int64(B, 4, 0, 1) + >>> C = matrix_new(lib.GrB_INT64, 2, 2) + >>> matrix_concat(C, [A, B], 2, 1) + >>> get_int64(C, 0, 0) == 1 + True + >>> get_int64(C, 1, 0) == 3 + True + + """ + tile_array = ffi.new("GrB_Matrix[]", [t[0] for t in tiles]) + check_status(C, lib.GxB_Matrix_concat( + C[0], tile_array, m, n, + ffi.NULL if desc is None else desc[0], + )) + + +def matrix_assign(C, A, rows, nrows, cols, ncols, mask=None, accum=None, desc=None): + """Assign a submatrix: C[rows, cols] = A. + + >>> C = matrix_new(lib.GrB_INT64, 3, 3) + >>> A = matrix_new(lib.GrB_INT64, 2, 2) + >>> set_int64(A, 10, 0, 0) + >>> set_int64(A, 20, 1, 1) + >>> rows = ffi.new("GrB_Index[2]", [0, 1]) + >>> cols = ffi.new("GrB_Index[2]", [0, 1]) + >>> matrix_assign(C, A, rows, 2, cols, 2) + >>> get_int64(C, 0, 0) == 10 + True + >>> get_int64(C, 1, 1) == 20 + True + + """ + check_status(C, lib.GrB_Matrix_assign( + C[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + A[0], + rows, nrows, cols, ncols, + ffi.NULL if desc is None else desc[0], + )) + + +def matrix_assign_scalar(C, x, rows, nrows, cols, ncols, mask=None, accum=None, desc=None): + """Assign a scalar to a submatrix: C[rows, cols] = x. + + >>> from suitesparse_graphblas import scalar + >>> C = matrix_new(lib.GrB_INT64, 3, 3) + >>> s = scalar.scalar_new(lib.GrB_INT64) + >>> scalar.set_int64(s, 99) + >>> rows = ffi.new("GrB_Index[2]", [0, 1]) + >>> cols = ffi.new("GrB_Index[2]", [0, 1]) + >>> matrix_assign_scalar(C, s, rows, 2, cols, 2) + >>> get_int64(C, 0, 0) == 99 + True + >>> get_int64(C, 1, 1) == 99 + True + + """ + check_status(C, lib.GrB_Matrix_assign_Scalar( + C[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + x[0], + rows, nrows, cols, ncols, + ffi.NULL if desc is None else desc[0], + )) + + +def matrix_extract(C, A, rows, nrows, cols, ncols, mask=None, accum=None, desc=None): + """Extract a submatrix: C = A[rows, cols]. + + >>> A = matrix_new(lib.GrB_INT64, 3, 3) + >>> set_int64(A, 42, 1, 2) + >>> C = matrix_new(lib.GrB_INT64, 1, 1) + >>> rows = ffi.new("GrB_Index[1]", [1]) + >>> cols = ffi.new("GrB_Index[1]", [2]) + >>> matrix_extract(C, A, rows, 1, cols, 1) + >>> get_int64(C, 0, 0) == 42 + True + + """ + check_status(C, lib.GrB_Matrix_extract( + C[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + A[0], + rows, nrows, cols, ncols, + ffi.NULL if desc is None else desc[0], + )) + + +def matrix_col_extract(w, A, rows, nrows, j, mask=None, accum=None, desc=None): + """Extract a column from a matrix into a vector: w = A[rows, j]. + + >>> from suitesparse_graphblas import vector + >>> A = matrix_new(lib.GrB_INT64, 3, 3) + >>> set_int64(A, 42, 1, 2) + >>> w = vector.vector_new(lib.GrB_INT64, 3) + >>> matrix_col_extract(w, A, lib.GrB_ALL, 3, 2) + >>> vector.get_int64(w, 1) == 42 + True + + """ + check_status(w, lib.GrB_Col_extract( + w[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + A[0], + rows, nrows, j, + ffi.NULL if desc is None else desc[0], + )) + + +def matrix_col_assign(C, u, rows, nrows, j, mask=None, accum=None, desc=None): + """Assign a vector to a column of a matrix: C[rows, j] = u. + + >>> from suitesparse_graphblas import vector + >>> C = matrix_new(lib.GrB_INT64, 3, 3) + >>> u = vector.vector_new(lib.GrB_INT64, 3) + >>> vector.set_int64(u, 42, 1) + >>> matrix_col_assign(C, u, lib.GrB_ALL, 3, 2) + >>> get_int64(C, 1, 2) == 42 + True + + """ + check_status(C, lib.GrB_Col_assign( + C[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + u[0], + rows, nrows, j, + ffi.NULL if desc is None else desc[0], + )) + + +def matrix_row_assign(C, u, i, cols, ncols, mask=None, accum=None, desc=None): + """Assign a vector to a row of a matrix: C[i, cols] = u. + + >>> from suitesparse_graphblas import vector + >>> C = matrix_new(lib.GrB_INT64, 3, 3) + >>> u = vector.vector_new(lib.GrB_INT64, 3) + >>> vector.set_int64(u, 42, 1) + >>> matrix_row_assign(C, u, 2, lib.GrB_ALL, 3) + >>> get_int64(C, 2, 1) == 42 + True + + """ + check_status(C, lib.GrB_Row_assign( + C[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + u[0], + i, cols, ncols, + ffi.NULL if desc is None else desc[0], + )) + + +def matrix_build_bool(C, rows, cols, vals, nvals, dup): + """Build a matrix from COO arrays of boolean values. + + >>> C = matrix_new(lib.GrB_BOOL, 2, 2) + >>> rows = np.array([0], dtype=np.uint64) + >>> cols = np.array([0], dtype=np.uint64) + >>> vals = np.array([True], dtype=np.bool_) + >>> matrix_build_bool(C, rows, cols, vals, 1, lib.GrB_FIRST_BOOL) + >>> get_bool(C, 0, 0) == True + True + + """ + check_status(C, lib.GrB_Matrix_build_BOOL( + C[0], + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("bool*", ffi.from_buffer(vals)), + nvals, dup, + )) + + +def matrix_build_int8(C, rows, cols, vals, nvals, dup): + """Build a matrix from COO arrays of int8 values. + + >>> C = matrix_new(lib.GrB_INT8, 2, 2) + >>> rows = np.array([0], dtype=np.uint64) + >>> cols = np.array([0], dtype=np.uint64) + >>> vals = np.array([7], dtype=np.int8) + >>> matrix_build_int8(C, rows, cols, vals, 1, lib.GrB_PLUS_INT8) + >>> get_int8(C, 0, 0) == 7 + True + + """ + check_status(C, lib.GrB_Matrix_build_INT8( + C[0], + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("int8_t*", ffi.from_buffer(vals)), + nvals, dup, + )) + + +def matrix_build_int16(C, rows, cols, vals, nvals, dup): + """Build a matrix from COO arrays of int16 values. + + >>> C = matrix_new(lib.GrB_INT16, 2, 2) + >>> rows = np.array([0], dtype=np.uint64) + >>> cols = np.array([0], dtype=np.uint64) + >>> vals = np.array([7], dtype=np.int16) + >>> matrix_build_int16(C, rows, cols, vals, 1, lib.GrB_PLUS_INT16) + >>> get_int16(C, 0, 0) == 7 + True + + """ + check_status(C, lib.GrB_Matrix_build_INT16( + C[0], + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("int16_t*", ffi.from_buffer(vals)), + nvals, dup, + )) + + +def matrix_build_int32(C, rows, cols, vals, nvals, dup): + """Build a matrix from COO arrays of int32 values. + + >>> C = matrix_new(lib.GrB_INT32, 2, 2) + >>> rows = np.array([0], dtype=np.uint64) + >>> cols = np.array([0], dtype=np.uint64) + >>> vals = np.array([7], dtype=np.int32) + >>> matrix_build_int32(C, rows, cols, vals, 1, lib.GrB_PLUS_INT32) + >>> get_int32(C, 0, 0) == 7 + True + + """ + check_status(C, lib.GrB_Matrix_build_INT32( + C[0], + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("int32_t*", ffi.from_buffer(vals)), + nvals, dup, + )) + + +def matrix_build_int64(C, rows, cols, vals, nvals, dup): + """Build a matrix from COO arrays of int64 values. + + >>> C = matrix_new(lib.GrB_INT64, 2, 2) + >>> rows = np.array([0], dtype=np.uint64) + >>> cols = np.array([0], dtype=np.uint64) + >>> vals = np.array([7], dtype=np.int64) + >>> matrix_build_int64(C, rows, cols, vals, 1, lib.GrB_PLUS_INT64) + >>> get_int64(C, 0, 0) == 7 + True + + """ + check_status(C, lib.GrB_Matrix_build_INT64( + C[0], + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("int64_t*", ffi.from_buffer(vals)), + nvals, dup, + )) + + +def matrix_build_uint8(C, rows, cols, vals, nvals, dup): + """Build a matrix from COO arrays of uint8 values. + + >>> C = matrix_new(lib.GrB_UINT8, 2, 2) + >>> rows = np.array([0], dtype=np.uint64) + >>> cols = np.array([0], dtype=np.uint64) + >>> vals = np.array([7], dtype=np.uint8) + >>> matrix_build_uint8(C, rows, cols, vals, 1, lib.GrB_PLUS_UINT8) + >>> get_uint8(C, 0, 0) == 7 + True + + """ + check_status(C, lib.GrB_Matrix_build_UINT8( + C[0], + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("uint8_t*", ffi.from_buffer(vals)), + nvals, dup, + )) + + +def matrix_build_uint16(C, rows, cols, vals, nvals, dup): + """Build a matrix from COO arrays of uint16 values. + + >>> C = matrix_new(lib.GrB_UINT16, 2, 2) + >>> rows = np.array([0], dtype=np.uint64) + >>> cols = np.array([0], dtype=np.uint64) + >>> vals = np.array([7], dtype=np.uint16) + >>> matrix_build_uint16(C, rows, cols, vals, 1, lib.GrB_PLUS_UINT16) + >>> get_uint16(C, 0, 0) == 7 + True + + """ + check_status(C, lib.GrB_Matrix_build_UINT16( + C[0], + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("uint16_t*", ffi.from_buffer(vals)), + nvals, dup, + )) + + +def matrix_build_uint32(C, rows, cols, vals, nvals, dup): + """Build a matrix from COO arrays of uint32 values. + + >>> C = matrix_new(lib.GrB_UINT32, 2, 2) + >>> rows = np.array([0], dtype=np.uint64) + >>> cols = np.array([0], dtype=np.uint64) + >>> vals = np.array([7], dtype=np.uint32) + >>> matrix_build_uint32(C, rows, cols, vals, 1, lib.GrB_PLUS_UINT32) + >>> get_uint32(C, 0, 0) == 7 + True + + """ + check_status(C, lib.GrB_Matrix_build_UINT32( + C[0], + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("uint32_t*", ffi.from_buffer(vals)), + nvals, dup, + )) + + +def matrix_build_uint64(C, rows, cols, vals, nvals, dup): + """Build a matrix from COO arrays of uint64 values. + + >>> C = matrix_new(lib.GrB_UINT64, 2, 2) + >>> rows = np.array([0], dtype=np.uint64) + >>> cols = np.array([0], dtype=np.uint64) + >>> vals = np.array([7], dtype=np.uint64) + >>> matrix_build_uint64(C, rows, cols, vals, 1, lib.GrB_PLUS_UINT64) + >>> get_uint64(C, 0, 0) == 7 + True + + """ + check_status(C, lib.GrB_Matrix_build_UINT64( + C[0], + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("uint64_t*", ffi.from_buffer(vals)), + nvals, dup, + )) + + +def matrix_build_fp32(C, rows, cols, vals, nvals, dup): + """Build a matrix from COO arrays of fp32 values. + + >>> C = matrix_new(lib.GrB_FP32, 2, 2) + >>> rows = np.array([0], dtype=np.uint64) + >>> cols = np.array([0], dtype=np.uint64) + >>> vals = np.array([1.5], dtype=np.float32) + >>> matrix_build_fp32(C, rows, cols, vals, 1, lib.GrB_PLUS_FP32) + >>> get_fp32(C, 0, 0) == 1.5 + True + + """ + check_status(C, lib.GrB_Matrix_build_FP32( + C[0], + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("float*", ffi.from_buffer(vals)), + nvals, dup, + )) + + +def matrix_build_fp64(C, rows, cols, vals, nvals, dup): + """Build a matrix from COO arrays of fp64 values. + + >>> C = matrix_new(lib.GrB_FP64, 2, 2) + >>> rows = np.array([0], dtype=np.uint64) + >>> cols = np.array([0], dtype=np.uint64) + >>> vals = np.array([1.5], dtype=np.float64) + >>> matrix_build_fp64(C, rows, cols, vals, 1, lib.GrB_PLUS_FP64) + >>> get_fp64(C, 0, 0) == 1.5 + True + + """ + check_status(C, lib.GrB_Matrix_build_FP64( + C[0], + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("double*", ffi.from_buffer(vals)), + nvals, dup, + )) + + +def matrix_extract_tuples_int64(A): + """Extract all tuples from a matrix as numpy arrays. + + Returns (rows, cols, vals) as numpy arrays. + + >>> A = matrix_new(lib.GrB_INT64, 2, 2) + >>> set_int64(A, 42, 0, 0) + >>> rows, cols, vals = matrix_extract_tuples_int64(A) + >>> len(vals) == 1 + True + >>> int(vals[0]) == 42 + True + + """ + n = matrix_nvals(A) + rows = np.empty(n, dtype=np.uint64) + cols = np.empty(n, dtype=np.uint64) + vals = np.empty(n, dtype=np.int64) + nvals_p = ffi.new("GrB_Index*", n) + if n > 0: + check_status(A, lib.GrB_Matrix_extractTuples_INT64( + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("int64_t*", ffi.from_buffer(vals)), + nvals_p, A[0], + )) + return rows, cols, vals + + +def matrix_extract_tuples_fp64(A): + """Extract all tuples from a matrix as numpy arrays. + + Returns (rows, cols, vals) as numpy arrays. + + >>> A = matrix_new(lib.GrB_FP64, 2, 2) + >>> set_fp64(A, 1.5, 0, 0) + >>> rows, cols, vals = matrix_extract_tuples_fp64(A) + >>> len(vals) == 1 + True + >>> float(vals[0]) == 1.5 + True + + """ + n = matrix_nvals(A) + rows = np.empty(n, dtype=np.uint64) + cols = np.empty(n, dtype=np.uint64) + vals = np.empty(n, dtype=np.float64) + nvals_p = ffi.new("GrB_Index*", n) + if n > 0: + check_status(A, lib.GrB_Matrix_extractTuples_FP64( + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("double*", ffi.from_buffer(vals)), + nvals_p, A[0], + )) + return rows, cols, vals + +def matrix_extract_tuples_bool(A): + """Extract all tuples from a matrix as numpy arrays. + + Returns (rows, cols, vals) as numpy arrays. + + >>> A = matrix_new(lib.GrB_BOOL, 2, 2) + >>> set_bool(A, True, 0, 0) + >>> rows, cols, vals = matrix_extract_tuples_bool(A) + >>> len(vals) == 1 + True + >>> bool(vals[0]) == True + True + + """ + n = matrix_nvals(A) + rows = np.empty(n, dtype=np.uint64) + cols = np.empty(n, dtype=np.uint64) + vals = np.empty(n, dtype=np.bool_) + nvals_p = ffi.new("GrB_Index*", n) + if n > 0: + check_status(A, lib.GrB_Matrix_extractTuples_BOOL( + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("bool*", ffi.from_buffer(vals)), + nvals_p, A[0], + )) + return rows, cols, vals + +def matrix_extract_tuples_int8(A): + """Extract all tuples from a matrix as numpy arrays. + + Returns (rows, cols, vals) as numpy arrays. + + >>> A = matrix_new(lib.GrB_INT8, 2, 2) + >>> set_int8(A, 7, 0, 0) + >>> rows, cols, vals = matrix_extract_tuples_int8(A) + >>> len(vals) == 1 + True + >>> int(vals[0]) == 7 + True + + """ + n = matrix_nvals(A) + rows = np.empty(n, dtype=np.uint64) + cols = np.empty(n, dtype=np.uint64) + vals = np.empty(n, dtype=np.int8) + nvals_p = ffi.new("GrB_Index*", n) + if n > 0: + check_status(A, lib.GrB_Matrix_extractTuples_INT8( + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("int8_t*", ffi.from_buffer(vals)), + nvals_p, A[0], + )) + return rows, cols, vals + +def matrix_extract_tuples_int16(A): + """Extract all tuples from a matrix as numpy arrays. + + Returns (rows, cols, vals) as numpy arrays. + + >>> A = matrix_new(lib.GrB_INT16, 2, 2) + >>> set_int16(A, 7, 0, 0) + >>> rows, cols, vals = matrix_extract_tuples_int16(A) + >>> len(vals) == 1 + True + >>> int(vals[0]) == 7 + True + + """ + n = matrix_nvals(A) + rows = np.empty(n, dtype=np.uint64) + cols = np.empty(n, dtype=np.uint64) + vals = np.empty(n, dtype=np.int16) + nvals_p = ffi.new("GrB_Index*", n) + if n > 0: + check_status(A, lib.GrB_Matrix_extractTuples_INT16( + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("int16_t*", ffi.from_buffer(vals)), + nvals_p, A[0], + )) + return rows, cols, vals + +def matrix_extract_tuples_int32(A): + """Extract all tuples from a matrix as numpy arrays. + + Returns (rows, cols, vals) as numpy arrays. + + >>> A = matrix_new(lib.GrB_INT32, 2, 2) + >>> set_int32(A, 7, 0, 0) + >>> rows, cols, vals = matrix_extract_tuples_int32(A) + >>> len(vals) == 1 + True + >>> int(vals[0]) == 7 + True + + """ + n = matrix_nvals(A) + rows = np.empty(n, dtype=np.uint64) + cols = np.empty(n, dtype=np.uint64) + vals = np.empty(n, dtype=np.int32) + nvals_p = ffi.new("GrB_Index*", n) + if n > 0: + check_status(A, lib.GrB_Matrix_extractTuples_INT32( + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("int32_t*", ffi.from_buffer(vals)), + nvals_p, A[0], + )) + return rows, cols, vals + +def matrix_extract_tuples_uint8(A): + """Extract all tuples from a matrix as numpy arrays. + + Returns (rows, cols, vals) as numpy arrays. + + >>> A = matrix_new(lib.GrB_UINT8, 2, 2) + >>> set_uint8(A, 7, 0, 0) + >>> rows, cols, vals = matrix_extract_tuples_uint8(A) + >>> len(vals) == 1 + True + >>> int(vals[0]) == 7 + True + + """ + n = matrix_nvals(A) + rows = np.empty(n, dtype=np.uint64) + cols = np.empty(n, dtype=np.uint64) + vals = np.empty(n, dtype=np.uint8) + nvals_p = ffi.new("GrB_Index*", n) + if n > 0: + check_status(A, lib.GrB_Matrix_extractTuples_UINT8( + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("uint8_t*", ffi.from_buffer(vals)), + nvals_p, A[0], + )) + return rows, cols, vals + +def matrix_extract_tuples_uint16(A): + """Extract all tuples from a matrix as numpy arrays. + + Returns (rows, cols, vals) as numpy arrays. + + >>> A = matrix_new(lib.GrB_UINT16, 2, 2) + >>> set_uint16(A, 7, 0, 0) + >>> rows, cols, vals = matrix_extract_tuples_uint16(A) + >>> len(vals) == 1 + True + >>> int(vals[0]) == 7 + True + + """ + n = matrix_nvals(A) + rows = np.empty(n, dtype=np.uint64) + cols = np.empty(n, dtype=np.uint64) + vals = np.empty(n, dtype=np.uint16) + nvals_p = ffi.new("GrB_Index*", n) + if n > 0: + check_status(A, lib.GrB_Matrix_extractTuples_UINT16( + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("uint16_t*", ffi.from_buffer(vals)), + nvals_p, A[0], + )) + return rows, cols, vals + +def matrix_extract_tuples_uint32(A): + """Extract all tuples from a matrix as numpy arrays. + + Returns (rows, cols, vals) as numpy arrays. + + >>> A = matrix_new(lib.GrB_UINT32, 2, 2) + >>> set_uint32(A, 7, 0, 0) + >>> rows, cols, vals = matrix_extract_tuples_uint32(A) + >>> len(vals) == 1 + True + >>> int(vals[0]) == 7 + True + + """ + n = matrix_nvals(A) + rows = np.empty(n, dtype=np.uint64) + cols = np.empty(n, dtype=np.uint64) + vals = np.empty(n, dtype=np.uint32) + nvals_p = ffi.new("GrB_Index*", n) + if n > 0: + check_status(A, lib.GrB_Matrix_extractTuples_UINT32( + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("uint32_t*", ffi.from_buffer(vals)), + nvals_p, A[0], + )) + return rows, cols, vals + +def matrix_extract_tuples_uint64(A): + """Extract all tuples from a matrix as numpy arrays. + + Returns (rows, cols, vals) as numpy arrays. + + >>> A = matrix_new(lib.GrB_UINT64, 2, 2) + >>> set_uint64(A, 7, 0, 0) + >>> rows, cols, vals = matrix_extract_tuples_uint64(A) + >>> len(vals) == 1 + True + >>> int(vals[0]) == 7 + True + + """ + n = matrix_nvals(A) + rows = np.empty(n, dtype=np.uint64) + cols = np.empty(n, dtype=np.uint64) + vals = np.empty(n, dtype=np.uint64) + nvals_p = ffi.new("GrB_Index*", n) + if n > 0: + check_status(A, lib.GrB_Matrix_extractTuples_UINT64( + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("uint64_t*", ffi.from_buffer(vals)), + nvals_p, A[0], + )) + return rows, cols, vals + +def matrix_extract_tuples_fp32(A): + """Extract all tuples from a matrix as numpy arrays. + + Returns (rows, cols, vals) as numpy arrays. + + >>> A = matrix_new(lib.GrB_FP32, 2, 2) + >>> set_fp32(A, 1.5, 0, 0) + >>> rows, cols, vals = matrix_extract_tuples_fp32(A) + >>> len(vals) == 1 + True + >>> float(vals[0]) == 1.5 + True + + """ + n = matrix_nvals(A) + rows = np.empty(n, dtype=np.uint64) + cols = np.empty(n, dtype=np.uint64) + vals = np.empty(n, dtype=np.float32) + nvals_p = ffi.new("GrB_Index*", n) + if n > 0: + check_status(A, lib.GrB_Matrix_extractTuples_FP32( + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("float*", ffi.from_buffer(vals)), + nvals_p, A[0], + )) + return rows, cols, vals + + def set_bool(A, value, i, j): """Set a boolean value to the matrix at row `i` column `j`. @@ -511,3 +1706,99 @@ def get_fc64(A, i, j): value = ffi.new("GxB_FC64_t*") check_status(A, lib.GxB_Matrix_extractElement_FC64(value, A[0], i, j)) return value[0] + + def matrix_build_fc32(C, rows, cols, vals, nvals, dup): + """Build a matrix from COO arrays of fc32 values. + + >>> C = matrix_new(lib.GxB_FC32, 2, 2) + >>> rows = np.array([0], dtype=np.uint64) + >>> cols = np.array([0], dtype=np.uint64) + >>> vals = np.array([2+3j], dtype=np.complex64) + >>> matrix_build_fc32(C, rows, cols, vals, 1, lib.GxB_PLUS_FC32) + >>> get_fc32(C, 0, 0) == 2+3j + True + + """ + check_status(C, lib.GxB_Matrix_build_FC32( + C[0], + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("GxB_FC32_t*", ffi.from_buffer(vals)), + nvals, dup, + )) + + def matrix_extract_tuples_fc32(A): + """Extract all tuples from a matrix as numpy arrays. + + Returns (rows, cols, vals) as numpy arrays. + + >>> A = matrix_new(lib.GxB_FC32, 2, 2) + >>> set_fc32(A, 2+3j, 0, 0) + >>> rows, cols, vals = matrix_extract_tuples_fc32(A) + >>> len(vals) == 1 + True + >>> complex(vals[0]) == 2+3j + True + + """ + n = matrix_nvals(A) + rows = np.empty(n, dtype=np.uint64) + cols = np.empty(n, dtype=np.uint64) + vals = np.empty(n, dtype=np.complex64) + nvals_p = ffi.new("GrB_Index*", n) + if n > 0: + check_status(A, lib.GxB_Matrix_extractTuples_FC32( + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("GxB_FC32_t*", ffi.from_buffer(vals)), + nvals_p, A[0], + )) + return rows, cols, vals + + def matrix_build_fc64(C, rows, cols, vals, nvals, dup): + """Build a matrix from COO arrays of fc64 values. + + >>> C = matrix_new(lib.GxB_FC64, 2, 2) + >>> rows = np.array([0], dtype=np.uint64) + >>> cols = np.array([0], dtype=np.uint64) + >>> vals = np.array([2+3j], dtype=np.complex128) + >>> matrix_build_fc64(C, rows, cols, vals, 1, lib.GxB_PLUS_FC64) + >>> get_fc64(C, 0, 0) == 2+3j + True + + """ + check_status(C, lib.GxB_Matrix_build_FC64( + C[0], + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("GxB_FC64_t*", ffi.from_buffer(vals)), + nvals, dup, + )) + + def matrix_extract_tuples_fc64(A): + """Extract all tuples from a matrix as numpy arrays. + + Returns (rows, cols, vals) as numpy arrays. + + >>> A = matrix_new(lib.GxB_FC64, 2, 2) + >>> set_fc64(A, 2+3j, 0, 0) + >>> rows, cols, vals = matrix_extract_tuples_fc64(A) + >>> len(vals) == 1 + True + >>> complex(vals[0]) == 2+3j + True + + """ + n = matrix_nvals(A) + rows = np.empty(n, dtype=np.uint64) + cols = np.empty(n, dtype=np.uint64) + vals = np.empty(n, dtype=np.complex128) + nvals_p = ffi.new("GrB_Index*", n) + if n > 0: + check_status(A, lib.GxB_Matrix_extractTuples_FC64( + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("GxB_FC64_t*", ffi.from_buffer(vals)), + nvals_p, A[0], + )) + return rows, cols, vals diff --git a/suitesparse_graphblas/scalar.py b/suitesparse_graphblas/scalar.py index 289ca51..ef421d6 100644 --- a/suitesparse_graphblas/scalar.py +++ b/suitesparse_graphblas/scalar.py @@ -1,6 +1,23 @@ +import os +import sys + from suitesparse_graphblas import check_status, exceptions, ffi, lib, supports_complex +def _capture_c_output(fn, *args): + """Capture C-level stdout output from a function call.""" + sys.stdout.flush() + r, w = os.pipe() + old = os.dup(1) + os.dup2(w, 1) + fn(*args) + os.dup2(old, 1) + os.close(w) + out = os.read(r, 100000).decode() + os.close(r) + return out + + def scalar_free(v): """Free a scalar.""" check_status(v, lib.GxB_Scalar_free(v)) @@ -37,6 +54,96 @@ def scalar_type(s): return T[0] +# --------------------------------------------------------------------------- +# GraphBLAS operations +# --------------------------------------------------------------------------- + + +def scalar_dup(s, *, free=scalar_free): + """Duplicate a scalar. + + >>> s = scalar_new(lib.GrB_INT64) + >>> set_int64(s, 42) + >>> t = scalar_dup(s) + >>> get_int64(t) == 42 + True + + """ + t = ffi.new("GxB_Scalar*") + check_status(t, lib.GrB_Scalar_dup(t, s[0])) + if free: + return ffi.gc(t, free) + return t + + +def scalar_clear(s): + """Remove the entry from a scalar. + + >>> s = scalar_new(lib.GrB_INT64) + >>> set_int64(s, 42) + >>> get_int64(s) == 42 + True + >>> scalar_clear(s) + >>> get_int64(s) is None + True + + """ + check_status(s, lib.GrB_Scalar_clear(s[0])) + + +def scalar_wait(s, waitmode=lib.GrB_COMPLETE): + """Wait for a scalar to complete pending operations. + + >>> s = scalar_new(lib.GrB_INT64) + >>> scalar_wait(s) + + """ + check_status(s, lib.GrB_Scalar_wait(s[0], waitmode)) + + +def scalar_print(s, name="", level=lib.GxB_COMPLETE): + """Print a scalar to stdout. + + ``level`` controls verbosity: ``lib.GxB_SILENT``, ``lib.GxB_SUMMARY``, + ``lib.GxB_SHORT``, ``lib.GxB_COMPLETE``, ``lib.GxB_SHORT_VERBOSE``, + or ``lib.GxB_COMPLETE_VERBOSE``. + + >>> s = scalar_new(lib.GrB_INT64) + >>> set_int64(s, 42) + >>> out = _capture_c_output(scalar_print, s, 's', lib.GxB_SHORT) + >>> 'int64_t scalar' in out + True + >>> '(0,0) 42' in out + True + + """ + check_status(s, lib.GxB_Scalar_fprint( + s[0], name.encode() if isinstance(name, str) else name, + level, ffi.NULL, + )) + + +def scalar_fprint(s, f, name="", level=lib.GxB_COMPLETE): + """Print a scalar to a C FILE* stream. + + Pass ``ffi.NULL`` for ``f`` to print to stdout. + ``level`` controls verbosity (see :func:`scalar_print`). + + >>> s = scalar_new(lib.GrB_INT64) + >>> set_int64(s, 7) + >>> out = _capture_c_output(scalar_fprint, s, ffi.NULL, 's', lib.GxB_SHORT) + >>> 'int64_t scalar' in out + True + >>> '(0,0) 7' in out + True + + """ + check_status(s, lib.GxB_Scalar_fprint( + s[0], name.encode() if isinstance(name, str) else name, + level, f, + )) + + def set_bool(s, value): """Set a boolean value to the scalar. diff --git a/suitesparse_graphblas/tests/test_doctest.py b/suitesparse_graphblas/tests/test_doctest.py index 68b9444..9253f12 100644 --- a/suitesparse_graphblas/tests/test_doctest.py +++ b/suitesparse_graphblas/tests/test_doctest.py @@ -1,11 +1,12 @@ def test_run_doctests(): import doctest - from suitesparse_graphblas import matrix, scalar, vector + from suitesparse_graphblas import iterator, matrix, scalar, vector for mod in ( matrix, vector, scalar, + iterator, ): doctest.testmod(mod, optionflags=doctest.ELLIPSIS, raise_on_error=True) diff --git a/suitesparse_graphblas/vector.py b/suitesparse_graphblas/vector.py index 66f9a5e..d8cb695 100644 --- a/suitesparse_graphblas/vector.py +++ b/suitesparse_graphblas/vector.py @@ -1,5 +1,24 @@ +import os +import sys + +import numpy as np + from suitesparse_graphblas import check_status, ffi, lib, supports_complex + +def _capture_c_output(fn, *args): + """Capture C-level stdout output from a function call.""" + sys.stdout.flush() + r, w = os.pipe() + old = os.dup(1) + os.dup2(w, 1) + fn(*args) + os.dup2(old, 1) + os.close(w) + out = os.read(r, 100000).decode() + os.close(r) + return out + from .io.serialize import deserialize_vector as deserialize # noqa: F401 from .io.serialize import serialize_vector as serialize # noqa: F401 @@ -77,6 +96,992 @@ def vector_nvals(v): return n[0] +def vector_option_get_int32(v, field): + """Get a vector option as an int32. + + >>> v = vector_new(lib.GrB_INT64, 3) + >>> vector_option_get_int32(v, lib.GxB_SPARSITY_STATUS) in (1, 2, 4, 8) + True + + """ + val = ffi.new("int32_t*") + check_status(v, lib.GxB_Vector_Option_get_INT32(v[0], field, val)) + return val[0] + + +def vector_option_set_int32(v, field, value): + """Set a vector option from an int32. + + >>> v = vector_new(lib.GrB_INT64, 3) + >>> vector_option_set_int32(v, lib.GxB_SPARSITY_CONTROL, lib.GxB_SPARSE) + >>> vector_option_get_int32(v, lib.GxB_SPARSITY_CONTROL) == lib.GxB_SPARSE + True + + """ + check_status(v, lib.GxB_Vector_Option_set_INT32( + v[0], field, ffi.cast("int32_t", value), + )) + + +def vector_option_get_fp64(v, field): + """Get a vector option as a float64. + + >>> v = vector_new(lib.GrB_INT64, 3) + >>> isinstance(vector_option_get_fp64(v, lib.GxB_BITMAP_SWITCH), float) + True + + """ + val = ffi.new("double*") + check_status(v, lib.GxB_Vector_Option_get_FP64(v[0], field, val)) + return val[0] + + +def vector_option_set_fp64(v, field, value): + """Set a vector option from a float64. + + >>> v = vector_new(lib.GrB_INT64, 3) + >>> vector_option_set_fp64(v, lib.GxB_BITMAP_SWITCH, 0.25) + >>> vector_option_get_fp64(v, lib.GxB_BITMAP_SWITCH) == 0.25 + True + + """ + check_status(v, lib.GxB_Vector_Option_set_FP64( + v[0], field, ffi.cast("double", value), + )) + + +# --------------------------------------------------------------------------- +# GraphBLAS operations +# --------------------------------------------------------------------------- + + +def vector_dup(v, *, free=vector_free): + """Duplicate a vector. + + >>> v = vector_new(lib.GrB_INT64, 3) + >>> set_int64(v, 42, 0) + >>> w = vector_dup(v) + >>> get_int64(w, 0) == 42 + True + + """ + w = ffi.new("GrB_Vector*") + check_status(w, lib.GrB_Vector_dup(w, v[0])) + if free: + return ffi.gc(w, free) + return w + + +def vector_clear(v): + """Remove all entries from a vector. + + >>> v = vector_new(lib.GrB_INT64, 3) + >>> set_int64(v, 42, 0) + >>> vector_nvals(v) == 1 + True + >>> vector_clear(v) + >>> vector_nvals(v) == 0 + True + + """ + check_status(v, lib.GrB_Vector_clear(v[0])) + + +def vector_wait(v, waitmode=lib.GrB_COMPLETE): + """Wait for a vector to complete pending operations. + + >>> v = vector_new(lib.GrB_INT64, 3) + >>> vector_wait(v) + + """ + check_status(v, lib.GrB_Vector_wait(v[0], waitmode)) + + +def vector_print(v, name="", level=lib.GxB_COMPLETE): + """Print a vector to stdout. + + ``level`` controls verbosity: ``lib.GxB_SILENT``, ``lib.GxB_SUMMARY``, + ``lib.GxB_SHORT``, ``lib.GxB_COMPLETE``, ``lib.GxB_SHORT_VERBOSE``, + or ``lib.GxB_COMPLETE_VERBOSE``. + + >>> v = vector_new(lib.GrB_INT64, 3) + >>> set_int64(v, 42, 0) + >>> vector_wait(v, lib.GrB_MATERIALIZE) + >>> out = _capture_c_output(vector_print, v, 'v', lib.GxB_SHORT) + >>> 'int64_t vector' in out + True + >>> '(0,0) 42' in out + True + + """ + check_status(v, lib.GxB_Vector_fprint( + v[0], name.encode() if isinstance(name, str) else name, + level, ffi.NULL, + )) + + +def vector_fprint(v, f, name="", level=lib.GxB_COMPLETE): + """Print a vector to a C FILE* stream. + + Pass ``ffi.NULL`` for ``f`` to print to stdout. + ``level`` controls verbosity (see :func:`vector_print`). + + >>> v = vector_new(lib.GrB_INT64, 3) + >>> set_int64(v, 7, 2) + >>> vector_wait(v, lib.GrB_MATERIALIZE) + >>> out = _capture_c_output(vector_fprint, v, ffi.NULL, 'v', lib.GxB_SHORT) + >>> 'int64_t vector' in out + True + >>> '(2,0) 7' in out + True + + """ + check_status(v, lib.GxB_Vector_fprint( + v[0], name.encode() if isinstance(name, str) else name, + level, f, + )) + + +def vector_mxv(w, semiring, A, u, mask=None, accum=None, desc=None): + """Matrix-vector multiply: w = A (+.*) u. + + >>> from suitesparse_graphblas import matrix + >>> w = vector_new(lib.GrB_INT64, 2) + >>> A = matrix.matrix_new(lib.GrB_INT64, 2, 2) + >>> u = vector_new(lib.GrB_INT64, 2) + >>> matrix.set_int64(A, 3, 0, 0) + >>> set_int64(u, 2, 0) + >>> vector_mxv(w, lib.GrB_PLUS_TIMES_SEMIRING_INT64, A, u) + >>> get_int64(w, 0) == 6 + True + + """ + check_status(w, lib.GrB_mxv( + w[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + semiring, + A[0], + u[0], + ffi.NULL if desc is None else desc[0], + )) + + +def vector_vxm(w, semiring, u, A, mask=None, accum=None, desc=None): + """Vector-matrix multiply: w = u (+.*) A. + + >>> from suitesparse_graphblas import matrix + >>> w = vector_new(lib.GrB_INT64, 2) + >>> u = vector_new(lib.GrB_INT64, 2) + >>> A = matrix.matrix_new(lib.GrB_INT64, 2, 2) + >>> set_int64(u, 2, 0) + >>> matrix.set_int64(A, 3, 0, 0) + >>> vector_vxm(w, lib.GrB_PLUS_TIMES_SEMIRING_INT64, u, A) + >>> get_int64(w, 0) == 6 + True + + """ + check_status(w, lib.GrB_vxm( + w[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + semiring, + u[0], + A[0], + ffi.NULL if desc is None else desc[0], + )) + + +def vector_ewise_add(w, op, u, v, mask=None, accum=None, desc=None): + """Element-wise addition of two vectors using a binary operator. + + >>> w = vector_new(lib.GrB_INT64, 3) + >>> u = vector_new(lib.GrB_INT64, 3) + >>> v = vector_new(lib.GrB_INT64, 3) + >>> set_int64(u, 2, 0) + >>> set_int64(v, 3, 0) + >>> vector_ewise_add(w, lib.GrB_PLUS_INT64, u, v) + >>> get_int64(w, 0) == 5 + True + + """ + check_status(w, lib.GrB_Vector_eWiseAdd_BinaryOp( + w[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + op, + u[0], + v[0], + ffi.NULL if desc is None else desc[0], + )) + + +def vector_ewise_mult(w, op, u, v, mask=None, accum=None, desc=None): + """Element-wise multiplication of two vectors using a binary operator. + + >>> w = vector_new(lib.GrB_INT64, 3) + >>> u = vector_new(lib.GrB_INT64, 3) + >>> v = vector_new(lib.GrB_INT64, 3) + >>> set_int64(u, 2, 0) + >>> set_int64(v, 3, 0) + >>> vector_ewise_mult(w, lib.GrB_TIMES_INT64, u, v) + >>> get_int64(w, 0) == 6 + True + + """ + check_status(w, lib.GrB_Vector_eWiseMult_BinaryOp( + w[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + op, + u[0], + v[0], + ffi.NULL if desc is None else desc[0], + )) + + +def vector_ewise_union(w, op, u, alpha, v, beta, mask=None, accum=None, desc=None): + """Element-wise union of two vectors using a binary operator. + + Unlike eWiseAdd, entries present in only one operand use the + corresponding default scalar (``alpha`` for u, ``beta`` for v). + + >>> from suitesparse_graphblas import scalar + >>> w = vector_new(lib.GrB_INT64, 3) + >>> u = vector_new(lib.GrB_INT64, 3) + >>> v = vector_new(lib.GrB_INT64, 3) + >>> set_int64(u, 2, 0) + >>> set_int64(v, 3, 2) + >>> a = scalar.scalar_new(lib.GrB_INT64) + >>> b = scalar.scalar_new(lib.GrB_INT64) + >>> scalar.set_int64(a, 0) + >>> scalar.set_int64(b, 0) + >>> vector_ewise_union(w, lib.GrB_PLUS_INT64, u, a, v, b) + >>> get_int64(w, 0) == 2 + True + >>> get_int64(w, 2) == 3 + True + + """ + check_status(w, lib.GxB_Vector_eWiseUnion( + w[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + op, + u[0], alpha[0], + v[0], beta[0], + ffi.NULL if desc is None else desc[0], + )) + + +def vector_apply(w, op, u, mask=None, accum=None, desc=None): + """Apply a unary operator to each entry of a vector. + + >>> w = vector_new(lib.GrB_INT64, 3) + >>> u = vector_new(lib.GrB_INT64, 3) + >>> set_int64(u, -5, 0) + >>> vector_apply(w, lib.GrB_ABS_INT64, u) + >>> get_int64(w, 0) == 5 + True + + """ + check_status(w, lib.GrB_Vector_apply( + w[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + op, + u[0], + ffi.NULL if desc is None else desc[0], + )) + + +def vector_apply_first(w, op, x, u, mask=None, accum=None, desc=None): + """Apply a binary operator with a scalar bound to the first argument: w = op(x, u). + + >>> from suitesparse_graphblas import scalar + >>> w = vector_new(lib.GrB_INT64, 3) + >>> u = vector_new(lib.GrB_INT64, 3) + >>> set_int64(u, 3, 0) + >>> s = scalar.scalar_new(lib.GrB_INT64) + >>> scalar.set_int64(s, 10) + >>> vector_apply_first(w, lib.GrB_TIMES_INT64, s, u) + >>> get_int64(w, 0) == 30 + True + + """ + check_status(w, lib.GrB_Vector_apply_BinaryOp1st_Scalar( + w[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + op, + x[0], + u[0], + ffi.NULL if desc is None else desc[0], + )) + + +def vector_apply_second(w, op, u, y, mask=None, accum=None, desc=None): + """Apply a binary operator with a scalar bound to the second argument: w = op(u, y). + + >>> from suitesparse_graphblas import scalar + >>> w = vector_new(lib.GrB_INT64, 3) + >>> u = vector_new(lib.GrB_INT64, 3) + >>> set_int64(u, 10, 0) + >>> s = scalar.scalar_new(lib.GrB_INT64) + >>> scalar.set_int64(s, 3) + >>> vector_apply_second(w, lib.GrB_TIMES_INT64, u, s) + >>> get_int64(w, 0) == 30 + True + + """ + check_status(w, lib.GrB_Vector_apply_BinaryOp2nd_Scalar( + w[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + op, + u[0], + y[0], + ffi.NULL if desc is None else desc[0], + )) + + +def vector_select(w, op, u, thunk, mask=None, accum=None, desc=None): + """Select entries from a vector using an index unary operator and scalar thunk. + + >>> from suitesparse_graphblas import scalar + >>> w = vector_new(lib.GrB_INT64, 3) + >>> u = vector_new(lib.GrB_INT64, 3) + >>> set_int64(u, 5, 0) + >>> set_int64(u, 1, 1) + >>> s = scalar.scalar_new(lib.GrB_INT64) + >>> scalar.set_int64(s, 3) + >>> vector_select(w, lib.GrB_VALUEGT_INT64, u, s) + >>> vector_nvals(w) == 1 + True + >>> get_int64(w, 0) == 5 + True + + """ + check_status(w, lib.GrB_Vector_select_Scalar( + w[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + op, + u[0], + thunk[0], + ffi.NULL if desc is None else desc[0], + )) + + +def vector_reduce(s, monoid, u, accum=None, desc=None): + """Reduce a vector to a scalar using a monoid. + + >>> from suitesparse_graphblas import scalar + >>> u = vector_new(lib.GrB_INT64, 3) + >>> set_int64(u, 2, 0) + >>> set_int64(u, 3, 1) + >>> s = scalar.scalar_new(lib.GrB_INT64) + >>> vector_reduce(s, lib.GrB_PLUS_MONOID_INT64, u) + >>> scalar.get_int64(s) == 5 + True + + """ + check_status(s, lib.GrB_Vector_reduce_Monoid_Scalar( + s[0], + ffi.NULL if accum is None else accum, + monoid, + u[0], + ffi.NULL if desc is None else desc[0], + )) + + +def vector_diag(v, A, k=0, desc=None): + """Extract the k-th diagonal of a matrix into a vector. + + ``k=0`` is the main diagonal, positive is above, negative below. + + >>> from suitesparse_graphblas import matrix + >>> A = matrix.matrix_new(lib.GrB_INT64, 3, 3) + >>> matrix.set_int64(A, 10, 0, 0) + >>> matrix.set_int64(A, 20, 1, 1) + >>> matrix.set_int64(A, 30, 2, 2) + >>> v = vector_new(lib.GrB_INT64, 3) + >>> vector_diag(v, A, 0) + >>> get_int64(v, 0) == 10 + True + >>> get_int64(v, 1) == 20 + True + >>> get_int64(v, 2) == 30 + True + + """ + check_status(v, lib.GxB_Vector_diag( + v[0], A[0], k, + ffi.NULL if desc is None else desc[0], + )) + + +def vector_assign(w, u, indices, ni, mask=None, accum=None, desc=None): + """Assign a subvector: w[indices] = u. + + >>> w = vector_new(lib.GrB_INT64, 3) + >>> u = vector_new(lib.GrB_INT64, 1) + >>> set_int64(u, 42, 0) + >>> idx = ffi.new("GrB_Index[1]", [1]) + >>> vector_assign(w, u, idx, 1) + >>> get_int64(w, 1) == 42 + True + + """ + check_status(w, lib.GrB_Vector_assign( + w[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + u[0], + indices, ni, + ffi.NULL if desc is None else desc[0], + )) + + +def vector_assign_scalar(w, x, indices, ni, mask=None, accum=None, desc=None): + """Assign a scalar to subvector positions: w[indices] = x. + + >>> from suitesparse_graphblas import scalar + >>> w = vector_new(lib.GrB_INT64, 3) + >>> s = scalar.scalar_new(lib.GrB_INT64) + >>> scalar.set_int64(s, 99) + >>> idx = ffi.new("GrB_Index[2]", [0, 2]) + >>> vector_assign_scalar(w, s, idx, 2) + >>> get_int64(w, 0) == 99 + True + >>> get_int64(w, 2) == 99 + True + + """ + check_status(w, lib.GrB_Vector_assign_Scalar( + w[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + x[0], + indices, ni, + ffi.NULL if desc is None else desc[0], + )) + + +def vector_extract(w, u, indices, ni, mask=None, accum=None, desc=None): + """Extract a subvector: w = u[indices]. + + >>> u = vector_new(lib.GrB_INT64, 3) + >>> set_int64(u, 42, 2) + >>> w = vector_new(lib.GrB_INT64, 1) + >>> idx = ffi.new("GrB_Index[1]", [2]) + >>> vector_extract(w, u, idx, 1) + >>> get_int64(w, 0) == 42 + True + + """ + check_status(w, lib.GrB_Vector_extract( + w[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + u[0], + indices, ni, + ffi.NULL if desc is None else desc[0], + )) + + +def vector_build_int64(w, indices, vals, nvals, dup): + """Build a vector from index and int64 value arrays. + + >>> w = vector_new(lib.GrB_INT64, 3) + >>> idx = np.array([0, 2], dtype=np.uint64) + >>> vals = np.array([10, 20], dtype=np.int64) + >>> vector_build_int64(w, idx, vals, 2, lib.GrB_PLUS_INT64) + >>> get_int64(w, 0) == 10 + True + >>> get_int64(w, 2) == 20 + True + + """ + check_status(w, lib.GrB_Vector_build_INT64( + w[0], + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("int64_t*", ffi.from_buffer(vals)), + nvals, dup, + )) + + +def vector_build_fp64(w, indices, vals, nvals, dup): + """Build a vector from index and fp64 value arrays. + + >>> w = vector_new(lib.GrB_FP64, 3) + >>> idx = np.array([0], dtype=np.uint64) + >>> vals = np.array([1.5], dtype=np.float64) + >>> vector_build_fp64(w, idx, vals, 1, lib.GrB_PLUS_FP64) + >>> get_fp64(w, 0) == 1.5 + True + + """ + check_status(w, lib.GrB_Vector_build_FP64( + w[0], + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("double*", ffi.from_buffer(vals)), + nvals, dup, + )) + + +def vector_extract_tuples_int64(v): + """Extract all tuples from a vector as numpy arrays. + + Returns (indices, vals) as numpy arrays. + + >>> v = vector_new(lib.GrB_INT64, 3) + >>> set_int64(v, 42, 1) + >>> idx, vals = vector_extract_tuples_int64(v) + >>> len(vals) == 1 + True + >>> int(idx[0]) == 1 + True + >>> int(vals[0]) == 42 + True + + """ + n = vector_nvals(v) + indices = np.empty(n, dtype=np.uint64) + vals = np.empty(n, dtype=np.int64) + nvals_p = ffi.new("GrB_Index*", n) + if n > 0: + check_status(v, lib.GrB_Vector_extractTuples_INT64( + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("int64_t*", ffi.from_buffer(vals)), + nvals_p, v[0], + )) + return indices, vals + + +def vector_extract_tuples_fp64(v): + """Extract all tuples from a vector as numpy arrays. + + Returns (indices, vals) as numpy arrays. + + >>> v = vector_new(lib.GrB_FP64, 3) + >>> set_fp64(v, 1.5, 0) + >>> idx, vals = vector_extract_tuples_fp64(v) + >>> len(vals) == 1 + True + >>> float(vals[0]) == 1.5 + True + + """ + n = vector_nvals(v) + indices = np.empty(n, dtype=np.uint64) + vals = np.empty(n, dtype=np.float64) + nvals_p = ffi.new("GrB_Index*", n) + if n > 0: + check_status(v, lib.GrB_Vector_extractTuples_FP64( + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("double*", ffi.from_buffer(vals)), + nvals_p, v[0], + )) + return indices, vals + +def vector_build_bool(w, indices, vals, nvals, dup): + """Build a vector from index and bool value arrays. + + >>> w = vector_new(lib.GrB_BOOL, 3) + >>> idx = np.array([0], dtype=np.uint64) + >>> vals = np.array([True], dtype=np.bool_) + >>> vector_build_bool(w, idx, vals, 1, lib.GrB_FIRST_BOOL) + >>> get_bool(w, 0) == True + True + + """ + check_status(w, lib.GrB_Vector_build_BOOL( + w[0], + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("bool*", ffi.from_buffer(vals)), + nvals, dup, + )) + +def vector_build_int8(w, indices, vals, nvals, dup): + """Build a vector from index and int8 value arrays. + + >>> w = vector_new(lib.GrB_INT8, 3) + >>> idx = np.array([0], dtype=np.uint64) + >>> vals = np.array([7], dtype=np.int8) + >>> vector_build_int8(w, idx, vals, 1, lib.GrB_PLUS_INT8) + >>> get_int8(w, 0) == 7 + True + + """ + check_status(w, lib.GrB_Vector_build_INT8( + w[0], + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("int8_t*", ffi.from_buffer(vals)), + nvals, dup, + )) + +def vector_build_int16(w, indices, vals, nvals, dup): + """Build a vector from index and int16 value arrays. + + >>> w = vector_new(lib.GrB_INT16, 3) + >>> idx = np.array([0], dtype=np.uint64) + >>> vals = np.array([7], dtype=np.int16) + >>> vector_build_int16(w, idx, vals, 1, lib.GrB_PLUS_INT16) + >>> get_int16(w, 0) == 7 + True + + """ + check_status(w, lib.GrB_Vector_build_INT16( + w[0], + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("int16_t*", ffi.from_buffer(vals)), + nvals, dup, + )) + +def vector_build_int32(w, indices, vals, nvals, dup): + """Build a vector from index and int32 value arrays. + + >>> w = vector_new(lib.GrB_INT32, 3) + >>> idx = np.array([0], dtype=np.uint64) + >>> vals = np.array([7], dtype=np.int32) + >>> vector_build_int32(w, idx, vals, 1, lib.GrB_PLUS_INT32) + >>> get_int32(w, 0) == 7 + True + + """ + check_status(w, lib.GrB_Vector_build_INT32( + w[0], + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("int32_t*", ffi.from_buffer(vals)), + nvals, dup, + )) + +def vector_build_uint8(w, indices, vals, nvals, dup): + """Build a vector from index and uint8 value arrays. + + >>> w = vector_new(lib.GrB_UINT8, 3) + >>> idx = np.array([0], dtype=np.uint64) + >>> vals = np.array([7], dtype=np.uint8) + >>> vector_build_uint8(w, idx, vals, 1, lib.GrB_PLUS_UINT8) + >>> get_uint8(w, 0) == 7 + True + + """ + check_status(w, lib.GrB_Vector_build_UINT8( + w[0], + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("uint8_t*", ffi.from_buffer(vals)), + nvals, dup, + )) + +def vector_build_uint16(w, indices, vals, nvals, dup): + """Build a vector from index and uint16 value arrays. + + >>> w = vector_new(lib.GrB_UINT16, 3) + >>> idx = np.array([0], dtype=np.uint64) + >>> vals = np.array([7], dtype=np.uint16) + >>> vector_build_uint16(w, idx, vals, 1, lib.GrB_PLUS_UINT16) + >>> get_uint16(w, 0) == 7 + True + + """ + check_status(w, lib.GrB_Vector_build_UINT16( + w[0], + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("uint16_t*", ffi.from_buffer(vals)), + nvals, dup, + )) + +def vector_build_uint32(w, indices, vals, nvals, dup): + """Build a vector from index and uint32 value arrays. + + >>> w = vector_new(lib.GrB_UINT32, 3) + >>> idx = np.array([0], dtype=np.uint64) + >>> vals = np.array([7], dtype=np.uint32) + >>> vector_build_uint32(w, idx, vals, 1, lib.GrB_PLUS_UINT32) + >>> get_uint32(w, 0) == 7 + True + + """ + check_status(w, lib.GrB_Vector_build_UINT32( + w[0], + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("uint32_t*", ffi.from_buffer(vals)), + nvals, dup, + )) + +def vector_build_uint64(w, indices, vals, nvals, dup): + """Build a vector from index and uint64 value arrays. + + >>> w = vector_new(lib.GrB_UINT64, 3) + >>> idx = np.array([0], dtype=np.uint64) + >>> vals = np.array([7], dtype=np.uint64) + >>> vector_build_uint64(w, idx, vals, 1, lib.GrB_PLUS_UINT64) + >>> get_uint64(w, 0) == 7 + True + + """ + check_status(w, lib.GrB_Vector_build_UINT64( + w[0], + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("uint64_t*", ffi.from_buffer(vals)), + nvals, dup, + )) + +def vector_build_fp32(w, indices, vals, nvals, dup): + """Build a vector from index and fp32 value arrays. + + >>> w = vector_new(lib.GrB_FP32, 3) + >>> idx = np.array([0], dtype=np.uint64) + >>> vals = np.array([1.5], dtype=np.float32) + >>> vector_build_fp32(w, idx, vals, 1, lib.GrB_PLUS_FP32) + >>> get_fp32(w, 0) == 1.5 + True + + """ + check_status(w, lib.GrB_Vector_build_FP32( + w[0], + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("float*", ffi.from_buffer(vals)), + nvals, dup, + )) + +def vector_extract_tuples_bool(v): + """Extract all tuples from a vector as numpy arrays. + + Returns (indices, vals) as numpy arrays. + + >>> v = vector_new(lib.GrB_BOOL, 3) + >>> set_bool(v, True, 0) + >>> idx, vals = vector_extract_tuples_bool(v) + >>> len(vals) == 1 + True + >>> bool(vals[0]) == True + True + + """ + n = vector_nvals(v) + indices = np.empty(n, dtype=np.uint64) + vals = np.empty(n, dtype=np.bool_) + nvals_p = ffi.new("GrB_Index*", n) + if n > 0: + check_status(v, lib.GrB_Vector_extractTuples_BOOL( + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("bool*", ffi.from_buffer(vals)), + nvals_p, v[0], + )) + return indices, vals + +def vector_extract_tuples_int8(v): + """Extract all tuples from a vector as numpy arrays. + + Returns (indices, vals) as numpy arrays. + + >>> v = vector_new(lib.GrB_INT8, 3) + >>> set_int8(v, 7, 0) + >>> idx, vals = vector_extract_tuples_int8(v) + >>> len(vals) == 1 + True + >>> int(vals[0]) == 7 + True + + """ + n = vector_nvals(v) + indices = np.empty(n, dtype=np.uint64) + vals = np.empty(n, dtype=np.int8) + nvals_p = ffi.new("GrB_Index*", n) + if n > 0: + check_status(v, lib.GrB_Vector_extractTuples_INT8( + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("int8_t*", ffi.from_buffer(vals)), + nvals_p, v[0], + )) + return indices, vals + +def vector_extract_tuples_int16(v): + """Extract all tuples from a vector as numpy arrays. + + Returns (indices, vals) as numpy arrays. + + >>> v = vector_new(lib.GrB_INT16, 3) + >>> set_int16(v, 7, 0) + >>> idx, vals = vector_extract_tuples_int16(v) + >>> len(vals) == 1 + True + >>> int(vals[0]) == 7 + True + + """ + n = vector_nvals(v) + indices = np.empty(n, dtype=np.uint64) + vals = np.empty(n, dtype=np.int16) + nvals_p = ffi.new("GrB_Index*", n) + if n > 0: + check_status(v, lib.GrB_Vector_extractTuples_INT16( + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("int16_t*", ffi.from_buffer(vals)), + nvals_p, v[0], + )) + return indices, vals + +def vector_extract_tuples_int32(v): + """Extract all tuples from a vector as numpy arrays. + + Returns (indices, vals) as numpy arrays. + + >>> v = vector_new(lib.GrB_INT32, 3) + >>> set_int32(v, 7, 0) + >>> idx, vals = vector_extract_tuples_int32(v) + >>> len(vals) == 1 + True + >>> int(vals[0]) == 7 + True + + """ + n = vector_nvals(v) + indices = np.empty(n, dtype=np.uint64) + vals = np.empty(n, dtype=np.int32) + nvals_p = ffi.new("GrB_Index*", n) + if n > 0: + check_status(v, lib.GrB_Vector_extractTuples_INT32( + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("int32_t*", ffi.from_buffer(vals)), + nvals_p, v[0], + )) + return indices, vals + +def vector_extract_tuples_uint8(v): + """Extract all tuples from a vector as numpy arrays. + + Returns (indices, vals) as numpy arrays. + + >>> v = vector_new(lib.GrB_UINT8, 3) + >>> set_uint8(v, 7, 0) + >>> idx, vals = vector_extract_tuples_uint8(v) + >>> len(vals) == 1 + True + >>> int(vals[0]) == 7 + True + + """ + n = vector_nvals(v) + indices = np.empty(n, dtype=np.uint64) + vals = np.empty(n, dtype=np.uint8) + nvals_p = ffi.new("GrB_Index*", n) + if n > 0: + check_status(v, lib.GrB_Vector_extractTuples_UINT8( + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("uint8_t*", ffi.from_buffer(vals)), + nvals_p, v[0], + )) + return indices, vals + +def vector_extract_tuples_uint16(v): + """Extract all tuples from a vector as numpy arrays. + + Returns (indices, vals) as numpy arrays. + + >>> v = vector_new(lib.GrB_UINT16, 3) + >>> set_uint16(v, 7, 0) + >>> idx, vals = vector_extract_tuples_uint16(v) + >>> len(vals) == 1 + True + >>> int(vals[0]) == 7 + True + + """ + n = vector_nvals(v) + indices = np.empty(n, dtype=np.uint64) + vals = np.empty(n, dtype=np.uint16) + nvals_p = ffi.new("GrB_Index*", n) + if n > 0: + check_status(v, lib.GrB_Vector_extractTuples_UINT16( + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("uint16_t*", ffi.from_buffer(vals)), + nvals_p, v[0], + )) + return indices, vals + +def vector_extract_tuples_uint32(v): + """Extract all tuples from a vector as numpy arrays. + + Returns (indices, vals) as numpy arrays. + + >>> v = vector_new(lib.GrB_UINT32, 3) + >>> set_uint32(v, 7, 0) + >>> idx, vals = vector_extract_tuples_uint32(v) + >>> len(vals) == 1 + True + >>> int(vals[0]) == 7 + True + + """ + n = vector_nvals(v) + indices = np.empty(n, dtype=np.uint64) + vals = np.empty(n, dtype=np.uint32) + nvals_p = ffi.new("GrB_Index*", n) + if n > 0: + check_status(v, lib.GrB_Vector_extractTuples_UINT32( + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("uint32_t*", ffi.from_buffer(vals)), + nvals_p, v[0], + )) + return indices, vals + +def vector_extract_tuples_uint64(v): + """Extract all tuples from a vector as numpy arrays. + + Returns (indices, vals) as numpy arrays. + + >>> v = vector_new(lib.GrB_UINT64, 3) + >>> set_uint64(v, 7, 0) + >>> idx, vals = vector_extract_tuples_uint64(v) + >>> len(vals) == 1 + True + >>> int(vals[0]) == 7 + True + + """ + n = vector_nvals(v) + indices = np.empty(n, dtype=np.uint64) + vals = np.empty(n, dtype=np.uint64) + nvals_p = ffi.new("GrB_Index*", n) + if n > 0: + check_status(v, lib.GrB_Vector_extractTuples_UINT64( + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("uint64_t*", ffi.from_buffer(vals)), + nvals_p, v[0], + )) + return indices, vals + +def vector_extract_tuples_fp32(v): + """Extract all tuples from a vector as numpy arrays. + + Returns (indices, vals) as numpy arrays. + + >>> v = vector_new(lib.GrB_FP32, 3) + >>> set_fp32(v, 1.5, 0) + >>> idx, vals = vector_extract_tuples_fp32(v) + >>> len(vals) == 1 + True + >>> float(vals[0]) == 1.5 + True + + """ + n = vector_nvals(v) + indices = np.empty(n, dtype=np.uint64) + vals = np.empty(n, dtype=np.float32) + nvals_p = ffi.new("GrB_Index*", n) + if n > 0: + check_status(v, lib.GrB_Vector_extractTuples_FP32( + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("float*", ffi.from_buffer(vals)), + nvals_p, v[0], + )) + return indices, vals + + def set_bool(v, value, i): """Set a boolean value to the vector at position `i`. @@ -412,3 +1417,91 @@ def get_fc64(v, i): value = ffi.new("GxB_FC64_t*") check_status(v, lib.GxB_Vector_extractElement_FC64(value, v[0], i)) return value[0] + + def vector_build_fc32(w, indices, vals, nvals, dup): + """Build a vector from index and fc32 value arrays. + + >>> w = vector_new(lib.GxB_FC32, 3) + >>> idx = np.array([0], dtype=np.uint64) + >>> vals = np.array([2+3j], dtype=np.complex64) + >>> vector_build_fc32(w, idx, vals, 1, lib.GxB_PLUS_FC32) + >>> get_fc32(w, 0) == 2+3j + True + + """ + check_status(w, lib.GxB_Vector_build_FC32( + w[0], + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("GxB_FC32_t*", ffi.from_buffer(vals)), + nvals, dup, + )) + + def vector_extract_tuples_fc32(v): + """Extract all tuples from a vector as numpy arrays. + + Returns (indices, vals) as numpy arrays. + + >>> v = vector_new(lib.GxB_FC32, 3) + >>> set_fc32(v, 2+3j, 0) + >>> idx, vals = vector_extract_tuples_fc32(v) + >>> len(vals) == 1 + True + >>> complex(vals[0]) == 2+3j + True + + """ + n = vector_nvals(v) + indices = np.empty(n, dtype=np.uint64) + vals = np.empty(n, dtype=np.complex64) + nvals_p = ffi.new("GrB_Index*", n) + if n > 0: + check_status(v, lib.GxB_Vector_extractTuples_FC32( + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("GxB_FC32_t*", ffi.from_buffer(vals)), + nvals_p, v[0], + )) + return indices, vals + + def vector_build_fc64(w, indices, vals, nvals, dup): + """Build a vector from index and fc64 value arrays. + + >>> w = vector_new(lib.GxB_FC64, 3) + >>> idx = np.array([0], dtype=np.uint64) + >>> vals = np.array([2+3j], dtype=np.complex128) + >>> vector_build_fc64(w, idx, vals, 1, lib.GxB_PLUS_FC64) + >>> get_fc64(w, 0) == 2+3j + True + + """ + check_status(w, lib.GxB_Vector_build_FC64( + w[0], + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("GxB_FC64_t*", ffi.from_buffer(vals)), + nvals, dup, + )) + + def vector_extract_tuples_fc64(v): + """Extract all tuples from a vector as numpy arrays. + + Returns (indices, vals) as numpy arrays. + + >>> v = vector_new(lib.GxB_FC64, 3) + >>> set_fc64(v, 2+3j, 0) + >>> idx, vals = vector_extract_tuples_fc64(v) + >>> len(vals) == 1 + True + >>> complex(vals[0]) == 2+3j + True + + """ + n = vector_nvals(v) + indices = np.empty(n, dtype=np.uint64) + vals = np.empty(n, dtype=np.complex128) + nvals_p = ffi.new("GrB_Index*", n) + if n > 0: + check_status(v, lib.GxB_Vector_extractTuples_FC64( + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("GxB_FC64_t*", ffi.from_buffer(vals)), + nvals_p, v[0], + )) + return indices, vals From 13e458b23e37f4d0dbe389141bf133ae760be0d4 Mon Sep 17 00:00:00 2001 From: Michel Pelletier Date: Fri, 10 Apr 2026 14:17:37 -0700 Subject: [PATCH 175/193] Move functional API to suitesparse_graphblas.api subpackage and add modules for all GraphBLAS types Reorganize the functional API (matrix, vector, scalar, iterator, io) into a dedicated api subpackage, separating it from the low-level CFFI binding layer. Users can now import via `from suitesparse_graphblas import api` with backward- compatible re-exports preserving all existing import paths. Add new API modules for all remaining GraphBLAS types: GrB_Type, UnaryOp, BinaryOp, IndexUnaryOp, IndexBinaryOp, Monoid, Semiring, Descriptor, Context, SelectOp, Container, and Global. Extract global_option functions into their own module and deduplicate _capture_c_output into api/utils.py. Update CLAUDE.md with Docker-based testing instructions and configure pytest to collect doctests via --doctest-modules for comprehensive test coverage. --- CLAUDE.md | 167 +++++ pyproject.toml | 10 +- suitesparse_graphblas/__init__.py | 93 +-- suitesparse_graphblas/api/__init__.py | 20 + suitesparse_graphblas/api/binaryop.py | 270 ++++++++ suitesparse_graphblas/api/container.py | 37 ++ suitesparse_graphblas/api/context.py | 225 +++++++ suitesparse_graphblas/api/descriptor.py | 146 +++++ suitesparse_graphblas/api/global_.py | 72 +++ suitesparse_graphblas/api/global_options.py | 76 +++ suitesparse_graphblas/api/grb_type.py | 198 ++++++ suitesparse_graphblas/api/indexbinaryop.py | 127 ++++ suitesparse_graphblas/api/indexunaryop.py | 218 +++++++ suitesparse_graphblas/api/io/__init__.py | 0 suitesparse_graphblas/{ => api}/io/binary.py | 3 +- .../{ => api}/io/serialize.py | 2 +- suitesparse_graphblas/{ => api}/iterator.py | 0 suitesparse_graphblas/{ => api}/matrix.py | 17 +- suitesparse_graphblas/api/monoid.py | 601 ++++++++++++++++++ suitesparse_graphblas/{ => api}/scalar.py | 17 +- suitesparse_graphblas/api/selectop.py | 82 +++ suitesparse_graphblas/api/semiring.py | 182 ++++++ suitesparse_graphblas/api/unaryop.py | 228 +++++++ suitesparse_graphblas/api/utils.py | 16 + suitesparse_graphblas/{ => api}/vector.py | 17 +- suitesparse_graphblas/{tests => }/conftest.py | 0 suitesparse_graphblas/io/__init__.py | 1 + suitesparse_graphblas/tests/test_doctest.py | 33 +- 28 files changed, 2725 insertions(+), 133 deletions(-) create mode 100644 CLAUDE.md create mode 100644 suitesparse_graphblas/api/__init__.py create mode 100644 suitesparse_graphblas/api/binaryop.py create mode 100644 suitesparse_graphblas/api/container.py create mode 100644 suitesparse_graphblas/api/context.py create mode 100644 suitesparse_graphblas/api/descriptor.py create mode 100644 suitesparse_graphblas/api/global_.py create mode 100644 suitesparse_graphblas/api/global_options.py create mode 100644 suitesparse_graphblas/api/grb_type.py create mode 100644 suitesparse_graphblas/api/indexbinaryop.py create mode 100644 suitesparse_graphblas/api/indexunaryop.py create mode 100644 suitesparse_graphblas/api/io/__init__.py rename suitesparse_graphblas/{ => api}/io/binary.py (99%) rename suitesparse_graphblas/{ => api}/io/serialize.py (98%) rename suitesparse_graphblas/{ => api}/iterator.py (100%) rename suitesparse_graphblas/{ => api}/matrix.py (99%) create mode 100644 suitesparse_graphblas/api/monoid.py rename suitesparse_graphblas/{ => api}/scalar.py (97%) create mode 100644 suitesparse_graphblas/api/selectop.py create mode 100644 suitesparse_graphblas/api/semiring.py create mode 100644 suitesparse_graphblas/api/unaryop.py create mode 100644 suitesparse_graphblas/api/utils.py rename suitesparse_graphblas/{ => api}/vector.py (99%) rename suitesparse_graphblas/{tests => }/conftest.py (100%) diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..ef34ae4 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,167 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## What this package is + +`suitesparse-graphblas` is a low-level Python CFFI binding around the C library +[SuiteSparse:GraphBLAS](https://github.com/DrTimothyAldenDavis/GraphBLAS). It exposes the +raw `ffi` and `lib` symbols and, on top of them, a small **functional API** in +`suitesparse_graphblas.matrix`, `suitesparse_graphblas.vector`, and +`suitesparse_graphblas.scalar`. These three modules are the **main entry point for users +of this library directly** — they are module-level functions operating on opaque CFFI +handles, e.g. `A = matrix.new(lib.GrB_BOOL, 3, 3); matrix.set_bool(A, True, 2, 2)`. Higher-level +syntax wrappers ([python-graphblas](https://github.com/python-graphblas/python-graphblas) +and [pygraphblas](https://github.com/Graphegon/pygraphblas)) build on top of this same +package for users who want a more Pythonic, OO-style interface. + +The currently targeted SuiteSparse:GraphBLAS version is pinned in `GB_VERSION.txt`. + +## Building from source + +Building requires a working SuiteSparse:GraphBLAS C library on the system. Point at it via +`GraphBLAS_ROOT` (must contain `include/GraphBLAS.h` and `lib/`): + +```bash +export GraphBLAS_ROOT="/path/to/graphblas" # or `$(brew --prefix suitesparse)` on macOS +pip install -e . --no-deps # editable dev install +``` + +If `GraphBLAS_ROOT` is unset, the build falls back to: +- `C:\GraphBLAS` on Windows +- `/usr/local` if `/usr/local/include/suitesparse` exists (the path used by `suitesparse.sh`) +- `sys.prefix` (works for conda-installed `graphblas`) + +The CI build uses conda-forge `graphblas=$(cat GB_VERSION.txt)`. To build SuiteSparse from +source instead, run `bash suitesparse.sh refs/tags/$(cat GB_VERSION.txt).0`. That script also +honors `SUITESPARSE_FAST_BUILD` / `SUITESPARSE_FASTEST_BUILD` env vars to disable many type +specializations for much faster local builds. + +## Tests, lint, and other commands + +Testing requires the compiled CFFI extension and the SuiteSparse:GraphBLAS C library, so +tests should be run inside the Docker container. Build the image once (this compiles +GraphBLAS from source and takes several minutes), then run tests against it: + +```bash +# Build the test image (uses the psg stage which includes pytest) +docker build --target psg \ + --build-arg SUITESPARSE=v$(cat GB_VERSION.txt) \ + --build-arg VERSION=99.0.0.0 \ + -t psg-test . + +# Run the full test suite (unit tests + all doctests) +docker run --rm -w /tmp psg-test pytest --pyargs suitesparse_graphblas --doctest-modules -v + +# Run only the unit tests (no doctests) +docker run --rm -w /tmp psg-test pytest --pyargs suitesparse_graphblas.tests -v + +# Run a single test file +docker run --rm -w /tmp psg-test pytest --pyargs suitesparse_graphblas.tests.test_scalar -v + +# Run by test name substring +docker run --rm -w /tmp psg-test pytest --pyargs suitesparse_graphblas --doctest-modules -k test_print_jit_config -v + +# Run linters/formatters (locally, no C library needed) +pre-commit run --all-files +``` + +Rebuild the Docker image after making changes — the `ADD . /psg` layer picks up the +current working tree. The SuiteSparse compilation layer is cached so rebuilds are fast. + +`conftest.py` calls `suitesparse_graphblas.initialize()` once per session — `GrB_init` may +only be called once per process, so `test_initialize.py` is run as a separate process in CI: + +```bash +docker run --rm -w /tmp psg-test python3 -m suitesparse_graphblas.tests.test_initialize +``` + +Coverage runs in CI use `CYTHON_COVERAGE=true` so the Cython `utils.pyx` extension is +recompiled with line tracing. + +## Architecture: how the binding is generated and assembled + +There are two layers of generated code, and understanding them is essential before touching +anything related to types, defines, or the FFI surface. + +### 1. Header generation — `suitesparse_graphblas/create_headers.py` + +This script regenerates **`suitesparse_graphblas.h`**, **`suitesparse_graphblas_no_complex.h`**, +and **`source.c`** from an upstream `GraphBLAS.h`. It: + +- Copies `GraphBLAS.h` from the install, runs the C preprocessor (using pycparser's + `fake_libc_include`), and parses the result with pycparser. +- Emits a cleaned-up header that cffi can `cdef()`, plus a complex-free variant for + platforms (notably MSVC) where `_Complex` types don't work. +- Manually tracks `DEFINES`, `CHAR_DEFINES`, `IGNORE_DEFINES`, and `DEPRECATED` sets. + **When updating to a new SuiteSparse:GraphBLAS version, these lists are the things most + likely to need editing.** New macros, new deprecations, or removed symbols all flow + through here. +- CI runs this script and `git diff --exit-code` to fail the build if the committed headers + drift from upstream. Re-running it locally and committing the result is the standard fix. + +### 2. CFFI compilation — `build_graphblas_cffi.py` + +`ffibuilder` calls `set_source()` with `source.c` and `cdef()` with `suitesparse_graphblas.h` +to produce the compiled extension `suitesparse_graphblas._graphblas` (which exposes `ffi` +and `lib`). On Windows it instead emits a `_graphblas.c` file and runs a textual patch +(`float _Complex` → `_Fcomplex`, `double _Complex` → `_Dcomplex`, `-DGxB_HAVE_COMPLEX_MSVC`) +because cffi cannot represent MSVC's complex types — see `get_extension()` for the patching +logic. `setup.py` chooses between the cffi-driven and Extension-driven paths based on +`build_graphblas_cffi.is_win`. + +`setup.py` also cythonizes any `*.pyx` under `suitesparse_graphblas/` (currently +`utils.pyx`). When Cython is unavailable, it falls back to checked-in `*.c` files; the +build will refuse to proceed if any are missing. + +### 3. Python layer (`suitesparse_graphblas/__init__.py` and friends) + +The package re-exports `ffi`/`lib` from the compiled extension and adds only thin helpers: + +- `initialize(blocking=False, memory_manager="numpy")` — must be called exactly once before + any GraphBLAS calls. The `numpy` memory manager routes allocation through + `PyDataMem_NEW`/`FREE` (defined in `utils.pyx::call_gxb_init`) so buffers can be claimed + zero-copy by NumPy and tracked by `tracemalloc`. +- `check_status(obj, info)` — central error handler. Maps `GrB_Info` codes to exception + classes in `exceptions.py` and pulls the human-readable message via the type-specific + `*_error()` function, looked up by cdata cname in `_error_func_lookup`. +- `vararg(val)` — a workaround for variadic GraphBLAS calls on `osx-arm64` and `ppc64le` + where ARM64 calling conventions force variadic args onto the stack. Prefer the + non-variadic typed variants (e.g. `GxB_Matrix_Option_get_INT32`) when they exist. +- `libget(name)` — fallback that retries a `GrB_*` lookup as `GxB_*` when SuiteSparse moves + a symbol between standard and extension namespaces. +- `burble` — context manager / global toggle for `GxB_BURBLE` diagnostic output. +- `matrix.py`, `vector.py`, `scalar.py` — **the functional API** of the package, and the + primary user-facing surface for code that uses `suitesparse-graphblas` directly. Each + module follows the same convention: `.new(...)` returns an `ffi.gc`-managed + cdata handle (`GrB_Matrix*`, `GrB_Vector*`, or `GxB_Scalar*`) and every other function + takes that handle as its first argument and routes errors through `check_status`. The + design is deliberately functional rather than class-based so the same handles can be + passed through higher-level wrappers without object-identity friction. When adding + features to this package, this is the layer where new user-facing helpers belong. +- `io/serialize.py`, `io/binary.py` — supporting I/O helpers (compressed serialize / + deserialize, binary format read/write). `matrix.py` and `vector.py` already re-export + `serialize` / `deserialize` from `io/serialize.py` so callers can reach them as + `matrix.serialize(A)` etc. + +### 4. `utils.pyx` and free-threading + +The Cython module exists primarily to (a) call `GxB_init` with NumPy's allocators by +casting the cffi function pointer through `uintptr_t` into a real C function pointer, and +(b) wrap NumPy buffers around GraphBLAS-allocated memory with `claim_buffer` / +`unclaim_buffer`, transferring ownership of the underlying allocation to NumPy. + +The file is marked `freethreading_compatible=True`. The package does nothing special for +free-threading itself — correctness depends on SuiteSparse:GraphBLAS being thread-safe, +which it is required to be. + +## Style and tooling + +- Black, isort, flake8 (config in `.flake8`, line length 100, double quotes), pyupgrade + (`--py311-plus`), autoflake, shellcheck — all wired through `pre-commit`. Run + `pre-commit run --all-files` before pushing. +- `pre-commit` also blocks direct commits to `main`. +- Python ≥ 3.11. NumPy ≥ 2.0 is required at build time (CFFI extension), ≥ 1.24 at runtime. +- Generated headers (`suitesparse_graphblas.h`, `suitesparse_graphblas_no_complex.h`, + `source.c`) are checked in and **must be regenerated via `create_headers.py`** rather + than hand-edited. CI enforces this. diff --git a/pyproject.toml b/pyproject.toml index 976de9b..fb4824a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -83,6 +83,8 @@ test = [ [tool.setuptools] packages = [ 'suitesparse_graphblas', + 'suitesparse_graphblas.api', + 'suitesparse_graphblas.api.io', 'suitesparse_graphblas.tests', 'suitesparse_graphblas.io', ] @@ -124,5 +126,9 @@ exclude_lines = [ "raise NotImplementedError", ] -[tool.pytest] -testpaths = ["suitesparse_graphblas/tests"] +[tool.pytest.ini_options] +testpaths = ["suitesparse_graphblas"] +addopts = "--doctest-modules" +# NOTE: When running in Docker, use -w /tmp and --pyargs to avoid the source +# directory shadowing the installed package (compiled extensions aren't in the +# source tree). See CLAUDE.md for the full Docker test commands. diff --git a/suitesparse_graphblas/__init__.py b/suitesparse_graphblas/__init__.py index 92e1e33..4f170b9 100644 --- a/suitesparse_graphblas/__init__.py +++ b/suitesparse_graphblas/__init__.py @@ -108,86 +108,6 @@ def libget(name): raise -# --------------------------------------------------------------------------- -# Global option get/set -# --------------------------------------------------------------------------- - - -def global_option_get_int32(field): - """Get a global option as an int32. - - >>> global_option_get_int32(lib.GxB_BURBLE) in (0, 1) - True - - """ - val = ffi.new("int32_t*") - info = lib.GxB_Global_Option_get_INT32(field, val) - if info != lib.GrB_SUCCESS: - raise _error_code_lookup.get(info, RuntimeError)( - f"GxB_Global_Option_get_INT32 failed with info={info}" - ) - return val[0] - - -def global_option_set_int32(field, value): - """Set a global option from an int32. - - >>> global_option_set_int32(lib.GxB_BURBLE, 0) - - """ - info = lib.GxB_Global_Option_set_INT32(field, ffi.cast("int32_t", value)) - if info != lib.GrB_SUCCESS: - raise _error_code_lookup.get(info, RuntimeError)( - f"GxB_Global_Option_set_INT32 failed with info={info}" - ) - - -def global_option_get_fp64(field): - """Get a global option as a float64. - - >>> isinstance(global_option_get_fp64(lib.GxB_HYPER_SWITCH), float) - True - - """ - val = ffi.new("double*") - info = lib.GxB_Global_Option_get_FP64(field, val) - if info != lib.GrB_SUCCESS: - raise _error_code_lookup.get(info, RuntimeError)( - f"GxB_Global_Option_get_FP64 failed with info={info}" - ) - return val[0] - - -def global_option_set_fp64(field, value): - """Set a global option from a float64. - - >>> default = global_option_get_fp64(lib.GxB_HYPER_SWITCH) - >>> global_option_set_fp64(lib.GxB_HYPER_SWITCH, default) - - """ - info = lib.GxB_Global_Option_set_FP64(field, ffi.cast("double", value)) - if info != lib.GrB_SUCCESS: - raise _error_code_lookup.get(info, RuntimeError)( - f"GxB_Global_Option_set_FP64 failed with info={info}" - ) - - -def global_option_get_char(field): - """Get a global option as a string. - - >>> 'SuiteSparse:GraphBLAS' in global_option_get_char(lib.GxB_LIBRARY_NAME) - True - - """ - val = ffi.new("char**") - info = lib.GxB_Global_Option_get_CHAR(field, val) - if info != lib.GrB_SUCCESS: - raise _error_code_lookup.get(info, RuntimeError)( - f"GxB_Global_Option_get_CHAR failed with info={info}" - ) - return ffi.string(val[0]).decode() - - bool_types = frozenset((lib.GrB_BOOL,)) signed_integer_types = frozenset( @@ -268,6 +188,9 @@ def global_option_get_char(field): "struct GB_Matrix_opaque *": lib.GrB_Matrix_error, "struct GB_Vector_opaque *": lib.GrB_Vector_error, "struct GB_Descriptor_opaque *": lib.GrB_Descriptor_error, + "struct GB_Context_opaque *": lib.GxB_Context_error, + "struct GB_IndexUnaryOp_opaque *": lib.GrB_IndexUnaryOp_error, + "struct GB_IndexBinaryOp_opaque *": lib.GxB_IndexBinaryOp_error, } @@ -383,3 +306,13 @@ def __repr__(self): burble = burble() + +# Backward-compatible re-exports: functional API moved to suitesparse_graphblas.api +from suitesparse_graphblas.api import iterator, matrix, scalar, vector # noqa: E402,F401 +from suitesparse_graphblas.api.global_options import ( # noqa: E402,F401 + global_option_get_char, + global_option_get_fp64, + global_option_get_int32, + global_option_set_fp64, + global_option_set_int32, +) diff --git a/suitesparse_graphblas/api/__init__.py b/suitesparse_graphblas/api/__init__.py new file mode 100644 index 0000000..680da82 --- /dev/null +++ b/suitesparse_graphblas/api/__init__.py @@ -0,0 +1,20 @@ +from suitesparse_graphblas.api import ( + binaryop, + container, + context, + descriptor, + global_, + global_options, + grb_type, + indexbinaryop, + indexunaryop, + iterator, + matrix, + monoid, + scalar, + semiring, + selectop, + unaryop, + vector, +) +from suitesparse_graphblas.api import io # noqa: F401 diff --git a/suitesparse_graphblas/api/binaryop.py b/suitesparse_graphblas/api/binaryop.py new file mode 100644 index 0000000..970a541 --- /dev/null +++ b/suitesparse_graphblas/api/binaryop.py @@ -0,0 +1,270 @@ +from suitesparse_graphblas import check_status, ffi, lib + +from .utils import _capture_c_output # noqa: F401 + + +def binaryop_free(op): + """Free a binary operator. + + >>> op = ffi.new("GrB_BinaryOp*", lib.GrB_PLUS_INT64) + >>> binaryop_free(op) + + """ + check_status(op, lib.GrB_BinaryOp_free(op)) + + +def binaryop_new(function, ztype, xtype, ytype, *, free=binaryop_free): + """Create a new GrB_BinaryOp from a C function pointer. + + ``function`` must be a CFFI callback compatible with + ``GxB_binary_function``. + + The ``free`` argument is called when the object is garbage + collected, the default is ``binaryop.binaryop_free()``. If ``free`` + is None then there is no automatic garbage collection and it is up + to the user to free the operator. + """ + op = ffi.new("GrB_BinaryOp*") + check_status(op, lib.GrB_BinaryOp_new(op, function, ztype, xtype, ytype)) + if free: + return ffi.gc(op, free) + return op + + +def binaryop_new_named(function, ztype, xtype, ytype, name, defn, *, free=binaryop_free): + """Create a new named GrB_BinaryOp (GxB extension). + + ``function`` must be a CFFI callback compatible with + ``GxB_binary_function``. ``name`` and ``defn`` are C strings + describing the operator for JIT compilation. + + The ``free`` argument is called when the object is garbage + collected, the default is ``binaryop.binaryop_free()``. If ``free`` + is None then there is no automatic garbage collection and it is up + to the user to free the operator. + """ + op = ffi.new("GrB_BinaryOp*") + check_status( + op, + lib.GxB_BinaryOp_new( + op, + function, + ztype, + xtype, + ytype, + name.encode() if isinstance(name, str) else name, + defn.encode() if isinstance(defn, str) else defn, + ), + ) + if free: + return ffi.gc(op, free) + return op + + +def binaryop_new_indexop(idxbinop, theta, *, free=binaryop_free): + """Create a new GrB_BinaryOp from a GxB_IndexBinaryOp and a scalar theta. + + The ``free`` argument is called when the object is garbage + collected, the default is ``binaryop.binaryop_free()``. If ``free`` + is None then there is no automatic garbage collection and it is up + to the user to free the operator. + """ + op = ffi.new("GrB_BinaryOp*") + check_status(op, lib.GxB_BinaryOp_new_IndexOp(op, idxbinop, theta)) + if free: + return ffi.gc(op, free) + return op + + +def binaryop_wait(op, waitmode=lib.GrB_COMPLETE): + """Wait for a binary operator to complete pending operations. + + >>> op = ffi.new("GrB_BinaryOp*", lib.GrB_PLUS_INT64) + >>> binaryop_wait(op) + + """ + check_status(op, lib.GrB_BinaryOp_wait(op[0], waitmode)) + + +# --------------------------------------------------------------------------- +# Print +# --------------------------------------------------------------------------- + + +def binaryop_print(op, name="", level=lib.GxB_COMPLETE): + """Print a binary operator to stdout. + + ``level`` controls verbosity: ``lib.GxB_SILENT``, ``lib.GxB_SUMMARY``, + ``lib.GxB_SHORT``, ``lib.GxB_COMPLETE``, ``lib.GxB_SHORT_VERBOSE``, + or ``lib.GxB_COMPLETE_VERBOSE``. + + >>> op = ffi.new("GrB_BinaryOp*", lib.GrB_PLUS_INT64) + >>> out = _capture_c_output(binaryop_print, op, 'op', lib.GxB_SHORT) + >>> 'plus' in out.lower() + True + + """ + check_status(op, lib.GxB_BinaryOp_fprint( + op[0], name.encode() if isinstance(name, str) else name, + level, ffi.NULL, + )) + + +def binaryop_fprint(op, f, name="", level=lib.GxB_COMPLETE): + """Print a binary operator to a C FILE* stream. + + Pass ``ffi.NULL`` for ``f`` to print to stdout. + ``level`` controls verbosity (see :func:`binaryop_print`). + + >>> op = ffi.new("GrB_BinaryOp*", lib.GrB_PLUS_INT64) + >>> out = _capture_c_output(binaryop_fprint, op, ffi.NULL, 'op', lib.GxB_SHORT) + >>> 'plus' in out.lower() + True + + """ + check_status(op, lib.GxB_BinaryOp_fprint( + op[0], name.encode() if isinstance(name, str) else name, + level, f, + )) + + +# --------------------------------------------------------------------------- +# Option get/set (typed) +# --------------------------------------------------------------------------- + + +def binaryop_get_int32(op, field): + """Get an operator option as an int32. + + >>> op = ffi.new("GrB_BinaryOp*", lib.GrB_PLUS_INT64) + >>> binaryop_get_int32(op, lib.GrB_OUTP_TYPE_CODE) >= 0 + True + + """ + val = ffi.new("int32_t*") + check_status(op, lib.GrB_BinaryOp_get_INT32(op[0], val, field)) + return val[0] + + +def binaryop_set_int32(op, field, value): + """Set an operator option from an int32.""" + check_status(op, lib.GrB_BinaryOp_set_INT32(op[0], ffi.cast("int32_t", value), field)) + + +def binaryop_get_size(op, field): + """Get an operator option as a size_t. + + >>> op = ffi.new("GrB_BinaryOp*", lib.GrB_PLUS_INT64) + >>> binaryop_get_size(op, lib.GrB_NAME) > 0 + True + + """ + val = ffi.new("size_t*") + check_status(op, lib.GrB_BinaryOp_get_SIZE(op[0], val, field)) + return val[0] + + +def binaryop_get_string(op, field): + """Get an operator option as a string. + + >>> op = ffi.new("GrB_BinaryOp*", lib.GrB_PLUS_INT64) + >>> 'plus' in binaryop_get_string(op, lib.GrB_NAME).lower() + True + + """ + val = ffi.new("char[256]") + check_status(op, lib.GrB_BinaryOp_get_String(op[0], val, field)) + return ffi.string(val).decode() + + +def binaryop_set_string(op, field, value): + """Set an operator option from a string.""" + check_status( + op, + lib.GrB_BinaryOp_set_String( + op[0], value.encode() if isinstance(value, str) else value, field + ), + ) + + +# --------------------------------------------------------------------------- +# Type queries +# --------------------------------------------------------------------------- + + +def binaryop_xtype(op): + """Return the first input (x) type of a binary operator. + + >>> op = ffi.new("GrB_BinaryOp*", lib.GrB_PLUS_INT64) + >>> binaryop_xtype(op) == lib.GrB_INT64 + True + + """ + T = ffi.new("GrB_Type*") + check_status(op, lib.GxB_BinaryOp_xtype(T, op[0])) + return T[0] + + +def binaryop_ytype(op): + """Return the second input (y) type of a binary operator. + + >>> op = ffi.new("GrB_BinaryOp*", lib.GrB_PLUS_INT64) + >>> binaryop_ytype(op) == lib.GrB_INT64 + True + + """ + T = ffi.new("GrB_Type*") + check_status(op, lib.GxB_BinaryOp_ytype(T, op[0])) + return T[0] + + +def binaryop_ztype(op): + """Return the output (z) type of a binary operator. + + >>> op = ffi.new("GrB_BinaryOp*", lib.GrB_PLUS_INT64) + >>> binaryop_ztype(op) == lib.GrB_INT64 + True + + """ + T = ffi.new("GrB_Type*") + check_status(op, lib.GxB_BinaryOp_ztype(T, op[0])) + return T[0] + + +def binaryop_xtype_name(op): + """Return the first input (x) type name of a binary operator as a string. + + >>> op = ffi.new("GrB_BinaryOp*", lib.GrB_PLUS_INT64) + >>> binaryop_xtype_name(op) + 'int64_t' + + """ + name = ffi.new("char[256]") + check_status(op, lib.GxB_BinaryOp_xtype_name(name, op[0])) + return ffi.string(name).decode() + + +def binaryop_ytype_name(op): + """Return the second input (y) type name of a binary operator as a string. + + >>> op = ffi.new("GrB_BinaryOp*", lib.GrB_PLUS_INT64) + >>> binaryop_ytype_name(op) + 'int64_t' + + """ + name = ffi.new("char[256]") + check_status(op, lib.GxB_BinaryOp_ytype_name(name, op[0])) + return ffi.string(name).decode() + + +def binaryop_ztype_name(op): + """Return the output (z) type name of a binary operator as a string. + + >>> op = ffi.new("GrB_BinaryOp*", lib.GrB_PLUS_INT64) + >>> binaryop_ztype_name(op) + 'int64_t' + + """ + name = ffi.new("char[256]") + check_status(op, lib.GxB_BinaryOp_ztype_name(name, op[0])) + return ffi.string(name).decode() diff --git a/suitesparse_graphblas/api/container.py b/suitesparse_graphblas/api/container.py new file mode 100644 index 0000000..2418f0a --- /dev/null +++ b/suitesparse_graphblas/api/container.py @@ -0,0 +1,37 @@ +from suitesparse_graphblas import _error_code_lookup, ffi, lib + + +def container_free(c): + """Free a container. + + >>> c = container_new() + >>> container_free(c) + + """ + info = lib.GxB_Container_free(c) + if info != lib.GrB_SUCCESS: + raise _error_code_lookup.get(info, RuntimeError)( + f"GxB_Container_free failed with info={info}" + ) + + +def container_new(*, free=container_free): + """Create a new ``GxB_Container`` and initialize it. + + The ``free`` argument is called when the object is garbage + collected, the default is ``container.container_free()``. If ``free`` + is None then there is no automatic garbage collection and it is up + to the user to free the container. + + >>> c = container_new() + + """ + c = ffi.new("GxB_Container*") + info = lib.GxB_Container_new(c) + if info != lib.GrB_SUCCESS: + raise _error_code_lookup.get(info, RuntimeError)( + f"GxB_Container_new failed with info={info}" + ) + if free: + return ffi.gc(c, free) + return c diff --git a/suitesparse_graphblas/api/context.py b/suitesparse_graphblas/api/context.py new file mode 100644 index 0000000..da6bc49 --- /dev/null +++ b/suitesparse_graphblas/api/context.py @@ -0,0 +1,225 @@ +from suitesparse_graphblas import check_status, ffi, lib + +from .utils import _capture_c_output # noqa: F401 + + +def context_free(ctx): + """Free a context. + + >>> ctx = context_new() + >>> context_free(ctx) + + """ + check_status(ctx, lib.GxB_Context_free(ctx)) + + +def context_new(*, free=context_free): + """Create a new GxB_Context and initialize it. + + The ``free`` argument is called when the object is garbage + collected, the default is ``context.context_free()``. If ``free`` is None + then there is no automatic garbage collection and it is up to the user + to free the context. + + >>> ctx = context_new() + + """ + ctx = ffi.new("GxB_Context*") + check_status(ctx, lib.GxB_Context_new(ctx)) + if free: + return ffi.gc(ctx, free) + return ctx + + +def context_wait(ctx, waitmode=lib.GrB_COMPLETE): + """Wait for a context to complete pending operations. + + >>> ctx = context_new() + >>> context_wait(ctx) + + """ + check_status(ctx, lib.GxB_Context_wait(ctx[0], waitmode)) + + +# --------------------------------------------------------------------------- +# Engage / disengage +# --------------------------------------------------------------------------- + + +def context_engage(ctx): + """Engage a context for the calling thread. + + An engaged context controls settings like nthreads and chunk for all + GraphBLAS operations executed by the calling thread until the context + is disengaged. + + >>> ctx = context_new() + >>> context_engage(ctx) + >>> context_disengage(ctx) + + """ + check_status(ctx, lib.GxB_Context_engage(ctx[0])) + + +def context_disengage(ctx): + """Disengage a context from the calling thread. + + After disengaging, the calling thread reverts to the default + (world) context settings. + + >>> ctx = context_new() + >>> context_engage(ctx) + >>> context_disengage(ctx) + + """ + check_status(ctx, lib.GxB_Context_disengage(ctx[0])) + + +# --------------------------------------------------------------------------- +# Option get/set (typed) +# --------------------------------------------------------------------------- + + +def context_get_int32(ctx, field): + """Get a context option as an int32. + + >>> ctx = context_new() + >>> context_get_int32(ctx, lib.GxB_CONTEXT_NTHREADS) >= 0 + True + + """ + val = ffi.new("int32_t*") + check_status(ctx, lib.GxB_Context_get_INT32(ctx[0], field, val)) + return val[0] + + +def context_set_int32(ctx, field, value): + """Set a context option from an int32. + + >>> ctx = context_new() + >>> context_set_int32(ctx, lib.GxB_CONTEXT_NTHREADS, 2) + >>> context_get_int32(ctx, lib.GxB_CONTEXT_NTHREADS) + 2 + + """ + check_status(ctx, lib.GxB_Context_set_INT32(ctx[0], field, ffi.cast("int32_t", value))) + + +def context_get_fp64(ctx, field): + """Get a context option as a float64. + + >>> ctx = context_new() + >>> isinstance(context_get_fp64(ctx, lib.GxB_CONTEXT_CHUNK), float) + True + + """ + val = ffi.new("double*") + check_status(ctx, lib.GxB_Context_get_FP64(ctx[0], field, val)) + return val[0] + + +def context_set_fp64(ctx, field, value): + """Set a context option from a float64. + + >>> ctx = context_new() + >>> context_set_fp64(ctx, lib.GxB_CONTEXT_CHUNK, 4096.0) + >>> context_get_fp64(ctx, lib.GxB_CONTEXT_CHUNK) + 4096.0 + + """ + check_status(ctx, lib.GxB_Context_set_FP64(ctx[0], field, ffi.cast("double", value))) + + +# --------------------------------------------------------------------------- +# Convenience accessors +# --------------------------------------------------------------------------- + + +def context_get_nthreads(ctx): + """Get the number of threads for a context. + + >>> ctx = context_new() + >>> context_get_nthreads(ctx) >= 0 + True + + """ + return context_get_int32(ctx, lib.GxB_CONTEXT_NTHREADS) + + +def context_set_nthreads(ctx, nthreads): + """Set the number of threads for a context. + + >>> ctx = context_new() + >>> context_set_nthreads(ctx, 4) + >>> context_get_nthreads(ctx) + 4 + + """ + context_set_int32(ctx, lib.GxB_CONTEXT_NTHREADS, nthreads) + + +def context_get_chunk(ctx): + """Get the chunk size for a context. + + The chunk size determines the minimum amount of work per thread. + + >>> ctx = context_new() + >>> isinstance(context_get_chunk(ctx), float) + True + + """ + return context_get_fp64(ctx, lib.GxB_CONTEXT_CHUNK) + + +def context_set_chunk(ctx, chunk): + """Set the chunk size for a context. + + >>> ctx = context_new() + >>> context_set_chunk(ctx, 4096.0) + >>> context_get_chunk(ctx) + 4096.0 + + """ + context_set_fp64(ctx, lib.GxB_CONTEXT_CHUNK, chunk) + + +# --------------------------------------------------------------------------- +# Print +# --------------------------------------------------------------------------- + + +def context_print(ctx, name="", level=lib.GxB_COMPLETE): + """Print a context to stdout. + + ``level`` controls verbosity: ``lib.GxB_SILENT``, ``lib.GxB_SUMMARY``, + ``lib.GxB_SHORT``, ``lib.GxB_COMPLETE``, ``lib.GxB_SHORT_VERBOSE``, + or ``lib.GxB_COMPLETE_VERBOSE``. + + >>> ctx = context_new() + >>> out = _capture_c_output(context_print, ctx, 'ctx', lib.GxB_SHORT) + >>> 'Context' in out + True + + """ + check_status(ctx, lib.GxB_Context_fprint( + ctx[0], name.encode() if isinstance(name, str) else name, + level, ffi.NULL, + )) + + +def context_fprint(ctx, f, name="", level=lib.GxB_COMPLETE): + """Print a context to a C FILE* stream. + + Pass ``ffi.NULL`` for ``f`` to print to stdout. + ``level`` controls verbosity (see :func:`context_print`). + + >>> ctx = context_new() + >>> out = _capture_c_output(context_fprint, ctx, ffi.NULL, 'ctx', lib.GxB_SHORT) + >>> 'Context' in out + True + + """ + check_status(ctx, lib.GxB_Context_fprint( + ctx[0], name.encode() if isinstance(name, str) else name, + level, f, + )) diff --git a/suitesparse_graphblas/api/descriptor.py b/suitesparse_graphblas/api/descriptor.py new file mode 100644 index 0000000..7ac200b --- /dev/null +++ b/suitesparse_graphblas/api/descriptor.py @@ -0,0 +1,146 @@ +from suitesparse_graphblas import check_status, ffi, lib + +from .utils import _capture_c_output # noqa: F401 + + +def descriptor_free(desc): + """Free a descriptor. + + >>> desc = descriptor_new() + >>> descriptor_free(desc) + + """ + check_status(desc, lib.GrB_Descriptor_free(desc)) + + +def descriptor_new(*, free=descriptor_free): + """Create a new ``GrB_Descriptor`` and initialize it. + + The ``free`` argument is called when the object is garbage + collected, the default is ``descriptor.descriptor_free()``. If ``free`` + is None then there is no automatic garbage collection and it is up + to the user to free the descriptor. + + >>> desc = descriptor_new() + + """ + desc = ffi.new("GrB_Descriptor*") + check_status(desc, lib.GrB_Descriptor_new(desc)) + if free: + return ffi.gc(desc, free) + return desc + + +def descriptor_wait(desc, waitmode=lib.GrB_COMPLETE): + """Wait for a descriptor to complete pending operations. + + >>> desc = descriptor_new() + >>> descriptor_wait(desc) + + """ + check_status(desc, lib.GrB_Descriptor_wait(desc[0], waitmode)) + + +def descriptor_print(desc, name="", level=lib.GxB_COMPLETE): + """Print a descriptor to stdout. + + ``level`` controls verbosity: ``lib.GxB_SILENT``, ``lib.GxB_SUMMARY``, + ``lib.GxB_SHORT``, ``lib.GxB_COMPLETE``, ``lib.GxB_SHORT_VERBOSE``, + or ``lib.GxB_COMPLETE_VERBOSE``. + + >>> desc = descriptor_new() + >>> out = _capture_c_output(descriptor_print, desc, 'desc', lib.GxB_SHORT) + >>> 'Descriptor' in out + True + + """ + check_status(desc, lib.GxB_Descriptor_fprint( + desc[0], name.encode() if isinstance(name, str) else name, + level, ffi.NULL, + )) + + +def descriptor_fprint(desc, f, name="", level=lib.GxB_COMPLETE): + """Print a descriptor to a C FILE* stream. + + Pass ``ffi.NULL`` for ``f`` to print to stdout. + ``level`` controls verbosity (see :func:`descriptor_print`). + + >>> desc = descriptor_new() + >>> out = _capture_c_output(descriptor_fprint, desc, ffi.NULL, 'desc', lib.GxB_SHORT) + >>> 'Descriptor' in out + True + + """ + check_status(desc, lib.GxB_Descriptor_fprint( + desc[0], name.encode() if isinstance(name, str) else name, + level, f, + )) + + +# --------------------------------------------------------------------------- +# Get / Set +# --------------------------------------------------------------------------- + + +def descriptor_get_int32(desc, field): + """Get a descriptor property as an int32. + + >>> desc = descriptor_new() + >>> isinstance(descriptor_get_int32(desc, lib.GrB_OUTP_FIELD), int) + True + + """ + val = ffi.new("int32_t*") + check_status(desc, lib.GrB_Descriptor_get_INT32(desc[0], val, field)) + return val[0] + + +def descriptor_set_int32(desc, field, value): + """Set a descriptor property from an int32. + + >>> desc = descriptor_new() + >>> descriptor_set_int32(desc, lib.GrB_OUTP_FIELD, lib.GrB_REPLACE) + + """ + check_status(desc, lib.GrB_Descriptor_set_INT32( + desc[0], ffi.cast("int32_t", value), field, + )) + + +def descriptor_get_size(desc, field): + """Get a descriptor property as a size_t. + + >>> desc = descriptor_new() + >>> isinstance(descriptor_get_size(desc, lib.GrB_NAME), int) + True + + """ + val = ffi.new("size_t*") + check_status(desc, lib.GrB_Descriptor_get_SIZE(desc[0], val, field)) + return val[0] + + +def descriptor_get_string(desc, field): + """Get a descriptor property as a string. + + >>> desc = descriptor_new() + >>> isinstance(descriptor_get_string(desc, lib.GrB_NAME), str) + True + + """ + val = ffi.new("char[256]") + check_status(desc, lib.GrB_Descriptor_get_String(desc[0], val, field)) + return ffi.string(val).decode() + + +def descriptor_set_string(desc, field, value): + """Set a descriptor property from a string. + + >>> desc = descriptor_new() + >>> descriptor_set_string(desc, lib.GrB_NAME, "my_desc") + >>> descriptor_get_string(desc, lib.GrB_NAME) + 'my_desc' + + """ + check_status(desc, lib.GrB_Descriptor_set_String(desc[0], value.encode(), field)) diff --git a/suitesparse_graphblas/api/global_.py b/suitesparse_graphblas/api/global_.py new file mode 100644 index 0000000..fc0083f --- /dev/null +++ b/suitesparse_graphblas/api/global_.py @@ -0,0 +1,72 @@ +from suitesparse_graphblas import _error_code_lookup, ffi, lib + + +def global_get_int32(field): + """Get a global property as an int32. + + >>> isinstance(global_get_int32(lib.GxB_NTHREADS), int) + True + + """ + val = ffi.new("int32_t*") + info = lib.GrB_Global_get_INT32(lib.GrB_GLOBAL, val, field) + if info != lib.GrB_SUCCESS: + raise _error_code_lookup.get(info, RuntimeError)( + f"GrB_Global_get_INT32 failed with info={info}" + ) + return val[0] + + +def global_set_int32(field, value): + """Set a global property from an int32. + + >>> nthreads = global_get_int32(lib.GxB_NTHREADS) + >>> global_set_int32(lib.GxB_NTHREADS, nthreads) + + """ + info = lib.GrB_Global_set_INT32(lib.GrB_GLOBAL, ffi.cast("int32_t", value), field) + if info != lib.GrB_SUCCESS: + raise _error_code_lookup.get(info, RuntimeError)( + f"GrB_Global_set_INT32 failed with info={info}" + ) + + +def global_get_size(field): + """Get a global property as a size_t. + + >>> isinstance(global_get_size(lib.GrB_NAME), int) + True + + """ + val = ffi.new("size_t*") + info = lib.GrB_Global_get_SIZE(lib.GrB_GLOBAL, val, field) + if info != lib.GrB_SUCCESS: + raise _error_code_lookup.get(info, RuntimeError)( + f"GrB_Global_get_SIZE failed with info={info}" + ) + return val[0] + + +def global_get_string(field): + """Get a global property as a string. + + >>> 'SuiteSparse:GraphBLAS' in global_get_string(lib.GrB_NAME) + True + + """ + val = ffi.new("char[256]") + info = lib.GrB_Global_get_String(lib.GrB_GLOBAL, val, field) + if info != lib.GrB_SUCCESS: + raise _error_code_lookup.get(info, RuntimeError)( + f"GrB_Global_get_String failed with info={info}" + ) + return ffi.string(val).decode() + + +def global_set_string(field, value): + """Set a global property from a string.""" + info = lib.GrB_Global_set_String(lib.GrB_GLOBAL, value.encode(), field) + if info != lib.GrB_SUCCESS: + raise _error_code_lookup.get(info, RuntimeError)( + f"GrB_Global_set_String failed with info={info}" + ) diff --git a/suitesparse_graphblas/api/global_options.py b/suitesparse_graphblas/api/global_options.py new file mode 100644 index 0000000..c50317d --- /dev/null +++ b/suitesparse_graphblas/api/global_options.py @@ -0,0 +1,76 @@ +from suitesparse_graphblas import _error_code_lookup, ffi, lib + + +def global_option_get_int32(field): + """Get a global option as an int32. + + >>> global_option_get_int32(lib.GxB_BURBLE) in (0, 1) + True + + """ + val = ffi.new("int32_t*") + info = lib.GxB_Global_Option_get_INT32(field, val) + if info != lib.GrB_SUCCESS: + raise _error_code_lookup.get(info, RuntimeError)( + f"GxB_Global_Option_get_INT32 failed with info={info}" + ) + return val[0] + + +def global_option_set_int32(field, value): + """Set a global option from an int32. + + >>> global_option_set_int32(lib.GxB_BURBLE, 0) + + """ + info = lib.GxB_Global_Option_set_INT32(field, ffi.cast("int32_t", value)) + if info != lib.GrB_SUCCESS: + raise _error_code_lookup.get(info, RuntimeError)( + f"GxB_Global_Option_set_INT32 failed with info={info}" + ) + + +def global_option_get_fp64(field): + """Get a global option as a float64. + + >>> isinstance(global_option_get_fp64(lib.GxB_HYPER_SWITCH), float) + True + + """ + val = ffi.new("double*") + info = lib.GxB_Global_Option_get_FP64(field, val) + if info != lib.GrB_SUCCESS: + raise _error_code_lookup.get(info, RuntimeError)( + f"GxB_Global_Option_get_FP64 failed with info={info}" + ) + return val[0] + + +def global_option_set_fp64(field, value): + """Set a global option from a float64. + + >>> default = global_option_get_fp64(lib.GxB_HYPER_SWITCH) + >>> global_option_set_fp64(lib.GxB_HYPER_SWITCH, default) + + """ + info = lib.GxB_Global_Option_set_FP64(field, ffi.cast("double", value)) + if info != lib.GrB_SUCCESS: + raise _error_code_lookup.get(info, RuntimeError)( + f"GxB_Global_Option_set_FP64 failed with info={info}" + ) + + +def global_option_get_char(field): + """Get a global option as a string. + + >>> 'SuiteSparse:GraphBLAS' in global_option_get_char(lib.GxB_LIBRARY_NAME) + True + + """ + val = ffi.new("char**") + info = lib.GxB_Global_Option_get_CHAR(field, val) + if info != lib.GrB_SUCCESS: + raise _error_code_lookup.get(info, RuntimeError)( + f"GxB_Global_Option_get_CHAR failed with info={info}" + ) + return ffi.string(val[0]).decode() diff --git a/suitesparse_graphblas/api/grb_type.py b/suitesparse_graphblas/api/grb_type.py new file mode 100644 index 0000000..39f8024 --- /dev/null +++ b/suitesparse_graphblas/api/grb_type.py @@ -0,0 +1,198 @@ +from suitesparse_graphblas import check_status, ffi, lib + +from .utils import _capture_c_output # noqa: F401 + + +def grb_type_free(T): + """Free a type. + + >>> T = grb_type_new(8) + >>> grb_type_free(T) + + """ + check_status(T, lib.GrB_Type_free(T)) + + +def grb_type_new(sizeof_ctype, *, free=grb_type_free): + """Create a new ``GrB_Type`` and initialize it. + + The ``free`` argument is called when the object is garbage + collected, the default is ``grb_type.grb_type_free()``. If ``free`` is + None then there is no automatic garbage collection and it is up to + the user to free the type. + + >>> T = grb_type_new(8) + + """ + T = ffi.new("GrB_Type*") + check_status(T, lib.GrB_Type_new(T, sizeof_ctype)) + if free: + return ffi.gc(T, free) + return T + + +def grb_type_new_named(sizeof_ctype, type_name, type_defn, *, free=grb_type_free): + """Create a new named ``GrB_Type`` and initialize it. + + ``type_name`` and ``type_defn`` are strings describing the type. + + >>> T = grb_type_new_named(8, "my_type", "int64_t") + + """ + T = ffi.new("GrB_Type*") + check_status(T, lib.GxB_Type_new(T, sizeof_ctype, type_name.encode(), type_defn.encode())) + if free: + return ffi.gc(T, free) + return T + + +def grb_type_wait(T, waitmode=lib.GrB_COMPLETE): + """Wait for a type to complete pending operations. + + >>> T = grb_type_new(8) + >>> grb_type_wait(T) + + """ + check_status(T, lib.GrB_Type_wait(T[0], waitmode)) + + +def grb_type_print(T, name="", level=lib.GxB_COMPLETE): + """Print a type to stdout. + + ``level`` controls verbosity: ``lib.GxB_SILENT``, ``lib.GxB_SUMMARY``, + ``lib.GxB_SHORT``, ``lib.GxB_COMPLETE``, ``lib.GxB_SHORT_VERBOSE``, + or ``lib.GxB_COMPLETE_VERBOSE``. + + >>> T = ffi.new("GrB_Type*", lib.GrB_INT64) + >>> out = _capture_c_output(grb_type_print, T, 'T', lib.GxB_SHORT) + >>> 'int64_t' in out + True + + """ + check_status(T, lib.GxB_Type_fprint( + T[0], name.encode() if isinstance(name, str) else name, + level, ffi.NULL, + )) + + +def grb_type_fprint(T, f, name="", level=lib.GxB_COMPLETE): + """Print a type to a C FILE* stream. + + Pass ``ffi.NULL`` for ``f`` to print to stdout. + ``level`` controls verbosity (see :func:`grb_type_print`). + + >>> T = ffi.new("GrB_Type*", lib.GrB_INT64) + >>> out = _capture_c_output(grb_type_fprint, T, ffi.NULL, 'T', lib.GxB_SHORT) + >>> 'int64_t' in out + True + + """ + check_status(T, lib.GxB_Type_fprint( + T[0], name.encode() if isinstance(name, str) else name, + level, f, + )) + + +# --------------------------------------------------------------------------- +# Get / Set +# --------------------------------------------------------------------------- + + +def grb_type_get_int32(T, field): + """Get a type property as an int32. + + >>> T = ffi.new("GrB_Type*", lib.GrB_INT64) + >>> isinstance(grb_type_get_int32(T, lib.GrB_EL_TYPE_CODE), int) + True + + """ + val = ffi.new("int32_t*") + check_status(T, lib.GrB_Type_get_INT32(T[0], val, field)) + return val[0] + + +def grb_type_set_int32(T, field, value): + """Set a type property from an int32. + + >>> T = grb_type_new(8) + >>> grb_type_set_int32(T, lib.GrB_EL_TYPE_CODE, 11) + Traceback (most recent call last): + ... + suitesparse_graphblas.exceptions.InvalidValue + + """ + check_status(T, lib.GrB_Type_set_INT32(T[0], ffi.cast("int32_t", value), field)) + + +def grb_type_get_size(T, field): + """Get a type property as a size_t. + + >>> T = ffi.new("GrB_Type*", lib.GrB_INT64) + >>> grb_type_get_size(T, lib.GrB_SIZE) + 8 + + """ + val = ffi.new("size_t*") + check_status(T, lib.GrB_Type_get_SIZE(T[0], val, field)) + return val[0] + + +def grb_type_get_string(T, field): + """Get a type property as a string. + + >>> T = ffi.new("GrB_Type*", lib.GrB_INT64) + >>> grb_type_get_string(T, lib.GrB_NAME) + 'GrB_INT64' + + """ + val = ffi.new("char[256]") + check_status(T, lib.GrB_Type_get_String(T[0], val, field)) + return ffi.string(val).decode() + + +def grb_type_set_string(T, field, value): + """Set a type property from a string.""" + check_status(T, lib.GrB_Type_set_String(T[0], value.encode(), field)) + + +# --------------------------------------------------------------------------- +# Legacy GxB accessors +# --------------------------------------------------------------------------- + + +def grb_type_size(T): + """Return the size of the type in bytes. + + >>> T = ffi.new("GrB_Type*", lib.GrB_INT64) + >>> grb_type_size(T) + 8 + + """ + sz = ffi.new("size_t*") + check_status(T, lib.GxB_Type_size(sz, T[0])) + return sz[0] + + +def grb_type_name(T): + """Return the name of the type. + + >>> T = ffi.new("GrB_Type*", lib.GrB_INT64) + >>> grb_type_name(T) + 'int64_t' + + """ + name = ffi.new("char[256]") + check_status(T, lib.GxB_Type_name(name, T[0])) + return ffi.string(name).decode() + + +def grb_type_from_name(type_name): + """Look up a built-in type by name. + + >>> grb_type_from_name("GrB_INT64") == lib.GrB_INT64 + True + + """ + T = ffi.new("GrB_Type*") + check_status(T, lib.GxB_Type_from_name(T, type_name.encode())) + return T[0] diff --git a/suitesparse_graphblas/api/indexbinaryop.py b/suitesparse_graphblas/api/indexbinaryop.py new file mode 100644 index 0000000..6587c89 --- /dev/null +++ b/suitesparse_graphblas/api/indexbinaryop.py @@ -0,0 +1,127 @@ +"""GxB_IndexBinaryOp functional API. + +There are no built-in GxB_IndexBinaryOp constants in the library, so most +functions in this module cannot have doctests without constructing an operator +from a CFFI callback. Only ``indexbinaryop_new`` creates instances, and it +requires a C function pointer. +""" + +from suitesparse_graphblas import check_status, ffi, lib + +from .utils import _capture_c_output # noqa: F401 + + +def indexbinaryop_free(op): + """Free an index binary operator.""" + check_status(op, lib.GxB_IndexBinaryOp_free(op)) + + +def indexbinaryop_new( + function, ztype, xtype, ytype, theta_type, name, defn, *, free=indexbinaryop_free +): + """Create a new GxB_IndexBinaryOp from a C function pointer. + + ``function`` must be a CFFI callback compatible with + ``GxB_index_binary_function``. ``name`` and ``defn`` are C strings + describing the operator for JIT compilation. + + The ``free`` argument is called when the object is garbage + collected, the default is ``indexbinaryop.indexbinaryop_free()``. + If ``free`` is None then there is no automatic garbage collection + and it is up to the user to free the operator. + """ + op = ffi.new("GxB_IndexBinaryOp*") + check_status( + op, + lib.GxB_IndexBinaryOp_new( + op, + function, + ztype, + xtype, + ytype, + theta_type, + name.encode() if isinstance(name, str) else name, + defn.encode() if isinstance(defn, str) else defn, + ), + ) + if free: + return ffi.gc(op, free) + return op + + +def indexbinaryop_wait(op, waitmode=lib.GrB_COMPLETE): + """Wait for an index binary operator to complete pending operations.""" + check_status(op, lib.GxB_IndexBinaryOp_wait(op[0], waitmode)) + + +# --------------------------------------------------------------------------- +# Print +# --------------------------------------------------------------------------- + + +def indexbinaryop_print(op, name="", level=lib.GxB_COMPLETE): + """Print an index binary operator to stdout. + + ``level`` controls verbosity: ``lib.GxB_SILENT``, ``lib.GxB_SUMMARY``, + ``lib.GxB_SHORT``, ``lib.GxB_COMPLETE``, ``lib.GxB_SHORT_VERBOSE``, + or ``lib.GxB_COMPLETE_VERBOSE``. + """ + check_status(op, lib.GxB_IndexBinaryOp_fprint( + op[0], name.encode() if isinstance(name, str) else name, + level, ffi.NULL, + )) + + +def indexbinaryop_fprint(op, f, name="", level=lib.GxB_COMPLETE): + """Print an index binary operator to a C FILE* stream. + + Pass ``ffi.NULL`` for ``f`` to print to stdout. + ``level`` controls verbosity (see :func:`indexbinaryop_print`). + """ + check_status(op, lib.GxB_IndexBinaryOp_fprint( + op[0], name.encode() if isinstance(name, str) else name, + level, f, + )) + + +# --------------------------------------------------------------------------- +# Option get/set (typed) +# --------------------------------------------------------------------------- + + +def indexbinaryop_get_int32(op, field): + """Get an operator option as an int32.""" + val = ffi.new("int32_t*") + check_status(op, lib.GxB_IndexBinaryOp_get_INT32(op[0], val, field)) + return val[0] + + +def indexbinaryop_set_int32(op, field, value): + """Set an operator option from an int32.""" + check_status( + op, lib.GxB_IndexBinaryOp_set_INT32(op[0], ffi.cast("int32_t", value), field) + ) + + +def indexbinaryop_get_size(op, field): + """Get an operator option as a size_t.""" + val = ffi.new("size_t*") + check_status(op, lib.GxB_IndexBinaryOp_get_SIZE(op[0], val, field)) + return val[0] + + +def indexbinaryop_get_string(op, field): + """Get an operator option as a string.""" + val = ffi.new("char[256]") + check_status(op, lib.GxB_IndexBinaryOp_get_String(op[0], val, field)) + return ffi.string(val).decode() + + +def indexbinaryop_set_string(op, field, value): + """Set an operator option from a string.""" + check_status( + op, + lib.GxB_IndexBinaryOp_set_String( + op[0], value.encode() if isinstance(value, str) else value, field + ), + ) diff --git a/suitesparse_graphblas/api/indexunaryop.py b/suitesparse_graphblas/api/indexunaryop.py new file mode 100644 index 0000000..06a24e9 --- /dev/null +++ b/suitesparse_graphblas/api/indexunaryop.py @@ -0,0 +1,218 @@ +from suitesparse_graphblas import check_status, ffi, lib + +from .utils import _capture_c_output # noqa: F401 + + +def indexunaryop_free(op): + """Free an index unary operator. + + >>> op = ffi.new("GrB_IndexUnaryOp*", lib.GrB_ROWINDEX_INT64) + >>> indexunaryop_free(op) + + """ + check_status(op, lib.GrB_IndexUnaryOp_free(op)) + + +def indexunaryop_new(function, ztype, xtype, ytype, *, free=indexunaryop_free): + """Create a new GrB_IndexUnaryOp from a C function pointer. + + ``function`` must be a CFFI callback compatible with + ``GxB_index_unary_function``. + + The ``free`` argument is called when the object is garbage + collected, the default is ``indexunaryop.indexunaryop_free()``. If + ``free`` is None then there is no automatic garbage collection and + it is up to the user to free the operator. + """ + op = ffi.new("GrB_IndexUnaryOp*") + check_status(op, lib.GrB_IndexUnaryOp_new(op, function, ztype, xtype, ytype)) + if free: + return ffi.gc(op, free) + return op + + +def indexunaryop_new_named(function, ztype, xtype, ytype, name, defn, *, free=indexunaryop_free): + """Create a new named GrB_IndexUnaryOp (GxB extension). + + ``function`` must be a CFFI callback compatible with + ``GxB_index_unary_function``. ``name`` and ``defn`` are C strings + describing the operator for JIT compilation. + + The ``free`` argument is called when the object is garbage + collected, the default is ``indexunaryop.indexunaryop_free()``. If + ``free`` is None then there is no automatic garbage collection and + it is up to the user to free the operator. + """ + op = ffi.new("GrB_IndexUnaryOp*") + check_status( + op, + lib.GxB_IndexUnaryOp_new( + op, + function, + ztype, + xtype, + ytype, + name.encode() if isinstance(name, str) else name, + defn.encode() if isinstance(defn, str) else defn, + ), + ) + if free: + return ffi.gc(op, free) + return op + + +def indexunaryop_wait(op, waitmode=lib.GrB_COMPLETE): + """Wait for an index unary operator to complete pending operations. + + >>> op = ffi.new("GrB_IndexUnaryOp*", lib.GrB_ROWINDEX_INT64) + >>> indexunaryop_wait(op) + + """ + check_status(op, lib.GrB_IndexUnaryOp_wait(op[0], waitmode)) + + +# --------------------------------------------------------------------------- +# Print +# --------------------------------------------------------------------------- + + +def indexunaryop_print(op, name="", level=lib.GxB_COMPLETE): + """Print an index unary operator to stdout. + + ``level`` controls verbosity: ``lib.GxB_SILENT``, ``lib.GxB_SUMMARY``, + ``lib.GxB_SHORT``, ``lib.GxB_COMPLETE``, ``lib.GxB_SHORT_VERBOSE``, + or ``lib.GxB_COMPLETE_VERBOSE``. + + >>> op = ffi.new("GrB_IndexUnaryOp*", lib.GrB_ROWINDEX_INT64) + >>> out = _capture_c_output(indexunaryop_print, op, 'op', lib.GxB_SHORT) + >>> 'rowindex' in out.lower() + True + + """ + check_status(op, lib.GxB_IndexUnaryOp_fprint( + op[0], name.encode() if isinstance(name, str) else name, + level, ffi.NULL, + )) + + +def indexunaryop_fprint(op, f, name="", level=lib.GxB_COMPLETE): + """Print an index unary operator to a C FILE* stream. + + Pass ``ffi.NULL`` for ``f`` to print to stdout. + ``level`` controls verbosity (see :func:`indexunaryop_print`). + + >>> op = ffi.new("GrB_IndexUnaryOp*", lib.GrB_ROWINDEX_INT64) + >>> out = _capture_c_output(indexunaryop_fprint, op, ffi.NULL, 'op', lib.GxB_SHORT) + >>> 'rowindex' in out.lower() + True + + """ + check_status(op, lib.GxB_IndexUnaryOp_fprint( + op[0], name.encode() if isinstance(name, str) else name, + level, f, + )) + + +# --------------------------------------------------------------------------- +# Option get/set (typed) +# --------------------------------------------------------------------------- + + +def indexunaryop_get_int32(op, field): + """Get an operator option as an int32. + + >>> op = ffi.new("GrB_IndexUnaryOp*", lib.GrB_ROWINDEX_INT64) + >>> indexunaryop_get_int32(op, lib.GrB_OUTP_TYPE_CODE) >= 0 + True + + """ + val = ffi.new("int32_t*") + check_status(op, lib.GrB_IndexUnaryOp_get_INT32(op[0], val, field)) + return val[0] + + +def indexunaryop_set_int32(op, field, value): + """Set an operator option from an int32.""" + check_status( + op, lib.GrB_IndexUnaryOp_set_INT32(op[0], ffi.cast("int32_t", value), field) + ) + + +def indexunaryop_get_size(op, field): + """Get an operator option as a size_t. + + >>> op = ffi.new("GrB_IndexUnaryOp*", lib.GrB_ROWINDEX_INT64) + >>> indexunaryop_get_size(op, lib.GrB_NAME) > 0 + True + + """ + val = ffi.new("size_t*") + check_status(op, lib.GrB_IndexUnaryOp_get_SIZE(op[0], val, field)) + return val[0] + + +def indexunaryop_get_string(op, field): + """Get an operator option as a string. + + >>> op = ffi.new("GrB_IndexUnaryOp*", lib.GrB_ROWINDEX_INT64) + >>> 'rowindex' in indexunaryop_get_string(op, lib.GrB_NAME).lower() + True + + """ + val = ffi.new("char[256]") + check_status(op, lib.GrB_IndexUnaryOp_get_String(op[0], val, field)) + return ffi.string(val).decode() + + +def indexunaryop_set_string(op, field, value): + """Set an operator option from a string.""" + check_status( + op, + lib.GrB_IndexUnaryOp_set_String( + op[0], value.encode() if isinstance(value, str) else value, field + ), + ) + + +# --------------------------------------------------------------------------- +# Type name queries +# --------------------------------------------------------------------------- + + +def indexunaryop_xtype_name(op): + """Return the input (x) type name of an index unary operator as a string. + + >>> op = ffi.new("GrB_IndexUnaryOp*", lib.GrB_ROWINDEX_INT64) + >>> indexunaryop_xtype_name(op) + '' + + """ + name = ffi.new("char[256]") + check_status(op, lib.GxB_IndexUnaryOp_xtype_name(name, op[0])) + return ffi.string(name).decode() + + +def indexunaryop_ytype_name(op): + """Return the thunk (y) type name of an index unary operator as a string. + + >>> op = ffi.new("GrB_IndexUnaryOp*", lib.GrB_ROWINDEX_INT64) + >>> indexunaryop_ytype_name(op) + 'int64_t' + + """ + name = ffi.new("char[256]") + check_status(op, lib.GxB_IndexUnaryOp_ytype_name(name, op[0])) + return ffi.string(name).decode() + + +def indexunaryop_ztype_name(op): + """Return the output (z) type name of an index unary operator as a string. + + >>> op = ffi.new("GrB_IndexUnaryOp*", lib.GrB_ROWINDEX_INT64) + >>> indexunaryop_ztype_name(op) + 'int64_t' + + """ + name = ffi.new("char[256]") + check_status(op, lib.GxB_IndexUnaryOp_ztype_name(name, op[0])) + return ffi.string(name).decode() diff --git a/suitesparse_graphblas/api/io/__init__.py b/suitesparse_graphblas/api/io/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/suitesparse_graphblas/io/binary.py b/suitesparse_graphblas/api/io/binary.py similarity index 99% rename from suitesparse_graphblas/io/binary.py rename to suitesparse_graphblas/api/io/binary.py index 190cc28..dafb628 100644 --- a/suitesparse_graphblas/io/binary.py +++ b/suitesparse_graphblas/api/io/binary.py @@ -3,7 +3,8 @@ from cffi import FFI -from suitesparse_graphblas import __version__, check_status, ffi, lib, matrix +from suitesparse_graphblas import __version__, check_status, ffi, lib +from suitesparse_graphblas.api import matrix stdffi = FFI() stdffi.cdef(""" diff --git a/suitesparse_graphblas/io/serialize.py b/suitesparse_graphblas/api/io/serialize.py similarity index 98% rename from suitesparse_graphblas/io/serialize.py rename to suitesparse_graphblas/api/io/serialize.py index 63e2e3d..399371d 100644 --- a/suitesparse_graphblas/io/serialize.py +++ b/suitesparse_graphblas/api/io/serialize.py @@ -140,4 +140,4 @@ def deserialize_vector(data, *, free=True, nthreads=None): return v -from suitesparse_graphblas import matrix, vector # noqa: E402 isort:skip +from suitesparse_graphblas.api import matrix, vector # noqa: E402 isort:skip diff --git a/suitesparse_graphblas/iterator.py b/suitesparse_graphblas/api/iterator.py similarity index 100% rename from suitesparse_graphblas/iterator.py rename to suitesparse_graphblas/api/iterator.py diff --git a/suitesparse_graphblas/matrix.py b/suitesparse_graphblas/api/matrix.py similarity index 99% rename from suitesparse_graphblas/matrix.py rename to suitesparse_graphblas/api/matrix.py index 7e70907..917f58e 100644 --- a/suitesparse_graphblas/matrix.py +++ b/suitesparse_graphblas/api/matrix.py @@ -1,23 +1,8 @@ -import os -import sys - import numpy as np from suitesparse_graphblas import check_status, ffi, lib, supports_complex - -def _capture_c_output(fn, *args): - """Capture C-level stdout output from a function call.""" - sys.stdout.flush() - r, w = os.pipe() - old = os.dup(1) - os.dup2(w, 1) - fn(*args) - os.dup2(old, 1) - os.close(w) - out = os.read(r, 100000).decode() - os.close(r) - return out +from .utils import _capture_c_output # noqa: F401 from .io.serialize import deserialize_matrix as deserialize # noqa: F401 from .io.serialize import serialize_matrix as serialize # noqa: F401 diff --git a/suitesparse_graphblas/api/monoid.py b/suitesparse_graphblas/api/monoid.py new file mode 100644 index 0000000..64dcc9d --- /dev/null +++ b/suitesparse_graphblas/api/monoid.py @@ -0,0 +1,601 @@ +from suitesparse_graphblas import check_status, ffi, lib, supports_complex + +from .utils import _capture_c_output # noqa: F401 + + +def monoid_free(m): + """Free a monoid. + + >>> m = monoid_new_int64(lib.GrB_PLUS_INT64, 0) + >>> monoid_free(m) + + """ + check_status(m, lib.GrB_Monoid_free(m)) + + +# --------------------------------------------------------------------------- +# Typed constructors +# --------------------------------------------------------------------------- + + +def monoid_new_bool(op, identity, *, free=monoid_free): + """Create a new GrB_Monoid with a boolean identity. + + >>> m = monoid_new_bool(lib.GrB_LAND, True) + >>> monoid_operator(m) == lib.GrB_LAND + True + + """ + m = ffi.new("GrB_Monoid*") + check_status(m, lib.GrB_Monoid_new_BOOL(m, op, identity)) + if free: + return ffi.gc(m, free) + return m + + +def monoid_new_int8(op, identity, *, free=monoid_free): + """Create a new GrB_Monoid with an int8 identity. + + >>> m = monoid_new_int8(lib.GrB_PLUS_INT8, 0) + >>> monoid_operator(m) == lib.GrB_PLUS_INT8 + True + + """ + m = ffi.new("GrB_Monoid*") + check_status(m, lib.GrB_Monoid_new_INT8(m, op, identity)) + if free: + return ffi.gc(m, free) + return m + + +def monoid_new_int16(op, identity, *, free=monoid_free): + """Create a new GrB_Monoid with an int16 identity. + + >>> m = monoid_new_int16(lib.GrB_PLUS_INT16, 0) + >>> monoid_operator(m) == lib.GrB_PLUS_INT16 + True + + """ + m = ffi.new("GrB_Monoid*") + check_status(m, lib.GrB_Monoid_new_INT16(m, op, identity)) + if free: + return ffi.gc(m, free) + return m + + +def monoid_new_int32(op, identity, *, free=monoid_free): + """Create a new GrB_Monoid with an int32 identity. + + >>> m = monoid_new_int32(lib.GrB_PLUS_INT32, 0) + >>> monoid_operator(m) == lib.GrB_PLUS_INT32 + True + + """ + m = ffi.new("GrB_Monoid*") + check_status(m, lib.GrB_Monoid_new_INT32(m, op, identity)) + if free: + return ffi.gc(m, free) + return m + + +def monoid_new_int64(op, identity, *, free=monoid_free): + """Create a new GrB_Monoid with an int64 identity. + + >>> m = monoid_new_int64(lib.GrB_PLUS_INT64, 0) + >>> monoid_operator(m) == lib.GrB_PLUS_INT64 + True + + """ + m = ffi.new("GrB_Monoid*") + check_status(m, lib.GrB_Monoid_new_INT64(m, op, identity)) + if free: + return ffi.gc(m, free) + return m + + +def monoid_new_uint8(op, identity, *, free=monoid_free): + """Create a new GrB_Monoid with a uint8 identity. + + >>> m = monoid_new_uint8(lib.GrB_PLUS_UINT8, 0) + >>> monoid_operator(m) == lib.GrB_PLUS_UINT8 + True + + """ + m = ffi.new("GrB_Monoid*") + check_status(m, lib.GrB_Monoid_new_UINT8(m, op, identity)) + if free: + return ffi.gc(m, free) + return m + + +def monoid_new_uint16(op, identity, *, free=monoid_free): + """Create a new GrB_Monoid with a uint16 identity. + + >>> m = monoid_new_uint16(lib.GrB_PLUS_UINT16, 0) + >>> monoid_operator(m) == lib.GrB_PLUS_UINT16 + True + + """ + m = ffi.new("GrB_Monoid*") + check_status(m, lib.GrB_Monoid_new_UINT16(m, op, identity)) + if free: + return ffi.gc(m, free) + return m + + +def monoid_new_uint32(op, identity, *, free=monoid_free): + """Create a new GrB_Monoid with a uint32 identity. + + >>> m = monoid_new_uint32(lib.GrB_PLUS_UINT32, 0) + >>> monoid_operator(m) == lib.GrB_PLUS_UINT32 + True + + """ + m = ffi.new("GrB_Monoid*") + check_status(m, lib.GrB_Monoid_new_UINT32(m, op, identity)) + if free: + return ffi.gc(m, free) + return m + + +def monoid_new_uint64(op, identity, *, free=monoid_free): + """Create a new GrB_Monoid with a uint64 identity. + + >>> m = monoid_new_uint64(lib.GrB_PLUS_UINT64, 0) + >>> monoid_operator(m) == lib.GrB_PLUS_UINT64 + True + + """ + m = ffi.new("GrB_Monoid*") + check_status(m, lib.GrB_Monoid_new_UINT64(m, op, identity)) + if free: + return ffi.gc(m, free) + return m + + +def monoid_new_fp32(op, identity, *, free=monoid_free): + """Create a new GrB_Monoid with an fp32 identity. + + >>> m = monoid_new_fp32(lib.GrB_PLUS_FP32, 0.0) + >>> monoid_operator(m) == lib.GrB_PLUS_FP32 + True + + """ + m = ffi.new("GrB_Monoid*") + check_status(m, lib.GrB_Monoid_new_FP32(m, op, identity)) + if free: + return ffi.gc(m, free) + return m + + +def monoid_new_fp64(op, identity, *, free=monoid_free): + """Create a new GrB_Monoid with an fp64 identity. + + >>> m = monoid_new_fp64(lib.GrB_PLUS_FP64, 0.0) + >>> monoid_operator(m) == lib.GrB_PLUS_FP64 + True + + """ + m = ffi.new("GrB_Monoid*") + check_status(m, lib.GrB_Monoid_new_FP64(m, op, identity)) + if free: + return ffi.gc(m, free) + return m + + +def monoid_new_udt(op, identity, *, free=monoid_free): + """Create a new GrB_Monoid with a user-defined type identity. + + The ``identity`` argument must be a ``void*`` pointer. + + """ + m = ffi.new("GrB_Monoid*") + check_status(m, lib.GrB_Monoid_new_UDT(m, op, identity)) + if free: + return ffi.gc(m, free) + return m + + +# --------------------------------------------------------------------------- +# Terminal constructors +# --------------------------------------------------------------------------- + + +def monoid_terminal_new_bool(op, identity, terminal, *, free=monoid_free): + """Create a new GxB_Monoid with a boolean identity and terminal. + + >>> m = monoid_terminal_new_bool(lib.GrB_LAND, True, False) + >>> monoid_operator(m) == lib.GrB_LAND + True + + """ + m = ffi.new("GrB_Monoid*") + check_status(m, lib.GxB_Monoid_terminal_new_BOOL(m, op, identity, terminal)) + if free: + return ffi.gc(m, free) + return m + + +def monoid_terminal_new_int8(op, identity, terminal, *, free=monoid_free): + """Create a new GxB_Monoid with an int8 identity and terminal. + + >>> m = monoid_terminal_new_int8(lib.GrB_PLUS_INT8, 0, 0) + >>> monoid_operator(m) == lib.GrB_PLUS_INT8 + True + + """ + m = ffi.new("GrB_Monoid*") + check_status(m, lib.GxB_Monoid_terminal_new_INT8(m, op, identity, terminal)) + if free: + return ffi.gc(m, free) + return m + + +def monoid_terminal_new_int16(op, identity, terminal, *, free=monoid_free): + """Create a new GxB_Monoid with an int16 identity and terminal. + + >>> m = monoid_terminal_new_int16(lib.GrB_PLUS_INT16, 0, 0) + >>> monoid_operator(m) == lib.GrB_PLUS_INT16 + True + + """ + m = ffi.new("GrB_Monoid*") + check_status(m, lib.GxB_Monoid_terminal_new_INT16(m, op, identity, terminal)) + if free: + return ffi.gc(m, free) + return m + + +def monoid_terminal_new_int32(op, identity, terminal, *, free=monoid_free): + """Create a new GxB_Monoid with an int32 identity and terminal. + + >>> m = monoid_terminal_new_int32(lib.GrB_PLUS_INT32, 0, 0) + >>> monoid_operator(m) == lib.GrB_PLUS_INT32 + True + + """ + m = ffi.new("GrB_Monoid*") + check_status(m, lib.GxB_Monoid_terminal_new_INT32(m, op, identity, terminal)) + if free: + return ffi.gc(m, free) + return m + + +def monoid_terminal_new_int64(op, identity, terminal, *, free=monoid_free): + """Create a new GxB_Monoid with an int64 identity and terminal. + + >>> m = monoid_terminal_new_int64(lib.GrB_PLUS_INT64, 0, 0) + >>> monoid_operator(m) == lib.GrB_PLUS_INT64 + True + + """ + m = ffi.new("GrB_Monoid*") + check_status(m, lib.GxB_Monoid_terminal_new_INT64(m, op, identity, terminal)) + if free: + return ffi.gc(m, free) + return m + + +def monoid_terminal_new_uint8(op, identity, terminal, *, free=monoid_free): + """Create a new GxB_Monoid with a uint8 identity and terminal. + + >>> m = monoid_terminal_new_uint8(lib.GrB_PLUS_UINT8, 0, 0) + >>> monoid_operator(m) == lib.GrB_PLUS_UINT8 + True + + """ + m = ffi.new("GrB_Monoid*") + check_status(m, lib.GxB_Monoid_terminal_new_UINT8(m, op, identity, terminal)) + if free: + return ffi.gc(m, free) + return m + + +def monoid_terminal_new_uint16(op, identity, terminal, *, free=monoid_free): + """Create a new GxB_Monoid with a uint16 identity and terminal. + + >>> m = monoid_terminal_new_uint16(lib.GrB_PLUS_UINT16, 0, 0) + >>> monoid_operator(m) == lib.GrB_PLUS_UINT16 + True + + """ + m = ffi.new("GrB_Monoid*") + check_status(m, lib.GxB_Monoid_terminal_new_UINT16(m, op, identity, terminal)) + if free: + return ffi.gc(m, free) + return m + + +def monoid_terminal_new_uint32(op, identity, terminal, *, free=monoid_free): + """Create a new GxB_Monoid with a uint32 identity and terminal. + + >>> m = monoid_terminal_new_uint32(lib.GrB_PLUS_UINT32, 0, 0) + >>> monoid_operator(m) == lib.GrB_PLUS_UINT32 + True + + """ + m = ffi.new("GrB_Monoid*") + check_status(m, lib.GxB_Monoid_terminal_new_UINT32(m, op, identity, terminal)) + if free: + return ffi.gc(m, free) + return m + + +def monoid_terminal_new_uint64(op, identity, terminal, *, free=monoid_free): + """Create a new GxB_Monoid with a uint64 identity and terminal. + + >>> m = monoid_terminal_new_uint64(lib.GrB_PLUS_UINT64, 0, 0) + >>> monoid_operator(m) == lib.GrB_PLUS_UINT64 + True + + """ + m = ffi.new("GrB_Monoid*") + check_status(m, lib.GxB_Monoid_terminal_new_UINT64(m, op, identity, terminal)) + if free: + return ffi.gc(m, free) + return m + + +def monoid_terminal_new_fp32(op, identity, terminal, *, free=monoid_free): + """Create a new GxB_Monoid with an fp32 identity and terminal. + + >>> m = monoid_terminal_new_fp32(lib.GrB_PLUS_FP32, 0.0, 0.0) + >>> monoid_operator(m) == lib.GrB_PLUS_FP32 + True + + """ + m = ffi.new("GrB_Monoid*") + check_status(m, lib.GxB_Monoid_terminal_new_FP32(m, op, identity, terminal)) + if free: + return ffi.gc(m, free) + return m + + +def monoid_terminal_new_fp64(op, identity, terminal, *, free=monoid_free): + """Create a new GxB_Monoid with an fp64 identity and terminal. + + >>> m = monoid_terminal_new_fp64(lib.GrB_PLUS_FP64, 0.0, 0.0) + >>> monoid_operator(m) == lib.GrB_PLUS_FP64 + True + + """ + m = ffi.new("GrB_Monoid*") + check_status(m, lib.GxB_Monoid_terminal_new_FP64(m, op, identity, terminal)) + if free: + return ffi.gc(m, free) + return m + + +def monoid_terminal_new_udt(op, identity, terminal, *, free=monoid_free): + """Create a new GxB_Monoid with a user-defined type identity and terminal. + + The ``identity`` and ``terminal`` arguments must be ``void*`` pointers. + + """ + m = ffi.new("GrB_Monoid*") + check_status(m, lib.GxB_Monoid_terminal_new_UDT(m, op, identity, terminal)) + if free: + return ffi.gc(m, free) + return m + + +if supports_complex(): + + def monoid_new_fc32(op, identity, *, free=monoid_free): + """Create a new GrB_Monoid with an fc32 identity. + + >>> m = monoid_new_fc32(lib.GxB_PLUS_FC32, 0 + 0j) + >>> monoid_operator(m) == lib.GxB_PLUS_FC32 + True + + """ + m = ffi.new("GrB_Monoid*") + check_status(m, lib.GxB_Monoid_new_FC32(m, op, identity)) + if free: + return ffi.gc(m, free) + return m + + def monoid_new_fc64(op, identity, *, free=monoid_free): + """Create a new GrB_Monoid with an fc64 identity. + + >>> m = monoid_new_fc64(lib.GxB_PLUS_FC64, 0 + 0j) + >>> monoid_operator(m) == lib.GxB_PLUS_FC64 + True + + """ + m = ffi.new("GrB_Monoid*") + check_status(m, lib.GxB_Monoid_new_FC64(m, op, identity)) + if free: + return ffi.gc(m, free) + return m + + def monoid_terminal_new_fc32(op, identity, terminal, *, free=monoid_free): + """Create a new GxB_Monoid with an fc32 identity and terminal. + + >>> m = monoid_terminal_new_fc32(lib.GxB_PLUS_FC32, 0 + 0j, 0 + 0j) + >>> monoid_operator(m) == lib.GxB_PLUS_FC32 + True + + """ + m = ffi.new("GrB_Monoid*") + check_status(m, lib.GxB_Monoid_terminal_new_FC32(m, op, identity, terminal)) + if free: + return ffi.gc(m, free) + return m + + def monoid_terminal_new_fc64(op, identity, terminal, *, free=monoid_free): + """Create a new GxB_Monoid with an fc64 identity and terminal. + + >>> m = monoid_terminal_new_fc64(lib.GxB_PLUS_FC64, 0 + 0j, 0 + 0j) + >>> monoid_operator(m) == lib.GxB_PLUS_FC64 + True + + """ + m = ffi.new("GrB_Monoid*") + check_status(m, lib.GxB_Monoid_terminal_new_FC64(m, op, identity, terminal)) + if free: + return ffi.gc(m, free) + return m + + +# --------------------------------------------------------------------------- +# Wait +# --------------------------------------------------------------------------- + + +def monoid_wait(m, waitmode=lib.GrB_COMPLETE): + """Wait for a monoid to complete pending operations. + + >>> m = ffi.new("GrB_Monoid*", lib.GrB_PLUS_MONOID_INT64) + >>> monoid_wait(m) + + """ + check_status(m, lib.GrB_Monoid_wait(m[0], waitmode)) + + +# --------------------------------------------------------------------------- +# Print +# --------------------------------------------------------------------------- + + +def monoid_print(m, name="", level=lib.GxB_COMPLETE): + """Print a monoid to stdout. + + ``level`` controls verbosity: ``lib.GxB_SILENT``, ``lib.GxB_SUMMARY``, + ``lib.GxB_SHORT``, ``lib.GxB_COMPLETE``, ``lib.GxB_SHORT_VERBOSE``, + or ``lib.GxB_COMPLETE_VERBOSE``. + + >>> m = ffi.new("GrB_Monoid*", lib.GrB_PLUS_MONOID_INT64) + >>> out = _capture_c_output(monoid_print, m, 'm', lib.GxB_SHORT) + >>> 'Monoid' in out + True + + """ + check_status(m, lib.GxB_Monoid_fprint( + m[0], name.encode() if isinstance(name, str) else name, + level, ffi.NULL, + )) + + +def monoid_fprint(m, f, name="", level=lib.GxB_COMPLETE): + """Print a monoid to a C FILE* stream. + + Pass ``ffi.NULL`` for ``f`` to print to stdout. + ``level`` controls verbosity (see :func:`monoid_print`). + + >>> m = ffi.new("GrB_Monoid*", lib.GrB_PLUS_MONOID_INT64) + >>> out = _capture_c_output(monoid_fprint, m, ffi.NULL, 'm', lib.GxB_SHORT) + >>> 'Monoid' in out + True + + """ + check_status(m, lib.GxB_Monoid_fprint( + m[0], name.encode() if isinstance(name, str) else name, + level, f, + )) + + +# --------------------------------------------------------------------------- +# Option get/set (typed) +# --------------------------------------------------------------------------- + + +def monoid_get_int32(m, field): + """Get a monoid option as an int32. + + >>> m = ffi.new("GrB_Monoid*", lib.GrB_PLUS_MONOID_INT64) + >>> monoid_get_int32(m, lib.GrB_INP0_TYPE_CODE) >= 0 + True + + """ + val = ffi.new("int32_t*") + check_status(m, lib.GrB_Monoid_get_INT32(m[0], val, field)) + return val[0] + + +def monoid_set_int32(m, field, value): + """Set a monoid option from an int32. + + """ + check_status(m, lib.GrB_Monoid_set_INT32(m[0], ffi.cast("int32_t", value), field)) + + +def monoid_get_size(m, field): + """Get a monoid option as a size_t. + + >>> m = ffi.new("GrB_Monoid*", lib.GrB_PLUS_MONOID_INT64) + >>> monoid_get_size(m, lib.GrB_NAME) >= 0 + True + + """ + val = ffi.new("size_t*") + check_status(m, lib.GrB_Monoid_get_SIZE(m[0], val, field)) + return val[0] + + +def monoid_get_string(m, field): + """Get a monoid option as a string. + + >>> m = ffi.new("GrB_Monoid*", lib.GrB_PLUS_MONOID_INT64) + >>> isinstance(monoid_get_string(m, lib.GrB_NAME), str) + True + + """ + val = ffi.new("char[256]") + check_status(m, lib.GrB_Monoid_get_String(m[0], val, field)) + return ffi.string(val).decode() + + +def monoid_set_string(m, field, value): + """Set a monoid option from a string. + + """ + check_status(m, lib.GrB_Monoid_set_String(m[0], value.encode(), field)) + + +# --------------------------------------------------------------------------- +# Accessors +# --------------------------------------------------------------------------- + + +def monoid_operator(m): + """Return the binary operator of a monoid. + + >>> m = ffi.new("GrB_Monoid*", lib.GrB_PLUS_MONOID_INT64) + >>> monoid_operator(m) == lib.GrB_PLUS_INT64 + True + + """ + op = ffi.new("GrB_BinaryOp*") + check_status(m, lib.GxB_Monoid_operator(op, m[0])) + return op[0] + + +def monoid_identity(m): + """Return a buffer containing the identity value of a monoid. + + >>> m = ffi.new("GrB_Monoid*", lib.GrB_PLUS_MONOID_INT64) + >>> val = monoid_identity(m) + + """ + val = ffi.new("char[256]") + check_status(m, lib.GxB_Monoid_identity(val, m[0])) + return val + + +def monoid_terminal(m): + """Return a (has_terminal, buffer) tuple for a monoid. + + ``has_terminal`` is a boolean indicating whether the monoid has a + terminal value. + + >>> m = ffi.new("GrB_Monoid*", lib.GrB_PLUS_MONOID_INT64) + >>> has_terminal, val = monoid_terminal(m) + >>> isinstance(has_terminal, bool) + True + + """ + has_terminal = ffi.new("bool*") + val = ffi.new("char[256]") + check_status(m, lib.GxB_Monoid_terminal(has_terminal, val, m[0])) + return has_terminal[0], val diff --git a/suitesparse_graphblas/scalar.py b/suitesparse_graphblas/api/scalar.py similarity index 97% rename from suitesparse_graphblas/scalar.py rename to suitesparse_graphblas/api/scalar.py index ef421d6..d4536a0 100644 --- a/suitesparse_graphblas/scalar.py +++ b/suitesparse_graphblas/api/scalar.py @@ -1,21 +1,6 @@ -import os -import sys - from suitesparse_graphblas import check_status, exceptions, ffi, lib, supports_complex - -def _capture_c_output(fn, *args): - """Capture C-level stdout output from a function call.""" - sys.stdout.flush() - r, w = os.pipe() - old = os.dup(1) - os.dup2(w, 1) - fn(*args) - os.dup2(old, 1) - os.close(w) - out = os.read(r, 100000).decode() - os.close(r) - return out +from .utils import _capture_c_output # noqa: F401 def scalar_free(v): diff --git a/suitesparse_graphblas/api/selectop.py b/suitesparse_graphblas/api/selectop.py new file mode 100644 index 0000000..b68b389 --- /dev/null +++ b/suitesparse_graphblas/api/selectop.py @@ -0,0 +1,82 @@ +from suitesparse_graphblas import _error_code_lookup, ffi, lib + +from .utils import _capture_c_output # noqa: F401 + + +def selectop_xtype(op): + """Return the xtype of a select operator. + + >>> op = ffi.new("GxB_SelectOp*", lib.GxB_TRIL) + >>> selectop_xtype(op) == ffi.NULL + True + + """ + T = ffi.new("GrB_Type*") + info = lib.GxB_SelectOp_xtype(T, op[0]) + if info != lib.GrB_SUCCESS: + raise _error_code_lookup.get(info, RuntimeError)( + f"GxB_SelectOp_xtype failed with info={info}" + ) + return T[0] + + +def selectop_ttype(op): + """Return the ttype (thunk type) of a select operator. + + >>> op = ffi.new("GxB_SelectOp*", lib.GxB_TRIL) + >>> selectop_ttype(op) == ffi.NULL + True + + """ + T = ffi.new("GrB_Type*") + info = lib.GxB_SelectOp_ttype(T, op[0]) + if info != lib.GrB_SUCCESS: + raise _error_code_lookup.get(info, RuntimeError)( + f"GxB_SelectOp_ttype failed with info={info}" + ) + return T[0] + + +def selectop_print(op, name="", level=lib.GxB_COMPLETE): + """Print a select operator to stdout. + + ``level`` controls verbosity: ``lib.GxB_SILENT``, ``lib.GxB_SUMMARY``, + ``lib.GxB_SHORT``, ``lib.GxB_COMPLETE``, ``lib.GxB_SHORT_VERBOSE``, + or ``lib.GxB_COMPLETE_VERBOSE``. + + >>> op = ffi.new("GxB_SelectOp*", lib.GxB_TRIL) + >>> out = _capture_c_output(selectop_print, op, 'op', lib.GxB_SHORT) + >>> 'tril' in out.lower() + True + + """ + info = lib.GxB_SelectOp_fprint( + op[0], name.encode() if isinstance(name, str) else name, + level, ffi.NULL, + ) + if info != lib.GrB_SUCCESS: + raise _error_code_lookup.get(info, RuntimeError)( + f"GxB_SelectOp_fprint failed with info={info}" + ) + + +def selectop_fprint(op, f, name="", level=lib.GxB_COMPLETE): + """Print a select operator to a C FILE* stream. + + Pass ``ffi.NULL`` for ``f`` to print to stdout. + ``level`` controls verbosity (see :func:`selectop_print`). + + >>> op = ffi.new("GxB_SelectOp*", lib.GxB_TRIL) + >>> out = _capture_c_output(selectop_fprint, op, ffi.NULL, 'op', lib.GxB_SHORT) + >>> 'tril' in out.lower() + True + + """ + info = lib.GxB_SelectOp_fprint( + op[0], name.encode() if isinstance(name, str) else name, + level, f, + ) + if info != lib.GrB_SUCCESS: + raise _error_code_lookup.get(info, RuntimeError)( + f"GxB_SelectOp_fprint failed with info={info}" + ) diff --git a/suitesparse_graphblas/api/semiring.py b/suitesparse_graphblas/api/semiring.py new file mode 100644 index 0000000..03ef469 --- /dev/null +++ b/suitesparse_graphblas/api/semiring.py @@ -0,0 +1,182 @@ +from suitesparse_graphblas import check_status, ffi, lib + +from .utils import _capture_c_output # noqa: F401 + + +def semiring_free(s): + """Free a semiring. + + >>> s = semiring_new(lib.GrB_PLUS_MONOID_INT64, lib.GrB_TIMES_INT64) + >>> semiring_free(s) + + """ + check_status(s, lib.GrB_Semiring_free(s)) + + +def semiring_new(add, multiply, *, free=semiring_free): + """Create a new GrB_Semiring from a monoid and binary operator. + + ``add`` is a ``GrB_Monoid`` value and ``multiply`` is a + ``GrB_BinaryOp`` value. + + The ``free`` argument is called when the object is garbage + collected, the default is ``semiring.semiring_free()``. If ``free`` + is None then there is no automatic garbage collection and it is up + to the user to free the semiring. + + >>> s = semiring_new(lib.GrB_PLUS_MONOID_INT64, lib.GrB_TIMES_INT64) + >>> semiring_multiply(s) == lib.GrB_TIMES_INT64 + True + + """ + s = ffi.new("GrB_Semiring*") + check_status(s, lib.GrB_Semiring_new(s, add, multiply)) + if free: + return ffi.gc(s, free) + return s + + +# --------------------------------------------------------------------------- +# Wait +# --------------------------------------------------------------------------- + + +def semiring_wait(s, waitmode=lib.GrB_COMPLETE): + """Wait for a semiring to complete pending operations. + + >>> s = ffi.new("GrB_Semiring*", lib.GrB_PLUS_TIMES_SEMIRING_INT64) + >>> semiring_wait(s) + + """ + check_status(s, lib.GrB_Semiring_wait(s[0], waitmode)) + + +# --------------------------------------------------------------------------- +# Print +# --------------------------------------------------------------------------- + + +def semiring_print(s, name="", level=lib.GxB_COMPLETE): + """Print a semiring to stdout. + + ``level`` controls verbosity: ``lib.GxB_SILENT``, ``lib.GxB_SUMMARY``, + ``lib.GxB_SHORT``, ``lib.GxB_COMPLETE``, ``lib.GxB_SHORT_VERBOSE``, + or ``lib.GxB_COMPLETE_VERBOSE``. + + >>> s = ffi.new("GrB_Semiring*", lib.GrB_PLUS_TIMES_SEMIRING_INT64) + >>> out = _capture_c_output(semiring_print, s, 's', lib.GxB_SHORT) + >>> 'Semiring' in out + True + + """ + check_status(s, lib.GxB_Semiring_fprint( + s[0], name.encode() if isinstance(name, str) else name, + level, ffi.NULL, + )) + + +def semiring_fprint(s, f, name="", level=lib.GxB_COMPLETE): + """Print a semiring to a C FILE* stream. + + Pass ``ffi.NULL`` for ``f`` to print to stdout. + ``level`` controls verbosity (see :func:`semiring_print`). + + >>> s = ffi.new("GrB_Semiring*", lib.GrB_PLUS_TIMES_SEMIRING_INT64) + >>> out = _capture_c_output(semiring_fprint, s, ffi.NULL, 's', lib.GxB_SHORT) + >>> 'Semiring' in out + True + + """ + check_status(s, lib.GxB_Semiring_fprint( + s[0], name.encode() if isinstance(name, str) else name, + level, f, + )) + + +# --------------------------------------------------------------------------- +# Option get/set (typed) +# --------------------------------------------------------------------------- + + +def semiring_get_int32(s, field): + """Get a semiring option as an int32. + + >>> s = ffi.new("GrB_Semiring*", lib.GrB_PLUS_TIMES_SEMIRING_INT64) + >>> semiring_get_int32(s, lib.GrB_INP0_TYPE_CODE) >= 0 + True + + """ + val = ffi.new("int32_t*") + check_status(s, lib.GrB_Semiring_get_INT32(s[0], val, field)) + return val[0] + + +def semiring_set_int32(s, field, value): + """Set a semiring option from an int32. + + """ + check_status(s, lib.GrB_Semiring_set_INT32(s[0], ffi.cast("int32_t", value), field)) + + +def semiring_get_size(s, field): + """Get a semiring option as a size_t. + + >>> s = ffi.new("GrB_Semiring*", lib.GrB_PLUS_TIMES_SEMIRING_INT64) + >>> semiring_get_size(s, lib.GrB_NAME) >= 0 + True + + """ + val = ffi.new("size_t*") + check_status(s, lib.GrB_Semiring_get_SIZE(s[0], val, field)) + return val[0] + + +def semiring_get_string(s, field): + """Get a semiring option as a string. + + >>> s = ffi.new("GrB_Semiring*", lib.GrB_PLUS_TIMES_SEMIRING_INT64) + >>> isinstance(semiring_get_string(s, lib.GrB_NAME), str) + True + + """ + val = ffi.new("char[256]") + check_status(s, lib.GrB_Semiring_get_String(s[0], val, field)) + return ffi.string(val).decode() + + +def semiring_set_string(s, field, value): + """Set a semiring option from a string. + + """ + check_status(s, lib.GrB_Semiring_set_String(s[0], value.encode(), field)) + + +# --------------------------------------------------------------------------- +# Accessors +# --------------------------------------------------------------------------- + + +def semiring_add(s): + """Return the additive monoid of a semiring. + + >>> s = ffi.new("GrB_Semiring*", lib.GrB_PLUS_TIMES_SEMIRING_INT64) + >>> semiring_add(s) == lib.GrB_PLUS_MONOID_INT64 + True + + """ + m = ffi.new("GrB_Monoid*") + check_status(s, lib.GxB_Semiring_add(m, s[0])) + return m[0] + + +def semiring_multiply(s): + """Return the multiply binary operator of a semiring. + + >>> s = ffi.new("GrB_Semiring*", lib.GrB_PLUS_TIMES_SEMIRING_INT64) + >>> semiring_multiply(s) == lib.GrB_TIMES_INT64 + True + + """ + op = ffi.new("GrB_BinaryOp*") + check_status(s, lib.GxB_Semiring_multiply(op, s[0])) + return op[0] diff --git a/suitesparse_graphblas/api/unaryop.py b/suitesparse_graphblas/api/unaryop.py new file mode 100644 index 0000000..e16dd21 --- /dev/null +++ b/suitesparse_graphblas/api/unaryop.py @@ -0,0 +1,228 @@ +from suitesparse_graphblas import check_status, ffi, lib + +from .utils import _capture_c_output # noqa: F401 + + +def unaryop_free(op): + """Free a unary operator. + + >>> op = ffi.new("GrB_UnaryOp*", lib.GrB_AINV_INT64) + >>> unaryop_free(op) + + """ + check_status(op, lib.GrB_UnaryOp_free(op)) + + +def unaryop_new(function, ztype, xtype, *, free=unaryop_free): + """Create a new GrB_UnaryOp from a C function pointer. + + ``function`` must be a CFFI callback compatible with + ``GxB_unary_function``. + + The ``free`` argument is called when the object is garbage + collected, the default is ``unaryop.unaryop_free()``. If ``free`` + is None then there is no automatic garbage collection and it is up + to the user to free the operator. + """ + op = ffi.new("GrB_UnaryOp*") + check_status(op, lib.GrB_UnaryOp_new(op, function, ztype, xtype)) + if free: + return ffi.gc(op, free) + return op + + +def unaryop_new_named(function, ztype, xtype, name, defn, *, free=unaryop_free): + """Create a new named GrB_UnaryOp (GxB extension). + + ``function`` must be a CFFI callback compatible with + ``GxB_unary_function``. ``name`` and ``defn`` are C strings + describing the operator for JIT compilation. + + The ``free`` argument is called when the object is garbage + collected, the default is ``unaryop.unaryop_free()``. If ``free`` + is None then there is no automatic garbage collection and it is up + to the user to free the operator. + """ + op = ffi.new("GrB_UnaryOp*") + check_status( + op, + lib.GxB_UnaryOp_new( + op, + function, + ztype, + xtype, + name.encode() if isinstance(name, str) else name, + defn.encode() if isinstance(defn, str) else defn, + ), + ) + if free: + return ffi.gc(op, free) + return op + + +def unaryop_wait(op, waitmode=lib.GrB_COMPLETE): + """Wait for a unary operator to complete pending operations. + + >>> op = ffi.new("GrB_UnaryOp*", lib.GrB_AINV_INT64) + >>> unaryop_wait(op) + + """ + check_status(op, lib.GrB_UnaryOp_wait(op[0], waitmode)) + + +# --------------------------------------------------------------------------- +# Print +# --------------------------------------------------------------------------- + + +def unaryop_print(op, name="", level=lib.GxB_COMPLETE): + """Print a unary operator to stdout. + + ``level`` controls verbosity: ``lib.GxB_SILENT``, ``lib.GxB_SUMMARY``, + ``lib.GxB_SHORT``, ``lib.GxB_COMPLETE``, ``lib.GxB_SHORT_VERBOSE``, + or ``lib.GxB_COMPLETE_VERBOSE``. + + >>> op = ffi.new("GrB_UnaryOp*", lib.GrB_AINV_INT64) + >>> out = _capture_c_output(unaryop_print, op, 'op', lib.GxB_SHORT) + >>> 'ainv' in out.lower() + True + + """ + check_status(op, lib.GxB_UnaryOp_fprint( + op[0], name.encode() if isinstance(name, str) else name, + level, ffi.NULL, + )) + + +def unaryop_fprint(op, f, name="", level=lib.GxB_COMPLETE): + """Print a unary operator to a C FILE* stream. + + Pass ``ffi.NULL`` for ``f`` to print to stdout. + ``level`` controls verbosity (see :func:`unaryop_print`). + + >>> op = ffi.new("GrB_UnaryOp*", lib.GrB_AINV_INT64) + >>> out = _capture_c_output(unaryop_fprint, op, ffi.NULL, 'op', lib.GxB_SHORT) + >>> 'ainv' in out.lower() + True + + """ + check_status(op, lib.GxB_UnaryOp_fprint( + op[0], name.encode() if isinstance(name, str) else name, + level, f, + )) + + +# --------------------------------------------------------------------------- +# Option get/set (typed) +# --------------------------------------------------------------------------- + + +def unaryop_get_int32(op, field): + """Get an operator option as an int32. + + >>> op = ffi.new("GrB_UnaryOp*", lib.GrB_AINV_INT64) + >>> unaryop_get_int32(op, lib.GrB_OUTP_TYPE_CODE) >= 0 + True + + """ + val = ffi.new("int32_t*") + check_status(op, lib.GrB_UnaryOp_get_INT32(op[0], val, field)) + return val[0] + + +def unaryop_set_int32(op, field, value): + """Set an operator option from an int32.""" + check_status(op, lib.GrB_UnaryOp_set_INT32(op[0], ffi.cast("int32_t", value), field)) + + +def unaryop_get_size(op, field): + """Get an operator option as a size_t. + + >>> op = ffi.new("GrB_UnaryOp*", lib.GrB_AINV_INT64) + >>> unaryop_get_size(op, lib.GrB_NAME) > 0 + True + + """ + val = ffi.new("size_t*") + check_status(op, lib.GrB_UnaryOp_get_SIZE(op[0], val, field)) + return val[0] + + +def unaryop_get_string(op, field): + """Get an operator option as a string. + + >>> op = ffi.new("GrB_UnaryOp*", lib.GrB_AINV_INT64) + >>> 'ainv' in unaryop_get_string(op, lib.GrB_NAME).lower() + True + + """ + val = ffi.new("char[256]") + check_status(op, lib.GrB_UnaryOp_get_String(op[0], val, field)) + return ffi.string(val).decode() + + +def unaryop_set_string(op, field, value): + """Set an operator option from a string.""" + check_status( + op, + lib.GrB_UnaryOp_set_String( + op[0], value.encode() if isinstance(value, str) else value, field + ), + ) + + +# --------------------------------------------------------------------------- +# Type queries +# --------------------------------------------------------------------------- + + +def unaryop_xtype(op): + """Return the input (x) type of a unary operator. + + >>> op = ffi.new("GrB_UnaryOp*", lib.GrB_AINV_INT64) + >>> unaryop_xtype(op) == lib.GrB_INT64 + True + + """ + T = ffi.new("GrB_Type*") + check_status(op, lib.GxB_UnaryOp_xtype(T, op[0])) + return T[0] + + +def unaryop_ztype(op): + """Return the output (z) type of a unary operator. + + >>> op = ffi.new("GrB_UnaryOp*", lib.GrB_AINV_INT64) + >>> unaryop_ztype(op) == lib.GrB_INT64 + True + + """ + T = ffi.new("GrB_Type*") + check_status(op, lib.GxB_UnaryOp_ztype(T, op[0])) + return T[0] + + +def unaryop_xtype_name(op): + """Return the input (x) type name of a unary operator as a string. + + >>> op = ffi.new("GrB_UnaryOp*", lib.GrB_AINV_INT64) + >>> unaryop_xtype_name(op) + 'int64_t' + + """ + name = ffi.new("char[256]") + check_status(op, lib.GxB_UnaryOp_xtype_name(name, op[0])) + return ffi.string(name).decode() + + +def unaryop_ztype_name(op): + """Return the output (z) type name of a unary operator as a string. + + >>> op = ffi.new("GrB_UnaryOp*", lib.GrB_AINV_INT64) + >>> unaryop_ztype_name(op) + 'int64_t' + + """ + name = ffi.new("char[256]") + check_status(op, lib.GxB_UnaryOp_ztype_name(name, op[0])) + return ffi.string(name).decode() diff --git a/suitesparse_graphblas/api/utils.py b/suitesparse_graphblas/api/utils.py new file mode 100644 index 0000000..df5d3eb --- /dev/null +++ b/suitesparse_graphblas/api/utils.py @@ -0,0 +1,16 @@ +import os +import sys + + +def _capture_c_output(fn, *args): + """Capture C-level stdout output from a function call.""" + sys.stdout.flush() + r, w = os.pipe() + old = os.dup(1) + os.dup2(w, 1) + fn(*args) + os.dup2(old, 1) + os.close(w) + out = os.read(r, 100000).decode() + os.close(r) + return out diff --git a/suitesparse_graphblas/vector.py b/suitesparse_graphblas/api/vector.py similarity index 99% rename from suitesparse_graphblas/vector.py rename to suitesparse_graphblas/api/vector.py index d8cb695..3ecdcbf 100644 --- a/suitesparse_graphblas/vector.py +++ b/suitesparse_graphblas/api/vector.py @@ -1,23 +1,8 @@ -import os -import sys - import numpy as np from suitesparse_graphblas import check_status, ffi, lib, supports_complex - -def _capture_c_output(fn, *args): - """Capture C-level stdout output from a function call.""" - sys.stdout.flush() - r, w = os.pipe() - old = os.dup(1) - os.dup2(w, 1) - fn(*args) - os.dup2(old, 1) - os.close(w) - out = os.read(r, 100000).decode() - os.close(r) - return out +from .utils import _capture_c_output # noqa: F401 from .io.serialize import deserialize_vector as deserialize # noqa: F401 from .io.serialize import serialize_vector as serialize # noqa: F401 diff --git a/suitesparse_graphblas/tests/conftest.py b/suitesparse_graphblas/conftest.py similarity index 100% rename from suitesparse_graphblas/tests/conftest.py rename to suitesparse_graphblas/conftest.py diff --git a/suitesparse_graphblas/io/__init__.py b/suitesparse_graphblas/io/__init__.py index e69de29..b2d6f38 100644 --- a/suitesparse_graphblas/io/__init__.py +++ b/suitesparse_graphblas/io/__init__.py @@ -0,0 +1 @@ +from suitesparse_graphblas.api.io import binary, serialize # noqa: F401 diff --git a/suitesparse_graphblas/tests/test_doctest.py b/suitesparse_graphblas/tests/test_doctest.py index 9253f12..58adaf3 100644 --- a/suitesparse_graphblas/tests/test_doctest.py +++ b/suitesparse_graphblas/tests/test_doctest.py @@ -1,12 +1,43 @@ def test_run_doctests(): import doctest - from suitesparse_graphblas import iterator, matrix, scalar, vector + from suitesparse_graphblas.api import ( + binaryop, + container, + context, + descriptor, + global_, + global_options, + grb_type, + indexbinaryop, + indexunaryop, + iterator, + matrix, + monoid, + scalar, + selectop, + semiring, + unaryop, + vector, + ) for mod in ( matrix, vector, scalar, iterator, + context, + global_options, + grb_type, + unaryop, + binaryop, + indexunaryop, + indexbinaryop, + monoid, + semiring, + descriptor, + selectop, + container, + global_, ): doctest.testmod(mod, optionflags=doctest.ELLIPSIS, raise_on_error=True) From 72f92d3b2b9e6733952f0531bc2137d805192d4c Mon Sep 17 00:00:00 2001 From: Michel Pelletier Date: Fri, 10 Apr 2026 14:27:51 -0700 Subject: [PATCH 176/193] Add mkdocs site with API reference and GitHub Pages deployment Set up mkdocs-material with mkdocstrings to auto-generate API docs from docstrings across all 18 api modules. Add GitHub Actions workflow to build and deploy to GitHub Pages on push to main. --- .github/workflows/docs.yml | 20 ++++++++++++ docs/api/binaryop.md | 3 ++ docs/api/container.md | 3 ++ docs/api/context.md | 3 ++ docs/api/descriptor.md | 3 ++ docs/api/global_.md | 3 ++ docs/api/global_options.md | 3 ++ docs/api/grb_type.md | 3 ++ docs/api/indexbinaryop.md | 3 ++ docs/api/indexunaryop.md | 3 ++ docs/api/io.md | 9 ++++++ docs/api/iterator.md | 3 ++ docs/api/matrix.md | 3 ++ docs/api/monoid.md | 3 ++ docs/api/scalar.md | 3 ++ docs/api/selectop.md | 3 ++ docs/api/semiring.md | 3 ++ docs/api/unaryop.md | 3 ++ docs/api/vector.md | 3 ++ docs/index.md | 65 ++++++++++++++++++++++++++++++++++++++ mkdocs.yml | 55 ++++++++++++++++++++++++++++++++ pyproject.toml | 4 +++ 22 files changed, 204 insertions(+) create mode 100644 .github/workflows/docs.yml create mode 100644 docs/api/binaryop.md create mode 100644 docs/api/container.md create mode 100644 docs/api/context.md create mode 100644 docs/api/descriptor.md create mode 100644 docs/api/global_.md create mode 100644 docs/api/global_options.md create mode 100644 docs/api/grb_type.md create mode 100644 docs/api/indexbinaryop.md create mode 100644 docs/api/indexunaryop.md create mode 100644 docs/api/io.md create mode 100644 docs/api/iterator.md create mode 100644 docs/api/matrix.md create mode 100644 docs/api/monoid.md create mode 100644 docs/api/scalar.md create mode 100644 docs/api/selectop.md create mode 100644 docs/api/semiring.md create mode 100644 docs/api/unaryop.md create mode 100644 docs/api/vector.md create mode 100644 docs/index.md create mode 100644 mkdocs.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..fe0485b --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,20 @@ +name: docs + +on: + push: + branches: [main] + workflow_dispatch: + +permissions: + contents: write + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + - run: pip install mkdocs-material "mkdocstrings[python]" + - run: mkdocs gh-deploy --force diff --git a/docs/api/binaryop.md b/docs/api/binaryop.md new file mode 100644 index 0000000..583e954 --- /dev/null +++ b/docs/api/binaryop.md @@ -0,0 +1,3 @@ +# BinaryOp + +::: suitesparse_graphblas.api.binaryop diff --git a/docs/api/container.md b/docs/api/container.md new file mode 100644 index 0000000..de2ceb9 --- /dev/null +++ b/docs/api/container.md @@ -0,0 +1,3 @@ +# Container + +::: suitesparse_graphblas.api.container diff --git a/docs/api/context.md b/docs/api/context.md new file mode 100644 index 0000000..aa5f1cf --- /dev/null +++ b/docs/api/context.md @@ -0,0 +1,3 @@ +# Context + +::: suitesparse_graphblas.api.context diff --git a/docs/api/descriptor.md b/docs/api/descriptor.md new file mode 100644 index 0000000..0907cf6 --- /dev/null +++ b/docs/api/descriptor.md @@ -0,0 +1,3 @@ +# Descriptor + +::: suitesparse_graphblas.api.descriptor diff --git a/docs/api/global_.md b/docs/api/global_.md new file mode 100644 index 0000000..bf4ef8d --- /dev/null +++ b/docs/api/global_.md @@ -0,0 +1,3 @@ +# Global + +::: suitesparse_graphblas.api.global_ diff --git a/docs/api/global_options.md b/docs/api/global_options.md new file mode 100644 index 0000000..81cae7f --- /dev/null +++ b/docs/api/global_options.md @@ -0,0 +1,3 @@ +# Global Options + +::: suitesparse_graphblas.api.global_options diff --git a/docs/api/grb_type.md b/docs/api/grb_type.md new file mode 100644 index 0000000..d09d3ec --- /dev/null +++ b/docs/api/grb_type.md @@ -0,0 +1,3 @@ +# Type + +::: suitesparse_graphblas.api.grb_type diff --git a/docs/api/indexbinaryop.md b/docs/api/indexbinaryop.md new file mode 100644 index 0000000..d20161a --- /dev/null +++ b/docs/api/indexbinaryop.md @@ -0,0 +1,3 @@ +# IndexBinaryOp + +::: suitesparse_graphblas.api.indexbinaryop diff --git a/docs/api/indexunaryop.md b/docs/api/indexunaryop.md new file mode 100644 index 0000000..e0c08ad --- /dev/null +++ b/docs/api/indexunaryop.md @@ -0,0 +1,3 @@ +# IndexUnaryOp + +::: suitesparse_graphblas.api.indexunaryop diff --git a/docs/api/io.md b/docs/api/io.md new file mode 100644 index 0000000..5a4dbf7 --- /dev/null +++ b/docs/api/io.md @@ -0,0 +1,9 @@ +# IO + +## Serialization + +::: suitesparse_graphblas.api.io.serialize + +## Binary Format + +::: suitesparse_graphblas.api.io.binary diff --git a/docs/api/iterator.md b/docs/api/iterator.md new file mode 100644 index 0000000..3cf6f88 --- /dev/null +++ b/docs/api/iterator.md @@ -0,0 +1,3 @@ +# Iterator + +::: suitesparse_graphblas.api.iterator diff --git a/docs/api/matrix.md b/docs/api/matrix.md new file mode 100644 index 0000000..e50eecc --- /dev/null +++ b/docs/api/matrix.md @@ -0,0 +1,3 @@ +# Matrix + +::: suitesparse_graphblas.api.matrix diff --git a/docs/api/monoid.md b/docs/api/monoid.md new file mode 100644 index 0000000..063932f --- /dev/null +++ b/docs/api/monoid.md @@ -0,0 +1,3 @@ +# Monoid + +::: suitesparse_graphblas.api.monoid diff --git a/docs/api/scalar.md b/docs/api/scalar.md new file mode 100644 index 0000000..9c9b2fc --- /dev/null +++ b/docs/api/scalar.md @@ -0,0 +1,3 @@ +# Scalar + +::: suitesparse_graphblas.api.scalar diff --git a/docs/api/selectop.md b/docs/api/selectop.md new file mode 100644 index 0000000..9466bf3 --- /dev/null +++ b/docs/api/selectop.md @@ -0,0 +1,3 @@ +# SelectOp + +::: suitesparse_graphblas.api.selectop diff --git a/docs/api/semiring.md b/docs/api/semiring.md new file mode 100644 index 0000000..9196eeb --- /dev/null +++ b/docs/api/semiring.md @@ -0,0 +1,3 @@ +# Semiring + +::: suitesparse_graphblas.api.semiring diff --git a/docs/api/unaryop.md b/docs/api/unaryop.md new file mode 100644 index 0000000..2bce041 --- /dev/null +++ b/docs/api/unaryop.md @@ -0,0 +1,3 @@ +# UnaryOp + +::: suitesparse_graphblas.api.unaryop diff --git a/docs/api/vector.md b/docs/api/vector.md new file mode 100644 index 0000000..433a2f9 --- /dev/null +++ b/docs/api/vector.md @@ -0,0 +1,3 @@ +# Vector + +::: suitesparse_graphblas.api.vector diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..bbd11b3 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,65 @@ +# suitesparse-graphblas + +Low-level Python CFFI bindings for [SuiteSparse:GraphBLAS](https://github.com/DrTimothyAldenDavis/GraphBLAS). + +## Overview + +`suitesparse-graphblas` exposes the raw `ffi` and `lib` symbols from the +SuiteSparse:GraphBLAS C library and provides a **functional API** in the +`suitesparse_graphblas.api` subpackage. The functional API consists of +module-level functions operating on opaque CFFI handles for each GraphBLAS type. + +## Quick Start + +```python +from suitesparse_graphblas import initialize, lib +from suitesparse_graphblas.api import matrix + +initialize() + +# Create a 3x3 boolean matrix +A = matrix.matrix_new(lib.GrB_BOOL, 3, 3) +matrix.set_bool(A, True, 0, 1) +matrix.set_bool(A, True, 1, 2) + +print(matrix.matrix_nvals(A)) # 2 +print(matrix.matrix_shape(A)) # (3, 3) +``` + +## API Modules + +The functional API covers all GraphBLAS types: + +| Module | Type | Description | +|--------|------|-------------| +| [matrix](api/matrix.md) | GrB_Matrix | Sparse matrix operations | +| [vector](api/vector.md) | GrB_Vector | Sparse vector operations | +| [scalar](api/scalar.md) | GxB_Scalar | Scalar values | +| [iterator](api/iterator.md) | GxB_Iterator | Matrix/vector iteration | +| [context](api/context.md) | GxB_Context | Thread configuration | +| [grb_type](api/grb_type.md) | GrB_Type | Type definitions | +| [unaryop](api/unaryop.md) | GrB_UnaryOp | Unary operators | +| [binaryop](api/binaryop.md) | GrB_BinaryOp | Binary operators | +| [indexunaryop](api/indexunaryop.md) | GrB_IndexUnaryOp | Index unary operators | +| [indexbinaryop](api/indexbinaryop.md) | GxB_IndexBinaryOp | Index binary operators | +| [monoid](api/monoid.md) | GrB_Monoid | Monoids | +| [semiring](api/semiring.md) | GrB_Semiring | Semirings | +| [descriptor](api/descriptor.md) | GrB_Descriptor | Operation descriptors | +| [selectop](api/selectop.md) | GxB_SelectOp | Select operators (deprecated) | +| [container](api/container.md) | GxB_Container | Containers | +| [global_options](api/global_options.md) | — | Global option get/set (GxB) | +| [global_](api/global_.md) | GrB_Global | Global get/set (GrB 2.1) | +| [io](api/io.md) | — | Serialization and binary I/O | + +## Installation + +```bash +pip install suitesparse-graphblas +``` + +Or from source with a local GraphBLAS build: + +```bash +export GraphBLAS_ROOT="/path/to/graphblas" +pip install -e . --no-deps +``` diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000..2e06ccd --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,55 @@ +site_name: suitesparse-graphblas +site_url: https://michelp.github.io/python-suitesparse-graphblas/ +repo_url: https://github.com/michelp/python-suitesparse-graphblas + +theme: + name: material + palette: + - scheme: default + primary: indigo + toggle: + icon: material/brightness-7 + name: Switch to dark mode + - scheme: slate + primary: indigo + toggle: + icon: material/brightness-4 + name: Switch to light mode + +plugins: + - search + - mkdocstrings: + handlers: + python: + paths: [.] + options: + allow_inspection: false + show_source: false + docstring_style: numpy + show_docstring_examples: true + members_order: source + show_root_heading: true + show_root_full_path: false + heading_level: 2 + +nav: + - Home: index.md + - API Reference: + - Matrix: api/matrix.md + - Vector: api/vector.md + - Scalar: api/scalar.md + - Iterator: api/iterator.md + - Context: api/context.md + - Type: api/grb_type.md + - UnaryOp: api/unaryop.md + - BinaryOp: api/binaryop.md + - IndexUnaryOp: api/indexunaryop.md + - IndexBinaryOp: api/indexbinaryop.md + - Monoid: api/monoid.md + - Semiring: api/semiring.md + - Descriptor: api/descriptor.md + - SelectOp: api/selectop.md + - Container: api/container.md + - Global Options: api/global_options.md + - Global: api/global_.md + - IO: api/io.md diff --git a/pyproject.toml b/pyproject.toml index fb4824a..f078b0e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -79,6 +79,10 @@ changelog = "https://github.com/GraphBLAS/python-suitesparse-graphblas/releases" test = [ "pytest", ] +docs = [ + "mkdocs-material", + "mkdocstrings[python]", +] [tool.setuptools] packages = [ From a0a1551594d7c0855d2af0b8ba8b56370b3fe2f6 Mon Sep 17 00:00:00 2001 From: Michel Pelletier Date: Fri, 10 Apr 2026 17:02:45 -0700 Subject: [PATCH 177/193] Switch docs from mkdocs to pdoc for proper doctest rendering mkdocstrings rendered doctest blocks as inline text. pdoc natively renders >>> blocks as syntax-highlighted code. Docs are now generated inside the Docker container via pdoc and deployed to GitHub Pages. --- .github/workflows/docs.yml | 40 +++++++++++++++++++---- docs/api/binaryop.md | 3 -- docs/api/container.md | 3 -- docs/api/context.md | 3 -- docs/api/descriptor.md | 3 -- docs/api/global_.md | 3 -- docs/api/global_options.md | 3 -- docs/api/grb_type.md | 3 -- docs/api/indexbinaryop.md | 3 -- docs/api/indexunaryop.md | 3 -- docs/api/io.md | 9 ------ docs/api/iterator.md | 3 -- docs/api/matrix.md | 3 -- docs/api/monoid.md | 3 -- docs/api/scalar.md | 3 -- docs/api/selectop.md | 3 -- docs/api/semiring.md | 3 -- docs/api/unaryop.md | 3 -- docs/api/vector.md | 3 -- docs/index.md | 65 -------------------------------------- mkdocs.yml | 55 -------------------------------- pyproject.toml | 3 +- 22 files changed, 35 insertions(+), 188 deletions(-) delete mode 100644 docs/api/binaryop.md delete mode 100644 docs/api/container.md delete mode 100644 docs/api/context.md delete mode 100644 docs/api/descriptor.md delete mode 100644 docs/api/global_.md delete mode 100644 docs/api/global_options.md delete mode 100644 docs/api/grb_type.md delete mode 100644 docs/api/indexbinaryop.md delete mode 100644 docs/api/indexunaryop.md delete mode 100644 docs/api/io.md delete mode 100644 docs/api/iterator.md delete mode 100644 docs/api/matrix.md delete mode 100644 docs/api/monoid.md delete mode 100644 docs/api/scalar.md delete mode 100644 docs/api/selectop.md delete mode 100644 docs/api/semiring.md delete mode 100644 docs/api/unaryop.md delete mode 100644 docs/api/vector.md delete mode 100644 docs/index.md delete mode 100644 mkdocs.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index fe0485b..a8fc770 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -6,15 +6,43 @@ on: workflow_dispatch: permissions: - contents: write + pages: write + id-token: write + +concurrency: + group: pages + cancel-in-progress: false jobs: - deploy: + build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + + - name: Build package in Docker + run: | + docker build --target psg \ + --build-arg SUITESPARSE=v$(cat GB_VERSION.txt) \ + --build-arg VERSION=99.0.0.0 \ + -t psg-docs . + + - name: Generate docs with pdoc + run: | + docker run --rm -v ${{ github.workspace }}/site:/out psg-docs \ + bash -c "pip install --break-system-packages -q pdoc && \ + pdoc --output-directory /out --no-show-source --docformat numpy \ + suitesparse_graphblas.api" + + - uses: actions/upload-pages-artifact@v3 with: - python-version: '3.12' - - run: pip install mkdocs-material "mkdocstrings[python]" - - run: mkdocs gh-deploy --force + path: site/ + + deploy: + needs: build + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - uses: actions/deploy-pages@v4 + id: deployment diff --git a/docs/api/binaryop.md b/docs/api/binaryop.md deleted file mode 100644 index 583e954..0000000 --- a/docs/api/binaryop.md +++ /dev/null @@ -1,3 +0,0 @@ -# BinaryOp - -::: suitesparse_graphblas.api.binaryop diff --git a/docs/api/container.md b/docs/api/container.md deleted file mode 100644 index de2ceb9..0000000 --- a/docs/api/container.md +++ /dev/null @@ -1,3 +0,0 @@ -# Container - -::: suitesparse_graphblas.api.container diff --git a/docs/api/context.md b/docs/api/context.md deleted file mode 100644 index aa5f1cf..0000000 --- a/docs/api/context.md +++ /dev/null @@ -1,3 +0,0 @@ -# Context - -::: suitesparse_graphblas.api.context diff --git a/docs/api/descriptor.md b/docs/api/descriptor.md deleted file mode 100644 index 0907cf6..0000000 --- a/docs/api/descriptor.md +++ /dev/null @@ -1,3 +0,0 @@ -# Descriptor - -::: suitesparse_graphblas.api.descriptor diff --git a/docs/api/global_.md b/docs/api/global_.md deleted file mode 100644 index bf4ef8d..0000000 --- a/docs/api/global_.md +++ /dev/null @@ -1,3 +0,0 @@ -# Global - -::: suitesparse_graphblas.api.global_ diff --git a/docs/api/global_options.md b/docs/api/global_options.md deleted file mode 100644 index 81cae7f..0000000 --- a/docs/api/global_options.md +++ /dev/null @@ -1,3 +0,0 @@ -# Global Options - -::: suitesparse_graphblas.api.global_options diff --git a/docs/api/grb_type.md b/docs/api/grb_type.md deleted file mode 100644 index d09d3ec..0000000 --- a/docs/api/grb_type.md +++ /dev/null @@ -1,3 +0,0 @@ -# Type - -::: suitesparse_graphblas.api.grb_type diff --git a/docs/api/indexbinaryop.md b/docs/api/indexbinaryop.md deleted file mode 100644 index d20161a..0000000 --- a/docs/api/indexbinaryop.md +++ /dev/null @@ -1,3 +0,0 @@ -# IndexBinaryOp - -::: suitesparse_graphblas.api.indexbinaryop diff --git a/docs/api/indexunaryop.md b/docs/api/indexunaryop.md deleted file mode 100644 index e0c08ad..0000000 --- a/docs/api/indexunaryop.md +++ /dev/null @@ -1,3 +0,0 @@ -# IndexUnaryOp - -::: suitesparse_graphblas.api.indexunaryop diff --git a/docs/api/io.md b/docs/api/io.md deleted file mode 100644 index 5a4dbf7..0000000 --- a/docs/api/io.md +++ /dev/null @@ -1,9 +0,0 @@ -# IO - -## Serialization - -::: suitesparse_graphblas.api.io.serialize - -## Binary Format - -::: suitesparse_graphblas.api.io.binary diff --git a/docs/api/iterator.md b/docs/api/iterator.md deleted file mode 100644 index 3cf6f88..0000000 --- a/docs/api/iterator.md +++ /dev/null @@ -1,3 +0,0 @@ -# Iterator - -::: suitesparse_graphblas.api.iterator diff --git a/docs/api/matrix.md b/docs/api/matrix.md deleted file mode 100644 index e50eecc..0000000 --- a/docs/api/matrix.md +++ /dev/null @@ -1,3 +0,0 @@ -# Matrix - -::: suitesparse_graphblas.api.matrix diff --git a/docs/api/monoid.md b/docs/api/monoid.md deleted file mode 100644 index 063932f..0000000 --- a/docs/api/monoid.md +++ /dev/null @@ -1,3 +0,0 @@ -# Monoid - -::: suitesparse_graphblas.api.monoid diff --git a/docs/api/scalar.md b/docs/api/scalar.md deleted file mode 100644 index 9c9b2fc..0000000 --- a/docs/api/scalar.md +++ /dev/null @@ -1,3 +0,0 @@ -# Scalar - -::: suitesparse_graphblas.api.scalar diff --git a/docs/api/selectop.md b/docs/api/selectop.md deleted file mode 100644 index 9466bf3..0000000 --- a/docs/api/selectop.md +++ /dev/null @@ -1,3 +0,0 @@ -# SelectOp - -::: suitesparse_graphblas.api.selectop diff --git a/docs/api/semiring.md b/docs/api/semiring.md deleted file mode 100644 index 9196eeb..0000000 --- a/docs/api/semiring.md +++ /dev/null @@ -1,3 +0,0 @@ -# Semiring - -::: suitesparse_graphblas.api.semiring diff --git a/docs/api/unaryop.md b/docs/api/unaryop.md deleted file mode 100644 index 2bce041..0000000 --- a/docs/api/unaryop.md +++ /dev/null @@ -1,3 +0,0 @@ -# UnaryOp - -::: suitesparse_graphblas.api.unaryop diff --git a/docs/api/vector.md b/docs/api/vector.md deleted file mode 100644 index 433a2f9..0000000 --- a/docs/api/vector.md +++ /dev/null @@ -1,3 +0,0 @@ -# Vector - -::: suitesparse_graphblas.api.vector diff --git a/docs/index.md b/docs/index.md deleted file mode 100644 index bbd11b3..0000000 --- a/docs/index.md +++ /dev/null @@ -1,65 +0,0 @@ -# suitesparse-graphblas - -Low-level Python CFFI bindings for [SuiteSparse:GraphBLAS](https://github.com/DrTimothyAldenDavis/GraphBLAS). - -## Overview - -`suitesparse-graphblas` exposes the raw `ffi` and `lib` symbols from the -SuiteSparse:GraphBLAS C library and provides a **functional API** in the -`suitesparse_graphblas.api` subpackage. The functional API consists of -module-level functions operating on opaque CFFI handles for each GraphBLAS type. - -## Quick Start - -```python -from suitesparse_graphblas import initialize, lib -from suitesparse_graphblas.api import matrix - -initialize() - -# Create a 3x3 boolean matrix -A = matrix.matrix_new(lib.GrB_BOOL, 3, 3) -matrix.set_bool(A, True, 0, 1) -matrix.set_bool(A, True, 1, 2) - -print(matrix.matrix_nvals(A)) # 2 -print(matrix.matrix_shape(A)) # (3, 3) -``` - -## API Modules - -The functional API covers all GraphBLAS types: - -| Module | Type | Description | -|--------|------|-------------| -| [matrix](api/matrix.md) | GrB_Matrix | Sparse matrix operations | -| [vector](api/vector.md) | GrB_Vector | Sparse vector operations | -| [scalar](api/scalar.md) | GxB_Scalar | Scalar values | -| [iterator](api/iterator.md) | GxB_Iterator | Matrix/vector iteration | -| [context](api/context.md) | GxB_Context | Thread configuration | -| [grb_type](api/grb_type.md) | GrB_Type | Type definitions | -| [unaryop](api/unaryop.md) | GrB_UnaryOp | Unary operators | -| [binaryop](api/binaryop.md) | GrB_BinaryOp | Binary operators | -| [indexunaryop](api/indexunaryop.md) | GrB_IndexUnaryOp | Index unary operators | -| [indexbinaryop](api/indexbinaryop.md) | GxB_IndexBinaryOp | Index binary operators | -| [monoid](api/monoid.md) | GrB_Monoid | Monoids | -| [semiring](api/semiring.md) | GrB_Semiring | Semirings | -| [descriptor](api/descriptor.md) | GrB_Descriptor | Operation descriptors | -| [selectop](api/selectop.md) | GxB_SelectOp | Select operators (deprecated) | -| [container](api/container.md) | GxB_Container | Containers | -| [global_options](api/global_options.md) | — | Global option get/set (GxB) | -| [global_](api/global_.md) | GrB_Global | Global get/set (GrB 2.1) | -| [io](api/io.md) | — | Serialization and binary I/O | - -## Installation - -```bash -pip install suitesparse-graphblas -``` - -Or from source with a local GraphBLAS build: - -```bash -export GraphBLAS_ROOT="/path/to/graphblas" -pip install -e . --no-deps -``` diff --git a/mkdocs.yml b/mkdocs.yml deleted file mode 100644 index 2e06ccd..0000000 --- a/mkdocs.yml +++ /dev/null @@ -1,55 +0,0 @@ -site_name: suitesparse-graphblas -site_url: https://michelp.github.io/python-suitesparse-graphblas/ -repo_url: https://github.com/michelp/python-suitesparse-graphblas - -theme: - name: material - palette: - - scheme: default - primary: indigo - toggle: - icon: material/brightness-7 - name: Switch to dark mode - - scheme: slate - primary: indigo - toggle: - icon: material/brightness-4 - name: Switch to light mode - -plugins: - - search - - mkdocstrings: - handlers: - python: - paths: [.] - options: - allow_inspection: false - show_source: false - docstring_style: numpy - show_docstring_examples: true - members_order: source - show_root_heading: true - show_root_full_path: false - heading_level: 2 - -nav: - - Home: index.md - - API Reference: - - Matrix: api/matrix.md - - Vector: api/vector.md - - Scalar: api/scalar.md - - Iterator: api/iterator.md - - Context: api/context.md - - Type: api/grb_type.md - - UnaryOp: api/unaryop.md - - BinaryOp: api/binaryop.md - - IndexUnaryOp: api/indexunaryop.md - - IndexBinaryOp: api/indexbinaryop.md - - Monoid: api/monoid.md - - Semiring: api/semiring.md - - Descriptor: api/descriptor.md - - SelectOp: api/selectop.md - - Container: api/container.md - - Global Options: api/global_options.md - - Global: api/global_.md - - IO: api/io.md diff --git a/pyproject.toml b/pyproject.toml index f078b0e..0d24207 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -80,8 +80,7 @@ test = [ "pytest", ] docs = [ - "mkdocs-material", - "mkdocstrings[python]", + "pdoc", ] [tool.setuptools] From 0b713dc1e7b184fff32f7a984ec8097e70e5c235 Mon Sep 17 00:00:00 2001 From: Michel Pelletier Date: Sun, 12 Apr 2026 13:55:32 -0700 Subject: [PATCH 178/193] Fix Windows test failure and speed up docs build Use ucrtbase instead of dlopen(None) for malloc on Windows, fixing cffi collection error during doctest-modules. Use COMPACT=1 for the docs Docker build to skip type specializations. --- .github/workflows/docs.yml | 1 + suitesparse_graphblas/api/io/binary.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index a8fc770..70f7bc0 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -24,6 +24,7 @@ jobs: docker build --target psg \ --build-arg SUITESPARSE=v$(cat GB_VERSION.txt) \ --build-arg VERSION=99.0.0.0 \ + --build-arg COMPACT=1 \ -t psg-docs . - name: Generate docs with pdoc diff --git a/suitesparse_graphblas/api/io/binary.py b/suitesparse_graphblas/api/io/binary.py index dafb628..4124061 100644 --- a/suitesparse_graphblas/api/io/binary.py +++ b/suitesparse_graphblas/api/io/binary.py @@ -1,3 +1,4 @@ +import sys from ctypes.util import find_library from pathlib import Path @@ -10,7 +11,10 @@ stdffi.cdef(""" void *malloc(size_t size); """) -stdlib = stdffi.dlopen(find_library("c")) +if sys.platform == "win32": + stdlib = stdffi.dlopen("ucrtbase") +else: + stdlib = stdffi.dlopen(find_library("c")) # When "packing" a matrix the owner of the memory buffer is transfered # to SuiteSparse, which then becomes responsible for freeing it. cffi From dcf83c78c2865d8c63ffb6d8358685fb4a187db3 Mon Sep 17 00:00:00 2001 From: Michel Pelletier Date: Mon, 13 Apr 2026 11:30:11 -0700 Subject: [PATCH 179/193] Add module level docstrings to api docs. --- suitesparse_graphblas/__init__.py | 2 ++ suitesparse_graphblas/api/__init__.py | 16 ++++++++++++++++ suitesparse_graphblas/api/matrix.py | 2 ++ suitesparse_graphblas/api/scalar.py | 2 ++ suitesparse_graphblas/api/vector.py | 2 ++ 5 files changed, 24 insertions(+) diff --git a/suitesparse_graphblas/__init__.py b/suitesparse_graphblas/__init__.py index 4f170b9..e2b650a 100644 --- a/suitesparse_graphblas/__init__.py +++ b/suitesparse_graphblas/__init__.py @@ -1,3 +1,5 @@ +"""Low-level Python CFFI binding for SuiteSparse:GraphBLAS.""" + import importlib.metadata import platform import struct as _struct diff --git a/suitesparse_graphblas/api/__init__.py b/suitesparse_graphblas/api/__init__.py index 680da82..397c369 100644 --- a/suitesparse_graphblas/api/__init__.py +++ b/suitesparse_graphblas/api/__init__.py @@ -1,3 +1,19 @@ +"""SuiteSparse:GraphBLAS is a full implementation of the GraphBLAS +standard, which defines a set of sparse matrix operations on an +extended algebra of semirings using an almost unlimited variety of +operators and types. When applied to sparse adjacency matrices, these +algebraic operations are equivalent to computations on graphs. +GraphBLAS provides a powerful and expressive framework for creating +high-performance graph algorithms based on the elegant mathematics of +sparse matrix operations on a semiring. + +This module contains the "functional API" for +python-suitesparse-graphblas. This is a higher level API than the +"raw" CFFI binding, but a lower level API than the algebraic +functionality provided by the +[python-graphblas](https://python-graphblas.readthedocs.io/en/stable/api_reference/index.html) +library. +""" from suitesparse_graphblas.api import ( binaryop, container, diff --git a/suitesparse_graphblas/api/matrix.py b/suitesparse_graphblas/api/matrix.py index 917f58e..47d3795 100644 --- a/suitesparse_graphblas/api/matrix.py +++ b/suitesparse_graphblas/api/matrix.py @@ -1,3 +1,5 @@ +"""Create, manipulate, and query GrB_Matrix objects.""" + import numpy as np from suitesparse_graphblas import check_status, ffi, lib, supports_complex diff --git a/suitesparse_graphblas/api/scalar.py b/suitesparse_graphblas/api/scalar.py index d4536a0..b76e7b6 100644 --- a/suitesparse_graphblas/api/scalar.py +++ b/suitesparse_graphblas/api/scalar.py @@ -1,3 +1,5 @@ +"""Create, manipulate, and query GxB_Scalar objects.""" + from suitesparse_graphblas import check_status, exceptions, ffi, lib, supports_complex from .utils import _capture_c_output # noqa: F401 diff --git a/suitesparse_graphblas/api/vector.py b/suitesparse_graphblas/api/vector.py index 3ecdcbf..b8026d8 100644 --- a/suitesparse_graphblas/api/vector.py +++ b/suitesparse_graphblas/api/vector.py @@ -1,3 +1,5 @@ +"""Create, manipulate, and query GrB_Vector objects.""" + import numpy as np from suitesparse_graphblas import check_status, ffi, lib, supports_complex From fac5ffe070953d1313d8755bbebb56bc3fe75fb9 Mon Sep 17 00:00:00 2001 From: Michel Pelletier Date: Mon, 13 Apr 2026 13:04:34 -0700 Subject: [PATCH 180/193] Add links to SuiteSparse:GraphBLAS repo and User Guide in api docstring --- suitesparse_graphblas/api/__init__.py | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/suitesparse_graphblas/api/__init__.py b/suitesparse_graphblas/api/__init__.py index 397c369..d31250f 100644 --- a/suitesparse_graphblas/api/__init__.py +++ b/suitesparse_graphblas/api/__init__.py @@ -1,11 +1,12 @@ -"""SuiteSparse:GraphBLAS is a full implementation of the GraphBLAS -standard, which defines a set of sparse matrix operations on an -extended algebra of semirings using an almost unlimited variety of -operators and types. When applied to sparse adjacency matrices, these -algebraic operations are equivalent to computations on graphs. -GraphBLAS provides a powerful and expressive framework for creating -high-performance graph algorithms based on the elegant mathematics of -sparse matrix operations on a semiring. +"""[SuiteSparse:GraphBLAS](https://github.com/DrTimothyAldenDavis/GraphBLAS) +is a full implementation of the GraphBLAS standard, which defines a +set of sparse matrix operations on an extended algebra of semirings +using an almost unlimited variety of operators and types. When applied +to sparse adjacency matrices, these algebraic operations are +equivalent to computations on graphs. GraphBLAS provides a powerful +and expressive framework for creating high-performance graph +algorithms based on the elegant mathematics of sparse matrix +operations on a semiring. This module contains the "functional API" for python-suitesparse-graphblas. This is a higher level API than the @@ -13,6 +14,11 @@ functionality provided by the [python-graphblas](https://python-graphblas.readthedocs.io/en/stable/api_reference/index.html) library. + +For documentation on the SuiteSparse implementation that describes all +of these functions in detail, read the [SuiteSparse:GraphBLAS User +Guide](https://github.com/DrTimothyAldenDavis/GraphBLAS/blob/stable/Doc/GraphBLAS_UserGuide.pdf) + """ from suitesparse_graphblas.api import ( binaryop, From 6b594179266d00250e6eaa90f496452485bf3fea Mon Sep 17 00:00:00 2001 From: Michel Pelletier Date: Mon, 13 Apr 2026 15:37:32 -0700 Subject: [PATCH 181/193] Add BFS example and fix descriptor API to use bare objects Add suitesparse_graphblas.api.examples subpackage with a BFS algorithm translated from LAGraph's vanilla push-only implementation. Remove descriptor_new/descriptor_free from the public API since descriptors are static library objects (e.g. lib.GrB_DESC_S), not user-created. Remove all desc[0] dereferencing across the API so descriptors are passed directly as bare objects. --- pyproject.toml | 1 + suitesparse_graphblas/api/descriptor.py | 73 +++----- .../api/examples/__init__.py | 7 + suitesparse_graphblas/api/examples/bfs.py | 160 ++++++++++++++++++ suitesparse_graphblas/api/io/serialize.py | 27 +-- suitesparse_graphblas/api/iterator.py | 8 +- suitesparse_graphblas/api/matrix.py | 40 ++--- suitesparse_graphblas/api/vector.py | 28 +-- 8 files changed, 239 insertions(+), 105 deletions(-) create mode 100644 suitesparse_graphblas/api/examples/__init__.py create mode 100644 suitesparse_graphblas/api/examples/bfs.py diff --git a/pyproject.toml b/pyproject.toml index 0d24207..15dee86 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -87,6 +87,7 @@ docs = [ packages = [ 'suitesparse_graphblas', 'suitesparse_graphblas.api', + 'suitesparse_graphblas.api.examples', 'suitesparse_graphblas.api.io', 'suitesparse_graphblas.tests', 'suitesparse_graphblas.io', diff --git a/suitesparse_graphblas/api/descriptor.py b/suitesparse_graphblas/api/descriptor.py index 7ac200b..7fde590 100644 --- a/suitesparse_graphblas/api/descriptor.py +++ b/suitesparse_graphblas/api/descriptor.py @@ -3,42 +3,13 @@ from .utils import _capture_c_output # noqa: F401 -def descriptor_free(desc): - """Free a descriptor. - - >>> desc = descriptor_new() - >>> descriptor_free(desc) - - """ - check_status(desc, lib.GrB_Descriptor_free(desc)) - - -def descriptor_new(*, free=descriptor_free): - """Create a new ``GrB_Descriptor`` and initialize it. - - The ``free`` argument is called when the object is garbage - collected, the default is ``descriptor.descriptor_free()``. If ``free`` - is None then there is no automatic garbage collection and it is up - to the user to free the descriptor. - - >>> desc = descriptor_new() - - """ - desc = ffi.new("GrB_Descriptor*") - check_status(desc, lib.GrB_Descriptor_new(desc)) - if free: - return ffi.gc(desc, free) - return desc - - def descriptor_wait(desc, waitmode=lib.GrB_COMPLETE): """Wait for a descriptor to complete pending operations. - >>> desc = descriptor_new() - >>> descriptor_wait(desc) + >>> descriptor_wait(lib.GrB_DESC_S) """ - check_status(desc, lib.GrB_Descriptor_wait(desc[0], waitmode)) + check_status(desc, lib.GrB_Descriptor_wait(desc, waitmode)) def descriptor_print(desc, name="", level=lib.GxB_COMPLETE): @@ -48,14 +19,13 @@ def descriptor_print(desc, name="", level=lib.GxB_COMPLETE): ``lib.GxB_SHORT``, ``lib.GxB_COMPLETE``, ``lib.GxB_SHORT_VERBOSE``, or ``lib.GxB_COMPLETE_VERBOSE``. - >>> desc = descriptor_new() - >>> out = _capture_c_output(descriptor_print, desc, 'desc', lib.GxB_SHORT) + >>> out = _capture_c_output(descriptor_print, lib.GrB_DESC_S, 'desc', lib.GxB_SHORT) >>> 'Descriptor' in out True """ check_status(desc, lib.GxB_Descriptor_fprint( - desc[0], name.encode() if isinstance(name, str) else name, + desc, name.encode() if isinstance(name, str) else name, level, ffi.NULL, )) @@ -66,14 +36,13 @@ def descriptor_fprint(desc, f, name="", level=lib.GxB_COMPLETE): Pass ``ffi.NULL`` for ``f`` to print to stdout. ``level`` controls verbosity (see :func:`descriptor_print`). - >>> desc = descriptor_new() - >>> out = _capture_c_output(descriptor_fprint, desc, ffi.NULL, 'desc', lib.GxB_SHORT) + >>> out = _capture_c_output(descriptor_fprint, lib.GrB_DESC_S, ffi.NULL, 'desc', lib.GxB_SHORT) >>> 'Descriptor' in out True """ check_status(desc, lib.GxB_Descriptor_fprint( - desc[0], name.encode() if isinstance(name, str) else name, + desc, name.encode() if isinstance(name, str) else name, level, f, )) @@ -86,61 +55,57 @@ def descriptor_fprint(desc, f, name="", level=lib.GxB_COMPLETE): def descriptor_get_int32(desc, field): """Get a descriptor property as an int32. - >>> desc = descriptor_new() - >>> isinstance(descriptor_get_int32(desc, lib.GrB_OUTP_FIELD), int) + >>> isinstance(descriptor_get_int32(lib.GrB_DESC_S, lib.GrB_OUTP_FIELD), int) True """ val = ffi.new("int32_t*") - check_status(desc, lib.GrB_Descriptor_get_INT32(desc[0], val, field)) + check_status(desc, lib.GrB_Descriptor_get_INT32(desc, val, field)) return val[0] def descriptor_set_int32(desc, field, value): """Set a descriptor property from an int32. - >>> desc = descriptor_new() - >>> descriptor_set_int32(desc, lib.GrB_OUTP_FIELD, lib.GrB_REPLACE) + >>> from suitesparse_graphblas.api.descriptor import descriptor_get_int32 + >>> descriptor_get_int32(lib.GrB_DESC_S, lib.GrB_OUTP_FIELD) == lib.GrB_REPLACE + False """ check_status(desc, lib.GrB_Descriptor_set_INT32( - desc[0], ffi.cast("int32_t", value), field, + desc, ffi.cast("int32_t", value), field, )) def descriptor_get_size(desc, field): """Get a descriptor property as a size_t. - >>> desc = descriptor_new() - >>> isinstance(descriptor_get_size(desc, lib.GrB_NAME), int) + >>> isinstance(descriptor_get_size(lib.GrB_DESC_S, lib.GrB_NAME), int) True """ val = ffi.new("size_t*") - check_status(desc, lib.GrB_Descriptor_get_SIZE(desc[0], val, field)) + check_status(desc, lib.GrB_Descriptor_get_SIZE(desc, val, field)) return val[0] def descriptor_get_string(desc, field): """Get a descriptor property as a string. - >>> desc = descriptor_new() - >>> isinstance(descriptor_get_string(desc, lib.GrB_NAME), str) + >>> isinstance(descriptor_get_string(lib.GrB_DESC_S, lib.GrB_NAME), str) True """ val = ffi.new("char[256]") - check_status(desc, lib.GrB_Descriptor_get_String(desc[0], val, field)) + check_status(desc, lib.GrB_Descriptor_get_String(desc, val, field)) return ffi.string(val).decode() def descriptor_set_string(desc, field, value): """Set a descriptor property from a string. - >>> desc = descriptor_new() - >>> descriptor_set_string(desc, lib.GrB_NAME, "my_desc") - >>> descriptor_get_string(desc, lib.GrB_NAME) - 'my_desc' + >>> descriptor_get_string(lib.GrB_DESC_S, lib.GrB_NAME) + 'GrB_DESC_S' """ - check_status(desc, lib.GrB_Descriptor_set_String(desc[0], value.encode(), field)) + check_status(desc, lib.GrB_Descriptor_set_String(desc, value.encode(), field)) diff --git a/suitesparse_graphblas/api/examples/__init__.py b/suitesparse_graphblas/api/examples/__init__.py new file mode 100644 index 0000000..6f05b2f --- /dev/null +++ b/suitesparse_graphblas/api/examples/__init__.py @@ -0,0 +1,7 @@ +"""Example graph algorithms using the functional API. + +These examples are Python translations of algorithms from the +[LAGraph](https://github.com/GraphBLAS/LAGraph) library, demonstrating +how to use the `suitesparse_graphblas.api` modules to implement +graph algorithms with GraphBLAS. +""" diff --git a/suitesparse_graphblas/api/examples/bfs.py b/suitesparse_graphblas/api/examples/bfs.py new file mode 100644 index 0000000..796e096 --- /dev/null +++ b/suitesparse_graphblas/api/examples/bfs.py @@ -0,0 +1,160 @@ +"""Breadth-First Search using the GraphBLAS functional API. + +This is a Python translation of the vanilla (push-only) BFS algorithm from +[LAGraph](https://github.com/GraphBLAS/LAGraph) +(`LG_BreadthFirstSearch_vanilla_template.c`). + +The algorithm uses vector-matrix multiply (`vxm`) with a structural +complement mask to expand the frontier to unvisited nodes at each level. +It can compute BFS levels (distances from source), parent node IDs in +the BFS tree, or both. + +Example +------- +Build a small directed graph and run BFS from node 0:: + + >>> from suitesparse_graphblas import lib + >>> from suitesparse_graphblas.api import matrix, vector + >>> from suitesparse_graphblas.api.examples.bfs import bfs + >>> # + >>> # Graph: 0 -> 1 -> 2 -> 3 + >>> A = matrix.matrix_new(lib.GrB_BOOL, 4, 4) + >>> matrix.set_bool(A, True, 0, 1) + >>> matrix.set_bool(A, True, 1, 2) + >>> matrix.set_bool(A, True, 2, 3) + >>> level, parent = bfs(A, 0) + >>> [vector.get_int64(level, i) for i in range(4)] + [0, 1, 2, 3] + >>> [vector.get_int64(parent, i) for i in range(4)] + [0, 0, 1, 2] +""" + +from suitesparse_graphblas import check_status, ffi, lib +from suitesparse_graphblas.api import matrix, scalar, vector + + +def bfs(A, src, compute_level=True, compute_parent=True): + """Breadth-first search on a graph represented as an adjacency matrix. + + Parameters + ---------- + A : GrB_Matrix* + Square adjacency matrix (any type). Edge from ``i`` to ``j`` + exists when ``A(i, j)`` is stored. + src : int + Source node index (0-based). + compute_level : bool + If True, return a level vector where ``level(i)`` is the + shortest-path distance from *src* to node *i*. + compute_parent : bool + If True, return a parent vector where ``parent(i)`` is the + parent of node *i* in the BFS tree (``parent(src) == src``). + + Returns + ------- + level : GrB_Vector* or None + Level vector (if *compute_level* is True). + parent : GrB_Vector* or None + Parent vector (if *compute_parent* is True). + """ + if not compute_level and not compute_parent: + raise ValueError("at least one of compute_level or compute_parent must be True") + + n = matrix.matrix_nrows(A) + + if compute_parent: + # Parent mode: frontier is INT64, holds parent IDs. + # Semiring: MIN_FIRST selects the minimum parent index. + parent_vec = vector.vector_new(lib.GrB_INT64, n) + semiring = lib.GrB_MIN_FIRST_SEMIRING_INT64 + frontier = vector.vector_new(lib.GrB_INT64, n) + vector.set_int64(frontier, src, src) + else: + # Level-only mode: frontier is BOOL. + # Semiring: ANY_PAIR just checks reachability. + parent_vec = None + semiring = lib.GxB_ANY_PAIR_BOOL + frontier = vector.vector_new(lib.GrB_BOOL, n) + vector.set_bool(frontier, True, src) + + level_vec = vector.vector_new(lib.GrB_INT64, n) if compute_level else None + + # The mask is the set of already-visited nodes (parent or level vector). + # GrB_DESC_RSC complements the mask so vxm only writes to unvisited nodes. + mask = parent_vec if compute_parent else level_vec + + # Scalar used to assign the current level number. + if compute_level: + level_scalar = scalar.scalar_new(lib.GrB_INT64) + + current_level = 0 + while True: + # Assign current level to all frontier nodes: level = current_level + if compute_level: + scalar.set_int64(level_scalar, current_level) + vector.vector_assign_scalar( + level_vec, level_scalar, lib.GrB_ALL, n, + mask=frontier, desc=lib.GrB_DESC_S, + ) + + if compute_parent: + # Record parent IDs: parent = frontier + vector.vector_assign( + parent_vec, frontier, lib.GrB_ALL, n, + mask=frontier, desc=lib.GrB_DESC_S, + ) + # Convert frontier values to their own indices (ROWINDEX). + # After this, frontier(i) == i for every stored entry, + # so the next vxm propagates node i as the parent ID. + check_status( + frontier, + lib.GrB_Vector_apply_IndexOp_INT64( + frontier[0], ffi.NULL, ffi.NULL, + lib.GrB_ROWINDEX_INT64, frontier[0], 0, ffi.NULL, + ), + ) + + current_level += 1 + + # Expand frontier: frontier = frontier * A + vector.vector_vxm( + frontier, semiring, frontier, A, + mask=mask, desc=lib.GrB_DESC_RSC, + ) + + # Stop when the frontier is empty. + if vector.vector_nvals(frontier) == 0: + break + + return level_vec, parent_vec + + +if __name__ == "__main__": + import suitesparse_graphblas as gb + + gb.initialize() + + # Build a small undirected graph (7 nodes): + # + # 0 --- 1 --- 2 + # | | + # 3 4 --- 5 + # | + # 6 + # + n = 7 + A = matrix.matrix_new(lib.GrB_BOOL, n, n) + edges = [(0, 1), (0, 3), (1, 2), (1, 4), (4, 5), (4, 6)] + for i, j in edges: + matrix.set_bool(A, True, i, j) + matrix.set_bool(A, True, j, i) # undirected + + src = 0 + level, parent = bfs(A, src) + + print(f"BFS from node {src}:") + print(f" {'node':>4} {'level':>5} {'parent':>6}") + for i in range(n): + lv = vector.get_int64(level, i) + pa = vector.get_int64(parent, i) + print(f" {i:>4} {lv:>5} {pa:>6}") diff --git a/suitesparse_graphblas/api/io/serialize.py b/suitesparse_graphblas/api/io/serialize.py index 399371d..bc7c9a5 100644 --- a/suitesparse_graphblas/api/io/serialize.py +++ b/suitesparse_graphblas/api/io/serialize.py @@ -4,25 +4,26 @@ from suitesparse_graphblas.utils import claim_buffer -def free_desc(desc): - """Free a descriptor.""" - check_status(desc, lib.GrB_Descriptor_free(desc)) +def _free_desc(desc): + """Free a descriptor via a temporary pointer.""" + desc_ptr = ffi.new("GrB_Descriptor*", desc) + lib.GrB_Descriptor_free(desc_ptr) def get_serialize_desc(compression=lib.GxB_COMPRESSION_DEFAULT, level=None, nthreads=None): """Create a descriptor for serializing or deserializing. - This returns None (for NULL descriptor) or a pointer to a GrB_Descriptor. + This returns None (for NULL descriptor) or a GrB_Descriptor. """ if nthreads is None and (compression is None or compression == lib.GxB_COMPRESSION_DEFAULT): return None - desc = ffi.new("GrB_Descriptor*") - check_status(desc, lib.GrB_Descriptor_new(desc)) - desc = ffi.gc(desc, free_desc) + desc_ptr = ffi.new("GrB_Descriptor*") + check_status(desc_ptr, lib.GrB_Descriptor_new(desc_ptr)) + desc = ffi.gc(desc_ptr[0], _free_desc) if nthreads is not None: check_status( desc, - lib.GxB_Desc_set_INT32(desc[0], lib.GxB_NTHREADS, ffi.cast("int32_t", nthreads)), + lib.GxB_Desc_set_INT32(desc, lib.GxB_NTHREADS, ffi.cast("int32_t", nthreads)), ) if compression is not None: if level is not None and compression in { @@ -32,7 +33,7 @@ def get_serialize_desc(compression=lib.GxB_COMPRESSION_DEFAULT, level=None, nthr compression += level check_status( desc, - lib.GxB_Desc_set_INT32(desc[0], lib.GxB_COMPRESSION, ffi.cast("int32_t", compression)), + lib.GxB_Desc_set_INT32(desc, lib.GxB_COMPRESSION, ffi.cast("int32_t", compression)), ) return desc @@ -56,7 +57,7 @@ def serialize_matrix(A, compression=lib.GxB_COMPRESSION_DEFAULT, level=None, *, data_ptr = ffi.new("void**") size_ptr = ffi.new("GrB_Index*") check_status( - A, lib.GxB_Matrix_serialize(data_ptr, size_ptr, A[0], ffi.NULL if desc is None else desc[0]) + A, lib.GxB_Matrix_serialize(data_ptr, size_ptr, A[0], ffi.NULL if desc is None else desc) ) return claim_buffer(ffi, data_ptr[0], size_ptr[0], np.dtype(np.uint8)) @@ -79,7 +80,7 @@ def serialize_vector(v, compression=lib.GxB_COMPRESSION_DEFAULT, level=None, *, data_ptr = ffi.new("void**") size_ptr = ffi.new("GrB_Index*") check_status( - v, lib.GxB_Vector_serialize(data_ptr, size_ptr, v[0], ffi.NULL if desc is None else desc[0]) + v, lib.GxB_Vector_serialize(data_ptr, size_ptr, v[0], ffi.NULL if desc is None else desc) ) return claim_buffer(ffi, data_ptr[0], size_ptr[0], np.dtype(np.uint8)) @@ -102,7 +103,7 @@ def deserialize_matrix(data, *, free=True, nthreads=None): ffi.NULL, # dtype; we don't check for now ffi.from_buffer("void*", data), data.nbytes, - ffi.NULL if desc is None else desc[0], + ffi.NULL if desc is None else desc, ), ) if free: @@ -130,7 +131,7 @@ def deserialize_vector(data, *, free=True, nthreads=None): ffi.NULL, # dtype; we don't check for now ffi.from_buffer("void*", data), data.nbytes, - ffi.NULL if desc is None else desc[0], + ffi.NULL if desc is None else desc, ), ) if free: diff --git a/suitesparse_graphblas/api/iterator.py b/suitesparse_graphblas/api/iterator.py index f94d8f0..5df331e 100644 --- a/suitesparse_graphblas/api/iterator.py +++ b/suitesparse_graphblas/api/iterator.py @@ -56,7 +56,7 @@ def matrix_iterator_attach(it, A, desc=None): """ info = lib.GxB_Matrix_Iterator_attach( - it[0], A[0], ffi.NULL if desc is None else desc[0], + it[0], A[0], ffi.NULL if desc is None else desc, ) return _check_info(info) @@ -79,7 +79,7 @@ def row_iterator_attach(it, A, desc=None): """ info = lib.GxB_rowIterator_attach( - it[0], A[0], ffi.NULL if desc is None else desc[0], + it[0], A[0], ffi.NULL if desc is None else desc, ) return _check_info(info) @@ -102,7 +102,7 @@ def col_iterator_attach(it, A, desc=None): """ info = lib.GxB_colIterator_attach( - it[0], A[0], ffi.NULL if desc is None else desc[0], + it[0], A[0], ffi.NULL if desc is None else desc, ) return _check_info(info) @@ -124,7 +124,7 @@ def vector_iterator_attach(it, v, desc=None): """ info = lib.GxB_Vector_Iterator_attach( - it[0], v[0], ffi.NULL if desc is None else desc[0], + it[0], v[0], ffi.NULL if desc is None else desc, ) return _check_info(info) diff --git a/suitesparse_graphblas/api/matrix.py b/suitesparse_graphblas/api/matrix.py index 47d3795..d72d7de 100644 --- a/suitesparse_graphblas/api/matrix.py +++ b/suitesparse_graphblas/api/matrix.py @@ -348,7 +348,7 @@ def matrix_mxm(C, semiring, A, B, mask=None, accum=None, desc=None): semiring, A[0], B[0], - ffi.NULL if desc is None else desc[0], + ffi.NULL if desc is None else desc, )) @@ -372,7 +372,7 @@ def matrix_ewise_add(C, op, A, B, mask=None, accum=None, desc=None): op, A[0], B[0], - ffi.NULL if desc is None else desc[0], + ffi.NULL if desc is None else desc, )) @@ -396,7 +396,7 @@ def matrix_ewise_mult(C, op, A, B, mask=None, accum=None, desc=None): op, A[0], B[0], - ffi.NULL if desc is None else desc[0], + ffi.NULL if desc is None else desc, )) @@ -430,7 +430,7 @@ def matrix_ewise_union(C, op, A, alpha, B, beta, mask=None, accum=None, desc=Non op, A[0], alpha[0], B[0], beta[0], - ffi.NULL if desc is None else desc[0], + ffi.NULL if desc is None else desc, )) @@ -451,7 +451,7 @@ def matrix_apply(C, op, A, mask=None, accum=None, desc=None): ffi.NULL if accum is None else accum, op, A[0], - ffi.NULL if desc is None else desc[0], + ffi.NULL if desc is None else desc, )) @@ -476,7 +476,7 @@ def matrix_apply_first(C, op, x, A, mask=None, accum=None, desc=None): op, x[0], A[0], - ffi.NULL if desc is None else desc[0], + ffi.NULL if desc is None else desc, )) @@ -501,7 +501,7 @@ def matrix_apply_second(C, op, A, y, mask=None, accum=None, desc=None): op, A[0], y[0], - ffi.NULL if desc is None else desc[0], + ffi.NULL if desc is None else desc, )) @@ -529,7 +529,7 @@ def matrix_select(C, op, A, thunk, mask=None, accum=None, desc=None): op, A[0], thunk[0], - ffi.NULL if desc is None else desc[0], + ffi.NULL if desc is None else desc, )) @@ -552,7 +552,7 @@ def matrix_reduce(w, monoid, A, mask=None, accum=None, desc=None): ffi.NULL if accum is None else accum, monoid, A[0], - ffi.NULL if desc is None else desc[0], + ffi.NULL if desc is None else desc, )) @@ -574,7 +574,7 @@ def matrix_reduce_scalar(s, monoid, A, accum=None, desc=None): ffi.NULL if accum is None else accum, monoid, A[0], - ffi.NULL if desc is None else desc[0], + ffi.NULL if desc is None else desc, )) @@ -594,7 +594,7 @@ def matrix_transpose(C, A, mask=None, accum=None, desc=None): ffi.NULL if mask is None else mask[0], ffi.NULL if accum is None else accum, A[0], - ffi.NULL if desc is None else desc[0], + ffi.NULL if desc is None else desc, )) @@ -618,7 +618,7 @@ def matrix_kronecker(C, op, A, B, mask=None, accum=None, desc=None): op, A[0], B[0], - ffi.NULL if desc is None else desc[0], + ffi.NULL if desc is None else desc, )) @@ -645,7 +645,7 @@ def matrix_diag(C, v, k=0, desc=None): """ check_status(C, lib.GxB_Matrix_diag( C[0], v[0], k, - ffi.NULL if desc is None else desc[0], + ffi.NULL if desc is None else desc, )) @@ -672,7 +672,7 @@ def matrix_concat(C, tiles, m, n, desc=None): tile_array = ffi.new("GrB_Matrix[]", [t[0] for t in tiles]) check_status(C, lib.GxB_Matrix_concat( C[0], tile_array, m, n, - ffi.NULL if desc is None else desc[0], + ffi.NULL if desc is None else desc, )) @@ -698,7 +698,7 @@ def matrix_assign(C, A, rows, nrows, cols, ncols, mask=None, accum=None, desc=No ffi.NULL if accum is None else accum, A[0], rows, nrows, cols, ncols, - ffi.NULL if desc is None else desc[0], + ffi.NULL if desc is None else desc, )) @@ -724,7 +724,7 @@ def matrix_assign_scalar(C, x, rows, nrows, cols, ncols, mask=None, accum=None, ffi.NULL if accum is None else accum, x[0], rows, nrows, cols, ncols, - ffi.NULL if desc is None else desc[0], + ffi.NULL if desc is None else desc, )) @@ -747,7 +747,7 @@ def matrix_extract(C, A, rows, nrows, cols, ncols, mask=None, accum=None, desc=N ffi.NULL if accum is None else accum, A[0], rows, nrows, cols, ncols, - ffi.NULL if desc is None else desc[0], + ffi.NULL if desc is None else desc, )) @@ -769,7 +769,7 @@ def matrix_col_extract(w, A, rows, nrows, j, mask=None, accum=None, desc=None): ffi.NULL if accum is None else accum, A[0], rows, nrows, j, - ffi.NULL if desc is None else desc[0], + ffi.NULL if desc is None else desc, )) @@ -791,7 +791,7 @@ def matrix_col_assign(C, u, rows, nrows, j, mask=None, accum=None, desc=None): ffi.NULL if accum is None else accum, u[0], rows, nrows, j, - ffi.NULL if desc is None else desc[0], + ffi.NULL if desc is None else desc, )) @@ -813,7 +813,7 @@ def matrix_row_assign(C, u, i, cols, ncols, mask=None, accum=None, desc=None): ffi.NULL if accum is None else accum, u[0], i, cols, ncols, - ffi.NULL if desc is None else desc[0], + ffi.NULL if desc is None else desc, )) diff --git a/suitesparse_graphblas/api/vector.py b/suitesparse_graphblas/api/vector.py index b8026d8..1afba50 100644 --- a/suitesparse_graphblas/api/vector.py +++ b/suitesparse_graphblas/api/vector.py @@ -250,7 +250,7 @@ def vector_mxv(w, semiring, A, u, mask=None, accum=None, desc=None): semiring, A[0], u[0], - ffi.NULL if desc is None else desc[0], + ffi.NULL if desc is None else desc, )) @@ -275,7 +275,7 @@ def vector_vxm(w, semiring, u, A, mask=None, accum=None, desc=None): semiring, u[0], A[0], - ffi.NULL if desc is None else desc[0], + ffi.NULL if desc is None else desc, )) @@ -299,7 +299,7 @@ def vector_ewise_add(w, op, u, v, mask=None, accum=None, desc=None): op, u[0], v[0], - ffi.NULL if desc is None else desc[0], + ffi.NULL if desc is None else desc, )) @@ -323,7 +323,7 @@ def vector_ewise_mult(w, op, u, v, mask=None, accum=None, desc=None): op, u[0], v[0], - ffi.NULL if desc is None else desc[0], + ffi.NULL if desc is None else desc, )) @@ -357,7 +357,7 @@ def vector_ewise_union(w, op, u, alpha, v, beta, mask=None, accum=None, desc=Non op, u[0], alpha[0], v[0], beta[0], - ffi.NULL if desc is None else desc[0], + ffi.NULL if desc is None else desc, )) @@ -378,7 +378,7 @@ def vector_apply(w, op, u, mask=None, accum=None, desc=None): ffi.NULL if accum is None else accum, op, u[0], - ffi.NULL if desc is None else desc[0], + ffi.NULL if desc is None else desc, )) @@ -403,7 +403,7 @@ def vector_apply_first(w, op, x, u, mask=None, accum=None, desc=None): op, x[0], u[0], - ffi.NULL if desc is None else desc[0], + ffi.NULL if desc is None else desc, )) @@ -428,7 +428,7 @@ def vector_apply_second(w, op, u, y, mask=None, accum=None, desc=None): op, u[0], y[0], - ffi.NULL if desc is None else desc[0], + ffi.NULL if desc is None else desc, )) @@ -456,7 +456,7 @@ def vector_select(w, op, u, thunk, mask=None, accum=None, desc=None): op, u[0], thunk[0], - ffi.NULL if desc is None else desc[0], + ffi.NULL if desc is None else desc, )) @@ -478,7 +478,7 @@ def vector_reduce(s, monoid, u, accum=None, desc=None): ffi.NULL if accum is None else accum, monoid, u[0], - ffi.NULL if desc is None else desc[0], + ffi.NULL if desc is None else desc, )) @@ -504,7 +504,7 @@ def vector_diag(v, A, k=0, desc=None): """ check_status(v, lib.GxB_Vector_diag( v[0], A[0], k, - ffi.NULL if desc is None else desc[0], + ffi.NULL if desc is None else desc, )) @@ -526,7 +526,7 @@ def vector_assign(w, u, indices, ni, mask=None, accum=None, desc=None): ffi.NULL if accum is None else accum, u[0], indices, ni, - ffi.NULL if desc is None else desc[0], + ffi.NULL if desc is None else desc, )) @@ -551,7 +551,7 @@ def vector_assign_scalar(w, x, indices, ni, mask=None, accum=None, desc=None): ffi.NULL if accum is None else accum, x[0], indices, ni, - ffi.NULL if desc is None else desc[0], + ffi.NULL if desc is None else desc, )) @@ -573,7 +573,7 @@ def vector_extract(w, u, indices, ni, mask=None, accum=None, desc=None): ffi.NULL if accum is None else accum, u[0], indices, ni, - ffi.NULL if desc is None else desc[0], + ffi.NULL if desc is None else desc, )) From 8d9eb2c1c45af3eee89a6d200e357104aff42bb7 Mon Sep 17 00:00:00 2001 From: Michel Pelletier Date: Mon, 13 Apr 2026 20:10:31 -0700 Subject: [PATCH 182/193] Add apply_IndexOp_Scalar to matrix and vector functional API Add matrix_apply_indexop and vector_apply_indexop wrapping the GrB_Matrix_apply_IndexOp_Scalar and GrB_Vector_apply_IndexOp_Scalar C functions, with doctests. Update BFS example to use the new vector_apply_indexop instead of raw ffi calls. --- suitesparse_graphblas/api/examples/bfs.py | 12 ++++------ suitesparse_graphblas/api/matrix.py | 28 +++++++++++++++++++++++ suitesparse_graphblas/api/vector.py | 28 +++++++++++++++++++++++ 3 files changed, 61 insertions(+), 7 deletions(-) diff --git a/suitesparse_graphblas/api/examples/bfs.py b/suitesparse_graphblas/api/examples/bfs.py index 796e096..3ae7b5e 100644 --- a/suitesparse_graphblas/api/examples/bfs.py +++ b/suitesparse_graphblas/api/examples/bfs.py @@ -29,7 +29,7 @@ [0, 0, 1, 2] """ -from suitesparse_graphblas import check_status, ffi, lib +from suitesparse_graphblas import lib from suitesparse_graphblas.api import matrix, scalar, vector @@ -69,6 +69,8 @@ def bfs(A, src, compute_level=True, compute_parent=True): semiring = lib.GrB_MIN_FIRST_SEMIRING_INT64 frontier = vector.vector_new(lib.GrB_INT64, n) vector.set_int64(frontier, src, src) + index_thunk = scalar.scalar_new(lib.GrB_INT64) + scalar.set_int64(index_thunk, 0) else: # Level-only mode: frontier is BOOL. # Semiring: ANY_PAIR just checks reachability. @@ -106,12 +108,8 @@ def bfs(A, src, compute_level=True, compute_parent=True): # Convert frontier values to their own indices (ROWINDEX). # After this, frontier(i) == i for every stored entry, # so the next vxm propagates node i as the parent ID. - check_status( - frontier, - lib.GrB_Vector_apply_IndexOp_INT64( - frontier[0], ffi.NULL, ffi.NULL, - lib.GrB_ROWINDEX_INT64, frontier[0], 0, ffi.NULL, - ), + vector.vector_apply_indexop( + frontier, lib.GrB_ROWINDEX_INT64, frontier, index_thunk, ) current_level += 1 diff --git a/suitesparse_graphblas/api/matrix.py b/suitesparse_graphblas/api/matrix.py index d72d7de..0feedaa 100644 --- a/suitesparse_graphblas/api/matrix.py +++ b/suitesparse_graphblas/api/matrix.py @@ -505,6 +505,34 @@ def matrix_apply_second(C, op, A, y, mask=None, accum=None, desc=None): )) +def matrix_apply_indexop(C, op, A, thunk, mask=None, accum=None, desc=None): + """Apply an index unary operator to each entry of a matrix with a scalar thunk. + + >>> from suitesparse_graphblas import scalar + >>> C = matrix_new(lib.GrB_INT64, 3, 3) + >>> A = matrix_new(lib.GrB_INT64, 3, 3) + >>> set_int64(A, 10, 0, 0) + >>> set_int64(A, 20, 1, 1) + >>> s = scalar.scalar_new(lib.GrB_INT64) + >>> scalar.set_int64(s, 0) + >>> matrix_apply_indexop(C, lib.GrB_ROWINDEX_INT64, A, s) + >>> get_int64(C, 0, 0) == 0 + True + >>> get_int64(C, 1, 1) == 1 + True + + """ + check_status(C, lib.GrB_Matrix_apply_IndexOp_Scalar( + C[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + op, + A[0], + thunk[0], + ffi.NULL if desc is None else desc, + )) + + def matrix_select(C, op, A, thunk, mask=None, accum=None, desc=None): """Select entries from a matrix using an index unary operator and scalar thunk. diff --git a/suitesparse_graphblas/api/vector.py b/suitesparse_graphblas/api/vector.py index 1afba50..f144cc4 100644 --- a/suitesparse_graphblas/api/vector.py +++ b/suitesparse_graphblas/api/vector.py @@ -432,6 +432,34 @@ def vector_apply_second(w, op, u, y, mask=None, accum=None, desc=None): )) +def vector_apply_indexop(w, op, u, thunk, mask=None, accum=None, desc=None): + """Apply an index unary operator to each entry of a vector with a scalar thunk. + + >>> from suitesparse_graphblas import scalar + >>> w = vector_new(lib.GrB_INT64, 3) + >>> u = vector_new(lib.GrB_INT64, 3) + >>> set_int64(u, 10, 0) + >>> set_int64(u, 20, 2) + >>> s = scalar.scalar_new(lib.GrB_INT64) + >>> scalar.set_int64(s, 0) + >>> vector_apply_indexop(w, lib.GrB_ROWINDEX_INT64, u, s) + >>> get_int64(w, 0) == 0 + True + >>> get_int64(w, 2) == 2 + True + + """ + check_status(w, lib.GrB_Vector_apply_IndexOp_Scalar( + w[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + op, + u[0], + thunk[0], + ffi.NULL if desc is None else desc, + )) + + def vector_select(w, op, u, thunk, mask=None, accum=None, desc=None): """Select entries from a vector using an index unary operator and scalar thunk. From 60c5e1ea6f88779b5b58d28a294eefb0e66e0894 Mon Sep 17 00:00:00 2001 From: Michel Pelletier Date: Wed, 15 Apr 2026 08:42:11 -0700 Subject: [PATCH 183/193] Merge global_ into global_options. --- suitesparse_graphblas/api/__init__.py | 1 - suitesparse_graphblas/api/global_.py | 72 --------------------- suitesparse_graphblas/api/global_options.py | 71 ++++++++++++++++++++ suitesparse_graphblas/tests/test_doctest.py | 2 - 4 files changed, 71 insertions(+), 75 deletions(-) delete mode 100644 suitesparse_graphblas/api/global_.py diff --git a/suitesparse_graphblas/api/__init__.py b/suitesparse_graphblas/api/__init__.py index d31250f..15cadfb 100644 --- a/suitesparse_graphblas/api/__init__.py +++ b/suitesparse_graphblas/api/__init__.py @@ -25,7 +25,6 @@ container, context, descriptor, - global_, global_options, grb_type, indexbinaryop, diff --git a/suitesparse_graphblas/api/global_.py b/suitesparse_graphblas/api/global_.py deleted file mode 100644 index fc0083f..0000000 --- a/suitesparse_graphblas/api/global_.py +++ /dev/null @@ -1,72 +0,0 @@ -from suitesparse_graphblas import _error_code_lookup, ffi, lib - - -def global_get_int32(field): - """Get a global property as an int32. - - >>> isinstance(global_get_int32(lib.GxB_NTHREADS), int) - True - - """ - val = ffi.new("int32_t*") - info = lib.GrB_Global_get_INT32(lib.GrB_GLOBAL, val, field) - if info != lib.GrB_SUCCESS: - raise _error_code_lookup.get(info, RuntimeError)( - f"GrB_Global_get_INT32 failed with info={info}" - ) - return val[0] - - -def global_set_int32(field, value): - """Set a global property from an int32. - - >>> nthreads = global_get_int32(lib.GxB_NTHREADS) - >>> global_set_int32(lib.GxB_NTHREADS, nthreads) - - """ - info = lib.GrB_Global_set_INT32(lib.GrB_GLOBAL, ffi.cast("int32_t", value), field) - if info != lib.GrB_SUCCESS: - raise _error_code_lookup.get(info, RuntimeError)( - f"GrB_Global_set_INT32 failed with info={info}" - ) - - -def global_get_size(field): - """Get a global property as a size_t. - - >>> isinstance(global_get_size(lib.GrB_NAME), int) - True - - """ - val = ffi.new("size_t*") - info = lib.GrB_Global_get_SIZE(lib.GrB_GLOBAL, val, field) - if info != lib.GrB_SUCCESS: - raise _error_code_lookup.get(info, RuntimeError)( - f"GrB_Global_get_SIZE failed with info={info}" - ) - return val[0] - - -def global_get_string(field): - """Get a global property as a string. - - >>> 'SuiteSparse:GraphBLAS' in global_get_string(lib.GrB_NAME) - True - - """ - val = ffi.new("char[256]") - info = lib.GrB_Global_get_String(lib.GrB_GLOBAL, val, field) - if info != lib.GrB_SUCCESS: - raise _error_code_lookup.get(info, RuntimeError)( - f"GrB_Global_get_String failed with info={info}" - ) - return ffi.string(val).decode() - - -def global_set_string(field, value): - """Set a global property from a string.""" - info = lib.GrB_Global_set_String(lib.GrB_GLOBAL, value.encode(), field) - if info != lib.GrB_SUCCESS: - raise _error_code_lookup.get(info, RuntimeError)( - f"GrB_Global_set_String failed with info={info}" - ) diff --git a/suitesparse_graphblas/api/global_options.py b/suitesparse_graphblas/api/global_options.py index c50317d..85224e4 100644 --- a/suitesparse_graphblas/api/global_options.py +++ b/suitesparse_graphblas/api/global_options.py @@ -74,3 +74,74 @@ def global_option_get_char(field): f"GxB_Global_Option_get_CHAR failed with info={info}" ) return ffi.string(val[0]).decode() + + +def global_get_int32(field): + """Get a global property as an int32. + + >>> isinstance(global_get_int32(lib.GxB_NTHREADS), int) + True + + """ + val = ffi.new("int32_t*") + info = lib.GrB_Global_get_INT32(lib.GrB_GLOBAL, val, field) + if info != lib.GrB_SUCCESS: + raise _error_code_lookup.get(info, RuntimeError)( + f"GrB_Global_get_INT32 failed with info={info}" + ) + return val[0] + + +def global_set_int32(field, value): + """Set a global property from an int32. + + >>> nthreads = global_get_int32(lib.GxB_NTHREADS) + >>> global_set_int32(lib.GxB_NTHREADS, nthreads) + + """ + info = lib.GrB_Global_set_INT32(lib.GrB_GLOBAL, ffi.cast("int32_t", value), field) + if info != lib.GrB_SUCCESS: + raise _error_code_lookup.get(info, RuntimeError)( + f"GrB_Global_set_INT32 failed with info={info}" + ) + + +def global_get_size(field): + """Get a global property as a size_t. + + >>> isinstance(global_get_size(lib.GrB_NAME), int) + True + + """ + val = ffi.new("size_t*") + info = lib.GrB_Global_get_SIZE(lib.GrB_GLOBAL, val, field) + if info != lib.GrB_SUCCESS: + raise _error_code_lookup.get(info, RuntimeError)( + f"GrB_Global_get_SIZE failed with info={info}" + ) + return val[0] + + +def global_get_string(field): + """Get a global property as a string. + + >>> 'SuiteSparse:GraphBLAS' in global_get_string(lib.GrB_NAME) + True + + """ + val = ffi.new("char[256]") + info = lib.GrB_Global_get_String(lib.GrB_GLOBAL, val, field) + if info != lib.GrB_SUCCESS: + raise _error_code_lookup.get(info, RuntimeError)( + f"GrB_Global_get_String failed with info={info}" + ) + return ffi.string(val).decode() + + +def global_set_string(field, value): + """Set a global property from a string.""" + info = lib.GrB_Global_set_String(lib.GrB_GLOBAL, value.encode(), field) + if info != lib.GrB_SUCCESS: + raise _error_code_lookup.get(info, RuntimeError)( + f"GrB_Global_set_String failed with info={info}" + ) diff --git a/suitesparse_graphblas/tests/test_doctest.py b/suitesparse_graphblas/tests/test_doctest.py index 58adaf3..8b2b456 100644 --- a/suitesparse_graphblas/tests/test_doctest.py +++ b/suitesparse_graphblas/tests/test_doctest.py @@ -6,7 +6,6 @@ def test_run_doctests(): container, context, descriptor, - global_, global_options, grb_type, indexbinaryop, @@ -38,6 +37,5 @@ def test_run_doctests(): descriptor, selectop, container, - global_, ): doctest.testmod(mod, optionflags=doctest.ELLIPSIS, raise_on_error=True) From eca02617a9e0786b0106c2f3b1211ca1b32ad37c Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Sat, 8 Aug 2026 23:33:49 -0500 Subject: [PATCH 184/193] Update to SS:GB v10.4.0 (and run pre-commit linting) (#151) * Update to SS:GB v10.4.0 (and run pre-commit linting) * Handle free-threaded Python explicitly in CI --- .flake8 | 2 + .github/workflows/test.yml | 47 +- .github/workflows/wheels.yml | 8 +- .gitignore | 3 + .pre-commit-config.yaml | 6 +- GB_VERSION.txt | 2 +- suitesparse.sh | 8 +- suitesparse_graphblas/__init__.py | 10 +- suitesparse_graphblas/api/__init__.py | 5 +- suitesparse_graphblas/api/binaryop.py | 26 +- suitesparse_graphblas/api/context.py | 26 +- suitesparse_graphblas/api/descriptor.py | 37 +- suitesparse_graphblas/api/examples/bfs.py | 29 +- suitesparse_graphblas/api/grb_type.py | 26 +- suitesparse_graphblas/api/indexbinaryop.py | 30 +- suitesparse_graphblas/api/indexunaryop.py | 30 +- suitesparse_graphblas/api/iterator.py | 16 +- suitesparse_graphblas/api/matrix.py | 921 +++++++++++------- suitesparse_graphblas/api/monoid.py | 34 +- suitesparse_graphblas/api/scalar.py | 26 +- suitesparse_graphblas/api/selectop.py | 12 +- suitesparse_graphblas/api/semiring.py | 34 +- suitesparse_graphblas/api/unaryop.py | 26 +- suitesparse_graphblas/api/vector.py | 759 +++++++++------ suitesparse_graphblas/create_headers.py | 25 +- suitesparse_graphblas/suitesparse_graphblas.h | 86 +- .../suitesparse_graphblas_no_complex.h | 82 +- 27 files changed, 1528 insertions(+), 788 deletions(-) diff --git a/.flake8 b/.flake8 index efbe9a5..617214e 100644 --- a/.flake8 +++ b/.flake8 @@ -7,3 +7,5 @@ extend-ignore = per-file-ignores = suitesparse_graphblas/io/binary.py:C408, suitesparse_graphblas/tests/test_io.py:E721, +# The api package re-exports its submodules for `from suitesparse_graphblas import api` + suitesparse_graphblas/api/__init__.py:F401, diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0c93034..07815f1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,19 +18,38 @@ jobs: source: ["conda-forge"] # os: ["ubuntu-latest"] # source: ["source"] - python-version: ["3.11", "3.12", "3.13", "3.14"] + # A trailing "t" means the free-threaded (no-GIL) build of that version. + python-version: ["3.11", "3.12", "3.13", "3.14", "3.14t"] steps: - name: Checkout uses: actions/checkout@v6 with: fetch-depth: 0 persist-credentials: false + - name: Compose conda environment file + run: | + # conda-forge ships two ABIs for CPython 3.13+ ("cp314" and "cp314t"), + # and `python=3.14` alone lets the solver pick either one: it resolved + # to free-threaded on Linux and Windows but to the GIL build on macOS. + # The `python-gil` and `python-freethreading` metapackages pin + # `python_abi` to one or the other, so ask for the one this matrix + # entry wants instead of leaving it to the solver. + pyver="${{ matrix.python-version }}" + if [[ $pyver == *t ]]; then + variant=python-freethreading + pyver=${pyver%t} + else + variant=python-gil + fi + cp continuous_integration/environment.yml environment-ci.yml + echo " - python=$pyver" >> environment-ci.yml + echo " - $variant" >> environment-ci.yml + cat environment-ci.yml - name: Conda uses: conda-incubator/setup-miniconda@v3 with: auto-update-conda: true - python-version: ${{ matrix.python-version }} - environment-file: continuous_integration/environment.yml + environment-file: environment-ci.yml channels: conda-forge,nodefaults channel-priority: strict activate-environment: suitesparse-graphblas @@ -62,15 +81,31 @@ jobs: - name: Build run: | pip install -e . --no-deps + - name: Configure coverage + run: | + # Cython's coverage plugin (see [tool.coverage.run] in pyproject.toml) + # needs coverage's C tracer. conda-forge builds coverage without its C + # extension for free-threaded Python, and conda resolves `python=3.14` + # to the free-threaded build (3.14t) on some platforms. There, loading + # the plugin raises ImportError and every `coverage run` dies before it + # runs anything, so run the tests directly instead. + if python -c "import Cython.Coverage" 2>/dev/null; then + coverage erase + echo "COV=coverage run -a --branch" >> $GITHUB_ENV + else + echo "Cython coverage plugin unusable here; running without coverage" + python -VV + echo "COV=python" >> $GITHUB_ENV + fi - name: Test env: CYTHON_COVERAGE: true run: | pytest -s -k test_print_jit_config - coverage run --branch -m pytest - coverage run -a --branch suitesparse_graphblas/tests/test_initialize.py + $COV -m pytest + $COV suitesparse_graphblas/tests/test_initialize.py - name: create_headers.py check if: (! contains(matrix.os, 'windows')) run: | - coverage run -a --branch suitesparse_graphblas/create_headers.py + $COV suitesparse_graphblas/create_headers.py git diff --exit-code # error if anything changed diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 591ca63..a35412b 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -138,8 +138,12 @@ jobs: # very verbose CIBW_BUILD_VERBOSITY: 3 - # cibuildwheel v3: PyPy no longer built by default; enable explicitly - # Note: cpython-freethreading not enabled because cffi doesn't support it yet + # cibuildwheel v3: PyPy no longer built by default; enable explicitly. + # Free-threaded wheels: cibuildwheel only gates cp313t behind + # "cpython-freethreading" (see its selector.py), so cp314t is already + # built and tested here by default. cp313t stays off because cffi + # publishes no cp313t wheels, so enabling it would build cffi from + # source in every wheel job. CIBW_ENABLE: "pypy" # Build SuiteSparse diff --git a/.gitignore b/.gitignore index e382cda..d079cfe 100644 --- a/.gitignore +++ b/.gitignore @@ -43,6 +43,9 @@ GraphBLAS-*/ pip-log.txt pip-delete-this-directory.txt +# Conda environment file composed by CI (see .github/workflows/test.yml) +environment-ci.yml + # Unit test / coverage reports htmlcov/ .tox/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a88a72c..6f168de 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -41,7 +41,7 @@ repos: - id: autoflake args: [--in-place] - repo: https://github.com/pycqa/isort - rev: 8.0.1 + rev: 9.0.0b2 hooks: - id: isort - repo: https://github.com/asottile/pyupgrade @@ -50,7 +50,7 @@ repos: - id: pyupgrade args: [--py311-plus] - repo: https://github.com/psf/black-pre-commit-mirror - rev: 26.3.1 + rev: 26.5.1 hooks: - id: black - repo: https://github.com/PyCQA/flake8 @@ -89,7 +89,7 @@ repos: - id: python-no-log-warn - id: text-unicode-replacement-char - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.37.0 + rev: 0.37.4 hooks: - id: check-dependabot - id: check-github-workflows diff --git a/GB_VERSION.txt b/GB_VERSION.txt index a936832..816c071 100644 --- a/GB_VERSION.txt +++ b/GB_VERSION.txt @@ -1 +1 @@ -10.3.1 +10.4.0 diff --git a/suitesparse.sh b/suitesparse.sh index 0b47855..ad05bbf 100755 --- a/suitesparse.sh +++ b/suitesparse.sh @@ -3,7 +3,13 @@ set -x # echo on # parse SuiteSparse version from first argument, a git tag that ends in the version (no leading v) -if [[ $1 =~ refs/tags/([0-9]*\.[0-9]*\.[0-9]*\.beta[0-9]*).*$ ]]; then +if [[ $1 =~ refs/tags/v?([0-9]+\.[0-9]+\.[0-9]+-beta\.[0-9]+) ]]; then + # Naming used since v10.4.0-beta.1, e.g. "10.4.0-beta.2". Note that callers + # append the psg patch level (".0"), which is not part of the upstream tag. + echo "Beta version detected (X.Y.Z-beta.N)" + VERSION=${BASH_REMATCH[1]} +elif [[ $1 =~ refs/tags/([0-9]*\.[0-9]*\.[0-9]*\.beta[0-9]*).*$ ]]; then + # Older naming, e.g. "8.0.1.beta1" echo "Beta version detected" VERSION=${BASH_REMATCH[1]} elif [[ $1 =~ refs/tags/([0-9]*\.[0-9]*\.[0-9]*)\..*$ ]]; then diff --git a/suitesparse_graphblas/__init__.py b/suitesparse_graphblas/__init__.py index e2b650a..895a66f 100644 --- a/suitesparse_graphblas/__init__.py +++ b/suitesparse_graphblas/__init__.py @@ -309,9 +309,13 @@ def __repr__(self): burble = burble() -# Backward-compatible re-exports: functional API moved to suitesparse_graphblas.api -from suitesparse_graphblas.api import iterator, matrix, scalar, vector # noqa: E402,F401 -from suitesparse_graphblas.api.global_options import ( # noqa: E402,F401 +# isort: off +# Backward-compatible re-exports: functional API moved to suitesparse_graphblas.api. +# These must stay at the bottom of the file: the api modules import names defined +# above (`check_status`, `ffi`, `lib`), so letting isort's `float_to_top` hoist them +# to the top would make `import suitesparse_graphblas` a circular import. +from suitesparse_graphblas.api import iterator, matrix, scalar, vector # noqa: E402, F401 +from suitesparse_graphblas.api.global_options import ( # noqa: E402, F401 global_option_get_char, global_option_get_fp64, global_option_get_int32, diff --git a/suitesparse_graphblas/api/__init__.py b/suitesparse_graphblas/api/__init__.py index 15cadfb..3006c1f 100644 --- a/suitesparse_graphblas/api/__init__.py +++ b/suitesparse_graphblas/api/__init__.py @@ -20,6 +20,8 @@ Guide](https://github.com/DrTimothyAldenDavis/GraphBLAS/blob/stable/Doc/GraphBLAS_UserGuide.pdf) """ + +from suitesparse_graphblas.api import io # noqa: F401 from suitesparse_graphblas.api import ( binaryop, container, @@ -33,9 +35,8 @@ matrix, monoid, scalar, - semiring, selectop, + semiring, unaryop, vector, ) -from suitesparse_graphblas.api import io # noqa: F401 diff --git a/suitesparse_graphblas/api/binaryop.py b/suitesparse_graphblas/api/binaryop.py index 970a541..cc87358 100644 --- a/suitesparse_graphblas/api/binaryop.py +++ b/suitesparse_graphblas/api/binaryop.py @@ -104,10 +104,15 @@ def binaryop_print(op, name="", level=lib.GxB_COMPLETE): True """ - check_status(op, lib.GxB_BinaryOp_fprint( - op[0], name.encode() if isinstance(name, str) else name, - level, ffi.NULL, - )) + check_status( + op, + lib.GxB_BinaryOp_fprint( + op[0], + name.encode() if isinstance(name, str) else name, + level, + ffi.NULL, + ), + ) def binaryop_fprint(op, f, name="", level=lib.GxB_COMPLETE): @@ -122,10 +127,15 @@ def binaryop_fprint(op, f, name="", level=lib.GxB_COMPLETE): True """ - check_status(op, lib.GxB_BinaryOp_fprint( - op[0], name.encode() if isinstance(name, str) else name, - level, f, - )) + check_status( + op, + lib.GxB_BinaryOp_fprint( + op[0], + name.encode() if isinstance(name, str) else name, + level, + f, + ), + ) # --------------------------------------------------------------------------- diff --git a/suitesparse_graphblas/api/context.py b/suitesparse_graphblas/api/context.py index da6bc49..5549bd5 100644 --- a/suitesparse_graphblas/api/context.py +++ b/suitesparse_graphblas/api/context.py @@ -201,10 +201,15 @@ def context_print(ctx, name="", level=lib.GxB_COMPLETE): True """ - check_status(ctx, lib.GxB_Context_fprint( - ctx[0], name.encode() if isinstance(name, str) else name, - level, ffi.NULL, - )) + check_status( + ctx, + lib.GxB_Context_fprint( + ctx[0], + name.encode() if isinstance(name, str) else name, + level, + ffi.NULL, + ), + ) def context_fprint(ctx, f, name="", level=lib.GxB_COMPLETE): @@ -219,7 +224,12 @@ def context_fprint(ctx, f, name="", level=lib.GxB_COMPLETE): True """ - check_status(ctx, lib.GxB_Context_fprint( - ctx[0], name.encode() if isinstance(name, str) else name, - level, f, - )) + check_status( + ctx, + lib.GxB_Context_fprint( + ctx[0], + name.encode() if isinstance(name, str) else name, + level, + f, + ), + ) diff --git a/suitesparse_graphblas/api/descriptor.py b/suitesparse_graphblas/api/descriptor.py index 7fde590..308a071 100644 --- a/suitesparse_graphblas/api/descriptor.py +++ b/suitesparse_graphblas/api/descriptor.py @@ -24,10 +24,15 @@ def descriptor_print(desc, name="", level=lib.GxB_COMPLETE): True """ - check_status(desc, lib.GxB_Descriptor_fprint( - desc, name.encode() if isinstance(name, str) else name, - level, ffi.NULL, - )) + check_status( + desc, + lib.GxB_Descriptor_fprint( + desc, + name.encode() if isinstance(name, str) else name, + level, + ffi.NULL, + ), + ) def descriptor_fprint(desc, f, name="", level=lib.GxB_COMPLETE): @@ -41,10 +46,15 @@ def descriptor_fprint(desc, f, name="", level=lib.GxB_COMPLETE): True """ - check_status(desc, lib.GxB_Descriptor_fprint( - desc, name.encode() if isinstance(name, str) else name, - level, f, - )) + check_status( + desc, + lib.GxB_Descriptor_fprint( + desc, + name.encode() if isinstance(name, str) else name, + level, + f, + ), + ) # --------------------------------------------------------------------------- @@ -72,9 +82,14 @@ def descriptor_set_int32(desc, field, value): False """ - check_status(desc, lib.GrB_Descriptor_set_INT32( - desc, ffi.cast("int32_t", value), field, - )) + check_status( + desc, + lib.GrB_Descriptor_set_INT32( + desc, + ffi.cast("int32_t", value), + field, + ), + ) def descriptor_get_size(desc, field): diff --git a/suitesparse_graphblas/api/examples/bfs.py b/suitesparse_graphblas/api/examples/bfs.py index 3ae7b5e..feb122c 100644 --- a/suitesparse_graphblas/api/examples/bfs.py +++ b/suitesparse_graphblas/api/examples/bfs.py @@ -95,29 +95,44 @@ def bfs(A, src, compute_level=True, compute_parent=True): if compute_level: scalar.set_int64(level_scalar, current_level) vector.vector_assign_scalar( - level_vec, level_scalar, lib.GrB_ALL, n, - mask=frontier, desc=lib.GrB_DESC_S, + level_vec, + level_scalar, + lib.GrB_ALL, + n, + mask=frontier, + desc=lib.GrB_DESC_S, ) if compute_parent: # Record parent IDs: parent = frontier vector.vector_assign( - parent_vec, frontier, lib.GrB_ALL, n, - mask=frontier, desc=lib.GrB_DESC_S, + parent_vec, + frontier, + lib.GrB_ALL, + n, + mask=frontier, + desc=lib.GrB_DESC_S, ) # Convert frontier values to their own indices (ROWINDEX). # After this, frontier(i) == i for every stored entry, # so the next vxm propagates node i as the parent ID. vector.vector_apply_indexop( - frontier, lib.GrB_ROWINDEX_INT64, frontier, index_thunk, + frontier, + lib.GrB_ROWINDEX_INT64, + frontier, + index_thunk, ) current_level += 1 # Expand frontier: frontier = frontier * A vector.vector_vxm( - frontier, semiring, frontier, A, - mask=mask, desc=lib.GrB_DESC_RSC, + frontier, + semiring, + frontier, + A, + mask=mask, + desc=lib.GrB_DESC_RSC, ) # Stop when the frontier is empty. diff --git a/suitesparse_graphblas/api/grb_type.py b/suitesparse_graphblas/api/grb_type.py index 39f8024..1c01fc3 100644 --- a/suitesparse_graphblas/api/grb_type.py +++ b/suitesparse_graphblas/api/grb_type.py @@ -69,10 +69,15 @@ def grb_type_print(T, name="", level=lib.GxB_COMPLETE): True """ - check_status(T, lib.GxB_Type_fprint( - T[0], name.encode() if isinstance(name, str) else name, - level, ffi.NULL, - )) + check_status( + T, + lib.GxB_Type_fprint( + T[0], + name.encode() if isinstance(name, str) else name, + level, + ffi.NULL, + ), + ) def grb_type_fprint(T, f, name="", level=lib.GxB_COMPLETE): @@ -87,10 +92,15 @@ def grb_type_fprint(T, f, name="", level=lib.GxB_COMPLETE): True """ - check_status(T, lib.GxB_Type_fprint( - T[0], name.encode() if isinstance(name, str) else name, - level, f, - )) + check_status( + T, + lib.GxB_Type_fprint( + T[0], + name.encode() if isinstance(name, str) else name, + level, + f, + ), + ) # --------------------------------------------------------------------------- diff --git a/suitesparse_graphblas/api/indexbinaryop.py b/suitesparse_graphblas/api/indexbinaryop.py index 6587c89..4d513ae 100644 --- a/suitesparse_graphblas/api/indexbinaryop.py +++ b/suitesparse_graphblas/api/indexbinaryop.py @@ -66,10 +66,15 @@ def indexbinaryop_print(op, name="", level=lib.GxB_COMPLETE): ``lib.GxB_SHORT``, ``lib.GxB_COMPLETE``, ``lib.GxB_SHORT_VERBOSE``, or ``lib.GxB_COMPLETE_VERBOSE``. """ - check_status(op, lib.GxB_IndexBinaryOp_fprint( - op[0], name.encode() if isinstance(name, str) else name, - level, ffi.NULL, - )) + check_status( + op, + lib.GxB_IndexBinaryOp_fprint( + op[0], + name.encode() if isinstance(name, str) else name, + level, + ffi.NULL, + ), + ) def indexbinaryop_fprint(op, f, name="", level=lib.GxB_COMPLETE): @@ -78,10 +83,15 @@ def indexbinaryop_fprint(op, f, name="", level=lib.GxB_COMPLETE): Pass ``ffi.NULL`` for ``f`` to print to stdout. ``level`` controls verbosity (see :func:`indexbinaryop_print`). """ - check_status(op, lib.GxB_IndexBinaryOp_fprint( - op[0], name.encode() if isinstance(name, str) else name, - level, f, - )) + check_status( + op, + lib.GxB_IndexBinaryOp_fprint( + op[0], + name.encode() if isinstance(name, str) else name, + level, + f, + ), + ) # --------------------------------------------------------------------------- @@ -98,9 +108,7 @@ def indexbinaryop_get_int32(op, field): def indexbinaryop_set_int32(op, field, value): """Set an operator option from an int32.""" - check_status( - op, lib.GxB_IndexBinaryOp_set_INT32(op[0], ffi.cast("int32_t", value), field) - ) + check_status(op, lib.GxB_IndexBinaryOp_set_INT32(op[0], ffi.cast("int32_t", value), field)) def indexbinaryop_get_size(op, field): diff --git a/suitesparse_graphblas/api/indexunaryop.py b/suitesparse_graphblas/api/indexunaryop.py index 06a24e9..b333fc1 100644 --- a/suitesparse_graphblas/api/indexunaryop.py +++ b/suitesparse_graphblas/api/indexunaryop.py @@ -89,10 +89,15 @@ def indexunaryop_print(op, name="", level=lib.GxB_COMPLETE): True """ - check_status(op, lib.GxB_IndexUnaryOp_fprint( - op[0], name.encode() if isinstance(name, str) else name, - level, ffi.NULL, - )) + check_status( + op, + lib.GxB_IndexUnaryOp_fprint( + op[0], + name.encode() if isinstance(name, str) else name, + level, + ffi.NULL, + ), + ) def indexunaryop_fprint(op, f, name="", level=lib.GxB_COMPLETE): @@ -107,10 +112,15 @@ def indexunaryop_fprint(op, f, name="", level=lib.GxB_COMPLETE): True """ - check_status(op, lib.GxB_IndexUnaryOp_fprint( - op[0], name.encode() if isinstance(name, str) else name, - level, f, - )) + check_status( + op, + lib.GxB_IndexUnaryOp_fprint( + op[0], + name.encode() if isinstance(name, str) else name, + level, + f, + ), + ) # --------------------------------------------------------------------------- @@ -133,9 +143,7 @@ def indexunaryop_get_int32(op, field): def indexunaryop_set_int32(op, field, value): """Set an operator option from an int32.""" - check_status( - op, lib.GrB_IndexUnaryOp_set_INT32(op[0], ffi.cast("int32_t", value), field) - ) + check_status(op, lib.GrB_IndexUnaryOp_set_INT32(op[0], ffi.cast("int32_t", value), field)) def indexunaryop_get_size(op, field): diff --git a/suitesparse_graphblas/api/iterator.py b/suitesparse_graphblas/api/iterator.py index 5df331e..bf47f1a 100644 --- a/suitesparse_graphblas/api/iterator.py +++ b/suitesparse_graphblas/api/iterator.py @@ -56,7 +56,9 @@ def matrix_iterator_attach(it, A, desc=None): """ info = lib.GxB_Matrix_Iterator_attach( - it[0], A[0], ffi.NULL if desc is None else desc, + it[0], + A[0], + ffi.NULL if desc is None else desc, ) return _check_info(info) @@ -79,7 +81,9 @@ def row_iterator_attach(it, A, desc=None): """ info = lib.GxB_rowIterator_attach( - it[0], A[0], ffi.NULL if desc is None else desc, + it[0], + A[0], + ffi.NULL if desc is None else desc, ) return _check_info(info) @@ -102,7 +106,9 @@ def col_iterator_attach(it, A, desc=None): """ info = lib.GxB_colIterator_attach( - it[0], A[0], ffi.NULL if desc is None else desc, + it[0], + A[0], + ffi.NULL if desc is None else desc, ) return _check_info(info) @@ -124,7 +130,9 @@ def vector_iterator_attach(it, v, desc=None): """ info = lib.GxB_Vector_Iterator_attach( - it[0], v[0], ffi.NULL if desc is None else desc, + it[0], + v[0], + ffi.NULL if desc is None else desc, ) return _check_info(info) diff --git a/suitesparse_graphblas/api/matrix.py b/suitesparse_graphblas/api/matrix.py index 0feedaa..157d733 100644 --- a/suitesparse_graphblas/api/matrix.py +++ b/suitesparse_graphblas/api/matrix.py @@ -4,10 +4,9 @@ from suitesparse_graphblas import check_status, ffi, lib, supports_complex -from .utils import _capture_c_output # noqa: F401 - from .io.serialize import deserialize_matrix as deserialize # noqa: F401 from .io.serialize import serialize_matrix as serialize # noqa: F401 +from .utils import _capture_c_output # noqa: F401 def matrix_free(A): @@ -204,9 +203,14 @@ def matrix_option_set_int32(A, field, value): True """ - check_status(A, lib.GxB_Matrix_Option_set_INT32( - A[0], field, ffi.cast("int32_t", value), - )) + check_status( + A, + lib.GxB_Matrix_Option_set_INT32( + A[0], + field, + ffi.cast("int32_t", value), + ), + ) def matrix_option_get_fp64(A, field): @@ -231,9 +235,14 @@ def matrix_option_set_fp64(A, field, value): True """ - check_status(A, lib.GxB_Matrix_Option_set_FP64( - A[0], field, ffi.cast("double", value), - )) + check_status( + A, + lib.GxB_Matrix_Option_set_FP64( + A[0], + field, + ffi.cast("double", value), + ), + ) # --------------------------------------------------------------------------- @@ -300,10 +309,15 @@ def matrix_print(A, name="", level=lib.GxB_COMPLETE): True """ - check_status(A, lib.GxB_Matrix_fprint( - A[0], name.encode() if isinstance(name, str) else name, - level, ffi.NULL, - )) + check_status( + A, + lib.GxB_Matrix_fprint( + A[0], + name.encode() if isinstance(name, str) else name, + level, + ffi.NULL, + ), + ) def matrix_fprint(A, f, name="", level=lib.GxB_COMPLETE): @@ -322,10 +336,15 @@ def matrix_fprint(A, f, name="", level=lib.GxB_COMPLETE): True """ - check_status(A, lib.GxB_Matrix_fprint( - A[0], name.encode() if isinstance(name, str) else name, - level, f, - )) + check_status( + A, + lib.GxB_Matrix_fprint( + A[0], + name.encode() if isinstance(name, str) else name, + level, + f, + ), + ) def matrix_mxm(C, semiring, A, B, mask=None, accum=None, desc=None): @@ -341,15 +360,18 @@ def matrix_mxm(C, semiring, A, B, mask=None, accum=None, desc=None): True """ - check_status(C, lib.GrB_mxm( - C[0], - ffi.NULL if mask is None else mask[0], - ffi.NULL if accum is None else accum, - semiring, - A[0], - B[0], - ffi.NULL if desc is None else desc, - )) + check_status( + C, + lib.GrB_mxm( + C[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + semiring, + A[0], + B[0], + ffi.NULL if desc is None else desc, + ), + ) def matrix_ewise_add(C, op, A, B, mask=None, accum=None, desc=None): @@ -365,15 +387,18 @@ def matrix_ewise_add(C, op, A, B, mask=None, accum=None, desc=None): True """ - check_status(C, lib.GrB_Matrix_eWiseAdd_BinaryOp( - C[0], - ffi.NULL if mask is None else mask[0], - ffi.NULL if accum is None else accum, - op, - A[0], - B[0], - ffi.NULL if desc is None else desc, - )) + check_status( + C, + lib.GrB_Matrix_eWiseAdd_BinaryOp( + C[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + op, + A[0], + B[0], + ffi.NULL if desc is None else desc, + ), + ) def matrix_ewise_mult(C, op, A, B, mask=None, accum=None, desc=None): @@ -389,15 +414,18 @@ def matrix_ewise_mult(C, op, A, B, mask=None, accum=None, desc=None): True """ - check_status(C, lib.GrB_Matrix_eWiseMult_BinaryOp( - C[0], - ffi.NULL if mask is None else mask[0], - ffi.NULL if accum is None else accum, - op, - A[0], - B[0], - ffi.NULL if desc is None else desc, - )) + check_status( + C, + lib.GrB_Matrix_eWiseMult_BinaryOp( + C[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + op, + A[0], + B[0], + ffi.NULL if desc is None else desc, + ), + ) def matrix_ewise_union(C, op, A, alpha, B, beta, mask=None, accum=None, desc=None): @@ -423,15 +451,20 @@ def matrix_ewise_union(C, op, A, alpha, B, beta, mask=None, accum=None, desc=Non True """ - check_status(C, lib.GxB_Matrix_eWiseUnion( - C[0], - ffi.NULL if mask is None else mask[0], - ffi.NULL if accum is None else accum, - op, - A[0], alpha[0], - B[0], beta[0], - ffi.NULL if desc is None else desc, - )) + check_status( + C, + lib.GxB_Matrix_eWiseUnion( + C[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + op, + A[0], + alpha[0], + B[0], + beta[0], + ffi.NULL if desc is None else desc, + ), + ) def matrix_apply(C, op, A, mask=None, accum=None, desc=None): @@ -445,14 +478,17 @@ def matrix_apply(C, op, A, mask=None, accum=None, desc=None): True """ - check_status(C, lib.GrB_Matrix_apply( - C[0], - ffi.NULL if mask is None else mask[0], - ffi.NULL if accum is None else accum, - op, - A[0], - ffi.NULL if desc is None else desc, - )) + check_status( + C, + lib.GrB_Matrix_apply( + C[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + op, + A[0], + ffi.NULL if desc is None else desc, + ), + ) def matrix_apply_first(C, op, x, A, mask=None, accum=None, desc=None): @@ -469,15 +505,18 @@ def matrix_apply_first(C, op, x, A, mask=None, accum=None, desc=None): True """ - check_status(C, lib.GrB_Matrix_apply_BinaryOp1st_Scalar( - C[0], - ffi.NULL if mask is None else mask[0], - ffi.NULL if accum is None else accum, - op, - x[0], - A[0], - ffi.NULL if desc is None else desc, - )) + check_status( + C, + lib.GrB_Matrix_apply_BinaryOp1st_Scalar( + C[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + op, + x[0], + A[0], + ffi.NULL if desc is None else desc, + ), + ) def matrix_apply_second(C, op, A, y, mask=None, accum=None, desc=None): @@ -494,15 +533,18 @@ def matrix_apply_second(C, op, A, y, mask=None, accum=None, desc=None): True """ - check_status(C, lib.GrB_Matrix_apply_BinaryOp2nd_Scalar( - C[0], - ffi.NULL if mask is None else mask[0], - ffi.NULL if accum is None else accum, - op, - A[0], - y[0], - ffi.NULL if desc is None else desc, - )) + check_status( + C, + lib.GrB_Matrix_apply_BinaryOp2nd_Scalar( + C[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + op, + A[0], + y[0], + ffi.NULL if desc is None else desc, + ), + ) def matrix_apply_indexop(C, op, A, thunk, mask=None, accum=None, desc=None): @@ -522,15 +564,18 @@ def matrix_apply_indexop(C, op, A, thunk, mask=None, accum=None, desc=None): True """ - check_status(C, lib.GrB_Matrix_apply_IndexOp_Scalar( - C[0], - ffi.NULL if mask is None else mask[0], - ffi.NULL if accum is None else accum, - op, - A[0], - thunk[0], - ffi.NULL if desc is None else desc, - )) + check_status( + C, + lib.GrB_Matrix_apply_IndexOp_Scalar( + C[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + op, + A[0], + thunk[0], + ffi.NULL if desc is None else desc, + ), + ) def matrix_select(C, op, A, thunk, mask=None, accum=None, desc=None): @@ -550,15 +595,18 @@ def matrix_select(C, op, A, thunk, mask=None, accum=None, desc=None): True """ - check_status(C, lib.GrB_Matrix_select_Scalar( - C[0], - ffi.NULL if mask is None else mask[0], - ffi.NULL if accum is None else accum, - op, - A[0], - thunk[0], - ffi.NULL if desc is None else desc, - )) + check_status( + C, + lib.GrB_Matrix_select_Scalar( + C[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + op, + A[0], + thunk[0], + ffi.NULL if desc is None else desc, + ), + ) def matrix_reduce(w, monoid, A, mask=None, accum=None, desc=None): @@ -574,14 +622,17 @@ def matrix_reduce(w, monoid, A, mask=None, accum=None, desc=None): True """ - check_status(w, lib.GrB_Matrix_reduce_Monoid( - w[0], - ffi.NULL if mask is None else mask[0], - ffi.NULL if accum is None else accum, - monoid, - A[0], - ffi.NULL if desc is None else desc, - )) + check_status( + w, + lib.GrB_Matrix_reduce_Monoid( + w[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + monoid, + A[0], + ffi.NULL if desc is None else desc, + ), + ) def matrix_reduce_scalar(s, monoid, A, accum=None, desc=None): @@ -597,13 +648,16 @@ def matrix_reduce_scalar(s, monoid, A, accum=None, desc=None): True """ - check_status(s, lib.GrB_Matrix_reduce_Monoid_Scalar( - s[0], - ffi.NULL if accum is None else accum, - monoid, - A[0], - ffi.NULL if desc is None else desc, - )) + check_status( + s, + lib.GrB_Matrix_reduce_Monoid_Scalar( + s[0], + ffi.NULL if accum is None else accum, + monoid, + A[0], + ffi.NULL if desc is None else desc, + ), + ) def matrix_transpose(C, A, mask=None, accum=None, desc=None): @@ -617,13 +671,16 @@ def matrix_transpose(C, A, mask=None, accum=None, desc=None): True """ - check_status(C, lib.GrB_transpose( - C[0], - ffi.NULL if mask is None else mask[0], - ffi.NULL if accum is None else accum, - A[0], - ffi.NULL if desc is None else desc, - )) + check_status( + C, + lib.GrB_transpose( + C[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + A[0], + ffi.NULL if desc is None else desc, + ), + ) def matrix_kronecker(C, op, A, B, mask=None, accum=None, desc=None): @@ -639,15 +696,18 @@ def matrix_kronecker(C, op, A, B, mask=None, accum=None, desc=None): True """ - check_status(C, lib.GrB_Matrix_kronecker_BinaryOp( - C[0], - ffi.NULL if mask is None else mask[0], - ffi.NULL if accum is None else accum, - op, - A[0], - B[0], - ffi.NULL if desc is None else desc, - )) + check_status( + C, + lib.GrB_Matrix_kronecker_BinaryOp( + C[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + op, + A[0], + B[0], + ffi.NULL if desc is None else desc, + ), + ) def matrix_diag(C, v, k=0, desc=None): @@ -671,10 +731,15 @@ def matrix_diag(C, v, k=0, desc=None): True """ - check_status(C, lib.GxB_Matrix_diag( - C[0], v[0], k, - ffi.NULL if desc is None else desc, - )) + check_status( + C, + lib.GxB_Matrix_diag( + C[0], + v[0], + k, + ffi.NULL if desc is None else desc, + ), + ) def matrix_concat(C, tiles, m, n, desc=None): @@ -698,10 +763,16 @@ def matrix_concat(C, tiles, m, n, desc=None): """ tile_array = ffi.new("GrB_Matrix[]", [t[0] for t in tiles]) - check_status(C, lib.GxB_Matrix_concat( - C[0], tile_array, m, n, - ffi.NULL if desc is None else desc, - )) + check_status( + C, + lib.GxB_Matrix_concat( + C[0], + tile_array, + m, + n, + ffi.NULL if desc is None else desc, + ), + ) def matrix_assign(C, A, rows, nrows, cols, ncols, mask=None, accum=None, desc=None): @@ -720,14 +791,20 @@ def matrix_assign(C, A, rows, nrows, cols, ncols, mask=None, accum=None, desc=No True """ - check_status(C, lib.GrB_Matrix_assign( - C[0], - ffi.NULL if mask is None else mask[0], - ffi.NULL if accum is None else accum, - A[0], - rows, nrows, cols, ncols, - ffi.NULL if desc is None else desc, - )) + check_status( + C, + lib.GrB_Matrix_assign( + C[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + A[0], + rows, + nrows, + cols, + ncols, + ffi.NULL if desc is None else desc, + ), + ) def matrix_assign_scalar(C, x, rows, nrows, cols, ncols, mask=None, accum=None, desc=None): @@ -746,14 +823,20 @@ def matrix_assign_scalar(C, x, rows, nrows, cols, ncols, mask=None, accum=None, True """ - check_status(C, lib.GrB_Matrix_assign_Scalar( - C[0], - ffi.NULL if mask is None else mask[0], - ffi.NULL if accum is None else accum, - x[0], - rows, nrows, cols, ncols, - ffi.NULL if desc is None else desc, - )) + check_status( + C, + lib.GrB_Matrix_assign_Scalar( + C[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + x[0], + rows, + nrows, + cols, + ncols, + ffi.NULL if desc is None else desc, + ), + ) def matrix_extract(C, A, rows, nrows, cols, ncols, mask=None, accum=None, desc=None): @@ -769,14 +852,20 @@ def matrix_extract(C, A, rows, nrows, cols, ncols, mask=None, accum=None, desc=N True """ - check_status(C, lib.GrB_Matrix_extract( - C[0], - ffi.NULL if mask is None else mask[0], - ffi.NULL if accum is None else accum, - A[0], - rows, nrows, cols, ncols, - ffi.NULL if desc is None else desc, - )) + check_status( + C, + lib.GrB_Matrix_extract( + C[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + A[0], + rows, + nrows, + cols, + ncols, + ffi.NULL if desc is None else desc, + ), + ) def matrix_col_extract(w, A, rows, nrows, j, mask=None, accum=None, desc=None): @@ -791,14 +880,19 @@ def matrix_col_extract(w, A, rows, nrows, j, mask=None, accum=None, desc=None): True """ - check_status(w, lib.GrB_Col_extract( - w[0], - ffi.NULL if mask is None else mask[0], - ffi.NULL if accum is None else accum, - A[0], - rows, nrows, j, - ffi.NULL if desc is None else desc, - )) + check_status( + w, + lib.GrB_Col_extract( + w[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + A[0], + rows, + nrows, + j, + ffi.NULL if desc is None else desc, + ), + ) def matrix_col_assign(C, u, rows, nrows, j, mask=None, accum=None, desc=None): @@ -813,14 +907,19 @@ def matrix_col_assign(C, u, rows, nrows, j, mask=None, accum=None, desc=None): True """ - check_status(C, lib.GrB_Col_assign( - C[0], - ffi.NULL if mask is None else mask[0], - ffi.NULL if accum is None else accum, - u[0], - rows, nrows, j, - ffi.NULL if desc is None else desc, - )) + check_status( + C, + lib.GrB_Col_assign( + C[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + u[0], + rows, + nrows, + j, + ffi.NULL if desc is None else desc, + ), + ) def matrix_row_assign(C, u, i, cols, ncols, mask=None, accum=None, desc=None): @@ -835,14 +934,19 @@ def matrix_row_assign(C, u, i, cols, ncols, mask=None, accum=None, desc=None): True """ - check_status(C, lib.GrB_Row_assign( - C[0], - ffi.NULL if mask is None else mask[0], - ffi.NULL if accum is None else accum, - u[0], - i, cols, ncols, - ffi.NULL if desc is None else desc, - )) + check_status( + C, + lib.GrB_Row_assign( + C[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + u[0], + i, + cols, + ncols, + ffi.NULL if desc is None else desc, + ), + ) def matrix_build_bool(C, rows, cols, vals, nvals, dup): @@ -857,13 +961,17 @@ def matrix_build_bool(C, rows, cols, vals, nvals, dup): True """ - check_status(C, lib.GrB_Matrix_build_BOOL( - C[0], - ffi.cast("GrB_Index*", ffi.from_buffer(rows)), - ffi.cast("GrB_Index*", ffi.from_buffer(cols)), - ffi.cast("bool*", ffi.from_buffer(vals)), - nvals, dup, - )) + check_status( + C, + lib.GrB_Matrix_build_BOOL( + C[0], + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("bool*", ffi.from_buffer(vals)), + nvals, + dup, + ), + ) def matrix_build_int8(C, rows, cols, vals, nvals, dup): @@ -878,13 +986,17 @@ def matrix_build_int8(C, rows, cols, vals, nvals, dup): True """ - check_status(C, lib.GrB_Matrix_build_INT8( - C[0], - ffi.cast("GrB_Index*", ffi.from_buffer(rows)), - ffi.cast("GrB_Index*", ffi.from_buffer(cols)), - ffi.cast("int8_t*", ffi.from_buffer(vals)), - nvals, dup, - )) + check_status( + C, + lib.GrB_Matrix_build_INT8( + C[0], + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("int8_t*", ffi.from_buffer(vals)), + nvals, + dup, + ), + ) def matrix_build_int16(C, rows, cols, vals, nvals, dup): @@ -899,13 +1011,17 @@ def matrix_build_int16(C, rows, cols, vals, nvals, dup): True """ - check_status(C, lib.GrB_Matrix_build_INT16( - C[0], - ffi.cast("GrB_Index*", ffi.from_buffer(rows)), - ffi.cast("GrB_Index*", ffi.from_buffer(cols)), - ffi.cast("int16_t*", ffi.from_buffer(vals)), - nvals, dup, - )) + check_status( + C, + lib.GrB_Matrix_build_INT16( + C[0], + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("int16_t*", ffi.from_buffer(vals)), + nvals, + dup, + ), + ) def matrix_build_int32(C, rows, cols, vals, nvals, dup): @@ -920,13 +1036,17 @@ def matrix_build_int32(C, rows, cols, vals, nvals, dup): True """ - check_status(C, lib.GrB_Matrix_build_INT32( - C[0], - ffi.cast("GrB_Index*", ffi.from_buffer(rows)), - ffi.cast("GrB_Index*", ffi.from_buffer(cols)), - ffi.cast("int32_t*", ffi.from_buffer(vals)), - nvals, dup, - )) + check_status( + C, + lib.GrB_Matrix_build_INT32( + C[0], + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("int32_t*", ffi.from_buffer(vals)), + nvals, + dup, + ), + ) def matrix_build_int64(C, rows, cols, vals, nvals, dup): @@ -941,13 +1061,17 @@ def matrix_build_int64(C, rows, cols, vals, nvals, dup): True """ - check_status(C, lib.GrB_Matrix_build_INT64( - C[0], - ffi.cast("GrB_Index*", ffi.from_buffer(rows)), - ffi.cast("GrB_Index*", ffi.from_buffer(cols)), - ffi.cast("int64_t*", ffi.from_buffer(vals)), - nvals, dup, - )) + check_status( + C, + lib.GrB_Matrix_build_INT64( + C[0], + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("int64_t*", ffi.from_buffer(vals)), + nvals, + dup, + ), + ) def matrix_build_uint8(C, rows, cols, vals, nvals, dup): @@ -962,13 +1086,17 @@ def matrix_build_uint8(C, rows, cols, vals, nvals, dup): True """ - check_status(C, lib.GrB_Matrix_build_UINT8( - C[0], - ffi.cast("GrB_Index*", ffi.from_buffer(rows)), - ffi.cast("GrB_Index*", ffi.from_buffer(cols)), - ffi.cast("uint8_t*", ffi.from_buffer(vals)), - nvals, dup, - )) + check_status( + C, + lib.GrB_Matrix_build_UINT8( + C[0], + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("uint8_t*", ffi.from_buffer(vals)), + nvals, + dup, + ), + ) def matrix_build_uint16(C, rows, cols, vals, nvals, dup): @@ -983,13 +1111,17 @@ def matrix_build_uint16(C, rows, cols, vals, nvals, dup): True """ - check_status(C, lib.GrB_Matrix_build_UINT16( - C[0], - ffi.cast("GrB_Index*", ffi.from_buffer(rows)), - ffi.cast("GrB_Index*", ffi.from_buffer(cols)), - ffi.cast("uint16_t*", ffi.from_buffer(vals)), - nvals, dup, - )) + check_status( + C, + lib.GrB_Matrix_build_UINT16( + C[0], + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("uint16_t*", ffi.from_buffer(vals)), + nvals, + dup, + ), + ) def matrix_build_uint32(C, rows, cols, vals, nvals, dup): @@ -1004,13 +1136,17 @@ def matrix_build_uint32(C, rows, cols, vals, nvals, dup): True """ - check_status(C, lib.GrB_Matrix_build_UINT32( - C[0], - ffi.cast("GrB_Index*", ffi.from_buffer(rows)), - ffi.cast("GrB_Index*", ffi.from_buffer(cols)), - ffi.cast("uint32_t*", ffi.from_buffer(vals)), - nvals, dup, - )) + check_status( + C, + lib.GrB_Matrix_build_UINT32( + C[0], + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("uint32_t*", ffi.from_buffer(vals)), + nvals, + dup, + ), + ) def matrix_build_uint64(C, rows, cols, vals, nvals, dup): @@ -1025,13 +1161,17 @@ def matrix_build_uint64(C, rows, cols, vals, nvals, dup): True """ - check_status(C, lib.GrB_Matrix_build_UINT64( - C[0], - ffi.cast("GrB_Index*", ffi.from_buffer(rows)), - ffi.cast("GrB_Index*", ffi.from_buffer(cols)), - ffi.cast("uint64_t*", ffi.from_buffer(vals)), - nvals, dup, - )) + check_status( + C, + lib.GrB_Matrix_build_UINT64( + C[0], + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("uint64_t*", ffi.from_buffer(vals)), + nvals, + dup, + ), + ) def matrix_build_fp32(C, rows, cols, vals, nvals, dup): @@ -1046,13 +1186,17 @@ def matrix_build_fp32(C, rows, cols, vals, nvals, dup): True """ - check_status(C, lib.GrB_Matrix_build_FP32( - C[0], - ffi.cast("GrB_Index*", ffi.from_buffer(rows)), - ffi.cast("GrB_Index*", ffi.from_buffer(cols)), - ffi.cast("float*", ffi.from_buffer(vals)), - nvals, dup, - )) + check_status( + C, + lib.GrB_Matrix_build_FP32( + C[0], + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("float*", ffi.from_buffer(vals)), + nvals, + dup, + ), + ) def matrix_build_fp64(C, rows, cols, vals, nvals, dup): @@ -1067,13 +1211,17 @@ def matrix_build_fp64(C, rows, cols, vals, nvals, dup): True """ - check_status(C, lib.GrB_Matrix_build_FP64( - C[0], - ffi.cast("GrB_Index*", ffi.from_buffer(rows)), - ffi.cast("GrB_Index*", ffi.from_buffer(cols)), - ffi.cast("double*", ffi.from_buffer(vals)), - nvals, dup, - )) + check_status( + C, + lib.GrB_Matrix_build_FP64( + C[0], + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("double*", ffi.from_buffer(vals)), + nvals, + dup, + ), + ) def matrix_extract_tuples_int64(A): @@ -1096,12 +1244,16 @@ def matrix_extract_tuples_int64(A): vals = np.empty(n, dtype=np.int64) nvals_p = ffi.new("GrB_Index*", n) if n > 0: - check_status(A, lib.GrB_Matrix_extractTuples_INT64( - ffi.cast("GrB_Index*", ffi.from_buffer(rows)), - ffi.cast("GrB_Index*", ffi.from_buffer(cols)), - ffi.cast("int64_t*", ffi.from_buffer(vals)), - nvals_p, A[0], - )) + check_status( + A, + lib.GrB_Matrix_extractTuples_INT64( + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("int64_t*", ffi.from_buffer(vals)), + nvals_p, + A[0], + ), + ) return rows, cols, vals @@ -1125,14 +1277,19 @@ def matrix_extract_tuples_fp64(A): vals = np.empty(n, dtype=np.float64) nvals_p = ffi.new("GrB_Index*", n) if n > 0: - check_status(A, lib.GrB_Matrix_extractTuples_FP64( - ffi.cast("GrB_Index*", ffi.from_buffer(rows)), - ffi.cast("GrB_Index*", ffi.from_buffer(cols)), - ffi.cast("double*", ffi.from_buffer(vals)), - nvals_p, A[0], - )) + check_status( + A, + lib.GrB_Matrix_extractTuples_FP64( + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("double*", ffi.from_buffer(vals)), + nvals_p, + A[0], + ), + ) return rows, cols, vals + def matrix_extract_tuples_bool(A): """Extract all tuples from a matrix as numpy arrays. @@ -1153,14 +1310,19 @@ def matrix_extract_tuples_bool(A): vals = np.empty(n, dtype=np.bool_) nvals_p = ffi.new("GrB_Index*", n) if n > 0: - check_status(A, lib.GrB_Matrix_extractTuples_BOOL( - ffi.cast("GrB_Index*", ffi.from_buffer(rows)), - ffi.cast("GrB_Index*", ffi.from_buffer(cols)), - ffi.cast("bool*", ffi.from_buffer(vals)), - nvals_p, A[0], - )) + check_status( + A, + lib.GrB_Matrix_extractTuples_BOOL( + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("bool*", ffi.from_buffer(vals)), + nvals_p, + A[0], + ), + ) return rows, cols, vals + def matrix_extract_tuples_int8(A): """Extract all tuples from a matrix as numpy arrays. @@ -1181,14 +1343,19 @@ def matrix_extract_tuples_int8(A): vals = np.empty(n, dtype=np.int8) nvals_p = ffi.new("GrB_Index*", n) if n > 0: - check_status(A, lib.GrB_Matrix_extractTuples_INT8( - ffi.cast("GrB_Index*", ffi.from_buffer(rows)), - ffi.cast("GrB_Index*", ffi.from_buffer(cols)), - ffi.cast("int8_t*", ffi.from_buffer(vals)), - nvals_p, A[0], - )) + check_status( + A, + lib.GrB_Matrix_extractTuples_INT8( + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("int8_t*", ffi.from_buffer(vals)), + nvals_p, + A[0], + ), + ) return rows, cols, vals + def matrix_extract_tuples_int16(A): """Extract all tuples from a matrix as numpy arrays. @@ -1209,14 +1376,19 @@ def matrix_extract_tuples_int16(A): vals = np.empty(n, dtype=np.int16) nvals_p = ffi.new("GrB_Index*", n) if n > 0: - check_status(A, lib.GrB_Matrix_extractTuples_INT16( - ffi.cast("GrB_Index*", ffi.from_buffer(rows)), - ffi.cast("GrB_Index*", ffi.from_buffer(cols)), - ffi.cast("int16_t*", ffi.from_buffer(vals)), - nvals_p, A[0], - )) + check_status( + A, + lib.GrB_Matrix_extractTuples_INT16( + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("int16_t*", ffi.from_buffer(vals)), + nvals_p, + A[0], + ), + ) return rows, cols, vals + def matrix_extract_tuples_int32(A): """Extract all tuples from a matrix as numpy arrays. @@ -1237,14 +1409,19 @@ def matrix_extract_tuples_int32(A): vals = np.empty(n, dtype=np.int32) nvals_p = ffi.new("GrB_Index*", n) if n > 0: - check_status(A, lib.GrB_Matrix_extractTuples_INT32( - ffi.cast("GrB_Index*", ffi.from_buffer(rows)), - ffi.cast("GrB_Index*", ffi.from_buffer(cols)), - ffi.cast("int32_t*", ffi.from_buffer(vals)), - nvals_p, A[0], - )) + check_status( + A, + lib.GrB_Matrix_extractTuples_INT32( + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("int32_t*", ffi.from_buffer(vals)), + nvals_p, + A[0], + ), + ) return rows, cols, vals + def matrix_extract_tuples_uint8(A): """Extract all tuples from a matrix as numpy arrays. @@ -1265,14 +1442,19 @@ def matrix_extract_tuples_uint8(A): vals = np.empty(n, dtype=np.uint8) nvals_p = ffi.new("GrB_Index*", n) if n > 0: - check_status(A, lib.GrB_Matrix_extractTuples_UINT8( - ffi.cast("GrB_Index*", ffi.from_buffer(rows)), - ffi.cast("GrB_Index*", ffi.from_buffer(cols)), - ffi.cast("uint8_t*", ffi.from_buffer(vals)), - nvals_p, A[0], - )) + check_status( + A, + lib.GrB_Matrix_extractTuples_UINT8( + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("uint8_t*", ffi.from_buffer(vals)), + nvals_p, + A[0], + ), + ) return rows, cols, vals + def matrix_extract_tuples_uint16(A): """Extract all tuples from a matrix as numpy arrays. @@ -1293,14 +1475,19 @@ def matrix_extract_tuples_uint16(A): vals = np.empty(n, dtype=np.uint16) nvals_p = ffi.new("GrB_Index*", n) if n > 0: - check_status(A, lib.GrB_Matrix_extractTuples_UINT16( - ffi.cast("GrB_Index*", ffi.from_buffer(rows)), - ffi.cast("GrB_Index*", ffi.from_buffer(cols)), - ffi.cast("uint16_t*", ffi.from_buffer(vals)), - nvals_p, A[0], - )) + check_status( + A, + lib.GrB_Matrix_extractTuples_UINT16( + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("uint16_t*", ffi.from_buffer(vals)), + nvals_p, + A[0], + ), + ) return rows, cols, vals + def matrix_extract_tuples_uint32(A): """Extract all tuples from a matrix as numpy arrays. @@ -1321,14 +1508,19 @@ def matrix_extract_tuples_uint32(A): vals = np.empty(n, dtype=np.uint32) nvals_p = ffi.new("GrB_Index*", n) if n > 0: - check_status(A, lib.GrB_Matrix_extractTuples_UINT32( - ffi.cast("GrB_Index*", ffi.from_buffer(rows)), - ffi.cast("GrB_Index*", ffi.from_buffer(cols)), - ffi.cast("uint32_t*", ffi.from_buffer(vals)), - nvals_p, A[0], - )) + check_status( + A, + lib.GrB_Matrix_extractTuples_UINT32( + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("uint32_t*", ffi.from_buffer(vals)), + nvals_p, + A[0], + ), + ) return rows, cols, vals + def matrix_extract_tuples_uint64(A): """Extract all tuples from a matrix as numpy arrays. @@ -1349,14 +1541,19 @@ def matrix_extract_tuples_uint64(A): vals = np.empty(n, dtype=np.uint64) nvals_p = ffi.new("GrB_Index*", n) if n > 0: - check_status(A, lib.GrB_Matrix_extractTuples_UINT64( - ffi.cast("GrB_Index*", ffi.from_buffer(rows)), - ffi.cast("GrB_Index*", ffi.from_buffer(cols)), - ffi.cast("uint64_t*", ffi.from_buffer(vals)), - nvals_p, A[0], - )) + check_status( + A, + lib.GrB_Matrix_extractTuples_UINT64( + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("uint64_t*", ffi.from_buffer(vals)), + nvals_p, + A[0], + ), + ) return rows, cols, vals + def matrix_extract_tuples_fp32(A): """Extract all tuples from a matrix as numpy arrays. @@ -1377,12 +1574,16 @@ def matrix_extract_tuples_fp32(A): vals = np.empty(n, dtype=np.float32) nvals_p = ffi.new("GrB_Index*", n) if n > 0: - check_status(A, lib.GrB_Matrix_extractTuples_FP32( - ffi.cast("GrB_Index*", ffi.from_buffer(rows)), - ffi.cast("GrB_Index*", ffi.from_buffer(cols)), - ffi.cast("float*", ffi.from_buffer(vals)), - nvals_p, A[0], - )) + check_status( + A, + lib.GrB_Matrix_extractTuples_FP32( + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("float*", ffi.from_buffer(vals)), + nvals_p, + A[0], + ), + ) return rows, cols, vals @@ -1734,13 +1935,17 @@ def matrix_build_fc32(C, rows, cols, vals, nvals, dup): True """ - check_status(C, lib.GxB_Matrix_build_FC32( - C[0], - ffi.cast("GrB_Index*", ffi.from_buffer(rows)), - ffi.cast("GrB_Index*", ffi.from_buffer(cols)), - ffi.cast("GxB_FC32_t*", ffi.from_buffer(vals)), - nvals, dup, - )) + check_status( + C, + lib.GxB_Matrix_build_FC32( + C[0], + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("GxB_FC32_t*", ffi.from_buffer(vals)), + nvals, + dup, + ), + ) def matrix_extract_tuples_fc32(A): """Extract all tuples from a matrix as numpy arrays. @@ -1762,12 +1967,16 @@ def matrix_extract_tuples_fc32(A): vals = np.empty(n, dtype=np.complex64) nvals_p = ffi.new("GrB_Index*", n) if n > 0: - check_status(A, lib.GxB_Matrix_extractTuples_FC32( - ffi.cast("GrB_Index*", ffi.from_buffer(rows)), - ffi.cast("GrB_Index*", ffi.from_buffer(cols)), - ffi.cast("GxB_FC32_t*", ffi.from_buffer(vals)), - nvals_p, A[0], - )) + check_status( + A, + lib.GxB_Matrix_extractTuples_FC32( + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("GxB_FC32_t*", ffi.from_buffer(vals)), + nvals_p, + A[0], + ), + ) return rows, cols, vals def matrix_build_fc64(C, rows, cols, vals, nvals, dup): @@ -1782,13 +1991,17 @@ def matrix_build_fc64(C, rows, cols, vals, nvals, dup): True """ - check_status(C, lib.GxB_Matrix_build_FC64( - C[0], - ffi.cast("GrB_Index*", ffi.from_buffer(rows)), - ffi.cast("GrB_Index*", ffi.from_buffer(cols)), - ffi.cast("GxB_FC64_t*", ffi.from_buffer(vals)), - nvals, dup, - )) + check_status( + C, + lib.GxB_Matrix_build_FC64( + C[0], + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("GxB_FC64_t*", ffi.from_buffer(vals)), + nvals, + dup, + ), + ) def matrix_extract_tuples_fc64(A): """Extract all tuples from a matrix as numpy arrays. @@ -1810,10 +2023,14 @@ def matrix_extract_tuples_fc64(A): vals = np.empty(n, dtype=np.complex128) nvals_p = ffi.new("GrB_Index*", n) if n > 0: - check_status(A, lib.GxB_Matrix_extractTuples_FC64( - ffi.cast("GrB_Index*", ffi.from_buffer(rows)), - ffi.cast("GrB_Index*", ffi.from_buffer(cols)), - ffi.cast("GxB_FC64_t*", ffi.from_buffer(vals)), - nvals_p, A[0], - )) + check_status( + A, + lib.GxB_Matrix_extractTuples_FC64( + ffi.cast("GrB_Index*", ffi.from_buffer(rows)), + ffi.cast("GrB_Index*", ffi.from_buffer(cols)), + ffi.cast("GxB_FC64_t*", ffi.from_buffer(vals)), + nvals_p, + A[0], + ), + ) return rows, cols, vals diff --git a/suitesparse_graphblas/api/monoid.py b/suitesparse_graphblas/api/monoid.py index 64dcc9d..4706b05 100644 --- a/suitesparse_graphblas/api/monoid.py +++ b/suitesparse_graphblas/api/monoid.py @@ -471,10 +471,15 @@ def monoid_print(m, name="", level=lib.GxB_COMPLETE): True """ - check_status(m, lib.GxB_Monoid_fprint( - m[0], name.encode() if isinstance(name, str) else name, - level, ffi.NULL, - )) + check_status( + m, + lib.GxB_Monoid_fprint( + m[0], + name.encode() if isinstance(name, str) else name, + level, + ffi.NULL, + ), + ) def monoid_fprint(m, f, name="", level=lib.GxB_COMPLETE): @@ -489,10 +494,15 @@ def monoid_fprint(m, f, name="", level=lib.GxB_COMPLETE): True """ - check_status(m, lib.GxB_Monoid_fprint( - m[0], name.encode() if isinstance(name, str) else name, - level, f, - )) + check_status( + m, + lib.GxB_Monoid_fprint( + m[0], + name.encode() if isinstance(name, str) else name, + level, + f, + ), + ) # --------------------------------------------------------------------------- @@ -514,9 +524,7 @@ def monoid_get_int32(m, field): def monoid_set_int32(m, field, value): - """Set a monoid option from an int32. - - """ + """Set a monoid option from an int32.""" check_status(m, lib.GrB_Monoid_set_INT32(m[0], ffi.cast("int32_t", value), field)) @@ -547,9 +555,7 @@ def monoid_get_string(m, field): def monoid_set_string(m, field, value): - """Set a monoid option from a string. - - """ + """Set a monoid option from a string.""" check_status(m, lib.GrB_Monoid_set_String(m[0], value.encode(), field)) diff --git a/suitesparse_graphblas/api/scalar.py b/suitesparse_graphblas/api/scalar.py index b76e7b6..f4537a3 100644 --- a/suitesparse_graphblas/api/scalar.py +++ b/suitesparse_graphblas/api/scalar.py @@ -104,10 +104,15 @@ def scalar_print(s, name="", level=lib.GxB_COMPLETE): True """ - check_status(s, lib.GxB_Scalar_fprint( - s[0], name.encode() if isinstance(name, str) else name, - level, ffi.NULL, - )) + check_status( + s, + lib.GxB_Scalar_fprint( + s[0], + name.encode() if isinstance(name, str) else name, + level, + ffi.NULL, + ), + ) def scalar_fprint(s, f, name="", level=lib.GxB_COMPLETE): @@ -125,10 +130,15 @@ def scalar_fprint(s, f, name="", level=lib.GxB_COMPLETE): True """ - check_status(s, lib.GxB_Scalar_fprint( - s[0], name.encode() if isinstance(name, str) else name, - level, f, - )) + check_status( + s, + lib.GxB_Scalar_fprint( + s[0], + name.encode() if isinstance(name, str) else name, + level, + f, + ), + ) def set_bool(s, value): diff --git a/suitesparse_graphblas/api/selectop.py b/suitesparse_graphblas/api/selectop.py index b68b389..f80aa75 100644 --- a/suitesparse_graphblas/api/selectop.py +++ b/suitesparse_graphblas/api/selectop.py @@ -51,8 +51,10 @@ def selectop_print(op, name="", level=lib.GxB_COMPLETE): """ info = lib.GxB_SelectOp_fprint( - op[0], name.encode() if isinstance(name, str) else name, - level, ffi.NULL, + op[0], + name.encode() if isinstance(name, str) else name, + level, + ffi.NULL, ) if info != lib.GrB_SUCCESS: raise _error_code_lookup.get(info, RuntimeError)( @@ -73,8 +75,10 @@ def selectop_fprint(op, f, name="", level=lib.GxB_COMPLETE): """ info = lib.GxB_SelectOp_fprint( - op[0], name.encode() if isinstance(name, str) else name, - level, f, + op[0], + name.encode() if isinstance(name, str) else name, + level, + f, ) if info != lib.GrB_SUCCESS: raise _error_code_lookup.get(info, RuntimeError)( diff --git a/suitesparse_graphblas/api/semiring.py b/suitesparse_graphblas/api/semiring.py index 03ef469..e942c3c 100644 --- a/suitesparse_graphblas/api/semiring.py +++ b/suitesparse_graphblas/api/semiring.py @@ -69,10 +69,15 @@ def semiring_print(s, name="", level=lib.GxB_COMPLETE): True """ - check_status(s, lib.GxB_Semiring_fprint( - s[0], name.encode() if isinstance(name, str) else name, - level, ffi.NULL, - )) + check_status( + s, + lib.GxB_Semiring_fprint( + s[0], + name.encode() if isinstance(name, str) else name, + level, + ffi.NULL, + ), + ) def semiring_fprint(s, f, name="", level=lib.GxB_COMPLETE): @@ -87,10 +92,15 @@ def semiring_fprint(s, f, name="", level=lib.GxB_COMPLETE): True """ - check_status(s, lib.GxB_Semiring_fprint( - s[0], name.encode() if isinstance(name, str) else name, - level, f, - )) + check_status( + s, + lib.GxB_Semiring_fprint( + s[0], + name.encode() if isinstance(name, str) else name, + level, + f, + ), + ) # --------------------------------------------------------------------------- @@ -112,9 +122,7 @@ def semiring_get_int32(s, field): def semiring_set_int32(s, field, value): - """Set a semiring option from an int32. - - """ + """Set a semiring option from an int32.""" check_status(s, lib.GrB_Semiring_set_INT32(s[0], ffi.cast("int32_t", value), field)) @@ -145,9 +153,7 @@ def semiring_get_string(s, field): def semiring_set_string(s, field, value): - """Set a semiring option from a string. - - """ + """Set a semiring option from a string.""" check_status(s, lib.GrB_Semiring_set_String(s[0], value.encode(), field)) diff --git a/suitesparse_graphblas/api/unaryop.py b/suitesparse_graphblas/api/unaryop.py index e16dd21..f5f4fc3 100644 --- a/suitesparse_graphblas/api/unaryop.py +++ b/suitesparse_graphblas/api/unaryop.py @@ -88,10 +88,15 @@ def unaryop_print(op, name="", level=lib.GxB_COMPLETE): True """ - check_status(op, lib.GxB_UnaryOp_fprint( - op[0], name.encode() if isinstance(name, str) else name, - level, ffi.NULL, - )) + check_status( + op, + lib.GxB_UnaryOp_fprint( + op[0], + name.encode() if isinstance(name, str) else name, + level, + ffi.NULL, + ), + ) def unaryop_fprint(op, f, name="", level=lib.GxB_COMPLETE): @@ -106,10 +111,15 @@ def unaryop_fprint(op, f, name="", level=lib.GxB_COMPLETE): True """ - check_status(op, lib.GxB_UnaryOp_fprint( - op[0], name.encode() if isinstance(name, str) else name, - level, f, - )) + check_status( + op, + lib.GxB_UnaryOp_fprint( + op[0], + name.encode() if isinstance(name, str) else name, + level, + f, + ), + ) # --------------------------------------------------------------------------- diff --git a/suitesparse_graphblas/api/vector.py b/suitesparse_graphblas/api/vector.py index f144cc4..f123028 100644 --- a/suitesparse_graphblas/api/vector.py +++ b/suitesparse_graphblas/api/vector.py @@ -4,10 +4,9 @@ from suitesparse_graphblas import check_status, ffi, lib, supports_complex -from .utils import _capture_c_output # noqa: F401 - from .io.serialize import deserialize_vector as deserialize # noqa: F401 from .io.serialize import serialize_vector as serialize # noqa: F401 +from .utils import _capture_c_output # noqa: F401 def vector_free(v): @@ -105,9 +104,14 @@ def vector_option_set_int32(v, field, value): True """ - check_status(v, lib.GxB_Vector_Option_set_INT32( - v[0], field, ffi.cast("int32_t", value), - )) + check_status( + v, + lib.GxB_Vector_Option_set_INT32( + v[0], + field, + ffi.cast("int32_t", value), + ), + ) def vector_option_get_fp64(v, field): @@ -132,9 +136,14 @@ def vector_option_set_fp64(v, field, value): True """ - check_status(v, lib.GxB_Vector_Option_set_FP64( - v[0], field, ffi.cast("double", value), - )) + check_status( + v, + lib.GxB_Vector_Option_set_FP64( + v[0], + field, + ffi.cast("double", value), + ), + ) # --------------------------------------------------------------------------- @@ -201,10 +210,15 @@ def vector_print(v, name="", level=lib.GxB_COMPLETE): True """ - check_status(v, lib.GxB_Vector_fprint( - v[0], name.encode() if isinstance(name, str) else name, - level, ffi.NULL, - )) + check_status( + v, + lib.GxB_Vector_fprint( + v[0], + name.encode() if isinstance(name, str) else name, + level, + ffi.NULL, + ), + ) def vector_fprint(v, f, name="", level=lib.GxB_COMPLETE): @@ -223,10 +237,15 @@ def vector_fprint(v, f, name="", level=lib.GxB_COMPLETE): True """ - check_status(v, lib.GxB_Vector_fprint( - v[0], name.encode() if isinstance(name, str) else name, - level, f, - )) + check_status( + v, + lib.GxB_Vector_fprint( + v[0], + name.encode() if isinstance(name, str) else name, + level, + f, + ), + ) def vector_mxv(w, semiring, A, u, mask=None, accum=None, desc=None): @@ -243,15 +262,18 @@ def vector_mxv(w, semiring, A, u, mask=None, accum=None, desc=None): True """ - check_status(w, lib.GrB_mxv( - w[0], - ffi.NULL if mask is None else mask[0], - ffi.NULL if accum is None else accum, - semiring, - A[0], - u[0], - ffi.NULL if desc is None else desc, - )) + check_status( + w, + lib.GrB_mxv( + w[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + semiring, + A[0], + u[0], + ffi.NULL if desc is None else desc, + ), + ) def vector_vxm(w, semiring, u, A, mask=None, accum=None, desc=None): @@ -268,15 +290,18 @@ def vector_vxm(w, semiring, u, A, mask=None, accum=None, desc=None): True """ - check_status(w, lib.GrB_vxm( - w[0], - ffi.NULL if mask is None else mask[0], - ffi.NULL if accum is None else accum, - semiring, - u[0], - A[0], - ffi.NULL if desc is None else desc, - )) + check_status( + w, + lib.GrB_vxm( + w[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + semiring, + u[0], + A[0], + ffi.NULL if desc is None else desc, + ), + ) def vector_ewise_add(w, op, u, v, mask=None, accum=None, desc=None): @@ -292,15 +317,18 @@ def vector_ewise_add(w, op, u, v, mask=None, accum=None, desc=None): True """ - check_status(w, lib.GrB_Vector_eWiseAdd_BinaryOp( - w[0], - ffi.NULL if mask is None else mask[0], - ffi.NULL if accum is None else accum, - op, - u[0], - v[0], - ffi.NULL if desc is None else desc, - )) + check_status( + w, + lib.GrB_Vector_eWiseAdd_BinaryOp( + w[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + op, + u[0], + v[0], + ffi.NULL if desc is None else desc, + ), + ) def vector_ewise_mult(w, op, u, v, mask=None, accum=None, desc=None): @@ -316,15 +344,18 @@ def vector_ewise_mult(w, op, u, v, mask=None, accum=None, desc=None): True """ - check_status(w, lib.GrB_Vector_eWiseMult_BinaryOp( - w[0], - ffi.NULL if mask is None else mask[0], - ffi.NULL if accum is None else accum, - op, - u[0], - v[0], - ffi.NULL if desc is None else desc, - )) + check_status( + w, + lib.GrB_Vector_eWiseMult_BinaryOp( + w[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + op, + u[0], + v[0], + ffi.NULL if desc is None else desc, + ), + ) def vector_ewise_union(w, op, u, alpha, v, beta, mask=None, accum=None, desc=None): @@ -350,15 +381,20 @@ def vector_ewise_union(w, op, u, alpha, v, beta, mask=None, accum=None, desc=Non True """ - check_status(w, lib.GxB_Vector_eWiseUnion( - w[0], - ffi.NULL if mask is None else mask[0], - ffi.NULL if accum is None else accum, - op, - u[0], alpha[0], - v[0], beta[0], - ffi.NULL if desc is None else desc, - )) + check_status( + w, + lib.GxB_Vector_eWiseUnion( + w[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + op, + u[0], + alpha[0], + v[0], + beta[0], + ffi.NULL if desc is None else desc, + ), + ) def vector_apply(w, op, u, mask=None, accum=None, desc=None): @@ -372,14 +408,17 @@ def vector_apply(w, op, u, mask=None, accum=None, desc=None): True """ - check_status(w, lib.GrB_Vector_apply( - w[0], - ffi.NULL if mask is None else mask[0], - ffi.NULL if accum is None else accum, - op, - u[0], - ffi.NULL if desc is None else desc, - )) + check_status( + w, + lib.GrB_Vector_apply( + w[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + op, + u[0], + ffi.NULL if desc is None else desc, + ), + ) def vector_apply_first(w, op, x, u, mask=None, accum=None, desc=None): @@ -396,15 +435,18 @@ def vector_apply_first(w, op, x, u, mask=None, accum=None, desc=None): True """ - check_status(w, lib.GrB_Vector_apply_BinaryOp1st_Scalar( - w[0], - ffi.NULL if mask is None else mask[0], - ffi.NULL if accum is None else accum, - op, - x[0], - u[0], - ffi.NULL if desc is None else desc, - )) + check_status( + w, + lib.GrB_Vector_apply_BinaryOp1st_Scalar( + w[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + op, + x[0], + u[0], + ffi.NULL if desc is None else desc, + ), + ) def vector_apply_second(w, op, u, y, mask=None, accum=None, desc=None): @@ -421,15 +463,18 @@ def vector_apply_second(w, op, u, y, mask=None, accum=None, desc=None): True """ - check_status(w, lib.GrB_Vector_apply_BinaryOp2nd_Scalar( - w[0], - ffi.NULL if mask is None else mask[0], - ffi.NULL if accum is None else accum, - op, - u[0], - y[0], - ffi.NULL if desc is None else desc, - )) + check_status( + w, + lib.GrB_Vector_apply_BinaryOp2nd_Scalar( + w[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + op, + u[0], + y[0], + ffi.NULL if desc is None else desc, + ), + ) def vector_apply_indexop(w, op, u, thunk, mask=None, accum=None, desc=None): @@ -449,15 +494,18 @@ def vector_apply_indexop(w, op, u, thunk, mask=None, accum=None, desc=None): True """ - check_status(w, lib.GrB_Vector_apply_IndexOp_Scalar( - w[0], - ffi.NULL if mask is None else mask[0], - ffi.NULL if accum is None else accum, - op, - u[0], - thunk[0], - ffi.NULL if desc is None else desc, - )) + check_status( + w, + lib.GrB_Vector_apply_IndexOp_Scalar( + w[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + op, + u[0], + thunk[0], + ffi.NULL if desc is None else desc, + ), + ) def vector_select(w, op, u, thunk, mask=None, accum=None, desc=None): @@ -477,15 +525,18 @@ def vector_select(w, op, u, thunk, mask=None, accum=None, desc=None): True """ - check_status(w, lib.GrB_Vector_select_Scalar( - w[0], - ffi.NULL if mask is None else mask[0], - ffi.NULL if accum is None else accum, - op, - u[0], - thunk[0], - ffi.NULL if desc is None else desc, - )) + check_status( + w, + lib.GrB_Vector_select_Scalar( + w[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + op, + u[0], + thunk[0], + ffi.NULL if desc is None else desc, + ), + ) def vector_reduce(s, monoid, u, accum=None, desc=None): @@ -501,13 +552,16 @@ def vector_reduce(s, monoid, u, accum=None, desc=None): True """ - check_status(s, lib.GrB_Vector_reduce_Monoid_Scalar( - s[0], - ffi.NULL if accum is None else accum, - monoid, - u[0], - ffi.NULL if desc is None else desc, - )) + check_status( + s, + lib.GrB_Vector_reduce_Monoid_Scalar( + s[0], + ffi.NULL if accum is None else accum, + monoid, + u[0], + ffi.NULL if desc is None else desc, + ), + ) def vector_diag(v, A, k=0, desc=None): @@ -530,10 +584,15 @@ def vector_diag(v, A, k=0, desc=None): True """ - check_status(v, lib.GxB_Vector_diag( - v[0], A[0], k, - ffi.NULL if desc is None else desc, - )) + check_status( + v, + lib.GxB_Vector_diag( + v[0], + A[0], + k, + ffi.NULL if desc is None else desc, + ), + ) def vector_assign(w, u, indices, ni, mask=None, accum=None, desc=None): @@ -548,14 +607,18 @@ def vector_assign(w, u, indices, ni, mask=None, accum=None, desc=None): True """ - check_status(w, lib.GrB_Vector_assign( - w[0], - ffi.NULL if mask is None else mask[0], - ffi.NULL if accum is None else accum, - u[0], - indices, ni, - ffi.NULL if desc is None else desc, - )) + check_status( + w, + lib.GrB_Vector_assign( + w[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + u[0], + indices, + ni, + ffi.NULL if desc is None else desc, + ), + ) def vector_assign_scalar(w, x, indices, ni, mask=None, accum=None, desc=None): @@ -573,14 +636,18 @@ def vector_assign_scalar(w, x, indices, ni, mask=None, accum=None, desc=None): True """ - check_status(w, lib.GrB_Vector_assign_Scalar( - w[0], - ffi.NULL if mask is None else mask[0], - ffi.NULL if accum is None else accum, - x[0], - indices, ni, - ffi.NULL if desc is None else desc, - )) + check_status( + w, + lib.GrB_Vector_assign_Scalar( + w[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + x[0], + indices, + ni, + ffi.NULL if desc is None else desc, + ), + ) def vector_extract(w, u, indices, ni, mask=None, accum=None, desc=None): @@ -595,14 +662,18 @@ def vector_extract(w, u, indices, ni, mask=None, accum=None, desc=None): True """ - check_status(w, lib.GrB_Vector_extract( - w[0], - ffi.NULL if mask is None else mask[0], - ffi.NULL if accum is None else accum, - u[0], - indices, ni, - ffi.NULL if desc is None else desc, - )) + check_status( + w, + lib.GrB_Vector_extract( + w[0], + ffi.NULL if mask is None else mask[0], + ffi.NULL if accum is None else accum, + u[0], + indices, + ni, + ffi.NULL if desc is None else desc, + ), + ) def vector_build_int64(w, indices, vals, nvals, dup): @@ -618,12 +689,16 @@ def vector_build_int64(w, indices, vals, nvals, dup): True """ - check_status(w, lib.GrB_Vector_build_INT64( - w[0], - ffi.cast("GrB_Index*", ffi.from_buffer(indices)), - ffi.cast("int64_t*", ffi.from_buffer(vals)), - nvals, dup, - )) + check_status( + w, + lib.GrB_Vector_build_INT64( + w[0], + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("int64_t*", ffi.from_buffer(vals)), + nvals, + dup, + ), + ) def vector_build_fp64(w, indices, vals, nvals, dup): @@ -637,12 +712,16 @@ def vector_build_fp64(w, indices, vals, nvals, dup): True """ - check_status(w, lib.GrB_Vector_build_FP64( - w[0], - ffi.cast("GrB_Index*", ffi.from_buffer(indices)), - ffi.cast("double*", ffi.from_buffer(vals)), - nvals, dup, - )) + check_status( + w, + lib.GrB_Vector_build_FP64( + w[0], + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("double*", ffi.from_buffer(vals)), + nvals, + dup, + ), + ) def vector_extract_tuples_int64(v): @@ -666,11 +745,15 @@ def vector_extract_tuples_int64(v): vals = np.empty(n, dtype=np.int64) nvals_p = ffi.new("GrB_Index*", n) if n > 0: - check_status(v, lib.GrB_Vector_extractTuples_INT64( - ffi.cast("GrB_Index*", ffi.from_buffer(indices)), - ffi.cast("int64_t*", ffi.from_buffer(vals)), - nvals_p, v[0], - )) + check_status( + v, + lib.GrB_Vector_extractTuples_INT64( + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("int64_t*", ffi.from_buffer(vals)), + nvals_p, + v[0], + ), + ) return indices, vals @@ -693,13 +776,18 @@ def vector_extract_tuples_fp64(v): vals = np.empty(n, dtype=np.float64) nvals_p = ffi.new("GrB_Index*", n) if n > 0: - check_status(v, lib.GrB_Vector_extractTuples_FP64( - ffi.cast("GrB_Index*", ffi.from_buffer(indices)), - ffi.cast("double*", ffi.from_buffer(vals)), - nvals_p, v[0], - )) + check_status( + v, + lib.GrB_Vector_extractTuples_FP64( + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("double*", ffi.from_buffer(vals)), + nvals_p, + v[0], + ), + ) return indices, vals + def vector_build_bool(w, indices, vals, nvals, dup): """Build a vector from index and bool value arrays. @@ -711,12 +799,17 @@ def vector_build_bool(w, indices, vals, nvals, dup): True """ - check_status(w, lib.GrB_Vector_build_BOOL( - w[0], - ffi.cast("GrB_Index*", ffi.from_buffer(indices)), - ffi.cast("bool*", ffi.from_buffer(vals)), - nvals, dup, - )) + check_status( + w, + lib.GrB_Vector_build_BOOL( + w[0], + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("bool*", ffi.from_buffer(vals)), + nvals, + dup, + ), + ) + def vector_build_int8(w, indices, vals, nvals, dup): """Build a vector from index and int8 value arrays. @@ -729,12 +822,17 @@ def vector_build_int8(w, indices, vals, nvals, dup): True """ - check_status(w, lib.GrB_Vector_build_INT8( - w[0], - ffi.cast("GrB_Index*", ffi.from_buffer(indices)), - ffi.cast("int8_t*", ffi.from_buffer(vals)), - nvals, dup, - )) + check_status( + w, + lib.GrB_Vector_build_INT8( + w[0], + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("int8_t*", ffi.from_buffer(vals)), + nvals, + dup, + ), + ) + def vector_build_int16(w, indices, vals, nvals, dup): """Build a vector from index and int16 value arrays. @@ -747,12 +845,17 @@ def vector_build_int16(w, indices, vals, nvals, dup): True """ - check_status(w, lib.GrB_Vector_build_INT16( - w[0], - ffi.cast("GrB_Index*", ffi.from_buffer(indices)), - ffi.cast("int16_t*", ffi.from_buffer(vals)), - nvals, dup, - )) + check_status( + w, + lib.GrB_Vector_build_INT16( + w[0], + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("int16_t*", ffi.from_buffer(vals)), + nvals, + dup, + ), + ) + def vector_build_int32(w, indices, vals, nvals, dup): """Build a vector from index and int32 value arrays. @@ -765,12 +868,17 @@ def vector_build_int32(w, indices, vals, nvals, dup): True """ - check_status(w, lib.GrB_Vector_build_INT32( - w[0], - ffi.cast("GrB_Index*", ffi.from_buffer(indices)), - ffi.cast("int32_t*", ffi.from_buffer(vals)), - nvals, dup, - )) + check_status( + w, + lib.GrB_Vector_build_INT32( + w[0], + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("int32_t*", ffi.from_buffer(vals)), + nvals, + dup, + ), + ) + def vector_build_uint8(w, indices, vals, nvals, dup): """Build a vector from index and uint8 value arrays. @@ -783,12 +891,17 @@ def vector_build_uint8(w, indices, vals, nvals, dup): True """ - check_status(w, lib.GrB_Vector_build_UINT8( - w[0], - ffi.cast("GrB_Index*", ffi.from_buffer(indices)), - ffi.cast("uint8_t*", ffi.from_buffer(vals)), - nvals, dup, - )) + check_status( + w, + lib.GrB_Vector_build_UINT8( + w[0], + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("uint8_t*", ffi.from_buffer(vals)), + nvals, + dup, + ), + ) + def vector_build_uint16(w, indices, vals, nvals, dup): """Build a vector from index and uint16 value arrays. @@ -801,12 +914,17 @@ def vector_build_uint16(w, indices, vals, nvals, dup): True """ - check_status(w, lib.GrB_Vector_build_UINT16( - w[0], - ffi.cast("GrB_Index*", ffi.from_buffer(indices)), - ffi.cast("uint16_t*", ffi.from_buffer(vals)), - nvals, dup, - )) + check_status( + w, + lib.GrB_Vector_build_UINT16( + w[0], + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("uint16_t*", ffi.from_buffer(vals)), + nvals, + dup, + ), + ) + def vector_build_uint32(w, indices, vals, nvals, dup): """Build a vector from index and uint32 value arrays. @@ -819,12 +937,17 @@ def vector_build_uint32(w, indices, vals, nvals, dup): True """ - check_status(w, lib.GrB_Vector_build_UINT32( - w[0], - ffi.cast("GrB_Index*", ffi.from_buffer(indices)), - ffi.cast("uint32_t*", ffi.from_buffer(vals)), - nvals, dup, - )) + check_status( + w, + lib.GrB_Vector_build_UINT32( + w[0], + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("uint32_t*", ffi.from_buffer(vals)), + nvals, + dup, + ), + ) + def vector_build_uint64(w, indices, vals, nvals, dup): """Build a vector from index and uint64 value arrays. @@ -837,12 +960,17 @@ def vector_build_uint64(w, indices, vals, nvals, dup): True """ - check_status(w, lib.GrB_Vector_build_UINT64( - w[0], - ffi.cast("GrB_Index*", ffi.from_buffer(indices)), - ffi.cast("uint64_t*", ffi.from_buffer(vals)), - nvals, dup, - )) + check_status( + w, + lib.GrB_Vector_build_UINT64( + w[0], + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("uint64_t*", ffi.from_buffer(vals)), + nvals, + dup, + ), + ) + def vector_build_fp32(w, indices, vals, nvals, dup): """Build a vector from index and fp32 value arrays. @@ -855,12 +983,17 @@ def vector_build_fp32(w, indices, vals, nvals, dup): True """ - check_status(w, lib.GrB_Vector_build_FP32( - w[0], - ffi.cast("GrB_Index*", ffi.from_buffer(indices)), - ffi.cast("float*", ffi.from_buffer(vals)), - nvals, dup, - )) + check_status( + w, + lib.GrB_Vector_build_FP32( + w[0], + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("float*", ffi.from_buffer(vals)), + nvals, + dup, + ), + ) + def vector_extract_tuples_bool(v): """Extract all tuples from a vector as numpy arrays. @@ -881,13 +1014,18 @@ def vector_extract_tuples_bool(v): vals = np.empty(n, dtype=np.bool_) nvals_p = ffi.new("GrB_Index*", n) if n > 0: - check_status(v, lib.GrB_Vector_extractTuples_BOOL( - ffi.cast("GrB_Index*", ffi.from_buffer(indices)), - ffi.cast("bool*", ffi.from_buffer(vals)), - nvals_p, v[0], - )) + check_status( + v, + lib.GrB_Vector_extractTuples_BOOL( + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("bool*", ffi.from_buffer(vals)), + nvals_p, + v[0], + ), + ) return indices, vals + def vector_extract_tuples_int8(v): """Extract all tuples from a vector as numpy arrays. @@ -907,13 +1045,18 @@ def vector_extract_tuples_int8(v): vals = np.empty(n, dtype=np.int8) nvals_p = ffi.new("GrB_Index*", n) if n > 0: - check_status(v, lib.GrB_Vector_extractTuples_INT8( - ffi.cast("GrB_Index*", ffi.from_buffer(indices)), - ffi.cast("int8_t*", ffi.from_buffer(vals)), - nvals_p, v[0], - )) + check_status( + v, + lib.GrB_Vector_extractTuples_INT8( + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("int8_t*", ffi.from_buffer(vals)), + nvals_p, + v[0], + ), + ) return indices, vals + def vector_extract_tuples_int16(v): """Extract all tuples from a vector as numpy arrays. @@ -933,13 +1076,18 @@ def vector_extract_tuples_int16(v): vals = np.empty(n, dtype=np.int16) nvals_p = ffi.new("GrB_Index*", n) if n > 0: - check_status(v, lib.GrB_Vector_extractTuples_INT16( - ffi.cast("GrB_Index*", ffi.from_buffer(indices)), - ffi.cast("int16_t*", ffi.from_buffer(vals)), - nvals_p, v[0], - )) + check_status( + v, + lib.GrB_Vector_extractTuples_INT16( + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("int16_t*", ffi.from_buffer(vals)), + nvals_p, + v[0], + ), + ) return indices, vals + def vector_extract_tuples_int32(v): """Extract all tuples from a vector as numpy arrays. @@ -959,13 +1107,18 @@ def vector_extract_tuples_int32(v): vals = np.empty(n, dtype=np.int32) nvals_p = ffi.new("GrB_Index*", n) if n > 0: - check_status(v, lib.GrB_Vector_extractTuples_INT32( - ffi.cast("GrB_Index*", ffi.from_buffer(indices)), - ffi.cast("int32_t*", ffi.from_buffer(vals)), - nvals_p, v[0], - )) + check_status( + v, + lib.GrB_Vector_extractTuples_INT32( + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("int32_t*", ffi.from_buffer(vals)), + nvals_p, + v[0], + ), + ) return indices, vals + def vector_extract_tuples_uint8(v): """Extract all tuples from a vector as numpy arrays. @@ -985,13 +1138,18 @@ def vector_extract_tuples_uint8(v): vals = np.empty(n, dtype=np.uint8) nvals_p = ffi.new("GrB_Index*", n) if n > 0: - check_status(v, lib.GrB_Vector_extractTuples_UINT8( - ffi.cast("GrB_Index*", ffi.from_buffer(indices)), - ffi.cast("uint8_t*", ffi.from_buffer(vals)), - nvals_p, v[0], - )) + check_status( + v, + lib.GrB_Vector_extractTuples_UINT8( + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("uint8_t*", ffi.from_buffer(vals)), + nvals_p, + v[0], + ), + ) return indices, vals + def vector_extract_tuples_uint16(v): """Extract all tuples from a vector as numpy arrays. @@ -1011,13 +1169,18 @@ def vector_extract_tuples_uint16(v): vals = np.empty(n, dtype=np.uint16) nvals_p = ffi.new("GrB_Index*", n) if n > 0: - check_status(v, lib.GrB_Vector_extractTuples_UINT16( - ffi.cast("GrB_Index*", ffi.from_buffer(indices)), - ffi.cast("uint16_t*", ffi.from_buffer(vals)), - nvals_p, v[0], - )) + check_status( + v, + lib.GrB_Vector_extractTuples_UINT16( + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("uint16_t*", ffi.from_buffer(vals)), + nvals_p, + v[0], + ), + ) return indices, vals + def vector_extract_tuples_uint32(v): """Extract all tuples from a vector as numpy arrays. @@ -1037,13 +1200,18 @@ def vector_extract_tuples_uint32(v): vals = np.empty(n, dtype=np.uint32) nvals_p = ffi.new("GrB_Index*", n) if n > 0: - check_status(v, lib.GrB_Vector_extractTuples_UINT32( - ffi.cast("GrB_Index*", ffi.from_buffer(indices)), - ffi.cast("uint32_t*", ffi.from_buffer(vals)), - nvals_p, v[0], - )) + check_status( + v, + lib.GrB_Vector_extractTuples_UINT32( + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("uint32_t*", ffi.from_buffer(vals)), + nvals_p, + v[0], + ), + ) return indices, vals + def vector_extract_tuples_uint64(v): """Extract all tuples from a vector as numpy arrays. @@ -1063,13 +1231,18 @@ def vector_extract_tuples_uint64(v): vals = np.empty(n, dtype=np.uint64) nvals_p = ffi.new("GrB_Index*", n) if n > 0: - check_status(v, lib.GrB_Vector_extractTuples_UINT64( - ffi.cast("GrB_Index*", ffi.from_buffer(indices)), - ffi.cast("uint64_t*", ffi.from_buffer(vals)), - nvals_p, v[0], - )) + check_status( + v, + lib.GrB_Vector_extractTuples_UINT64( + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("uint64_t*", ffi.from_buffer(vals)), + nvals_p, + v[0], + ), + ) return indices, vals + def vector_extract_tuples_fp32(v): """Extract all tuples from a vector as numpy arrays. @@ -1089,11 +1262,15 @@ def vector_extract_tuples_fp32(v): vals = np.empty(n, dtype=np.float32) nvals_p = ffi.new("GrB_Index*", n) if n > 0: - check_status(v, lib.GrB_Vector_extractTuples_FP32( - ffi.cast("GrB_Index*", ffi.from_buffer(indices)), - ffi.cast("float*", ffi.from_buffer(vals)), - nvals_p, v[0], - )) + check_status( + v, + lib.GrB_Vector_extractTuples_FP32( + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("float*", ffi.from_buffer(vals)), + nvals_p, + v[0], + ), + ) return indices, vals @@ -1444,12 +1621,16 @@ def vector_build_fc32(w, indices, vals, nvals, dup): True """ - check_status(w, lib.GxB_Vector_build_FC32( - w[0], - ffi.cast("GrB_Index*", ffi.from_buffer(indices)), - ffi.cast("GxB_FC32_t*", ffi.from_buffer(vals)), - nvals, dup, - )) + check_status( + w, + lib.GxB_Vector_build_FC32( + w[0], + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("GxB_FC32_t*", ffi.from_buffer(vals)), + nvals, + dup, + ), + ) def vector_extract_tuples_fc32(v): """Extract all tuples from a vector as numpy arrays. @@ -1470,11 +1651,15 @@ def vector_extract_tuples_fc32(v): vals = np.empty(n, dtype=np.complex64) nvals_p = ffi.new("GrB_Index*", n) if n > 0: - check_status(v, lib.GxB_Vector_extractTuples_FC32( - ffi.cast("GrB_Index*", ffi.from_buffer(indices)), - ffi.cast("GxB_FC32_t*", ffi.from_buffer(vals)), - nvals_p, v[0], - )) + check_status( + v, + lib.GxB_Vector_extractTuples_FC32( + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("GxB_FC32_t*", ffi.from_buffer(vals)), + nvals_p, + v[0], + ), + ) return indices, vals def vector_build_fc64(w, indices, vals, nvals, dup): @@ -1488,12 +1673,16 @@ def vector_build_fc64(w, indices, vals, nvals, dup): True """ - check_status(w, lib.GxB_Vector_build_FC64( - w[0], - ffi.cast("GrB_Index*", ffi.from_buffer(indices)), - ffi.cast("GxB_FC64_t*", ffi.from_buffer(vals)), - nvals, dup, - )) + check_status( + w, + lib.GxB_Vector_build_FC64( + w[0], + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("GxB_FC64_t*", ffi.from_buffer(vals)), + nvals, + dup, + ), + ) def vector_extract_tuples_fc64(v): """Extract all tuples from a vector as numpy arrays. @@ -1514,9 +1703,13 @@ def vector_extract_tuples_fc64(v): vals = np.empty(n, dtype=np.complex128) nvals_p = ffi.new("GrB_Index*", n) if n > 0: - check_status(v, lib.GxB_Vector_extractTuples_FC64( - ffi.cast("GrB_Index*", ffi.from_buffer(indices)), - ffi.cast("GxB_FC64_t*", ffi.from_buffer(vals)), - nvals_p, v[0], - )) + check_status( + v, + lib.GxB_Vector_extractTuples_FC64( + ffi.cast("GrB_Index*", ffi.from_buffer(indices)), + ffi.cast("GxB_FC64_t*", ffi.from_buffer(vals)), + nvals_p, + v[0], + ), + ) return indices, vals diff --git a/suitesparse_graphblas/create_headers.py b/suitesparse_graphblas/create_headers.py index 0ec57fb..dcfb5f4 100644 --- a/suitesparse_graphblas/create_headers.py +++ b/suitesparse_graphblas/create_headers.py @@ -302,6 +302,10 @@ def groupby(index, seq): "GxB_COMPRESSION_ZSTD", "GxB_COMPRESSION_NONE", "GxB_USE_VALUES", + # Memory arenas, added in version 10.4 + "GxB_ARENA_DATA", + "GxB_ARENA_HEADER", + "GxB_NARENAS", } CHAR_DEFINES = { @@ -340,6 +344,12 @@ def groupby(index, seq): "GxB_cuda_malloc", "GxB_cuda_free", } + +# Declared in GraphBLAS.h, but not actually defined by libgraphblas. cffi would +# happily bind these, but then importing `_graphblas` fails at dlopen time with +# "symbol not found in flat namespace". Remove entries here once upstream +# implements them. This is most common in beta releases. +NOT_IMPLEMENTED = set() IGNORE_ENUMS = { "memory_order", "RMM_MODE", @@ -388,6 +398,8 @@ def get_groups(ast): groups = {} vals = {x for x in lines if "GrB_Info GxB" in x} - seen vals |= {x for x in lines if "GxB_Iterator" in x and "GB" not in x} - seen + # A few GxB functions return void, e.g. GxB_atfork_* (added in v10.4.0) + vals |= {x for x in lines if x.startswith("void GxB")} - seen seen.update(vals) groups["GxB methods"] = sorted(vals, key=sort_key) @@ -631,11 +643,14 @@ def visit_Decl(self, node): self.functions.append(node) def handle_function_node(node): - if generator.visit(node.type.type) != "GrB_Info" and "GxB_Iterator" not in generator.visit( - node + if ( + generator.visit(node.type.type) != "GrB_Info" + and "GxB_Iterator" not in generator.visit(node) + # e.g. GxB_atfork_* (added in v10.4.0) return void + and not (node.name.startswith("GxB_") and generator.visit(node.type.type) == "void") ): raise ValueError(generator.visit(node)) - if node.name in DEPRECATED: + if node.name in DEPRECATED or node.name in NOT_IMPLEMENTED: return text = generator.visit(node) text += ";" @@ -679,6 +694,10 @@ def handle_function_node(node): "wait": "core", "deserialize": "core", "Serialized": "core", # Added in version 9 + "arena": "core", # Added in version 10.4 + "atfork": "core", # Added in version 10.4 + "initialized": "core", # Added in version 10.4 + "finalized": "core", # Added in version 10.4 }[group] return { "name": node.name, diff --git a/suitesparse_graphblas/suitesparse_graphblas.h b/suitesparse_graphblas/suitesparse_graphblas.h index 2e3e66b..c50f31f 100644 --- a/suitesparse_graphblas/suitesparse_graphblas.h +++ b/suitesparse_graphblas/suitesparse_graphblas.h @@ -24,7 +24,7 @@ typedef struct GB_SelectOp_opaque *GxB_SelectOp; typedef struct GxB_Container_struct *GxB_Container; /* GxB typedefs (functions) */ -typedef int64_t (*GxB_print_function)(char *string, size_t string_size, const void *value, int verbose); +typedef int64_t (*GxB_print_function)(char *string, size_t string_len, const void *value, int verbose); typedef void (*GxB_binary_function)(void *, const void *, const void *); typedef void (*GxB_index_binary_function)(void *, const void *, GrB_Index, GrB_Index, const void *, GrB_Index, GrB_Index, const void *); typedef void (*GxB_index_unary_function)(void *z, const void *x, GrB_Index i, GrB_Index j, const void *y); @@ -41,7 +41,8 @@ struct GxB_Container_struct uint64_t u64_future[11]; int32_t format; int32_t orientation; - uint32_t u32_future[14]; + int32_t header_arena; + uint32_t u32_future[13]; GrB_Vector p; GrB_Vector h; GrB_Vector b; @@ -256,6 +257,10 @@ typedef enum GxB_CALLOC_FUNCTION = 7038, GxB_REALLOC_FUNCTION = 7039, GxB_FREE_FUNCTION = 7040, + GxB_ARENA_MALLOC = 0x10000, + GxB_ARENA_CALLOC = 0x20000, + GxB_ARENA_REALLOC = 0x30000, + GxB_ARENA_FREE = 0x40000, GxB_GLOBAL_NTHREADS = 7086, GxB_GLOBAL_CHUNK = 7087, GxB_GLOBAL_NGPUS = 7102, @@ -2993,8 +2998,8 @@ GrB_Info GrB_Matrix_select_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_ GrB_Info GrB_Matrix_select_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint16_t y, const GrB_Descriptor desc); GrB_Info GrB_Matrix_select_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint32_t y, const GrB_Descriptor desc); GrB_Info GrB_Matrix_select_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint64_t y, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_serialize(void *blob, GrB_Index *blob_size_handle, GrB_Matrix A); -GrB_Info GrB_Matrix_serializeSize(GrB_Index *blob_size_handle, GrB_Matrix A); +GrB_Info GrB_Matrix_serialize(void *blob, GrB_Index *blob_size, GrB_Matrix A); +GrB_Info GrB_Matrix_serializeSize(GrB_Index *blob_size, GrB_Matrix A); GrB_Info GrB_Matrix_setElement_BOOL(GrB_Matrix C, bool x, GrB_Index i, GrB_Index j); GrB_Info GrB_Matrix_setElement_FP32(GrB_Matrix C, float x, GrB_Index i, GrB_Index j); GrB_Info GrB_Matrix_setElement_FP64(GrB_Matrix C, double x, GrB_Index i, GrB_Index j); @@ -3318,6 +3323,7 @@ GrB_Info GB_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, int format, GrB /* binary */ GrB_Info GxB_BinaryOp_fprint(GrB_BinaryOp binaryop, const char *name, int pr, FILE *f); GrB_Info GxB_BinaryOp_new(GrB_BinaryOp *op, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *binop_name, const char *binop_defn); +GrB_Info GxB_BinaryOp_new_arena(GrB_BinaryOp *op_handle, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *binop_name, const char *binop_defn, const int header_arena); GrB_Info GxB_BinaryOp_xtype(GrB_Type *, GrB_BinaryOp); GrB_Info GxB_BinaryOp_xtype_name(char *, const GrB_BinaryOp); GrB_Info GxB_BinaryOp_ytype(GrB_Type *, GrB_BinaryOp); @@ -3328,6 +3334,7 @@ GrB_Info GxB_BinaryOp_ztype_name(char *, const GrB_BinaryOp); /* container */ GrB_Info GxB_Container_free(GxB_Container *object); GrB_Info GxB_Container_new(GxB_Container *Container); +GrB_Info GxB_Container_new_arena(GxB_Container *Container, const int header_arena, const int data_arena); /* context */ GrB_Info GxB_Context_disengage(GxB_Context Context); @@ -3343,6 +3350,7 @@ GrB_Info GxB_Context_get_SIZE(GxB_Context, size_t *, int); GrB_Info GxB_Context_get_String(GxB_Context, char *, int); GrB_Info GxB_Context_get_VOID(GxB_Context, void *, int); GrB_Info GxB_Context_new(GxB_Context *Context); +GrB_Info GxB_Context_new_arena(GxB_Context *Context_handle, const int header_arena); GrB_Info GxB_Context_set(GxB_Context, int, ...); GrB_Info GxB_Context_set_FP64(GxB_Context, int, double); GrB_Info GxB_Context_set_INT(GxB_Context, int32_t, int); @@ -3369,8 +3377,15 @@ GrB_Info GxB_Serialized_get_INT32(const void *, int32_t *, int, size_t); GrB_Info GxB_Serialized_get_SIZE(const void *, size_t *, int, size_t); GrB_Info GxB_Serialized_get_String(const void *, char *, int, size_t); GrB_Info GxB_Serialized_get_VOID(const void *, void *, int, size_t); +GrB_Info GxB_arena_init(int arena, void *(*user_malloc_function)(size_t), void *(*user_calloc_function)(size_t, size_t), void *(*user_realloc_function)(void *, size_t), void (*user_free_function)(void *)); +GrB_Info GxB_arena_initialized(int *flag, int arena); GrB_Info GxB_deserialize_type_name(char *, const void *, uint64_t); +GrB_Info GxB_finalized(int *flag); GrB_Info GxB_init(int mode, void *(*user_malloc_function)(size_t), void *(*user_calloc_function)(size_t, size_t), void *(*user_realloc_function)(void *, size_t), void (*user_free_function)(void *)); +GrB_Info GxB_initialized(int *flag); +void GxB_atfork_child(void); +void GxB_atfork_parent(void); +void GxB_atfork_prepare(void); /* descriptor */ GrB_Info GxB_Desc_get(GrB_Descriptor, int, ...); @@ -3381,6 +3396,7 @@ GrB_Info GxB_Desc_set_FP64(GrB_Descriptor, int, double); GrB_Info GxB_Desc_set_INT32(GrB_Descriptor, int, int32_t); GrB_Info GxB_Descriptor_fprint(GrB_Descriptor descriptor, const char *name, int pr, FILE *f); GrB_Info GxB_Descriptor_get(int32_t *, GrB_Descriptor, int); +GrB_Info GxB_Descriptor_new_arena(GrB_Descriptor *descriptor, const int header_arena); /* indexbinary */ GrB_Info GxB_IndexBinaryOp_error(const char **error, const GxB_IndexBinaryOp object); @@ -3391,6 +3407,7 @@ GrB_Info GxB_IndexBinaryOp_get_SIZE(GxB_IndexBinaryOp object, size_t *, int); GrB_Info GxB_IndexBinaryOp_get_String(GxB_IndexBinaryOp object, char *, int); GrB_Info GxB_IndexBinaryOp_get_VOID(GxB_IndexBinaryOp object, void *, int); GrB_Info GxB_IndexBinaryOp_new(GxB_IndexBinaryOp *op, GxB_index_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, GrB_Type theta_type, const char *idxbinop_name, const char *idxbinop_defn); +GrB_Info GxB_IndexBinaryOp_new_arena(GxB_IndexBinaryOp *op_handle, GxB_index_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, GrB_Type theta_type, const char *idxop_name, const char *idxop_defn, const int header_arena); GrB_Info GxB_IndexBinaryOp_set_INT32(GxB_IndexBinaryOp object, int32_t, int); GrB_Info GxB_IndexBinaryOp_set_String(GxB_IndexBinaryOp object, char *, int); GrB_Info GxB_IndexBinaryOp_set_VOID(GxB_IndexBinaryOp object, void *, int, size_t); @@ -3399,6 +3416,7 @@ GrB_Info GxB_IndexBinaryOp_wait(GxB_IndexBinaryOp object, int waitmode); /* indexunary */ GrB_Info GxB_IndexUnaryOp_fprint(GrB_IndexUnaryOp op, const char *name, int pr, FILE *f); GrB_Info GxB_IndexUnaryOp_new(GrB_IndexUnaryOp *op, GxB_index_unary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *idxop_name, const char *idxop_defn); +GrB_Info GxB_IndexUnaryOp_new_arena(GrB_IndexUnaryOp *op_handle, GxB_index_unary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *idxop_name, const char *idxop_defn, const int header_arena); GrB_Info GxB_IndexUnaryOp_xtype_name(char *, const GrB_IndexUnaryOp); GrB_Info GxB_IndexUnaryOp_ytype_name(char *, const GrB_IndexUnaryOp); GrB_Info GxB_IndexUnaryOp_ztype_name(char *, const GrB_IndexUnaryOp); @@ -3417,6 +3435,7 @@ GrB_Index GxB_rowIterator_getRowIndex(GxB_Iterator iterator); GrB_Index GxB_rowIterator_kount(GxB_Iterator iterator); GrB_Info GxB_Iterator_free(GxB_Iterator *object); GrB_Info GxB_Iterator_new(GxB_Iterator *iterator); +GrB_Info GxB_Iterator_new_arena(GxB_Iterator *iterator, const int header_arena); GrB_Info GxB_Matrix_Iterator_next(GxB_Iterator iterator); GrB_Info GxB_Matrix_Iterator_seek(GxB_Iterator iterator, GrB_Index p); GrB_Info GxB_Vector_Iterator_next(GxB_Iterator iterator); @@ -3476,7 +3495,10 @@ GrB_Info GxB_Matrix_build_Scalar_Vector(GrB_Matrix C, const GrB_Vector I_vector, GrB_Info GxB_Matrix_build_Vector(GrB_Matrix C, const GrB_Vector I_vector, const GrB_Vector J_vector, const GrB_Vector X_vector, const GrB_BinaryOp dup, const GrB_Descriptor desc); GrB_Info GxB_Matrix_concat(GrB_Matrix C, const GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Descriptor desc); GrB_Info GxB_Matrix_deserialize(GrB_Matrix *C, GrB_Type type, const void *blob, GrB_Index blob_size, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_deserialize_arena(GrB_Matrix *C, GrB_Type type, const void *blob, uint64_t blob_memsize, const int header_arena, const int data_arena, const GrB_Descriptor desc); GrB_Info GxB_Matrix_diag(GrB_Matrix C, const GrB_Vector v, int64_t k, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_diag_arena(GrB_Matrix *C, const GrB_Vector v, int64_t k, const int header_arena, const int data_arena); +GrB_Info GxB_Matrix_dup_arena(GrB_Matrix *C, const GrB_Matrix A, const int header_arena, const int data_arena); GrB_Info GxB_Matrix_eWiseUnion(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Matrix A, const GrB_Scalar alpha, const GrB_Matrix B, const GrB_Scalar beta, const GrB_Descriptor desc); GrB_Info GxB_Matrix_export_BitmapC(GrB_Matrix *, GrB_Type *, uint64_t *, uint64_t *, int8_t **, void **, uint64_t *, uint64_t *, bool *, uint64_t *, const GrB_Descriptor); GrB_Info GxB_Matrix_export_BitmapR(GrB_Matrix *, GrB_Type *, uint64_t *, uint64_t *, int8_t **, void **, uint64_t *, uint64_t *, bool *, uint64_t *, const GrB_Descriptor); @@ -3508,6 +3530,7 @@ GrB_Info GxB_Matrix_import_HyperCSR(GrB_Matrix *, GrB_Type, uint64_t, uint64_t, GrB_Info GxB_Matrix_isStoredElement(const GrB_Matrix A, GrB_Index i, GrB_Index j); GrB_Info GxB_Matrix_iso(bool *, const GrB_Matrix); GrB_Info GxB_Matrix_memoryUsage(size_t *size, const GrB_Matrix A); +GrB_Info GxB_Matrix_new_arena(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const int header_arena, const int data_arena); GrB_Info GxB_Matrix_pack_BitmapC(GrB_Matrix, int8_t **, void **, uint64_t, uint64_t, bool, uint64_t, const GrB_Descriptor); GrB_Info GxB_Matrix_pack_BitmapR(GrB_Matrix, int8_t **, void **, uint64_t, uint64_t, bool, uint64_t, const GrB_Descriptor); GrB_Info GxB_Matrix_pack_CSC(GrB_Matrix, uint64_t **, uint64_t **, void **, uint64_t, uint64_t, uint64_t, bool, bool, const GrB_Descriptor); @@ -3520,14 +3543,18 @@ GrB_Info GxB_Matrix_reduce_FC32(GxB_FC32_t *c, const GrB_BinaryOp accum, const G GrB_Info GxB_Matrix_reduce_FC64(GxB_FC64_t *c, const GrB_BinaryOp accum, const GrB_Monoid monoid, const GrB_Matrix A, const GrB_Descriptor desc); GrB_Info GxB_Matrix_reshape(GrB_Matrix C, bool by_col, GrB_Index nrows_new, GrB_Index ncols_new, const GrB_Descriptor desc); GrB_Info GxB_Matrix_reshapeDup(GrB_Matrix *C, GrB_Matrix A, bool by_col, GrB_Index nrows_new, GrB_Index ncols_new, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_reshapeDup_arena(GrB_Matrix *C, GrB_Matrix A, bool by_col, uint64_t nrows_new, uint64_t ncols_new, const int header_arena, const int data_arena, const GrB_Descriptor desc); GrB_Info GxB_Matrix_select(GrB_Matrix, const GrB_Matrix, const GrB_BinaryOp, const GxB_SelectOp, const GrB_Matrix, const GrB_Scalar, const GrB_Descriptor); GrB_Info GxB_Matrix_select_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, GxB_FC32_t y, const GrB_Descriptor desc); GrB_Info GxB_Matrix_select_FC64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, GxB_FC64_t y, const GrB_Descriptor desc); -GrB_Info GxB_Matrix_serialize(void **blob_handle, GrB_Index *blob_size_handle, GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_serialize(void **blob_handle, GrB_Index *blob_size, GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_serialize_arena(void **blob_handle, GrB_Index *blob_size, GrB_Matrix A, const int data_arena, const GrB_Descriptor desc); GrB_Info GxB_Matrix_setElement_FC32(GrB_Matrix C, GxB_FC32_t x, GrB_Index i, GrB_Index j); GrB_Info GxB_Matrix_setElement_FC64(GrB_Matrix C, GxB_FC64_t x, GrB_Index i, GrB_Index j); +GrB_Info GxB_Matrix_set_arenas(GrB_Matrix *Ahandle, const int new_header_arena, const int new_data_arena); GrB_Info GxB_Matrix_sort(GrB_Matrix C, GrB_Matrix P, GrB_BinaryOp op, GrB_Matrix A, const GrB_Descriptor desc); GrB_Info GxB_Matrix_split(GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Index *Tile_nrows, const GrB_Index *Tile_ncols, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_split_arena(GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Index *Tile_nrows, const GrB_Index *Tile_ncols, const GrB_Matrix A, const int header_arena, const int data_arena, const GrB_Descriptor desc); GrB_Info GxB_Matrix_subassign(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); GrB_Info GxB_Matrix_subassign_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); GrB_Info GxB_Matrix_subassign_FC32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, GxB_FC32_t x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); @@ -3572,6 +3599,20 @@ GrB_Info GxB_Monoid_fprint(GrB_Monoid monoid, const char *name, int pr, FILE *f) GrB_Info GxB_Monoid_identity(void *, GrB_Monoid); GrB_Info GxB_Monoid_new_FC32(GrB_Monoid *monoid, GrB_BinaryOp op, GxB_FC32_t identity); GrB_Info GxB_Monoid_new_FC64(GrB_Monoid *monoid, GrB_BinaryOp op, GxB_FC64_t identity); +GrB_Info GxB_Monoid_new_arena_BOOL(GrB_Monoid *monoid, GrB_BinaryOp op, bool identity, const int header_arena); +GrB_Info GxB_Monoid_new_arena_FC32(GrB_Monoid *monoid, GrB_BinaryOp op, GxB_FC32_t identity, const int header_arena); +GrB_Info GxB_Monoid_new_arena_FC64(GrB_Monoid *monoid, GrB_BinaryOp op, GxB_FC64_t identity, const int header_arena); +GrB_Info GxB_Monoid_new_arena_FP32(GrB_Monoid *monoid, GrB_BinaryOp op, float identity, const int header_arena); +GrB_Info GxB_Monoid_new_arena_FP64(GrB_Monoid *monoid, GrB_BinaryOp op, double identity, const int header_arena); +GrB_Info GxB_Monoid_new_arena_INT8(GrB_Monoid *monoid, GrB_BinaryOp op, int8_t identity, const int header_arena); +GrB_Info GxB_Monoid_new_arena_INT16(GrB_Monoid *monoid, GrB_BinaryOp op, int16_t identity, const int header_arena); +GrB_Info GxB_Monoid_new_arena_INT32(GrB_Monoid *monoid, GrB_BinaryOp op, int32_t identity, const int header_arena); +GrB_Info GxB_Monoid_new_arena_INT64(GrB_Monoid *monoid, GrB_BinaryOp op, int64_t identity, const int header_arena); +GrB_Info GxB_Monoid_new_arena_UDT(GrB_Monoid *monoid, GrB_BinaryOp op, void *identity, const int header_arena); +GrB_Info GxB_Monoid_new_arena_UINT8(GrB_Monoid *monoid, GrB_BinaryOp op, uint8_t identity, const int header_arena); +GrB_Info GxB_Monoid_new_arena_UINT16(GrB_Monoid *monoid, GrB_BinaryOp op, uint16_t identity, const int header_arena); +GrB_Info GxB_Monoid_new_arena_UINT32(GrB_Monoid *monoid, GrB_BinaryOp op, uint32_t identity, const int header_arena); +GrB_Info GxB_Monoid_new_arena_UINT64(GrB_Monoid *monoid, GrB_BinaryOp op, uint64_t identity, const int header_arena); GrB_Info GxB_Monoid_operator(GrB_BinaryOp *, GrB_Monoid); GrB_Info GxB_Monoid_terminal(bool *, void *, GrB_Monoid); GrB_Info GxB_Monoid_terminal_new_BOOL(GrB_Monoid *monoid, GrB_BinaryOp op, bool identity, bool terminal); @@ -3588,15 +3629,31 @@ GrB_Info GxB_Monoid_terminal_new_UINT8(GrB_Monoid *monoid, GrB_BinaryOp op, uint GrB_Info GxB_Monoid_terminal_new_UINT16(GrB_Monoid *monoid, GrB_BinaryOp op, uint16_t identity, uint16_t terminal); GrB_Info GxB_Monoid_terminal_new_UINT32(GrB_Monoid *monoid, GrB_BinaryOp op, uint32_t identity, uint32_t terminal); GrB_Info GxB_Monoid_terminal_new_UINT64(GrB_Monoid *monoid, GrB_BinaryOp op, uint64_t identity, uint64_t terminal); +GrB_Info GxB_Monoid_terminal_new_arena_BOOL(GrB_Monoid *monoid, GrB_BinaryOp op, bool identity, bool terminal, const int header_arena); +GrB_Info GxB_Monoid_terminal_new_arena_FC32(GrB_Monoid *monoid, GrB_BinaryOp op, GxB_FC32_t identity, GxB_FC32_t terminal, const int header_arena); +GrB_Info GxB_Monoid_terminal_new_arena_FC64(GrB_Monoid *monoid, GrB_BinaryOp op, GxB_FC64_t identity, GxB_FC64_t terminal, const int header_arena); +GrB_Info GxB_Monoid_terminal_new_arena_FP32(GrB_Monoid *monoid, GrB_BinaryOp op, float identity, float terminal, const int header_arena); +GrB_Info GxB_Monoid_terminal_new_arena_FP64(GrB_Monoid *monoid, GrB_BinaryOp op, double identity, double terminal, const int header_arena); +GrB_Info GxB_Monoid_terminal_new_arena_INT8(GrB_Monoid *monoid, GrB_BinaryOp op, int8_t identity, int8_t terminal, const int header_arena); +GrB_Info GxB_Monoid_terminal_new_arena_INT16(GrB_Monoid *monoid, GrB_BinaryOp op, int16_t identity, int16_t terminal, const int header_arena); +GrB_Info GxB_Monoid_terminal_new_arena_INT32(GrB_Monoid *monoid, GrB_BinaryOp op, int32_t identity, int32_t terminal, const int header_arena); +GrB_Info GxB_Monoid_terminal_new_arena_INT64(GrB_Monoid *monoid, GrB_BinaryOp op, int64_t identity, int64_t terminal, const int header_arena); +GrB_Info GxB_Monoid_terminal_new_arena_UDT(GrB_Monoid *monoid, GrB_BinaryOp op, void *identity, void *terminal, const int header_arena); +GrB_Info GxB_Monoid_terminal_new_arena_UINT8(GrB_Monoid *monoid, GrB_BinaryOp op, uint8_t identity, uint8_t terminal, const int header_arena); +GrB_Info GxB_Monoid_terminal_new_arena_UINT16(GrB_Monoid *monoid, GrB_BinaryOp op, uint16_t identity, uint16_t terminal, const int header_arena); +GrB_Info GxB_Monoid_terminal_new_arena_UINT32(GrB_Monoid *monoid, GrB_BinaryOp op, uint32_t identity, uint32_t terminal, const int header_arena); +GrB_Info GxB_Monoid_terminal_new_arena_UINT64(GrB_Monoid *monoid, GrB_BinaryOp op, uint64_t identity, uint64_t terminal, const int header_arena); /* scalar */ GrB_Info GxB_BinaryOp_new_IndexOp(GrB_BinaryOp *binop, GxB_IndexBinaryOp idxbinop, GrB_Scalar theta); +GrB_Info GxB_BinaryOp_new_IndexOp_arena(GrB_BinaryOp *binop_handle, GxB_IndexBinaryOp idxbinop, GrB_Scalar theta, const int header_arena); GrB_Info GxB_Context_get_Scalar(GxB_Context, GrB_Scalar, int); GrB_Info GxB_Context_set_Scalar(GxB_Context, GrB_Scalar, int); GrB_Info GxB_IndexBinaryOp_get_Scalar(GxB_IndexBinaryOp object, GrB_Scalar, int); GrB_Info GxB_IndexBinaryOp_set_Scalar(GxB_IndexBinaryOp object, GrB_Scalar, int); GrB_Info GxB_Scalar_clear(GrB_Scalar); GrB_Info GxB_Scalar_dup(GrB_Scalar *, const GrB_Scalar); +GrB_Info GxB_Scalar_dup_arena(GrB_Scalar *s, const GrB_Scalar t, const int header_arena, const int data_arena); GrB_Info GxB_Scalar_error(const char **, const GrB_Scalar); GrB_Info GxB_Scalar_extractElement_BOOL(bool *, const GrB_Scalar); GrB_Info GxB_Scalar_extractElement_FC32(GxB_FC32_t *x, const GrB_Scalar s); @@ -3616,6 +3673,7 @@ GrB_Info GxB_Scalar_fprint(GrB_Scalar s, const char *name, int pr, FILE *f); GrB_Info GxB_Scalar_free(GrB_Scalar *); GrB_Info GxB_Scalar_memoryUsage(size_t *size, const GrB_Scalar s); GrB_Info GxB_Scalar_new(GrB_Scalar *, GrB_Type); +GrB_Info GxB_Scalar_new_arena(GrB_Scalar *s, GrB_Type type, const int header_arena, const int data_arena); GrB_Info GxB_Scalar_nvals(uint64_t *, const GrB_Scalar); GrB_Info GxB_Scalar_setElement_BOOL(GrB_Scalar, bool); GrB_Info GxB_Scalar_setElement_FC32(GrB_Scalar s, GxB_FC32_t x); @@ -3631,6 +3689,7 @@ GrB_Info GxB_Scalar_setElement_UINT8(GrB_Scalar, uint8_t); GrB_Info GxB_Scalar_setElement_UINT16(GrB_Scalar, uint16_t); GrB_Info GxB_Scalar_setElement_UINT32(GrB_Scalar, uint32_t); GrB_Info GxB_Scalar_setElement_UINT64(GrB_Scalar, uint64_t); +GrB_Info GxB_Scalar_set_arenas(GrB_Scalar *Shandle, const int new_header_arena, const int new_data_arena); GrB_Info GxB_Scalar_type(GrB_Type *type, const GrB_Scalar s); GrB_Info GxB_Scalar_type_name(char *, const GrB_Scalar); GrB_Info GxB_Scalar_wait(GrB_Scalar *); @@ -3645,17 +3704,20 @@ GrB_Info GxB_SelectOp_xtype(GrB_Type *, GxB_SelectOp); GrB_Info GxB_Semiring_add(GrB_Monoid *, GrB_Semiring); GrB_Info GxB_Semiring_fprint(GrB_Semiring semiring, const char *name, int pr, FILE *f); GrB_Info GxB_Semiring_multiply(GrB_BinaryOp *, GrB_Semiring); +GrB_Info GxB_Semiring_new_arena(GrB_Semiring *semiring, GrB_Monoid add, GrB_BinaryOp multiply, const int header_arena); /* type */ GrB_Info GxB_Type_fprint(GrB_Type type, const char *name, int pr, FILE *f); GrB_Info GxB_Type_from_name(GrB_Type *type, const char *type_name); GrB_Info GxB_Type_name(char *, const GrB_Type); GrB_Info GxB_Type_new(GrB_Type *type, size_t sizeof_ctype, const char *type_name, const char *type_defn); +GrB_Info GxB_Type_new_arena(GrB_Type *type, size_t sizeof_type, const char *type_name, const char *type_defn, const int header_arena); GrB_Info GxB_Type_size(size_t *, const GrB_Type); /* unary */ GrB_Info GxB_UnaryOp_fprint(GrB_UnaryOp unaryop, const char *name, int pr, FILE *f); GrB_Info GxB_UnaryOp_new(GrB_UnaryOp *unaryop, GxB_unary_function function, GrB_Type ztype, GrB_Type xtype, const char *unop_name, const char *unop_defn); +GrB_Info GxB_UnaryOp_new_arena(GrB_UnaryOp *op_handle, GxB_unary_function function, GrB_Type ztype, GrB_Type xtype, const char *unop_name, const char *unop_defn, const int header_arena); GrB_Info GxB_UnaryOp_xtype(GrB_Type *, GrB_UnaryOp); GrB_Info GxB_UnaryOp_xtype_name(char *, const GrB_UnaryOp); GrB_Info GxB_UnaryOp_ztype(GrB_Type *, GrB_UnaryOp); @@ -3687,6 +3749,8 @@ GrB_Info GxB_Vector_build_Scalar(GrB_Vector w, const GrB_Index *I_, const GrB_Sc GrB_Info GxB_Vector_build_Scalar_Vector(GrB_Vector w, const GrB_Vector I_vector, const GrB_Scalar scalar, const GrB_Descriptor desc); GrB_Info GxB_Vector_build_Vector(GrB_Vector w, const GrB_Vector I_vector, const GrB_Vector X_vector, const GrB_BinaryOp dup, const GrB_Descriptor desc); GrB_Info GxB_Vector_deserialize(GrB_Vector *w, GrB_Type type, const void *blob, GrB_Index blob_size, const GrB_Descriptor desc); +GrB_Info GxB_Vector_deserialize_arena(GrB_Vector *w, GrB_Type type, const void *blob, GrB_Index blob_size, const int header_arena, const int data_arena, const GrB_Descriptor desc); +GrB_Info GxB_Vector_dup_arena(GrB_Vector *w, const GrB_Vector u, const int header_arena, const int data_arena); GrB_Info GxB_Vector_eWiseUnion(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Vector u, const GrB_Scalar alpha, const GrB_Vector v, const GrB_Scalar beta, const GrB_Descriptor desc); GrB_Info GxB_Vector_export_Bitmap(GrB_Vector *, GrB_Type *, uint64_t *, int8_t **, void **, uint64_t *, uint64_t *, bool *, uint64_t *, const GrB_Descriptor); GrB_Info GxB_Vector_export_CSC(GrB_Vector *, GrB_Type *, uint64_t *, uint64_t **, void **, uint64_t *, uint64_t *, bool *, uint64_t *, bool *, const GrB_Descriptor); @@ -3703,8 +3767,9 @@ GrB_Info GxB_Vector_import_CSC(GrB_Vector *, GrB_Type, uint64_t, uint64_t **, vo GrB_Info GxB_Vector_import_Full(GrB_Vector *, GrB_Type, uint64_t, void **, uint64_t, bool, const GrB_Descriptor); GrB_Info GxB_Vector_isStoredElement(const GrB_Vector v, GrB_Index i); GrB_Info GxB_Vector_iso(bool *, const GrB_Vector); -GrB_Info GxB_Vector_load(GrB_Vector V, void **X, GrB_Type type, uint64_t n, uint64_t X_size, int handling, const GrB_Descriptor desc); +GrB_Info GxB_Vector_load(GrB_Vector V, void **X, GrB_Type type, uint64_t n, uint64_t X_memsize, int handling, const GrB_Descriptor desc); GrB_Info GxB_Vector_memoryUsage(size_t *size, const GrB_Vector v); +GrB_Info GxB_Vector_new_arena(GrB_Vector *v, GrB_Type type, GrB_Index n, const int header_arena, const int data_arena); GrB_Info GxB_Vector_pack_Bitmap(GrB_Vector, int8_t **, void **, uint64_t, uint64_t, bool, uint64_t, const GrB_Descriptor); GrB_Info GxB_Vector_pack_CSC(GrB_Vector, uint64_t **, void **, uint64_t, uint64_t, bool, uint64_t, bool, const GrB_Descriptor); GrB_Info GxB_Vector_pack_Full(GrB_Vector, void **, uint64_t, bool, const GrB_Descriptor); @@ -3713,9 +3778,11 @@ GrB_Info GxB_Vector_reduce_FC64(GxB_FC64_t *c, const GrB_BinaryOp accum, const G GrB_Info GxB_Vector_select(GrB_Vector, const GrB_Vector, const GrB_BinaryOp, const GxB_SelectOp, const GrB_Vector, const GrB_Scalar, const GrB_Descriptor); GrB_Info GxB_Vector_select_FC32(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, GxB_FC32_t y, const GrB_Descriptor desc); GrB_Info GxB_Vector_select_FC64(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Vector u, GxB_FC64_t y, const GrB_Descriptor desc); -GrB_Info GxB_Vector_serialize(void **blob_handle, GrB_Index *blob_size_handle, GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GxB_Vector_serialize(void **blob_handle, GrB_Index *blob_size, GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GxB_Vector_serialize_arena(void **blob_handle, GrB_Index *blob_size, GrB_Vector u, const int data_arena, const GrB_Descriptor desc); GrB_Info GxB_Vector_setElement_FC32(GrB_Vector w, GxB_FC32_t x, GrB_Index i); GrB_Info GxB_Vector_setElement_FC64(GrB_Vector w, GxB_FC64_t x, GrB_Index i); +GrB_Info GxB_Vector_set_arenas(GrB_Vector *Vhandle, const int new_header_arena, const int new_data_arena); GrB_Info GxB_Vector_sort(GrB_Vector w, GrB_Vector p, GrB_BinaryOp op, GrB_Vector u, const GrB_Descriptor desc); GrB_Info GxB_Vector_subassign(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); GrB_Info GxB_Vector_subassign_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); @@ -3737,7 +3804,7 @@ GrB_Info GxB_Vector_subassign_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_Info GxB_Vector_subassign_Vector(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Vector I_vector, const GrB_Descriptor desc); GrB_Info GxB_Vector_type(GrB_Type *type, const GrB_Vector v); GrB_Info GxB_Vector_type_name(char *, const GrB_Vector); -GrB_Info GxB_Vector_unload(GrB_Vector V, void **X, GrB_Type *type, uint64_t *n, uint64_t *X_size, int *handling, const GrB_Descriptor desc); +GrB_Info GxB_Vector_unload(GrB_Vector V, void **X, GrB_Type *type, uint64_t *n, uint64_t *X_memsize, int *handling, const GrB_Descriptor desc); GrB_Info GxB_Vector_unpack_Bitmap(GrB_Vector, int8_t **, void **, uint64_t *, uint64_t *, bool *, uint64_t *, const GrB_Descriptor); GrB_Info GxB_Vector_unpack_CSC(GrB_Vector, uint64_t **, void **, uint64_t *, uint64_t *, bool *, uint64_t *, bool *, const GrB_Descriptor); GrB_Info GxB_Vector_unpack_Full(GrB_Vector, void **, uint64_t *, bool *, const GrB_Descriptor); @@ -3749,6 +3816,8 @@ GrB_Info GxB_unload_Vector_into_Container(GrB_Vector V, GxB_Container Container, #define GRB_VERSION ... #define GrB_INDEX_MAX ... #define GxB_ANY_SPARSITY ... +#define GxB_ARENA_DATA ... +#define GxB_ARENA_HEADER ... #define GxB_AUTO_SPARSITY ... #define GxB_BACKWARDS ... #define GxB_BEGIN ... @@ -3771,6 +3840,7 @@ GrB_Info GxB_unload_Vector_into_Container(GrB_Vector V, GxB_Container Container, #define GxB_INC ... #define GxB_INDEX_MAX ... #define GxB_MAX_NAME_LEN ... +#define GxB_NARENAS ... #define GxB_NBITMAP_SWITCH ... #define GxB_NGPUS ... #define GxB_NTHREADS ... diff --git a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h index 4376bec..dea3086 100644 --- a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h +++ b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h @@ -22,7 +22,7 @@ typedef struct GB_SelectOp_opaque *GxB_SelectOp; typedef struct GxB_Container_struct *GxB_Container; /* GxB typedefs (functions) */ -typedef int64_t (*GxB_print_function)(char *string, size_t string_size, const void *value, int verbose); +typedef int64_t (*GxB_print_function)(char *string, size_t string_len, const void *value, int verbose); typedef void (*GxB_binary_function)(void *, const void *, const void *); typedef void (*GxB_index_binary_function)(void *, const void *, GrB_Index, GrB_Index, const void *, GrB_Index, GrB_Index, const void *); typedef void (*GxB_index_unary_function)(void *z, const void *x, GrB_Index i, GrB_Index j, const void *y); @@ -39,7 +39,8 @@ struct GxB_Container_struct uint64_t u64_future[11]; int32_t format; int32_t orientation; - uint32_t u32_future[14]; + int32_t header_arena; + uint32_t u32_future[13]; GrB_Vector p; GrB_Vector h; GrB_Vector b; @@ -252,6 +253,10 @@ typedef enum GxB_CALLOC_FUNCTION = 7038, GxB_REALLOC_FUNCTION = 7039, GxB_FREE_FUNCTION = 7040, + GxB_ARENA_MALLOC = 0x10000, + GxB_ARENA_CALLOC = 0x20000, + GxB_ARENA_REALLOC = 0x30000, + GxB_ARENA_FREE = 0x40000, GxB_GLOBAL_NTHREADS = 7086, GxB_GLOBAL_CHUNK = 7087, GxB_GLOBAL_NGPUS = 7102, @@ -2817,8 +2822,8 @@ GrB_Info GrB_Matrix_select_UINT8(GrB_Matrix C, const GrB_Matrix Mask, const GrB_ GrB_Info GrB_Matrix_select_UINT16(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint16_t y, const GrB_Descriptor desc); GrB_Info GrB_Matrix_select_UINT32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint32_t y, const GrB_Descriptor desc); GrB_Info GrB_Matrix_select_UINT64(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_IndexUnaryOp op, const GrB_Matrix A, uint64_t y, const GrB_Descriptor desc); -GrB_Info GrB_Matrix_serialize(void *blob, GrB_Index *blob_size_handle, GrB_Matrix A); -GrB_Info GrB_Matrix_serializeSize(GrB_Index *blob_size_handle, GrB_Matrix A); +GrB_Info GrB_Matrix_serialize(void *blob, GrB_Index *blob_size, GrB_Matrix A); +GrB_Info GrB_Matrix_serializeSize(GrB_Index *blob_size, GrB_Matrix A); GrB_Info GrB_Matrix_setElement_BOOL(GrB_Matrix C, bool x, GrB_Index i, GrB_Index j); GrB_Info GrB_Matrix_setElement_FP32(GrB_Matrix C, float x, GrB_Index i, GrB_Index j); GrB_Info GrB_Matrix_setElement_FP64(GrB_Matrix C, double x, GrB_Index i, GrB_Index j); @@ -3142,6 +3147,7 @@ GrB_Info GB_Iterator_attach(GxB_Iterator iterator, GrB_Matrix A, int format, GrB /* binary */ GrB_Info GxB_BinaryOp_fprint(GrB_BinaryOp binaryop, const char *name, int pr, FILE *f); GrB_Info GxB_BinaryOp_new(GrB_BinaryOp *op, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *binop_name, const char *binop_defn); +GrB_Info GxB_BinaryOp_new_arena(GrB_BinaryOp *op_handle, GxB_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *binop_name, const char *binop_defn, const int header_arena); GrB_Info GxB_BinaryOp_xtype(GrB_Type *, GrB_BinaryOp); GrB_Info GxB_BinaryOp_xtype_name(char *, const GrB_BinaryOp); GrB_Info GxB_BinaryOp_ytype(GrB_Type *, GrB_BinaryOp); @@ -3152,6 +3158,7 @@ GrB_Info GxB_BinaryOp_ztype_name(char *, const GrB_BinaryOp); /* container */ GrB_Info GxB_Container_free(GxB_Container *object); GrB_Info GxB_Container_new(GxB_Container *Container); +GrB_Info GxB_Container_new_arena(GxB_Container *Container, const int header_arena, const int data_arena); /* context */ GrB_Info GxB_Context_disengage(GxB_Context Context); @@ -3167,6 +3174,7 @@ GrB_Info GxB_Context_get_SIZE(GxB_Context, size_t *, int); GrB_Info GxB_Context_get_String(GxB_Context, char *, int); GrB_Info GxB_Context_get_VOID(GxB_Context, void *, int); GrB_Info GxB_Context_new(GxB_Context *Context); +GrB_Info GxB_Context_new_arena(GxB_Context *Context_handle, const int header_arena); GrB_Info GxB_Context_set(GxB_Context, int, ...); GrB_Info GxB_Context_set_FP64(GxB_Context, int, double); GrB_Info GxB_Context_set_INT(GxB_Context, int32_t, int); @@ -3193,8 +3201,15 @@ GrB_Info GxB_Serialized_get_INT32(const void *, int32_t *, int, size_t); GrB_Info GxB_Serialized_get_SIZE(const void *, size_t *, int, size_t); GrB_Info GxB_Serialized_get_String(const void *, char *, int, size_t); GrB_Info GxB_Serialized_get_VOID(const void *, void *, int, size_t); +GrB_Info GxB_arena_init(int arena, void *(*user_malloc_function)(size_t), void *(*user_calloc_function)(size_t, size_t), void *(*user_realloc_function)(void *, size_t), void (*user_free_function)(void *)); +GrB_Info GxB_arena_initialized(int *flag, int arena); GrB_Info GxB_deserialize_type_name(char *, const void *, uint64_t); +GrB_Info GxB_finalized(int *flag); GrB_Info GxB_init(int mode, void *(*user_malloc_function)(size_t), void *(*user_calloc_function)(size_t, size_t), void *(*user_realloc_function)(void *, size_t), void (*user_free_function)(void *)); +GrB_Info GxB_initialized(int *flag); +void GxB_atfork_child(void); +void GxB_atfork_parent(void); +void GxB_atfork_prepare(void); /* descriptor */ GrB_Info GxB_Desc_get(GrB_Descriptor, int, ...); @@ -3205,6 +3220,7 @@ GrB_Info GxB_Desc_set_FP64(GrB_Descriptor, int, double); GrB_Info GxB_Desc_set_INT32(GrB_Descriptor, int, int32_t); GrB_Info GxB_Descriptor_fprint(GrB_Descriptor descriptor, const char *name, int pr, FILE *f); GrB_Info GxB_Descriptor_get(int32_t *, GrB_Descriptor, int); +GrB_Info GxB_Descriptor_new_arena(GrB_Descriptor *descriptor, const int header_arena); /* indexbinary */ GrB_Info GxB_IndexBinaryOp_error(const char **error, const GxB_IndexBinaryOp object); @@ -3215,6 +3231,7 @@ GrB_Info GxB_IndexBinaryOp_get_SIZE(GxB_IndexBinaryOp object, size_t *, int); GrB_Info GxB_IndexBinaryOp_get_String(GxB_IndexBinaryOp object, char *, int); GrB_Info GxB_IndexBinaryOp_get_VOID(GxB_IndexBinaryOp object, void *, int); GrB_Info GxB_IndexBinaryOp_new(GxB_IndexBinaryOp *op, GxB_index_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, GrB_Type theta_type, const char *idxbinop_name, const char *idxbinop_defn); +GrB_Info GxB_IndexBinaryOp_new_arena(GxB_IndexBinaryOp *op_handle, GxB_index_binary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, GrB_Type theta_type, const char *idxop_name, const char *idxop_defn, const int header_arena); GrB_Info GxB_IndexBinaryOp_set_INT32(GxB_IndexBinaryOp object, int32_t, int); GrB_Info GxB_IndexBinaryOp_set_String(GxB_IndexBinaryOp object, char *, int); GrB_Info GxB_IndexBinaryOp_set_VOID(GxB_IndexBinaryOp object, void *, int, size_t); @@ -3223,6 +3240,7 @@ GrB_Info GxB_IndexBinaryOp_wait(GxB_IndexBinaryOp object, int waitmode); /* indexunary */ GrB_Info GxB_IndexUnaryOp_fprint(GrB_IndexUnaryOp op, const char *name, int pr, FILE *f); GrB_Info GxB_IndexUnaryOp_new(GrB_IndexUnaryOp *op, GxB_index_unary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *idxop_name, const char *idxop_defn); +GrB_Info GxB_IndexUnaryOp_new_arena(GrB_IndexUnaryOp *op_handle, GxB_index_unary_function function, GrB_Type ztype, GrB_Type xtype, GrB_Type ytype, const char *idxop_name, const char *idxop_defn, const int header_arena); GrB_Info GxB_IndexUnaryOp_xtype_name(char *, const GrB_IndexUnaryOp); GrB_Info GxB_IndexUnaryOp_ytype_name(char *, const GrB_IndexUnaryOp); GrB_Info GxB_IndexUnaryOp_ztype_name(char *, const GrB_IndexUnaryOp); @@ -3241,6 +3259,7 @@ GrB_Index GxB_rowIterator_getRowIndex(GxB_Iterator iterator); GrB_Index GxB_rowIterator_kount(GxB_Iterator iterator); GrB_Info GxB_Iterator_free(GxB_Iterator *object); GrB_Info GxB_Iterator_new(GxB_Iterator *iterator); +GrB_Info GxB_Iterator_new_arena(GxB_Iterator *iterator, const int header_arena); GrB_Info GxB_Matrix_Iterator_next(GxB_Iterator iterator); GrB_Info GxB_Matrix_Iterator_seek(GxB_Iterator iterator, GrB_Index p); GrB_Info GxB_Vector_Iterator_next(GxB_Iterator iterator); @@ -3288,7 +3307,10 @@ GrB_Info GxB_Matrix_build_Scalar_Vector(GrB_Matrix C, const GrB_Vector I_vector, GrB_Info GxB_Matrix_build_Vector(GrB_Matrix C, const GrB_Vector I_vector, const GrB_Vector J_vector, const GrB_Vector X_vector, const GrB_BinaryOp dup, const GrB_Descriptor desc); GrB_Info GxB_Matrix_concat(GrB_Matrix C, const GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Descriptor desc); GrB_Info GxB_Matrix_deserialize(GrB_Matrix *C, GrB_Type type, const void *blob, GrB_Index blob_size, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_deserialize_arena(GrB_Matrix *C, GrB_Type type, const void *blob, uint64_t blob_memsize, const int header_arena, const int data_arena, const GrB_Descriptor desc); GrB_Info GxB_Matrix_diag(GrB_Matrix C, const GrB_Vector v, int64_t k, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_diag_arena(GrB_Matrix *C, const GrB_Vector v, int64_t k, const int header_arena, const int data_arena); +GrB_Info GxB_Matrix_dup_arena(GrB_Matrix *C, const GrB_Matrix A, const int header_arena, const int data_arena); GrB_Info GxB_Matrix_eWiseUnion(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Matrix A, const GrB_Scalar alpha, const GrB_Matrix B, const GrB_Scalar beta, const GrB_Descriptor desc); GrB_Info GxB_Matrix_export_BitmapC(GrB_Matrix *, GrB_Type *, uint64_t *, uint64_t *, int8_t **, void **, uint64_t *, uint64_t *, bool *, uint64_t *, const GrB_Descriptor); GrB_Info GxB_Matrix_export_BitmapR(GrB_Matrix *, GrB_Type *, uint64_t *, uint64_t *, int8_t **, void **, uint64_t *, uint64_t *, bool *, uint64_t *, const GrB_Descriptor); @@ -3312,6 +3334,7 @@ GrB_Info GxB_Matrix_import_HyperCSR(GrB_Matrix *, GrB_Type, uint64_t, uint64_t, GrB_Info GxB_Matrix_isStoredElement(const GrB_Matrix A, GrB_Index i, GrB_Index j); GrB_Info GxB_Matrix_iso(bool *, const GrB_Matrix); GrB_Info GxB_Matrix_memoryUsage(size_t *size, const GrB_Matrix A); +GrB_Info GxB_Matrix_new_arena(GrB_Matrix *A, GrB_Type type, GrB_Index nrows, GrB_Index ncols, const int header_arena, const int data_arena); GrB_Info GxB_Matrix_pack_BitmapC(GrB_Matrix, int8_t **, void **, uint64_t, uint64_t, bool, uint64_t, const GrB_Descriptor); GrB_Info GxB_Matrix_pack_BitmapR(GrB_Matrix, int8_t **, void **, uint64_t, uint64_t, bool, uint64_t, const GrB_Descriptor); GrB_Info GxB_Matrix_pack_CSC(GrB_Matrix, uint64_t **, uint64_t **, void **, uint64_t, uint64_t, uint64_t, bool, bool, const GrB_Descriptor); @@ -3322,10 +3345,14 @@ GrB_Info GxB_Matrix_pack_HyperCSC(GrB_Matrix, uint64_t **, uint64_t **, uint64_t GrB_Info GxB_Matrix_pack_HyperCSR(GrB_Matrix, uint64_t **, uint64_t **, uint64_t **, void **, uint64_t, uint64_t, uint64_t, uint64_t, bool, uint64_t, bool, const GrB_Descriptor); GrB_Info GxB_Matrix_reshape(GrB_Matrix C, bool by_col, GrB_Index nrows_new, GrB_Index ncols_new, const GrB_Descriptor desc); GrB_Info GxB_Matrix_reshapeDup(GrB_Matrix *C, GrB_Matrix A, bool by_col, GrB_Index nrows_new, GrB_Index ncols_new, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_reshapeDup_arena(GrB_Matrix *C, GrB_Matrix A, bool by_col, uint64_t nrows_new, uint64_t ncols_new, const int header_arena, const int data_arena, const GrB_Descriptor desc); GrB_Info GxB_Matrix_select(GrB_Matrix, const GrB_Matrix, const GrB_BinaryOp, const GxB_SelectOp, const GrB_Matrix, const GrB_Scalar, const GrB_Descriptor); -GrB_Info GxB_Matrix_serialize(void **blob_handle, GrB_Index *blob_size_handle, GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_serialize(void **blob_handle, GrB_Index *blob_size, GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_serialize_arena(void **blob_handle, GrB_Index *blob_size, GrB_Matrix A, const int data_arena, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_set_arenas(GrB_Matrix *Ahandle, const int new_header_arena, const int new_data_arena); GrB_Info GxB_Matrix_sort(GrB_Matrix C, GrB_Matrix P, GrB_BinaryOp op, GrB_Matrix A, const GrB_Descriptor desc); GrB_Info GxB_Matrix_split(GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Index *Tile_nrows, const GrB_Index *Tile_ncols, const GrB_Matrix A, const GrB_Descriptor desc); +GrB_Info GxB_Matrix_split_arena(GrB_Matrix *Tiles, const GrB_Index m, const GrB_Index n, const GrB_Index *Tile_nrows, const GrB_Index *Tile_ncols, const GrB_Matrix A, const int header_arena, const int data_arena, const GrB_Descriptor desc); GrB_Info GxB_Matrix_subassign(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, const GrB_Matrix A, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); GrB_Info GxB_Matrix_subassign_BOOL(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); GrB_Info GxB_Matrix_subassign_FP32(GrB_Matrix C, const GrB_Matrix Mask, const GrB_BinaryOp accum, float x, const GrB_Index *I_, GrB_Index ni, const GrB_Index *J, GrB_Index nj, const GrB_Descriptor desc); @@ -3366,6 +3393,18 @@ GrB_Info GxB_unpack_HyperHash(GrB_Matrix, GrB_Matrix *, const GrB_Descriptor); /* monoid */ GrB_Info GxB_Monoid_fprint(GrB_Monoid monoid, const char *name, int pr, FILE *f); GrB_Info GxB_Monoid_identity(void *, GrB_Monoid); +GrB_Info GxB_Monoid_new_arena_BOOL(GrB_Monoid *monoid, GrB_BinaryOp op, bool identity, const int header_arena); +GrB_Info GxB_Monoid_new_arena_FP32(GrB_Monoid *monoid, GrB_BinaryOp op, float identity, const int header_arena); +GrB_Info GxB_Monoid_new_arena_FP64(GrB_Monoid *monoid, GrB_BinaryOp op, double identity, const int header_arena); +GrB_Info GxB_Monoid_new_arena_INT8(GrB_Monoid *monoid, GrB_BinaryOp op, int8_t identity, const int header_arena); +GrB_Info GxB_Monoid_new_arena_INT16(GrB_Monoid *monoid, GrB_BinaryOp op, int16_t identity, const int header_arena); +GrB_Info GxB_Monoid_new_arena_INT32(GrB_Monoid *monoid, GrB_BinaryOp op, int32_t identity, const int header_arena); +GrB_Info GxB_Monoid_new_arena_INT64(GrB_Monoid *monoid, GrB_BinaryOp op, int64_t identity, const int header_arena); +GrB_Info GxB_Monoid_new_arena_UDT(GrB_Monoid *monoid, GrB_BinaryOp op, void *identity, const int header_arena); +GrB_Info GxB_Monoid_new_arena_UINT8(GrB_Monoid *monoid, GrB_BinaryOp op, uint8_t identity, const int header_arena); +GrB_Info GxB_Monoid_new_arena_UINT16(GrB_Monoid *monoid, GrB_BinaryOp op, uint16_t identity, const int header_arena); +GrB_Info GxB_Monoid_new_arena_UINT32(GrB_Monoid *monoid, GrB_BinaryOp op, uint32_t identity, const int header_arena); +GrB_Info GxB_Monoid_new_arena_UINT64(GrB_Monoid *monoid, GrB_BinaryOp op, uint64_t identity, const int header_arena); GrB_Info GxB_Monoid_operator(GrB_BinaryOp *, GrB_Monoid); GrB_Info GxB_Monoid_terminal(bool *, void *, GrB_Monoid); GrB_Info GxB_Monoid_terminal_new_BOOL(GrB_Monoid *monoid, GrB_BinaryOp op, bool identity, bool terminal); @@ -3380,15 +3419,29 @@ GrB_Info GxB_Monoid_terminal_new_UINT8(GrB_Monoid *monoid, GrB_BinaryOp op, uint GrB_Info GxB_Monoid_terminal_new_UINT16(GrB_Monoid *monoid, GrB_BinaryOp op, uint16_t identity, uint16_t terminal); GrB_Info GxB_Monoid_terminal_new_UINT32(GrB_Monoid *monoid, GrB_BinaryOp op, uint32_t identity, uint32_t terminal); GrB_Info GxB_Monoid_terminal_new_UINT64(GrB_Monoid *monoid, GrB_BinaryOp op, uint64_t identity, uint64_t terminal); +GrB_Info GxB_Monoid_terminal_new_arena_BOOL(GrB_Monoid *monoid, GrB_BinaryOp op, bool identity, bool terminal, const int header_arena); +GrB_Info GxB_Monoid_terminal_new_arena_FP32(GrB_Monoid *monoid, GrB_BinaryOp op, float identity, float terminal, const int header_arena); +GrB_Info GxB_Monoid_terminal_new_arena_FP64(GrB_Monoid *monoid, GrB_BinaryOp op, double identity, double terminal, const int header_arena); +GrB_Info GxB_Monoid_terminal_new_arena_INT8(GrB_Monoid *monoid, GrB_BinaryOp op, int8_t identity, int8_t terminal, const int header_arena); +GrB_Info GxB_Monoid_terminal_new_arena_INT16(GrB_Monoid *monoid, GrB_BinaryOp op, int16_t identity, int16_t terminal, const int header_arena); +GrB_Info GxB_Monoid_terminal_new_arena_INT32(GrB_Monoid *monoid, GrB_BinaryOp op, int32_t identity, int32_t terminal, const int header_arena); +GrB_Info GxB_Monoid_terminal_new_arena_INT64(GrB_Monoid *monoid, GrB_BinaryOp op, int64_t identity, int64_t terminal, const int header_arena); +GrB_Info GxB_Monoid_terminal_new_arena_UDT(GrB_Monoid *monoid, GrB_BinaryOp op, void *identity, void *terminal, const int header_arena); +GrB_Info GxB_Monoid_terminal_new_arena_UINT8(GrB_Monoid *monoid, GrB_BinaryOp op, uint8_t identity, uint8_t terminal, const int header_arena); +GrB_Info GxB_Monoid_terminal_new_arena_UINT16(GrB_Monoid *monoid, GrB_BinaryOp op, uint16_t identity, uint16_t terminal, const int header_arena); +GrB_Info GxB_Monoid_terminal_new_arena_UINT32(GrB_Monoid *monoid, GrB_BinaryOp op, uint32_t identity, uint32_t terminal, const int header_arena); +GrB_Info GxB_Monoid_terminal_new_arena_UINT64(GrB_Monoid *monoid, GrB_BinaryOp op, uint64_t identity, uint64_t terminal, const int header_arena); /* scalar */ GrB_Info GxB_BinaryOp_new_IndexOp(GrB_BinaryOp *binop, GxB_IndexBinaryOp idxbinop, GrB_Scalar theta); +GrB_Info GxB_BinaryOp_new_IndexOp_arena(GrB_BinaryOp *binop_handle, GxB_IndexBinaryOp idxbinop, GrB_Scalar theta, const int header_arena); GrB_Info GxB_Context_get_Scalar(GxB_Context, GrB_Scalar, int); GrB_Info GxB_Context_set_Scalar(GxB_Context, GrB_Scalar, int); GrB_Info GxB_IndexBinaryOp_get_Scalar(GxB_IndexBinaryOp object, GrB_Scalar, int); GrB_Info GxB_IndexBinaryOp_set_Scalar(GxB_IndexBinaryOp object, GrB_Scalar, int); GrB_Info GxB_Scalar_clear(GrB_Scalar); GrB_Info GxB_Scalar_dup(GrB_Scalar *, const GrB_Scalar); +GrB_Info GxB_Scalar_dup_arena(GrB_Scalar *s, const GrB_Scalar t, const int header_arena, const int data_arena); GrB_Info GxB_Scalar_error(const char **, const GrB_Scalar); GrB_Info GxB_Scalar_extractElement_BOOL(bool *, const GrB_Scalar); GrB_Info GxB_Scalar_extractElement_FP32(float *, const GrB_Scalar); @@ -3406,6 +3459,7 @@ GrB_Info GxB_Scalar_fprint(GrB_Scalar s, const char *name, int pr, FILE *f); GrB_Info GxB_Scalar_free(GrB_Scalar *); GrB_Info GxB_Scalar_memoryUsage(size_t *size, const GrB_Scalar s); GrB_Info GxB_Scalar_new(GrB_Scalar *, GrB_Type); +GrB_Info GxB_Scalar_new_arena(GrB_Scalar *s, GrB_Type type, const int header_arena, const int data_arena); GrB_Info GxB_Scalar_nvals(uint64_t *, const GrB_Scalar); GrB_Info GxB_Scalar_setElement_BOOL(GrB_Scalar, bool); GrB_Info GxB_Scalar_setElement_FP32(GrB_Scalar, float); @@ -3419,6 +3473,7 @@ GrB_Info GxB_Scalar_setElement_UINT8(GrB_Scalar, uint8_t); GrB_Info GxB_Scalar_setElement_UINT16(GrB_Scalar, uint16_t); GrB_Info GxB_Scalar_setElement_UINT32(GrB_Scalar, uint32_t); GrB_Info GxB_Scalar_setElement_UINT64(GrB_Scalar, uint64_t); +GrB_Info GxB_Scalar_set_arenas(GrB_Scalar *Shandle, const int new_header_arena, const int new_data_arena); GrB_Info GxB_Scalar_type(GrB_Type *type, const GrB_Scalar s); GrB_Info GxB_Scalar_type_name(char *, const GrB_Scalar); GrB_Info GxB_Scalar_wait(GrB_Scalar *); @@ -3433,17 +3488,20 @@ GrB_Info GxB_SelectOp_xtype(GrB_Type *, GxB_SelectOp); GrB_Info GxB_Semiring_add(GrB_Monoid *, GrB_Semiring); GrB_Info GxB_Semiring_fprint(GrB_Semiring semiring, const char *name, int pr, FILE *f); GrB_Info GxB_Semiring_multiply(GrB_BinaryOp *, GrB_Semiring); +GrB_Info GxB_Semiring_new_arena(GrB_Semiring *semiring, GrB_Monoid add, GrB_BinaryOp multiply, const int header_arena); /* type */ GrB_Info GxB_Type_fprint(GrB_Type type, const char *name, int pr, FILE *f); GrB_Info GxB_Type_from_name(GrB_Type *type, const char *type_name); GrB_Info GxB_Type_name(char *, const GrB_Type); GrB_Info GxB_Type_new(GrB_Type *type, size_t sizeof_ctype, const char *type_name, const char *type_defn); +GrB_Info GxB_Type_new_arena(GrB_Type *type, size_t sizeof_type, const char *type_name, const char *type_defn, const int header_arena); GrB_Info GxB_Type_size(size_t *, const GrB_Type); /* unary */ GrB_Info GxB_UnaryOp_fprint(GrB_UnaryOp unaryop, const char *name, int pr, FILE *f); GrB_Info GxB_UnaryOp_new(GrB_UnaryOp *unaryop, GxB_unary_function function, GrB_Type ztype, GrB_Type xtype, const char *unop_name, const char *unop_defn); +GrB_Info GxB_UnaryOp_new_arena(GrB_UnaryOp *op_handle, GxB_unary_function function, GrB_Type ztype, GrB_Type xtype, const char *unop_name, const char *unop_defn, const int header_arena); GrB_Info GxB_UnaryOp_xtype(GrB_Type *, GrB_UnaryOp); GrB_Info GxB_UnaryOp_xtype_name(char *, const GrB_UnaryOp); GrB_Info GxB_UnaryOp_ztype(GrB_Type *, GrB_UnaryOp); @@ -3465,6 +3523,8 @@ GrB_Info GxB_Vector_build_Scalar(GrB_Vector w, const GrB_Index *I_, const GrB_Sc GrB_Info GxB_Vector_build_Scalar_Vector(GrB_Vector w, const GrB_Vector I_vector, const GrB_Scalar scalar, const GrB_Descriptor desc); GrB_Info GxB_Vector_build_Vector(GrB_Vector w, const GrB_Vector I_vector, const GrB_Vector X_vector, const GrB_BinaryOp dup, const GrB_Descriptor desc); GrB_Info GxB_Vector_deserialize(GrB_Vector *w, GrB_Type type, const void *blob, GrB_Index blob_size, const GrB_Descriptor desc); +GrB_Info GxB_Vector_deserialize_arena(GrB_Vector *w, GrB_Type type, const void *blob, GrB_Index blob_size, const int header_arena, const int data_arena, const GrB_Descriptor desc); +GrB_Info GxB_Vector_dup_arena(GrB_Vector *w, const GrB_Vector u, const int header_arena, const int data_arena); GrB_Info GxB_Vector_eWiseUnion(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_BinaryOp add, const GrB_Vector u, const GrB_Scalar alpha, const GrB_Vector v, const GrB_Scalar beta, const GrB_Descriptor desc); GrB_Info GxB_Vector_export_Bitmap(GrB_Vector *, GrB_Type *, uint64_t *, int8_t **, void **, uint64_t *, uint64_t *, bool *, uint64_t *, const GrB_Descriptor); GrB_Info GxB_Vector_export_CSC(GrB_Vector *, GrB_Type *, uint64_t *, uint64_t **, void **, uint64_t *, uint64_t *, bool *, uint64_t *, bool *, const GrB_Descriptor); @@ -3477,13 +3537,16 @@ GrB_Info GxB_Vector_import_CSC(GrB_Vector *, GrB_Type, uint64_t, uint64_t **, vo GrB_Info GxB_Vector_import_Full(GrB_Vector *, GrB_Type, uint64_t, void **, uint64_t, bool, const GrB_Descriptor); GrB_Info GxB_Vector_isStoredElement(const GrB_Vector v, GrB_Index i); GrB_Info GxB_Vector_iso(bool *, const GrB_Vector); -GrB_Info GxB_Vector_load(GrB_Vector V, void **X, GrB_Type type, uint64_t n, uint64_t X_size, int handling, const GrB_Descriptor desc); +GrB_Info GxB_Vector_load(GrB_Vector V, void **X, GrB_Type type, uint64_t n, uint64_t X_memsize, int handling, const GrB_Descriptor desc); GrB_Info GxB_Vector_memoryUsage(size_t *size, const GrB_Vector v); +GrB_Info GxB_Vector_new_arena(GrB_Vector *v, GrB_Type type, GrB_Index n, const int header_arena, const int data_arena); GrB_Info GxB_Vector_pack_Bitmap(GrB_Vector, int8_t **, void **, uint64_t, uint64_t, bool, uint64_t, const GrB_Descriptor); GrB_Info GxB_Vector_pack_CSC(GrB_Vector, uint64_t **, void **, uint64_t, uint64_t, bool, uint64_t, bool, const GrB_Descriptor); GrB_Info GxB_Vector_pack_Full(GrB_Vector, void **, uint64_t, bool, const GrB_Descriptor); GrB_Info GxB_Vector_select(GrB_Vector, const GrB_Vector, const GrB_BinaryOp, const GxB_SelectOp, const GrB_Vector, const GrB_Scalar, const GrB_Descriptor); -GrB_Info GxB_Vector_serialize(void **blob_handle, GrB_Index *blob_size_handle, GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GxB_Vector_serialize(void **blob_handle, GrB_Index *blob_size, GrB_Vector u, const GrB_Descriptor desc); +GrB_Info GxB_Vector_serialize_arena(void **blob_handle, GrB_Index *blob_size, GrB_Vector u, const int data_arena, const GrB_Descriptor desc); +GrB_Info GxB_Vector_set_arenas(GrB_Vector *Vhandle, const int new_header_arena, const int new_data_arena); GrB_Info GxB_Vector_sort(GrB_Vector w, GrB_Vector p, GrB_BinaryOp op, GrB_Vector u, const GrB_Descriptor desc); GrB_Info GxB_Vector_subassign(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); GrB_Info GxB_Vector_subassign_BOOL(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, bool x, const GrB_Index *I_, GrB_Index ni, const GrB_Descriptor desc); @@ -3503,7 +3566,7 @@ GrB_Info GxB_Vector_subassign_UINT64(GrB_Vector w, const GrB_Vector mask, const GrB_Info GxB_Vector_subassign_Vector(GrB_Vector w, const GrB_Vector mask, const GrB_BinaryOp accum, const GrB_Vector u, const GrB_Vector I_vector, const GrB_Descriptor desc); GrB_Info GxB_Vector_type(GrB_Type *type, const GrB_Vector v); GrB_Info GxB_Vector_type_name(char *, const GrB_Vector); -GrB_Info GxB_Vector_unload(GrB_Vector V, void **X, GrB_Type *type, uint64_t *n, uint64_t *X_size, int *handling, const GrB_Descriptor desc); +GrB_Info GxB_Vector_unload(GrB_Vector V, void **X, GrB_Type *type, uint64_t *n, uint64_t *X_memsize, int *handling, const GrB_Descriptor desc); GrB_Info GxB_Vector_unpack_Bitmap(GrB_Vector, int8_t **, void **, uint64_t *, uint64_t *, bool *, uint64_t *, const GrB_Descriptor); GrB_Info GxB_Vector_unpack_CSC(GrB_Vector, uint64_t **, void **, uint64_t *, uint64_t *, bool *, uint64_t *, bool *, const GrB_Descriptor); GrB_Info GxB_Vector_unpack_Full(GrB_Vector, void **, uint64_t *, bool *, const GrB_Descriptor); @@ -3515,6 +3578,8 @@ GrB_Info GxB_unload_Vector_into_Container(GrB_Vector V, GxB_Container Container, #define GRB_VERSION ... #define GrB_INDEX_MAX ... #define GxB_ANY_SPARSITY ... +#define GxB_ARENA_DATA ... +#define GxB_ARENA_HEADER ... #define GxB_AUTO_SPARSITY ... #define GxB_BACKWARDS ... #define GxB_BEGIN ... @@ -3537,6 +3602,7 @@ GrB_Info GxB_unload_Vector_into_Container(GrB_Vector V, GxB_Container Container, #define GxB_INC ... #define GxB_INDEX_MAX ... #define GxB_MAX_NAME_LEN ... +#define GxB_NARENAS ... #define GxB_NBITMAP_SWITCH ... #define GxB_NGPUS ... #define GxB_NTHREADS ... From b1623b3752782d3dd73cc0f564f98f93c7bebefd Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Tue, 11 Aug 2026 11:05:52 -0500 Subject: [PATCH 185/193] Update to SS:GB 10.4.1 (#152) --- .pre-commit-config.yaml | 2 +- GB_VERSION.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6f168de..93a9779 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -89,7 +89,7 @@ repos: - id: python-no-log-warn - id: text-unicode-replacement-char - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.37.4 + rev: 0.38.0 hooks: - id: check-dependabot - id: check-github-workflows diff --git a/GB_VERSION.txt b/GB_VERSION.txt index 816c071..da772b9 100644 --- a/GB_VERSION.txt +++ b/GB_VERSION.txt @@ -1 +1 @@ -10.4.0 +10.4.1 From 96bb9a6c99c1a63dd7688d3dff552a98677e00ca Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Tue, 25 Aug 2026 11:32:56 -0500 Subject: [PATCH 186/193] Update to SS:GB 10.5.0 (#153) --- .pre-commit-config.yaml | 8 ++++---- GB_VERSION.txt | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 93a9779..4889f83 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -31,17 +31,17 @@ repos: - id: name-tests-test args: ["--pytest-test-first"] - repo: https://github.com/abravalheri/validate-pyproject - rev: v0.25 + rev: '0.26' hooks: - id: validate-pyproject name: Validate pyproject.toml - repo: https://github.com/PyCQA/autoflake - rev: v2.3.3 + rev: v2.4.0 hooks: - id: autoflake args: [--in-place] - repo: https://github.com/pycqa/isort - rev: 9.0.0b2 + rev: 9.0.0b5 hooks: - id: isort - repo: https://github.com/asottile/pyupgrade @@ -77,7 +77,7 @@ repos: # - id: pyroma # args: [-n, "10", .] - repo: https://github.com/shellcheck-py/shellcheck-py - rev: "v0.11.0.1" + rev: "v0.11.0.1-1" hooks: - id: shellcheck - repo: https://github.com/pre-commit/pygrep-hooks diff --git a/GB_VERSION.txt b/GB_VERSION.txt index da772b9..2cf514e 100644 --- a/GB_VERSION.txt +++ b/GB_VERSION.txt @@ -1 +1 @@ -10.4.1 +10.5.0 From 0ca0f0fef923801d04794d7e0f8b8d9fcc40ae1a Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Wed, 26 Aug 2026 09:22:51 -0500 Subject: [PATCH 187/193] Strict cmake config to ensure openmp is used (#154) --- suitesparse.sh | 14 ++++++ suitesparse_graphblas/__init__.py | 9 ++++ suitesparse_graphblas/tests/test_package.py | 56 ++++++++++++++++++++- 3 files changed, 78 insertions(+), 1 deletion(-) diff --git a/suitesparse.sh b/suitesparse.sh index ad05bbf..aab7fd3 100755 --- a/suitesparse.sh +++ b/suitesparse.sh @@ -27,6 +27,20 @@ if [ -z "${NPROC}" ]; then fi cmake_params=() + +# Fail the build if OpenMP is missing instead of silently producing a serial +# library. GraphBLAS only warns and carries on, so a serial build stays +# invisible until someone measures it: conda-forge's graphblas 10.5.0 shipped +# that way on osx-arm64 while still depending on llvm-openmp. The matching +# runtime check on the built wheel is tests/test_package.py::test_openmp. +cmake_params+=(-DSUITESPARSE_USE_OPENMP=ON) +cmake_params+=(-DSUITESPARSE_USE_STRICT=ON) +# STRICT makes any requested-but-missing feature fatal, and SuiteSparsePolicy +# defaults both of these to ON, so they must be turned off explicitly or the +# configure step dies on "CUDA required for SuiteSparse but not found". +cmake_params+=(-DSUITESPARSE_USE_CUDA=OFF) +cmake_params+=(-DSUITESPARSE_USE_FORTRAN=OFF) + if [ -n "${BREW_LIBOMP}" ]; then # macOS OpenMP flags. # FindOpenMP doesn't find brew's libomp, so set the necessary configs manually. diff --git a/suitesparse_graphblas/__init__.py b/suitesparse_graphblas/__init__.py index 895a66f..7d08d23 100644 --- a/suitesparse_graphblas/__init__.py +++ b/suitesparse_graphblas/__init__.py @@ -24,6 +24,15 @@ ) from exc del importlib, platform +# The SuiteSparse:GraphBLAS C library this binding was built against, as +# (major, minor, sub). ``__version__`` is the version of *this package*, +# which should normally match. +libgraphblas_version = ( + lib.GxB_IMPLEMENTATION_MAJOR, + lib.GxB_IMPLEMENTATION_MINOR, + lib.GxB_IMPLEMENTATION_SUB, +) + # It is strongly recommended to use the non-variadic version of functions to be # compatible with the most number of architectures. For example, you should use # GxB_Matrix_Option_get_INT32 instead of GxB_Matrix_Option_get. diff --git a/suitesparse_graphblas/tests/test_package.py b/suitesparse_graphblas/tests/test_package.py index 77086a6..b0e2d32 100644 --- a/suitesparse_graphblas/tests/test_package.py +++ b/suitesparse_graphblas/tests/test_package.py @@ -1,5 +1,7 @@ +import pytest + import suitesparse_graphblas -from suitesparse_graphblas import ffi, lib # noqa: F401 +from suitesparse_graphblas import ffi, lib def test_matrix_existence(): @@ -12,3 +14,55 @@ def test_version(): version = suitesparse_graphblas.__version__ version = [int(x) for x in version.split("+")[0].split(".")] assert version > [9, 4, 4, 0] + + +def test_openmp(): + # GraphBLAS only warns at configure time when OpenMP is missing and still + # builds a working, but serial, library, so a serial build is invisible + # from the outside: conda-forge's graphblas 10.5.0 shipped that way on + # osx-arm64. Wheels build GraphBLAS from source in suitesparse.sh, where + # macOS has to point CMake at Homebrew's libomp by hand, so the same slip + # is possible here. + val_ptr = ffi.new("int32_t*") + info = lib.GrB_Global_get_INT32(lib.GrB_GLOBAL, val_ptr, lib.GxB_LIBRARY_OPENMP) + assert info == lib.GrB_SUCCESS + assert val_ptr[0], "libgraphblas was built without OpenMP" + + +def test_libgraphblas_version_matches_the_loaded_library(): + """The GraphBLAS this extension was compiled against must be the one it loads. + + ``libgraphblas_version`` reads cffi ``#define`` constants, which are + resolved when the C extension is compiled against a particular + GraphBLAS.h. The values below come from the shared library actually loaded + at runtime. When those disagree, every cffi call is reading a struct laid + out by a different build -- a mismatch that surfaces later as an + unexplained ``GrB_OUT_OF_MEMORY`` or a crash, never as an import error. + """ + val_ptr = ffi.new("int32_t*") + runtime = [] + for field in ( + lib.GrB_LIBRARY_VER_MAJOR, + lib.GrB_LIBRARY_VER_MINOR, + lib.GrB_LIBRARY_VER_PATCH, + ): + assert lib.GrB_Global_get_INT32(lib.GrB_GLOBAL, val_ptr, field) == lib.GrB_SUCCESS + runtime.append(val_ptr[0]) + assert tuple(runtime) == suitesparse_graphblas.libgraphblas_version + + +def test_version_tracks_libgraphblas(): + """A released version's first three parts are the SuiteSparse:GraphBLAS version. + + That convention is what lets a caller infer the library version from the + package version, and it only holds for a release: between releases the + version reports the previous tag, which is why ``libgraphblas_version`` + exists and why anything gating on a library feature should read that + instead. Skipped on a development build rather than asserted, since + disagreeing there is the expected state, not a defect. + """ + version = suitesparse_graphblas.__version__ + if "+" in version: + pytest.skip(f"development build between releases: {version}") + parts = tuple(int(x) for x in version.split(".")[:3]) + assert parts == suitesparse_graphblas.libgraphblas_version From 6318bbc3fc67ec732f50529a5c642b384c004355 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Thu, 17 Sep 2026 11:45:12 -0500 Subject: [PATCH 188/193] Update to 10.5.1 (#155) --- .pre-commit-config.yaml | 2 +- GB_VERSION.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4889f83..292c81c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -41,7 +41,7 @@ repos: - id: autoflake args: [--in-place] - repo: https://github.com/pycqa/isort - rev: 9.0.0b5 + rev: 9.0.1 hooks: - id: isort - repo: https://github.com/asottile/pyupgrade diff --git a/GB_VERSION.txt b/GB_VERSION.txt index 2cf514e..4a6e70e 100644 --- a/GB_VERSION.txt +++ b/GB_VERSION.txt @@ -1 +1 @@ -10.5.0 +10.5.1 From 1434ec8326e73e241fe2064d7fc374abefdbcb5f Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Thu, 17 Sep 2026 13:25:23 -0500 Subject: [PATCH 189/193] Disable docs deploy, b/c we don't have docs yet (#156) --- .github/workflows/docs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 70f7bc0..777414d 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,8 +1,8 @@ name: docs +# Disabled: we don't have docs to deploy yet, so this only runs when +# triggered manually. Restore `push: branches: [main]` to re-enable. on: - push: - branches: [main] workflow_dispatch: permissions: From a1be7302a0b77d452d94b98153b00a6bd3987ec6 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Thu, 8 Oct 2026 08:40:04 -0700 Subject: [PATCH 190/193] Update to Python 3.15, other maintenance, and allocator stuff (#157) * Support Python 3.15; fix allocator mismatches with NumPy >= 2.5 NumPy 2.5 allocates with PyMem_RawMalloc, but frees OWNDATA arrays that have no memory handler with libc free(). The two differ on free-threaded 3.15 (mimalloc) and under PYTHONMALLOC=debug, so matrix.serialize and binread aborted there. - claim_buffer attaches NumPy's default memory handler (setup.py sets NPY_TARGET_VERSION to 1.22 to expose it) - binread allocates with GraphBLAS's own allocator instead of libc malloc - add utils.can_unclaim_buffer to check before handing an array's buffer to GraphBLAS; document unclaim_buffer - initialize() raises if GraphBLAS fails to initialize - add tests/test_memory.py (runs in a subprocess with PYTHONMALLOC=debug) Python 3.15 and maintenance: - add 3.15 classifier and Black target; test 3.15 rc in CI via the conda-forge python_rc channel, ranked below conda-forge - cibuildwheel v3.4 -> v4.2 (builds cp315 and cp315t wheels) - update all actions and pin them to commit SHAs; group Dependabot updates with a 7-day cooldown - least-privilege workflow permissions, cancel superseded PR runs, no ${{ }} expansion inside run: scripts; `bash -el` so a failing command in a multi-command test step fails the step - stricter pytest config: warnings are errors, strict markers and config - update pre-commit hooks; add actionlint, zizmor and pysentry - rename CLAUDE.md to AGENTS.md and update it - publish via PyPI Trusted Publishing (environments pypi and test-pypi) instead of an API token * Pair NumPy memory handlers with GraphBLAS arenas; add give_buffer GraphBLAS (>= 10.4) frees a buffer with its arena's allocator, and NumPy frees an array's data with the array's memory handler. A buffer that crosses between them needs both to agree, or the wrong free aborts (free-threaded 3.15, PYTHONMALLOC=debug) or corrupts memory. - claim_buffer and claim_buffer_2d attach the handler for the buffer's arena (NumPy's default if the arena uses NumPy's allocator, else one that calls the arena's functions); new optional `arena` argument - add give_buffer, a context manager that hands an array (or a copy) to GraphBLAS and commits only if GraphBLAS took it, and empty(), which allocates arrays GraphBLAS can always own - can_unclaim_buffer checks the handler matches the arena; unclaim_buffer raises if the array can't be owned - serialize_* name the result's arena; binread reads into the new matrix's arena and packs with give_buffer, which also fixes iso matrices packed with a full-size Ax_size; binwrite restores the matrix if writing fails - tests fail when NumPy frees an array that has no handler; test_memory covers both memory managers and a libc arena (explicit, global, and Context); doctests run for every api module; wheel tests use -W error - drop stale flake8 ignores; ignore create_headers.py's output --- .flake8 | 2 - .github/dependabot.yml | 9 + .github/workflows/docs.yml | 18 +- .github/workflows/lint.yml | 11 +- .github/workflows/test.yml | 58 ++- .github/workflows/update_graphblas.yml | 21 +- .github/workflows/wheels.yml | 98 ++--- .gitignore | 4 + .pre-commit-config.yaml | 23 +- CLAUDE.md => AGENTS.md | 81 +++- pyproject.toml | 16 +- setup.py | 7 +- suitesparse_graphblas/__init__.py | 18 +- suitesparse_graphblas/api/io/binary.py | 363 +++++++---------- suitesparse_graphblas/api/io/serialize.py | 19 +- suitesparse_graphblas/conftest.py | 21 + suitesparse_graphblas/tests/test_doctest.py | 60 +-- suitesparse_graphblas/tests/test_io.py | 9 + suitesparse_graphblas/tests/test_memory.py | 361 +++++++++++++++++ suitesparse_graphblas/utils.pxd | 39 +- suitesparse_graphblas/utils.pyx | 408 +++++++++++++++++++- 21 files changed, 1247 insertions(+), 399 deletions(-) rename CLAUDE.md => AGENTS.md (60%) create mode 100644 suitesparse_graphblas/tests/test_memory.py diff --git a/.flake8 b/.flake8 index 617214e..0d31d68 100644 --- a/.flake8 +++ b/.flake8 @@ -5,7 +5,5 @@ extend-ignore = E203, # E203 whitespace before ':' (to be compatible with black) per-file-ignores = - suitesparse_graphblas/io/binary.py:C408, - suitesparse_graphblas/tests/test_io.py:E721, # The api package re-exports its submodules for `from suitesparse_graphblas import api` suitesparse_graphblas/api/__init__.py:F401, diff --git a/.github/dependabot.yml b/.github/dependabot.yml index b18fd29..5fa64ac 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,3 +4,12 @@ updates: directory: '/' schedule: interval: 'weekly' + # Wait a week after a release before proposing it, so a compromised or + # broken release has time to be noticed and yanked. + cooldown: + default-days: 7 + # One PR per week for all action bumps instead of one PR per action. + groups: + github-actions: + patterns: + - '*' diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 777414d..a6f536b 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -6,8 +6,7 @@ on: workflow_dispatch: permissions: - pages: write - id-token: write + contents: read concurrency: group: pages @@ -17,33 +16,38 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - name: Build package in Docker run: | docker build --target psg \ - --build-arg SUITESPARSE=v$(cat GB_VERSION.txt) \ + --build-arg SUITESPARSE="v$(cat GB_VERSION.txt)" \ --build-arg VERSION=99.0.0.0 \ --build-arg COMPACT=1 \ -t psg-docs . - name: Generate docs with pdoc run: | - docker run --rm -v ${{ github.workspace }}/site:/out psg-docs \ + docker run --rm -v "$GITHUB_WORKSPACE/site:/out" psg-docs \ bash -c "pip install --break-system-packages -q pdoc && \ pdoc --output-directory /out --no-show-source --docformat numpy \ suitesparse_graphblas.api" - - uses: actions/upload-pages-artifact@v3 + - uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0 with: path: site/ deploy: needs: build runs-on: ubuntu-latest + permissions: + pages: write # to deploy to GitHub Pages + id-token: write # to prove the deployment comes from this workflow environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} steps: - - uses: actions/deploy-pages@v4 + - uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1 id: deployment diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 63644a1..b05ed8a 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -9,16 +9,21 @@ on: permissions: contents: read +# Cancel superseded runs of a PR; never cancel branch pushes. +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} + cancel-in-progress: true + jobs: pre-commit: name: pre-commit-hooks runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 persist-credentials: false - - uses: actions/setup-python@v6 + - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: "3.11" - - uses: pre-commit/action@v3.0.1 + - uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 07815f1..0d79922 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,12 +5,22 @@ on: branches: [ main ] pull_request: +permissions: + contents: read + +# Cancel superseded runs of a PR; never cancel runs on main. +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} + cancel-in-progress: true + jobs: test: runs-on: ${{ matrix.os }} defaults: run: - shell: bash -l {0} + # -e: a custom shell gets no errexit, so without it a multi-command step + # (e.g. "Test") would only report the exit status of its last command. + shell: bash -el {0} strategy: fail-fast: false matrix: @@ -19,14 +29,17 @@ jobs: # os: ["ubuntu-latest"] # source: ["source"] # A trailing "t" means the free-threaded (no-GIL) build of that version. - python-version: ["3.11", "3.12", "3.13", "3.14", "3.14t"] + # TODO: add "3.15t" once conda-forge builds cffi and numpy for cp315t. + python-version: ["3.11", "3.12", "3.13", "3.14", "3.14t", "3.15"] steps: - name: Checkout - uses: actions/checkout@v6 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 persist-credentials: false - name: Compose conda environment file + env: + PYVER: ${{ matrix.python-version }} run: | # conda-forge ships two ABIs for CPython 3.13+ ("cp314" and "cp314t"), # and `python=3.14` alone lets the solver pick either one: it resolved @@ -34,35 +47,48 @@ jobs: # The `python-gil` and `python-freethreading` metapackages pin # `python_abi` to one or the other, so ask for the one this matrix # entry wants instead of leaving it to the solver. - pyver="${{ matrix.python-version }}" + pyver=$PYVER if [[ $pyver == *t ]]; then variant=python-freethreading pyver=${pyver%t} else variant=python-gil fi - cp continuous_integration/environment.yml environment-ci.yml + channels=conda-forge,nodefaults + if [[ $pyver == 3.15 ]]; then + # TODO: drop this branch once Python 3.15.0 final is on conda-forge. + # Until then the 3.15 release candidates need `_python_rc`, which only + # the `python_rc` label provides. The label must rank *below* + # conda-forge: it also holds older `python` rc builds (but no 3.15), and + # strict channel priority would then hide conda-forge's 3.15 rc. + channels=conda-forge,conda-forge/label/python_rc,nodefaults + awk '{ print } /^ - conda-forge$/ { print " - conda-forge/label/python_rc" }' \ + continuous_integration/environment.yml > environment-ci.yml + else + cp continuous_integration/environment.yml environment-ci.yml + fi + echo "CONDA_CHANNELS=$channels" >> "$GITHUB_ENV" echo " - python=$pyver" >> environment-ci.yml echo " - $variant" >> environment-ci.yml cat environment-ci.yml - name: Conda - uses: conda-incubator/setup-miniconda@v3 + uses: conda-incubator/setup-miniconda@be893c923ea9cf1cf7cd510fbdde27c7e18cbdcb # v4.1.0 with: auto-update-conda: true environment-file: environment-ci.yml - channels: conda-forge,nodefaults + channels: ${{ env.CONDA_CHANNELS }} channel-priority: strict activate-environment: suitesparse-graphblas auto-activate-base: false - name: GraphBLAS (from conda-forge) if: (contains(matrix.source, 'conda-forge')) run: | - conda install graphblas=$(cat GB_VERSION.txt) + conda install "graphblas=$(cat GB_VERSION.txt)" - name: GraphBLAS (from source) if: (contains(matrix.source, 'source')) run: | # From release (also works with beta versions) - GRAPHBLAS_PREFIX=${CONDA_PREFIX} bash suitesparse.sh refs/tags/$(cat GB_VERSION.txt).0 + GRAPHBLAS_PREFIX="${CONDA_PREFIX}" bash suitesparse.sh "refs/tags/$(cat GB_VERSION.txt).0" # From tag # curl -L https://github.com/DrTimothyAldenDavis/GraphBLAS/archive/refs/tags/v$(cat GB_VERSION.txt).tar.gz | tar xzf - @@ -84,18 +110,18 @@ jobs: - name: Configure coverage run: | # Cython's coverage plugin (see [tool.coverage.run] in pyproject.toml) - # needs coverage's C tracer. conda-forge builds coverage without its C - # extension for free-threaded Python, and conda resolves `python=3.14` - # to the free-threaded build (3.14t) on some platforms. There, loading - # the plugin raises ImportError and every `coverage run` dies before it - # runs anything, so run the tests directly instead. + # needs coverage's C tracer. Where conda-forge has no compiled build of + # coverage for a Python (3.15, for now), it installs a pure-Python build + # that lacks the tracer. There, loading the plugin raises ImportError and + # every `coverage run` dies before it runs anything, so run the tests + # directly instead. if python -c "import Cython.Coverage" 2>/dev/null; then coverage erase - echo "COV=coverage run -a --branch" >> $GITHUB_ENV + echo "COV=coverage run -a --branch" >> "$GITHUB_ENV" else echo "Cython coverage plugin unusable here; running without coverage" python -VV - echo "COV=python" >> $GITHUB_ENV + echo "COV=python" >> "$GITHUB_ENV" fi - name: Test env: diff --git a/.github/workflows/update_graphblas.yml b/.github/workflows/update_graphblas.yml index 532072f..f5c0fb6 100644 --- a/.github/workflows/update_graphblas.yml +++ b/.github/workflows/update_graphblas.yml @@ -1,12 +1,7 @@ # Checks for latest SuiteSparse:GraphBLAS version on GitHub and creates a PR to update the version used by this repo. name: Check for GraphBLAS updates -# In addition to permissions below, must explicitly allow GitHub Actions to create pull requests. -# This setting can be found in a repository's settings under Actions > General > Workflow permissions. -# https://github.com/peter-evans/create-pull-request#workflow-permissions -permissions: - contents: write - pull-requests: write +permissions: {} on: # Note: Workflow must run at least once to appear in workflows list. @@ -26,24 +21,30 @@ jobs: name: Check for GraphBLAS update if: github.repository == 'GraphBLAS/python-suitesparse-graphblas' || github.repository == 'alugowski/python-suitesparse-graphblas' runs-on: ubuntu-latest + # In addition to these permissions, must explicitly allow GitHub Actions to create pull requests. + # This setting can be found in a repository's settings under Actions > General > Workflow permissions. + # https://github.com/peter-evans/create-pull-request#workflow-permissions + permissions: + contents: write + pull-requests: write steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 persist-credentials: false - - uses: actions/setup-python@v6 + - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: "3.11" - name: Get latest GraphBLAS version run: | python latest_suitesparse_graphblas_version.py > GB_VERSION.txt - echo "GB_VERSION=$(cat GB_VERSION.txt)" >> $GITHUB_ENV + echo "GB_VERSION=$(cat GB_VERSION.txt)" >> "$GITHUB_ENV" shell: bash - name: Create Pull Request - uses: peter-evans/create-pull-request@v8 + uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 with: # See documentation: https://github.com/peter-evans/create-pull-request # Action behavior: https://github.com/peter-evans/create-pull-request#action-behaviour diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index a35412b..07caebe 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -21,20 +21,21 @@ on: pull_request: +# Cancel superseded runs of a PR only. Keying on `github.ref` would also let a +# push to main cancel a running release or manual (workflow_dispatch) upload. concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} cancel-in-progress: true permissions: - # For PyPI Trusted Publisher - id-token: write + contents: read jobs: build_sdist: name: Build SDist runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 persist-credentials: false @@ -45,7 +46,7 @@ jobs: - name: Check metadata run: pipx run twine check dist/* - - uses: actions/upload-artifact@v7 + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: sdist path: dist/*.tar.gz @@ -94,7 +95,7 @@ jobs: cibw_archs: "arm64" steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 persist-credentials: false @@ -103,20 +104,20 @@ jobs: if: github.event_name == 'push' || github.event_name == 'pull_request' # Ask suitesparse.sh to compile in the fastest way possible and provide a GB version to build run: | - echo "SUITESPARSE_FASTEST_BUILD=1" >> $GITHUB_ENV + echo "SUITESPARSE_FASTEST_BUILD=1" >> "$GITHUB_ENV" shell: bash - name: Setup GraphBLAS version from GB_VERSION.txt # Use GraphBLAS version specified in GB_VERSION.txt unless specified in a git tag (next workflow step). # Git tag method required for uploads to PyPI. if: github.event_name != 'release' && github.event.inputs.upload_dest != 'PyPI' - run: echo "GB_VERSION_REF=refs/tags/$(cat GB_VERSION.txt).0" >> $GITHUB_ENV + run: echo "GB_VERSION_REF=refs/tags/$(cat GB_VERSION.txt).0" >> "$GITHUB_ENV" shell: bash - name: Setup GraphBLAS version from git tag if: ${{ startsWith(github.ref, 'refs/tags/') }} # If this is a tagged ref, like a release, then use the tag for the graphblas version - run: echo "GB_VERSION_REF=${{ github.ref }}" >> $GITHUB_ENV + run: echo "GB_VERSION_REF=$GITHUB_REF" >> "$GITHUB_ENV" shell: bash - name: Install tools (macOS) @@ -129,21 +130,19 @@ jobs: run: | brew fetch --retry coreutils && brew install coreutils brew fetch --retry libomp && brew reinstall libomp - echo MACOSX_DEPLOYMENT_TARGET=$(otool -l $(brew --prefix libomp)/lib/libomp.dylib | grep minos | awk '{print $2}') >> $GITHUB_ENV + echo "MACOSX_DEPLOYMENT_TARGET=$(otool -l "$(brew --prefix libomp)/lib/libomp.dylib" | grep minos | awk '{print $2}')" >> "$GITHUB_ENV" - - uses: pypa/cibuildwheel@v3.4 + - uses: pypa/cibuildwheel@e090b81e30c4d855ea63bf4b6e59204c09a101ae # v4.2.1 with: output-dir: wheelhouse env: # very verbose CIBW_BUILD_VERBOSITY: 3 - # cibuildwheel v3: PyPy no longer built by default; enable explicitly. - # Free-threaded wheels: cibuildwheel only gates cp313t behind - # "cpython-freethreading" (see its selector.py), so cp314t is already - # built and tested here by default. cp313t stays off because cffi - # publishes no cp313t wheels, so enabling it would build cffi from - # source in every wheel job. + # PyPy is not built by default (since cibuildwheel v3); enable explicitly. + # Free-threaded wheels (cp314t, cp315t) are built and tested by default. + # cibuildwheel v4 dropped cp313t (and its "cpython-freethreading" + # enable option) entirely. CIBW_ENABLE: "pypy" # Build SuiteSparse @@ -171,60 +170,67 @@ jobs: # Use delvewheel on Windows. # This copies graphblas.dll into the wheel. "repair" in cibuildwheel parlance includes copying any shared # libraries from the build host into the wheel to make the wheel self-contained. - # Cibuildwheel includes tools for this for Linux and macOS, and they recommend delvewheel for Windows. - # Note: Currently using a workaround: --no-mangle instead of stripping graphblas.dll + # cibuildwheel v4 installs delvewheel and uses it by default; this overrides its command so it can + # find graphblas.dll and to apply a workaround: --no-mangle instead of stripping graphblas.dll # see https://github.com/adang1345/delvewheel/issues/33 - CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel" CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair --add-path \"C:\\GraphBLAS\\bin\" --no-mangle \"libgomp-1.dll;libgcc_s_seh-1.dll\" -w {dest_dir} {wheel}" # make cibuildwheel install test dependencies from pyproject.toml CIBW_TEST_EXTRAS: "test" - # run tests - CIBW_TEST_COMMAND: "pytest --pyargs suitesparse_graphblas -s -k test_print_jit_config && pytest -v --pyargs suitesparse_graphblas" + # run tests. They run from a temporary directory, so pyproject.toml's pytest + # config doesn't apply; -W error restores its `filterwarnings = ["error"]`. + CIBW_TEST_COMMAND: "pytest --pyargs suitesparse_graphblas -s -k test_print_jit_config && pytest -v -W error --pyargs suitesparse_graphblas" - CIBW_TEST_SKIP: ${{ matrix.cibw_test_skip }} - - - uses: actions/upload-artifact@v7 + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: wheels-${{ matrix.os }}-${{ matrix.cibw_archs }}${{ matrix.arch_note}} path: wheelhouse/*.whl if-no-files-found: error - upload_all: + # Uploads use PyPI Trusted Publishing (no API token). Each index trusts this workflow + # (wheels.yml) only when it runs in the GitHub environment registered with it. + upload_pypi: name: Upload to PyPI needs: [build_wheels, build_sdist] runs-on: ubuntu-latest - # only upload releases to PyPI - if: github.repository == 'GraphBLAS/python-suitesparse-graphblas' && ((github.event_name == 'release' && github.event.action == 'published') || (github.event_name == 'workflow_dispatch' && github.event.inputs.upload_dest != 'No Upload')) - + # only upload releases (or an explicit manual request) to PyPI + if: github.repository == 'GraphBLAS/python-suitesparse-graphblas' && ((github.event_name == 'release' && github.event.action == 'published') || (github.event_name == 'workflow_dispatch' && github.event.inputs.upload_dest == 'PyPI')) + environment: + name: pypi + url: https://pypi.org/p/suitesparse-graphblas + permissions: + id-token: write # for Trusted Publishing (and its attestations) steps: - - uses: actions/setup-python@v6 - with: - python-version: "3.x" - - - uses: actions/download-artifact@v8 + - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: path: dist merge-multiple: true - # Upload to PyPI - - uses: pypa/gh-action-pypi-publish@v1.13.0 - name: Upload to PyPI - if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.upload_dest == 'PyPI') + - uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2 with: # PyPI does not allow replacing a file. Without this flag the entire action fails if even a single duplicate exists. skip-existing: true - verbose: true - password: ${{ secrets.PYPI_TOKEN }} - # Upload to Test PyPI - - uses: pypa/gh-action-pypi-publish@v1.13.0 - name: Upload to Test PyPI - if: github.event_name == 'workflow_dispatch' && github.event.inputs.upload_dest == 'Test PyPI' + upload_test_pypi: + name: Upload to Test PyPI + needs: [build_wheels, build_sdist] + runs-on: ubuntu-latest + if: github.repository == 'GraphBLAS/python-suitesparse-graphblas' && github.event_name == 'workflow_dispatch' && github.event.inputs.upload_dest == 'Test PyPI' + environment: + name: test-pypi + url: https://test.pypi.org/p/suitesparse-graphblas + permissions: + id-token: write # for Trusted Publishing (and its attestations) + steps: + - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: + path: dist + merge-multiple: true + + - uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2 + with: + repository-url: https://test.pypi.org/legacy/ # PyPI does not allow replacing a file. Without this flag the entire action fails if even a single duplicate exists. skip-existing: true - verbose: true - repository-url: https://test.pypi.org/legacy/ diff --git a/.gitignore b/.gitignore index d079cfe..7d098cf 100644 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,10 @@ wheelhouse # Wheel building stuff GraphBLAS-*/ +# Left behind by create_headers.py +suitesparse_graphblas/GraphBLAS-orig.h +suitesparse_graphblas/GraphBLAS-processed.h + # PyInstaller # Usually these files are written by a python script from a template # before PyInstaller builds the exe, so as to inject date/other infos into it. diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 292c81c..2b3decc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -41,7 +41,7 @@ repos: - id: autoflake args: [--in-place] - repo: https://github.com/pycqa/isort - rev: 9.0.1 + rev: 9.0.2 hooks: - id: isort - repo: https://github.com/asottile/pyupgrade @@ -54,15 +54,15 @@ repos: hooks: - id: black - repo: https://github.com/PyCQA/flake8 - rev: 7.3.0 + rev: 7.4.1 hooks: - id: flake8 args: ["--config=.flake8"] additional_dependencies: &flake8_dependencies # These versions need updated manually - - flake8==7.3.0 + - flake8==7.4.1 - flake8-comprehensions==3.17.0 - - flake8-bugbear==25.11.29 + - flake8-bugbear==26.9.30 # - flake8-simplify==0.22.0 - repo: https://github.com/asottile/yesqa rev: v1.5.0 @@ -88,11 +88,24 @@ repos: - id: python-no-eval - id: python-no-log-warn - id: text-unicode-replacement-char + - repo: https://github.com/rhysd/actionlint + rev: v1.7.12 + hooks: + - id: actionlint + - repo: https://github.com/zizmorcore/zizmor-pre-commit + rev: v1.30.1 + hooks: + - id: zizmor - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.38.0 + rev: 0.38.2 hooks: - id: check-dependabot - id: check-github-workflows + - repo: https://github.com/pysentry/pysentry-pre-commit + rev: v0.5.0 + hooks: + - id: pysentry + args: ["--format=human", "--fail-on=low", "--sources=pypa,osv,pypi"] - repo: meta hooks: - id: check-hooks-apply diff --git a/CLAUDE.md b/AGENTS.md similarity index 60% rename from CLAUDE.md rename to AGENTS.md index ef34ae4..1e93373 100644 --- a/CLAUDE.md +++ b/AGENTS.md @@ -1,16 +1,17 @@ -# CLAUDE.md +# AGENTS.md -This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. +This file provides guidance to AI coding agents (e.g., Claude Code) when working with code in this repository. ## What this package is `suitesparse-graphblas` is a low-level Python CFFI binding around the C library [SuiteSparse:GraphBLAS](https://github.com/DrTimothyAldenDavis/GraphBLAS). It exposes the -raw `ffi` and `lib` symbols and, on top of them, a small **functional API** in -`suitesparse_graphblas.matrix`, `suitesparse_graphblas.vector`, and -`suitesparse_graphblas.scalar`. These three modules are the **main entry point for users -of this library directly** — they are module-level functions operating on opaque CFFI -handles, e.g. `A = matrix.new(lib.GrB_BOOL, 3, 3); matrix.set_bool(A, True, 2, 2)`. Higher-level +raw `ffi` and `lib` symbols and, on top of them, a **functional API** in the +`suitesparse_graphblas.api` package (`matrix`, `vector`, `scalar`, plus `binaryop`, `monoid`, +`semiring`, `descriptor`, `iterator`, …). `matrix`, `vector`, and `scalar` (also re-exported as +`suitesparse_graphblas.matrix` etc. for backward compatibility) are the **main entry point for +users of this library directly** — they are module-level functions operating on opaque CFFI +handles, e.g. `A = matrix.matrix_new(lib.GrB_BOOL, 3, 3); matrix.set_bool(A, True, 2, 2)`. Higher-level syntax wrappers ([python-graphblas](https://github.com/python-graphblas/python-graphblas) and [pygraphblas](https://github.com/Graphegon/pygraphblas)) build on top of this same package for users who want a more Pythonic, OO-style interface. @@ -131,25 +132,62 @@ The package re-exports `ffi`/`lib` from the compiled extension and adds only thi - `libget(name)` — fallback that retries a `GrB_*` lookup as `GxB_*` when SuiteSparse moves a symbol between standard and extension namespaces. - `burble` — context manager / global toggle for `GxB_BURBLE` diagnostic output. -- `matrix.py`, `vector.py`, `scalar.py` — **the functional API** of the package, and the - primary user-facing surface for code that uses `suitesparse-graphblas` directly. Each - module follows the same convention: `.new(...)` returns an `ffi.gc`-managed +- `api/matrix.py`, `api/vector.py`, `api/scalar.py` (and the other `api/` modules) — + **the functional API** of the package, and the primary user-facing surface for code that + uses `suitesparse-graphblas` directly. `__init__.py` re-exports `matrix`, `vector`, + `scalar`, and `iterator` at the bottom of the file (to avoid a circular import) so + `suitesparse_graphblas.matrix` keeps working. Each module follows the same convention: + `._new(...)` (e.g. `matrix.matrix_new`) returns an `ffi.gc`-managed cdata handle (`GrB_Matrix*`, `GrB_Vector*`, or `GxB_Scalar*`) and every other function takes that handle as its first argument and routes errors through `check_status`. The design is deliberately functional rather than class-based so the same handles can be passed through higher-level wrappers without object-identity friction. When adding features to this package, this is the layer where new user-facing helpers belong. -- `io/serialize.py`, `io/binary.py` — supporting I/O helpers (compressed serialize / - deserialize, binary format read/write). `matrix.py` and `vector.py` already re-export - `serialize` / `deserialize` from `io/serialize.py` so callers can reach them as - `matrix.serialize(A)` etc. +- `api/io/serialize.py`, `api/io/binary.py` — supporting I/O helpers (compressed serialize / + deserialize, binary format read/write), also importable as `suitesparse_graphblas.io`. + `api/matrix.py` and `api/vector.py` already re-export `serialize` / `deserialize` from + `api/io/serialize.py` so callers can reach them as `matrix.serialize(A)` etc. ### 4. `utils.pyx` and free-threading -The Cython module exists primarily to (a) call `GxB_init` with NumPy's allocators by -casting the cffi function pointer through `uintptr_t` into a real C function pointer, and -(b) wrap NumPy buffers around GraphBLAS-allocated memory with `claim_buffer` / -`unclaim_buffer`, transferring ownership of the underlying allocation to NumPy. +The Cython module exists to (a) call `GxB_init` with NumPy's allocators by casting the cffi +function pointer through `uintptr_t` into a real C function pointer, and (b) move buffers +between GraphBLAS and NumPy without copying. Its module docstring is the reference for (b). + +Memory that changes owner must be freed by the allocator that allocated it. GraphBLAS frees +with the allocator of the buffer's *arena* (arena 0 is NumPy's `PyDataMem_*` allocator for +`memory_manager="numpy"`, libc's for `"c"`; `GxB_arena_init` adds more). NumPy frees with +the array's memory handler (NEP 49), or with libc `free` if it has none. Don't assume any +two of these agree: with NumPy ≥ 2.5, NumPy's allocator is `PyMem_RawMalloc`, which is +mimalloc on free-threaded Python ≥ 3.15 and gains debug hooks under `python -X dev`. So, +per arena, `utils.pyx` asks GraphBLAS for the arena's functions and uses NumPy's default +handler if they are NumPy's, else its own handler that calls them +(`suitesparse_graphblas_arena`): + +- GraphBLAS → NumPy: `claim_buffer` / `claim_buffer_2d` attach that handler. +- NumPy → GraphBLAS: use `give_buffer` (a context manager) around the GraphBLAS call that + takes ownership (`GxB_*_pack_*`, `GxB_*_load` with `GrB_DEFAULT + arena`, ...). It hands + over the array itself only if `can_unclaim_buffer` (owns its data, writeable, and its + handler is the arena's), otherwise a copy in `empty(...)` memory, and it commits only if + GraphBLAS set the pointer to NULL. Never hand GraphBLAS libc `malloc` memory or arrays of + unknown provenance; `api/io/binary.py::binread` shows the pattern. +- `arena` defaults to the *global* data arena. GraphBLAS itself uses the data arena of the + Context engaged on the calling thread, which can't be queried, so code that must be right + under any Context names the arena: `serialize_*` call `GxB_*_serialize_arena`, and + `binread` uses the data arena of the matrix it just created. `GxB_*_unpack_*` and + `GxB_*_export_*` move the object to that arena before handing out its arrays, so the arena + an object was made in says nothing about them. + +`tests/test_memory.py` checks all of this (both managers, a libc arena as an explicit, +global, and Context arena, threads, `binread`) in a subprocess under `PYTHONMALLOC=debug`, +which turns a mismatch into an abort on any Python. Its buffers are over 1024 bytes on +purpose: NumPy caches smaller freed blocks, which hides a wrong free. `conftest.py` also +makes NumPy warn, failing the test, whenever it frees an array that owns its data but has +no memory handler; that catches a missing handler even where the allocators happen to agree. + +When claiming a buffer from `GxB_*_unload`, use the arena in the returned `handling` +(`handling - GrB_DEFAULT`), and never claim one with `handling >= GxB_IS_READONLY`: whoever +loaded it read-only still owns it. The file is marked `freethreading_compatible=True`. The package does nothing special for free-threading itself — correctness depends on SuiteSparse:GraphBLAS being thread-safe, @@ -160,7 +198,14 @@ which it is required to be. - Black, isort, flake8 (config in `.flake8`, line length 100, double quotes), pyupgrade (`--py311-plus`), autoflake, shellcheck — all wired through `pre-commit`. Run `pre-commit run --all-files` before pushing. +- `pre-commit` also lints GitHub Actions workflows (actionlint, zizmor) and scans + dependencies for known vulnerabilities (pysentry). actionlint runs shellcheck on `run:` + scripts only when `shellcheck` is on `PATH` — it is on the CI runner, so quote `$(...)` + and `"$GITHUB_ENV"` even if it passes locally. Don't expand `${{ ... }}` contexts inside + `run:` scripts (zizmor's template-injection audit); pass them through `env:` instead. - `pre-commit` also blocks direct commits to `main`. +- pytest is strict (see `[tool.pytest.ini_options]`): warnings are errors, markers must be + registered, and xfails must fail. - Python ≥ 3.11. NumPy ≥ 2.0 is required at build time (CFFI extension), ≥ 1.24 at runtime. - Generated headers (`suitesparse_graphblas.h`, `suitesparse_graphblas_no_complex.h`, `source.c`) are checked in and **must be regenerated via `create_headers.py`** rather diff --git a/pyproject.toml b/pyproject.toml index 15dee86..81a34e6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,6 +56,7 @@ classifiers = [ "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.14", + "Programming Language :: Python :: 3.15", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: Free Threading :: 2 - Beta", "Intended Audience :: Developers", @@ -100,7 +101,7 @@ dirty_template = "{tag}+{ccount}.g{sha}.dirty" [tool.black] line-length = 100 -target-version = ["py311", "py312", "py313", "py314"] +target-version = ["py311", "py312", "py313", "py314", "py315"] [tool.isort] sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"] @@ -132,7 +133,16 @@ exclude_lines = [ [tool.pytest.ini_options] testpaths = ["suitesparse_graphblas"] -addopts = "--doctest-modules" +addopts = [ + "--doctest-modules", + "--strict-config", # Error on unknown or misspelled config options + "--strict-markers", # Error on unregistered markers + "-ra", # Summarize all non-passing tests (skips, xfails, ...) at the end +] +xfail_strict = true +# Turn warnings into errors. On free-threaded builds this also catches +# "The global interpreter lock (GIL) has been enabled to load module ...". +filterwarnings = ["error"] # NOTE: When running in Docker, use -w /tmp and --pyargs to avoid the source # directory shadowing the installed package (compiled extensions aren't in the -# source tree). See CLAUDE.md for the full Docker test commands. +# source tree). See AGENTS.md for the full Docker test commands. diff --git a/setup.py b/setup.py index 860cd3a..c554dd9 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,12 @@ except ImportError: use_cython = False -define_macros = [("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")] +define_macros = [ + ("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION"), + # utils.pyx needs `PyArrayObject_fields.mem_handler`, added in NumPy 1.22. The NumPy + # version targeted by default depends on the NumPy being built against (1.19 for 2.0). + ("NPY_TARGET_VERSION", "NPY_1_22_API_VERSION"), +] # /d2FH4- flag needed only for early Python 3.8 builds on Windows. # See https://cibuildwheel.readthedocs.io/en/stable/faq/ diff --git a/suitesparse_graphblas/__init__.py b/suitesparse_graphblas/__init__.py index 7d08d23..48eac6c 100644 --- a/suitesparse_graphblas/__init__.py +++ b/suitesparse_graphblas/__init__.py @@ -83,10 +83,12 @@ def initialize(*, blocking=False, memory_manager="numpy"): Whether to call init with GrB_BLOCKING or GrB_NONBLOCKING. Default is False. memory_manager : {'numpy', 'c'}, optional - Choose which malloc/free functions to use. 'numpy' uses numpy's - allocators, which makes it safe to perform zero-copy to and from numpy, - and allows Python to track memory usage via tracemalloc (if enabled). - 'c' uses the default allocators. Default is 'numpy'. + Choose which malloc/free functions GraphBLAS uses. 'numpy' uses NumPy's + allocator, so arrays NumPy allocated can be handed to GraphBLAS without + copying, and Python can track memory usage via tracemalloc (if enabled). + 'c' uses the C library's. Either way, `suitesparse_graphblas.utils` moves + buffers between GraphBLAS and NumPy safely, copying when it must. + Default is 'numpy'. The global variable `suitesparse_graphblas.is_initialized` indicates whether GraphBLAS has been initialized. @@ -96,11 +98,15 @@ def initialize(*, blocking=False, memory_manager="numpy"): blocking = lib.GrB_BLOCKING if blocking else lib.GrB_NONBLOCKING memory_manager = memory_manager.lower() if memory_manager == "numpy": - utils.call_gxb_init(ffi, lib, blocking) + info = utils.call_gxb_init(ffi, lib, blocking) elif memory_manager == "c": - lib.GrB_init(blocking) + info = lib.GrB_init(blocking) else: raise ValueError(f'memory_manager argument must be "numpy" or "c"; got: {memory_manager!r}') + if info != lib.GrB_SUCCESS: + raise _error_code_lookup.get(info, RuntimeError)( + f"Failed to initialize GraphBLAS (info={info})" + ) # See: https://github.com/GraphBLAS/python-suitesparse-graphblas/issues/40 for attr in dir(lib): getattr(lib, attr) diff --git a/suitesparse_graphblas/api/io/binary.py b/suitesparse_graphblas/api/io/binary.py index 4124061..974ecf0 100644 --- a/suitesparse_graphblas/api/io/binary.py +++ b/suitesparse_graphblas/api/io/binary.py @@ -1,35 +1,11 @@ -import sys -from ctypes.util import find_library +from contextlib import ExitStack from pathlib import Path -from cffi import FFI +import numpy as np from suitesparse_graphblas import __version__, check_status, ffi, lib from suitesparse_graphblas.api import matrix - -stdffi = FFI() -stdffi.cdef(""" -void *malloc(size_t size); -""") -if sys.platform == "win32": - stdlib = stdffi.dlopen("ucrtbase") -else: - stdlib = stdffi.dlopen(find_library("c")) - -# When "packing" a matrix the owner of the memory buffer is transfered -# to SuiteSparse, which then becomes responsible for freeing it. cffi -# wisely does not allow you to do this without declaring and calling -# malloc directly. When SuiteSparse moves over to a more formal -# memory manager with the cuda work, this will likely change and have -# to be replaceable with a allocator common to numpy, cuda, and here. -# Maybe PyDataMem_NEW? - - -def readinto_new_buffer(f, typ, size, allocator=stdlib.malloc): - buff = ffi.cast(typ, allocator(size)) - f.readinto(ffi.buffer(buff, size)) - return buff - +from suitesparse_graphblas.utils import empty, give_buffer GRB_HEADER_LEN = 512 NULL = ffi.NULL @@ -90,6 +66,12 @@ def readinto_new_buffer(f, typ, size, allocator=stdlib.malloc): def binwrite(A, filename, comments=None, opener=Path.open): + """Write Matrix ``A`` to ``filename`` in SuiteSparse:GraphBLAS's binary format. + + ``opener`` opens the file for writing (e.g. ``gzip.open`` to compress it). To avoid a + copy, ``A`` is unpacked while it is written and packed again afterwards (even if writing + fails), so other threads must not use ``A`` meanwhile. + """ if isinstance(filename, str): filename = Path(filename) @@ -261,198 +243,45 @@ def binwrite(A, filename, comments=None, opener=Path.open): header_content = header_template.format(**vars) header = f"{header_content: <{GRB_HEADER_LEN}}".encode("ascii") - with opener(filename, "wb") as f: - fwrite = f.write - fwrite(header) - fwrite(buff(impl, sizeof("uint64_t"))) - fwrite(buff(format, sizeof("GxB_Format_Value"))) - fwrite(buff(sparsity_status, sizeof("int32_t"))) - fwrite(buff(sparsity_control, sizeof("int32_t"))) - fwrite(buff(hyper_switch, sizeof("double"))) - fwrite(buff(bitmap_switch, sizeof("double"))) - fwrite(buff(nrows, Isize)) - fwrite(buff(ncols, Isize)) - fwrite(buff(nvec, Isize)) - fwrite(buff(nvals, Isize)) - fwrite(buff(typecode, sizeof("int32_t"))) - fwrite(buff(typesize, sizeof("size_t"))) - fwrite(buff(is_iso, sizeof("bool"))) - - Tsize = typesize[0] - iso = is_iso[0] - - if is_hyper: - fwrite(buff(Ap[0], (nvec[0] + 1) * Isize)) - fwrite(buff(Ah[0], nvec[0] * Isize)) - fwrite(buff(Ai[0], nvals[0] * Isize)) - Axsize = Tsize if iso else nvals[0] * Tsize - elif is_sparse: - fwrite(buff(Ap[0], (nvec[0] + 1) * Isize)) - fwrite(buff(Ai[0], nvals[0] * Isize)) - Axsize = Tsize if iso else nvals[0] * Tsize - elif is_bitmap: - fwrite(buff(Ab[0], nrows[0] * ncols[0] * ffi.sizeof("int8_t"))) - Axsize = Tsize if iso else nrows[0] * ncols[0] * Tsize - else: - Axsize = Tsize if iso else nrows[0] * ncols[0] * Tsize - - fwrite(buff(Ax[0], Axsize)) - - if by_col and is_hyper: - check_status( - A, - lib.GxB_Matrix_pack_HyperCSC( - A[0], - Ap, - Ah, - Ai, - Ax, - Ap_size[0], - Ah_size[0], - Ai_size[0], - Ax_size[0], - is_iso[0], - nvec[0], - is_jumbled[0], - NULL, - ), - ) - - elif by_row and is_hyper: - check_status( - A, - lib.GxB_Matrix_pack_HyperCSR( - A[0], - Ap, - Ah, - Ai, - Ax, - Ap_size[0], - Ah_size[0], - Ai_size[0], - Ax_size[0], - is_iso[0], - nvec[0], - is_jumbled[0], - NULL, - ), - ) - - elif by_col and is_sparse: - check_status( - A, - lib.GxB_Matrix_pack_CSC( - A[0], Ap, Ai, Ax, Ap_size[0], Ai_size[0], Ax_size[0], is_iso[0], is_jumbled[0], NULL - ), - ) - - elif by_row and is_sparse: - check_status( - A, - lib.GxB_Matrix_pack_CSR( - A[0], Ap, Ai, Ax, Ap_size[0], Ai_size[0], Ax_size[0], is_iso[0], is_jumbled[0], NULL - ), - ) - - elif by_col and is_bitmap: - check_status( - A, - lib.GxB_Matrix_pack_BitmapC( - A[0], Ab, Ax, Ab_size[0], Ax_size[0], is_iso[0], nvals[0], NULL - ), - ) - - elif by_row and is_bitmap: - check_status( - A, - lib.GxB_Matrix_pack_BitmapR( - A[0], Ab, Ax, Ab_size[0], Ax_size[0], is_iso[0], nvals[0], NULL - ), - ) - - elif by_col and is_full: - check_status(A, lib.GxB_Matrix_pack_FullC(A[0], Ax, Ax_size[0], is_iso[0], NULL)) - - elif by_row and is_full: - check_status(A, lib.GxB_Matrix_pack_FullR(A[0], Ax, Ax_size[0], is_iso[0], NULL)) - else: - raise TypeError("This should hever happen") - - -def binread(filename, opener=Path.open): - if isinstance(filename, str): - filename = Path(filename) - - with opener(filename, "rb") as f: - fread = f.read - - fread(GRB_HEADER_LEN) - impl = frombuff("uint64_t*", fread(sizeof("uint64_t"))) - - assert impl[0] == lib.GxB_IMPLEMENTATION - - format = frombuff("GxB_Format_Value*", fread(sizeof("GxB_Format_Value"))) - sparsity_status = frombuff("int32_t*", fread(sizeof("int32_t"))) - sparsity_control = frombuff("int32_t*", fread(sizeof("int32_t"))) - hyper_switch = frombuff("double*", fread(sizeof("double"))) - bitmap_switch = frombuff("double*", fread(sizeof("double"))) - nrows = frombuff("GrB_Index*", fread(Isize)) - ncols = frombuff("GrB_Index*", fread(Isize)) - nvec = frombuff("GrB_Index*", fread(Isize)) - nvals = frombuff("GrB_Index*", fread(Isize)) - typecode = frombuff("int32_t*", fread(sizeof("int32_t"))) - typesize = frombuff("size_t*", fread(sizeof("size_t"))) - is_iso = frombuff("bool*", fread(sizeof("bool"))) - is_jumbled = ffi.new("bool*", 0) - - by_row = format[0] == lib.GxB_BY_ROW - by_col = format[0] == lib.GxB_BY_COL - - is_hyper = sparsity_status[0] == lib.GxB_HYPERSPARSE - is_sparse = sparsity_status[0] == lib.GxB_SPARSE - is_bitmap = sparsity_status[0] == lib.GxB_BITMAP - is_full = sparsity_status[0] == lib.GxB_FULL - - atype = _ss_codetypes[typecode[0]] - - Ap = ffinew("GrB_Index**") - Ai = ffinew("GrB_Index**") - Ah = ffinew("GrB_Index**") - Ax = ffinew("void**") - Ab = ffinew("int8_t**") - - Ap_size = ffinew("GrB_Index*") - Ai_size = ffinew("GrB_Index*") - Ah_size = ffinew("GrB_Index*") - Ax_size = ffinew("GrB_Index*") - Ab_size = ffinew("GrB_Index*") - - if is_hyper: - Ap_size[0] = (nvec[0] + 1) * Isize - Ah_size[0] = nvec[0] * Isize - Ai_size[0] = nvals[0] * Isize - Ax_size[0] = nvals[0] * typesize[0] - - Ap[0] = readinto_new_buffer(f, "GrB_Index*", Ap_size[0]) - Ah[0] = readinto_new_buffer(f, "GrB_Index*", Ah_size[0]) - Ai[0] = readinto_new_buffer(f, "GrB_Index*", Ai_size[0]) - elif is_sparse: - Ap_size[0] = (nvec[0] + 1) * Isize - Ai_size[0] = nvals[0] * Isize - Ax_size[0] = nvals[0] * typesize[0] - Ap[0] = readinto_new_buffer(f, "GrB_Index*", Ap_size[0]) - Ai[0] = readinto_new_buffer(f, "GrB_Index*", Ai_size[0]) - elif is_bitmap: - Ab_size[0] = nrows[0] * ncols[0] * ffi.sizeof("int8_t") - Ax_size[0] = nrows[0] * ncols[0] * typesize[0] - Ab[0] = readinto_new_buffer(f, "int8_t*", Ab_size[0]) - elif is_full: - Ax_size[0] = nrows[0] * ncols[0] * typesize[0] - - Ax[0] = readinto_new_buffer(f, "uint8_t*", typesize[0] if is_iso[0] else Ax_size[0]) - - A = matrix.matrix_new(atype, nrows[0], ncols[0]) - + try: + with opener(filename, "wb") as f: + fwrite = f.write + fwrite(header) + fwrite(buff(impl, sizeof("uint64_t"))) + fwrite(buff(format, sizeof("GxB_Format_Value"))) + fwrite(buff(sparsity_status, sizeof("int32_t"))) + fwrite(buff(sparsity_control, sizeof("int32_t"))) + fwrite(buff(hyper_switch, sizeof("double"))) + fwrite(buff(bitmap_switch, sizeof("double"))) + fwrite(buff(nrows, Isize)) + fwrite(buff(ncols, Isize)) + fwrite(buff(nvec, Isize)) + fwrite(buff(nvals, Isize)) + fwrite(buff(typecode, sizeof("int32_t"))) + fwrite(buff(typesize, sizeof("size_t"))) + fwrite(buff(is_iso, sizeof("bool"))) + + Tsize = typesize[0] + iso = is_iso[0] + + if is_hyper: + fwrite(buff(Ap[0], (nvec[0] + 1) * Isize)) + fwrite(buff(Ah[0], nvec[0] * Isize)) + fwrite(buff(Ai[0], nvals[0] * Isize)) + Axsize = Tsize if iso else nvals[0] * Tsize + elif is_sparse: + fwrite(buff(Ap[0], (nvec[0] + 1) * Isize)) + fwrite(buff(Ai[0], nvals[0] * Isize)) + Axsize = Tsize if iso else nvals[0] * Tsize + elif is_bitmap: + fwrite(buff(Ab[0], nrows[0] * ncols[0] * ffi.sizeof("int8_t"))) + Axsize = Tsize if iso else nrows[0] * ncols[0] * Tsize + else: + Axsize = Tsize if iso else nrows[0] * ncols[0] * Tsize + + fwrite(buff(Ax[0], Axsize)) + finally: + # The matrix was unpacked to write its arrays, so give them back even if that failed if by_col and is_hyper: check_status( A, @@ -549,7 +378,101 @@ def binread(filename, opener=Path.open): elif by_row and is_full: check_status(A, lib.GxB_Matrix_pack_FullR(A[0], Ax, Ax_size[0], is_iso[0], NULL)) else: - raise TypeError("Unknown format {format[0]}") + raise TypeError("This should never happen") + + +def binread(filename, opener=Path.open): + """Read a Matrix from ``filename``, written by ``binwrite``. + + ``opener`` opens the file for reading (e.g. ``gzip.open``). + """ + if isinstance(filename, str): + filename = Path(filename) + + with opener(filename, "rb") as f: + fread = f.read + + fread(GRB_HEADER_LEN) + impl = frombuff("uint64_t*", fread(sizeof("uint64_t"))) + + assert impl[0] == lib.GxB_IMPLEMENTATION + + format = frombuff("GxB_Format_Value*", fread(sizeof("GxB_Format_Value"))) + sparsity_status = frombuff("int32_t*", fread(sizeof("int32_t"))) + sparsity_control = frombuff("int32_t*", fread(sizeof("int32_t"))) + hyper_switch = frombuff("double*", fread(sizeof("double"))) + bitmap_switch = frombuff("double*", fread(sizeof("double"))) + nrows = frombuff("GrB_Index*", fread(Isize)) + ncols = frombuff("GrB_Index*", fread(Isize)) + nvec = frombuff("GrB_Index*", fread(Isize)) + nvals = frombuff("GrB_Index*", fread(Isize)) + typecode = frombuff("int32_t*", fread(sizeof("int32_t"))) + typesize = frombuff("size_t*", fread(sizeof("size_t"))) + is_iso = frombuff("bool*", fread(sizeof("bool"))) + + by_row = format[0] == lib.GxB_BY_ROW + by_col = format[0] == lib.GxB_BY_COL + + is_hyper = sparsity_status[0] == lib.GxB_HYPERSPARSE + is_sparse = sparsity_status[0] == lib.GxB_SPARSE + is_bitmap = sparsity_status[0] == lib.GxB_BITMAP + is_full = sparsity_status[0] == lib.GxB_FULL + + atype = _ss_codetypes[typecode[0]] + + if not (by_row or by_col): + raise TypeError(f"Unknown format {format[0]}") + + A = matrix.matrix_new(atype, nrows[0], ncols[0]) + # GraphBLAS will own the buffers we read into, and takes them to be from the data + # arena that new matrices use + arena = ffinew("int32_t*") + check_status(A, lib.GrB_Matrix_get_INT32(A[0], arena, lib.GxB_ARENA_DATA)) + arena = arena[0] + buffers = [] # (array, ctype), in the order the file and `GxB_Matrix_pack_*` have them + + def read(nbytes, ctype): + array = empty(nbytes, np.uint8, arena=arena) + if f.readinto(array) != nbytes: + raise EOFError(f"{filename} is truncated") + buffers.append((array, ctype)) + + if is_hyper: + pack = lib.GxB_Matrix_pack_HyperCSC if by_col else lib.GxB_Matrix_pack_HyperCSR + read((nvec[0] + 1) * Isize, "GrB_Index*") # Ap + read(nvec[0] * Isize, "GrB_Index*") # Ah + read(nvals[0] * Isize, "GrB_Index*") # Ai + nx = nvals[0] + args = [nvec[0], False] # False: not jumbled + elif is_sparse: + pack = lib.GxB_Matrix_pack_CSC if by_col else lib.GxB_Matrix_pack_CSR + read((nvec[0] + 1) * Isize, "GrB_Index*") # Ap + read(nvals[0] * Isize, "GrB_Index*") # Ai + nx = nvals[0] + args = [False] # not jumbled + elif is_bitmap: + pack = lib.GxB_Matrix_pack_BitmapC if by_col else lib.GxB_Matrix_pack_BitmapR + read(nrows[0] * ncols[0], "int8_t*") # Ab + nx = nrows[0] * ncols[0] + args = [nvals[0]] + elif is_full: + pack = lib.GxB_Matrix_pack_FullC if by_col else lib.GxB_Matrix_pack_FullR + nx = nrows[0] * ncols[0] + args = [] + else: + raise TypeError(f"Unknown sparsity status {sparsity_status[0]}") + # An iso matrix stores a single value, and GraphBLAS must be told its true size + read(typesize[0] if is_iso[0] else nx * typesize[0], "void*") # Ax + + with ExitStack() as stack: + # The buffers become GraphBLAS's only if the pack succeeds + given = [ + stack.enter_context(give_buffer(array, ctype, copy=False, arena=arena)) + for array, ctype in buffers + ] + ptrs = [ptr for ptr, _, _ in given] + sizes = [nbytes for _, nbytes, _ in given] + check_status(A, pack(A[0], *ptrs, *sizes, is_iso[0], *args, NULL)) matrix.matrix_set_sparsity_control(A, sparsity_control[0]) matrix.matrix_set_hyper_switch(A, hyper_switch[0]) diff --git a/suitesparse_graphblas/api/io/serialize.py b/suitesparse_graphblas/api/io/serialize.py index bc7c9a5..c6aefde 100644 --- a/suitesparse_graphblas/api/io/serialize.py +++ b/suitesparse_graphblas/api/io/serialize.py @@ -1,6 +1,7 @@ import numpy as np from suitesparse_graphblas import check_status, ffi, lib +from suitesparse_graphblas.api.global_options import global_get_int32 from suitesparse_graphblas.utils import claim_buffer @@ -56,10 +57,12 @@ def serialize_matrix(A, compression=lib.GxB_COMPRESSION_DEFAULT, level=None, *, desc = get_serialize_desc(compression, level, nthreads) data_ptr = ffi.new("void**") size_ptr = ffi.new("GrB_Index*") - check_status( - A, lib.GxB_Matrix_serialize(data_ptr, size_ptr, A[0], ffi.NULL if desc is None else desc) - ) - return claim_buffer(ffi, data_ptr[0], size_ptr[0], np.dtype(np.uint8)) + # Name the arena for the result, which is otherwise that of the engaged Context (if + # any), so that `claim_buffer` knows which allocator must free it + arena = global_get_int32(lib.GxB_ARENA_DATA) + desc = ffi.NULL if desc is None else desc + check_status(A, lib.GxB_Matrix_serialize_arena(data_ptr, size_ptr, A[0], arena, desc)) + return claim_buffer(ffi, data_ptr[0], size_ptr[0], np.dtype(np.uint8), arena) def serialize_vector(v, compression=lib.GxB_COMPRESSION_DEFAULT, level=None, *, nthreads=None): @@ -79,10 +82,10 @@ def serialize_vector(v, compression=lib.GxB_COMPRESSION_DEFAULT, level=None, *, desc = get_serialize_desc(compression, level, nthreads) data_ptr = ffi.new("void**") size_ptr = ffi.new("GrB_Index*") - check_status( - v, lib.GxB_Vector_serialize(data_ptr, size_ptr, v[0], ffi.NULL if desc is None else desc) - ) - return claim_buffer(ffi, data_ptr[0], size_ptr[0], np.dtype(np.uint8)) + arena = global_get_int32(lib.GxB_ARENA_DATA) # see `serialize_matrix` + desc = ffi.NULL if desc is None else desc + check_status(v, lib.GxB_Vector_serialize_arena(data_ptr, size_ptr, v[0], arena, desc)) + return claim_buffer(ffi, data_ptr[0], size_ptr[0], np.dtype(np.uint8), arena) def deserialize_matrix(data, *, free=True, nthreads=None): diff --git a/suitesparse_graphblas/conftest.py b/suitesparse_graphblas/conftest.py index b6c5ead..4e25e1d 100644 --- a/suitesparse_graphblas/conftest.py +++ b/suitesparse_graphblas/conftest.py @@ -2,7 +2,28 @@ from suitesparse_graphblas import initialize +try: + from numpy._core._multiarray_umath import _set_numpy_warn_if_no_mem_policy +except ImportError: # pragma: no cover + try: # NumPy < 2 + from numpy.core._multiarray_umath import _set_numpy_warn_if_no_mem_policy + except ImportError: # private, so it may go away + _set_numpy_warn_if_no_mem_policy = None + @pytest.fixture(scope="session", autouse=True) def intialize_suitesparse_graphblas(): initialize() + + +@pytest.fixture(scope="session", autouse=True) +def warn_if_no_memory_handler(): + # NumPy frees the data of an array that owns it but has no memory handler with libc + # `free`, which is only right by luck (see utils.pyx). Make NumPy warn when it does; + # the warning fails the test (see `filterwarnings` in pyproject.toml). + if _set_numpy_warn_if_no_mem_policy is None: # pragma: no cover + yield + return + old = _set_numpy_warn_if_no_mem_policy(True) + yield + _set_numpy_warn_if_no_mem_policy(old) diff --git a/suitesparse_graphblas/tests/test_doctest.py b/suitesparse_graphblas/tests/test_doctest.py index 8b2b456..8718558 100644 --- a/suitesparse_graphblas/tests/test_doctest.py +++ b/suitesparse_graphblas/tests/test_doctest.py @@ -1,41 +1,23 @@ -def test_run_doctests(): - import doctest +import doctest +import importlib +import pkgutil + +from suitesparse_graphblas import api, utils - from suitesparse_graphblas.api import ( - binaryop, - container, - context, - descriptor, - global_options, - grb_type, - indexbinaryop, - indexunaryop, - iterator, - matrix, - monoid, - scalar, - selectop, - semiring, - unaryop, - vector, - ) - for mod in ( - matrix, - vector, - scalar, - iterator, - context, - global_options, - grb_type, - unaryop, - binaryop, - indexunaryop, - indexbinaryop, - monoid, - semiring, - descriptor, - selectop, - container, - ): - doctest.testmod(mod, optionflags=doctest.ELLIPSIS, raise_on_error=True) +def test_run_doctests(): + # Every module of the functional API, found rather than listed so none is missed: the + # wheel builds' test command does not collect doctests, so they run only through here + attempted = 0 + names = sorted(info.name for info in pkgutil.walk_packages(api.__path__, f"{api.__name__}.")) + for name in names: + mod = importlib.import_module(name) + _, tried = doctest.testmod(mod, optionflags=doctest.ELLIPSIS, raise_on_error=True) + attempted += tried + assert attempted > 0 + + # `testmod` doesn't find these: Cython functions, or wrapped by `contextmanager` + runner = doctest.DebugRunner(optionflags=doctest.ELLIPSIS) # raises on failure + for test in doctest.DocTestFinder().find(utils.give_buffer, "give_buffer", globs={}): + runner.run(test) + assert runner.tries > 0 diff --git a/suitesparse_graphblas/tests/test_io.py b/suitesparse_graphblas/tests/test_io.py index a06afb9..2819a2c 100644 --- a/suitesparse_graphblas/tests/test_io.py +++ b/suitesparse_graphblas/tests/test_io.py @@ -198,3 +198,12 @@ def test_matrix_binfile_read_write(tmp_path): ) assert is_eq[0] + + +def test_binwrite_failure_keeps_matrix(tmp_path): + # `binwrite` unpacks the matrix to write its arrays, and must put them back regardless + A = matrix.matrix_new(lib.GrB_INT64, 2, 2) + check_status(A, lib.GrB_Matrix_setElement_INT64(A[0], 1, 0, 0)) + with pytest.raises(OSError): + binary.binwrite(A, tmp_path / "missing_directory" / "matrix.binfile") + assert matrix.matrix_nvals(A) == 1 diff --git a/suitesparse_graphblas/tests/test_memory.py b/suitesparse_graphblas/tests/test_memory.py new file mode 100644 index 0000000..ed70352 --- /dev/null +++ b/suitesparse_graphblas/tests/test_memory.py @@ -0,0 +1,361 @@ +import os +import subprocess +import sys +import textwrap + +import numpy as np +import pytest + +from suitesparse_graphblas import check_status, exceptions, ffi, lib, matrix, vector +from suitesparse_graphblas.utils import ( + can_unclaim_buffer, + claim_buffer, + claim_buffer_2d, + empty, + give_buffer, + unclaim_buffer, +) + +# Move memory between GraphBLAS and NumPy every supported way, then free all of it. +# `binary` is not tested on Windows; see test_io.py. +SCRIPT = textwrap.dedent(""" + import gc + import sys + import threading + from pathlib import Path + + import numpy as np + + import suitesparse_graphblas as ssgb + from suitesparse_graphblas import check_status, ffi, lib, matrix, vector + from suitesparse_graphblas.api import context + from suitesparse_graphblas.utils import can_unclaim_buffer, claim_buffer, empty, give_buffer + + memory_manager, tmpdir = sys.argv[1], Path(sys.argv[2]) + ssgb.initialize(memory_manager=memory_manager) + # NumPy warns (here, raises) when it frees an array without a memory handler (see the + # subprocess environment), but from deallocation, where it can only report it + unraisable = [] + sys.unraisablehook = unraisable.append + int64 = np.dtype(np.int64) + # NumPy keeps freed blocks under 1024 bytes for reuse, which would hide a wrong free + N = 1000 + + + def load(array, **kwargs): + # NumPy -> GraphBLAS, the way to use `give_buffer` + v = vector.vector_new(lib.GrB_INT64) + with give_buffer(array, **kwargs) as (X, nbytes, arena): + info = lib.GxB_Vector_load( + v[0], X, lib.GrB_INT64, array.size, nbytes, lib.GrB_DEFAULT + arena, ffi.NULL + ) + check_status(v, info) + assert vector.vector_nvals(v) == array.size + return v + + + def unload(v): + # GraphBLAS -> NumPy, the way to use `claim_buffer` + X = ffi.new("void**") + n = ffi.new("uint64_t*") + handling = ffi.new("int*") + info = lib.GxB_Vector_unload( + v[0], X, ffi.new("GrB_Type*"), n, ffi.new("uint64_t*"), handling, ffi.NULL + ) + check_status(v, info) + assert handling[0] < lib.GxB_IS_READONLY # else the data is not GraphBLAS's to give + return claim_buffer(ffi, X[0], n[0], int64, arena=handling[0] - lib.GrB_DEFAULT) + + + def roundtrip(**kwargs): + # NumPy -> GraphBLAS -> NumPy: without a copy (if "numpy"), with one, and from `empty` + ones = empty(N, int64, **kwargs) + ones[:] = 1 + for array in [np.arange(N), np.arange(2 * N)[::2], ones]: + total = array.sum() + assert unload(load(array, **kwargs)).sum() == total + v = load(np.arange(N), **kwargs) + data = vector.serialize(v, lib.GxB_COMPRESSION_NONE) + assert data.nbytes > N * 8 + assert vector.vector_nvals(vector.deserialize(data)) == N + + + def main(): + array = np.arange(N) + assert can_unclaim_buffer(array) == (memory_manager == "numpy") + load(array) + assert array.flags.owndata == (memory_manager != "numpy") # was it copied? + roundtrip() + + # GraphBLAS has nothing to give for an empty array, so NumPy allocates it + assert claim_buffer(ffi, ffi.NULL, 0, int64).shape == (0,) + + # The same array as two arguments: GraphBLAS must get two buffers + array = np.arange(N, dtype=np.uint64) + A = matrix.matrix_new(lib.GrB_UINT64, 1, N) + with ( + give_buffer(np.array([0, N], np.uint64), "GrB_Index*") as (Ap, Ap_size, _), + give_buffer(array, "GrB_Index*") as (Aj, Aj_size, _), + give_buffer(array) as (Ax, Ax_size, _), + ): + info = lib.GxB_Matrix_pack_CSR( + A[0], Ap, Aj, Ax, Ap_size, Aj_size, Ax_size, False, False, ffi.NULL + ) + check_status(A, info) + assert matrix.matrix_nvals(A) == N + + # Many threads at once (free-threaded Python runs them in parallel) + def roundtrips(): + for _ in range(20): + roundtrip() + + threads = [threading.Thread(target=roundtrips) for _ in range(8)] + for t in threads: + t.start() + for t in threads: + t.join() + + if sys.platform == "win32": + return + from suitesparse_graphblas.io import binary + + # `binread` hands its buffers to GraphBLAS; an iso matrix stores a single value, and + # making it non-iso later must not write past it + for sparsity in [lib.GxB_HYPERSPARSE, lib.GxB_SPARSE, lib.GxB_BITMAP, lib.GxB_FULL]: + A = matrix.matrix_new(lib.GrB_INT64, 30, 30) + info = lib.GrB_Matrix_assign_INT64( + A[0], ffi.NULL, ffi.NULL, 7, lib.GrB_ALL, 30, lib.GrB_ALL, 30, ffi.NULL + ) + check_status(A, info) + matrix.matrix_set_sparsity_control(A, sparsity) + binary.binwrite(A, tmpdir / "iso.binfile") + B = binary.binread(tmpdir / "iso.binfile") + matrix.set_int64(B, 99, 0, 0) + check_status(B, lib.GrB_Matrix_wait(B[0], lib.GrB_MATERIALIZE)) + assert matrix.matrix_nvals(B) == 900 + + # Another arena, using libc's allocator. The last one, since GraphBLAS means to give + # CUDA an arena of its own (the first 10.4.0 betas reserved arena 1). It needs a realloc: + # without one, GraphBLAS (10.4.0 to 10.5.1) frees the arena's memory with arena 0's + # free when it grows a buffer. + k = lib.GxB_NARENAS - 1 + import cffi + + std = cffi.FFI() + std.cdef("void *malloc(size_t); void *calloc(size_t, size_t);") + std.cdef("void *realloc(void *, size_t); void free(void *);") + libc = std.dlopen(None) + funcs = [ + ffi.cast(sig, int(std.cast("uintptr_t", std.addressof(libc, name)))) + for name, sig in [ + ("malloc", "void *(*)(size_t)"), + ("calloc", "void *(*)(size_t, size_t)"), + ("realloc", "void *(*)(void *, size_t)"), + ("free", "void (*)(void *)"), + ] + ] + assert lib.GxB_arena_init(k, *funcs) == lib.GrB_SUCCESS + array = empty(N, int64, arena=k) + assert can_unclaim_buffer(array, arena=k) and not can_unclaim_buffer(array, arena=0) + assert not can_unclaim_buffer(np.arange(N), arena=k) + roundtrip(arena=k) + + def others(): + # GraphBLAS -> NumPy and NumPy -> GraphBLAS in functions that have no `arena` + roundtrip() + binary.binwrite(A, tmpdir / "arena.binfile") + assert matrix.matrix_nvals(binary.binread(tmpdir / "arena.binfile")) == 900 + + # ...as the global data arena, which is then the default + assert lib.GrB_Global_set_INT32(lib.GrB_GLOBAL, k, lib.GxB_ARENA_DATA) == lib.GrB_SUCCESS + assert can_unclaim_buffer(empty(N)) and not can_unclaim_buffer(np.arange(N)) + others() + assert lib.GrB_Global_set_INT32(lib.GrB_GLOBAL, 0, lib.GxB_ARENA_DATA) == lib.GrB_SUCCESS + + # ...and as the data arena of an engaged Context, which GraphBLAS doesn't reveal + ctx = context.context_new() + check_status(ctx, lib.GxB_Context_set_INT(ctx[0], k, lib.GxB_ARENA_DATA)) + context.context_engage(ctx) + others() + context.context_disengage(ctx) + + + main() + gc.collect() + assert not unraisable, [str(u.exc_value) for u in unraisable] + """) + + +@pytest.mark.parametrize("memory_manager", ["numpy", "c"]) +def test_allocators_match(memory_manager, tmp_path): + """Memory must be freed by the allocator that allocated it, whoever ends up owning it. + + A mismatch is silent wherever both allocators happen to be libc's, which used to be + everywhere. They differ on free-threaded Python 3.15, and Python's debug hooks make + them differ on any Python (given NumPy >=2.5), so this test doesn't depend on which + Python runs it. It needs its own process: a mismatch aborts the interpreter, and + GraphBLAS can only be initialized once. + """ + proc = subprocess.run( + [ + sys.executable, + "-W", + "error::RuntimeWarning", + "-c", + SCRIPT, + memory_manager, + str(tmp_path), + ], + env={**os.environ, "PYTHONMALLOC": "debug", "NUMPY_WARN_IF_NO_MEM_POLICY": "1"}, + capture_output=True, + text=True, + timeout=300, + ) + assert proc.returncode == 0, proc.stderr + + +def load(array, **kwargs): + v = vector.vector_new(lib.GrB_INT64) + with give_buffer(array, **kwargs) as (X, nbytes, arena): + info = lib.GxB_Vector_load( + v[0], X, lib.GrB_INT64, array.size, nbytes, lib.GrB_DEFAULT + arena, ffi.NULL + ) + check_status(v, info) + return v + + +def test_claim_buffer(): + int64 = np.dtype(np.int64) + assert claim_buffer(ffi, ffi.NULL, 0, int64).shape == (0,) + assert claim_buffer_2d(ffi, ffi.NULL, 0, 0, 5, int64, True).shape == (0, 5) + with pytest.raises(ValueError, match="NULL pointer"): + claim_buffer(ffi, ffi.NULL, 3, int64) + with pytest.raises(ValueError, match="NULL pointer"): + claim_buffer_2d(ffi, ffi.NULL, 6, 2, 3, int64, True) + + +def test_can_unclaim_buffer(): + array = np.arange(10) + assert can_unclaim_buffer(array) + assert can_unclaim_buffer(matrix.serialize(matrix.matrix_new(lib.GrB_BOOL, 2, 2))) + assert can_unclaim_buffer(empty(3)) + # GraphBLAS can only take ownership from an owner, and only if it may change the data + assert not can_unclaim_buffer(array[:5]) + assert not can_unclaim_buffer(np.frombuffer(b"1234", np.uint8)) + readonly = np.arange(10) + readonly.flags.writeable = False + assert not can_unclaim_buffer(readonly) + assert not can_unclaim_buffer(np.array([None, 1])) + assert not can_unclaim_buffer([1, 2, 3]) + for arena in [8, -1, 2**40]: + with pytest.raises(ValueError, match="range"): + can_unclaim_buffer(array, arena=arena) + with pytest.raises(ValueError, match="arena 5 has not been initialized"): + can_unclaim_buffer(array, arena=5) + + +def test_unclaim_buffer(): + def handover(array): + # The low-level way: hand over (after checking `can_unclaim_buffer`), then unclaim + v = vector.vector_new(lib.GrB_INT64) + X = ffi.new("void**", ffi.cast("void*", array.ctypes.data)) + info = lib.GxB_Vector_load( + v[0], X, lib.GrB_INT64, array.size, array.nbytes, lib.GrB_DEFAULT, ffi.NULL + ) + check_status(v, info) + return v + + array = np.arange(10) + assert can_unclaim_buffer(array) + v = handover(array) + unclaim_buffer(array) + assert not array.flags.owndata + assert not array.flags.writeable + assert vector.vector_nvals(v) == 10 + + # GraphBLAS should not have been given this, but it now has it, so NumPy must let go + array = np.arange(10) + array.flags.writeable = False + assert not can_unclaim_buffer(array) + v = handover(array) + with pytest.raises(ValueError, match="it is read-only. Check `can_unclaim_buffer`"): + unclaim_buffer(array) + assert not array.flags.owndata + assert vector.vector_nvals(v) == 10 + + for array in [np.arange(10)[::2], np.frombuffer(bytearray(8), np.uint8)]: + with pytest.raises(ValueError, match="does not own its data"): + unclaim_buffer(array) + assert array.flags.writeable # unchanged + + +def test_empty(): + a = empty((2, 3), np.int32) + assert a.shape == (2, 3) + assert a.dtype == np.int32 + assert a.flags.c_contiguous + assert a.flags.owndata + a[...] = 1 + assert a.sum() == 6 + f = empty([2, 3], order="F") + assert f.dtype == np.float64 + assert f.flags.f_contiguous + assert not f.flags.c_contiguous + assert empty(4).shape == empty(np.int64(4)).shape == (4,) + assert empty(()).shape == () + assert empty((0, 5)).size == 0 + with pytest.raises(ValueError, match="negative"): + empty(-1) + with pytest.raises(TypeError, match="sequence of ints"): + empty(1.5) + with pytest.raises(TypeError, match="Python objects"): + empty(3, object) + with pytest.raises(ValueError, match="order"): + empty(3, order="A") + + +def test_give_buffer(): + # Zero-copy: the array no longer owns the data GraphBLAS took + array = np.arange(5) + v = load(array) + assert not array.flags.owndata + assert not array.flags.writeable + x = ffi.new("int64_t*") + check_status(v, lib.GrB_Vector_extractElement_INT64(x, v[0], 4)) + assert x[0] == 4 + + # A copy, so the array is unchanged + for array, kwargs in [(np.arange(10)[::2], {}), (np.arange(5), {"copy": True})]: + v = load(array, **kwargs) + assert array.flags.writeable + check_status(v, lib.GrB_Vector_extractElement_INT64(x, v[0], 4)) + assert x[0] == array[4] + with pytest.raises(ValueError, match="without copying: it does not own its data"): + load(np.arange(10)[::2], copy=False) + + # GraphBLAS didn't take ownership, so the array keeps it + array = np.arange(5) + v = vector.vector_new(lib.GrB_INT64) + with pytest.raises(exceptions.InvalidValue): + with give_buffer(array) as (X, nbytes, arena): + assert not array.flags.owndata # so that it can't be given twice + info = lib.GxB_Vector_load( # claims more entries than fit + v[0], X, lib.GrB_INT64, array.size + 1, nbytes, lib.GrB_DEFAULT, ffi.NULL + ) + check_status(v, info) + assert array.flags.owndata + assert array.flags.writeable + + # The same array twice: the second is a copy, or an error if it may not be + array = np.arange(5) + with give_buffer(array) as (X, _, _), give_buffer(array) as (Y, _, _): + assert X[0] != Y[0] + with pytest.raises(ValueError, match="already being given"): + with give_buffer(array), give_buffer(array, copy=False): + pass + assert array.flags.owndata + + with pytest.raises(TypeError, match="Python objects"): + load(np.array([None, 1])) + with pytest.raises(TypeError, match="copy"): + load(np.arange(5), copy="yes") diff --git a/suitesparse_graphblas/utils.pxd b/suitesparse_graphblas/utils.pxd index 69a279e..05da4ff 100644 --- a/suitesparse_graphblas/utils.pxd +++ b/suitesparse_graphblas/utils.pxd @@ -1,4 +1,5 @@ -from libc.stdint cimport uint64_t +from cpython.ref cimport PyObject +from libc.stdint cimport int32_t, uint8_t from numpy cimport dtype as dtype_t from numpy cimport ndarray, npy_intp @@ -9,6 +10,22 @@ cdef extern from "numpy/arrayobject.h" nogil: void *PyDataMem_NEW_ZEROED(size_t nmemb, size_t size) void *PyDataMem_RENEW(void *ptr, size_t size) void PyDataMem_FREE(void *ptr) + # The memory handler (a PyCapsule) whose allocator matches the functions above + PyObject *PyDataMem_DefaultHandler + # NumPy memory handlers (NEP 49); like `mem_handler`, these need + # NPY_TARGET_VERSION >= NPY_1_22_API_VERSION (see setup.py) + ctypedef struct PyDataMemAllocator: + void *ctx + void *(*malloc)(void *ctx, size_t size) noexcept nogil + void *(*calloc)(void *ctx, size_t nelem, size_t elsize) noexcept nogil + void *(*realloc)(void *ctx, void *ptr, size_t new_size) noexcept nogil + void (*free)(void *ctx, void *ptr, size_t size) noexcept nogil + ctypedef struct PyDataMem_Handler: + char name[127] + uint8_t version + PyDataMemAllocator allocator + ctypedef struct PyArrayObject_fields: + PyObject *mem_handler # These are available in newer Cython versions void PyArray_ENABLEFLAGS(ndarray array, int flags) void PyArray_CLEARFLAGS(ndarray array, int flags) @@ -21,20 +38,32 @@ ctypedef enum GrB_Mode: GrB_NONBLOCKING GrB_BLOCKING -ctypedef uint64_t (*GxB_init)( +# GrB_Info is a C enum (int); errors are negative +ctypedef int (*GxB_init)( GrB_Mode, void *(*user_malloc_function)(size_t), void *(*user_calloc_function)(size_t, size_t), void *(*user_realloc_function)(void *, size_t), void (*user_free_function)(void *), ) +# GrB_Global_get_INT32 +ctypedef int (*global_get_int32_t)(void *, int32_t *, int) noexcept nogil cpdef int call_gxb_init(object ffi, object lib, int mode) -cpdef ndarray claim_buffer(object ffi, object cdata, size_t size, dtype_t dtype) +cpdef ndarray claim_buffer(object ffi, object cdata, size_t size, dtype_t dtype, object arena=*) cpdef ndarray claim_buffer_2d( - object ffi, object cdata, size_t cdata_size, size_t nrows, size_t ncols, dtype_t dtype, bint is_c_order + object ffi, + object cdata, + size_t cdata_size, + size_t nrows, + size_t ncols, + dtype_t dtype, + bint is_c_order, + object arena=*, ) -cpdef unclaim_buffer(ndarray array) +cpdef bint can_unclaim_buffer(object array, object arena=*) except -1 + +cpdef unclaim_buffer(ndarray array, object arena=*) diff --git a/suitesparse_graphblas/utils.pyx b/suitesparse_graphblas/utils.pyx index 5c9ae99..7124cdc 100644 --- a/suitesparse_graphblas/utils.pyx +++ b/suitesparse_graphblas/utils.pyx @@ -4,15 +4,226 @@ # libraries are required to be thread-safe, so things should "just work". # Of course, users writing multithreaded code can find many creative ways # to fail, but python-suitesparse-graphblas shouldn't crash. +"""Move memory between GraphBLAS and NumPy without copying. + +Memory must be freed by the allocator that allocated it. GraphBLAS frees the memory it +owns with the allocator of the *arena* the memory belongs to: arena 0 is set up by +``suitesparse_graphblas.initialize`` (NumPy's allocator for ``memory_manager="numpy"``, +libc's for ``"c"``), and ``GxB_arena_init`` can add more. NumPy frees the data of an +array with the array's memory handler (NEP 49). So: + +- GraphBLAS -> NumPy: ``claim_buffer`` and ``claim_buffer_2d`` wrap memory GraphBLAS + allocated in an array whose memory handler frees it with the same arena's allocator. +- NumPy -> GraphBLAS: ``give_buffer`` hands the data of an array to a GraphBLAS function + that takes ownership of it, such as ``GxB_Matrix_pack_CSR`` or ``GxB_Vector_load`` + (copying it first if GraphBLAS can't own it). ``can_unclaim_buffer`` and + ``unclaim_buffer`` are the lower-level pieces. +- ``empty`` makes an array that GraphBLAS can always take ownership of. + +Each function takes an optional ``arena``. It defaults to GraphBLAS's global data arena +(``GxB_ARENA_DATA`` of ``GrB_GLOBAL``; 0 unless changed), which is where GraphBLAS +allocates, and where it expects memory it is given to be from, unless the calling thread +has engaged a ``GxB_Context`` with another data arena. GraphBLAS can't be asked which +Context is engaged, so pass ``arena`` in that case. + +Which arena a buffer from GraphBLAS is in: ``GxB_*_unpack_*`` and ``GxB_*_export_*`` first +move the object to the arena above, so their buffers are in it whatever arena the object +was made in; ``GxB_*_unload`` reports each buffer's arena (``handling - GrB_DEFAULT``). +""" +import operator +import threading +from contextlib import contextmanager + import numpy as np + +from suitesparse_graphblas._graphblas import ffi as _ffi +from suitesparse_graphblas._graphblas import lib as _lib + +from cpython.pycapsule cimport PyCapsule_GetPointer, PyCapsule_New +from cpython.pyport cimport PY_SSIZE_T_MAX from cpython.ref cimport Py_INCREF -from libc.stdint cimport uintptr_t +from libc.stdint cimport SIZE_MAX, int32_t, uintptr_t +from libc.stdio cimport snprintf +from libc.string cimport memset from numpy cimport NPY_ARRAY_F_CONTIGUOUS, NPY_ARRAY_OWNDATA, NPY_ARRAY_WRITEABLE from numpy cimport dtype as dtype_t -from numpy cimport import_array, ndarray, npy_intp +from numpy cimport PyArray_CHKFLAGS, PyArray_DATA, import_array, ndarray, npy_intp import_array() + +cdef enum: + NARENAS = 8 # GxB_NARENAS + +if _lib.GxB_NARENAS > NARENAS: # pragma: no cover + raise ImportError(f"Unsupported GxB_NARENAS: {_lib.GxB_NARENAS}") + +ctypedef void *(*malloc_t)(size_t) noexcept nogil +ctypedef void *(*calloc_t)(size_t, size_t) noexcept nogil +ctypedef void *(*realloc_t)(void *, size_t) noexcept nogil +ctypedef void (*free_t)(void *) noexcept nogil + +ctypedef struct Arena: + malloc_t malloc + calloc_t calloc # may be NULL + realloc_t realloc # may be NULL + free_t free + +# The allocator of each GraphBLAS arena, and a NumPy memory handler that uses it +cdef Arena arenas[NARENAS] +cdef PyDataMem_Handler arena_handlers[NARENAS] +# The NumPy memory handler (a PyCapsule) for the memory of each arena, made on first use. +# It is NumPy's default handler if the arena uses NumPy's allocator. +cdef list _handlers = [None] * NARENAS +_handlers_lock = threading.Lock() + + +cdef uintptr_t address(object cdata) except? 0: + # The address in a cffi pointer. Cython isn't compiled against GraphBLAS, so this is how + # it gets at what cffi's `lib` has: cast the result to the C type and use it directly. + return int(_ffi.cast("uintptr_t", cdata)) + + +# `GrB_Global_get_INT32(GrB_GLOBAL, ...)`, called directly rather than through cffi because +# it is on the path of every function below +cdef global_get_int32_t global_get_int32 = address( + _ffi.addressof(_lib, "GrB_Global_get_INT32") +) +cdef void *GrB_GLOBAL = address(_lib.GrB_GLOBAL) +cdef int GxB_ARENA_DATA = _lib.GxB_ARENA_DATA + + +cdef void *arena_malloc(void *ctx, size_t size) noexcept nogil: + return (ctx).malloc(size) + + +cdef void *arena_calloc(void *ctx, size_t nelem, size_t elsize) noexcept nogil: + cdef Arena *arena = ctx + cdef void *ptr + if arena.calloc != NULL: + return arena.calloc(nelem, elsize) + if elsize != 0 and nelem > SIZE_MAX // elsize: + return NULL + ptr = arena.malloc(nelem * elsize) + if ptr != NULL: + memset(ptr, 0, nelem * elsize) + return ptr + + +cdef void *arena_realloc(void *ctx, void *ptr, size_t new_size) noexcept nogil: + cdef Arena *arena = ctx + if arena.realloc == NULL: # optional for GraphBLAS arenas; NumPy raises MemoryError + return NULL + return arena.realloc(ptr, new_size) + + +cdef void arena_free(void *ctx, void *ptr, size_t size) noexcept nogil: + (ctx).free(ptr) + + +cdef int _resolve_arena(object arena) except -1: + cdef int32_t k + cdef int info + if arena is None: + info = global_get_int32(GrB_GLOBAL, &k, GxB_ARENA_DATA) + if info != 0: # GrB_SUCCESS + raise RuntimeError( + f"Unable to get GraphBLAS's data arena (info={info}); is GraphBLAS initialized?" + ) + return k + index = operator.index(arena) + if not 0 <= index < NARENAS: + raise ValueError(f"arena must be in range({NARENAS}); got {arena!r}") + return index + + +cdef object _handler(int k): + # The NumPy memory handler for memory from arena `k` + handler = _handlers[k] + if handler is None: + with _handlers_lock: + handler = _handlers[k] + if handler is None: + handler = _handlers[k] = _new_handler(k) + return handler + + +cdef object _new_handler(int k): + cdef uintptr_t funcs[4] + flag = _ffi.new("int*") + info = _lib.GxB_arena_initialized(flag, k) + if info != _lib.GrB_SUCCESS: + raise RuntimeError( + f"Unable to query GraphBLAS arena {k} (info={info}); is GraphBLAS initialized?" + ) + if not flag[0]: + raise ValueError(f"GraphBLAS arena {k} has not been initialized (see GxB_arena_init)") + func = _ffi.new("void**") + for i, field in enumerate( + [_lib.GxB_ARENA_MALLOC, _lib.GxB_ARENA_CALLOC, _lib.GxB_ARENA_REALLOC, _lib.GxB_ARENA_FREE] + ): + info = _lib.GrB_Global_get_VOID(_lib.GrB_GLOBAL, func, field + k) + if info != _lib.GrB_SUCCESS: + raise RuntimeError(f"Unable to get the allocator of GraphBLAS arena {k} (info={info})") + funcs[i] = address(func[0]) + arenas[k].malloc = funcs[0] + arenas[k].calloc = funcs[1] + arenas[k].realloc = funcs[2] + arenas[k].free = funcs[3] + if funcs[3] == PyDataMem_FREE: + # NumPy's allocator (memory_manager="numpy"): use NumPy's own handler, so these + # arrays are like any other NumPy array (including for `can_unclaim_buffer`). + return PyDataMem_DefaultHandler + snprintf(arena_handlers[k].name, sizeof(arena_handlers[k].name), "suitesparse_graphblas_arena%d", k) + arena_handlers[k].version = 1 + arena_handlers[k].allocator.ctx = &arenas[k] + arena_handlers[k].allocator.malloc = arena_malloc + arena_handlers[k].allocator.calloc = arena_calloc + arena_handlers[k].allocator.realloc = arena_realloc + arena_handlers[k].allocator.free = arena_free + return PyCapsule_New(&arena_handlers[k], "mem_handler", NULL) + + +cdef str _handler_name(object handler): + return (PyCapsule_GetPointer(handler, "mem_handler")).name.decode() + + +cdef inline void own_data(ndarray array, object handler): + # Make `array`, which was wrapped around existing data, own (and eventually free) that + # data with `handler`. Without a handler, NumPy frees with libc `free`, which is wrong + # unless the data is from libc `malloc`. + cdef PyArrayObject_fields *fields = array + if fields.mem_handler == NULL: # else NumPy allocated the data (it was given NULL) + Py_INCREF(handler) + fields.mem_handler = handler + PyArray_ENABLEFLAGS(array, NPY_ARRAY_OWNDATA) + + +cdef str _why_not_ownable(object array, object handler): + # Why GraphBLAS can't take ownership of the data of `array` (to free with `handler`), + # or None if it can. + cdef ndarray arr + cdef PyObject *mem_handler + if not isinstance(array, ndarray): + return f"it is a {type(array).__name__}, not a NumPy array" + arr = array + if not PyArray_CHKFLAGS(arr, NPY_ARRAY_OWNDATA): + return "it does not own its data (e.g., it is a view, or is already being given)" + if not PyArray_CHKFLAGS(arr, NPY_ARRAY_WRITEABLE): + return "it is read-only" + if arr.dtype.hasobject: + return "it holds Python objects" + mem_handler = (arr).mem_handler + if mem_handler == handler: + return None + if mem_handler == NULL: + return "it has no NumPy memory handler, so its data came from an unknown allocator" + return ( + f"its data came from NumPy memory handler {_handler_name(mem_handler)!r}, " + f"but GraphBLAS will free it as {_handler_name(handler)!r}" + ) + + cpdef int call_gxb_init(object ffi, object lib, int mode): # We need to call `GxB_init`, but we didn't compile Cython against GraphBLAS. So, we get it from cffi. # Step 1: ffi.addressof(lib, "GxB_init") @@ -25,27 +236,42 @@ cpdef int call_gxb_init(object ffi, object lib, int mode): # Return type: uintptr_t in Cython. Cast Python int to Cython integer for pointers. # Step 5: (...) # Return: function pointer in Cython! - cdef GxB_init func = int(ffi.cast("uintptr_t", ffi.addressof(lib, "GxB_init"))) return func(mode, PyDataMem_NEW, PyDataMem_NEW_ZEROED, PyDataMem_RENEW, PyDataMem_FREE) -cpdef ndarray claim_buffer(object ffi, object cdata, size_t size, dtype_t dtype): +cpdef ndarray claim_buffer(object ffi, object cdata, size_t size, dtype_t dtype, object arena=None): + """Return a 1-d array that owns ``size`` elements of GraphBLAS-allocated memory at ``cdata``. + + ``arena`` is the GraphBLAS arena that allocated the memory (default: the global data + arena); NumPy will free the memory with that arena's allocator. + """ cdef: npy_intp dims = size uintptr_t ptr = int(ffi.cast("uintptr_t", cdata)) ndarray array + handler = _handler(_resolve_arena(arena)) + if ptr == 0 and size != 0: + raise ValueError(f"Unable to claim {size} elements from a NULL pointer") Py_INCREF(dtype) array = PyArray_NewFromDescr( ndarray, dtype, 1, &dims, NULL, ptr, NPY_ARRAY_WRITEABLE, NULL ) - PyArray_ENABLEFLAGS(array, NPY_ARRAY_OWNDATA) + own_data(array, handler) return array cpdef ndarray claim_buffer_2d( - object ffi, object cdata, size_t cdata_size, size_t nrows, size_t ncols, dtype_t dtype, bint is_c_order + object ffi, + object cdata, + size_t cdata_size, + size_t nrows, + size_t ncols, + dtype_t dtype, + bint is_c_order, + object arena=None, ): + """Like ``claim_buffer``, but return a 2-d ``nrows`` by ``ncols`` array.""" cdef: size_t size = nrows * ncols ndarray array @@ -53,7 +279,10 @@ cpdef ndarray claim_buffer_2d( npy_intp dims[2] int flags = NPY_ARRAY_WRITEABLE if cdata_size == size: + handler = _handler(_resolve_arena(arena)) ptr = int(ffi.cast("uintptr_t", cdata)) + if ptr == 0 and size != 0: + raise ValueError(f"Unable to claim {size} elements from a NULL pointer") dims[0] = nrows dims[1] = ncols if not is_c_order: @@ -62,9 +291,9 @@ cpdef ndarray claim_buffer_2d( array = PyArray_NewFromDescr( ndarray, dtype, 2, dims, NULL, ptr, flags, NULL ) - PyArray_ENABLEFLAGS(array, NPY_ARRAY_OWNDATA) + own_data(array, handler) elif cdata_size > size: # pragma: no cover - array = claim_buffer(ffi, cdata, cdata_size, dtype) + array = claim_buffer(ffi, cdata, cdata_size, dtype, arena) if is_c_order: array = array[:size].reshape((nrows, ncols)) else: @@ -77,5 +306,164 @@ cpdef ndarray claim_buffer_2d( return array -cpdef unclaim_buffer(ndarray array): - PyArray_CLEARFLAGS(array, NPY_ARRAY_OWNDATA | NPY_ARRAY_WRITEABLE) +cpdef bint can_unclaim_buffer(object array, object arena=None) except -1: + """Whether GraphBLAS may take ownership of the data of ``array``. + + True only if ``array`` owns its data, is writeable, does not hold Python objects, and + its data came from the allocator of the GraphBLAS arena (default: the global data + arena) that will free it. So views never qualify, nor do arrays from a custom NumPy + memory handler, nor (with ``memory_manager="c"``) arrays NumPy allocated. Arrays from + ``claim_buffer``, ``empty``, and (with ``memory_manager="numpy"``) NumPy's default + allocator do. Prefer ``give_buffer``, which also copies when this is False. + + This cannot see other references to the data: GraphBLAS may free or reallocate it at + any time after the handover, so no view of ``array`` (nor memoryview or cffi pointer + into it) may outlive the handover. + """ + if not isinstance(array, ndarray) or not PyArray_CHKFLAGS(array, NPY_ARRAY_OWNDATA): + return False + return _why_not_ownable(array, _handler(_resolve_arena(arena))) is None + + +cpdef unclaim_buffer(ndarray array, object arena=None): + """Make ``array`` a read-only view of its data, which GraphBLAS has taken ownership of. + + Call this *after* a GraphBLAS function took ownership, and only for an array that + passed ``can_unclaim_buffer`` beforehand. Prefer ``give_buffer``, which does both. + + Raises ValueError if GraphBLAS can't own the data (see ``can_unclaim_buffer``). Since + GraphBLAS already has it and will free it, ``array`` stops owning the data even then, + so that NumPy does not free it too. + """ + why_not = _why_not_ownable(array, _handler(_resolve_arena(arena))) + if why_not is None: + PyArray_CLEARFLAGS(array, NPY_ARRAY_OWNDATA | NPY_ARRAY_WRITEABLE) + return + PyArray_CLEARFLAGS(array, NPY_ARRAY_OWNDATA) + raise ValueError( + f"GraphBLAS cannot safely own the data of this array: {why_not}. Check " + "`can_unclaim_buffer` before handing data to GraphBLAS, or use `give_buffer`." + ) + + +def empty(shape, dtype=float, order="C", arena=None): + """Return a new, uninitialized array whose data GraphBLAS can take ownership of. + + Like ``numpy.empty``, but allocated by the allocator of the GraphBLAS ``arena`` + (default: the global data arena) whatever the ``memory_manager`` or NumPy memory + handler in use, so ``can_unclaim_buffer`` is True for it. + """ + cdef: + int k = _resolve_arena(arena) + void *ptr + ndarray array + ndarray dims + handler = _handler(k) + dtype = np.dtype(dtype) + if dtype.hasobject: + raise TypeError("GraphBLAS cannot own arrays that hold Python objects") + if order not in {"C", "F"}: + raise ValueError(f"order must be 'C' or 'F'; got {order!r}") + try: + shape = (operator.index(shape),) + except TypeError: + try: + shape = tuple([operator.index(dim) for dim in shape]) + except TypeError: + raise TypeError(f"shape must be an int or a sequence of ints; got {shape!r}") from None + nbytes = dtype.itemsize + for dim in shape: + if dim < 0: + raise ValueError("negative dimensions are not allowed") + nbytes *= dim + if nbytes > PY_SSIZE_T_MAX: + raise ValueError("array is too big") + dims = np.array(shape, dtype=np.intp) + ptr = arenas[k].malloc(nbytes or 1) # NumPy never allocates 0 bytes either + if ptr == NULL: + raise MemoryError(f"Unable to allocate {nbytes} bytes") + Py_INCREF(dtype) + try: + array = PyArray_NewFromDescr( + ndarray, + dtype, + len(shape), + PyArray_DATA(dims), + NULL, + ptr, + NPY_ARRAY_WRITEABLE | (NPY_ARRAY_F_CONTIGUOUS if order == "F" else 0), + NULL, + ) + except BaseException: + arenas[k].free(ptr) + raise + own_data(array, handler) + return array + + +@contextmanager +def give_buffer(array, ctype="void*", *, copy=None, arena=None): + """Hand the data of ``array`` to a GraphBLAS function that takes ownership of it. + + Yields ``(ptr, nbytes, arena)``: ``ptr`` is a new ``ctype *`` that points to the data, + to pass to, e.g., ``GxB_Matrix_pack_CSR`` (with ``nbytes`` as the size) or to + ``GxB_Vector_load`` (with handling ``GrB_DEFAULT + arena``). GraphBLAS sets ``*ptr`` + to NULL when it takes ownership; then, on exit, the array handed over becomes a + read-only view of data it no longer owns. Otherwise (e.g., the call failed) nothing + changes. + + copy : bool, optional + None (default): hand over the data of ``array`` itself if GraphBLAS can own it + (see ``can_unclaim_buffer``), else a copy. True: always hand over a copy, leaving + ``array`` unchanged. False: never copy; raise ValueError if GraphBLAS can't own it. + arena : int, optional + The GraphBLAS arena that will own the data (default: the global data arena). + + An array is handed over only once: to give the same array as two arguments of one + call, nest two ``give_buffer`` and the second gets a copy. Giving one array from two + threads at once is a race, like any other change to an array. + + Examples + -------- + >>> import numpy as np + >>> from suitesparse_graphblas import check_status, ffi, lib, vector + >>> from suitesparse_graphblas.utils import give_buffer + >>> v = vector.vector_new(lib.GrB_INT64) + >>> values = np.arange(3) + >>> with give_buffer(values) as (X, nbytes, arena): + ... info = lib.GxB_Vector_load( + ... v[0], X, lib.GrB_INT64, values.size, nbytes, lib.GrB_DEFAULT + arena, ffi.NULL + ... ) + ... check_status(v, info) + >>> vector.vector_nvals(v), values.flags.owndata + (3, False) + """ + cdef int k = _resolve_arena(arena) + cdef ndarray buf + if copy is not None and not isinstance(copy, bool): + raise TypeError(f"copy must be None, True, or False; got {copy!r}") + handler = _handler(k) + array = np.asarray(array) + if array.dtype.hasobject: + raise TypeError("GraphBLAS cannot own arrays that hold Python objects") + why_not = None if copy else _why_not_ownable(array, handler) + if copy is False and why_not is not None: + raise ValueError( + f"GraphBLAS cannot take ownership of the data of this array without copying: {why_not}" + ) + if copy or why_not is not None: + order = "F" if array.flags.f_contiguous and not array.flags.c_contiguous else "C" + buf = empty(array.shape, array.dtype, order, k) + np.copyto(buf, array, casting="no") + else: + buf = array + ptr = _ffi.new(f"{ctype}*", _ffi.cast(ctype, PyArray_DATA(buf))) + # `buf` stops owning its data for now, so that giving the same array again copies it + PyArray_CLEARFLAGS(buf, NPY_ARRAY_OWNDATA) + try: + yield ptr, buf.nbytes, k + finally: + if ptr[0] == _ffi.NULL: # GraphBLAS owns the data now + PyArray_CLEARFLAGS(buf, NPY_ARRAY_WRITEABLE) + else: + PyArray_ENABLEFLAGS(buf, NPY_ARRAY_OWNDATA) From 90dfbd380dd3a6da3013fb6580723b6b8c5e11b0 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Tue, 13 Oct 2026 10:31:30 -0500 Subject: [PATCH 191/193] Build Pyodide (WebAssembly) wheels (#158) Add a pyodide job to wheels.yml that builds and tests cp313 and cp314 pyemscripten wheels (PEP 783) for PyPI. GraphBLAS is built as a static library in before-build (SUITESPARSE_EMSCRIPTEN=1), and EMCC_CFLAGS=-O2 replaces Pyodide's -Oz link, which never finishes. cp315 is skipped until Pyodide 315 is final. Also: - suitesparse.sh stops at the first failed step and uses the CMake option names GraphBLAS honors (GRAPHBLAS_COMPACT, GRAPHBLAS_JITINIT); the old names were silently ignored. - Tests: explicit int64 where GraphBLAS reads GrB_INT64 (NumPy's default int is int32 on wasm32); skip the subprocess and OpenMP tests on emscripten; lzma is optional. - Wheels no longer ship build-only .c/.h files (the sdist keeps them). - README and AGENTS.md notes on Pyodide; Emscripten classifier. --- .github/workflows/wheels.yml | 28 +++++++++++- AGENTS.md | 15 +++++++ README.md | 14 ++++++ pyproject.toml | 6 +++ suitesparse.sh | 47 +++++++++++++++------ suitesparse_graphblas/tests/test_io.py | 11 ++++- suitesparse_graphblas/tests/test_memory.py | 22 ++++++---- suitesparse_graphblas/tests/test_package.py | 5 +++ suitesparse_graphblas/utils.pyx | 2 +- 9 files changed, 124 insertions(+), 26 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 07caebe..ead4e0b 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -94,6 +94,17 @@ jobs: - os: macos-14 cibw_archs: "arm64" + # WebAssembly for Pyodide (PEP 783 `pyemscripten_*` wheels). GraphBLAS is built in + # before-build (see CIBW_*_PYODIDE below). + - os: ubuntu-latest + cibw_platform: "pyodide" + cibw_archs: "wasm32" + arch_note: "pyodide" + # Pyodide for 3.15 is an alpha, and building for it names the cffi module with + # the build machine's abi3 suffix (e.g., `_graphblas.abi3-x86_64-linux-gnu.so`), + # which Pyodide can't import. + cibw_skip: "cp315-*" + steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: @@ -145,11 +156,25 @@ jobs: # enable option) entirely. CIBW_ENABLE: "pypy" + CIBW_PLATFORM: ${{ matrix.cibw_platform || 'auto' }} + # Build SuiteSparse CIBW_BEFORE_ALL: bash suitesparse.sh ${{ env.GB_VERSION_REF }} CIBW_BEFORE_BUILD_LINUX: ${{ matrix.cibw_before_build_linux }} + # Pyodide: cibuildwheel sets up Emscripten for each Python version (each Pyodide + # version has its own) after before-all, so build GraphBLAS in before-build instead. + # SUITESPARSE_EMSCRIPTEN=1 asks suitesparse.sh for a static library to link into the + # extension module. The empty before-all overrides the one above. + # EMCC_CFLAGS=-O2: Pyodide links with -Oz, and binaryen's wasm-opt -Oz had not + # finished with GraphBLAS after 30 CPU-minutes; -O2 takes about a minute. emcc + # appends EMCC_CFLAGS to every command, so its -O2 is the one that counts (also for + # compiling GraphBLAS, which is then smaller and no slower). + CIBW_BEFORE_ALL_PYODIDE: "" + CIBW_BEFORE_BUILD_PYODIDE: bash suitesparse.sh ${{ env.GB_VERSION_REF }} + CIBW_ENVIRONMENT_PYODIDE: SUITESPARSE_EMSCRIPTEN=1 GRAPHBLAS_PREFIX=/tmp/graphblas-wasm GraphBLAS_ROOT=/tmp/graphblas-wasm EMCC_CFLAGS=-O2 + CIBW_ENVIRONMENT_PASS_LINUX: SUITESPARSE_FASTEST_BUILD # CMAKE_GNUtoMS=ON asks suitesparse.sh to build libraries in MSVC style on Windows. @@ -180,7 +205,8 @@ jobs: # run tests. They run from a temporary directory, so pyproject.toml's pytest # config doesn't apply; -W error restores its `filterwarnings = ["error"]`. - CIBW_TEST_COMMAND: "pytest --pyargs suitesparse_graphblas -s -k test_print_jit_config && pytest -v -W error --pyargs suitesparse_graphblas" + # `python -m pytest`, because the `pytest` script doesn't work in a Pyodide venv. + CIBW_TEST_COMMAND: "python -m pytest --pyargs suitesparse_graphblas -s -k test_print_jit_config && python -m pytest -v -W error --pyargs suitesparse_graphblas" - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: diff --git a/AGENTS.md b/AGENTS.md index 1e93373..aeaf36c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -38,6 +38,21 @@ source instead, run `bash suitesparse.sh refs/tags/$(cat GB_VERSION.txt).0`. Tha honors `SUITESPARSE_FAST_BUILD` / `SUITESPARSE_FASTEST_BUILD` env vars to disable many type specializations for much faster local builds. +### WebAssembly (Pyodide) + +`wheels.yml` builds `pyemscripten` wheels for Pyodide with cibuildwheel +(`CIBW_PLATFORM=pyodide`). With `SUITESPARSE_EMSCRIPTEN=1`, `suitesparse.sh` builds GraphBLAS +as a static library (no OpenMP: Pyodide has no threads) with `emcmake` and Pyodide's compiler +flags, so `emcc` and `pyodide` must be on `PATH`; cibuildwheel provides them only in +before-build, once per Python. Two things that native builds forgive break on wasm32: + +- Calling a C function through a pointer of the wrong type traps ("function signature + mismatch"), so each function pointer type in `utils.pxd`/`utils.pyx` must match the + function's C declaration exactly, return type included (10.5.1.0 typed `GxB_init` as + returning `uint64_t`, which fails on import there). +- NumPy's default integer is int32, so give `dtype=np.int64` to arrays that GraphBLAS reads as + `GrB_INT64`. + ## Tests, lint, and other commands Testing requires the compiled CFFI extension and the SuiteSparse:GraphBLAS C library, so diff --git a/README.md b/README.md index 2d15f15..5334701 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,20 @@ or conda install -c conda-forge python-suitesparse-graphblas ``` +### In the browser (Pyodide) +PyPI also has WebAssembly wheels for [Pyodide](https://pyodide.org) 314 (Python 3.14) and +0.29.4 or later (Python 3.13), the `pyemscripten` platform of +[PEP 783](https://peps.python.org/pep-0783/). So, in Pyodide or JupyterLite +(jupyterlite-pyodide-kernel 0.8 uses Pyodide 314): + +```python +import micropip +await micropip.install("suitesparse-graphblas") +``` + +Older versions of Pyodide don't recognize these wheels: micropip says it can't find a pure +Python 3 wheel. GraphBLAS runs single-threaded in Pyodide, which has no threads (so no OpenMP). + ## Installation from source If you wish to link against your own copy of SuiteSparse:GraphBLAS you may build from source. diff --git a/pyproject.toml b/pyproject.toml index 81a34e6..501d5f3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,6 +47,7 @@ keywords = [ ] classifiers = [ "Development Status :: 5 - Production/Stable", + "Environment :: WebAssembly :: Emscripten", "Operating System :: MacOS :: MacOS X", "Operating System :: POSIX :: Linux", "Operating System :: Microsoft :: Windows", @@ -94,6 +95,11 @@ packages = [ 'suitesparse_graphblas.io', ] +# Build inputs that MANIFEST.in puts in the sdist. Nothing reads them at runtime, so keep them +# out of wheels (`utils.c` alone is about 1 MB, which matters most for Pyodide's downloads). +[tool.setuptools.exclude-package-data] +suitesparse_graphblas = ["*.c", "*.h"] + [tool.setuptools-git-versioning] enabled = true dev_template = "{tag}+{ccount}.g{sha}" diff --git a/suitesparse.sh b/suitesparse.sh index aab7fd3..18edb20 100755 --- a/suitesparse.sh +++ b/suitesparse.sh @@ -33,7 +33,12 @@ cmake_params=() # invisible until someone measures it: conda-forge's graphblas 10.5.0 shipped # that way on osx-arm64 while still depending on llvm-openmp. The matching # runtime check on the built wheel is tests/test_package.py::test_openmp. -cmake_params+=(-DSUITESPARSE_USE_OPENMP=ON) +if [ -n "${SUITESPARSE_EMSCRIPTEN}" ]; then + # ...except for WebAssembly, which has no threads in Pyodide + cmake_params+=(-DSUITESPARSE_USE_OPENMP=OFF) +else + cmake_params+=(-DSUITESPARSE_USE_OPENMP=ON) +fi cmake_params+=(-DSUITESPARSE_USE_STRICT=ON) # STRICT makes any requested-but-missing feature fatal, and SuiteSparsePolicy # defaults both of these to ON, so they must be turned off explicitly or the @@ -66,17 +71,35 @@ if [ -n "${CMAKE_GNUtoMS}" ]; then cmake_params+=(-DCMAKE_STATIC_LIBRARY_PREFIX=) fi +cmake_cmd=(cmake) +if [ -n "${SUITESPARSE_EMSCRIPTEN}" ]; then + # WebAssembly for Pyodide (emcc and pyodide must be on PATH, as in cibuildwheel's + # before-build). Build a static library to link into the extension module, with Pyodide's + # compiler flags (-fPIC and its exception handling ABI). Its -Oz is overridden by + # CMake's Release flags (-O3), or by EMCC_CFLAGS if that sets one (see wheels.yml). + cmake_cmd=(emcmake cmake) + CFLAGS="$(pyodide config get cflags)" || exit 1 + export CFLAGS + cmake_params+=(-DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON) + # No CPU features to detect + cmake_params+=(-DGBNCPUFEAT=1) +fi + if [ -n "${GRAPHBLAS_PREFIX}" ]; then echo "GRAPHBLAS_PREFIX=${GRAPHBLAS_PREFIX}" cmake_params+=(-DCMAKE_INSTALL_PREFIX="${GRAPHBLAS_PREFIX}") fi +# Start clean: this may run more than once (e.g., per Python version for Pyodide) +rm -rf "GraphBLAS-${VERSION}" curl -L "https://github.com/DrTimothyAldenDavis/GraphBLAS/archive/refs/tags/v${VERSION}.tar.gz" | tar xzf - cd "GraphBLAS-${VERSION}/build" || exit # Disable optimizing some rarely-used types for significantly faster builds and significantly smaller wheel size. # Also the build with all types enabled sometimes stalls on GitHub Actions. Probably due to exceeded resource limits. # These can still be used, they'll just have reduced performance (AFAIK similar to UDTs). +# GraphBLAS's own GB_control.h (as of 10.5.1) already disables INT8, INT16, UINT8 and UINT16, so +# the types left without FactoryKernels here are those four plus FC32, FC64 and UINT32. # shellcheck disable=SC2129 # echo "#define GxB_NO_BOOL 1" >> ../Source/GB_control.h # # echo "#define GxB_NO_FP32 1" >> ../Source/GB_control.h # @@ -132,12 +155,8 @@ if [ -n "${SUITESPARSE_FASTEST_BUILD}" ]; then echo "#define GxB_NO_UINT64 1" >> ../Source/GB_control.h echo "#define GxB_NO_UINT8 1" >> ../Source/GB_control.h - # Setting COMPACT probably makes setting config in GB_control.h above unnecessary - cmake_params+=(-DCOMPACT=1) - # Also no JIT for the fastest possible build - cmake_params+=(-DNJIT=1) - # Disable all Source/Generated2 kernels. For workflow development only. - cmake_params+=(-DCMAKE_CUDA_DEV=1) + # No FactoryKernels at all, which probably makes the GB_control.h settings above unnecessary + cmake_params+=(-DGRAPHBLAS_COMPACT=ON) fi if [ -n "${CMAKE_GNUtoMS}" ]; then @@ -145,24 +164,26 @@ if [ -n "${CMAKE_GNUtoMS}" ]; then echo "Skipping JIT on Windows for now because it fails to build." cmake_params+=(-DGRAPHBLAS_USE_JIT=OFF) else - # Use `-DJITINIT=2` so that the JIT functionality is available, but disabled by default. + # Use `GRAPHBLAS_JITINIT=2` so that the JIT functionality is available, but disabled by default. # Level 2, "run", means that pre-JIT kernels may be used, which does not require a compiler at runtime. - cmake_params+=(-DJITINIT=2) + cmake_params+=(-DGRAPHBLAS_JITINIT=2) # Disable JIT here too to not segfault in tests cmake_params+=(-DGRAPHBLAS_USE_JIT=OFF) fi # some platforms require sudo for installation, some don't have sudo at all -if [ "$(uname)" == "Darwin" ]; then +if [ "$(uname)" == "Darwin" ] && [ -z "${SUITESPARSE_EMSCRIPTEN}" ]; then SUDO=sudo else SUDO="" fi -cmake .. -DCMAKE_BUILD_TYPE=Release -G 'Unix Makefiles' "${cmake_params[@]}" -make -j"$NPROC" -$SUDO make install +# Stop at the first failure. Carrying on would hide it until the wheel fails to link, or let +# the wheel link against a library left by an earlier run (e.g., for another Python). +"${cmake_cmd[@]}" .. -DCMAKE_BUILD_TYPE=Release -G 'Unix Makefiles' "${cmake_params[@]}" || exit 1 +make -j"$NPROC" || exit 1 +$SUDO make install || exit 1 if [ -n "${CMAKE_GNUtoMS}" ]; then if [ -z "${GRAPHBLAS_PREFIX}" ]; then diff --git a/suitesparse_graphblas/tests/test_io.py b/suitesparse_graphblas/tests/test_io.py index 2819a2c..1134314 100644 --- a/suitesparse_graphblas/tests/test_io.py +++ b/suitesparse_graphblas/tests/test_io.py @@ -1,6 +1,5 @@ import bz2 import gzip -import lzma import platform from pathlib import Path @@ -21,6 +20,11 @@ vector, ) +try: + import lzma +except ImportError: # Pyodide before 314 has it as a separate package + lzma = None + if platform.system() == "Windows": pytest.skip("skipping windows-only tests", allow_module_level=True) @@ -136,7 +140,10 @@ def test_serialize_vector(): def test_matrix_binfile_read_write(tmp_path): - for opener in (Path.open, gzip.open, bz2.open, lzma.open): + openers = [Path.open, gzip.open, bz2.open] + if lzma is not None: + openers.append(lzma.open) + for opener in openers: for format in (lib.GxB_BY_ROW, lib.GxB_BY_COL): for T in grb_types: for sparsity in (lib.GxB_HYPERSPARSE, lib.GxB_SPARSE, lib.GxB_BITMAP, lib.GxB_FULL): diff --git a/suitesparse_graphblas/tests/test_memory.py b/suitesparse_graphblas/tests/test_memory.py index ed70352..d5d26c3 100644 --- a/suitesparse_graphblas/tests/test_memory.py +++ b/suitesparse_graphblas/tests/test_memory.py @@ -71,17 +71,17 @@ def roundtrip(**kwargs): # NumPy -> GraphBLAS -> NumPy: without a copy (if "numpy"), with one, and from `empty` ones = empty(N, int64, **kwargs) ones[:] = 1 - for array in [np.arange(N), np.arange(2 * N)[::2], ones]: + for array in [np.arange(N, dtype=int64), np.arange(2 * N, dtype=int64)[::2], ones]: total = array.sum() assert unload(load(array, **kwargs)).sum() == total - v = load(np.arange(N), **kwargs) + v = load(np.arange(N, dtype=int64), **kwargs) data = vector.serialize(v, lib.GxB_COMPRESSION_NONE) assert data.nbytes > N * 8 assert vector.vector_nvals(vector.deserialize(data)) == N def main(): - array = np.arange(N) + array = np.arange(N, dtype=int64) assert can_unclaim_buffer(array) == (memory_manager == "numpy") load(array) assert array.flags.owndata == (memory_manager != "numpy") # was it copied? @@ -186,6 +186,7 @@ def others(): """) +@pytest.mark.skipif(sys.platform == "emscripten", reason="needs a subprocess") @pytest.mark.parametrize("memory_manager", ["numpy", "c"]) def test_allocators_match(memory_manager, tmp_path): """Memory must be freed by the allocator that allocated it, whoever ends up owning it. @@ -265,7 +266,7 @@ def handover(array): check_status(v, info) return v - array = np.arange(10) + array = np.arange(10, dtype=np.int64) assert can_unclaim_buffer(array) v = handover(array) unclaim_buffer(array) @@ -274,7 +275,7 @@ def handover(array): assert vector.vector_nvals(v) == 10 # GraphBLAS should not have been given this, but it now has it, so NumPy must let go - array = np.arange(10) + array = np.arange(10, dtype=np.int64) array.flags.writeable = False assert not can_unclaim_buffer(array) v = handover(array) @@ -316,7 +317,7 @@ def test_empty(): def test_give_buffer(): # Zero-copy: the array no longer owns the data GraphBLAS took - array = np.arange(5) + array = np.arange(5, dtype=np.int64) v = load(array) assert not array.flags.owndata assert not array.flags.writeable @@ -325,7 +326,10 @@ def test_give_buffer(): assert x[0] == 4 # A copy, so the array is unchanged - for array, kwargs in [(np.arange(10)[::2], {}), (np.arange(5), {"copy": True})]: + for array, kwargs in [ + (np.arange(10, dtype=np.int64)[::2], {}), + (np.arange(5, dtype=np.int64), {"copy": True}), + ]: v = load(array, **kwargs) assert array.flags.writeable check_status(v, lib.GrB_Vector_extractElement_INT64(x, v[0], 4)) @@ -334,7 +338,7 @@ def test_give_buffer(): load(np.arange(10)[::2], copy=False) # GraphBLAS didn't take ownership, so the array keeps it - array = np.arange(5) + array = np.arange(5, dtype=np.int64) v = vector.vector_new(lib.GrB_INT64) with pytest.raises(exceptions.InvalidValue): with give_buffer(array) as (X, nbytes, arena): @@ -347,7 +351,7 @@ def test_give_buffer(): assert array.flags.writeable # The same array twice: the second is a copy, or an error if it may not be - array = np.arange(5) + array = np.arange(5, dtype=np.int64) with give_buffer(array) as (X, _, _), give_buffer(array) as (Y, _, _): assert X[0] != Y[0] with pytest.raises(ValueError, match="already being given"): diff --git a/suitesparse_graphblas/tests/test_package.py b/suitesparse_graphblas/tests/test_package.py index b0e2d32..99563cb 100644 --- a/suitesparse_graphblas/tests/test_package.py +++ b/suitesparse_graphblas/tests/test_package.py @@ -1,3 +1,5 @@ +import sys + import pytest import suitesparse_graphblas @@ -16,6 +18,9 @@ def test_version(): assert version > [9, 4, 4, 0] +@pytest.mark.skipif( + sys.platform == "emscripten", reason="WebAssembly (Pyodide) has no threads, so no OpenMP" +) def test_openmp(): # GraphBLAS only warns at configure time when OpenMP is missing and still # builds a working, but serial, library, so a serial build is invisible diff --git a/suitesparse_graphblas/utils.pyx b/suitesparse_graphblas/utils.pyx index 7124cdc..1330f7d 100644 --- a/suitesparse_graphblas/utils.pyx +++ b/suitesparse_graphblas/utils.pyx @@ -429,7 +429,7 @@ def give_buffer(array, ctype="void*", *, copy=None, arena=None): >>> from suitesparse_graphblas import check_status, ffi, lib, vector >>> from suitesparse_graphblas.utils import give_buffer >>> v = vector.vector_new(lib.GrB_INT64) - >>> values = np.arange(3) + >>> values = np.arange(3, dtype=np.int64) >>> with give_buffer(values) as (X, nbytes, arena): ... info = lib.GxB_Vector_load( ... v[0], X, lib.GrB_INT64, values.size, nbytes, lib.GrB_DEFAULT + arena, ffi.NULL From e23e85db9f43a011f56825f032f2d95c8b3e95dd Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Tue, 13 Oct 2026 14:51:47 -0500 Subject: [PATCH 192/193] Build wheels against Python 3.15.0 final; routine CI maintenance (#159) * Build wheels against Python 3.15.0 final; routine CI maintenance - cibuildwheel v4.2.1 -> v4.3.1, which builds 3.15 wheels with 3.15.0 final instead of rc3 - Skip PyPy 3.12 wheels: no NumPy release builds on PyPy 3.12 yet. pp311 wheels are now for PyPy 8.0 (pypy311_pp80), and CI builds NumPy from source for them - Build macOS arm64 wheels on macos-15 (macos-14 is retired 2026-11-02). Homebrew's libomp there needs macOS 15, so arm64 wheels now require macOS 15 - test.yml: drop the conda-forge python_rc channel now that Python 3.15.0 is on conda-forge - upload-artifact v7.0.2, download-artifact v8.0.2 - pre-commit: pyupgrade v3.22.0, black 26.10.1 * Skip PyPy wheels on Windows NumPy has no wheels for PyPy 8.0, so the pp311 test step built NumPy from source. On Windows that build uses MinGW, which warns on import that it is experimental, and -W error makes that warning fail the tests. --- .github/workflows/test.yml | 17 ++--------------- .github/workflows/wheels.yml | 23 ++++++++++++++++------- .pre-commit-config.yaml | 4 ++-- 3 files changed, 20 insertions(+), 24 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0d79922..8f16332 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -54,20 +54,7 @@ jobs: else variant=python-gil fi - channels=conda-forge,nodefaults - if [[ $pyver == 3.15 ]]; then - # TODO: drop this branch once Python 3.15.0 final is on conda-forge. - # Until then the 3.15 release candidates need `_python_rc`, which only - # the `python_rc` label provides. The label must rank *below* - # conda-forge: it also holds older `python` rc builds (but no 3.15), and - # strict channel priority would then hide conda-forge's 3.15 rc. - channels=conda-forge,conda-forge/label/python_rc,nodefaults - awk '{ print } /^ - conda-forge$/ { print " - conda-forge/label/python_rc" }' \ - continuous_integration/environment.yml > environment-ci.yml - else - cp continuous_integration/environment.yml environment-ci.yml - fi - echo "CONDA_CHANNELS=$channels" >> "$GITHUB_ENV" + cp continuous_integration/environment.yml environment-ci.yml echo " - python=$pyver" >> environment-ci.yml echo " - $variant" >> environment-ci.yml cat environment-ci.yml @@ -76,7 +63,7 @@ jobs: with: auto-update-conda: true environment-file: environment-ci.yml - channels: ${{ env.CONDA_CHANNELS }} + channels: conda-forge,nodefaults channel-priority: strict activate-environment: suitesparse-graphblas auto-activate-base: false diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index ead4e0b..c96d494 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -46,7 +46,7 @@ jobs: - name: Check metadata run: pipx run twine check dist/* - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: name: sdist path: dist/*.tar.gz @@ -61,6 +61,10 @@ jobs: include: - os: windows-latest cibw_archs: "auto64" + # No PyPy: NumPy has no wheels for PyPy 8.0, and a NumPy built from source here + # uses MinGW, which warns on import that it is experimental ("CRASHES ARE TO BE + # EXPECTED"), failing the tests. + cibw_skip: "pp*" # Linux x86_64 manylinux - os: ubuntu-latest @@ -91,7 +95,8 @@ jobs: # macOS Apple Silicon # Keep runner version as old as possible: libomp determines minimum macOS version. - - os: macos-14 + # macos-14 is retired on 2026-11-02 (and fails jobs during brownouts before then). + - os: macos-15 cibw_archs: "arm64" # WebAssembly for Pyodide (PEP 783 `pyemscripten_*` wheels). GraphBLAS is built in @@ -143,7 +148,7 @@ jobs: brew fetch --retry libomp && brew reinstall libomp echo "MACOSX_DEPLOYMENT_TARGET=$(otool -l "$(brew --prefix libomp)/lib/libomp.dylib" | grep minos | awk '{print $2}')" >> "$GITHUB_ENV" - - uses: pypa/cibuildwheel@e090b81e30c4d855ea63bf4b6e59204c09a101ae # v4.2.1 + - uses: pypa/cibuildwheel@b3395e271a35f73dad77f21802abe9b986dfe299 # v4.3.1 with: output-dir: wheelhouse env: @@ -151,6 +156,8 @@ jobs: CIBW_BUILD_VERBOSITY: 3 # PyPy is not built by default (since cibuildwheel v3); enable explicitly. + # cibuildwheel v4.3 builds PyPy 8.0, whose ABI tag (`pypy311_pp80`) PyPy 7.3 can't + # install, and NumPy has no wheels for it, so building and testing compile NumPy. # Free-threaded wheels (cp314t, cp315t) are built and tested by default. # cibuildwheel v4 dropped cp313t (and its "cpython-freethreading" # enable option) entirely. @@ -190,7 +197,9 @@ jobs: # Architectures to build specified in matrix CIBW_ARCHS: ${{ matrix.cibw_archs }} - CIBW_SKIP: "${{ matrix.cibw_skip }}" + # Skip PyPy 3.12 everywhere: no NumPy release builds on it yet (NumPy's bundled + # pythoncapi_compat.h redefines functions that PyPy 3.12 v8.0's headers declare). + CIBW_SKIP: "pp312-* ${{ matrix.cibw_skip }}" # Use delvewheel on Windows. # This copies graphblas.dll into the wheel. "repair" in cibuildwheel parlance includes copying any shared @@ -208,7 +217,7 @@ jobs: # `python -m pytest`, because the `pytest` script doesn't work in a Pyodide venv. CIBW_TEST_COMMAND: "python -m pytest --pyargs suitesparse_graphblas -s -k test_print_jit_config && python -m pytest -v -W error --pyargs suitesparse_graphblas" - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: name: wheels-${{ matrix.os }}-${{ matrix.cibw_archs }}${{ matrix.arch_note}} path: wheelhouse/*.whl @@ -229,7 +238,7 @@ jobs: permissions: id-token: write # for Trusted Publishing (and its attestations) steps: - - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 with: path: dist merge-multiple: true @@ -250,7 +259,7 @@ jobs: permissions: id-token: write # for Trusted Publishing (and its attestations) steps: - - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 with: path: dist merge-multiple: true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2b3decc..c51ee4a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -45,12 +45,12 @@ repos: hooks: - id: isort - repo: https://github.com/asottile/pyupgrade - rev: v3.21.2 + rev: v3.22.0 hooks: - id: pyupgrade args: [--py311-plus] - repo: https://github.com/psf/black-pre-commit-mirror - rev: 26.5.1 + rev: 26.10.1 hooks: - id: black - repo: https://github.com/PyCQA/flake8 From 8ff05f1223b9bd9548f172bc134807c85c1814f8 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Wed, 28 Oct 2026 10:09:08 -0500 Subject: [PATCH 193/193] Update to SuiteSparse:GraphBLAS 10.5.2; routine CI maintenance (#160) - Regenerate headers. 10.5.2 turns GxB_NONBLOCKING_GPU and GxB_BLOCKING_GPU into historical aliases of GrB_NONBLOCKING and GrB_BLOCKING, so drop them from lib; add GxB_NARENAS_GPU. - Drop a test comment about a GraphBLAS arena realloc bug that 10.5.2 fixes. - Bump cibuildwheel to v4.3.3 and gh-action-pypi-publish to v1.14.3 (fixes for the eMudhra CA compromise), and zizmor to v1.31.1. --- .github/workflows/wheels.yml | 6 +++--- .pre-commit-config.yaml | 2 +- GB_VERSION.txt | 2 +- suitesparse.sh | 2 +- suitesparse_graphblas/create_headers.py | 3 +++ suitesparse_graphblas/suitesparse_graphblas.h | 5 ++--- suitesparse_graphblas/suitesparse_graphblas_no_complex.h | 5 ++--- suitesparse_graphblas/tests/test_memory.py | 5 +---- 8 files changed, 14 insertions(+), 16 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index c96d494..818e255 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -148,7 +148,7 @@ jobs: brew fetch --retry libomp && brew reinstall libomp echo "MACOSX_DEPLOYMENT_TARGET=$(otool -l "$(brew --prefix libomp)/lib/libomp.dylib" | grep minos | awk '{print $2}')" >> "$GITHUB_ENV" - - uses: pypa/cibuildwheel@b3395e271a35f73dad77f21802abe9b986dfe299 # v4.3.1 + - uses: pypa/cibuildwheel@8c2dcd2e96041a619f5ff03c9638d7941e2553a4 # v4.3.3 with: output-dir: wheelhouse env: @@ -243,7 +243,7 @@ jobs: path: dist merge-multiple: true - - uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2 + - uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3 with: # PyPI does not allow replacing a file. Without this flag the entire action fails if even a single duplicate exists. skip-existing: true @@ -264,7 +264,7 @@ jobs: path: dist merge-multiple: true - - uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2 + - uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3 with: repository-url: https://test.pypi.org/legacy/ # PyPI does not allow replacing a file. Without this flag the entire action fails if even a single duplicate exists. diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c51ee4a..86cebb5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -93,7 +93,7 @@ repos: hooks: - id: actionlint - repo: https://github.com/zizmorcore/zizmor-pre-commit - rev: v1.30.1 + rev: v1.31.1 hooks: - id: zizmor - repo: https://github.com/python-jsonschema/check-jsonschema diff --git a/GB_VERSION.txt b/GB_VERSION.txt index 4a6e70e..a39233b 100644 --- a/GB_VERSION.txt +++ b/GB_VERSION.txt @@ -1 +1 @@ -10.5.1 +10.5.2 diff --git a/suitesparse.sh b/suitesparse.sh index 18edb20..d44b5c9 100755 --- a/suitesparse.sh +++ b/suitesparse.sh @@ -98,7 +98,7 @@ cd "GraphBLAS-${VERSION}/build" || exit # Disable optimizing some rarely-used types for significantly faster builds and significantly smaller wheel size. # Also the build with all types enabled sometimes stalls on GitHub Actions. Probably due to exceeded resource limits. # These can still be used, they'll just have reduced performance (AFAIK similar to UDTs). -# GraphBLAS's own GB_control.h (as of 10.5.1) already disables INT8, INT16, UINT8 and UINT16, so +# GraphBLAS's own GB_control.h (as of 10.5.2) already disables INT8, INT16, UINT8 and UINT16, so # the types left without FactoryKernels here are those four plus FC32, FC64 and UINT32. # shellcheck disable=SC2129 # echo "#define GxB_NO_BOOL 1" >> ../Source/GB_control.h # diff --git a/suitesparse_graphblas/create_headers.py b/suitesparse_graphblas/create_headers.py index dcfb5f4..59d5e8c 100644 --- a/suitesparse_graphblas/create_headers.py +++ b/suitesparse_graphblas/create_headers.py @@ -306,6 +306,7 @@ def groupby(index, seq): "GxB_ARENA_DATA", "GxB_ARENA_HEADER", "GxB_NARENAS", + "GxB_NARENAS_GPU", # Added in version 10.5.2 } CHAR_DEFINES = { @@ -337,6 +338,8 @@ def groupby(index, seq): "GxB_HAVE_COMPLEX_C99", # deprecated "GxB_HYPER", + "GxB_NONBLOCKING_GPU", # GrB_Mode values until 10.5.2; now aliases of GrB_NONBLOCKING + "GxB_BLOCKING_GPU", # and GrB_BLOCKING } IGNORE_LINES = { diff --git a/suitesparse_graphblas/suitesparse_graphblas.h b/suitesparse_graphblas/suitesparse_graphblas.h index c50f31f..30dc2f9 100644 --- a/suitesparse_graphblas/suitesparse_graphblas.h +++ b/suitesparse_graphblas/suitesparse_graphblas.h @@ -126,9 +126,7 @@ typedef enum typedef enum { GrB_NONBLOCKING = 0, - GrB_BLOCKING = 1, - GxB_NONBLOCKING_GPU = 7099, - GxB_BLOCKING_GPU = 7098 + GrB_BLOCKING = 1 } GrB_Mode; typedef enum @@ -3841,6 +3839,7 @@ GrB_Info GxB_unload_Vector_into_Container(GrB_Vector V, GxB_Container Container, #define GxB_INDEX_MAX ... #define GxB_MAX_NAME_LEN ... #define GxB_NARENAS ... +#define GxB_NARENAS_GPU ... #define GxB_NBITMAP_SWITCH ... #define GxB_NGPUS ... #define GxB_NTHREADS ... diff --git a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h index dea3086..9e80f31 100644 --- a/suitesparse_graphblas/suitesparse_graphblas_no_complex.h +++ b/suitesparse_graphblas/suitesparse_graphblas_no_complex.h @@ -124,9 +124,7 @@ typedef enum typedef enum { GrB_NONBLOCKING = 0, - GrB_BLOCKING = 1, - GxB_NONBLOCKING_GPU = 7099, - GxB_BLOCKING_GPU = 7098 + GrB_BLOCKING = 1 } GrB_Mode; typedef enum @@ -3603,6 +3601,7 @@ GrB_Info GxB_unload_Vector_into_Container(GrB_Vector V, GxB_Container Container, #define GxB_INDEX_MAX ... #define GxB_MAX_NAME_LEN ... #define GxB_NARENAS ... +#define GxB_NARENAS_GPU ... #define GxB_NBITMAP_SWITCH ... #define GxB_NGPUS ... #define GxB_NTHREADS ... diff --git a/suitesparse_graphblas/tests/test_memory.py b/suitesparse_graphblas/tests/test_memory.py index d5d26c3..03ef601 100644 --- a/suitesparse_graphblas/tests/test_memory.py +++ b/suitesparse_graphblas/tests/test_memory.py @@ -134,10 +134,7 @@ def roundtrips(): check_status(B, lib.GrB_Matrix_wait(B[0], lib.GrB_MATERIALIZE)) assert matrix.matrix_nvals(B) == 900 - # Another arena, using libc's allocator. The last one, since GraphBLAS means to give - # CUDA an arena of its own (the first 10.4.0 betas reserved arena 1). It needs a realloc: - # without one, GraphBLAS (10.4.0 to 10.5.1) frees the arena's memory with arena 0's - # free when it grows a buffer. + # Another arena, using libc's allocator k = lib.GxB_NARENAS - 1 import cffi