Download include/cholmod_function.h from camenduru/slahmr-test: direct link, hf CLI and curl.
- Browser
- Download file 6.64 kB
-
https://huggingface.co/camenduru/slahmr-test/resolve/main/include/cholmod_function.h
- Command line
-
hf download hf://camenduru/slahmr-test/include/cholmod_function.h
-
curl -L -o cholmod_function.h https://huggingface.co/camenduru/slahmr-test/resolve/main/include/cholmod_function.h
6.64 kB
| /* ========================================================================== */ | |
| /* === CHOLMOD/Include/cholmod_function.h ================================ */ | |
| /* ========================================================================== */ | |
| /* ----------------------------------------------------------------------------- | |
| * CHOLMOD/Include/cholmod_function.h | |
| * Copyright (C) 2014, Timothy A. Davis | |
| * This specific file (CHOLMOD/Include/cholmod_function.h) has no license | |
| * restrictions at all. You may freely include this in your applications, and | |
| * modify it at will. | |
| * -------------------------------------------------------------------------- */ | |
| /* Memory management, printing, and math function pointers were removed from | |
| the CHOLMOD Common struct as of version 2.2.0 and later. They now appear in | |
| SuiteSparse_config.h instead. This file assists in backward compatibility, | |
| so that you can use either old or new versions of CHOLMOD and SuiteSparse in | |
| an application that uses the function pointers. You can copy the file into | |
| your own application that uses older versions of CHOLMOD, or the current | |
| version, so that you have a transparent method for setting these function | |
| pointers for any version of CHOLMOD and SuiteSparse. | |
| In both old and new versions of CHOLMOD (and SuiteSparse), the intent of | |
| these function pointers is that they are not to be called directly. | |
| Instead, you should use (for example), the cholmod_malloc function. That | |
| function is a wrapper that then uses the cc->malloc_memory or | |
| SuiteSparse_config.malloc_func function pointers. | |
| In each of the macros below, 'cc' is a pointer to the CHOLMOD Common struct. | |
| Usage: to assign, say, 'malloc' as your memory allocator, use this: | |
| #include "cholmod_function.h" | |
| ... | |
| cholmod_common *cc, Common ; | |
| cc = &Common ; | |
| cholmod_start (cc) ; | |
| ... | |
| CHOLMOD_FUNCTION_DEFAULTS ; | |
| CHOLMOD_FUNCTION_MALLOC (cc) = mymalloc ; | |
| instead of this, in older versions of CHOLMOD: | |
| cc->malloc_memory = mymalloc ; | |
| or in newer versions of CHOLMOD: | |
| SuiteSparse_config.malloc_func = mymalloc ; | |
| */ | |
| /* -------------------------------------------------------------------------- */ | |
| /* location of function pointers, depending on the CHOLMOD version */ | |
| /* -------------------------------------------------------------------------- */ | |
| /* -------------------------------------------------------------------------- */ | |
| /* default math functions, depending on the CHOLMOD version */ | |
| /* -------------------------------------------------------------------------- */ | |
| /* -------------------------------------------------------------------------- */ | |
| /* default memory manager functions */ | |
| /* -------------------------------------------------------------------------- */ | |
| /* MATLAB mexFunction */ | |
| /* standard ANSI C */ | |
| /* no memory manager defined at compile time */ | |
| /* -------------------------------------------------------------------------- */ | |
| /* default printf function */ | |
| /* -------------------------------------------------------------------------- */ | |
| /* -------------------------------------------------------------------------- */ | |
| /* set all the defaults */ | |
| /* -------------------------------------------------------------------------- */ | |
| /* Use this macro to initialize all the function pointers to their defaults | |
| for any version of CHOLMOD. For CHOLMD 2.2.0 and later, it sets function | |
| pointers in the SuiteSparse_config struct. For older versions, it sets | |
| function pointers in the CHOLMOD Common. This assignment is not | |
| thread-safe, and should be done before launching any threads. */ | |