diff --git a/.github/workflows/build-arch-emu.yaml b/.github/workflows/build-arch-emu.yaml new file mode 100644 index 000000000..8011d708c --- /dev/null +++ b/.github/workflows/build-arch-emu.yaml @@ -0,0 +1,169 @@ +name: arch-emu +on: + push: + branches-ignore: + - '**/dev2' + pull_request: + +concurrency: ci-arch-emu-${{ github.ref }} + +env: + # string with name of libraries to be built + BUILD_LIBS: "SuiteSparse_config:Mongoose:AMD:BTF:CAMD:CCOLAMD:COLAMD:CHOLMOD:CSparse:CXSparse:LDL:KLU:UMFPACK:RBio:SuiteSparse_GPURuntime:GPUQREngine:SPQR:SPEX" + # string with name of libraries to be checked + CHECK_LIBS: "SuiteSparse_config:Mongoose:AMD:BTF:CAMD:CCOLAMD:COLAMD:CHOLMOD:CSparse:CXSparse:LDL:KLU:UMFPACK:RBio:SPQR:SPEX" + + +jobs: + + alpine: + runs-on: ubuntu-latest + + defaults: + run: + # Use emulated shell as default + shell: alpine.sh {0} + + strategy: + # Allow other runners in the matrix to continue if some fail + fail-fast: false + + matrix: + # For available CPU architectures, see: + # https://github.com/marketplace/actions/setup-alpine-linux-environment + arch: [x86, aarch64, armv7, ppc64le, s390x] + include: + - arch: x86 + ccache-max: 42M + - arch: aarch64 + ccache-max: 42M + - arch: armv7 + ccache-max: 42M + - arch: ppc64le + ccache-max: 45M + - arch: s390x + ccache-max: 42M + + name: alpine (${{ matrix.arch }}) + + steps: + - name: checkout repository + uses: actions/checkout@v3 + # shell: bash + + - name: install dependencies + uses: jirutka/setup-alpine@v1 + # shell: bash + with: + arch: ${{ matrix.arch }} + packages: > + build-base + ccache + cmake + gfortran + m4 + gmp-dev + mpfr-dev + openblas-dev + + - name: prepare ccache + # create key with human readable timestamp + # used in action/cache/restore and action/cache/save steps + id: ccache-prepare + run: | + echo "key=ccache:alpine:${{ matrix.arch }}:${{ github.ref }}:$(date +"%Y-%m-%d_%H-%M-%S"):${{ github.sha }}" >> $GITHUB_OUTPUT + + - name: restore ccache + # setup the GitHub cache used to maintain the ccache from one job to the next + uses: actions/cache/restore@v3 + with: + # location of the ccache of the chroot in the root file system + path: /home/runner/rootfs/alpine-latest-${{ matrix.arch }}/home/runner/.ccache + key: ${{ steps.ccache-prepare.outputs.key }} + # Prefer caches from the same branch. Fall back to caches from the dev branch. + restore-keys: | + ccache:alpine:${{ matrix.arch }}:${{ github.ref }} + ccache:alpine:${{ matrix.arch }} + + - name: configure ccache + env: + CCACHE_MAX: ${{ matrix.ccache-max }} + run: | + test -d ~/.ccache || mkdir ~/.ccache + echo "max_size = $CCACHE_MAX" >> ~/.ccache/ccache.conf + echo "compression = true" >> ~/.ccache/ccache.conf + ccache -s + which ccache + # echo "/usr/lib/ccache" >> $GITHUB_PATH + + - name: build + run: | + echo "gcc --version" + gcc --version + echo "gcc -dumpmachine" + gcc -dumpmachine + IFS=: + for lib in ${BUILD_LIBS}; do + printf " \033[0;32m==>\033[0m Building library \033[0;32m${lib}\033[0m\n" + echo "::group::Configure $lib" + cd ${GITHUB_WORKSPACE}/${lib}/build + cmake -DCMAKE_BUILD_TYPE="Release" \ + -DCMAKE_INSTALL_PREFIX="${GITHUB_WORKSPACE}" \ + -DCMAKE_C_COMPILER_LAUNCHER="ccache" \ + -DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \ + -DCMAKE_Fortran_COMPILER_LAUNCHER="ccache" \ + -DBLA_VENDOR="OpenBLAS" \ + .. + echo "::endgroup::" + echo "::group::Build $lib" + cmake --build . --config Release + echo "::endgroup::" + done + + - name: check + run: | + IFS=':' + for lib in ${CHECK_LIBS}; do + printf "::group:: \033[0;32m==>\033[0m Checking library \033[0;32m${lib}\033[0m\n" + cd ${GITHUB_WORKSPACE}/${lib} + make demos + echo "::endgroup::" + done + + - name: ccache status + continue-on-error: true + run: ccache -s + + - name: save ccache + # Save the cache after we are done (successfully) building + # This helps to retain the ccache even if the subsequent steps are failing. + uses: actions/cache/save@v3 + with: + path: /home/runner/rootfs/alpine-latest-${{ matrix.arch }}/home/runner/.ccache + key: ${{ steps.ccache-prepare.outputs.key }} + + - name: install + run: | + IFS=':' + for lib in ${BUILD_LIBS}; do + printf "::group::\033[0;32m==>\033[0m Installing library \033[0;32m${lib}\033[0m\n" + cd ${GITHUB_WORKSPACE}/${lib}/build + cmake --install . + echo "::endgroup::" + done + + - name: build example + run: | + cd ${GITHUB_WORKSPACE}/Example/build + printf "::group::\033[0;32m==>\033[0m Configuring example\n" + cmake \ + -DBLA_VENDOR="OpenBLAS" \ + .. + echo "::endgroup::" + printf "::group::\033[0;32m==>\033[0m Building example\n" + cmake --build . + echo "::endgroup::" + printf "::group::\033[0;32m==>\033[0m Executing example\n" + LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/lib ./my_demo + echo "::endgroup::" + diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index b858bacae..884ab0c27 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -22,12 +22,15 @@ jobs: # https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners runs-on: ubuntu-latest + name: ubuntu (${{ matrix.compiler }} ${{ matrix.cuda }} CUDA) + strategy: # Allow other runners in the matrix to continue if some fail fail-fast: false matrix: compiler: [gcc, clang] + cuda: [with, without] include: - compiler: gcc compiler-pkgs: "g++ gcc" @@ -42,6 +45,12 @@ jobs: ccache-max: 600M - compiler: clang ccache-max: 500M + - cuda: with + cuda-pkgs: "nvidia-cuda-dev nvidia-cuda-toolkit" + cuda-cmake-flags: + -DENABLE_CUDA=On + -DCUDAToolkit_INCLUDE_DIR="/usr/include" + -DCMAKE_CUDA_COMPILER_LAUNCHER="ccache" env: CC: ${{ matrix.cc }} @@ -54,18 +63,19 @@ jobs: - name: install dependencies env: COMPILER_PKGS: ${{ matrix.compiler-pkgs }} + CUDA_PKGS: ${{ matrix.cuda-pkgs }} run: | sudo apt -qq update sudo apt install -y ${COMPILER_PKGS} autoconf automake ccache cmake \ dvipng gfortran libgmp-dev liblapack-dev libmpfr-dev \ - libopenblas-dev + libopenblas-dev ${CUDA_PKGS} - name: prepare ccache # create key with human readable timestamp # used in action/cache/restore and action/cache/save steps id: ccache-prepare run: | - echo "key=ccache:ubuntu:${{ matrix.compiler }}:${{ github.ref }}:$(date +"%Y-%m-%d_%H-%M-%S"):${{ github.sha }}" >> $GITHUB_OUTPUT + echo "key=ccache:ubuntu:${{ matrix.compiler }}:${{ matrix.cuda }}:${{ github.ref }}:$(date +"%Y-%m-%d_%H-%M-%S"):${{ github.sha }}" >> $GITHUB_OUTPUT - name: restore ccache # setup the GitHub cache used to maintain the ccache from one job to the next @@ -75,8 +85,23 @@ jobs: key: ${{ steps.ccache-prepare.outputs.key }} # Prefer caches from the same branch. Fall back to caches from the dev branch. restore-keys: | - ccache:ubuntu:${{ matrix.compiler }}:${{ github.ref }} - ccache:ubuntu:${{ matrix.compiler }} + ccache:ubuntu:${{ matrix.compiler }}:${{ matrix.cuda }}:${{ github.ref }} + ccache:ubuntu:${{ matrix.compiler }}:${{ matrix.cuda }} + + - name: create empty libraries + # This is to work around a bug in nvlink. + # See: https://forums.developer.nvidia.com/t/nvlink-fatal-could-not-open-input-file-when-linking-with-empty-static-library/208517 + if: matrix.cuda == 'with' + run: | + touch empty.c + gcc -fPIC -c empty.c -oempty.o + ar rcsv libdl.a empty.o + ar rcsv librt.a empty.o + ar rcsv libpthread.a empty.o + # overwrite system libraries with "valid" empty libraries + sudo mv ./libdl.a /usr/lib/x86_64-linux-gnu/libdl.a + sudo mv ./librt.a /usr/lib/x86_64-linux-gnu/librt.a + sudo mv ./libpthread.a /usr/lib/x86_64-linux-gnu/libpthread.a - name: configure ccache env: @@ -101,6 +126,7 @@ jobs: -DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \ -DCMAKE_Fortran_COMPILER_LAUNCHER="ccache" \ -DBLA_VENDOR="OpenBLAS" \ + ${{ matrix.cuda-cmake-flags }} \ .. echo "::endgroup::" echo "::group::Build $lib" @@ -146,6 +172,7 @@ jobs: printf "::group::\033[0;32m==>\033[0m Configuring example\n" cmake \ -DBLA_VENDOR="OpenBLAS" \ + ${{ matrix.cuda-cmake-flags }} \ .. echo "::endgroup::" printf "::group::\033[0;32m==>\033[0m Building example\n" diff --git a/.gitignore b/.gitignore index d0d4223fd..c6499d0a8 100644 --- a/.gitignore +++ b/.gitignore @@ -168,7 +168,9 @@ SPQR/Tcov/gpu_results.txt SPQR/Tcov/gpuqrengine_demo SPQR/Tcov/qrdemo_gpu SPQR/Tcov/qrtest +SPQR/Tcov/qrtest32 SPQR/Tcov/qrtest_out.txt +SPQR/Tcov/qrtest_out32.txt SPQR/Tcov/troll.m SPQR/Tcov/cov.out diff --git a/AMD/CMakeLists.txt b/AMD/CMakeLists.txt index d640142d0..2810219e4 100644 --- a/AMD/CMakeLists.txt +++ b/AMD/CMakeLists.txt @@ -10,12 +10,12 @@ # get the version #------------------------------------------------------------------------------- -cmake_minimum_required ( VERSION 3.19 ) +cmake_minimum_required ( VERSION 3.20 ) -set ( AMD_DATE "June 16, 2023" ) +set ( AMD_DATE "Sept 8, 2023" ) set ( AMD_VERSION_MAJOR 3 ) -set ( AMD_VERSION_MINOR 0 ) -set ( AMD_VERSION_SUB 4 ) +set ( AMD_VERSION_MINOR 2 ) +set ( AMD_VERSION_SUB 0 ) message ( STATUS "Building AMD version: v" ${AMD_VERSION_MAJOR}. @@ -27,7 +27,6 @@ message ( STATUS "Building AMD version: v" #------------------------------------------------------------------------------- set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} - ${CMAKE_SOURCE_DIR}/cmake_modules ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/cmake_modules ) include ( SuiteSparsePolicy ) @@ -57,7 +56,11 @@ endif ( ) # find library dependencies #------------------------------------------------------------------------------- -find_package ( SuiteSparse_config 7.1.0 REQUIRED ) +find_package ( SuiteSparse_config 7.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH ) +if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) + find_package ( SuiteSparse_config 7.2.0 REQUIRED ) +endif ( ) #------------------------------------------------------------------------------- # configure files @@ -72,7 +75,7 @@ configure_file ( "Config/amd_version.tex.in" "${PROJECT_SOURCE_DIR}/Doc/amd_vers # include directories #------------------------------------------------------------------------------- -include_directories ( Source Include ${SUITESPARSE_CONFIG_INCLUDE_DIR} ) +include_directories ( Source Include ) #------------------------------------------------------------------------------- # dynamic amd library properties @@ -84,22 +87,27 @@ else ( ) file ( GLOB AMD_SOURCES "Source/*.c" ) endif ( ) -add_library ( amd SHARED ${AMD_SOURCES} ) -set_target_properties ( amd PROPERTIES +add_library ( AMD SHARED ${AMD_SOURCES} ) +set_target_properties ( AMD PROPERTIES VERSION ${AMD_VERSION_MAJOR}.${AMD_VERSION_MINOR}.${AMD_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON + OUTPUT_NAME amd SOVERSION ${AMD_VERSION_MAJOR} PUBLIC_HEADER "Include/amd.h" WINDOWS_EXPORT_ALL_SYMBOLS ON ) +target_include_directories ( AMD + INTERFACE $ + $ ) + #------------------------------------------------------------------------------- # static amd library properties #------------------------------------------------------------------------------- if ( NOT NSTATIC ) - add_library ( amd_static STATIC ${AMD_SOURCES} ) - set_target_properties ( amd_static PROPERTIES + add_library ( AMD_static STATIC ${AMD_SOURCES} ) + set_target_properties ( AMD_static PROPERTIES VERSION ${AMD_VERSION_MAJOR}.${AMD_VERSION_MINOR}.${AMD_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON @@ -107,26 +115,38 @@ if ( NOT NSTATIC ) SOVERSION ${AMD_VERSION_MAJOR} ) if ( MSVC ) - set_target_properties ( amd_static PROPERTIES + set_target_properties ( AMD_static PROPERTIES OUTPUT_NAME amd_static ) endif ( ) + + target_include_directories ( AMD_static + INTERFACE $ + $ ) + endif ( ) #------------------------------------------------------------------------------- # add the library dependencies #------------------------------------------------------------------------------- -# suitesparseconfig: -target_link_libraries ( amd PRIVATE ${SUITESPARSE_CONFIG_LIBRARIES} ) +# SuiteSparseConfig: +target_link_libraries ( AMD PRIVATE SuiteSparse::SuiteSparseConfig ) +target_include_directories ( AMD PUBLIC + "$" ) if ( NOT NSTATIC ) - target_link_libraries ( amd_static PUBLIC ${SUITESPARSE_CONFIG_STATIC} ) + if ( TARGET SuiteSparse::SuiteSparseConfig_static ) + target_link_libraries ( AMD_static PUBLIC SuiteSparse::SuiteSparseConfig_static ) + else ( ) + target_link_libraries ( AMD_static PUBLIC SuiteSparse::SuiteSparseConfig ) + endif ( ) endif ( ) # libm: if ( NOT WIN32 ) - target_link_libraries ( amd PRIVATE m ) + target_link_libraries ( AMD PRIVATE m ) if ( NOT NSTATIC ) - target_link_libraries ( amd_static PUBLIC m ) + set ( AMD_STATIC_LIBS "${AMD_STATIC_LIBS} -lm" ) + target_link_libraries ( AMD_static PUBLIC m ) endif ( ) endif ( ) @@ -134,19 +154,73 @@ endif ( ) # AMD installation location #------------------------------------------------------------------------------- -install ( TARGETS amd +include ( CMakePackageConfigHelpers ) + +install ( TARGETS AMD + EXPORT AMDTargets LIBRARY DESTINATION ${SUITESPARSE_LIBDIR} ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} RUNTIME DESTINATION ${SUITESPARSE_BINDIR} PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} ) -install ( FILES ${CMAKE_SOURCE_DIR}/cmake_modules/FindAMD.cmake - DESTINATION ${SUITESPARSE_LIBDIR}/cmake/SuiteSparse - COMPONENT Development ) if ( NOT NSTATIC ) - install ( TARGETS amd_static + install ( TARGETS AMD_static + EXPORT AMDTargets ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} ) endif ( ) +# create (temporary) export target file during build +export ( EXPORT AMDTargets + NAMESPACE SuiteSparse:: + FILE ${CMAKE_CURRENT_BINARY_DIR}/AMDTargets.cmake ) + +# install export target, config and version files for find_package +install ( EXPORT AMDTargets + NAMESPACE SuiteSparse:: + DESTINATION ${SUITESPARSE_LIBDIR}/cmake/AMD ) + +configure_package_config_file ( + Config/AMDConfig.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/AMDConfig.cmake + INSTALL_DESTINATION ${SUITESPARSE_LIBDIR}/cmake/AMD ) + +write_basic_package_version_file ( + ${CMAKE_CURRENT_BINARY_DIR}/AMDConfigVersion.cmake + COMPATIBILITY SameMajorVersion ) + +install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/AMDConfig.cmake + ${CMAKE_CURRENT_BINARY_DIR}/AMDConfigVersion.cmake + DESTINATION ${SUITESPARSE_LIBDIR}/cmake/AMD ) + +#------------------------------------------------------------------------------- +# create pkg-config file +#------------------------------------------------------------------------------- + +if ( NOT MSVC ) + set ( prefix "${CMAKE_INSTALL_PREFIX}" ) + set ( exec_prefix "\${prefix}" ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) + if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) + set ( libdir "${SUITESPARSE_LIBDIR}") + else ( ) + set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") + endif ( ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) + if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) + set ( includedir "${SUITESPARSE_INCLUDEDIR}") + else ( ) + set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + endif ( ) + configure_file ( + Config/AMD.pc.in + AMD.pc + @ONLY + NEWLINE_STYLE LF ) + install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/AMD.pc + DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) +endif ( ) + #------------------------------------------------------------------------------- # Demo library and programs #------------------------------------------------------------------------------- @@ -174,13 +248,13 @@ if ( DEMO ) endif ( ) # Libraries required for Demo programs - target_link_libraries ( amd_demo PUBLIC amd ) - target_link_libraries ( amd_l_demo PUBLIC amd ) - target_link_libraries ( amd_demo2 PUBLIC amd ) - target_link_libraries ( amd_simple PUBLIC amd ) + target_link_libraries ( amd_demo PUBLIC AMD ) + target_link_libraries ( amd_l_demo PUBLIC AMD ) + target_link_libraries ( amd_demo2 PUBLIC AMD ) + target_link_libraries ( amd_simple PUBLIC AMD ) if ( NOT NFORTRAN ) - target_link_libraries ( amd_f77demo PUBLIC amd ) - target_link_libraries ( amd_f77simple PUBLIC amd ) + target_link_libraries ( amd_f77demo PUBLIC AMD ) + target_link_libraries ( amd_f77simple PUBLIC AMD ) endif ( ) else ( ) diff --git a/AMD/Config/AMD.pc.in b/AMD/Config/AMD.pc.in new file mode 100644 index 000000000..33f3424dd --- /dev/null +++ b/AMD/Config/AMD.pc.in @@ -0,0 +1,17 @@ +# AMD, Copyright (c) 1996-2023, Timothy A. Davis. +# All Rights Reserved. +# SPDX-License-Identifier: BSD-3-Clause + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: AMD +URL: https://github.com/DrTimothyAldenDavis/SuiteSparse +Description: Routines for permuting sparse matrices prior to factorization in SuiteSparse +Version: @AMD_VERSION_MAJOR@.@AMD_VERSION_MINOR@.@AMD_VERSION_SUB@ +Requires.private: SuiteSparse_config +Libs: -L${libdir} -lamd +Libs.private: @AMD_STATIC_LIBS@ +Cflags: -I${includedir} diff --git a/AMD/Config/AMDConfig.cmake.in b/AMD/Config/AMDConfig.cmake.in new file mode 100644 index 000000000..9b26776d7 --- /dev/null +++ b/AMD/Config/AMDConfig.cmake.in @@ -0,0 +1,121 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/AMD/cmake_modules/AMDConfig.cmake +#------------------------------------------------------------------------------- + +# The following copyright and license applies to just this file only, not to +# the library itself: +# AMDConfig.cmake, Copyright (c) 2023, Timothy A. Davis. All Rights Reserved. +# SPDX-License-Identifier: BSD-3-clause + +#------------------------------------------------------------------------------- + +# Finds the AMD include file and compiled library. +# The following targets are defined: +# SuiteSparse::AMD - for the shared library (if available) +# SuiteSparse::AMD_static - for the static library (if available) + +# For backward compatibility the following variables are set: + +# AMD_INCLUDE_DIR - where to find amd.h +# AMD_LIBRARY - dynamic AMD library +# AMD_STATIC - static AMD library +# AMD_LIBRARIES - libraries when using AMD +# AMD_FOUND - true if AMD found + +# Set ``CMAKE_MODULE_PATH`` to the parent folder where this module file is +# installed. + +#------------------------------------------------------------------------------- + +@PACKAGE_INIT@ + +set ( AMD_DATE "@AMD_DATE@" ) +set ( AMD_VERSION_MAJOR @AMD_VERSION_MAJOR@ ) +set ( AMD_VERSION_MINOR @AMD_VERSION_MINOR@ ) +set ( AMD_VERSION_PATCH @AMD_VERSION_SUB@ ) +set ( AMD_VERSION "@AMD_VERSION_MAJOR@.@AMD_VERSION_MINOR@.@AMD_VERSION_SUB@" ) + +include ( ${CMAKE_CURRENT_LIST_DIR}/AMDTargets.cmake ) + +# The following is only for backward compatibility with FindAMD. + +set ( _target_shared SuiteSparse::AMD ) +set ( _target_static SuiteSparse::AMD_static ) +set ( _var_prefix "AMD" ) + +get_target_property ( ${_var_prefix}_INCLUDE_DIR ${_target_shared} INTERFACE_INCLUDE_DIRECTORIES ) +if ( ${_var_prefix}_INCLUDE_DIR ) + # First item in SuiteSparse targets contains the "main" header directory. + list ( GET ${_var_prefix}_INCLUDE_DIR 0 ${_var_prefix}_INCLUDE_DIR ) +endif ( ) +get_target_property ( ${_var_prefix}_LIBRARY ${_target_shared} IMPORTED_IMPLIB ) +if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} IMPORTED_LOCATION ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) +endif ( ) +if ( TARGET ${_target_static} ) + get_target_property ( ${_var_prefix}_STATIC ${_target_static} IMPORTED_LOCATION ) +endif ( ) + +# Check for most common build types +set ( _config_types "Debug" "Release" "RelWithDebInfo" "MinSizeRel" ) + +get_property ( _isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG ) +if ( _isMultiConfig ) + # For multi-configuration generators (e.g., Visual Studio), prefer those + # configurations. + list ( PREPEND _config_types ${CMAKE_CONFIGURATION_TYPES} ) +else ( ) + # For single-configuration generators, prefer the current configuration. + list ( PREPEND _config_types ${CMAKE_BUILD_TYPE} ) +endif ( ) + +list ( REMOVE_DUPLICATES _config_types ) + +foreach ( _config ${_config_types} ) + string ( TOUPPER ${_config} _uc_config ) + if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} + IMPORTED_IMPLIB_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) + endif ( ) + if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} + IMPORTED_LOCATION_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) + endif ( ) + if ( TARGET ${_target_static} AND NOT ${_var_prefix}_STATIC ) + get_target_property ( _library_chk ${_target_static} + IMPORTED_LOCATION_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_STATIC ${_library_chk} ) + endif ( ) + endif ( ) +endforeach ( ) + +set ( AMD_LIBRARIES ${AMD_LIBRARY} ) + +macro ( suitesparse_check_exist _var _files ) + # ignore generator expressions + string ( GENEX_STRIP "${_files}" _files2 ) + + foreach ( _file ${_files2} ) + if ( NOT EXISTS "${_file}" ) + message ( FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist!" ) + endif ( ) + endforeach () +endmacro ( ) + +suitesparse_check_exist ( AMD_INCLUDE_DIR ${AMD_INCLUDE_DIR} ) +suitesparse_check_exist ( AMD_LIBRARY ${AMD_LIBRARY} ) + +message ( STATUS "AMD version: ${AMD_VERSION}" ) +message ( STATUS "AMD include: ${AMD_INCLUDE_DIR}") +message ( STATUS "AMD library: ${AMD_LIBRARY}") +message ( STATUS "AMD static: ${AMD_STATIC}") diff --git a/AMD/Demo/amd_demo.out b/AMD/Demo/amd_demo.out index bae82e042..be12b7d7f 100644 --- a/AMD/Demo/amd_demo.out +++ b/AMD/Demo/amd_demo.out @@ -1,7 +1,7 @@ -AMD version 3.0.4, date: June 16, 2023 +AMD version 3.2.0, date: Sept 8, 2023 AMD demo, with the 24-by-24 Harwell/Boeing matrix, can_24: -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -115,7 +115,7 @@ Plot of input matrix pattern: 23: . . . . . . X . . . . X X . . . . . . . . . . X return value from amd_order: 0 (should be 0) -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK n, dimension of A: 24 nz, number of nonzeros in A: 160 diff --git a/AMD/Demo/amd_demo2.out b/AMD/Demo/amd_demo2.out index 06f25221a..56ab26771 100644 --- a/AMD/Demo/amd_demo2.out +++ b/AMD/Demo/amd_demo2.out @@ -1,7 +1,7 @@ AMD demo, with a jumbled version of the 24-by-24 Harwell/Boeing matrix, can_24: -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -144,7 +144,7 @@ Plot of symmetric matrix to be ordered by amd_order: 23: . . . . . . X . . . . X X . . . . . . . . . . X return value from amd_order: 1 (should be 1) -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK, but jumbled n, dimension of A: 24 nz, number of nonzeros in A: 102 diff --git a/AMD/Demo/amd_l_demo.out b/AMD/Demo/amd_l_demo.out index 6c0d3ba5b..1f932e933 100644 --- a/AMD/Demo/amd_l_demo.out +++ b/AMD/Demo/amd_l_demo.out @@ -1,7 +1,7 @@ -AMD version 3.0.4, date: June 16, 2023 +AMD version 3.2.0, date: Sept 8, 2023 AMD demo, with the 24-by-24 Harwell/Boeing matrix, can_24: -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -115,7 +115,7 @@ Plot of input matrix pattern: 23: . . . . . . X . . . . X X . . . . . . . . . . X return value from amd_l_order: 0 (should be 0) -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK n, dimension of A: 24 nz, number of nonzeros in A: 160 diff --git a/AMD/Doc/AMD_UserGuide.pdf b/AMD/Doc/AMD_UserGuide.pdf index e1c12a9e0..9d856f65a 100644 Binary files a/AMD/Doc/AMD_UserGuide.pdf and b/AMD/Doc/AMD_UserGuide.pdf differ diff --git a/AMD/Doc/ChangeLog b/AMD/Doc/ChangeLog index 5fe1f1496..674f848c0 100644 --- a/AMD/Doc/ChangeLog +++ b/AMD/Doc/ChangeLog @@ -1,3 +1,7 @@ +Sept 8, 2023: version 3.2.0 + + * cmake updates: SuiteSparse:: namespace by Markus Muetzel + June 16, 2023: version 3.0.4 * cmake build system updates: update by Markus Muetzel diff --git a/AMD/Doc/amd_version.tex b/AMD/Doc/amd_version.tex index c791314c8..28ac136e7 100644 --- a/AMD/Doc/amd_version.tex +++ b/AMD/Doc/amd_version.tex @@ -1,2 +1,2 @@ % version of SuiteSparse/AMD -\date{VERSION 3.0.4, June 16, 2023} +\date{VERSION 3.2.0, Sept 8, 2023} diff --git a/AMD/Include/amd.h b/AMD/Include/amd.h index c189ccd0a..b47ea7b71 100644 --- a/AMD/Include/amd.h +++ b/AMD/Include/amd.h @@ -374,10 +374,10 @@ void amd_l_info (double Info [ ]) ; * Versions 1.1 and earlier of AMD do not include a #define'd version number. */ -#define AMD_DATE "June 16, 2023" +#define AMD_DATE "Sept 8, 2023" #define AMD_MAIN_VERSION 3 -#define AMD_SUB_VERSION 0 -#define AMD_SUBSUB_VERSION 4 +#define AMD_SUB_VERSION 2 +#define AMD_SUBSUB_VERSION 0 #define AMD_VERSION_CODE(main,sub) ((main) * 1000 + (sub)) #define AMD_VERSION AMD_VERSION_CODE(AMD_MAIN_VERSION,AMD_SUB_VERSION) diff --git a/AMD/cmake_modules/FindAMD.cmake b/AMD/cmake_modules/FindAMD.cmake deleted file mode 100644 index 32554bb2a..000000000 --- a/AMD/cmake_modules/FindAMD.cmake +++ /dev/null @@ -1,129 +0,0 @@ -#------------------------------------------------------------------------------- -# SuiteSparse/AMD/cmake_modules/FindAMD.cmake -#------------------------------------------------------------------------------- - -# The following copyright and license applies to just this file only, not to -# the library itself: -# FindAMD.cmake, Copyright (c) 2022-2023, Timothy A. Davis. All Rights Reserved. -# SPDX-License-Identifier: BSD-3-clause - -#------------------------------------------------------------------------------- - -# Finds the AMD include file and compiled library and sets: - -# AMD_INCLUDE_DIR - where to find amd.h -# AMD_LIBRARY - dynamic AMD library -# AMD_STATIC - static AMD library -# AMD_LIBRARIES - libraries when using AMD -# AMD_FOUND - true if AMD found - -# set ``AMD_ROOT`` to an AMD installation root to -# tell this module where to look. - -# All the Find*.cmake files in SuiteSparse are installed by 'make install' into -# /usr/local/lib/cmake/SuiteSparse (where '/usr/local' is the -# ${CMAKE_INSTALL_PREFIX}). To access this file, place the following commands -# in your CMakeLists.txt file. See also SuiteSparse/Example/CMakeLists.txt: -# -# set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} -# ${CMAKE_INSTALL_PREFIX}/lib/cmake/SuiteSparse ) - -#------------------------------------------------------------------------------- - -# include files for AMD -find_path ( AMD_INCLUDE_DIR - NAMES amd.h - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/AMD - HINTS ${CMAKE_SOURCE_DIR}/../AMD - PATH_SUFFIXES include Include -) - -# dynamic AMD library (or static if no dynamic library was built) -find_library ( AMD_LIBRARY - NAMES amd amd_static - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/AMD - HINTS ${CMAKE_SOURCE_DIR}/../AMD - PATH_SUFFIXES lib build build/Release build/Debug -) - -if ( MSVC ) - set ( STATIC_NAME amd_static amd ) -else ( ) - set ( STATIC_NAME amd ) - set ( save ${CMAKE_FIND_LIBRARY_SUFFIXES} ) - set ( CMAKE_FIND_LIBRARY_SUFFIXES - ${CMAKE_STATIC_LIBRARY_SUFFIX} ${CMAKE_FIND_LIBRARY_SUFFIXES} ) -endif ( ) - -# static AMD library -find_library ( AMD_STATIC - NAMES ${STATIC_NAME} - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/AMD - HINTS ${CMAKE_SOURCE_DIR}/../AMD - PATH_SUFFIXES lib build build/Release build/Debug -) - -if ( NOT MSVC ) - # restore the CMAKE_FIND_LIBRARY_SUFFIXES variable - set ( CMAKE_FIND_LIBRARY_SUFFIXES ${save} ) -endif ( ) - -# get version of the library from the dynamic library name -get_filename_component ( AMD_LIBRARY ${AMD_LIBRARY} REALPATH ) -get_filename_component ( AMD_FILENAME ${AMD_LIBRARY} NAME ) -string ( - REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" - AMD_VERSION - ${AMD_FILENAME} -) - -# set ( AMD_VERSION "" ) -if ( EXISTS "${AMD_INCLUDE_DIR}" AND NOT AMD_VERSION ) - # if the version does not appear in the filename, read the include file - file ( STRINGS ${AMD_INCLUDE_DIR}/amd.h AMD_MAJOR_STR - REGEX "define AMD_MAIN_VERSION" ) - file ( STRINGS ${AMD_INCLUDE_DIR}/amd.h AMD_MINOR_STR - REGEX "define AMD_SUB_VERSION" ) - file ( STRINGS ${AMD_INCLUDE_DIR}/amd.h AMD_PATCH_STR - REGEX "define AMD_SUBSUB_VERSION" ) - message ( STATUS "major: ${AMD_MAJOR_STR}" ) - message ( STATUS "minor: ${AMD_MINOR_STR}" ) - message ( STATUS "patch: ${AMD_PATCH_STR}" ) - string ( REGEX MATCH "[0-9]+" AMD_MAJOR ${AMD_MAJOR_STR} ) - string ( REGEX MATCH "[0-9]+" AMD_MINOR ${AMD_MINOR_STR} ) - string ( REGEX MATCH "[0-9]+" AMD_PATCH ${AMD_PATCH_STR} ) - set (AMD_VERSION "${AMD_MAJOR}.${AMD_MINOR}.${AMD_PATCH}") -endif ( ) - -set ( AMD_LIBRARIES ${AMD_LIBRARY} ) - -include (FindPackageHandleStandardArgs) - -find_package_handle_standard_args ( AMD - REQUIRED_VARS AMD_LIBRARY AMD_INCLUDE_DIR - VERSION_VAR AMD_VERSION -) - -mark_as_advanced ( - AMD_INCLUDE_DIR - AMD_LIBRARY - AMD_STATIC - AMD_LIBRARIES -) - -if ( AMD_FOUND ) - message ( STATUS "AMD version: ${AMD_VERSION}" ) - message ( STATUS "AMD include: ${AMD_INCLUDE_DIR}") - message ( STATUS "AMD library: ${AMD_LIBRARY}") - message ( STATUS "AMD static: ${AMD_STATIC}") -else ( ) - message ( STATUS "AMD not found" ) - set ( AMD_INCLUDE_DIR "" ) - set ( AMD_LIBRARIES "" ) - set ( AMD_LIBRARY "" ) - set ( AMD_STATIC "" ) -endif ( ) - diff --git a/BTF/CMakeLists.txt b/BTF/CMakeLists.txt index 89a30ddba..cd0d212fa 100644 --- a/BTF/CMakeLists.txt +++ b/BTF/CMakeLists.txt @@ -10,12 +10,12 @@ # get the version #------------------------------------------------------------------------------- -cmake_minimum_required ( VERSION 3.19 ) +cmake_minimum_required ( VERSION 3.20 ) -set ( BTF_DATE "June 16, 2023" ) +set ( BTF_DATE "Sept 8, 2023" ) set ( BTF_VERSION_MAJOR 2 ) -set ( BTF_VERSION_MINOR 0 ) -set ( BTF_VERSION_SUB 4 ) +set ( BTF_VERSION_MINOR 2 ) +set ( BTF_VERSION_SUB 0 ) message ( STATUS "Building BTF version: v" ${BTF_VERSION_MAJOR}. @@ -27,7 +27,6 @@ message ( STATUS "Building BTF version: v" #------------------------------------------------------------------------------- set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} - ${CMAKE_SOURCE_DIR}/cmake_modules ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/cmake_modules ) include ( SuiteSparsePolicy ) @@ -44,7 +43,11 @@ project ( btf # find library dependencies #------------------------------------------------------------------------------- -find_package ( SuiteSparse_config 7.1.0 REQUIRED ) +find_package ( SuiteSparse_config 7.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH ) +if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) + find_package ( SuiteSparse_config 7.2.0 REQUIRED ) +endif ( ) #------------------------------------------------------------------------------- # configure files @@ -57,7 +60,7 @@ configure_file ( "Config/btf.h.in" "${PROJECT_SOURCE_DIR}/Include/btf.h" # include directories #------------------------------------------------------------------------------- -include_directories ( Source Include ${SUITESPARSE_CONFIG_INCLUDE_DIR} ) +include_directories ( Source Include ) #------------------------------------------------------------------------------- # dynamic btf library properties @@ -65,24 +68,29 @@ include_directories ( Source Include ${SUITESPARSE_CONFIG_INCLUDE_DIR} ) file ( GLOB BTF_SOURCES "Source/*.c" ) -add_library ( btf SHARED ${BTF_SOURCES} ) +add_library ( BTF SHARED ${BTF_SOURCES} ) -set_target_properties ( btf PROPERTIES +set_target_properties ( BTF PROPERTIES VERSION ${BTF_VERSION_MAJOR}.${BTF_VERSION_MINOR}.${BTF_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON + OUTPUT_NAME btf SOVERSION ${BTF_VERSION_MAJOR} PUBLIC_HEADER "Include/btf.h" WINDOWS_EXPORT_ALL_SYMBOLS ON) +target_include_directories ( BTF + INTERFACE $ + $ ) + #------------------------------------------------------------------------------- # static btf library properties #------------------------------------------------------------------------------- if ( NOT NSTATIC ) - add_library ( btf_static STATIC ${BTF_SOURCES} ) + add_library ( BTF_static STATIC ${BTF_SOURCES} ) - set_target_properties ( btf_static PROPERTIES + set_target_properties ( BTF_static PROPERTIES VERSION ${BTF_VERSION_MAJOR}.${BTF_VERSION_MINOR}.${BTF_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON @@ -90,26 +98,38 @@ if ( NOT NSTATIC ) SOVERSION ${BTF_VERSION_MAJOR} ) if ( MSVC ) - set_target_properties ( btf_static PROPERTIES + set_target_properties ( BTF_static PROPERTIES OUTPUT_NAME btf_static ) endif ( ) + + target_include_directories ( BTF_static + INTERFACE $ + $ ) + endif ( ) #------------------------------------------------------------------------------- # add the library dependencies #------------------------------------------------------------------------------- -# suitesparseconfig: -target_link_libraries ( btf PRIVATE ${SUITESPARSE_CONFIG_LIBRARIES} ) +# SuiteSparseConfig: +target_link_libraries ( BTF PRIVATE SuiteSparse::SuiteSparseConfig ) +target_include_directories ( BTF PUBLIC + "$" ) if ( NOT NSTATIC ) - target_link_libraries ( btf_static PUBLIC ${SUITESPARSE_CONFIG_STATIC} ) + if ( TARGET SuiteSparse::SuiteSparseConfig_static ) + target_link_libraries ( BTF_static PUBLIC SuiteSparse::SuiteSparseConfig_static ) + else ( ) + target_link_libraries ( BTF_static PUBLIC SuiteSparse::SuiteSparseConfig ) + endif ( ) endif ( ) # libm: if ( NOT WIN32 ) - target_link_libraries ( btf PRIVATE m ) + target_link_libraries ( BTF PRIVATE m ) if ( NOT NSTATIC ) - target_link_libraries ( btf_static PUBLIC m ) + set ( BTF_STATIC_LIBS "${BTF_STATIC_LIBS} -lm" ) + target_link_libraries ( BTF_static PUBLIC m ) endif ( ) endif ( ) @@ -117,19 +137,73 @@ endif ( ) # BTF installation location #------------------------------------------------------------------------------- -install ( TARGETS btf +include ( CMakePackageConfigHelpers ) + +install ( TARGETS BTF + EXPORT BTFTargets LIBRARY DESTINATION ${SUITESPARSE_LIBDIR} ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} RUNTIME DESTINATION ${SUITESPARSE_BINDIR} PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} ) -install ( FILES ${CMAKE_SOURCE_DIR}/cmake_modules/FindBTF.cmake - DESTINATION ${SUITESPARSE_LIBDIR}/cmake/SuiteSparse - COMPONENT Development ) if ( NOT NSTATIC ) - install ( TARGETS btf_static + install ( TARGETS BTF_static + EXPORT BTFTargets ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} ) endif ( ) +# create (temporary) export target file during build +export ( EXPORT BTFTargets + NAMESPACE SuiteSparse:: + FILE ${CMAKE_CURRENT_BINARY_DIR}/BTFTargets.cmake ) + +# install export target, config and version files for find_package +install ( EXPORT BTFTargets + NAMESPACE SuiteSparse:: + DESTINATION ${SUITESPARSE_LIBDIR}/cmake/BTF ) + +configure_package_config_file ( + Config/BTFConfig.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/BTFConfig.cmake + INSTALL_DESTINATION ${SUITESPARSE_LIBDIR}/cmake/BTF ) + +write_basic_package_version_file ( + ${CMAKE_CURRENT_BINARY_DIR}/BTFConfigVersion.cmake + COMPATIBILITY SameMajorVersion ) + +install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/BTFConfig.cmake + ${CMAKE_CURRENT_BINARY_DIR}/BTFConfigVersion.cmake + DESTINATION ${SUITESPARSE_LIBDIR}/cmake/BTF ) + +#------------------------------------------------------------------------------- +# create pkg-config file +#------------------------------------------------------------------------------- + +if ( NOT MSVC ) + set ( prefix "${CMAKE_INSTALL_PREFIX}" ) + set ( exec_prefix "\${prefix}" ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) + if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) + set ( libdir "${SUITESPARSE_LIBDIR}") + else ( ) + set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") + endif ( ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) + if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) + set ( includedir "${SUITESPARSE_INCLUDEDIR}") + else ( ) + set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + endif ( ) + configure_file ( + Config/BTF.pc.in + BTF.pc + @ONLY + NEWLINE_STYLE LF ) + install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/BTF.pc + DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) +endif ( ) + #------------------------------------------------------------------------------- # report status #------------------------------------------------------------------------------- diff --git a/BTF/Config/BTF.pc.in b/BTF/Config/BTF.pc.in new file mode 100644 index 000000000..104334f04 --- /dev/null +++ b/BTF/Config/BTF.pc.in @@ -0,0 +1,17 @@ +# BTF, Copyright (c) 2004-2023, Timothy A. Davis. +# All Rights Reserved. +# SPDX-License-Identifier: LGPL-2.1-or-later + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: BTF +URL: https://github.com/DrTimothyAldenDavis/SuiteSparse +Description: Software package for permuting a matrix into block upper triangular form in SuiteSparse +Version: @BTF_VERSION_MAJOR@.@BTF_VERSION_MINOR@.@BTF_VERSION_SUB@ +Requires.private: SuiteSparse_config +Libs: -L${libdir} -lbtf +Libs.private: @BTF_STATIC_LIBS@ +Cflags: -I${includedir} diff --git a/BTF/Config/BTFConfig.cmake.in b/BTF/Config/BTFConfig.cmake.in new file mode 100644 index 000000000..26f707e14 --- /dev/null +++ b/BTF/Config/BTFConfig.cmake.in @@ -0,0 +1,121 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/BTF/cmake_modules/BTFConfig.cmake +#------------------------------------------------------------------------------- + +# The following copyright and license applies to just this file only, not to +# the library itself: +# BTFConfig.cmake, Copyright (c) 2023, Timothy A. Davis. All Rights Reserved. +# SPDX-License-Identifier: BSD-3-clause + +#------------------------------------------------------------------------------- + +# Finds the BTF include file and compiled library. +# The following targets are defined: +# SuiteSparse::BTF - for the shared library (if available) +# SuiteSparse::BTF_static - for the static library (if available) + +# For backward compatibility the following variables are set: + +# BTF_INCLUDE_DIR - where to find btf.h +# BTF_LIBRARY - dynamic BTF library +# BTF_STATIC - static BTF library +# BTF_LIBRARIES - libraries when using BTF +# BTF_FOUND - true if BTF found + +# Set ``CMAKE_MODULE_PATH`` to the parent folder where this module file is +# installed. + +#------------------------------------------------------------------------------- + +@PACKAGE_INIT@ + +set ( BTF_DATE "@BTF_DATE@" ) +set ( BTF_VERSION_MAJOR @BTF_VERSION_MAJOR@ ) +set ( BTF_VERSION_MINOR @BTF_VERSION_MINOR@ ) +set ( BTF_VERSION_SUB @BTF_VERSION_SUB@ ) +set ( BTF_VERSION "@BTF_VERSION_MAJOR@.@BTF_VERSION_MINOR@.@BTF_VERSION_SUB@" ) + +include ( ${CMAKE_CURRENT_LIST_DIR}/BTFTargets.cmake ) + +# The following is only for backward compatibility with FindBTF. + +set ( _target_shared SuiteSparse::BTF ) +set ( _target_static SuiteSparse::BTF_static ) +set ( _var_prefix "BTF" ) + +get_target_property ( ${_var_prefix}_INCLUDE_DIR ${_target_shared} INTERFACE_INCLUDE_DIRECTORIES ) +if ( ${_var_prefix}_INCLUDE_DIR ) + # First item in SuiteSparse targets contains the "main" header directory. + list ( GET ${_var_prefix}_INCLUDE_DIR 0 ${_var_prefix}_INCLUDE_DIR ) +endif ( ) +get_target_property ( ${_var_prefix}_LIBRARY ${_target_shared} IMPORTED_IMPLIB ) +if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} IMPORTED_LOCATION ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) +endif ( ) +if ( TARGET ${_target_static} ) + get_target_property ( ${_var_prefix}_STATIC ${_target_static} IMPORTED_LOCATION ) +endif ( ) + +# Check for most common build types +set ( _config_types "Debug" "Release" "RelWithDebInfo" "MinSizeRel" ) + +get_property ( _isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG ) +if ( _isMultiConfig ) + # For multi-configuration generators (e.g., Visual Studio), prefer those + # configurations. + list ( PREPEND _config_types ${CMAKE_CONFIGURATION_TYPES} ) +else ( ) + # For single-configuration generators, prefer the current configuration. + list ( PREPEND _config_types ${CMAKE_BUILD_TYPE} ) +endif ( ) + +list ( REMOVE_DUPLICATES _config_types ) + +foreach ( _config ${_config_types} ) + string ( TOUPPER ${_config} _uc_config ) + if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} + IMPORTED_IMPLIB_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) + endif ( ) + if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} + IMPORTED_LOCATION_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) + endif ( ) + if ( TARGET ${_target_static} AND NOT ${_var_prefix}_STATIC ) + get_target_property ( _library_chk ${_target_static} + IMPORTED_LOCATION_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_STATIC ${_library_chk} ) + endif ( ) + endif ( ) +endforeach ( ) + +set ( BTF_LIBRARIES ${BTF_LIBRARY} ) + +macro ( suitesparse_check_exist _var _files ) + # ignore generator expressions + string ( GENEX_STRIP "${_files}" _files2 ) + + foreach ( _file ${_files2} ) + if ( NOT EXISTS "${_file}" ) + message ( FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist!" ) + endif ( ) + endforeach () +endmacro ( ) + +suitesparse_check_exist ( BTF_INCLUDE_DIR ${BTF_INCLUDE_DIR} ) +suitesparse_check_exist ( BTF_LIBRARY ${BTF_LIBRARY} ) + +message ( STATUS "BTF version: ${BTF_VERSION}" ) +message ( STATUS "BTF include: ${BTF_INCLUDE_DIR}" ) +message ( STATUS "BTF library: ${BTF_LIBRARY}" ) +message ( STATUS "BTF static: ${BTF_STATIC}" ) diff --git a/BTF/Doc/ChangeLog b/BTF/Doc/ChangeLog index 90751386a..37d774e38 100644 --- a/BTF/Doc/ChangeLog +++ b/BTF/Doc/ChangeLog @@ -1,3 +1,7 @@ +Sept 8, 2023: version 2.2.0 + + * cmake updates: SuiteSparse:: namespace by Markus Muetzel + June 16, 2023: version 2.0.4 * cmake build system updates: update by Markus Muetzel diff --git a/BTF/Include/btf.h b/BTF/Include/btf.h index b37afd8e3..a0b3ca98e 100644 --- a/BTF/Include/btf.h +++ b/BTF/Include/btf.h @@ -254,10 +254,10 @@ int64_t btf_l_order (int64_t, int64_t *, int64_t *, double , double *, * #endif */ -#define BTF_DATE "June 16, 2023" +#define BTF_DATE "Sept 8, 2023" #define BTF_MAIN_VERSION 2 -#define BTF_SUB_VERSION 0 -#define BTF_SUBSUB_VERSION 4 +#define BTF_SUB_VERSION 2 +#define BTF_SUBSUB_VERSION 0 #define BTF_VERSION_CODE(main,sub) ((main) * 1000 + (sub)) #define BTF_VERSION BTF_VERSION_CODE(BTF_MAIN_VERSION,BTF_SUB_VERSION) diff --git a/BTF/cmake_modules/FindBTF.cmake b/BTF/cmake_modules/FindBTF.cmake deleted file mode 100644 index a0c8ca3ae..000000000 --- a/BTF/cmake_modules/FindBTF.cmake +++ /dev/null @@ -1,129 +0,0 @@ -#------------------------------------------------------------------------------- -# SuiteSparse/BTF/cmake_modules/FindBTF.cmake -#------------------------------------------------------------------------------- - -# The following copyright and license applies to just this file only, not to -# the library itself: -# FindBTF.cmake, Copyright (c) 2022-2023, Timothy A. Davis. All Rights Reserved. -# SPDX-License-Identifier: BSD-3-clause - -#------------------------------------------------------------------------------- - -# Finds the BTF include file and compiled library and sets: - -# BTF_INCLUDE_DIR - where to find btf.h -# BTF_LIBRARY - dynamic BTF library -# BTF_STATIC - static BTF library -# BTF_LIBRARIES - libraries when using BTF -# BTF_FOUND - true if BTF found - -# set ``BTF_ROOT`` to a BTF installation root to -# tell this module where to look. - -# All the Find*.cmake files in SuiteSparse are installed by 'make install' into -# /usr/local/lib/cmake/SuiteSparse (where '/usr/local' is the -# ${CMAKE_INSTALL_PREFIX}). To access this file, place the following commands -# in your CMakeLists.txt file. See also SuiteSparse/Example/CMakeLists.txt: -# -# set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} -# ${CMAKE_INSTALL_PREFIX}/lib/cmake/SuiteSparse ) - -#------------------------------------------------------------------------------- - -# include files for BTF -find_path ( BTF_INCLUDE_DIR - NAMES btf.h - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/BTF - HINTS ${CMAKE_SOURCE_DIR}/../BTF - PATH_SUFFIXES include Include -) - -# dynamic BTF library (or static if no dynamic library was built) -find_library ( BTF_LIBRARY - NAMES btf btf_static - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/BTF - HINTS ${CMAKE_SOURCE_DIR}/../BTF - PATH_SUFFIXES lib build build/Release build/Debug -) - -if ( MSVC ) - set ( STATIC_NAME btf_static btf ) -else ( ) - set ( STATIC_NAME btf ) - set ( save ${CMAKE_FIND_LIBRARY_SUFFIXES} ) - set ( CMAKE_FIND_LIBRARY_SUFFIXES - ${CMAKE_STATIC_LIBRARY_SUFFIX} ${CMAKE_FIND_LIBRARY_SUFFIXES} ) -endif ( ) - -# static BTF library -find_library ( BTF_STATIC - NAMES ${STATIC_NAME} - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/BTF - HINTS ${CMAKE_SOURCE_DIR}/../BTF - PATH_SUFFIXES lib build build/Release build/Debug -) - -if ( NOT MSVC ) - # restore the CMAKE_FIND_LIBRARY_SUFFIXES variable - set ( CMAKE_FIND_LIBRARY_SUFFIXES ${save} ) -endif ( ) - -# get version of the library from the dynamic library name -get_filename_component ( BTF_LIBRARY ${BTF_LIBRARY} REALPATH ) -get_filename_component ( BTF_FILENAME ${BTF_LIBRARY} NAME ) -string ( - REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" - BTF_VERSION - ${BTF_FILENAME} -) - -# set ( BTF_VERSION "" ) -if ( EXISTS "${BTF_INCLUDE_DIR}" AND NOT BTF_VERSION ) - # if the version does not appear in the filename, read the include file - file ( STRINGS ${BTF_INCLUDE_DIR}/btf.h BTF_MAJOR_STR - REGEX "define BTF_MAIN_VERSION" ) - file ( STRINGS ${BTF_INCLUDE_DIR}/btf.h BTF_MINOR_STR - REGEX "define BTF_SUB_VERSION" ) - file ( STRINGS ${BTF_INCLUDE_DIR}/btf.h BTF_PATCH_STR - REGEX "define BTF_SUBSUB_VERSION" ) - message ( STATUS "major: ${BTF_MAJOR_STR}" ) - message ( STATUS "minor: ${BTF_MINOR_STR}" ) - message ( STATUS "patch: ${BTF_PATCH_STR}" ) - string ( REGEX MATCH "[0-9]+" BTF_MAJOR ${BTF_MAJOR_STR} ) - string ( REGEX MATCH "[0-9]+" BTF_MINOR ${BTF_MINOR_STR} ) - string ( REGEX MATCH "[0-9]+" BTF_PATCH ${BTF_PATCH_STR} ) - set (BTF_VERSION "${BTF_MAJOR}.${BTF_MINOR}.${BTF_PATCH}") -endif ( ) - -set ( BTF_LIBRARIES ${BTF_LIBRARY} ) - -include (FindPackageHandleStandardArgs) - -find_package_handle_standard_args ( BTF - REQUIRED_VARS BTF_LIBRARY BTF_INCLUDE_DIR - VERSION_VAR BTF_VERSION -) - -mark_as_advanced ( - BTF_INCLUDE_DIR - BTF_LIBRARY - BTF_STATIC - BTF_LIBRARIES -) - -if ( BTF_FOUND ) - message ( STATUS "BTF version: ${BTF_VERSION}" ) - message ( STATUS "BTF include: ${BTF_INCLUDE_DIR}" ) - message ( STATUS "BTF library: ${BTF_LIBRARY}" ) - message ( STATUS "BTF static: ${BTF_STATIC}" ) -else ( ) - message ( STATUS "BTF not found" ) - set ( BTF_INCLUDE_DIR "" ) - set ( BTF_LIBRARIES "" ) - set ( BTF_LIBRARY "" ) - set ( BTF_STATIC "" ) -endif ( ) - diff --git a/CAMD/CMakeLists.txt b/CAMD/CMakeLists.txt index 232b35100..2b7d48996 100644 --- a/CAMD/CMakeLists.txt +++ b/CAMD/CMakeLists.txt @@ -9,12 +9,12 @@ # get the version #------------------------------------------------------------------------------- -cmake_minimum_required ( VERSION 3.19 ) +cmake_minimum_required ( VERSION 3.20 ) -set ( CAMD_DATE "June 16, 2023" ) +set ( CAMD_DATE "Sept 8, 2023" ) set ( CAMD_VERSION_MAJOR 3 ) -set ( CAMD_VERSION_MINOR 0 ) -set ( CAMD_VERSION_SUB 4 ) +set ( CAMD_VERSION_MINOR 2 ) +set ( CAMD_VERSION_SUB 0 ) message ( STATUS "Building CAMD version: v" ${CAMD_VERSION_MAJOR}. @@ -26,7 +26,6 @@ message ( STATUS "Building CAMD version: v" #------------------------------------------------------------------------------- set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} - ${CMAKE_SOURCE_DIR}/cmake_modules ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/cmake_modules ) include ( SuiteSparsePolicy ) @@ -43,7 +42,11 @@ project ( camd # find library dependencies #------------------------------------------------------------------------------- -find_package ( SuiteSparse_config 7.1.0 REQUIRED ) +find_package ( SuiteSparse_config 7.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH ) +if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) + find_package ( SuiteSparse_config 7.2.0 REQUIRED ) +endif ( ) #------------------------------------------------------------------------------- # configure files @@ -60,7 +63,7 @@ configure_file ( "Config/camd_version.tex.in" # include directories #------------------------------------------------------------------------------- -include_directories ( Source Include ${SUITESPARSE_CONFIG_INCLUDE_DIR} ) +include_directories ( Source Include ) #------------------------------------------------------------------------------- # dynamic camd library properties @@ -68,24 +71,29 @@ include_directories ( Source Include ${SUITESPARSE_CONFIG_INCLUDE_DIR} ) file ( GLOB CAMD_SOURCES "Source/*.c" ) -add_library ( camd SHARED ${CAMD_SOURCES} ) +add_library ( CAMD SHARED ${CAMD_SOURCES} ) -set_target_properties ( camd PROPERTIES +set_target_properties ( CAMD PROPERTIES VERSION ${CAMD_VERSION_MAJOR}.${CAMD_VERSION_MINOR}.${CAMD_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON + OUTPUT_NAME camd SOVERSION ${CAMD_VERSION_MAJOR} PUBLIC_HEADER "Include/camd.h" WINDOWS_EXPORT_ALL_SYMBOLS ON ) +target_include_directories ( CAMD + INTERFACE $ + $ ) + #------------------------------------------------------------------------------- # static camd library properties #------------------------------------------------------------------------------- if ( NOT NSTATIC ) - add_library ( camd_static STATIC ${CAMD_SOURCES} ) + add_library ( CAMD_static STATIC ${CAMD_SOURCES} ) - set_target_properties ( camd_static PROPERTIES + set_target_properties ( CAMD_static PROPERTIES VERSION ${CAMD_VERSION_MAJOR}.${CAMD_VERSION_MINOR}.${CAMD_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON @@ -93,25 +101,37 @@ if ( NOT NSTATIC ) SOVERSION ${CAMD_VERSION_MAJOR} ) if ( MSVC ) - set_target_properties ( camd_static PROPERTIES + set_target_properties ( CAMD_static PROPERTIES OUTPUT_NAME camd_static ) endif ( ) + + target_include_directories ( CAMD_static + INTERFACE $ + $ ) + endif ( ) #------------------------------------------------------------------------------- # add the library dependencies #------------------------------------------------------------------------------- -target_link_libraries ( camd PRIVATE ${SUITESPARSE_CONFIG_LIBRARY} ) +target_link_libraries ( CAMD PRIVATE SuiteSparse::SuiteSparseConfig ) +target_include_directories ( CAMD PUBLIC + "$" ) if ( NOT NSTATIC ) - target_link_libraries ( camd_static PUBLIC ${SUITESPARSE_CONFIG_STATIC} ) + if ( TARGET SuiteSparse::SuiteSparseConfig_static ) + target_link_libraries ( CAMD_static PUBLIC SuiteSparse::SuiteSparseConfig_static ) + else ( ) + target_link_libraries ( CAMD_static PUBLIC SuiteSparse::SuiteSparseConfig ) + endif ( ) endif ( ) # libm: if ( NOT WIN32 ) - target_link_libraries ( camd PRIVATE m ) + target_link_libraries ( CAMD PRIVATE m ) if ( NOT NSTATIC ) - target_link_libraries ( camd_static PUBLIC m ) + set ( CAMD_STATIC_LIBS "${CAMD_STATIC_LIBS} -lm" ) + target_link_libraries ( CAMD_static PUBLIC m ) endif ( ) endif ( ) @@ -119,19 +139,73 @@ endif ( ) # CAMD installation location #------------------------------------------------------------------------------- -install ( TARGETS camd +include ( CMakePackageConfigHelpers ) + +install ( TARGETS CAMD + EXPORT CAMDTargets LIBRARY DESTINATION ${SUITESPARSE_LIBDIR} ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} RUNTIME DESTINATION ${SUITESPARSE_BINDIR} PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} ) -install ( FILES ${CMAKE_SOURCE_DIR}/cmake_modules/FindCAMD.cmake - DESTINATION ${SUITESPARSE_LIBDIR}/cmake/SuiteSparse - COMPONENT Development ) if ( NOT NSTATIC ) - install ( TARGETS camd_static + install ( TARGETS CAMD_static + EXPORT CAMDTargets ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} ) endif ( ) +# create (temporary) export target file during build +export ( EXPORT CAMDTargets + NAMESPACE SuiteSparse:: + FILE ${CMAKE_CURRENT_BINARY_DIR}/CAMDTargets.cmake ) + +# install export target, config and version files for find_package +install ( EXPORT CAMDTargets + NAMESPACE SuiteSparse:: + DESTINATION ${SUITESPARSE_LIBDIR}/cmake/CAMD ) + +configure_package_config_file ( + Config/CAMDConfig.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/CAMDConfig.cmake + INSTALL_DESTINATION ${SUITESPARSE_LIBDIR}/cmake/CAMD ) + +write_basic_package_version_file ( + ${CMAKE_CURRENT_BINARY_DIR}/CAMDConfigVersion.cmake + COMPATIBILITY SameMajorVersion ) + +install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/CAMDConfig.cmake + ${CMAKE_CURRENT_BINARY_DIR}/CAMDConfigVersion.cmake + DESTINATION ${SUITESPARSE_LIBDIR}/cmake/CAMD ) + +#------------------------------------------------------------------------------- +# create pkg-config file +#------------------------------------------------------------------------------- + +if ( NOT MSVC ) + set ( prefix "${CMAKE_INSTALL_PREFIX}" ) + set ( exec_prefix "\${prefix}" ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) + if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) + set ( libdir "${SUITESPARSE_LIBDIR}") + else ( ) + set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") + endif ( ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) + if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) + set ( includedir "${SUITESPARSE_INCLUDEDIR}") + else ( ) + set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + endif ( ) + configure_file ( + Config/CAMD.pc.in + CAMD.pc + @ONLY + NEWLINE_STYLE LF ) + install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/CAMD.pc + DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) +endif ( ) + #------------------------------------------------------------------------------- # Demo library and programs #------------------------------------------------------------------------------- @@ -155,10 +229,10 @@ if ( DEMO ) add_executable ( camd_simple "Demo/camd_simple.c" ) # Libraries required for Demo programs - target_link_libraries ( camd_demo PUBLIC camd ) - target_link_libraries ( camd_l_demo PUBLIC camd ) - target_link_libraries ( camd_demo2 PUBLIC camd ) - target_link_libraries ( camd_simple PUBLIC camd ) + target_link_libraries ( camd_demo PUBLIC CAMD ) + target_link_libraries ( camd_l_demo PUBLIC CAMD ) + target_link_libraries ( camd_demo2 PUBLIC CAMD ) + target_link_libraries ( camd_simple PUBLIC CAMD ) else ( ) diff --git a/CAMD/Config/CAMD.pc.in b/CAMD/Config/CAMD.pc.in new file mode 100644 index 000000000..0485f5720 --- /dev/null +++ b/CAMD/Config/CAMD.pc.in @@ -0,0 +1,17 @@ +# CAMD, Copyright (c) 2007-2023, Timothy A. Davis. +# All Rights Reserved. +# SPDX-License-Identifier: BSD-3-Clause + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: CAMD +URL: https://github.com/DrTimothyAldenDavis/SuiteSparse +Description: Routines for permuting sparse matrices prior to factorization in SuiteSparse +Version: @CAMD_VERSION_MAJOR@.@CAMD_VERSION_MINOR@.@CAMD_VERSION_SUB@ +Requires.private: SuiteSparse_config +Libs: -L${libdir} -lcamd +Libs.private: @CAMD_STATIC_LIBS@ +Cflags: -I${includedir} diff --git a/CAMD/Config/CAMDConfig.cmake.in b/CAMD/Config/CAMDConfig.cmake.in new file mode 100644 index 000000000..06e3d4cc9 --- /dev/null +++ b/CAMD/Config/CAMDConfig.cmake.in @@ -0,0 +1,121 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/CAMD/cmake_modules/CAMDConfig.cmake +#------------------------------------------------------------------------------- + +# The following copyright and license applies to just this file only, not to +# the library itself: +# CAMDConfig.cmake, Copyright (c) 2023, Timothy A. Davis. All Rights Reserved. +# SPDX-License-Identifier: BSD-3-clause + +#------------------------------------------------------------------------------- + +# Finds the CAMD include file and compiled library. +# The following targets are defined: +# SuiteSparse::CAMD - for the shared library (if available) +# SuiteSparse::CAMD_static - for the static library (if available) + +# For backward compatibility the following variables are set: + +# CAMD_INCLUDE_DIR - where to find camd.h +# CAMD_LIBRARY - dynamic CAMD library +# CAMD_STATIC - static CAMD library +# CAMD_LIBRARIES - libraries when using CAMD +# CAMD_FOUND - true if CAMD found + +# Set ``CMAKE_MODULE_PATH`` to the parent folder where this module file is +# installed. + +#------------------------------------------------------------------------------- + +@PACKAGE_INIT@ + +set ( CAMD_DATE "@CAMD_DATE@" ) +set ( CAMD_VERSION_MAJOR @CAMD_VERSION_MAJOR@ ) +set ( CAMD_VERSION_MINOR @CAMD_VERSION_MINOR@ ) +set ( CAMD_VERSION_PATCH @CAMD_VERSION_SUB@ ) +set ( CAMD_VERSION "@CAMD_VERSION_MAJOR@.@CAMD_VERSION_MINOR@.@CAMD_VERSION_SUB@" ) + +include ( ${CMAKE_CURRENT_LIST_DIR}/CAMDTargets.cmake ) + +# The following is only for backward compatibility with FindCAMD. + +set ( _target_shared SuiteSparse::CAMD ) +set ( _target_static SuiteSparse::CAMD_static ) +set ( _var_prefix "CAMD" ) + +get_target_property ( ${_var_prefix}_INCLUDE_DIR ${_target_shared} INTERFACE_INCLUDE_DIRECTORIES ) +if ( ${_var_prefix}_INCLUDE_DIR ) + # First item in SuiteSparse targets contains the "main" header directory. + list ( GET ${_var_prefix}_INCLUDE_DIR 0 ${_var_prefix}_INCLUDE_DIR ) +endif ( ) +get_target_property ( ${_var_prefix}_LIBRARY ${_target_shared} IMPORTED_IMPLIB ) +if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} IMPORTED_LOCATION ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) +endif ( ) +if ( TARGET ${_target_static} ) + get_target_property ( ${_var_prefix}_STATIC ${_target_static} IMPORTED_LOCATION ) +endif ( ) + +# Check for most common build types +set ( _config_types "Debug" "Release" "RelWithDebInfo" "MinSizeRel" ) + +get_property ( _isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG ) +if ( _isMultiConfig ) + # For multi-configuration generators (e.g., Visual Studio), prefer those + # configurations. + list ( PREPEND _config_types ${CMAKE_CONFIGURATION_TYPES} ) +else ( ) + # For single-configuration generators, prefer the current configuration. + list ( PREPEND _config_types ${CMAKE_BUILD_TYPE} ) +endif ( ) + +list ( REMOVE_DUPLICATES _config_types ) + +foreach ( _config ${_config_types} ) + string ( TOUPPER ${_config} _uc_config ) + if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} + IMPORTED_IMPLIB_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) + endif ( ) + if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} + IMPORTED_LOCATION_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) + endif ( ) + if ( TARGET ${_target_static} AND NOT ${_var_prefix}_STATIC ) + get_target_property ( _library_chk ${_target_static} + IMPORTED_LOCATION_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_STATIC ${_library_chk} ) + endif ( ) + endif ( ) +endforeach ( ) + +set ( AMD_LIBRARIES ${CAMD_LIBRARY} ) + +macro ( suitesparse_check_exist _var _files ) + # ignore generator expressions + string ( GENEX_STRIP "${_files}" _files2 ) + + foreach ( _file ${_files2} ) + if ( NOT EXISTS "${_file}" ) + message ( FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist!" ) + endif ( ) + endforeach () +endmacro ( ) + +suitesparse_check_exist ( CAMD_INCLUDE_DIR ${CAMD_INCLUDE_DIR} ) +suitesparse_check_exist ( CAMD_LIBRARY ${CAMD_LIBRARY} ) + +message ( STATUS "CAMD version: ${CAMD_VERSION}" ) +message ( STATUS "CAMD include: ${CAMD_INCLUDE_DIR}" ) +message ( STATUS "CAMD library: ${CAMD_LIBRARY}" ) +message ( STATUS "CAMD static: ${CAMD_STATIC}" ) diff --git a/CAMD/Demo/camd_demo.out b/CAMD/Demo/camd_demo.out index c70e7232b..4456bacbb 100644 --- a/CAMD/Demo/camd_demo.out +++ b/CAMD/Demo/camd_demo.out @@ -1,7 +1,7 @@ -CAMD version 3.0, date: June 16, 2023 +CAMD version 3.2, date: Sept 8, 2023 CAMD demo, with the 24-by-24 Harwell/Boeing matrix, can_24: -camd version 3.0.4, June 16, 2023: approximate minimum degree ordering: +camd version 3.2.0, Sept 8, 2023: approximate minimum degree ordering: dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -115,7 +115,7 @@ Plot of input matrix pattern: 23: . . . . . . X . . . . X X . . . . . . . . . . X return value from camd_order: 0 (should be 0) -CAMD version 3.0.4, June 16, 2023, results: +CAMD version 3.2.0, Sept 8, 2023, results: status: OK n, dimension of A: 24 nz, number of nonzeros in A: 160 diff --git a/CAMD/Demo/camd_demo2.out b/CAMD/Demo/camd_demo2.out index 7e16dbf3b..1bdfb7151 100644 --- a/CAMD/Demo/camd_demo2.out +++ b/CAMD/Demo/camd_demo2.out @@ -1,7 +1,7 @@ CAMD demo, with a jumbled version of the 24-by-24 Harwell/Boeing matrix, can_24: -camd version 3.0.4, June 16, 2023: approximate minimum degree ordering: +camd version 3.2.0, Sept 8, 2023: approximate minimum degree ordering: dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -144,7 +144,7 @@ Plot of symmetric matrix to be ordered by camd_order: 23: . . . . . . X . . . . X X . . . . . . . . . . X return value from camd_order: 1 (should be 1) -CAMD version 3.0.4, June 16, 2023, results: +CAMD version 3.2.0, Sept 8, 2023, results: status: OK, but jumbled n, dimension of A: 24 nz, number of nonzeros in A: 102 diff --git a/CAMD/Demo/camd_l_demo.out b/CAMD/Demo/camd_l_demo.out index 34ffe2583..2a363bc1b 100644 --- a/CAMD/Demo/camd_l_demo.out +++ b/CAMD/Demo/camd_l_demo.out @@ -1,7 +1,7 @@ -CAMD version 3.0, date: June 16, 2023 +CAMD version 3.2, date: Sept 8, 2023 CAMD demo, with the 24-by-24 Harwell/Boeing matrix, can_24: -camd version 3.0.4, June 16, 2023: approximate minimum degree ordering: +camd version 3.2.0, Sept 8, 2023: approximate minimum degree ordering: dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -115,7 +115,7 @@ Plot of input matrix pattern: 23: . . . . . . X . . . . X X . . . . . . . . . . X return value from camd_l_order: 0 (should be 0) -CAMD version 3.0.4, June 16, 2023, results: +CAMD version 3.2.0, Sept 8, 2023, results: status: OK n, dimension of A: 24 nz, number of nonzeros in A: 160 diff --git a/CAMD/Doc/CAMD_UserGuide.pdf b/CAMD/Doc/CAMD_UserGuide.pdf index 00891f92f..60b445000 100644 Binary files a/CAMD/Doc/CAMD_UserGuide.pdf and b/CAMD/Doc/CAMD_UserGuide.pdf differ diff --git a/CAMD/Doc/ChangeLog b/CAMD/Doc/ChangeLog index 9e2f61e34..bbd5c49d3 100644 --- a/CAMD/Doc/ChangeLog +++ b/CAMD/Doc/ChangeLog @@ -1,3 +1,7 @@ +Sept 8, 2023: version 3.2.0 + + * cmake updates: SuiteSparse:: namespace by Markus Muetzel + June 16, 2023: version 3.0.4 * cmake build system updates: update by Markus Muetzel diff --git a/CAMD/Doc/camd_version.tex b/CAMD/Doc/camd_version.tex index d06b8707d..ef7d16585 100644 --- a/CAMD/Doc/camd_version.tex +++ b/CAMD/Doc/camd_version.tex @@ -1,2 +1,2 @@ % version of SuiteSparse/CAMD -\date{VERSION 3.0.4, June 16, 2023} +\date{VERSION 3.2.0, Sept 8, 2023} diff --git a/CAMD/Include/camd.h b/CAMD/Include/camd.h index c21910f58..245e76795 100644 --- a/CAMD/Include/camd.h +++ b/CAMD/Include/camd.h @@ -384,10 +384,10 @@ void camd_l_info (double Info [ ]) ; * #endif */ -#define CAMD_DATE "June 16, 2023" +#define CAMD_DATE "Sept 8, 2023" #define CAMD_MAIN_VERSION 3 -#define CAMD_SUB_VERSION 0 -#define CAMD_SUBSUB_VERSION 4 +#define CAMD_SUB_VERSION 2 +#define CAMD_SUBSUB_VERSION 0 #define CAMD_VERSION_CODE(main,sub) ((main) * 1000 + (sub)) #define CAMD_VERSION CAMD_VERSION_CODE(CAMD_MAIN_VERSION,CAMD_SUB_VERSION) diff --git a/CAMD/cmake_modules/FindCAMD.cmake b/CAMD/cmake_modules/FindCAMD.cmake deleted file mode 100644 index 68cdf7055..000000000 --- a/CAMD/cmake_modules/FindCAMD.cmake +++ /dev/null @@ -1,129 +0,0 @@ -#------------------------------------------------------------------------------- -# SuiteSparse/CAMD/cmake_modules/FindCAMD.cmake -#------------------------------------------------------------------------------- - -# The following copyright and license applies to just this file only, not to -# the library itself: -# FindCAMD.cmake, Copyright (c) 2022-2023, Timothy A. Davis. All Rights Reserved. -# SPDX-License-Identifier: BSD-3-clause - -#------------------------------------------------------------------------------- - -# Finds the CAMD include file and compiled library and sets: - -# CAMD_INCLUDE_DIR - where to find camd.h -# CAMD_LIBRARY - dynamic CAMD library -# CAMD_STATIC - static CAMD library -# CAMD_LIBRARIES - libraries when using CAMD -# CAMD_FOUND - true if CAMD found - -# set ``CAMD_ROOT`` to a CAMD installation root to -# tell this module where to look. - -# All the Find*.cmake files in SuiteSparse are installed by 'make install' into -# /usr/local/lib/cmake/SuiteSparse (where '/usr/local' is the -# ${CMAKE_INSTALL_PREFIX}). To access this file, place the following commands -# in your CMakeLists.txt file. See also SuiteSparse/Example/CMakeLists.txt: -# -# set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} -# ${CMAKE_INSTALL_PREFIX}/lib/cmake/SuiteSparse ) - -#------------------------------------------------------------------------------- - -# include files for CAMD -find_path ( CAMD_INCLUDE_DIR - NAMES camd.h - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/CAMD - HINTS ${CMAKE_SOURCE_DIR}/../CAMD - PATH_SUFFIXES include Include -) - -# dynamic CAMD library (or static if no dynamic library was built) -find_library ( CAMD_LIBRARY - NAMES camd camd_static - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/CAMD - HINTS ${CMAKE_SOURCE_DIR}/../CAMD - PATH_SUFFIXES lib build build/Release build/Debug -) - -if ( MSVC ) - set ( STATIC_NAME camd_static camd ) -else ( ) - set ( STATIC_NAME camd ) - set ( save ${CMAKE_FIND_LIBRARY_SUFFIXES} ) - set ( CMAKE_FIND_LIBRARY_SUFFIXES - ${CMAKE_STATIC_LIBRARY_SUFFIX} ${CMAKE_FIND_LIBRARY_SUFFIXES} ) -endif ( ) - -# static CAMD library -find_library ( CAMD_STATIC - NAMES ${STATIC_NAME} - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/CAMD - HINTS ${CMAKE_SOURCE_DIR}/../CAMD - PATH_SUFFIXES lib build build/Release build/Debug -) - -if ( NOT MSVC ) - # restore the CMAKE_FIND_LIBRARY_SUFFIXES variable - set ( CMAKE_FIND_LIBRARY_SUFFIXES ${save} ) -endif ( ) - -# get version of the library from the dynamic library filename -get_filename_component ( CAMD_LIBRARY ${CAMD_LIBRARY} REALPATH ) -get_filename_component ( CAMD_FILENAME ${CAMD_LIBRARY} NAME ) -string ( - REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" - CAMD_VERSION - ${CAMD_FILENAME} -) - -# set ( CAMD_VERSION "" ) -if ( EXISTS "${CAMD_INCLUDE_DIR}" AND NOT CAMD_VERSION ) - # if the version does not appear in the filename, read the include file - file ( STRINGS ${CAMD_INCLUDE_DIR}/camd.h CAMD_MAJOR_STR - REGEX "define CAMD_MAIN_VERSION" ) - file ( STRINGS ${CAMD_INCLUDE_DIR}/camd.h CAMD_MINOR_STR - REGEX "define CAMD_SUB_VERSION" ) - file ( STRINGS ${CAMD_INCLUDE_DIR}/camd.h CAMD_PATCH_STR - REGEX "define CAMD_SUBSUB_VERSION" ) - message ( STATUS "major: ${CAMD_MAJOR_STR}" ) - message ( STATUS "minor: ${CAMD_MINOR_STR}" ) - message ( STATUS "patch: ${CAMD_PATCH_STR}" ) - string ( REGEX MATCH "[0-9]+" CAMD_MAJOR ${CAMD_MAJOR_STR} ) - string ( REGEX MATCH "[0-9]+" CAMD_MINOR ${CAMD_MINOR_STR} ) - string ( REGEX MATCH "[0-9]+" CAMD_PATCH ${CAMD_PATCH_STR} ) - set (CAMD_VERSION "${CAMD_MAJOR}.${CAMD_MINOR}.${CAMD_PATCH}") -endif ( ) - -set ( CAMD_LIBRARIES ${CAMD_LIBRARY} ) - -include (FindPackageHandleStandardArgs) - -find_package_handle_standard_args ( CAMD - REQUIRED_VARS CAMD_LIBRARY CAMD_INCLUDE_DIR - VERSION_VAR CAMD_VERSION -) - -mark_as_advanced ( - CAMD_INCLUDE_DIR - CAMD_LIBRARY - CAMD_STATIC - CAMD_LIBRARIES -) - -if ( CAMD_FOUND ) - message ( STATUS "CAMD version: ${CAMD_VERSION}" ) - message ( STATUS "CAMD include: ${CAMD_INCLUDE_DIR}" ) - message ( STATUS "CAMD library: ${CAMD_LIBRARY}" ) - message ( STATUS "CAMD static: ${CAMD_STATIC}" ) -else ( ) - message ( STATUS "CAMD not found" ) - set ( CAMD_INCLUDE_DIR "" ) - set ( CAMD_LIBRARIES "" ) - set ( CAMD_LIBRARY "" ) - set ( CAMD_STATIC "" ) -endif ( ) - diff --git a/CCOLAMD/CMakeLists.txt b/CCOLAMD/CMakeLists.txt index 71354f6de..7524cb0b5 100644 --- a/CCOLAMD/CMakeLists.txt +++ b/CCOLAMD/CMakeLists.txt @@ -9,12 +9,12 @@ # get the version #------------------------------------------------------------------------------- -cmake_minimum_required ( VERSION 3.19 ) +cmake_minimum_required ( VERSION 3.20 ) -set ( CCOLAMD_DATE "June 16, 2023" ) +set ( CCOLAMD_DATE "Sept 8, 2023" ) set ( CCOLAMD_VERSION_MAJOR 3 ) -set ( CCOLAMD_VERSION_MINOR 0 ) -set ( CCOLAMD_VERSION_SUB 4 ) +set ( CCOLAMD_VERSION_MINOR 2 ) +set ( CCOLAMD_VERSION_SUB 0 ) message ( STATUS "Building CCOLAMD version: v" ${CCOLAMD_VERSION_MAJOR}. @@ -26,7 +26,6 @@ message ( STATUS "Building CCOLAMD version: v" #------------------------------------------------------------------------------- set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} - ${CMAKE_SOURCE_DIR}/cmake_modules ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/cmake_modules ) include ( SuiteSparsePolicy ) @@ -43,7 +42,11 @@ project ( ccolamd # find library dependencies #------------------------------------------------------------------------------- -find_package ( SuiteSparse_config 7.1.0 REQUIRED ) +find_package ( SuiteSparse_config 7.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH ) +if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) + find_package ( SuiteSparse_config 7.2.0 REQUIRED ) +endif ( ) #------------------------------------------------------------------------------- # configure files @@ -57,7 +60,7 @@ configure_file ( "Config/ccolamd.h.in" # include directories #------------------------------------------------------------------------------- -include_directories ( Source Include ${SUITESPARSE_CONFIG_INCLUDE_DIR} ) +include_directories ( Source Include ) #------------------------------------------------------------------------------- # dynamic ccolamd library properties @@ -65,24 +68,29 @@ include_directories ( Source Include ${SUITESPARSE_CONFIG_INCLUDE_DIR} ) file ( GLOB CCOLAMD_SOURCES "Source/*.c" ) -add_library ( ccolamd SHARED ${CCOLAMD_SOURCES} ) +add_library ( CCOLAMD SHARED ${CCOLAMD_SOURCES} ) -set_target_properties ( ccolamd PROPERTIES +set_target_properties ( CCOLAMD PROPERTIES VERSION ${CCOLAMD_VERSION_MAJOR}.${CCOLAMD_VERSION_MINOR}.${CCOLAMD_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON + OUTPUT_NAME ccolamd SOVERSION ${CCOLAMD_VERSION_MAJOR} PUBLIC_HEADER "Include/ccolamd.h" WINDOWS_EXPORT_ALL_SYMBOLS ON ) +target_include_directories ( CCOLAMD + INTERFACE $ + $ ) + #------------------------------------------------------------------------------- # static ccolamd library properties #------------------------------------------------------------------------------- if ( NOT NSTATIC ) - add_library ( ccolamd_static STATIC ${CCOLAMD_SOURCES} ) + add_library ( CCOLAMD_static STATIC ${CCOLAMD_SOURCES} ) - set_target_properties ( ccolamd_static PROPERTIES + set_target_properties ( CCOLAMD_static PROPERTIES VERSION ${CCOLAMD_VERSION_MAJOR}.${CCOLAMD_VERSION_MINOR}.${CCOLAMD_VERSION_SUB} OUTPUT_NAME ccolamd C_STANDARD 11 @@ -90,25 +98,37 @@ if ( NOT NSTATIC ) SOVERSION ${CCOLAMD_VERSION_MAJOR} ) if ( MSVC ) - set_target_properties ( ccolamd_static PROPERTIES + set_target_properties ( CCOLAMD_static PROPERTIES OUTPUT_NAME ccolamd_static ) endif ( ) + + target_include_directories ( CCOLAMD_static + INTERFACE $ + $ ) + endif ( ) #------------------------------------------------------------------------------- # add the library dependencies #------------------------------------------------------------------------------- -target_link_libraries ( ccolamd PRIVATE ${SUITESPARSE_CONFIG_LIBRARY} ) +target_link_libraries ( CCOLAMD PRIVATE SuiteSparse::SuiteSparseConfig ) +target_include_directories ( CCOLAMD PUBLIC + "$" ) if ( NOT NSTATIC ) - target_link_libraries ( ccolamd_static PUBLIC ${SUITESPARSE_CONFIG_STATIC} ) + if ( TARGET SuiteSparse::SuiteSparseConfig_static ) + target_link_libraries ( CCOLAMD_static PUBLIC SuiteSparse::SuiteSparseConfig_static ) + else ( ) + target_link_libraries ( CCOLAMD_static PUBLIC SuiteSparse::SuiteSparseConfig ) + endif ( ) endif ( ) # libm: if ( NOT WIN32 ) - target_link_libraries ( ccolamd PRIVATE m ) + target_link_libraries ( CCOLAMD PRIVATE m ) if ( NOT NSTATIC ) - target_link_libraries ( ccolamd_static PUBLIC m ) + set ( CCOLAMD_STATIC_LIBS "${CCOLAMD_STATIC_LIBS} -lm" ) + target_link_libraries ( CCOLAMD_static PUBLIC m ) endif ( ) endif ( ) @@ -116,19 +136,73 @@ endif ( ) # COLAMD installation location #------------------------------------------------------------------------------- -install ( TARGETS ccolamd +include ( CMakePackageConfigHelpers ) + +install ( TARGETS CCOLAMD + EXPORT CCOLAMDTargets LIBRARY DESTINATION ${SUITESPARSE_LIBDIR} ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} RUNTIME DESTINATION ${SUITESPARSE_BINDIR} PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} ) -install ( FILES ${CMAKE_SOURCE_DIR}/cmake_modules/FindCCOLAMD.cmake - DESTINATION ${SUITESPARSE_LIBDIR}/cmake/SuiteSparse - COMPONENT Development ) if ( NOT NSTATIC ) - install ( TARGETS ccolamd_static + install ( TARGETS CCOLAMD_static + EXPORT CCOLAMDTargets ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} ) endif ( ) +# create (temporary) export target file during build +export ( EXPORT CCOLAMDTargets + NAMESPACE SuiteSparse:: + FILE ${CMAKE_CURRENT_BINARY_DIR}/CCOLAMDTargets.cmake ) + +# install export target, config and version files for find_package +install ( EXPORT CCOLAMDTargets + NAMESPACE SuiteSparse:: + DESTINATION ${SUITESPARSE_LIBDIR}/cmake/CCOLAMD ) + +configure_package_config_file ( + Config/CCOLAMDConfig.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/CCOLAMDConfig.cmake + INSTALL_DESTINATION ${SUITESPARSE_LIBDIR}/cmake/CCOLAMD ) + +write_basic_package_version_file ( + ${CMAKE_CURRENT_BINARY_DIR}/CCOLAMDConfigVersion.cmake + COMPATIBILITY SameMajorVersion ) + +install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/CCOLAMDConfig.cmake + ${CMAKE_CURRENT_BINARY_DIR}/CCOLAMDConfigVersion.cmake + DESTINATION ${SUITESPARSE_LIBDIR}/cmake/CCOLAMD ) + +#------------------------------------------------------------------------------- +# create pkg-config file +#------------------------------------------------------------------------------- + +if ( NOT MSVC ) + set ( prefix "${CMAKE_INSTALL_PREFIX}" ) + set ( exec_prefix "\${prefix}" ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) + if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) + set ( libdir "${SUITESPARSE_LIBDIR}") + else ( ) + set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") + endif ( ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) + if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) + set ( includedir "${SUITESPARSE_INCLUDEDIR}") + else ( ) + set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + endif ( ) + configure_file ( + Config/CCOLAMD.pc.in + CCOLAMD.pc + @ONLY + NEWLINE_STYLE LF ) + install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/CCOLAMD.pc + DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) +endif ( ) + #------------------------------------------------------------------------------- # Demo library and programs #------------------------------------------------------------------------------- @@ -150,8 +224,8 @@ if ( DEMO ) add_executable ( ccolamd_l_example "Demo/ccolamd_l_example.c" ) # Libraries required for Demo programs - target_link_libraries ( ccolamd_example PUBLIC ccolamd ) - target_link_libraries ( ccolamd_l_example PUBLIC ccolamd ) + target_link_libraries ( ccolamd_example PUBLIC CCOLAMD ) + target_link_libraries ( ccolamd_l_example PUBLIC CCOLAMD ) else ( ) diff --git a/CCOLAMD/Config/CCOLAMD.pc.in b/CCOLAMD/Config/CCOLAMD.pc.in new file mode 100644 index 000000000..939cfd9ad --- /dev/null +++ b/CCOLAMD/Config/CCOLAMD.pc.in @@ -0,0 +1,17 @@ +# CCOLAMD, Copyright (c) 2005-2023, Timothy A. Davis. +# All Rights Reserved. +# SPDX-License-Identifier: BSD-3-Clause + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: CCOLAMD +URL: https://github.com/DrTimothyAldenDavis/SuiteSparse +Description: Routines for column approximate minimum degree ordering algorithm in SuiteSparse +Version: @CCOLAMD_VERSION_MAJOR@.@CCOLAMD_VERSION_MINOR@.@CCOLAMD_VERSION_SUB@ +Requires.private: SuiteSparse_config +Libs: -L${libdir} -lccolamd +Libs.private: @CCOLAMD_STATIC_LIBS@ +Cflags: -I${includedir} diff --git a/CCOLAMD/Config/CCOLAMDConfig.cmake.in b/CCOLAMD/Config/CCOLAMDConfig.cmake.in new file mode 100644 index 000000000..4152ada89 --- /dev/null +++ b/CCOLAMD/Config/CCOLAMDConfig.cmake.in @@ -0,0 +1,121 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/CCOLAMD/cmake_modules/CCOLAMDConfig.cmake +#------------------------------------------------------------------------------- + +# The following copyright and license applies to just this file only, not to +# the library itself: +# CCOLAMDConfig.cmake, Copyright (c) 2023, Timothy A. Davis. All Rights Reserved. +# SPDX-License-Identifier: BSD-3-clause + +#------------------------------------------------------------------------------- + +# Finds the CCOLAMD include file and compiled library. +# The following targets are defined: +# SuiteSparse::CCOLAMD - for the shared library (if available) +# SuiteSparse::CCOLAMD_static - for the static library (if available) + +# For backward compatibility the following variables are set: + +# CCOLAMD_INCLUDE_DIR - where to find ccolamd.h +# CCOLAMD_LIBRARY - dynamic CCOLAMD library +# CCOLAMD_STATIC - static CCOLAMD library +# CCOLAMD_LIBRARIES - libraries when using CCOLAMD +# CCOLAMD_FOUND - true if CCOLAMD found + +# Set ``CMAKE_MODULE_PATH`` to the parent folder where this module file is +# installed. + +#------------------------------------------------------------------------------- + +@PACKAGE_INIT@ + +set ( CCOLAMD_DATE "@CCOLAMD_DATE@" ) +set ( CCOLAMD_VERSION_MAJOR @CCOLAMD_VERSION_MAJOR@ ) +set ( CCOLAMD_VERSION_MINOR @CCOLAMD_VERSION_MINOR@ ) +set ( CCOLAMD_VERSION_PATCH @CCOLAMD_VERSION_SUB@ ) +set ( CCOLAMD_VERSION "@CCOLAMD_VERSION_MAJOR@.@CCOLAMD_VERSION_MINOR@.@CCOLAMD_VERSION_SUB@" ) + +include ( ${CMAKE_CURRENT_LIST_DIR}/CCOLAMDTargets.cmake ) + +# The following is only for backward compatibility with FindCCOLAMD. + +set ( _target_shared SuiteSparse::CCOLAMD ) +set ( _target_static SuiteSparse::CCOLAMD_static ) +set ( _var_prefix "CCOLAMD" ) + +get_target_property ( ${_var_prefix}_INCLUDE_DIR ${_target_shared} INTERFACE_INCLUDE_DIRECTORIES ) +if ( ${_var_prefix}_INCLUDE_DIR ) + # First item in SuiteSparse targets contains the "main" header directory. + list ( GET ${_var_prefix}_INCLUDE_DIR 0 ${_var_prefix}_INCLUDE_DIR ) +endif ( ) +get_target_property ( ${_var_prefix}_LIBRARY ${_target_shared} IMPORTED_IMPLIB ) +if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} IMPORTED_LOCATION ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) +endif ( ) +if ( TARGET ${_target_static} ) + get_target_property ( ${_var_prefix}_STATIC ${_target_static} IMPORTED_LOCATION ) +endif ( ) + +# Check for most common build types +set ( _config_types "Debug" "Release" "RelWithDebInfo" "MinSizeRel" ) + +get_property ( _isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG ) +if ( _isMultiConfig ) + # For multi-configuration generators (e.g., Visual Studio), prefer those + # configurations. + list ( PREPEND _config_types ${CMAKE_CONFIGURATION_TYPES} ) +else ( ) + # For single-configuration generators, prefer the current configuration. + list ( PREPEND _config_types ${CMAKE_BUILD_TYPE} ) +endif ( ) + +list ( REMOVE_DUPLICATES _config_types ) + +foreach ( _config ${_config_types} ) + string ( TOUPPER ${_config} _uc_config ) + if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} + IMPORTED_IMPLIB_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) + endif ( ) + if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} + IMPORTED_LOCATION_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) + endif ( ) + if ( TARGET ${_target_static} AND NOT ${_var_prefix}_STATIC ) + get_target_property ( _library_chk ${_target_static} + IMPORTED_LOCATION_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_STATIC ${_library_chk} ) + endif ( ) + endif ( ) +endforeach ( ) + +set ( CCOLAMD_LIBRARIES ${CCOLAMD_LIBRARY} ) + +macro ( suitesparse_check_exist _var _files ) + # ignore generator expressions + string ( GENEX_STRIP "${_files}" _files2 ) + + foreach ( _file ${_files2} ) + if ( NOT EXISTS "${_file}" ) + message ( FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist!" ) + endif ( ) + endforeach () +endmacro ( ) + +suitesparse_check_exist ( CCOLAMD_INCLUDE_DIR ${CCOLAMD_INCLUDE_DIR} ) +suitesparse_check_exist ( CCOLAMD_LIBRARY ${CCOLAMD_LIBRARY} ) + +message ( STATUS "CCOLAMD version: ${CCOLAMD_VERSION}" ) +message ( STATUS "CCOLAMD include: ${CCOLAMD_INCLUDE_DIR}" ) +message ( STATUS "CCOLAMD library: ${CCOLAMD_LIBRARY}" ) +message ( STATUS "CCOLAMD static: ${CCOLAMD_STATIC}" ) diff --git a/CCOLAMD/Demo/ccolamd_example.out b/CCOLAMD/Demo/ccolamd_example.out index 5c7d7164c..26e1c880f 100644 --- a/CCOLAMD/Demo/ccolamd_example.out +++ b/CCOLAMD/Demo/ccolamd_example.out @@ -15,7 +15,7 @@ Column 3, with 2 entries: row 1 row 3 -ccolamd version 3.0.4, June 16, 2023: OK. +ccolamd version 3.2.0, Sept 8, 2023: OK. ccolamd: number of dense or empty rows ignored: 0 ccolamd: number of dense or empty columns ignored: 0 ccolamd: number of garbage collections performed: 0 @@ -38,7 +38,7 @@ Column 3, with 1 entries: row 4 Column 4, with 0 entries: -csymamd version 3.0.4, June 16, 2023: OK. +csymamd version 3.2.0, Sept 8, 2023: OK. csymamd: number of dense or empty rows ignored: 0 csymamd: number of dense or empty columns ignored: 0 csymamd: number of garbage collections performed: 0 diff --git a/CCOLAMD/Demo/ccolamd_l_example.out b/CCOLAMD/Demo/ccolamd_l_example.out index efa80fb55..234593a26 100644 --- a/CCOLAMD/Demo/ccolamd_l_example.out +++ b/CCOLAMD/Demo/ccolamd_l_example.out @@ -15,7 +15,7 @@ Column 3, with 2 entries: row 1 row 3 -ccolamd version 3.0.4, June 16, 2023: OK. +ccolamd version 3.2.0, Sept 8, 2023: OK. ccolamd: number of dense or empty rows ignored: 0 ccolamd: number of dense or empty columns ignored: 0 ccolamd: number of garbage collections performed: 0 @@ -38,7 +38,7 @@ Column 3, with 1 entries: row 4 Column 4, with 0 entries: -csymamd version 3.0.4, June 16, 2023: OK. +csymamd version 3.2.0, Sept 8, 2023: OK. csymamd: number of dense or empty rows ignored: 0 csymamd: number of dense or empty columns ignored: 0 csymamd: number of garbage collections performed: 0 diff --git a/CCOLAMD/Doc/ChangeLog b/CCOLAMD/Doc/ChangeLog index 9eff4761d..f494f9011 100644 --- a/CCOLAMD/Doc/ChangeLog +++ b/CCOLAMD/Doc/ChangeLog @@ -1,3 +1,7 @@ +Sept 8, 2023: version 3.2.0 + + * cmake updates: SuiteSparse:: namespace by Markus Muetzel + June 16, 2023: version 3.0.4 * cmake build system updates: update by Markus Muetzel diff --git a/CCOLAMD/Include/ccolamd.h b/CCOLAMD/Include/ccolamd.h index fa50152c1..c339bb701 100644 --- a/CCOLAMD/Include/ccolamd.h +++ b/CCOLAMD/Include/ccolamd.h @@ -41,10 +41,10 @@ extern "C" { * #endif */ -#define CCOLAMD_DATE "June 16, 2023" +#define CCOLAMD_DATE "Sept 8, 2023" #define CCOLAMD_MAIN_VERSION 3 -#define CCOLAMD_SUB_VERSION 0 -#define CCOLAMD_SUBSUB_VERSION 4 +#define CCOLAMD_SUB_VERSION 2 +#define CCOLAMD_SUBSUB_VERSION 0 #define CCOLAMD_VERSION_CODE(main,sub) ((main) * 1000 + (sub)) #define CCOLAMD_VERSION \ diff --git a/CCOLAMD/cmake_modules/FindCCOLAMD.cmake b/CCOLAMD/cmake_modules/FindCCOLAMD.cmake deleted file mode 100644 index 783383f90..000000000 --- a/CCOLAMD/cmake_modules/FindCCOLAMD.cmake +++ /dev/null @@ -1,129 +0,0 @@ -#------------------------------------------------------------------------------- -# SuiteSparse/CCOLAMD/cmake_modules/FindCCOLAMD.cmake -#------------------------------------------------------------------------------- - -# The following copyright and license applies to just this file only, not to -# the library itself: -# FindCCOLAMD.cmake, Copyright (c) 2022-2023, Timothy A. Davis. All Rights Reserved. -# SPDX-License-Identifier: BSD-3-clause - -#------------------------------------------------------------------------------- - -# Finds the CCOLAMD include file and compiled library and sets: - -# CCOLAMD_INCLUDE_DIR - where to find ccolamd.h -# CCOLAMD_LIBRARY - dynamic CCOLAMD library -# CCOLAMD_STATIC - static CCOLAMD library -# CCOLAMD_LIBRARIES - libraries when using CCOLAMD -# CCOLAMD_FOUND - true if CCOLAMD found - -# set ``CCOLAMD_ROOT`` to a CCOLAMD installation root to -# tell this module where to look. - -# All the Find*.cmake files in SuiteSparse are installed by 'make install' into -# /usr/local/lib/cmake/SuiteSparse (where '/usr/local' is the -# ${CMAKE_INSTALL_PREFIX}). To access this file, place the following commands -# in your CMakeLists.txt file. See also SuiteSparse/Example/CMakeLists.txt: -# -# set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} -# ${CMAKE_INSTALL_PREFIX}/lib/cmake/SuiteSparse ) - -#------------------------------------------------------------------------------- - -# include files for CCOLAMD -find_path ( CCOLAMD_INCLUDE_DIR - NAMES ccolamd.h - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/CCOLAMD - HINTS ${CMAKE_SOURCE_DIR}/../CCOLAMD - PATH_SUFFIXES include Include -) - -# dynamic CCOLAMD library (or static if no dynamic library was built) -find_library ( CCOLAMD_LIBRARY - NAMES ccolamd ccolamd_static - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/CCOLAMD - HINTS ${CMAKE_SOURCE_DIR}/../CCOLAMD - PATH_SUFFIXES lib build build/Release build/Debug -) - -if ( MSVC ) - set ( STATIC_NAME ccolamd_static ccolamd ) -else ( ) - set ( STATIC_NAME ccolamd ) - set ( save ${CMAKE_FIND_LIBRARY_SUFFIXES} ) - set ( CMAKE_FIND_LIBRARY_SUFFIXES - ${CMAKE_STATIC_LIBRARY_SUFFIX} ${CMAKE_FIND_LIBRARY_SUFFIXES} ) -endif ( ) - -# static CCOLAMD library -find_library ( CCOLAMD_STATIC - NAMES ${STATIC_NAME} - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/CCOLAMD - HINTS ${CMAKE_SOURCE_DIR}/../CCOLAMD - PATH_SUFFIXES lib build build/Release build/Debug -) - -if ( NOT MSVC ) - # restore the CMAKE_FIND_LIBRARY_SUFFIXES variable - set ( CMAKE_FIND_LIBRARY_SUFFIXES ${save} ) -endif ( ) - -# get version of the library from the dynamic library name -get_filename_component ( CCOLAMD_LIBRARY ${CCOLAMD_LIBRARY} REALPATH ) -get_filename_component ( CCOLAMD_FILENAME ${CCOLAMD_LIBRARY} NAME ) -string ( - REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" - CCOLAMD_VERSION - ${CCOLAMD_FILENAME} -) - -# set ( CCOLAMD_VERSION "" ) -if ( EXISTS "${CCOLAMD_INCLUDE_DIR}" AND NOT CCOLAMD_VERSION ) - # if the version does not appear in the filename, read the include file - file ( STRINGS ${CCOLAMD_INCLUDE_DIR}/ccolamd.h CCOLAMD_MAJOR_STR - REGEX "define CCOLAMD_MAIN_VERSION" ) - file ( STRINGS ${CCOLAMD_INCLUDE_DIR}/ccolamd.h CCOLAMD_MINOR_STR - REGEX "define CCOLAMD_SUB_VERSION" ) - file ( STRINGS ${CCOLAMD_INCLUDE_DIR}/ccolamd.h CCOLAMD_PATCH_STR - REGEX "define CCOLAMD_SUBSUB_VERSION" ) - message ( STATUS "major: ${CCOLAMD_MAJOR_STR}" ) - message ( STATUS "minor: ${CCOLAMD_MINOR_STR}" ) - message ( STATUS "patch: ${CCOLAMD_PATCH_STR}" ) - string ( REGEX MATCH "[0-9]+" CCOLAMD_MAJOR ${CCOLAMD_MAJOR_STR} ) - string ( REGEX MATCH "[0-9]+" CCOLAMD_MINOR ${CCOLAMD_MINOR_STR} ) - string ( REGEX MATCH "[0-9]+" CCOLAMD_PATCH ${CCOLAMD_PATCH_STR} ) - set (CCOLAMD_VERSION "${CCOLAMD_MAJOR}.${CCOLAMD_MINOR}.${CCOLAMD_PATCH}") -endif ( ) - -set ( CCOLAMD_LIBRARIES ${CCOLAMD_LIBRARY} ) - -include (FindPackageHandleStandardArgs) - -find_package_handle_standard_args ( CCOLAMD - REQUIRED_VARS CCOLAMD_LIBRARY CCOLAMD_INCLUDE_DIR - VERSION_VAR CCOLAMD_VERSION -) - -mark_as_advanced ( - CCOLAMD_INCLUDE_DIR - CCOLAMD_LIBRARY - CCOLAMD_STATIC - CCOLAMD_LIBRARIES -) - -if ( CCOLAMD_FOUND ) - message ( STATUS "CCOLAMD version: ${CCOLAMD_VERSION}" ) - message ( STATUS "CCOLAMD include: ${CCOLAMD_INCLUDE_DIR}" ) - message ( STATUS "CCOLAMD library: ${CCOLAMD_LIBRARY}" ) - message ( STATUS "CCOLAMD static: ${CCOLAMD_STATIC}" ) -else ( ) - message ( STATUS "CCOLAMD not found" ) - set ( CCOLAMD_INCLUDE_DIR "" ) - set ( CCOLAMD_LIBRARIES "" ) - set ( CCOLAMD_LIBRARY "" ) - set ( CCOLAMD_STATIC "" ) -endif ( ) - diff --git a/CHOLMOD/CMakeLists.txt b/CHOLMOD/CMakeLists.txt index 66ab5e9b5..614f8eae7 100644 --- a/CHOLMOD/CMakeLists.txt +++ b/CHOLMOD/CMakeLists.txt @@ -12,10 +12,10 @@ # cmake 3.22 is required to find the BLAS/LAPACK cmake_minimum_required ( VERSION 3.22 ) -set ( CHOLMOD_DATE "June 16, 2023" ) +set ( CHOLMOD_DATE "Sept 8, 2023" ) set ( CHOLMOD_VERSION_MAJOR 4 ) -set ( CHOLMOD_VERSION_MINOR 0 ) -set ( CHOLMOD_VERSION_SUB 4 ) +set ( CHOLMOD_VERSION_MINOR 2 ) +set ( CHOLMOD_VERSION_SUB 0 ) message ( STATUS "Building CHOLMOD version: v" ${CHOLMOD_VERSION_MAJOR}. @@ -28,10 +28,6 @@ message ( STATUS "Building CHOLMOD version: v" set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake_modules - ${CMAKE_SOURCE_DIR}/../COLAMD/cmake_modules - ${CMAKE_SOURCE_DIR}/../AMD/cmake_modules - ${CMAKE_SOURCE_DIR}/../CAMD/cmake_modules - ${CMAKE_SOURCE_DIR}/../CCOLAMD/cmake_modules ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/cmake_modules ) option ( ENABLE_CUDA "Enable CUDA acceleration" on ) @@ -46,7 +42,9 @@ if ( NGPL ) endif ( ) include ( SuiteSparsePolicy ) -include ( SuiteSparse_ssize_t ) + +include ( CheckTypeSize ) +check_type_size ( "ssize_t" SSIZE_T ) if ( NOT HAVE_SSIZE_T ) # #include and ssize_t not defined (typically on Windows) add_compile_definitions ( NO_SSIZE_T ) @@ -80,9 +78,23 @@ else ( ) find_package ( OpenMP ) endif ( ) -find_package ( SuiteSparse_config 7.1.0 REQUIRED ) -find_package ( COLAMD 3.0.4 REQUIRED ) -find_package ( AMD 3.0.4 REQUIRED ) +find_package ( SuiteSparse_config 7.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH ) +if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) + find_package ( SuiteSparse_config 7.2.0 REQUIRED ) +endif ( ) + +find_package ( COLAMD 3.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../COLAMD/build NO_DEFAULT_PATH ) +if ( NOT TARGET SuiteSparse::COLAMD ) + find_package ( COLAMD 3.2.0 REQUIRED ) +endif ( ) + +find_package ( AMD 3.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../AMD/build NO_DEFAULT_PATH ) +if ( NOT TARGET SuiteSparse::AMD ) + find_package ( AMD 3.2.0 REQUIRED ) +endif ( ) #------------------------------------------------------------------------------- # find CHOLMOD modules @@ -184,8 +196,18 @@ find_package ( AMD 3.0.4 REQUIRED ) if ( NOT NCAMD ) # find CAMD and CCOLAMD - find_package ( CAMD 3.0.4 ) - find_package ( CCOLAMD 3.0.4 ) + find_package ( CAMD 3.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../CAMD/build NO_DEFAULT_PATH ) + if ( NOT TARGET SuiteSparse::CAMD ) + find_package ( CAMD 3.2.0 ) + endif ( ) + + find_package ( CCOLAMD 3.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../CCOLAMD/build NO_DEFAULT_PATH ) + if ( NOT TARGET SuiteSparse::CCOLAMD ) + find_package ( CCOLAMD 3.2.0 ) + endif ( ) + if ( NOT CAMD_FOUND OR NOT CCOLAMD_FOUND ) # CAMD and/or CCOLAMD not found set ( NCAMD true ) @@ -245,17 +267,12 @@ find_package ( AMD 3.0.4 REQUIRED ) # find CUDA #------------------------------------------------------------------------------- -add_subdirectory ( GPU ) if ( SUITESPARSE_CUDA ) # with CUDA - set ( CHOLMOD_CUDA cholmod_cuda ${CUDA_LIBRARIES} ) - set ( CHOLMOD_CUDA_STATIC cholmod_cuda_static ${CUDA_LIBRARIES} ) + add_subdirectory ( GPU ) + message ( STATUS "CUDA libraries: " ${CUDA_LIBRARIES} ) include_directories ( GPU ${CUDAToolkit_INCLUDE_DIRS} ) link_directories ( "GPU" "${CUDA_LIBRARIES}" "/usr/local/cuda/lib64/stubs" "/usr/local/cuda/lib64" ) -else ( ) - # without CUDA and RMM - set ( CHOLMOD_CUDA ) - set ( CHOLMOD_CUDA_STATIC ) endif ( ) #------------------------------------------------------------------------------- @@ -274,8 +291,7 @@ configure_file ( "Config/cholmod_version.tex.in" #------------------------------------------------------------------------------- include_directories ( Check Cholesky Core MatrixOps Modify Partition - Supernodal Include ${CMAKE_SOURCE_DIR} ${SUITESPARSE_CONFIG_INCLUDE_DIR} - ${AMD_INCLUDE_DIR} ${COLAMD_INCLUDE_DIR} ) + Supernodal Include ${CMAKE_SOURCE_DIR} ) #------------------------------------------------------------------------------- # dynamic cholmod library properties @@ -285,29 +301,34 @@ file ( GLOB CHOLMOD_SOURCES "Check/cholmod_*.c" "Cholesky/cholmod_*.c" "Core/cholmod_*.c" "MatrixOps/cholmod_*.c" "Modify/cholmod_*.c" "Partition/cholmod_*.c" "Supernodal/cholmod_*.c" ) -add_library ( cholmod SHARED ${CHOLMOD_SOURCES} ) +add_library ( CHOLMOD SHARED ${CHOLMOD_SOURCES} ) -set_target_properties ( cholmod PROPERTIES +set_target_properties ( CHOLMOD PROPERTIES VERSION ${CHOLMOD_VERSION_MAJOR}.${CHOLMOD_VERSION_MINOR}.${CHOLMOD_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON + OUTPUT_NAME cholmod SOVERSION ${CHOLMOD_VERSION_MAJOR} PUBLIC_HEADER "Include/cholmod.h" WINDOWS_EXPORT_ALL_SYMBOLS ON ) if ( SUITESPARSE_CUDA ) - set_target_properties ( cholmod PROPERTIES CUDA_SEPARABLE_COMPILATION on ) - set_target_properties ( cholmod PROPERTIES POSITION_INDEPENDENT_CODE on ) + set_target_properties ( CHOLMOD PROPERTIES CUDA_SEPARABLE_COMPILATION on ) + set_target_properties ( CHOLMOD PROPERTIES POSITION_INDEPENDENT_CODE on ) endif ( ) +target_include_directories ( CHOLMOD + INTERFACE $ + $ ) + #------------------------------------------------------------------------------- # static cholmod library properties #------------------------------------------------------------------------------- if ( NOT NSTATIC ) - add_library ( cholmod_static STATIC ${CHOLMOD_SOURCES} ) + add_library ( CHOLMOD_static STATIC ${CHOLMOD_SOURCES} ) - set_target_properties ( cholmod_static PROPERTIES + set_target_properties ( CHOLMOD_static PROPERTIES VERSION ${CHOLMOD_VERSION_MAJOR}.${CHOLMOD_VERSION_MINOR}.${CHOLMOD_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON @@ -315,24 +336,35 @@ if ( NOT NSTATIC ) SOVERSION ${CHOLMOD_VERSION_MAJOR} ) if ( MSVC ) - set_target_properties ( cholmod_static PROPERTIES + set_target_properties ( CHOLMOD_static PROPERTIES OUTPUT_NAME cholmod_static ) endif ( ) if ( SUITESPARSE_CUDA ) - set_target_properties ( cholmod_static PROPERTIES CUDA_SEPARABLE_COMPILATION on ) - set_target_properties ( cholmod_static PROPERTIES POSITION_INDEPENDENT_CODE on ) + set_target_properties ( CHOLMOD_static PROPERTIES CUDA_SEPARABLE_COMPILATION on ) + set_target_properties ( CHOLMOD_static PROPERTIES POSITION_INDEPENDENT_CODE on ) endif ( ) + + target_include_directories ( CHOLMOD_static + INTERFACE $ + $ ) + endif ( ) #------------------------------------------------------------------------------- # add the library dependencies #------------------------------------------------------------------------------- -# suitesparseconfig: -target_link_libraries ( cholmod PRIVATE ${SUITESPARSE_CONFIG_LIBRARIES} ) +# SuiteSparseConfig: +target_link_libraries ( CHOLMOD PRIVATE SuiteSparse::SuiteSparseConfig ) +target_include_directories ( CHOLMOD PUBLIC + "$" ) if ( NOT NSTATIC ) - target_link_libraries ( cholmod_static PUBLIC ${SUITESPARSE_CONFIG_STATIC} ) + if ( TARGET SuiteSparse::SuiteSparseConfig_static ) + target_link_libraries ( CHOLMOD_static PUBLIC SuiteSparse::SuiteSparseConfig_static ) + else ( ) + target_link_libraries ( CHOLMOD_static PUBLIC SuiteSparse::SuiteSparseConfig ) + endif ( ) endif ( ) # OpenMP: @@ -340,69 +372,96 @@ if ( OPENMP_FOUND ) message ( STATUS "OpenMP C libraries: ${OpenMP_C_LIBRARIES} ") message ( STATUS "OpenMP C include: ${OpenMP_C_INCLUDE_DIRS} ") message ( STATUS "OpenMP C flags: ${OpenMP_C_FLAGS} ") - target_link_libraries ( cholmod PRIVATE ${OpenMP_C_LIBRARIES} ) + target_link_libraries ( CHOLMOD PRIVATE ${OpenMP_C_LIBRARIES} ) if ( NOT NSTATIC ) - target_link_libraries ( cholmod_static PUBLIC ${OpenMP_C_LIBRARIES} ) + target_link_libraries ( CHOLMOD_static PUBLIC ${OpenMP_C_LIBRARIES} ) + list ( APPEND CHOLMOD_STATIC_LIBS ${OpenMP_C_LIBRARIES} ) endif ( ) set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS} " ) set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_C_FLAGS} " ) include_directories ( ${OpenMP_C_INCLUDE_DIRS} ) +else ( ) + # to fix METIS: use threadprivate variables for GKRAND instead globals, + # so multiple user threads can call cholmod_analyze in parallel on + # different matrices, and avoid global locking of the system rand. + include ( SuiteSparse__thread ) endif ( ) # libm: if ( NOT WIN32 ) - target_link_libraries ( cholmod PRIVATE m ) + target_link_libraries ( CHOLMOD PRIVATE m ) if ( NOT NSTATIC ) - target_link_libraries ( cholmod_static PUBLIC m ) + list ( APPEND CHOLMOD_STATIC_LIBS "m" ) + target_link_libraries ( CHOLMOD_static PUBLIC m ) endif ( ) endif ( ) + list ( APPEND CHOLMOD_STATIC_LIBS "m" ) -# amd: -target_link_libraries ( cholmod PRIVATE ${AMD_LIBRARIES} ) +# AMD: +target_link_libraries ( CHOLMOD PRIVATE SuiteSparse::AMD ) if ( NOT NSTATIC ) - target_link_libraries ( cholmod_static PUBLIC ${AMD_STATIC} ) + if ( TARGET SuiteSparse::AMD_static ) + target_link_libraries ( CHOLMOD_static PUBLIC SuiteSparse::AMD_static ) + else ( ) + target_link_libraries ( CHOLMOD_static PUBLIC SuiteSparse::AMD ) + endif ( ) endif ( ) -# colamd: -target_link_libraries ( cholmod PRIVATE ${COLAMD_LIBRARIES} ) +# COLAMD: +target_link_libraries ( CHOLMOD PRIVATE SuiteSparse::COLAMD ) if ( NOT NSTATIC ) - target_link_libraries ( cholmod_static PUBLIC ${COLAMD_STATIC} ) + if ( TARGET SuiteSparse::COLAMD_static ) + target_link_libraries ( CHOLMOD_static PUBLIC SuiteSparse::COLAMD_static ) + else ( ) + target_link_libraries ( CHOLMOD_static PUBLIC SuiteSparse::COLAMD ) + endif ( ) endif ( ) # BLAS and LAPACK: for the Supernodal Module if ( NOT NSUPERNODAL ) - # BLAS: - message ( STATUS "BLAS libraries: ${BLAS_LIBRARIES} ") - message ( STATUS "BLAS include: ${BLAS_INCLUDE_DIRS} ") - message ( STATUS "BLAS linker flags: ${BLAS_LINKER_FLAGS} ") - target_link_libraries ( cholmod PRIVATE ${BLAS_LIBRARIES} ) - if ( NOT NSTATIC ) - target_link_libraries ( cholmod_static PUBLIC ${BLAS_LIBRARIES} ) - endif ( ) - include_directories ( ${BLAS_INCLUDE_DIRS} ) - # LAPACK: message ( STATUS "LAPACK libraries: ${LAPACK_LIBRARIES} ") message ( STATUS "LAPACK include: ${LAPACK_INCLUDE_DIRS} ") message ( STATUS "LAPACK linker flags: ${LAPACK_LINKER_FLAGS} ") - target_link_libraries ( cholmod PRIVATE ${LAPACK_LIBRARIES} ) + target_link_libraries ( CHOLMOD PRIVATE ${LAPACK_LIBRARIES} ) if ( NOT NSTATIC ) - target_link_libraries ( cholmod_static PUBLIC ${LAPACK_LIBRARIES} ) + list ( APPEND CHOLMOD_STATIC_LIBS ${LAPACK_LIBRARIES} ) + target_link_libraries ( CHOLMOD_static PUBLIC ${LAPACK_LIBRARIES} ) endif ( ) include_directories ( ${LAPACK_INCLUDE_DIR} ) + + # BLAS: + message ( STATUS "BLAS libraries: ${BLAS_LIBRARIES} ") + message ( STATUS "BLAS include: ${BLAS_INCLUDE_DIRS} ") + message ( STATUS "BLAS linker flags: ${BLAS_LINKER_FLAGS} ") + target_link_libraries ( CHOLMOD PRIVATE ${BLAS_LIBRARIES} ) + if ( NOT NSTATIC ) + list ( APPEND CHOLMOD_STATIC_LIBS ${BLAS_LIBRARIES} ) + target_link_libraries ( CHOLMOD_static PUBLIC ${BLAS_LIBRARIES} ) + endif ( ) + include_directories ( ${BLAS_INCLUDE_DIRS} ) endif ( ) -# camd and ccolamd: +# CAMD and CCOLAMD: if ( NOT NCAMD ) - include_directories ( ${CAMD_INCLUDE_DIR} ) - target_link_libraries ( cholmod PRIVATE ${CAMD_LIBRARIES} ) + target_link_libraries ( CHOLMOD PRIVATE SuiteSparse::CAMD ) if ( NOT NSTATIC ) - target_link_libraries ( cholmod_static PUBLIC ${CAMD_STATIC} ) + set ( CHOLMOD_STATIC_MODULES "${CHOLMOD_STATIC_MODULES} CAMD" ) + if ( TARGET SuiteSparse::CAMD_static ) + target_link_libraries ( CHOLMOD_static PUBLIC SuiteSparse::CAMD_static ) + else ( ) + target_link_libraries ( CHOLMOD_static PUBLIC SuiteSparse::CAMD ) + endif ( ) endif ( ) - include_directories ( ${CCOLAMD_INCLUDE_DIR} ) - target_link_libraries ( cholmod PRIVATE ${CCOLAMD_LIBRARIES} ) + + target_link_libraries ( CHOLMOD PRIVATE SuiteSparse::CCOLAMD ) if ( NOT NSTATIC ) - target_link_libraries ( cholmod_static PUBLIC ${CCOLAMD_STATIC} ) + set ( CHOLMOD_STATIC_MODULES "${CHOLMOD_STATIC_MODULES} CCOLAMD" ) + if ( TARGET SuiteSparse::CCOLAMD_static ) + target_link_libraries ( CHOLMOD_static PUBLIC SuiteSparse::CCOLAMD_static ) + else ( ) + target_link_libraries ( CHOLMOD_static PUBLIC SuiteSparse::CCOLAMD ) + endif ( ) endif ( ) endif ( ) @@ -413,34 +472,139 @@ if ( NOT NPARTITION ) include_directories ( SuiteSparse_metis/include ) endif ( ) -# cholmod_cuda +# CHOLMOD_CUDA if ( SUITESPARSE_CUDA ) message ( STATUS "CHOLMOD cuda: " ${CHOLMOD_CUDA} ) - target_link_libraries ( cholmod PRIVATE ${CHOLMOD_CUDA} ) + target_link_libraries ( CHOLMOD PRIVATE CHOLMOD_CUDA ${CUDA_LIBRARIES} ) + if ( NOT NSTATIC ) + target_link_libraries ( CHOLMOD_static PUBLIC CHOLMOD_CUDA_static ${CUDA_LIBRARIES} ) + endif ( ) + target_link_libraries ( CHOLMOD PRIVATE CUDA::nvrtc CUDA::cudart_static + CUDA::nvToolsExt CUDA::cublas ) + target_include_directories ( CHOLMOD INTERFACE + $ ) if ( NOT NSTATIC ) - target_link_libraries ( cholmod_static PUBLIC ${CHOLMOD_CUDA_STATIC} ) + target_link_libraries ( CHOLMOD_static PUBLIC CUDA::nvrtc CUDA::cudart_static + CUDA::nvToolsExt CUDA::cublas ) + endif ( ) + + set ( old_CMAKE_EXTRA_INCLUDE_FILES CMAKE_EXTRA_INCLUDE_FILES ) + list ( APPEND CMAKE_EXTRA_INCLUDE_FILES "stdlib.h" ) + check_type_size ( "__compar_fn_t" COMPAR_FN_T ) + set ( CMAKE_EXTRA_INCLUDE_FILES old_CMAKE_EXTRA_INCLUDE_FILES ) + + if ( NOT HAVE_COMPAR_FN_T ) + target_compile_definitions ( CHOLMOD PRIVATE NCOMPAR_FN_T ) + if ( NOT NSTATIC ) + target_compile_definitions ( CHOLMOD_static PRIVATE NCOMPAR_FN_T ) + endif ( ) endif ( ) + endif ( ) #------------------------------------------------------------------------------- # CHOLMOD installation location #------------------------------------------------------------------------------- -install ( TARGETS cholmod +include ( CMakePackageConfigHelpers ) + +install ( TARGETS CHOLMOD + EXPORT CHOLMODTargets LIBRARY DESTINATION ${SUITESPARSE_LIBDIR} ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} RUNTIME DESTINATION ${SUITESPARSE_BINDIR} PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} ) -install ( FILES - cmake_modules/FindCHOLMOD.cmake - cmake_modules/FindCHOLMOD_CUDA.cmake - DESTINATION ${SUITESPARSE_LIBDIR}/cmake/SuiteSparse - COMPONENT Development ) if ( NOT NSTATIC ) - install ( TARGETS cholmod_static + install ( TARGETS CHOLMOD_static + EXPORT CHOLMODTargets ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} ) endif ( ) +# create (temporary) export target file during build +export ( EXPORT CHOLMODTargets + NAMESPACE SuiteSparse:: + FILE ${CMAKE_CURRENT_BINARY_DIR}/CHOLMODTargets.cmake ) + +# install export target, config and version files for find_package +install ( EXPORT CHOLMODTargets + NAMESPACE SuiteSparse:: + DESTINATION ${SUITESPARSE_LIBDIR}/cmake/CHOLMOD ) + +# generate config file to be used in common build tree +set ( SUITESPARSE_IN_BUILD_TREE on ) +configure_package_config_file ( + Config/CHOLMODConfig.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/CHOLMODConfig.cmake + INSTALL_DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/CHOLMODConfig.cmake ) + +# generate config file to be installed +set ( SUITESPARSE_IN_BUILD_TREE off ) +configure_package_config_file ( + Config/CHOLMODConfig.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/target/CHOLMODConfig.cmake + INSTALL_DESTINATION ${SUITESPARSE_LIBDIR}/cmake/CHOLMOD ) + +write_basic_package_version_file ( + ${CMAKE_CURRENT_BINARY_DIR}/CHOLMODConfigVersion.cmake + COMPATIBILITY SameMajorVersion ) + +install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/target/CHOLMODConfig.cmake + ${CMAKE_CURRENT_BINARY_DIR}/CHOLMODConfigVersion.cmake + DESTINATION ${SUITESPARSE_LIBDIR}/cmake/CHOLMOD ) + +#------------------------------------------------------------------------------- +# create pkg-config file +#------------------------------------------------------------------------------- + +if ( NOT MSVC ) + # This might be something like: + # /usr/lib/libgomp.so;/usr/lib/libpthread.a;m + # convert to -l flags for pkg-config, i.e.: "-lgomp -lpthread -lm" + set ( CHOLMOD_STATIC_LIBS_LIST ${CHOLMOD_STATIC_LIBS} ) + set ( CHOLMOD_STATIC_LIBS "" ) + foreach ( _lib ${CHOLMOD_STATIC_LIBS_LIST} ) + string ( FIND ${_lib} "." _pos REVERSE ) + if ( ${_pos} EQUAL "-1" ) + set ( CHOLMOD_STATIC_LIBS "${CHOLMOD_STATIC_LIBS} -l${_lib}" ) + continue () + endif ( ) + foreach ( _kind IN ITEMS "IMPORT" "SHARED" "STATIC" ) + set ( _regex ".*\\/(lib)?([^\\.]*)(${CMAKE_${_kind}_LIBRARY_SUFFIX})" ) + if ( ${_lib} MATCHES ${_regex} ) + string ( REGEX REPLACE ${_regex} "\\2" _libname ${_lib} ) + if ( NOT "${_libname}" STREQUAL "" ) + set ( CHOLMOD_STATIC_LIBS "${CHOLMOD_STATIC_LIBS} -l${_libname}" ) + break () + endif ( ) + endif ( ) + endforeach ( ) + endforeach ( ) + + set ( prefix "${CMAKE_INSTALL_PREFIX}" ) + set ( exec_prefix "\${prefix}" ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) + if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) + set ( libdir "${SUITESPARSE_LIBDIR}") + else ( ) + set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") + endif ( ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) + if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) + set ( includedir "${SUITESPARSE_INCLUDEDIR}") + else ( ) + set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + endif ( ) + configure_file ( + Config/CHOLMOD.pc.in + CHOLMOD.pc + @ONLY + NEWLINE_STYLE LF ) + install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/CHOLMOD.pc + DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) +endif ( ) + #------------------------------------------------------------------------------- # Demo library and programs #------------------------------------------------------------------------------- @@ -469,9 +633,18 @@ if ( DEMO ) endif ( ) # Libraries required for Demo programs - target_link_libraries ( cholmod_demo PUBLIC cholmod ${CHOLMOD_CUDA} ${SUITESPARSE_CONFIG_LIBRARIES} ) - target_link_libraries ( cholmod_l_demo PUBLIC cholmod ${CHOLMOD_CUDA} ${SUITESPARSE_CONFIG_LIBRARIES} ) - target_link_libraries ( cholmod_simple PUBLIC cholmod ${CHOLMOD_CUDA} ) + target_link_libraries ( cholmod_demo PUBLIC CHOLMOD SuiteSparse::SuiteSparseConfig ) + if ( SUITESPARSE_CUDA ) + target_link_libraries ( cholmod_demo PUBLIC CHOLMOD_CUDA ) + endif ( ) + target_link_libraries ( cholmod_l_demo PUBLIC CHOLMOD SuiteSparse::SuiteSparseConfig ) + if ( SUITESPARSE_CUDA ) + target_link_libraries ( cholmod_l_demo PUBLIC CHOLMOD_CUDA ) + endif ( ) + target_link_libraries ( cholmod_simple PUBLIC CHOLMOD ) + if ( SUITESPARSE_CUDA ) + target_link_libraries ( cholmod_simple PUBLIC CHOLMOD_CUDA ) + endif ( ) else ( ) diff --git a/CHOLMOD/Check/cholmod_check.c b/CHOLMOD/Check/cholmod_check.c index 45972b6f7..857163e40 100644 --- a/CHOLMOD/Check/cholmod_check.c +++ b/CHOLMOD/Check/cholmod_check.c @@ -69,7 +69,7 @@ /* === printing definitions ================================================= */ /* ========================================================================== */ -#ifdef LONG +#if ( ITYPE == CHOLMOD_LONG ) #define I8 "%8ld" #define I_8 "%-8ld" #else diff --git a/CHOLMOD/Cholesky/cholmod_amd.c b/CHOLMOD/Cholesky/cholmod_amd.c index 089830bcf..ef4eff006 100644 --- a/CHOLMOD/Cholesky/cholmod_amd.c +++ b/CHOLMOD/Cholesky/cholmod_amd.c @@ -166,7 +166,7 @@ int CHOLMOD(amd) Control [AMD_AGGRESSIVE] = Common->method [Common->current].aggressive ; } -#ifdef LONG +#if ( ITYPE == CHOLMOD_LONG ) amd_l2 (n, C->p, C->i, Len, C->nzmax, cnz, Nv, Next, Perm, Head, Elen, Degree, Wi, Control, Info) ; #else diff --git a/CHOLMOD/Cholesky/cholmod_colamd.c b/CHOLMOD/Cholesky/cholmod_colamd.c index 6980afecb..c14b7d0d3 100644 --- a/CHOLMOD/Cholesky/cholmod_colamd.c +++ b/CHOLMOD/Cholesky/cholmod_colamd.c @@ -92,7 +92,7 @@ int CHOLMOD(colamd) s = CHOLMOD(mult_size_t) (nrow, 4, &ok) ; s = CHOLMOD(add_size_t) (s, ncol, &ok) ; -#ifdef LONG +#if ( ITYPE == CHOLMOD_LONG ) alen = colamd_l_recommended (A->nzmax, ncol, nrow) ; colamd_l_set_defaults (knobs) ; #else @@ -151,7 +151,7 @@ int CHOLMOD(colamd) Int stats [COLAMD_STATS] ; Cp = C->p ; -#ifdef LONG +#if ( ITYPE == CHOLMOD_LONG ) colamd_l (ncol, nrow, alen, C->i, Cp, knobs, stats) ; #else colamd (ncol, nrow, alen, C->i, Cp, knobs, stats) ; diff --git a/CHOLMOD/Cholesky/cholmod_postorder.c b/CHOLMOD/Cholesky/cholmod_postorder.c index edacaea14..a6e67d4b2 100644 --- a/CHOLMOD/Cholesky/cholmod_postorder.c +++ b/CHOLMOD/Cholesky/cholmod_postorder.c @@ -139,7 +139,7 @@ Int CHOLMOD(postorder) /* return # of nodes postordered */ ( /* ---- input ---- */ Int *Parent, /* size n. Parent [j] = p if p is the parent of j */ - size_t n, + size_t n_input, Int *Weight, /* size n, optional. Weight [j] is weight of node j */ /* ---- output --- */ Int *Post, /* size n. Post [k] = j is kth in postordered tree */ @@ -151,6 +151,7 @@ Int CHOLMOD(postorder) /* return # of nodes postordered */ Int j, p, k, w, nextj ; size_t s ; int ok = TRUE ; + Int n = (Int) n_input ; /* ---------------------------------------------------------------------- */ /* check inputs */ @@ -166,7 +167,7 @@ Int CHOLMOD(postorder) /* return # of nodes postordered */ /* ---------------------------------------------------------------------- */ /* s = 2*n */ - s = CHOLMOD(mult_size_t) (n, 2, &ok) ; + s = CHOLMOD(mult_size_t) (n_input, (size_t) 2, &ok) ; if (!ok) { ERROR (CHOLMOD_TOO_LARGE, "problem too large") ; diff --git a/CHOLMOD/Config/CHOLMOD.pc.in b/CHOLMOD/Config/CHOLMOD.pc.in new file mode 100644 index 000000000..7c079cbfe --- /dev/null +++ b/CHOLMOD/Config/CHOLMOD.pc.in @@ -0,0 +1,17 @@ +# CHOLMOD, Copyright (c) 2005-2023, Timothy A. Davis. +# All Rights Reserved. +# SPDX-License-Identifier: LGPL-2.1-or-later AND GPL-2.0-or-later AND Apache-2.0 + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: CHOLMOD +URL: https://github.com/DrTimothyAldenDavis/SuiteSparse +Description: Routines for factorizing sparse symmetric positive definite matrices in SuiteSparse +Version: @CHOLMOD_VERSION_MAJOR@.@CHOLMOD_VERSION_MINOR@.@CHOLMOD_VERSION_SUB@ +Requires.private: SuiteSparse_config AMD COLAMD @CHOLMOD_STATIC_MODULES@ +Libs: -L${libdir} -lcholmod +Libs.private: @CHOLMOD_STATIC_LIBS@ +Cflags: -I${includedir} diff --git a/CHOLMOD/Config/CHOLMODConfig.cmake.in b/CHOLMOD/Config/CHOLMODConfig.cmake.in new file mode 100644 index 000000000..ac747fddb --- /dev/null +++ b/CHOLMOD/Config/CHOLMODConfig.cmake.in @@ -0,0 +1,136 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/CHOLMOD/cmake_modules/CHOLMODConfig.cmake +#------------------------------------------------------------------------------- + +# The following copyright and license applies to just this file only, not to +# the library itself: +# CHOLMODConfig.cmake, Copyright (c) 2023, Timothy A. Davis. All Rights Reserved. +# SPDX-License-Identifier: BSD-3-clause + +#------------------------------------------------------------------------------- + +# Finds the CHOLMOD include file and compiled library. +# The following targets are defined: +# SuiteSparse::CHOLMOD - for the shared library (if available) +# SuiteSparse::CHOLMOD_static - for the static library (if available) + +# For backward compatibility the following variables are set: + +# CHOLMOD_INCLUDE_DIR - where to find cholmod.h +# CHOLMOD_LIBRARY - compiled CHOLMOD library +# CHOLMOD_LIBRARIES - libraries when using CHOLMOD +# CHOLMOD_FOUND - true if CHOLMOD found + +# Set ``CMAKE_MODULE_PATH`` to the parent folder where this module file is +# installed. + +#------------------------------------------------------------------------------- + +@PACKAGE_INIT@ + +set ( CHOLMOD_DATE "@CHOLMOD_DATE@" ) +set ( CHOLMOD_VERSION_MAJOR @CHOLMOD_VERSION_MAJOR@ ) +set ( CHOLMOD_VERSION_MINOR @CHOLMOD_VERSION_MINOR@ ) +set ( CHOLMOD_VERSION_PATCH @CHOLMOD_VERSION_SUB@ ) +set ( CHOLMOD_VERSION "@CHOLMOD_VERSION_MAJOR@.@CHOLMOD_VERSION_MINOR@.@CHOLMOD_VERSION_SUB@" ) + +if ( @SUITESPARSE_CUDA@ ) + # Look for imported targets of additional dependency if CHOLMOD was built with CUDA + + if ( @SUITESPARSE_IN_BUILD_TREE@ ) + # First check in a common build tree + find_package ( CHOLMOD_CUDA @CHOLMOD_VERSION_MAJOR@.@CHOLMOD_VERSION_MINOR@.@CHOLMOD_VERSION_SUB@ + PATHS ${CMAKE_SOURCE_DIR}/../CHOLMOD/build NO_DEFAULT_PATH ) + # Then, check in the currently active CMAKE_MODULE_PATH + if ( NOT TARGET SuiteSparse::CHOLMOD_CUDA ) + find_package ( CHOLMOD_CUDA @CHOLMOD_VERSION_MAJOR@.@CHOLMOD_VERSION_MINOR@.@CHOLMOD_VERSION_SUB@ REQUIRED ) + endif ( ) + else ( ) + find_package ( CHOLMOD_CUDA @CHOLMOD_VERSION_MAJOR@.@CHOLMOD_VERSION_MINOR@.@CHOLMOD_VERSION_SUB@ REQUIRED ) + endif ( ) +endif ( ) + +include ( ${CMAKE_CURRENT_LIST_DIR}/CHOLMODTargets.cmake ) + +# The following is only for backward compatibility with FindCHOLMOD. + +set ( _target_shared SuiteSparse::CHOLMOD ) +set ( _target_static SuiteSparse::CHOLMOD_static ) +set ( _var_prefix "CHOLMOD" ) + +get_target_property ( ${_var_prefix}_INCLUDE_DIR ${_target_shared} INTERFACE_INCLUDE_DIRECTORIES ) +if ( ${_var_prefix}_INCLUDE_DIR ) + # First item in SuiteSparse targets contains the "main" header directory. + list ( GET ${_var_prefix}_INCLUDE_DIR 0 ${_var_prefix}_INCLUDE_DIR ) +endif ( ) +get_target_property ( ${_var_prefix}_LIBRARY ${_target_shared} IMPORTED_IMPLIB ) +if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} IMPORTED_LOCATION ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) +endif ( ) +if ( TARGET ${_target_static} ) + get_target_property ( ${_var_prefix}_STATIC ${_target_static} IMPORTED_LOCATION ) +endif ( ) + +# Check for most common build types +set ( _config_types "Debug" "Release" "RelWithDebInfo" "MinSizeRel" ) + +get_property ( _isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG ) +if ( _isMultiConfig ) + # For multi-configuration generators (e.g., Visual Studio), prefer those + # configurations. + list ( PREPEND _config_types ${CMAKE_CONFIGURATION_TYPES} ) +else ( ) + # For single-configuration generators, prefer the current configuration. + list ( PREPEND _config_types ${CMAKE_BUILD_TYPE} ) +endif ( ) + +list ( REMOVE_DUPLICATES _config_types ) + +foreach ( _config ${_config_types} ) + string ( TOUPPER ${_config} _uc_config ) + if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} + IMPORTED_IMPLIB_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) + endif ( ) + if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} + IMPORTED_LOCATION_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) + endif ( ) + if ( TARGET ${_target_static} AND NOT ${_var_prefix}_STATIC ) + get_target_property ( _library_chk ${_target_static} + IMPORTED_LOCATION_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_STATIC ${_library_chk} ) + endif ( ) + endif ( ) +endforeach ( ) + +set ( CHOLMOD_LIBRARIES ${CHOLMOD_LIBRARY} ) + +macro ( suitesparse_check_exist _var _files ) + # ignore generator expressions + string ( GENEX_STRIP "${_files}" _files2 ) + + foreach ( _file ${_files2} ) + if ( NOT EXISTS "${_file}" ) + message ( FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist!" ) + endif ( ) + endforeach () +endmacro ( ) + +suitesparse_check_exist ( CHOLMOD_INCLUDE_DIR ${CHOLMOD_INCLUDE_DIR} ) +suitesparse_check_exist ( CHOLMOD_LIBRARY ${CHOLMOD_LIBRARY} ) + +message ( STATUS "CHOLMOD version: ${CHOLMOD_VERSION}" ) +message ( STATUS "CHOLMOD include: ${CHOLMOD_INCLUDE_DIR}" ) +message ( STATUS "CHOLMOD library: ${CHOLMOD_LIBRARY}" ) +message ( STATUS "CHOLMOD static: ${CHOLMOD_STATIC}" ) diff --git a/CHOLMOD/Config/CHOLMOD_CUDA.pc.in b/CHOLMOD/Config/CHOLMOD_CUDA.pc.in new file mode 100644 index 000000000..1c48f12ca --- /dev/null +++ b/CHOLMOD/Config/CHOLMOD_CUDA.pc.in @@ -0,0 +1,17 @@ +# CHOLMOD_CUDA, Copyright (c) 2005-2023, Timothy A. Davis. +# All Rights Reserved. +# SPDX-License-Identifier: GPL-2.0-or-later + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +# FIXME: Which flags do we need for static linking? + +Name: CHOLMOD_CUDA +URL: https://github.com/DrTimothyAldenDavis/SuiteSparse +Description: CHOLMOD/GPU module in SuiteSparse +Version: @CHOLMOD_VERSION_MAJOR@.@CHOLMOD_VERSION_MINOR@.@CHOLMOD_VERSION_SUB@ +Libs: -L${libdir} -lcholmod_cuda +Cflags: -I${includedir} diff --git a/CHOLMOD/Config/CHOLMOD_CUDAConfig.cmake.in b/CHOLMOD/Config/CHOLMOD_CUDAConfig.cmake.in new file mode 100644 index 000000000..9b7b6f26b --- /dev/null +++ b/CHOLMOD/Config/CHOLMOD_CUDAConfig.cmake.in @@ -0,0 +1,121 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/CHOLMOD/cmake_modules/CHOLMOD_CUDAConfig.cmake +#------------------------------------------------------------------------------- + +# The following copyright and license applies to just this file only, not to +# the library itself: +# CHOLMOD_CUDAConfig.cmake, Copyright (c) 2023, Timothy A. Davis. All Rights Reserved. +# SPDX-License-Identifier: BSD-3-clause + +#------------------------------------------------------------------------------- + +# Finds the CHOLMOD_CUDA include file and compiled library. +# The following targets are defined: +# SuiteSparse::CHOLMOD_CUDA - for the shared library (if available) +# SuiteSparse::CHOLMOD_CUDA_static - for the static library (if available) + +# For backward compatibility the following variables are set: + +# CHOLMOD_CUDA_LIBRARY - dynamic CHOLMOD_CUDA library +# CHOLMOD_CUDA_STATIC - static CHOLMOD_CUDA library +# CHOLMOD_CUDA_LIBRARIES - libraries when using CHOLMOD_CUDA +# CHOLMOD_CUDA_FOUND - true if CHOLMOD_CUDA found + +# Set ``CMAKE_MODULE_PATH`` to the parent folder where this module file is +# installed. + +#------------------------------------------------------------------------------- + +@PACKAGE_INIT@ + +set ( CHOLMOD_CUDA_DATE "@CHOLMOD_DATE@" ) +set ( CHOLMOD_CUDA_VERSION_MAJOR @CHOLMOD_VERSION_MAJOR@ ) +set ( CHOLMOD_CUDA_VERSION_MINOR @CHOLMOD_VERSION_MINOR@ ) +set ( CHOLMOD_CUDA_VERSION_PATCH @CHOLMOD_VERSION_SUB@ ) +set ( CHOLMOD_CUDA_VERSION "@CHOLMOD_VERSION_MAJOR@.@CHOLMOD_VERSION_MINOR@.@CHOLMOD_VERSION_SUB@" ) + +# Look for NVIDIA CUDA toolkit +find_package ( CUDAToolkit @CUDAToolkit_VERSION_MAJOR@ REQUIRED ) + +include ( ${CMAKE_CURRENT_LIST_DIR}/CHOLMOD_CUDATargets.cmake ) + +# The following is only for backward compatibility with FindCHOLMOD_CUDA. + +set ( _target_shared SuiteSparse::CHOLMOD_CUDA ) +set ( _target_static SuiteSparse::CHOLMOD_CUDA_static ) +set ( _var_prefix "CHOLMOD_CUDA" ) + +get_target_property ( ${_var_prefix}_INCLUDE_DIR ${_target_shared} INTERFACE_INCLUDE_DIRECTORIES ) +if ( ${_var_prefix}_INCLUDE_DIR ) + # First item in SuiteSparse targets contains the "main" header directory. + list ( GET ${_var_prefix}_INCLUDE_DIR 0 ${_var_prefix}_INCLUDE_DIR ) +endif ( ) +get_target_property ( ${_var_prefix}_LIBRARY ${_target_shared} IMPORTED_IMPLIB ) +if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} IMPORTED_LOCATION ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) +endif ( ) +if ( TARGET ${_target_static} ) + get_target_property ( ${_var_prefix}_STATIC ${_target_static} IMPORTED_LOCATION ) +endif ( ) + +# Check for most common build types +set ( _config_types "Debug" "Release" "RelWithDebInfo" "MinSizeRel" ) + +get_property ( _isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG ) +if ( _isMultiConfig ) + # For multi-configuration generators (e.g., Visual Studio), prefer those + # configurations. + list ( PREPEND _config_types ${CMAKE_CONFIGURATION_TYPES} ) +else ( ) + # For single-configuration generators, prefer the current configuration. + list ( PREPEND _config_types ${CMAKE_BUILD_TYPE} ) +endif ( ) + +list ( REMOVE_DUPLICATES _config_types ) + +foreach ( _config ${_config_types} ) + string ( TOUPPER ${_config} _uc_config ) + if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} + IMPORTED_IMPLIB_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) + endif ( ) + if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} + IMPORTED_LOCATION_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) + endif ( ) + if ( TARGET ${_target_static} AND NOT ${_var_prefix}_STATIC ) + get_target_property ( _library_chk ${_target_static} + IMPORTED_LOCATION_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_STATIC ${_library_chk} ) + endif ( ) + endif ( ) +endforeach ( ) + +set ( CHOLMOD_CUDA_LIBRARIES ${CHOLMOD_CUDA_LIBRARY} ) + +macro ( suitesparse_check_exist _var _files ) + # ignore generator expressions + string ( GENEX_STRIP "${_files}" _files2 ) + + foreach ( _file ${_files2} ) + if ( NOT EXISTS "${_file}" ) + message ( FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist!" ) + endif ( ) + endforeach () +endmacro ( ) + +suitesparse_check_exist ( CHOLMOD_CUDA_LIBRARY ${CHOLMOD_CUDA_LIBRARY} ) + +message ( STATUS "CHOLMOD_CUDA version: ${CHOLMOD_CUDA_VERSION}" ) +message ( STATUS "CHOLMOD_CUDA library: ${CHOLMOD_CUDA_LIBRARY}" ) +message ( STATUS "CHOLMOD_CUDA static: ${CHOLMOD_CUDA_STATIC}" ) diff --git a/CHOLMOD/Config/cholmod.h.in b/CHOLMOD/Config/cholmod.h.in index 846619ad6..37c3212d9 100644 --- a/CHOLMOD/Config/cholmod.h.in +++ b/CHOLMOD/Config/cholmod.h.in @@ -102,11 +102,6 @@ #define CHOLMOD_SUB_VERSION @CHOLMOD_VERSION_MINOR@ #define CHOLMOD_SUBSUB_VERSION @CHOLMOD_VERSION_SUB@ -/* make it easy for C++ programs to include CHOLMOD */ -#ifdef __cplusplus -extern "C" { -#endif - /* ========================================================================== */ /* === Include/cholmod_io64 ================================================= */ /* ========================================================================== */ @@ -584,6 +579,11 @@ extern "C" { #define CHOLMOD_AUTO 1 /* select simpl/super depending on matrix */ #define CHOLMOD_SUPERNODAL 2 /* always do supernodal */ +/* make it easy for C++ programs to include CHOLMOD */ +#ifdef __cplusplus +extern "C" { +#endif + typedef struct cholmod_common_struct { /* ---------------------------------------------------------------------- */ @@ -4596,6 +4596,11 @@ int cholmod_l_super_ltsolve (cholmod_factor *, cholmod_dense *, cholmod_dense *, #endif +#ifdef __cplusplus +} +#endif + + /* ========================================================================== */ /* === Include/cholmod_gpu.h ================================================ */ /* ========================================================================== */ @@ -4634,6 +4639,11 @@ int cholmod_l_super_ltsolve (cholmod_factor *, cholmod_dense *, cholmod_dense *, #define CHOLMOD_HANDLE_CUDA_ERROR(e,s) {if (e) {ERROR(CHOLMOD_GPU_PROBLEM,s);}} +/* make it easy for C++ programs to include CHOLMOD */ +#ifdef __cplusplus +extern "C" { +#endif + typedef struct cholmod_gpu_pointers { double *h_Lx [CHOLMOD_HOST_SUPERNODE_BUFFERS] ; @@ -4672,11 +4682,10 @@ void cholmod_l_gpu_end ( cholmod_common *Common ) ; int cholmod_gpu_allocate ( cholmod_common *Common ) ; int cholmod_l_gpu_allocate ( cholmod_common *Common ) ; -#endif - #ifdef __cplusplus } #endif #endif +#endif diff --git a/CHOLMOD/Doc/CHOLMOD_UserGuide.pdf b/CHOLMOD/Doc/CHOLMOD_UserGuide.pdf index 696cefcad..d1f425acc 100644 Binary files a/CHOLMOD/Doc/CHOLMOD_UserGuide.pdf and b/CHOLMOD/Doc/CHOLMOD_UserGuide.pdf differ diff --git a/CHOLMOD/Doc/CHOLMOD_UserGuide.tex b/CHOLMOD/Doc/CHOLMOD_UserGuide.tex index ba3fb078c..184396fb6 100644 --- a/CHOLMOD/Doc/CHOLMOD_UserGuide.tex +++ b/CHOLMOD/Doc/CHOLMOD_UserGuide.tex @@ -48,7 +48,7 @@ \end{abstract} %------------------------------------------------------------------------------- -CHOLMOD Copyright\copyright 2005-2022 by Timothy A. Davis, All Rights Reserved. +CHOLMOD Copyright\copyright 2005-2023 by Timothy A. Davis, All Rights Reserved. Portions are also copyrighted by William W. Hager (the {\tt Modify} Module), and the University of Florida (the {\tt Partition} and {\tt Core} Modules). All Rights Reserved. diff --git a/CHOLMOD/Doc/ChangeLog b/CHOLMOD/Doc/ChangeLog index 3b6410675..6c9f12575 100644 --- a/CHOLMOD/Doc/ChangeLog +++ b/CHOLMOD/Doc/ChangeLog @@ -1,3 +1,14 @@ +Sept 8, 2023: version 4.2.0 + + * cmake updates: SuiteSparse:: namespace by Markus Muetzel + * bug fix: typecast was broken in cholmod_postorder.c + * minor fixes to debug scaffolding and test code: cholmod_internal.h, + cholmod_metis_wrapper.c, Tcov/memory.c. + * support for SPQR: minor changes to support SPQR v4.2.0 with 32-bit + integers; no change to user-visible API. + * METIS now using GKRAND: with threadprivate state variables, to + avoid global system lock when using CHOLMON on many user threads + June 16, 2023: version 4.0.4 * cmake build system updates: update by Markus Muetzel diff --git a/CHOLMOD/Doc/cholmod_version.tex b/CHOLMOD/Doc/cholmod_version.tex index 50daeea59..71a4bfb0e 100644 --- a/CHOLMOD/Doc/cholmod_version.tex +++ b/CHOLMOD/Doc/cholmod_version.tex @@ -1,2 +1,2 @@ % version of SuiteSparse/CHOLMOD -\date{VERSION 4.0.4, June 16, 2023} +\date{VERSION 4.2.0, Sept 8, 2023} diff --git a/CHOLMOD/GPU/CMakeLists.txt b/CHOLMOD/GPU/CMakeLists.txt index 66f95766d..2a009b499 100644 --- a/CHOLMOD/GPU/CMakeLists.txt +++ b/CHOLMOD/GPU/CMakeLists.txt @@ -11,7 +11,7 @@ #------------------------------------------------------------------------------- # cmake 3.22 is required to find the BLAS/LAPACK -cmake_minimum_required ( VERSION 3.19 ) +cmake_minimum_required ( VERSION 3.20 ) message ( STATUS "Building CHOLMOD_CUDA version: v" ${CHOLMOD_VERSION_MAJOR}. @@ -20,37 +20,31 @@ message ( STATUS "Building CHOLMOD_CUDA version: v" include ( SuiteSparsePolicy ) -if ( SUITESPARSE_CUDA ) - project ( cholmod_cuda - VERSION "${CHOLMOD_VERSION_MAJOR}.${CHOLMOD_VERSION_MINOR}.${CHOLMOD_VERSION_SUB}" - LANGUAGES C CXX CUDA ) - set ( CMAKE_CUDA_FLAGS "-cudart=static -lineinfo -DSUITESPARSE_CUDA" ) - set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSUITESPARSE_CUDA" ) - message ( STATUS "C++ flags for CUDA: ${CMAKE_CXX_FLAGS}" ) - message ( STATUS "nvcc flags for CUDA: ${CMAKE_CUDA_FLAGS}" ) - file ( GLOB CHOLMOD_CUDA_SOURCES "cholmod_gpu.c" "cholmod_l_gpu.c" - "cholmod_gpu_kernels.cu" ) -else ( ) - project ( cholmod_cuda - VERSION "${CHOLMOD_VERSION_MAJOR}.${CHOLMOD_VERSION_MINOR}.${CHOLMOD_VERSION_SUB}" - LANGUAGES C CXX ) - file ( GLOB CHOLMOD_CUDA_SOURCES "cholmod_gpu.c" "cholmod_l_gpu.c" ) -endif ( ) +project ( cholmod_cuda + VERSION "${CHOLMOD_VERSION_MAJOR}.${CHOLMOD_VERSION_MINOR}.${CHOLMOD_VERSION_SUB}" + LANGUAGES C CXX CUDA ) +set ( CMAKE_CUDA_FLAGS "-cudart=static -lineinfo -DSUITESPARSE_CUDA" ) +set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSUITESPARSE_CUDA" ) +message ( STATUS "C++ flags for CUDA: ${CMAKE_CXX_FLAGS}" ) +message ( STATUS "nvcc flags for CUDA: ${CMAKE_CUDA_FLAGS}" ) +file ( GLOB CHOLMOD_CUDA_SOURCES "cholmod_gpu.c" "cholmod_l_gpu.c" + "cholmod_gpu_kernels.cu" ) -add_library ( cholmod_cuda SHARED ${CHOLMOD_CUDA_SOURCES} ) +add_library ( CHOLMOD_CUDA SHARED ${CHOLMOD_CUDA_SOURCES} ) -set_target_properties ( cholmod_cuda PROPERTIES +set_target_properties ( CHOLMOD_CUDA PROPERTIES VERSION ${CHOLMOD_VERSION_MAJOR}.${CHOLMOD_VERSION_MINOR}.${CHOLMOD_VERSION_SUB} CXX_STANDARD_REQUIRED ON CXX_STANDARD 17 C_STANDARD_REQUIRED ON C_STANDARD 11 + OUTPUT_NAME cholmod_cuda SOVERSION ${CHOLMOD_VERSION_MAJOR} ) if ( NOT NSTATIC ) - add_library ( cholmod_cuda_static STATIC ${CHOLMOD_CUDA_SOURCES} ) + add_library ( CHOLMOD_CUDA_static STATIC ${CHOLMOD_CUDA_SOURCES} ) - set_target_properties ( cholmod_cuda_static PROPERTIES + set_target_properties ( CHOLMOD_CUDA_static PROPERTIES VERSION ${CHOLMOD_VERSION_MAJOR}.${CHOLMOD_VERSION_MINOR}.${CHOLMOD_VERSION_SUB} CXX_STANDARD_REQUIRED ON CXX_STANDARD 17 @@ -60,7 +54,7 @@ if ( NOT NSTATIC ) SOVERSION ${CHOLMOD_VERSION_MAJOR} ) if ( MSVC ) - set_target_properties ( cholmod_cuda_static PROPERTIES + set_target_properties ( CHOLMOD_CUDA_static PROPERTIES OUTPUT_NAME cholmod_cuda_static ) endif ( ) endif ( ) @@ -76,42 +70,95 @@ set ( CHOLMOD_CUDA_INCLUDES include_directories ( ${CHOLMOD_CUDA_INCLUDES} ${CUDAToolkit_INCLUDE_DIRS} ) -target_include_directories ( cholmod_cuda PUBLIC +target_include_directories ( CHOLMOD_CUDA PRIVATE ${CUDAToolkit_INCLUDE_DIRS} ${CHOLMOD_CUDA_INCLUDES} ) -set_target_properties ( cholmod_cuda PROPERTIES POSITION_INDEPENDENT_CODE ON ) -set_target_properties ( cholmod_cuda PROPERTIES CUDA_SEPARABLE_COMPILATION ON ) +set_target_properties ( CHOLMOD_CUDA PROPERTIES POSITION_INDEPENDENT_CODE ON ) +set_target_properties ( CHOLMOD_CUDA PROPERTIES CUDA_SEPARABLE_COMPILATION ON ) if ( NOT NSTATIC ) - target_include_directories ( cholmod_cuda_static PUBLIC - ${CUDAToolkit_INCLUDE_DIRS} - ${CHOLMOD_CUDA_INCLUDES} ) - set_target_properties ( cholmod_cuda_static PROPERTIES CUDA_SEPARABLE_COMPILATION on ) - set_target_properties ( cholmod_cuda_static PROPERTIES POSITION_INDEPENDENT_CODE on ) +target_include_directories ( CHOLMOD_CUDA_static PRIVATE + ${CUDAToolkit_INCLUDE_DIRS} + ${CHOLMOD_CUDA_INCLUDES} ) +set_target_properties ( CHOLMOD_CUDA_static PROPERTIES CUDA_SEPARABLE_COMPILATION on ) +set_target_properties ( CHOLMOD_CUDA_static PROPERTIES POSITION_INDEPENDENT_CODE on ) endif ( ) -if ( SUITESPARSE_CUDA ) - # this must be a PUBLIC link, not PRIVATE, so the CHOLMOD library - # itself can link against these libraries - target_link_libraries ( cholmod_cuda PUBLIC CUDA::nvrtc CUDA::cudart_static +target_link_libraries ( CHOLMOD_CUDA PRIVATE CUDA::nvrtc CUDA::cudart_static + CUDA::nvToolsExt CUDA::cublas ) +if ( NOT NSTATIC ) + target_link_libraries ( CHOLMOD_CUDA_static PUBLIC CUDA::nvrtc CUDA::cudart_static CUDA::nvToolsExt CUDA::cublas ) - if ( NOT NSTATIC ) - target_link_libraries ( cholmod_cuda_static PUBLIC CUDA::nvrtc CUDA::cudart_static - CUDA::nvToolsExt CUDA::cublas ) - endif ( ) endif ( ) #------------------------------------------------------------------------------- # installation location #------------------------------------------------------------------------------- -install ( TARGETS cholmod_cuda +include ( CMakePackageConfigHelpers ) + +install ( TARGETS CHOLMOD_CUDA + EXPORT CHOLMOD_CUDATargets LIBRARY DESTINATION ${SUITESPARSE_LIBDIR} ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} RUNTIME DESTINATION ${SUITESPARSE_BINDIR} PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} ) if ( NOT NSTATIC ) - install ( TARGETS cholmod_cuda_static + install ( TARGETS CHOLMOD_CUDA_static + EXPORT CHOLMOD_CUDATargets ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} ) endif ( ) + +# create (temporary) export target file during build +export ( EXPORT CHOLMOD_CUDATargets + NAMESPACE SuiteSparse:: + FILE ${CMAKE_CURRENT_BINARY_DIR}/../CHOLMOD_CUDATargets.cmake ) + +# install export target, config and version files for find_package +install ( EXPORT CHOLMOD_CUDATargets + NAMESPACE SuiteSparse:: + DESTINATION ${SUITESPARSE_LIBDIR}/cmake/CHOLMOD_CUDA ) + +configure_package_config_file ( + ../Config/CHOLMOD_CUDAConfig.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/../CHOLMOD_CUDAConfig.cmake + INSTALL_DESTINATION ${SUITESPARSE_LIBDIR}/cmake/CHOLMOD_CUDA ) + +write_basic_package_version_file ( + ${CMAKE_CURRENT_BINARY_DIR}/../CHOLMOD_CUDAConfigVersion.cmake + COMPATIBILITY SameMajorVersion ) + +install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/../CHOLMOD_CUDAConfig.cmake + ${CMAKE_CURRENT_BINARY_DIR}/../CHOLMOD_CUDAConfigVersion.cmake + DESTINATION ${SUITESPARSE_LIBDIR}/cmake/CHOLMOD_CUDA ) + +#------------------------------------------------------------------------------- +# create pkg-config file +#------------------------------------------------------------------------------- + +if ( NOT MSVC ) + set ( prefix "${CMAKE_INSTALL_PREFIX}" ) + set ( exec_prefix "\${prefix}" ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) + if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) + set ( libdir "${SUITESPARSE_LIBDIR}") + else ( ) + set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") + endif ( ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) + if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) + set ( includedir "${SUITESPARSE_INCLUDEDIR}") + else ( ) + set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + endif ( ) + configure_file ( + ../Config/CHOLMOD_CUDA.pc.in + CHOLMOD_CUDA.pc + @ONLY + NEWLINE_STYLE LF ) + install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/CHOLMOD_CUDA.pc + DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) +endif ( ) diff --git a/CHOLMOD/GPU/t_cholmod_gpu.c b/CHOLMOD/GPU/t_cholmod_gpu.c index 0b72de68f..e206ba65a 100644 --- a/CHOLMOD/GPU/t_cholmod_gpu.c +++ b/CHOLMOD/GPU/t_cholmod_gpu.c @@ -49,7 +49,7 @@ void TEMPLATE2 (CHOLMOD (gpu_clear_memory)) int chunk_multiplier = 5; int num_chunks = chunk_multiplier * num_threads; size_t chunksize = size / num_chunks; - size_t i; + int i; #pragma omp parallel for num_threads(num_threads) private(i) schedule(dynamic) for(i = 0; i < num_chunks; i++) { @@ -116,14 +116,16 @@ int TEMPLATE2 (CHOLMOD (gpu_init)) } /* divvy up the memory in dev_mempool */ - gpu_p->d_Lx[0] = Common->dev_mempool; - gpu_p->d_Lx[1] = Common->dev_mempool + Common->devBuffSize; - gpu_p->d_C = Common->dev_mempool + 2*Common->devBuffSize; - gpu_p->d_A[0] = Common->dev_mempool + 3*Common->devBuffSize; - gpu_p->d_A[1] = Common->dev_mempool + 4*Common->devBuffSize; - gpu_p->d_Ls = Common->dev_mempool + 5*Common->devBuffSize; - gpu_p->d_Map = gpu_p->d_Ls + (nls+1)*sizeof(int64_t) ; - gpu_p->d_RelativeMap = gpu_p->d_Map + (n+1)*sizeof(int64_t) ; + // these d_* are (double *) pointers, so add an explicit typecast: + gpu_p->d_Lx[0] = (double *) (Common->dev_mempool) ; + gpu_p->d_Lx[1] = (double *) ((char*)Common->dev_mempool + Common->devBuffSize) ; + gpu_p->d_C = (double *) ((char*)Common->dev_mempool + 2 * Common->devBuffSize) ; + gpu_p->d_A[0] = (double *) ((char*)Common->dev_mempool + 3 * Common->devBuffSize) ; + gpu_p->d_A[1] = (double *) ((char*)Common->dev_mempool + 4 * Common->devBuffSize) ; + // these d_* pointers are (void *): + gpu_p->d_Ls = (char*)Common->dev_mempool + 5 * Common->devBuffSize; + gpu_p->d_Map = (char*)gpu_p->d_Ls + (nls + 1) * sizeof(int64_t); + gpu_p->d_RelativeMap = (char*)gpu_p->d_Map + (n + 1) * sizeof(int64_t) ; /* Copy all of the Ls and Lpi data to the device. If any supernodes are * to be computed on the device then this will be needed, so might as @@ -188,6 +190,9 @@ int TEMPLATE2 (CHOLMOD (gpu_init)) } +#if defined(NCOMPAR_FN_T) +typedef int (*__compar_fn_t)(const void *, const void *); +#endif /* ========================================================================== */ /* === gpu_reorder_descendants ============================================== */ diff --git a/CHOLMOD/Include/cholmod.h b/CHOLMOD/Include/cholmod.h index b14b0d83f..d6c02cbdc 100644 --- a/CHOLMOD/Include/cholmod.h +++ b/CHOLMOD/Include/cholmod.h @@ -97,15 +97,10 @@ #ifndef CHOLMOD_H #define CHOLMOD_H -#define CHOLMOD_DATE "June 16, 2023" +#define CHOLMOD_DATE "Sept 8, 2023" #define CHOLMOD_MAIN_VERSION 4 -#define CHOLMOD_SUB_VERSION 0 -#define CHOLMOD_SUBSUB_VERSION 4 - -/* make it easy for C++ programs to include CHOLMOD */ -#ifdef __cplusplus -extern "C" { -#endif +#define CHOLMOD_SUB_VERSION 2 +#define CHOLMOD_SUBSUB_VERSION 0 /* ========================================================================== */ /* === Include/cholmod_io64 ================================================= */ @@ -584,6 +579,11 @@ extern "C" { #define CHOLMOD_AUTO 1 /* select simpl/super depending on matrix */ #define CHOLMOD_SUPERNODAL 2 /* always do supernodal */ +/* make it easy for C++ programs to include CHOLMOD */ +#ifdef __cplusplus +extern "C" { +#endif + typedef struct cholmod_common_struct { /* ---------------------------------------------------------------------- */ @@ -4596,6 +4596,11 @@ int cholmod_l_super_ltsolve (cholmod_factor *, cholmod_dense *, cholmod_dense *, #endif +#ifdef __cplusplus +} +#endif + + /* ========================================================================== */ /* === Include/cholmod_gpu.h ================================================ */ /* ========================================================================== */ @@ -4634,6 +4639,11 @@ int cholmod_l_super_ltsolve (cholmod_factor *, cholmod_dense *, cholmod_dense *, #define CHOLMOD_HANDLE_CUDA_ERROR(e,s) {if (e) {ERROR(CHOLMOD_GPU_PROBLEM,s);}} +/* make it easy for C++ programs to include CHOLMOD */ +#ifdef __cplusplus +extern "C" { +#endif + typedef struct cholmod_gpu_pointers { double *h_Lx [CHOLMOD_HOST_SUPERNODE_BUFFERS] ; @@ -4672,11 +4682,10 @@ void cholmod_l_gpu_end ( cholmod_common *Common ) ; int cholmod_gpu_allocate ( cholmod_common *Common ) ; int cholmod_l_gpu_allocate ( cholmod_common *Common ) ; -#endif - #ifdef __cplusplus } #endif #endif +#endif diff --git a/CHOLMOD/Include/cholmod_internal.h b/CHOLMOD/Include/cholmod_internal.h index 892c203f1..e14eeb48c 100644 --- a/CHOLMOD/Include/cholmod_internal.h +++ b/CHOLMOD/Include/cholmod_internal.h @@ -133,45 +133,12 @@ /* === int/long and double/float definitions ================================ */ /* ========================================================================== */ -/* CHOLMOD is designed for 3 types of integer variables: - * - * (1) all integers are int - * (2) most integers are int, some are int64_t - * (3) all integers are int64_t - * - * and two kinds of floating-point values: - * - * (1) double - * (2) float - * - * the complex types (ANSI-compatible complex, and MATLAB-compatable zomplex) - * are based on the double or float type, and are not selected here. They - * are typically selected via template routines. - * - * This gives 6 different modes in which CHOLMOD can be compiled (only the - * first two are currently supported): - * - * DINT double, int prefix: cholmod_ - * DLONG double, int64_t prefix: cholmod_l_ - * DMIX double, mixed int/int64_t prefix: cholmod_m_ - * SINT float, int prefix: cholmod_si_ - * SLONG float, int64_t prefix: cholmod_sl_ - * SMIX float, mixed int/log prefix: cholmod_sm_ - * - * These are selected with compile time flags (-DDLONG, for example). If no - * flag is selected, the default is DINT. - * - * All six versions use the same include files. The user-visible include files - * are completely independent of which int/long/double/float version is being - * used. The integer / real types in all data structures (sparse, triplet, - * dense, common, and triplet) are defined at run-time, not compile-time, so - * there is only one "cholmod_sparse" data type. Void pointers are used inside - * that data structure to point to arrays of the proper type. Each data - * structure has an itype and dtype field which determines the kind of basic - * types used. These are defined in Include/cholmod_core.h. - * - * FUTURE WORK: support all six types (float, and mixed int/long) - */ +#include "cholmod_types.h" + +#ifndef DLONG +// GPU acceleration only available for the DLONG case (double, int64) +#undef SUITESPARSE_CUDA +#endif /* -------------------------------------------------------------------------- */ /* routines for doing arithmetic on size_t, and checking for overflow */ @@ -182,49 +149,6 @@ size_t cholmod_mult_size_t (size_t a, size_t k, int *ok) ; size_t cholmod_l_add_size_t (size_t a, size_t b, int *ok) ; size_t cholmod_l_mult_size_t (size_t a, size_t k, int *ok) ; -/* -------------------------------------------------------------------------- */ -/* double (also complex double), int64_t */ -/* -------------------------------------------------------------------------- */ - -#ifdef DLONG -#define Real double -#define Int int64_t -#define UInt uint64_t -#define Int_max INT64_MAX -#define CHOLMOD(name) cholmod_l_ ## name -#define LONG -#define DOUBLE -#define ITYPE CHOLMOD_LONG -#define DTYPE CHOLMOD_DOUBLE -#define ID "%" PRId64 - -/* -------------------------------------------------------------------------- */ -/* double (also complex double), int: this is the default */ -/* -------------------------------------------------------------------------- */ - -#else - -#ifndef DINT -#define DINT -#endif -#define INT -#define DOUBLE - -#define Real double -#define Int int32_t -#define UInt uint32_t -#define Int_max INT32_MAX -#define CHOLMOD(name) cholmod_ ## name -#define ITYPE CHOLMOD_INT -#define DTYPE CHOLMOD_DOUBLE -#define ID "%d" - -/* GPU acceleration is not available for the int version of CHOLMOD */ -#undef SUITESPARSE_CUDA - -#endif - - /* ========================================================================== */ /* === Include/cholmod_complexity.h ========================================= */ /* ========================================================================== */ @@ -640,7 +564,7 @@ int cholmod_l_dump_work(int, int, int64_t, cholmod_common *) ; #define PRK(k,params) \ { \ - if (CHOLMOD(dump) >= (k) \ + if (CHOLMOD(dump) >= (k)) \ { \ int (*printf_func) (const char *, ...) ; \ printf_func = SuiteSparse_config_printf_func_get ( ) ; \ diff --git a/CHOLMOD/Include/cholmod_types.h b/CHOLMOD/Include/cholmod_types.h new file mode 100644 index 000000000..e82f783d7 --- /dev/null +++ b/CHOLMOD/Include/cholmod_types.h @@ -0,0 +1,139 @@ +//------------------------------------------------------------------------------ +// CHOLMOD/Include/cholmod_types.h +//------------------------------------------------------------------------------ + +// CHOLMOD/Include/cholmod_types.h. Copyright (C) 2005-2023, +// Timothy A. Davis. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +//------------------------------------------------------------------------------ + +// CHOLMOD internal include file: defining integer and floating-point types. +// This file is suitable for inclusion in C and C++ codes. It can be +// #include'd more than once. + +// The #include'ing file defines one of four macros (DINT, DLONG, SINT, or +// SLONG) before #include'ing this file. + +/* ========================================================================== */ +/* === int/long and double/float definitions ================================ */ +/* ========================================================================== */ + +/* CHOLMOD is designed for 3 types of integer variables: + * + * (1) all integers are int + * (2) most integers are int, some are int64_t + * (3) all integers are int64_t + * + * and two kinds of floating-point values: + * + * (1) double + * (2) float + * + * the complex types (ANSI-compatible complex, and MATLAB-compatable zomplex) + * are based on the double or float type, and are not selected here. They + * are typically selected via template routines. + * + * This gives 6 different modes in which CHOLMOD can be compiled (only the + * first two are currently supported): + * + * DINT double, int prefix: cholmod_ + * DLONG double, int64_t prefix: cholmod_l_ + * DMIX double, mixed int/int64_t prefix: cholmod_m_ + * SINT float, int prefix: cholmod_si_ + * SLONG float, int64_t prefix: cholmod_sl_ + * SMIX float, mixed int/log prefix: cholmod_sm_ + * + * These are selected with compile time flags (-DDLONG, for example). If no + * flag is selected, the default is DINT. + * + * All six versions use the same include files. The user-visible include files + * are completely independent of which int/long/double/float version is being + * used. The integer / real types in all data structures (sparse, triplet, + * dense, common, and triplet) are defined at run-time, not compile-time, so + * there is only one "cholmod_sparse" data type. Void pointers are used inside + * that data structure to point to arrays of the proper type. Each data + * structure has an itype and dtype field which determines the kind of basic + * types used. These are defined in Include/cholmod_core.h. + * + * FUTURE WORK: support all six types (float, and mixed int/long) + * SINT and SLONG are in progress. + */ + +// ----------------------------------------------------------------------------- + +#undef Real +#undef Int +#undef UInt +#undef Int_max +#undef CHOLMOD +#undef ITYPE +#undef DTYPE +#undef ID + +#if defined ( SLONG ) + + //-------------------------------------------------------------------------- + // SLONG: float (also complex float), int64_t + //-------------------------------------------------------------------------- + + #define Real float + #define Int int64_t + #define UInt uint64_t + #define Int_max INT64_MAX + #define CHOLMOD(name) cholmod_sl_ ## name + #define ITYPE CHOLMOD_LONG + #define DTYPE CHOLMOD_SINGLE + #define ID "%" PRId64 + +#elif defined ( SINT ) + + //-------------------------------------------------------------------------- + // SINT: float (also complex float), int32_t + //-------------------------------------------------------------------------- + + #define Real float + #define Int int32_t + #define UInt uint32_t + #define Int_max INT32_MAX + #define CHOLMOD(name) cholmod_si_ ## name + #define ITYPE CHOLMOD_INT + #define DTYPE CHOLMOD_SINGLE + #define ID "%d" + +#elif defined ( DLONG ) + + //-------------------------------------------------------------------------- + // DLONG: double (also complex double), int64_t + //-------------------------------------------------------------------------- + + #define Real double + #define Int int64_t + #define UInt uint64_t + #define Int_max INT64_MAX + #define CHOLMOD(name) cholmod_l_ ## name + #define ITYPE CHOLMOD_LONG + #define DTYPE CHOLMOD_DOUBLE + #define ID "%" PRId64 + +#else + + //-------------------------------------------------------------------------- + // DINT: double (also complex double), int32 + //-------------------------------------------------------------------------- + + #ifndef DINT + #define DINT + #endif + + #define Real double + #define Int int32_t + #define UInt uint32_t + #define Int_max INT32_MAX + #define CHOLMOD(name) cholmod_ ## name + #define ITYPE CHOLMOD_INT + #define DTYPE CHOLMOD_DOUBLE + #define ID "%d" + +#endif + diff --git a/CHOLMOD/Partition/cholmod_camd.c b/CHOLMOD/Partition/cholmod_camd.c index 7b0b78965..40747391b 100644 --- a/CHOLMOD/Partition/cholmod_camd.c +++ b/CHOLMOD/Partition/cholmod_camd.c @@ -177,7 +177,7 @@ int CHOLMOD(camd) Control [CAMD_AGGRESSIVE] = Common->method [Common->current].aggressive; } -#ifdef LONG +#if ( ITYPE == CHOLMOD_LONG ) /* DEBUG (camd_l_debug_init ("cholmod_l_camd")) ; */ camd_l2 (n, C->p, C->i, Len, C->nzmax, cnz, Nv, Next, Perm, Head, Elen, Degree, Wi, Control, Info, Cmember, BucketSet) ; diff --git a/CHOLMOD/Partition/cholmod_ccolamd.c b/CHOLMOD/Partition/cholmod_ccolamd.c index 231cef6ea..08b79c9b5 100644 --- a/CHOLMOD/Partition/cholmod_ccolamd.c +++ b/CHOLMOD/Partition/cholmod_ccolamd.c @@ -67,7 +67,7 @@ static int ccolamd_interface /* ---------------------------------------------------------------------- */ /* get parameters */ -#ifdef LONG +#if ( ITYPE == CHOLMOD_LONG ) ccolamd_l_set_defaults (knobs) ; #else ccolamd_set_defaults (knobs) ; @@ -90,7 +90,7 @@ static int ccolamd_interface if (ok) { -#ifdef LONG +#if ( ITYPE == CHOLMOD_LONG ) ccolamd_l (ncol, nrow, alen, C->i, C->p, knobs, stats, Cmember) ; #else ccolamd (ncol, nrow, alen, C->i, C->p, knobs, stats, Cmember) ; @@ -164,7 +164,7 @@ int CHOLMOD(ccolamd) /* allocate workspace */ /* ---------------------------------------------------------------------- */ -#ifdef LONG +#if ( ITYPE == CHOLMOD_LONG ) alen = ccolamd_l_recommended (A->nzmax, ncol, nrow) ; #else alen = ccolamd_recommended (A->nzmax, ncol, nrow) ; diff --git a/CHOLMOD/Partition/cholmod_csymamd.c b/CHOLMOD/Partition/cholmod_csymamd.c index 3bdafaa88..03d46e1f7 100644 --- a/CHOLMOD/Partition/cholmod_csymamd.c +++ b/CHOLMOD/Partition/cholmod_csymamd.c @@ -86,7 +86,7 @@ int CHOLMOD(csymamd) perm = Common->Head ; /* size nrow+1 (i/l/l) */ /* get parameters */ -#ifdef LONG +#if ( ITYPE == CHOLMOD_LONG ) ccolamd_l_set_defaults (knobs) ; #else ccolamd_set_defaults (knobs) ; @@ -103,7 +103,7 @@ int CHOLMOD(csymamd) calloc_func = SuiteSparse_config_calloc_func_get ( ) ; free_func = SuiteSparse_config_free_func_get ( ) ; -#ifdef LONG +#if ( ITYPE == CHOLMOD_LONG ) csymamd_l (nrow, A->i, A->p, perm, knobs, stats, calloc_func, free_func, diff --git a/CHOLMOD/Partition/cholmod_metis_wrapper.c b/CHOLMOD/Partition/cholmod_metis_wrapper.c index faecbd994..42f967928 100644 --- a/CHOLMOD/Partition/cholmod_metis_wrapper.c +++ b/CHOLMOD/Partition/cholmod_metis_wrapper.c @@ -87,7 +87,9 @@ double gk_CPUSeconds(void) { return (0) ; } #include "SuiteSparse_metis/libmetis/wspace.c" // unused by CHOLMOD: -// #include "SuiteSparse_metis/libmetis/checkgraph.c" +#ifndef NDEBUG +#include "SuiteSparse_metis/libmetis/checkgraph.c" +#endif // #include "SuiteSparse_metis/libmetis/frename.c" // #include "SuiteSparse_metis/libmetis/mesh.c" // #include "SuiteSparse_metis/libmetis/meshpart.c" diff --git a/CHOLMOD/Partition/cholmod_metis_wrapper.h b/CHOLMOD/Partition/cholmod_metis_wrapper.h index cdc56a521..0a3ac9315 100644 --- a/CHOLMOD/Partition/cholmod_metis_wrapper.h +++ b/CHOLMOD/Partition/cholmod_metis_wrapper.h @@ -2,7 +2,7 @@ // CHOLMOD/Partition/cholmod_metis_wrapper.h: METIS renaming for CHOLMOD //------------------------------------------------------------------------------ -// CHOLMOD/Partition Module. Copyright (C) 2005-2022, University of Florida. +// CHOLMOD/Partition Module. Copyright (C) 2005-2023, University of Florida. // All Rights Reserved. Author: Timothy A. Davis. // SPDX-License-Identifier: LGPL-2.1+ @@ -11,6 +11,11 @@ #ifndef CHOLMOD_METIS_WRAP_H #define CHOLMOD_METIS_WRAP_H +// always use GKRAND instead of the system rand in METIS +#ifndef USE_GKRAND +#define USE_GKRAND +#endif + #if defined ( __GNUC__ ) && !defined ( __clang__ ) // disable memcpy warnings: #pragma GCC diagnostic ignored "-Wstringop-overflow=" diff --git a/CHOLMOD/SuiteSparse_metis/GKlib/random.c b/CHOLMOD/SuiteSparse_metis/GKlib/random.c index d18e7188b..b6462a060 100644 --- a/CHOLMOD/SuiteSparse_metis/GKlib/random.c +++ b/CHOLMOD/SuiteSparse_metis/GKlib/random.c @@ -60,11 +60,41 @@ GK_MKRANDOM(gk_z, size_t, ssize_t) #define UM 0xFFFFFFFF80000000ULL /* Most significant 33 bits */ #define LM 0x7FFFFFFFULL /* Least significant 31 bits */ +// added by Tim Davis for CHOLMOD: mt and mti state variables threadprivate +#if defined ( _OPENMP ) + // OpenMP threadprivate is preferred + static uint64_t mt[NN]; + static int mti=NN+1; + #pragma omp threadprivate (mt,mti) + +#elif defined ( HAVE_KEYWORD__THREAD ) + + // gcc and many other compilers support the __thread keyword + __thread static uint64_t mt[NN]; + __thread static int mti=NN+1; + +#elif defined ( HAVE_KEYWORD__DECLSPEC_THREAD ) + + // Windows: __declspec (thread) + __declspec ( thread ) static uint64_t mt[NN]; + __declspec ( thread ) static int mti=NN+1; + +#elif defined ( HAVE_KEYWORD__THREAD_LOCAL ) + + // ANSI C11 threads + #include + _Thread_local static uint64_t mt[NN]; + _Thread_local static int mti=NN+1; + +#else +// original METIS uses global state: this is not thread-safe: /* The array for the state vector */ static uint64_t mt[NN]; /* mti==NN+1 means mt[NN] is not initialized */ static int mti=NN+1; +#endif + #endif /* USE_GKRAND */ /* initializes mt[NN] with a seed */ diff --git a/CHOLMOD/Tcov/cm.h b/CHOLMOD/Tcov/cm.h index b8655544f..ce8366929 100644 --- a/CHOLMOD/Tcov/cm.h +++ b/CHOLMOD/Tcov/cm.h @@ -16,43 +16,6 @@ #include #include -/* -------------------------------------------------------------------------- */ -/* double, int64_t */ -/* -------------------------------------------------------------------------- */ - -#ifdef DLONG -#define Real double -#define Int int64_t -#define UInt uint64_t -#define Int_max INT64_MAX -#define CHOLMOD(name) cholmod_l_ ## name -#define LONG -#define DOUBLE -#define ITYPE CHOLMOD_LONG -#define DTYPE CHOLMOD_DOUBLE - -/* -------------------------------------------------------------------------- */ -/* double, int: this is the default */ -/* -------------------------------------------------------------------------- */ - -#else - -#ifndef DINT -#define DINT -#endif -#define INT -#define DOUBLE - -#define Real double -#define Int int32_t -#define UInt uint32_t -#define Int_max INT32_MAX -#define CHOLMOD(name) cholmod_ ## name -#define ITYPE CHOLMOD_INT -#define DTYPE CHOLMOD_DOUBLE - -#endif - /* -------------------------------------------------------------------------- */ #include "cholmod_internal.h" @@ -183,9 +146,7 @@ void camdtest (cholmod_sparse *A) ; /* AMD, COLAMD, and CCOLAMD */ /* -------------------------------------------------------------------------- */ -#ifdef LONG - -#define ID "%" PRId64 +#if ( ITYPE == CHOLMOD_LONG ) #define AMD_order amd_l_order #define AMD_defaults amd_l_defaults @@ -238,8 +199,6 @@ void camdtest (cholmod_sparse *A) ; #else -#define ID "%d" - #define AMD_order amd_order #define AMD_defaults amd_defaults #define AMD_control amd_control diff --git a/CHOLMOD/Tcov/memory.c b/CHOLMOD/Tcov/memory.c index fa5e7ced9..b28cd4305 100644 --- a/CHOLMOD/Tcov/memory.c +++ b/CHOLMOD/Tcov/memory.c @@ -127,7 +127,7 @@ void normal_memory_handler ( void ) void test_memory_handler ( void ) { SuiteSparse_config_malloc_func_set (my_malloc2) ; - SuiteSparse_config_calloc_func_set ((my_calloc2) ; + SuiteSparse_config_calloc_func_set (my_calloc2) ; SuiteSparse_config_realloc_func_set (my_realloc2) ; SuiteSparse_config_free_func_set (my_free2) ; diff --git a/CHOLMOD/Tcov/null2.c b/CHOLMOD/Tcov/null2.c index 1087fa7d9..4b17bbf67 100644 --- a/CHOLMOD/Tcov/null2.c +++ b/CHOLMOD/Tcov/null2.c @@ -878,7 +878,7 @@ void null2 (cholmod_triplet *Tok, int do_nantests) cm->print = 1 ; cm->print = 4 ; -#ifdef LONG +#if ( ITYPE == CHOLMOD_LONG ) C->itype = CHOLMOD_INT ; #else C->itype = CHOLMOD_LONG ; @@ -1183,7 +1183,7 @@ void null2 (cholmod_triplet *Tok, int do_nantests) ok = CHOLMOD(print_factor)(L, "L OK", cm) ; OK (ok) ; cm->print = 4 ; -#ifdef LONG +#if ( ITYPE == CHOLMOD_LONG ) L->itype = CHOLMOD_INT ; #else L->itype = CHOLMOD_LONG ; @@ -2369,7 +2369,7 @@ if (do_nantests) ok = CHOLMOD(print_triplet)(T, "T ok", cm) ; OK (ok) ; cm->print = 4 ; -#ifdef LONG +#if ( ITYPE == CHOLMOD_LONG ) T->itype = CHOLMOD_INT ; #else T->itype = CHOLMOD_LONG ; diff --git a/CHOLMOD/cmake_modules/FindCHOLMOD.cmake b/CHOLMOD/cmake_modules/FindCHOLMOD.cmake deleted file mode 100644 index bb7792fdc..000000000 --- a/CHOLMOD/cmake_modules/FindCHOLMOD.cmake +++ /dev/null @@ -1,128 +0,0 @@ -#------------------------------------------------------------------------------- -# SuiteSparse/CHOLMOD/cmake_modules/FindCHOLMOD.cmake -#------------------------------------------------------------------------------- - -# The following copyright and license applies to just this file only, not to -# the library itself: -# FindCHOLMOD.cmake, Copyright (c) 2022-2023, Timothy A. Davis. All Rights Reserved. -# SPDX-License-Identifier: BSD-3-clause - -#------------------------------------------------------------------------------- - -# Finds the CHOLMOD include file and compiled library and sets: - -# CHOLMOD_INCLUDE_DIR - where to find cholmod.h -# CHOLMOD_LIBRARY - compiled CHOLMOD library -# CHOLMOD_LIBRARIES - libraries when using CHOLMOD -# CHOLMOD_FOUND - true if CHOLMOD found - -# set ``CHOLMOD_ROOT`` to a CHOLMOD installation root to -# tell this module where to look. - -# All the Find*.cmake files in SuiteSparse are installed by 'make install' into -# /usr/local/lib/cmake/SuiteSparse (where '/usr/local' is the -# ${CMAKE_INSTALL_PREFIX}). To access this file, place the following commands -# in your CMakeLists.txt file. See also SuiteSparse/Example/CMakeLists.txt: -# -# set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} -# ${CMAKE_INSTALL_PREFIX}/lib/cmake/SuiteSparse ) - -#------------------------------------------------------------------------------- - -# include files for CHOLMOD -find_path ( CHOLMOD_INCLUDE_DIR - NAMES cholmod.h - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/CHOLMOD - HINTS ${CMAKE_SOURCE_DIR}/../CHOLMOD - PATH_SUFFIXES include Include -) - -# dynamic CHOLMOD library (or static if no dynamic library was built) -find_library ( CHOLMOD_LIBRARY - NAMES cholmod cholmod_static - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/CHOLMOD - HINTS ${CMAKE_SOURCE_DIR}/../CHOLMOD - PATH_SUFFIXES lib build build/Release build/Debug -) - -if ( MSVC ) - set ( STATIC_NAME cholmod_static cholmod ) -else ( ) - set ( STATIC_NAME cholmod ) - set ( save ${CMAKE_FIND_LIBRARY_SUFFIXES} ) - set ( CMAKE_FIND_LIBRARY_SUFFIXES - ${CMAKE_STATIC_LIBRARY_SUFFIX} ${CMAKE_FIND_LIBRARY_SUFFIXES} ) -endif ( ) - -# static CHOLMOD library -find_library ( CHOLMOD_STATIC - NAMES ${STATIC_NAME} - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/CHOLMOD - HINTS ${CMAKE_SOURCE_DIR}/../CHOLMOD - PATH_SUFFIXES lib build build/Release build/Debug -) - -if ( NOT MSVC ) - # restore the CMAKE_FIND_LIBRARY_SUFFIXES variable - set ( CMAKE_FIND_LIBRARY_SUFFIXES ${save} ) -endif ( ) - -# get version of the library from the dynamic library name -get_filename_component ( CHOLMOD_LIBRARY ${CHOLMOD_LIBRARY} REALPATH ) -get_filename_component ( CHOLMOD_FILENAME ${CHOLMOD_LIBRARY} NAME ) -string ( - REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" - CHOLMOD_VERSION - ${CHOLMOD_FILENAME} -) - -# set ( CHOLMOD_VERSION "" ) -if ( EXISTS "${CHOLMOD_INCLUDE_DIR}" AND NOT CHOLMOD_VERSION ) - # if the version does not appear in the filename, read the include file - file ( STRINGS ${CHOLMOD_INCLUDE_DIR}/cholmod.h CHOLMOD_MAJOR_STR - REGEX "define CHOLMOD_MAIN_VERSION" ) - file ( STRINGS ${CHOLMOD_INCLUDE_DIR}/cholmod.h CHOLMOD_MINOR_STR - REGEX "define CHOLMOD_SUB_VERSION" ) - file ( STRINGS ${CHOLMOD_INCLUDE_DIR}/cholmod.h CHOLMOD_PATCH_STR - REGEX "define CHOLMOD_SUBSUB_VERSION" ) - message ( STATUS "major: ${CHOLMOD_MAJOR_STR}" ) - message ( STATUS "minor: ${CHOLMOD_MINOR_STR}" ) - message ( STATUS "patch: ${CHOLMOD_PATCH_STR}" ) - string ( REGEX MATCH "[0-9]+" CHOLMOD_MAJOR ${CHOLMOD_MAJOR_STR} ) - string ( REGEX MATCH "[0-9]+" CHOLMOD_MINOR ${CHOLMOD_MINOR_STR} ) - string ( REGEX MATCH "[0-9]+" CHOLMOD_PATCH ${CHOLMOD_PATCH_STR} ) - set (CHOLMOD_VERSION "${CHOLMOD_MAJOR}.${CHOLMOD_MINOR}.${CHOLMOD_PATCH}") -endif ( ) - -set (CHOLMOD_LIBRARIES ${CHOLMOD_LIBRARY} ) - -include (FindPackageHandleStandardArgs) - -find_package_handle_standard_args ( CHOLMOD - REQUIRED_VARS CHOLMOD_LIBRARY CHOLMOD_INCLUDE_DIR - VERSION_VAR CHOLMOD_VERSION -) - -mark_as_advanced ( - CHOLMOD_INCLUDE_DIR - CHOLMOD_LIBRARY - CHOLMOD_STATIC - CHOLMOD_LIBRARIES -) - -if ( CHOLMOD_FOUND ) - message ( STATUS "CHOLMOD version: ${CHOLMOD_VERSION}" ) - message ( STATUS "CHOLMOD include: ${CHOLMOD_INCLUDE_DIR}" ) - message ( STATUS "CHOLMOD library: ${CHOLMOD_LIBRARY}" ) - message ( STATUS "CHOLMOD static: ${CHOLMOD_STATIC}" ) -else ( ) - message ( STATUS "CHOLMOD not found" ) - set ( CHOLMOD_INCLUDE_DIR "" ) - set ( CHOLMOD_LIBRARIES "" ) - set ( CHOLMOD_LIBRARY "" ) - set ( CHOLMOD_STATIC "" ) -endif ( ) - diff --git a/CHOLMOD/cmake_modules/FindCHOLMOD_CUDA.cmake b/CHOLMOD/cmake_modules/FindCHOLMOD_CUDA.cmake deleted file mode 100644 index 0d3498ee7..000000000 --- a/CHOLMOD/cmake_modules/FindCHOLMOD_CUDA.cmake +++ /dev/null @@ -1,128 +0,0 @@ -#------------------------------------------------------------------------------- -# SuiteSparse/CHOLMOD/cmake_modules/FindCHOLMOD_CUDA.cmake -#------------------------------------------------------------------------------- - -# The following copyright and license applies to just this file only, not to -# the library itself: -# FindCHOLMOD_CUDA.cmake, Copyright (c) 2022-2023, Timothy A. Davis. All Rights Reserved. -# SPDX-License-Identifier: BSD-3-clause - -#------------------------------------------------------------------------------- - -# Finds the CHOLMOD_CUDA compiled library and sets: - -# CHOLMOD_CUDA_LIBRARY - dynamic CHOLMOD_CUDA library -# CHOLMOD_CUDA_STATIC - static CHOLMOD_CUDA library -# CHOLMOD_CUDA_LIBRARIES - libraries when using CHOLMOD_CUDA -# CHOLMOD_CUDA_FOUND - true if CHOLMOD_CUDA found - -# set ``CHOLMOD_CUDA_ROOT`` to a CHOLMOD_CUDA installation root to -# tell this module where to look. - -# All the Find*.cmake files in SuiteSparse are installed by 'make install' into -# /usr/local/lib/cmake/SuiteSparse (where '/usr/local' is the -# ${CMAKE_INSTALL_PREFIX}). To access this file, place the following commands -# in your CMakeLists.txt file. See also SuiteSparse/Example/CMakeLists.txt: -# -# set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} -# ${CMAKE_INSTALL_PREFIX}/lib/cmake/SuiteSparse ) - -#------------------------------------------------------------------------------- - - -# include files for CHOLMOD -find_path ( CHOLMOD_INCLUDE_DIR - NAMES cholmod.h - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/CHOLMOD - HINTS ${CMAKE_SOURCE_DIR}/../CHOLMOD - PATH_SUFFIXES include Include -) - -# dynamic CHOLMOD_CUDA library (or static if no dynamic library was built) -find_library ( CHOLMOD_CUDA_LIBRARY - NAMES cholmod_cuda cholmod_cuda_static - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse - HINTS ${CMAKE_SOURCE_DIR}/../CHOLMOD/ - HINTS ${CMAKE_SOURCE_DIR}/../CHOLMOD/build/GPU - PATH_SUFFIXES lib build build/Release build/Debug -) - -if ( MSVC ) - set ( STATIC_NAME cholmod_cuda_static cholmod_cuda ) -else ( ) - set ( STATIC_NAME cholmod_cuda ) - set ( save ${CMAKE_FIND_LIBRARY_SUFFIXES} ) - set ( CMAKE_FIND_LIBRARY_SUFFIXES - ${CMAKE_STATIC_LIBRARY_SUFFIX} ${CMAKE_FIND_LIBRARY_SUFFIXES} ) -endif ( ) - -# static CHOLMOD_CUDA library -find_library ( CHOLMOD_CUDA_STATIC - NAMES ${STATIC_NAME} - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse - HINTS ${CMAKE_SOURCE_DIR}/../CHOLMOD/ - HINTS ${CMAKE_SOURCE_DIR}/../CHOLMOD/build/GPU - PATH_SUFFIXES lib build build/Release build/Debug -) - -if ( NOT MSVC ) - # restore the CMAKE_FIND_LIBRARY_SUFFIXES variable - set ( CMAKE_FIND_LIBRARY_SUFFIXES ${save} ) -endif ( ) - -# get version of the library from the dynamic library name -get_filename_component ( CHOLMOD_CUDA_LIBRARY ${CHOLMOD_CUDA_LIBRARY} REALPATH ) -get_filename_component ( CHOLMOD_CUDA_FILENAME ${CHOLMOD_CUDA_LIBRARY} NAME ) -string ( - REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" - CHOLMOD_CUDA_VERSION - ${CHOLMOD_CUDA_FILENAME} -) - -# set ( CHOLMOD_CUDA_VERSION "" ) -if ( EXISTS "${CHOLMOD_INCLUDE_DIR}" AND NOT CHOLMOD_CUDA_VERSION ) - # if the version does not appear in the filename, read the include file - file ( STRINGS ${CHOLMOD_INCLUDE_DIR}/cholmod.h CHOLMOD_CUDA_MAJOR_STR - REGEX "define CHOLMOD_MAIN_VERSION" ) - file ( STRINGS ${CHOLMOD_INCLUDE_DIR}/cholmod.h CHOLMOD_CUDA_MINOR_STR - REGEX "define CHOLMOD_SUB_VERSION" ) - file ( STRINGS ${CHOLMOD_INCLUDE_DIR}/cholmod.h CHOLMOD_CUDA_PATCH_STR - REGEX "define CHOLMOD_SUBSUB_VERSION" ) - message ( STATUS "major: ${CHOLMOD_CUDA_MAJOR_STR}" ) - message ( STATUS "minor: ${CHOLMOD_CUDA_MINOR_STR}" ) - message ( STATUS "patch: ${CHOLMOD_CUDA_PATCH_STR}" ) - string ( REGEX MATCH "[0-9]+" CHOLMOD_CUDA_MAJOR ${CHOLMOD_CUDA_MAJOR_STR} ) - string ( REGEX MATCH "[0-9]+" CHOLMOD_CUDA_MINOR ${CHOLMOD_CUDA_MINOR_STR} ) - string ( REGEX MATCH "[0-9]+" CHOLMOD_CUDA_PATCH ${CHOLMOD_CUDA_PATCH_STR} ) - set (CHOLMOD_CUDA_VERSION "${CHOLMOD_CUDA_MAJOR}.${CHOLMOD_CUDA_MINOR}.${CHOLMOD_CUDA_PATCH}") -endif ( ) - -set (CHOLMOD_CUDA_LIBRARIES ${CHOLMOD_CUDA_LIBRARY}) - -include (FindPackageHandleStandardArgs) - -find_package_handle_standard_args ( CHOLMOD_CUDA - REQUIRED_VARS CHOLMOD_CUDA_LIBRARY - VERSION_VAR CHOLMOD_CUDA_VERSION -) - -mark_as_advanced ( - CHOLMOD_CUDA_LIBRARY - CHOLMOD_CUDA_STATIC - CHOLMOD_CUDA_LIBRARIES -) - -if ( CHOLMOD_CUDA_FOUND ) - message ( STATUS "CHOLMOD_CUDA version: ${CHOLMOD_CUDA_VERSION}" ) - message ( STATUS "CHOLMOD_CUDA library: ${CHOLMOD_CUDA_LIBRARY}" ) - message ( STATUS "CHOLMOD_CUDA static: ${CHOLMOD_CUDA_STATIC}" ) -else ( ) - message ( STATUS "CHOLMOD_CUDA not found" ) - set ( CHOLMOD_CUDA_LIBRARIES "" ) - set ( CHOLMOD_CUDA_LIBRARY "" ) - set ( CHOLMOD_CUDA_STATIC "" ) -endif ( ) - diff --git a/COLAMD/CMakeLists.txt b/COLAMD/CMakeLists.txt index d38284fa0..462329bef 100644 --- a/COLAMD/CMakeLists.txt +++ b/COLAMD/CMakeLists.txt @@ -9,12 +9,12 @@ # get the version #------------------------------------------------------------------------------- -cmake_minimum_required ( VERSION 3.19 ) +cmake_minimum_required ( VERSION 3.20 ) -set ( COLAMD_DATE "June 16, 2023" ) +set ( COLAMD_DATE "Sept 8, 2023" ) set ( COLAMD_VERSION_MAJOR 3 ) -set ( COLAMD_VERSION_MINOR 0 ) -set ( COLAMD_VERSION_SUB 4 ) +set ( COLAMD_VERSION_MINOR 2 ) +set ( COLAMD_VERSION_SUB 0 ) message ( STATUS "Building COLAMD version: v" ${COLAMD_VERSION_MAJOR}. @@ -26,7 +26,6 @@ message ( STATUS "Building COLAMD version: v" #------------------------------------------------------------------------------- set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} - ${CMAKE_SOURCE_DIR}/cmake_modules ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/cmake_modules ) include ( SuiteSparsePolicy ) @@ -43,7 +42,11 @@ project ( colamd # find library dependencies #------------------------------------------------------------------------------- -find_package ( SuiteSparse_config 7.1.0 REQUIRED ) +find_package ( SuiteSparse_config 7.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH ) +if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) + find_package ( SuiteSparse_config 7.2.0 REQUIRED ) +endif ( ) #------------------------------------------------------------------------------- # configure files @@ -57,7 +60,7 @@ configure_file ( "Config/colamd.h.in" # include directories #------------------------------------------------------------------------------- -include_directories ( Source Include ${SUITESPARSE_CONFIG_INCLUDE_DIR} ) +include_directories ( Source Include ) #------------------------------------------------------------------------------- # dynamic colamd library properties @@ -65,24 +68,29 @@ include_directories ( Source Include ${SUITESPARSE_CONFIG_INCLUDE_DIR} ) file ( GLOB COLAMD_SOURCES "Source/*.c" ) -add_library ( colamd SHARED ${COLAMD_SOURCES} ) +add_library ( COLAMD SHARED ${COLAMD_SOURCES} ) -set_target_properties ( colamd PROPERTIES +set_target_properties ( COLAMD PROPERTIES VERSION ${COLAMD_VERSION_MAJOR}.${COLAMD_VERSION_MINOR}.${COLAMD_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON + OUTPUT_NAME colamd SOVERSION ${COLAMD_VERSION_MAJOR} PUBLIC_HEADER "Include/colamd.h" WINDOWS_EXPORT_ALL_SYMBOLS ON ) +target_include_directories ( COLAMD + INTERFACE $ + $ ) + #------------------------------------------------------------------------------- # static colamd library properties #------------------------------------------------------------------------------- if ( NOT NSTATIC ) - add_library ( colamd_static STATIC ${COLAMD_SOURCES} ) + add_library ( COLAMD_static STATIC ${COLAMD_SOURCES} ) - set_target_properties ( colamd_static PROPERTIES + set_target_properties ( COLAMD_static PROPERTIES VERSION ${COLAMD_VERSION_MAJOR}.${COLAMD_VERSION_MINOR}.${COLAMD_VERSION_SUB} OUTPUT_NAME colamd C_STANDARD 11 @@ -90,25 +98,37 @@ if ( NOT NSTATIC ) SOVERSION ${COLAMD_VERSION_MAJOR} ) if ( MSVC ) - set_target_properties ( colamd_static PROPERTIES + set_target_properties ( COLAMD_static PROPERTIES OUTPUT_NAME colamd_static ) endif ( ) + + target_include_directories ( COLAMD_static + INTERFACE $ + $ ) + endif ( ) #------------------------------------------------------------------------------- # add the library dependencies #------------------------------------------------------------------------------- -target_link_libraries ( colamd PRIVATE ${SUITESPARSE_CONFIG_LIBRARY} ) +target_link_libraries ( COLAMD PRIVATE SuiteSparse::SuiteSparseConfig ) +target_include_directories ( COLAMD PUBLIC + "$" ) if ( NOT NSTATIC ) - target_link_libraries ( colamd_static PUBLIC ${SUITESPARSE_CONFIG_STATIC} ) + if ( TARGET SuiteSparse::SuiteSparseConfig_static ) + target_link_libraries ( COLAMD_static PUBLIC SuiteSparse::SuiteSparseConfig_static ) + else ( ) + target_link_libraries ( COLAMD_static PUBLIC SuiteSparse::SuiteSparseConfig ) + endif ( ) endif ( ) # libm: if ( NOT WIN32 ) - target_link_libraries ( colamd PRIVATE m ) + target_link_libraries ( COLAMD PRIVATE m ) if ( NOT NSTATIC ) - target_link_libraries ( colamd_static PUBLIC m ) + set ( COLAMD_STATIC_LIBS "${COLAMD_STATIC_LIBS} -lm" ) + target_link_libraries ( COLAMD_static PUBLIC m ) endif ( ) endif ( ) @@ -116,19 +136,73 @@ endif ( ) # COLAMD installation location #------------------------------------------------------------------------------- -install ( TARGETS colamd +include ( CMakePackageConfigHelpers ) + +install ( TARGETS COLAMD + EXPORT COLAMDTargets LIBRARY DESTINATION ${SUITESPARSE_LIBDIR} ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} RUNTIME DESTINATION ${SUITESPARSE_BINDIR} PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} ) -install ( FILES ${CMAKE_SOURCE_DIR}/cmake_modules/FindCOLAMD.cmake - DESTINATION ${SUITESPARSE_LIBDIR}/cmake/SuiteSparse - COMPONENT Development ) if ( NOT NSTATIC ) - install ( TARGETS colamd_static + install ( TARGETS COLAMD_static + EXPORT COLAMDTargets ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} ) endif ( ) +# create (temporary) export target file during build +export ( EXPORT COLAMDTargets + NAMESPACE SuiteSparse:: + FILE ${CMAKE_CURRENT_BINARY_DIR}/COLAMDTargets.cmake ) + +# install export target, config and version files for find_package +install ( EXPORT COLAMDTargets + NAMESPACE SuiteSparse:: + DESTINATION ${SUITESPARSE_LIBDIR}/cmake/COLAMD ) + +configure_package_config_file ( + Config/COLAMDConfig.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/COLAMDConfig.cmake + INSTALL_DESTINATION ${SUITESPARSE_LIBDIR}/cmake/COLAMD ) + +write_basic_package_version_file ( + ${CMAKE_CURRENT_BINARY_DIR}/COLAMDConfigVersion.cmake + COMPATIBILITY SameMajorVersion ) + +install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/COLAMDConfig.cmake + ${CMAKE_CURRENT_BINARY_DIR}/COLAMDConfigVersion.cmake + DESTINATION ${SUITESPARSE_LIBDIR}/cmake/COLAMD ) + +#------------------------------------------------------------------------------- +# create pkg-config file +#------------------------------------------------------------------------------- + +if ( NOT MSVC ) + set ( prefix "${CMAKE_INSTALL_PREFIX}" ) + set ( exec_prefix "\${prefix}" ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) + if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) + set ( libdir "${SUITESPARSE_LIBDIR}") + else ( ) + set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") + endif ( ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) + if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) + set ( includedir "${SUITESPARSE_INCLUDEDIR}") + else ( ) + set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + endif ( ) + configure_file ( + Config/COLAMD.pc.in + COLAMD.pc + @ONLY + NEWLINE_STYLE LF ) + install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/COLAMD.pc + DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) +endif ( ) + #------------------------------------------------------------------------------- # Demo library and programs #------------------------------------------------------------------------------- @@ -150,8 +224,8 @@ if ( DEMO ) add_executable ( colamd_l_example "Demo/colamd_l_example.c" ) # Libraries required for Demo programs - target_link_libraries ( colamd_example PUBLIC colamd ) - target_link_libraries ( colamd_l_example PUBLIC colamd ) + target_link_libraries ( colamd_example PUBLIC COLAMD ) + target_link_libraries ( colamd_l_example PUBLIC COLAMD ) else ( ) diff --git a/COLAMD/Config/COLAMD.pc.in b/COLAMD/Config/COLAMD.pc.in new file mode 100644 index 000000000..69ac6f7df --- /dev/null +++ b/COLAMD/Config/COLAMD.pc.in @@ -0,0 +1,17 @@ +# COLAMD, Copyright (c) 1998-2023, Timothy A. Davis. +# All Rights Reserved. +# SPDX-License-Identifier: BSD-3-Clause + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: COLAMD +URL: https://github.com/DrTimothyAldenDavis/SuiteSparse +Description: Routines for column approximate minimum degree ordering algorithm in SuiteSparse +Version: @COLAMD_VERSION_MAJOR@.@COLAMD_VERSION_MINOR@.@COLAMD_VERSION_SUB@ +Requires.private: SuiteSparse_config +Libs: -L${libdir} -lcolamd +Libs.private: @COLAMD_STATIC_LIBS@ +Cflags: -I${includedir} diff --git a/COLAMD/Config/COLAMDConfig.cmake.in b/COLAMD/Config/COLAMDConfig.cmake.in new file mode 100644 index 000000000..a9597ee57 --- /dev/null +++ b/COLAMD/Config/COLAMDConfig.cmake.in @@ -0,0 +1,121 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/COLAMD/cmake_modules/COLAMDConfig.cmake +#------------------------------------------------------------------------------- + +# The following copyright and license applies to just this file only, not to +# the library itself: +# COLAMDConfig.cmake, Copyright (c) 2023, Timothy A. Davis. All Rights Reserved. +# SPDX-License-Identifier: BSD-3-clause + +#------------------------------------------------------------------------------- + +# Finds the COLAMD include file and compiled library. +# The following targets are defined: +# SuiteSparse::COLAMD - for the shared library (if available) +# SuiteSparse::COLAMD_static - for the static library (if available) + +# For backward compatibility the following variables are set: + +# COLAMD_INCLUDE_DIR - where to find colamd.h +# COLAMD_LIBRARY - dynamic COLAMD library +# COLAMD_STATIC - static COLAMD library +# COLAMD_LIBRARIES - libraries when using COLAMD +# COLAMD_FOUND - true if COLAMD found + +# Set ``CMAKE_MODULE_PATH`` to the parent folder where this module file is +# installed. + +#------------------------------------------------------------------------------- + +@PACKAGE_INIT@ + +set ( COLAMD_DATE "@COLAMD_DATE@" ) +set ( COLAMD_VERSION_MAJOR @COLAMD_VERSION_MAJOR@ ) +set ( COLAMD_VERSION_MINOR @COLAMD_VERSION_MINOR@ ) +set ( COLAMD_VERSION_PATCH @COLAMD_VERSION_SUB@ ) +set ( COLAMD_VERSION "@COLAMD_VERSION_MAJOR@.@COLAMD_VERSION_MINOR@.@COLAMD_VERSION_SUB@" ) + +include ( ${CMAKE_CURRENT_LIST_DIR}/COLAMDTargets.cmake ) + +# The following is only for backward compatibility with FindCOLAMD. + +set ( _target_shared SuiteSparse::COLAMD ) +set ( _target_static SuiteSparse::COLAMD_static ) +set ( _var_prefix "COLAMD" ) + +get_target_property ( ${_var_prefix}_INCLUDE_DIR ${_target_shared} INTERFACE_INCLUDE_DIRECTORIES ) +if ( ${_var_prefix}_INCLUDE_DIR ) + # First item in SuiteSparse targets contains the "main" header directory. + list ( GET ${_var_prefix}_INCLUDE_DIR 0 ${_var_prefix}_INCLUDE_DIR ) +endif ( ) +get_target_property ( ${_var_prefix}_LIBRARY ${_target_shared} IMPORTED_IMPLIB ) +if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} IMPORTED_LOCATION ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) +endif ( ) +if ( TARGET ${_target_static} ) + get_target_property ( ${_var_prefix}_STATIC ${_target_static} IMPORTED_LOCATION ) +endif ( ) + +# Check for most common build types +set ( _config_types "Debug" "Release" "RelWithDebInfo" "MinSizeRel" ) + +get_property ( _isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG ) +if ( _isMultiConfig ) + # For multi-configuration generators (e.g., Visual Studio), prefer those + # configurations. + list ( PREPEND _config_types ${CMAKE_CONFIGURATION_TYPES} ) +else ( ) + # For single-configuration generators, prefer the current configuration. + list ( PREPEND _config_types ${CMAKE_BUILD_TYPE} ) +endif ( ) + +list ( REMOVE_DUPLICATES _config_types ) + +foreach ( _config ${_config_types} ) + string ( TOUPPER ${_config} _uc_config ) + if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} + IMPORTED_IMPLIB_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) + endif ( ) + if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} + IMPORTED_LOCATION_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) + endif ( ) + if ( TARGET ${_target_static} AND NOT ${_var_prefix}_STATIC ) + get_target_property ( _library_chk ${_target_static} + IMPORTED_LOCATION_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_STATIC ${_library_chk} ) + endif ( ) + endif ( ) +endforeach ( ) + +set ( COLAMD_LIBRARIES ${COLAMD_LIBRARY} ) + +macro ( suitesparse_check_exist _var _files ) + # ignore generator expressions + string ( GENEX_STRIP "${_files}" _files2 ) + + foreach ( _file ${_files2} ) + if ( NOT EXISTS "${_file}" ) + message ( FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist!" ) + endif ( ) + endforeach () +endmacro ( ) + +suitesparse_check_exist ( COLAMD_INCLUDE_DIR ${COLAMD_INCLUDE_DIR} ) +suitesparse_check_exist ( COLAMD_LIBRARY ${COLAMD_LIBRARY} ) + +message ( STATUS "COLAMD version: ${COLAMD_VERSION}" ) +message ( STATUS "COLAMD include: ${COLAMD_INCLUDE_DIR}" ) +message ( STATUS "COLAMD library: ${COLAMD_LIBRARY}" ) +message ( STATUS "COLAMD static: ${COLAMD_STATIC}" ) diff --git a/COLAMD/Demo/colamd_example.out b/COLAMD/Demo/colamd_example.out index e6d1a865f..77b4197a6 100644 --- a/COLAMD/Demo/colamd_example.out +++ b/COLAMD/Demo/colamd_example.out @@ -15,7 +15,7 @@ Column 3, with 2 entries: row 1 row 3 -colamd version 3.0.4, June 16, 2023: OK. +colamd version 3.2.0, Sept 8, 2023: OK. colamd: number of dense or empty rows ignored: 0 colamd: number of dense or empty columns ignored: 0 colamd: number of garbage collections performed: 0 @@ -38,7 +38,7 @@ Column 3, with 1 entries: row 4 Column 4, with 0 entries: -symamd version 3.0.4, June 16, 2023: OK. +symamd version 3.2.0, Sept 8, 2023: OK. symamd: number of dense or empty rows ignored: 0 symamd: number of dense or empty columns ignored: 0 symamd: number of garbage collections performed: 0 diff --git a/COLAMD/Demo/colamd_l_example.out b/COLAMD/Demo/colamd_l_example.out index a5b7f883f..296845a73 100644 --- a/COLAMD/Demo/colamd_l_example.out +++ b/COLAMD/Demo/colamd_l_example.out @@ -15,7 +15,7 @@ Column 3, with 2 entries: row 1 row 3 -colamd version 3.0.4, June 16, 2023: OK. +colamd version 3.2.0, Sept 8, 2023: OK. colamd: number of dense or empty rows ignored: 0 colamd: number of dense or empty columns ignored: 0 colamd: number of garbage collections performed: 0 @@ -38,7 +38,7 @@ Column 3, with 1 entries: row 4 Column 4, with 0 entries: -symamd version 3.0.4, June 16, 2023: OK. +symamd version 3.2.0, Sept 8, 2023: OK. symamd: number of dense or empty rows ignored: 0 symamd: number of dense or empty columns ignored: 0 symamd: number of garbage collections performed: 0 diff --git a/COLAMD/Doc/ChangeLog b/COLAMD/Doc/ChangeLog index 40746248e..0c014fa5a 100644 --- a/COLAMD/Doc/ChangeLog +++ b/COLAMD/Doc/ChangeLog @@ -1,3 +1,7 @@ +Sept 8, 2023: version 3.2.0 + + * cmake updates: SuiteSparse:: namespace by Markus Muetzel + June 16, 2023: version 3.0.4 * cmake build system updates: update by Markus Muetzel diff --git a/COLAMD/Include/colamd.h b/COLAMD/Include/colamd.h index afcb6f525..9d8c9a3f4 100644 --- a/COLAMD/Include/colamd.h +++ b/COLAMD/Include/colamd.h @@ -70,10 +70,10 @@ extern "C" { * Versions 2.3 and earlier of COLAMD do not include a #define'd version number. */ -#define COLAMD_DATE "June 16, 2023" +#define COLAMD_DATE "Sept 8, 2023" #define COLAMD_MAIN_VERSION 3 -#define COLAMD_SUB_VERSION 0 -#define COLAMD_SUBSUB_VERSION 4 +#define COLAMD_SUB_VERSION 2 +#define COLAMD_SUBSUB_VERSION 0 #define COLAMD_VERSION_CODE(main,sub) ((main) * 1000 + (sub)) #define COLAMD_VERSION \ diff --git a/COLAMD/cmake_modules/FindCOLAMD.cmake b/COLAMD/cmake_modules/FindCOLAMD.cmake deleted file mode 100644 index 8a9c332b1..000000000 --- a/COLAMD/cmake_modules/FindCOLAMD.cmake +++ /dev/null @@ -1,129 +0,0 @@ -#------------------------------------------------------------------------------- -# SuiteSparse/COLAMD/cmake_modules/FindCOLAMD.cmake -#------------------------------------------------------------------------------- - -# The following copyright and license applies to just this file only, not to -# the library itself: -# FindCOLAMD.cmake, Copyright (c) 2022-2023, Timothy A. Davis. All Rights Reserved. -# SPDX-License-Identifier: BSD-3-clause - -#------------------------------------------------------------------------------- - -# Finds the COLAMD include file and compiled library and sets: - -# COLAMD_INCLUDE_DIR - where to find colamd.h -# COLAMD_LIBRARY - dynamic COLAMD library -# COLAMD_STATIC - static COLAMD library -# COLAMD_LIBRARIES - libraries when using COLAMD -# COLAMD_FOUND - true if COLAMD found - -# set ``COLAMD_ROOT`` to a COLAMD installation root to -# tell this module where to look. - -# All the Find*.cmake files in SuiteSparse are installed by 'make install' into -# /usr/local/lib/cmake/SuiteSparse (where '/usr/local' is the -# ${CMAKE_INSTALL_PREFIX}). To access this file, place the following commands -# in your CMakeLists.txt file. See also SuiteSparse/Example/CMakeLists.txt: -# -# set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} -# ${CMAKE_INSTALL_PREFIX}/lib/cmake/SuiteSparse ) - -#------------------------------------------------------------------------------- - -# include files for COLAMD -find_path ( COLAMD_INCLUDE_DIR - NAMES colamd.h - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/COLAMD - HINTS ${CMAKE_SOURCE_DIR}/../COLAMD - PATH_SUFFIXES include Include -) - -# dynamic COLAMD library (or static if no dynamic library was built) -find_library ( COLAMD_LIBRARY - NAMES colamd colamd_static - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/COLAMD - HINTS ${CMAKE_SOURCE_DIR}/../COLAMD - PATH_SUFFIXES lib build build/Release build/Debug -) - -if ( MSVC ) - set ( STATIC_NAME colamd_static colamd ) -else ( ) - set ( STATIC_NAME colamd ) - set ( save ${CMAKE_FIND_LIBRARY_SUFFIXES} ) - set ( CMAKE_FIND_LIBRARY_SUFFIXES - ${CMAKE_STATIC_LIBRARY_SUFFIX} ${CMAKE_FIND_LIBRARY_SUFFIXES} ) -endif ( ) - -# static COLAMD library -find_library ( COLAMD_STATIC - NAMES ${STATIC_NAME} - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/COLAMD - HINTS ${CMAKE_SOURCE_DIR}/../COLAMD - PATH_SUFFIXES lib build build/Release build/Debug -) - -if ( NOT MSVC ) - # restore the CMAKE_FIND_LIBRARY_SUFFIXES variable - set ( CMAKE_FIND_LIBRARY_SUFFIXES ${save} ) -endif ( ) - -# get version of the library from the dynamic library name -get_filename_component ( COLAMD_LIBRARY ${COLAMD_LIBRARY} REALPATH ) -get_filename_component ( COLAMD_FILENAME ${COLAMD_LIBRARY} NAME ) -string ( - REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" - COLAMD_VERSION - ${COLAMD_FILENAME} -) - -# set ( COLAMD_VERSION "" ) -if ( EXISTS "${COLAMD_INCLUDE_DIR}" AND NOT COLAMD_VERSION ) - # if the version does not appear in the filename, read the include file - file ( STRINGS ${COLAMD_INCLUDE_DIR}/colamd.h COLAMD_MAJOR_STR - REGEX "define COLAMD_MAIN_VERSION" ) - file ( STRINGS ${COLAMD_INCLUDE_DIR}/colamd.h COLAMD_MINOR_STR - REGEX "define COLAMD_SUB_VERSION" ) - file ( STRINGS ${COLAMD_INCLUDE_DIR}/colamd.h COLAMD_PATCH_STR - REGEX "define COLAMD_SUBSUB_VERSION" ) - message ( STATUS "major: ${COLAMD_MAJOR_STR}" ) - message ( STATUS "minor: ${COLAMD_MINOR_STR}" ) - message ( STATUS "patch: ${COLAMD_PATCH_STR}" ) - string ( REGEX MATCH "[0-9]+" COLAMD_MAJOR ${COLAMD_MAJOR_STR} ) - string ( REGEX MATCH "[0-9]+" COLAMD_MINOR ${COLAMD_MINOR_STR} ) - string ( REGEX MATCH "[0-9]+" COLAMD_PATCH ${COLAMD_PATCH_STR} ) - set (COLAMD_VERSION "${COLAMD_MAJOR}.${COLAMD_MINOR}.${COLAMD_PATCH}") -endif ( ) - -set (COLAMD_LIBRARIES ${COLAMD_LIBRARY}) - -include (FindPackageHandleStandardArgs) - -find_package_handle_standard_args ( COLAMD - REQUIRED_VARS COLAMD_LIBRARY COLAMD_INCLUDE_DIR - VERSION_VAR COLAMD_VERSION -) - -mark_as_advanced ( - COLAMD_INCLUDE_DIR - COLAMD_LIBRARY - COLAMD_STATIC - COLAMD_LIBRARIES -) - -if ( COLAMD_FOUND ) - message ( STATUS "COLAMD version: ${COLAMD_VERSION}" ) - message ( STATUS "COLAMD include: ${COLAMD_INCLUDE_DIR}" ) - message ( STATUS "COLAMD library: ${COLAMD_LIBRARY}" ) - message ( STATUS "COLAMD static: ${COLAMD_STATIC}" ) -else ( ) - message ( STATUS "COLAMD not found" ) - set ( COLAMD_INCLUDE_DIR "" ) - set ( COLAMD_LIBRARIES "" ) - set ( COLAMD_LIBRARY "" ) - set ( COLAMD_STATIC "" ) -endif ( ) - diff --git a/CSparse/CMakeLists.txt b/CSparse/CMakeLists.txt index ab82cb0a1..5d78d2d87 100644 --- a/CSparse/CMakeLists.txt +++ b/CSparse/CMakeLists.txt @@ -17,10 +17,10 @@ cmake_minimum_required ( VERSION 3.13 ) -set ( CSPARSE_DATE "June 16, 2023" ) +set ( CSPARSE_DATE "Sept 8, 2023" ) set ( CSPARSE_VERSION_MAJOR 4 ) -set ( CSPARSE_VERSION_MINOR 0 ) -set ( CSPARSE_VERSION_SUB 4 ) +set ( CSPARSE_VERSION_MINOR 2 ) +set ( CSPARSE_VERSION_SUB 0 ) message ( STATUS "Building CSparse version: v" ${CSPARSE_VERSION_MAJOR}. @@ -120,10 +120,41 @@ endif ( ) if ( NOT WIN32 ) target_link_libraries ( csparse PRIVATE m ) if ( NOT NSTATIC ) + set ( CSPARSE_STATIC_LIBS "${CSPARSE_STATIC_LIBS} -lm" ) target_link_libraries ( csparse_static PUBLIC m ) endif ( ) endif ( ) + +#------------------------------------------------------------------------------- +# create pkg-config file +#------------------------------------------------------------------------------- + +if ( NOT MSVC ) + set ( prefix "${CMAKE_INSTALL_PREFIX}" ) + set ( exec_prefix "\${prefix}" ) + cmake_path ( IS_ABSOLUTE CMAKE_INSTALL_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) + if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) + set ( libdir "${CMAKE_INSTALL_LIBDIR}") + else ( ) + set ( libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}") + endif ( ) + cmake_path ( IS_ABSOLUTE CMAKE_INSTALL_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) + if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) + set ( includedir "${CMAKE_INSTALL_INCLUDEDIR}") + else ( ) + set ( includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}") + endif ( ) + configure_file ( + Config/CSparse.pc.in + CSparse.pc + @ONLY + NEWLINE_STYLE LF ) + # install ( FILES + # ${CMAKE_CURRENT_BINARY_DIR}/CSparse.pc + # DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig ) +endif ( ) + #------------------------------------------------------------------------------- # Demo library and programs #------------------------------------------------------------------------------- diff --git a/CSparse/Config/CSparse.pc.in b/CSparse/Config/CSparse.pc.in new file mode 100644 index 000000000..95229589c --- /dev/null +++ b/CSparse/Config/CSparse.pc.in @@ -0,0 +1,16 @@ +# CSparse, Copyright (c) 2006-2023, Timothy A. Davis. +# All Rights Reserved. +# SPDX-License-Identifier: LGPL-2.1-or-later + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: CSparse +URL: https://github.com/DrTimothyAldenDavis/SuiteSparse +Description: Direct methods for sparse linear systems in SuiteSparse +Version: @CSPARSE_VERSION_MAJOR@.@CSPARSE_VERSION_MINOR@.@CSPARSE_VERSION_SUB@ +Libs: -L${libdir} -lcsparse +Libs.private: @CSPARSE_STATIC_LIBS@ +Cflags: -I${includedir} diff --git a/CSparse/Demo/cs_demo.out b/CSparse/Demo/cs_demo.out index 9caaad9af..6f180dacb 100644 --- a/CSparse/Demo/cs_demo.out +++ b/CSparse/Demo/cs_demo.out @@ -1,6 +1,38 @@ +( cd build && cmake .. && cmake --build . --config Release -j8 ) +-- Building CSparse version: v4.2.0 (Sept 8, 2023) +-- Source: /home/faculty/d/davis/dev2/SuiteSparse/CSparse +-- Build: /home/faculty/d/davis/dev2/SuiteSparse/CSparse/build +-- Build type: Release +-- Also compiling the demos in CSparse/Demo +-- Configuring done (0.0s) +-- Generating done (0.0s) +-- Build files have been written to: /home/faculty/d/davis/dev2/SuiteSparse/CSparse/build +gmake[1]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CSparse/build' +[ 47%] Built target csparse_static +[ 93%] Built target csparse +[ 95%] Built target cs_demo1 +[ 98%] Built target cs_demo2 +[100%] Built target cs_demo3 +gmake[1]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CSparse/build' +( cd build && cmake -DDEMO=1 .. && cmake --build . --config Release -j8 ) +-- Building CSparse version: v4.2.0 (Sept 8, 2023) +-- Source: /home/faculty/d/davis/dev2/SuiteSparse/CSparse +-- Build: /home/faculty/d/davis/dev2/SuiteSparse/CSparse/build +-- Build type: Release +-- Also compiling the demos in CSparse/Demo +-- Configuring done (0.0s) +-- Generating done (0.0s) +-- Build files have been written to: /home/faculty/d/davis/dev2/SuiteSparse/CSparse/build +gmake[1]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CSparse/build' +[ 46%] Built target csparse +[ 93%] Built target csparse_static +[ 95%] Built target cs_demo1 +[ 97%] Built target cs_demo3 +[100%] Built target cs_demo2 +gmake[1]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CSparse/build' ./build/cs_demo1 < ./Matrix/t1 T: -CSparse Version 4.0.0, Nov 12, 2022. Copyright (c) Timothy A. Davis, 2006-2022 +CSparse Version 4.2.0, Sept 8, 2023. Copyright (c) Timothy A. Davis, 2006-2022 triplet: 4-by-4, nzmax: 16 nnz: 10 2 2 : 3 1 0 : 3.1 @@ -13,7 +45,7 @@ triplet: 4-by-4, nzmax: 16 nnz: 10 0 0 : 4.5 2 1 : 1.7 A: -CSparse Version 4.0.0, Nov 12, 2022. Copyright (c) Timothy A. Davis, 2006-2022 +CSparse Version 4.2.0, Sept 8, 2023. Copyright (c) Timothy A. Davis, 2006-2022 4-by-4, nzmax: 10 nnz: 10, 1-norm: 11.1 col 0 : locations 0 to 2 1 : 3.1 @@ -30,7 +62,7 @@ CSparse Version 4.0.0, Nov 12, 2022. Copyright (c) Timothy A. Davis, 2006-2022 3 : 1 1 : 0.9 AT: -CSparse Version 4.0.0, Nov 12, 2022. Copyright (c) Timothy A. Davis, 2006-2022 +CSparse Version 4.2.0, Sept 8, 2023. Copyright (c) Timothy A. Davis, 2006-2022 4-by-4, nzmax: 10 nnz: 10, 1-norm: 7.7 col 0 : locations 0 to 1 0 : 4.5 @@ -47,7 +79,7 @@ CSparse Version 4.0.0, Nov 12, 2022. Copyright (c) Timothy A. Davis, 2006-2022 1 : 0.4 3 : 1 D: -CSparse Version 4.0.0, Nov 12, 2022. Copyright (c) Timothy A. Davis, 2006-2022 +CSparse Version 4.2.0, Sept 8, 2023. Copyright (c) Timothy A. Davis, 2006-2022 4-by-4, nzmax: 16 nnz: 16, 1-norm: 139.58 col 0 : locations 0 to 3 1 : 13.95 @@ -103,7 +135,7 @@ Chol amd(A+A') time: 0.00 resid: 2.55e-19 zero entries dropped: 71 tiny entries dropped: 10 blocks: 38 singletons: 37 structural rank: 183 -QR natural time: 0.01 resid: 6.84e-28 +QR natural time: 0.00 resid: 6.84e-28 QR amd(A'*A) time: 0.00 resid: 9.38e-28 LU natural time: 0.00 resid: 6.20e-28 LU amd(A+A') time: 0.00 resid: 1.55e-27 @@ -135,9 +167,9 @@ QR amd(A'*A) time: 0.00 resid: 2.25e-16 --- Matrix: 4884-by-4884, nnz: 147631 (sym: -1: nnz 290378), norm: 7.01e+09 blocks: 75 singletons: 74 structural rank: 4884 -QR amd(A'*A) time: 0.67 resid: 1.39e-22 -LU amd(A+A') time: 0.32 resid: 1.10e-22 -LU amd(S'*S) time: 0.32 resid: 1.28e-22 +QR amd(A'*A) time: 0.68 resid: 1.39e-22 +LU amd(A+A') time: 0.33 resid: 1.10e-22 +LU amd(S'*S) time: 0.34 resid: 1.28e-22 LU amd(A'*A) time: 0.34 resid: 1.78e-22 Chol amd(A+A') time: 0.11 resid: 1.19e-22 ./build/cs_demo3 < ./Matrix/bcsstk01 diff --git a/CSparse/Doc/ChangeLog b/CSparse/Doc/ChangeLog index 1d2c102f4..75b99a395 100644 --- a/CSparse/Doc/ChangeLog +++ b/CSparse/Doc/ChangeLog @@ -1,3 +1,7 @@ +Sept 8, 2023: version 4.2.0 + + * cmake updates: SuiteSparse:: namespace by Markus Muetzel + June 16, 2023: version 4.0.4 * cmake build system updates: update by Markus Muetzel diff --git a/CSparse/Include/cs.h b/CSparse/Include/cs.h index b33f652f6..ef1ec9ed1 100644 --- a/CSparse/Include/cs.h +++ b/CSparse/Include/cs.h @@ -13,9 +13,9 @@ #include "mex.h" #endif #define CS_VER 4 /* CSparse Version */ -#define CS_SUBVER 0 -#define CS_SUBSUB 4 -#define CS_DATE "June 16, 2023" /* CSparse release date */ +#define CS_SUBVER 2 +#define CS_SUBSUB 0 +#define CS_DATE "Sept 8, 2023" /* CSparse release date */ #define CS_COPYRIGHT "Copyright (c) Timothy A. Davis, 2006-2022" #ifndef csi diff --git a/CXSparse/CMakeLists.txt b/CXSparse/CMakeLists.txt index 49be925c4..e245a80fd 100644 --- a/CXSparse/CMakeLists.txt +++ b/CXSparse/CMakeLists.txt @@ -9,12 +9,12 @@ # get the version #------------------------------------------------------------------------------- -cmake_minimum_required ( VERSION 3.19 ) +cmake_minimum_required ( VERSION 3.20 ) -set ( CXSPARSE_DATE "June 16, 2023" ) +set ( CXSPARSE_DATE "Sept 8, 2023" ) set ( CXSPARSE_VERSION_MAJOR 4 ) -set ( CXSPARSE_VERSION_MINOR 0 ) -set ( CXSPARSE_VERSION_SUB 4 ) +set ( CXSPARSE_VERSION_MINOR 2 ) +set ( CXSPARSE_VERSION_SUB 0 ) message ( STATUS "Building CXSparse version: v" ${CXSPARSE_VERSION_MAJOR}. @@ -26,7 +26,6 @@ message ( STATUS "Building CXSparse version: v" #------------------------------------------------------------------------------- set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} - ${CMAKE_SOURCE_DIR}/cmake_modules ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/cmake_modules ) include ( SuiteSparsePolicy ) @@ -64,7 +63,11 @@ project ( cxsparse # find library dependencies #------------------------------------------------------------------------------- -find_package ( SuiteSparse_config 7.1.0 REQUIRED ) +find_package ( SuiteSparse_config 7.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH ) +if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) + find_package ( SuiteSparse_config 7.2.0 REQUIRED ) +endif ( ) #------------------------------------------------------------------------------- # Configure cs.h with version number @@ -78,7 +81,7 @@ configure_file ( "Config/cs.h.in" # include directories #------------------------------------------------------------------------------- -include_directories ( Source Include ${SUITESPARSE_CONFIG_INCLUDE_DIR} ) +include_directories ( Source Include ) #------------------------------------------------------------------------------- # dynamic cxsparse library properties @@ -98,24 +101,29 @@ else ( ) file ( GLOB CXSPARSE_SOURCES "Source/*.c" ) endif ( ) -add_library ( cxsparse SHARED ${CXSPARSE_SOURCES} ) +add_library ( CXSparse SHARED ${CXSPARSE_SOURCES} ) -set_target_properties ( cxsparse PROPERTIES +set_target_properties ( CXSparse PROPERTIES VERSION ${CXSPARSE_VERSION_MAJOR}.${CXSPARSE_VERSION_MINOR}.${CXSPARSE_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON + OUTPUT_NAME cxsparse SOVERSION ${CXSPARSE_VERSION_MAJOR} PUBLIC_HEADER "Include/cs.h" WINDOWS_EXPORT_ALL_SYMBOLS ON ) +target_include_directories ( CXSparse + INTERFACE $ + $ ) + #------------------------------------------------------------------------------- # static cxsparse library properties #------------------------------------------------------------------------------- if ( NOT NSTATIC ) - add_library ( cxsparse_static STATIC ${CXSPARSE_SOURCES} ) + add_library ( CXSparse_static STATIC ${CXSPARSE_SOURCES} ) - set_target_properties ( cxsparse_static PROPERTIES + set_target_properties ( CXSparse_static PROPERTIES VERSION ${CXSPARSE_VERSION_MAJOR}.${CXSPARSE_VERSION_MINOR}.${CXSPARSE_VERSION_SUB} OUTPUT_NAME cxsparse C_STANDARD 11 @@ -123,25 +131,37 @@ if ( NOT NSTATIC ) SOVERSION ${CXSPARSE_VERSION_MAJOR} ) if ( MSVC ) - set_target_properties ( cxsparse_static PROPERTIES + set_target_properties ( CXSparse_static PROPERTIES OUTPUT_NAME cxsparse_static ) endif ( ) + + target_include_directories ( CXSparse_static + INTERFACE $ + $ ) + endif ( ) #------------------------------------------------------------------------------- # add the library dependencies #------------------------------------------------------------------------------- -target_link_libraries ( cxsparse PRIVATE ${SUITESPARSE_CONFIG_LIBRARY} ) +target_link_libraries ( CXSparse PRIVATE SuiteSparse::SuiteSparseConfig ) +target_include_directories ( CXSparse PUBLIC + "$" ) if ( NOT NSTATIC ) - target_link_libraries ( cxsparse_static PUBLIC ${SUITESPARSE_CONFIG_LIBRARY} ) + if ( TARGET SuiteSparse::SuiteSparseConfig_static ) + target_link_libraries ( CXSparse_static PUBLIC SuiteSparse::SuiteSparseConfig_static ) + else ( ) + target_link_libraries ( CXSparse_static PUBLIC SuiteSparse::SuiteSparseConfig ) + endif ( ) endif ( ) # libm: if ( NOT WIN32 ) - target_link_libraries ( cxsparse PRIVATE m ) + target_link_libraries ( CXSparse PRIVATE m ) if ( NOT NSTATIC ) - target_link_libraries ( cxsparse_static PUBLIC m ) + set ( CXSPARSE_STATIC_LIBS "${CXSPARSE_STATIC_LIBS} -lm" ) + target_link_libraries ( CXSparse_static PUBLIC m ) endif ( ) endif ( ) @@ -149,19 +169,73 @@ endif ( ) # installation location #------------------------------------------------------------------------------- -install ( TARGETS cxsparse +include ( CMakePackageConfigHelpers ) + +install ( TARGETS CXSparse + EXPORT CXSparseTargets LIBRARY DESTINATION ${SUITESPARSE_LIBDIR} ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} RUNTIME DESTINATION ${SUITESPARSE_BINDIR} PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} ) -install ( FILES ${CMAKE_SOURCE_DIR}/cmake_modules/FindCXSparse.cmake - DESTINATION ${SUITESPARSE_LIBDIR}/cmake/SuiteSparse - COMPONENT Development ) if ( NOT NSTATIC ) - install ( TARGETS cxsparse_static + install ( TARGETS CXSparse_static + EXPORT CXSparseTargets ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} ) endif ( ) +# create (temporary) export target file during build +export ( EXPORT CXSparseTargets + NAMESPACE SuiteSparse:: + FILE ${CMAKE_CURRENT_BINARY_DIR}/CXSparseTargets.cmake ) + +# install export target, config and version files for find_package +install ( EXPORT CXSparseTargets + NAMESPACE SuiteSparse:: + DESTINATION ${SUITESPARSE_LIBDIR}/cmake/CXSparse ) + +configure_package_config_file ( + Config/CXSparseConfig.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/CXSparseConfig.cmake + INSTALL_DESTINATION ${SUITESPARSE_LIBDIR}/cmake/CXSparse ) + +write_basic_package_version_file ( + ${CMAKE_CURRENT_BINARY_DIR}/CXSparseConfigVersion.cmake + COMPATIBILITY SameMajorVersion ) + +install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/CXSparseConfig.cmake + ${CMAKE_CURRENT_BINARY_DIR}/CXSparseConfigVersion.cmake + DESTINATION ${SUITESPARSE_LIBDIR}/cmake/CXSparse ) + +#------------------------------------------------------------------------------- +# create pkg-config file +#------------------------------------------------------------------------------- + +if ( NOT MSVC ) + set ( prefix "${CMAKE_INSTALL_PREFIX}" ) + set ( exec_prefix "\${prefix}" ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) + if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) + set ( libdir "${SUITESPARSE_LIBDIR}") + else ( ) + set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") + endif ( ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) + if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) + set ( includedir "${SUITESPARSE_INCLUDEDIR}") + else ( ) + set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + endif ( ) + configure_file ( + Config/CXSparse.pc.in + CXSparse.pc + @ONLY + NEWLINE_STYLE LF ) + install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/CXSparse.pc + DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) +endif ( ) + #------------------------------------------------------------------------------- # Demo library and programs #------------------------------------------------------------------------------- @@ -205,26 +279,26 @@ if ( DEMO ) endif ( ) # Libraries required for Demo programs - target_link_libraries ( cs_demo1 PUBLIC cxsparse ) - target_link_libraries ( cs_demo2 PUBLIC cxsparse ) - target_link_libraries ( cs_demo3 PUBLIC cxsparse ) + target_link_libraries ( cs_demo1 PUBLIC CXSparse ) + target_link_libraries ( cs_demo2 PUBLIC CXSparse ) + target_link_libraries ( cs_demo3 PUBLIC CXSparse ) - target_link_libraries ( cs_di_demo1 PUBLIC cxsparse ) - target_link_libraries ( cs_di_demo2 PUBLIC cxsparse ) - target_link_libraries ( cs_di_demo3 PUBLIC cxsparse ) + target_link_libraries ( cs_di_demo1 PUBLIC CXSparse ) + target_link_libraries ( cs_di_demo2 PUBLIC CXSparse ) + target_link_libraries ( cs_di_demo3 PUBLIC CXSparse ) - target_link_libraries ( cs_dl_demo1 PUBLIC cxsparse ) - target_link_libraries ( cs_dl_demo2 PUBLIC cxsparse ) - target_link_libraries ( cs_dl_demo3 PUBLIC cxsparse ) + target_link_libraries ( cs_dl_demo1 PUBLIC CXSparse ) + target_link_libraries ( cs_dl_demo2 PUBLIC CXSparse ) + target_link_libraries ( cs_dl_demo3 PUBLIC CXSparse ) if ( NOT NCOMPLEX ) - target_link_libraries ( cs_ci_demo1 PUBLIC cxsparse ) - target_link_libraries ( cs_ci_demo2 PUBLIC cxsparse ) - target_link_libraries ( cs_ci_demo3 PUBLIC cxsparse ) + target_link_libraries ( cs_ci_demo1 PUBLIC CXSparse ) + target_link_libraries ( cs_ci_demo2 PUBLIC CXSparse ) + target_link_libraries ( cs_ci_demo3 PUBLIC CXSparse ) - target_link_libraries ( cs_cl_demo1 PUBLIC cxsparse ) - target_link_libraries ( cs_cl_demo2 PUBLIC cxsparse ) - target_link_libraries ( cs_cl_demo3 PUBLIC cxsparse ) + target_link_libraries ( cs_cl_demo1 PUBLIC CXSparse ) + target_link_libraries ( cs_cl_demo2 PUBLIC CXSparse ) + target_link_libraries ( cs_cl_demo3 PUBLIC CXSparse ) if ( NOT WIN32 ) target_link_libraries ( cs_ci_demo1 PUBLIC m ) @@ -236,8 +310,8 @@ if ( DEMO ) target_link_libraries ( cs_cl_demo3 PUBLIC m ) endif ( ) - target_link_libraries ( cs_idemo PUBLIC cxsparse ) - target_link_libraries ( cs_ldemo PUBLIC cxsparse ) + target_link_libraries ( cs_idemo PUBLIC CXSparse ) + target_link_libraries ( cs_ldemo PUBLIC CXSparse ) endif ( ) else ( ) diff --git a/CXSparse/Config/CXSparse.pc.in b/CXSparse/Config/CXSparse.pc.in new file mode 100644 index 000000000..3b980d013 --- /dev/null +++ b/CXSparse/Config/CXSparse.pc.in @@ -0,0 +1,17 @@ +# CXSparse, Copyright (c) 2006-2023, Timothy A. Davis. +# All Rights Reserved. +# SPDX-License-Identifier: LGPL-2.1-or-later + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: CXSparse +URL: https://github.com/DrTimothyAldenDavis/SuiteSparse +Description: Direct methods for sparse linear systems for real and complex matrices in SuiteSparse +Version: @CXSPARSE_VERSION_MAJOR@.@CXSPARSE_VERSION_MINOR@.@CXSPARSE_VERSION_SUB@ +Requires.private: SuiteSparse_config +Libs: -L${libdir} -lcxsparse +Libs.private: @CXSPARSE_STATIC_LIBS@ +Cflags: -I${includedir} diff --git a/CXSparse/Config/CXSparseConfig.cmake.in b/CXSparse/Config/CXSparseConfig.cmake.in new file mode 100644 index 000000000..1cb709acc --- /dev/null +++ b/CXSparse/Config/CXSparseConfig.cmake.in @@ -0,0 +1,121 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/CXSparse/cmake_modules/CXSparseConfig.cmake +#------------------------------------------------------------------------------- + +# The following copyright and license applies to just this file only, not to +# the library itself: +# CXSparseConfig.cmake, Copyright (c) 2023, Timothy A. Davis. All Rights Reserved. +# SPDX-License-Identifier: BSD-3-clause + +#------------------------------------------------------------------------------- + +# Finds the CXSparse include file and compiled library. +# The following targets are defined: +# SuiteSparse::CXSparse - for the shared library (if available) +# SuiteSparse::CXSparse_static - for the static library (if available) + +# For backward compatibility the following variables are set: + +# CXSPARSE_INCLUDE_DIR - where to find cs.h +# CXSPARSE_LIBRARY - dynamic CXSPARSE library +# CXSPARSE_STATIC - static CXSPARSE library +# CXSPARSE_LIBRARIES - libraries when using CXSPARSE +# CXSPARSE_FOUND - true if CXSPARSE found + +# Set ``CMAKE_MODULE_PATH`` to the parent folder where this module file is +# installed. + +#------------------------------------------------------------------------------- + +@PACKAGE_INIT@ + +set ( CXSPARSE_DATE "@CXSPARSE_DATE@" ) +set ( CXSPARSE_VERSION_MAJOR @CXSPARSE_VERSION_MAJOR@ ) +set ( CXSPARSE_VERSION_MINOR @CXSPARSE_VERSION_MINOR@ ) +set ( CXSPARSE_VERSION_PATCH @CXSPARSE_VERSION_SUB@ ) +set ( CXSPARSE_VERSION "@CXSPARSE_VERSION_MAJOR@.@CXSPARSE_VERSION_MINOR@.@CXSPARSE_VERSION_SUB@" ) + +include ( ${CMAKE_CURRENT_LIST_DIR}/CXSparseTargets.cmake ) + +# The following is only for backward compatibility with FindCXSparse. + +set ( _target_shared SuiteSparse::CXSparse ) +set ( _target_static SuiteSparse::CXSparse_static ) +set ( _var_prefix "CXSPARSE" ) + +get_target_property ( ${_var_prefix}_INCLUDE_DIR ${_target_shared} INTERFACE_INCLUDE_DIRECTORIES ) +if ( ${_var_prefix}_INCLUDE_DIR ) + # First item in SuiteSparse targets contains the "main" header directory. + list ( GET ${_var_prefix}_INCLUDE_DIR 0 ${_var_prefix}_INCLUDE_DIR ) +endif ( ) +get_target_property ( ${_var_prefix}_LIBRARY ${_target_shared} IMPORTED_IMPLIB ) +if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} IMPORTED_LOCATION ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) +endif ( ) +if ( TARGET ${_target_static} ) + get_target_property ( ${_var_prefix}_STATIC ${_target_static} IMPORTED_LOCATION ) +endif ( ) + +# Check for most common build types +set ( _config_types "Debug" "Release" "RelWithDebInfo" "MinSizeRel" ) + +get_property ( _isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG ) +if ( _isMultiConfig ) + # For multi-configuration generators (e.g., Visual Studio), prefer those + # configurations. + list ( PREPEND _config_types ${CMAKE_CONFIGURATION_TYPES} ) +else ( ) + # For single-configuration generators, prefer the current configuration. + list ( PREPEND _config_types ${CMAKE_BUILD_TYPE} ) +endif ( ) + +list ( REMOVE_DUPLICATES _config_types ) + +foreach ( _config ${_config_types} ) + string ( TOUPPER ${_config} _uc_config ) + if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} + IMPORTED_IMPLIB_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) + endif ( ) + if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} + IMPORTED_LOCATION_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) + endif ( ) + if ( TARGET ${_target_static} AND NOT ${_var_prefix}_STATIC ) + get_target_property ( _library_chk ${_target_static} + IMPORTED_LOCATION_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_STATIC ${_library_chk} ) + endif ( ) + endif ( ) +endforeach ( ) + +set ( CXSPARSE_LIBRARIES ${CXSPARSE_LIBRARY} ) + +macro ( suitesparse_check_exist _var _files ) + # ignore generator expressions + string ( GENEX_STRIP "${_files}" _files2 ) + + foreach ( _file ${_files2} ) + if ( NOT EXISTS "${_file}" ) + message ( FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist!" ) + endif ( ) + endforeach () +endmacro ( ) + +suitesparse_check_exist ( CXSPARSE_INCLUDE_DIR ${CXSPARSE_INCLUDE_DIR} ) +suitesparse_check_exist ( CXSPARSE_LIBRARY ${CXSPARSE_LIBRARY} ) + +message ( STATUS "CXSparse version: ${CXSPARSE_VERSION}" ) +message ( STATUS "CXSparse include: ${CXSPARSE_INCLUDE_DIR}" ) +message ( STATUS "CXSparse library: ${CXSPARSE_LIBRARY}" ) +message ( STATUS "CXSparse static: ${CXSPARSE_STATIC}" ) diff --git a/CXSparse/Config/cs.h.in b/CXSparse/Config/cs.h.in index e73488a3d..6280e7467 100644 --- a/CXSparse/Config/cs.h.in +++ b/CXSparse/Config/cs.h.in @@ -27,12 +27,12 @@ #define _CXS_H #if @CXSPARSE_USE_COMPLEX@ -#include -#define cs_complex_t double _Complex -#endif - -#ifdef __cplusplus -extern "C" { +# ifdef __cplusplus +# include +# else +# include +# endif +# define cs_complex_t double _Complex #endif #define CS_VER @CXSPARSE_VERSION_MAJOR@ /* CXSparse Version */ @@ -47,6 +47,10 @@ extern "C" { #define cs_long_t_id "%" PRId64 #define cs_long_t_max INT64_MAX +#ifdef __cplusplus +extern "C" { +#endif + /* -------------------------------------------------------------------------- */ /* double/int32_t version of CXSparse */ /* -------------------------------------------------------------------------- */ diff --git a/CXSparse/Demo/cs_demo.out b/CXSparse/Demo/cs_demo.out index 5b6abbb23..5566fd258 100644 --- a/CXSparse/Demo/cs_demo.out +++ b/CXSparse/Demo/cs_demo.out @@ -1,259 +1,65 @@ -( cd build && cmake .. && make --jobs=8 ) --- Building CXSparse version: v4.0.2 (Dec 9, 2022) +( cd build && cmake -DDEMO=1 .. && cmake --build . --config Release -j8 ) +-- Building CXSparse version: v4.2.0 (Sept 8, 2023) -- Source: /home/faculty/d/davis/dev2/SuiteSparse/CXSparse -- Build: /home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build --- Local install: /home/faculty/d/davis/dev2/SuiteSparse/lib --- Local include: /home/faculty/d/davis/dev2/SuiteSparse/include --- Local bin: /home/faculty/d/davis/dev2/SuiteSparse/bin --- Install rpath: /home/faculty/d/davis/dev2/SuiteSparse/lib --- Build rpath: /home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build;/home/faculty/d/davis/dev2/SuiteSparse/lib +-- Install lib: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Install include: /home/faculty/d/davis/dev2/SuiteSparse/include +-- Install bin: /home/faculty/d/davis/dev2/SuiteSparse/bin +-- Install rpath: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Build rpath: /home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build;/home/faculty/d/davis/dev2/SuiteSparse/lib -- Build type: Release --- Fortran: GNU +-- Fortran: /usr/bin/f95 -- CUDA: not enabled --- SuiteSparse_config version: 6.0.2 +-- complex data type: enabled +-- SuiteSparse_config version: 7.2.0 -- SuiteSparse_config include: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config --- SuiteSparse_config library: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.so.6.0.2 +-- SuiteSparse_config library: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.so.7.2.0 -- SuiteSparse_config static: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.a --- Installation in ../lib and ../include, --- with 'make local ; make install'. No 'sudo' required. -- Also compiling the demos in CXSparse/Demo -- ------------------------------------------------------------------------ -- SuiteSparse CMAKE report for: cxsparse -- ------------------------------------------------------------------------ --- install in /usr/local: false --- install in SuiteSparse/lib and SuiteSparse/include: true +-- inside common SuiteSparse root: true +-- install in SuiteSparse/lib and SuiteSparse/include: 1 -- build type: Release -- NSTATIC: false (build static library) -- use OpenMP: no --- C compiler: GNU +-- C compiler: /usr/bin/cc -- C flags: -- C++ compiler: -- C++ flags: -- C Flags release: -O3 -DNDEBUG -- C++ Flags release: +-- Fortran compiler: /usr/bin/f95 -- compile definitions: -- ------------------------------------------------------------------------ --- Configuring done --- Generating done +-- Configuring done (0.0s) +-- Generating done (0.1s) -- Build files have been written to: /home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build -make[1]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -make[2]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -make[3]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -make[3]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -Consolidate compiler generated dependencies of target cxsparse -make[3]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -Consolidate compiler generated dependencies of target cxsparse_static -make[3]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -[ 45%] Built target cxsparse -[ 90%] Built target cxsparse_static -make[3]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -make[3]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -make[3]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -make[3]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -Consolidate compiler generated dependencies of target cs_demo1 -make[3]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -make[3]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -Consolidate compiler generated dependencies of target cs_demo2 -make[3]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -make[3]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -make[3]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -Consolidate compiler generated dependencies of target cs_demo3 -make[3]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -Consolidate compiler generated dependencies of target cs_di_demo1 -make[3]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -Consolidate compiler generated dependencies of target cs_di_demo3 -make[3]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -make[3]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -Consolidate compiler generated dependencies of target cs_di_demo2 -make[3]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -Consolidate compiler generated dependencies of target cs_dl_demo1 -make[3]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' +gmake[1]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' +[ 44%] Built target CXSparse +[ 89%] Built target CXSparse_static +[ 89%] Built target cs_di_demo1 +[ 90%] Built target cs_demo2 +[ 91%] Built target cs_demo3 [ 91%] Built target cs_demo1 -Consolidate compiler generated dependencies of target cs_dl_demo2 -make[3]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -[ 92%] Built target cs_demo2 -[ 92%] Built target cs_demo3 -[ 93%] Built target cs_di_demo1 -make[3]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -[ 94%] Built target cs_di_demo2 -[ 94%] Built target cs_di_demo3 -make[3]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -[ 95%] Built target cs_dl_demo1 -make[3]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -make[3]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -make[3]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -[ 96%] Built target cs_dl_demo2 -make[3]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -Consolidate compiler generated dependencies of target cs_dl_demo3 -make[3]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -Consolidate compiler generated dependencies of target cs_ci_demo1 -make[3]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -make[3]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -make[3]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -Consolidate compiler generated dependencies of target cs_ci_demo2 -Consolidate compiler generated dependencies of target cs_ci_demo3 -make[3]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -Consolidate compiler generated dependencies of target cs_cl_demo1 -make[3]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -make[3]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -Consolidate compiler generated dependencies of target cs_cl_demo2 -make[3]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -Consolidate compiler generated dependencies of target cs_idemo -make[3]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -Consolidate compiler generated dependencies of target cs_cl_demo3 -make[3]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -[ 96%] Built target cs_dl_demo3 -[ 96%] Built target cs_ci_demo1 -[ 97%] Built target cs_idemo -[ 98%] Built target cs_cl_demo2 -[ 98%] Built target cs_ci_demo3 -[ 99%] Built target cs_cl_demo1 -make[3]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -[100%] Built target cs_ci_demo2 -[100%] Built target cs_cl_demo3 -Consolidate compiler generated dependencies of target cs_ldemo -make[3]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -[100%] Built target cs_ldemo -make[2]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -make[1]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -( cd build && cmake -DDEMO=1 .. && make --jobs=8 ) --- Building CXSparse version: v4.0.2 (Dec 9, 2022) --- Source: /home/faculty/d/davis/dev2/SuiteSparse/CXSparse --- Build: /home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build --- Local install: /home/faculty/d/davis/dev2/SuiteSparse/lib --- Local include: /home/faculty/d/davis/dev2/SuiteSparse/include --- Local bin: /home/faculty/d/davis/dev2/SuiteSparse/bin --- Install rpath: /home/faculty/d/davis/dev2/SuiteSparse/lib --- Build rpath: /home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build;/home/faculty/d/davis/dev2/SuiteSparse/lib --- Build type: Release --- Fortran: GNU --- CUDA: not enabled --- SuiteSparse_config version: 6.0.2 --- SuiteSparse_config include: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config --- SuiteSparse_config library: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.so.6.0.2 --- SuiteSparse_config static: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.a --- Installation in ../lib and ../include, --- with 'make local ; make install'. No 'sudo' required. --- Also compiling the demos in CXSparse/Demo --- ------------------------------------------------------------------------ --- SuiteSparse CMAKE report for: cxsparse --- ------------------------------------------------------------------------ --- install in /usr/local: false --- install in SuiteSparse/lib and SuiteSparse/include: true --- build type: Release --- NSTATIC: false (build static library) --- use OpenMP: no --- C compiler: GNU --- C flags: --- C++ compiler: --- C++ flags: --- C Flags release: -O3 -DNDEBUG --- C++ Flags release: --- compile definitions: --- ------------------------------------------------------------------------ --- Configuring done --- Generating done --- Build files have been written to: /home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build -make[1]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -make[2]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -make[3]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -make[3]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -Consolidate compiler generated dependencies of target cxsparse_static -make[3]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -Consolidate compiler generated dependencies of target cxsparse -make[3]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -[ 85%] Built target cxsparse_static -[ 90%] Built target cxsparse -make[3]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -make[3]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -make[3]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -make[3]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -make[3]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -Consolidate compiler generated dependencies of target cs_demo1 -make[3]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -make[3]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -make[3]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -make[3]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -Consolidate compiler generated dependencies of target cs_demo3 -Consolidate compiler generated dependencies of target cs_demo2 -make[3]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -make[3]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -Consolidate compiler generated dependencies of target cs_di_demo1 -make[3]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -Consolidate compiler generated dependencies of target cs_di_demo2 -make[3]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -Consolidate compiler generated dependencies of target cs_di_demo3 -Consolidate compiler generated dependencies of target cs_dl_demo1 -make[3]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -make[3]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -Consolidate compiler generated dependencies of target cs_dl_demo2 -make[3]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -[ 90%] Built target cs_demo3 -[ 91%] Built target cs_dl_demo1 [ 92%] Built target cs_di_demo2 -[ 93%] Built target cs_demo1 +[ 92%] Built target cs_dl_demo1 [ 93%] Built target cs_di_demo3 -[ 95%] Built target cs_di_demo1 -[ 95%] Built target cs_demo2 -[ 96%] Built target cs_dl_demo2 -make[3]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -make[3]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -make[3]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -make[3]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -make[3]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -make[3]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -Consolidate compiler generated dependencies of target cs_dl_demo3 -make[3]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -make[3]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -make[3]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -Consolidate compiler generated dependencies of target cs_ci_demo1 -make[3]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -Consolidate compiler generated dependencies of target cs_ci_demo2 -Consolidate compiler generated dependencies of target cs_ci_demo3 -make[3]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -make[3]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -Consolidate compiler generated dependencies of target cs_cl_demo1 -Consolidate compiler generated dependencies of target cs_cl_demo2 -make[3]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -make[3]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -Consolidate compiler generated dependencies of target cs_cl_demo3 -make[3]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -Consolidate compiler generated dependencies of target cs_idemo -make[3]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -[ 96%] Built target cs_dl_demo3 -[ 96%] Built target cs_ci_demo1 -make[3]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -[ 96%] Built target cs_ci_demo3 -[ 97%] Built target cs_cl_demo1 -[ 98%] Built target cs_ci_demo2 +[ 94%] Built target cs_dl_demo2 +[ 94%] Built target cs_ci_demo2 +[ 95%] Built target cs_dl_demo3 +[ 95%] Built target cs_cl_demo1 +[ 96%] Built target cs_cl_demo3 +[ 97%] Built target cs_ci_demo1 +[ 98%] Built target cs_ci_demo3 [ 99%] Built target cs_cl_demo2 -[100%] Built target cs_idemo -[100%] Built target cs_cl_demo3 -Consolidate compiler generated dependencies of target cs_ldemo -make[3]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' +[ 99%] Built target cs_idemo [100%] Built target cs_ldemo -make[2]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -make[1]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' -./build/cs_idemo < Matrix/t2 - ---- cs_idemo, size of CS_INT: 4 - +gmake[1]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' +./build/cs_demo1 < Matrix/t1 T: -CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 -triplet: 4-by-4, nzmax: 16 nnz: 10 - 2 2 : (3, 3.14159) - 1 0 : (3.1, 42) - 3 3 : (1, 7) - 0 2 : (3.2, 0.1) - 1 1 : (2.9, 1.3) - 3 0 : (3.5, 0) - 3 1 : (0.4, 2.71828) - 1 3 : (0.9, 99) - 0 0 : (4.5, 6) - 2 1 : (1.7, 1) - -Treal: -CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 +CXSparse Version 4.2.0, Sept 8, 2023. Copyright (c) Timothy A. Davis, 2006-2022 triplet: 4-by-4, nzmax: 16 nnz: 10 2 2 : 3 1 0 : 3.1 @@ -265,41 +71,8 @@ triplet: 4-by-4, nzmax: 16 nnz: 10 1 3 : 0.9 0 0 : 4.5 2 1 : 1.7 - -Timag: -CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 -triplet: 4-by-4, nzmax: 16 nnz: 10 - 2 2 : 3.14159 - 1 0 : 42 - 3 3 : 7 - 0 2 : 0.1 - 1 1 : 1.3 - 3 0 : 0 - 3 1 : 2.71828 - 1 3 : 99 - 0 0 : 6 - 2 1 : 1 - A: -CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 -4-by-4, nzmax: 10 nnz: 10, 1-norm: 106.075 - col 0 : locations 0 to 2 - 1 : (3.1, 42) - 3 : (3.5, 0) - 0 : (4.5, 6) - col 1 : locations 3 to 5 - 1 : (2.9, 1.3) - 3 : (0.4, 2.71828) - 2 : (1.7, 1) - col 2 : locations 6 to 7 - 2 : (3, 3.14159) - 0 : (3.2, 0.1) - col 3 : locations 8 to 9 - 3 : (1, 7) - 1 : (0.9, 99) - -C1 = real(A): -CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 +CXSparse Version 4.2.0, Sept 8, 2023. Copyright (c) Timothy A. Davis, 2006-2022 4-by-4, nzmax: 10 nnz: 10, 1-norm: 11.1 col 0 : locations 0 to 2 1 : 3.1 @@ -315,234 +88,148 @@ CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 col 3 : locations 8 to 9 3 : 1 1 : 0.9 +AT: +CXSparse Version 4.2.0, Sept 8, 2023. Copyright (c) Timothy A. Davis, 2006-2022 +4-by-4, nzmax: 10 nnz: 10, 1-norm: 7.7 + col 0 : locations 0 to 1 + 0 : 4.5 + 2 : 3.2 + col 1 : locations 2 to 4 + 0 : 3.1 + 1 : 2.9 + 3 : 0.9 + col 2 : locations 5 to 6 + 1 : 1.7 + 2 : 3 + col 3 : locations 7 to 9 + 0 : 3.5 + 1 : 0.4 + 3 : 1 +D: +CXSparse Version 4.2.0, Sept 8, 2023. Copyright (c) Timothy A. Davis, 2006-2022 +4-by-4, nzmax: 16 nnz: 16, 1-norm: 139.58 + col 0 : locations 0 to 3 + 1 : 13.95 + 3 : 15.75 + 0 : 100.28 + 2 : 9.6 + col 1 : locations 4 to 7 + 1 : 88.62 + 3 : 12.91 + 0 : 13.95 + 2 : 4.93 + col 2 : locations 8 to 11 + 1 : 4.93 + 3 : 0.68 + 2 : 81.68 + 0 : 9.6 + col 3 : locations 12 to 15 + 1 : 12.91 + 3 : 83.2 + 0 : 15.75 + 2 : 0.68 +./build/cs_demo2 < Matrix/t1 -C2 = imag(A): -CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 -4-by-4, nzmax: 10 nnz: 10, 1-norm: 106 - col 0 : locations 0 to 2 - 1 : 42 - 3 : 0 - 0 : 6 - col 1 : locations 3 to 5 - 1 : 1.3 - 3 : 2.71828 - 2 : 1 - col 2 : locations 6 to 7 - 2 : 3.14159 - 0 : 0.1 - col 3 : locations 8 to 9 - 3 : 7 - 1 : 99 - -A1: -CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 -4-by-4, nzmax: 10 nnz: 10, 1-norm: 11.1 - col 0 : locations 0 to 2 - 1 : (3.1, 0) - 3 : (3.5, 0) - 0 : (4.5, 0) - col 1 : locations 3 to 5 - 1 : (2.9, 0) - 3 : (0.4, 0) - 2 : (1.7, 0) - col 2 : locations 6 to 7 - 2 : (3, 0) - 0 : (3.2, 0) - col 3 : locations 8 to 9 - 3 : (1, 0) - 1 : (0.9, 0) - -A2: -CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 -4-by-4, nzmax: 10 nnz: 10, 1-norm: 106 - col 0 : locations 0 to 2 - 1 : (0, 42) - 3 : (0, 0) - 0 : (0, 6) - col 1 : locations 3 to 5 - 1 : (0, 1.3) - 3 : (0, 2.71828) - 2 : (0, 1) - col 2 : locations 6 to 7 - 2 : (0, 3.14159) - 0 : (0, 0.1) - col 3 : locations 8 to 9 - 3 : (0, 7) - 1 : (0, 99) - -B = conj(A): -CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 -4-by-4, nzmax: 10 nnz: 10, 1-norm: 106.075 - col 0 : locations 0 to 2 - 1 : (3.1, -42) - 3 : (3.5, 0) - 0 : (4.5, -6) - col 1 : locations 3 to 5 - 1 : (2.9, -1.3) - 3 : (0.4, -2.71828) - 2 : (1.7, -1) - col 2 : locations 6 to 7 - 2 : (3, -3.14159) - 0 : (3.2, -0.1) - col 3 : locations 8 to 9 - 3 : (1, -7) - 1 : (0.9, -99) -./build/cs_ldemo < Matrix/t2 - ---- cs_ldemo, size of CS_INT: 8 - -T: -CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 -triplet: 4-by-4, nzmax: 16 nnz: 10 - 2 2 : (3, 3.14159) - 1 0 : (3.1, 42) - 3 3 : (1, 7) - 0 2 : (3.2, 0.1) - 1 1 : (2.9, 1.3) - 3 0 : (3.5, 0) - 3 1 : (0.4, 2.71828) - 1 3 : (0.9, 99) - 0 0 : (4.5, 6) - 2 1 : (1.7, 1) +--- Matrix: 4-by-4, nnz: 10 (sym: 0: nnz 0), norm: 1.11e+01 +blocks: 1 singletons: 0 structural rank: 4 +QR natural time: 0.00 resid: 3.06e-17 +QR amd(A'*A) time: 0.00 resid: 2.30e-17 +LU natural time: 0.00 resid: 1.53e-17 +LU amd(A+A') time: 0.00 resid: 1.53e-17 +LU amd(S'*S) time: 0.00 resid: 0.00e+00 +LU amd(A'*A) time: 0.00 resid: 1.53e-17 +./build/cs_demo2 < Matrix/fs_183_1 -Treal: -CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 -triplet: 4-by-4, nzmax: 16 nnz: 10 - 2 2 : 3 - 1 0 : 3.1 - 3 3 : 1 - 0 2 : 3.2 - 1 1 : 2.9 - 3 0 : 3.5 - 3 1 : 0.4 - 1 3 : 0.9 - 0 0 : 4.5 - 2 1 : 1.7 +--- Matrix: 183-by-183, nnz: 988 (sym: 0: nnz 0), norm: 1.70e+09 +zero entries dropped: 71 +tiny entries dropped: 10 +blocks: 38 singletons: 37 structural rank: 183 +QR natural time: 0.00 resid: 1.42e-27 +QR amd(A'*A) time: 0.00 resid: 3.35e-28 +LU natural time: 0.00 resid: 6.20e-28 +LU amd(A+A') time: 0.00 resid: 1.55e-27 +LU amd(S'*S) time: 0.00 resid: 6.98e-28 +LU amd(A'*A) time: 0.00 resid: 6.98e-28 +./build/cs_demo2 < Matrix/west0067 -Timag: -CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 -triplet: 4-by-4, nzmax: 16 nnz: 10 - 2 2 : 3.14159 - 1 0 : 42 - 3 3 : 7 - 0 2 : 0.1 - 1 1 : 1.3 - 3 0 : 0 - 3 1 : 2.71828 - 1 3 : 99 - 0 0 : 6 - 2 1 : 1 +--- Matrix: 67-by-67, nnz: 294 (sym: 0: nnz 0), norm: 6.14e+00 +blocks: 2 singletons: 1 structural rank: 67 +QR natural time: 0.00 resid: 5.19e-17 +QR amd(A'*A) time: 0.00 resid: 3.25e-17 +LU natural time: 0.00 resid: 3.89e-17 +LU amd(A+A') time: 0.00 resid: 2.27e-17 +LU amd(S'*S) time: 0.00 resid: 1.95e-17 +LU amd(A'*A) time: 0.00 resid: 2.60e-17 +./build/cs_demo2 < Matrix/lp_afiro -A: -CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 -4-by-4, nzmax: 10 nnz: 10, 1-norm: 106.075 - col 0 : locations 0 to 2 - 1 : (3.1, 42) - 3 : (3.5, 0) - 0 : (4.5, 6) - col 1 : locations 3 to 5 - 1 : (2.9, 1.3) - 3 : (0.4, 2.71828) - 2 : (1.7, 1) - col 2 : locations 6 to 7 - 2 : (3, 3.14159) - 0 : (3.2, 0.1) - col 3 : locations 8 to 9 - 3 : (1, 7) - 1 : (0.9, 99) +--- Matrix: 27-by-51, nnz: 102 (sym: 0: nnz 0), norm: 3.43e+00 +blocks: 1 singletons: 0 structural rank: 27 +QR natural time: 0.00 resid: 3.85e-16 +QR amd(A'*A) time: 0.00 resid: 1.50e-16 +./build/cs_demo2 < Matrix/ash219 -C1 = real(A): -CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 -4-by-4, nzmax: 10 nnz: 10, 1-norm: 11.1 - col 0 : locations 0 to 2 - 1 : 3.1 - 3 : 3.5 - 0 : 4.5 - col 1 : locations 3 to 5 - 1 : 2.9 - 3 : 0.4 - 2 : 1.7 - col 2 : locations 6 to 7 - 2 : 3 - 0 : 3.2 - col 3 : locations 8 to 9 - 3 : 1 - 1 : 0.9 +--- Matrix: 219-by-85, nnz: 438 (sym: 0: nnz 0), norm: 9.00e+00 +blocks: 1 singletons: 0 structural rank: 85 +QR natural time: 0.00 resid: 1.61e-02 +QR amd(A'*A) time: 0.00 resid: 1.61e-02 +./build/cs_demo2 < Matrix/mbeacxc -C2 = imag(A): -CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 -4-by-4, nzmax: 10 nnz: 10, 1-norm: 106 - col 0 : locations 0 to 2 - 1 : 42 - 3 : 0 - 0 : 6 - col 1 : locations 3 to 5 - 1 : 1.3 - 3 : 2.71828 - 2 : 1 - col 2 : locations 6 to 7 - 2 : 3.14159 - 0 : 0.1 - col 3 : locations 8 to 9 - 3 : 7 - 1 : 99 +--- Matrix: 492-by-490, nnz: 49920 (sym: 0: nnz 0), norm: 9.29e-01 +blocks: 10 singletons: 8 structural rank: 448 +QR natural time: 0.05 resid: nan +QR amd(A'*A) time: 0.06 resid: nan +./build/cs_demo2 < Matrix/bcsstk01 -A1: -CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 -4-by-4, nzmax: 10 nnz: 10, 1-norm: 11.1 - col 0 : locations 0 to 2 - 1 : (3.1, 0) - 3 : (3.5, 0) - 0 : (4.5, 0) - col 1 : locations 3 to 5 - 1 : (2.9, 0) - 3 : (0.4, 0) - 2 : (1.7, 0) - col 2 : locations 6 to 7 - 2 : (3, 0) - 0 : (3.2, 0) - col 3 : locations 8 to 9 - 3 : (1, 0) - 1 : (0.9, 0) +--- Matrix: 48-by-48, nnz: 224 (sym: -1: nnz 400), norm: 3.57e+09 +blocks: 1 singletons: 0 structural rank: 48 +QR natural time: 0.00 resid: 3.65e-19 +QR amd(A'*A) time: 0.00 resid: 4.02e-19 +LU natural time: 0.00 resid: 2.17e-19 +LU amd(A+A') time: 0.00 resid: 1.87e-19 +LU amd(S'*S) time: 0.00 resid: 2.38e-19 +LU amd(A'*A) time: 0.00 resid: 2.38e-19 +Chol natural time: 0.00 resid: 2.64e-19 +Chol amd(A+A') time: 0.00 resid: 2.55e-19 +./build/cs_demo3 < Matrix/bcsstk01 -A2: -CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 -4-by-4, nzmax: 10 nnz: 10, 1-norm: 106 - col 0 : locations 0 to 2 - 1 : (0, 42) - 3 : (0, 0) - 0 : (0, 6) - col 1 : locations 3 to 5 - 1 : (0, 1.3) - 3 : (0, 2.71828) - 2 : (0, 1) - col 2 : locations 6 to 7 - 2 : (0, 3.14159) - 0 : (0, 0.1) - col 3 : locations 8 to 9 - 3 : (0, 7) - 1 : (0, 99) +--- Matrix: 48-by-48, nnz: 224 (sym: -1: nnz 400), norm: 3.57e+09 -B = conj(A): -CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 -4-by-4, nzmax: 10 nnz: 10, 1-norm: 106.075 - col 0 : locations 0 to 2 - 1 : (3.1, -42) - 3 : (3.5, 0) - 0 : (4.5, -6) - col 1 : locations 3 to 5 - 1 : (2.9, -1.3) - 3 : (0.4, -2.71828) - 2 : (1.7, -1) - col 2 : locations 6 to 7 - 2 : (3, -3.14159) - 0 : (3.2, -0.1) - col 3 : locations 8 to 9 - 3 : (1, -7) - 1 : (0.9, -99) -./build/cs_demo1 < Matrix/t1 +chol then update/downdate amd(A+A') +symbolic chol time 0.00 +numeric chol time 0.00 +solve chol time 0.00 +original: resid: 2.55e-19 +update: time: 0.00 +update: time: 0.00 (incl solve) resid: 9.66e-19 +rechol: time: 0.00 (incl solve) resid: 1.55e-18 +downdate: time: 0.00 +downdate: time: 0.00 (incl solve) resid: 3.74e-17 +./build/cs_demo2 < Matrix/bcsstk16 + +--- Matrix: 4884-by-4884, nnz: 147631 (sym: -1: nnz 290378), norm: 7.01e+09 +blocks: 75 singletons: 74 structural rank: 4884 +QR amd(A'*A) time: 0.67 resid: 2.01e-22 +LU amd(A+A') time: 0.32 resid: 1.10e-22 +LU amd(S'*S) time: 0.32 resid: 1.28e-22 +LU amd(A'*A) time: 0.33 resid: 1.78e-22 +Chol amd(A+A') time: 0.10 resid: 1.19e-22 +./build/cs_demo3 < Matrix/bcsstk16 + +--- Matrix: 4884-by-4884, nnz: 147631 (sym: -1: nnz 290378), norm: 7.01e+09 + +chol then update/downdate amd(A+A') +symbolic chol time 0.01 +numeric chol time 0.09 +solve chol time 0.00 +original: resid: 1.19e-22 +update: time: 0.00 +update: time: 0.00 (incl solve) resid: 1.12e-23 +rechol: time: 0.09 (incl solve) resid: 1.17e-23 +downdate: time: 0.00 +downdate: time: 0.00 (incl solve) resid: 4.09e-22 +./build/cs_di_demo1 < Matrix/t1 T: -CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 +CXSparse Version 4.2.0, Sept 8, 2023. Copyright (c) Timothy A. Davis, 2006-2022 triplet: 4-by-4, nzmax: 16 nnz: 10 2 2 : 3 1 0 : 3.1 @@ -555,7 +242,7 @@ triplet: 4-by-4, nzmax: 16 nnz: 10 0 0 : 4.5 2 1 : 1.7 A: -CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 +CXSparse Version 4.2.0, Sept 8, 2023. Copyright (c) Timothy A. Davis, 2006-2022 4-by-4, nzmax: 10 nnz: 10, 1-norm: 11.1 col 0 : locations 0 to 2 1 : 3.1 @@ -572,7 +259,7 @@ CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 3 : 1 1 : 0.9 AT: -CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 +CXSparse Version 4.2.0, Sept 8, 2023. Copyright (c) Timothy A. Davis, 2006-2022 4-by-4, nzmax: 10 nnz: 10, 1-norm: 7.7 col 0 : locations 0 to 1 0 : 4.5 @@ -589,7 +276,7 @@ CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 1 : 0.4 3 : 1 D: -CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 +CXSparse Version 4.2.0, Sept 8, 2023. Copyright (c) Timothy A. Davis, 2006-2022 4-by-4, nzmax: 16 nnz: 16, 1-norm: 139.58 col 0 : locations 0 to 3 1 : 13.95 @@ -611,7 +298,7 @@ CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 3 : 83.2 0 : 15.75 2 : 0.68 -./build/cs_demo2 < Matrix/t1 +./build/cs_di_demo2 < Matrix/t1 --- Matrix: 4-by-4, nnz: 10 (sym: 0: nnz 0), norm: 1.11e+01 blocks: 1 singletons: 0 structural rank: 4 @@ -621,7 +308,7 @@ LU natural time: 0.00 resid: 1.53e-17 LU amd(A+A') time: 0.00 resid: 1.53e-17 LU amd(S'*S) time: 0.00 resid: 0.00e+00 LU amd(A'*A) time: 0.00 resid: 1.53e-17 -./build/cs_demo2 < Matrix/fs_183_1 +./build/cs_di_demo2 < Matrix/fs_183_1 --- Matrix: 183-by-183, nnz: 988 (sym: 0: nnz 0), norm: 1.70e+09 zero entries dropped: 71 @@ -633,7 +320,7 @@ LU natural time: 0.00 resid: 6.20e-28 LU amd(A+A') time: 0.00 resid: 1.55e-27 LU amd(S'*S) time: 0.00 resid: 6.98e-28 LU amd(A'*A) time: 0.00 resid: 6.98e-28 -./build/cs_demo2 < Matrix/west0067 +./build/cs_di_demo2 < Matrix/west0067 --- Matrix: 67-by-67, nnz: 294 (sym: 0: nnz 0), norm: 6.14e+00 blocks: 2 singletons: 1 structural rank: 67 @@ -643,25 +330,25 @@ LU natural time: 0.00 resid: 3.89e-17 LU amd(A+A') time: 0.00 resid: 2.27e-17 LU amd(S'*S) time: 0.00 resid: 1.95e-17 LU amd(A'*A) time: 0.00 resid: 2.60e-17 -./build/cs_demo2 < Matrix/lp_afiro +./build/cs_di_demo2 < Matrix/lp_afiro --- Matrix: 27-by-51, nnz: 102 (sym: 0: nnz 0), norm: 3.43e+00 blocks: 1 singletons: 0 structural rank: 27 QR natural time: 0.00 resid: 3.85e-16 QR amd(A'*A) time: 0.00 resid: 1.50e-16 -./build/cs_demo2 < Matrix/ash219 +./build/cs_di_demo2 < Matrix/ash219 --- Matrix: 219-by-85, nnz: 438 (sym: 0: nnz 0), norm: 9.00e+00 blocks: 1 singletons: 0 structural rank: 85 QR natural time: 0.00 resid: 1.61e-02 QR amd(A'*A) time: 0.00 resid: 1.61e-02 -./build/cs_demo2 < Matrix/mbeacxc +./build/cs_di_demo2 < Matrix/mbeacxc --- Matrix: 492-by-490, nnz: 49920 (sym: 0: nnz 0), norm: 9.29e-01 blocks: 10 singletons: 8 structural rank: 448 -QR natural time: 0.06 resid: nan -QR amd(A'*A) time: 0.07 resid: nan -./build/cs_demo2 < Matrix/bcsstk01 +QR natural time: 0.05 resid: nan +QR amd(A'*A) time: 0.06 resid: nan +./build/cs_di_demo2 < Matrix/bcsstk01 --- Matrix: 48-by-48, nnz: 224 (sym: -1: nnz 400), norm: 3.57e+09 blocks: 1 singletons: 0 structural rank: 48 @@ -673,7 +360,7 @@ LU amd(S'*S) time: 0.00 resid: 2.38e-19 LU amd(A'*A) time: 0.00 resid: 2.38e-19 Chol natural time: 0.00 resid: 2.64e-19 Chol amd(A+A') time: 0.00 resid: 2.55e-19 -./build/cs_demo3 < Matrix/bcsstk01 +./build/cs_di_demo3 < Matrix/bcsstk01 --- Matrix: 48-by-48, nnz: 224 (sym: -1: nnz 400), norm: 3.57e+09 @@ -687,16 +374,16 @@ update: time: 0.00 (incl solve) resid: 9.66e-19 rechol: time: 0.00 (incl solve) resid: 1.55e-18 downdate: time: 0.00 downdate: time: 0.00 (incl solve) resid: 3.74e-17 -./build/cs_demo2 < Matrix/bcsstk16 +./build/cs_di_demo2 < Matrix/bcsstk16 --- Matrix: 4884-by-4884, nnz: 147631 (sym: -1: nnz 290378), norm: 7.01e+09 blocks: 75 singletons: 74 structural rank: 4884 -QR amd(A'*A) time: 0.62 resid: 2.01e-22 +QR amd(A'*A) time: 0.63 resid: 2.01e-22 LU amd(A+A') time: 0.32 resid: 1.10e-22 LU amd(S'*S) time: 0.32 resid: 1.28e-22 LU amd(A'*A) time: 0.33 resid: 1.78e-22 Chol amd(A+A') time: 0.10 resid: 1.19e-22 -./build/cs_demo3 < Matrix/bcsstk16 +./build/cs_di_demo3 < Matrix/bcsstk16 --- Matrix: 4884-by-4884, nnz: 147631 (sym: -1: nnz 290378), norm: 7.01e+09 @@ -710,9 +397,9 @@ update: time: 0.00 (incl solve) resid: 1.12e-23 rechol: time: 0.09 (incl solve) resid: 1.17e-23 downdate: time: 0.00 downdate: time: 0.00 (incl solve) resid: 4.09e-22 -./build/cs_di_demo1 < Matrix/t1 +./build/cs_dl_demo1 < Matrix/t1 T: -CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 +CXSparse Version 4.2.0, Sept 8, 2023. Copyright (c) Timothy A. Davis, 2006-2022 triplet: 4-by-4, nzmax: 16 nnz: 10 2 2 : 3 1 0 : 3.1 @@ -725,7 +412,7 @@ triplet: 4-by-4, nzmax: 16 nnz: 10 0 0 : 4.5 2 1 : 1.7 A: -CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 +CXSparse Version 4.2.0, Sept 8, 2023. Copyright (c) Timothy A. Davis, 2006-2022 4-by-4, nzmax: 10 nnz: 10, 1-norm: 11.1 col 0 : locations 0 to 2 1 : 3.1 @@ -742,7 +429,7 @@ CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 3 : 1 1 : 0.9 AT: -CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 +CXSparse Version 4.2.0, Sept 8, 2023. Copyright (c) Timothy A. Davis, 2006-2022 4-by-4, nzmax: 10 nnz: 10, 1-norm: 7.7 col 0 : locations 0 to 1 0 : 4.5 @@ -759,7 +446,7 @@ CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 1 : 0.4 3 : 1 D: -CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 +CXSparse Version 4.2.0, Sept 8, 2023. Copyright (c) Timothy A. Davis, 2006-2022 4-by-4, nzmax: 16 nnz: 16, 1-norm: 139.58 col 0 : locations 0 to 3 1 : 13.95 @@ -781,7 +468,7 @@ CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 3 : 83.2 0 : 15.75 2 : 0.68 -./build/cs_di_demo2 < Matrix/t1 +./build/cs_dl_demo2 < Matrix/t1 --- Matrix: 4-by-4, nnz: 10 (sym: 0: nnz 0), norm: 1.11e+01 blocks: 1 singletons: 0 structural rank: 4 @@ -791,7 +478,7 @@ LU natural time: 0.00 resid: 1.53e-17 LU amd(A+A') time: 0.00 resid: 1.53e-17 LU amd(S'*S) time: 0.00 resid: 0.00e+00 LU amd(A'*A) time: 0.00 resid: 1.53e-17 -./build/cs_di_demo2 < Matrix/fs_183_1 +./build/cs_dl_demo2 < Matrix/fs_183_1 --- Matrix: 183-by-183, nnz: 988 (sym: 0: nnz 0), norm: 1.70e+09 zero entries dropped: 71 @@ -803,7 +490,7 @@ LU natural time: 0.00 resid: 6.20e-28 LU amd(A+A') time: 0.00 resid: 1.55e-27 LU amd(S'*S) time: 0.00 resid: 6.98e-28 LU amd(A'*A) time: 0.00 resid: 6.98e-28 -./build/cs_di_demo2 < Matrix/west0067 +./build/cs_dl_demo2 < Matrix/west0067 --- Matrix: 67-by-67, nnz: 294 (sym: 0: nnz 0), norm: 6.14e+00 blocks: 2 singletons: 1 structural rank: 67 @@ -813,25 +500,25 @@ LU natural time: 0.00 resid: 3.89e-17 LU amd(A+A') time: 0.00 resid: 2.27e-17 LU amd(S'*S) time: 0.00 resid: 1.95e-17 LU amd(A'*A) time: 0.00 resid: 2.60e-17 -./build/cs_di_demo2 < Matrix/lp_afiro +./build/cs_dl_demo2 < Matrix/lp_afiro --- Matrix: 27-by-51, nnz: 102 (sym: 0: nnz 0), norm: 3.43e+00 blocks: 1 singletons: 0 structural rank: 27 QR natural time: 0.00 resid: 3.85e-16 QR amd(A'*A) time: 0.00 resid: 1.50e-16 -./build/cs_di_demo2 < Matrix/ash219 +./build/cs_dl_demo2 < Matrix/ash219 --- Matrix: 219-by-85, nnz: 438 (sym: 0: nnz 0), norm: 9.00e+00 blocks: 1 singletons: 0 structural rank: 85 QR natural time: 0.00 resid: 1.61e-02 QR amd(A'*A) time: 0.00 resid: 1.61e-02 -./build/cs_di_demo2 < Matrix/mbeacxc +./build/cs_dl_demo2 < Matrix/mbeacxc --- Matrix: 492-by-490, nnz: 49920 (sym: 0: nnz 0), norm: 9.29e-01 blocks: 10 singletons: 8 structural rank: 448 -QR natural time: 0.06 resid: nan -QR amd(A'*A) time: 0.07 resid: nan -./build/cs_di_demo2 < Matrix/bcsstk01 +QR natural time: 0.05 resid: nan +QR amd(A'*A) time: 0.06 resid: nan +./build/cs_dl_demo2 < Matrix/bcsstk01 --- Matrix: 48-by-48, nnz: 224 (sym: -1: nnz 400), norm: 3.57e+09 blocks: 1 singletons: 0 structural rank: 48 @@ -843,7 +530,7 @@ LU amd(S'*S) time: 0.00 resid: 2.38e-19 LU amd(A'*A) time: 0.00 resid: 2.38e-19 Chol natural time: 0.00 resid: 2.64e-19 Chol amd(A+A') time: 0.00 resid: 2.55e-19 -./build/cs_di_demo3 < Matrix/bcsstk01 +./build/cs_dl_demo3 < Matrix/bcsstk01 --- Matrix: 48-by-48, nnz: 224 (sym: -1: nnz 400), norm: 3.57e+09 @@ -857,32 +544,261 @@ update: time: 0.00 (incl solve) resid: 9.66e-19 rechol: time: 0.00 (incl solve) resid: 1.55e-18 downdate: time: 0.00 downdate: time: 0.00 (incl solve) resid: 3.74e-17 -./build/cs_di_demo2 < Matrix/bcsstk16 +./build/cs_dl_demo2 < Matrix/bcsstk16 --- Matrix: 4884-by-4884, nnz: 147631 (sym: -1: nnz 290378), norm: 7.01e+09 blocks: 75 singletons: 74 structural rank: 4884 -QR amd(A'*A) time: 0.65 resid: 2.01e-22 -LU amd(A+A') time: 0.31 resid: 1.10e-22 -LU amd(S'*S) time: 0.31 resid: 1.28e-22 -LU amd(A'*A) time: 0.33 resid: 1.78e-22 +QR amd(A'*A) time: 0.64 resid: 2.01e-22 +LU amd(A+A') time: 0.33 resid: 1.10e-22 +LU amd(S'*S) time: 0.33 resid: 1.28e-22 +LU amd(A'*A) time: 0.35 resid: 1.78e-22 Chol amd(A+A') time: 0.10 resid: 1.19e-22 -./build/cs_di_demo3 < Matrix/bcsstk16 +./build/cs_dl_demo3 < Matrix/bcsstk16 + +--- Matrix: 4884-by-4884, nnz: 147631 (sym: -1: nnz 290378), norm: 7.01e+09 + +chol then update/downdate amd(A+A') +symbolic chol time 0.01 +numeric chol time 0.11 +solve chol time 0.00 +original: resid: 1.19e-22 +update: time: 0.00 +update: time: 0.00 (incl solve) resid: 1.12e-23 +rechol: time: 0.10 (incl solve) resid: 1.17e-23 +downdate: time: 0.00 +downdate: time: 0.00 (incl solve) resid: 4.09e-22 +( cd build && cmake -DDEMO=1 .. && cmake --build . --config Release -j8 ) +-- Building CXSparse version: v4.2.0 (Sept 8, 2023) +-- Source: /home/faculty/d/davis/dev2/SuiteSparse/CXSparse +-- Build: /home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build +-- Install lib: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Install include: /home/faculty/d/davis/dev2/SuiteSparse/include +-- Install bin: /home/faculty/d/davis/dev2/SuiteSparse/bin +-- Install rpath: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Build rpath: /home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build;/home/faculty/d/davis/dev2/SuiteSparse/lib +-- Build type: Release +-- Fortran: /usr/bin/f95 +-- CUDA: not enabled +-- complex data type: enabled +-- SuiteSparse_config version: 7.2.0 +-- SuiteSparse_config include: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config +-- SuiteSparse_config library: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.so.7.2.0 +-- SuiteSparse_config static: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.a +-- Also compiling the demos in CXSparse/Demo +-- ------------------------------------------------------------------------ +-- SuiteSparse CMAKE report for: cxsparse +-- ------------------------------------------------------------------------ +-- inside common SuiteSparse root: true +-- install in SuiteSparse/lib and SuiteSparse/include: 1 +-- build type: Release +-- NSTATIC: false (build static library) +-- use OpenMP: no +-- C compiler: /usr/bin/cc +-- C flags: +-- C++ compiler: +-- C++ flags: +-- C Flags release: -O3 -DNDEBUG +-- C++ Flags release: +-- Fortran compiler: /usr/bin/f95 +-- compile definitions: +-- ------------------------------------------------------------------------ +-- Configuring done (0.0s) +-- Generating done (0.1s) +-- Build files have been written to: /home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build +gmake[1]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' +[ 45%] Built target CXSparse_static +[ 89%] Built target CXSparse +[ 90%] Built target cs_dl_demo2 +[ 91%] Built target cs_demo2 +[ 91%] Built target cs_demo1 +[ 91%] Built target cs_di_demo1 +[ 92%] Built target cs_di_demo3 +[ 92%] Built target cs_dl_demo1 +[ 93%] Built target cs_demo3 +[ 94%] Built target cs_di_demo2 +[ 95%] Built target cs_ci_demo1 +[ 96%] Built target cs_dl_demo3 +[ 97%] Built target cs_ci_demo3 +[ 97%] Built target cs_idemo +[ 98%] Built target cs_cl_demo3 +[ 98%] Built target cs_ci_demo2 +[ 98%] Built target cs_cl_demo1 +[ 99%] Built target cs_cl_demo2 +[100%] Built target cs_ldemo +gmake[1]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/CXSparse/build' +./build/cs_idemo < Matrix/t2 + +--- cs_idemo, size of CS_INT: 4 + +T: +CXSparse Version 4.2.0, Sept 8, 2023. Copyright (c) Timothy A. Davis, 2006-2022 +triplet: 4-by-4, nzmax: 16 nnz: 10 + 2 2 : (3, 3.14159) + 1 0 : (3.1, 42) + 3 3 : (1, 7) + 0 2 : (3.2, 0.1) + 1 1 : (2.9, 1.3) + 3 0 : (3.5, 0) + 3 1 : (0.4, 2.71828) + 1 3 : (0.9, 99) + 0 0 : (4.5, 6) + 2 1 : (1.7, 1) + +Treal: +CXSparse Version 4.2.0, Sept 8, 2023. Copyright (c) Timothy A. Davis, 2006-2022 +triplet: 4-by-4, nzmax: 16 nnz: 10 + 2 2 : 3 + 1 0 : 3.1 + 3 3 : 1 + 0 2 : 3.2 + 1 1 : 2.9 + 3 0 : 3.5 + 3 1 : 0.4 + 1 3 : 0.9 + 0 0 : 4.5 + 2 1 : 1.7 + +Timag: +CXSparse Version 4.2.0, Sept 8, 2023. Copyright (c) Timothy A. Davis, 2006-2022 +triplet: 4-by-4, nzmax: 16 nnz: 10 + 2 2 : 3.14159 + 1 0 : 42 + 3 3 : 7 + 0 2 : 0.1 + 1 1 : 1.3 + 3 0 : 0 + 3 1 : 2.71828 + 1 3 : 99 + 0 0 : 6 + 2 1 : 1 + +A: +CXSparse Version 4.2.0, Sept 8, 2023. Copyright (c) Timothy A. Davis, 2006-2022 +4-by-4, nzmax: 10 nnz: 10, 1-norm: 106.075 + col 0 : locations 0 to 2 + 1 : (3.1, 42) + 3 : (3.5, 0) + 0 : (4.5, 6) + col 1 : locations 3 to 5 + 1 : (2.9, 1.3) + 3 : (0.4, 2.71828) + 2 : (1.7, 1) + col 2 : locations 6 to 7 + 2 : (3, 3.14159) + 0 : (3.2, 0.1) + col 3 : locations 8 to 9 + 3 : (1, 7) + 1 : (0.9, 99) + +C1 = real(A): +CXSparse Version 4.2.0, Sept 8, 2023. Copyright (c) Timothy A. Davis, 2006-2022 +4-by-4, nzmax: 10 nnz: 10, 1-norm: 11.1 + col 0 : locations 0 to 2 + 1 : 3.1 + 3 : 3.5 + 0 : 4.5 + col 1 : locations 3 to 5 + 1 : 2.9 + 3 : 0.4 + 2 : 1.7 + col 2 : locations 6 to 7 + 2 : 3 + 0 : 3.2 + col 3 : locations 8 to 9 + 3 : 1 + 1 : 0.9 + +C2 = imag(A): +CXSparse Version 4.2.0, Sept 8, 2023. Copyright (c) Timothy A. Davis, 2006-2022 +4-by-4, nzmax: 10 nnz: 10, 1-norm: 106 + col 0 : locations 0 to 2 + 1 : 42 + 3 : 0 + 0 : 6 + col 1 : locations 3 to 5 + 1 : 1.3 + 3 : 2.71828 + 2 : 1 + col 2 : locations 6 to 7 + 2 : 3.14159 + 0 : 0.1 + col 3 : locations 8 to 9 + 3 : 7 + 1 : 99 + +A1: +CXSparse Version 4.2.0, Sept 8, 2023. Copyright (c) Timothy A. Davis, 2006-2022 +4-by-4, nzmax: 10 nnz: 10, 1-norm: 11.1 + col 0 : locations 0 to 2 + 1 : (3.1, 0) + 3 : (3.5, 0) + 0 : (4.5, 0) + col 1 : locations 3 to 5 + 1 : (2.9, 0) + 3 : (0.4, 0) + 2 : (1.7, 0) + col 2 : locations 6 to 7 + 2 : (3, 0) + 0 : (3.2, 0) + col 3 : locations 8 to 9 + 3 : (1, 0) + 1 : (0.9, 0) + +A2: +CXSparse Version 4.2.0, Sept 8, 2023. Copyright (c) Timothy A. Davis, 2006-2022 +4-by-4, nzmax: 10 nnz: 10, 1-norm: 106 + col 0 : locations 0 to 2 + 1 : (0, 42) + 3 : (0, 0) + 0 : (0, 6) + col 1 : locations 3 to 5 + 1 : (0, 1.3) + 3 : (0, 2.71828) + 2 : (0, 1) + col 2 : locations 6 to 7 + 2 : (0, 3.14159) + 0 : (0, 0.1) + col 3 : locations 8 to 9 + 3 : (0, 7) + 1 : (0, 99) + +B = conj(A): +CXSparse Version 4.2.0, Sept 8, 2023. Copyright (c) Timothy A. Davis, 2006-2022 +4-by-4, nzmax: 10 nnz: 10, 1-norm: 106.075 + col 0 : locations 0 to 2 + 1 : (3.1, -42) + 3 : (3.5, 0) + 0 : (4.5, -6) + col 1 : locations 3 to 5 + 1 : (2.9, -1.3) + 3 : (0.4, -2.71828) + 2 : (1.7, -1) + col 2 : locations 6 to 7 + 2 : (3, -3.14159) + 0 : (3.2, -0.1) + col 3 : locations 8 to 9 + 3 : (1, -7) + 1 : (0.9, -99) +./build/cs_ldemo < Matrix/t2 ---- Matrix: 4884-by-4884, nnz: 147631 (sym: -1: nnz 290378), norm: 7.01e+09 +--- cs_ldemo, size of CS_INT: 8 -chol then update/downdate amd(A+A') -symbolic chol time 0.01 -numeric chol time 0.09 -solve chol time 0.00 -original: resid: 1.19e-22 -update: time: 0.00 -update: time: 0.00 (incl solve) resid: 1.12e-23 -rechol: time: 0.09 (incl solve) resid: 1.17e-23 -downdate: time: 0.00 -downdate: time: 0.00 (incl solve) resid: 4.09e-22 -./build/cs_dl_demo1 < Matrix/t1 T: -CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 +CXSparse Version 4.2.0, Sept 8, 2023. Copyright (c) Timothy A. Davis, 2006-2022 +triplet: 4-by-4, nzmax: 16 nnz: 10 + 2 2 : (3, 3.14159) + 1 0 : (3.1, 42) + 3 3 : (1, 7) + 0 2 : (3.2, 0.1) + 1 1 : (2.9, 1.3) + 3 0 : (3.5, 0) + 3 1 : (0.4, 2.71828) + 1 3 : (0.9, 99) + 0 0 : (4.5, 6) + 2 1 : (1.7, 1) + +Treal: +CXSparse Version 4.2.0, Sept 8, 2023. Copyright (c) Timothy A. Davis, 2006-2022 triplet: 4-by-4, nzmax: 16 nnz: 10 2 2 : 3 1 0 : 3.1 @@ -894,8 +810,41 @@ triplet: 4-by-4, nzmax: 16 nnz: 10 1 3 : 0.9 0 0 : 4.5 2 1 : 1.7 + +Timag: +CXSparse Version 4.2.0, Sept 8, 2023. Copyright (c) Timothy A. Davis, 2006-2022 +triplet: 4-by-4, nzmax: 16 nnz: 10 + 2 2 : 3.14159 + 1 0 : 42 + 3 3 : 7 + 0 2 : 0.1 + 1 1 : 1.3 + 3 0 : 0 + 3 1 : 2.71828 + 1 3 : 99 + 0 0 : 6 + 2 1 : 1 + A: -CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 +CXSparse Version 4.2.0, Sept 8, 2023. Copyright (c) Timothy A. Davis, 2006-2022 +4-by-4, nzmax: 10 nnz: 10, 1-norm: 106.075 + col 0 : locations 0 to 2 + 1 : (3.1, 42) + 3 : (3.5, 0) + 0 : (4.5, 6) + col 1 : locations 3 to 5 + 1 : (2.9, 1.3) + 3 : (0.4, 2.71828) + 2 : (1.7, 1) + col 2 : locations 6 to 7 + 2 : (3, 3.14159) + 0 : (3.2, 0.1) + col 3 : locations 8 to 9 + 3 : (1, 7) + 1 : (0.9, 99) + +C1 = real(A): +CXSparse Version 4.2.0, Sept 8, 2023. Copyright (c) Timothy A. Davis, 2006-2022 4-by-4, nzmax: 10 nnz: 10, 1-norm: 11.1 col 0 : locations 0 to 2 1 : 3.1 @@ -911,148 +860,81 @@ CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 col 3 : locations 8 to 9 3 : 1 1 : 0.9 -AT: -CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 -4-by-4, nzmax: 10 nnz: 10, 1-norm: 7.7 - col 0 : locations 0 to 1 - 0 : 4.5 - 2 : 3.2 - col 1 : locations 2 to 4 - 0 : 3.1 - 1 : 2.9 - 3 : 0.9 - col 2 : locations 5 to 6 - 1 : 1.7 - 2 : 3 - col 3 : locations 7 to 9 - 0 : 3.5 - 1 : 0.4 - 3 : 1 -D: -CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 -4-by-4, nzmax: 16 nnz: 16, 1-norm: 139.58 - col 0 : locations 0 to 3 - 1 : 13.95 - 3 : 15.75 - 0 : 100.28 - 2 : 9.6 - col 1 : locations 4 to 7 - 1 : 88.62 - 3 : 12.91 - 0 : 13.95 - 2 : 4.93 - col 2 : locations 8 to 11 - 1 : 4.93 - 3 : 0.68 - 2 : 81.68 - 0 : 9.6 - col 3 : locations 12 to 15 - 1 : 12.91 - 3 : 83.2 - 0 : 15.75 - 2 : 0.68 -./build/cs_dl_demo2 < Matrix/t1 - ---- Matrix: 4-by-4, nnz: 10 (sym: 0: nnz 0), norm: 1.11e+01 -blocks: 1 singletons: 0 structural rank: 4 -QR natural time: 0.00 resid: 3.06e-17 -QR amd(A'*A) time: 0.00 resid: 2.30e-17 -LU natural time: 0.00 resid: 1.53e-17 -LU amd(A+A') time: 0.00 resid: 1.53e-17 -LU amd(S'*S) time: 0.00 resid: 0.00e+00 -LU amd(A'*A) time: 0.00 resid: 1.53e-17 -./build/cs_dl_demo2 < Matrix/fs_183_1 - ---- Matrix: 183-by-183, nnz: 988 (sym: 0: nnz 0), norm: 1.70e+09 -zero entries dropped: 71 -tiny entries dropped: 10 -blocks: 38 singletons: 37 structural rank: 183 -QR natural time: 0.01 resid: 1.42e-27 -QR amd(A'*A) time: 0.00 resid: 3.35e-28 -LU natural time: 0.00 resid: 6.20e-28 -LU amd(A+A') time: 0.00 resid: 1.55e-27 -LU amd(S'*S) time: 0.00 resid: 6.98e-28 -LU amd(A'*A) time: 0.00 resid: 6.98e-28 -./build/cs_dl_demo2 < Matrix/west0067 - ---- Matrix: 67-by-67, nnz: 294 (sym: 0: nnz 0), norm: 6.14e+00 -blocks: 2 singletons: 1 structural rank: 67 -QR natural time: 0.00 resid: 5.19e-17 -QR amd(A'*A) time: 0.00 resid: 3.25e-17 -LU natural time: 0.00 resid: 3.89e-17 -LU amd(A+A') time: 0.00 resid: 2.27e-17 -LU amd(S'*S) time: 0.00 resid: 1.95e-17 -LU amd(A'*A) time: 0.00 resid: 2.60e-17 -./build/cs_dl_demo2 < Matrix/lp_afiro - ---- Matrix: 27-by-51, nnz: 102 (sym: 0: nnz 0), norm: 3.43e+00 -blocks: 1 singletons: 0 structural rank: 27 -QR natural time: 0.00 resid: 3.85e-16 -QR amd(A'*A) time: 0.00 resid: 1.50e-16 -./build/cs_dl_demo2 < Matrix/ash219 - ---- Matrix: 219-by-85, nnz: 438 (sym: 0: nnz 0), norm: 9.00e+00 -blocks: 1 singletons: 0 structural rank: 85 -QR natural time: 0.00 resid: 1.61e-02 -QR amd(A'*A) time: 0.00 resid: 1.61e-02 -./build/cs_dl_demo2 < Matrix/mbeacxc - ---- Matrix: 492-by-490, nnz: 49920 (sym: 0: nnz 0), norm: 9.29e-01 -blocks: 10 singletons: 8 structural rank: 448 -QR natural time: 0.05 resid: nan -QR amd(A'*A) time: 0.06 resid: nan -./build/cs_dl_demo2 < Matrix/bcsstk01 - ---- Matrix: 48-by-48, nnz: 224 (sym: -1: nnz 400), norm: 3.57e+09 -blocks: 1 singletons: 0 structural rank: 48 -QR natural time: 0.00 resid: 3.65e-19 -QR amd(A'*A) time: 0.00 resid: 4.02e-19 -LU natural time: 0.00 resid: 2.17e-19 -LU amd(A+A') time: 0.00 resid: 1.87e-19 -LU amd(S'*S) time: 0.00 resid: 2.38e-19 -LU amd(A'*A) time: 0.00 resid: 2.38e-19 -Chol natural time: 0.00 resid: 2.64e-19 -Chol amd(A+A') time: 0.00 resid: 2.55e-19 -./build/cs_dl_demo3 < Matrix/bcsstk01 ---- Matrix: 48-by-48, nnz: 224 (sym: -1: nnz 400), norm: 3.57e+09 - -chol then update/downdate amd(A+A') -symbolic chol time 0.00 -numeric chol time 0.00 -solve chol time 0.00 -original: resid: 2.55e-19 -update: time: 0.00 -update: time: 0.00 (incl solve) resid: 9.66e-19 -rechol: time: 0.00 (incl solve) resid: 1.55e-18 -downdate: time: 0.00 -downdate: time: 0.00 (incl solve) resid: 3.74e-17 -./build/cs_dl_demo2 < Matrix/bcsstk16 +C2 = imag(A): +CXSparse Version 4.2.0, Sept 8, 2023. Copyright (c) Timothy A. Davis, 2006-2022 +4-by-4, nzmax: 10 nnz: 10, 1-norm: 106 + col 0 : locations 0 to 2 + 1 : 42 + 3 : 0 + 0 : 6 + col 1 : locations 3 to 5 + 1 : 1.3 + 3 : 2.71828 + 2 : 1 + col 2 : locations 6 to 7 + 2 : 3.14159 + 0 : 0.1 + col 3 : locations 8 to 9 + 3 : 7 + 1 : 99 ---- Matrix: 4884-by-4884, nnz: 147631 (sym: -1: nnz 290378), norm: 7.01e+09 -blocks: 75 singletons: 74 structural rank: 4884 -QR amd(A'*A) time: 0.63 resid: 2.01e-22 -LU amd(A+A') time: 0.34 resid: 1.10e-22 -LU amd(S'*S) time: 0.33 resid: 1.28e-22 -LU amd(A'*A) time: 0.35 resid: 1.78e-22 -Chol amd(A+A') time: 0.11 resid: 1.19e-22 -./build/cs_dl_demo3 < Matrix/bcsstk16 +A1: +CXSparse Version 4.2.0, Sept 8, 2023. Copyright (c) Timothy A. Davis, 2006-2022 +4-by-4, nzmax: 10 nnz: 10, 1-norm: 11.1 + col 0 : locations 0 to 2 + 1 : (3.1, 0) + 3 : (3.5, 0) + 0 : (4.5, 0) + col 1 : locations 3 to 5 + 1 : (2.9, 0) + 3 : (0.4, 0) + 2 : (1.7, 0) + col 2 : locations 6 to 7 + 2 : (3, 0) + 0 : (3.2, 0) + col 3 : locations 8 to 9 + 3 : (1, 0) + 1 : (0.9, 0) ---- Matrix: 4884-by-4884, nnz: 147631 (sym: -1: nnz 290378), norm: 7.01e+09 +A2: +CXSparse Version 4.2.0, Sept 8, 2023. Copyright (c) Timothy A. Davis, 2006-2022 +4-by-4, nzmax: 10 nnz: 10, 1-norm: 106 + col 0 : locations 0 to 2 + 1 : (0, 42) + 3 : (0, 0) + 0 : (0, 6) + col 1 : locations 3 to 5 + 1 : (0, 1.3) + 3 : (0, 2.71828) + 2 : (0, 1) + col 2 : locations 6 to 7 + 2 : (0, 3.14159) + 0 : (0, 0.1) + col 3 : locations 8 to 9 + 3 : (0, 7) + 1 : (0, 99) -chol then update/downdate amd(A+A') -symbolic chol time 0.01 -numeric chol time 0.10 -solve chol time 0.00 -original: resid: 1.19e-22 -update: time: 0.00 -update: time: 0.00 (incl solve) resid: 1.12e-23 -rechol: time: 0.10 (incl solve) resid: 1.17e-23 -downdate: time: 0.00 -downdate: time: 0.00 (incl solve) resid: 4.09e-22 +B = conj(A): +CXSparse Version 4.2.0, Sept 8, 2023. Copyright (c) Timothy A. Davis, 2006-2022 +4-by-4, nzmax: 10 nnz: 10, 1-norm: 106.075 + col 0 : locations 0 to 2 + 1 : (3.1, -42) + 3 : (3.5, 0) + 0 : (4.5, -6) + col 1 : locations 3 to 5 + 1 : (2.9, -1.3) + 3 : (0.4, -2.71828) + 2 : (1.7, -1) + col 2 : locations 6 to 7 + 2 : (3, -3.14159) + 0 : (3.2, -0.1) + col 3 : locations 8 to 9 + 3 : (1, -7) + 1 : (0.9, -99) ./build/cs_ci_demo1 < Matrix/t2 T: -CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 +CXSparse Version 4.2.0, Sept 8, 2023. Copyright (c) Timothy A. Davis, 2006-2022 triplet: 4-by-4, nzmax: 16 nnz: 10 2 2 : (3, 3.14159) 1 0 : (3.1, 42) @@ -1065,7 +947,7 @@ triplet: 4-by-4, nzmax: 16 nnz: 10 0 0 : (4.5, 6) 2 1 : (1.7, 1) A: -CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 +CXSparse Version 4.2.0, Sept 8, 2023. Copyright (c) Timothy A. Davis, 2006-2022 4-by-4, nzmax: 10 nnz: 10, 1-norm: 106.075 col 0 : locations 0 to 2 1 : (3.1, 42) @@ -1082,7 +964,7 @@ CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 3 : (1, 7) 1 : (0.9, 99) AT: -CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 +CXSparse Version 4.2.0, Sept 8, 2023. Copyright (c) Timothy A. Davis, 2006-2022 4-by-4, nzmax: 10 nnz: 10, 1-norm: 144.296 col 0 : locations 0 to 1 0 : (4.5, -6) @@ -1099,7 +981,7 @@ CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 1 : (0.4, -2.71828) 3 : (1, -7) D: -CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 +CXSparse Version 4.2.0, Sept 8, 2023. Copyright (c) Timothy A. Davis, 2006-2022 4-by-4, nzmax: 16 nnz: 16, 1-norm: 25308.3 col 0 : locations 0 to 3 1 : (265.95, 170.4) @@ -1163,8 +1045,8 @@ LU amd(A'*A) time: 0.00 resid: 4.76e-17 --- Matrix: 492-by-490, nnz: 49920 (sym: 0: nnz 0), norm: 9.29e-01 blocks: 10 singletons: 8 structural rank: 448 -QR natural time: 0.12 resid: nan -QR amd(A'*A) time: 0.13 resid: nan +QR natural time: 0.14 resid: nan +QR amd(A'*A) time: 0.14 resid: nan ./build/cs_ci_demo2 < Matrix/young1c --- Matrix: 841-by-841, nnz: 4089 (sym: 0: nnz 0), norm: 7.30e+02 @@ -1189,8 +1071,8 @@ LU amd(A'*A) time: 0.01 resid: 4.71e-17 --- Matrix: 1600-by-1600, nnz: 7840 (sym: 0: nnz 0), norm: 1.41e+01 blocks: 1 singletons: 0 structural rank: 1600 -QR amd(A'*A) time: 0.01 resid: 1.04e-15 -LU amd(A+A') time: 0.00 resid: 3.55e-16 +QR amd(A'*A) time: 0.02 resid: 1.04e-15 +LU amd(A+A') time: 0.01 resid: 3.55e-16 LU amd(S'*S) time: 0.01 resid: 4.03e-16 LU amd(A'*A) time: 0.01 resid: 4.03e-16 ./build/cs_ci_demo2 < Matrix/c4 @@ -1224,7 +1106,7 @@ downdate: time: 0.00 (incl solve) resid: 5.85e-17 --- Matrix: 1280-by-1280, nnz: 11963 (sym: -1: nnz 22646), norm: 8.00e+01 tiny entries dropped: 66 blocks: 20 singletons: 14 structural rank: 1280 -QR amd(A'*A) time: 0.00 resid: 6.15e-25 +QR amd(A'*A) time: 0.01 resid: 6.15e-25 LU amd(A+A') time: 0.00 resid: 2.33e-25 LU amd(S'*S) time: 0.00 resid: 3.96e-25 LU amd(A'*A) time: 0.00 resid: 3.96e-25 @@ -1245,7 +1127,7 @@ downdate: time: 0.00 downdate: time: 0.00 (incl solve) resid: 5.85e-25 ./build/cs_cl_demo1 < Matrix/t2 T: -CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 +CXSparse Version 4.2.0, Sept 8, 2023. Copyright (c) Timothy A. Davis, 2006-2022 triplet: 4-by-4, nzmax: 16 nnz: 10 2 2 : (3, 3.14159) 1 0 : (3.1, 42) @@ -1258,7 +1140,7 @@ triplet: 4-by-4, nzmax: 16 nnz: 10 0 0 : (4.5, 6) 2 1 : (1.7, 1) A: -CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 +CXSparse Version 4.2.0, Sept 8, 2023. Copyright (c) Timothy A. Davis, 2006-2022 4-by-4, nzmax: 10 nnz: 10, 1-norm: 106.075 col 0 : locations 0 to 2 1 : (3.1, 42) @@ -1275,7 +1157,7 @@ CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 3 : (1, 7) 1 : (0.9, 99) AT: -CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 +CXSparse Version 4.2.0, Sept 8, 2023. Copyright (c) Timothy A. Davis, 2006-2022 4-by-4, nzmax: 10 nnz: 10, 1-norm: 144.296 col 0 : locations 0 to 1 0 : (4.5, -6) @@ -1292,7 +1174,7 @@ CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 1 : (0.4, -2.71828) 3 : (1, -7) D: -CXSparse Version 4.0.2, Dec 9, 2022. Copyright (c) Timothy A. Davis, 2006-2022 +CXSparse Version 4.2.0, Sept 8, 2023. Copyright (c) Timothy A. Davis, 2006-2022 4-by-4, nzmax: 16 nnz: 16, 1-norm: 25308.3 col 0 : locations 0 to 3 1 : (265.95, 170.4) @@ -1356,7 +1238,7 @@ LU amd(A'*A) time: 0.00 resid: 4.76e-17 --- Matrix: 492-by-490, nnz: 49920 (sym: 0: nnz 0), norm: 9.29e-01 blocks: 10 singletons: 8 structural rank: 448 -QR natural time: 0.12 resid: nan +QR natural time: 0.14 resid: nan QR amd(A'*A) time: 0.13 resid: nan ./build/cs_cl_demo2 < Matrix/young1c @@ -1373,7 +1255,7 @@ LU amd(A'*A) time: 0.00 resid: 3.37e-16 --- Matrix: 324-by-324, nnz: 26730 (sym: 0: nnz 0), norm: 1.71e+00 blocks: 1 singletons: 0 structural rank: 324 QR natural time: 0.02 resid: 9.42e-17 -QR amd(A'*A) time: 0.02 resid: 8.94e-17 +QR amd(A'*A) time: 0.03 resid: 8.94e-17 LU natural time: 0.01 resid: 6.01e-17 LU amd(A+A') time: 0.01 resid: 4.05e-17 LU amd(S'*S) time: 0.01 resid: 4.71e-17 @@ -1382,8 +1264,8 @@ LU amd(A'*A) time: 0.01 resid: 4.71e-17 --- Matrix: 1600-by-1600, nnz: 7840 (sym: 0: nnz 0), norm: 1.41e+01 blocks: 1 singletons: 0 structural rank: 1600 -QR amd(A'*A) time: 0.01 resid: 1.04e-15 -LU amd(A+A') time: 0.00 resid: 3.55e-16 +QR amd(A'*A) time: 0.02 resid: 1.04e-15 +LU amd(A+A') time: 0.01 resid: 3.55e-16 LU amd(S'*S) time: 0.01 resid: 4.03e-16 LU amd(A'*A) time: 0.01 resid: 4.03e-16 ./build/cs_cl_demo2 < Matrix/c4 diff --git a/CXSparse/Doc/ChangeLog b/CXSparse/Doc/ChangeLog index 509347381..731fd73b9 100644 --- a/CXSparse/Doc/ChangeLog +++ b/CXSparse/Doc/ChangeLog @@ -1,3 +1,8 @@ +Sept 8, 2023: version 4.2.0 + + * cmake updates: SuiteSparse:: namespace by Markus Muetzel + * complex types: more changes for C++, from Markus Muetzel + June 16, 2023: version 4.0.4 * cmake build system updates: update by Markus Muetzel diff --git a/CXSparse/Include/cs.h b/CXSparse/Include/cs.h index 5a083f82c..05e62b5ef 100644 --- a/CXSparse/Include/cs.h +++ b/CXSparse/Include/cs.h @@ -27,18 +27,18 @@ #define _CXS_H #if 1 -#include -#define cs_complex_t double _Complex -#endif - -#ifdef __cplusplus -extern "C" { +# ifdef __cplusplus +# include +# else +# include +# endif +# define cs_complex_t double _Complex #endif #define CS_VER 4 /* CXSparse Version */ -#define CS_SUBVER 0 -#define CS_SUBSUB 4 -#define CS_DATE "June 16, 2023" /* CXSparse release date */ +#define CS_SUBVER 2 +#define CS_SUBSUB 0 +#define CS_DATE "Sept 8, 2023" /* CXSparse release date */ #define CS_COPYRIGHT "Copyright (c) Timothy A. Davis, 2006-2022" #define CXSPARSE @@ -47,6 +47,10 @@ extern "C" { #define cs_long_t_id "%" PRId64 #define cs_long_t_max INT64_MAX +#ifdef __cplusplus +extern "C" { +#endif + /* -------------------------------------------------------------------------- */ /* double/int32_t version of CXSparse */ /* -------------------------------------------------------------------------- */ diff --git a/CXSparse/cmake_modules/FindCXSparse.cmake b/CXSparse/cmake_modules/FindCXSparse.cmake deleted file mode 100644 index 11bddd36b..000000000 --- a/CXSparse/cmake_modules/FindCXSparse.cmake +++ /dev/null @@ -1,136 +0,0 @@ -#------------------------------------------------------------------------------- -# SuiteSparse/CXSparse/cmake_modules/FindCXSparse.cmake -#------------------------------------------------------------------------------- - -# The following copyright and license applies to just this file only, not to -# the library itself: -# FindCXSparse.cmake, Copyright (c) 2022-2023, Timothy A. Davis. All Rights Reserved. -# SPDX-License-Identifier: BSD-3-clause - -#------------------------------------------------------------------------------- - -# Finds the CXSparse include file and compiled library and sets: - -# CXSPARSE_INCLUDE_DIR - where to find cs.h -# CXSPARSE_LIBRARY - dynamic CXSPARSE library -# CXSPARSE_STATIC - static CXSPARSE library -# CXSPARSE_LIBRARIES - libraries when using CXSPARSE -# CXSPARSE_FOUND - true if CXSPARSE found - -# set ``CXSparse_ROOT`` or ``CXSPARSE_ROOT`` to a CXSPARSE installation root to -# tell this module where to look. - -# All the Find*.cmake files in SuiteSparse are installed by 'make install' into -# /usr/local/lib/cmake/SuiteSparse (where '/usr/local' is the -# ${CMAKE_INSTALL_PREFIX}). To access this file, place the following commands -# in your CMakeLists.txt file. See also SuiteSparse/Example/CMakeLists.txt: -# -# set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} -# ${CMAKE_INSTALL_PREFIX}/lib/cmake/SuiteSparse ) - -#------------------------------------------------------------------------------- - - -# include files for CXSPARSE -find_path ( CXSPARSE_INCLUDE_DIR - NAMES cs.h - HINTS ${CXSPARSE_ROOT} - HINTS ENV CXSPARSE_ROOT - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/CXSparse - HINTS ${CMAKE_SOURCE_DIR}/../CXSparse - PATH_SUFFIXES include Include -) - -# dynamic CXSPARSE library (or static if no dynamic library was built) -find_library ( CXSPARSE_LIBRARY - NAMES cxsparse cxsparse_static - HINTS ${CXSPARSE_ROOT} - HINTS ENV CXSPARSE_ROOT - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/CXSparse - HINTS ${CMAKE_SOURCE_DIR}/../CXSparse - PATH_SUFFIXES lib build build/Release build/Debug -) - -if ( MSVC ) - set ( STATIC_NAME cxsparse_static cxsparse ) -else ( ) - set ( STATIC_NAME cxsparse ) - set ( save ${CMAKE_FIND_LIBRARY_SUFFIXES} ) - set ( CMAKE_FIND_LIBRARY_SUFFIXES - ${CMAKE_STATIC_LIBRARY_SUFFIX} ${CMAKE_FIND_LIBRARY_SUFFIXES} ) -endif ( ) - -# static CXSPARSE library -find_library ( CXSPARSE_STATIC - NAMES ${STATIC_NAME} - HINTS ${CXSPARSE_ROOT} - HINTS ENV CXSPARSE_ROOT - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/CXSparse - HINTS ${CMAKE_SOURCE_DIR}/../CXSparse - PATH_SUFFIXES lib build build/Release build/Debug -) - -if ( NOT MSVC ) - # restore the CMAKE_FIND_LIBRARY_SUFFIXES variable - set ( CMAKE_FIND_LIBRARY_SUFFIXES ${save} ) -endif ( ) - -# get version of the library from the dynamic library name -get_filename_component ( CXSPARSE_LIBRARY ${CXSPARSE_LIBRARY} REALPATH ) -get_filename_component ( CXSPARSE_FILENAME ${CXSPARSE_LIBRARY} NAME ) -string ( - REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" - CXSPARSE_VERSION - ${CXSPARSE_FILENAME} -) - -# set ( CXSPARSE_VERSION "" ) -if ( EXISTS "${CXSPARSE_INCLUDE_DIR}" AND NOT CXSPARSE_VERSION ) - # if the version does not appear in the filename, read the include file - file ( STRINGS ${CXSPARSE_INCLUDE_DIR}/cs.h CXSPARSE_MAJOR_STR - REGEX "define CS_VER" ) - file ( STRINGS ${CXSPARSE_INCLUDE_DIR}/cs.h CXSPARSE_MINOR_STR - REGEX "define CS_SUBVER" ) - file ( STRINGS ${CXSPARSE_INCLUDE_DIR}/cs.h CXSPARSE_PATCH_STR - REGEX "define CS_SUBSUB" ) - message ( STATUS "major: ${CXSPARSE_MAJOR_STR}" ) - message ( STATUS "minor: ${CXSPARSE_MINOR_STR}" ) - message ( STATUS "patch: ${CXSPARSE_PATCH_STR}" ) - string ( REGEX MATCH "[0-9]+" CXSPARSE_MAJOR ${CXSPARSE_MAJOR_STR} ) - string ( REGEX MATCH "[0-9]+" CXSPARSE_MINOR ${CXSPARSE_MINOR_STR} ) - string ( REGEX MATCH "[0-9]+" CXSPARSE_PATCH ${CXSPARSE_PATCH_STR} ) - set (CXSPARSE_VERSION "${CXSPARSE_MAJOR}.${CXSPARSE_MINOR}.${CXSPARSE_PATCH}") -endif ( ) - -set ( CXSPARSE_LIBRARIES ${CXSPARSE_LIBRARY} ) - -include (FindPackageHandleStandardArgs) - -find_package_handle_standard_args ( CXSparse - REQUIRED_VARS CXSPARSE_LIBRARY CXSPARSE_INCLUDE_DIR - VERSION_VAR CXSPARSE_VERSION -) - -mark_as_advanced ( - CXSPARSE_INCLUDE_DIR - CXSPARSE_LIBRARY - CXSPARSE_STATIC - CXSPARSE_LIBRARIES -) - -if ( CXSPARSE_FOUND ) - message ( STATUS "CXSparse version: ${CXSPARSE_VERSION}" ) - message ( STATUS "CXSparse include: ${CXSPARSE_INCLUDE_DIR}" ) - message ( STATUS "CXSparse library: ${CXSPARSE_LIBRARY}" ) - message ( STATUS "CXSparse static: ${CXSPARSE_STATIC}" ) -else ( ) - message ( STATUS "CXSparse not found" ) - set ( CXSPARSE_INCLUDE_DIR "" ) - set ( CXSPARSE_LIBRARIES "" ) - set ( CXSPARSE_LIBRARY "" ) - set ( CXSPARSE_STATIC "" ) -endif ( ) - diff --git a/ChangeLog b/ChangeLog index f4b0053d7..337974d5c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Sept 8, 2023: version 7.2.0 + + * build system: modern cmake structure, by Markus Muetzel. + Most packages updated to vX.2.0 where X is unchanged (except SPQR + and Example package). + * SPQR v4.2.0: Major SO update. Support for int32 indices by Raye Kimmerer + June 29, 2023: version 7.1.0 * GraphBLAS v8.0.2: major update with a new JIT feature. diff --git a/Example/CMakeLists.txt b/Example/CMakeLists.txt index 5fdb17d02..87f0b2583 100644 --- a/Example/CMakeLists.txt +++ b/Example/CMakeLists.txt @@ -9,13 +9,13 @@ # get the version #------------------------------------------------------------------------------- -cmake_minimum_required ( VERSION 3.19 ) +cmake_minimum_required ( VERSION 3.20 ) # cmake inserts the date and version number into Include/my.h: -set ( MY_DATE "June 16, 2023" ) +set ( MY_DATE "Sept 8, 2023" ) set ( MY_VERSION_MAJOR 1 ) -set ( MY_VERSION_MINOR 2 ) -set ( MY_VERSION_PATCH 5 ) +set ( MY_VERSION_MINOR 4 ) +set ( MY_VERSION_PATCH 0 ) message ( STATUS "Building MY library version: v" ${MY_VERSION_MAJOR}. @@ -44,6 +44,9 @@ set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake_modules ${CMAKE_SOURCE_DIR}/../lib/cmake/SuiteSparse ${CMAKE_INSTALL_PREFIX}/lib/cmake/SuiteSparse ) +# add path to cmake target files (if necessary) +set ( CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} + ${CMAKE_SOURCE_DIR}/../lib/cmake ) #------------------------------------------------------------------------------- # define my project @@ -58,27 +61,31 @@ project ( my #------------------------------------------------------------------------------- # look for all SuiteSparse packages: -find_package ( SuiteSparse_config 7.1.0 REQUIRED ) -find_package ( AMD 3.0.4 REQUIRED ) -find_package ( BTF 2.0.4 REQUIRED ) -find_package ( CAMD 3.0.4 REQUIRED ) -find_package ( CCOLAMD 3.0.4 REQUIRED ) -find_package ( COLAMD 3.0.4 REQUIRED ) -find_package ( CHOLMOD 4.0.4 REQUIRED ) -find_package ( CHOLMOD_CUDA 4.0.4 REQUIRED ) -find_package ( CXSparse 4.0.4 REQUIRED ) -find_package ( GPUQREngine 2.0.4 REQUIRED ) -find_package ( GraphBLAS 8.0.2 REQUIRED ) -find_package ( KLU 2.0.4 REQUIRED ) -find_package ( KLU_CHOLMOD 2.0.4 REQUIRED ) -find_package ( LDL 3.0.4 REQUIRED ) -find_package ( Mongoose 3.0.5 REQUIRED ) -find_package ( RBio 4.0.0 REQUIRED ) -find_package ( SPEX 2.0.4 REQUIRED ) -find_package ( SuiteSparse_GPURuntime 2.0.4 REQUIRED ) -find_package ( SPQR 3.0.4 REQUIRED ) -find_package ( SPQR_CUDA 3.0.4 REQUIRED ) -find_package ( UMFPACK 6.1.1 REQUIRED ) +find_package ( SuiteSparse_config 7.2.0 REQUIRED ) +find_package ( AMD 3.2.0 REQUIRED ) +find_package ( BTF 2.2.0 REQUIRED ) +find_package ( CAMD 3.2.0 REQUIRED ) +find_package ( CCOLAMD 3.2.0 REQUIRED ) +find_package ( COLAMD 3.2.0 REQUIRED ) +find_package ( CHOLMOD 4.2.0 REQUIRED ) +find_package ( CXSparse 4.2.0 REQUIRED ) +find_package ( GraphBLAS 8.2.0 ) +find_package ( KLU 2.2.0 REQUIRED ) +find_package ( KLU_CHOLMOD 2.2.0 REQUIRED ) +find_package ( LDL 3.2.0 REQUIRED ) +find_package ( Mongoose 3.2.0 REQUIRED ) +find_package ( RBio 4.2.0 REQUIRED ) +find_package ( SPEX 2.2.0 REQUIRED ) +find_package ( SPQR 4.2.0 REQUIRED ) +find_package ( UMFPACK 6.2.0 REQUIRED ) + +if ( TARGET CUDA::nvrtc ) + # CHOLMOD and SPQR have been compiled with CUDA enabled. +# find_package ( CHOLMOD_CUDA 4.2.0 REQUIRED ) +# find_package ( SPQR_CUDA 4.2.0 REQUIRED ) + find_package ( SuiteSparse_GPURuntime 3.2.0 REQUIRED ) + find_package ( GPUQREngine 3.2.0 REQUIRED ) +endif ( ) # look for all external libaries: find_package ( OpenMP REQUIRED ) @@ -217,138 +224,225 @@ target_link_libraries ( my_cxx PRIVATE ${MPFR_LIBRARIES} ) target_link_libraries ( my_cxx_static PUBLIC ${MPFR_STATIC} ) include_directories ( ${MPFR_INCLUDE_DIR} ) -# amd: -target_link_libraries ( my PRIVATE ${AMD_LIBRARIES} ) -target_link_libraries ( my_static PUBLIC ${AMD_STATIC} ) -target_link_libraries ( my_cxx PRIVATE ${AMD_LIBRARIES} ) -target_link_libraries ( my_cxx_static PUBLIC ${AMD_STATIC} ) -include_directories ( ${AMD_INCLUDE_DIR} ) - -# btf: -target_link_libraries ( my PRIVATE ${BTF_LIBRARIES} ) -target_link_libraries ( my_static PUBLIC ${BTF_STATIC} ) -target_link_libraries ( my_cxx PRIVATE ${BTF_LIBRARIES} ) -target_link_libraries ( my_cxx_static PUBLIC ${BTF_STATIC} ) -include_directories ( ${BTF_INCLUDE_DIR} ) - -# camd: -target_link_libraries ( my PRIVATE ${CAMD_LIBRARIES} ) -target_link_libraries ( my_static PUBLIC ${CAMD_STATIC} ) -target_link_libraries ( my_cxx PRIVATE ${CAMD_LIBRARIES} ) -target_link_libraries ( my_cxx_static PUBLIC ${CAMD_STATIC} ) -include_directories ( ${CAMD_INCLUDE_DIR} ) - -# ccolamd: -target_link_libraries ( my PRIVATE ${CCOLAMD_LIBRARIES} ) -target_link_libraries ( my_static PUBLIC ${CCOLAMD_STATIC} ) -target_link_libraries ( my_cxx PRIVATE ${CCOLAMD_LIBRARIES} ) -target_link_libraries ( my_cxx_static PUBLIC ${CCOLAMD_STATIC} ) -include_directories ( ${CCOLAMD_INCLUDE_DIR} ) - -# cholmod: -target_link_libraries ( my PRIVATE ${CHOLMOD_LIBRARIES} ) -target_link_libraries ( my_static PUBLIC ${CHOLMOD_STATIC} ) -target_link_libraries ( my_cxx PRIVATE ${CHOLMOD_LIBRARIES} ) -target_link_libraries ( my_cxx_static PUBLIC ${CHOLMOD_STATIC} ) -include_directories ( ${CHOLMOD_INCLUDE_DIR} ) - -# colamd: -target_link_libraries ( my PRIVATE ${COLAMD_LIBRARIES} ) -target_link_libraries ( my_static PUBLIC ${COLAMD_STATIC} ) -target_link_libraries ( my_cxx PRIVATE ${COLAMD_LIBRARIES} ) -target_link_libraries ( my_cxx_static PUBLIC ${COLAMD_STATIC} ) -include_directories ( ${COLAMD_INCLUDE_DIR} ) - -# cxsparse: -target_link_libraries ( my PRIVATE ${CXSPARSE_LIBRARIES} ) -target_link_libraries ( my_static PUBLIC ${CXSPARSE_STATIC} ) -target_link_libraries ( my_cxx PRIVATE ${CXSPARSE_LIBRARIES} ) -target_link_libraries ( my_cxx_static PUBLIC ${CXSPARSE_STATIC} ) -include_directories ( ${CXSPARSE_INCLUDE_DIR} ) - -# gpuqrengine: -target_link_libraries ( my PRIVATE ${GPUQRENGINE_LIBRARIES} ) -target_link_libraries ( my_static PUBLIC ${GPUQRENGINE_STATIC} ) -target_link_libraries ( my_cxx PRIVATE ${GPUQRENGINE_LIBRARIES} ) -target_link_libraries ( my_cxx_static PUBLIC ${GPUQRENGINE_STATIC} ) -include_directories ( ${GPUQRENGINE_INCLUDE_DIR} ) +# AMD: +target_link_libraries ( my PRIVATE SuiteSparse::AMD ) +target_link_libraries ( my_cxx PRIVATE SuiteSparse::AMD ) +if ( TARGET SuiteSparse::AMD_static ) + target_link_libraries ( my_static PUBLIC SuiteSparse::AMD_static ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::AMD_static ) +else ( ) + target_link_libraries ( my_static PUBLIC SuiteSparse::AMD ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::AMD ) +endif ( ) + +# BTF: +target_link_libraries ( my PRIVATE SuiteSparse::BTF ) +target_link_libraries ( my_cxx PRIVATE SuiteSparse::BTF ) +if ( TARGET SuiteSparse::BTF_static ) + target_link_libraries ( my_static PUBLIC SuiteSparse::BTF_static ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::BTF_static ) +else ( ) + target_link_libraries ( my_static PUBLIC SuiteSparse::BTF ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::BTF ) +endif ( ) + +# CAMD: +target_link_libraries ( my PRIVATE SuiteSparse::CAMD ) +target_link_libraries ( my_cxx PRIVATE SuiteSparse::CAMD ) +if ( TARGET SuiteSparse::CAMD_static ) + target_link_libraries ( my_static PUBLIC SuiteSparse::CAMD_static ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::CAMD_static ) +else ( ) + target_link_libraries ( my_static PUBLIC SuiteSparse::CAMD ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::CAMD ) +endif ( ) + +# CCOLAMD: +target_link_libraries ( my PRIVATE SuiteSparse::CCOLAMD ) +target_link_libraries ( my_cxx PRIVATE SuiteSparse::CCOLAMD ) +if ( TARGET SuiteSparse::CCOLAMD_static ) + target_link_libraries ( my_static PUBLIC SuiteSparse::CCOLAMD_static ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::CCOLAMD_static ) +else ( ) + target_link_libraries ( my_static PUBLIC SuiteSparse::CCOLAMD ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::CCOLAMD ) +endif ( ) + +# CHOLMOD: +target_link_libraries ( my PRIVATE SuiteSparse::CHOLMOD ) +target_link_libraries ( my_cxx PRIVATE SuiteSparse::CHOLMOD ) +if ( TARGET SuiteSparse::CHOLMOD_static ) + target_link_libraries ( my_static PUBLIC SuiteSparse::CHOLMOD_static ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::CHOLMOD_static ) +else ( ) + target_link_libraries ( my_static PUBLIC SuiteSparse::CHOLMOD ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::CHOLMOD ) +endif ( ) + +# COLAMD: +target_link_libraries ( my PRIVATE SuiteSparse::COLAMD ) +target_link_libraries ( my_cxx PRIVATE SuiteSparse::COLAMD ) +if ( TARGET SuiteSparse::COLAMD_static ) + target_link_libraries ( my_static PUBLIC SuiteSparse::COLAMD_static ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::COLAMD_static ) +else ( ) + target_link_libraries ( my_static PUBLIC SuiteSparse::COLAMD ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::COLAMD ) +endif ( ) + +# CXSparse: +target_link_libraries ( my PRIVATE SuiteSparse::CXSparse ) +target_link_libraries ( my_cxx PRIVATE SuiteSparse::CXSparse ) +if ( TARGET SuiteSparse::CXSparse_static ) + target_link_libraries ( my_static PUBLIC SuiteSparse::CXSparse_static ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::CXSparse_static ) +else ( ) + target_link_libraries ( my_static PUBLIC SuiteSparse::CXSparse ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::CXSparse ) +endif ( ) + +# GPUQREngine: +if ( ENABLE_CUDA ) + target_link_libraries ( my PRIVATE SuiteSparse::GPUQREngine ) + target_link_libraries ( my_cxx PRIVATE SuiteSparse::GPUQREngine ) + if ( TARGET SuiteSparse::GPUQREngine_static ) + target_link_libraries ( my_static PUBLIC SuiteSparse::GPUQREngine_static ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::GPUQREngine_static ) + else ( ) + target_link_libraries ( my_static PUBLIC SuiteSparse::GPUQREngine ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::GPUQREngine ) + endif ( ) +endif ( ) # GraphBLAS: -target_link_libraries ( my PRIVATE ${GRAPHBLAS_LIBRARIES} ) -target_link_libraries ( my_static PUBLIC ${GRAPHBLAS_STATIC} ) -target_link_libraries ( my_cxx PRIVATE ${GRAPHBLAS_LIBRARIES} ) -target_link_libraries ( my_cxx_static PUBLIC ${GRAPHBLAS_STATIC} ) -include_directories ( ${GRAPHBLAS_INCLUDE_DIR} ) - -# klu: -target_link_libraries ( my PRIVATE ${KLU_LIBRARIES} ) -target_link_libraries ( my_static PUBLIC ${KLU_STATIC} ) -target_link_libraries ( my_cxx PRIVATE ${KLU_LIBRARIES} ) -target_link_libraries ( my_cxx_static PUBLIC ${KLU_STATIC} ) -include_directories ( ${KLU_INCLUDE_DIR} ) - -# klu_cholmod: -target_link_libraries ( my PRIVATE ${KLU_CHOLMOD_LIBRARIES} ) -target_link_libraries ( my_static PUBLIC ${KLU_CHOLMOD_STATIC} ) -target_link_libraries ( my_cxx PRIVATE ${KLU_CHOLMOD_LIBRARIES} ) -target_link_libraries ( my_cxx_static PUBLIC ${KLU_CHOLMOD_STATIC} ) -include_directories ( ${KLU_CHOLMOD_INCLUDE_DIR} ) - -# ldl: -target_link_libraries ( my PRIVATE ${LDL_LIBRARIES} ) -target_link_libraries ( my_static PUBLIC ${LDL_STATIC} ) -target_link_libraries ( my_cxx PRIVATE ${LDL_LIBRARIES} ) -target_link_libraries ( my_cxx_static PUBLIC ${LDL_STATIC} ) -include_directories ( ${LDL_INCLUDE_DIR} ) - -# mongoose: -target_link_libraries ( my PRIVATE ${MONGOOSE_LIBRARIES} ) -target_link_libraries ( my_static PUBLIC ${MONGOSE_STATIC} ) -target_link_libraries ( my_cxx PRIVATE ${MONGOOSE_LIBRARIES} ) -target_link_libraries ( my_cxx_static PUBLIC ${MONGOSE_STATIC} ) -include_directories ( ${MONGOOSE_INCLUDE_DIR} ) - -# rbio: -target_link_libraries ( my PRIVATE ${RBIO_LIBRARIES} ) -target_link_libraries ( my_static PUBLIC ${RBIO_STATIC} ) -target_link_libraries ( my_cxx PRIVATE ${RBIO_LIBRARIES} ) -target_link_libraries ( my_cxx_static PUBLIC ${RBIO_STATIC} ) -include_directories ( ${RBIO_INCLUDE_DIR} ) - -# spex: -target_link_libraries ( my PRIVATE ${SPEX_LIBRARIES} ) -target_link_libraries ( my_static PUBLIC ${SPEX_STATIC} ) -target_link_libraries ( my_cxx PRIVATE ${SPEX_LIBRARIES} ) -target_link_libraries ( my_cxx_static PUBLIC ${SPEX_STATIC} ) -include_directories ( ${SPEX_INCLUDE_DIR} ) - -# spqr: -target_link_libraries ( my PRIVATE ${SPQR_LIBRARIES} ) -target_link_libraries ( my_static PUBLIC ${SPQR_STATIC} ) -target_link_libraries ( my_cxx PRIVATE ${SPQR_LIBRARIES} ) -target_link_libraries ( my_cxx_static PUBLIC ${SPQR_STATIC} ) -include_directories ( ${SPQR_INCLUDE_DIR} ) - -# suitesparseconfig: -target_link_libraries ( my PRIVATE ${SUITESPARSE_CONFIG_LIBRARIES} ) -target_link_libraries ( my_static PUBLIC ${SUITESPARSE_CONFIG_STATIC} ) -target_link_libraries ( my_cxx PRIVATE ${SUITESPARSE_CONFIG_LIBRARIES} ) -target_link_libraries ( my_cxx_static PUBLIC ${SUITESPARSE_CONFIG_STATIC} ) -include_directories ( ${SUITESPARSE_CONFIG_INCLUDE_DIR} ) - -# suitesparse_gpuruntime: -target_link_libraries ( my PRIVATE ${SUITESPARSE_GPURUNTIME_LIBRARIES} ) -target_link_libraries ( my_static PUBLIC ${SUITESPARSE_GPURUNTIME_STATIC} ) -target_link_libraries ( my_cxx PRIVATE ${SUITESPARSE_GPURUNTIME_LIBRARIES} ) -target_link_libraries ( my_cxx_static PUBLIC ${SUITESPARSE_GPURUNTIME_STATIC} ) -include_directories ( ${SUITESPARSE_GPURUNTIME_INCLUDE_DIR} ) - -# umfpack: -target_link_libraries ( my PRIVATE ${UMFPACK_LIBRARIES} ) -target_link_libraries ( my_static PUBLIC ${UMFPACK_STATIC} ) -target_link_libraries ( my_cxx PRIVATE ${UMFPACK_LIBRARIES} ) -target_link_libraries ( my_cxx_static PUBLIC ${UMFPACK_STATIC} ) -include_directories ( ${UMFPACK_INCLUDE_DIR} ) +if ( TARGET SuiteSparse::GraphBLAS ) + target_link_libraries ( my PRIVATE SuiteSparse::GraphBLAS ) + target_link_libraries ( my_cxx PRIVATE SuiteSparse::GraphBLAS ) + if ( TARGET SuiteSparse::GraphBLAS_static ) + target_link_libraries ( my_static PUBLIC SuiteSparse::GraphBLAS_static ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::GraphBLAS_static ) + else ( ) + target_link_libraries ( my_static PUBLIC SuiteSparse::GraphBLAS ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::GraphBLAS ) + endif ( ) +else ( ) + target_compile_definitions ( my PRIVATE NO_GRAPHBLAS ) + target_compile_definitions ( my_cxx PRIVATE NO_GRAPHBLAS ) + target_compile_definitions ( my_static PRIVATE NO_GRAPHBLAS ) + target_compile_definitions ( my_cxx_static PRIVATE NO_GRAPHBLAS ) +endif ( ) + +# KLU: +target_link_libraries ( my PRIVATE SuiteSparse::KLU ) +target_link_libraries ( my_cxx PRIVATE SuiteSparse::KLU ) +if ( TARGET SuiteSparse::KLU_static ) + target_link_libraries ( my_static PUBLIC SuiteSparse::KLU_static ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::KLU_static ) +else ( ) + target_link_libraries ( my_static PUBLIC SuiteSparse::KLU ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::KLU ) +endif ( ) + +# KLU_CHOLMOD: +target_link_libraries ( my PRIVATE SuiteSparse::KLU_CHOLMOD ) +target_link_libraries ( my_cxx PRIVATE SuiteSparse::KLU_CHOLMOD ) +if ( TARGET SuiteSparse::KLU_CHOLMOD_static ) + target_link_libraries ( my_static PUBLIC SuiteSparse::KLU_CHOLMOD_static ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::KLU_CHOLMOD_static ) +else ( ) + target_link_libraries ( my_static PUBLIC SuiteSparse::KLU_CHOLMOD ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::KLU_CHOLMOD ) +endif ( ) + +# LDL: +target_link_libraries ( my PRIVATE SuiteSparse::LDL ) +target_link_libraries ( my_cxx PRIVATE SuiteSparse::LDL ) +if ( TARGET SuiteSparse::LDL_static ) + target_link_libraries ( my_static PUBLIC SuiteSparse::LDL_static ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::LDL_static ) +else ( ) + target_link_libraries ( my_static PUBLIC SuiteSparse::LDL ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::LDL ) +endif ( ) + +# Mongoose: +target_link_libraries ( my PRIVATE SuiteSparse::Mongoose ) +target_link_libraries ( my_cxx PRIVATE SuiteSparse::Mongoose ) +if ( TARGET SuiteSparse::Mongoose_static ) + target_link_libraries ( my_static PUBLIC SuiteSparse::Mongoose_static ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::Mongoose_static ) +else ( ) + target_link_libraries ( my_static PUBLIC SuiteSparse::Mongoose ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::Mongoose ) +endif ( ) + +# RBio: +target_link_libraries ( my PRIVATE SuiteSparse::RBio ) +target_link_libraries ( my_cxx PRIVATE SuiteSparse::RBio ) +if ( TARGET SuiteSparse::RBio_static ) + target_link_libraries ( my_static PUBLIC SuiteSparse::RBio_static ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::RBio_static ) +else ( ) + target_link_libraries ( my_static PUBLIC SuiteSparse::RBio ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::RBio ) +endif ( ) + +# SPEX: +target_link_libraries ( my PRIVATE SuiteSparse::SPEX ) +target_link_libraries ( my_cxx PRIVATE SuiteSparse::SPEX ) +if ( TARGET SuiteSparse::SPEX_static ) + target_link_libraries ( my_static PUBLIC SuiteSparse::SPEX_static ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::SPEX_static ) +else ( ) + target_link_libraries ( my_static PUBLIC SuiteSparse::SPEX ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::SPEX ) +endif ( ) + +# SPQR: +target_link_libraries ( my PRIVATE SuiteSparse::SPQR ) +target_link_libraries ( my_cxx PRIVATE SuiteSparse::SPQR ) +if ( TARGET SuiteSparse::SPQR_static ) + target_link_libraries ( my_static PUBLIC SuiteSparse::SPQR_static ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::SPQR_static ) +else ( ) + target_link_libraries ( my_static PUBLIC SuiteSparse::SPQR ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::SPQR ) +endif ( ) + +# SuiteSparseConfig: +target_link_libraries ( my PRIVATE SuiteSparse::SuiteSparseConfig ) +target_link_libraries ( my_cxx PRIVATE SuiteSparse::SuiteSparseConfig ) +if ( TARGET SuiteSparse::SuiteSparseConfig_static ) + target_link_libraries ( my_static PUBLIC SuiteSparse::SuiteSparseConfig_static ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::SuiteSparseConfig_static ) +else ( ) + target_link_libraries ( my_static PUBLIC SuiteSparse::SuiteSparseConfig ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::SuiteSparseConfig ) +endif ( ) + +# GPURuntime: +if ( ENABLE_CUDA ) + target_link_libraries ( my PRIVATE SuiteSparse::GPURuntime ) + target_link_libraries ( my_cxx PRIVATE SuiteSparse::GPURuntime ) + if ( TARGET SuiteSparse::GPURuntime_static ) + target_link_libraries ( my_static PUBLIC SuiteSparse::GPURuntime_static ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::GPURuntime_static ) + else ( ) + target_link_libraries ( my_static PUBLIC SuiteSparse::GPURuntime ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::GPURuntime ) + endif ( ) +endif ( ) + +# UMFPACK: +target_link_libraries ( my PRIVATE SuiteSparse::UMFPACK ) +target_link_libraries ( my_cxx PRIVATE SuiteSparse::UMFPACK ) +if ( TARGET SuiteSparse::UMFPACK_static ) + target_link_libraries ( my_static PUBLIC SuiteSparse::UMFPACK_static ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::UMFPACK_static ) +else ( ) + target_link_libraries ( my_static PUBLIC SuiteSparse::UMFPACK ) + target_link_libraries ( my_cxx_static PUBLIC SuiteSparse::UMFPACK ) +endif ( ) #------------------------------------------------------------------------------- # installation location diff --git a/Example/Include/my.h b/Example/Include/my.h index 27eb10903..319f5178b 100644 --- a/Example/Include/my.h +++ b/Example/Include/my.h @@ -11,10 +11,10 @@ // file, since it is constructed from Config/my.h.in by cmake. // version and date for example user library -#define MY_DATE "June 16, 2023" +#define MY_DATE "Sept 8, 2023" #define MY_MAJOR_VERSION 1 -#define MY_MINOR_VERSION 2 -#define MY_PATCH_VERSION 5 +#define MY_MINOR_VERSION 4 +#define MY_PATCH_VERSION 0 #ifdef __cplusplus extern "C" { diff --git a/Example/Include/my_internal.h b/Example/Include/my_internal.h index 2181b17a7..e78d149cb 100644 --- a/Example/Include/my_internal.h +++ b/Example/Include/my_internal.h @@ -17,7 +17,9 @@ #include "cholmod.h" #include "colamd.h" #include "cs.h" -#include "GraphBLAS.h" +#if ! defined (NO_GRAPHBLAS) +# include "GraphBLAS.h" +#endif #include "klu.h" #include "ldl.h" #include "RBio.h" @@ -27,8 +29,8 @@ #ifdef __cplusplus // SuiteSparse include files for C++: -#include "SuiteSparseQR.hpp" -#include "Mongoose.hpp" +# include "SuiteSparseQR.hpp" +# include "Mongoose.hpp" #endif // OpenMP include file: diff --git a/Example/Source/my.c b/Example/Source/my.c index b50383816..c2bcd3714 100644 --- a/Example/Source/my.c +++ b/Example/Source/my.c @@ -144,6 +144,7 @@ void my_function (void) cholmod_common cc ; OK (cholmod_l_start (&cc)) ; +#if ! defined (NO_GRAPHBLAS) //-------------------------------------------------------------------------- // GraphBLAS //-------------------------------------------------------------------------- @@ -156,6 +157,7 @@ void my_function (void) printf ("GraphBLAS: v%d.%d.%d (in library)\n", version [0], version [1], version [2]) ; OK (GrB_finalize ( ) == GrB_SUCCESS) ; +#endif //-------------------------------------------------------------------------- // KLU @@ -201,7 +203,7 @@ void my_function (void) err = 0 ; for (int i = 0 ; i < n ; i++) { - printf ("x2 [%d] = %g\n", i, b [i]) ; + printf ("x2 [%d] = %g\n", i, x2 [i]) ; err = fmax (err, fabs (x2 [i] - xgood [i])) ; } printf ("error: %g\n", err) ; diff --git a/Example/Source/my_cxx.cc b/Example/Source/my_cxx.cc index cb19343d8..f72ac8c28 100644 --- a/Example/Source/my_cxx.cc +++ b/Example/Source/my_cxx.cc @@ -176,6 +176,7 @@ void my_function (void) cholmod_common cc ; OK (cholmod_l_start (&cc)) ; +#if ! defined (NO_GRAPHBLAS) //-------------------------------------------------------------------------- // GraphBLAS //-------------------------------------------------------------------------- @@ -193,6 +194,7 @@ void my_function (void) << version[2] << " " << "(in library)" << std::endl; OK (GrB_finalize ( ) == GrB_SUCCESS) ; +#endif //-------------------------------------------------------------------------- // KLU diff --git a/GPUQREngine/CMakeLists.txt b/GPUQREngine/CMakeLists.txt index 07718af30..eb34fe798 100644 --- a/GPUQREngine/CMakeLists.txt +++ b/GPUQREngine/CMakeLists.txt @@ -10,13 +10,12 @@ # get the version #------------------------------------------------------------------------------- -# cmake 3.22 is required to find the BLAS/LAPACK -cmake_minimum_required ( VERSION 3.19 ) +cmake_minimum_required ( VERSION 3.20 ) -set ( GPUQRENGINE_DATE "June 16, 2023" ) -set ( GPUQRENGINE_VERSION_MAJOR 2 ) -set ( GPUQRENGINE_VERSION_MINOR 0 ) -set ( GPUQRENGINE_VERSION_SUB 4 ) +set ( GPUQRENGINE_DATE "Sept 8, 2023" ) +set ( GPUQRENGINE_VERSION_MAJOR 3 ) +set ( GPUQRENGINE_VERSION_MINOR 2 ) +set ( GPUQRENGINE_VERSION_SUB 0 ) message ( STATUS "Building GPUQRENGINE version: v" ${GPUQRENGINE_VERSION_MAJOR}. @@ -28,13 +27,6 @@ message ( STATUS "Building GPUQRENGINE version: v" #------------------------------------------------------------------------------- set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} - ${CMAKE_SOURCE_DIR}/cmake_modules - ${CMAKE_SOURCE_DIR}/../COLAMD/cmake_modules - ${CMAKE_SOURCE_DIR}/../AMD/cmake_modules - ${CMAKE_SOURCE_DIR}/../CAMD/cmake_modules - ${CMAKE_SOURCE_DIR}/../CCOLAMD/cmake_modules - ${CMAKE_SOURCE_DIR}/../CHOLMOD/cmake_modules - ${CMAKE_SOURCE_DIR}/../SuiteSparse_GPURuntime/cmake_modules ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/cmake_modules ) option ( ENABLE_CUDA "Enable CUDA acceleration" on ) @@ -62,10 +54,18 @@ endif ( ) #------------------------------------------------------------------------------- # for the library itself -find_package ( SuiteSparse_config 7.1.0 REQUIRED ) +find_package ( SuiteSparse_config 7.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH ) +if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) + find_package ( SuiteSparse_config 7.2.0 REQUIRED ) +endif ( ) if ( SUITESPARSE_CUDA ) - find_package ( SuiteSparse_GPURuntime 2.0.4 REQUIRED ) + find_package ( SuiteSparse_GPURuntime 3.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_GPURuntime/build NO_DEFAULT_PATH ) + if ( NOT TARGET SuiteSparse::GPURuntime ) + find_package ( SuiteSparse_GPURuntime 3.2.0 REQUIRED ) + endif ( ) endif ( ) # Demo disabled for GPUQREngine v2.x @@ -73,12 +73,41 @@ set ( DEMO_OK false ) if ( DEMO AND DEMO_OK ) # for the demo only: - find_package ( AMD 3.0.4 ) - find_package ( COLAMD 3.0.4 ) - find_package ( CAMD 3.0.4 ) - find_package ( CCOLAMD 3.0.4 ) - find_package ( CHOLMOD 4.0.4 ) - find_package ( CHOLMOD_CUDA 4.0.4 ) + find_package ( AMD 3.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../AMD/build NO_DEFAULT_PATH ) + if ( NOT TARGET SuiteSparse::AMD ) + find_package ( AMD 3.2.0 ) + endif ( ) + + find_package ( COLAMD 3.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../COLAMD/build NO_DEFAULT_PATH ) + if ( NOT TARGET SuiteSparse::COLAMD ) + find_package ( COLAMD 3.2.0 ) + endif ( ) + + find_package ( CAMD 3.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../CAMD/build NO_DEFAULT_PATH ) + if ( NOT TARGET SuiteSparse::CAMD ) + find_package ( CAMD 3.2.0 ) + endif ( ) + + find_package ( CCOLAMD 3.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../CCOLAMD/build NO_DEFAULT_PATH ) + if ( NOT TARGET SuiteSparse::CCOLAMD ) + find_package ( CCOLAMD 3.2.0 ) + endif ( ) + + find_package ( CHOLMOD 4.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../CHOLMOD/build NO_DEFAULT_PATH ) + if ( NOT TARGET SuiteSparse::CHOLMOD ) + find_package ( CHOLMOD 4.2.0 ) + endif ( ) + + find_package ( CHOLMOD_CUDA 4.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../CHOLMOD/build NO_DEFAULT_PATH ) + if ( NOT TARGET SuiteSparse::CHOLMOD_CUDA ) + find_package ( CHOLMOD_CUDA 4.2.0 ) + endif ( ) endif ( ) if ( SUITESPARSE_CUDA AND CHOLMOD_FOUND AND AMD_FOUND AND COLAMD_FOUND AND @@ -115,9 +144,7 @@ else ( ) endif ( ) set ( GPUQRENGINE_INCLUDES Include Include/Kernel - Include/Kernel/Apply Include/Kernel/Assemble Include/Kernel/Factorize - ${CMAKE_SOURCE_DIR}/../SuiteSparse_GPURuntime/Include - ${SUITESPARSE_CONFIG_INCLUDE_DIR} ) + Include/Kernel/Apply Include/Kernel/Assemble Include/Kernel/Factorize ) include_directories ( ${GPUQRENGINE_INCLUDES} ${CUDAToolkit_INCLUDE_DIRS} ) @@ -125,35 +152,44 @@ include_directories ( ${GPUQRENGINE_INCLUDES} ${CUDAToolkit_INCLUDE_DIRS} ) # dynamic gpuqrengine library properties #------------------------------------------------------------------------------- -add_library ( gpuqrengine SHARED ${GPUQRENGINE_SOURCES} ) +add_library ( GPUQREngine SHARED ${GPUQRENGINE_SOURCES} ) -set_target_properties ( gpuqrengine PROPERTIES +set_target_properties ( GPUQREngine PROPERTIES VERSION ${GPUQRENGINE_VERSION_MAJOR}.${GPUQRENGINE_VERSION_MINOR}.${GPUQRENGINE_VERSION_SUB} CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON + OUTPUT_NAME gpuqrengine SOVERSION ${GPUQRENGINE_VERSION_MAJOR} PUBLIC_HEADER "Include/GPUQREngine.hpp" WINDOWS_EXPORT_ALL_SYMBOLS ON ) -target_include_directories ( gpuqrengine PUBLIC - ${CUDAToolkit_INCLUDE_DIRS} - ${GPUQRENGINE_INCLUDES} ) +target_include_directories ( GPUQREngine PRIVATE + ${CUDAToolkit_INCLUDE_DIRS} + ${GPUQRENGINE_INCLUDES} + "$" ) if ( SUITESPARSE_CUDA ) - set_target_properties ( gpuqrengine PROPERTIES POSITION_INDEPENDENT_CODE ON ) - set_target_properties ( gpuqrengine PROPERTIES CUDA_SEPARABLE_COMPILATION ON ) - target_link_libraries ( gpuqrengine PRIVATE CUDA::nvrtc CUDA::cudart_static + target_include_directories ( GPUQREngine PRIVATE + "$" ) + + set_target_properties ( GPUQREngine PROPERTIES POSITION_INDEPENDENT_CODE ON ) + set_target_properties ( GPUQREngine PROPERTIES CUDA_SEPARABLE_COMPILATION ON ) + target_link_libraries ( GPUQREngine PRIVATE CUDA::nvrtc CUDA::cudart_static CUDA::nvToolsExt CUDA::cublas ) endif ( ) +target_include_directories ( GPUQREngine + INTERFACE $ + $ ) + #------------------------------------------------------------------------------- # static gpuqrengine library properties #------------------------------------------------------------------------------- if ( NOT NSTATIC ) - add_library ( gpuqrengine_static STATIC ${GPUQRENGINE_SOURCES} ) + add_library ( GPUQREngine_static STATIC ${GPUQRENGINE_SOURCES} ) - set_target_properties ( gpuqrengine_static PROPERTIES + set_target_properties ( GPUQREngine_static PROPERTIES VERSION ${GPUQRENGINE_VERSION_MAJOR}.${GPUQRENGINE_VERSION_MINOR}.${GPUQRENGINE_VERSION_SUB} CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON @@ -161,39 +197,101 @@ if ( NOT NSTATIC ) SOVERSION ${GPUQRENGINE_VERSION_MAJOR} ) if ( MSVC ) - set_target_properties ( gpuqrengine_static PROPERTIES + set_target_properties ( GPUQREngine_static PROPERTIES OUTPUT_NAME gpuqrengine_static ) endif ( ) - target_include_directories ( gpuqrengine_static PUBLIC - ${CUDAToolkit_INCLUDE_DIRS} - ${GPUQRENGINE_INCLUDES} ) + target_include_directories ( GPUQREngine_static PRIVATE + ${CUDAToolkit_INCLUDE_DIRS} + ${GPUQRENGINE_INCLUDES} + "$" ) if ( SUITESPARSE_CUDA ) - set_target_properties ( gpuqrengine_static PROPERTIES CUDA_SEPARABLE_COMPILATION on ) - set_target_properties ( gpuqrengine_static PROPERTIES POSITION_INDEPENDENT_CODE on ) - target_link_libraries ( gpuqrengine_static PUBLIC CUDA::nvrtc CUDA::cudart_static + target_include_directories ( GPUQREngine_static PRIVATE + "$" ) + + set_target_properties ( GPUQREngine_static PROPERTIES CUDA_SEPARABLE_COMPILATION on ) + set_target_properties ( GPUQREngine_static PROPERTIES POSITION_INDEPENDENT_CODE on ) + target_link_libraries ( GPUQREngine_static PUBLIC CUDA::nvrtc CUDA::cudart_static CUDA::nvToolsExt CUDA::cublas ) endif ( ) + + target_include_directories ( GPUQREngine_static + INTERFACE $ + $ ) endif ( ) #------------------------------------------------------------------------------- # installation location #------------------------------------------------------------------------------- -install ( TARGETS gpuqrengine +include ( CMakePackageConfigHelpers ) + +install ( TARGETS GPUQREngine + EXPORT GPUQREngineTargets LIBRARY DESTINATION ${SUITESPARSE_LIBDIR} ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} RUNTIME DESTINATION ${SUITESPARSE_BINDIR} PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} ) -install ( FILES ${CMAKE_SOURCE_DIR}/cmake_modules/FindGPUQREngine.cmake - DESTINATION ${SUITESPARSE_LIBDIR}/cmake/SuiteSparse - COMPONENT Development ) if ( NOT NSTATIC ) - install ( TARGETS gpuqrengine_static + install ( TARGETS GPUQREngine_static + EXPORT GPUQREngineTargets ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} ) endif ( ) +# create (temporary) export target file during build +export ( EXPORT GPUQREngineTargets + NAMESPACE SuiteSparse:: + FILE ${CMAKE_CURRENT_BINARY_DIR}/GPUQREngineTargets.cmake ) + +# install export target, config and version files for find_package +install ( EXPORT GPUQREngineTargets + NAMESPACE SuiteSparse:: + DESTINATION ${SUITESPARSE_LIBDIR}/cmake/GPUQREngine ) + +configure_package_config_file ( + Config/GPUQREngineConfig.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/GPUQREngineConfig.cmake + INSTALL_DESTINATION ${SUITESPARSE_LIBDIR}/cmake/GPUQREngine ) + +write_basic_package_version_file ( + ${CMAKE_CURRENT_BINARY_DIR}/GPUQREngineConfigVersion.cmake + COMPATIBILITY SameMajorVersion ) + +install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/GPUQREngineConfig.cmake + ${CMAKE_CURRENT_BINARY_DIR}/GPUQREngineConfigVersion.cmake + DESTINATION ${SUITESPARSE_LIBDIR}/cmake/GPUQREngine ) + +#------------------------------------------------------------------------------- +# create pkg-config file +#------------------------------------------------------------------------------- + +if ( NOT MSVC ) + set ( prefix "${CMAKE_INSTALL_PREFIX}" ) + set ( exec_prefix "\${prefix}" ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) + if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) + set ( libdir "${SUITESPARSE_LIBDIR}") + else ( ) + set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") + endif ( ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) + if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) + set ( includedir "${SUITESPARSE_INCLUDEDIR}") + else ( ) + set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + endif ( ) + configure_file ( + Config/GPUQREngine.pc.in + GPUQREngine.pc + @ONLY + NEWLINE_STYLE LF ) + install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/GPUQREngine.pc + DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) +endif ( ) + #------------------------------------------------------------------------------- # Demo library and programs #------------------------------------------------------------------------------- @@ -213,10 +311,10 @@ if ( DEMO AND DEMO_OK ) add_executable ( gpuqrengine_demo "Demo/gpuqrengine_demo.cpp" ) # Libraries required for Demo programs - target_link_libraries ( gpuqrengine_demo PUBLIC gpuqrengine - ${CHOLMOD_LIBRARIES} ${AMD_LIBRARIES} ${COLAMD_LIBRARIES} - ${CAMD_LIBRARIES} ${CCOLAMD_LIBRARIES} ${CHOLMOD_CUDA} - ${SUITESPARSE_GPURUNTIME_LIBRARIES} ${SUITESPARSE_CONFIG_LIBRARIES} ) + target_link_libraries ( gpuqrengine_demo PUBLIC GPUQREngine + SuiteSparse::CHOLMOD SuiteSparse::AMD SuiteSparse::COLAMD + SuiteSparse::CAMD SuiteSparse::CCOLAMD SuiteSparse::CHOLMOD_CUDA + SuiteSparse::GPURuntime SuiteSparse::SuiteSparseConfig ) else ( ) diff --git a/GPUQREngine/Config/GPUQREngine.pc.in b/GPUQREngine/Config/GPUQREngine.pc.in new file mode 100644 index 000000000..dcc804f34 --- /dev/null +++ b/GPUQREngine/Config/GPUQREngine.pc.in @@ -0,0 +1,17 @@ +# GPUQREngine, Copyright (c) 2013-2023, Timothy A. Davis. +# All Rights Reserved. +# SPDX-License-Identifier: GPL-2.0-or-later + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +# FIXME: Which flags do we need to statically link CUDA + +Name: GPUQREngine +URL: https://github.com/DrTimothyAldenDavis/SuiteSparse +Description: GPU-accelerated QR factorization engine supporting SuiteSparseQR in SuiteSparse +Version: @GPUQRENGINE_VERSION_MAJOR@.@GPUQRENGINE_VERSION_MINOR@.@GPUQRENGINE_VERSION_SUB@ +Libs: -L${libdir} -lgpuqrengine +Cflags: -I${includedir} diff --git a/GPUQREngine/Config/GPUQREngineConfig.cmake.in b/GPUQREngine/Config/GPUQREngineConfig.cmake.in new file mode 100644 index 000000000..b0bd24f56 --- /dev/null +++ b/GPUQREngine/Config/GPUQREngineConfig.cmake.in @@ -0,0 +1,121 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/GPUQREngine/cmake_modules/GPUQREngineConfig.cmake +#------------------------------------------------------------------------------- + +# The following copyright and license applies to just this file only, not to +# the library itself: +# GPUQREngineConfig.cmake, Copyright (c) 2023, Timothy A. Davis. All Rights Reserved. +# SPDX-License-Identifier: BSD-3-clause + +#------------------------------------------------------------------------------- + +# Finds the GPUQREngine include file and compiled library. +# The following targets are defined: +# SuiteSparse::GPUQREngine - for the shared library (if available) +# SuiteSparse::GPUQREngine_static - for the static library (if available) + +# For backward compatibility the following variables are set: + +# GPUQRENGINE_INCLUDE_DIR - where to find GPUQREngine.hpp +# GPUQRENGINE_LIBRARY - dynamic GPUQREngine library +# GPUQRENGINE_STATIC - static GPUQREngine library +# GPUQRENGINE_LIBRARIES - libraries when using GPUQREngine +# GPUQRENGINE_FOUND - true if GPUQREngine found + +# Set ``CMAKE_MODULE_PATH`` to the parent folder where this module file is +# installed. + +#------------------------------------------------------------------------------- + +@PACKAGE_INIT@ + +set ( GPUQRENGINE_DATE "@GPUQRENGINE_DATE@" ) +set ( GPUQRENGINE_VERSION_MAJOR @GPUQRENGINE_VERSION_MAJOR@ ) +set ( GPUQRENGINE_VERSION_MINOR @GPUQRENGINE_VERSION_MINOR@ ) +set ( GPUQRENGINE_VERSION_PATCH @GPUQRENGINE_VERSION_SUB@ ) +set ( GPUQRENGINE_VERSION "@GPUQRENGINE_VERSION_MAJOR@.@GPUQRENGINE_VERSION_MINOR@.@GPUQRENGINE_VERSION_SUB@" ) + +include ( ${CMAKE_CURRENT_LIST_DIR}/GPUQREngineTargets.cmake ) + +# The following is only for backward compatibility with FindGPUQREngine. + +set ( _target_shared SuiteSparse::GPUQREngine ) +set ( _target_static SuiteSparse::GPUQREngine_static ) +set ( _var_prefix "GPUQRENGINE" ) + +get_target_property ( ${_var_prefix}_INCLUDE_DIR ${_target_shared} INTERFACE_INCLUDE_DIRECTORIES ) +if ( ${_var_prefix}_INCLUDE_DIR ) + # First item in SuiteSparse targets contains the "main" header directory. + list ( GET ${_var_prefix}_INCLUDE_DIR 0 ${_var_prefix}_INCLUDE_DIR ) +endif ( ) +get_target_property ( ${_var_prefix}_LIBRARY ${_target_shared} IMPORTED_IMPLIB ) +if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} IMPORTED_LOCATION ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) +endif ( ) +if ( TARGET ${_target_static} ) + get_target_property ( ${_var_prefix}_STATIC ${_target_static} IMPORTED_LOCATION ) +endif ( ) + +# Check for most common build types +set ( _config_types "Debug" "Release" "RelWithDebInfo" "MinSizeRel" ) + +get_property ( _isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG ) +if ( _isMultiConfig ) + # For multi-configuration generators (e.g., Visual Studio), prefer those + # configurations. + list ( PREPEND _config_types ${CMAKE_CONFIGURATION_TYPES} ) +else ( ) + # For single-configuration generators, prefer the current configuration. + list ( PREPEND _config_types ${CMAKE_BUILD_TYPE} ) +endif ( ) + +list ( REMOVE_DUPLICATES _config_types ) + +foreach ( _config ${_config_types} ) + string ( TOUPPER ${_config} _uc_config ) + if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} + IMPORTED_IMPLIB_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) + endif ( ) + if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} + IMPORTED_LOCATION_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) + endif ( ) + if ( TARGET ${_target_static} AND NOT ${_var_prefix}_STATIC ) + get_target_property ( _library_chk ${_target_static} + IMPORTED_LOCATION_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_STATIC ${_library_chk} ) + endif ( ) + endif ( ) +endforeach ( ) + +set ( GPUQRENGINE_LIBRARIES ${GPUQRENGINE_LIBRARY} ) + +macro ( suitesparse_check_exist _var _files ) + # ignore generator expressions + string ( GENEX_STRIP "${_files}" _files2 ) + + foreach ( _file ${_files2} ) + if ( NOT EXISTS "${_file}" ) + message ( FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist!" ) + endif ( ) + endforeach () +endmacro ( ) + +suitesparse_check_exist ( GPUQRENGINE_INCLUDE_DIR ${GPUQRENGINE_INCLUDE_DIR} ) +suitesparse_check_exist ( GPUQRENGINE_LIBRARY ${GPUQRENGINE_LIBRARY} ) + +message ( STATUS "GPUQREngine version: ${GPUQRENGINE_VERSION}" ) +message ( STATUS "GPUQREngine include: ${GPUQRENGINE_INCLUDE_DIR}" ) +message ( STATUS "GPUQREngine library: ${GPUQRENGINE_LIBRARY}" ) +message ( STATUS "GPUQREngine static: ${GPUQRENGINE_STATIC}" ) diff --git a/GPUQREngine/Doc/ChangeLog b/GPUQREngine/Doc/ChangeLog index c0cf9be7e..db8e65d60 100644 --- a/GPUQREngine/Doc/ChangeLog +++ b/GPUQREngine/Doc/ChangeLog @@ -1,3 +1,8 @@ +Sept 8, 2023: version 3.2.0 + + * cmake updates: SuiteSparse:: namespace by Markus Muetzel + * 32-bit version added: by Raye Kimmerer + June 16, 2023: version 2.0.4 * cmake build system updates: update by Markus Muetzel diff --git a/GPUQREngine/Include/GPUQREngine.hpp b/GPUQREngine/Include/GPUQREngine.hpp index bbad0bcc2..498942837 100644 --- a/GPUQREngine/Include/GPUQREngine.hpp +++ b/GPUQREngine/Include/GPUQREngine.hpp @@ -12,10 +12,10 @@ #define GPUQRENGINE_HPP // Version information: -#define GPUQRENGINE_DATE "June 16, 2023" -#define GPUQRENGINE_MAIN_VERSION 2 -#define GPUQRENGINE_SUB_VERSION 0 -#define GPUQRENGINE_SUBSUB_VERSION 4 +#define GPUQRENGINE_DATE "Sept 8, 2023" +#define GPUQRENGINE_MAIN_VERSION 3 +#define GPUQRENGINE_SUB_VERSION 2 +#define GPUQRENGINE_SUBSUB_VERSION 0 #define GPUQRENGINE_VER_CODE(main,sub) ((main) * 1000 + (sub)) #define GPUQRENGINE_VERSION \ diff --git a/GPUQREngine/Include/GPUQREngine_BucketList.hpp b/GPUQREngine/Include/GPUQREngine_BucketList.hpp index e2c7b44fb..d7ce56167 100644 --- a/GPUQREngine/Include/GPUQREngine_BucketList.hpp +++ b/GPUQREngine/Include/GPUQREngine_BucketList.hpp @@ -24,11 +24,15 @@ #include "GPUQREngine_TaskDescriptor.hpp" #include "GPUQREngine_LLBundle.hpp" #include "GPUQREngine_Front.hpp" +#include "SuiteSparseGPU_internal.hpp" + + struct TaskDescriptor; +template class LLBundle; -class BucketList +template class BucketList { public: bool useFlag; // A flag indicating whether to use this @@ -46,7 +50,7 @@ class BucketList Int *bundleCount; // The # of bundles native to bucket index Int *idleTileCount; // The # of idle tiles in bucket index - Front *front; + Front *front; Int numRowTiles; // # row tiles of F Int numColTiles; // # col tiles of F Int numBuckets; // min(numRowTiles, numColTiles) @@ -60,7 +64,7 @@ class BucketList Int ApplyGranularity; // The desired granularity (in col tiles) // for applies - LLBundle *Bundles; // The bundles maintained by this scheduler + LLBundle *Bundles; // The bundles maintained by this scheduler Int numBundles; // Total # of bundles Workspace *wsMongoVT; // The VT blocks this bucket list scheduler owns @@ -68,11 +72,11 @@ class BucketList int VThead; // Index of the first available entry in VTlist // Constructors - void *operator new(long unsigned int, BucketList* p) + void *operator new(long unsigned int, BucketList * p) { return p; } - BucketList(Front *f, Int minApplyGranularity); + BucketList(Front *f, Int minApplyGranularity); ~BucketList(); // Bundle management functions @@ -83,8 +87,21 @@ class BucketList #endif // VT management functions - double *allocateVT(); - double *freeVT(double *gpuVT); + double *allocateVT + ( + void + ) + { + return gpuVT[VThead++]; + } + double *freeVT + ( + double *doneVT // The GPU pointer of a released VT tile + ) + { + gpuVT[--VThead] = doneVT; + return NULL; + } bool IsDone() { @@ -157,7 +174,7 @@ class BucketList // edge case kernels. bool IsInternal ( - LLBundle& bundle, + LLBundle & bundle, int jLast ); @@ -171,4 +188,7 @@ class BucketList ); }; +extern template class BucketList; +extern template class BucketList; + #endif diff --git a/GPUQREngine/Include/GPUQREngine_Common.hpp b/GPUQREngine/Include/GPUQREngine_Common.hpp index 6977b77dd..532d34439 100644 --- a/GPUQREngine/Include/GPUQREngine_Common.hpp +++ b/GPUQREngine/Include/GPUQREngine_Common.hpp @@ -49,7 +49,6 @@ #define NUMTHREADS 384 #define PACKASSEMBLY_SHMEM_MAPINTS 2024 - /*** Common Macros ***********************************************************/ // ceiling of a/b for two integers a and b @@ -66,7 +65,7 @@ #endif #define EMPTY (-1) -#define Int int64_t +// #define Int int64_t // To render the buckets for visualization in graphvis, uncomment this next // line, or compile the code with -DGPUQRENGINE_RENDER diff --git a/GPUQREngine/Include/GPUQREngine_Front.hpp b/GPUQREngine/Include/GPUQREngine_Front.hpp index a865ad294..7bae8b894 100644 --- a/GPUQREngine/Include/GPUQREngine_Front.hpp +++ b/GPUQREngine/Include/GPUQREngine_Front.hpp @@ -23,7 +23,7 @@ #include "GPUQREngine_SparseMeta.hpp" #include "GPUQREngine_FrontState.hpp" -class Front +template class Front { public: Int fids; // Front id within a stage diff --git a/GPUQREngine/Include/GPUQREngine_Internal.hpp b/GPUQREngine/Include/GPUQREngine_Internal.hpp index 0426999de..2391a6061 100644 --- a/GPUQREngine/Include/GPUQREngine_Internal.hpp +++ b/GPUQREngine/Include/GPUQREngine_Internal.hpp @@ -28,15 +28,16 @@ void GPUQREngine_UberKernel int numTasks // The # of items in the work list ); +template QREngineResultCode GPUQREngine_Internal ( size_t gpuMemorySize, // The total size of the GPU memory - Front *fronts, // The list of fronts to factorize + Front *fronts, // The list of fronts to factorize Int numFronts, // The number of fronts in the list Int *Parent = NULL, // Map from front to its Parent Int *Childp = NULL, // Child[Childp[f]] to Child[Childp[f+1]] Int *Child = NULL, // has all the children of front f. - QREngineStats *stats = NULL // An optional in-out parameter to capture + QREngineStats *stats = NULL // An optional in-out parameter to capture // statistics ); diff --git a/GPUQREngine/Include/GPUQREngine_LLBundle.hpp b/GPUQREngine/Include/GPUQREngine_LLBundle.hpp index 31245cec4..2ea869e64 100644 --- a/GPUQREngine/Include/GPUQREngine_LLBundle.hpp +++ b/GPUQREngine/Include/GPUQREngine_LLBundle.hpp @@ -28,12 +28,14 @@ #include "GPUQREngine_TaskDescriptor.hpp" struct TaskDescriptor; +template class BucketList; -class LLBundle + +template class LLBundle { public: - BucketList *Buckets; // A back pointer to the hosting BucketList + BucketList *Buckets; // A back pointer to the hosting BucketList Int NativeBucket; // The column bucket the bundle belongs "is native" to @@ -74,15 +76,37 @@ class LLBundle TaskType CurrentTask; - void *operator new(long unsigned int, LLBundle* p){ return p; } - LLBundle(BucketList *buckets, Int panelSize, Int nativeBucket); - - // empty LLBundle constructor (currently used, kept for possible future use - // LLBundle(); - + void *operator new(long unsigned int, LLBundle * p){ return p; } + //------------------------------------------------------------------------------ + // + // This file contains the constructor and destructor for the LLBundle class. + // The constructor will attempt to reserve a VT tile automatically, since newly + // created bundles are immediately slated for factorization. + // + // ============================================================================= + LLBundle + ( + BucketList *buckets, + Int panelSize, + Int nativeBucket + ) + { + Buckets = buckets; + PanelSize = panelSize; + NativeBucket = nativeBucket; + SecondMin = Shadow = First = Delta = Max = EMPTY; + Count = ApplyCount = 0; + VT[0] = VT[1] = NULL; + + /* Create the factorize task and allocate a VT block. */ + CurrentTask = TASKTYPE_GenericFactorize; + VT[0] = buckets->allocateVT(); + } // LLBundle destructor: - ~LLBundle(); - + ~LLBundle() + { + } + #ifdef GPUQRENGINE_PIPELINING void AddTileToDelta(Int rowTile); #endif @@ -93,10 +117,14 @@ class LLBundle bool Advance(); void PipelinedRearrange(); + void UpdateSecondMinIndex(); void UpdateMax(); + void gpuPack(TaskDescriptor *cpuTask); }; +extern template class LLBundle; +extern template class LLBundle; #endif diff --git a/GPUQREngine/Include/GPUQREngine_Scheduler.hpp b/GPUQREngine/Include/GPUQREngine_Scheduler.hpp index 70f66bbad..22513e7e2 100644 --- a/GPUQREngine/Include/GPUQREngine_Scheduler.hpp +++ b/GPUQREngine/Include/GPUQREngine_Scheduler.hpp @@ -33,6 +33,7 @@ size_t ssgpu_maxQueueSize // return size of scheduler queue size_t gpuMemorySize // size of GPU memory, in bytes ) ; +template class Scheduler { private: @@ -59,13 +60,13 @@ class Scheduler // successfully invoke the cuda // initialization calls. - Front *frontList; + Front *frontList; Int numFronts; Int numFrontsCompleted; int activeSet; - BucketList *bucketLists; + BucketList *bucketLists; Int *afPerm; // Permutation of "active" fronts Int *afPinv; // Inverse permutation of "active" fronts @@ -96,8 +97,8 @@ class Scheduler cudaStream_t memoryStreamD2H; /* Scheduler.cpp */ - void *operator new(long unsigned int, Scheduler* p){ return p; } - Scheduler(Front *fronts, Int numFronts, size_t gpuMemorySize); + void *operator new(long unsigned int, Scheduler * p){ return p; } + Scheduler(Front *fronts, Int numFronts, size_t gpuMemorySize); ~Scheduler(); /* Scheduler_Front.cpp */ @@ -117,7 +118,7 @@ class Scheduler ) { // NOTE: tested by SPQR/Tcov, but not flagged as such in cov results - BucketList *dlbl = (&bucketLists[f]); + BucketList *dlbl = (&bucketLists[f]); if(dlbl->useFlag) dlbl->Initialize(); } @@ -156,7 +157,7 @@ class Scheduler /* Stats */ float kernelTime; Int numKernelLaunches; - Int gpuFlops; + int64_t gpuFlops; #ifdef GPUQRENGINE_RENDER /* Debug stuff */ @@ -167,8 +168,10 @@ class Scheduler #endif #if 1 - void debugDumpFront(Front *front); + void debugDumpFront(Front *front); #endif }; +extern template class Scheduler; +extern template class Scheduler; #endif diff --git a/GPUQREngine/Include/GPUQREngine_Stats.hpp b/GPUQREngine/Include/GPUQREngine_Stats.hpp index 223d879b4..dc7e79359 100644 --- a/GPUQREngine/Include/GPUQREngine_Stats.hpp +++ b/GPUQREngine/Include/GPUQREngine_Stats.hpp @@ -16,7 +16,7 @@ #ifndef GPUQRENGINE_STATS_HPP #define GPUQRENGINE_STATS_HPP -struct QREngineStats +template struct QREngineStats { float kernelTime; // The total time spent in the kernel. // This time is accumulated across multiple @@ -24,7 +24,7 @@ struct QREngineStats Int numLaunches; // The total number of kernel launches. - Int flopsActual; // The total number of flops performed. + int64_t flopsActual; // The total number of flops performed. QREngineStats() { diff --git a/GPUQREngine/Include/GPUQREngine_SuiteSparse.hpp b/GPUQREngine/Include/GPUQREngine_SuiteSparse.hpp index 44183217d..d3089e045 100644 --- a/GPUQREngine/Include/GPUQREngine_SuiteSparse.hpp +++ b/GPUQREngine/Include/GPUQREngine_SuiteSparse.hpp @@ -28,28 +28,31 @@ enum QREngineResultCode // Use C++ Polymorphism to provide many different function signatures and // call patterns. +template QREngineResultCode GPUQREngine ( size_t gpuMemorySize, - Front *userFronts, + Front *userFronts, Int numFronts, - QREngineStats *stats = NULL + QREngineStats *stats = NULL ); +template QREngineResultCode GPUQREngine ( size_t gpuMemorySize, - Front *userFronts, + Front *userFronts, Int numFronts, Int *Parent, Int *Childp, Int *Child, - QREngineStats *stats = NULL + QREngineStats *stats = NULL ); +template Int *GPUQREngine_FindStaircase ( - Front *front // The front whose staircase we are computing + Front *front // The front whose staircase we are computing ); // Version information: diff --git a/GPUQREngine/Include/GPUQREngine_TaskDescriptor.hpp b/GPUQREngine/Include/GPUQREngine_TaskDescriptor.hpp index f45b14ac1..08f8ffd1a 100644 --- a/GPUQREngine/Include/GPUQREngine_TaskDescriptor.hpp +++ b/GPUQREngine/Include/GPUQREngine_TaskDescriptor.hpp @@ -18,6 +18,7 @@ #ifndef GPUQRENGINE_TASKDESCRIPTOR_HPP #define GPUQRENGINE_TASKDESCRIPTOR_HPP +#include enum TaskType { @@ -55,6 +56,7 @@ enum TaskType TASKTYPE_PackAssembly // Push assembly (child to parent) }; +template class Scheduler; struct TaskDescriptor @@ -110,14 +112,14 @@ struct TaskDescriptor // These two methods are implemented in TaskDescriptor_flops.cpp. // They are used to rearrange tasks in the WorkQueue to promote a // uniform distribution of work items in the queue. -Int getFlops +int64_t getFlops ( - TaskDescriptor *task // Task for which to compute the flops + const TaskDescriptor *task // Task for which to compute the flops ); -Int getWeightedFlops +int64_t getWeightedFlops ( - TaskDescriptor *task // Task for which to compute the flops + const TaskDescriptor *task // Task for which to compute the flops ); #endif diff --git a/GPUQREngine/Source/BucketList/BucketList.cpp b/GPUQREngine/Source/BucketList/BucketList.cpp index bb02081d9..601fc6684 100644 --- a/GPUQREngine/Source/BucketList/BucketList.cpp +++ b/GPUQREngine/Source/BucketList/BucketList.cpp @@ -21,23 +21,21 @@ // the constructor is responsible for memory management AND initialization. // ============================================================================= -#include "GPUQREngine_BucketList.hpp" - - -#define FREE_EVERYTHING \ +#define FREE_EVERYTHING_BUCKET \ head = (Int *) SuiteSparse_free(head); \ idleTileCount = (Int *) SuiteSparse_free(idleTileCount); \ bundleCount = (Int *) SuiteSparse_free(bundleCount); \ prev = (Int *) SuiteSparse_free(prev); \ next = (Int *) SuiteSparse_free(next); \ triu = (bool *) SuiteSparse_free(triu); \ - Bundles = (LLBundle *) SuiteSparse_free(Bundles); \ + Bundles = (LLBundle *) SuiteSparse_free(Bundles); \ gpuVT = (double **) SuiteSparse_free(gpuVT); \ wsMongoVT = Workspace::destroy(wsMongoVT); - -BucketList::BucketList +#include "GPUQREngine_BucketList.hpp" +template +BucketList::BucketList ( - Front *F, + Front *F, Int minApplyGranularity ) { @@ -68,7 +66,7 @@ BucketList::BucketList next = (Int*) SuiteSparse_calloc(numRowTiles, sizeof(Int)); prev = (Int*) SuiteSparse_calloc(numRowTiles, sizeof(Int)); triu = (bool*) SuiteSparse_calloc(numRowTiles, sizeof(bool)); - Bundles = (LLBundle*) SuiteSparse_calloc(numRowTiles, sizeof(LLBundle)); + Bundles = (LLBundle *) SuiteSparse_calloc(numRowTiles, sizeof(LLBundle )); gpuVT = (double**) SuiteSparse_calloc(numRowTiles, sizeof(double*)); // malloc wsMongoVT on the GPU @@ -79,7 +77,7 @@ BucketList::BucketList if(!head || !idleTileCount || !bundleCount || !next || !prev || !triu || !Bundles || !gpuVT || !wsMongoVT) { - FREE_EVERYTHING ; + FREE_EVERYTHING_BUCKET ; memory_ok = false ; return; } @@ -105,13 +103,30 @@ BucketList::BucketList } } -BucketList::~BucketList() +template BucketList::BucketList +( + Front *F, + int32_t minApplyGranularity +) ; +template BucketList::BucketList +( + Front *F, + int64_t minApplyGranularity +) ; + +template +BucketList::~BucketList() { - FREE_EVERYTHING ; + FREE_EVERYTHING_BUCKET ; } -void BucketList::Initialize() +template BucketList::~BucketList() ; +template BucketList::~BucketList() ; + + +template +void BucketList::Initialize() { int fm = front->fm; int fn = front->fn; @@ -133,3 +148,6 @@ void BucketList::Initialize() } } } + +template void BucketList::Initialize() ; +template void BucketList::Initialize() ; diff --git a/GPUQREngine/Source/BucketList/BucketList_AdvanceBundles.cpp b/GPUQREngine/Source/BucketList/BucketList_AdvanceBundles.cpp index fc4214ea1..2cfa05e1a 100644 --- a/GPUQREngine/Source/BucketList/BucketList_AdvanceBundles.cpp +++ b/GPUQREngine/Source/BucketList/BucketList_AdvanceBundles.cpp @@ -12,15 +12,13 @@ // and keeping a Shadow copy to support subsequent Apply tasks. // // ============================================================================= - - #include "GPUQREngine_BucketList.hpp" - -void BucketList::AdvanceBundles() +template +void BucketList::AdvanceBundles() { for (int i = 0; i < numBundles; i++) { - LLBundle& bundle = Bundles[i]; + LLBundle & bundle = Bundles[i]; /* An advancing bundle is removed from its native bucket. */ bundleCount[bundle.NativeBucket]--; @@ -45,3 +43,6 @@ void BucketList::AdvanceBundles() } } } + +template void BucketList::AdvanceBundles() ; +template void BucketList::AdvanceBundles() ; diff --git a/GPUQREngine/Source/BucketList/BucketList_CreateBundles.cpp b/GPUQREngine/Source/BucketList/BucketList_CreateBundles.cpp index 39411be9f..f0fe2b9e3 100644 --- a/GPUQREngine/Source/BucketList/BucketList_CreateBundles.cpp +++ b/GPUQREngine/Source/BucketList/BucketList_CreateBundles.cpp @@ -13,12 +13,11 @@ // // ============================================================================= -#include "GPUQREngine_BucketList.hpp" - - // CreateBundles selects rowtiles up to PANELSIZE and creates a new bundle // ready for factorization. -void BucketList::CreateBundles +#include "GPUQREngine_BucketList.hpp" +template +void BucketList::CreateBundles ( void ) @@ -32,7 +31,7 @@ void BucketList::CreateBundles if (SkipBundleCreation(tile, colBucket)){ colBucket++; continue; } /* At this point we know we're going to add a bundle. */ - LLBundle candidate(this, PanelSize, colBucket); + LLBundle candidate(this, PanelSize, colBucket); for (int i=0; i::CreateBundles +( + void +) ; +template void BucketList::CreateBundles +( + void +) ; + // SkipBundleCreation determines whether we should skip creating a new // bundle for the specified tile in the specified column bucket. -bool BucketList::SkipBundleCreation +template +bool BucketList::SkipBundleCreation ( Int tile, // The tile to consider Int colBucket // The column bucket it sits in @@ -84,12 +93,24 @@ bool BucketList::SkipBundleCreation return false; } +template bool BucketList::SkipBundleCreation +( + int32_t tile, // The tile to consider + int32_t colBucket // The column bucket it sits in +) ; +template bool BucketList::SkipBundleCreation +( + int64_t tile, // The tile to consider + int64_t colBucket // The column bucket it sits in +) ; + // IsInternal determines whether a tile is completely within the bounds // of the front because if it isn't then we will need to use the special // edge case kernels. -bool BucketList::IsInternal +template +bool BucketList::IsInternal ( - LLBundle& Bundle, + LLBundle & Bundle, int jLast ) { @@ -112,3 +133,14 @@ bool BucketList::IsInternal Int iLast = TILESIZE * (iTile+1) - 1; return(iLast < front->fm && jLast < front->fn); } + +template bool BucketList::IsInternal +( + LLBundle & Bundle, + int jLast +) ; +template bool BucketList::IsInternal +( + LLBundle & Bundle, + int jLast +) ; diff --git a/GPUQREngine/Source/BucketList/BucketList_FillWorkQueue.cpp b/GPUQREngine/Source/BucketList/BucketList_FillWorkQueue.cpp index 422964faa..68b4b1b3c 100644 --- a/GPUQREngine/Source/BucketList/BucketList_FillWorkQueue.cpp +++ b/GPUQREngine/Source/BucketList/BucketList_FillWorkQueue.cpp @@ -21,11 +21,11 @@ #include "GPUQREngine_BucketList.hpp" - // FillWorkQueue is responsible for filling the work queue with items and // resolving generic TaskType entries on the bundles into concrete tasks // to be performed by the GPU. -Int BucketList::FillWorkQueue +template +Int BucketList::FillWorkQueue ( TaskDescriptor *queue, // The list of work items for the GPU Int *queueIndex // The current index into the queue @@ -42,7 +42,7 @@ Int BucketList::FillWorkQueue // For all bundles the bucket list is currently tracking: for (int i = 0; i < numBundles; i++) { - LLBundle& bundle = Bundles[i]; + LLBundle & bundle = Bundles[i]; TaskType type = bundle.CurrentTask; int nativeBucket = (int) bundle.NativeBucket; @@ -202,3 +202,14 @@ Int BucketList::FillWorkQueue return numTasks; } + +template int32_t BucketList::FillWorkQueue +( + TaskDescriptor *queue, // The list of work items for the GPU + int32_t *queueIndex // The current index into the queue +) ; +template int64_t BucketList::FillWorkQueue +( + TaskDescriptor *queue, // The list of work items for the GPU + int64_t *queueIndex // The current index into the queue +) ; diff --git a/GPUQREngine/Source/BucketList/BucketList_GrowBundles.cpp b/GPUQREngine/Source/BucketList/BucketList_GrowBundles.cpp index 55323cbc1..e39fd6809 100644 --- a/GPUQREngine/Source/BucketList/BucketList_GrowBundles.cpp +++ b/GPUQREngine/Source/BucketList/BucketList_GrowBundles.cpp @@ -15,10 +15,10 @@ // ============================================================================= #include "GPUQREngine_BucketList.hpp" -#ifdef GPUQRENGINE_PIPELINING - /* Grow existing bundles and advance the task type to APPLY_FACTORIZE. */ -void BucketList::GrowBundles +#ifdef GPUQRENGINE_PIPELINING +template +void BucketList::GrowBundles ( void ) @@ -26,7 +26,7 @@ void BucketList::GrowBundles //Console.WriteLine("=== GrowBundles"); for (int i = 0; i < numBundles; i++ ) { - LLBundle& bundle = Bundles[i]; + LLBundle & bundle = Bundles[i]; /* The bundle is a phantom bundle if it only has a shadow entry. * In this case, we choose not to grow the bundle. */ @@ -73,4 +73,12 @@ void BucketList::GrowBundles } } +template void BucketList::GrowBundles +( + void +) ; +template void BucketList::GrowBundles +( + void +) ; #endif diff --git a/GPUQREngine/Source/BucketList/BucketList_Manage.cpp b/GPUQREngine/Source/BucketList/BucketList_Manage.cpp index be0d0dcfc..08cf7f7e6 100644 --- a/GPUQREngine/Source/BucketList/BucketList_Manage.cpp +++ b/GPUQREngine/Source/BucketList/BucketList_Manage.cpp @@ -15,11 +15,9 @@ // pipelined factorization. // // ============================================================================= - #include "GPUQREngine_BucketList.hpp" - - -void BucketList::Insert +template +void BucketList::Insert ( Int tile, Int bucket, @@ -41,8 +39,21 @@ void BucketList::Insert /* Keep track of the last bucket. */ LastBucket = MAX(LastBucket, bucket); } +template void BucketList::Insert +( + int32_t tile, + int32_t bucket, + bool upperTriangular +) ; +template void BucketList::Insert +( + int64_t tile, + int64_t bucket, + bool upperTriangular +) ; -void BucketList::Remove +template +void BucketList::Remove ( Int tile, Int bucket @@ -66,8 +77,20 @@ void BucketList::Remove numIdleTiles--; } +template void BucketList::Remove +( + int32_t tile, + int32_t bucket +) ; +template void BucketList::Remove +( + int64_t tile, + int64_t bucket +) ; + #ifdef GPUQRENGINE_PIPELINING -Int BucketList::RemoveHead +template +Int BucketList::RemoveHead ( Int bucket // The bucket number ) @@ -76,21 +99,12 @@ Int BucketList::RemoveHead Remove(tile, bucket); return tile; } -#endif - -double *BucketList::allocateVT +template int32_t BucketList::RemoveHead ( - void -) -{ - return gpuVT[VThead++]; -} - -double *BucketList::freeVT + int32_t bucket // The bucket number +) ; +template int64_t BucketList::RemoveHead ( - double *doneVT // The GPU pointer of a released VT tile -) -{ - gpuVT[--VThead] = doneVT; - return NULL; -} + int64_t bucket // The bucket number +) ; +#endif diff --git a/GPUQREngine/Source/BucketList/BucketList_PostProcessing.cpp b/GPUQREngine/Source/BucketList/BucketList_PostProcessing.cpp index faf9cab12..4164f6550 100644 --- a/GPUQREngine/Source/BucketList/BucketList_PostProcessing.cpp +++ b/GPUQREngine/Source/BucketList/BucketList_PostProcessing.cpp @@ -12,18 +12,16 @@ // including merging delta tiles with the main bundle and other fixups. // // ============================================================================= - #include "GPUQREngine_BucketList.hpp" - - -void BucketList::PostProcess +template +void BucketList::PostProcess ( void ) { for(int b=0; b& bundle = Bundles[b]; /* Get details about the task type. */ TaskType type = bundle.CurrentTask; @@ -48,3 +46,12 @@ void BucketList::PostProcess } } } + +template void BucketList::PostProcess +( + void +) ; +template void BucketList::PostProcess +( + void +) ; diff --git a/GPUQREngine/Source/GPUQREngine_ExpertDense.cpp b/GPUQREngine/Source/GPUQREngine_ExpertDense.cpp index ed7ac15dd..9e3761cf5 100644 --- a/GPUQREngine/Source/GPUQREngine_ExpertDense.cpp +++ b/GPUQREngine/Source/GPUQREngine_ExpertDense.cpp @@ -24,29 +24,49 @@ #include "GPUQREngine_Internal.hpp" - +template QREngineResultCode GPUQREngine_Cleanup ( QREngineResultCode code, // The result code that we're exiting with - Front *userFronts, // The user-provided list of fronts - Front *fronts, // The internal copy of the user's fronts + Front *userFronts, // The user-provided list of fronts + Front *fronts, // The internal copy of the user's fronts Int numFronts, // The number of fronts to be factorized Workspace *wsMongoF, // Pointer to the total GPU Front workspace Workspace *wsMongoR // Pointer to the total CPU R workspace ); +template QREngineResultCode GPUQREngine_Cleanup +( + QREngineResultCode code, // The result code that we're exiting with + Front *userFronts, // The user-provided list of fronts + Front *fronts, // The internal copy of the user's fronts + int32_t numFronts, // The number of fronts to be factorized + Workspace *wsMongoF, // Pointer to the total GPU Front workspace + Workspace *wsMongoR // Pointer to the total CPU R workspace +); +template QREngineResultCode GPUQREngine_Cleanup +( + QREngineResultCode code, // The result code that we're exiting with + Front *userFronts, // The user-provided list of fronts + Front *fronts, // The internal copy of the user's fronts + int64_t numFronts, // The number of fronts to be factorized + Workspace *wsMongoF, // Pointer to the total GPU Front workspace + Workspace *wsMongoR // Pointer to the total CPU R workspace +); + +template QREngineResultCode GPUQREngine ( size_t gpuMemorySize, // The total available GPU memory size in bytes - Front *userFronts, // The list of fronts to factorize + Front *userFronts, // The list of fronts to factorize Int numFronts, // The number of fronts to factorize - QREngineStats *stats // An optional parameter. If present, statistics + QREngineStats *stats // An optional parameter. If present, statistics // are collected and passed back to the caller // via this struct ) { /* Allocate workspaces */ - Front *fronts = (Front*) SuiteSparse_calloc(numFronts, sizeof(Front)); + Front *fronts = (Front *) SuiteSparse_calloc(numFronts, sizeof(Front )); if(!fronts) { return QRENGINE_OUTOFMEMORY; @@ -57,10 +77,10 @@ QREngineResultCode GPUQREngine for(int f=0; f *userFront = &(userFronts[f]); Int m = userFront->fm; Int n = userFront->fn; - Front *front = new (&fronts[f]) Front(f, EMPTY, m, n); + Front *front = new (&fronts[f]) Front (f, EMPTY, m, n); FSize += front->getNumFrontValues(); RSize += front->getNumRValues(); } @@ -90,7 +110,7 @@ QREngineResultCode GPUQREngine for(int f=0; f *front = &(fronts[f]); front->F = CPU_REFERENCE(wsMongoF, double*) + FOffset; front->gpuF = GPU_REFERENCE(wsMongoF, double*) + FOffset; front->cpuR = CPU_REFERENCE(wsMongoR, double*) + ROffset; @@ -98,7 +118,7 @@ QREngineResultCode GPUQREngine ROffset += front->getNumRValues(); /* COPY USER DATA (user's F to our F) */ - Front *userFront = &(userFronts[f]); + Front *userFront = &(userFronts[f]); double *userF = userFront->F; double *F = front->F; Int m = userFront->fm; @@ -133,7 +153,7 @@ QREngineResultCode GPUQREngine } /* Do the factorization for this set of fronts. */ - QREngineResultCode result = GPUQREngine_Internal(gpuMemorySize, fronts, + QREngineResultCode result = GPUQREngine_Internal (gpuMemorySize, fronts, numFronts, NULL, NULL, NULL, stats); if(result != QRENGINE_SUCCESS) { @@ -144,7 +164,7 @@ QREngineResultCode GPUQREngine /* COPY USER DATA (our R back to user's R) */ for(int f=0; f *userFront = &(userFronts[f]); double *R = (&fronts[f])->cpuR; double *userR = userFront->cpuR; Int m = userFront->fm; @@ -166,11 +186,31 @@ QREngineResultCode GPUQREngine userFronts, fronts, numFronts, wsMongoF, wsMongoR); } +template QREngineResultCode GPUQREngine +( + size_t gpuMemorySize, // The total available GPU memory size in bytes + Front *userFronts, // The list of fronts to factorize + int32_t numFronts, // The number of fronts to factorize + QREngineStats *stats // An optional parameter. If present, statistics + // are collected and passed back to the caller + // via this struct +) ; +template QREngineResultCode GPUQREngine +( + size_t gpuMemorySize, // The total available GPU memory size in bytes + Front *userFronts, // The list of fronts to factorize + int64_t numFronts, // The number of fronts to factorize + QREngineStats *stats // An optional parameter. If present, statistics + // are collected and passed back to the caller + // via this struct +) ; + +template QREngineResultCode GPUQREngine_Cleanup ( QREngineResultCode code, // The result code that we're exiting with - Front *userFronts, // The user-provided list of fronts - Front *fronts, // The internal copy of the user's fronts + Front *userFronts, // The user-provided list of fronts + Front *fronts, // The internal copy of the user's fronts Int numFronts, // The number of fronts to be factorized Workspace *wsMongoF, // Pointer to the total GPU Front workspace Workspace *wsMongoR // Pointer to the total CPU R workspace @@ -179,8 +219,8 @@ QREngineResultCode GPUQREngine_Cleanup /* Cleanup fronts. */ for(int f=0; f *userFront = (&userFronts[f]); + Front *front = &(fronts[f]); if(front != NULL) { /* If we had to attach our own stair, clean it up. */ @@ -193,7 +233,7 @@ QREngineResultCode GPUQREngine_Cleanup front->F = NULL; } } - fronts = (Front *) SuiteSparse_free(fronts); + fronts = (Front *) SuiteSparse_free(fronts); /* Free the mongo structures. Note that Workspace checks for NULL. */ wsMongoF = Workspace::destroy(wsMongoF); @@ -202,9 +242,10 @@ QREngineResultCode GPUQREngine_Cleanup return code; } +template Int *GPUQREngine_FindStaircase ( - Front *front // The front whose staircase we are computing + Front *front // The front whose staircase we are computing ) { Int fm = front->fm; @@ -225,5 +266,13 @@ Int *GPUQREngine_FindStaircase return Stair; } +template int32_t *GPUQREngine_FindStaircase +( + Front *front // The front whose staircase we are computing +) ; +template int64_t *GPUQREngine_FindStaircase +( + Front *front // The front whose staircase we are computing +) ; #endif diff --git a/GPUQREngine/Source/GPUQREngine_ExpertSparse.cpp b/GPUQREngine/Source/GPUQREngine_ExpertSparse.cpp index a6aa80124..9879afc13 100644 --- a/GPUQREngine/Source/GPUQREngine_ExpertSparse.cpp +++ b/GPUQREngine/Source/GPUQREngine_ExpertSparse.cpp @@ -17,18 +17,18 @@ #include "GPUQREngine_Internal.hpp" - +template QREngineResultCode GPUQREngine ( size_t gpuMemorySize, // The total available GPU memory size in bytes - Front *userFronts, // The list of fronts to factorize + Front *userFronts, // The list of fronts to factorize Int numFronts, // The number of fronts to factorize Int *Parent, // The front-to-parent mapping Int *Childp, // Front-to-child column pointers Int *Child, // Child permutation // (Child[Childp[f]] to Child[Childp[f+1]] are all // the front identifiers for front "f"'s children. - QREngineStats *stats // An optional parameter. If present, statistics + QREngineStats *stats // An optional parameter. If present, statistics // are collected and passed back to the caller // via this struct ) @@ -37,5 +37,33 @@ QREngineResultCode GPUQREngine Childp, Child, stats)) ; } +template QREngineResultCode GPUQREngine +( + size_t gpuMemorySize, // The total available GPU memory size in bytes + Front *userFronts, // The list of fronts to factorize + int32_t numFronts, // The number of fronts to factorize + int32_t *Parent, // The front-to-parent mapping + int32_t *Childp, // Front-to-child column pointers + int32_t *Child, // Child permutation + // (Child[Childp[f]] to Child[Childp[f+1]] are all + // the front identifiers for front "f"'s children. + QREngineStats *stats // An optional parameter. If present, statistics + // are collected and passed back to the caller + // via this struct +) ; +template QREngineResultCode GPUQREngine +( + size_t gpuMemorySize, // The total available GPU memory size in bytes + Front *userFronts, // The list of fronts to factorize + int64_t numFronts, // The number of fronts to factorize + int64_t *Parent, // The front-to-parent mapping + int64_t *Childp, // Front-to-child column pointers + int64_t *Child, // Child permutation + // (Child[Childp[f]] to Child[Childp[f+1]] are all + // the front identifiers for front "f"'s children. + QREngineStats *stats // An optional parameter. If present, statistics + // are collected and passed back to the caller + // via this struct +) ; #endif diff --git a/GPUQREngine/Source/GPUQREngine_GraphVizHelper.cpp b/GPUQREngine/Source/GPUQREngine_GraphVizHelper.cpp index 8caa48cdc..fc3d4a42e 100644 --- a/GPUQREngine/Source/GPUQREngine_GraphVizHelper.cpp +++ b/GPUQREngine/Source/GPUQREngine_GraphVizHelper.cpp @@ -33,19 +33,21 @@ #include #include +template void GraphVizHelper_ComputeBundleLabel ( - LLBundle& bundle, // C++ Reference to the bundle + LLBundle & bundle, // C++ Reference to the bundle char *label // (output) The label to use for the bundle ); static int DotSID = 1; -void GPUQREngine_RenderBuckets(BucketList *buckets) +template +void GPUQREngine_RenderBuckets(BucketList *buckets) { // if(!RENDER_DENSE_FACTORIZATION) return; - LLBundle *bundles = buckets->Bundles; + LLBundle *bundles = buckets->Bundles; int numBundles = buckets->numBundles; char bundleNames[numBundles][64]; @@ -139,7 +141,7 @@ void GPUQREngine_RenderBuckets(BucketList *buckets) } for(int i=0; i& bundle = bundles[i]; if (bundle.NativeBucket == colBucket) { sprintf(bundleNames[bbc], "CB_%d_HB_%d", colBucket, bbc); @@ -191,9 +193,10 @@ void GPUQREngine_RenderBuckets(BucketList *buckets) fclose(output); } +template void GraphVizHelper_ComputeBundleLabel ( - LLBundle& bundle, // C++ Reference to the bundle + LLBundle & bundle, // C++ Reference to the bundle char *label // (output) The label to use for the bundle ) { diff --git a/GPUQREngine/Source/GPUQREngine_Internal.cpp b/GPUQREngine/Source/GPUQREngine_Internal.cpp index f7281020a..88bd253b9 100644 --- a/GPUQREngine/Source/GPUQREngine_Internal.cpp +++ b/GPUQREngine/Source/GPUQREngine_Internal.cpp @@ -20,18 +20,18 @@ #include "GPUQREngine_Scheduler.hpp" #include "GPUQREngine_Stats.hpp" - +template QREngineResultCode GPUQREngine_Internal ( size_t gpuMemorySize, // The total available GPU memory size in bytes - Front *fronts, // The list of fronts to factorize + Front *fronts, // The list of fronts to factorize Int numFronts, // The number of fronts to factorize Int *Parent, // The front-to-parent mapping Int *Childp, // Front-to-child column pointers Int *Child, // Child permutation // (Child[Childp[f]] to Child[Childp[f+1]] are all // the front identifiers for front "f"'s children. - QREngineStats *stats // An optional parameter. If present, statistics + QREngineStats *stats // An optional parameter. If present, statistics // are collected and passed back to the caller // via this struct ) @@ -39,13 +39,13 @@ QREngineResultCode GPUQREngine_Internal bool ok = true; /* Create the scheduler. */ - Scheduler *scheduler = (Scheduler*) SuiteSparse_calloc(1,sizeof(Scheduler)); + Scheduler *scheduler = (Scheduler *) SuiteSparse_calloc(1,sizeof(Scheduler )); if (scheduler == NULL) { return QRENGINE_OUTOFMEMORY; } - new (scheduler) Scheduler(fronts, numFronts, gpuMemorySize); + new (scheduler) Scheduler (fronts, numFronts, gpuMemorySize); ok = scheduler->memory_ok && scheduler->cuda_ok; /* If we encountered problems initializing the scheduler: */ @@ -56,7 +56,7 @@ QREngineResultCode GPUQREngine_Internal if(scheduler) { scheduler->~Scheduler(); - scheduler = (Scheduler*) SuiteSparse_free (scheduler) ; + scheduler = (Scheduler *) SuiteSparse_free (scheduler) ; } if(!memory_ok) return QRENGINE_OUTOFMEMORY; if(!cuda_ok) return QRENGINE_GPUERROR; @@ -90,10 +90,48 @@ QREngineResultCode GPUQREngine_Internal /* Explicitly invoke the destructor */ scheduler->~Scheduler(); - scheduler = (Scheduler*) SuiteSparse_free(scheduler); + scheduler = (Scheduler *) SuiteSparse_free(scheduler); return QRENGINE_SUCCESS; } +template QREngineResultCode GPUQREngine_Internal +( + size_t gpuMemorySize, // The total available GPU memory size in bytes + Front *fronts, // The list of fronts to factorize + int32_t numFronts, // The number of fronts to factorize + int32_t *Parent, // The front-to-parent mapping + int32_t *Childp, // Front-to-child column pointers + int32_t *Child, // Child permutation + // (Child[Childp[f]] to Child[Childp[f+1]] are all + // the front identifiers for front "f"'s children. + QREngineStats *stats // An optional parameter. If present, statistics + // are collected and passed back to the caller + // via this struct +) ; +template QREngineResultCode GPUQREngine_Internal +( + size_t gpuMemorySize, // The total available GPU memory size in bytes + Front *fronts, // The list of fronts to factorize + int64_t numFronts, // The number of fronts to factorize + int64_t *Parent, // The front-to-parent mapping + int64_t *Childp, // Front-to-child column pointers + int64_t *Child, // Child permutation + // (Child[Childp[f]] to Child[Childp[f+1]] are all + // the front identifiers for front "f"'s children. + QREngineStats *stats // An optional parameter. If present, statistics + // are collected and passed back to the caller + // via this struct +) ; + +template class BucketList; +template class BucketList; + +template class LLBundle; +template class LLBundle; + +template class Scheduler; +template class Scheduler; + #endif diff --git a/GPUQREngine/Source/LLBundle/LLBundle.cpp b/GPUQREngine/Source/LLBundle/LLBundle.cpp deleted file mode 100644 index 169dda517..000000000 --- a/GPUQREngine/Source/LLBundle/LLBundle.cpp +++ /dev/null @@ -1,41 +0,0 @@ -// ============================================================================= -// === GPUQREngine/Source/LLBundle.cpp ========================================= -// ============================================================================= - -// GPUQREngine, Copyright (c) 2013, Timothy A Davis, Sencer Nuri Yeralan, -// and Sanjay Ranka. All Rights Reserved. -// SPDX-License-Identifier: GPL-2.0+ - -//------------------------------------------------------------------------------ -// -// This file contains the constructor and destructor for the LLBundle class. -// The constructor will attempt to reserve a VT tile automatically, since newly -// created bundles are immediately slated for factorization. -// -// ============================================================================= - -#include "GPUQREngine_BucketList.hpp" - - -LLBundle::LLBundle -( - BucketList *buckets, - Int panelSize, - Int nativeBucket -) -{ - Buckets = buckets; - PanelSize = panelSize; - NativeBucket = nativeBucket; - SecondMin = Shadow = First = Delta = Max = EMPTY; - Count = ApplyCount = 0; - VT[0] = VT[1] = NULL; - - /* Create the factorize task and allocate a VT block. */ - CurrentTask = TASKTYPE_GenericFactorize; - VT[0] = buckets->allocateVT(); -} - -LLBundle::~LLBundle() -{ -} diff --git a/GPUQREngine/Source/LLBundle/LLBundle_AddTiles.cpp b/GPUQREngine/Source/LLBundle/LLBundle_AddTiles.cpp index f1ddd97a7..734ce8af0 100644 --- a/GPUQREngine/Source/LLBundle/LLBundle_AddTiles.cpp +++ b/GPUQREngine/Source/LLBundle/LLBundle_AddTiles.cpp @@ -12,13 +12,11 @@ // or to the bundle's delta (if pipelined factorization is enabled). // // ============================================================================= - +#include "GPUQREngine_LLBundle.hpp" #include "GPUQREngine_BucketList.hpp" - - #ifdef GPUQRENGINE_PIPELINING - -void LLBundle::AddTileToDelta +template +void LLBundle ::AddTileToDelta ( Int rowTile ) @@ -66,7 +64,8 @@ void LLBundle::AddTileToDelta #endif -void LLBundle::AddTileToSlots +template +void LLBundle ::AddTileToSlots ( Int rowTile ) @@ -118,3 +117,12 @@ void LLBundle::AddTileToSlots /* Update last, if needed. */ if (next[Last] != EMPTY) Last = next[Last]; } + +template void LLBundle ::AddTileToSlots +( + int32_t rowTile +) ; +template void LLBundle ::AddTileToSlots +( + int64_t rowTile +) ; diff --git a/GPUQREngine/Source/LLBundle/LLBundle_Advance.cpp b/GPUQREngine/Source/LLBundle/LLBundle_Advance.cpp index 97a976116..15bca9d27 100644 --- a/GPUQREngine/Source/LLBundle/LLBundle_Advance.cpp +++ b/GPUQREngine/Source/LLBundle/LLBundle_Advance.cpp @@ -19,11 +19,10 @@ // front in it to begin with. // // ============================================================================= - +#include "GPUQREngine_LLBundle.hpp" #include "GPUQREngine_BucketList.hpp" - - -bool LLBundle::Advance +template +bool LLBundle ::Advance ( void ) @@ -84,3 +83,12 @@ bool LLBundle::Advance return stillAround; } + +template bool LLBundle ::Advance +( + void +) ; +template bool LLBundle ::Advance +( + void +) ; diff --git a/GPUQREngine/Source/LLBundle/LLBundle_GPUPack.cpp b/GPUQREngine/Source/LLBundle/LLBundle_GPUPack.cpp index 94199cbdd..bff64c42b 100644 --- a/GPUQREngine/Source/LLBundle/LLBundle_GPUPack.cpp +++ b/GPUQREngine/Source/LLBundle/LLBundle_GPUPack.cpp @@ -12,11 +12,10 @@ // its state into a packet of metadata information that the GPU can act on. // // ============================================================================= - +#include "GPUQREngine_LLBundle.hpp" #include "GPUQREngine_BucketList.hpp" - - -void LLBundle::gpuPack +template +void LLBundle ::gpuPack ( TaskDescriptor* cpuTask ) @@ -60,3 +59,12 @@ void LLBundle::gpuPack cpuTask->AuxAddress[0] = VT[0]; cpuTask->AuxAddress[1] = VT[1]; } + +template void LLBundle ::gpuPack +( + TaskDescriptor* cpuTask +) ; +template void LLBundle ::gpuPack +( + TaskDescriptor* cpuTask +) ; diff --git a/GPUQREngine/Source/LLBundle/LLBundle_PipelinedRearrange.cpp b/GPUQREngine/Source/LLBundle/LLBundle_PipelinedRearrange.cpp index 79b0f4561..909344bd9 100644 --- a/GPUQREngine/Source/LLBundle/LLBundle_PipelinedRearrange.cpp +++ b/GPUQREngine/Source/LLBundle/LLBundle_PipelinedRearrange.cpp @@ -15,11 +15,10 @@ // data structure. // // ============================================================================= - +#include "GPUQREngine_LLBundle.hpp" #include "GPUQREngine_BucketList.hpp" - - -void LLBundle::PipelinedRearrange +template +void LLBundle ::PipelinedRearrange ( void ) @@ -110,3 +109,12 @@ void LLBundle::PipelinedRearrange while (next[Last] != EMPTY) Last = next[Last]; } } + +template void LLBundle ::PipelinedRearrange +( + void +) ; +template void LLBundle ::PipelinedRearrange +( + void +) ; diff --git a/GPUQREngine/Source/LLBundle/LLBundle_UpdateSecondMinIndex.cpp b/GPUQREngine/Source/LLBundle/LLBundle_UpdateSecondMinIndex.cpp index 1e9101cdb..68ae3adde 100644 --- a/GPUQREngine/Source/LLBundle/LLBundle_UpdateSecondMinIndex.cpp +++ b/GPUQREngine/Source/LLBundle/LLBundle_UpdateSecondMinIndex.cpp @@ -13,14 +13,13 @@ // // ============================================================================= - -#include "GPUQREngine_BucketList.hpp" - // ----------------------------------------------------------------------------- // LLBundle::UpdateSecondMinIndex // ----------------------------------------------------------------------------- - -void LLBundle::UpdateSecondMinIndex +#include "GPUQREngine_LLBundle.hpp" +#include "GPUQREngine_BucketList.hpp" +template +void LLBundle ::UpdateSecondMinIndex ( void ) @@ -38,12 +37,20 @@ void LLBundle::UpdateSecondMinIndex inspect = next[inspect]; } } +template void LLBundle ::UpdateSecondMinIndex +( + void +) ; +template void LLBundle ::UpdateSecondMinIndex +( + void +) ; // ----------------------------------------------------------------------------- // LLBundle::UpdateMax // ----------------------------------------------------------------------------- - -void LLBundle::UpdateMax +template +void LLBundle ::UpdateMax ( void ) @@ -54,3 +61,12 @@ void LLBundle::UpdateMax Max = Shadow; for(Int tile=First; tile!=EMPTY; tile=next[tile]) Max = MAX(Max, tile); } + +template void LLBundle ::UpdateMax +( + void +) ; +template void LLBundle ::UpdateMax +( + void +) ; diff --git a/GPUQREngine/Source/Scheduler/Scheduler.cpp b/GPUQREngine/Source/Scheduler/Scheduler.cpp index 601fc7734..372f2d18a 100644 --- a/GPUQREngine/Source/Scheduler/Scheduler.cpp +++ b/GPUQREngine/Source/Scheduler/Scheduler.cpp @@ -21,24 +21,22 @@ // the constructor is responsible for memory management AND initialization. // ============================================================================= -#include "GPUQREngine_Scheduler.hpp" - // ----------------------------------------------------------------------------- // Macro destructor // ----------------------------------------------------------------------------- - -#define FREE_EVERYTHING \ +#include "GPUQREngine_Scheduler.hpp" +#define FREE_EVERYTHING_SCHEDULER \ afPerm = (Int *) SuiteSparse_free(afPerm); \ afPinv = (Int *) SuiteSparse_free(afPinv); \ if(bucketLists) \ { \ for(Int f=0; f *dlbl = (&bucketLists[f]); \ dlbl->~BucketList(); \ } \ } \ - bucketLists = (BucketList*) SuiteSparse_free(bucketLists); \ + bucketLists = (BucketList *) SuiteSparse_free(bucketLists); \ FrontDataPulled = (bool *) SuiteSparse_free(FrontDataPulled); \ eventFrontDataReady =(cudaEvent_t*) SuiteSparse_free(eventFrontDataReady); \ eventFrontDataPulled=(cudaEvent_t*) SuiteSparse_free(eventFrontDataPulled);\ @@ -56,9 +54,10 @@ // Scheduler constructor // ----------------------------------------------------------------------------- -Scheduler::Scheduler +template +Scheduler ::Scheduler ( - Front *fronts, + Front *fronts, Int numFronts, size_t gpuMemorySize ) @@ -87,8 +86,8 @@ Scheduler::Scheduler afPerm = (Int*) SuiteSparse_calloc(numFronts, sizeof(Int)); afPinv = (Int*) SuiteSparse_calloc(numFronts, sizeof(Int)); - bucketLists = (BucketList*) - SuiteSparse_calloc(numFronts, sizeof(BucketList)); + bucketLists = (BucketList *) + SuiteSparse_calloc(numFronts, sizeof(BucketList )); FrontDataPulled = (bool*) SuiteSparse_calloc(numFronts, sizeof(bool)); eventFrontDataReady = (cudaEvent_t*) SuiteSparse_calloc(numFronts, sizeof(cudaEvent_t)); @@ -98,7 +97,7 @@ Scheduler::Scheduler if(!afPerm || !afPinv || !bucketLists || !FrontDataPulled || !eventFrontDataReady || !eventFrontDataPulled) { - FREE_EVERYTHING ; + FREE_EVERYTHING_SCHEDULER ; memory_ok = false; return; } @@ -111,7 +110,7 @@ Scheduler::Scheduler If this fails, we have either cuda_ok = false or memory_ok = false. */ if(!initialize(gpuMemorySize)) { - FREE_EVERYTHING; + FREE_EVERYTHING_SCHEDULER ; // If cuda_ok is still true then we ran out of memory. // Else we had enough memory but failed the cuda calls. if(cuda_ok) memory_ok = false; @@ -160,22 +159,38 @@ Scheduler::Scheduler renderCount = 0; #endif } +template Scheduler ::Scheduler +( + Front *fronts, + int32_t numFronts, + size_t gpuMemorySize +) ; +template Scheduler ::Scheduler +( + Front *fronts, + int64_t numFronts, + size_t gpuMemorySize +) ; // ----------------------------------------------------------------------------- // Scheduler destructor // ----------------------------------------------------------------------------- - -Scheduler::~Scheduler() +template +Scheduler ::~Scheduler() { - FREE_EVERYTHING ; + FREE_EVERYTHING_SCHEDULER ; } +template Scheduler ::~Scheduler() ; +template Scheduler ::~Scheduler() ; + // ----------------------------------------------------------------------------- // Scheduler::initialize // ----------------------------------------------------------------------------- // Returns true if OK, false if out of memory or cuda initialization failed. // ----------------------------------------------------------------------------- -bool Scheduler::initialize +template +bool Scheduler ::initialize ( size_t gpuMemorySize ) @@ -187,7 +202,7 @@ bool Scheduler::initialize for(int pf=0; pf *front = &(frontList[pf]); SparseMeta *meta = &(front->sparseMeta); Int f = front->fids; bool isDense = front->isDense(); @@ -197,7 +212,7 @@ bool Scheduler::initialize afPinv[f] = EMPTY; /* Configure the bucket list for each front. */ - BucketList *dlbl = (&bucketLists[f]); + BucketList *dlbl = (&bucketLists[f]); dlbl->useFlag = false; if(front->isTooBigForSmallQR()) { @@ -258,3 +273,12 @@ bool Scheduler::initialize return cuda_ok; } + +template bool Scheduler ::initialize +( + size_t gpuMemorySize +) ; +template bool Scheduler ::initialize +( + size_t gpuMemorySize +) ; diff --git a/GPUQREngine/Source/Scheduler/Scheduler_FillWorkQueue.cpp b/GPUQREngine/Source/Scheduler/Scheduler_FillWorkQueue.cpp index e91471564..ef0849c2f 100644 --- a/GPUQREngine/Source/Scheduler/Scheduler_FillWorkQueue.cpp +++ b/GPUQREngine/Source/Scheduler/Scheduler_FillWorkQueue.cpp @@ -69,41 +69,41 @@ // When all fronts are in the DONE state then the QREngine's work is done. // // ============================================================================= - -#include "GPUQREngine_Scheduler.hpp" #include "GPUQREngine_GraphVizHelper.hpp" - +#include "GPUQREngine_Scheduler.hpp" // ----------------------------------------------------------------------------- // prototypes for local functions // ----------------------------------------------------------------------------- - +template TaskDescriptor buildSAssemblyTask ( - Front *front, + Front *front, int pstart, int pend ); +template TaskDescriptor buildPackAssemblyTask ( - Front *front, + Front *front, int cistart, int ciend, int cjstart, int cjend ); +template TaskDescriptor buildSmallQRTask ( - Front *front + Front *front ); // ----------------------------------------------------------------------------- // Scheduler::fillWorkQueue // ----------------------------------------------------------------------------- - -void Scheduler::fillWorkQueue +template +void Scheduler ::fillWorkQueue ( void ) @@ -141,7 +141,7 @@ void Scheduler::fillWorkQueue for(Int p=0; p *front = (&frontList[f]); valid = (front->gpuF == queue[t].F && front->printMe); } if(!valid) continue; @@ -171,18 +171,26 @@ void Scheduler::fillWorkQueue #endif } +template void Scheduler ::fillWorkQueue +( + void +) ; +template void Scheduler ::fillWorkQueue +( + void +) ; // ----------------------------------------------------------------------------- // Scheduler::fillTasks // ----------------------------------------------------------------------------- - -void Scheduler::fillTasks +template +void Scheduler ::fillTasks ( Int f, // INPUT: Current front TaskDescriptor *queue, // INPUT: CPU Task entries Int *queueIndex // IN/OUT: The index of the current entry ) { - Front *front = (&frontList[f]); + Front *front = (&frontList[f]); SparseMeta *sparseMeta = &(front->sparseMeta); bool isDense = front->isDense(); @@ -228,7 +236,7 @@ void Scheduler::fillTasks while(pstart != pend) { /* Build the S Assembly task. */ - queue[qindex++] = buildSAssemblyTask(front, pstart, pend); + queue[qindex++] = buildSAssemblyTask (front, pstart, pend); /* Save-through the lastSIndex then update pend */ pstart = sparseMeta->lastSIndex = pend; @@ -254,7 +262,7 @@ void Scheduler::fillTasks case FACTORIZE: { /* If we have to schedule the fronts via the scheduler: */ - BucketList *Buckets = (&bucketLists[f]); + BucketList *Buckets = (&bucketLists[f]); if(Buckets->useFlag) { /* Only invoke the bucket scheduler if we have enough space in @@ -389,14 +397,25 @@ void Scheduler::fillTasks /* Copy-out the indexes. */ *queueIndex = qindex; } - +template void Scheduler ::fillTasks +( + int32_t f, // INPUT: Current front + TaskDescriptor *queue, // INPUT: CPU Task entries + int32_t *queueIndex // IN/OUT: The index of the current entry +) ; +template void Scheduler ::fillTasks +( + int64_t f, // INPUT: Current front + TaskDescriptor *queue, // INPUT: CPU Task entries + int64_t *queueIndex // IN/OUT: The index of the current entry +) ; // ----------------------------------------------------------------------------- // buildSAssemblyTask // ----------------------------------------------------------------------------- - +template TaskDescriptor buildSAssemblyTask ( - Front *front, + Front *front, int pstart, int pend ) @@ -418,10 +437,10 @@ TaskDescriptor buildSAssemblyTask // ----------------------------------------------------------------------------- // buildPackAssemblyTask // ----------------------------------------------------------------------------- - +template TaskDescriptor buildPackAssemblyTask ( - Front *front, + Front *front, int cistart, int ciend, int cjstart, @@ -454,10 +473,10 @@ TaskDescriptor buildPackAssemblyTask // ----------------------------------------------------------------------------- // buildSmallQRTask // ----------------------------------------------------------------------------- - +template TaskDescriptor buildSmallQRTask ( - Front *front + Front *front ) { TaskDescriptor returner; diff --git a/GPUQREngine/Source/Scheduler/Scheduler_Front.cpp b/GPUQREngine/Source/Scheduler/Scheduler_Front.cpp index d49d88d0d..0375eb60f 100644 --- a/GPUQREngine/Source/Scheduler/Scheduler_Front.cpp +++ b/GPUQREngine/Source/Scheduler/Scheduler_Front.cpp @@ -29,15 +29,12 @@ // to not accidentally free a front whose R factor is still in transit. // // ============================================================================= - #include "GPUQREngine_Scheduler.hpp" - - // ----------------------------------------------------------------------------- // Scheduler::activateFront // ----------------------------------------------------------------------------- - -void Scheduler::activateFront +template +void Scheduler ::activateFront ( Int f // The front id to manipulate ) @@ -45,7 +42,7 @@ void Scheduler::activateFront /* If the front has already been activated, exit early. */ if(afPinv[f] != EMPTY) return; - Front *front = (&frontList[f]); + Front *front = (&frontList[f]); /* Add this front to the list of active fronts. */ afPerm[numActiveFronts] = f; @@ -72,18 +69,25 @@ void Scheduler::activateFront } } } - +template void Scheduler ::activateFront +( + int32_t f // The front id to manipulate +) ; +template void Scheduler ::activateFront +( + int64_t f // The front id to manipulate +) ; // ----------------------------------------------------------------------------- // Scheduler::pullFrontData // ----------------------------------------------------------------------------- - -bool Scheduler::pullFrontData +template +bool Scheduler ::pullFrontData ( Int f // The front id to manipulate ) { /* Grab the front descriptor. */ - Front *front = (&frontList[f]); + Front *front = (&frontList[f]); /* If we're only doing a push assembly then there's nothing to pull. */ if(front->isPushOnly()) return true; @@ -127,11 +131,19 @@ bool Scheduler::pullFrontData return (FrontDataPulled[f] = true); } +template bool Scheduler ::pullFrontData +( + int32_t f // The front id to manipulate +) ; +template bool Scheduler ::pullFrontData +( + int64_t f // The front id to manipulate +) ; // ----------------------------------------------------------------------------- // Scheduler::finishFront // ----------------------------------------------------------------------------- - -bool Scheduler::finishFront +template +bool Scheduler ::finishFront ( Int f // The front id to manipulate ) @@ -139,7 +151,7 @@ bool Scheduler::finishFront /* If we've already freed the front, return early. */ if(afPinv[f] == EMPTY) return true; - Front *front = (&frontList[f]); + Front *front = (&frontList[f]); /* If we're doing more than a push, we need to get the data off the GPU. */ if(!front->isPushOnly()) @@ -167,13 +179,23 @@ bool Scheduler::finishFront /* If we got through this method, we have successfully freed the front. */ return true; } +template bool Scheduler ::finishFront +( + int32_t f // The front id to manipulate +) ; +template bool Scheduler ::finishFront +( + int64_t f // The front id to manipulate +) ; +#include "GPUQREngine.hpp" // ----------------------------------------------------------------------------- // debugDumpFront // ----------------------------------------------------------------------------- #if 1 -void Scheduler::debugDumpFront(Front *front) +template +void Scheduler ::debugDumpFront(Front *front) { Workspace *wsFront = Workspace::allocate (front->getNumFrontValues(), // CPU, DEBUG ONLY @@ -194,10 +216,10 @@ void Scheduler::debugDumpFront(Front *front) // printf("\n"); // } - for (Int j = 0 ; j < fn ; j++) + for (int64_t j = 0 ; j < fn ; j++) { - printf (" --- column %ld of %ld\n", j, fn) ; - for (Int i = 0 ; i < fm ; i++) + printf (" --- column %ld of %ld\n", (int64_t) j, (int64_t) fn) ; + for (int64_t i = 0 ; i < fm ; i++) { if (i == j) printf (" [ diag: ") ; else printf (" row %4ld ", i) ; @@ -212,4 +234,7 @@ void Scheduler::debugDumpFront(Front *front) wsFront->assign(wsFront->cpu(), NULL); wsFront = Workspace::destroy(wsFront); } +template void Scheduler ::debugDumpFront(Front *front) ; +template void Scheduler ::debugDumpFront(Front *front) ; + #endif diff --git a/GPUQREngine/Source/Scheduler/Scheduler_LaunchKernel.cpp b/GPUQREngine/Source/Scheduler/Scheduler_LaunchKernel.cpp index 08c0d886a..e5dd2eb7b 100644 --- a/GPUQREngine/Source/Scheduler/Scheduler_LaunchKernel.cpp +++ b/GPUQREngine/Source/Scheduler/Scheduler_LaunchKernel.cpp @@ -15,12 +15,12 @@ // // ============================================================================= -#include "GPUQREngine_Scheduler.hpp" #include "GPUQREngine_Internal.hpp" #include "GPUQREngine_Timing.hpp" +#include "GPUQREngine_Scheduler.hpp" - -void Scheduler::launchKernel +template +void Scheduler ::launchKernel ( void ) @@ -67,3 +67,12 @@ void Scheduler::launchKernel /* Clear the number of tasks. */ numTasks[activeSet] = 0; } + +template void Scheduler ::launchKernel +( + void +) ; +template void Scheduler ::launchKernel +( + void +) ; diff --git a/GPUQREngine/Source/Scheduler/Scheduler_PostProcess.cpp b/GPUQREngine/Source/Scheduler/Scheduler_PostProcess.cpp index 07cf4004f..3f2f183eb 100644 --- a/GPUQREngine/Source/Scheduler/Scheduler_PostProcess.cpp +++ b/GPUQREngine/Source/Scheduler/Scheduler_PostProcess.cpp @@ -63,11 +63,9 @@ // When all fronts are in the DONE state then the QREngine's work is done. // // ============================================================================= - #include "GPUQREngine_Scheduler.hpp" - - -bool Scheduler::postProcess +template +bool Scheduler ::postProcess ( void ) @@ -78,7 +76,7 @@ bool Scheduler::postProcess /* Get the front from the "active fronts" permutation. */ Int f = afPerm[p]; - Front *front = (&frontList[f]); + Front *front = (&frontList[f]); SparseMeta *meta = &(front->sparseMeta); bool isDense = front->isDense(); bool isSparse = front->isSparse(); @@ -245,3 +243,12 @@ bool Scheduler::postProcess /* Return whether all the fronts are DONE. */ return (numFronts == numFrontsCompleted); } + +template bool Scheduler ::postProcess +( + void +) ; +template bool Scheduler ::postProcess +( + void +) ; diff --git a/GPUQREngine/Source/Scheduler/Scheduler_Render.cpp b/GPUQREngine/Source/Scheduler/Scheduler_Render.cpp index cb2cb61b8..79dac75ce 100644 --- a/GPUQREngine/Source/Scheduler/Scheduler_Render.cpp +++ b/GPUQREngine/Source/Scheduler/Scheduler_Render.cpp @@ -26,16 +26,16 @@ // // ============================================================================= -#include "GPUQREngine_Internal.hpp" -#ifdef GPUQRENGINE_RENDER +#ifdef GPUQRENGINE_RENDER +#include "GPUQREngine_Internal.hpp" #include "GPUQREngine_Scheduler.hpp" #include #include -void Scheduler::render +void Scheduler ::render ( void ) @@ -99,4 +99,12 @@ void Scheduler::render fclose(output); } +template void Scheduler ::render +( + void +) ; +template void Scheduler ::render +( + void +) ; #endif diff --git a/GPUQREngine/Source/Scheduler/Scheduler_TransferData.cpp b/GPUQREngine/Source/Scheduler/Scheduler_TransferData.cpp index 8c2112859..485892a9b 100644 --- a/GPUQREngine/Source/Scheduler/Scheduler_TransferData.cpp +++ b/GPUQREngine/Source/Scheduler/Scheduler_TransferData.cpp @@ -20,23 +20,24 @@ // compareTaskTime is the comparator. // // ============================================================================= - -#include "GPUQREngine_Scheduler.hpp" #include "GPUQREngine_TaskDescriptor.hpp" +#include "GPUQREngine_Scheduler.hpp" - -int compareTaskTime (const void * a, const void * b) +static int compareTaskTime (const void * a, const void * b) { - TaskDescriptor *ta = (TaskDescriptor*) a; - TaskDescriptor *tb = (TaskDescriptor*) b; + const TaskDescriptor *ta = reinterpret_cast (a); + const TaskDescriptor *tb = reinterpret_cast (b); - Int aFlops = getWeightedFlops(ta); - Int bFlops = getWeightedFlops(tb); + int64_t aFlops = getWeightedFlops(ta); + int64_t bFlops = getWeightedFlops(tb); - return bFlops - aFlops; + if (aFlops == bFlops) return (0) ; + if (aFlops < bFlops) return (-1) ; + /* if (aFlops > bFlops) */ return (1) ; } -void Scheduler::transferData +template +void Scheduler ::transferData ( void ) @@ -49,7 +50,7 @@ void Scheduler::transferData for(Int t=0; t::transferData +( + void +) ; +template void Scheduler ::transferData +( + void +) ; diff --git a/GPUQREngine/Source/TaskDescriptor/TaskDescriptor_flops.cpp b/GPUQREngine/Source/TaskDescriptor/TaskDescriptor_flops.cpp index 3b9fbd252..bb57c7f0a 100644 --- a/GPUQREngine/Source/TaskDescriptor/TaskDescriptor_flops.cpp +++ b/GPUQREngine/Source/TaskDescriptor/TaskDescriptor_flops.cpp @@ -21,11 +21,12 @@ // flopsFactorizeVT // ----------------------------------------------------------------------------- -Int flopsFactorizeVT(int numTiles) +int64_t flopsFactorizeVT(int numTiles) { - Int m = TILESIZE * numTiles; - Int n = TILESIZE; - Int v = TILESIZE; + int64_t ntiles = numTiles ; + int64_t m = TILESIZE * ntiles ; + int64_t n = TILESIZE; + int64_t v = TILESIZE; return 2 * (m-1) + v * (6 + 4*m*n + 5*n + 2*m) + ((-4*n -2*m -5) * (v*(v+1)/2)) + @@ -37,9 +38,11 @@ Int flopsFactorizeVT(int numTiles) // flopsFactorize // ----------------------------------------------------------------------------- -Int flopsFactorize(int m, int n) +int64_t flopsFactorize(int m_in, int n_in) { - Int v = MIN(m, n); + int64_t m = m_in ; + int64_t n = n_in ; + int64_t v = MIN(m, n); return 2 * (m-1) + v * (6 + 4*m*n + 5*n + 2*m) + ((-4*n -2*m -4) * v*(v+1)/2) + @@ -51,10 +54,12 @@ Int flopsFactorize(int m, int n) // flopsApply // ----------------------------------------------------------------------------- -Int flopsApply(int numTiles, int n) +int64_t flopsApply(int numTiles, int n_in) { - Int m = TILESIZE * numTiles; - Int k = TILESIZE; + int64_t ntiles = numTiles ; + int64_t n = n_in ; + int64_t m = TILESIZE * ntiles; + int64_t k = TILESIZE; return k*n*(4*m - k + 3); } @@ -63,7 +68,7 @@ Int flopsApply(int numTiles, int n) // ----------------------------------------------------------------------------- #ifdef GPUQRENGINE_PIPELINING -Int flopsApplyFactorize(int applyTiles, int factorizeTiles) +int64_t flopsApplyFactorize(int applyTiles, int factorizeTiles) { return flopsApply(applyTiles, TILESIZE) + flopsFactorizeVT(factorizeTiles); } @@ -73,7 +78,7 @@ Int flopsApplyFactorize(int applyTiles, int factorizeTiles) // getFlops // ----------------------------------------------------------------------------- -Int getFlops(TaskDescriptor *task) +int64_t getFlops(const TaskDescriptor *task) { switch(task->Type) { @@ -113,9 +118,9 @@ Int getFlops(TaskDescriptor *task) // getWeightedFlops // ----------------------------------------------------------------------------- -Int getWeightedFlops(TaskDescriptor *task) +int64_t getWeightedFlops(const TaskDescriptor *task) { - Int flops = getFlops(task); + int64_t flops = getFlops(task); switch(task->Type) { case TASKTYPE_FactorizeVT_3x1: diff --git a/GPUQREngine/Source/Scheduler/ssgpu_maxQueueSize.cpp b/GPUQREngine/Source/ssgpu_maxQueueSize.cpp similarity index 97% rename from GPUQREngine/Source/Scheduler/ssgpu_maxQueueSize.cpp rename to GPUQREngine/Source/ssgpu_maxQueueSize.cpp index 4707ab0e2..f22b1d841 100644 --- a/GPUQREngine/Source/Scheduler/ssgpu_maxQueueSize.cpp +++ b/GPUQREngine/Source/ssgpu_maxQueueSize.cpp @@ -7,9 +7,8 @@ // SPDX-License-Identifier: GPL-2.0+ //------------------------------------------------------------------------------ - +#ifdef SUITESPARSE_CUDA #include "GPUQREngine_Scheduler.hpp" - #define MIN_QUEUE_SIZE 50000 size_t ssgpu_maxQueueSize // return size of scheduler queue @@ -35,3 +34,4 @@ size_t ssgpu_maxQueueSize // return size of scheduler queue return (maxQueueSize) ; } +#endif diff --git a/GPUQREngine/cmake_modules/FindGPUQREngine.cmake b/GPUQREngine/cmake_modules/FindGPUQREngine.cmake deleted file mode 100644 index 3a93f5680..000000000 --- a/GPUQREngine/cmake_modules/FindGPUQREngine.cmake +++ /dev/null @@ -1,134 +0,0 @@ -#------------------------------------------------------------------------------- -# SuiteSparse/GPUQREngine/cmake_modules/FindGPUQREngine.cmake -#------------------------------------------------------------------------------- - -# The following copyright and license applies to just this file only, not to -# the library itself: -# FindGPUQREngine.cmake, Copyright (c) 2022-2023, Timothy A. Davis. All Rights Reserved. -# SPDX-License-Identifier: BSD-3-clause - -#------------------------------------------------------------------------------- - -# Finds the GPUQREngine compiled library and sets: - -# GPUQRENGINE_INCLUDE_DIR - where to find GPUQREngine.hpp -# GPUQRENGINE_LIBRARY - dynamic GPUQREngine library -# GPUQRENGINE_STATIC - static GPUQREngine library -# GPUQRENGINE_LIBRARIES - libraries when using GPUQREngine -# GPUQRENGINE_FOUND - true if GPUQREngine found - -# set ``GPUQREngine_ROOT`` or ``GPUQRENGINE_ROOT`` to a GPUQREngine -# installation root to tell this module where to look. - -# All the Find*.cmake files in SuiteSparse are installed by 'make install' into -# /usr/local/lib/cmake/SuiteSparse (where '/usr/local' is the -# ${CMAKE_INSTALL_PREFIX}). To access this file, place the following commands -# in your CMakeLists.txt file. See also SuiteSparse/Example/CMakeLists.txt: -# -# set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} -# ${CMAKE_INSTALL_PREFIX}/lib/cmake/SuiteSparse ) - -#------------------------------------------------------------------------------- - -# include files for GPUQREngine -find_path ( GPUQRENGINE_INCLUDE_DIR - NAMES GPUQREngine.hpp - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/GPUQREngine - HINTS ${CMAKE_SOURCE_DIR}/../GPUQREngine - PATH_SUFFIXES include Include -) - -# dynamic GPUQREngine library (or static if no dynamic library was built) -find_library ( GPUQRENGINE_LIBRARY - NAMES gpuqrengine gpuqrengine_static - HINTS ${GPUQRENGINE_ROOT} - HINTS ENV GPUQRENGINE_ROOT - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/GPUQREngine - HINTS ${CMAKE_SOURCE_DIR}/../GPUQREngine - PATH_SUFFIXES lib build build/Release build/Debug -) - -if ( MSVC ) - set ( STATIC_NAME gpuqrengine_static gpuqrengine ) -else ( ) - set ( STATIC_NAME gpuqrengine ) - set ( save ${CMAKE_FIND_LIBRARY_SUFFIXES} ) - set ( CMAKE_FIND_LIBRARY_SUFFIXES - ${CMAKE_STATIC_LIBRARY_SUFFIX} ${CMAKE_FIND_LIBRARY_SUFFIXES} ) -endif ( ) - -# static GPUQREngine library -find_library ( GPUQRENGINE_STATIC - NAMES ${STATIC_NAME} - HINTS ${GPUQRENGINE_ROOT} - HINTS ENV GPUQRENGINE_ROOT - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/GPUQREngine - HINTS ${CMAKE_SOURCE_DIR}/../GPUQREngine - PATH_SUFFIXES lib build build/Release build/Debug -) - -if ( NOT MSVC ) - # restore the CMAKE_FIND_LIBRARY_SUFFIXES variable - set ( CMAKE_FIND_LIBRARY_SUFFIXES ${save} ) -endif ( ) - -# get version of the library from the dynamic library name -get_filename_component ( GPUQRENGINE_LIBRARY ${GPUQRENGINE_LIBRARY} REALPATH ) -get_filename_component ( GPUQRENGINE_FILENAME ${GPUQRENGINE_LIBRARY} NAME ) -string ( - REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" - GPUQRENGINE_VERSION - ${GPUQRENGINE_FILENAME} -) - -# set ( GPUQRENGINE_VERSION "" ) -if ( EXISTS "${GPUQRENGINE_INCLUDE_DIR}" AND NOT GPUQRENGINE_VERSION ) - # if the version does not appear in the filename, read the include file - file ( STRINGS ${GPUQRENGINE_INCLUDE_DIR}/GPUQREngine.hpp GPUQRENGINE_MAJOR_STR - REGEX "define GPUQRENGINE_MAIN_VERSION" ) - file ( STRINGS ${GPUQRENGINE_INCLUDE_DIR}/GPUQREngine.hpp GPUQRENGINE_MINOR_STR - REGEX "define GPUQRENGINE_SUB_VERSION" ) - file ( STRINGS ${GPUQRENGINE_INCLUDE_DIR}/GPUQREngine.hpp GPUQRENGINE_PATCH_STR - REGEX "define GPUQRENGINE_SUBSUB_VERSION" ) - message ( STATUS "major: ${GPUQRENGINE_MAJOR_STR}" ) - message ( STATUS "minor: ${GPUQRENGINE_MINOR_STR}" ) - message ( STATUS "patch: ${GPUQRENGINE_PATCH_STR}" ) - string ( REGEX MATCH "[0-9]+" GPUQRENGINE_MAJOR ${GPUQRENGINE_MAJOR_STR} ) - string ( REGEX MATCH "[0-9]+" GPUQRENGINE_MINOR ${GPUQRENGINE_MINOR_STR} ) - string ( REGEX MATCH "[0-9]+" GPUQRENGINE_PATCH ${GPUQRENGINE_PATCH_STR} ) - set (GPUQRENGINE_VERSION "${GPUQRENGINE_MAJOR}.${GPUQRENGINE_MINOR}.${GPUQRENGINE_PATCH}") -endif ( ) - -# libaries when using GPUQREngine -set (GPUQRENGINE_LIBRARIES ${GPUQRENGINE_LIBRARY}) - -include (FindPackageHandleStandardArgs) - -find_package_handle_standard_args ( GPUQREngine - REQUIRED_VARS GPUQRENGINE_LIBRARY - VERSION_VAR GPUQRENGINE_VERSION -) - -mark_as_advanced ( - GPUQRENGINE_INCLUDE_DIR - GPUQRENGINE_LIBRARY - GPUQRENGINE_STATIC - GPUQRENGINE_LIBRARIES -) - -if ( GPUQRENGINE_FOUND ) - message ( STATUS "GPUQREngine version: ${GPUQRENGINE_VERSION}" ) - message ( STATUS "GPUQREngine include: ${GPUQRENGINE_INCLUDE_DIR}" ) - message ( STATUS "GPUQREngine library: ${GPUQRENGINE_LIBRARY}" ) - message ( STATUS "GPUQREngine static: ${GPUQRENGINE_STATIC}" ) -else ( ) - message ( STATUS "GPUQREngine not found" ) - set ( GPUQRENGINE_INCLUDE_DIR "" ) - set ( GPUQRENGINE_LIBRARIES "" ) - set ( GPUQRENGINE_LIBRARY "" ) - set ( GPUQRENGINE_STATIC "" ) -endif ( ) - diff --git a/GraphBLAS/CMakeLists.txt b/GraphBLAS/CMakeLists.txt index b40de9844..03f24d6e9 100644 --- a/GraphBLAS/CMakeLists.txt +++ b/GraphBLAS/CMakeLists.txt @@ -11,7 +11,7 @@ # get the version #------------------------------------------------------------------------------- -cmake_minimum_required ( VERSION 3.16 ) +cmake_minimum_required ( VERSION 3.20 ) set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake_modules ) @@ -229,24 +229,29 @@ else ( ) endif ( ) endif ( ) -add_library ( graphblas SHARED ${GRAPHBLAS_SOURCES} ) +add_library ( GraphBLAS SHARED ${GRAPHBLAS_SOURCES} ) -set_target_properties ( graphblas PROPERTIES +set_target_properties ( GraphBLAS PROPERTIES VERSION ${GraphBLAS_VERSION_MAJOR}.${GraphBLAS_VERSION_MINOR}.${GraphBLAS_VERSION_SUB} + OUTPUT_NAME graphblas SOVERSION ${GraphBLAS_VERSION_MAJOR} C_STANDARD 11 C_STANDARD_REQUIRED ON PUBLIC_HEADER "Include/GraphBLAS.h" WINDOWS_EXPORT_ALL_SYMBOLS ON ) +target_include_directories ( GraphBLAS + INTERFACE $ + $ ) + if ( SUITESPARSE_CUDA ) - add_dependencies ( graphblas graphblascuda ) -# add_dependencies ( graphblas rmm_wrap ) + add_dependencies ( GraphBLAS graphblascuda ) +# add_dependencies ( GraphBLAS rmm_wrap ) endif ( ) if ( WIN32 ) # Compiling the graphblas dll on Windows: export the dll symbols - target_compile_definitions ( graphblas PRIVATE GB_DLL_EXPORT ) + target_compile_definitions ( GraphBLAS PRIVATE GB_DLL_EXPORT ) endif ( ) #------------------------------------------------------------------------------- @@ -255,9 +260,9 @@ endif ( ) if ( NOT NSTATIC ) - add_library ( graphblas_static STATIC ${GRAPHBLAS_SOURCES} ) + add_library ( GraphBLAS_static STATIC ${GRAPHBLAS_SOURCES} ) - set_target_properties ( graphblas_static PROPERTIES + set_target_properties ( GraphBLAS_static PROPERTIES VERSION ${GraphBLAS_VERSION_MAJOR}.${GraphBLAS_VERSION_MINOR}.${GraphBLAS_VERSION_SUB} OUTPUT_NAME graphblas SOVERSION ${GraphBLAS_VERSION_MAJOR} @@ -265,13 +270,17 @@ if ( NOT NSTATIC ) C_STANDARD_REQUIRED ON ) if ( MSVC ) - set_target_properties ( graphblas_static PROPERTIES + set_target_properties ( GraphBLAS_static PROPERTIES OUTPUT_NAME graphblas_static ) endif ( ) + target_include_directories ( GraphBLAS_static + INTERFACE $ + $ ) + if ( SUITESPARSE_CUDA ) - add_dependencies ( graphblas_static graphblascuda ) -# add_dependencies ( graphblas_static rmm_wrap ) + add_dependencies ( GraphBLAS_static graphblascuda ) +# add_dependencies ( GraphBLAS_static rmm_wrap ) endif ( ) endif ( ) @@ -287,9 +296,9 @@ if ( NOT GBNCPUFEAT ) check_include_file ( dlfcn.h HAVE_DLFCN_H ) if ( HAVE_DLFCN_H ) message ( STATUS "cpu_feautures has dlfcn.h" ) - target_compile_definitions ( graphblas PRIVATE HAVE_DLFCN_H ) + target_compile_definitions ( GraphBLAS PRIVATE HAVE_DLFCN_H ) if ( NOT NSTATIC ) - target_compile_definitions ( graphblas_static PRIVATE HAVE_DLFCN_H ) + target_compile_definitions ( GraphBLAS_static PRIVATE HAVE_DLFCN_H ) endif ( ) else ( ) message ( STATUS "cpu_feautures without dlfcn.h" ) @@ -297,9 +306,9 @@ if ( NOT GBNCPUFEAT ) check_symbol_exists ( getauxval "sys/auxv.h" HAVE_STRONG_GETAUXVAL ) if ( HAVE_STRONG_GETAUXVAL ) message ( STATUS "cpu_feautures has getauxval from sys/auxv.h" ) - target_compile_definitions ( graphblas PRIVATE HAVE_STRONG_GETAUXVAL ) + target_compile_definitions ( GraphBLAS PRIVATE HAVE_STRONG_GETAUXVAL ) if ( NOT NSTATIC ) - target_compile_definitions ( graphblas_static PRIVATE HAVE_STRONG_GETAUXVAL ) + target_compile_definitions ( GraphBLAS_static PRIVATE HAVE_STRONG_GETAUXVAL ) endif ( ) else ( ) message ( STATUS "cpu_feautures doesn't have getauxval from sys/auxv.h" ) @@ -314,26 +323,29 @@ endif ( ) # libm: if ( NOT WIN32 ) set ( GB_M "m" ) - target_link_libraries ( graphblas PRIVATE m ) + target_link_libraries ( GraphBLAS PRIVATE m ) if ( NOT NSTATIC ) - target_link_libraries ( graphblas_static PUBLIC m ) + list ( APPEND GRAPHBLAS_STATIC_LIBS "m" ) + target_link_libraries ( GraphBLAS_static PUBLIC m ) endif ( ) endif ( ) # libdl if ( NOT WIN32 ) - target_link_libraries ( graphblas PRIVATE dl ) + target_link_libraries ( GraphBLAS PRIVATE dl ) if ( NOT NSTATIC ) - target_link_libraries ( graphblas_static PUBLIC dl ) + list ( APPEND GRAPHBLAS_STATIC_LIBS "dl" ) + target_link_libraries ( GraphBLAS_static PUBLIC dl ) endif ( ) endif ( ) # atomic include ( SuiteSparseAtomic ) if ( LIBATOMIC_REQUIRED ) - target_link_libraries ( graphblas PRIVATE atomic ) + target_link_libraries ( GraphBLAS PRIVATE atomic ) if ( NOT NSTATIC ) - target_link_libraries ( graphblas_static PUBLIC atomic ) + list ( APPEND GRAPHBLAS_STATIC_LIBS "atomic" ) + target_link_libraries ( GraphBLAS_static PUBLIC atomic ) endif ( ) endif ( ) @@ -345,15 +357,16 @@ if ( OPENMP_FOUND ) message ( STATUS "CMAKE OpenMP libraries: ${OpenMP_C_LIBRARIES}" ) message ( STATUS "CMAKE OpenMP include: ${OpenMP_C_INCLUDE_DIRS}" ) # revert to ${OpenMP_C_LIBRARIES}: - target_link_libraries ( graphblas PRIVATE ${OpenMP_C_LIBRARIES} ) + target_link_libraries ( GraphBLAS PRIVATE ${OpenMP_C_LIBRARIES} ) # cannot use OpenMP::OpenMP_C because the JIT is configured with # LINK_LIBRARIES. Those are -l lists passed directly to the # C compiler, and this is converted into "-lOpenMP::OpenMP_C". # So this breaks: - # target_link_libraries ( graphblas PRIVATE OpenMP::OpenMP_C ) + # target_link_libraries ( GraphBLAS PRIVATE OpenMP::OpenMP_C ) if ( NOT NSTATIC ) - target_link_libraries ( graphblas_static PUBLIC ${OpenMP_C_LIBRARIES} ) - # target_link_libraries ( graphblas_static PUBLIC OpenMP::OpenMP_C ) + list ( APPEND GRAPHBLAS_STATIC_LIBS ${OpenMP_C_LIBRARIES} ) + target_link_libraries ( GraphBLAS_static PUBLIC ${OpenMP_C_LIBRARIES} ) + # target_link_libraries ( GraphBLAS_static PUBLIC OpenMP::OpenMP_C ) endif ( ) message ( STATUS "CMAKE OpenMP C flags: ${OpenMP_C_FLAGS}" ) set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS} " ) @@ -379,15 +392,15 @@ else ( ) endif ( ) # get the current library list, before linking with cuda and rmm -get_target_property ( GB_CMAKE_LIBRARIES graphblas LINK_LIBRARIES ) +get_target_property ( GB_CMAKE_LIBRARIES GraphBLAS LINK_LIBRARIES ) if ( NOT GB_CMAKE_LIBRARIES ) set ( GB_CMAKE_LIBRARIES "" ) endif ( ) if ( SUITESPARSE_CUDA ) - target_link_libraries ( graphblas PRIVATE ${GB_CUDA} ${GB_RMM} ) + target_link_libraries ( GraphBLAS PRIVATE ${GB_CUDA} ${GB_RMM} ) if ( NOT NSTATIC ) - target_link_libraries ( graphblas_static PUBLIC ${GB_CUDA} ${GB_RMM} ) + target_link_libraries ( GraphBLAS_static PUBLIC ${GB_CUDA} ${GB_RMM} ) endif ( ) endif ( ) @@ -423,17 +436,17 @@ if ( DEMO ) add_executable ( gauss_demo "Demo/Program/gauss_demo.c" ) # Libraries required for Demo programs - target_link_libraries ( openmp_demo PUBLIC graphblas ${GB_M} ${GB_CUDA} ${GB_RMM} ) - target_link_libraries ( openmp2_demo PUBLIC graphblas ${GB_M} ${GB_CUDA} ${GB_RMM} ) - target_link_libraries ( complex_demo PUBLIC graphblas ${GB_M} ${GB_CUDA} ${GB_RMM} ) - target_link_libraries ( kron_demo PUBLIC graphblas ${GB_M} ${GB_CUDA} ${GB_RMM} ) + target_link_libraries ( openmp_demo PUBLIC GraphBLAS ${GB_M} ${GB_CUDA} ${GB_RMM} ) + target_link_libraries ( openmp2_demo PUBLIC GraphBLAS ${GB_M} ${GB_CUDA} ${GB_RMM} ) + target_link_libraries ( complex_demo PUBLIC GraphBLAS ${GB_M} ${GB_CUDA} ${GB_RMM} ) + target_link_libraries ( kron_demo PUBLIC GraphBLAS ${GB_M} ${GB_CUDA} ${GB_RMM} ) target_link_libraries ( simple_demo PUBLIC ${GB_M} ${GB_CUDA} ${GB_RMM} ) - target_link_libraries ( wildtype_demo PUBLIC graphblas ${GB_M} ${GB_CUDA} ${GB_RMM} ) - target_link_libraries ( reduce_demo PUBLIC graphblas ${GB_M} ${GB_CUDA} ${GB_RMM} ) - target_link_libraries ( import_demo PUBLIC graphblas ${GB_M} ${GB_CUDA} ${GB_RMM} ) - target_link_libraries ( wathen_demo PUBLIC graphblas ${GB_M} ${GB_CUDA} ${GB_RMM} ) - target_link_libraries ( context_demo PUBLIC graphblas ${GB_M} ${GB_CUDA} ${GB_RMM} ) - target_link_libraries ( gauss_demo PUBLIC graphblas ${GB_M} ${GB_CUDA} ${GB_RMM} ) + target_link_libraries ( wildtype_demo PUBLIC GraphBLAS ${GB_M} ${GB_CUDA} ${GB_RMM} ) + target_link_libraries ( reduce_demo PUBLIC GraphBLAS ${GB_M} ${GB_CUDA} ${GB_RMM} ) + target_link_libraries ( import_demo PUBLIC GraphBLAS ${GB_M} ${GB_CUDA} ${GB_RMM} ) + target_link_libraries ( wathen_demo PUBLIC GraphBLAS ${GB_M} ${GB_CUDA} ${GB_RMM} ) + target_link_libraries ( context_demo PUBLIC GraphBLAS ${GB_M} ${GB_CUDA} ${GB_RMM} ) + target_link_libraries ( gauss_demo PUBLIC GraphBLAS ${GB_M} ${GB_CUDA} ${GB_RMM} ) if ( OPENMP_FOUND ) target_link_libraries ( openmp_demo PUBLIC OpenMP::OpenMP_C ) target_link_libraries ( openmp2_demo PUBLIC OpenMP::OpenMP_C ) @@ -452,19 +465,97 @@ endif ( ) # installation location #------------------------------------------------------------------------------- -install ( TARGETS graphblas +include ( CMakePackageConfigHelpers ) + +install ( TARGETS GraphBLAS + EXPORT GraphBLASTargets LIBRARY DESTINATION ${SUITESPARSE_LIBDIR} ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} RUNTIME DESTINATION ${SUITESPARSE_BINDIR} PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} ) -install ( FILES ${CMAKE_SOURCE_DIR}/cmake_modules/FindGraphBLAS.cmake - DESTINATION ${SUITESPARSE_LIBDIR}/cmake/SuiteSparse - COMPONENT Development ) + if ( NOT NSTATIC ) - install ( TARGETS graphblas_static + install ( TARGETS GraphBLAS_static + EXPORT GraphBLASTargets ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} ) endif ( ) +# create (temporary) export target file during build +export ( EXPORT GraphBLASTargets + NAMESPACE SuiteSparse:: + FILE ${CMAKE_CURRENT_BINARY_DIR}/GraphBLASTargets.cmake ) + +# install export target and config for find_package +install ( EXPORT GraphBLASTargets + NAMESPACE SuiteSparse:: + DESTINATION ${SUITESPARSE_LIBDIR}/cmake/GraphBLAS ) + +configure_package_config_file ( + Config/GraphBLASConfig.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/GraphBLASConfig.cmake + INSTALL_DESTINATION ${SUITESPARSE_LIBDIR}/cmake/GraphBLAS ) + +write_basic_package_version_file ( + ${CMAKE_CURRENT_BINARY_DIR}/GraphBLASConfigVersion.cmake + COMPATIBILITY SameMajorVersion ) + +install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/GraphBLASConfig.cmake + ${CMAKE_CURRENT_BINARY_DIR}/GraphBLASConfigVersion.cmake + DESTINATION ${SUITESPARSE_LIBDIR}/cmake/GraphBLAS ) + +#------------------------------------------------------------------------------- +# create pkg-config file +#------------------------------------------------------------------------------- + +if ( NOT MSVC ) + # This might be something like: + # /usr/lib/libgomp.so;/usr/lib/libpthread.a;m + # convert to -l flags for pkg-config, i.e.: "-lgomp -lpthread -lm" + set ( GRAPHBLAS_STATIC_LIBS_LIST ${GRAPHBLAS_STATIC_LIBS} ) + set ( GRAPHBLAS_STATIC_LIBS "" ) + foreach ( _lib ${GRAPHBLAS_STATIC_LIBS_LIST} ) + string ( FIND ${_lib} "." _pos REVERSE ) + if ( ${_pos} EQUAL "-1" ) + set ( GRAPHBLAS_STATIC_LIBS "${GRAPHBLAS_STATIC_LIBS} -l${_lib}" ) + continue () + endif ( ) + foreach ( _kind IN ITEMS "IMPORT" "SHARED" "STATIC" ) + set ( _regex ".*\\/(lib)?([^\\.]*)(${CMAKE_${_kind}_LIBRARY_SUFFIX})" ) + if ( ${_lib} MATCHES ${_regex} ) + string ( REGEX REPLACE ${_regex} "\\2" _libname ${_lib} ) + if ( NOT "${_libname}" STREQUAL "" ) + set ( GRAPHBLAS_STATIC_LIBS "${GRAPHBLAS_STATIC_LIBS} -l${_libname}" ) + break () + endif ( ) + endif ( ) + endforeach ( ) + endforeach ( ) + + set ( prefix "${CMAKE_INSTALL_PREFIX}" ) + set ( exec_prefix "\${prefix}" ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) + if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) + set ( libdir "${SUITESPARSE_LIBDIR}") + else ( ) + set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") + endif ( ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) + if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) + set ( includedir "${SUITESPARSE_INCLUDEDIR}") + else ( ) + set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + endif ( ) + configure_file ( + Config/GraphBLAS.pc.in + GraphBLAS.pc + @ONLY + NEWLINE_STYLE LF ) + install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/GraphBLAS.pc + DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) +endif ( ) + #------------------------------------------------------------------------------- # configure the JITs #------------------------------------------------------------------------------- @@ -503,4 +594,3 @@ endif ( ) #------------------------------------------------------------------------------- include ( SuiteSparseReport ) - diff --git a/GraphBLAS/CUDA/CMakeLists.txt b/GraphBLAS/CUDA/CMakeLists.txt index 05ffe03d2..1195a9e0c 100644 --- a/GraphBLAS/CUDA/CMakeLists.txt +++ b/GraphBLAS/CUDA/CMakeLists.txt @@ -180,14 +180,14 @@ set_target_properties(graphblascuda_test PROPERTIES CUDA_ARCHITECTURES "52;75;80 include(GoogleTest) -add_dependencies(graphblascuda_test graphblas) +add_dependencies(graphblascuda_test GraphBLAS) add_dependencies(graphblascuda_test graphblascuda) add_dependencies(graphblascuda_test gtest_main) add_dependencies(graphblascuda_test rmm_wrap) target_link_libraries(graphblascuda_test PUBLIC - graphblas + GraphBLAS graphblascuda rmm_wrap CUDA::cudart_static diff --git a/GraphBLAS/Config/GraphBLAS.pc.in b/GraphBLAS/Config/GraphBLAS.pc.in new file mode 100644 index 000000000..a9aa4d302 --- /dev/null +++ b/GraphBLAS/Config/GraphBLAS.pc.in @@ -0,0 +1,18 @@ +# GraphBLAS, Copyright (c) 2017-2023, Timothy A. Davis. +# All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +# FIXME: Which flags do we need to statically link CUDA? + +Name: GraphBLAS +URL: https://github.com/DrTimothyAldenDavis/SuiteSparse +Description: Complete implementation of the GraphBLAS standard in SuiteSparse +Version: @GraphBLAS_VERSION_MAJOR@.@GraphBLAS_VERSION_MINOR@.@GraphBLAS_VERSION_SUB@ +Libs: -L${libdir} -lgraphblas +Libs.private: @GRAPHBLAS_STATIC_LIBS@ +Cflags: -I${includedir} diff --git a/GraphBLAS/Config/GraphBLASConfig.cmake.in b/GraphBLAS/Config/GraphBLASConfig.cmake.in new file mode 100644 index 000000000..0f9241834 --- /dev/null +++ b/GraphBLAS/Config/GraphBLASConfig.cmake.in @@ -0,0 +1,121 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/GraphBLAS/cmake_modules/GraphBLASConfig.cmake +#------------------------------------------------------------------------------- + +# The following copyright and license applies to just this file only, not to +# the library itself: +# GraphBLASConfig.cmake, Copyright (c) 2023, Timothy A. Davis. All Rights Reserved. +# SPDX-License-Identifier: BSD-3-clause + +#------------------------------------------------------------------------------- + +# Finds the GraphBLAS include file and compiled library. +# The following targets are defined: +# SuiteSparse::GraphBLAS - for the shared library (if available) +# SuiteSparse::GraphBLAS_static - for the static library (if available) + +# For backward compatibility the following variables are set: + +# GRAPHBLAS_INCLUDE_DIR - where to find GraphBLAS.h, etc. +# GRAPHBLAS_LIBRARY - dynamic GraphBLAS library +# GRAPHBLAS_STATIC - static GraphBLAS library +# GRAPHBLAS_LIBRARIES - libraries when using GraphBLAS +# GRAPHBLAS_FOUND - true if GraphBLAS found + +# Set ``CMAKE_MODULE_PATH`` to the parent folder where this module file is +# installed. + +#------------------------------------------------------------------------------- + +@PACKAGE_INIT@ + +set ( GRAPHBLAS_DATE "@GraphBLAS_DATE@" ) +set ( GRAPHBLAS_VERSION_MAJOR @GraphBLAS_VERSION_MAJOR@ ) +set ( GRAPHBLAS_VERSION_MINOR @GraphBLAS_VERSION_MINOR@ ) +set ( GRAPHBLAS_VERSION_PATCH @GraphBLAS_VERSION_SUB@ ) +set ( GRAPHBLAS_VERSION "@GraphBLAS_VERSION_MAJOR@.@GraphBLAS_VERSION_MINOR@.@GraphBLAS_VERSION_SUB@" ) + +include ( ${CMAKE_CURRENT_LIST_DIR}/GraphBLASTargets.cmake ) + +# The following is only for backward compatibility with FindGraphBLAS. + +set ( _target_shared SuiteSparse::GraphBLAS ) +set ( _target_static SuiteSparse::GraphBLAS_static ) +set ( _var_prefix "GRAPHBLAS" ) + +get_target_property ( ${_var_prefix}_INCLUDE_DIR ${_target_shared} INTERFACE_INCLUDE_DIRECTORIES ) +if ( ${_var_prefix}_INCLUDE_DIR ) + # First item in SuiteSparse targets contains the "main" header directory. + list ( GET ${_var_prefix}_INCLUDE_DIR 0 ${_var_prefix}_INCLUDE_DIR ) +endif ( ) +get_target_property ( ${_var_prefix}_LIBRARY ${_target_shared} IMPORTED_IMPLIB ) +if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} IMPORTED_LOCATION ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) +endif ( ) +if ( TARGET ${_target_static} ) + get_target_property ( ${_var_prefix}_STATIC ${_target_static} IMPORTED_LOCATION ) +endif ( ) + +# Check for most common build types +set ( _config_types "Debug" "Release" "RelWithDebInfo" "MinSizeRel" ) + +get_property ( _isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG ) +if ( _isMultiConfig ) + # For multi-configuration generators (e.g., Visual Studio), prefer those + # configurations. + list ( PREPEND _config_types ${CMAKE_CONFIGURATION_TYPES} ) +else ( ) + # For single-configuration generators, prefer the current configuration. + list ( PREPEND _config_types ${CMAKE_BUILD_TYPE} ) +endif ( ) + +list ( REMOVE_DUPLICATES _config_types ) + +foreach ( _config ${_config_types} ) + string ( TOUPPER ${_config} _uc_config ) + if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} + IMPORTED_IMPLIB_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) + endif ( ) + if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} + IMPORTED_LOCATION_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) + endif ( ) + if ( TARGET ${_target_static} AND NOT ${_var_prefix}_STATIC ) + get_target_property ( _library_chk ${_target_static} + IMPORTED_LOCATION_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_STATIC ${_library_chk} ) + endif ( ) + endif ( ) +endforeach ( ) + +set ( GRAPHBLAS_LIBRARIES ${GRAPHBLAS_LIBRARY} ) + +macro ( suitesparse_check_exist _var _files ) + # ignore generator expressions + string ( GENEX_STRIP "${_files}" _files2 ) + + foreach ( _file ${_files2} ) + if ( NOT EXISTS "${_file}" ) + message ( FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist!" ) + endif ( ) + endforeach () +endmacro ( ) + +suitesparse_check_exist ( GRAPHBLAS_INCLUDE_DIR ${GRAPHBLAS_INCLUDE_DIR} ) +suitesparse_check_exist ( GRAPHBLAS_LIBRARY ${GRAPHBLAS_LIBRARY} ) + +message ( STATUS "GraphBLAS version: ${GRAPHBLAS_VERSION}" ) +message ( STATUS "GraphBLAS include: ${GRAPHBLAS_INCLUDE_DIR}" ) +message ( STATUS "GraphBLAS library: ${GRAPHBLAS_LIBRARY}" ) +message ( STATUS "GraphBLAS static: ${GRAPHBLAS_STATIC}" ) diff --git a/GraphBLAS/Config/README.md.in b/GraphBLAS/Config/README.md.in index 89cb69124..cac5d08ba 100644 --- a/GraphBLAS/Config/README.md.in +++ b/GraphBLAS/Config/README.md.in @@ -199,8 +199,44 @@ McGinnis, kmcginnis@txamfoundation.com) for details. SuiteSparse:GraphBLAS, is copyrighted by Timothy A. Davis, (c) 2017-2023, All Rights Reserved. davis@tamu.edu. +----------------------------------------------------------------------------- + +## For distro maintainers (Linux, homebrew, spack, R, Octave, Trilinos, ...): + +Thanks for packaging SuiteSparse! Here are some suggestions: + + * GraphBLAS takes a long time to compile because it creates many fast + "FactoryKernels" at compile-time. If you want to reduce the compile + time and library size, enable the COMPACT mode, but keep the JIT + enabled. Then GraphBLAS will compile the kernels it needs at run-time, + via its JIT. Performance will be the same as the FactoryKernels once + the JIT kernels are compiled. User compiled kernels are placed in + ~/.SuiteSparse, by default. You do not need to distribute the source + for GraphBLAS to enable the JIT: just libgraphblas.so and GraphBLAS.h + is enough. + + * GraphBLAS needs OpenMP! It's fundamentally a parallel code so please + distribute it with OpenMP enabled. Performance will suffer + otherwise. + -------------------------------------------------------------------------------- +## References: + +To cite this package, please use the following: + + T. Davis, Algorithm 10xx: SuiteSparse:GraphBLAS: parallel graph + algorithms in the language of sparse linear algebra, ACM Trans on + Mathematical Software, just acceped, 2023. See the pdf in + https://github.com/DrTimothyAldenDavis/GraphBLAS/tree/stable/Doc . + https://doi.org/10.1145/3577195 + + T. Davis, Algorithm 1000: SuiteSparse:GraphBLAS: graph algorithms in + the language of sparse linear algebra, ACM Trans on Mathematical + Software, vol 45, no 4, Dec. 2019, Article No 44. + https://doi.org/10.1145/3322125. + +-------------------------------------------------------------------------------- ## Software Acknowledgements SuiteSparse:GraphBLAS relies on the following packages (details in the LICENSE diff --git a/GraphBLAS/Demo/Output/complex_demo_out2.m b/GraphBLAS/Demo/Output/complex_demo_out2.m new file mode 100644 index 000000000..e9e9a8785 --- /dev/null +++ b/GraphBLAS/Demo/Output/complex_demo_out2.m @@ -0,0 +1,51 @@ + +% run this output of this program as a script: + +% GraphBLAS matrix A: nrows: 3 ncols 5 entries: 10 +A = sparse (3,5) ; + A (1,2) = ( 0) + ( 0.8253972948485638)*1i ; + A (1,3) = ( 0.8158771738902956) + ( 0.6199473944886393)*1i ; + A (1,4) = ( 0.230335927869842) + ( 0)*1i ; + A (1,5) = ( 0.6834455780600209) + ( 0)*1i ; + A (2,1) = ( 0) + ( 0.8145545554415048)*1i ; + A (2,2) = ( 0) + ( 0.8106511441383925)*1i ; + A (2,3) = ( 0) + ( 0.6296551667948371)*1i ; + A (2,4) = ( 0.6749993971837149) + ( 0.1028046574093258)*1i ; + A (2,5) = ( 0.1781985185630041) + ( 0)*1i ; + A (3,1) = ( 0.6668132827629559) + ( 0)*1i ; +A + +% GraphBLAS matrix B: nrows: 5 ncols 4 entries: 13 +B = sparse (5,4) ; + B (1,1) = ( 0.03470661760412896) + ( 0)*1i ; + B (1,2) = ( 0.2320846810101108) + ( 0)*1i ; + B (1,4) = ( 0.4037695773165162) + ( 0)*1i ; + B (2,1) = ( 0) + ( 0.70501889367129)*1i ; + B (2,3) = ( 0.2114568817022959) + ( 0)*1i ; + B (2,4) = ( 0) + ( 0.4423346124115619)*1i ; + B (3,1) = ( 0.929676618909714) + ( 0)*1i ; + B (3,2) = ( 0.03154825424997802) + ( 0)*1i ; + B (3,3) = ( 0) + ( 0.1598994553484671)*1i ; + B (3,4) = ( 0.9813322475732387) + ( 0.9048904118202962)*1i ; + B (4,1) = ( 0) + ( 0.9376008381429164)*1i ; + B (4,4) = ( 0) + ( 0.8269171297987302)*1i ; + B (5,4) = ( 0.1371733231185191) + ( 0)*1i ; +B + +% GraphBLAS matrix C: nrows: 3 ncols 4 entries: 11 +C = sparse (3,4) ; + C (1,1) = ( 0.1765812448145327) + ( 0.7923137566352751)*1i ; + C (1,2) = ( 0.02573950051864457) + ( 0.01955825802293901)*1i ; + C (1,3) = (-0.09912925072343469) + ( 0.3049942538704926)*1i ; + C (1,4) = (-0.03168916369751931) + ( 1.537122526250736)*1i ; + C (2,1) = ( -0.6679141057457941) + ( 1.24652612056368)*1i ; + C (2,2) = ( 0) + ( 0.2089101554568301)*1i ; + C (2,3) = ( -0.1006815182278427) + ( 0.1714177630879029)*1i ; + C (2,4) = ( -0.9889148320979797) + ( 1.50496183271377)*1i ; + C (3,1) = ( 0.02314283361820783) + ( 0)*1i ; + C (3,2) = ( 0.1547571480233455) + ( 0)*1i ; + C (3,4) = ( 0.2692389173302374) + ( 0)*1i ; +C +E = A*B +err = norm (C-E,1) +assert (err < 1e-12) diff --git a/GraphBLAS/Demo/Output/gauss_demo.out b/GraphBLAS/Demo/Output/gauss_demo.out index df86ba0b8..c44ba2ed8 100644 --- a/GraphBLAS/Demo/Output/gauss_demo.out +++ b/GraphBLAS/Demo/Output/gauss_demo.out @@ -2,36 +2,107 @@ Gauss demo. Note that all transposes are array transposes, not matrix (conjugate) transposes. - GraphBLAS Context: GxB_CONTEXT_WORLD - Context.nthreads: 8 + GraphBLAS Context: World + Context.nthreads: 40 Context.chunk: 65536 JIT configuration: ------------------ -JIT C compiler: [/usr/bin/gcc] +JIT C compiler: [/usr/bin/cc] JIT C flags: [ -Wundef -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -O3 -DNDEBUG -fopenmp -fPIC ] JIT C link flags: [ -shared ] -JIT C libraries: [ -lm -ldl /usr/lib/gcc/x86_64-linux-gnu/7/libgomp.so /usr/lib/x86_64-linux-gnu/libpthread.so] +JIT C libraries: [ -lm -ldl /usr/lib/gcc/x86_64-linux-gnu/9/libgomp.so /usr/lib/x86_64-linux-gnu/libpthread.so] JIT C preface: [] -JIT cache: [/home/davis/.SuiteSparse/GraphBLAS/8.0.0] +JIT cache: [/home/faculty/d/davis/.SuiteSparse/GrB8.2.0] +JIT C control: [4] +JIT C control: [4] reset ------------------------------------- JIT C preface (revised): // kernel generated by gauss_demo.c #include - [ GxB_Type_new (jit: loaded but must recompile) (jit: compile and load) (jit: /usr/bin/gcc -DGB_JIT_RUNTIME=1 -Wundef -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -O3 -DNDEBUG -fopenmp -fPIC -I/home/davis/.SuiteSparse/GraphBLAS/8.0.0/src -o /home/davis/.SuiteSparse/GraphBLAS/8.0.0/c/b4/GB_jit__user_type__0__gauss.o -c /home/davis/.SuiteSparse/GraphBLAS/8.0.0/c/b4/GB_jit__user_type__0__gauss.c ; /usr/bin/gcc -Wundef -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -O3 -DNDEBUG -fopenmp -fPIC -shared -o /home/davis/.SuiteSparse/GraphBLAS/8.0.0/lib/b4/libGB_jit__user_type__0__gauss.so /home/davis/.SuiteSparse/GraphBLAS/8.0.0/c/b4/GB_jit__user_type__0__gauss.o -lm -ldl /usr/lib/gcc/x86_64-linux-gnu/7/libgomp.so /usr/lib/x86_64-linux-gnu/libpthread.so ) - 0.0696 sec ] + [ GxB_Type_new (jit: loaded but must recompile) (jit: compile and load) (jit: cmake) +-- The C compiler identification is GNU 9.4.0 +-- Detecting C compiler ABI info +-- Detecting C compiler ABI info - done +-- Check for working C compiler: /usr/bin/cc - skipped +-- Detecting C compile features +-- Detecting C compile features - done +-- Configuring done (0.3s) +-- Generating done (0.0s) +-- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/ce2be202506bf1b4 +make[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/ce2be202506bf1b4' +make[2]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/ce2be202506bf1b4' +make[3]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/ce2be202506bf1b4' +make[3]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/ce2be202506bf1b4' +make[3]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/ce2be202506bf1b4' +[ 50%] Building C object CMakeFiles/GB_jit__user_type__0__gauss.dir/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/c/b4/GB_jit__user_type__0__gauss.c.o +[100%] Linking C shared library libGB_jit__user_type__0__gauss.so +make[3]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/ce2be202506bf1b4' +[100%] Built target GB_jit__user_type__0__gauss +make[2]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/ce2be202506bf1b4' +make[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/ce2be202506bf1b4' +-- Install configuration: "" +-- Installing: /home/faculty/d/davis/.SuiteSparse/GrB8.2.0/lib/b4/libGB_jit__user_type__0__gauss.so + + 0.558 sec ] GraphBLAS type: BadGauss user-defined: [gauss] size: 4 typedef struct { int32_t real ; } gauss ; - [ GxB_Type_new (jit: type changed) (jit: loaded but must recompile) (jit: compile and load) (jit: /usr/bin/gcc -DGB_JIT_RUNTIME=1 -Wundef -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -O3 -DNDEBUG -fopenmp -fPIC -I/home/davis/.SuiteSparse/GraphBLAS/8.0.0/src -o /home/davis/.SuiteSparse/GraphBLAS/8.0.0/c/b4/GB_jit__user_type__0__gauss.o -c /home/davis/.SuiteSparse/GraphBLAS/8.0.0/c/b4/GB_jit__user_type__0__gauss.c ; /usr/bin/gcc -Wundef -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -O3 -DNDEBUG -fopenmp -fPIC -shared -o /home/davis/.SuiteSparse/GraphBLAS/8.0.0/lib/b4/libGB_jit__user_type__0__gauss.so /home/davis/.SuiteSparse/GraphBLAS/8.0.0/c/b4/GB_jit__user_type__0__gauss.o -lm -ldl /usr/lib/gcc/x86_64-linux-gnu/7/libgomp.so /usr/lib/x86_64-linux-gnu/libpthread.so ) - 0.0515 sec ] + [ GxB_Type_new (jit: type changed) (jit: loaded but must recompile) (jit: compile and load) (jit: cmake) +-- The C compiler identification is GNU 9.4.0 +-- Detecting C compiler ABI info +-- Detecting C compiler ABI info - done +-- Check for working C compiler: /usr/bin/cc - skipped +-- Detecting C compile features +-- Detecting C compile features - done +-- Configuring done (0.3s) +-- Generating done (0.0s) +-- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/ce2be202506bf1b4 +make[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/ce2be202506bf1b4' +make[2]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/ce2be202506bf1b4' +make[3]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/ce2be202506bf1b4' +make[3]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/ce2be202506bf1b4' +make[3]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/ce2be202506bf1b4' +[ 50%] Building C object CMakeFiles/GB_jit__user_type__0__gauss.dir/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/c/b4/GB_jit__user_type__0__gauss.c.o +[100%] Linking C shared library libGB_jit__user_type__0__gauss.so +make[3]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/ce2be202506bf1b4' +[100%] Built target GB_jit__user_type__0__gauss +make[2]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/ce2be202506bf1b4' +make[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/ce2be202506bf1b4' +-- Install configuration: "" +-- Installing: /home/faculty/d/davis/.SuiteSparse/GrB8.2.0/lib/b4/libGB_jit__user_type__0__gauss.so + + 0.559 sec ] GraphBLAS type: Gauss user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; - [ GxB_Type_new (jit: type ok) - 5.29e-06 sec ] + [ GxB_Type_new + 8.5e-06 sec ] GraphBLAS type: Gauss user-defined: [gauss] size: 8 typedef struct { int32_t real ; int32_t imag ; } gauss ; - [ GxB_BinaryOp_new (jit: loaded but must recompile) (jit: compile and load) (jit: /usr/bin/gcc -DGB_JIT_RUNTIME=1 -Wundef -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -O3 -DNDEBUG -fopenmp -fPIC -I/home/davis/.SuiteSparse/GraphBLAS/8.0.0/src -o /home/davis/.SuiteSparse/GraphBLAS/8.0.0/c/1b/GB_jit__user_op__0__addgauss.o -c /home/davis/.SuiteSparse/GraphBLAS/8.0.0/c/1b/GB_jit__user_op__0__addgauss.c ; /usr/bin/gcc -Wundef -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -O3 -DNDEBUG -fopenmp -fPIC -shared -o /home/davis/.SuiteSparse/GraphBLAS/8.0.0/lib/1b/libGB_jit__user_op__0__addgauss.so /home/davis/.SuiteSparse/GraphBLAS/8.0.0/c/1b/GB_jit__user_op__0__addgauss.o -lm -ldl /usr/lib/gcc/x86_64-linux-gnu/7/libgomp.so /usr/lib/x86_64-linux-gnu/libpthread.so ) - 0.0564 sec ] + [ GxB_BinaryOp_new (jit: loaded but must recompile) (jit: compile and load) (jit: cmake) +-- The C compiler identification is GNU 9.4.0 +-- Detecting C compiler ABI info +-- Detecting C compiler ABI info - done +-- Check for working C compiler: /usr/bin/cc - skipped +-- Detecting C compile features +-- Detecting C compile features - done +-- Configuring done (0.3s) +-- Generating done (0.0s) +-- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/af7c00a52397011b +make[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/af7c00a52397011b' +make[2]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/af7c00a52397011b' +make[3]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/af7c00a52397011b' +make[3]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/af7c00a52397011b' +make[3]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/af7c00a52397011b' +[ 50%] Building C object CMakeFiles/GB_jit__user_op__0__addgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/c/1b/GB_jit__user_op__0__addgauss.c.o +[100%] Linking C shared library libGB_jit__user_op__0__addgauss.so +make[3]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/af7c00a52397011b' +[100%] Built target GB_jit__user_op__0__addgauss +make[2]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/af7c00a52397011b' +make[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/af7c00a52397011b' +-- Install configuration: "" +-- Installing: /home/faculty/d/davis/.SuiteSparse/GrB8.2.0/lib/1b/libGB_jit__user_op__0__addgauss.so + + 0.55 sec ] GraphBLAS BinaryOp: BadAddGauss (user-defined): z=addgauss(x,y) GraphBLAS type: ztype user-defined: [gauss] size: 8 @@ -45,8 +116,31 @@ void addgauss (gauss *z, const gauss *x, const gauss *y) z->real = x->real + y->real ; z->imag = -911 ; } - [ GxB_BinaryOp_new (jit: op changed) (jit: loaded but must recompile) (jit: compile and load) (jit: /usr/bin/gcc -DGB_JIT_RUNTIME=1 -Wundef -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -O3 -DNDEBUG -fopenmp -fPIC -I/home/davis/.SuiteSparse/GraphBLAS/8.0.0/src -o /home/davis/.SuiteSparse/GraphBLAS/8.0.0/c/1b/GB_jit__user_op__0__addgauss.o -c /home/davis/.SuiteSparse/GraphBLAS/8.0.0/c/1b/GB_jit__user_op__0__addgauss.c ; /usr/bin/gcc -Wundef -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -O3 -DNDEBUG -fopenmp -fPIC -shared -o /home/davis/.SuiteSparse/GraphBLAS/8.0.0/lib/1b/libGB_jit__user_op__0__addgauss.so /home/davis/.SuiteSparse/GraphBLAS/8.0.0/c/1b/GB_jit__user_op__0__addgauss.o -lm -ldl /usr/lib/gcc/x86_64-linux-gnu/7/libgomp.so /usr/lib/x86_64-linux-gnu/libpthread.so ) - 0.063 sec ] + [ GxB_BinaryOp_new (jit: op changed) (jit: loaded but must recompile) (jit: compile and load) (jit: cmake) +-- The C compiler identification is GNU 9.4.0 +-- Detecting C compiler ABI info +-- Detecting C compiler ABI info - done +-- Check for working C compiler: /usr/bin/cc - skipped +-- Detecting C compile features +-- Detecting C compile features - done +-- Configuring done (0.3s) +-- Generating done (0.0s) +-- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/af7c00a52397011b +make[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/af7c00a52397011b' +make[2]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/af7c00a52397011b' +make[3]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/af7c00a52397011b' +make[3]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/af7c00a52397011b' +make[3]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/af7c00a52397011b' +[ 50%] Building C object CMakeFiles/GB_jit__user_op__0__addgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/c/1b/GB_jit__user_op__0__addgauss.c.o +[100%] Linking C shared library libGB_jit__user_op__0__addgauss.so +make[3]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/af7c00a52397011b' +[100%] Built target GB_jit__user_op__0__addgauss +make[2]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/af7c00a52397011b' +make[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/af7c00a52397011b' +-- Install configuration: "" +-- Installing: /home/faculty/d/davis/.SuiteSparse/GrB8.2.0/lib/1b/libGB_jit__user_op__0__addgauss.so + + 0.556 sec ] GraphBLAS BinaryOp: AddGauss (user-defined): z=addgauss(x,y) GraphBLAS type: ztype user-defined: [gauss] size: 8 @@ -60,8 +154,8 @@ void addgauss (gauss *z, const gauss *x, const gauss *y) z->real = x->real + y->real ; z->imag = x->imag + y->imag ; } - [ GxB_BinaryOp_new (jit: op ok) - 3.27e-06 sec ] + [ GxB_BinaryOp_new + 8.21e-06 sec ] GraphBLAS BinaryOp: AddGauss (user-defined): z=addgauss(x,y) GraphBLAS type: ztype user-defined: [gauss] size: 8 @@ -147,11 +241,11 @@ row 2: ( 3, 2) ( 3, 1) ( 3, 0) ( 3, -1) row 3: ( 4, 2) ( 4, 1) ( 4, 0) ( 4, -1) [ GrB_reduce (A bitmap) (jit: load) - 5.75e-05 sec ] + 0.00019 sec ] sum (A) = (39,6) [ GrB_mxm C=A*B, saxpy (B = B*B, anz: 15 bnz: 15) (bitmap saxpy) (jit: load) (bitmap to full) - 9.17e-05 sec ] + 0.000272 sec ] =============== Gauss A = A^2 matrix: @@ -163,7 +257,7 @@ row 2: ( 27, 16) ( 28, 12) ( 30, 0) ( 32, -12) row 3: ( 36, 22) ( 38, 16) ( 40, 0) ( 42, -16) [ GrB_reduce (A full) (jit: load) - 3.59e-05 sec ] + 0.00014 sec ] sum (A^2) = (387,46) @@ -176,11 +270,11 @@ row 2: . . . . row 3: . . . . [ GxB_set (full to sparse) - 4.51e-06 sec ] + 2.01e-05 sec ] [ GxB_set (hyper to sparse) - 3.22e-06 sec ] + 1.01e-05 sec ] [ GrB_mxm (iso mask: struct) (iso wait:M 0 zombies, 4 pending) (iso build) (hyper to sparse) C=A'*B, masked_dot_product (dot3) (S{S} = Sf'*Sf) nthreads 1 ntasks 1 (jit: load) (sparse to bitmap) - 7.75e-05 sec ] + 0.000288 sec ] =============== Gauss C = diag(AA') matrix: @@ -192,11 +286,11 @@ row 2: . . (2893, 768) . row 3: . . . (5108,1456) [ GxB_set - 1.69e-07 sec ] + 6.22e-07 sec ] [ GxB_set (hyper to sparse) - 1.62e-06 sec ] + 7.46e-06 sec ] [ GrB_select (A dense) - 1.69e-05 sec ] + 4.13e-05 sec ] Gauss D matrix @@ -207,7 +301,7 @@ row 2: . . ( 30, 0) . row 3: . . . ( 42, -16) [ GrB_mxm C=A*B, colscale (Sf=Sf*S) (jit: load) - 4.63e-05 sec ] + 0.000182 sec ] =============== Gauss C = D*A matrix: @@ -219,9 +313,9 @@ row 2: ( 810, 480) ( 840, 360) ( 900, 0) ( 960,-360) row 3: (1864, 348) (1852, 64) (1680,-640) (1508,-1344) [ GxB_set - 1.23e-07 sec ] + 4.58e-07 sec ] [ GxB_set (sparse to bitmap) - 2.44e-06 sec ] + 9.91e-06 sec ] Gauss D matrix (bitmap) @@ -242,7 +336,7 @@ row 3: . . . ( 42, -16) (3,3) [user-defined value] [ GxB_set (bitmap to sparse) - 4.22e-06 sec ] + 1.44e-05 sec ] Gauss D matrix (back to sparse) @@ -263,7 +357,7 @@ row 3: . . . ( 42, -16) (3,3) [user-defined value] [ GrB_mxm C=A*B, rowscale (Sf=S*Sf) (jit: load) - 4.5e-05 sec ] + 0.000179 sec ] =============== Gauss C = A*D matrix: @@ -275,7 +369,7 @@ row 2: ( 179, 252) ( 408, 440) ( 900, 0) (1152,-1016) row 3: ( 236, 342) ( 556, 592) (1200, 0) (1508,-1344) [ GrB_assign (C iso assign) (pending: 0) Method 21: (C full) = scalar - 1.45e-05 sec ] + 3.29e-05 sec ] =============== Gauss C = (1,-2) matrix: @@ -297,7 +391,7 @@ row 2: ( 27, 16) ( 28, 12) ( 30, 0) ( 32, -12) row 3: ( 36, 22) ( 38, 16) ( 40, 0) ( 42, -16) [ GrB_mxm C=A'*B, dot_product (dot4: F += Sf'*Sf) (jit: load) (C in place) - 4.39e-05 sec ] + 0.000174 sec ] =============== Gauss C += A*A' matrix: @@ -309,7 +403,7 @@ row 2: ( 918, 58) (1943, 476) (2894, 766) (3845,1056) row 3: (1221, 88) (2581, 658) (3845,1056) (5109,1454) [ GrB_assign (C iso assign) (pending: 0) Method 21: (C full) = scalar - 4.84e-06 sec ] + 1.97e-05 sec ] =============== Gauss B = (1,-2) matrix: @@ -321,7 +415,7 @@ row 2: ( 1, -2) ( 1, -2) ( 1, -2) ( 1, -2) row 3: ( 1, -2) ( 1, -2) ( 1, -2) ( 1, -2) [ GrB_mxm C=A*B, saxpy (saxpy4: F += Sf*F) (coarse, threads: 1) (jit: load) (C in place) - 5.1e-05 sec ] + 0.000194 sec ] =============== Gauss C += B*A: @@ -333,7 +427,7 @@ row 2: (1112, -70) (2110, 327) (2989, 566) (3868, 805) row 3: (1415, -40) (2748, 509) (3940, 856) (5132,1203) [ GrB_mxm C=A*B, saxpy (saxpy5: F += F*Sf) (jit: load) (C in place) - 4.18e-05 sec ] + 0.000171 sec ] =============== Gauss C += A*B: @@ -345,7 +439,7 @@ row 2: (1261,-288) (2259, 109) (3138, 348) (4017, 587) row 3: (1615,-330) (2948, 219) (4140, 566) (5332, 913) [ GrB_apply (shallow-op) (jit: load) - 4.27e-05 sec ] + 0.00016 sec ] =============== Gauss C = (1,-2) + A: @@ -357,7 +451,7 @@ row 2: ( 28, 14) ( 29, 10) ( 31, -2) ( 33, -14) row 3: ( 37, 20) ( 39, 14) ( 41, -2) ( 43, -18) [ GrB_apply (shallow-op) (jit: load) - 3.71e-05 sec ] + 0.000174 sec ] =============== Gauss C = A*(1,-2): @@ -369,7 +463,7 @@ row 2: ( 59, -38) ( 52, -44) ( 30, -60) ( 8, -76) row 3: ( 80, -50) ( 70, -60) ( 40, -80) ( 10,-100) [ GrB_apply (transpose-op) (transpose) (1-thread bucket transpose) (jit: load) (full to sparse) - 5.88e-05 sec ] + 0.000196 sec ] =============== Gauss C = A'*(1,-2): @@ -381,7 +475,7 @@ row 2: ( 5, -20) ( 20, -40) ( 30, -60) ( 40, -80) row 3: ( -1, -23) ( 6, -52) ( 8, -76) ( 10,-100) [ GrB_apply (transpose-op) (transpose) (1-thread bucket transpose) (jit: load) (full to sparse) - 3.92e-05 sec ] + 0.000162 sec ] =============== Gauss C = (1,-2)*A': @@ -402,7 +496,7 @@ void realgauss (int32_t *z, const gauss *x) (*z) = x->real ; } [ GrB_apply (shallow-op) (jit: load) - 3.85e-05 sec ] + 0.000159 sec ] 4x4 GraphBLAS int32_t matrix, full by row R, 16 entries, memory: 280 bytes @@ -435,7 +529,7 @@ row 2: ( 5, -20) ( 20, -40) ( 30, -60) ( 40, -80) row 3: ( -1, -23) ( 6, -52) ( 8, -76) ( 10,-100) [ GrB_apply (transpose-op) (transpose) (bitmap/full transpose) (jit: load) - 3.78e-05 sec ] + 0.000181 sec ] 4x4 GraphBLAS int32_t matrix, full by row R, 16 entries, memory: 280 bytes @@ -458,6 +552,7 @@ row 3: ( -1, -23) ( 6, -52) ( 8, -76) ( 10,-100) (3,3) 10 + =============== C size: 4-by-4 @@ -467,7 +562,7 @@ row 2: ( 5, -20) ( 20, -40) ( 30, -60) ( 40, -80) row 3: ( -1, -23) ( 6, -52) ( 8, -76) ( 10,-100) [ GrB_apply (shallow-op) (jit: load) - 3.69e-05 sec ] + 0.000156 sec ] R = ijgauss (C) @@ -492,7 +587,7 @@ R = ijgauss (C) (3,3) 11 [ GrB_Matrix_extractTuples (A full) - 1.09e-05 sec ] + 4.21e-05 sec ] R (0,0) = 18 R (0,1) = 38 R (0,2) = 58 @@ -520,7 +615,7 @@ row 2: ( 5, -20) ( 20, -40) ( 30, -60) ( 40, -80) row 3: ( -1, -23) ( 6, -52) ( 8, -76) ( 10,-100) [ GrB_transpose (transpose) (bitmap/full transpose) (jit: load) - 3.99e-05 sec ] + 0.00016 sec ] =============== C = C' @@ -532,9 +627,9 @@ row 2: ( 59, -38) ( 52, -44) ( 30, -60) ( 8, -76) row 3: ( 80, -50) ( 70, -60) ( 40, -80) ( 10,-100) [ GxB_set (in-place transpose) (transpose) - 5.67e-06 sec ] - [ GxB_Matrix_concat (sparse concat) (transpose) (bitmap/full transpose) (jit: run) (transpose) (transpose) (1-thread bucket transpose) (jit: load) (transpose) (1-thread bucket transpose) (jit: run) (transpose) (transpose) (bitmap/full transpose) (jit: run) - 6.61e-05 sec ] + 1.68e-05 sec ] + [ GxB_Matrix_concat (sparse concat) (transpose) (bitmap/full transpose) (transpose) (transpose) (1-thread bucket transpose) (jit: load) (transpose) (1-thread bucket transpose) (transpose) (transpose) (bitmap/full transpose) + 0.00026 sec ] =============== Z = [C D ; E E ; D C] @@ -842,7 +937,7 @@ row 255: . . . ( 42, -16) ( 80, -50) ( 70, -60 (255,7) [user-defined value] [ GxB_Matrix_split (sparse/hyper split) - 1.29e-05 sec ] + 4.43e-05 sec ] =============== C Tile from Z: @@ -1440,9 +1535,9 @@ row 127: ( 42, -16) ( 80, -50) ( 70, -60) ( 40, -80) ( 10,-100) (127,4) [user-defined value] [ GxB_set (in-place transpose) (transpose) - 2.97e-06 sec ] - [ GxB_Matrix_concat (bitmap concat) (transpose) (bitmap/full transpose) (jit: run) (transpose) (transpose) (1-thread bucket transpose) (jit: run) (transpose) (1-thread bucket transpose) (jit: run) (transpose) (transpose) (bitmap/full transpose) (jit: run) - 2.75e-05 sec ] + 1.28e-05 sec ] + [ GxB_Matrix_concat (bitmap concat) (transpose) (bitmap/full transpose) (transpose) (transpose) (1-thread bucket transpose) (transpose) (1-thread bucket transpose) (transpose) (transpose) (bitmap/full transpose) + 9.46e-05 sec ] =============== Z = [C D ; E E ; D C] @@ -1510,7 +1605,7 @@ row 15: . . . ( 42, -16) ( 80, -50) ( 70, -60) (15,7) [user-defined value] [ GxB_Matrix_split (bitmap split) - 6.21e-06 sec ] + 2.23e-05 sec ] =============== C Tile from Z: @@ -1628,7 +1723,7 @@ row 7: ( 42, -16) ( 80, -50) ( 70, -60) ( 40, -80) ( 10,-100) (7,4) [user-defined value] [ GrB_assign (pending: 0) Method 22: (C full) += scalar (jit: load) - 4.73e-05 sec ] + 0.000203 sec ] =============== C = C + ciso @@ -1640,9 +1735,9 @@ row 2: ( 60, -40) ( 53, -46) ( 31, -62) ( 9, -78) row 3: ( 81, -52) ( 71, -62) ( 41, -82) ( 11,-102) [ GxB_set - 9.13e-08 sec ] + 4.64e-07 sec ] [ GxB_Matrix_split (full split) - 4.33e-06 sec ] + 1.85e-05 sec ] =============== S Tile from C: @@ -1726,8 +1821,8 @@ row 1: ( 39, -28) ( 35, -30) ( 21, -42) ( 7, -54) row 2: ( 60, -40) ( 53, -46) ( 31, -62) ( 9, -78) row 3: ( 81, -52) ( 71, -62) ( 41, -82) ( 11,-102) - [ GrB_assign (pending: 0) Method 22: (C full) += scalar (jit: paused) (generic C(:,:)+=x assign) - 6.87e-06 sec ] + [ GrB_assign (pending: 0) Method 22: (C full) += scalar (generic C(:,:)+=x assign) + 2.26e-05 sec ] =============== C = C + ciso (JIT paused): @@ -1748,8 +1843,8 @@ row 1: ( 40, -30) ( 36, -32) ( 22, -44) ( 8, -56) row 2: ( 61, -42) ( 54, -48) ( 32, -64) ( 10, -80) row 3: ( 82, -54) ( 72, -64) ( 42, -84) ( 12,-104) - [ GrB_assign (pending: 0) Method 22: (C full) += scalar (jit: paused) (generic C(:,:)+=x assign) - 4.99e-06 sec ] + [ GrB_assign (pending: 0) Method 22: (C full) += scalar (generic C(:,:)+=x assign) + 1.68e-05 sec ] =============== C = C * ciso (JIT paused): @@ -1761,8 +1856,8 @@ row 2: ( -23,-164) ( -42,-156) ( -96,-128) (-150,-100) row 3: ( -26,-218) ( -56,-208) (-126,-168) (-196,-128) JIT: run (may not load or compile) - [ GrB_assign (pending: 0) Method 22: (C full) += scalar (jit: run) - 4.02e-06 sec ] + [ GrB_assign (pending: 0) Method 22: (C full) += scalar + 1.31e-05 sec ] =============== C = C + ciso (JIT run): @@ -1773,8 +1868,8 @@ row 1: ( -19,-112) ( -27,-106) ( -65, -90) (-103, -74) row 2: ( -22,-166) ( -41,-158) ( -95,-130) (-149,-102) row 3: ( -25,-220) ( -55,-210) (-125,-170) (-195,-130) - [ GrB_assign (pending: 0) Method 22: (C full) += scalar (jit: not loaded) (generic C(:,:)+=x assign) - 4.72e-06 sec ] + [ GrB_assign (pending: 0) Method 22: (C full) += scalar (generic C(:,:)+=x assign) + 1.78e-05 sec ] =============== C = C * ciso (JIT not loaded): @@ -1787,7 +1882,7 @@ row 3: (-465,-170) (-475,-100) (-465, 80) (-455, 260) JIT: on [ GrB_assign (pending: 0) Method 22: (C full) += scalar (jit: load) - 4.01e-05 sec ] + 0.000169 sec ] =============== C = C * ciso (full JIT): diff --git a/GraphBLAS/Demo/Output/gauss_demo1.out b/GraphBLAS/Demo/Output/gauss_demo1.out new file mode 100644 index 000000000..9276d7624 --- /dev/null +++ b/GraphBLAS/Demo/Output/gauss_demo1.out @@ -0,0 +1,1895 @@ +Gauss demo. Note that all transposes are array transposes, +not matrix (conjugate) transposes. + + + GraphBLAS Context: World + Context.nthreads: 40 + Context.chunk: 65536 +JIT configuration: ------------------ +JIT C compiler: [/usr/bin/cc] +JIT C flags: [ -Wundef -std=c11 -lm -Wno-pragmas -fexcess-precision=fast -fcx-limited-range -fno-math-errno -fwrapv -O3 -DNDEBUG -fopenmp -fPIC ] +JIT C link flags: [ -shared ] +JIT C libraries: [ -lm -ldl /usr/lib/gcc/x86_64-linux-gnu/9/libgomp.so /usr/lib/x86_64-linux-gnu/libpthread.so] +JIT C preface: [] +JIT cache: [/home/faculty/d/davis/.SuiteSparse/GrB8.2.0] +JIT C control: [4] +JIT C control: [4] reset +------------------------------------- + +JIT C preface (revised): +// kernel generated by gauss_demo.c +#include + + [ GxB_Type_new (jit: loaded but must recompile) (jit: compile and load) (jit: cmake) +-- The C compiler identification is GNU 9.4.0 +-- Detecting C compiler ABI info +-- Detecting C compiler ABI info - done +-- Check for working C compiler: /usr/bin/cc - skipped +-- Detecting C compile features +-- Detecting C compile features - done +-- Configuring done (0.3s) +-- Generating done (0.0s) +-- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/ce2be202506bf1b4 +make[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/ce2be202506bf1b4' +make[2]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/ce2be202506bf1b4' +make[3]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/ce2be202506bf1b4' +make[3]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/ce2be202506bf1b4' +make[3]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/ce2be202506bf1b4' +[ 50%] Building C object CMakeFiles/GB_jit__user_type__0__gauss.dir/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/c/b4/GB_jit__user_type__0__gauss.c.o +[100%] Linking C shared library libGB_jit__user_type__0__gauss.so +make[3]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/ce2be202506bf1b4' +[100%] Built target GB_jit__user_type__0__gauss +make[2]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/ce2be202506bf1b4' +make[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/ce2be202506bf1b4' +-- Install configuration: "" +-- Installing: /home/faculty/d/davis/.SuiteSparse/GrB8.2.0/lib/b4/libGB_jit__user_type__0__gauss.so + + 0.532 sec ] + GraphBLAS type: BadGauss user-defined: [gauss] size: 4 + typedef struct { int32_t real ; } gauss ; + [ GxB_Type_new (jit: type changed) (jit: loaded but must recompile) (jit: compile and load) (jit: cmake) +-- The C compiler identification is GNU 9.4.0 +-- Detecting C compiler ABI info +-- Detecting C compiler ABI info - done +-- Check for working C compiler: /usr/bin/cc - skipped +-- Detecting C compile features +-- Detecting C compile features - done +-- Configuring done (0.3s) +-- Generating done (0.0s) +-- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/ce2be202506bf1b4 +make[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/ce2be202506bf1b4' +make[2]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/ce2be202506bf1b4' +make[3]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/ce2be202506bf1b4' +make[3]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/ce2be202506bf1b4' +make[3]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/ce2be202506bf1b4' +[ 50%] Building C object CMakeFiles/GB_jit__user_type__0__gauss.dir/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/c/b4/GB_jit__user_type__0__gauss.c.o +[100%] Linking C shared library libGB_jit__user_type__0__gauss.so +make[3]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/ce2be202506bf1b4' +[100%] Built target GB_jit__user_type__0__gauss +make[2]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/ce2be202506bf1b4' +make[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/ce2be202506bf1b4' +-- Install configuration: "" +-- Installing: /home/faculty/d/davis/.SuiteSparse/GrB8.2.0/lib/b4/libGB_jit__user_type__0__gauss.so + + 0.528 sec ] + GraphBLAS type: Gauss user-defined: [gauss] size: 8 + typedef struct { int32_t real ; int32_t imag ; } gauss ; + [ GxB_Type_new + 1.11e-05 sec ] + GraphBLAS type: Gauss user-defined: [gauss] size: 8 + typedef struct { int32_t real ; int32_t imag ; } gauss ; + [ GxB_BinaryOp_new (jit: loaded but must recompile) (jit: compile and load) (jit: cmake) +-- The C compiler identification is GNU 9.4.0 +-- Detecting C compiler ABI info +-- Detecting C compiler ABI info - done +-- Check for working C compiler: /usr/bin/cc - skipped +-- Detecting C compile features +-- Detecting C compile features - done +-- Configuring done (0.3s) +-- Generating done (0.0s) +-- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/af7c00a52397011b +make[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/af7c00a52397011b' +make[2]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/af7c00a52397011b' +make[3]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/af7c00a52397011b' +make[3]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/af7c00a52397011b' +make[3]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/af7c00a52397011b' +[ 50%] Building C object CMakeFiles/GB_jit__user_op__0__addgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/c/1b/GB_jit__user_op__0__addgauss.c.o +[100%] Linking C shared library libGB_jit__user_op__0__addgauss.so +make[3]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/af7c00a52397011b' +[100%] Built target GB_jit__user_op__0__addgauss +make[2]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/af7c00a52397011b' +make[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/af7c00a52397011b' +-- Install configuration: "" +-- Installing: /home/faculty/d/davis/.SuiteSparse/GrB8.2.0/lib/1b/libGB_jit__user_op__0__addgauss.so + + 0.555 sec ] + + GraphBLAS BinaryOp: BadAddGauss (user-defined): z=addgauss(x,y) + GraphBLAS type: ztype user-defined: [gauss] size: 8 + typedef struct { int32_t real ; int32_t imag ; } gauss ; + GraphBLAS type: xtype user-defined: [gauss] size: 8 + typedef struct { int32_t real ; int32_t imag ; } gauss ; + GraphBLAS type: ytype user-defined: [gauss] size: 8 + typedef struct { int32_t real ; int32_t imag ; } gauss ; +void addgauss (gauss *z, const gauss *x, const gauss *y) +{ + z->real = x->real + y->real ; + z->imag = -911 ; +} + [ GxB_BinaryOp_new (jit: op changed) (jit: loaded but must recompile) (jit: compile and load) (jit: cmake) +-- The C compiler identification is GNU 9.4.0 +-- Detecting C compiler ABI info +-- Detecting C compiler ABI info - done +-- Check for working C compiler: /usr/bin/cc - skipped +-- Detecting C compile features +-- Detecting C compile features - done +-- Configuring done (0.3s) +-- Generating done (0.0s) +-- Build files have been written to: /home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/af7c00a52397011b +make[1]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/af7c00a52397011b' +make[2]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/af7c00a52397011b' +make[3]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/af7c00a52397011b' +make[3]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/af7c00a52397011b' +make[3]: Entering directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/af7c00a52397011b' +[ 50%] Building C object CMakeFiles/GB_jit__user_op__0__addgauss.dir/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/c/1b/GB_jit__user_op__0__addgauss.c.o +[100%] Linking C shared library libGB_jit__user_op__0__addgauss.so +make[3]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/af7c00a52397011b' +[100%] Built target GB_jit__user_op__0__addgauss +make[2]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/af7c00a52397011b' +make[1]: Leaving directory '/home/faculty/d/davis/.SuiteSparse/GrB8.2.0/tmp/af7c00a52397011b' +-- Install configuration: "" +-- Installing: /home/faculty/d/davis/.SuiteSparse/GrB8.2.0/lib/1b/libGB_jit__user_op__0__addgauss.so + + 0.576 sec ] + + GraphBLAS BinaryOp: AddGauss (user-defined): z=addgauss(x,y) + GraphBLAS type: ztype user-defined: [gauss] size: 8 + typedef struct { int32_t real ; int32_t imag ; } gauss ; + GraphBLAS type: xtype user-defined: [gauss] size: 8 + typedef struct { int32_t real ; int32_t imag ; } gauss ; + GraphBLAS type: ytype user-defined: [gauss] size: 8 + typedef struct { int32_t real ; int32_t imag ; } gauss ; +void addgauss (gauss *z, const gauss *x, const gauss *y) +{ + z->real = x->real + y->real ; + z->imag = x->imag + y->imag ; +} + [ GxB_BinaryOp_new + 6.96e-06 sec ] + + GraphBLAS BinaryOp: AddGauss (user-defined): z=addgauss(x,y) + GraphBLAS type: ztype user-defined: [gauss] size: 8 + typedef struct { int32_t real ; int32_t imag ; } gauss ; + GraphBLAS type: xtype user-defined: [gauss] size: 8 + typedef struct { int32_t real ; int32_t imag ; } gauss ; + GraphBLAS type: ytype user-defined: [gauss] size: 8 + typedef struct { int32_t real ; int32_t imag ; } gauss ; +void addgauss (gauss *z, const gauss *x, const gauss *y) +{ + z->real = x->real + y->real ; + z->imag = x->imag + y->imag ; +} + + GraphBLAS Monoid: AddMonoid (user-defined): + GraphBLAS BinaryOp: monoid->op (user-defined): z=addgauss(x,y) + GraphBLAS type: ztype user-defined: [gauss] size: 8 + typedef struct { int32_t real ; int32_t imag ; } gauss ; + GraphBLAS type: xtype user-defined: [gauss] size: 8 + typedef struct { int32_t real ; int32_t imag ; } gauss ; + GraphBLAS type: ytype user-defined: [gauss] size: 8 + typedef struct { int32_t real ; int32_t imag ; } gauss ; +void addgauss (gauss *z, const gauss *x, const gauss *y) +{ + z->real = x->real + y->real ; + z->imag = x->imag + y->imag ; +} + identity: [ [user-defined value] ] + + GraphBLAS BinaryOp: MultGauss (user-defined): z=multgauss(x,y) + GraphBLAS type: ztype user-defined: [gauss] size: 8 + typedef struct { int32_t real ; int32_t imag ; } gauss ; + GraphBLAS type: xtype user-defined: [gauss] size: 8 + typedef struct { int32_t real ; int32_t imag ; } gauss ; + GraphBLAS type: ytype user-defined: [gauss] size: 8 + typedef struct { int32_t real ; int32_t imag ; } gauss ; +void multgauss (gauss *z, const gauss *x, const gauss *y) +{ + int32_t zreal = x->real * y->real - x->imag * y->imag ; + int32_t zimag = x->real * y->imag + x->imag * y->real ; + z->real = zreal ; + z->imag = zimag ; +} + + GraphBLAS Semiring: GaussSemiring (user-defined): (addgauss_multgauss) + GraphBLAS Monoid: semiring->add (user-defined): + GraphBLAS BinaryOp: monoid->op (user-defined): z=addgauss(x,y) + GraphBLAS type: ztype user-defined: [gauss] size: 8 + typedef struct { int32_t real ; int32_t imag ; } gauss ; + GraphBLAS type: xtype user-defined: [gauss] size: 8 + typedef struct { int32_t real ; int32_t imag ; } gauss ; + GraphBLAS type: ytype user-defined: [gauss] size: 8 + typedef struct { int32_t real ; int32_t imag ; } gauss ; +void addgauss (gauss *z, const gauss *x, const gauss *y) +{ + z->real = x->real + y->real ; + z->imag = x->imag + y->imag ; +} + identity: [ [user-defined value] ] + + GraphBLAS BinaryOp: semiring->multiply (user-defined): z=multgauss(x,y) + GraphBLAS type: ztype user-defined: [gauss] size: 8 + typedef struct { int32_t real ; int32_t imag ; } gauss ; + GraphBLAS type: xtype user-defined: [gauss] size: 8 + typedef struct { int32_t real ; int32_t imag ; } gauss ; + GraphBLAS type: ytype user-defined: [gauss] size: 8 + typedef struct { int32_t real ; int32_t imag ; } gauss ; +void multgauss (gauss *z, const gauss *x, const gauss *y) +{ + int32_t zreal = x->real * y->real - x->imag * y->imag ; + int32_t zimag = x->real * y->imag + x->imag * y->real ; + z->real = zreal ; + z->imag = zimag ; +} +(iso wait:C (setElement:to non-iso) 0 zombies, 1 pending) + +=============== Gauss A matrix: + +size: 4-by-4 +row 0: . ( 1, 1) ( 1, 0) ( 1, -1) +row 1: ( 2, 2) ( 2, 1) ( 2, 0) ( 2, -1) +row 2: ( 3, 2) ( 3, 1) ( 3, 0) ( 3, -1) +row 3: ( 4, 2) ( 4, 1) ( 4, 0) ( 4, -1) + + [ GrB_reduce (A bitmap) (jit: load) + 0.000153 sec ] + +sum (A) = (39,6) + [ GrB_mxm C=A*B, saxpy (B = B*B, anz: 15 bnz: 15) (bitmap saxpy) (jit: load) (bitmap to full) + 0.00021 sec ] + + +=============== Gauss A = A^2 matrix: + +size: 4-by-4 +row 0: ( 9, 4) ( 9, 1) ( 9, -2) ( 9, -5) +row 1: ( 18, 10) ( 18, 8) ( 20, 0) ( 22, -8) +row 2: ( 27, 16) ( 28, 12) ( 30, 0) ( 32, -12) +row 3: ( 36, 22) ( 38, 16) ( 40, 0) ( 42, -16) + + [ GrB_reduce (A full) (jit: load) + 0.000115 sec ] + +sum (A^2) = (387,46) + + +Gauss C empty matrix +size: 4-by-4 +row 0: . . . . +row 1: . . . . +row 2: . . . . +row 3: . . . . + + [ GxB_set (full to sparse) + 1.2e-05 sec ] + [ GxB_set (hyper to sparse) + 8.09e-06 sec ] + [ GrB_mxm (iso mask: struct) (iso wait:M 0 zombies, 4 pending) (iso build) (hyper to sparse) C=A'*B, masked_dot_product (dot3) (S{S} = Sf'*Sf) nthreads 1 ntasks 1 (jit: load) (sparse to bitmap) + 0.000228 sec ] + + +=============== Gauss C = diag(AA') matrix: + +size: 4-by-4 +row 0: ( 278, -36) . . . +row 1: . (1304, 296) . . +row 2: . . (2893, 768) . +row 3: . . . (5108,1456) + + [ GxB_set + 5.01e-07 sec ] + [ GxB_set (hyper to sparse) + 5.92e-06 sec ] + [ GrB_select (A dense) + 3.35e-05 sec ] + + +Gauss D matrix +size: 4-by-4 +row 0: ( 9, 4) . . . +row 1: . ( 18, 8) . . +row 2: . . ( 30, 0) . +row 3: . . . ( 42, -16) + + [ GrB_mxm C=A*B, colscale (Sf=Sf*S) (jit: load) + 0.000147 sec ] + + +=============== Gauss C = D*A matrix: + +size: 4-by-4 +row 0: ( 65, 72) ( 77, 45) ( 89, 18) ( 101, -9) +row 1: ( 244, 324) ( 260, 288) ( 360, 160) ( 460, 32) +row 2: ( 810, 480) ( 840, 360) ( 900, 0) ( 960,-360) +row 3: (1864, 348) (1852, 64) (1680,-640) (1508,-1344) + + [ GxB_set + 3.63e-07 sec ] + [ GxB_set (sparse to bitmap) + 7.91e-06 sec ] + + +Gauss D matrix (bitmap) +size: 4-by-4 +row 0: ( 9, 4) . . . +row 1: . ( 18, 8) . . +row 2: . . ( 30, 0) . +row 3: . . . ( 42, -16) + + + 4x4 GraphBLAS gauss matrix, bitmap by row + sparsity control: bitmap only + D, 4 entries, memory: 360 bytes + + (0,0) [user-defined value] + (1,1) [user-defined value] + (2,2) [user-defined value] + (3,3) [user-defined value] + + [ GxB_set (bitmap to sparse) + 1.14e-05 sec ] + + +Gauss D matrix (back to sparse) +size: 4-by-4 +row 0: ( 9, 4) . . . +row 1: . ( 18, 8) . . +row 2: . . ( 30, 0) . +row 3: . . . ( 42, -16) + + + 4x4 GraphBLAS gauss matrix, sparse by row + sparsity control: sparse only + D, 4 entries, memory: 320 bytes + + (0,0) [user-defined value] + (1,1) [user-defined value] + (2,2) [user-defined value] + (3,3) [user-defined value] + + [ GrB_mxm C=A*B, rowscale (Sf=S*Sf) (jit: load) + 0.000145 sec ] + + +=============== Gauss C = A*D matrix: + +size: 4-by-4 +row 0: ( 65, 72) ( 154, 90) ( 270, -60) ( 298,-354) +row 1: ( 122, 162) ( 260, 288) ( 600, 0) ( 796,-688) +row 2: ( 179, 252) ( 408, 440) ( 900, 0) (1152,-1016) +row 3: ( 236, 342) ( 556, 592) (1200, 0) (1508,-1344) + + [ GrB_assign (C iso assign) (pending: 0) Method 21: (C full) = scalar + 3.33e-05 sec ] + + +=============== Gauss C = (1,-2) matrix: + +size: 4-by-4 +row 0: ( 1, -2) ( 1, -2) ( 1, -2) ( 1, -2) +row 1: ( 1, -2) ( 1, -2) ( 1, -2) ( 1, -2) +row 2: ( 1, -2) ( 1, -2) ( 1, -2) ( 1, -2) +row 3: ( 1, -2) ( 1, -2) ( 1, -2) ( 1, -2) + + + +=============== Gauss A matrix: + +size: 4-by-4 +row 0: ( 9, 4) ( 9, 1) ( 9, -2) ( 9, -5) +row 1: ( 18, 10) ( 18, 8) ( 20, 0) ( 22, -8) +row 2: ( 27, 16) ( 28, 12) ( 30, 0) ( 32, -12) +row 3: ( 36, 22) ( 38, 16) ( 40, 0) ( 42, -16) + + [ GrB_mxm C=A'*B, dot_product (dot4: F += Sf'*Sf) (jit: load) (C in place) + 0.000138 sec ] + + +=============== Gauss C += A*A' matrix: + +size: 4-by-4 +row 0: ( 279, -38) ( 615, 28) ( 918, 58) (1221, 88) +row 1: ( 615, 28) (1305, 294) (1943, 476) (2581, 658) +row 2: ( 918, 58) (1943, 476) (2894, 766) (3845,1056) +row 3: (1221, 88) (2581, 658) (3845,1056) (5109,1454) + + [ GrB_assign (C iso assign) (pending: 0) Method 21: (C full) = scalar + 1.5e-05 sec ] + + +=============== Gauss B = (1,-2) matrix: + +size: 4-by-4 +row 0: ( 1, -2) ( 1, -2) ( 1, -2) ( 1, -2) +row 1: ( 1, -2) ( 1, -2) ( 1, -2) ( 1, -2) +row 2: ( 1, -2) ( 1, -2) ( 1, -2) ( 1, -2) +row 3: ( 1, -2) ( 1, -2) ( 1, -2) ( 1, -2) + + [ GrB_mxm C=A*B, saxpy (saxpy4: F += Sf*F) (coarse, threads: 1) (jit: load) (C in place) + 0.000158 sec ] + + +=============== Gauss C += B*A: + +size: 4-by-4 +row 0: ( 473,-166) ( 782,-121) (1013,-142) (1244,-163) +row 1: ( 809,-100) (1472, 145) (2038, 276) (2604, 407) +row 2: (1112, -70) (2110, 327) (2989, 566) (3868, 805) +row 3: (1415, -40) (2748, 509) (3940, 856) (5132,1203) + + [ GrB_mxm C=A*B, saxpy (saxpy5: F += F*Sf) (jit: load) (C in place) + 0.000174 sec ] + + +=============== Gauss C += A*B: + +size: 4-by-4 +row 0: ( 505,-240) ( 814,-195) (1045,-216) (1276,-237) +row 1: ( 907,-246) (1570, -1) (2136, 130) (2702, 261) +row 2: (1261,-288) (2259, 109) (3138, 348) (4017, 587) +row 3: (1615,-330) (2948, 219) (4140, 566) (5332, 913) + + [ GrB_apply (shallow-op) (jit: load) + 0.000154 sec ] + + +=============== Gauss C = (1,-2) + A: + +size: 4-by-4 +row 0: ( 10, 2) ( 10, -1) ( 10, -4) ( 10, -7) +row 1: ( 19, 8) ( 19, 6) ( 21, -2) ( 23, -10) +row 2: ( 28, 14) ( 29, 10) ( 31, -2) ( 33, -14) +row 3: ( 37, 20) ( 39, 14) ( 41, -2) ( 43, -18) + + [ GrB_apply (shallow-op) (jit: load) + 9.5e-05 sec ] + + +=============== Gauss C = A*(1,-2): + +size: 4-by-4 +row 0: ( 17, -14) ( 11, -17) ( 5, -20) ( -1, -23) +row 1: ( 38, -26) ( 34, -28) ( 20, -40) ( 6, -52) +row 2: ( 59, -38) ( 52, -44) ( 30, -60) ( 8, -76) +row 3: ( 80, -50) ( 70, -60) ( 40, -80) ( 10,-100) + + [ GrB_apply (transpose-op) (transpose) (1-thread bucket transpose) (jit: load) (full to sparse) + 0.00013 sec ] + + +=============== Gauss C = A'*(1,-2): + +size: 4-by-4 +row 0: ( 17, -14) ( 38, -26) ( 59, -38) ( 80, -50) +row 1: ( 11, -17) ( 34, -28) ( 52, -44) ( 70, -60) +row 2: ( 5, -20) ( 20, -40) ( 30, -60) ( 40, -80) +row 3: ( -1, -23) ( 6, -52) ( 8, -76) ( 10,-100) + + [ GrB_apply (transpose-op) (transpose) (1-thread bucket transpose) (jit: load) (full to sparse) + 0.000109 sec ] + + +=============== Gauss C = (1,-2)*A': + +size: 4-by-4 +row 0: ( 17, -14) ( 38, -26) ( 59, -38) ( 80, -50) +row 1: ( 11, -17) ( 34, -28) ( 52, -44) ( 70, -60) +row 2: ( 5, -20) ( 20, -40) ( 30, -60) ( 40, -80) +row 3: ( -1, -23) ( 6, -52) ( 8, -76) ( 10,-100) + + + GraphBLAS UnaryOp: RealGauss (user-defined): z=realgauss(x) + GraphBLAS type: ztype int32_t size: 4 + GraphBLAS type: xtype user-defined: [gauss] size: 8 + typedef struct { int32_t real ; int32_t imag ; } gauss ; +void realgauss (int32_t *z, const gauss *x) +{ + (*z) = x->real ; +} + [ GrB_apply (shallow-op) (jit: load) + 0.000106 sec ] + + 4x4 GraphBLAS int32_t matrix, full by row + R, 16 entries, memory: 280 bytes + + (0,0) 17 + (0,1) 38 + (0,2) 59 + (0,3) 80 + (1,0) 11 + (1,1) 34 + (1,2) 52 + (1,3) 70 + (2,0) 5 + (2,1) 20 + (2,2) 30 + (2,3) 40 + (3,0) -1 + (3,1) 6 + (3,2) 8 + (3,3) 10 + + + +=============== R = RealGauss (C') + +size: 4-by-4 +row 0: ( 17, -14) ( 38, -26) ( 59, -38) ( 80, -50) +row 1: ( 11, -17) ( 34, -28) ( 52, -44) ( 70, -60) +row 2: ( 5, -20) ( 20, -40) ( 30, -60) ( 40, -80) +row 3: ( -1, -23) ( 6, -52) ( 8, -76) ( 10,-100) + + [ GrB_apply (transpose-op) (transpose) (bitmap/full transpose) (jit: load) + 0.000104 sec ] + + 4x4 GraphBLAS int32_t matrix, full by row + R, 16 entries, memory: 280 bytes + + (0,0) 17 + (0,1) 11 + (0,2) 5 + (0,3) -1 + (1,0) 38 + (1,1) 34 + (1,2) 20 + (1,3) 6 + (2,0) 59 + (2,1) 52 + (2,2) 30 + (2,3) 8 + (3,0) 80 + (3,1) 70 + (3,2) 40 + (3,3) 10 + + + +=============== C + +size: 4-by-4 +row 0: ( 17, -14) ( 38, -26) ( 59, -38) ( 80, -50) +row 1: ( 11, -17) ( 34, -28) ( 52, -44) ( 70, -60) +row 2: ( 5, -20) ( 20, -40) ( 30, -60) ( 40, -80) +row 3: ( -1, -23) ( 6, -52) ( 8, -76) ( 10,-100) + + [ GrB_apply (shallow-op) (jit: load) + 0.000101 sec ] + +R = ijgauss (C) + + 4x4 GraphBLAS int64_t matrix, full by row + R, 16 entries, memory: 344 bytes + + (0,0) 18 + (0,1) 38 + (0,2) 58 + (0,3) 78 + (1,0) 13 + (1,1) 35 + (1,2) 52 + (1,3) 69 + (2,0) 8 + (2,1) 22 + (2,2) 31 + (2,3) 40 + (3,0) 3 + (3,1) 9 + (3,2) 10 + (3,3) 11 + + [ GrB_Matrix_extractTuples (A full) + 2.09e-05 sec ] +R (0,0) = 18 +R (0,1) = 38 +R (0,2) = 58 +R (0,3) = 78 +R (1,0) = 13 +R (1,1) = 35 +R (1,2) = 52 +R (1,3) = 69 +R (2,0) = 8 +R (2,1) = 22 +R (2,2) = 31 +R (2,3) = 40 +R (3,0) = 3 +R (3,1) = 9 +R (3,2) = 10 +R (3,3) = 11 + + +=============== C + +size: 4-by-4 +row 0: ( 17, -14) ( 38, -26) ( 59, -38) ( 80, -50) +row 1: ( 11, -17) ( 34, -28) ( 52, -44) ( 70, -60) +row 2: ( 5, -20) ( 20, -40) ( 30, -60) ( 40, -80) +row 3: ( -1, -23) ( 6, -52) ( 8, -76) ( 10,-100) + + [ GrB_transpose (transpose) (bitmap/full transpose) (jit: load) + 0.000113 sec ] + + +=============== C = C' + +size: 4-by-4 +row 0: ( 17, -14) ( 11, -17) ( 5, -20) ( -1, -23) +row 1: ( 38, -26) ( 34, -28) ( 20, -40) ( 6, -52) +row 2: ( 59, -38) ( 52, -44) ( 30, -60) ( 8, -76) +row 3: ( 80, -50) ( 70, -60) ( 40, -80) ( 10,-100) + + [ GxB_set (in-place transpose) (transpose) + 1.16e-05 sec ] + [ GxB_Matrix_concat (sparse concat) (transpose) (bitmap/full transpose) (transpose) (transpose) (1-thread bucket transpose) (jit: load) (transpose) (1-thread bucket transpose) (transpose) (transpose) (bitmap/full transpose) + 0.00017 sec ] + + +=============== Z = [C D ; E E ; D C] +size: 256-by-8 +row 0: ( 17, -14) ( 11, -17) ( 5, -20) ( -1, -23) ( 9, 4) . . . +row 1: ( 38, -26) ( 34, -28) ( 20, -40) ( 6, -52) . ( 18, 8) . . +row 2: ( 59, -38) ( 52, -44) ( 30, -60) ( 8, -76) . . ( 30, 0) . +row 3: ( 80, -50) ( 70, -60) ( 40, -80) ( 10,-100) . . . ( 42, -16) +row 4: . . . . . . . . +row 5: . . . . . . . . +row 6: . . . . . . . . +row 7: . . . . . . . . +row 8: . . . . . . . . +row 9: . . . . . . . . +row 10: . . . . . . . . +row 11: . . . . . . . . +row 12: . . . . . . . . +row 13: . . . . . . . . +row 14: . . . . . . . . +row 15: . . . . . . . . +row 16: . . . . . . . . +row 17: . . . . . . . . +row 18: . . . . . . . . +row 19: . . . . . . . . +row 20: . . . . . . . . +row 21: . . . . . . . . +row 22: . . . . . . . . +row 23: . . . . . . . . +row 24: . . . . . . . . +row 25: . . . . . . . . +row 26: . . . . . . . . +row 27: . . . . . . . . +row 28: . . . . . . . . +row 29: . . . . . . . . +row 30: . . . . . . . . +row 31: . . . . . . . . +row 32: . . . . . . . . +row 33: . . . . . . . . +row 34: . . . . . . . . +row 35: . . . . . . . . +row 36: . . . . . . . . +row 37: . . . . . . . . +row 38: . . . . . . . . +row 39: . . . . . . . . +row 40: . . . . . . . . +row 41: . . . . . . . . +row 42: . . . . . . . . +row 43: . . . . . . . . +row 44: . . . . . . . . +row 45: . . . . . . . . +row 46: . . . . . . . . +row 47: . . . . . . . . +row 48: . . . . . . . . +row 49: . . . . . . . . +row 50: . . . . . . . . +row 51: . . . . . . . . +row 52: . . . . . . . . +row 53: . . . . . . . . +row 54: . . . . . . . . +row 55: . . . . . . . . +row 56: . . . . . . . . +row 57: . . . . . . . . +row 58: . . . . . . . . +row 59: . . . . . . . . +row 60: . . . . . . . . +row 61: . . . . . . . . +row 62: . . . . . . . . +row 63: . . . . . . . . +row 64: . . . . . . . . +row 65: . . . . . . . . +row 66: . . . . . . . . +row 67: . . . . . . . . +row 68: . . . . . . . . +row 69: . . . . . . . . +row 70: . . . . . . . . +row 71: . . . . . . . . +row 72: . . . . . . . . +row 73: . . . . . . . . +row 74: . . . . . . . . +row 75: . . . . . . . . +row 76: . . . . . . . . +row 77: . . . . . . . . +row 78: . . . . . . . . +row 79: . . . . . . . . +row 80: . . . . . . . . +row 81: . . . . . . . . +row 82: . . . . . . . . +row 83: . . . . . . . . +row 84: . . . . . . . . +row 85: . . . . . . . . +row 86: . . . . . . . . +row 87: . . . . . . . . +row 88: . . . . . . . . +row 89: . . . . . . . . +row 90: . . . . . . . . +row 91: . . . . . . . . +row 92: . . . . . . . . +row 93: . . . . . . . . +row 94: . . . . . . . . +row 95: . . . . . . . . +row 96: . . . . . . . . +row 97: . . . . . . . . +row 98: . . . . . . . . +row 99: . . . . . . . . +row 100: . . . . . . . . +row 101: . . . . . . . . +row 102: . . . . . . . . +row 103: . . . . . . . . +row 104: . . . . . . . . +row 105: . . . . . . . . +row 106: . . . . . . . . +row 107: . . . . . . . . +row 108: . . . . . . . . +row 109: . . . . . . . . +row 110: . . . . . . . . +row 111: . . . . . . . . +row 112: . . . . . . . . +row 113: . . . . . . . . +row 114: . . . . . . . . +row 115: . . . . . . . . +row 116: . . . . . . . . +row 117: . . . . . . . . +row 118: . . . . . . . . +row 119: . . . . . . . . +row 120: . . . . . . . . +row 121: . . . . . . . . +row 122: . . . . . . . . +row 123: . . . . . . . . +row 124: . . . . . . . . +row 125: . . . . . . . . +row 126: . . . . . . . . +row 127: . . . . . . . . +row 128: . . . . . . . . +row 129: . . . . . . . . +row 130: . . . . . . . . +row 131: . . . . . . . . +row 132: . . . . . . . . +row 133: . . . . . . . . +row 134: . . . . . . . . +row 135: . . . . . . . . +row 136: . . . . . . . . +row 137: . . . . . . . . +row 138: . . . . . . . . +row 139: . . . . . . . . +row 140: . . . . . . . . +row 141: . . . . . . . . +row 142: . . . . . . . . +row 143: . . . . . . . . +row 144: . . . . . . . . +row 145: . . . . . . . . +row 146: . . . . . . . . +row 147: . . . . . . . . +row 148: . . . . . . . . +row 149: . . . . . . . . +row 150: . . . . . . . . +row 151: . . . . . . . . +row 152: . . . . . . . . +row 153: . . . . . . . . +row 154: . . . . . . . . +row 155: . . . . . . . . +row 156: . . . . . . . . +row 157: . . . . . . . . +row 158: . . . . . . . . +row 159: . . . . . . . . +row 160: . . . . . . . . +row 161: . . . . . . . . +row 162: . . . . . . . . +row 163: . . . . . . . . +row 164: . . . . . . . . +row 165: . . . . . . . . +row 166: . . . . . . . . +row 167: . . . . . . . . +row 168: . . . . . . . . +row 169: . . . . . . . . +row 170: . . . . . . . . +row 171: . . . . . . . . +row 172: . . . . . . . . +row 173: . . . . . . . . +row 174: . . . . . . . . +row 175: . . . . . . . . +row 176: . . . . . . . . +row 177: . . . . . . . . +row 178: . . . . . . . . +row 179: . . . . . . . . +row 180: . . . . . . . . +row 181: . . . . . . . . +row 182: . . . . . . . . +row 183: . . . . . . . . +row 184: . . . . . . . . +row 185: . . . . . . . . +row 186: . . . . . . . . +row 187: . . . . . . . . +row 188: . . . . . . . . +row 189: . . . . . . . . +row 190: . . . . . . . . +row 191: . . . . . . . . +row 192: . . . . . . . . +row 193: . . . . . . . . +row 194: . . . . . . . . +row 195: . . . . . . . . +row 196: . . . . . . . . +row 197: . . . . . . . . +row 198: . . . . . . . . +row 199: . . . . . . . . +row 200: . . . . . . . . +row 201: . . . . . . . . +row 202: . . . . . . . . +row 203: . . . . . . . . +row 204: . . . . . . . . +row 205: . . . . . . . . +row 206: . . . . . . . . +row 207: . . . . . . . . +row 208: . . . . . . . . +row 209: . . . . . . . . +row 210: . . . . . . . . +row 211: . . . . . . . . +row 212: . . . . . . . . +row 213: . . . . . . . . +row 214: . . . . . . . . +row 215: . . . . . . . . +row 216: . . . . . . . . +row 217: . . . . . . . . +row 218: . . . . . . . . +row 219: . . . . . . . . +row 220: . . . . . . . . +row 221: . . . . . . . . +row 222: . . . . . . . . +row 223: . . . . . . . . +row 224: . . . . . . . . +row 225: . . . . . . . . +row 226: . . . . . . . . +row 227: . . . . . . . . +row 228: . . . . . . . . +row 229: . . . . . . . . +row 230: . . . . . . . . +row 231: . . . . . . . . +row 232: . . . . . . . . +row 233: . . . . . . . . +row 234: . . . . . . . . +row 235: . . . . . . . . +row 236: . . . . . . . . +row 237: . . . . . . . . +row 238: . . . . . . . . +row 239: . . . . . . . . +row 240: . . . . . . . . +row 241: . . . . . . . . +row 242: . . . . . . . . +row 243: . . . . . . . . +row 244: . . . . . . . . +row 245: . . . . . . . . +row 246: . . . . . . . . +row 247: . . . . . . . . +row 248: . . . . . . . . +row 249: . . . . . . . . +row 250: . . . . . . . . +row 251: . . . . . . . . +row 252: ( 9, 4) . . . ( 17, -14) ( 11, -17) ( 5, -20) ( -1, -23) +row 253: . ( 18, 8) . . ( 38, -26) ( 34, -28) ( 20, -40) ( 6, -52) +row 254: . . ( 30, 0) . ( 59, -38) ( 52, -44) ( 30, -60) ( 8, -76) +row 255: . . . ( 42, -16) ( 80, -50) ( 70, -60) ( 40, -80) ( 10,-100) + + + 256x8 GraphBLAS gauss matrix, sparse by col + Z, 40 entries, memory: 928 bytes + + (0,0) [user-defined value] + (1,0) [user-defined value] + (2,0) [user-defined value] + (3,0) [user-defined value] + (252,0) [user-defined value] + (0,1) [user-defined value] + (1,1) [user-defined value] + (2,1) [user-defined value] + (3,1) [user-defined value] + (253,1) [user-defined value] + (0,2) [user-defined value] + (1,2) [user-defined value] + (2,2) [user-defined value] + (3,2) [user-defined value] + (254,2) [user-defined value] + (0,3) [user-defined value] + (1,3) [user-defined value] + (2,3) [user-defined value] + (3,3) [user-defined value] + (255,3) [user-defined value] + (0,4) [user-defined value] + (252,4) [user-defined value] + (253,4) [user-defined value] + (254,4) [user-defined value] + (255,4) [user-defined value] + (1,5) [user-defined value] + (252,5) [user-defined value] + (253,5) [user-defined value] + (254,5) [user-defined value] + (255,5) [user-defined value] + (2,6) [user-defined value] + (252,6) [user-defined value] + (253,6) [user-defined value] + (254,6) [user-defined value] + (255,6) [user-defined value] + (3,7) [user-defined value] + (252,7) [user-defined value] + (253,7) [user-defined value] + (254,7) [user-defined value] + (255,7) [user-defined value] + + [ GxB_Matrix_split (sparse/hyper split) + 3.53e-05 sec ] + + +=============== C Tile from Z: + +size: 128-by-3 +row 0: ( 17, -14) ( 11, -17) ( 5, -20) +row 1: ( 38, -26) ( 34, -28) ( 20, -40) +row 2: ( 59, -38) ( 52, -44) ( 30, -60) +row 3: ( 80, -50) ( 70, -60) ( 40, -80) +row 4: . . . +row 5: . . . +row 6: . . . +row 7: . . . +row 8: . . . +row 9: . . . +row 10: . . . +row 11: . . . +row 12: . . . +row 13: . . . +row 14: . . . +row 15: . . . +row 16: . . . +row 17: . . . +row 18: . . . +row 19: . . . +row 20: . . . +row 21: . . . +row 22: . . . +row 23: . . . +row 24: . . . +row 25: . . . +row 26: . . . +row 27: . . . +row 28: . . . +row 29: . . . +row 30: . . . +row 31: . . . +row 32: . . . +row 33: . . . +row 34: . . . +row 35: . . . +row 36: . . . +row 37: . . . +row 38: . . . +row 39: . . . +row 40: . . . +row 41: . . . +row 42: . . . +row 43: . . . +row 44: . . . +row 45: . . . +row 46: . . . +row 47: . . . +row 48: . . . +row 49: . . . +row 50: . . . +row 51: . . . +row 52: . . . +row 53: . . . +row 54: . . . +row 55: . . . +row 56: . . . +row 57: . . . +row 58: . . . +row 59: . . . +row 60: . . . +row 61: . . . +row 62: . . . +row 63: . . . +row 64: . . . +row 65: . . . +row 66: . . . +row 67: . . . +row 68: . . . +row 69: . . . +row 70: . . . +row 71: . . . +row 72: . . . +row 73: . . . +row 74: . . . +row 75: . . . +row 76: . . . +row 77: . . . +row 78: . . . +row 79: . . . +row 80: . . . +row 81: . . . +row 82: . . . +row 83: . . . +row 84: . . . +row 85: . . . +row 86: . . . +row 87: . . . +row 88: . . . +row 89: . . . +row 90: . . . +row 91: . . . +row 92: . . . +row 93: . . . +row 94: . . . +row 95: . . . +row 96: . . . +row 97: . . . +row 98: . . . +row 99: . . . +row 100: . . . +row 101: . . . +row 102: . . . +row 103: . . . +row 104: . . . +row 105: . . . +row 106: . . . +row 107: . . . +row 108: . . . +row 109: . . . +row 110: . . . +row 111: . . . +row 112: . . . +row 113: . . . +row 114: . . . +row 115: . . . +row 116: . . . +row 117: . . . +row 118: . . . +row 119: . . . +row 120: . . . +row 121: . . . +row 122: . . . +row 123: . . . +row 124: . . . +row 125: . . . +row 126: . . . +row 127: . . . + + + 128x3 GraphBLAS gauss matrix, sparse by col + CTiles [k], 12 entries, memory: 440 bytes + + (0,0) [user-defined value] + (1,0) [user-defined value] + (2,0) [user-defined value] + (3,0) [user-defined value] + (0,1) [user-defined value] + (1,1) [user-defined value] + (2,1) [user-defined value] + (3,1) [user-defined value] + (0,2) [user-defined value] + (1,2) [user-defined value] + (2,2) [user-defined value] + (3,2) [user-defined value] + + + +=============== C Tile from Z: + +size: 128-by-5 +row 0: ( -1, -23) ( 9, 4) . . . +row 1: ( 6, -52) . ( 18, 8) . . +row 2: ( 8, -76) . . ( 30, 0) . +row 3: ( 10,-100) . . . ( 42, -16) +row 4: . . . . . +row 5: . . . . . +row 6: . . . . . +row 7: . . . . . +row 8: . . . . . +row 9: . . . . . +row 10: . . . . . +row 11: . . . . . +row 12: . . . . . +row 13: . . . . . +row 14: . . . . . +row 15: . . . . . +row 16: . . . . . +row 17: . . . . . +row 18: . . . . . +row 19: . . . . . +row 20: . . . . . +row 21: . . . . . +row 22: . . . . . +row 23: . . . . . +row 24: . . . . . +row 25: . . . . . +row 26: . . . . . +row 27: . . . . . +row 28: . . . . . +row 29: . . . . . +row 30: . . . . . +row 31: . . . . . +row 32: . . . . . +row 33: . . . . . +row 34: . . . . . +row 35: . . . . . +row 36: . . . . . +row 37: . . . . . +row 38: . . . . . +row 39: . . . . . +row 40: . . . . . +row 41: . . . . . +row 42: . . . . . +row 43: . . . . . +row 44: . . . . . +row 45: . . . . . +row 46: . . . . . +row 47: . . . . . +row 48: . . . . . +row 49: . . . . . +row 50: . . . . . +row 51: . . . . . +row 52: . . . . . +row 53: . . . . . +row 54: . . . . . +row 55: . . . . . +row 56: . . . . . +row 57: . . . . . +row 58: . . . . . +row 59: . . . . . +row 60: . . . . . +row 61: . . . . . +row 62: . . . . . +row 63: . . . . . +row 64: . . . . . +row 65: . . . . . +row 66: . . . . . +row 67: . . . . . +row 68: . . . . . +row 69: . . . . . +row 70: . . . . . +row 71: . . . . . +row 72: . . . . . +row 73: . . . . . +row 74: . . . . . +row 75: . . . . . +row 76: . . . . . +row 77: . . . . . +row 78: . . . . . +row 79: . . . . . +row 80: . . . . . +row 81: . . . . . +row 82: . . . . . +row 83: . . . . . +row 84: . . . . . +row 85: . . . . . +row 86: . . . . . +row 87: . . . . . +row 88: . . . . . +row 89: . . . . . +row 90: . . . . . +row 91: . . . . . +row 92: . . . . . +row 93: . . . . . +row 94: . . . . . +row 95: . . . . . +row 96: . . . . . +row 97: . . . . . +row 98: . . . . . +row 99: . . . . . +row 100: . . . . . +row 101: . . . . . +row 102: . . . . . +row 103: . . . . . +row 104: . . . . . +row 105: . . . . . +row 106: . . . . . +row 107: . . . . . +row 108: . . . . . +row 109: . . . . . +row 110: . . . . . +row 111: . . . . . +row 112: . . . . . +row 113: . . . . . +row 114: . . . . . +row 115: . . . . . +row 116: . . . . . +row 117: . . . . . +row 118: . . . . . +row 119: . . . . . +row 120: . . . . . +row 121: . . . . . +row 122: . . . . . +row 123: . . . . . +row 124: . . . . . +row 125: . . . . . +row 126: . . . . . +row 127: . . . . . + + + 128x5 GraphBLAS gauss matrix, sparse by col + CTiles [k], 8 entries, memory: 392 bytes + + (0,0) [user-defined value] + (1,0) [user-defined value] + (2,0) [user-defined value] + (3,0) [user-defined value] + (0,1) [user-defined value] + (1,2) [user-defined value] + (2,3) [user-defined value] + (3,4) [user-defined value] + + + +=============== C Tile from Z: + +size: 128-by-3 +row 0: . . . +row 1: . . . +row 2: . . . +row 3: . . . +row 4: . . . +row 5: . . . +row 6: . . . +row 7: . . . +row 8: . . . +row 9: . . . +row 10: . . . +row 11: . . . +row 12: . . . +row 13: . . . +row 14: . . . +row 15: . . . +row 16: . . . +row 17: . . . +row 18: . . . +row 19: . . . +row 20: . . . +row 21: . . . +row 22: . . . +row 23: . . . +row 24: . . . +row 25: . . . +row 26: . . . +row 27: . . . +row 28: . . . +row 29: . . . +row 30: . . . +row 31: . . . +row 32: . . . +row 33: . . . +row 34: . . . +row 35: . . . +row 36: . . . +row 37: . . . +row 38: . . . +row 39: . . . +row 40: . . . +row 41: . . . +row 42: . . . +row 43: . . . +row 44: . . . +row 45: . . . +row 46: . . . +row 47: . . . +row 48: . . . +row 49: . . . +row 50: . . . +row 51: . . . +row 52: . . . +row 53: . . . +row 54: . . . +row 55: . . . +row 56: . . . +row 57: . . . +row 58: . . . +row 59: . . . +row 60: . . . +row 61: . . . +row 62: . . . +row 63: . . . +row 64: . . . +row 65: . . . +row 66: . . . +row 67: . . . +row 68: . . . +row 69: . . . +row 70: . . . +row 71: . . . +row 72: . . . +row 73: . . . +row 74: . . . +row 75: . . . +row 76: . . . +row 77: . . . +row 78: . . . +row 79: . . . +row 80: . . . +row 81: . . . +row 82: . . . +row 83: . . . +row 84: . . . +row 85: . . . +row 86: . . . +row 87: . . . +row 88: . . . +row 89: . . . +row 90: . . . +row 91: . . . +row 92: . . . +row 93: . . . +row 94: . . . +row 95: . . . +row 96: . . . +row 97: . . . +row 98: . . . +row 99: . . . +row 100: . . . +row 101: . . . +row 102: . . . +row 103: . . . +row 104: . . . +row 105: . . . +row 106: . . . +row 107: . . . +row 108: . . . +row 109: . . . +row 110: . . . +row 111: . . . +row 112: . . . +row 113: . . . +row 114: . . . +row 115: . . . +row 116: . . . +row 117: . . . +row 118: . . . +row 119: . . . +row 120: . . . +row 121: . . . +row 122: . . . +row 123: . . . +row 124: ( 9, 4) . . +row 125: . ( 18, 8) . +row 126: . . ( 30, 0) +row 127: . . . + + + 128x3 GraphBLAS gauss matrix, sparse by col + CTiles [k], 3 entries, memory: 296 bytes + + (124,0) [user-defined value] + (125,1) [user-defined value] + (126,2) [user-defined value] + + + +=============== C Tile from Z: + +size: 128-by-5 +row 0: . . . . . +row 1: . . . . . +row 2: . . . . . +row 3: . . . . . +row 4: . . . . . +row 5: . . . . . +row 6: . . . . . +row 7: . . . . . +row 8: . . . . . +row 9: . . . . . +row 10: . . . . . +row 11: . . . . . +row 12: . . . . . +row 13: . . . . . +row 14: . . . . . +row 15: . . . . . +row 16: . . . . . +row 17: . . . . . +row 18: . . . . . +row 19: . . . . . +row 20: . . . . . +row 21: . . . . . +row 22: . . . . . +row 23: . . . . . +row 24: . . . . . +row 25: . . . . . +row 26: . . . . . +row 27: . . . . . +row 28: . . . . . +row 29: . . . . . +row 30: . . . . . +row 31: . . . . . +row 32: . . . . . +row 33: . . . . . +row 34: . . . . . +row 35: . . . . . +row 36: . . . . . +row 37: . . . . . +row 38: . . . . . +row 39: . . . . . +row 40: . . . . . +row 41: . . . . . +row 42: . . . . . +row 43: . . . . . +row 44: . . . . . +row 45: . . . . . +row 46: . . . . . +row 47: . . . . . +row 48: . . . . . +row 49: . . . . . +row 50: . . . . . +row 51: . . . . . +row 52: . . . . . +row 53: . . . . . +row 54: . . . . . +row 55: . . . . . +row 56: . . . . . +row 57: . . . . . +row 58: . . . . . +row 59: . . . . . +row 60: . . . . . +row 61: . . . . . +row 62: . . . . . +row 63: . . . . . +row 64: . . . . . +row 65: . . . . . +row 66: . . . . . +row 67: . . . . . +row 68: . . . . . +row 69: . . . . . +row 70: . . . . . +row 71: . . . . . +row 72: . . . . . +row 73: . . . . . +row 74: . . . . . +row 75: . . . . . +row 76: . . . . . +row 77: . . . . . +row 78: . . . . . +row 79: . . . . . +row 80: . . . . . +row 81: . . . . . +row 82: . . . . . +row 83: . . . . . +row 84: . . . . . +row 85: . . . . . +row 86: . . . . . +row 87: . . . . . +row 88: . . . . . +row 89: . . . . . +row 90: . . . . . +row 91: . . . . . +row 92: . . . . . +row 93: . . . . . +row 94: . . . . . +row 95: . . . . . +row 96: . . . . . +row 97: . . . . . +row 98: . . . . . +row 99: . . . . . +row 100: . . . . . +row 101: . . . . . +row 102: . . . . . +row 103: . . . . . +row 104: . . . . . +row 105: . . . . . +row 106: . . . . . +row 107: . . . . . +row 108: . . . . . +row 109: . . . . . +row 110: . . . . . +row 111: . . . . . +row 112: . . . . . +row 113: . . . . . +row 114: . . . . . +row 115: . . . . . +row 116: . . . . . +row 117: . . . . . +row 118: . . . . . +row 119: . . . . . +row 120: . . . . . +row 121: . . . . . +row 122: . . . . . +row 123: . . . . . +row 124: . ( 17, -14) ( 11, -17) ( 5, -20) ( -1, -23) +row 125: . ( 38, -26) ( 34, -28) ( 20, -40) ( 6, -52) +row 126: . ( 59, -38) ( 52, -44) ( 30, -60) ( 8, -76) +row 127: ( 42, -16) ( 80, -50) ( 70, -60) ( 40, -80) ( 10,-100) + + + 128x5 GraphBLAS gauss matrix, sparse by col + CTiles [k], 17 entries, memory: 536 bytes + + (127,0) [user-defined value] + (124,1) [user-defined value] + (125,1) [user-defined value] + (126,1) [user-defined value] + (127,1) [user-defined value] + (124,2) [user-defined value] + (125,2) [user-defined value] + (126,2) [user-defined value] + (127,2) [user-defined value] + (124,3) [user-defined value] + (125,3) [user-defined value] + (126,3) [user-defined value] + (127,3) [user-defined value] + (124,4) [user-defined value] + (125,4) [user-defined value] + (126,4) [user-defined value] + (127,4) [user-defined value] + + [ GxB_set (in-place transpose) (transpose) + 7.17e-06 sec ] + [ GxB_Matrix_concat (bitmap concat) (transpose) (bitmap/full transpose) (transpose) (transpose) (1-thread bucket transpose) (transpose) (1-thread bucket transpose) (transpose) (transpose) (bitmap/full transpose) + 5.61e-05 sec ] + + +=============== Z = [C D ; E E ; D C] +size: 16-by-8 +row 0: ( 17, -14) ( 11, -17) ( 5, -20) ( -1, -23) ( 9, 4) . . . +row 1: ( 38, -26) ( 34, -28) ( 20, -40) ( 6, -52) . ( 18, 8) . . +row 2: ( 59, -38) ( 52, -44) ( 30, -60) ( 8, -76) . . ( 30, 0) . +row 3: ( 80, -50) ( 70, -60) ( 40, -80) ( 10,-100) . . . ( 42, -16) +row 4: . . . . . . . . +row 5: . . . . . . . . +row 6: . . . . . . . . +row 7: . . . . . . . . +row 8: . . . . . . . . +row 9: . . . . . . . . +row 10: . . . . . . . . +row 11: . . . . . . . . +row 12: ( 9, 4) . . . ( 17, -14) ( 11, -17) ( 5, -20) ( -1, -23) +row 13: . ( 18, 8) . . ( 38, -26) ( 34, -28) ( 20, -40) ( 6, -52) +row 14: . . ( 30, 0) . ( 59, -38) ( 52, -44) ( 30, -60) ( 8, -76) +row 15: . . . ( 42, -16) ( 80, -50) ( 70, -60) ( 40, -80) ( 10,-100) + + + 16x8 GraphBLAS gauss matrix, bitmap by col + Z, 40 entries, memory: 1.3 KB + + (0,0) [user-defined value] + (1,0) [user-defined value] + (2,0) [user-defined value] + (3,0) [user-defined value] + (12,0) [user-defined value] + (0,1) [user-defined value] + (1,1) [user-defined value] + (2,1) [user-defined value] + (3,1) [user-defined value] + (13,1) [user-defined value] + (0,2) [user-defined value] + (1,2) [user-defined value] + (2,2) [user-defined value] + (3,2) [user-defined value] + (14,2) [user-defined value] + (0,3) [user-defined value] + (1,3) [user-defined value] + (2,3) [user-defined value] + (3,3) [user-defined value] + (15,3) [user-defined value] + (0,4) [user-defined value] + (12,4) [user-defined value] + (13,4) [user-defined value] + (14,4) [user-defined value] + (15,4) [user-defined value] + (1,5) [user-defined value] + (12,5) [user-defined value] + (13,5) [user-defined value] + (14,5) [user-defined value] + (15,5) [user-defined value] + (2,6) [user-defined value] + (12,6) [user-defined value] + (13,6) [user-defined value] + (14,6) [user-defined value] + (15,6) [user-defined value] + (3,7) [user-defined value] + (12,7) [user-defined value] + (13,7) [user-defined value] + (14,7) [user-defined value] + (15,7) [user-defined value] + + [ GxB_Matrix_split (bitmap split) + 1.66e-05 sec ] + + +=============== C Tile from Z: + +size: 8-by-3 +row 0: ( 17, -14) ( 11, -17) ( 5, -20) +row 1: ( 38, -26) ( 34, -28) ( 20, -40) +row 2: ( 59, -38) ( 52, -44) ( 30, -60) +row 3: ( 80, -50) ( 70, -60) ( 40, -80) +row 4: . . . +row 5: . . . +row 6: . . . +row 7: . . . + + + 8x3 GraphBLAS gauss matrix, bitmap by col + CTiles [k], 12 entries, memory: 432 bytes + + (0,0) [user-defined value] + (1,0) [user-defined value] + (2,0) [user-defined value] + (3,0) [user-defined value] + (0,1) [user-defined value] + (1,1) [user-defined value] + (2,1) [user-defined value] + (3,1) [user-defined value] + (0,2) [user-defined value] + (1,2) [user-defined value] + (2,2) [user-defined value] + (3,2) [user-defined value] + + + +=============== C Tile from Z: + +size: 8-by-5 +row 0: ( -1, -23) ( 9, 4) . . . +row 1: ( 6, -52) . ( 18, 8) . . +row 2: ( 8, -76) . . ( 30, 0) . +row 3: ( 10,-100) . . . ( 42, -16) +row 4: . . . . . +row 5: . . . . . +row 6: . . . . . +row 7: . . . . . + + + 8x5 GraphBLAS gauss matrix, bitmap by col + CTiles [k], 8 entries, memory: 576 bytes + + (0,0) [user-defined value] + (1,0) [user-defined value] + (2,0) [user-defined value] + (3,0) [user-defined value] + (0,1) [user-defined value] + (1,2) [user-defined value] + (2,3) [user-defined value] + (3,4) [user-defined value] + + + +=============== C Tile from Z: + +size: 8-by-3 +row 0: . . . +row 1: . . . +row 2: . . . +row 3: . . . +row 4: ( 9, 4) . . +row 5: . ( 18, 8) . +row 6: . . ( 30, 0) +row 7: . . . + + + 8x3 GraphBLAS gauss matrix, bitmap by col + CTiles [k], 3 entries, memory: 432 bytes + + (4,0) [user-defined value] + (5,1) [user-defined value] + (6,2) [user-defined value] + + + +=============== C Tile from Z: + +size: 8-by-5 +row 0: . . . . . +row 1: . . . . . +row 2: . . . . . +row 3: . . . . . +row 4: . ( 17, -14) ( 11, -17) ( 5, -20) ( -1, -23) +row 5: . ( 38, -26) ( 34, -28) ( 20, -40) ( 6, -52) +row 6: . ( 59, -38) ( 52, -44) ( 30, -60) ( 8, -76) +row 7: ( 42, -16) ( 80, -50) ( 70, -60) ( 40, -80) ( 10,-100) + + + 8x5 GraphBLAS gauss matrix, bitmap by col + CTiles [k], 17 entries, memory: 576 bytes + + (7,0) [user-defined value] + (4,1) [user-defined value] + (5,1) [user-defined value] + (6,1) [user-defined value] + (7,1) [user-defined value] + (4,2) [user-defined value] + (5,2) [user-defined value] + (6,2) [user-defined value] + (7,2) [user-defined value] + (4,3) [user-defined value] + (5,3) [user-defined value] + (6,3) [user-defined value] + (7,3) [user-defined value] + (4,4) [user-defined value] + (5,4) [user-defined value] + (6,4) [user-defined value] + (7,4) [user-defined value] + + [ GrB_assign (pending: 0) Method 22: (C full) += scalar (jit: load) + 0.000132 sec ] + + +=============== C = C + ciso + +size: 4-by-4 +row 0: ( 18, -16) ( 12, -19) ( 6, -22) ( 0, -25) +row 1: ( 39, -28) ( 35, -30) ( 21, -42) ( 7, -54) +row 2: ( 60, -40) ( 53, -46) ( 31, -62) ( 9, -78) +row 3: ( 81, -52) ( 71, -62) ( 41, -82) ( 11,-102) + + [ GxB_set + 2.48e-07 sec ] + [ GxB_Matrix_split (full split) + 1.16e-05 sec ] + + +=============== S Tile from C: + +size: 1-by-2 +row 0: ( 18, -16) ( 12, -19) + + + 1x2 GraphBLAS gauss matrix, full by row + sparsity control: full + STiles [k], 2 entries, memory: 232 bytes + + (0,0) [user-defined value] + (0,1) [user-defined value] + + + +=============== S Tile from C: + +size: 1-by-2 +row 0: ( 6, -22) ( 0, -25) + + + 1x2 GraphBLAS gauss matrix, full by row + sparsity control: full + STiles [k], 2 entries, memory: 232 bytes + + (0,0) [user-defined value] + (0,1) [user-defined value] + + + +=============== S Tile from C: + +size: 3-by-2 +row 0: ( 39, -28) ( 35, -30) +row 1: ( 60, -40) ( 53, -46) +row 2: ( 81, -52) ( 71, -62) + + + 3x2 GraphBLAS gauss matrix, full by row + sparsity control: full + STiles [k], 6 entries, memory: 264 bytes + + (0,0) [user-defined value] + (0,1) [user-defined value] + (1,0) [user-defined value] + (1,1) [user-defined value] + (2,0) [user-defined value] + (2,1) [user-defined value] + + + +=============== S Tile from C: + +size: 3-by-2 +row 0: ( 21, -42) ( 7, -54) +row 1: ( 31, -62) ( 9, -78) +row 2: ( 41, -82) ( 11,-102) + + + 3x2 GraphBLAS gauss matrix, full by row + sparsity control: full + STiles [k], 6 entries, memory: 264 bytes + + (0,0) [user-defined value] + (0,1) [user-defined value] + (1,0) [user-defined value] + (1,1) [user-defined value] + (2,0) [user-defined value] + (2,1) [user-defined value] + +JIT: paused + + +=============== C: + +size: 4-by-4 +row 0: ( 18, -16) ( 12, -19) ( 6, -22) ( 0, -25) +row 1: ( 39, -28) ( 35, -30) ( 21, -42) ( 7, -54) +row 2: ( 60, -40) ( 53, -46) ( 31, -62) ( 9, -78) +row 3: ( 81, -52) ( 71, -62) ( 41, -82) ( 11,-102) + + [ GrB_assign (pending: 0) Method 22: (C full) += scalar (generic C(:,:)+=x assign) + 1.41e-05 sec ] + + +=============== C = C + ciso (JIT paused): + +size: 4-by-4 +row 0: ( 19, -18) ( 13, -21) ( 7, -24) ( 1, -27) +row 1: ( 40, -30) ( 36, -32) ( 22, -44) ( 8, -56) +row 2: ( 61, -42) ( 54, -48) ( 32, -64) ( 10, -80) +row 3: ( 82, -54) ( 72, -64) ( 42, -84) ( 12,-104) + + + +=============== C: + +size: 4-by-4 +row 0: ( 19, -18) ( 13, -21) ( 7, -24) ( 1, -27) +row 1: ( 40, -30) ( 36, -32) ( 22, -44) ( 8, -56) +row 2: ( 61, -42) ( 54, -48) ( 32, -64) ( 10, -80) +row 3: ( 82, -54) ( 72, -64) ( 42, -84) ( 12,-104) + + [ GrB_assign (pending: 0) Method 22: (C full) += scalar (generic C(:,:)+=x assign) + 1e-05 sec ] + + +=============== C = C * ciso (JIT paused): + +size: 4-by-4 +row 0: ( -17, -56) ( -29, -47) ( -41, -38) ( -53, -29) +row 1: ( -20,-110) ( -28,-104) ( -66, -88) (-104, -72) +row 2: ( -23,-164) ( -42,-156) ( -96,-128) (-150,-100) +row 3: ( -26,-218) ( -56,-208) (-126,-168) (-196,-128) + +JIT: run (may not load or compile) + [ GrB_assign (pending: 0) Method 22: (C full) += scalar + 7.94e-06 sec ] + + +=============== C = C + ciso (JIT run): + +size: 4-by-4 +row 0: ( -16, -58) ( -28, -49) ( -40, -40) ( -52, -31) +row 1: ( -19,-112) ( -27,-106) ( -65, -90) (-103, -74) +row 2: ( -22,-166) ( -41,-158) ( -95,-130) (-149,-102) +row 3: ( -25,-220) ( -55,-210) (-125,-170) (-195,-130) + + [ GrB_assign (pending: 0) Method 22: (C full) += scalar (generic C(:,:)+=x assign) + 1.11e-05 sec ] + + +=============== C = C * ciso (JIT not loaded): + +size: 4-by-4 +row 0: (-132, -26) (-126, 7) (-120, 40) (-114, 73) +row 1: (-243, -74) (-239, -52) (-245, 40) (-251, 132) +row 2: (-354,-122) (-357, -76) (-355, 60) (-353, 196) +row 3: (-465,-170) (-475,-100) (-465, 80) (-455, 260) + +JIT: on + [ GrB_assign (pending: 0) Method 22: (C full) += scalar (jit: load) + 0.000109 sec ] + + +=============== C = C * ciso (full JIT): + +size: 4-by-4 +row 0: (-184, 238) (-112, 259) ( -40, 280) ( 32, 301) +row 1: (-391, 412) (-343, 426) (-165, 530) ( 13, 634) +row 2: (-598, 586) (-509, 638) (-235, 770) ( 39, 902) +row 3: (-805, 760) (-675, 850) (-305,1010) ( 65,1170) + diff --git a/GraphBLAS/Demo/Output/import_demo.out b/GraphBLAS/Demo/Output/import_demo.out index 40e4c92ee..13be0e9b9 100644 --- a/GraphBLAS/Demo/Output/import_demo.out +++ b/GraphBLAS/Demo/Output/import_demo.out @@ -4,7 +4,7 @@ ========================= import_test: format 0 67x67 GraphBLAS double matrix, sparse by row - C to export, 294 entries, memory: 9.2 KB + C to export, 294 entries, memory: 5.3 KB (0,7) -0.834182 (0,12) 1.26582 @@ -40,7 +40,7 @@ ========================= import_test: format 1 67x67 GraphBLAS double matrix, sparse by row - C to export, 294 entries, memory: 9.2 KB + C to export, 294 entries, memory: 5.3 KB (0,7) -0.834182 (0,12) 1.26582 @@ -76,7 +76,7 @@ ========================= import_test: format 2 67x67 GraphBLAS double matrix, sparse by row - C to export, 294 entries, memory: 9.2 KB + C to export, 294 entries, memory: 5.3 KB (0,7) -0.834182 (0,12) 1.26582 @@ -112,7 +112,7 @@ ========================= import_test: format 3 67x67 GraphBLAS double matrix, sparse by row - C to export, 294 entries, memory: 9.2 KB + C to export, 294 entries, memory: 5.3 KB (0,7) -0.834182 (0,12) 1.26582 @@ -150,7 +150,7 @@ ========================= import_test: format 0 67x67 GraphBLAS double matrix, sparse by col - C to export, 294 entries, memory: 9.2 KB + C to export, 294 entries, memory: 5.3 KB (4,0) -0.278842 (5,0) -0.268019 @@ -186,7 +186,7 @@ ========================= import_test: format 1 67x67 GraphBLAS double matrix, sparse by col - C to export, 294 entries, memory: 9.2 KB + C to export, 294 entries, memory: 5.3 KB (4,0) -0.278842 (5,0) -0.268019 @@ -222,7 +222,7 @@ ========================= import_test: format 2 67x67 GraphBLAS double matrix, sparse by col - C to export, 294 entries, memory: 9.2 KB + C to export, 294 entries, memory: 5.3 KB (4,0) -0.278842 (5,0) -0.268019 @@ -258,7 +258,7 @@ ========================= import_test: format 3 67x67 GraphBLAS double matrix, sparse by col - C to export, 294 entries, memory: 9.2 KB + C to export, 294 entries, memory: 5.3 KB (4,0) -0.278842 (5,0) -0.268019 @@ -296,7 +296,7 @@ ========================= import_test: format 0 67x67 GraphBLAS double matrix, hypersparse by row - C to export, 294 entries, memory: 10.2 KB + C to export, 294 entries, memory: 5.9 KB (0,7) -0.834182 (0,12) 1.26582 @@ -332,7 +332,7 @@ ========================= import_test: format 1 67x67 GraphBLAS double matrix, hypersparse by row - C to export, 294 entries, memory: 10.2 KB + C to export, 294 entries, memory: 5.9 KB (0,7) -0.834182 (0,12) 1.26582 @@ -368,7 +368,7 @@ ========================= import_test: format 2 67x67 GraphBLAS double matrix, hypersparse by row - C to export, 294 entries, memory: 10.2 KB + C to export, 294 entries, memory: 5.9 KB (0,7) -0.834182 (0,12) 1.26582 @@ -404,7 +404,7 @@ ========================= import_test: format 3 67x67 GraphBLAS double matrix, hypersparse by row - C to export, 294 entries, memory: 10.2 KB + C to export, 294 entries, memory: 5.9 KB (0,7) -0.834182 (0,12) 1.26582 @@ -442,7 +442,7 @@ ========================= import_test: format 0 67x67 GraphBLAS double matrix, hypersparse by col - C to export, 294 entries, memory: 10.2 KB + C to export, 294 entries, memory: 5.9 KB (4,0) -0.278842 (5,0) -0.268019 @@ -478,7 +478,7 @@ ========================= import_test: format 1 67x67 GraphBLAS double matrix, hypersparse by col - C to export, 294 entries, memory: 10.2 KB + C to export, 294 entries, memory: 5.9 KB (4,0) -0.278842 (5,0) -0.268019 @@ -514,7 +514,7 @@ ========================= import_test: format 2 67x67 GraphBLAS double matrix, hypersparse by col - C to export, 294 entries, memory: 10.2 KB + C to export, 294 entries, memory: 5.9 KB (4,0) -0.278842 (5,0) -0.268019 @@ -550,7 +550,7 @@ ========================= import_test: format 3 67x67 GraphBLAS double matrix, hypersparse by col - C to export, 294 entries, memory: 10.2 KB + C to export, 294 entries, memory: 5.9 KB (4,0) -0.278842 (5,0) -0.268019 diff --git a/GraphBLAS/Demo/Output/openmp_demo.out b/GraphBLAS/Demo/Output/openmp_demo.out index da6ccd067..0866eb3a9 100644 --- a/GraphBLAS/Demo/Output/openmp_demo.out +++ b/GraphBLAS/Demo/Output/openmp_demo.out @@ -1,51 +1,51 @@ Demo: ../build/openmp_demo: User threads in this program are OpenMP threads. -================= worker 1 starts: +================= worker 0 starts: -================= worker 6 starts: +================= worker 1 starts: -================= worker 4 starts: +================= worker 7 starts: ================= worker 3 starts: -================= worker 7 starts: +================= worker 2 starts: -================= worker 5 starts: +================= worker 6 starts: -================= worker 2 starts: +================= worker 4 starts: -================= worker 0 starts: +================= worker 5 starts: ------------------ worker 1 intentional error: +----------------- worker 0 intentional error: GraphBLAS error: GrB_INVALID_INDEX function: GrB_Matrix_setElement_INT32 (C, row, col, x) -Row index 1001 out of range; must be < 6 +Row index 1000 out of range; must be < 6 ----------------- worker 4 intentional error: GraphBLAS error: GrB_INVALID_INDEX function: GrB_Matrix_setElement_INT32 (C, row, col, x) Row index 1004 out of range; must be < 6 ------------------ worker 6 intentional error: +----------------- worker 7 intentional error: GraphBLAS error: GrB_INVALID_INDEX function: GrB_Matrix_setElement_INT32 (C, row, col, x) -Row index 1006 out of range; must be < 6 +Row index 1007 out of range; must be < 6 ------------------ worker 3 intentional error: +----------------- worker 1 intentional error: GraphBLAS error: GrB_INVALID_INDEX function: GrB_Matrix_setElement_INT32 (C, row, col, x) -Row index 1003 out of range; must be < 6 +Row index 1001 out of range; must be < 6 ------------------ worker 7 intentional error: +----------------- worker 6 intentional error: GraphBLAS error: GrB_INVALID_INDEX function: GrB_Matrix_setElement_INT32 (C, row, col, x) -Row index 1007 out of range; must be < 6 +Row index 1006 out of range; must be < 6 ------------------ worker 0 intentional error: +----------------- worker 3 intentional error: GraphBLAS error: GrB_INVALID_INDEX function: GrB_Matrix_setElement_INT32 (C, row, col, x) -Row index 1000 out of range; must be < 6 +Row index 1003 out of range; must be < 6 ----------------- worker 5 intentional error: GraphBLAS error: GrB_INVALID_INDEX @@ -57,46 +57,123 @@ GraphBLAS error: GrB_INVALID_INDEX function: GrB_Matrix_setElement_INT32 (C, row, col, x) Row index 1002 out of range; must be < 6 ------------------ worker 4 is done: +----------------- worker 0 is done: 6x6 GraphBLAS double matrix, full by row - A, 36 entries, memory: 768 bytes + A, 36 entries, memory: 504 bytes - (0,0) 101004 - (0,1) 102004 - (0,2) 103004 - (0,3) 104004 - (0,4) 105004 - (0,5) 106004 - (1,0) 201004 - (1,1) 202004 - (1,2) 203004 - (1,3) 204004 - (1,4) 205004 - (1,5) 206004 - (2,0) 301004 - (2,1) 302004 - (2,2) 303004 - (2,3) 304004 - (2,4) 305004 - (2,5) 306004 - (3,0) 401004 - (3,1) 402004 - (3,2) 403004 - (3,3) 404004 - (3,4) 405004 - (3,5) 406004 - (4,0) 501004 - (4,1) 502004 - (4,2) 503004 - (4,3) 504004 - (4,4) 505004 + (0,0) 101000 + (0,1) 102000 + (0,2) 103000 + (0,3) 104000 + (0,4) 105000 + (0,5) 106000 + (1,0) 201000 + (1,1) 202000 + (1,2) 203000 + (1,3) 204000 + (1,4) 205000 + (1,5) 206000 + (2,0) 301000 + (2,1) 302000 + (2,2) 303000 + (2,3) 304000 + (2,4) 305000 + (2,5) 306000 + (3,0) 401000 + (3,1) 402000 + (3,2) 403000 + (3,3) 404000 + (3,4) 405000 + (3,5) 406000 + (4,0) 501000 + (4,1) 502000 + (4,2) 503000 + (4,3) 504000 + (4,4) 505000 + ... + +----------------- worker 2 is done: + + 6x6 GraphBLAS double matrix, full by row + A, 36 entries, memory: 504 bytes + + (0,0) 101002 + (0,1) 102002 + (0,2) 103002 + (0,3) 104002 + (0,4) 105002 + (0,5) 106002 + (1,0) 201002 + (1,1) 202002 + (1,2) 203002 + (1,3) 204002 + (1,4) 205002 + (1,5) 206002 + (2,0) 301002 + (2,1) 302002 + (2,2) 303002 + (2,3) 304002 + (2,4) 305002 + (2,5) 306002 + (3,0) 401002 + (3,1) 402002 + (3,2) 403002 + (3,3) 404002 + (3,4) 405002 + (3,5) 406002 + (4,0) 501002 + (4,1) 502002 + (4,2) 503002 + (4,3) 504002 + (4,4) 505002 ... +----------------- worker 6 is done: + + 6x6 GraphBLAS double matrix, full by row + A, 36 entries, memory: 504 bytes + + (0,0) 101006 + (0,1) 102006 + (0,2) 103006 + (0,3) 104006 + (0,4) 105006 + (0,5) 106006 + (1,0) 201006 + (1,1) 202006 + (1,2) 203006 + (1,3) 204006 + (1,4) 205006 + (1,5) 206006 + (2,0) 301006 + (2,1) 302006 + (2,2) 303006 + (2,3) 304006 + (2,4) 305006 + (2,5) 306006 + (3,0) 401006 + (3,1) 402006 + (3,2) 403006 + (3,3) 404006 + (3,4) 405006 + (3,5) 406006 + (4,0) 501006 + (4,1) 502006 + (4,2) 503006 + (4,3) 504006 + (4,4) 505006 + ... + +----------------- worker 2 error should be same: +GraphBLAS error: GrB_INVALID_INDEX +function: GrB_Matrix_setElement_INT32 (C, row, col, x) +Row index 1002 out of range; must be < 6 + ----------------- worker 3 is done: 6x6 GraphBLAS double matrix, full by row - A, 36 entries, memory: 768 bytes + A, 36 entries, memory: 504 bytes (0,0) 101003 (0,1) 102003 @@ -129,10 +206,15 @@ Row index 1002 out of range; must be < 6 (4,4) 505003 ... +----------------- worker 6 error should be same: +GraphBLAS error: GrB_INVALID_INDEX +function: GrB_Matrix_setElement_INT32 (C, row, col, x) +Row index 1006 out of range; must be < 6 + ----------------- worker 1 is done: 6x6 GraphBLAS double matrix, full by row - A, 36 entries, memory: 768 bytes + A, 36 entries, memory: 504 bytes (0,0) 101001 (0,1) 102001 @@ -165,97 +247,51 @@ Row index 1002 out of range; must be < 6 (4,4) 505001 ... ------------------ worker 4 error should be same: -GraphBLAS error: GrB_INVALID_INDEX -function: GrB_Matrix_setElement_INT32 (C, row, col, x) -Row index 1004 out of range; must be < 6 - ------------------ worker 2 is done: - - 6x6 GraphBLAS double matrix, full by row - A, 36 entries, memory: 768 bytes - - (0,0) 101002 - (0,1) 102002 - (0,2) 103002 - (0,3) 104002 - (0,4) 105002 - (0,5) 106002 - (1,0) 201002 - (1,1) 202002 - (1,2) 203002 - (1,3) 204002 - (1,4) 205002 - (1,5) 206002 - (2,0) 301002 - (2,1) 302002 - (2,2) 303002 - (2,3) 304002 - (2,4) 305002 - (2,5) 306002 - (3,0) 401002 - (3,1) 402002 - (3,2) 403002 - (3,3) 404002 - (3,4) 405002 - (3,5) 406002 - (4,0) 501002 - (4,1) 502002 - (4,2) 503002 - (4,3) 504002 - (4,4) 505002 - ... - ------------------ worker 0 is done: +----------------- worker 5 is done: 6x6 GraphBLAS double matrix, full by row - A, 36 entries, memory: 768 bytes + A, 36 entries, memory: 504 bytes - (0,0) 101000 - (0,1) 102000 - (0,2) 103000 - (0,3) 104000 - (0,4) 105000 - (0,5) 106000 - (1,0) 201000 - (1,1) 202000 - (1,2) 203000 - (1,3) 204000 - (1,4) 205000 - (1,5) 206000 - (2,0) 301000 - (2,1) 302000 - (2,2) 303000 - (2,3) 304000 - (2,4) 305000 - (2,5) 306000 - (3,0) 401000 - (3,1) 402000 - (3,2) 403000 - (3,3) 404000 - (3,4) 405000 - (3,5) 406000 - (4,0) 501000 - (4,1) 502000 - (4,2) 503000 - (4,3) 504000 - (4,4) 505000 + (0,0) 101005 + (0,1) 102005 + (0,2) 103005 + (0,3) 104005 + (0,4) 105005 + (0,5) 106005 + (1,0) 201005 + (1,1) 202005 + (1,2) 203005 + (1,3) 204005 + (1,4) 205005 + (1,5) 206005 + (2,0) 301005 + (2,1) 302005 + (2,2) 303005 + (2,3) 304005 + (2,4) 305005 + (2,5) 306005 + (3,0) 401005 + (3,1) 402005 + (3,2) 403005 + (3,3) 404005 + (3,4) 405005 + (3,5) 406005 + (4,0) 501005 + (4,1) 502005 + (4,2) 503005 + (4,3) 504005 + (4,4) 505005 ... ------------------ worker 2 error should be same: -GraphBLAS error: GrB_INVALID_INDEX -function: GrB_Matrix_setElement_INT32 (C, row, col, x) -Row index 1002 out of range; must be < 6 - ------------------ worker 1 error should be same: +----------------- worker 0 error should be same: GraphBLAS error: GrB_INVALID_INDEX function: GrB_Matrix_setElement_INT32 (C, row, col, x) -Row index 1001 out of range; must be < 6 +Row index 1000 out of range; must be < 6 ----------------- worker 7 is done: 6x6 GraphBLAS double matrix, full by row - A, 36 entries, memory: 768 bytes + A, 36 entries, memory: 504 bytes (0,0) 101007 (0,1) 102007 @@ -288,107 +324,71 @@ Row index 1001 out of range; must be < 6 (4,4) 505007 ... +----------------- worker 1 error should be same: +GraphBLAS error: GrB_INVALID_INDEX +function: GrB_Matrix_setElement_INT32 (C, row, col, x) +Row index 1001 out of range; must be < 6 + ----------------- worker 3 error should be same: GraphBLAS error: GrB_INVALID_INDEX function: GrB_Matrix_setElement_INT32 (C, row, col, x) Row index 1003 out of range; must be < 6 ------------------ worker 5 is done: +----------------- worker 4 is done: 6x6 GraphBLAS double matrix, full by row - A, 36 entries, memory: 768 bytes + A, 36 entries, memory: 504 bytes - (0,0) 101005 - (0,1) 102005 - (0,2) 103005 - (0,3) 104005 - (0,4) 105005 - (0,5) 106005 - (1,0) 201005 - (1,1) 202005 - (1,2) 203005 - (1,3) 204005 - (1,4) 205005 - (1,5) 206005 - (2,0) 301005 - (2,1) 302005 - (2,2) 303005 - (2,3) 304005 - (2,4) 305005 - (2,5) 306005 - (3,0) 401005 - (3,1) 402005 - (3,2) 403005 - (3,3) 404005 - (3,4) 405005 - (3,5) 406005 - (4,0) 501005 - (4,1) 502005 - (4,2) 503005 - (4,3) 504005 - (4,4) 505005 + (0,0) 101004 + (0,1) 102004 + (0,2) 103004 + (0,3) 104004 + (0,4) 105004 + (0,5) 106004 + (1,0) 201004 + (1,1) 202004 + (1,2) 203004 + (1,3) 204004 + (1,4) 205004 + (1,5) 206004 + (2,0) 301004 + (2,1) 302004 + (2,2) 303004 + (2,3) 304004 + (2,4) 305004 + (2,5) 306004 + (3,0) 401004 + (3,1) 402004 + (3,2) 403004 + (3,3) 404004 + (3,4) 405004 + (3,5) 406004 + (4,0) 501004 + (4,1) 502004 + (4,2) 503004 + (4,3) 504004 + (4,4) 505004 ... ------------------ worker 0 error should be same: +----------------- worker 5 error should be same: GraphBLAS error: GrB_INVALID_INDEX function: GrB_Matrix_setElement_INT32 (C, row, col, x) -Row index 1000 out of range; must be < 6 +Row index 1005 out of range; must be < 6 ----------------- worker 7 error should be same: GraphBLAS error: GrB_INVALID_INDEX function: GrB_Matrix_setElement_INT32 (C, row, col, x) Row index 1007 out of range; must be < 6 ------------------ worker 5 error should be same: -GraphBLAS error: GrB_INVALID_INDEX -function: GrB_Matrix_setElement_INT32 (C, row, col, x) -Row index 1005 out of range; must be < 6 - ------------------ worker 6 is done: - - 6x6 GraphBLAS double matrix, full by row - A, 36 entries, memory: 768 bytes - - (0,0) 101006 - (0,1) 102006 - (0,2) 103006 - (0,3) 104006 - (0,4) 105006 - (0,5) 106006 - (1,0) 201006 - (1,1) 202006 - (1,2) 203006 - (1,3) 204006 - (1,4) 205006 - (1,5) 206006 - (2,0) 301006 - (2,1) 302006 - (2,2) 303006 - (2,3) 304006 - (2,4) 305006 - (2,5) 306006 - (3,0) 401006 - (3,1) 402006 - (3,2) 403006 - (3,3) 404006 - (3,4) 405006 - (3,5) 406006 - (4,0) 501006 - (4,1) 502006 - (4,2) 503006 - (4,3) 504006 - (4,4) 505006 - ... - ------------------ worker 6 error should be same: +----------------- worker 4 error should be same: GraphBLAS error: GrB_INVALID_INDEX function: GrB_Matrix_setElement_INT32 (C, row, col, x) -Row index 1006 out of range; must be < 6 +Row index 1004 out of range; must be < 6 ---- Leader prints matrix 0 6x6 GraphBLAS double matrix, full by row - A, 36 entries, memory: 768 bytes + A, 36 entries, memory: 504 bytes (0,0) 101000 (0,1) 102000 @@ -424,7 +424,7 @@ Row index 1006 out of range; must be < 6 ---- Leader prints matrix 1 6x6 GraphBLAS double matrix, full by row - A, 36 entries, memory: 768 bytes + A, 36 entries, memory: 504 bytes (0,0) 101001 (0,1) 102001 @@ -460,7 +460,7 @@ Row index 1006 out of range; must be < 6 ---- Leader prints matrix 2 6x6 GraphBLAS double matrix, full by row - A, 36 entries, memory: 768 bytes + A, 36 entries, memory: 504 bytes (0,0) 101002 (0,1) 102002 @@ -496,7 +496,7 @@ Row index 1006 out of range; must be < 6 ---- Leader prints matrix 3 6x6 GraphBLAS double matrix, full by row - A, 36 entries, memory: 768 bytes + A, 36 entries, memory: 504 bytes (0,0) 101003 (0,1) 102003 @@ -532,7 +532,7 @@ Row index 1006 out of range; must be < 6 ---- Leader prints matrix 4 6x6 GraphBLAS double matrix, full by row - A, 36 entries, memory: 768 bytes + A, 36 entries, memory: 504 bytes (0,0) 101004 (0,1) 102004 @@ -568,7 +568,7 @@ Row index 1006 out of range; must be < 6 ---- Leader prints matrix 5 6x6 GraphBLAS double matrix, full by row - A, 36 entries, memory: 768 bytes + A, 36 entries, memory: 504 bytes (0,0) 101005 (0,1) 102005 @@ -604,7 +604,7 @@ Row index 1006 out of range; must be < 6 ---- Leader prints matrix 6 6x6 GraphBLAS double matrix, full by row - A, 36 entries, memory: 768 bytes + A, 36 entries, memory: 504 bytes (0,0) 101006 (0,1) 102006 @@ -640,7 +640,7 @@ Row index 1006 out of range; must be < 6 ---- Leader prints matrix 7 6x6 GraphBLAS double matrix, full by row - A, 36 entries, memory: 768 bytes + A, 36 entries, memory: 504 bytes (0,0) 101007 (0,1) 102007 diff --git a/GraphBLAS/Demo/Output/wildtype_demo.out b/GraphBLAS/Demo/Output/wildtype_demo.out index cdf36412f..a4cffa326 100644 --- a/GraphBLAS/Demo/Output/wildtype_demo.out +++ b/GraphBLAS/Demo/Output/wildtype_demo.out @@ -1,5 +1,5 @@ [ GxB_Type_new - 9.86e-06 sec ] + 9.57e-06 sec ] GraphBLAS type: WildType user-defined: [wildtype] size: 192 typedef struct { double stuff [4][4] ; char whatstuff [64] ; } wildtype ; WildType size: 192 @@ -11,8 +11,8 @@ a wildtype scalar: scalar1 [this is from scalar1] 100.0 101.0 102.0 103.0 200.0 201.0 202.0 203.0 300.0 301.0 302.0 303.0 -(iso wait:C (setElement:to non-iso) 0 zombies, 1 pending) [ GrB_transpose (wait:A 0 zombies, 2 pending) (build) (jit: load) add:(H<.>=H+H) (jit: load) (hyper to sparse) (transpose) (builder transpose) (jit: run) (hyper to sparse) - 0.000947 sec ] +(iso wait:C (setElement:to non-iso) 0 zombies, 1 pending) [ GrB_transpose (wait:A 0 zombies, 2 pending) (build) (jit: load) add:(H<.>=H+H) (jit: load) (hyper to sparse) (transpose) (builder transpose) (hyper to sparse) + 0.00153 sec ] a wildtype scalar: got scalar2 = C(7,2) [this is A(2,7)] 0.0 1.0 2.0 3.0 @@ -139,7 +139,7 @@ Printing the matrix with GxB_Matrix_fprint: (3,7) [user-defined value] [ GrB_Matrix_nvals - 7.73e-07 sec ] + 6.5e-07 sec ] ============= printing the WildType matrix: input A (10-by-10 with 3 entries) @@ -183,8 +183,8 @@ Printing the matrix with GxB_Matrix_fprint: row: 4 col: 2 [user-defined value] pending operator: implicit 2nd - [ GrB_Matrix_nvals (wait:A 0 zombies, 2 pending) (build) (jit: run) add:(H<.>=H+H) (jit: run) (hyper to sparse) - 3.68e-05 sec ] + [ GrB_Matrix_nvals (wait:A 0 zombies, 2 pending) (build) add:(H<.>=H+H) (hyper to sparse) + 0.000157 sec ] ============= printing the WildType matrix: input B (10-by-10 with 3 entries) @@ -214,7 +214,7 @@ a wildtype scalar: [here is B(7,5)] ============= that was the WildType matrix input B [ GrB_mxm C=A*B, saxpy (S = S*S, anz: 3 bnz: 3) axbwork 8 (intensity: 1.14 workspace/(nnz(A)+nnz(B)): 1.43) (nthreads 1 coarse: 1) (sparse saxpy) (jit: load) - 0.000114 sec ] + 0.000208 sec ] Printing the matrix with GxB_Matrix_fprint: @@ -227,7 +227,7 @@ Printing the matrix with GxB_Matrix_fprint: (3,5) [user-defined value] [ GrB_Matrix_nvals - 8.48e-08 sec ] + 1.83e-07 sec ] ============= printing the WildType matrix: output C (10-by-10 with 4 entries) @@ -274,7 +274,7 @@ The mask matrix M: iso value: 1 pending tuples: 4 max pending: 256 zombies: 0 pending tuples: - GraphBLAS type: int32_t size: 4 + GraphBLAS type: bool size: 1 row: 2 col: 2 row: 2 col: 3 row: 3 col: 2 @@ -282,7 +282,7 @@ The mask matrix M: pending operator: implicit 2nd [ GrB_mxm (iso wait:M 0 zombies, 4 pending) (iso build) (hyper to sparse) C=A'*B, masked_dot_product (dot3) (S{S} = S'*S) nthreads 1 ntasks 1 (jit: load) - 9.23e-05 sec ] + 0.000182 sec ] Printing the matrix with GxB_Matrix_fprint: @@ -295,7 +295,7 @@ Printing the matrix with GxB_Matrix_fprint: (3,3) [user-defined value] [ GrB_Matrix_nvals - 6.89e-08 sec ] + 1.6e-07 sec ] ============= printing the WildType matrix: output C (10-by-10 with 4 entries) @@ -333,15 +333,15 @@ a wildtype scalar: [this was added] ============= that was the WildType matrix output C [ GrB_reduce (jit: load) - 4.75e-05 sec ] + 0.000102 sec ] a wildtype scalar: sum (first time) [this was added] -111773.5 269.5 93412.5 583455.5 -49510798.5 271594.5 43367587.5 319487980.5 -92402621.5 2801413.5 85075148.5 622622583.5 -149241466.8 471094.8 130123106.2 959972867.8 - [ GrB_reduce (jit: run) - 3.14e-06 sec ] + [ GrB_reduce + 2.47e-06 sec ] a wildtype scalar: sum (again) [this was added] -111773.5 269.5 93412.5 583455.5 @@ -349,7 +349,7 @@ a wildtype scalar: sum (again) [this was added] -92402621.5 2801413.5 85075148.5 622622583.5 -149241466.8 471094.8 130123106.2 959972867.8 [ GxB_set (transpose) (in-place transpose) (transpose) (1-thread bucket transpose) (jit: load) - 6.21e-05 sec ] + 0.000109 sec ] C is now stored by column, but it looks just the same to the GraphBLAS user application. The difference is opaque, in the @@ -366,7 +366,7 @@ Printing the matrix with GxB_Matrix_fprint: (3,3) [user-defined value] [ GrB_Matrix_nvals - 5.63e-08 sec ] + 1.51e-07 sec ] ============= printing the WildType matrix: output C (10-by-10 with 4 entries) @@ -412,7 +412,7 @@ Printing the matrix with GxB_Matrix_fprint: The matrix D is not wild enough to print. [ GrB_apply (shallow-op) - 1.25e-05 sec ] + 2.51e-05 sec ] 10x10 GraphBLAS int64_t matrix, sparse by row E (positional i), 3 entries, memory: 352 bytes @@ -422,7 +422,7 @@ The matrix D is not wild enough to print. (3,7) 3 [ GrB_apply (shallow-op) - 3.55e-06 sec ] + 6.63e-06 sec ] 10x10 GraphBLAS int64_t matrix, sparse by row E (positional j), 3 entries, memory: 352 bytes @@ -432,7 +432,7 @@ The matrix D is not wild enough to print. (3,7) 7 [ GrB_eWiseAdd - 3.09e-06 sec ] + 3.88e-06 sec ] This is supposed to fail, as a demo of GrB_error: GraphBLAS error: GrB_DOMAIN_MISMATCH diff --git a/GraphBLAS/Doc/ChangeLog b/GraphBLAS/Doc/ChangeLog index a59a9c070..6effae9f6 100644 --- a/GraphBLAS/Doc/ChangeLog +++ b/GraphBLAS/Doc/ChangeLog @@ -1,3 +1,7 @@ +Sept 8, 2023: version 8.2.0 + + * cmake updates: SuiteSparse:: namespace by Markus Muetzel + Version 8.0.2, June 16, 2023 * added -DJITINIT=option: use -DJITINIT to set the initial state of diff --git a/GraphBLAS/Doc/GraphBLAS_UserGuide.pdf b/GraphBLAS/Doc/GraphBLAS_UserGuide.pdf index 5929129ef..a008a5aea 100644 Binary files a/GraphBLAS/Doc/GraphBLAS_UserGuide.pdf and b/GraphBLAS/Doc/GraphBLAS_UserGuide.pdf differ diff --git a/GraphBLAS/Doc/GraphBLAS_UserGuide.tex b/GraphBLAS/Doc/GraphBLAS_UserGuide.tex index fa5b0812a..d01a69a63 100644 --- a/GraphBLAS/Doc/GraphBLAS_UserGuide.tex +++ b/GraphBLAS/Doc/GraphBLAS_UserGuide.tex @@ -16078,7 +16078,10 @@ \subsection{Mac using clang} %---------------------------------------- To use OpenMP with clang on the Mac, try installing it from the - \url{https://mac.r-project.org/openmp/} project: + \url{https://mac.r-project.org/openmp/} project. +Be sure to check that page for the OpenMP version +that matches your version of Apple Xcode. +If using Xcode 13.3 to 13.4.1, use: {\scriptsize \begin{verbatim} @@ -16086,6 +16089,27 @@ \subsection{Mac using clang} sudo tar fvxz openmp-13.0.0-darwin21-Release.tar.gz -C / \end{verbatim} } + +For Xcode 14+ use the following instead. + + {\scriptsize + \begin{verbatim} + curl -O https://mac.r-project.org/openmp/openmp-14.0.6-darwin20-Release.tar.gz + sudo tar fvxz openmp-14.0.6-darwin20-Release.tar.gz -C / + \end{verbatim} } + +These commands will install universal binaries (ARM and x86) for +\verb'libomp.dylib', and the following files: + + {\scriptsize + \begin{verbatim} + /usr/local/lib/libomp.dylib + /usr/local/include/ompt.h + /usr/local/include/omp.h + /usr/local/include/omp-tools.h + \end{verbatim} } + + Once you do this, the GraphBLAS Cmake should find this copy of OpenMP for clang. @@ -16424,6 +16448,12 @@ \section{Release Notes} \begin{itemize} +\item Version 8.2.0, Sept 5, 2023 + + \begin{itemize} + \item cmake updates: \verb'SuiteSparse::' namespace by Markus M\"{u}tzel. + \end{itemize} + \item Version 8.0.2, June 16, 2023 \begin{itemize} diff --git a/GraphBLAS/Doc/GraphBLAS_version.tex b/GraphBLAS/Doc/GraphBLAS_version.tex index 53709481a..a786681c9 100644 --- a/GraphBLAS/Doc/GraphBLAS_version.tex +++ b/GraphBLAS/Doc/GraphBLAS_version.tex @@ -1,5 +1,5 @@ % version of SuiteSparse:GraphBLAS \date{VERSION -8.0.2, -June 16, 2023} +8.2.0, +Sept 8, 2023} diff --git a/GraphBLAS/Include/GraphBLAS.h b/GraphBLAS/Include/GraphBLAS.h index 273cb29f3..12135d64f 100644 --- a/GraphBLAS/Include/GraphBLAS.h +++ b/GraphBLAS/Include/GraphBLAS.h @@ -1,4 +1,4 @@ -// SuiteSparse:GraphBLAS 8.0.2 +// SuiteSparse:GraphBLAS 8.2.0 //------------------------------------------------------------------------------ // GraphBLAS.h: definitions for the GraphBLAS package //------------------------------------------------------------------------------ @@ -220,10 +220,10 @@ // The version of this implementation, and the GraphBLAS API version: #define GxB_IMPLEMENTATION_NAME "SuiteSparse:GraphBLAS" -#define GxB_IMPLEMENTATION_DATE "June 16, 2023" +#define GxB_IMPLEMENTATION_DATE "Sept 8, 2023" #define GxB_IMPLEMENTATION_MAJOR 8 -#define GxB_IMPLEMENTATION_MINOR 0 -#define GxB_IMPLEMENTATION_SUB 2 +#define GxB_IMPLEMENTATION_MINOR 2 +#define GxB_IMPLEMENTATION_SUB 0 #define GxB_SPEC_DATE "Nov 15, 2021" #define GxB_SPEC_MAJOR 2 #define GxB_SPEC_MINOR 0 diff --git a/GraphBLAS/JITpackage/GB_JITpackage.c b/GraphBLAS/JITpackage/GB_JITpackage.c index e68d7a630..7ea78dcb2 100644 --- a/GraphBLAS/JITpackage/GB_JITpackage.c +++ b/GraphBLAS/JITpackage/GB_JITpackage.c @@ -17,2833 +17,2834 @@ GB_JITpackage_index_struct GB_JITpackage_index [1] = {{0, 0, NULL, NULL}} ; int GB_JITpackage_nfiles = 217 ; // ../Include/GraphBLAS.h: -uint8_t GB_JITpackage_0 [56504] = { - 40,181, 47,253,160,170,243, 8, 0,132,208, 0,122,184, 76, 33, 45,176,174,172, - 27,186,140,104,187,228, 76, 62,247,248, 41,106,132, 27,156, 41,209, 37,224,236, -112,143,255, 15,172,106,159, 41,129,174, 84, 58,222, 74,242,131,254,131,253,141, - 93, 9,230, 1, 24, 2, 24, 2,158, 49,221, 78,111,174, 90,202,182,178, 87,225, - 45,221,126,154,149, 31,219,249,118,122,131,210,249,145,212,178,140,125, 95,210, -207,118,255,105, 88,201,150,210, 45,127,152, 35, 79, 45,199, 11,125, 67,131,244, -200,117,134,206, 91,163,199,143,179, 60, 54,213,238,132,127,181,166,192,177, 92, - 39,196,165,243,225,219,139,149,107,123, 38,247,255,111,159,110, 83,235, 14,198, - 23,134,122,239,173,107,209,187, 87, 38, 1, 97,240,253,184,113,100, 11,181,217, -117,220,122, 33,106, 59, 16,205,225, 26, 53,110,255,110,236,141,181,233, 93, 27, - 35,131, 64, 42,190, 48, 11,117,227, 87,203,237,221,105,254, 91,211, 34, 55,135, -175,173,124,255,243, 66,247,227, 48,108,202,153, 63, 61, 28,162, 52,106,179,118, - 90, 95,254,175,187, 63, 39,167, 43,103, 18, 12, 6,117,119,126,248,155,114, 98, -213,234,183,241,167, 55,166,152,167,150, 31,213,234, 12,192, 86,243,254,175,206, -120,171,213,184,233,220,248,103,167,153, 94,243,186,187, 53,114, 77,187, 90,150, -253,145,195,239,117,119,186,229,234,188,177, 93,227, 13,183,159,246,162,111,220, -158,249,223,222,161,223,230,253,177, 29, 57, 61,214,185,251,221,218, 52,122,230, - 87,161,185, 61,106, 19,126,107, 33,173,182, 22, 41,200,104, 47,203,158,180,211, -137, 92,187,115,192, 60,125,119, 66,183, 70,126,183,161,219,211,163,135,101,223, -233, 77, 90, 63,190,111, 61, 26,185, 58,255, 99,248, 92,157, 62,189,142,206,105, -142, 70,217,178,246, 5, 53,215, 24,189, 59,150, 65,211,111,244,248,111,127,119, -218,236, 62, 12,165, 71, 89,227,253,205,114,188,181,189,201,125,155,118, 60,171, -113,228,159,236,120, 76, 18, 16,221, 81, 28,241,158,219,188,181,229, 5,209, 95, - 91,155, 20,136, 7, 19,204, 36,219,227,253,157,225,191, 29, 55, 51, 76, 41,197, -144,128,196, 67, 2,226, 0,228, 33,193,146, 22, 49,252,233,137, 19,158, 40, 14, -117,215,122, 83,195,208,209, 92,220,208, 98,135,187,187,236,118,227,175,118,222, - 89,231,214,146, 35,221,196, 16, 17, 17, 14,137,233, 49, 33, 96,140,162, 72,186, - 78,116,140, 72,191,199, 14,214,119,126, 24, 71, 68, 4,215, 38,194, 30,233,167, -205, 27,201, 30,196,199, 84, 96,130, 60, 96, 1, 8,177, 88,149,235, 67, 4,166, - 58,167,105,146, 8,192, 7,148,136, 44, 76,100,195, 60,221,249, 28,249,251,125, -219,155, 23,130,139,188,161,117,167,121,115,188,175,218,207,117,106,221, 86,142, - 88, 40,200, 50, 77,243, 84,166,174,201,165, 97,201,178,170,210,176,100, 76,155, -255,163, 29,237,126,187,116,101, 15, 60,128, 37,201, 35, 41,138,164, 40,146,240, -184, 14, 85,139, 21,137,105,130, 53,141,251, 46, 62, 43,249, 70, 75, 55, 7,132, -177, 75,166,162, 42, 25, 70,101,100, 28,177,196, 50, 98,105, 66,143, 46, 30, 84, - 5, 38, 38, 21,124, 51, 9, 2,213,197,197,245, 41,184,155,157,149, 7, 22, 69, -246, 70,155, 78,190, 23,243,212, 77, 17, 88, 68,107,254, 89, 44,162, 3,122, 80, - 32,104,239,251,143, 14, 10,197,163,128, 1,200,131,130,130, 2,194, 17, 10, 10, - 9, 8, 4, 66,121, 64, 34, 7,178,204,114,185,176, 73,214,158,216, 89,201,205, -197,143,171,208,129,252, 41,183,249,160,168,238,148,164,219, 79,168, 55, 28, 17, -255,157,110, 47,253,226,243,212, 31,177,114, 10,121,244,235, 89,223, 24, 86,203, -213,165,161, 52, 24,165,146,163, 44,227,234,110, 33,255,199,202, 58, 29,196,138, - 53,153, 11,230,129,149, 81, 40, 19, 12, 11, 69,193,128,129,114, 97, 42,151, 42, -163, 88, 26,203,149, 69, 25, 75, 35,171,176, 74, 54,117,166,107,223, 18,190,156, -182, 90,143, 33,148, 36, 8, 96, 46, 50,108, 67,193,244,198,164, 20,218, 53, 19, -141, 28, 75, 61, 82,173,101,132, 66, 73, 46, 20, 12,111, 58,183, 41,171, 68,210, -191,233,167, 29,192,209,208, 77, 13, 32, 16,232,129,103, 36, 16,195,172,130, 17, - 49,179, 4,138, 38,136,106,107,247,231,118,236,190, 63,182, 99,248,180,171,247, -134,127,154,102,191,173,244,158,212,163,183,135,251,173, 86,231, 51,252, 88, 74, -109,107,113, 91, 32,153,153, 29, 18, 91,149, 75, 99,217,100, 50,205,197, 32, 3, -192, 2, 4,176, 20, 49,133,210,176, 66, 28, 32, 0,131, 88, 10, 65, 80, 36,161, -161, 42,239, 27,105,132,100, 88, 66, 81, 52, 84,197,139,181,157,243,120,235,164, -214,114, 56,147,202,234,222, 10,186,201, 78,121, 63, 65,136,195,178,221,249, 45, - 2, 56, 50,178, 12, 12,149,193,224,173,101,221,102, 0,105,187,235,223,253,182, -251,159,157, 30,234,143,238,177, 94, 7, 20, 6, 65, 72,198,118,122, 64,179,193, -116,218,196,117, 61, 43, 13,100, 84, 26,170,130, 93, 84,229, 50,121,203,249,108, - 1, 25, 57,237,217,231, 10, 2,147,203,126, 29,137,204, 5,147,201,182, 48,105, -228,218, 15, 33, 16,108, 49,177, 34, 92, 20,202,114, 89, 54,255,197, 14,212, 20, - 8, 30, 7,216, 2,219, 80, 25, 15, 44, 71,127, 75, 20,224,140, 40, 8, 97, 11, -182, 54, 89,164, 70, 72,105,127,224,131, 45, 24,195,172,170,218, 96, 23, 28, 30, - 89, 83, 89, 12, 36,151, 12,130, 6, 83,177, 38,150,230, 98,177, 64,211,132,167, -227,217,235,113, 53,118,149,231,189,175,118, 72, 78, 73, 96,130,220,239,201,237, -214,227,237,123,254,248,217,110,148,254,221,118, 26,167,117,151,238,157, 93,173, -247, 86, 33, 65, 24,130,165,199, 4, 39, 72, 0,137, 88,138, 34,201, 99, 98,130, - 4,100,128,219,217, 31,141,158,251,205,249, 3,107, 98,169,224,207,237,213,126, -122, 83,194,201,213,251, 40,127,172, 71, 64,176, 66, 93, 24,195,235,205,161, 19, - 99,154,178,217, 1, 82,236,177,235,164,240,102,235,164,184,118,186, 1,135,188, -246,102, 80,113,144, 48, 79, 27,154,117, 47, 82,168, 45,225,106,132,192,212, 99, -197, 48,250,108,183, 21,118,232,183, 12,106,164,116, 86,180, 10,223,107, 53,236, -239,141, 21,237,163,159,132,235,148, 33, 10, 70, 96,197,255,211,243,238, 84,111, -143,229,186,167,229,217, 12, 39,150,171, 1, 67,176, 80,124,113, 77, 44,151,138, - 51, 23,198, 44, 42,147,161, 28,100,104, 46, 7, 16,187, 48, 74,194, 13, 18,176, -139,127, 78,217, 30, 63,119,179,119,186,115,241, 19,233, 55,173,155,136,143,224, -220, 78,113,250,124, 62, 85,194,141,204,177,204,159,133,208, 90,141,179, 78, 13, -212,161,232,241,103, 67, 92, 33, 53, 72,104,144, 16, 49,100,150, 22,102,177,170, -139,210, 80, 37, 76,161, 59,235,134, 43, 2, 40,254, 8,106,174, 90, 44,128,167, -169, 97,236, 93,221, 78, 79,152,167,255,136,136, 72,231,222,174, 74,104,104,208, -108, 46, 18,138,227,247,217,225,126,150, 19, 29,160, 99,210,128, 24,128,176,199, - 90, 36,152, 89,178,193, 30,150, 11, 1,103, 46, 12,168, 10,195, 9, 8,119,253, - 24,104,168, 73, 67, 3, 91, 21,202,146, 73, 18,133,178,121, 60, 30,144, 7,137, -243, 61,116, 91,167, 7,221, 82,136, 94,244,180, 61, 77,189,185,190, 28, 57, 98, - 97, 25, 10,131, 89,154,254, 93,237,243,251,247,211,245, 43,222,195,237,159, 70, - 0, 34, 81, 33, 8, 38, 87, 38, 69,124,160,129,101,147, 81, 77, 96, 19,202,202, -100,104, 44,255,182,115,145,180,231, 69,118, 89,122,228,135,236, 1,214,239, 99, -233, 87, 22,230,150, 37,191, 17,107, 48, 74,130,112,196, 17,188, 63,107,199,172, -204,213,122,219,154,171,149, 28,174,248, 80,252,208, 24,113,245,157, 16,180,222, - 22, 98,188,159,225, 61, 97,181,236, 77,237,117,251,176, 29,188,143,130,195,140, -145,175, 45, 43, 56,169,144,223,218, 13, 29,164, 73,177, 69, 68,115,153, 52,165, -247, 78,234,158, 72,134,229, 68,205,191, 14, 4,141,210, 90, 78, 99,162,104,108, - 45,118, 94,251,136,200,193,119,168,246, 67, 48, 98,185, 96, 26, 20, 70,132, 63, -181,150,223, 27,244,118, 31, 51,222, 19, 65,211,227, 72, 84, 49, 71, 32, 96, 30, - 80, 24,199, 27,229,182, 89,103, 8,250,125, 59, 79,252,159,182,245,116, 14,198, -231,246,126, 81,138,126,250,215,157,127,118,243, 64, 30,232,129, 30,200,171,147, -161,228,129,234, 91,237,236, 38, 22,136,146, 29,129, 92,142,211,163,193, 60,133, -226,199, 35,211,122,177,157,175,209,225, 79,136,143,247,125,110,154, 7,134,115, -163,108,111, 57,159,179,241,239,207, 8,117, 62, 96, 4,139, 89,241,215,216, 30, - 67, 44, 60,183,245,246, 67, 43,179,209, 84,155,140, 6,131, 13, 48,170, 18,161, -130, 31, 22, 85, 69,132, 41,105, 96, 21, 89,176,130, 74,130,170, 94,211,198, 71, -239,139,119,155, 92,113,133, 20,140,149,113,203, 26,202,134,186,176, 38,145,233, -237,244,196,174, 57,210, 78, 30,248,114,243,235, 55,213,207, 89,227, 54, 39,113, -183,111,220,206, 80,131,210,205,218,194,252,136, 37,230, 44,123,136,248,129,229, -180, 30,168,221,102,168,121, 12,146, 28,182, 70,157,143,175,199,251, 13, 85, 67, - 69,250,232, 99, 41, 54, 24,140, 12,114,117,114, 68,115, 65,101, 38, 92, 31,195, -114, 53,168, 46, 20,137,165,114,177, 70,143,173,236,206,221,154,118, 15,121,210, - 44,229, 48,127,222, 71,158, 66,118,107, 14,115, 5,219,205,145,193,225,136, 60, - 1, 13, 96, 19, 75,231,115,255,249,232,184,207,214,230, 80,116,143, 86, 69, 93, -213,117,113,177,193, 66,110,189,246, 36, 32,100, 46, 21,171,146, 93, 92,178,143, -173, 27,245,123, 84,151, 37,135,222,168,195, 57,130,150,132, 76,205,204, 72,146, - 20, 50,140, 1,147, 64, 16, 12, 16,143,148,141,136,115,121, 26, 63, 35, 49, 51, -113, 41, 40, 9,149, 24,133, 51,132, 17, 98,136, 33, 36, 34, 34, 34, 34,129, 72, -144, 36,205, 3,231, 64,131,236, 46, 18,137,131,103,109,220,186, 99,101,166, 98, - 80, 55, 48,160,129,242, 8,245,194, 30, 51,189,226, 40, 43, 67,172, 32,211,185, - 43,107,108,121, 2,230,144,124,114, 0, 28, 43, 48,243, 22, 4,133,188,251,141, - 68,213, 4,143, 24,129,155,225, 41, 52,243, 21, 86,103,247, 18, 60,226,131,174, -149, 57,254, 81,255,105,208, 13, 14,140, 11,168, 99,158, 5,124, 53,175, 5, 30, -252,195,225,203, 8,185,123, 48,145, 15,206, 16,204,113, 79,153,172, 68, 84,241, - 62,221, 37,132,175,184,207,198, 44,182,137,137,154,228,195,158,219,111, 57,139, - 22, 72, 66, 55,183,204,122,141,105, 48,241,167,166,100, 96,193,109, 88, 17,214, - 67,175, 27,239, 54,225,174,112,132,103,143,227,225, 75,248,254,228,191,196,163, - 16, 88,185, 96, 25,193,121, 49,138, 78, 81, 5, 33, 41,211,149,102, 28,242, 25, - 90,134, 5,103,198, 37, 51,255, 48,196,181,144,219,106, 45, 55, 79,185,229, 75, - 20,133, 31, 12,131,232,151,105,100, 34, 62,179,174, 11, 77,105,137, 24, 0, 74, -198,132, 96, 73, 36, 5, 49, 66, 56,174,235,204, 53, 45, 76, 89,131,214,176,252, -154,229, 79, 69,143,115,236,232,169,184,111, 77, 87,115,202, 21,141,220,154, 69, -235,124, 98,169, 9,221, 48,109,179,144,186, 13, 62,158, 19,127,189,132,146, 24, - 8, 0,148, 32,108,108, 51,195, 34, 64,235,153, 2,162, 32,155,247, 45, 12, 69, -163,137, 44, 56,119,219, 49, 82,239,207, 78,136,176, 51, 23, 87,182, 55, 73,116, - 23,146,209, 42,242, 71,148, 6,161,171, 95, 51,199, 83, 60, 47, 14,199,162,187, -138, 62,108, 47,191,190,182,231, 0,158, 92,245, 18, 56,165,197,178,220,236, 36, -244,179,103,163,204, 58, 53,203,165, 36, 17,158,190,131, 44, 4, 37,226, 64,142, - 21,222, 24,183, 2,215, 48,117,193, 55, 81,241,136,237, 88, 98,152, 0,239,138, -219,201,124, 10, 75,181, 26,221,181, 1, 78,231,170,148, 5, 5,165, 58, 69, 70, - 8, 49,132, 81,170, 1,232,115,136,242,164, 13,170,182, 5,105, 37, 98, 57, 87, -212, 8,140,207,149,169,174,207,251,230,225,221, 87, 83, 95,175,161,176,110,113, - 62, 43,149,140, 7, 87,193, 21,103,151, 37, 72, 58, 26, 70,253,150,187, 6,117, - 91, 54,168, 66,251,178, 19, 79,194, 62,173, 60,254, 23,150,135,245, 56,196,139, - 70,204,134, 83,186,107,241,255,130,161, 7, 32,103,242,203,231, 13, 74,130,111, - 17,229,214,254,125, 50, 23, 25, 35, 82, 19,149,224,119,211,209,244, 41,159,224, - 49,146,251, 95,152, 92,179, 40,134,127,124,187,151,120, 74,190,147,218,124, 77, -154,238, 45,227,150, 63,159,195, 39, 94,234,102,213, 38, 14, 86,168,170,240,251, - 7, 74,128,147,178,247,214,176, 38, 80,190,111,180, 88,239,179,210,171,213,147, -165, 52,114,192,154,230, 75,184,228, 10,102,206, 33,253,124,170,129,106,169,208, - 60, 74, 7, 3, 93,153, 93,151,219,161,139, 87, 32,203,223,160,184,203, 83, 44, - 5,241,116,118,193, 73, 89, 18,207, 53, 98, 62, 52,104, 95, 34,156,166,241, 18, - 13, 20, 0,203, 64,130, 37,190, 97,251, 90, 65, 70,200,193, 96, 97,229,173,149, - 9,173,132,133,232,214, 54,163,143, 7,124, 0,214,136,198,221,150,128,107, 80, -105,107,133, 82, 64, 62,171,135, 36,175,160,197, 9,218,255, 82,107, 80, 16,118, -113,173, 50, 49,113,204,156, 1,250,248,209, 19,146,153,170, 57,220,158,146, 62, -245,205,210,151, 21,164,169, 8, 48,252,182,184, 73,200, 89,184,133,132,114, 10, -156,231,204, 34,169,197, 51, 15,160,176,178,145,241,172,122, 12, 0,206,154, 68, -194, 10, 91, 90,212,240,147,178,223,124,137, 65, 29, 87, 86, 73, 27,204,130,212, - 26,248,204, 29,113, 64,140, 45,218,182,249, 9, 14, 52, 14, 81,122,112,230, 0, - 48,137,104,155,147,128,248, 2,153,181,228,134,214, 44,127, 17,156,120, 76,207, -128, 13, 81, 0,226,223,244, 49, 83,147,190, 23, 30, 88, 13,113,213, 10,252,230, - 12, 63, 29, 7, 85, 27,144, 97, 89, 77,189, 52,211,181, 76,246, 44,171, 27,196, -158,138,185,221, 83,157, 50, 11, 13,247,126, 97,211,210, 62,177, 77, 46,121,101, -104,115,148,138,215, 84, 41, 35,159,120,220,112,190,236, 37, 31, 81,194,226,254, -227,245,193,181,189,115,180, 51, 27,210,194, 49,198, 33, 74,173, 0, 86,158, 47, - 1, 96, 81,104,117, 46,147,193,153, 77,216,234,125,237, 65, 32, 66, 52,241,209, -174, 97, 83,230, 42,175, 36,140,192,242,197, 79,190, 63, 84,132,229,227,207,163, -242,121,135,134,175,192,121, 70, 68,195, 7,232,218,254,120,131,234,224, 65, 43, -231,181, 5,242, 93, 60, 1,161, 12, 6, 66, 29, 0,120, 54,207, 39, 30,215, 31, - 76,153,239, 49, 18,106, 52,117,189,226,131,205,157,103, 60, 31,101, 33, 13,204, -227,175, 11,101,148, 47, 27,180,156,227, 70, 95,166, 87,239,179, 93,249,192, 13, - 71, 3, 21,187, 46, 29,200, 49,169,255,182, 94,122,246, 72,147,214,192,126, 34, - 76,206,199, 56, 26,172,118,228, 93,140, 34, 40, 7, 14, 83, 35,153, 78,150,137, - 25, 13,144, 41, 38,142, 60, 35,220,172, 34, 93,112, 85, 21,129,150,192, 26,156, - 46,248,209,139, 90,115,135, 49, 87,175, 10,143, 97, 4,206, 80,222, 34,142,136, -140,160,151, 26,182, 54,133, 3, 14,226,111, 16,122,199, 8,208, 83,183,115,153, -242, 99,206,210,213,221, 14,254,167, 34,101, 64, 95,223,189, 19, 73,112,169, 67, - 53,194, 82,113,207, 88, 63, 37, 97, 99,242,216, 54,146,222,204, 22,237,117, 1, -180,219,212,127, 68,121, 12, 86,220,120, 31, 17,144,165,201, 89, 88, 38, 87,204, - 69,241, 17,120,120,100,205,182, 65,252, 97,254,214,157, 20, 7, 10,227,216, 72, -136, 95,114,238, 37, 75, 88,250,152,129, 10, 76,239, 8, 44,146,223,239,112,162, - 0,122, 54, 99,201,241, 65,163, 94, 42,135,188,115,229, 18, 6,117,108,179,187, -210,244, 18,175, 23,148,239,191,191, 81,249, 2,197,103,156,248,155, 71, 26,231, -184,136,138, 73, 97,135, 3,138,183,112,215,234,151,184,155,177, 64, 36,187,220, -198, 33, 63,168,225,223,255,223,164,198, 94,119, 96,209,206,114,155,113,228, 32, -109,127, 25,141, 40, 80,176,178, 29, 10,250,164,168,112,149,228,235, 47,241,230, - 85, 11, 27,172, 10, 99,144, 2,128,207,148,124, 49,106,128, 40, 62, 61,253,172, -152,136, 23, 19,144,101,184,126,161, 72,144,176, 59, 88, 56,107,106, 43,244,191, -200,188, 20, 9, 27,184,120,202,223,166, 67,250, 83,128, 39,243,112,210,198,138, - 88,241,114, 98,220,191, 62,115,242, 38, 65,160,166, 65,123,116,158,110,216, 99, -255,111, 54,198,225,178,246,106,166,240,168,112,154, 21, 91,156, 3,252, 84, 83, -173, 39, 41,145, 3,149, 2,188, 12,118,207, 61,117, 86,104,136,140,195, 36,255, -136, 16,238,236, 48, 66, 48,163, 33, 66, 16, 51, 10, 69, 90, 71,222, 11,139,179, -204,195,254,215,231, 1,115, 50,190,125, 87, 59,144, 49,118,245,125, 58,131,248, - 48,143,250, 9,111,106,237, 88, 50,192,141,132,178,199, 22,243,112, 43,185,116, - 82, 87,127,220, 2, 3, 72,197,148, 37,168, 64, 26, 71,248, 74,186,106, 10,164, -134,144,150, 64, 40,114, 86,149, 77,190,133, 23, 78, 6, 42,176,208, 47,196,131, -113, 12,133,210,135,103,181,222,155,178, 2,142,116,217, 93,165, 4,155, 26,191, -106,193, 30, 74, 49,237, 32, 20,179, 94, 0, 84, 7, 33,153,227,246,116,243, 50, -199,120, 99, 41, 96,122,221, 6,192, 97,171,216,187,205,213, 30, 64,226,242,234, -224,100, 50,121, 43,112, 56,132,220, 19, 53,189,214, 79, 53, 63, 58,155, 63,146, - 57,165, 84,227,213,145,128,223, 63, 16,234,185, 25, 81,241, 54,159,147,243,231, - 71, 19, 8,101, 69,199, 49, 91,151, 9,198,175,204,149,155,113, 86,248,239,255, -230,141,251,255, 84, 83,142, 26,139,240,196, 2,123,106,113,243,136, 85,156, 61, -129, 54,217,233,106, 64,250, 86, 10, 88, 31, 41,155, 6,133,179, 52, 86,198,124, -128,123,238,237,254, 65, 42,118,223, 67,130,129,225, 18, 77,142, 1,102,114,195, -168, 29, 9,135, 96,183,213, 73,248, 81, 84, 11, 28,153,136,167, 4, 72,207,155, - 64, 24,227,127, 19,191, 35,213,100, 79,155, 91, 55,241,159,240,166, 27, 11,113, -188, 34,250, 3,255, 92,203,219,122,116,201, 99, 19,129,143,112, 18,132,164, 44, - 33, 3, 39,153, 7,124, 60,226,250,166, 17,240,187, 13,250,177, 61,134,107, 33, - 99,182,138,248,132,221, 6,242,137,173,158,255, 14,252,213,255,252, 87,188,170, - 36,194,217, 18,124, 26,236, 98, 3,162,125, 52,133,121,112, 2,135,215,225,132, -200,147, 94, 26, 0,212,129,235,185,113, 84,163,167,108, 68,208, 2, 44, 89,200, -141,168, 34, 71,150,142,149,137,228,251,129, 92, 96,248, 10, 8,245,245,208, 36, - 41,235, 40, 5,116, 82,208,142,126,155,104, 15,111,204,224,186, 46,192,132, 54, - 47,251,206, 8, 18, 67, 40, 32,179, 55,200, 76, 47, 17, 32, 5,129, 26, 15,174, -203,179, 86,211,167,133, 10, 85,224, 7,179,242,189,103,131, 22,131, 1,175, 53, - 22,130,114, 11,130,250, 84,168, 86, 64,172, 75, 69,219,140,159, 5,176, 79,229, - 31,150, 10, 68,131,186, 70, 33, 85, 95,187, 48, 2,192, 59,169,212,241,224, 65, -106,211, 65,149, 6, 38, 94,255,126,209,249,175,241,135, 54,220,138,181, 24,204, -152, 8, 6, 56, 99,130,164,184,142,152, 25,186,107,151,248,164,220, 22, 59, 85, -101, 13,145,246,198,197, 46,254,103,229, 59,203,170, 0,254,184, 77,226, 39, 23, -244, 50,220,151,139, 16,220,186,229, 19,199, 64,217, 46,125, 16,238, 25,118,157, - 50, 46, 39,136,242,165,105, 59,196,178, 7,250,247, 16, 70, 96,166,188,105, 85, -103,223,192, 39,118, 55,105,216, 21,204,254,221, 70,212, 34,134,100, 87,156,120, - 60, 18,176, 55,250,159, 40, 18, 40,246, 79,234, 63, 92, 74,172,224, 0,211, 78, - 43,180,121,196, 5, 0, 18,115, 15,201,217,216,218,177, 98,234, 56,241,230,236, -194, 29,208, 12, 1,249,204,240, 6, 45,227,100,202, 93,195, 97, 26, 81,109,149, -119,209,202,112,187,226,133, 78,212,239,180, 49,172,228,123, 21, 46, 2, 74,121, -124, 68,190,100,207,213, 62,206,176,188,199, 34,189,158,105,223,153,231, 84,253, - 49,168, 20, 50,225, 27, 35, 40,153,146,219,164,148,170, 18, 16, 15,121, 71,253, - 1,152, 86,141,194,250, 33,145,142, 46,140, 29,136,249,218,234,228,113,136, 86, - 35,190,180, 50,206,159, 5,180,174,114, 45,192,211,233,112, 36, 62,107,248,130, - 65, 68, 39,103, 41,112,175,244,236,141,255,212, 39, 64,230,255, 36,252, 41,194, - 84,209, 57, 37, 2, 89,121,124,216, 23, 92,216, 78,115, 13,230,248,121,112,185, - 6, 92,106,138, 82,140,131, 43,107, 59,201,198,198,201,147,200, 93,191,252,114, -124, 24, 36,168,244, 39, 55,212, 73,234,130,159,100, 10,203, 58,206,215, 12, 26, - 86,223,194,134,184,242, 78,129,142, 44,253, 27,213, 8, 40, 92,167,117,117,111, - 58,219, 79,142,147,221, 32,235,237,140,124,185, 16, 30, 87, 96, 11, 82,145, 65, - 7,115, 27,120,114,119,132,247,199,148, 0,136,116, 20, 1,139,145,224,105, 34, - 71,168,150,184,202,228, 78,120, 8,162,196,186, 19,170,244, 70,243, 7, 71,206, -116,147, 84,223,135, 47,120,224,200,136,188, 35,196,207, 8,136, 13,162, 68, 1, -241, 22,238,240, 83,126, 99, 58, 24,181,197, 14,203,140,142,200, 50,192, 80,232, -214,171, 35, 74,117,204,238,145,249, 43, 83,239,218, 88,230,155, 88, 81, 35,136, - 38, 23,188,195,144,148,246,143,191,243, 95,143,160,110, 54, 80,254,196,189, 61, -192,158, 26,222,152, 80, 31, 43, 73,247, 76, 33, 58, 97,240, 66, 38,112, 37,136, -214,242, 72,186,204,139,176, 76, 2, 27,168,232,229,206,200,216,130,239,138, 43, -120, 72,153,226,143,212,155, 93, 85,172,168,176, 48, 73, 37, 18,187, 41,209, 9, -192,156, 55,243,176, 49, 49, 28, 43, 68,185,118,138,201, 24, 83, 76, 65, 35,206, - 55, 31, 68,213, 37, 62,100, 94,243,146,201, 71, 74,119,191,130,145, 99,206,186, - 85, 12, 44, 75,240, 78, 10, 48, 21,145, 82,210, 72,164, 65,205, 99, 56, 83,124, -113, 24,224,206,167, 18, 41,165, 67,224, 7,230, 10,231, 4, 24,167, 58, 5,182, -141,170, 52,208, 62, 99,106, 56, 66, 17, 65,190,205,196, 34,171, 27,142, 1,180, - 7, 33,230,188,167,179,241,228,170,136,225,158, 81, 5,232,109,226,188,199, 35, - 92,177, 26,165,112,171,129,216,194, 28, 18,165,217,154, 55, 88, 47, 77,191,225, -222, 18,167,155,161,196,154,148, 40, 13, 94, 26, 41,107,160, 28,184,106, 63, 93, -102, 42,132,129,181,108, 44, 19,218,158,112,204,138,234,186, 37, 54, 21,132, 38, - 11,233, 38,151, 4, 5, 21,144,152,122,141, 54,248, 85,197,140,248,136, 4, 78, -194,251, 45,132,157, 20,189, 46,128, 57,172,204,220,131,108,254, 22, 9, 20,206, -251, 48,109, 31, 66, 64, 63, 16, 64,238,114,121, 68, 65,242, 7, 59, 31, 27,123, -155, 11,182, 43, 25, 80, 52,221,195,146, 88, 61,121, 87,219,206, 77, 12,104, 58, - 30,105,208,144,229, 88,181, 94, 41,118,220, 56,168,163,122,105, 98,187,125, 83, - 56,205,251,172, 67,123,220,213,197, 27, 22,247, 96,223,182, 86,146, 29,189, 92, - 91,161,167,238, 51, 43,219,226,109, 88, 38,163,207, 53, 2, 70,235, 25,154, 63, -234, 27,204,238,232,137, 11, 94, 14,170,197,164, 25,219,248, 38, 32,161,206, 11, - 21,255,226, 72,135, 75,105,120,183, 77,224,236, 59,174, 59, 71, 46,181, 62,135, - 57,222,134,200,149, 70,169,122, 25,106,243, 88, 68,251,181,209, 85,119,240,117, -228, 37,113,226,138,116,195,166,185,226, 4,222, 89, 77,170,112, 14, 93,148,197, -245, 60,171,128,142,193, 24, 89, 29,222,180, 3,106, 43, 50,184,179, 85, 48, 59, - 84,223, 22,149,130, 96,252,152,209, 31, 86, 93,227,106,174, 3,158,193,190,246, -124,167,128,138, 91,129,123,109, 81, 66,190,110,226,218,145,107, 52,112,211, 16, -219, 58,116,112,125, 95,244,103,130,123, 33, 57,217,183, 2, 64,174, 77, 91, 19, - 0,182,102, 17,106, 57,133,252, 48, 23, 92,249,187,145, 21, 24,197,111,148,186, -197,141, 1,155, 8,141,202, 90, 74,130,226,228,136, 99,148, 27,161, 1, 2,248, -227,210,126,179,123,145, 49,210,111,212,195,251, 94, 47, 37, 9,102,146,235,146, -227,132, 31,173,181, 95,142,214, 57, 32,101,114,118, 51,152,130, 28,248, 40,206, -204,243,217,192,207, 79,236,208,143,235,145,110,165,158, 31, 93,237,125, 92, 33, - 79,115, 53,160, 35, 72,120,128,185,221,190, 63, 75,157, 10, 90, 24,123, 23, 43, -222, 21, 97,106, 4,171,167, 81,181, 66, 78,239,217,239,109, 76, 93,238,119, 15, -121,191, 96, 93,165, 61, 53,155, 79, 87, 42, 76, 94, 95, 58, 31,224,120,120,196, -189,108, 2, 10,139,183,190, 3, 84, 74, 33, 72, 63, 20,165,128, 0,154, 54,133, - 21, 26,177, 70,187, 35,210,124, 21, 17, 68,185,166,162, 93,173, 75, 13,158, 12, -123,143, 63,189, 97,195,156,147,189,130, 3,205, 69, 12,101,225, 37,134,225,207, -158,114,233, 76,190,218, 50, 23, 69,239, 35,252,101,206,128,110, 29,143,177, 90, -117,237,120,139, 83, 10, 1, 19,169,121, 25, 92,122, 51,233,125,124,198, 30,114, -142,184, 44,231,168, 58,235, 98, 26, 87,222,127,120,195,110,200, 71,182,169, 56, - 36, 43, 40,174,242, 17,207, 72,110, 8,187,241,157, 53,201, 83,108, 84,168, 39, -221, 4, 2, 84, 97,137,168, 61, 5, 31,133,125,190, 86,161, 34,152, 72, 25,211, -196,156,192,188,118, 42,132, 4, 89,155, 48,100,228, 21, 78,232, 14,120,184,102, -161,208, 25, 8, 85,126,105, 49, 55,241,123,149,207,228,215,120,155,161, 93, 73, -200, 88, 21,151,176, 28,176,152, 98, 44,163,136, 14, 2,212,220,108, 85, 40,191, -161,196,230,245,163,141,251, 3,215,199,135, 10, 74,237,192,192,214,248,197,211, -147, 86, 1, 66,228, 62, 57, 22, 29,166, 83,107,203,135, 31,138, 2,164, 50,109, -190, 95, 7,244, 90,158, 74,207, 85,189,232, 5,104,126,104,241, 69,227,133, 31, -184, 45,159, 57,168,189, 2,255, 89,251,182, 18,205,185, 85,134, 92,150, 95, 61, - 5, 74, 68,243,147,214,198, 94,174,239, 24,249,205,139, 81, 29,246,137,174,221, - 46,229,202, 45, 12, 65,167, 14,121,131, 91, 20,133,136, 10,120, 14,225,167, 59, -202, 58,140,148,151, 40,162,192,163, 77,179, 9,133,182,122,174,192,124,102,130, -251, 3,210,155,254,156,177,164, 61, 67,163,124,124,184,242,131, 48, 72, 13,108, -200,139,197, 77,206,154,235, 88,170,227,215, 87, 47,180,193,165,171,149,198,157, -157, 48, 39,123, 39,162,203,120, 91,154, 51, 36,217,235, 74,173,215,122, 32,199, -246, 59, 4, 17, 9, 96, 66, 97,167, 89, 70,151,202,133, 10,154, 88,185,152,239, -230, 62, 40,124,166, 8, 26, 98, 93,168,151, 72, 66, 23,169,155,255,211,120,228, -112, 95,205, 98,218, 13,232,198,217,192, 98, 79,190,123,189,222,213,175,144,249, -192,109, 3,120, 64, 31,125,229, 19, 58,119,204,229,193, 93,217, 21,220, 27,192, - 68, 98, 75,222, 84,222, 90, 61,250,124, 85, 60,207,209,190, 82, 17, 90,127,195, - 63,244,132,165,244,135, 2, 46, 6, 23,245, 61, 16, 64,143,179,151,225, 62,154, - 45,191,218, 8, 55,198,120,232,180,204,231,121,119,118,131, 59,202,170, 5,192, - 0,218,249,209,134,130, 94, 72, 86, 16,238, 13,155,176,200,224, 87,200,176, 27, - 28,109,124, 6,192,116,232,254, 3,137,140,221,144, 35, 49, 94,210,225, 89,178, -223, 83, 81, 32,131, 7, 95,220,235, 60, 2, 17, 76, 52, 69,143,213,128,253,124, - 76, 72,223,145,254, 84, 37,136,251, 85, 35,230,148,198,212, 62, 17,238,202,203, -215,116,190, 8, 68, 48,196, 92,132,254,189,163,142,248, 49,142, 29,110,145,204, -234, 11, 6, 24, 0, 29, 17,115,210, 67, 2, 72, 61, 78, 72,174, 86, 69,178, 22, - 20,240,135, 21,223,146,109,126,196,104, 6,236,101, 6,148,148,124, 72, 16, 18, -210, 51, 62,227,205, 65, 82,241,239,193, 29,204, 44,192,214,208, 10, 16,221,236, - 73,179, 65,131, 47, 26,101,248,248, 12, 98,163,145,221,190,185, 78,187,210, 53, -173, 8, 97, 12,122,218,206,153,239,115,189, 7, 35, 65, 61,125, 36,126,238,134, - 72,148, 20, 63,227, 47,133, 95, 56, 10,246, 86,144,145,240,100,195,131, 82, 29, - 9,174, 90,212, 18,243,156, 60,177, 39,244,215,163,183,158,140,224,105, 51, 71, - 95,147,213, 3,106,206,122,203, 56,123, 39,221,115,135,115, 30,224,223, 95,230, -155,246,152, 61,241, 90, 30,224, 78,245,184, 79, 89,172, 15,211, 5,120, 13,218, -141, 84, 88, 52,212,153,254, 53, 73,141, 29, 59, 27,113,147, 89,237,223, 14, 3, - 97,188, 99, 8, 72, 32,103,243,167,115,104,160,112, 34,105, 28,103, 7, 42,194, - 29,107,103,150, 37,162, 75, 26, 66,157,120,232, 35,115, 31, 53,198,178,250,108, - 48,203, 88,190, 84,145, 17,101,130, 85,247, 29, 41,230, 9, 22, 79,100,177, 21, - 73, 60,112, 43,118,210,194, 21,154, 8,218,103,155, 42, 12, 24,131,204, 74, 21, - 53,243, 93, 9,224,181, 80,219,130,217,196, 28, 94,135, 40,236,110,164, 87, 83, - 23,106,213, 77,143,122,102,254, 70, 27,178,104, 80,172,254,191,138, 69,154, 34, -201, 23, 91,241,232, 9, 1, 44, 28, 14,173,207,238,251,207, 0, 74,249,117, 11, -198, 72,214, 52, 48,154,254,190, 34, 13,181,130, 11, 32,132,205,180, 85,240,150, - 45, 6, 68, 4,105,111, 0,159, 60,223, 52,196,170,137,211,214,116, 73,105, 12, -102,146,244, 27, 70, 4,245, 19,218, 14,235,172,173, 40,248,212, 72, 69, 26,224, -136,157, 73, 20, 2, 83,100, 33,193, 60, 67,233, 9, 18,107,179,137,177,152,180, -225, 85,140, 20, 7,204, 96, 89,161,135, 65, 18,116,154,240, 62, 87, 30,115, 65, -199,222, 89, 10,215,153, 10,132,204, 42,219,196,129, 37, 54, 72,225, 1, 46,169, -212,242,184,247, 31, 41, 31,104, 60,137,168,113, 9, 46, 30,193,219,110,163,146, -162,185,138, 54, 58, 87,201, 30, 36, 58, 2,166,142,224, 75, 86, 28,214,185,146, -133,126,196, 86, 36,102,254, 23,238,114,201,237,252,200, 82,145,180,151,175,249, -232,234,153, 40,225,159, 90,177,178, 27,205,195, 25,103, 49, 66,114, 81,243, 77, -148,114,184,184,169,189,238,177,165, 94, 81,135,130, 96,254, 57,160,202,206, 87, - 26, 13,160, 27,100,143, 0,198,180,164, 40,208,206,204, 3,200, 4, 1,156, 94, -173,164,204,193, 47,109,144,152,219,117, 27, 76,167,223,198, 11,163, 66,165, 87, -141, 55,105, 14, 93, 70,169,135,163, 84, 76,151, 0,153, 0,150, 0,243,167,231, - 63,122,235,165, 25,113, 22,142, 94,100, 42,149, 63,251, 79,254,159,105,101,232, -165,114,246,201,103, 40,202,117, 12,235,196,132,236, 72, 42, 73,181, 61, 8, 8, -221,107, 52,205,194, 70, 18,127, 86, 29,123,151,241, 5,237, 91, 67,171,181, 20, -189, 56,138,117,239, 43, 99,171,250,124, 52, 28,107,166, 19,140,195, 30,219,111, - 24,199, 61, 48,236,241,152, 85,231,193, 56, 11,245,255,213, 3, 88, 28, 58, 85, -204,143, 72, 56, 23,136,193,191,158,244, 60,129, 64,246, 43,221, 85,135,159, 59, - 77, 95, 73, 11, 58, 98, 15,230,241, 55,100,251, 15,233, 19,253, 1, 53, 17,249, -200, 15,238, 35,167,154,154,145,125,146, 89, 52, 30, 44,254,190,164, 14, 7,195, -209,127, 55,244,169,141,198,108, 52,230, 64,196,208, 55, 23,219,155,235,166,164, - 69, 23, 63,227, 39, 47, 17,137,120,142,177,173, 71, 65, 12, 34, 84,247,168,200, - 68,144, 60,229, 35, 4,145, 73, 82, 77, 74,213,221,104, 80, 74, 69,137,222, 77, -133, 33,121,167,206,117,127, 52,211,137, 15, 1, 82, 77,108,208,173,225,115, 42, - 70,253, 82, 61,231,148,200,104,127, 92, 64,226, 17,111, 60,223, 59,215, 11,235, - 33,227,223,246, 87,179,253, 72,209, 83,254,243,128,120,138,190,178,109, 28,221, -171,121, 95,237,145,250,130,234,215,218,226, 29,122,244, 45, 78,194,180,167,244, - 1, 89,230,210,173,241,119, 45,132,131,209,186,141,129,123,200,239,108,161,165, - 72,244, 82,212,177,118,136,190,166,216,218,242,128, 75,107,136,113,197, 17,194, - 97,181, 33, 87,177,100, 90,213, 54,180,173,183,201, 16,255,215,139, 69,114,227, -235,105,143, 2,112,172,211, 50,205, 53, 33,186, 76,151, 89, 18, 64,245,126,213, - 86,180,125, 91,233,241,148,128,231,209, 7, 20, 84, 20, 47,185, 5, 65,178,211, -250,242,148,119, 76,211,116,171, 72,130,232,215,195,122, 49,234,154,121,201,103, - 9, 90, 23, 4, 74, 60, 2, 41,229,147,111,141, 90,207,244,118, 42,149,241,228, -144,230,214,180, 62,190,210,156,255,185, 56, 13,153,132, 94, 48,241, 78,241, 78, -224,160, 89,184,142,219, 50, 79, 39, 53, 87, 58,207,150,185, 56,145, 65,165,191, - 2, 44,214,132, 62,123,159,214,179, 21,206, 57,231,188, 28,241,220,128,124,150, - 19,140,248,243,114,150,115,122,233,187, 47, 77,209,192,192,165,102,127,233, 5, -175,213,118,187, 48,215, 38,115, 89,182, 76, 65, 84,180,214, 66,166, 81, 88, 30, - 54,135,136,231,190,245, 98,170,181,221,151,138, 53,131,149,157,189,203,214, 93, -155,205,133,209,128,121, 83, 81,164,160, 48, 83,206,163,170, 54,144,241, 81, 85, - 34, 4,203,182, 77,211, 52, 23, 77,198,130,125, 55,227,208,214,111,211,201, 48, - 10, 19, 87,118,117,156,134, 5,135,223,168,211,156,177,162, 77,146,230,179, 3, - 17, 12, 48, 10,203, 99,114, 49, 11,115,241, 3, 83,128,146, 80, 29, 34, 5,203, - 81, 16, 48, 33, 18, 33,140, 24,194, 8, 33,132,136, 4, 34, 66, 34, 82, 18,169, - 3,247, 14,179,210,244,144,142, 74,136,207,136, 84,173,252,144, 67,237,166,197, - 21,182, 82,206, 32, 13,110, 29,153,105, 67, 83, 53,225,176, 68,109, 40, 49, 48, -163,213,210,104,188, 84, 17,195, 17,105, 75,122,205, 28,118, 49,242,124,212, 10, - 59,241,210,118,196, 84,234, 21,147,248,105,220, 99,132, 44, 48, 80,121, 10,158, -180,148,123, 47,244,243, 5, 52, 44,211, 13, 75, 27, 36, 76,233, 97, 97, 68, 57, -137,134, 17,136, 46,214,132,216,166, 25,126,178, 33, 85, 62, 73,204,152,199, 8, -221, 6,151,101,105, 28, 77,100,148,125,198, 82, 69, 3, 18,221, 80,228, 73,183, - 33,108, 69, 38,110, 84, 20,133,190,137,188,166, 30,109,236, 35,162, 81, 15, 26, - 4, 47,173,226, 87,181, 99, 54, 75,182,242,128, 42,163, 65,141,113, 50,162, 48, -163,221,221,251, 93, 53,230,215, 64,223,111,195,189, 67,130,247,110,211, 29,132, -113,244,180,198,184,237, 20,228,185,103,196,220,153,113, 4,225,226, 65,138,251, - 43, 0,141,214, 15, 89,243, 36, 1, 43, 72,250, 31, 23,155, 18, 1,204,248, 90, -196, 38, 27, 62, 13,248, 53, 99, 83,244, 5,112, 27,210,242, 71, 22, 85,250,177, - 71,219,205, 90,238, 7, 51,188,172, 29,161, 37,107,238, 55,250, 61,214,216,111, -139, 81, 14, 24,234, 85,163, 59,249,177, 49,232, 32, 63, 91,217, 64,174,140,169, -139,170, 34,108,108, 66,185,254,193,175,161,227,107,163,187,174,234,189,166,120, - 8,205,183, 71, 94,147, 21, 26,228,107,119, 8,181, 0,249, 26,226,214,226,109, -173,174, 75,100,174, 99,131,186, 6, 91, 94,238, 60, 10, 97,196,163, 57,130,201, - 73,206, 46,132,249,194,203,161,163,114,221,140,108,235, 89,183, 52,128,124,240, - 95, 51,247, 91,126, 3,203,177, 7,117, 52, 2, 24, 8, 35, 11, 44,108, 74,245, - 70,242, 65,239, 16, 46, 68, 20,193,141,238,176,158, 26, 86, 71,113, 58,250, 80, -243, 63,122, 19, 95,221, 13,155,124, 80, 23,144,100, 56,158,133, 56, 74, 6, 30, -107,149,130, 12, 33,145,204, 50,162,250,110,215,123,215, 46,245, 31,228, 76,167, -112,251, 59,252,136, 62, 60, 20,163, 85, 68,207,123, 87, 11,117,106,123, 64,124, -116,220,180,242,145, 3,245,145,126,222,114,216, 70,237, 55,126, 13,138,134,221, -159,149,100,209,236,188, 26, 58, 97,242,107, 59,202,200, 51, 52, 22, 8, 48,158, - 26,141,153,208,145, 23, 81, 12, 81,239, 88,106, 4,205,196,178, 52,138, 17,156, -243, 77,184,144, 94,101, 23,173,105, 96, 94, 14, 42,149,234, 34,242,141,100,129, - 2,210,105,102, 19,236, 33, 53,165,208, 67, 10,174,215, 13, 85, 57,200,235, 62, -154, 22, 6,235,232,140, 51, 1, 31,146,186,241,193, 22, 54,197, 54,233, 29, 54, - 49,247,168,153,158, 70,205,134,133,205, 50,102,252,207, 24,155,198,104,213, 37, -228,244, 89,200,115,220, 92,104,186,160,175, 24, 33,233, 84, 7,148,252, 52, 47, - 26,209, 49,101,228, 28,162, 43,197,153, 53, 26,103,190, 83,238, 52, 61,228,215, -139,235,107,178,190, 69,105,112, 53,208, 45,110,216,181, 29, 65, 75,198, 46, 14, -167,232,236, 1,208,230, 40,129,134,100, 85, 70,244, 8,241, 15,181, 80,136,152, -185, 70, 27, 7,155,224,220,221, 79, 9,140,244,212, 58,182, 25, 70,184,160,227, - 67,133,116,139,206,209,243,229,154,253,232,122,166, 80,130,162, 90, 3,125,168, - 53,197, 67,138,243, 19,255, 62, 42,197,123, 56, 89, 49, 81,247, 67,121,154,220, -148,196, 5, 57,158, 0,135, 17, 12, 59,138, 7,202,220,188, 2,225, 44,207,182, -202,237, 44, 88,167,134,221, 47, 10,174, 37, 31, 66,136,186, 54, 69,113,203,246, -204,191, 98, 94,203,178,167,122, 47,203,102,230, 51, 93,154,209,108,232,211,150, -144, 28,159,123, 13,127, 52, 23,227,150, 36,130,212,109,129,207, 31, 73,230, 48, - 22,170, 87, 42,155, 90, 56,249,199,185, 76,227,240,174,130,139,146,154,180, 25, -185, 45,156,221,116,227, 19,152,242,193,103,102,238, 77,203, 33,193, 80,187, 15, -144, 79,170, 6,228, 74, 94, 58,210, 64, 36, 18,145, 98, 84,172, 69,222,138,197, -118, 64,251,160,170, 48,208,141,104,115, 73, 33,214,212, 39,105,163, 20,119,218, - 82,140, 28,167,158, 39,215,169, 86,255,220,119,227, 4,148,105,166, 76,101,154, - 41,167,208,164,157,185, 82, 15,235, 56, 6, 20,226,210,168,132, 99,205, 73, 57, -229, 9, 64,130, 54, 29, 65, 51,254, 93,201, 99,136, 37,192,213, 30,234,160, 48, - 2,232,218,167,255, 13, 87,134,102,243,211,117,220,191,120, 28,128,247, 66, 90, -248, 26,250,218,194, 23, 99,223,178,159,200, 4, 47,249, 54, 48,229, 18,131,186, -122,141,125,217,102,161,121, 85, 74,120,108,148,164, 27,121,143,113,172, 51, 82, -155, 26, 5,126,150, 88, 8,220,102,207,171, 76, 95,126, 36, 15,179,120,101, 8, -238, 25, 62,169,145, 63, 50,163,236,137, 69, 46, 18,200,250, 20,128,245,192,202, - 74,176, 21, 29, 95, 33, 0,232, 49, 85,180, 75, 84,186,145,209,212, 51, 70, 48, -149,252,174,177,249, 65, 1, 85,194,166, 88,229, 80,148,160, 38, 28,126, 55,161, -105, 0, 0,164, 37, 64,185, 36,241, 62, 54, 7, 34, 75,209, 9,224, 19, 51, 13, -183,228,107, 66,225, 41, 19, 8,252,136,180,137,215,183, 61,120,171,202,160,174, - 16, 15, 58,179,179,140,246, 54,130,209, 34, 76, 59,131,112,104,168,163, 73, 95, - 38,134,146,218,235, 18, 36,242, 68,217,162,193, 34, 79,233, 32,126, 44, 1, 71, - 90,170,146,212,236,190,236, 23, 63, 62,228,147,149, 52,162,116,255, 8,204,227, -146, 5,153, 95,227,126,129, 70,204,247, 69,180,136,208,130, 71,196, 36, 35,205, -132,248, 64, 87, 53,188, 10,210,165,145, 49, 74,246,100, 69, 62,129, 98, 26,198, -137,235,136, 49,217,139,251,175, 72,233, 90, 53,163,187, 61,193,253,214, 32,195, -236, 1,164, 21, 11,125,207,244, 46,210, 88,139, 59,220, 75, 30,219,166,194,247, -149,130,223, 82,171, 50,198,216,246, 23,145,114, 39, 97, 89,221,147, 17,147,253, -188, 25,224,246,199,214,240, 8,215, 30,178, 4,249,243, 89,228, 3, 92,133,159, -135,178,168,150,143,196, 18,182, 40,205, 93,116,194,143, 73,149, 4,129,244,208, -215,170,119,138,100, 82, 75, 91,193, 56, 40, 57,148, 58, 8, 30, 19, 49, 71,238, -252,183, 33,164, 53, 84,101,101, 33, 26,173,181,223,231,125,137,120, 16, 63,123, -225,197, 65, 31,245, 81, 84, 27, 53, 73,240, 76,109,162,108, 47, 34, 10, 31, 18, - 15,249,121, 98, 37,109,200,220, 1, 34,231,130,219, 44,211,146, 90, 73, 85,151, -208,215,102,172,175,103, 49, 18, 88, 55,226,105,229,150,238, 67, 33, 71,231, 82, -226, 12, 81, 18,242, 89,226, 96,236, 91,195, 85, 9,223, 82, 61, 1,134, 80,228, - 99,135,132,190, 26,110,149,239, 77,120, 38,197, 30, 10, 64,179,175,167,200,170, -104,205, 61,159, 34,102,153, 27,255,247,174, 22, 53,242,225,231,183,230,113,253, - 60,221,208, 60, 73,190,171,255,113, 42,103, 64, 70,252, 51, 28, 86, 45,208, 93, - 76,140,174,228, 64, 36,203,217,182,190,142,226, 3,171,131, 32,102,154,150,138, -226,110,104,184,227,143,236,214, 51, 90,164, 50, 51, 78, 23,141, 12,157,241,163, -148, 1,161, 91,116, 25,244,203,216, 67, 59,161, 97,213,232, 63, 8,187,199, 80, - 75, 91,201,232,151,244,206, 37,212, 37,209,194,156, 78, 45, 52,154,116, 74, 25, -133,105,241,156, 72,198, 65,190, 94, 49, 26, 83, 73, 75,193,207,199,111, 34,192, -154,156, 19,226, 50,156,167, 87,210,177, 9, 41,126,200, 10,229,214, 73,233,214, -179, 52,153, 73,182,221,158, 24,219, 40,147,133, 54,218,144,169,229, 80, 51, 41, -165, 30, 71,241,226,253,143,214,214,167, 9, 67,248, 89,246, 44, 61,228, 32,204, -148,107, 81, 23, 95, 32, 29,186, 13, 65, 3,196,193,207,154,103,254, 97,145,222, - 43,133,125,179,180,238,253, 94,236, 44,162,149,140, 51,211,206,196,201,129,224, - 71,209, 42,233,224,251, 25,136,100,140,127,124, 86,164,198,185,195, 68,216, 92, -231, 57, 58, 7,126, 40,230, 34, 70,193,225,237, 55, 57, 69,190,204, 3, 66,184, -230,173,192,185,211,167,182,231, 28,217, 91,180,184,224, 81, 42, 55,196,107,157, -156,101,217,120,179,172, 24,133,110, 95, 7, 44,202,212, 88, 54,143,210,232,210, -248, 35,200,190,167,127,231,126,234, 2,159, 79, 58,244, 91,192, 39, 90,250,121, - 95,223,109,216, 23,133, 98, 82, 64, 53,216,127, 13,193,123, 20,117, 66,163,112, -198,140,175,145,216, 28,204,230, 41,105, 30,155, 3, 1,189, 68,174,152,218, 77, -173, 90, 70, 33,222, 71,146,238,127,119,174,157, 43,143,152,134,244,120, 16, 80, - 67,167, 62,133, 44,192, 2,252,254,236, 41,120,222,202, 64, 29, 9,156,205, 23, -122, 84,229,165,184, 21,138,201,121,248, 53,176,175,181,235, 8, 62,173, 88,218, - 91,194, 70,223,202,237,159,233, 69, 37,186,198,168, 58,160, 76,133,185,120,169, - 77,200,169, 68,203,117, 54,242, 30, 6,168,107, 78, 42,222,155,144,164,254,211, -217,163,175,123,240,100, 8,253, 82,254,114, 16, 49,168,137,173, 93,184, 73, 64, - 54,135, 87, 58,134, 38,230, 54, 32,107,116, 76,157,211,134,232, 85,237,121,229, - 24, 78,179, 0,137, 42, 1, 94,104, 82,224,154,105, 9,190, 81,183, 66,254,136, -248, 3,172, 25, 5,242, 56, 19, 59, 49, 4,172,103, 44, 78, 48,236, 65, 60, 52, -179,125,225,126,255, 95,251, 1, 10,131,213, 10, 8, 27,206,204, 8,232, 40, 96, - 73,238, 14, 64,179, 66, 88,254,136,141,188,160, 9, 25,194,100,155, 67, 75,233, -197, 28, 73,214,128,112,186, 76,121,186,215,137,135, 50, 43,132, 74,131,137, 1, - 58,147,175, 81,230,140,204,240, 97,158, 85, 71,247, 0,148,229, 14,237,147, 19, - 5,131, 58,114,149,211,243, 51,234, 37,156,153,127, 5, 3, 61, 67, 10,146,163, -105,234,160,229,139,255, 3,217, 26, 82, 58,159,152,215, 97, 25, 94,152, 87,111, -106, 9, 20, 79,205,150,198, 4,194,183,250, 0,249, 4, 31, 36,220,104,158, 26, - 46,235,178, 42,232, 82,198, 63, 98, 31,235, 36, 76, 28, 43, 37, 80, 95,150,240, -172, 4,226, 4,102,198,136,235,153,104, 64, 86,231,134,130,178,167, 88,168,240, -221,148, 98, 27,229,159, 1,110,202,235, 22, 51,209,190,102,149, 56,202,215, 49, -160, 82,222, 12, 41,121,200,153,135,196,237,222,162,174,139, 47,143,107, 32,116, -183, 66,129, 7,119,246, 35, 21,238, 40,129,128,160,158,173,229,166,170,234, 70, - 75, 32,152,227,185,179,121,112,186,225, 88, 11,251,216, 28,116,195,149, 64,131, - 72,132,182,246,197, 15, 90, 10, 90, 74, 74,171,243,255,168, 48, 7,168,250,122, -244,132,102,163,174,161, 36, 25, 32, 99,155,176,248,131,192, 61,223,178,234,220, - 96,247,202,232, 24,223,254,122, 44,221, 2,109,114,122,207,254, 13, 79, 24,223, - 99,216,203,138,133, 11,157, 33,135, 49, 10,192,193,239,196,197,245,233, 57, 87, -188, 6, 3, 29, 49, 86,183,106,236,238,180,221,130,107, 93, 40,253,120, 65, 76, - 39, 99,221,217,255,244,114, 31,250,189, 91,237, 92,176,109, 85,213,237,155,115, -170,184,192, 45,138,235, 57, 16,153, 9, 74,229,141, 86, 8,248,125,155,237, 87, -247, 99, 79,124, 68,193, 2,211, 67, 66,229,212,154, 70,102,209, 40, 45,246, 48, -218, 61,234,116, 54, 41, 49,122, 95,211,240,159, 74,233,246,122, 70, 79, 8,167, -192,177, 51,149, 51,122,119, 93, 68,199, 4, 2, 63,235,245, 52, 97,138,113,123, - 23,149,225,156,126,250, 86,103,229, 62,120,117, 55,238,125,161, 65,227, 88,218, -147,126,189, 54,112, 19, 43, 12, 61, 74,203,154,180, 9,208, 34,113, 56,240, 10, -221, 3, 2,165,102,224, 86,138,188,198, 18,107, 86,217, 58, 5,246, 12, 81, 9, -124, 91,172,155,248, 83,100,130,116, 24, 44, 43, 32,150, 49,135, 50,193,162, 38, -171, 23,126,231, 35, 25, 29,229,190,165,244, 17,160, 61,157,192,240,220,252,145, -198,154, 1,202, 95,152,205,205, 21,189,142,112, 46,109, 56, 21,232,116,255,249, - 48, 96, 4,219,205,171,249, 54, 39, 64, 43,169,253, 75, 55,194, 62,162, 25, 72, -187, 80, 45,243, 83, 58, 35,212,160, 91, 37,202, 19,116,181,121, 81, 34,121,110, -202, 4,255,174, 66, 6,104,133,191,106,166, 68,175, 43,188,157, 71,249, 48,195, -242,194, 30, 63,104,141, 52,176, 14,210,117,136, 53, 7,137,162,206, 38, 58,151, -136, 16,135, 48,129,220, 15,128, 53,132,168, 68, 70,253,103, 42, 10,209, 19,153, -213,207,169, 24, 68, 37, 50,194,222, 37, 2,209, 64, 9, 56,101,136,128,101, 34, - 3,137,169, 58,176, 24,244,130, 10, 68, 48, 64,168, 56, 96,228, 56,194,184,161, -197,117,188,247,134, 76, 18, 42,186,142, 47,109,152, 73, 66,197, 17, 99,171, 69, -184,161, 37,145,129,128,254,121, 33, 35, 13,232,151,137, 26, 5,151,220,111,255, -199,148,156,253, 55, 68,134,132,212,244, 47, 12,242,159,221,215,217,143,221,194, -183, 18, 92, 4,232,226, 76,190,229, 25, 27, 20,195, 62,102, 55,163, 63,102,175, -104, 72,151, 61,165,194, 4,148,134,142, 26, 97, 57, 37,188, 16,243,122,225,145, -120,176,204,201, 33,170, 0,203,113, 6,153,192,106,156, 98,177, 16,253, 36,148, -197,170, 67,108, 45,235,107,207, 9,145, 85, 29, 75, 21, 23,224,190,132, 84,165, -169, 52,205, 1,190,141, 72,229,252,229, 1,120, 87,192,169, 58,177,197, 38,250, - 80,177,189,254, 37,172,145,169,134, 18,117, 35,119,155,210,225,218,211,227,201, -192,231,180,188,146, 42, 63, 85,233, 64,154,248, 47,194, 47,148,207, 18,130, 55, -104, 54,238,253, 76,199,179,103,186,246,127, 21,249,185, 56,198,204, 10,145,119, -205, 61, 63,135,162,243,179, 70,164,109,144,123,222,215,137,133,248,148, 93,100, - 12,136,212,130,244,141, 2, 50,159,111,154, 84,192,129,202, 36, 93, 53, 12, 54, - 72, 10,219, 94, 59, 22, 53,135,117,126,226, 19, 49,111, 15,242,190,222, 94,121, -255,143,175, 82, 66, 46,176,126,188,140,229,149,147, 54,202, 73, 34,247, 11, 61, -160, 84,187,251,209,139,182,206,192, 76,134,147, 40,107,225,176,162,214,168, 76, -112,136,158,242,195,103, 67, 34,165, 90, 49, 2,141,242,164, 96,145, 83, 53,196, -145,142, 77,120,227,129, 76,234,179,179, 80,163,138, 52, 87,204, 74, 91,244, 54, - 23, 32, 76,136,158,234,225,123,157, 24,129, 82, 88,249,176, 60,132,218,123,135, -225, 17,144,111,192, 38, 16, 13, 32, 63, 51, 84,149,117,155, 55, 63,104, 40, 36, - 15,188, 15, 51,112,151,104, 73, 16,154, 71,246, 47,210,136, 29,211,116, 83,108, - 58,229,173,140,251,192, 47,144,100, 66,183,255,153,150, 56, 15,110,227,131,171, - 9,192, 81, 98, 36, 21,121, 48, 42,228,183, 16, 73, 4,120, 19,139,245,166,154, -254, 59,178, 66, 30, 25,255,102,196,130, 78,193,240,130, 38, 45,194, 13,134,100, -115, 53, 61, 59, 32, 46,133,163, 5, 99,200, 44,130,230, 32, 19,171,251,217, 38, -200, 68,207, 51,154, 83, 43,107, 1,112, 16, 90, 0, 39, 24,138, 64, 26,156,230, -195, 92,207, 68,109, 98, 97, 61,181,153,150,136,152, 88,175,108,230,111,154,247, -248, 12,204, 86,194,169,178,244, 54,227,115, 29,191,102,122, 73, 47, 24,200, 28, -213,124,118,135,143, 38,103,224, 25,214,199, 9,140,159,144,176, 48, 75,109,120, - 26, 14,167,151,162, 62,144, 26,236,185,230, 94, 72,100,114,157,114, 51,248,112, -240, 97,179, 68,245,193, 25,195,163, 24, 61, 67, 50,255,121,254, 28,199, 4,151, -241, 52,229, 17,206, 37, 61, 3,222, 12,101, 94,206,192, 28, 44, 31,148,112, 10, - 13, 37,185,160, 9,197, 34, 39,241,173, 83, 94, 49,112, 53,224,196,133,236,166, - 2, 41, 31, 27,246,136,156, 58, 65,175,112,138, 9, 99, 92,101,200,127,153,176, -131,143,222, 99, 43,112,198, 90,214, 27,226,240,118, 35,245,172, 47,165,111,244, - 23,241, 28, 10, 63, 69, 58, 7,219, 25, 82,200,222,226, 78,132, 11,146,129,168, -151,112,135,152, 1,168,133,160, 37,133,238,129,196,132, 22,195,159, 92,224,191, - 79, 24, 96,129,252,174, 19,237,191,239,130, 91,136,250, 24,128,235, 46, 45, 44, -118, 79, 15, 77,120,105,185, 61, 21,202, 29,125, 78, 35,104, 0,212,156, 14,234, -154, 23,195, 26, 16,254, 23,202,176, 12,213,170, 47,234, 43, 6, 83,216,196,116, -171, 75,211,111,250, 61, 90, 46,104, 58,118,162, 43, 86,212, 73, 38, 31,105, 42, -150,107, 41,130, 16, 6,142,169, 21,245,132, 85,202,180, 73, 46, 32, 66,122, 15, -148, 45, 93,121,243,193,120,172,135,152,122,133,183, 57,187,156,242,135, 36, 15, -192, 99,252,133,217,159, 34,111, 62,157,138,181,138, 56,254, 64,125,182, 63,225, - 77, 10, 59, 74,180,238, 28, 61, 6, 78,146,220,177,107,179,201,247,200,205,164, -210, 97,206,255,172, 88,196,142,202,216, 90, 34,154,195,148, 64, 34,139, 72,205, -102,111,164,123, 84,255, 67,236,171,116,231, 86,211, 90,214,104, 9,211,148, 96, -254,141,214,214,220,170,139, 99,231,111, 51,235, 97,213,245,170, 72,197,116, 70, -203, 71,159, 45, 2, 25,164, 75,197, 28, 72,109, 63,251,118,183, 53, 61, 41,163, - 83,172, 28, 26, 0,219, 82, 2, 42, 20,223, 66, 64, 59,173, 95, 46,104,169, 97, - 86, 13, 32,236,173,105,225,166,124, 90, 61,154,203, 68, 50,250, 29,123, 5,210, - 61,232, 66,194,233, 73, 8,107,130, 74, 42,222,134, 53, 90,105, 16, 29,214,159, -253,226, 10,192,196,243, 52, 64,178, 50,159, 88, 18, 10,152,209, 4, 76,166,130, -164, 23,221,157, 9, 25,106,228, 19,176,172, 13,207,112,100, 52, 90,115, 29, 36, -119,129, 90,254, 67,202,215,209, 96, 19,194,202,106,219,126,236, 29, 1,250, 74, - 0, 14, 40,192,210,209, 3,176, 86,175, 89,221, 15,178, 39,184,195,148,106, 9, - 67, 63,210,226,180, 7,128,185,238,222, 45,255,209, 11,251,227,233,119, 21,133, - 44, 10,184,217, 0,216, 0,217, 0, 27,149, 8, 28, 7,125, 73, 36,215, 74,168, -156,156,102,138,146, 48, 77,153,234, 79, 84, 5, 93, 56,151,204,196, 80,237,243, -194,228,135,208,106,242, 44,253,167,125,127, 51,107,237, 71,201,207, 99, 18,108, - 21,214, 14,136,183,211,222,254,212,190,158,182,245, 92,187,138,107,200, 47,167, -186,104,151,170, 71,167,213, 33,130,216, 68, 52, 80, 60,135,174,247,243,234, 11, -107,135,152, 39,208,227, 84, 59, 17, 44,231, 9,110,207, 84, 61,254,107,103, 16, - 39, 19,210, 52,152, 84,233,233,169,131, 25,225,160,124, 55,211,141,148,253,197, -231,129,211, 28,166, 91,234, 50,161,121, 38, 32, 68,158,207, 69, 68, 71, 55, 91, -167,138,118,219, 85,121,215, 19, 45, 4,121, 58,237,237,157,181,189,163,139,135, - 51, 48, 96,159,126,134,208,171,204,164,108,138,167,202, 86,149,198, 17,105, 28, - 44, 20, 90,174, 84, 48,253,212,196,186,187, 77,101,238,254,120, 84, 63,167,149, -237,196, 6, 25, 79,114, 14, 88,146,251,177, 68, 99,137, 25,122,237, 20, 90,203, -107,101,187,214, 1,181,103,172,145, 57, 28,207, 26,244,219, 69,154,118, 25, 49, -140,210,239, 76, 36,203, 50,195,147,122,189,121,214,242, 84, 41, 35,108, 0,159, -253, 23, 74, 82, 80, 56, 96, 56,144, 30, 59, 85, 93,117,102, 7,155, 76,218, 77, -118, 83,128, 25,200,206, 18, 20, 24, 90,211,180, 13,221,168,231,209,142,187,190, -174,234, 38,153,118, 74,137, 73,172,177,174, 78,142,166,154,158, 44, 77,109,131, -116,183,219,234,158,244, 84,181,247,178, 59,219, 3, 13,251,160,238,152, 13, 48, -236,130, 76, 77,245, 63,227, 97, 2,192, 84,100,197, 84,243,192,128,199, 13, 93, -242, 71,250, 84, 60,116,104, 26,218,249,118,237,207,230,190,237, 39,103, 89,118, - 83, 9, 81, 90, 98, 28,163, 80, 18, 82,214,141,148,244,163,114, 62, 62, 32,198, -138, 31,149,174, 20,108, 36, 34, 9,118,182,232, 87, 11,122, 29, 32, 36, 44,124, -237, 15, 14, 33, 52,176, 44, 14,214, 36,131,191,239,251,162,133,177, 87, 58, 58, -157, 30,152,118,220,173,165, 59, 97,177,104, 28, 68,156, 0,173, 83, 1, 59,163, -208,170,156,188,205,100, 65,206,176,126,147,233, 6, 84, 56,238,179, 84,124, 39, - 59,107,231,245, 87,148,251,105,214,109,130,202, 98, 46,168, 16,116,189,219,209, -149, 55,189,154,170,165,153, 59,231,235, 70,137, 36, 55,182,240,128, 52, 14,199, -147,193, 91,245, 8, 59,118, 70,117,183, 99,133, 43, 10,198,182, 98,117, 53,115, -123,109, 71,213,201,221,212, 45, 25,120, 94,228, 46,212, 68, 34,142, 38,210, 0, -184, 7,164, 97, 64, 64,120, 52,151,205, 67,133,115, 54, 32, 81,246,160,137, 46, - 25, 13,244,209, 30, 96,127,206, 57,231,156, 49,198, 56,211, 60,231,206, 86,172, - 24,186,186,164,217, 94, 53,133,116,223,135,182, 98, 48,157, 45,200,171, 61,155, - 16, 29,120,255,218,238,171,221,236,250,163, 84, 57,120,245,213,142,179, 12,221, -113, 5, 51, 88,160, 41,163,145, 57,177, 62,234,238, 26,108, 76, 93,233,141,145, -143,248, 38,227, 69, 15,187,126,138,246,215,218, 31, 90,173,176,175,106,103, 53, -131, 63,247, 88, 97, 72,123,132,112, 20,221, 67,224,200,107,151,193,223,104,227, -117, 28,165, 72, 42, 26, 71, 46,125, 3, 43, 29,210,157, 77,254,243,166,247,125, -191,174,124, 69,249, 66, 44,148,214,250,202,162,245, 63,239, 24, 66,136,191,141, - 58,198,255, 90,105,118, 30,166,254, 17, 71,236, 15,175,238,110,212,235, 46,199, -125,223,141, 33,206,224,254,240, 99,127,247,168,230,209,127,152,245, 11,208,211, -252,138,143,178,187,219, 24,180,104,245, 74,243,173, 59, 75,245, 39,233,167,123, -151, 81,126,126,189, 40,206,186,219,182,233, 86,168,251,218,213,127,122, 88,239, - 49,226,232,238,238,238,151,119,173,157, 48, 79,213, 70,103, 42,182, 7,143,190, -168, 20, 27,230,176, 54, 32, 8, 3,164, 0, 8, 28,137, 9,100, 34,105, 26, 73, -138,252,180,128,135, 67,155, 5, 17, 5,146, 5,162,128, 70, 16, 16, 0, 28,128, - 1, 36,128, 0, 12, 0, 24, 64, 1, 0, 1, 3, 20, 2, 76,179, 7,205,183,128, -238,186,160,126,116, 64,224,114,151,111,239, 10,184, 49,126, 6,238,165,134,204, - 96,234, 51,101, 22,204,148,171,202,151,145, 79,203,219, 11,239,230,200, 17,179, -169, 5, 50,248,229,102,195, 53,241,232, 74, 67,137,212,241,236,129, 91, 58,186, -161,187,234,132,245,176, 78,134,212,217,102,182,214,153, 40,215, 45, 72, 10,248, - 54, 46,213,217,118, 86,222, 35, 10,221, 12, 62,104, 26,201,189,237,110, 93,181, - 24, 12, 29,238,201, 7,195, 81,147,249, 21,202, 35, 77, 98,149, 90,217,206,172, - 60, 19, 19,223,170, 93,222,124,204,166,204,164,232,148, 97,235,197,218,100,208, - 17,185, 97, 50, 74,148, 1, 15, 3,206,118,193,201,238, 44, 12,230, 85, 92,114, -229,105,145, 0,122,204,157,208,187, 53, 77,124,193, 23, 61, 57, 11, 80, 90,112, - 92,148, 62,160,101,138, 24,252,193,104,228,163,113,105,145,207,149,183,207, 25, -228,191, 3,241,212, 27,230,132,180, 42,154, 29, 71, 25,235, 85, 42, 65, 59,221, - 31,204, 81, 73,158,203, 69,166,120,100,108, 4,126, 35,250, 52, 45, 26, 76,250, - 67, 92,147,250,229, 54,219,165,163,101, 99,229, 67,125,195,205, 9,199,108,100, - 51, 25, 2, 6, 24,200, 31,247, 23,188,238,202, 73,147, 33,199, 11,194,104, 21, - 84, 5,217,253, 53,140,203,171, 15,209,149,171, 35,209,117, 43,231, 45,138, 51, -236,146,230,197, 75,225,141,179, 1,170,194,185,183, 91,205,133,192, 83, 60,128, -222, 16, 77,192,238, 35,142, 67, 17, 88,174, 29,193,139,187,141,239,169,253,137, -133, 72, 89,125, 14, 75, 93, 29,158, 85, 73, 18,113, 88, 31,241,177,238,234, 98, -155,157, 69, 54, 35,200, 26, 20,143, 10,177, 72,178, 45,207, 63,199,139,154,253, - 36, 88, 18,251, 92,195, 92,118,250, 94,170, 50,215, 85, 78,241,126,149, 9,173, - 49,183,125, 81, 29,181, 73,209, 72,112,117,121,124,253, 86,236,227,120,251, 94, -232,219, 55,111,246, 84,194,210, 94, 41, 87,246,202,254,137,148,123,136, 68,141, -162,176,251,198,179,212, 38,152,147, 66,121, 10, 8, 20,236,139, 62,185,205,145, - 44,116,243,100,179,173,146, 75,209,180, 72, 42, 86,204,159,165,248,112, 32, 31, - 17,160,158, 40, 26,225,143,104,216,158,168,185,253,134,130, 79,156,195, 87,193, -115,161,153,183,247,137, 81, 39, 92,100, 75,153,221,125, 87,243, 52,211, 99,122, -247, 39,211, 97,241,137,137, 45,160,140,132, 53, 18,166,119,129,114, 21,150,228, - 47,213, 8,202, 86, 88,225,188,116, 55, 40, 43, 97,193,232,210, 61,161,188, 38, -235, 73,162, 69,161,168, 16,107, 77, 75,119, 13,229, 55, 44, 69,150,132,252,152, -143, 37, 60, 30,218,126, 10,232,161,190,227, 33,223,248,184, 29,210,186,111,207, -123,175, 60,247, 80, 80,120,173,233, 21,205, 20,115, 17,138, 96,200,172,139, 87, -152,175, 21,248,245, 10, 55,216,236,137,156,138,209,148,165,213,150, 50,242,171, -245,215, 93,160,190, 96, 59,242, 83, 1, 86,229, 10,156,128, 6, 70,141, 51,201, - 59,140, 36,184,204,131,226,218, 53,187, 84,139,224,155, 72, 62,122, 89, 20, 49, - 10, 1, 31,218,234,211,221,164,114, 19, 52, 30,189,203, 37, 45, 82,138, 8, 82, -162,111, 32,128,226, 71,175, 96, 56,168,248, 89,142,227,255,251,243, 82, 73, 82, -191,189,103, 26,153,251,123, 14,122,189, 2,227,171,118,121, 81,198, 19,120,208, - 97, 63,125,237, 51, 68, 12,223,195, 73,207, 7,209, 7, 94, 4,114,229,223,129, - 16, 11,196,116, 66,136, 34,205, 21, 32,135,249,109,130,148, 14, 10,198,105,214, - 52, 68, 10,239, 41,199,241, 39, 21, 49, 64, 70,151,248,139,188, 6, 18,134, 23, -158,210, 85,157, 47,168, 2,136,197,138, 50,102,136, 84, 28, 22, 18, 68, 3, 9, -115,105,240, 57,192,155, 70, 10,128, 12,187, 1,131,224,182, 15,135,191,170,218, -164,230, 68, 10, 53,121, 56, 82, 74,146, 11, 83, 60,252,188,168, 20, 25,109,216, -247,225,235,110,250,105,145, 12,136, 8, 54,133, 77,135,104, 19, 97,148, 1,154, -117,206,246,224,153, 74, 11,205, 37, 16,170,113, 82, 14,167, 27, 51,155,220,199, -220, 92,144,168, 17, 0,132,178, 12,124, 45,117, 87, 50, 46,227, 54,125,236, 73, - 27, 37,217,177, 37,200,234, 78, 39,153,172,138,221,220, 77, 90, 13,135, 77,218, - 72, 6,135, 33,116, 80,215,152,242,131,124,158, 10, 98, 87, 79, 38, 18,180,193, -139, 79, 13, 6, 75, 57,122,104,153,104,110,249,150,225,201, 94, 38,219, 24,186, -184,133,234,108,151,159,223,247, 46,234, 39,139,177, 94,190, 82,180, 12, 20, 93, -134,171,190,252, 70,189, 21, 53,255,154, 40, 54, 28, 61, 41,174,242,146, 61,213, -201,158,183,171,230, 65,189,178,114, 41, 28,150,114,242, 91, 63,234,202,232,217, - 46,155,172,184,147, 54, 93,206, 95,203,185,132,102,250,196,132, 5,196,249, 26, - 24,165,181,150,122, 4, 38,187,154,180,190,156,184,195,140, 73,111,120,103,224, - 99,101, 75,194, 16,169, 12,129, 51,100,200,198,193, 26, 1, 94,171, 52, 73, 5, -162, 66,164,190,229,125, 60,141, 18, 15, 32,252,121, 26,161,187,132,125,105, 7, -193,181,222,159,246,147,188,133,193,180, 27,210, 93,242,226,249,131, 89,121, 43, -143, 98,201, 71, 34,121, 6,213, 58,150,156,211,110,242,159,233, 92,101, 58, 12, -244,201,133,106, 96,250,239,103,254, 99, 64,255, 74,183,252, 40,107,157,147,180, -186,146,156, 68,255, 29, 74,222,183, 73,163,127,111,137,242,129, 0,227,213, 28, -162,205, 14,211, 93, 79,166, 35,101,183, 54, 4, 10,212,144, 31,157, 41,133,183, - 13,207, 48,224, 53, 70,101,111, 89, 11,129,118,128, 18,137,237,236,162,164,121, -192,129,218, 41,226,210,199,122,248, 67, 80,228,118,122,186,208,204,113, 99,224, - 32,205,200,224,174, 68,182, 77,180, 59, 62,248,189,181,112, 51, 94,239,152,225, - 68,171, 0,219,109,162, 53, 82,207, 23, 71,243, 56, 66, 14,160,238,215, 52,128, -193,245,151,123, 63, 4, 72,177,192,197,183,221,228, 6, 61,111,142,112, 0, 63, -206,102, 61, 32,104, 81,233,233, 0,228,142,235, 29, 13, 14,121, 53, 50,163,224, -136,220, 30, 64, 70, 34, 57,246, 78,198,140, 25, 46,153, 28,213,111,192, 57, 58, - 46,131,161,237,100,119, 86,230, 12, 92,195, 9, 23,165,199, 82,140,155,126,181, -117,182,182, 72,243, 57,182,216,223,197, 56,176, 27, 86,216,109,103,180, 28,198, -216,198,133, 80,187,185, 98, 97,189,155, 37, 35, 62, 6, 87,164, 36, 45,222,184, - 9, 68,192,221,156,188,233, 25,188, 81,148,100,191,125, 27, 10, 50, 22, 26,230, - 86,105, 18, 44,111, 73,253,170,216,201,104, 11,200, 0, 65,138,220, 95,107, 64, - 90, 74, 78,160, 91, 59,132,206, 62, 11,122,143, 97, 89, 16,184,190,172,200, 88, -192, 6,111, 54,174,192,240, 21, 80, 28,209,215,149,115,240,175, 83,241,132, 54, -145, 33,161,102,199, 53, 34, 85, 82, 43,240, 74,111, 17,115,116,126,149, 62,139, -211, 20, 24, 85,128,129,107,149,228, 58, 5,255,171, 35,161,132, 37,165, 0, 91, -173,237, 32, 85, 49,225, 76, 53,207,115, 80, 64, 70, 46,208, 76,106,227,122,157, -242,255,251, 16, 64,118,243,133,146,221, 86,201,226,128, 42, 18,189, 31,237,113, - 53, 47, 0,106,238,236,185,199,238,243, 33,210, 59,123,193, 13, 43,146, 63, 75, -177,102,198, 83, 36, 60,100,162,165,226,122,139,224, 52, 71,142, 37,221, 29,147, -234, 16,158,205,173, 56,247, 68, 34,143, 92, 72,119, 14,236,136,225,241,142, 44, - 66, 50,158,131,235,145,232,166,187,227, 22, 1,229,191, 18,235,149,200,186,233, - 43, 73,232, 49, 44,147, 51, 66, 86, 22,145,249,208,134, 88,238, 63,170, 61, 68, - 44, 16, 32,237,126, 30, 17, 51, 30,146, 43, 89,107, 27, 30,240, 56, 6,219, 30, -176, 32, 18,170, 94,216,116,123, 28,244,252,138,242,204, 43, 18,112,151, 14,103, - 36,240,112, 59,132,117, 58,183,247,218,144, 16, 37, 41,186, 14,240,219,161, 24, - 18,173, 29,199, 76,188, 46, 30, 71, 62,227, 12,174,119,200,102,237,136, 63, 29, -123, 98, 33,183, 71, 77,193,181,125,229,239,110,194,246, 48, 31,227,184, 88,125, -126,221,246,181,218, 57,130,144, 14, 80,194,108, 67,154,119,192,145, 23, 39, 3, -100,175, 45,136,233,171,168,241,184,202,236, 81, 92,132,220, 14, 70,148,131,114, -197, 18, 21, 99, 45,184, 60, 84,157, 63,255,125, 35,212,181,136,201, 52, 91, 15, - 54,216, 77,148,200,100,203,179,217,252,158,238, 3, 95,151,236,113,168,227,167, - 23,178,193, 38, 65, 79,206,176,113,108,188, 83, 45,235,213, 76, 32, 2,225,154, -145,221,235, 36,153, 84,199,199,240,201, 71, 57, 55, 6, 8, 85, 10, 71,251, 50, -226, 5, 99,138,186, 60,168,145,152, 19, 53,237, 72, 52, 39,131,201,104,108, 76, - 68, 37, 62,112,167,249,192,190,145,123,189,194,206, 24, 2,176, 30,157,126, 20, -227,226,202,130,176,140, 16, 61,152, 58,184,251, 24, 43,123, 15, 18,189, 75,111, - 8, 17,170, 11,195, 94, 10, 32, 7,217,215,163,132,184, 16,215,186,233,198, 21, -230, 62, 71,186, 15,192, 69, 88,105,253,221, 70,132, 13,153, 99,177, 41,140, 50, -127, 20, 73,199,212,207,121,241,135,215,250,177,204,135, 66, 1,248, 24, 66,217, - 27, 81, 18,232,156,143, 91,130,147, 70, 10,206, 98,103, 20,242,137, 61,118,226, - 97, 20,220, 66,208,160, 61, 30,227,170,235,207, 69, 10, 18,206, 31, 69,135,175, -149,210, 73,181,110, 53,179,230,176,118, 58,221,114,182,210, 0, 34, 96,253, 30, -128, 46, 2,154,147, 31,115, 2,123,160,102, 30,165,238,106,239, 38,181,167, 91, - 95,154, 73, 6, 58,141,139,179, 39, 73,207,181,197, 57, 46,164,195,233, 22,192, - 48, 49,213,102,193,134, 22, 51, 85,163,188,132, 24,139, 92, 90, 60,176,160,135, - 6,244, 53,227,251, 99, 9, 23,166, 54,240,241,149,106,181, 58, 77,172, 57,252, -204, 12, 66,172, 25, 20, 75,243,225,221,111,122,251,165, 49, 24,124, 25, 71,252, -162,176,162,143,184, 80,240, 16,136, 66,169,165,113, 66,131,194,174,145,115, 63, -194,116,167, 88,175,110,108,126,148, 72, 9,156,236, 55,161,233,126, 10,101, 95, - 81,130, 36,112,118, 25, 73,132, 94,196,223,188,170,238, 18,106,160, 62,208,201, -148, 73,246,166,134, 35,131, 65, 8,141,121,139,178, 51, 11, 38,217,235,145, 42, - 37, 91, 7,100,201,140,110,150,163,249,248, 53,138, 88,180,163, 33,176,134, 69, -192, 29,127,144, 51,126,166, 85, 97, 52,197,205,150,228, 34,165,135,118,107,154, - 13, 49,244,240,128,217, 87,121,199,210,139, 47,240,231, 18,113,177,184,110,214, - 79,188, 36, 62,112,180,145,184,226,137,190,221,131,144, 83, 11, 48,163, 36, 72, - 9,114,175, 37, 60, 82, 81,172, 25, 98, 53,205,232, 41,193,218, 88,121, 3, 66, -186,157, 37,182,159,188,214,118,104,125, 7, 98,241,158,196, 94, 55,221,191,235, -129,157,118, 31,230,245,150, 50, 18,180,139,113, 15, 23,117,245,168,214, 73,214, -106, 29,118, 25, 71,216, 28,133,118, 30,244,108,104, 12, 36,239,211,102, 2,186, -115,237,215,249,168, 48, 4, 22, 22, 37,211,118,159,186, 9,181, 70,136, 78,187, -208,100,255,139,237, 12,217,201,255,236, 8,209,235,189, 5, 45, 11, 46,102, 47, -218,210, 96,169,104,160,193,169,150, 36,162, 82, 43,229, 84,140,185, 25,170,135, - 29,204,253, 58, 23, 49, 31,105,101, 41, 49,151,170, 46,223,111,225,177,251,161, -184,155,150, 84, 4,120,172, 53, 54, 16,228,180,216,144, 56,121,216,189,154, 92, - 34,227, 79,251,143,123,193, 48,215,116,179,135, 28,110, 0,171, 71,115, 56, 85, - 17, 13,182,200,179, 84,179, 65,252,219,173,192,101,104,187,101, 75, 59,190,226, - 51,216,194,106,188,229, 9,120,217, 77,247,160,223, 3,189, 14,127, 79,209,158, -100,229,129,106, 85, 4, 9, 18,213,230, 79,102,136,222, 31, 74, 26,194, 6, 24, -145, 14, 94,139,149,235,230,212,100,157,198,254,120,107,255, 53, 63, 36, 46,156, -141, 15,160, 73, 10,105, 31,146,195,199,162,122,243,144,159,220, 97,116, 10,228, -246,240, 34, 3, 69,124, 52, 48,129, 45,124,236,234,113, 37,169, 67, 70,243,142, - 52,252,179, 93,148,231, 18, 26,219, 88, 6, 73,132,204,142, 0,108,240,156, 30, - 22,215,141,240,196,240,100,167,181,117,154,114,200, 35, 43,249,140,153,232, 61, -230, 42,105, 30,203,128, 19,116,145,231,213,161,234, 70,118, 80,182, 38,202, 1, - 28,250, 71, 23, 19,209, 56,164,223,151,206,146, 94,121,109,109, 28,249,180, 30, -156,167, 51, 47, 80,120,196,126, 32,251,238,104,248, 94,125,167, 52,239, 66, 14, -147, 27, 54, 79, 6,112, 54,135,135, 73,254, 57, 89, 26,250,178, 43,154, 26, 38, - 53,109,217, 7,203, 78, 62,232,114, 15,104, 48, 47,176, 83,111, 56, 71, 44, 69, -111, 98,124, 80,158,204, 83,195,116, 52,236,158,195,232, 79, 55,136,159,116, 60, -201, 34, 2,157,209,217, 91,235, 9,149, 75, 74,141, 1,103,234, 30, 54,241,152, - 27,126,220,237,152,183, 35, 46, 30, 0,253,140,197,103,106,219, 99,224,128, 25, -132,186,198, 81,247,140, 47,122,153, 54,102, 3,215, 51,154,137, 35, 41,172, 34, - 90, 88, 68, 24,115,129,221,106, 75,102, 50, 38, 23, 28, 61, 4, 93,139, 33, 95, - 85,178, 2,215, 94,130, 47,101,129, 35,118, 13,101, 40, 78,148,231, 57,194, 53, -177, 42,190, 74,146, 2,126,202,160,134, 93,192,149, 72, 68, 79,207,145,203, 91, -126,251, 19, 5,126,200,192,135,147,145,194,232, 58,174,131,216, 58,163,246,208, -147,236, 71, 12,155,186, 44,112,240,125, 40,118,186,100,251, 61, 26,182, 44,140, - 20,227,101,103,179,134, 59,230, 81,228,181,200, 14,132,135, 13, 48,245,139, 0, - 61,186,136,101, 12,171,240,224, 77,226,234,104,177, 75, 29, 41,163,114,208,145, -228, 93, 14, 76,144,215, 97, 25,253, 58,131,246, 68, 5,105, 49,248, 71,160,230, -172,238,228,193,129, 61, 12,230,243, 79,240,117,163,165,137, 57,248,167,133,115, -104, 47, 14, 59,132,185, 81, 27,226, 82,244, 79, 7,200,104,230,150,149,126,116, - 58,109,181,122,206,244,248,181,152, 55,209,210,132, 63,192,104,106,236, 26, 81, -218,164,209,108, 84,115,177, 35,109,217, 7,161,182,148, 88, 14,142, 80,145,117, -212,103, 69,211, 29,252, 86,116, 81,207,243, 73,178,204, 87, 72,158,208, 75,184, -167,121, 47,179,174, 2, 16, 85,174,216, 82,134, 42, 19, 55, 38, 74, 10, 53,106, -240,138,209,194,196,101,133,204, 11, 66, 0,132,163, 52,138,164, 26, 74,166,156, -167,115,143, 91,242, 9,134,158, 71, 27, 47,125,229, 99, 60,124, 62,186, 87, 6, - 82, 19, 73, 68,215, 59,206,196,225, 33, 15, 75, 39, 16, 21,243,220, 54,147, 77, -225, 57, 36,185, 80,197, 50, 14, 89, 40,246, 90, 22, 75, 77,116, 29,129,100,211, -132, 86, 66, 32,139,237, 30,150,199,162,178,152, 95,212,204,161,243,135, 76,246, - 86,147, 69,101,242,100,246, 12, 84,250, 16, 23, 86,211,116,162, 16,181,158, 37, -171, 88,211, 14,122, 73, 25, 3, 18, 47, 23,209, 21,127, 66, 23,164, 99,138,172, -225,134, 13,129,191,214, 92,244,187, 80, 73,139,197,189, 14, 81,217, 92,225, 95, - 76, 79,128,222, 36, 21,156,128,101,137, 87, 54, 90,195, 48, 28,213, 41, 65, 26, -192,139,204, 38,147,173,126, 16, 32,131,118,123,163, 62,130, 4,106, 64,141, 32, - 32,131,149,136,107, 61,131,149,148,153,181, 39,116, 0,143, 34,197,122, 17, 88, -111, 25,155,217, 81,167, 72, 7,219,146, 7,175,213,102, 98,163,246,250,180,148, -203,162, 64,161,143,220,188,108,210,189,193,112,142,144,118,203,218, 59, 41,171, -216,132,106,201, 26,156, 53, 55, 39,136, 91, 45,140,111,207,223, 35, 5,137,238, -174,180, 56, 51, 81,152,104, 32,212, 69,211, 53, 80,179, 45, 73, 67,160,187, 40, -104, 21,157, 30,168, 89,139,128,121, 22,173,193,131, 98,183,122,169,129, 72, 2, -198,160,210,152, 22,201, 93,248,218, 23,189,221, 27, 89, 58,198, 61, 38, 67, 1, -125, 42,175, 89,226,254,214,201,167,100,246, 72,175,246, 52,255,132,163, 15,144, -211,105, 69, 40, 0,124,181,103, 36,233, 26,117,234, 69, 73,163,252,123,233,169, - 57,228, 34,238, 20,118,157, 98, 8,128,214,142, 37, 40,201,163,114,169, 91,220, -130, 68,212, 29,252,169,184, 17, 20, 86, 54, 69, 80, 68, 93, 70,245, 93,113,126, -143,130, 13, 38,125,170,145,226,136,115, 36, 16, 5,188, 9, 24,134, 74,224,170, - 66,238, 56,181,226,243, 99, 35, 48,149,156,175, 68,123,145, 74,204,130,151, 41, -230,189,214,238, 68,218, 23,240, 89, 77, 2,188, 56,246,184, 75, 62,254, 2,179, -194,200,138, 71,248,156,214,192,235,161,253, 24,106,197, 76,185,110,104,134,180, - 40, 72,114,210,251, 10,122,132, 70, 45, 53,101,212,221, 55,250, 39, 17, 49, 34, -254, 22,165,203,100,236,198, 41, 65, 34,183,219,168, 49,188, 67,225,158,200,240, -113,213,240,243,132,208, 7,183,108,111, 95, 15, 46,238, 49,179, 45,174, 11,109, -235,176, 15,117, 57,241,146, 56, 49,105, 57,200,132,109,120,213,188,124,167,145, - 23,255, 4,240,187,145,212,210,184, 21,122,217,185, 15, 77, 39, 50, 35,132,165, -162,223, 55,142,206, 63,217,136,250,171, 42,161,244, 12,229,163,112,133,195,170, - 49, 80, 60, 23,110,240,253, 57,144, 1,211, 64, 49,151, 62, 25,115,187, 93, 24, - 92, 74,140, 84, 40,144,126,166,111,227, 12,121,158, 80, 32,128,208,227,250,200, -179, 7,245, 51, 93, 33, 33,110, 14,140,161,193, 94, 61, 0, 34,153,178,232, 38, -116, 84, 28, 13,142, 70,236, 21, 19, 66,183,137, 55, 59,181,193, 92, 8, 78, 59, -126,172,176,184,158,159,201, 99,142,166,134,206, 33, 56,122,188,101,178,241, 72, -175,149, 45,121,152,112, 79,245, 89,125, 6,203,179,111,181, 96,163, 86, 14,168, -247,123,171,243, 23,141,144, 90,241,148, 21,120,214,240, 20,147,111,198,103, 36, -179,210, 84,162,161, 40,216, 34,178, 52,234, 37, 64,251,111,248, 57,206,224, 52, -215,132, 24, 52,133,204, 88, 61,136, 49,162, 51, 28,202, 28,218,250,111,211,232, - 86, 90,126, 34,200,226,118,160, 37,176, 28, 12,104, 94, 43, 90,162,113, 29,172, -202,189,202,186,158,147, 31,101,177, 91,121,191,210,165,253,137,251, 32, 56, 31, - 51,101, 11, 68,127,154, 74, 31,205,222,231, 85,141,114, 3, 28,240, 27, 73,180, - 22,211,117, 53, 10,191, 19,164,249,179,154,159, 43,185, 48,182,249,229,248,132, -246,108,195,105,211,126, 66,170,177,102,168, 10,150,113,186, 95,183, 42,200, 61, -141, 0,225,189,174,175,184, 38,243, 66,222,139, 3,229,156,187, 71,194, 51, 56, -174, 11, 52,242,196, 7,180, 29, 20, 3, 18,126,156, 64,149, 0,135,135,233,144, - 40, 25,249,163, 34, 28, 65,246, 51, 28,135, 64,224,214,120,247, 24,192,113, 5, - 52, 58, 18,114, 66,128, 87,138, 45, 42,185, 84, 99,160, 11,152,105, 76,216, 0, -139,194,199,124,217,195,200, 26, 35, 16, 41, 3, 29,226,130, 4,150,105,254, 63, - 58,238,183,210,148, 92,129, 87, 97,171,252,159,203,167, 21,172, 9, 84,130, 19, - 27,198,142,110,245,246, 35, 70, 68, 49,238,255,126, 34,170, 23, 77,166,173, 1, -225, 15,136,254, 82,112, 65, 82,140,194, 0,133,173, 77, 53,184,178,222,152,204, - 44,193, 75,236,163, 31, 18,116,105,220, 2,204, 51,138,233, 8, 57,104,235, 79, -214, 70,236,211, 72,248,102, 13,175,138,180,112,132, 59,217,193,216,135,112, 84, -244,106,170, 35,134,240,158,216, 31,213,237,218,142,110, 23,194,217, 5, 48,237, -206,155, 4,114,235,130,204,192,237, 46,151, 82,106,115, 42,177,200,158,190,168, - 82, 71, 83,240,158,206,216,163,186,176,154,129,155,170,201,151,133,111,162, 2, -217,178, 72, 76, 68, 60,166,175,198,255,162,242, 13,102,121, 96,130,127,252,248, - 57,184,185, 59, 56,245,207, 62, 56,248,170,108,217, 14,159, 71, 38,179,221,153, -131,167, 56,238, 3,159, 8, 16,211,231, 91,223,170, 15,247,208,115,112,223,208, - 55,196,249, 70,111,246,161,196,188, 8, 67, 95,223,139,103, 42,201, 84, 36, 96, - 83,254, 51,127,149,245, 98,160, 39, 44,182,165, 79,171, 36,107, 88,215, 40,100, - 31,252,104, 90,215,237,107,181, 52,232,134,201,247,246, 60,128, 56, 7, 24, 14, - 22,237,178,243,104, 29,215,235,221,165,114,106,186,187, 81,247, 43, 99,193,134, -164,232,146,240,255, 82, 6,164, 34,130, 77,172,101, 53,195,136,227,245,252,237, - 44,241, 72, 93, 47, 42, 14,113, 25,139,107, 13, 16, 13, 26,245, 82,195,178, 69, - 61,137,215,160,204,231,134, 70, 38,234,181,100,168,247,232,198,232, 29,122, 24, - 43,179,153, 17,118, 28,101,224, 34,173, 38,220,104,160,241,124, 25,167,114, 19, - 10, 23, 79,238,204,232, 85,183,186,234, 86, 18,244,146,227,198,173,189,193,145, - 51, 3, 73, 18,224,148,160,244,126,117,243,196, 27, 57,157,242, 73, 70, 78, 91, -226, 84,225,199, 25, 0, 22,128,168,113,228, 12, 57, 5,225,145,136,155,113,182, -150,255, 41,153, 2, 80,166,138, 72,144,227,110, 21, 48,144,227,147, 40,177, 96, -160,224, 6, 32,205,234,113,111,147,146, 37, 8,247,233,111,223, 4,225, 67,199, -213,211,216, 74,244,106, 89,115,130,199,246, 1, 26, 61,242, 26, 38, 40,133, 17, -254, 51,144,167,140,158,176,225, 17,147, 18,152, 71,112,220,219,122,223,184, 46, -175, 3,220, 56,211,221, 77,196, 54,142,212,217,184,218, 62,127,113,125, 62, 70, -231,197,253,215, 56,104, 23, 23,146,112,139,175, 31,229, 67, 60, 87, 65, 7,132, - 78,152,159, 53, 80,214,232, 26,217, 16, 55,121,236,222,178, 82, 20,110, 71,162, - 0, 52,158, 43,137,162,115,138, 53, 60,211,173, 26, 44, 95, 29, 65,107,216, 11, - 8,245,207, 69, 3,151, 80, 27, 37, 30,121,193,196,154,248,111,215,187,205,201, -197, 30, 48,174,221,129, 45,241,230, 60, 5, 41,131,176, 31, 8, 49,151,137, 16, - 6,133, 17, 92,208,117,239, 11,194, 71,119,193,172, 91, 78, 13, 28, 70, 44,220, - 64,147,113, 79,141, 2, 76,171,133, 30, 61,105,115,148, 49,198,151, 72,188,204, - 18, 67,117, 19, 33,229,161, 98, 5, 26, 14, 25, 42, 39,249,212,211,245,190,221, -229,131, 92, 25,195, 1, 63,236,223,177,180,156, 19, 7, 89, 63,251,126, 96,134, - 41,154, 4,228,219,140,162, 81,167, 97,231,123, 49, 36,175, 1,102, 95,119, 6, -200,115,210, 55,253, 15, 13,208,144,229, 5,211,188, 35, 46,112, 36, 34, 55, 48, -129,236,101, 14, 68, 18, 28,179,229, 65, 41,236,152, 29,177,240, 90,125, 64,122, - 34, 64,233,194,192,171,212, 36,209, 13, 57, 5, 39,123,188, 90, 51,209,246,140, -126,167, 36,169, 60, 49,255, 5, 11, 67,125,254,186,200,183, 74, 16, 44,135, 54, -209,220, 35,110,110,109, 40,203, 58,151,101,205,227, 14,172, 74, 15,211, 80,174, - 23, 34, 88,151, 18, 65, 78,112, 86, 49, 12,159, 88, 0, 78,183, 64,225,222,245, -165,244,149,146, 3,151,248, 3,216, 46, 4,193, 62, 99,209,139,204,238, 85,209, -210, 61,230,186, 23, 75,122,121,193, 95, 49,130, 61, 14, 56, 22,220, 27, 89, 42, - 84,177,163,156,245, 89,169, 38,123, 96,189,232,122, 50,247, 94,187, 5,204, 20, -163,183,135,246,222,129,138,218, 70, 57, 50,117,135,177,121,193,222, 37,210,163, -211,214, 12, 61,234,101, 73,233,146,218, 0, 66,226,167, 66, 8,190,150,169,253, - 56, 42,118,217, 36,203,127,201, 55,212,123,145,168,168,151, 96,145,124,135,218, - 80, 73, 47, 91,105, 60, 41,148,161,108,180, 59,149,202, 96,153,247, 16,191, 50, -185,255,123,212, 34,224,201, 54, 27, 94, 22,120,159, 83,154,184,184, 91, 17, 64, -140, 78,172,176, 89,114,139, 66, 69, 92,179,179,224, 4,180,244, 72, 31,190,224, - 95,100,142, 41,236, 14,144, 37,178,212, 57, 44, 92, 11,135,109,136, 79,234, 71, -161,185, 10,200, 73,170,115,126, 23,211, 9,109,115,140,243, 54, 31,227, 11,225, - 93,186,231, 11, 91, 36, 7,125,194,196, 2, 42,221, 95, 40,140,194,194, 40,122, -164,165, 78,187,119, 82, 71, 0,179,123, 73, 75, 62, 89,126, 90,248, 37, 59, 44, - 31, 0,112,179,194, 97,161,113,164,129,132, 53,105, 47,156,163,101,234,126,168, - 55, 83, 88, 41,159,149, 98, 9,218,225, 24, 32,231, 14, 10,172,250, 3,138,156, - 71,126, 97, 20,173, 6,215, 40,167,113,246, 32,128,190, 95, 96,210, 81, 73,133, - 17, 72, 96, 66, 69, 40, 22, 62, 17,236,176,235,176,191,208,176, 56,177, 48,153, -125,238,124,155,172,123,213, 46, 7, 69,254, 31, 24, 58,244, 94,234, 16, 81,184, -248,117, 67,141,142, 42, 13,229, 96, 78, 57,191,181, 6,253,115, 96,180,151,141, -128,182,219,101, 3,238,206, 87,121,224,205,178, 16,108, 12, 48,215,206,236,248, -213, 12,146, 99,219,104,118,204,154,169,127,247,125,235, 41, 43,201, 59, 84,144, -143,230, 65,218,163,208,165,204,163,176,147,123, 33, 76, 60,180, 82, 12,246, 51, -120,252,158,212,232,208,122, 91,172,159,145, 97,255,187,191, 39,201,239, 38,108, -136, 3, 82,240, 32,151,225, 24,246, 69, 14,216, 98,173,187,240, 19, 0,241,140, -154, 5,142,164, 5,168,238,197, 64,161, 42, 31,155,138, 22,232,196, 14, 83, 17, -225,196,203,234,219,141,187, 24,143,115, 21,116,124, 79,252,127, 75, 64,193, 9, - 4,141,191,129,197, 92,180,192, 50,181,222,141, 37,128,143,190,243,143,138,117, - 18, 91,193,134, 23,121, 2,144, 96, 42, 39,243,217,166,132, 72, 90, 56, 37, 76, -253, 12, 15, 9,219, 52,198,166, 94,186,116,120,146,210,128,242, 89, 11,189,110, -219, 52,102,131,120,181,236, 83,235, 21, 55,131,212, 56,113,167, 0, 31, 77,209, - 3, 19,160,201, 29, 10,185, 44,147, 89,168, 22, 81, 18, 64,131, 94, 49,240,229, -212,221,188, 83,227,115,193,211, 74, 17,143,191, 43, 63, 16,221,146,110,160, 5, -230,141, 1, 16,253, 79, 26,179,151,240,131,242,211,121, 36,142,137,120,110, 88, - 38, 75,176,183, 85, 54, 81, 56,152,156,103,126,145, 55,206,214, 50,111,137,112, -120,145,116,222, 15, 77, 80,171,103,182,168,236, 67,114, 39,155,221,149,214, 96, - 67,210, 88,209,216,127, 19,210,156,235,164,167, 69,226,222,150, 32, 33, 33,205, -194, 61, 89,248, 49, 57,186,174, 10,171,192, 66, 46,200, 68, 82, 35,112,103,152, - 14, 16,195, 95, 37, 8,102,122,224,219,172, 39,190, 99,138,193,116,237, 84,137, -165, 55,110,122,130,183,163,167, 67, 78,241, 17, 20,229,118,197,114,148,211,233, -161,170,245, 70, 42, 75, 20, 56,192,124, 32,195,211,211,182,136, 34, 91,141,250, -225,253, 7, 15, 86,119, 73,242,231,118, 80, 21,119, 2, 18, 42, 7,123,193,113, - 89,239,176, 53,128,141,250, 58,247, 50,218, 21,251,118,224,171,163,231, 39,145, -100, 84, 38, 67,162, 63,221,172,173,209,118,112, 99,202,238, 88,204,203, 89,194, -107,223,176,153, 54,226,134, 87,197, 55,122, 31, 44, 8, 23,196,171, 37, 42,236, -162, 73,115,165, 43,171, 70, 83,154,106, 19,161,150,138,142, 84,168,128, 52, 65, - 74,121,136,124,147,165,131,128,152,160, 41,107,173, 10, 5, 69,113,123, 53,232, -158,229, 64, 98,176,190, 58,193, 62, 52, 21,143, 58, 18,156,250,229, 81,160,116, -146, 20,215, 99, 60,183, 48,246,132,164, 77, 25, 87,239,122,223, 72,102, 55,189, -231,143, 7, 37, 35,140,190,179,208,137, 29,187, 57, 86,116,116,128, 1,145, 50, -193,167,201, 79, 83,214,121,241, 91,165,118, 94,130,128,143, 39,208,181,212,140, - 52,104,106,109,171,196, 21,130,211, 52,212, 21,134, 85, 83,157,213,147, 87,242, -159,112,184, 36,204,191,135,200, 72,131, 96,129, 9, 73,179,187,121,116, 8,196, -221,232,160, 14,178,169,142,253,112, 43, 70,168,147, 1, 40,103,111,173, 74,160, -124,202, 54, 90, 73, 12,253,249,236, 18, 0,132,161,158,143, 92, 13,193,237,141, - 83,111,234,128, 62,191,241,106,183, 98, 36,198, 67, 2, 61, 9,242,119,243,252, - 0,158,158,175, 50, 22, 39,172,129, 5,190, 49, 34, 45, 35, 16,216, 44, 0, 16, -149,192, 54,162, 23,188,157,178,214, 72,231, 60, 72,201,144, 61,205, 13,139,123, -221, 75,193,242,183,108,206,237,241,102,225,147,211, 18, 87, 98, 94, 23,169,248, -190, 43,197,182,176, 94,186,184,153, 18, 90,225, 82,179,205,139,174,126,149,105, - 76,238,226,232, 9,197, 12,115, 11,174,180,199, 78,125,112,220,211,166, 21, 91, -126,244, 42,199,165, 10,212,209,253, 78, 51,220,105, 6,196,142,239,104, 29,202, - 76,166,136,119, 56, 6,236, 21,158,181,236, 45,230,205, 14, 39,217, 29, 37,130, -123,252, 94, 69,228,166,136, 95,151,214, 92, 37,243,210,124,240, 93,221, 42,132, - 58,134,205,225,227,213, 65,160,176,141, 53, 61,117, 78, 6,202,208,234, 91,185, - 77,192,157,226, 6,243, 44, 10, 48,198,165, 92,130,144,252, 71,246,209,170,139, -220,179, 9,179,140,238,153,112, 59, 17, 82,181,207,114, 87,174,117,121, 47, 69, -132, 19, 53,104, 25,168,129,145,195,198,155,116, 44,158,188,240,191, 1, 82,162, -246, 64,204,169,197,170,239, 37,200, 29,243,162,136,102,255,165,153, 26,177,146, - 52,155, 57,164, 41,183, 85, 44,153, 39,136, 3,201,252,172,199, 42, 27, 29,156, - 23,166,185, 88,230, 94, 30, 75, 52, 18, 31,237,187, 37, 86,255, 6,106,129,225, -244,245,202,179,223,178, 79,186,211,197,245, 27,162,121,128,133,148,132,125,103, -136,204, 72,254, 41,187,161,253,163, 45,163,104,252, 6, 39, 85,125, 50, 37,225, - 37, 98,228,224,128,175,161,120,221,228, 88, 55, 93,215,119,106, 23,163,238,238, -228,196, 26,187, 63, 34, 88, 58,169,210,151,189,166, 42, 3,195, 54,178,209,116, -243,131, 44,106,136,159,251,167,118, 5, 9, 46, 47,200,121, 76, 17, 85,250,144, -124,121,117,229, 33, 31,137,242,116,253,109,158, 21, 18,245, 67,213, 64, 80, 65, -212, 41,105,229,250,162,135, 4, 50, 59,195, 79, 5,146,198,163,181, 54,214,167, - 20,238,101, 96,170, 72,237, 28,200, 72, 98,235, 80, 68, 80,143,224,129,163, 67, - 2, 38,148,204, 74,172, 29,231,196, 85, 83,123,167,140,178,163, 88, 70,217,129, - 84, 6, 72,248,101,178, 74, 32,110,208,255,145,152,167,104,200, 61,148, 36, 41, -219,176,229,220, 86, 64,105,183,117,181,183, 71,142,165,100,213, 45,232, 51, 50, -148, 82,249,214,157,176, 16,166,170,183,232, 52,113, 40, 70,147, 2,186,100, 77, -198, 58,234,161, 72,135,144,193, 21, 9,158,163,250, 85, 93,161, 60, 46,142,118, -201, 65, 8, 66,130, 24,229, 16,186,140, 5,251,158, 14, 96, 14,187, 56,106,130, -164,161, 87,116,225,233, 56, 76,150, 12,102,240,220, 59, 60, 83,118, 78,110, 42, - 56,244, 59,228, 82,206, 14,252,224,193,100, 65, 61, 27, 98,142, 59, 78,199,101, - 95,143, 81,200, 51, 2,194, 54, 19,209,163,232, 62,241,122,127, 99,199,116, 15, -226,213, 16,251, 22,251,170, 16,230,171, 50, 68,214,198, 13,210, 68,112,250,199, - 61, 28,135,215, 27, 98, 95, 96,198,165,154,111,118, 87,220,194,159,217,144, 80, -184,160,177, 99,141, 94,217, 90,162,222,240,104, 41,117,163,158,115,252, 14,220, - 92,217,179,193,192, 63, 6, 85,222, 91,253,179,117,127, 3,233, 39,199,134, 63, - 79, 40,108,241, 87,177, 51,174,234, 66,151,214,235,164, 59,170, 50, 23, 73, 93, - 64,192, 32,105,225,118,147, 43,239, 11, 42,170,199,124,212,108,180,239, 24, 15, -154, 19,174,144,190,142,217, 54, 15,101,124,234,222,185,233,201,118,196,229, 62, -251, 77,139,108,102,153, 54,248,203,218,167, 16,134,153,150, 33,235, 10,142,146, -111,133,234,105, 80,206, 19, 88, 43,149, 67,125,207,244,152,204, 67, 91,253,255, -100, 71,172,240, 56, 62,203,169,242,215, 67, 29, 67, 99, 23,219,238,126,246, 19, -145,250, 10, 61, 84,185, 88,141,194,112,202,133,145, 18, 20, 30, 38, 86,185,105, -212,110,208,165,124,149,212, 50,163, 16, 44,128, 59,228, 33,140,185,233, 51, 28, - 91,183, 44, 94,110, 43, 80,101, 62,213,236,216, 86,108, 2,212, 80,108, 5,248, -185,235, 96, 23,166,177,179,156, 80, 68,142,182, 24,209,199, 84, 51, 40,157, 79, - 57, 13,130, 52, 7, 0,214,208,138, 34,130,164,181,115,150, 70,134,117, 81, 92, - 7,122,186,247, 92, 96,137,158, 9, 70, 37,123,201,174, 38,109, 20,149, 81, 58, -221, 24,253,122, 4,128,192,108,254,137,148,177, 76,158, 89,235,123, 56, 8,229, - 3,218,202, 20,178, 30, 77, 18, 24, 82, 66, 53,100, 84, 91,132, 91, 32, 77, 41, - 1, 0,188,117, 84,132,120,213,174,173,112,180, 65,132,208,103,242,184,184, 3, -163, 82,146, 72,153,251,152,173,113,186,246,224, 18, 12, 24, 67, 80, 71, 73,108, - 95,248,140, 41,110,124, 86,130,139,118,135, 35,141,135,212,124, 32, 70,211,233, -179, 84,141, 23, 24,100,159,164, 43,251,137,173, 45,208,226, 99,243,209,181, 52, -191,107,167, 42, 73, 48,128, 29,224, 13, 63, 87, 46,233,121, 57, 94, 5,230,205, -146, 47,151,220, 28,206,239,193,201, 69, 52,104,145, 5, 36,232, 60, 36, 51, 1, - 55, 24,230,219, 45, 88,122,177,182,246,162, 18,213, 40, 33,135,171,146, 86,214, -171,237,128,106, 97,217, 21,237, 61,128,170,234,217, 33, 84, 61,183, 38,164, 89, -149, 77, 12,159,226, 76, 18, 93,151,126,116,132, 44,191,205,151,107,234,196,110, -125, 90,211, 40,183,133,227, 12,142,115,250,167,238,206,230, 5,141, 25, 30, 75, -208,249,241, 92, 68,250, 6, 56,136,103, 66,183,101,183,223,206,178, 79, 53,110, - 43,250,189, 66, 53, 37,196,106, 6,196,222,255,130,109, 78, 35, 62,159,217,107, -115, 2, 5, 21,118,195, 83,125, 68, 21,131,108, 10, 63,245,105,140, 35,100,219, - 31,194,190, 70,115, 27, 75,151, 66,225, 39, 81, 50, 85,156,194,185, 41,155, 68, - 84, 45, 68,190,137, 76, 99, 17,126, 22, 73,233,222,232, 71,245, 0, 44,217,147, -106,178,153, 97, 20, 31,204,214,227,138, 80, 35, 33, 57, 82, 3, 3,209,200, 85, -236,121,218,177, 38,190, 46, 32,184,217,127,130,217, 11,115, 6, 88,239,147, 70, - 47, 42,192,106,116, 63,226,144,126,253,235,101, 6,114,134,125,132, 78,205,120, - 10, 73,229,188,167, 99,201, 33,246,253,243, 29, 60,166, 43, 68, 47,114,208,198, - 67,135,217,169, 61, 42, 96,200,202,243, 78,151,247,175,110,186, 8,121,129, 60, -212, 42, 88, 40, 99,126,184,202,175, 64, 46,141,109,186,232, 35,196,199, 97,168, - 84,240,188, 23,196,113,166,120,232,251,142,176,238, 41, 61,154, 83, 28,177,246, - 30, 35,160,242, 25, 87,102, 19,199, 94,149,231, 41, 17,195, 17, 20,164, 98,117, -132,179, 83,120, 31, 3,106,154, 81, 48, 40, 21,240, 91, 81, 76, 16,192,105,147, -147, 15, 40,204,254, 55,210,180, 28,206, 32,209, 56,100,211, 33, 46,183, 56, 82, -207, 56, 22,195,136, 1,107,167, 81, 43, 36,149,166,208,219,140,237,173,230,181, -214,210, 7,159,174,140,254, 67, 44, 34, 18,107,173, 18, 34, 10, 20,101, 16,135, -246, 32,121,180, 52, 0, 38,190, 73,193,108, 67, 65, 51,119,207,200,221, 1,221, -137,234,240, 42, 18,164, 23,174, 15,243, 58,116,127, 16,119,200, 55, 35,123,119, -214, 50, 7,202,241, 75,190,169, 10, 16,215,114,175,239, 8, 26, 67, 48,186,161, -116,194, 78,161,150,177,189,188,136,130,241, 67,224, 79, 53,242,221,184,160,228, -197, 66,150,116, 44,162, 29,104, 2, 0,100, 36,154,111, 75,166, 21, 24,193,181, -100, 22,145,153, 42, 78, 16,235,167,212,198, 35,123, 94, 20,204, 58,215, 63, 26, -111, 76, 39,186,188, 69,168,242,223, 67, 87, 62,198, 46, 77,200,118,106,225,128, -152,165,104,127,134,142, 52,104,158,186,220,198,142, 95, 53, 40,211, 6, 35,151, -172,101, 12, 15, 72,118,144,130, 2,197, 8, 66,228,119,160, 39,161, 86,252, 94, -135, 13,169, 9, 17,108,174,234, 74,210,110,142, 38, 38, 5,108,248, 48,224, 77, - 49,145, 61,180, 11, 92, 12,135, 35, 8,230,204, 7, 53, 25,130,114,190, 35, 77, - 31,109, 35,224, 74,245,107,212,221,253, 89,127, 17,216,228, 37,134,120, 59, 5, -243, 53, 43, 66, 92,246,100,249, 61, 22,117,177, 89,254,250,144,145,159,239,234, -169,195,138,152, 82,208,202, 22,157,201,198,232, 94,127, 18,216, 95, 18,151, 38, - 96,232,230,194, 65, 94, 18,177,249,206,243,133,113,136, 51,211, 20,232,176,139, - 78,243,134,221,148,104,172, 67, 21,198, 26, 6,199, 93, 58, 99,165, 14, 71,148, - 51, 33,185, 17,228,106,189, 13, 22,186, 57,178, 88,118,198, 32, 9, 66,166,131, -106,129,117, 96, 81, 1, 80, 38, 32,175,122,114, 20,159,141, 0,246,212, 41,201, -137,220,141,204, 92, 73,218,127,159, 45, 54,172,229, 78,210,124,126,110, 36,189, -105,218,149, 64,241,251,213,208,237,162, 23, 44,177,163,131, 33,202,153,193, 64, - 15, 13, 29,107, 51, 89, 83,152,240,208, 17,157, 8, 48, 7,103,126,186,120,118, -105, 23,207, 33,201,133,206, 94,100, 8,100, 52,160,209,176, 4,234,117, 10,135, - 67,161,193, 10,243,135,139,176, 62, 72, 49,121,216, 14,162, 87,225,212, 69, 31, -174, 12, 26,202, 8,113,230,114,134, 36,205, 16,102,138, 10, 4,207, 27,131, 95, - 22, 66,169, 64,128,185,206, 32,200, 46, 28,122, 97,178, 43, 15, 46, 66, 8,177, - 20, 33,187,242,226,173,182, 14,127, 53,132,207, 69, 60, 20,172, 50,164,184,104, -236,148, 1,119,163, 64,231,188, 91, 1, 58,101,116, 19, 41,192, 14,109, 3, 10, -136,233, 53,198, 87,213,220, 19,101,118, 8, 5,105,151,253,135,234, 17, 9,139, -235, 14, 70,154,156,249,159,150, 33,219,166, 40, 48, 69, 7, 2, 32, 1, 57, 1, - 41, 1, 10, 59,159,162,119,162, 37,177,165,192, 44,146, 89, 86,250,175,233, 91, - 95, 81, 60,173,222, 40,212,209,138, 62,197, 44, 61,159, 44,244, 39,232,174, 60, -162,111,136,117,254,147,195, 65, 62,178,199,233,145,159, 68, 35,102, 61, 56,249, - 68, 99,175, 89,235,114, 63,106,190,119,122,239,116,122, 88,241,158, 28,175, 55, - 62, 85,122,100, 29,249,154,250, 45,140,197, 92,142,214,209,188, 79,238,159, 5, -170, 31,121,118,253,249,111, 46,195, 73, 37,217,155,119,168,139, 72,132, 76, 18, - 33, 44,145, 51,153, 47, 50, 44, 41, 70,125,150, 24,181,142, 85,157,159,252, 11, - 98,209, 44,138,141,191, 68,218, 56,165, 29,101,201,141, 71,254,102, 89,249, 13, - 45, 25, 94, 11,155,172,101,178,170,215,184, 26, 71, 83,228,113, 38, 79,109, 90, -146,198,161,117, 47, 99, 91,227,244,114, 66,254, 32,179, 44,195,200, 30, 25,195, - 48, 45,115,199,136,124, 68,162,187,226,213, 24, 22,117,223,140, 59, 22,142,101, - 41,226, 8, 78,122,200,228,200, 23,150,112,179, 52, 89,242,145,177,135,227, 45, -145,216, 49,207, 51,198,159, 42,231,139, 71,148,222,150,148, 86,140, 85,189,212, - 43,166, 86, 51,189,213,228,239,121, 85,234, 38,247, 30,227, 97, 60,140,135,241, -170,174, 94,189, 74, 18,137, 90, 10, 1, 2,214,227, 91,185,128,127,134,222, 56, -248, 73,141, 45, 73,223, 49,159,239,128, 60,172,138,243, 93,231, 0, 90,251,127, -229,124, 64,150, 99, 51,242,175,244,104, 82, 96, 55,171,114, 45,243,111, 3, 57, -164,104, 59, 70,178,216,255,154, 59, 91,141, 19,194,236,225,133,247,127,178,173, -165,114, 50,144, 9, 8, 68,221,124,154, 30, 80,237,132, 55,180,229, 56,142, 29, - 6, 0,192, 71,182,207,224,123, 2,201,199,219,128, 18, 68, 30, 39,147,169,214, -100, 32,235, 56, 73,193,111,175,125, 86,153,165,255, 6,154,144,128, 28, 16,252, - 58,237,243,128, 78,150, 36,101,158,143,161,106, 74,219,162,170, 5,228, 65, 34, -146, 79,237,136,190, 5,175,130,159,141, 87, 19,190,139, 9,190,203, 41,227,145, - 97,163, 61, 10, 53,147,224,249,111, 94,166, 37,150,207, 83, 43,153, 40,195,225, -116, 68, 37,125,142,217,130, 7,148,153,216, 25,155,168,136,150,240,217, 92,192, - 14, 9,111, 93,102,131, 76, 5, 4, 85, 44, 76,147,167,124,150,210,167,116, 52, -249,162, 56, 29,205,230,235,112, 8, 50, 14, 28,200,178,236,210,169, 89,168,109, -234, 35,153, 65, 65, 6, 4, 17,108, 27,114,186, 33,169, 6,172,106,131, 0, 43, - 88,185,100,110, 88, 74, 62, 11, 71, 3,209,121, 30, 15, 2,122, 94,251, 84, 13, -200, 73,200, 58, 85,243,185,148,251, 35,145, 8,193,197,193, 35, 2,191,238,106, - 8,128, 69, 14,135,195, 65, 6, 56,242, 25,134, 21, 85, 86,214,119,254, 22,170, -236,222,242,220,221,173,175,124,125, 84,249,251,220, 40, 75,226,176, 74,249,160, -148,141,161, 23,118,186, 41, 32,188, 1,101, 10, 91, 84,104, 90,210,134,216, 3, - 46, 44,160,114, 97,255,208,156,181,162,231,174, 32,175,198,233,159,106,164,208, - 74, 88,241,174,113, 53, 26,142,198, 83, 34,242,105, 85,174,234,230, 69, 59, 52, - 37,209,239,194,198,157,176,250,241,221, 87,212,181, 38,203, 73,133,101,236, 0, -126,227, 67,223,113,100,183,190, 27,219,212,119,215, 87, 95,198,178,169, 11, 58, -139,162, 40,138, 68, 30, 5,176,138,106,131, 72,228,221, 91, 24,134,125, 38,154, -182,186,174,109,150, 58,203, 28,254,163,235,122,127,236, 18,189,232, 47,243, 28, - 93,169, 37, 69, 89, 95, 33, 9, 31, 93, 37, 44,181, 59, 83,232,183,102, 41, 80, - 89,187, 53,214, 26,135,126, 69, 43,230, 43,254,149,249,205,229, 1, 0,102,201, -128, 28, 7,209,231,225, 35,153,103,169,187,157,222, 10,172, 11, 30,132,168,178, - 24,213,184, 45,128,112, 25, 36,167, 46,246, 3, 26, 23,209,168,248,102,105,117, -190,223,198, 3, 81, 29, 50, 30, 1, 1, 4,215,214,162,176, 91,115, 74, 87,190, - 52,207,114,101, 75, 22, 56,129, 79,185,172, 92,143,214,158, 48,220,249, 87, 53, -102,186,113, 27,183,113, 27,167, 73, 52,137, 38, 49,187,206,236, 58,207,196,223, - 13,124,247,110, 13,164,105,250,185, 46,136,231, 37,108,220,198,109,220,198,105, - 18, 77,146,214,106,202,239,121, 9, 27,183,113, 27,183,113,154, 68,147,156,160, - 19, 20,145,166,214,121, 98,138,113, 99, 18, 78,159,180, 40,239, 66, 18,162, 70, - 3,215,243,211,244, 76, 43,130,167,166, 11,246,199, 88,178,113,226, 10,161, 65, -166, 74, 48, 59, 83,228,233, 23,152,139,139,203, 5,169,161, 56,252,162, 71,108, - 39,220,186, 84, 41,215, 29, 38,177,198,188,238,183,252, 24, 83, 69,176,194,199, -249, 47,127, 62, 89,110,136,105, 44, 61, 19,182, 46, 85,166,153,214, 39,254, 33, -201, 70,137, 38,246, 15,105,190, 57,231, 5, 30,201, 36,252,146,178, 78,123,116, -145,172,204,145,202,245, 25,158, 27,103,209,146,222,230,162,121, 44, 96,117, 96, -240,106, 37,123, 88, 15, 85, 99,202,152, 73,111,204,103,185,128, 20, 75,191, 99, -159,194,166, 90,156, 45,155, 47,180,185, 40,124,149,203,107,151,119, 74, 46, 49, - 82,198,225, 13,173, 48,223, 46, 99,241,142, 42,137,246, 19, 12,229,210, 85,227, -152, 45, 93,125,124, 98, 71,103,247, 95, 73,255,109, 9, 53, 90,187,239, 72,251, -111,109, 71,149,171,199,235,232, 28,181, 82, 57, 71, 94, 53,118,155, 65,105,144, -144,168,228,249, 70, 37, 27, 18, 0, 20, 0,179,178, 0, 8, 10,139,141, 69, 18, -137,156, 7,138, 82,123,164,224, 70, 68, 24, 7, 16, 7,145,133,196,161,104, 32, -128, 8, 8,137,129, 1,152, 0, 3, 48, 8, 1, 3,160, 0, 66, 1, 24,128, 66, -128,164, 17,249, 41, 92, 88,110, 64, 72,189,192,155, 28, 69,102, 38, 88,122,238, -168,233, 53, 8,164, 18,110,154, 65,152,242, 63,247,132,123, 29, 58,216,208, 0, -125,171, 65, 35,248,194,110, 49,166, 31, 72,161,241, 75,112, 36,119, 64,229, 30, - 11, 40,255,107, 16,246,118,182,183, 32,134, 57,209,237,199, 59, 87,154,105,169, -129, 95,156,174, 93, 64, 90,242,199,107,209, 6,118,225,205,175,113, 28, 65,171, - 22, 32,243,132,126, 42,160, 29, 7,149, 90, 32,234, 9, 46, 22,196, 64,168, 80, -155,252, 21, 71,237,136, 1,105,179, 93, 95,240, 22,228,174, 20,176,178,185, 31, - 2, 12,237,250,130, 0,235,176, 39, 1,220,159,189, 16,239,193,127,197,167,189, - 26,226,232,163,254, 9, 12, 79, 52,154,135,235,201,220,190,193,152,225, 77,167, - 18, 23, 48, 5,210, 55, 26, 97,184,177,227, 40, 6, 5, 71,254, 34, 30,141, 22, - 4,164,200,191,115,120,109,203, 92, 57, 12, 73,209,159,190,143, 95, 73, 19, 24, -116, 67,174,101, 12, 99, 73, 34,195, 88,149,202, 96,200,103, 56, 55,236, 61,148, - 97, 92,145,203, 48, 94,109,253,188,148, 81, 2,104, 63,197, 51,122,144,143, 71, -198, 92,120,248, 29,112, 31,134, 47, 47, 38,237,120, 63,141,114,148, 6,204, 53, -195, 76, 41,141,236,217, 38, 53, 75, 37,156,163,244, 40, 14,148, 4,168, 98,212, - 20,253,225,246, 6,226,210,235, 12,214,152, 12, 3, 32,106,109, 66, 80,239,231, -176,160,224,129,143, 36,245,107, 14, 44, 55,116,123,168,135,109, 14,109, 72,124, -120,207, 63, 76,214, 18,166,176,199,169, 93, 40, 47,241, 13, 36, 97, 26, 41, 46, -196,113,138,177, 90,230, 44,254,155,189,186,162, 9, 81, 46,207,161,201, 25, 43, -191,186,192, 28, 9, 69,199,112, 72, 46,250,153, 44, 1, 41, 97,213,204,121, 87, - 36, 54,124, 34,143, 0, 72, 14,144,208,144,159, 7,227,121, 33, 41,114,250,231, - 22,114,148,239,144, 68, 7,230,130, 90,165,208, 86,149,102,172,225,195, 15,139, - 95,127, 0, 72,109,250, 30, 95, 52, 13, 35, 62, 51,222,250,193, 16, 59, 4,103, -170,100,109,129,148, 37, 63,186,191, 48,169,237,162, 56, 26, 69,132, 13, 75, 90, - 81,192, 43,238,232, 57, 99, 9,120,177, 42,181,171, 28,156,177,120, 81,227,225, - 94,203, 48,171, 48,190,104, 34,156,112,156,140,184,206,149, 34,198, 66, 28, 39, -126, 67,189,164,148,249, 90,138,178, 85, 20, 70,194, 40,153, 78, 84,122, 74,150, -197,142,154,172, 70,117, 12,134,188,231, 53,225,162,146, 41,164,162,195,125, 9, -185, 23, 44,133, 44,250,240, 18,162,229,183, 50, 79, 71,198,134, 56,170, 40,225, -235,153, 52, 27, 35, 14,165,162,197,166, 72, 65,214,203,185,100,220, 26,254, 31, - 50, 29, 71,168, 5, 16, 42, 58,177,148, 66, 32,236,144, 40,128,136,155,120, 20, - 59, 34, 2, 21, 67,169, 73, 67, 24,251,167, 63,120, 0, 92, 24,191,179,185, 3, -191, 48,138, 71, 40, 40, 48,149, 17,136, 1, 97,123, 69, 15, 5,208,181, 2, 62, - 48,226, 29, 32,211,130, 40,234, 25, 17,153,177,246,223,106,221, 5,130,172, 74, - 8, 58,217,220, 16,214,151,113, 98,197,135, 39, 25,240,177,193, 22, 52,201,109, -100, 91,195, 12, 16,142, 58,129, 89, 67, 21,227, 90,221,169,253, 25,153,214, 9, - 98, 48, 80, 77,194,246, 81,131,191, 86, 83, 85,164,153, 96, 83,155,144, 81, 24, - 4,171, 49, 45,152,193, 94, 47, 68, 63,194,136,208,189, 66,250, 68, 24, 37, 8, -113,133, 44,100,129, 48, 68,116, 10, 29,147,113, 36,245,105, 48,194, 94,164,173, -123, 4,141, 9, 38,185,210, 85,176,203,250, 67, 39, 43,156, 57, 2,127,122,200, - 14, 4,149,218, 96,234, 8, 33, 62, 12,225, 80, 87,139, 73,130, 17,228,121,214, -108, 65, 10, 72,212, 27,232,242,114, 33,188, 23,172,215,111, 56, 16, 56,186,186, - 97,108,112,215, 61, 18,144, 63,132,253,193,147,228, 19, 8, 59,119,116,201, 33, - 63, 8,165,195,153,165, 12, 23,104, 83,164, 46,234,212, 29, 81,196, 88,120, 6, -104, 31, 51,249, 24,142,246, 18, 69, 64,163,125, 83, 69, 22,218, 68,132, 3, 92, - 42,174,193,233, 17,121,198, 28,121,238, 36,136,119,109,237,167,131,203,150,143, -172, 11,160, 51,161,117,129, 20, 51, 31,215,222,126,216,175,215,205, 62, 30, 76, -137,253,103,236,159, 14, 9,244,187,194,157, 20,234, 65,161, 90, 39,184,158,221, -121,211, 71,235,107, 22, 13,249, 50, 62,213, 11, 69, 18,220,241,111,129,118, 87, - 70,119,122, 82,170,176, 33,237, 6,140,249,184,141,241,159,136, 13, 64,229, 53, - 2, 42,103,166, 36,238,158,237,248, 72,129, 96, 60,227,141,207,216,224,154,115, - 76,223,174, 98, 2, 14, 89, 12, 99, 43,181,243, 35,102,193,124,228, 87, 20,200, -105, 37, 22,197,106,240,222,186,158, 41,192,133, 91,159,203, 22,102, 75,254, 56, -198,128,107,113,157, 73, 96,205,131,101,150,137, 60,223,210,204,167,229,208, 82, -128, 65,136, 54,110,101, 96, 32, 56, 61,140,157,154,112, 36, 92,245, 16, 80,198, -216, 42,228,107,248,110, 10,248,206, 38, 65, 64,183,143,254, 81,106,105,132,202, -202,185,198, 68,108, 35, 64, 20,162,231,219,109,159,193, 44,244,232,248, 83,214, -103,197,200,237,192,202,139,101,228,180,253, 10,172,103,113, 56, 29, 64,148,110, - 80, 71,144, 63,214, 50,148,187,227,249,154,118,243,208,150, 26, 78, 36, 7,135, - 86,220, 53,120,134,168,109,219,158, 81,162,105,209,157, 97,221, 49,233, 76,225, - 19,146, 4,178, 2, 34,243,141,130,121,104,185,197,175, 11,151, 72,169,170,173, - 36, 32, 19,116, 12,176,223, 47,161, 73, 31, 80, 32,121,174,198, 97, 87,107,100, -252, 12,129,138,221,128,138, 91,220,159,113, 32, 16,116,178,205,121,229,153,107, -220, 28, 88, 14,211,246,150, 90, 41,128,190, 72,118,129, 71,252,247,224,227,204, - 76,100, 85, 66,113,164,249, 1,250,231,129,192,237, 26, 90, 15,139,119, 27, 31, -183,223, 64,110, 52,228, 96, 16, 16, 9,126, 86,138, 35,241,190, 86, 25,129, 21, - 0, 43, 9, 86, 35,138, 68,233,209,188, 39,193, 30,114,138,128,139,112,115,228, -215, 58, 66, 95,240, 67,145,124,135,231,170,163, 11, 30,225,155,223,194, 49, 28, -124, 30, 21,243,122,251,111, 84,199,221, 88,148, 60, 32, 6,141,205,233,116, 97, - 69,255,213, 73,136, 12, 60,113, 15,206,112, 20,205,171, 80,106,106,111, 44, 95, -186, 14,188,225,249, 57,151,222, 26,254,112, 28, 39,193,148,176,213, 2,121,210, -202, 11,103,102,246, 16, 83, 84,105,229,223, 9, 40, 1, 83,184,110,218,197,130, - 29, 56, 81,107,151,164, 59,154,196,172,207, 90,126,115,220, 65,138, 4,161,137, -176,139, 50,136,151,168,200, 17,200,204,167, 35,185, 69,242,133, 13, 22,110, 20, - 80,162, 72, 5,201, 1, 86,136, 37,230,241, 83, 87,221, 12, 92, 85,171, 41, 0, -117, 16, 5,168,130,151,138,191,112,189,210, 92,151,198, 2, 21, 23,136,156,217, -147, 80,228,114,187,197,183, 68,100,220, 21, 85,203, 60, 1, 22,240,218,203,248, -189,199, 77,218,159,194, 29,138,132,250,103, 64,100, 4, 8, 88, 83, 64,188,170, -119, 5,143, 73,197, 13,247, 39,219,230, 18,130, 50, 66,144, 31,155,207,180, 81, -150,111,133,161,107,193, 9,164,226, 55,249, 64, 49,150, 2, 40,183, 56,107, 58, -220,111, 40,245, 35,130, 62,177,175, 48,162, 34, 82, 40,184,222,186,113, 72, 30, - 29,155, 63, 33, 85,247,211,144, 31,173, 32,221,237,150, 76, 89,229,111, 99,138, - 38,121,229,132,184, 54, 42, 42, 0, 3, 27, 0,201,147,200, 96,252, 31, 95,229, -193, 50,205, 79,121,191,240,108,246, 84,158,137,134, 16,200,181, 15, 19,106,100, -200,132, 94, 47, 81, 83,129, 4, 31, 38,137, 45,191,118,206,100, 32, 31,121, 79, -101,209,210,188, 17,222, 88, 20,114, 18, 8,168, 33,239, 41,146,122,208, 68, 43, - 28,128,213, 21,220,184, 2, 61, 22,168, 82,122,131, 26, 43,195,135,135,156, 67, - 16,185, 64,191,245, 73,254, 16, 31, 13, 22, 97,245, 19, 54,212,164,246,135, 90, -171, 66,166, 0, 47, 15,198,134,244,213,220, 62,230, 17, 27, 18,114,107,172,217, -129,128,150,190, 82, 84, 27,146, 19, 78,220, 11,241,178,185,184, 79,208, 23,130, -159, 92, 35,130, 96,172,191, 8, 69, 86, 4,156,186,231,217,171,253,199,119,254, -164,226,175,109,161,241, 15, 4, 37,124,169, 75,157,154,212,104,100,132,177,163, - 68, 64, 27,223, 51,239, 97,171, 96,232,253,235,156,101,252,106,125, 2,161, 56, - 59,167,136,163,233, 98, 36, 94, 57, 13,247, 87, 55, 41,158,217, 33, 69,133,103, -211,217, 22,198,116,218,109, 33,164, 7,140,188,147,250,254,162, 44, 41,235,150, -102, 35,186,202, 82,193,101, 96,187,204,239,116, 0,223, 34, 82, 32,206,209,147, -255, 30,199,168, 41, 34,179,141,250, 60,182, 28,235,140, 62,135,184,113,243,249, -249, 61,136, 28,165, 73, 93, 48, 73,106,204,234,153,194,246,253,216,234,203, 22, -184,167, 2, 29,218, 71,165, 1,224, 56, 39,172,166,108, 52,127, 29, 77,198,160, -221,245, 21, 80,222,113, 66, 53, 22,216,212, 11, 81,212,246,169, 43,170, 22,253, - 42,209, 72,167, 26,181,216,106,144,106,116,144,106,175,221,134,238, 43,165,237, -135, 61, 83, 81, 74, 38,129,230, 53,191,163,219, 86,145, 34, 60, 24, 4,227, 56, - 9,205, 90, 52,193,228,116, 14, 70, 21, 96, 46,127, 69, 97,226,130,226,124,226, -117,160,214, 68, 40,122,253,209,216, 58,196,123,209, 24, 74,217, 4,138, 68, 11, -186,251,182,107,214,247,166, 81,130,179,106, 58,169,166,188, 9,229, 67,196,137, - 88,184, 33,198, 46,133,146,186,205,144,133, 75, 47,157,180, 19,162, 57, 14, 34, -185, 52, 95,145,194,197,134,124, 99,227,180, 74,160, 43, 71,111,156,200, 86,236, -144, 15,122, 37, 11,150,212,235, 4,217,158,236, 44, 42,139, 58, 64,210, 28, 83, - 79, 47,192,217, 30, 74, 17, 30, 95,226, 51,174,176,212, 86, 81,215,221,124,112, -161,192,159,158,164,231, 6,229,221,223, 3,131,119,213,148, 0,170,134,178, 61, - 99, 12,214, 6, 43,166,106,137,249, 35,123,122, 74,173, 57,220,159,127,253, 6, -131,172,247,102, 79, 78, 18,204,158, 75, 91,175,238, 79, 3,205,186,140,235, 15, -207, 85, 8,122, 40, 74,245,232, 74,238, 52,202, 9, 42, 25,105, 65, 23,156,215, -152,173, 19,189,231,108, 54,190, 62, 93, 30,195,224,210,196,250,172,131,240,129, - 48,133, 69, 93,140,100, 28,217,151,206, 74, 55,113,244,193,114,151, 73,233, 14, -137,250, 74,129,201, 44,138,209, 6,246, 44,101,133,226,231,161,165, 12,131,142, -161, 42, 64,216,125, 51, 9,221, 20, 61,152,119,109, 91,160,178,185,140,242, 41, -113, 35,152, 75,205,107, 5,107,156, 59,233,183,122, 74,156,188,234, 45, 12, 45, -185, 58, 79, 46,134,127,252,208,203,238,156,182,203,152,247, 9, 70, 48, 85,135, -219,159, 62,115, 83,245, 3, 36, 97,188,207,110,213,255,101,112,243,253, 57,133, -235,151,128,106, 86,150,224, 71,204,149, 82, 51,180,200,168,219,119, 24,189, 11, -226, 90, 1,237,135, 0, 10,134,155,118, 2,228,223, 58, 27, 98,188,220,109,210, -177,164,160, 57,221,120,235,120, 56,168,240,135, 35,145,163,167,226,185, 94, 9, - 53, 71,253,225, 15,162, 78, 72, 42,162,128,104,151, 37, 81,195, 39,168,254,224, -254, 44, 91,254, 48,250,170,248,148, 55, 6, 26, 37, 35, 82,145, 54,170, 91,126, -221, 57, 62, 65,229,107, 14, 80,244,246, 38,176,104,194,233, 69,190,103,131,108, - 39,108, 57, 48, 17, 67, 23, 60, 71,154, 19,163,133,119, 6, 13,250,220, 81, 12, - 9, 44,177,204,231, 40, 75, 62, 48, 1, 4, 27,102,137,117,195,234,205, 25,175, -138,194, 92, 16, 45,210,147,221,142,150, 7, 22,229, 33, 45, 68,121,116, 24,200, - 92,197, 63, 23, 93,194,111,185,116,232,200,197,120,190, 86,106,250, 2, 27,118, - 21,215,151,160, 58,249, 43,238, 89,200,157, 26,123, 78,123,232,230,106,179,109, - 21,122,189,242, 74,216,200,230,173, 23, 88,206,204, 2,137, 11, 75,192, 86, 81, -237,225, 76, 56,205,163,224,168,130, 15, 17, 70,214,152,230, 29,142,235, 94,238, -160, 50,225,139,111,131,241,163,216, 80,131,199, 45,142,116, 33, 64, 45,205, 47, - 72, 61, 59,145,159,226,198,194, 18, 22,194, 14, 62,185,240,107,252,118,109, 5, -134, 36,139,233, 28, 1, 13,184,141,223,230, 18,116,137,210,209,110,100,251, 95, -130,198, 0, 43, 81,131, 5,139, 45, 32,176, 56, 35, 20,121,226, 61, 3, 1,213, - 57,176,133,199, 90,111, 62, 88,116,113, 80,113, 5,229, 98,223,129,174,252, 82, - 32,242,169,133,129,220, 61,173, 53, 46, 0, 51,228, 26,123, 98,159,138, 58,111, - 5,226, 14,175,254,168, 46, 73, 65,243,150,217,123, 81,130,231,133, 67, 82,248, -180,107,108, 82,212, 87,120,155,139, 99,201, 36,212,175,245,199,227, 91,102, 50, - 67,130,241,208, 24,242,215,113, 10,249,151, 30,252, 91,228,214,156,119,194,160, -161,201,141,152,232, 40, 9,241,141,141, 20, 78,176, 50,245, 62,172, 74, 1,148, -105,222,204,153,143,249,127,208,195, 13, 25,226, 27, 61, 1,184, 48,199,116,226, -135, 7, 41,165, 45,198,254, 38, 65,122,251,208,140,186, 81,142, 84,154,117,167, - 11,104,237, 81,226, 42,138,155, 91,124,129,252,197,215, 64,240,146,136, 21,113, - 33,226,174, 90,196, 82,204,119, 80,107, 47,135, 90,233, 18,148, 25,213,226,196, -137,180, 79, 45,243,177, 5, 66, 6,138,197, 40, 56, 47, 82, 99, 27, 73,166,138, -192, 51,156, 39, 85, 74,177, 47,206, 34,124, 75,101, 40,220,130,123,182,122, 4, - 40, 80, 19, 46,222,228,247,208, 52,185,104, 3,113,204,127, 23,148,133, 56,103, - 91,112,226,231,144, 91,161,135, 80, 69,242,159,157, 40,193,130, 2,128,103,143, - 2,140,140, 72,115,225,218,143, 18, 19, 14,112, 83,121, 73,176,214, 53,213,224, -247,209, 84,247,111,202, 2,171,136,208, 60,245,149,110, 37, 16, 34,181, 74,174, -101,232, 42,158,252, 47,173,244, 12,172,159, 67, 35,196,158,177,136,177,211,217, -164,221,211, 68, 19, 26, 64, 52,158, 11,128, 20, 41,100,226, 62, 37,241, 79, 15, - 48, 46,133,249, 62,210, 56,233,239, 70,151, 0,187,180,229, 16,109,230,203,170, -188, 53,202, 35, 60,216,126, 69, 24, 80, 6,102, 79,179, 10, 35,240,227,221,147, -237, 51, 73, 82, 36, 90, 49,203,203, 19,214, 39, 22, 33, 13,120, 69, 69, 17, 38, - 90,157, 28,134,149, 85, 63, 74, 14,156, 84,167, 48,129, 52, 27, 78,165, 82,154, - 96, 5, 74,157, 88, 27,255, 50,138, 84, 68, 35,110, 6,161,152,112,242,191,152, -193, 39, 30,107,220,196,125, 43, 89, 57, 11,141, 38, 96, 37,196,156,247,170,100, -160, 58,150, 18,221,155,250,108,214,164,170, 39,217, 31,207,175,190,158,225, 37, - 94, 25, 57, 20,197,135,238,159,173,240, 19,182, 0,146,189,141,151,145, 45,253, -109,185, 46, 51, 83,236, 22, 45, 36,161, 55, 83,207,167,132,116,250,171,227,195, -209, 67,211,157,171,165,209,217,233,182,195,109,247,215,149,108,149, 87, 71,214, - 86,149,134,115,142,173,117,161,105,197,239, 82, 15, 10, 30,199, 85,248, 41,204, -213,113,206,110, 4,204,178,168, 74, 45, 39, 16, 47,131,140,211,249, 28,124,102, -134,119, 14,233,117, 1,175,110,240,192,101, 53,151, 47,226,125,217,105, 46,176, - 57, 23,234,165,208, 2,205,233, 16, 16, 57,245,224, 65, 61,120,163,180, 29,227, -172, 56, 4, 49, 80,154, 77,239,174, 2,250, 23,136,238,130,203, 95, 24, 52, 60, -244, 32, 94, 40,102, 11,237,244,158, 7,119, 31, 45,176,200,153,141,106,236,148, - 91, 7,178,166,114, 62,149,202, 80,234,225, 90, 69, 23,153,205, 71, 84,214, 9, -216,173,128, 73,198,200,141,218,172,126,183,167, 76,255, 32,241, 72, 8,184,155, - 22, 33,248,165,169, 70, 29, 48,109,200, 79,124,148,133,202, 52,181,187, 6,204, - 79,187, 41, 72,165, 8,198,252, 52,133,121,170,119,250, 69,204,123,129, 94,129, -162,172,244,165, 4, 21, 22, 0, 97, 65,129,158,209, 88,109, 18,150,231, 49,199, -100, 5, 21,181,102, 60,201,130, 7,152, 74,216,230, 5, 69,200, 99,102, 73, 86, - 0, 55,114,206, 50, 39,178,172,237, 61,135, 46,157, 61, 83,168, 40,195, 52, 76, -220,195,230,153, 43,169,156,142,149, 15, 52,139,210, 69,198,158, 82,174, 89, 62, - 74,221, 40,124,154,121,152,139, 80,193, 62,113,188,110,186,217,241,184,118,151, - 29,182,133, 31,209,134,171,171, 42,106,144, 32,169,225, 15,211,169,234, 90, 72, -231,143,196,246,155,224, 11,114,190, 95,165,198,175,136,176,146, 0,176, 52,164, - 18,234,208, 34, 53, 50,155,253, 17,116,174,240,163, 21, 58,184, 42,130, 75,213, -219,133,160,124,171,253, 62,101, 42,195,197, 92,133,172,147, 77, 13,103,193,202, -101, 38, 59, 32, 18, 20,244,205, 1,250,230, 88,133,227, 19,147,140,165, 75, 18, - 32, 13, 98, 92,224,246, 34, 83, 55,155,142, 23,160, 43,106, 95, 11,185,206, 54, -130, 5, 83, 74,199,248,153, 20, 43, 49, 55, 16, 6, 32,245,161,215,188,117,250, - 66,207,205, 85,191,161, 40,242,186, 5, 7, 79,104,114,132,214, 4,217,136,170, -232,215, 98, 34,100,169,184, 11,179,200, 2,153,108, 4, 44,167,150, 7, 80,138, - 69,119,194,212, 41, 22,164,171, 12, 32, 4,107, 15, 38,173,171,198,188,208, 39, -255, 77, 22, 67, 85, 11,243, 26, 34,119,136, 53, 64,112,187, 54,236, 69, 56,226, - 19, 4, 4,123,234,159, 94,106, 82,130,228,160, 85, 46,175,249, 53,190, 5, 41, -107, 40, 7,121,121,142, 58, 72, 49,128, 21,242,163, 50,140, 23,233,220,224, 78, -140, 27,174,139, 64, 58,134, 43,251,143,172,253,254,242,131,152,186,199,147, 26, -173, 62, 50, 12,139,239,170,119,148, 23, 58, 15,201,193,156,244, 4, 4, 40,134, -146,146, 76,145,247, 86, 68,253,123, 53, 59,163,103, 62,149, 33,132,192,208,225, -202,183, 4,160,234,112,234, 98,109,120,231,176,161, 22, 71,175,149, 46, 80,172, - 58, 56,211, 78,107, 0,128, 45,152, 66,147,189,155,151,122,121,150,143,138,142, -159,196, 66, 0, 38, 64,158,241,237,188,118,213, 71, 10,217,120,102,160, 6, 48, -221, 96,167,209,105,173, 47,178,141,198, 22,251, 21, 32,173,236, 58,146, 19,160, - 2, 47,127,172, 3,207,199,226, 30,148,119, 57,183,254,228,209,135,106, 69,217, - 55,195, 51,113,162, 97, 15,145,231, 38,167,159,225,101,185,105, 12, 47, 98,121, - 55,217,166, 48, 27,206, 7, 55, 29,221,171,180,232,174,195,120,132,121,104,189, -187,187,132, 58,191, 84,236, 56, 77,185,253,105, 90, 34,171, 48, 14,101,157,186, - 30,180,210, 56,157, 8, 50,138, 15,151,128, 64,119, 38, 66, 36,224, 69, 21, 51, -165, 5, 66,229, 75, 78,119, 65,125,242,237, 73, 83,158, 95,242,196, 76,242,183, -238,125, 30,244, 48,172, 68, 25,128, 47, 49,207, 47, 9,185,195,104,232,247, 32, -235,158, 88, 25,196,109,237, 11, 73, 70, 2,234, 6,132,218,144, 56, 63,124,108, - 18, 27, 17,215,121, 7,225,210,119,170, 77,155,151,100,154,222, 83,198, 72,248, -114, 74, 68,226, 83,131,238,250, 14,150,167, 16, 60,218,221,216, 65,242, 85, 3, -122,183,173,207, 15,121,152,243,160,121, 24,116, 93,128, 44, 48, 6, 82, 90, 38, -243, 12, 49, 44, 11,253, 71, 41, 70, 80, 74,196,243,245, 67, 6,130,131, 61,231, -201, 21,130,212,188,101,133,187,170, 98, 22,208,246,171,170, 98,152, 64, 41, 34, -151, 69,157,167,224,110, 60,223, 4,150,238,117, 19,236,144, 43, 45,108, 32,251, -116,234,132,139,199,153,124, 58,223, 38,236,144, 21, 26,120,229, 10, 10, 7,110, -118, 28,124, 86,175, 25,207, 19, 53, 33,143, 83,210,106, 98,192,162, 51,133,153, -151,129,152,198,118,136,245,164, 98, 78, 8, 99, 98,196, 80, 59,232, 6,135,152, - 2, 99, 95,217, 38, 87,233,124, 76,154, 14, 52, 51,233, 43, 58,168,174,118, 96, - 40,103,141, 74,159,215,162,141,198,134,137, 31,162,233,221, 86, 63, 82, 64,206, - 96,181, 64, 83, 64, 3,202, 97,156,193,171,106, 6, 38, 63,135, 41, 3, 72, 3, -183, 11,122, 17,196, 59,225, 32, 8, 30, 16, 25,140, 14, 28,224, 67, 68,244,208, - 64, 0, 25,105, 86,124,217,249,135, 6,121, 8, 43,254,202, 56,192,219, 10, 3, - 60,112,235,141,137,116, 15,112,120,103,248,129, 57,187,174, 77,153,115,166, 40, - 89,113,135,240,137, 15,227,202,131,149,130,132,173, 15,216,231,249,150, 1,232, - 6, 35, 39,118, 80,255,230,129, 84,127,126,154,213,227,210,199, 63, 20, 87,107, -234,191,128, 35,160,236, 18,146, 81,234,204,161,203, 39,111, 98,134,192,236,174, - 17,197, 75, 74,196, 49, 86,156, 93, 12, 93,235,154,164, 22,248,218,178, 52, 30, - 79, 62,240,105,135,144, 6,217,172,201,148, 5, 82,231,167,156,248,128,135, 98, -119,101, 73,117,131,106,198,231,234,234,136, 43, 79,200,208,198,225, 78, 70,121, -155, 79,201,196,160,207, 72, 97, 81,233,163, 37, 32, 7,147, 31,124,253, 29,157, - 72,185, 71, 21,189,198, 65, 25,183,243,251, 77, 55,242,111, 74, 70, 64,201,238, -164,200, 20, 3,252,182,128, 66,155,171,161,117, 68,211,108,126, 47,129, 32,144, -119,217,191, 86,140,162, 6, 35, 50,142, 50, 98, 21, 59,154, 62,142, 94, 87, 62, - 67, 24,241, 99, 76,118, 34,171, 77,110,152, 38,228,119, 54,149, 49, 62,147, 62, -162,199,217, 6,109,201, 67,123,176,200,215,173, 72,150,200,132,206,200,188,251, - 18, 91,176, 2, 78, 47, 32, 82,251, 36,110,199, 34,147,182, 82,213,227,169,130, - 33,219,224,147, 83,233, 17, 32,224,161, 69,174, 72,151, 3, 39, 13,144,198,162, -159,126, 43,136,231,101, 31,246,115,240, 80,227,138, 95,175,188, 82,239, 53, 26, -204, 75,164, 98,215, 45,104, 2, 23,135,225,123, 94, 82,133, 83, 28, 32, 19,146, -127,104,167,187,242, 60,221,255,208, 32,167,146,173,139,133, 4,157, 54,214, 30, -250,150,225,113,128,182,119, 3, 10,168, 46, 13,102,144,213,112,176, 4,211,194, - 89,255,184, 57,163, 52,111, 32,111,230,247,228,108, 83,129,146,249, 65,239,176, -127, 93, 50,119,158, 83,203, 97,152,128,214,180,154,155,125, 11,167, 43,172,129, - 28, 76, 65,171,232, 1,224, 76,200,154,193,230, 17, 97, 83, 47,228,204, 16,113, - 13, 14,216, 4,166,141,160,135, 83, 10, 68, 86,215, 14,169, 74, 87,201, 23, 0, - 95,241, 99,136,217,245, 72,187,151, 88,170,170, 35,254, 69, 50, 58, 64,210, 16, -157,129, 49,227, 23, 5,194,191,244,114,234,210,131,232,166, 34, 53,221,195,113, -204,169,223, 3, 54,150, 38, 22, 39, 9, 37,223,251,162, 84,169, 46,252,109,224, - 23,228, 84,211,177, 88,106, 89,118,114, 37, 4,119, 0,156,207,111,222, 70,180, - 41, 61,211,247,216, 9, 50,178,119, 76,139, 9,251,210,209,167, 38, 76,128, 90, - 43,229,132, 56,172,250,211,200,210, 99, 92,233,102, 34, 3, 94, 21, 29,113,209, -151, 86,197,248, 75,136, 55, 19,110,196, 84,250,184,166,158,238,250,216, 41,182, -159,170, 23,243,158, 25,103,119,102, 69, 73,148, 59,228,155,170,138,128,114,137, - 78,159,248,253, 99,243,250, 44,211,248, 5,200,242, 39, 36,166,128,131,156,237, -165, 16, 58, 41,122,210,142, 98, 65,224,216,218,225, 16,232,148, 48,159,206,133, -162,227,189, 26, 73,215,182,105,161,159, 56, 63, 10, 87,177,121, 94,126, 50, 48, - 44,222,224,251,245,216,173, 97,142,171,227,241, 85,135,191,247, 79,242,210, 63, - 26,124, 75, 52,149,110,126,198,146,134, 81,209,148, 51, 36,130,112, 14,145,193, -120,165,230,211,250,220, 32,151,106,162,105,233,114, 83,226,112, 27,153,177,152, -211,241,161, 41, 54, 16, 7,166, 34,160, 46,210,212,144,136, 5, 20,105, 60, 77, -105, 93,237, 60, 55, 7,133, 38,247,138,124, 39,157,235, 41,180,203, 13, 59, 97, -176,177, 26,179,166, 36,153,173,149,243,202,171, 81,174,100,139,104,103,120,113, - 39, 52, 48, 42,217,246,168,240,130,252, 65, 82,209, 74, 40,224,156,245,188,253, - 35,167,199,232, 5,249,213, 31,247,200,177,243, 57,200,192,122,210,142,133,109, -224,242, 26,180,229, 68,240,230, 62, 4,188, 28,138, 31, 48, 86,151,200,255, 10, -124,202,212,245, 60,111, 94,162, 51, 24,180,135,125,229,181, 21,110,172,147,249, -167,140,247, 87, 36, 38, 24, 10,177,246,107,131,107,143,212,140, 0,109,185, 84, -115, 98,137,184,206, 9,203, 37, 31, 7,226,228, 15,231,101,128, 96,151,162, 5, -213,130,228,139,114, 57,110,192,186, 58,140,165, 11, 72,242, 47, 65,200,249, 69, - 93,182,244,179,114,137,154,156, 36, 40,150,156, 90,202,229,143,193,103, 76,190, - 15,241,167,216, 87, 75,223,123,114,225,223,130,246, 92,235,149, 81,126, 8, 59, - 95,190,227, 72, 25, 27,227, 73, 22,225,250,213, 50,136,217,180,176, 68,239,157, -128, 82, 41,130,223, 98, 93, 55,160,158, 79,179,180,175, 32,188, 0, 41, 30,123, -208, 50,125,249,213,155,104,229,138,178, 69,220,124, 75, 4, 23, 53, 63, 9, 30, -180,124, 29,130,111,172, 58,228,245,136,240, 21, 40,238,134,240,105, 93,118,227, - 5,146, 68,247, 22,193,131, 55,124,195,164, 18,192, 78, 38,119, 99, 29,112, 43, - 97,227,236,197, 10, 98, 1, 57, 99,153,232, 12, 57, 37, 61,105,198, 54, 40, 11, -141,133,218,122,235, 64, 36, 1, 41,145, 49,254,177,214, 94, 78, 3,221, 36,106, -106, 29,113,144, 96,242, 51, 28, 56,112, 13,100, 51,217, 70, 0, 28,131,131,252, - 15, 70,238, 76,177,222, 54,237, 98, 2,134, 75, 37, 16,167, 9, 63, 22,223, 72, -217,111,193,139, 84,158,103,154,226, 80,117,178,155,209, 34,184, 18,184,202,244, -107, 28, 41,142, 47,186,234,211,146,236,138, 84,179,173, 65, 67,194, 81, 5,196, - 91,107,134, 83,225,113, 1, 98, 51,102,104, 43,137,249,227, 3,180, 32,160, 69, - 67,195, 60,195,114,177,141,180,137,241,251, 88, 52, 86,113,112, 56, 97,134, 86, - 25, 83,248, 58,133,121, 37, 51,185,138, 31,167, 23,249, 90,103,155, 73,225, 96, -241, 48,198, 46, 27,169,209,134,232, 10,114,202,197,234, 69,238,225,103, 39,151, -228,115, 26, 86, 30,198,152,217,242,222,123, 64,128, 72, 23, 43, 96, 76,118,111, - 47,120, 38, 14, 96, 19, 44, 85,128,138,123, 84, 14, 43,152,254,194,108, 50,198, - 83, 13, 1,149,144,126,177,193,135, 81,183,206,102, 14,121, 85, 96,150,188, 44, - 53,117,119, 81, 32,107,142,179,164, 44, 15,143, 98,204, 27,105,194,185,183,221, - 0, 74,241,216,104,251,224,173, 27,180,220, 47,144,151,180, 96,228,196, 55,104, - 33,241,131,109, 94, 2,254,211,179,170,123,197,120, 93,157,154,190,118,206, 18, -131, 26,140, 38,151, 85,252, 82, 73, 76,217,224, 26, 6,209,141,137, 22,205,144, -171, 39,126,131,187,180,177, 33,129, 70, 41,103,169,160, 30, 37, 57,128, 69,225, -161, 79,176,158,124,139, 84,201, 2,253, 12, 11, 19, 48, 81,199, 86,233, 15,201, -171, 8,216,118, 35,138, 7, 56, 23,251,184, 46, 16, 19,135, 63, 22, 80, 10, 77, -191,124, 1,221, 30,165,106,207,225,109,121,112,102,119, 21, 31,228,114,124,122, -162,121,137,139, 92, 33,227,127,217, 52, 90,148, 67,242,175,236, 53,215,113, 58, -121,185,224,235,114,239, 49,204,120, 91, 24,184,141,193,215,103,235,163, 36,166, -220, 75, 71, 92, 21,225,105, 45,124,194,216, 38, 8, 62, 36,117,196,237, 96,178, -227, 39, 29,147, 35, 19, 69,103,148,249, 98,115, 66,228,141,184, 87, 2,138,153, - 93,104, 59,234,215,174, 60,219, 0,129, 97, 35,189,149,201, 79,250,254,147, 10, -127,119,141,188,241,120,109, 19,199,214,171, 10,137, 86, 57,207,188,133,176, 45, - 6, 19, 96,197,160, 96, 17, 98, 40,153, 66,246,129,181,153, 61,101, 68,163,137, - 36,132,128,206,237,182,137,254, 11,156, 50,230, 23,149,105, 3,153, 59, 60,250, - 88, 19,205,138, 68, 9,182,148,212, 50, 78,204,193, 42,209, 73, 11,250, 11, 88, -238,183,142, 11,204,143, 46,140,102,108, 72, 90, 42,158, 71, 94, 12, 2, 97,160, -121,133, 42,106,115,130,117,160,186, 38,100,249,253, 1,155,192,187,147, 40,238, -194,181,205, 66, 27, 68,235,233, 78, 94, 40, 37, 17, 96,209, 0,175,247,113,111, - 30, 61,197, 12, 62,228,185,206, 13,178,160,180,235, 46,151,162,196,145,107, 62, -234,174, 20, 33, 71, 53,153, 88,247,200,210,164, 51, 59, 59,254,160, 76,118, 48, - 23, 97,130,161,154, 99,182,233,154, 64,252,189,151,108,130,100, 52, 40, 69,112, - 9, 13, 2,197, 58,195, 73, 66, 80, 22,146,181,139,236,254,148,192, 55,197, 28, -107, 97,158,220,192, 96,135,138,177,225,172, 46,236,180, 7, 38, 25,211,161,234, - 64,105, 91, 63, 10,144,250,231, 98,131,223, 82,117, 82, 4,147,220,106, 77,174, - 59, 98,149, 22, 96, 68, 1, 37, 58,232,134,189, 72,141, 19, 79,176, 35,220, 65, - 61,223, 81, 49, 34,162,126, 46, 36, 99, 87,228,253,188, 79,162, 70,244,254, 46, -124,125, 30,119,108,201,119,114,178, 44,169, 9, 45,170, 99,138, 7, 61, 9,240, - 8,100,160,169, 8, 20,158,230,102, 79, 7,174,191,197, 38,164, 54,181,169, 57, -210, 37, 45, 14, 21, 46, 37,141, 98, 56, 27,150,183,237, 44, 87, 27, 83, 4,111, -192,229, 77,213,212,137,142, 92, 64,161,163, 88, 94,248,154,117, 44,149,149,118, -179, 83, 47,100,255, 56,172,131, 73, 40,194,127, 88,176,125,245, 0, 6,188,144, -192,211,138, 20,174, 65, 84,118,197,176, 6, 30,135,199, 56,128, 57, 98,213,140, -248, 90, 10,141, 24, 0, 10,237, 33, 35,178, 38,156,227, 73,178,144, 40, 28,155, - 97, 51, 26, 19, 37, 55, 2, 23, 15,252, 36,206,128,170, 26, 92,142, 73,124, 42, -141,222,115,218,171,240,149,238, 54, 83,232,175, 58,130,213, 52, 52,101, 1, 59, - 1,138,251,157,192,109, 28, 28, 86,223, 43, 76,126,119,234, 0, 33,207, 97,169, -225,179,253, 39,159, 82, 49, 20, 2,165, 72,128, 37, 3, 53,167, 12,138,210,220, -134,103,128,241,145,250,170, 23, 47,168, 30,249, 43,221,213, 9,160,153, 97,138, -121, 65,181, 14, 72, 8,178,226, 74,124, 10,237,161,225,170,212, 87, 99, 8, 97, - 95,183,241, 50, 22, 41,151,172,114,131, 10,134,153,133,233,100,193,164, 84, 14, - 82, 78, 25,242, 74, 1, 14,136, 68, 39,153, 12,229,118,243, 16, 2, 83,206,178, - 78, 23,170,228, 36, 87,125, 87, 24,145,160, 99, 75,126,139,247, 69, 48, 68,204, - 74,166,156,222,190,240, 34,106,105,111,182,219,247, 95, 95,105,112, 91,236,137, - 4,201,160,172, 83,237, 35,160, 12, 2, 88,252,189, 3, 79, 13,125,173, 7, 12, -129,179, 96,157,154,117,140,254, 12, 41, 49,161, 88,124,104, 91,153,123,187,157, -196,217,190, 54, 39,146,168, 73,118,238, 12,175,187, 10,168,210,163,254,178, 8, - 19,193,168,179, 63, 73,169, 43, 1, 64, 44, 40, 49,129,222,225,126, 93, 73,107, - 15, 65, 29, 7,240, 38,172, 8, 24,102, 62,164,181, 53, 82, 29,132,191,218, 10, -114,172,249, 88,167,164,122,180,160,223, 15,146,165, 31, 31,168,253,115, 78, 3, - 2, 87,195,115, 11, 63,220,174, 73,180,231,173, 62,167, 84, 64, 40,166, 68,150, -195, 11,243,246,121, 34,209,132,181, 17,196, 88, 9,117,119, 76,147, 58,188,116, -102,179,169,175,199, 16,214,112,165,175,197, 66, 14, 52,182,211,116, 98,173,218, - 73, 45,153, 88, 40, 48, 82,105,237,153,181, 4, 73, 51,253, 20, 82,150,249,131, -186,203, 42,216, 97,165, 49, 60,116, 92,131, 78, 12, 57,207,194, 89,175,168,122, - 51,226, 30,237,140,193,156, 6,209,209,141, 48,185,132,245, 69,242,201,162, 38, -112,229,147, 66,227, 97,194, 89, 50,160,193,145, 16, 40,146,229,184, 20, 14,234, -111, 13, 5, 98, 55,229, 61,252,195,137,132,168, 89, 50,241,204, 11, 76,169,235, -251, 80, 34,139, 73,175,192,132,164,242, 79, 18,179,193,146,248,182, 28,105,113, -167,253, 77,238, 32, 87,135,209,114,206, 74, 46,238,175,234,111, 27, 14,254,185, - 13,216,244, 44, 50, 94,222,104,101, 79, 86, 70,187,137, 14, 76,138, 64, 19,105, -147,215, 30, 13, 60, 9,130, 40, 58,116, 99,197, 34,255, 95,128,110,106,177, 71, -111, 77, 89,102, 65, 59, 8, 58, 2,128,117, 49,224,217,145,170,183,182,246, 56, - 48, 51,253,149, 29, 63, 3,170, 87, 44,248,191, 97, 88,130,120, 41,242,137, 89, - 83,107, 47,206, 2,237, 53,166,160, 86,156,186, 32,170,226, 22, 23,228, 76, 86, -205,148,129,255,119, 49,193,126, 36,107,122, 27, 65,211, 20,184, 40, 85, 4, 49, - 54,234, 24,228,194,171, 45,108,246,190,210,151,219,184,149, 23, 46, 42, 0,223, - 33,241,129, 66,186, 12,105,232,164, 4,232,180,229,117,103, 3,144, 78,131,185, -188, 45, 13,190, 96,170, 90,209,213,170,132,167, 5,252,123, 54, 49,252, 38,136, - 65,212, 28,166, 51, 87,180,144, 3,205,106, 93, 33,180, 22,106,167, 21,213,117, - 83, 50, 12, 82,255,157, 6, 93,222,213,203, 16,198, 17,243,236,106,172,182, 34, - 57,178, 83, 45,174,176,235,158, 51, 53,142, 99, 63,214, 18,204,152,199,174,231, - 48,234, 80,232, 9,227,232, 53,227,114, 81,134,128,154,117, 77, 13, 68,179,107, -245, 43,122, 67,114,153, 11, 34,181, 85, 90,237, 64,186, 74,122, 11,152,102, 27, -229, 81,143, 46, 19, 35, 31, 27,100,179,147,109, 67, 44, 39,183,138, 15,194,132, - 46, 92,152,180, 24,142, 83,127, 90, 0, 74,124, 60,193,153,236, 48, 4, 80,188, -148, 89, 72,229,193, 61, 86, 35,177,178,148, 61,219,109,136,236,254, 83,201,143, -212, 30,141,244,192,168, 61,150, 3, 23,250,132,251,105,198, 10, 62, 95,103,254, - 38,250, 89,204,244,216,181,218,229, 49,239, 49,145,127, 52, 83, 62,182,156, 74, -204, 56,212,234,137,133,252,154,165,120,226,116,223,200, 12, 25, 22, 39, 52, 14, - 62, 85, 16,218,121,135, 8, 46, 39, 97,195,175,212,193, 0, 67,152, 5, 27, 78, - 72,117, 6,120, 47,156,142,127,209,121, 69,159,235, 93, 20, 17,238,103,202, 58, - 14, 14,181, 22,135,226, 71, 85, 10,137, 51, 19,160, 18, 67,159,244, 66, 82,178, - 37, 27,102,130, 11, 24, 84, 18,232, 49,249,184,110,244,122,229,186, 92, 65,137, - 54, 43, 65,182, 28, 68,186,163,200,247,214, 30, 65,156,175,253,118,181, 25, 1, - 66,147,228, 71, 46,102, 73,160,216,102, 80,239, 53, 83,130,242,193,162, 60,210, -191,150,241, 76, 53,178,127,186,134,110,218,107, 6,160, 5,218, 75,203,244, 94, -153,170,189,164,244, 21,232,225, 11,221,225,168, 55, 69,201,117,131,225, 9,219, - 73, 78,213,227, 76, 0,162,116,240,108, 86,125, 12, 59,242,130,148, 96,226, 54, - 39, 27, 64,183,205,163,198,248,187, 90, 42, 83, 86,240, 86,253,180, 99, 33,146, - 96, 6,112, 44,106,179,229, 94,221, 31, 48,111,194,163, 94,211,100,136,195, 37, - 37,242,112,249,229,196, 52,137, 46, 2,138,117, 84,100,151,144,227,117,107, 87, -107,101, 84, 29,124,185,235,127,178,223,242, 73, 39, 52,132, 1,238,133, 53,209, -232,143,130,200, 31, 7, 78, 80, 6,133,224,114,230,192,111, 64, 20,105, 46,113, -199, 18, 85, 69,178,254,129,148,108,245, 59,117,249,116, 29,236,110, 72,175, 77, -158,134, 39, 89, 19,212, 94, 36, 40, 80,202, 82, 39,236,133,230,123,205, 26,216, - 7,236, 97,241, 19, 35, 21, 53, 53,186,159,125,106,217,208,176,130,114,224,201, - 39,180,131,108, 37,160, 85, 52, 2, 26, 42, 5,148,229,104, 58, 79, 97, 53, 27, - 38,203, 70,194,212, 47,182,205,146,231,202, 27,165,160, 67, 79, 36,132,117,203, -119, 24, 18,122,151,179, 61,147,164, 50, 3, 72,226, 19, 96, 1, 0,252, 54, 28, - 2, 99,233, 13,124, 17,176,250, 84,131,201,153, 90,202, 39,106, 42,134,134,237, - 97, 45, 1,200,133,249,171, 98,227, 11,190,108,195,186,128,212,191, 90,104,105, -110, 15,182, 22, 26,135, 97,239, 91,184,193,117,164,130,228, 32, 26,216,244, 34, -176,193,251,134, 58, 62, 3,245,233,115,128, 61,203,111,240, 44, 16,233,198, 14, -169,178, 20,166, 28, 83,246,253, 97,166, 93,178,250,173, 1,120,201,246,219,173, - 68, 88,227,128,237, 50,120, 8, 87, 20,244,160, 26,191, 20, 12, 16, 74,149,226, - 80,177, 1,130,218,225, 50, 1,156,131,124,112,214,196,222,107,177, 80,119,102, - 2, 23,146, 12, 37, 67,151,119,161,167,130, 89,108,172, 37,247,228, 50, 42, 88, - 54,116,160,255,129,189, 77,137,165, 61,218, 37,166,181,195, 54,156, 69, 17, 84, - 4,238,206,223, 95, 1,208,131, 87, 58,169,199,164,123, 76,232, 3, 41, 11,149, -151, 92,135,120,150, 7,159, 10, 53, 16, 6,151,247, 42,124, 31,221, 71,179, 7, - 67,137, 46,213, 64, 95,104,164,229,254,109,250, 21,232,202,105, 57,244, 93,174, -245,195,212,247, 45, 25,142, 49,236,101,135, 67,129, 94,109,200,236,227,130, 95, - 65,204,233,116,246,140, 22, 79,128, 34,231, 82,145,228,173,134, 6, 59, 48, 76, - 51, 5,228, 5,129,114,196,162, 31, 3,225,224,194,244, 81, 67,242,154,245, 21, -199,222, 43, 76, 68, 11, 57, 67, 36,144, 40,243, 66, 58,161,253,132,192, 71,227, -225,195, 8,203, 22,104,222, 18,173,144, 45,200,152, 94, 65, 46,192,254,182,178, - 26,181,248, 33,237, 29,248,161, 2,196,108,215,127,178, 67, 21, 21,146,222,190, -156,205,185, 93,239,107, 62,103, 19, 60, 47, 50,218,115,184,115,118, 9, 2, 75, - 74, 43,255, 95, 68,221,201, 11, 1,241,116, 99, 28, 39,177, 26,162,137,175,161, - 62,181,171, 94, 45,209, 14, 61,254, 29,124, 82,225, 71, 89, 94,253,213,144, 90, - 2, 95,128,153, 71,218, 68,175, 5, 81,216,217,178,137, 6,194, 63, 7, 2,178, -118,141, 16, 43, 97,242,164, 21,166, 13,155, 88,171,145,227, 42,218,114, 16,195, - 85,252,193,167, 50, 94, 68,195, 5,193,219, 69,179, 88,250, 78,231, 99,212,194, -154, 90,129, 16,210,115,135, 20, 76, 76, 62, 44,117, 45,212,213,175,124,166,246, -183,216,176,136, 95,105, 79, 47, 40, 66,140, 37,135,198, 90, 30, 38,133,130,179, -157,237, 8,153,131,224,105,185,130,229,226,206,152, 10, 14,162, 51, 47, 64,141, -106, 2,223,154,145,147,248, 78,232, 18, 22, 22, 37,243, 8, 21, 18,201,231, 27, -130, 10,251,154, 38, 49, 27,143,217,229,203, 1,246, 77, 94,130, 35,221,102,221, -165,134, 17, 80,148,163,215,229,235, 75,144, 6, 69,174,228,106, 55,106,254,107, - 95, 69, 60,177,197, 87,218,135,242, 41, 53, 93,147,188,128,205,214,188, 77, 86, -147,161,251,173,191, 87,235, 11, 79,143,148, 77,252, 71,106,204,228,246,244,255, - 33, 69,148,205, 73, 35,209, 50, 9,179, 10,113, 47,215,225, 82,173,176, 51,112, -180, 36, 34, 96,118, 58,162, 72,127, 77,147, 21, 32,116, 75,136, 12,155,186,111, -236,168, 62,132,120,212, 77, 30,194, 48,198, 69,192, 6,198,233,173,142,203, 37, -149,219, 59,224,122,207, 4,255, 81, 41, 54,178, 23,189, 19, 96, 75,123, 22, 88, - 39,139,100, 29,218, 0,159, 37, 61,156, 49,164,185,224,109, 88, 77, 17, 1, 69, - 85,198,131,200, 24,248, 82, 86,157,126, 32, 95, 29,158,202,146,164,230, 52,131, - 24, 46, 8,124,207,104,119, 94,193,198,151,110, 80, 2, 53,253, 75, 48,196, 56, - 27,135, 14,204, 35, 71, 13,245,249,231,212,195,206,161, 11, 80, 65, 83, 30,226, -222,255, 93,230, 68,191,120,217, 5,116,156,154,224,122, 54,180, 0,224, 29, 28, - 49,157,191,105,249,230,117, 28, 21, 96, 99,138,185,224,157,219,122, 5, 17, 22, - 25,226,173, 94,224, 73,241, 24,206, 8,211,102, 18,113,221,230, 66, 41,132,126, - 59,217, 56,213, 0, 36, 84, 37,144,236,149,112,171,165,226,244,147,229,106,242, -185, 75,162,167,100, 44, 1,145, 2, 25, 0, 70,195,254,151, 59,199,245,251,190, -169, 35, 21, 50,237, 0,100,231,177,254,117, 48, 62,194, 98,231, 19, 25,121,172, - 66,236,101, 49,143, 23,197, 81,204,239,178,215,128,168,211,108,137, 63, 38, 52, -103,199,195, 88,247, 84,119, 28,191,182,137,152,147,225, 64,241,167,140,209, 7, -232,135,193,165,112, 76, 25,226,254,191,119,199, 93, 57, 0,230, 45,144,247, 24, - 52,199,246,246, 84,179,131,219, 14, 61,136,118,191,107,175, 58,103,137,182, 53, -110, 79, 45,165,151,171,209,111,102,251, 88, 83,140,235,217,187, 38,217,252,183, -255,157,233,208, 6, 24,219,173,150,212,198,149,244, 79,188,254,161,105,214,247, -171,186, 67,192, 84,223,203,187,114,247, 89,216,198,225,193, 76, 89,191,158,128, - 66, 33,178,220, 35, 9,226,135, 11, 25, 12, 43, 26,215,163,163, 58,202, 36,213, -225, 95, 16, 1,229,219,122,128,234, 65, 60, 32, 85, 56,245,121,233,171,162, 53, -167,166, 94, 73,176, 51, 66, 27, 49,219, 28,183,169, 7,116, 38, 95, 39, 58, 49, -222, 29, 1, 93, 76, 86,236,196,128, 38,201, 99,233,160,174,168, 70, 12,212,130, - 68,154,122,252,230, 3,106,202,183, 57,190,195,213, 95, 21,211, 75, 83,128,189, - 96, 90,166,147, 35,229,123, 15,115,241, 39, 72,252,210, 1, 79,109,238,165, 97, - 67, 90,254,246,223,120,221,127,152,248,255,134,218,110,211,185,137,171, 75,151, - 44,227,214,130,124,218,209, 71,178,133, 64,253, 53,128,163, 3,179,152, 72,123, -138, 42,180, 35, 17,180, 63, 77, 52, 19, 16, 99,195,145, 16,253,152, 8,217,218, - 68, 75,192,121,186,214, 28,193,109,109,204,205,185, 31,197, 28, 68,184, 26, 90, - 12,224,234, 56,203, 0, 70, 83,251, 63, 84, 29,225,231,148, 81,188,102, 89, 71, -149, 45, 92, 36,202, 46,185,114,218, 80,180,241, 72, 50,250,162,141,191, 36,104, -132,139,209, 68, 63,147, 1, 1,231, 24, 11,140, 18,223, 21,184,228,176,219, 94, - 55, 51, 93,152,210, 19, 30,227,172,231,132, 71, 31,100, 92,215, 7, 44, 23, 19, -241,119, 18, 77,137, 89,253,178,252, 74,168, 99,214,244,125, 25,199,130, 93,190, -147, 90,193,180,181,236,102,106, 6,163,157, 25,174,199, 24,225,204, 14, 48, 5, -143,105, 41, 80,182, 84,218, 61,160, 20, 1,133, 85,218,134,100,252,160, 96,116, -234,163, 57,195, 86, 11,123, 45, 96,253,144,214, 39, 17, 81, 39, 96,104, 24,156, -103,199,134, 57, 29, 19, 63,132, 49,131,117, 5, 34, 5,127,110, 20,197, 9,185, -175, 23, 60,235, 34, 95,156,136,188, 47,253, 81,202, 93,118,116,209,202,221,111, -128,223,178, 46,163,131,234,218,130, 4,173, 58, 13,103,107,238, 36,188,203,150, -125,104,229,226,218, 32,229, 70, 99,195, 95,124,251, 3,148, 99, 30, 29,150,104, - 91,115, 72,207, 92,247,225,244,174,189,193,103,138,147, 45,109, 25,183, 20,115, -109,199, 15,217,250, 89, 3, 48, 45,190,109, 56, 8,204, 14, 4, 48,203,123,217, -249,158,195, 50,199,249, 9, 6,193,177, 60,231,150,132, 55, 13,108,218, 6,217, - 81, 45,229, 27,139, 69,220,171,239,103, 48, 99,200,255,153, 94, 11, 35,216,101, - 65,214,217,143,254, 88, 8,205,255,246, 22,137, 17, 19, 21, 0,173,105,141, 0, - 1, 63,246, 45,226,244,239,197,170,214,247,177,105, 24, 64,246,218,129, 97,143, -197,223,134,207, 21,111,151, 26,192,176,211,119,230, 27, 45,177,254, 79, 50,208, -229,235, 91,151,116, 62,136,154,107,142,128,112,133,246,136,126, 90, 19,186, 9, -150,118, 38, 88,121,184, 3,151, 51,207, 4, 67, 58, 5,120, 56,215,160,156,254, -158, 76, 27,235,188,142,200, 0,153,233, 94, 70,132,255, 40, 35, 61, 76,115,122, - 57,226, 7,181, 74,140,201,165, 43,108,241,224,222, 40,101, 2,255, 19, 16,124, - 4, 71,250,168,188, 34,161,203, 3,246, 71,253, 37,184,130, 0,228,227,134, 35, -185,228,130, 14,150,122,168,133,119, 49, 91,160,206,153,198,113,148, 16,159,203, -177, 29, 54,152, 29,115,128,212, 6,199,110, 75,144,242,207, 69, 5, 12, 65,250, - 16, 75, 8,230,215,127,137, 18, 2,175,201,213,101,249,176,168, 46,192,144,218, - 44, 6,246, 25,240,141, 81, 40,126, 31,106,215, 46,177,216,206,158, 76, 24,113, -187, 77, 85, 40,187,170, 55,195,144, 37,186,218,203, 17,142,200,113,235, 18, 70, -119,105, 99,195,202,229, 51,104,102, 67, 73, 5,135,164, 23,204, 54, 3, 72,213, -186,205,108,169, 53,234, 22, 67, 48,144, 95, 19, 81,176,142, 26,205,132,112,124, -201,134, 89, 25,119,211, 16,186, 65,145,112,131,156,171,194, 77,192, 17,146,157, -113, 58,131, 39,120, 73,198,205,155,151, 7,216, 70, 97,210, 23,219,167,111,135, -100,117,205,194,169,161, 2, 48,206,230,255,215,117, 45,169, 10,231,194, 74, 45, - 74, 10, 69,211, 38, 51,144,102,118, 2,243, 70, 51,226,173, 56, 45,222, 37,192, -215,127, 19,188, 36,239, 51, 67, 26, 1, 19, 56, 65, 44,220, 19,173, 48,113,202, - 3,150,116, 35,225,125, 43, 1,173,158, 35,200, 67,152, 90,135, 75, 14, 97,177, -200,235,155, 70,179, 2,115,253,157,178,200,251,169,220,218, 1, 13,196, 98, 0, -102,146, 58, 24, 32,123, 3,139,105, 84,104, 75,244,162,233, 37,158, 11,241,212, - 22, 53,136, 18, 0, 26,128, 21, 51, 0, 51, 0, 50, 0, 71,214, 89, 35, 9,146, -232,227,148,254, 98, 58,111,123,239,189,247, 95,187, 87, 34, 23,195, 91,125,100, -157, 53,146, 32,137, 62,218, 21,171,233,145, 42, 92,224,191, 14,123,184,255,255, - 40,138,162,188, 13,237,123,101, 40, 14, 76,180, 91, 47,236,191,182,223, 76,218, -117, 79,179,220,216,251, 21, 44,195,143, 99, 89, 95, 12,150, 53,146,244, 23,246, -190, 24,222, 98, 89,103,141, 36, 72,162, 15, 46, 60,198,155,235, 92,193,169,220, - 27, 37, 91,170, 43, 25, 4,248,238, 84,173,176,242,202,240,251, 47, 96,184, 56, - 93,189,214,200, 58,107, 36,249,225,190,242,219,237,123,146, 50,230,193,183,227, -251,127,127,251,182,127,120,147,174,173,225, 24,179,119,154, 14,187,235, 78,211, - 36, 81,243, 90,123,239,239,208, 54,235,117,245,186,174,187,155,169,222,239,186, -187, 44, 11,213, 92, 45,218,156,152, 28,236, 62,145,109, 8,143, 99,132,218,168, -195, 93,179,102, 89, 3, 35, 53, 17, 8, 6,134, 70,130,241, 72,146, 67,187, 90, -218, 3, 83, 64, 81, 8, 33, 40, 10,137, 2, 65, 32, 18, 8, 12, 2, 1, 65, 32, -132,133, 32, 8,131, 32, 8, 1, 68,128, 80, 8,133,144, 12, 66,113, 12,150,126, - 65,195, 36,170,105, 72, 39,142,226,209, 45, 11,232,120,188, 44,201,202, 32,134, -195,193,125,157,179,157, 99, 41,209, 47,169,215, 41,224, 90, 98,169, 79, 74,126, -205, 61, 12,226,179,145, 58,121, 13,243,190,158, 53,246, 50, 25, 7,199, 1, 30, - 39, 53,171, 19,244,206,126, 37, 0,118, 50, 66, 26,171, 23, 5, 69,154, 24,163, -243,189,218,118,179,200,124,194,210, 2, 27,186,123,161, 41,225, 32, 63, 67, 72, - 10, 52,150, 8,183,129, 7, 86, 94,159,199,172,202,107,189, 98,225,136,250,207, - 44,193,215, 57,201, 8, 10,118,241, 14,240, 49,158,175,134, 54,141, 5,158,245, -194,149, 35,222,235,179, 37,189,140,205,181,213,192, 68, 89,183,156, 10,178, 6, - 90, 44, 36, 41, 37, 70,214, 92,206, 18,127,138, 52,233,128,215, 33, 59,224, 66, - 62,184,193, 66,204, 34,213, 36,153, 4, 10, 64,254,132,172, 28,200, 18, 84, 10, -169, 2, 86, 38, 38,203,179,200,192, 66,200, 80, 69, 49, 10,100,112, 32, 34,172, -160, 56, 2,171,111, 99, 26,208, 21,174,141,205,255,100,218, 73,114, 97, 75,233, - 76,234,255, 19,229,206, 2,134,252,183,206, 59,136,201, 48,110,239,160,133, 33, -105, 51, 28,115,233, 45, 11,130, 74,232,245,161, 56, 56,175,116,112,163, 14,245, -158,214,133,148, 24,185,174,149,177, 2,176,177,224,145,130,183, 29,123,241, 25, - 65,166, 61, 14,248,111, 99,115, 55, 79, 73, 31, 36,164,161, 69,184,245,176, 58, -241,163,120,146, 76,190,152,193,214, 80,139, 90, 55,169,147,134, 24, 2,124, 44, - 68, 57, 65, 16, 84, 4,125,109,106, 8,150,103,216,171, 79, 97,144,134, 22, 50, -123, 81, 51, 55, 65, 73, 30,133, 26,120, 26,184,224, 35,138, 16,184, 26,106, 31, - 32, 42,140, 40,176, 70, 43,151, 87,105,213,103, 42,173,118, 26, 23,120, 40,186, -194,107,219,150,237,166, 60,137,100,200,246,208,249,202,235, 91,242,210, 77,198, - 31,211,206,234,124, 19,241,120, 98, 16, 34, 68, 47, 44,217,140,167, 24, 57,209, -160, 65, 14, 13, 4, 78,229, 72, 79, 33,204, 81,177,155, 13, 69,203, 58, 45,227, - 47, 36,119,191,118,183,253,231, 22, 5,166, 88,169,110,111, 90,241, 81, 72,169, - 72,194, 91, 48, 64,144, 79, 34, 60,183, 44, 45,165,116,196,250, 18, 77, 42,150, - 63, 72,117,245, 3, 66, 58, 32,166,134, 21, 91,255,150,202,196,115, 86, 5,148, - 64,156, 78, 25, 61,223, 61, 46,106, 93, 24, 84,160,176,144, 16, 74,224,107,152, - 33,185,250,151, 27, 22,200, 28,213,253, 96,193, 84,222, 62,152,132, 79, 43, 24, - 29,254,195,232,206, 78, 67,132, 22,123,119,203, 51,106,114,235,211, 97,208,239, -135, 70,122,214,247, 47, 83, 54,239,215,209,163,142,214,115,193,171, 66,163, 67, -151, 78, 40,211,149, 30, 55,167,222,166,106,184,226, 64,206,157,231,123, 45,236, -220, 1,228,137,116,225, 71,126,192,115, 17,253,112, 9,235, 16,241,126, 93,212, - 15,194,231, 80, 10, 66,118, 38, 1, 48,226,132,212,241,221,217,104,233,213,230, -153,152, 59,183,229, 15, 96, 31, 10, 39, 93,170,244,192, 91,209,133, 29,208, 85, - 25, 2,253, 55,197,176,226,186,120, 20,162,173, 32, 23,195,172,110, 77,253, 0, - 14, 44,177, 37, 6,108,172,103,255,118, 17,224,152,185,192,187,208,133,224,254, -220, 99,116,180,204,248, 92, 24, 15,203,184,175,196, 2,253,194,206,224, 59,106, -208, 83, 34, 80,193,141, 91,188, 80,161,248, 74, 8, 0,131,100,122,199,224,211, -238,154,142, 37,222,197,247,149,151,161, 27,141,150, 90,176,247,168,129,112, 27, - 13,248, 76, 30, 49,121,171,249,203,185,221,163,187,150,207,141,178,174,156,135, -125,168,232, 3,125,172,106, 97, 6,233,102, 45, 69,229, 97, 13, 78, 36,104, 68, - 3,240, 74, 76, 96,103, 76, 43,175,198,222, 46,178,230,192, 73, 40, 26, 84,113, -111, 14, 99,143, 2, 37,158, 56, 72,252,203, 54,232, 15, 75, 53, 6,193,133,132, - 78,145,230, 76, 85, 49, 9,216,216,216, 36,248,125,113,248, 40, 63,143,216,165, -177,233,214,106,171,195,214,168, 67, 51,113,197,207,166,201, 79,110,182, 94, 45, -209,132,234, 48,146,160,228, 24, 40,187, 24, 70,255, 96,159,241,208, 43,132, 80, - 18, 9, 4,141,210,210, 43, 91, 92,166,222,170,217, 41, 70,229,141,125, 2, 43, -217, 83,209,254, 8,242, 10, 78, 64, 71, 12,136,148, 4, 36,161, 19, 2,241, 5, -156, 37,220, 84, 32,135,131,181, 4,130, 2,122, 14,221,146, 20, 86, 33,151,140, - 1,225, 63,249,137, 80, 8,187, 36, 0,226,127, 55, 31,253, 56,228, 6, 12, 26, - 74, 65,192,138, 25, 61, 41, 33, 0, 84, 14,131, 1,229, 97,162,251,246, 99,224, - 79,139, 52, 64,218, 52, 62,192, 19, 58, 63,131, 68, 21, 80,166,232, 76, 3,129, - 4,102,130, 7,178, 50, 84,174, 65, 11, 45,224, 76,163,183, 65,243, 20,128,166, - 71,229,140,144,230, 13,186, 27,194,199,177,184,124, 24,228,116,174,124, 80,228, - 84,234, 63, 68,114,180, 46, 62, 96,114, 30,150, 15,159, 28, 85,253, 15,166,156, - 91,203,135, 86,206,175,242,129,150,179, 84,255, 97,151,115,107,249, 32,204,249, -171,124, 72,230,172,234, 63, 64,115,182, 43,196,226,195, 53,167,174,130,203, 5, -111, 14,208, 25, 65,242,168,152,202,183,151, 62, 83,161,181,112,109, 42,217,233, -149,142, 64,144,233,152, 30,162,206, 63, 94, 45,165,136,106, 45,211, 54,166,100, -135,106, 25,178,115,116,123,187, 73,126, 17,174, 69,181,248,123,202,142, 95,235, -228,193,178,113,230, 18,123, 71,109,138, 2,127,137, 18, 92,222,252,242,174,204, -212, 48, 67, 17, 77, 80, 66, 9,204, 26, 40,150, 70,159,128,115,208,155, 57,153, -198, 57,250, 52, 59, 11,161, 35,110, 87,126,216, 38,127,238,226, 27,188, 85, 98, - 94,104,148,184,170,104, 49,206, 35,194,111, 98,185,243,189, 81,133, 3,142,224, - 13, 56,131,175,220, 74,133, 70,125,163, 4, 50,220,188,244,201, 64, 96,189, 50, -151, 79,110,185, 15, 13, 31, 26, 68, 82,153, 29, 97,165,136, 92,108, 82, 52,209, - 13, 41, 82, 73, 19,142,171,128,160, 79,159,233,168, 0,211,198, 47, 82, 14, 67, - 4, 31,172, 43,177, 42, 41,178,143, 77, 62, 82,124, 64,178,175, 44, 95,252,226, -179,246, 36,219, 10, 78,107, 33, 16,116, 52,171,189,209,252,224, 94,145,241, 69, -204, 83,235,157,218,147,190,124,222, 93, 30,213,234,166,180, 73, 47,224,131,101, - 90,244,158,183, 32,239, 39,246,186,184,124,251, 16,176,242, 99, 73, 91,213, 26, - 74, 64, 30,146,220, 72,145,145, 25,180, 33,141, 36, 27,168,196, 30, 42, 50,116, -145,122, 14,156,170,216, 71,126, 24,163,180,102,248,168, 71, 42,113, 35, 18,250, -242,219, 61,249, 5, 98, 48,215,215, 96, 15,166, 19,218,171, 29,174,247,154, 19, - 36,173, 54, 11, 2,184,117,249,145,252,233,188,223,162, 0,163, 49,169, 84, 27, -191,223,120,121, 0, 96,133,222, 31,123, 43,117,154,241, 10,141, 64,199, 23, 87, -178,224,108,224, 22, 59,209,162, 22, 28,127, 47,114, 95,234, 46, 3, 23,138,249, - 59,139, 83, 76, 53,101,236,130,252,224, 45,174, 30,153,124, 33,109,208, 22, 70, - 11, 84, 48,220, 29,172, 69,157, 7,134,130, 24,242,104,144, 22,140,121,122,129, -234,109,234,244, 66, 25, 26, 2,157,112,106,195, 69, 51,160, 2,129,231, 84, 72, - 3, 26,244,127, 68,118, 42, 60, 99, 26, 74,251, 94,216,242,212,228,128, 53,136, - 29, 95,192,160,217,193, 87,234,168,124,170,200,164, 59,103, 13,222, 83,221,240, -129, 4, 0,244, 17,111, 9,113,216,207,107,252,229,223, 35,102,131, 90, 55, 53, - 64,244,136,112,240, 12,124,166, 97,219, 92, 16,143, 44, 2,107,204,160, 25,189, - 59, 2, 27,120, 25, 17,129,228, 63,228, 21, 95,248, 12, 20, 17,129, 95,130, 86, -232, 12,155, 6, 54,142,160, 20, 54, 99,140,200,198,253,151, 32,120, 33, 51, 4, - 21,169,193,151, 57,164, 7, 39,218,138, 3, 3,128, 65, 32, 7,115, 86, 0, 40, -208, 93,245,128,126, 70,254,129, 53,208,205,250, 41,202, 30, 80,135, 43,140,240, -254, 72, 44,127, 66,151,150,129,128, 30,201,142, 17,186, 33, 96, 41, 52,134,121, -182, 28, 18,112,118, 32, 33,220, 15, 52,213,194, 19,144,164,146,199, 82,133, 80, - 74,195, 30,136,245, 23, 46, 83,141, 44,226,150,133,115,170,182, 93,116, 70,113, -218,187,252, 83, 61, 14,213,184,196, 35,176, 57, 68, 84,205, 25,114, 70,181,142, -128, 87,178, 84, 45, 58,122, 6, 58,152,124,133,160, 60,114,134, 41, 22,148,170, - 34,143,154, 49, 14,108,227, 48, 66, 80,122,196, 12,209,193,234, 23,189, 63,222, - 95, 36,190, 46,222, 97,184, 69, 82,251,133,135,199, 16, 52,206,157,155, 13,185, -106,107,168, 70,191, 21,185,205, 83, 72, 30, 80,199,238, 93,131,163,134, 72,160, - 55, 49, 76, 97, 95, 94, 38,122, 8, 74,104,236, 89,108, 34,117, 71, 5, 7,167, -166,209, 50,126,213,189,164, 36, 4,157, 32, 39,203,181,237, 98,220,218, 7, 35, -137, 31,108,210, 0, 99, 1,144, 85,113, 54,171,162, 1, 24,170, 95,125, 97,141, - 93, 10,134, 32,129, 24, 6, 39,162,195,137,135, 49, 56, 24, 98, 24, 51,144, 72, - 6, 47, 67, 25,249,148, 65, 69, 78,152, 33,134,225, 94,208,154, 33,174, 20, 67, -100,166, 11, 7, 68, 51, 60, 36,129,177, 14, 98,239,216, 97,195, 44, 28,201,134, -155,153,201, 17, 63,222,121,142,168, 68,166,218,241,104,196, 70, 73, 59,143,104, -232, 66, 61,242, 94, 3,206,225, 43,252, 10, 8,208, 39,116, 0, 72, 6, 29,160, - 14,220,229, 33,124,169, 8,217,205, 66, 89, 15, 0, 54, 72, 12,189,174,105,146, -139,156,179, 13, 48, 50,137, 20, 82,242, 39, 64, 54, 10, 11, 74,250, 46, 52, 99, - 36,175,142,245, 49,221, 55, 41, 12,155, 86,223, 73,209, 97, 34,208, 22,111, 50, -248,138,109, 92,124, 11, 14,128,143,239, 77, 24,136, 56, 48, 13,150, 60,154, 55, - 73, 68, 92,141, 77,126,134,158, 98,173, 55,228, 42,194,116,194,143,141,173,104, -129,116, 60,117,184, 69,223,232, 12,197,103,184, 81,243, 21,179,204,100,202,173, - 76, 81, 97, 98, 4,204,233, 35,126,230, 25,202,198,224, 77,198, 16,113, 16, 64, -201,179,183,178,108, 3,120,242, 21,185, 34,196,123,191, 31, 75,100, 60,245, 4, - 78, 13, 95,147, 28,136,142,169, 91,197,184, 76, 91, 0, 78, 84, 89,200,153,196, -204,165,108,137,144, 20,147,160,208, 36, 48, 78, 24, 81,233,190, 73,101,216,166, -145, 51, 76,196, 84,205,245, 50,108,152,218, 16, 63,125,195,107,231,161, 18, 14, -203,204, 12,211,167,142,254,170,180, 26,235,249, 89, 93, 23,196,180,115, 86, 24, - 83,147,162,221,216,144,132,233,252, 38,243,134,151, 4,226, 12,113,108,181, 96, - 26,249, 43, 50,211,158,226, 94,239, 40,166,205,186,147,234,171,148, 48,166,127, - 50, 77,179, 47, 41,225,168,204,234,247,109, 10, 61, 3,113,132, 78,113, 81,194, -222,193,203,157, 37, 8, 99, 75,173, 89, 48,171,251,150,247, 48,125, 57,194, 85, -189,178,190, 38,231,127, 45,228,249,198, 92,195,115,104, 77,103, 64, 16,133,214, -211, 50, 62,182,223, 1, 87,167,219, 55, 80,185,119,150,177,153, 50,215,215,179, -225,101,246,144,242, 70, 49,147, 35,215, 89, 8, 52,110, 50,189, 3,167,243,153, -175, 41, 9,229, 39,211,221,237, 23,245,146,227, 26,246,190, 27,244,228,150,134, -186,192, 20,155,128,145, 23,123,127,195,114, 92,135,164,204,129,254,195, 8, 73, - 48, 28,118,208,227,253, 73, 7, 39,240,174,206, 21, 44, 20,220,207,230,144, 54, - 52,173, 92, 73, 24,144,222,185,178,128, 88,195, 83, 90, 65,191,172, 20, 61,209, -130, 96,199, 72, 32, 87,197, 86,158, 11,118,192, 9,228,187, 24, 69, 26, 61,176, -191, 52,180, 66,130, 98,100, 47,130, 32, 64,103,199, 82, 58, 3, 70,209,208,105, - 72,208,128,183, 50, 74,120, 77, 22, 69,138, 55,200,219,244,251,135,236,108, 12, -224, 66,199, 28, 76, 56,118,154,112,141,220,186,255,213,127,180,133,102, 74,173, -145,255,216,237, 7,229,197,111, 46,116, 35,252, 41,199,240,149,119,247,145, 84, - 63,203, 10, 43,172, 69,223, 0, 7,228,168,105,192,168, 33, 6, 36,129, 23,209, - 12,230,206,133,162,235,238,116,123,238,134, 44, 4,121, 37, 74,112,211,193, 24, - 17, 12, 90,233, 48,245, 8,225,161,129,233,243,192,245, 29, 57,130, 2, 7,109, -208,191,206, 20, 4, 31, 44,174,140,192,237,221, 72, 18, 72,188,160, 0, 48,129, -153, 94,137,172, 3, 22, 21, 40, 7,185,132, 19,162,152, 56,172, 48, 80, 37,104, - 50,207,122, 11, 15,134,229, 6, 66, 23,248, 74, 64,172, 61,208, 42, 23, 90,138, -147, 71, 82, 44, 68,240, 60, 1,211,241,195,224, 79,176, 42,193,252,132, 85, 82, - 20, 90,124,103, 84,162, 96, 90,232, 70,138,162, 92,213, 43,184, 22,176, 82,162, - 24, 70,197, 11,166, 5,237,132, 44,142,173, 74, 6,167, 22, 90,242, 82,199, 34, - 14,150, 53,184, 14,176,149,161, 24,195, 26, 7, 19, 4,173, 85, 44,138, 97,181, -131, 5, 1,247, 34,138,110, 88,247, 96, 37,252, 60, 54,124, 97,178, 87,107, 10, -156, 86, 0, 38,148, 65, 32, 0,211, 60,164,193, 75,225,143,105,254, 24,185,214, -243,238, 18, 51,195,153,195, 68, 9, 41, 43, 0,164, 37,170,170,170,106, 86, 56, - 0, 56, 0, 57, 0,211,106,208, 79, 69, 69,117, 42,246,140,213,218, 78, 23,202, -179,207,164,111,193, 73, 58, 73,228,251, 23, 51,142, 60,163,230,206, 94,138, 92, -202,196, 35,162,135,123,166, 45, 7,180, 56,107, 14,160,250,204,157, 86,242, 37, - 24,183,122,190,109,107, 80,156,242, 47,181,200, 55, 85,253,165,201,190,119,214, -224, 95,207, 15,147,123,163,247,244,186,230,174, 24,188,195,221,200, 96,140, 82, - 71,174,243,132,105, 25, 77,182,206,181,136,113,105, 91,184, 82, 42, 32, 80, 95, -112, 18,117,222,236,138,171,237,120,157, 14,110, 58,230,115, 4,157, 45,163,133, - 34,248,187,133, 85,251, 86, 5,106, 93,223,199,102,112, 13,117, 14,231,188,174, - 13,226,152, 22, 85,234,241, 60, 21,132, 99,237,248,235, 22,246, 3, 73,146, 28, -109, 97, 21,197,230,191,103, 47,176, 32,182, 55, 12,175,184,247,253, 74,243,139, - 18, 48,139,122, 64,219, 25,125, 69,187, 55, 64, 11, 93,247,190,111,115, 91,250, -251, 71,143,115,222, 91,188, 1,132,219,168,195, 77,115,146,130,100, 57,147,244, - 16, 20, 28,141, 73,131, 2, 77, 73, 41,104, 12,247, 1,115, 80, 97, 72, 41, 64, - 18,147, 3, 65, 96, 19, 4, 69, 16, 16, 81, 2, 74, 64, 4,132, 8,136, 64, 18, -130, 4, 68,110,196, 76, 7, 16, 96,187,148,210,166,137, 98, 74,225,199, 0,110, -102, 72, 63, 19, 21,130,100,119,133,210, 91,142, 45, 69,145,223,100,105, 29,215, - 4,113,175,173,126,113,217, 4,245,136,161,170,144, 96, 63,172, 38,237,147,156, - 98,213,246,160, 67, 85,124, 19,192, 75,179,149, 39, 39,120, 45,142,142,139, 75, -221,105, 29,128, 73,144, 88,230,115,225,223, 4,105,113,232, 29,195,226, 26,131, -179,224, 56, 32, 82,169, 63, 19,191,156, 91, 93,220,146,246,116,149,156, 38,229, -165, 11,204,191, 70,159,190, 74, 81, 18,136,219,150,228, 77,244,105,150,210,101, -206,228, 77,112,222, 78, 53,236,233,140, 80,248,105,116,176,152, 84,131,234,142, - 25, 58,190, 70, 15, 54, 6, 82, 82,173,116, 52, 36,123, 99,176,140,244, 97,120, -232, 83,144, 52,145, 84,245, 32,240,146, 69,144,152, 8,106, 38,150,106,214,255, -132, 1,206, 40, 27,219,149, 94,238,145,249, 54, 73,241, 93,213,178,117, 3, 87, - 32, 71,187, 99,118, 37,225,206,252,252,153,186, 74, 32,186,247,148, 9,132,114, -248, 44,233,130, 38,178,103,150, 25, 64, 74,125,107, 96, 27, 71, 23, 20,190, 13, - 41,232, 95,155, 85, 26, 61, 74,249, 24, 82,244,146,186, 83,175,230, 29,217, 70, - 99, 17,175, 73,147, 25,170,118,204, 76, 5, 69, 76, 45, 19,138,158, 89,108,231, - 68,165,108, 13,170,163, 83,102, 14, 26,194, 4,103, 16, 30,131, 12,100,181, 94, -209,223,229,249,191,240, 48, 14,236,120,150, 71,233,180,167,202,240,167,182, 26, -109,166, 72,160, 45, 65, 91,235,140,214,216,188,210, 54, 64, 98, 86,170, 13, 57, -185,245, 52, 79,206,255, 91, 2, 66, 24,166,181,183,151,210,110,111, 89,111,215, - 10,160,140,247, 19,162, 45,209,120,190,164,252, 13,206,168,167,227,146, 58, 37, -114,245,198, 83, 99, 32,168,181, 6,211,154,216,104,216,191, 7,185,148,212, 70, - 16, 48,134, 54,136,194,103,187,233,105, 15,202, 2, 23, 67,191, 77, 27,171,198, -128, 10, 18, 18, 85,163,195, 11, 93, 22,182,145,113,249,225,197,142, 11, 83, 26, -218,191, 7,230,142, 11,125,212, 3,135,100,132, 13, 47, 14, 34, 89, 76,109,209, - 84,181,216,134,179, 73, 14,114,212,135,247,129, 55,189, 52, 35,106, 31,189,117, -169, 24,128,137, 89,205, 12, 92,233,172,218, 21, 91, 22, 10, 14,232,106,161,201, -182,220, 97,170, 93,188, 30,137, 32,201,155,212, 18, 35,200,230,176,149, 78, 97, -247,179, 0, 64,252,123,150,222,245, 22,180,143,119,243,176,191,136,211, 58,115, - 24,197,157, 13,188, 20,187,110,231, 57, 20,179,199,153,109, 74,170,216, 51,192, - 31, 76,143,158,176,255,154,199, 81, 56,209, 9,178,122,200, 93,247,235, 56,223, - 59,177,211,186,225,146,231,112, 46, 20,127,187,163,170,148,187, 61,145, 67, 93, -151,116, 54,183,114, 92, 68, 91,127,234,207, 52, 75, 98,128,182, 4, 30,222, 33, -242,160,212,245,158,150, 52, 36,203, 57,164,250,165,109,198, 26,129,192, 39,136, - 88,227,130,200,157,238,135,227,120,142,249,171,126, 42,133,129,128,160,158,142, -197,209, 21, 56,115,107,223, 30,184, 81, 11, 61,189,160, 61,238, 75, 80,112,156, - 11,120,201,147,251,251,137, 37,230,190, 72, 41,195, 51, 29,191, 14, 99,182, 64, - 95,180, 73,220,159,190,115,177, 64,233,240, 42, 34, 45, 70,244, 16, 76, 38,243, - 87, 4,117,236, 8,197,121,235,197,247, 13,221, 2, 72,162,217,226,161,175,174, -147, 85,206, 82,158, 54, 65,128,130,119,160,255, 54,181, 67, 80, 75,201,120,156, - 62,203, 83,149,122,168,106, 45, 37,187,179,153, 56,229,123,213,155, 7,242,132, -240, 46, 97, 42, 38,184,179,207,116, 79, 30, 23, 82, 85,148,232, 73,103,120, 9, -250, 8,104,192,207,228, 29, 44, 85,207,217,201,239,116,115,248, 71, 99,121, 56, - 16, 34,226,213,161,231,191,144,224,249, 7,146, 93, 39,131,104,113, 35,179, 0, - 97,226, 55, 99,177,237,119,145,240,194,229,230,133,230,115,246,184,152, 5,158, -197,195,231, 7, 15, 41, 65,117,253, 34, 57, 69,147,143,136, 0,164,185,156, 82, -173,222,223,187,161, 41, 57,204,178,128, 25,231, 64,191, 31, 9,247,132,246,100, -181, 66, 87,236,138, 37,179,248,194,204,119, 30, 47,133, 32,189,103, 9,225, 98, - 83, 24,223,201,191, 4,252, 39, 38, 93,232,235, 85, 34,250, 24,134, 83, 21,201, - 65,162,172,224,114,189,141, 35, 45,158, 39,112,234,139,113,143, 48, 41,166, 28, -252,118, 64,112,132, 23,150,181, 97, 0,241, 93, 52, 38,228, 89,180, 97,254,118, -159,245,100, 50,162,209,250, 37,177,163,118,144, 43,138,132,173, 6, 98, 24,200, - 0, 8, 54, 76,133,232, 92, 15,248, 24,170, 21, 57,242,166,197,184,130,113,242, - 3,196,238,191,247,231,167,238, 15,245, 19,206,191, 5,202,241,204, 41,161,255, -107, 28,151,230,242,101,207,104, 3, 62,238, 31, 15,157,185,240,174,100,150,141, -179,140, 24,128,217, 67, 49, 7,206,196, 91,216,119,153,105, 56,102,207,129, 63, -194,156, 63,182, 12,158,194,178,130,221, 16,218,113,114,147, 6,151,148,226,195, -248,116,241,109,159,150,100,196,135,166, 29, 2,188,197,135,205, 6, 54,192,172, -114, 13,237,239,142,216,101,109, 44, 88,120,106,196, 30,173,201, 33, 92, 94, 92, - 23, 1,127, 13, 25, 13, 58, 90, 47,254, 39,155, 23,248, 38, 76,125, 20,125,171, -140,179,161, 39,254, 52,217,244,250,176, 49, 82,182, 43,164, 29, 45, 80,215,103, -151,155, 77, 92,235,194,132,117,147, 15, 74,107,141,104,214, 26, 34, 51,178,225, - 21,102,227, 50,240, 37,129,173,151,170, 99,142,117,135, 38,125,239,184,216, 27, -201,247,237,154, 39, 68,130,252, 9,209,240, 69, 70,246, 7,231,187, 49,153,142, -182,161,193,179,161,152, 41,135, 60, 23,101,136, 60, 30, 23,220,193,187, 91, 60, -246,244, 17,124, 19,125, 10, 69, 18,134,210,185, 77,159,198, 67,178,196,167,176, - 96,248, 77, 9,133,145, 56,160,197,229,137,183,205,143, 63,114,112,202,162, 95, -150,133, 57,250,214,251,227, 49,116,120,190,231,142,195, 45,136,206,189,190,158, - 64, 79,251, 43,106, 85, 14,204, 99,108,229,147, 31,228,173,199,184, 0,166,137, - 14,211,212,201,151, 90,125,103,191, 52,146,223,168,215,254,191, 50, 45,186,232, - 26, 90, 77,193,228,114,169, 80,255,205, 90,161, 84, 61,203,247,155,172,150,167, -142,198,105,244,156,216,195, 99, 49, 12,121, 94, 92,149,111, 39, 54, 17, 53, 1, -235, 60,145,134, 25,178, 92,177, 4,141, 90, 0, 49, 8,107, 20,200,146, 83, 53, - 23,255,225,116,147,117,116,102, 32,141,134,135, 99, 53,255,136,164, 91, 88,254, - 88, 21,129,128,102, 6, 33, 78, 49,129,217,215,208,169,154,115, 6,194, 43, 14, -216,154, 84,185,166,165,171, 25,169, 44, 8,211,134, 10,221,206, 28,159,255,203, - 38, 25, 69,154, 94,232,180,112, 14,232, 92,199,230, 50, 38,204, 37, 21, 48,190, -137, 1,227, 6,156,190, 61,202,231, 92,114,140,233,232, 82,246, 54,154,203,157, -151,116, 62,127, 56, 77,193, 98, 63,171,103,181,244, 27, 31,124, 16,193, 9, 86, -107, 45,234, 55, 65, 40, 13,198,142, 22,186,200, 15, 22, 19, 58, 8, 11,108,231, -192,203,132,155,200,114,136, 16, 66,151,135,225,158, 40, 52,113, 33, 81,168,184, - 5, 26, 81,137, 54,167, 54,201,102, 24, 45,213,195,115,185,173,123, 44,132, 46, -186, 66,171, 44, 17, 61,198, 41,234,182,216,139,243, 34,105,150,247,254, 22, 42, -123,213,106,121,146,236,123, 9, 24,140, 67, 53,128, 32,199, 61, 40,155,246, 94, - 17,202, 26, 12,219, 26,234,173, 68,147, 5,152, 78, 63,254,244, 88,246, 81,191, -148,149,196,245,143,200,113, 47, 36, 75,194, 28, 27,160,162,221,101,126, 29, 26, -129,202,250,101,179,103,108, 75,238,153,183, 63, 72, 25,192,104, 26,195,138,140, - 70, 97,130,128, 36, 94,194,126, 65,252, 80,106, 17, 39,158, 34, 82,123,205,147, -206,141,239,219, 72,140,169,170, 30,162, 60,169, 68,213,210,244,249,204,155,132, - 42, 66,103,178, 64, 43,176,250,203, 78, 98,132,225,199,128,225, 56,144,241,192, -101, 56, 38,196, 81, 60,145, 41,233, 67, 75,223, 76,194,148, 55,126,132,170, 2, -223, 51,129,147,185,225, 30, 11, 3, 32,147,129,174,132, 45,182, 76, 57, 58, 32, - 16,223, 47, 55,131,176, 67,104,233,104,241,146,170,209,168,238,108, 70,209,226, - 68,201,177, 87,162,167,148, 23, 93, 66, 8,108, 50,250, 75, 54,202,135,175,196, -246, 30,205,142,229, 65, 60,113, 35,236,218, 5,223,251, 67, 27, 74,174, 80, 36, -236,126,118, 90, 79,252,162, 71,182, 93,117, 40,110,204, 78,109,185,228, 87, 64, -190,143, 58,188,119, 90,242,108,119, 25,235,200, 99, 30,237, 54, 23, 6, 10, 8, -220,171, 58, 28,193,220,183,141, 17, 45, 17,234,205,161, 68, 25,233, 58, 94,216, - 68,144,186, 37, 54, 93,235,234, 10, 28,221,105,168, 67, 53,238,218, 29, 79,100, -168,226,236,199,220,145, 12,112,219,217,135,129, 35,154, 73,114,153, 33, 60,142, -204,147, 13,237,110, 6,139,188,250,114, 33, 51,168, 84,239,131,140,193,137, 41, -141, 79, 40,164,216, 18, 10,164,225, 18,108, 20, 21,243,227,176,226,222,145,203, -190,121,160,158, 59, 41,244,239,164, 60,152,122,130, 25, 9, 77,114,214,142,158, -197,192, 80,154,209,160,157,172,160,158,249,105, 11, 62,148,144,105, 70,121, 72, -158,171,110, 16,201, 11,128,198,149,224,170,166, 43, 47, 57, 13,162,180, 73,217, - 11,202, 17, 42, 37,140,109,138, 89,173, 7, 89,137,216, 59,127, 69,236, 24,124, - 87,132,169,194, 60,138,197, 91, 36, 21, 33,127,204, 34, 33, 13,174, 0,122,193, - 36,204,165, 81, 63,144,237,145,187, 52, 64,160,115,188,193,190,193,150,120,252, -205, 99, 62,240,233,251,223, 50,142,115,123,227,143,165,253, 2,206,113,169,222, - 67,126,243,177,182, 27,200, 70,230, 90,152,214,251,173,147, 46, 7,112,189, 69, -134,158,172, 84,249,227,242,147,203,196,137,206, 62, 62,176,210,212, 40,215, 43, -154, 19, 15, 29, 30,184,176,254,103, 67, 89, 4,189,255,210,215, 3, 22,190,210, - 8,131, 93,184,165,237, 59,104,117,199,128,240,113, 22,103, 48,226, 63,154,194, -148,153,246,254, 13,234, 23,103, 53,155,122, 9,105, 15,208, 39, 94,111,184, 0, -159,174,255, 37,101,105, 35, 8, 5,227,196,128, 37,156,111,168, 83,127, 86,121, -143,169,213,224,104,211,132,123,224,214, 88, 23, 87,165, 6,208, 51,113,102, 82, -157,179,147,246,254,128,184, 70, 72,172,210, 97, 58, 5,160, 18,252, 58,183, 25, -132, 47,194,117,129, 56, 60,206,172,244, 98,182,227,171,253, 43,237,169, 53, 13, - 4,130,149, 28,125,195,123, 20,199,112, 18, 6, 25, 4, 49, 59,181,237,250,139, -247,184,240,120, 25,208,155,244,123,166,154,210,235, 3, 81, 24, 82,102,116,147, - 8,105, 54,150,112,242,174, 14,244,255, 83, 85, 68,171,130, 65, 22,250, 94, 94, -199, 98, 2,118, 32,236, 3,185,111,111, 46,209,216,110, 42,240,215, 14, 36,178, -172,184, 53,128,177,184, 40,135, 6,165, 8,154, 1,133, 78,226, 59,144, 40, 30, -119, 81, 1,222,120,220,252,135,178, 86,201, 66, 61, 46,156, 27, 0,104, 95, 85, - 82, 71, 84, 76, 76, 71, 69, 76, 76, 76, 88,134,134,168,243,207, 1,131, 45, 68, -192,142,208,136,154,230, 35, 48, 16, 0,134, 32, 49, 0, 17, 2,153, 71, 38, 66, - 17,145,242, 43,109, 41,220, 71,184,208, 7,219,200,254,185, 85, 17, 90, 91, 70, - 42,205,138,174, 70, 54, 41, 49,197,200,159, 12,221,129, 97, 66,245, 70, 13, 9, -115, 80, 83,144, 13,194,142,102, 68, 67, 24, 19, 48, 69, 29,189, 44,202,197, 26, -205,153,170, 66,105,132, 71,140,235, 57,216,163, 27,118, 8, 21,101,154, 66, 77, - 65, 82,121, 88, 4,129,226, 69, 67, 0,102, 57,226,128, 23, 46,218, 2,172,213, - 98, 84,225, 52,146, 24,124,161,154,180, 13,223,160, 43, 43, 16, 4,105,114,201, - 77, 30, 22, 65,160,200,118, 0,139,146,104, 93,233,212, 72, 19, 37,211, 16,250, -163, 33,111, 48, 40, 0, 91,213, 97,242,144, 41,192,124, 44,130, 70,249,166, 3, -182,100,162, 10,128,230,210,141, 52, 81, 41,175,128,123,115,224,242, 83,129,228, - 16, 92, 72, 72,151,188, 6,130, 64,145,237, 0, 22,207,208,186,210,169,145, 38, - 74,166, 33,244, 71, 67,222, 96, 80, 0,182,170,195,228, 33, 83,128,249, 88, 4, -141,242, 77, 7,108,201, 68, 21, 0,205,133, 27,105,162,100, 26,161, 63, 26,242, - 5,195, 4, 96,171, 58, 74, 30, 50, 5, 88,223, 64,208, 40,223,116,192,150, 76, - 84, 91, 0, 91, 45, 94,202, 30, 70, 53,146, 84,201, 20, 66,103,164,188, 74, 31, -232,146, 29, 66, 69, 89, 33, 81, 7, 58, 10,138, 69,208, 40, 94, 52, 4, 99, 22, - 81, 43,151,162,182,163,111,181, 24,157, 80,140, 54,112,140,121,218,100, 82,178, - 64,173,165,230,243, 22,121,132, 80,160,214, 82,243, 75,180,128,243, 19, 10, 20, -178,149,242, 37, 90,192,249, 9, 5, 10,217, 74,121,137, 22,112,126, 66,129, 66, -182, 50,178, 49, 2, 47, 65,160,224,173, 25,105, 10,200, 73, 32, 80,108,169, 79, -154, 2,114, 18, 8, 20, 91,234,147,166,128,156, 4, 2,197,150,154,207, 91,228, - 17, 66,129,162, 23,116,133,254,215,111, 87, 35,155,202,194,153, 6,166,137,248, -118,149,195,148, 56,131,196, 65,245,144, 41, 50, 4, 6,173,129, 70, 0,190,253, -202,231,170, 24,181,186, 21,125,153,105,106, 6, 39, 49,121, 5,114,210,147, 63, -153, 26,161, 38, 43,232, 40, 40,165,174, 65, 88,208,140,104, 8, 96,255, 17, 89, - 69,185,168, 2, 96,173,138,162, 11,117, 20, 49,241,165,122,164, 54,172,201,158, -110, 32, 72,108, 43,104,201,143,140,208, 76,181,237, 79,226, 47,219,133,150,109, -141,112,181,120,201,160,141,235,129, 43, 89, 39,166,153,164,176,160, 18,239,126, - 30,170,210, 54,162, 12,113, 75, 96, 33, 37, 93,115, 13,113,135, 48, 21, 73,195, - 16,149,153,246,155,143,153, 52, 96,161, 96,245, 3,140,234,124, 52,194,221, 88, -135, 61,249, 23,172,162, 62,130, 5,231, 40,119, 99,116,158, 36,185,164, 58, 96, - 92,161,233, 36, 64, 40,193,182, 96,160,252, 96, 38,148,169,246,128, 35,176,210, -127,165,224,240,231,166,101, 48,216,145,194, 44,154,193,117, 96,212, 36,141, 65, - 84,134,214,159,141,147, 20, 99,170,216, 13, 1,163, 26, 31,141,112, 55,214, 97, -151,233,131, 32,170,126,217, 1,148, 89,196, 85, 81, 73, 22,169, 91, 45, 70,101, -163,185,115, 73, 40,195,121, 81,106,130,189,221,240, 67,168, 40,211, 20,106, 10, -146,170,143, 69,208,170,140,203, 14,152,147, 68,188, 0,138,139,197, 12, 64, 43, -116,199,245, 62,225, 9, 63,167,173,202, 80,195, 25, 44,147, 82,141, 26,102, 3, - 6, 2,164, 1, 83,197,214, 1, 83,147,244, 1, 84, 18,250,227,113,146,122, 76, - 29,123, 3, 76, 37, 91,210, 30, 80, 73,232,143,199,233,238, 49, 82,144, 26, 98, -212,119, 87, 7, 42,187,238,226, 16,154,180,128, 4, 11,194, 81,248,230, 9, 92, -161, 44,230, 41,162,142, 56, 42,198,220,104,210, 12, 48, 56, 23, 84,233, 63,254, -190, 85,179,134,170,117,180,197, 31,125,219,170,209, 58, 39,123, 33,125,232, 6, - 28, 57, 0,114, 69, 20, 24,112,111, 3, 40, 15,166,148,187,112,133, 32,149,191, -154,251,182, 16,101, 37,171,255,187,137, 3, 67,251, 3,180, 59,112, 82,244, 88, -143, 23,212, 26, 6,123,121, 44, 71,162,207,221,156,140,184,222,150,205,165,187, - 56,177,130,178,204, 89,198, 83,210, 38,196, 8, 31,126,140,204, 51, 15, 37,148, -141,154,216, 97,168,122, 1,134,134,168,115,111, 51, 28, 83,138, 4, 8, 20,210, - 28,131,202,204, 76, 74, 7, 51,112, 32,168, 24, 40, 6, 24,194, 65,112, 29, 16, - 69, 8, 36, 18,160, 64, 68, 68, 36, 40, 41, 40,104,210, 6,199,219,101,254,169, -234,202, 36,145,175,158, 65,136, 53, 24,200,169,139, 17, 56,161,168,228, 95,241, - 39, 60,249,214, 45, 86, 56,101,120, 55, 42,132,160,222, 97, 78, 94, 19,141,158, -186,134,174,129,137,122, 16,190,250, 45,215, 13,197, 28,159,119,185,106,193, 59, - 16,128,174,212,225, 15,142,199,215,169,150,100, 46, 29,108,185,184, 0,103,183, - 22, 86,108,221, 3, 70,169,197,177,163,181, 94, 0,224, 11, 60,225, 18, 95,224, - 94, 6, 7, 86,196,171,126,124,139, 2, 79,128, 95,227,147, 31, 43,192, 79,147, - 24,195, 28, 3,204, 24,160, 27,149, 4,185, 16,100,104, 23,196, 7,120, 36,111, -148,203, 29, 72, 12,133,112,116,219,119,213, 1, 18,126, 88,241,205,178, 48, 8, -104, 77,161,247,104, 11,110,142, 43,175,170, 43,238,204,203, 8,188,191,175, 43, - 48,241, 87, 61,155, 3,102, 92, 8, 95, 11, 3,205,141, 36, 98,149, 0,217,192, - 23, 16, 36, 15, 18, 36, 47,234, 0,127, 74, 6,194,166,212,130,141,196, 8, 67, -130, 94,253, 57,247,181,128, 70, 55, 64, 71,165,139, 65, 13,104, 42,107, 18, 51, -236, 19, 36,108, 45,172, 23, 84, 70,102,148,200, 90,206,126,177, 3,214,150, 97, - 26, 13,120,166,175, 54, 99,205,137,171,229,250,164, 92, 92,203,219,136, 26,205, -105, 57,200,162,171, 45,227, 90,174,141,194,111, 25, 66,159, 62,189,152, 8, 94, -157, 61, 2, 82, 4, 45,148,119, 70,178,164,122,162,112,177, 39,135,224,227, 62, -208,114,194,140,252, 47,220, 69,187, 41,166,251,185,238, 40,231, 98,213,133, 86, -148, 32, 92,239,154,254,165,218,163,207,224, 61,224, 33, 25,126, 15,157,246,217, -166,199, 22,168,155,248,243, 77, 96,220,139, 14,247,230, 97, 90, 50, 31, 46,230, -156, 21,230,232,131,228,159, 55, 49,232, 42, 67,139, 44, 19,122, 7,145,149,115, -103, 46,244, 23,105,167,140,159,231,145, 73, 52,252,127, 76, 93,192,189,144, 74, -127, 54,106,208,221,231, 33, 3,135, 12,208,232,224, 91,247,226,131,224, 60,177, - 18, 83,151, 11, 59,128,228,219, 46, 60,172, 12,173,192,192, 3,197,172, 46, 71, - 96,178,198, 93, 64,229, 67,246,139,185, 20, 11,142,173,130, 35, 75,210, 44,157, - 13, 69,138,128, 99, 77, 77,252, 13,169, 77,147, 3, 69,244,209,129,147, 78,224, - 47,165,188,127, 65, 4,161,204, 61,108,192,184,198, 46, 58,219, 23, 36, 15,243, -246,203,104, 73,225, 54,187,113, 82,149,179,117,201,231, 0,215,226, 94,194, 22, -137, 24,242,103,214,224,141,176,207,252,222, 61,109, 91,167, 66, 84, 58, 61,142, -216, 45,202,169,240,130,216,243,241,134, 49,160,207, 66,182, 57,169, 21,170, 99, -119, 41,102, 23, 53, 83,249,144, 46,124,208,202,156,220, 69,194, 38,123,201,245, -249, 28,240, 71,231, 5, 0,240, 43, 65, 48,174, 23,219,208,112, 70,103,129,158, - 49,244,233, 17,220,243,176, 21, 56, 5, 57,136,236,138,212, 5,253,201, 93, 6, -163, 11,204,228, 60,170,155, 62,182,226, 38, 80, 7,194,166, 97,233,133, 64,213, -150, 54,214,137,158,230,145,211, 67, 51,206,109,194,111, 96,160, 9, 31,130,138, - 44, 92,119,155, 59,124, 57,177, 15,252, 62,241, 18,185, 23,181, 49,250,184,207, - 60,161, 78, 10,247,211,183,175,103, 58,180,214,231,135,239,126,117, 71,253,175, -183,172, 88, 86,148, 24,203,250,135,190,202,245,177, 44, 30, 92,108,224,177, 56, -177,197, 60,251,198, 42,124,148, 60, 21, 16,126,215,227, 46,143, 95,249, 42, 52, -108,242,223,216,165,218,208,209,160, 49,166, 75, 78, 40,153, 85, 25, 15,163, 47, - 37,228,209,140,115, 86,114, 80,208, 9, 1, 29,165,238,202, 66,156, 99,234, 7, - 22, 53, 81, 33,170,150,224, 85,102,137, 69,222,186,236, 53, 62,226,179,181, 3, -216,131,108,194,216,103,189,232,231, 88, 66,200,220,163, 56,158,233,253,103,202, -121,225, 98, 47,248,107, 15,102,150, 76,147,150, 69,114,167,126,218,218,246, 58, - 28,192,227, 43,241,186,218,232, 95,113,150, 44,125, 77, 92,213,103, 26,194,204, - 80, 95, 37,168, 63,223,102,102,170,254,212,154,139,140,245,174, 10,234,111,119, -203,113,122, 95, 10,119,171, 23, 38,169, 99, 83, 94,251,120,107,200, 84,123, 99, -137, 90, 95,183,216, 69,121,190, 9,127,164, 55,223, 58, 33,164,242,186,168,219, -143,201,112, 7,222,223,146, 98, 87,115, 77, 61, 37,194,162, 66, 75,195,116, 78, -111,253, 49,104, 10,169, 81,127, 16,118,219,166, 87,250,112,171,232,198, 70, 93, -183,137, 12,205,160,214,200,237, 27, 44, 90, 92, 79, 31, 89,141,219,139,217,214, - 72,160,168,167,197,135,137,191,209,145,207,109, 55,226,244, 63, 41, 24, 64, 16, -250,224,135, 89, 53, 16, 67,135,250, 75,207, 53,206,193, 44, 70,153, 43,198,133, -185,254, 11, 19, 29, 40,249, 94,252,121, 44, 25, 14,139,121,175,180,138, 57,241, -160,160,229,165,254, 46, 18,200, 22,184,124, 16,161, 15,122,166,186,236,250,207, - 47, 61,125, 94, 4,188,174,209,212, 47, 41,232,116, 90,219,218, 61,109,192,226, -250, 83,231, 71,192,139,237,104,187,109,112,207, 22, 65,104,245, 26, 30,125,197, -224, 11,233,184,147,106,117,156, 66, 55,191, 55, 24,228,255, 55,149,146,115,150, -245,183,174,226,249, 76,128, 45,212,220,106,115, 38, 45, 98,131,103, 51,203, 7, -183,182, 17,149,136, 57, 55, 2, 6, 23, 6,119, 61, 93,189, 25,225, 99,162, 72, - 19,145, 55,235,162,203,110, 98,175, 14, 0, 43, 5,163, 87, 55,200,141,130,224, - 53,157,153,132,164,250,103, 10, 32,103,172,148,171, 22,147, 20,209, 40,206,113, -184,204,209, 96,209, 85,145,224, 0,194,195,148, 91,198,156,226,127,114,134,139, -182, 33, 65,116, 19,166,225, 70, 97, 73,232,131, 28,101,119, 76,106, 14, 65,104, - 25,154, 9,234, 95,197, 99, 68,114, 39,120,169,216,228,218,199, 4,164, 68,161, -247,131,226,115, 83,219,192,225, 58,163, 43, 64, 8, 31, 4, 92,111, 84, 91,197, -250, 61, 85,173, 40,134,204,236, 1,171, 97,100, 74,193, 35,229, 9,188,117, 52, -245,187, 85, 12,255,108, 92,189, 69,175,116, 81,228,129,213,230, 30,166,180,137, -120, 38,216,138, 60, 6,198,212, 33, 31, 96,207,232,222,234, 4, 64,162,164,227, - 65,253, 49,172,182,129,113, 69, 67, 23, 33, 8, 21, 44, 52, 46,236,104, 57, 20, -138,129,178, 22,252, 4,245,243, 33, 95, 20,223,161,218, 18,228,175,132,204,140, -224,237, 4,125,195,208, 91,181,135, 70, 11, 93, 0, 37,232, 48,208,184,117, 89, - 60,213,254, 20,188, 3, 25, 57,134,151, 84,140, 19,104, 21,166,220, 78,104,236, -200,208,206,173, 49,236,179,241, 45,179, 69,175,185,228,116,205, 49,198,154,121, -249,104,240,124,156,161,123, 67, 68,220,147, 65,181,206,220, 47, 85,140, 61,219, -189, 26,137,202,134, 50,191,225, 30,233,220, 77,172,254,204, 74,159,170, 99, 15, - 55,246, 12, 30,117,175, 85,225,232, 86, 97,176,223,238,195,174,146,180, 33,147, -252, 55,183, 96,159, 72,218,144, 73,254,155, 93,181,214,132,140, 55, 20, 74, 82, -253,231,210,240, 4,185,244,119,173,248,230, 15,192, 12,129, 46, 18, 19, 6,254, -167,221,210, 67,156, 82, 0, 38,252, 43, 61,233,107, 23, 4,112, 36, 54, 6, 3, -179,210,116, 21, 93,230,200,173, 97,101,195,173,226,135,219, 66,135,132, 93, 37, -165,218,171,223,254, 18, 67,133,138,170,130, 43,233,118,155,174,185,160,232, 8, - 76, 80, 26,205,230,136,174, 73,204,141,187,161,162,166,236,241,107, 4,225, 79, - 38, 90, 22,233, 57, 21,130, 21, 75,178, 97, 21,130,187, 66,191,144, 92,177, 0, - 31,150,190,234,155, 83, 52,210, 19,143, 64,138,149, 91, 36,223, 8, 55,255, 15, - 72,125, 46,232, 37, 96, 66,248,122, 14,108, 12, 1, 70,183,166, 38,208, 84,209, - 3,233, 86,110,173, 54,141, 95,127,105, 4,188, 74,137,176,128, 74, 38,166,196, -153, 83, 87, 18, 9,127,128, 33,250,128, 47,158,228,234, 51,160, 0,153, 0,149, - 0, 85, 38,183, 90,229, 53, 99, 79,237,224,202, 3,139,247,168,166,106,187,254, -135,118, 49,161, 82, 44, 9, 73,160, 76, 4, 36, 26,152, 7,132,104,226,147,197, -170,201, 64, 11, 11,142,249,124, 69,173,210,247,196, 79, 70, 33,168, 53, 16,137, - 47, 98,135,142, 16, 50, 76,163, 28, 91, 41,234,146,213,206,207,245,111,227, 34, -195, 60, 90,173,209,241, 39, 94, 88,157,245, 59, 68, 86,142, 89,253,206, 38,102, - 84,163,174,231,120, 62,135,104, 19, 4, 61,206, 40,211, 41, 49, 7, 20, 60, 41, -142,219, 66,125, 20,196, 17, 21, 25,198,151,220,100, 5, 72,229,203,109,216,154, -187, 34, 28,110, 89,163,204, 54,146, 47,114,228,171,204, 64,160,140, 8,134, 14, - 75,150,245,160, 71,145, 72, 24,130, 64,166,198,145, 87, 66, 8,147,202, 36,161, -234,158, 27,124,190,210, 51,215,165, 73,100, 30,248, 51,209, 25,141, 89, 47, 88, -214,239, 11,157,132,214,151,192,126, 22, 69, 97, 1,178,215,108,115,170,252,205, - 49,188,155,227, 27, 61, 35,253, 54,238,194,182, 32,247, 67,238, 9,114, 99,144, -187,130,152,214, 34,138,223, 8,247, 40, 14,211,152, 43,102,114,147,213, 78,185, -253, 70,122,170,157,250,193, 1,151, 73, 56,146,249, 33,182, 86, 74,171,205,124, -126,147,235,207,101,169,141, 25,125,209,125, 42, 1,246, 85,205,100, 39,118,231, -175,217, 5, 5,206,243, 89,226,145,204, 56,225, 68, 25, 29, 74, 47,141,131, 1, -135, 19, 25, 97, 18, 77, 20, 54,230,105,114,119,119,159, 38,247,170,250,119,191, -156, 11,109,102, 31,162,182,198,159,124,224,187,239,251,161,179, 50,155,218, 6, -154,166,109,187,108,219,198,116,198,109,219,182,237,183,118,247,139, 67,190, 64, - 86,129,187,187, 19, 80,184,190, 85,240, 60,153, 60, 2,226, 52,245, 4,161,111, -176,220,255,221, 29,114,247, 78,167,129,223, 83, 77, 48,216,149,165,130, 85, 85, - 85,255,212,178, 8,205, 88,214, 91,239,238,255,208,195,119,119,175,111, 33,180, -215,143,247,192, 62,222, 94,200,192, 31, 31, 31, 30, 13,209,235, 58,181,190,215, -106,119, 57,206,206,159,168, 26,238,110,145, 42,145, 69,178, 72, 22,169, 18, 85, -162, 74, 36, 81, 36, 74, 31, 84, 26, 93, 54,184, 33,191,126, 23, 62,235,161, 26, -186,151,249,197,144,176, 72,149,136, 67,227,176, 72, 22,169, 18, 85, 34,137, 34, - 81,254,222,127,216, 63,199, 18, 92,193, 96,220,101, 52, 46, 81,180,239,152, 19, - 61, 20, 69, 41, 86,189, 40,146,137, 92, 9, 42,172,178, 50,107, 60, 12,149,184, - 73,190,104,248,162,217,124,141, 15,204, 81, 83, 53, 29, 13,174,239, 7, 29,215, -216,217, 68, 77, 71, 43,169,103,154,192, 55, 48,112,255,126,213, 24, 28,176,154, -214, 12, 92,174,231,158,203,180,144,249,159, 75,218,248,127,193,117,162,130, 20, -211, 2,141, 12,168, 4, 59, 38,109, 6, 0, 65, 3, 99,114, 0, 0, 12,138,137, - 67, 82,153, 72,148, 70, 81, 12,250, 1,196, 32, 6,131,152,133, 21, 7, 22, 69, -195, 64, 37, 24, 60,134,193, 25, 10, 0, 2, 6,128, 0, 0, 1, 64, 0, 32,162, - 8, 67,192, 64, 71,125,169,167, 95, 55,253,128, 6,140, 17,218, 82, 6,246,221, - 12,163, 4,236, 58, 55,239,213, 12, 66,227,118,189,119,187,215,156,213,118,136, -235, 89, 66,182, 50,173,219, 65, 11,113, 95,232, 19,218,136, 52, 78,207,201, 90, -112, 66,140,242, 96,214,105, 81,168,254,197,198, 17,231,150,194, 3, 57,152,220, - 41,101,177,132, 72, 62,243,148, 93,168,185, 63,255, 66,137,118, 67,232, 45,245, -146,153,160,151,203, 31,199,208, 79, 34, 27,212, 72,248, 49, 1, 58,181,221,183, - 11, 55, 0, 67, 79, 74,222, 88,142,214,231,215,240, 70, 98,235,119, 34, 52,235, -164, 26, 50,144,191,235,220, 48,213,248,174,158,134, 21, 33, 28, 93, 35, 59, 40, - 50, 11,158,118,248,231, 72,238, 72, 78, 65,221, 83, 3, 93, 96,180,211, 16,200, - 78, 94, 38,216,123,138,224,133,114,157, 28,245, 0,189,123,121,235,224,237,148, - 7,205,169,169,227, 59,213,218,200,243,151, 92, 36,130,163, 35,252, 44,177,148, -220,216,227,130,215, 79, 18, 31,114,167, 92,157,130,150,167,116, 29, 21, 55,195, -238,176,217,115,248,235, 28,154,236, 4,187, 37,172,243, 90,214, 53, 52,243,122, -121,244,163, 54,223,219,121,176,131,206,190, 31,226,147,220,207, 38, 43, 38, 84, -218,181,136, 39,175,171, 64,189, 63,192,151, 28,182,194, 96,198,177,164, 94,164, -184, 87, 34, 85, 27,196, 80,238,236,227, 51, 85,118, 89,155,164,232, 43,141,243, -117, 1,128, 45,113,219, 46,134,164, 68,181,202, 16,208, 33, 35, 73,202, 58,191, -109, 47,243, 2, 33,168, 10, 2,219,247,212, 94,157,194,209,243,236,154,165, 58, -135, 55,236, 55, 91, 47,230,180, 81,197,182,195,181, 92,136,209,120,171, 99,119, -172,128, 9,210,214, 89,105,161, 33,182,104,111, 58,139, 50,121,145,204, 50,215, -234, 20, 96, 6,151, 99,163, 67, 54,132,163,178,192, 22,158, 4,136,113, 21, 21, - 37,110, 16,233,108,112,237, 72,176,190,230, 37,174,158, 28, 1, 21, 2, 4,106, - 5, 48, 98,110, 24,249,238,132,166,197, 81,184, 85,117,176, 37, 84,198, 1, 16, - 60, 40, 1,134, 70, 55, 93,222,137,156, 64,242,106, 81, 17, 42,114, 9, 4,210, - 41, 66,128, 38,252,188,236,194, 43,172, 52,215,213,191, 24, 66, 61, 16, 71,132, -123, 86, 70,117, 10,101, 2,159, 60,114,128,187, 4,250,226,226, 2, 98, 60, 82, -255,242,137,175,160, 60,136,254,189,242, 34,209, 66, 15,178, 77,224, 8,218,160, -191,163,234,205, 79,132, 21,159,156,202,233, 66,123, 47,121,230, 61,210,248,182, - 55,160,201,107, 26, 98,101,212, 11, 74, 32,213,188, 48,159, 31,228, 59,160,175, -136,134,137,247, 13,207, 56,118,137, 14,237,147,152, 91,213, 28,246,225,235, 60, - 44, 18, 14,235,163,184,235,170,253,157,171, 81, 76, 23, 81,223,190,115, 72,223, -196,136,120,154,232, 67,169,135, 31,186, 79, 52,236,193,112, 62, 37, 2, 48, 80, -138,245, 96, 34,194,139, 81, 57,214, 25,254,120, 39,216,168, 57,197, 61, 15, 74, - 6, 52,194,152,240,226,106,147, 99,205,163,161,223, 56, 6,126,142,200, 65,194, -190, 86,172, 55,113,218, 6, 58,126,162, 72,191,147, 32, 47, 65,102, 10,106, 28, -189, 10,234, 13, 96,125, 98,199,250, 94,100, 22,160, 65, 56,167,205,162, 67, 51, -212,101, 8, 75,106,202, 15, 56, 50,166,177, 38,229,253, 86, 17, 33, 13,218,207, - 36, 72,233,168,133,215,154,253, 14, 99, 18,209,162,147,164,111, 69,159, 99, 33, -249,189,187, 96, 46, 91,249,103, 2,123,253,128,225, 44, 89,180, 64,165,154, 47, -213,245,201, 99,216,251, 45, 21,101,103,171,133,133,200,205,225, 32,140, 84,171, - 21,246,247,220, 76,161,139,139,244,185,185, 61,203, 38, 65,150,160, 60,151,112, - 83, 31,177, 18,230,182, 82, 96,255,151, 54,244,229, 69, 65, 56, 14, 71,243,185, -255, 2, 15, 3, 80, 16,187,203,156,174,215,191,200, 85, 67,185,153,159, 62,119, -118,148,130, 16,110,236,237, 4,165,253, 54,130,144,102,155, 85,198,226, 17, 65, - 27,220,146,128,185,244,119, 25,156,126, 9,235,110, 43,153,166,107,232,106,188, - 5, 44,213, 19,122,165, 61,241, 70,214, 18, 18, 71, 42, 49,163, 92,227, 33,190, - 43,104,186, 30,253,124,132,126,190,130, 17,113, 48, 29,176, 9, 43, 16, 84,200, -244,143, 42, 1,193, 37,149, 5, 61,178,146, 13,234,179,230,253,209,143,139, 87, - 58, 58, 43,182,120,103,233,189, 10,197,245,250, 85,183,246,123,229, 89,234, 53, -127,224, 20,123, 36, 22,133,187,169,247,187, 54,220,145, 59,237,196,164,217,183, -151,243,146, 71,253,191, 28, 52,240, 44,193,161, 75, 85, 5,168,217, 78,154, 54, -249,176,147,221,137, 87, 81,154, 47, 87,166,193, 34, 46, 43,106, 90, 15,239,130, - 16,127,238, 14,176, 73, 77, 8,228, 45,240, 59,187,189,136,237,112,177,171,216, - 91, 92,167,215,185,225,126, 70,234, 48,116,161, 61,139, 66,132,155,198,137, 89, -184,139,227, 85, 78, 70,108,106, 87, 34,112,163,206,198, 8, 70, 6,199, 30, 39, - 67, 76,226,252, 92,203,224,178,161, 99,166, 57,175,213,220,108,158,239, 18,251, - 76, 38, 92,153,189, 90,103,183, 86,239, 67,211,118,239,226,119, 95, 91,222,183, - 77,201,242,231, 38,172,131, 7,185, 46, 18, 14,172,250, 29, 20,111,161, 57, 0, -158, 86,104,153, 83,191, 81,163,130, 29,147,253, 42, 98,110,174,205,246,188,240, -214,201, 85, 40,207, 99, 57,239,128,156,198, 56,241, 23, 88, 67, 89, 38,206,145, -113,238,244, 32, 59,171,161,140, 86,214, 29,134,164, 81,234,106,127,200,183, 66, - 34, 72,230, 55, 66,101,190, 40,199,255,194,132, 0,193, 9,219, 54, 33,103,211, -254,255,201,148, 85, 8,123,129, 52,167,136, 69, 64,208,183, 98,242,210,170, 39, -104,233,114, 23,156,162, 10, 2,154, 47, 57, 17,165, 91, 0, 83,212, 52,182, 37, -225, 53, 86, 2,114, 14,222,109, 56,158,183,242,192,154, 38,149,105, 66, 78, 20, -175, 49,139,186,198, 41, 77,183,167,160,134,118, 7, 44, 35,122, 2, 83,183,118, -185, 81,153,112,209, 51,158,147,176, 44, 19, 97,120, 2,102,145,196,242, 36,177, -238,138,164, 97,123,196,111,137, 91,217,203,245, 35,169,125, 22,244, 71, 89,225, - 91,242,182, 56,255, 1,213,148,125,125,177,170,188,133,110,170, 14, 1,192,210, -174,112,176,222, 4,103,199, 78, 48, 18,247,148,227,182, 98, 0,235, 51,219, 73, - 42,150, 68,137, 77, 53,234,250,242,134, 75,237, 75,138, 76,109, 31, 92,109, 1, - 68, 59,200, 86,218,150, 76, 65, 4, 7, 34, 48,148,200,127,221, 84, 71, 52,214, - 26,137, 9,237, 78,224, 18,221, 33,104,243,137, 51,133,155,164, 85,184, 1,165, - 88, 95, 31,210,188,112,140,108, 47, 14,202, 84,151, 36,152, 90,207,211,187,231, -225, 95,205, 38,227,158, 94,209, 90,187, 75,186,140,198,118,221,159, 10, 33,223, - 14, 48, 86, 81,239,138,179, 30, 96, 70,171,161,106,172,144,159, 43, 86,207, 51, - 33, 81, 6, 62, 92,155,193, 96,215, 69, 4,207,159,142,219,215,169,110, 22, 18, -205,187, 30,226,107,240, 41,126,227,133,180,235, 49, 92,228, 63,235, 38, 7,115, -250, 14,210, 12,239,212, 95,229,193,254,252, 80,110, 5, 48,137, 74,199,109,102, - 7,151,136, 0,199,217,251, 19, 1, 42,106, 40,228,233,217,196, 47,165,135,196, -142, 86, 97,168, 33,125, 42, 4,172,224, 19, 50,105, 48, 31,199,209, 66,243, 52, -238, 34,233, 71,176, 57, 2,250, 49,114, 75,125,160,225,222, 13,116, 25,106,222, - 99,111, 81,165, 82, 75,133,169,144,210,241, 75, 86,234, 41, 59, 18, 84, 50,173, -140, 18, 47,200,106, 19,128,250,155, 14,125,249, 61,194,172,220,123,153,139,224, -151,130,162,187,165, 87, 69, 27,225,184,243,220,124,193,109, 14,127,222,179,169, - 68, 87, 37,201, 99,198, 78,157, 77, 37, 0, 14, 9,242,223,132, 51, 87,167, 79, -106,255,131, 20,187, 86, 61,149, 28,150, 8,156,198,240, 12,159,231, 96,226, 46, -172,228,176,143,135,164,131,230, 32,151, 93,255, 1, 6,153, 93, 53,254,129,249, - 6, 44, 34, 10, 91,143,234, 23, 76, 54,148, 38,127,222,228,188,141, 10,235,108, -172,131,242, 94,188, 2,118, 84,212,175,227,225, 77,167,164,180,201,216,107,166, - 13, 8, 54, 42,204, 89,227,247, 98,106,187,167,125,220,178, 99, 6,159,114,235, - 74,179,196, 12,117, 96,173, 70,135, 40, 98,180,168,117,168,252,104,187,129,123, - 86, 46,123,201, 81, 73,221,189, 9, 51, 23, 49, 22,171, 31,104,122,235,179,208, -109, 84,170,246, 12, 14, 56, 66,135, 72,182,157, 91, 76, 41,212,147,212,181, 39, - 20,149,162,199, 1, 1,148,213,207,115, 74, 58, 94,150, 55,145,245,122, 27,129, -228,224,104, 94,118,116,204,107,178, 59,124, 95,146, 26, 28, 40,176, 87,105, 17, -162,249,245, 77,158, 40,102,148, 62,133,154, 63, 45,118,129,248,194, 11,217,116, -162,126,200,129,238, 93, 38,134,132,164,102, 60, 60, 24,154, 95,112, 29,114,244, - 81, 16, 98, 62, 19, 46, 14,168, 44, 13, 59, 76,120,178,178,164,236,222,102, 49, - 45,230,225,128,208, 51,126,194,115, 88,168, 21,121,192, 3,193, 80, 45, 12, 95, - 84,252, 75, 10, 73,113,156,231, 0,154,178,249, 93, 64, 84, 6,238,141,121,177, - 17,139, 33,201, 0,208,145,170,102, 64,154,187, 29,245,173,177,149,254, 94,177, -199,162,220, 68, 51, 36,179,142,248,166, 46,211,255, 73, 39,218, 56,210, 7, 63, - 73,234, 30,129, 37, 82,253, 8, 86,144, 49,109, 10,121, 90, 28, 6,212,144,238, -170, 91, 50, 26, 23, 39,236,236, 22,121,150,228,240, 39, 12, 76, 20,108,197,114, -140, 74, 54,126,151,178, 27,165, 45,230,238,105,248, 5, 17,114, 29, 19, 66,185, -142,118, 16, 94, 54,122,115, 50,130,152, 68,249, 86, 33,226,215,180, 86,126, 83, -104, 74,217,253,153,150,193,118,206,178, 88, 75,178, 6,197, 26,216, 25, 50,113, -101, 74, 74,225, 63,237,234,197,109,162,127, 50, 52, 92,223,254,181,248,157,250, - 53,200, 13, 44,174,248, 0,163,179, 96,151,187,180,110, 48, 59, 93,153, 15,100, - 4, 85,254,202,125,179, 18,225,224,220,222,252,223,245,201, 59,205,149,187,144, - 20,203, 4, 45,127,192, 91,226, 53,124,195, 17, 72, 56,247,129,196,144,248, 48, - 50,188, 74,145,214,245,155,221, 60, 11,184,209,109,222, 77,154,176,180,247,251, -153, 3,172, 98,213, 0,172,120,131,130,184,150,239,126,181, 54,203, 67, 51,252, -237, 69, 92,225, 22,191,196,211,206, 82,234,243,243,224,122,216,140, 28,192,185, - 97,254,246,121, 62,101, 13,250,181, 32, 58,129,153,112, 0, 73,142, 64,239,186, -242,248, 0, 32, 48, 81, 44,254,125,253,240,216, 42,210, 75,209,111, 5, 48,217, -232, 90,233,156,180, 21,104,174, 3,193, 21, 37, 17,131, 18,241, 15,208,171, 42, -215, 34,109, 45,112, 78, 29,223, 37,202,220,120,201, 44,198, 34, 76, 34,254,139, -196,111, 30, 7, 1,137, 51,246, 17, 37, 51, 35, 64, 52, 5,190,238, 74, 61,196, -180,141, 4,201, 74,216,181,183, 26, 48,109, 30, 68, 8,169,137,200, 68,107,177, -138,104,240, 71, 49,232, 5, 81, 93, 88,147,248,152, 99,167,147,245, 78, 20, 23, -228, 9, 61, 19,196,159, 51,152,112, 0, 86,197, 81,130, 65,235, 99, 1,251,224, - 72,121, 74,176,182, 61,199, 39, 88,245, 20,185,194,150, 72,135,245, 41, 6,207, -112,138, 26, 95, 66, 16,212,223, 58, 79, 36,156,205,128, 71, 65,137,118, 70,231, - 7, 80, 44,173,221, 78, 4,173, 34,226, 70,222,127,174, 74, 70, 55,194,157,181, -144,138,248,167, 51,136,200,245, 15, 30,112,226,191, 58,114, 54, 65,134, 76,208, -203,234,254,170, 90, 46,130,243,239, 51, 60,210,114,205, 27,222, 32,251,117,114, - 66, 15, 21, 71,164, 14, 17,175,177,218,245,211,105,213, 33,185, 6, 43, 36,153, -112,135,206, 87,178,233, 17,255, 41,133,142, 30,135,128,244,132,165, 42,108, 11, -202,232,230, 71,135, 13,151, 42, 50, 43,245, 80, 70, 68, 83, 26,156,133,133, 53, -170,221,147,201, 17,191,138, 64, 47,156,132,199,190, 4, 33,234, 75, 94,206, 91, - 34,166, 55,162, 82, 50,136, 0, 51, 57, 23,253, 13,175,246, 73,189, 66,158, 73, -145,210, 78,214, 49,112,195,112,193, 1, 98,179,242, 80, 80, 98,115, 35,110,125, - 28, 82,181, 66, 22,108,114, 79, 83, 39,196,100,187,235,192, 44,154, 36,168, 19, - 9,161,140,116,128,138, 70, 11,199, 44, 49,174,100, 78,231, 8,250,144, 14, 12, - 11,202, 45, 8,236,154,172,210,105, 82,134,177, 72,145,253, 38,232,133,250, 89, -122,213, 20,135,108, 3, 62,255,211, 31,212, 85, 12,239, 87,206,252, 54,196,121, -136,144,241,121, 88,151, 3,134,229, 55, 4, 89, 43,129, 90,113,203, 79, 4,100, - 67,252, 92,212,190, 5, 80, 50,246, 52,153,172,110,126,167, 65,195,234, 70,242, -164,134,135,226, 0,154, 13, 36,220, 51, 51,111, 21, 73,151,168, 58,189, 58,228, - 52,120,113,113,176, 57, 31, 96, 8, 19, 11, 79, 22,163, 61,142,149, 64,242,141, -230,135,247,249,199, 88, 13,204,227,154, 87, 75,205,191, 23,172, 46, 91,172,214, - 39,198, 81, 22, 33, 34,141,198,246, 41,128, 67,169,114,135,174,206,156, 32, 21, -209,235,169,198, 47, 87, 5,195,198,241, 45,177,158, 33,167,195, 65, 71, 3, 61, -156, 15,115,125,160,236,151,107,210,240,145, 68,180, 24,130,124,160,239, 50,246, -192,195, 20,211,120,108,121, 61,108, 90, 12, 88,145, 26,150, 87,165,200, 43, 85, -214, 37,146,193,190, 13,145, 2, 35,208, 94, 95,234,196,160,193, 38, 43,134, 48, -107, 31, 65, 98,228, 71, 10, 34,220,194,219,199, 1, 60, 94, 21, 13,169,216, 53, -204,142, 94, 96,175, 74,214, 21,242, 48, 90, 74,142,147,162,205, 39,224,194,168, - 56,159, 40, 57,126, 14,193,198, 72,140,181, 62,151, 13,246,194, 14,191, 22, 54, -158, 86,176, 15, 9,237,225,159, 22,101, 51, 44,210, 22,154, 3, 69, 65,239, 64, - 25,197,136,116, 94, 39, 39, 74, 41, 27, 54,228, 3, 35,221, 72,156,235,239,190, - 71, 53, 27, 38, 13, 71,231, 8, 24,251, 51,116,237,191, 15,209,165,139,129, 50, -185, 37,176,100,146,105, 36, 6, 95,185, 84, 65,171, 54,214,101,214,121,201, 42, -159,153,144,239, 7,242,119, 48,135, 18, 23,239,238,187, 20,241,136,159, 86,178, -112,126,122, 65,192,240,249, 5, 40,153,176,161, 90,146,153,237, 53,194, 89,219, - 25, 2,176, 71, 62,181,178, 6,199,120,116, 42, 36, 72, 22, 54,232,245,185,119, -154,145, 84,170, 21,221, 99,219,144,214, 6,199,247,112,163,131, 85, 24,255,147, -121, 8, 57,225,211,132,161,187, 30,221, 29,219,111,188,173,210,199,199,125,203, -198, 94,182,213,116, 77, 22, 57, 40,181,203, 56,222,248,253,206, 6,127,179,239, - 23,116, 80,209,161,131, 42,250,124,107, 98, 20, 72, 65, 54,189,131,238, 52, 27, -197,132, 74,189,244,185,194,199,213, 58, 59, 1,101, 2, 27,185,199, 96,240,217, - 8, 46,220, 84,138, 54, 23, 97, 69, 91,162, 22,109,119,251,209,136, 10,133, 35, -203,207, 58,182, 99,123,246, 27, 55, 16,216,214,136,176, 11, 80,157, 57, 54, 84, - 8,117, 5,112,204, 70, 93,234,197, 23, 92, 12, 54, 24,153,183,157, 76, 26, 64, -175,173, 29,104,126,249, 73,237, 44, 56, 79,208,106,216, 65,138, 9,155,113,243, -150, 50,171,154, 93,150,178,130,161,164,208, 63,105,160,105,221, 67,187,162, 25, - 40,240, 23, 16,177, 46,187,196, 4,112, 9,237,137,153,114, 86, 30,195, 53,140, -198, 46,255,225, 20, 62,129,206,155,118,154,249, 55, 93, 3, 49, 25, 96, 58, 75, - 79,179,138,145,240,115, 55,215, 76, 48, 84,231, 55, 6, 22,222,231, 87, 56, 37, -141,162, 65,119,176, 68, 64,116,204,200, 45,147,123,158, 0,171,101,235,191,244, -184,115, 51, 65, 88, 30,181,158,218, 60,138, 46,145, 81, 85, 44,125,245,249, 5, -253,237,205, 84, 89,224, 74, 89,164,216,144, 24,143, 31, 78,107,137, 45, 85,145, - 11, 76,180,188,218, 97,165,228,232, 83,204,240,185,222, 79,157, 41,128, 30,152, -207,201,181, 48,116,222, 66,129, 7,225, 15, 75,168,106,188, 27,120,241,252,106, - 29, 62, 61, 71,249, 52,136, 38, 35,162,134, 62,139,214, 2, 48, 88, 67,178,137, -238, 30,167, 39,249,110,226,148,128,119, 73, 66,139,145,244,102,106, 77,118,215, - 45,203,144,168, 82,234, 99,196,212,140,175,193,117,172,184,170, 82,226,206,120, - 84,153, 70, 60,131, 51, 33, 65,129,105, 18,119,101, 7,204,156,172,158,158, 48, -202, 78, 29,210,244,230, 7,246,118, 23, 23,102, 1, 36, 80, 91,177,250, 37,110, -171,145,197,226,210, 54, 26,167,140,155,170,232,134,136,183, 55,167, 20, 16,134, -111,251, 71,170, 45, 3, 85,158,148, 11,110,127,195, 61,207,178, 31,183,194,164, -121,243,118,103,207, 18, 56,226, 22, 51, 57,101,220, 26,220,179,153, 6, 91, 30, - 35, 32,178,116,220,135, 26, 28,193,149, 5, 54,200,197, 25, 96,103,113, 11,251, -203,179,207,173,118, 68,215, 90,114, 70, 18,183,112, 25,206, 57,192,101,211, 42, -220,213,242,221,182,224,111,198,103,234,152,230,227,217, 0,188,219,142,151, 69, -188, 95,164,213,184,112, 69,121,241,238,110,123, 88,198,183,236,184,165, 65, 2, - 57,179,111, 84,126,210, 73, 99,130,182, 78,132, 68,197,161,104,165,107,128, 55, - 73,236, 40,115,174,189, 13, 69, 50,230,159, 45,144,253, 92, 95, 1,227, 15,191, -133,120,205,221, 87,244,135,252,218,110,154,140,248,192,246, 17,222,198,142, 77, -236,220, 55,155,218,218,184,105,140,161, 47,236,155,144,110, 4,110,127,213, 64, -237, 51,228, 70,171,185,255, 11,115,209,169,132,118, 48,222,139,179,104,208, 60, - 73, 43,195, 46, 63,152, 31, 12,107,155,168,104,139,133, 74,246,209,128,195, 93, - 45, 7, 11, 52, 11,145,177,113, 5,136,135, 64,129, 35,228,217,240,180,231,242, - 52, 27,203, 77,199, 16,235, 83,242,152, 45,201,170, 37, 26,126, 40,126,111,187, -172, 27, 38, 62, 53,152, 15, 48, 65,144, 72,248,216, 98, 99,214,252, 21, 56, 17, - 77, 31,238,170, 8,133, 81,149,117,130,134, 48, 65, 7, 90,121,194,120,179, 8, -179, 32, 14, 37,239, 29,188, 9,244, 1, 18, 43,222, 12,104,220, 74, 23, 30, 25, -249,252,201, 96,196, 70, 16, 4, 45,218, 39,104,147,188,103, 98,100, 74,206, 36, -208,207,115,223, 94,127,233, 47, 21,233,145,202,146,185, 61,214, 28,123,233,104, - 96,208,229,204, 73,157,251,217, 81, 11,211,210,224,145,138,148, 4,186,112, 34, -209, 62,151,216,134,132, 66, 53, 31,225, 15,115,247, 80,185,148,204,232,247,117, - 2, 6, 16,248,143,189,172,235,174, 66, 54,207, 40, 22, 45, 58,245,141, 28, 18, -151,233,188,172,207, 28,235, 73,214, 5, 45, 73,115,116,251,172,238,223,255,167, - 73,175,100, 48, 32,107,104, 98,182,102, 69,195,156,107, 15, 11, 1,172, 20,145, -247,170, 58, 68,165, 43,226,225, 68,214, 63,131,113, 48,223,143, 14, 87,239, 32, -173,215, 74,202,120,184,226,184, 0,243, 90,185, 16, 50, 29, 65, 24, 32, 59, 79, -141,210, 31,158, 24, 32,252,200,119,213, 72,196,250, 14, 92,225, 59,251,146,151, -224,160,219,246, 64,114,150, 72,153, 93,117, 14,109, 44, 52, 38,213,210, 55,148, -249,117, 98, 95,169, 90,128,202,165,140,185,179,186, 43,132, 26,157,160,203, 73, - 13,143, 39,212,228,244, 79,141,130,170, 59,184,205,225, 79,241, 93,103, 9,150, -174,228,240,238, 84,126,152,167, 69,219, 39, 70, 77,143,218,186, 54, 39, 91,155, - 70,115, 6, 53,174,213, 98,187,174,113,125,219, 5,216,145,194, 8, 50, 67,183, - 23,119, 29,246,182,110,211,210,143,166, 59,146, 32,199,224, 31, 26,157,138, 20, - 23,153,112, 84,171,184, 95,230,207,194,224,232,143, 49,201,233, 66,216,164,142, -200, 54,113,244,208,244, 14,104, 36, 16, 39, 4, 9, 54, 99, 20, 1,122,186, 12, -176,156, 91, 9, 2, 79,218, 6,152,136,157,215,172,206,238,126,139, 50,194, 48, - 50,109,198, 68, 4,183,100, 42,207,221, 14, 19, 25, 78, 69,152,143, 95, 22,140, - 85,119,138, 56,100,118,157, 44,118, 54,202,142, 27, 70,216,115, 88, 84, 75,137, -183,118,173,162, 16,225, 56,162,206, 81, 87,220,214, 7,211, 2, 88, 17, 11, 68, - 29, 16,201, 32,250, 37, 19,212,137,166, 90,133,250,147, 65,124,103, 1,175,153, - 82, 24, 56,200,214,234, 4, 12, 25,142,183,184, 70,158, 87,113, 39,188,242,180, -180, 59,176,224,131,177,149,213,206, 63,128,139,147,246,139, 21,155, 98, 27, 17, -143,222,129,118,137, 5,225, 67, 7,129,155,215,118,147, 98,144, 16,158, 96, 99, -139,221,209, 34, 14, 12, 34,165,194,176,116,145,185,153,143,244, 0,246,240, 40, - 84,200,244,244,183,224,126,195,176, 43, 45,231,114, 97,239,239,255, 9,123,240, -209, 4,173,184, 46,195, 42,227,227,144,134, 21, 90,162, 11,155,234,163, 68,244, -160,213,197,204,136,208,255,194,213,100,204,231,103,117,226, 18, 32,213,185, 90, -228,149,176,123,195,101,129, 82,139, 98,166,170,225,177,161,139, 88, 67,145, 23, - 1,146, 35,102,205,215,208,204, 79, 90, 11, 2,228, 97,231,163,161, 79, 37,174, -186,194, 25,196, 40,143,225,190,230, 88, 73,233, 18,226, 18, 84,156,242, 60,137, -174, 40, 15,174, 75,213,236,184,182, 51,235,238,143, 11, 22,222,229, 89,210,139, -103, 3, 54, 19,109,177,242,230,120,210, 71, 32,133,227,120,115, 64, 17,200,232, -128,166,213, 1, 1,253,250,229, 94,150,236,144,227,240, 96,231,106,144,211,193, -131, 16,123, 96,249,209, 23,174,183, 88,231,155, 4,105,145,155, 32,235,154, 16, -177,164, 99,245,101,116,243,176,135, 77, 96,125,201,188,241,153,151, 94,125,101, - 41, 98,129,251, 66,152, 78,136,199,152,184, 15,166, 44,111,158, 37,206, 34,164, -243,242, 39, 87,245,140, 43,154,101,248,245, 19, 90,170,226, 67, 3, 58,166,100, -107, 56, 88,224,181,234,194,177, 28, 69, 3,159,180,132,157,151,192, 77,192, 94, -246, 90,157, 93,140,214,131,107,104, 85,247,230,220, 33,167,137,176,134, 15,230, -219,196, 83,252, 85, 58,152, 42, 58, 13, 79, 91, 19,253,226,166,101, 98,218, 79, - 7,106,204,122, 93, 12,213,107, 6, 8, 96,245,138, 94,239,162,218, 0,203,249, - 37,124, 58,171, 69, 4, 43,132,212, 28, 77,154, 48,154, 52, 59, 83,151, 49,195, -176,176,157,169, 71, 16,188, 22, 8,181,118,247, 36,107, 56,221,191,184,200,207, -103,183, 49,190,237, 88, 73,144,192,174,243, 9, 69, 93,233, 36,224, 42, 36,101, -246, 59, 98,145, 60, 73,200, 1, 58,255,195,188,104,150, 19, 16,202,177,197,131, -254,233,169, 56,108,160,223,118, 53,223, 85,106,148, 96,151,122, 19,105,135, 89, -113,137,126, 46, 1,161,246, 89, 0,128,188,179, 18, 19,194, 19,204, 26,183, 67, - 90,104, 51,160, 40, 59,133,215,212,168, 33,127,170, 48, 1,237, 22,197, 18, 52, - 59, 57, 78,232, 83, 40,109, 63,108, 44,127,167,244, 36,100,166, 93, 62,128,111, -161, 89,183, 35,199, 59,193,139, 32,232, 80, 32,148,223, 29, 50, 78,120,115, 78, - 28,203,165,189,125,108, 95,179, 67, 83,245,204, 48,175,231,121,228,237,242, 68, -130, 0, 7, 17,135,122,103, 65, 41,183,142, 56, 40,154, 30,133, 83,216,186, 37, - 34, 83,160, 81,152, 67, 48, 13, 79,109,114,223, 26,148,132,110,208,102, 85,201, -237,116,232,188,248,220,172, 10,192, 34, 36,144, 56,154, 61,139,101,148, 52,193, - 77,241, 22, 37, 61, 56, 28, 39,154, 70, 41, 79, 93,144, 73,123,148,245,252,133, -134,125,183,209, 84,102, 80, 63, 86,240,242,193, 28, 22,130,248, 1, 11, 99,248, - 60,111,195,166, 78,140,146, 67,174, 15,102,203, 84,184,104,148,141, 19, 19,149, -187,144, 64,192,243, 40,196, 81,164, 36,222,242,106, 22, 33,143,217,123,137, 12, -166,158,154,133, 8,110,154, 11,162,199,119,104, 91, 93,189,135,222, 58,193,176, - 33,132,213, 22,131,210,123,197,185,118,148, 78,107,251, 75,243,189,167,209, 86, - 43,155,199,192,237,212, 43, 75,162, 34, 88, 30,157, 19,144,101,212,103,113,202, - 26, 92, 70, 89, 20,139, 85, 56, 80, 67, 16,242,227,143,145, 1,227,226,228,206, -168, 92,127,115,114, 8,139, 46,117, 87,208,187,224, 26,195, 8, 1, 82,100,167, - 31, 39, 91,107,111,120, 88,250,180,226, 23,123,186,182,133, 68, 33, 24,210, 17, - 5, 31, 36,184, 34, 42, 76, 57,212,182,122,152,175,242, 38,233,190,170,132, 95, - 21,132,117, 34,196, 77,246,122,181,209, 33,111, 36,220,112,131, 9, 87,128, 97, -230, 55,161,118,197, 70,150,165, 66,149,132, 9,220,238,214,121, 60, 77, 33, 18, -176, 93,141, 37,149, 83,246,108,197, 26,169,210, 72,222, 27,202,119, 23,208,164, -218, 90,193,196,100,184,142, 70,188,143,118, 42, 19,104, 53, 14, 33,178, 36,197, - 81,188,147,248,173,160,232, 75,190,236, 73, 4,191,207,149, 96,144,188, 29,180, - 41,155, 84,133,105,230, 90, 60,149,240, 80,186, 74, 15, 59, 82,156,250,102,231, -134, 20,122, 78, 77,186, 74, 37,238, 45, 48,103,114,189,233,129, 33,151, 64,114, -193,153,235, 26, 81,203,147, 40, 5,213, 8,207,167, 5, 4, 42, 24,130,230,209, - 79, 32,144,238, 8, 75, 93,204,162, 29,183, 54, 14, 50, 66,208, 43, 8, 67,176, -122,206, 68, 82,149,185,243, 15,107,252,204,177, 30, 87, 21,112,120,233, 48,171, -233, 83,101, 74, 45, 81, 97, 8, 46, 50, 8,165,164,246, 79,154,240, 52,165, 56, -252,102, 75,216,221,135,156,174, 38,139,202, 67,240, 99,134, 8,207,102,106, 10, -190, 40, 69, 25,223,105,233, 28,146,130,169, 56, 97,245, 74,237,197, 47, 88,183, -194, 56,139, 36,253, 4, 19,244,231,118,154,184,239, 50,103,247,135, 4, 69, 74, - 14,253,180, 27,209, 69, 58, 63,204,213,232, 99,132, 24, 25, 75, 24, 2, 95, 83, - 46,113,191, 88, 79, 67,140,212,132, 9, 7, 80,101, 51, 67,222, 72, 81, 72,215, -241,240,131, 13, 43, 72,164, 35, 39, 90, 13,211,143, 53,251, 18,224, 56,117,206, - 96,117, 60,243, 11, 44,115,206, 60, 70,182, 28,215,190, 11, 42,151, 96,105,126, - 14, 80,118,150,230,250,110,230,138, 20, 86, 28,100, 74,122, 20, 8, 66,152,161, -186,187,129,250,123,247,193, 46,242,216, 24, 45, 54,205, 46,231,106, 47,197, 88, -241, 70, 30, 58, 60, 68,239,138,138,241, 0,226,107, 72,131,129, 0,147,100, 72, -207, 31,213,132, 18,157,232, 24,119,214,221,173,192,103, 62,221, 71, 21, 3,181, - 97,176,182,197,180, 40, 8,251,142,231, 15,220,164,154, 42, 27,131, 65, 55,232, - 57,154,135,160,231, 32, 40,100,119, 42,204, 60,198, 27,207, 25,166, 16, 84,120, -147,252, 37,174,199,121,120, 39, 40, 8, 72,125,203,125, 11,124,168, 61, 32, 69, -121,141, 81, 8,162,253, 99, 31,248,129, 68, 81,203,127, 41,154,199, 30,136, 98, -176,119,154, 46,121, 55,169, 79,151, 32,116, 84, 42,145, 59,195,143,149, 1,189, -196, 35,103, 58,246,118, 96,158, 76,209,158,242,183,163,171, 72, 1, 50, 77,125, -192, 20, 4,250, 3,220,157,236,241,136,169,133,168, 70,180,115,251, 91,246,215, -133, 54,165,165,187, 75, 12, 76, 63, 10,251,178,192, 34, 17, 79,211,139,236, 2, -123,196, 83,213,205,155, 73, 9,123,168,145,206,251,186,185,157, 72,159,194, 46, - 6, 62, 78, 15, 7, 99,133,199, 67, 67,142, 43, 2,244, 88, 80,115,163, 23, 61, -208, 78, 14, 62,125,215, 29, 40,178,105, 1,130, 83,174,128,224,157,210, 9,217, - 44,151,148,211, 16,233,253,105,157,159, 75, 68,152, 51, 68, 57,205,113,209, 62, - 80,224,232, 10, 37,226,195, 37, 69,123,130,222,203, 77,246, 26,197,230, 42, 44, - 60, 34, 61,255,129, 90,200,137,112,241,212,182,159,224,119,165,231, 73,126, 83, - 56,248, 42,142,124, 43,201,183,187,115, 38, 39, 70,142, 14,132, 56, 60,176,244, -108,114, 61, 57,236,158,172, 5,216, 21,121,140,119,172, 17,218, 93, 79,227, 84, -212,179,129, 25,162,231, 9,120, 32, 15,251,223, 41, 43,210,238,213,172, 67,169, -106,170,105,109, 62,207, 70,249,152,189, 56, 70, 41, 77, 19,250, 2,168, 66,203, -227, 96,206, 65,235,170, 33,182, 87,122,174,166, 72,205, 72,180,134, 62,191,193, - 97, 18,151, 35,170, 4, 63, 20,246,242, 87, 91,243, 20,106, 96, 36,244,167,148, - 58,164, 58, 72,116,180,117, 96,117,181,206,172,150, 87,208, 51,255,192, 50,147, - 65, 67,140, 61,159, 45, 22, 90, 86,156,236, 68,152, 9,221, 35, 9,211,167, 82, -103,243,149,143,140, 41, 77, 94,100, 24,254, 69,115,147,163,236, 72,125,210, 4, - 18,193,192,144,244, 59,253,220,171,134,224,147, 99, 55, 91,112,212, 50,220, 4, -241,203,109,177, 11,224,208, 49, 85,120, 9,153,175, 81,122, 43,132, 53,203,201, - 15,165,219,156, 20, 72, 48,170,163, 43,126,209, 97,103,142, 53,173,195,196,184, -132,210, 72, 30,254,225,249,183, 24,151,246, 33,158, 98,141,119, 41,184,243, 89, -202,214,191, 26,100,176, 55, 61,230,239, 22,200, 37,237,228,185,149,127,166, 39, -127, 12, 4,204,180, 57, 25, 85,225,245,127,207,131,195,241, 40, 21,114, 13,169, -117,247,219,122, 33,102,111,101, 14,239, 12, 24, 80, 46, 23,149,129,208, 4, 94, -206,188,211, 72,144,247,188, 25,178,106, 35, 80,151, 19,154, 44,111,208,105,197, -203,190,130,163,194,165,212,156, 67, 10,192,232, 62, 63,114,245, 32,135,151, 0, -175,153,166,158,143, 51, 5,201, 94,234, 40,249,207, 62, 87, 50,182, 62, 47, 49, -179,134, 67,140,171, 27, 5,175, 45,196,223,184,166, 84, 76,100,131, 89,103,153, -196,133, 90, 77,207,216,159, 26,223,172,127,168,253, 16, 17,183,125, 26,142,225, -208, 48, 72, 34, 26,173, 0, 84,115, 68, 83, 80,104,249,148, 76,224,227,177,181, - 34,215,164,133, 41,131, 23, 72,181, 74,170, 18,231,177,217,159, 21,224,243,200, - 94, 91,182, 3, 86,183,133,141, 56, 69,215, 36, 88,241, 65,117, 8, 30,111,158, - 10,234,100,218,185, 87, 49, 0,130,132,112,197,221,101, 21,199, 47, 57,136,210, -245, 61, 7,136,211,208,208,214, 1,248,130,192, 0,132,142, 36,149, 26, 81,186, -208, 75, 81, 91,230,152,128,245,167,152,161, 37,148,195, 65,137,203, 99,247, 50, - 70,208, 44,176, 55,225,194,203, 87, 18,186,117,167, 40,139, 47,203, 64, 87,198, -169,178,125, 10, 13, 67, 23,200, 30,135, 8,251,160,219,136,177,247,236, 8, 7, -158, 84,104,239, 28,198,231,200, 69, 23,131, 22,165,207,135,157,234, 9,140,145, - 87, 80,107, 52, 68,250,252,124,233, 74, 45,144, 18,151,121,183, 41,180, 75, 28, -217, 92, 98,137,133, 66,174,113, 17,208, 35,246, 47,211,141,102, 34,158,110, 92, - 66, 94, 30, 27, 63,250,192, 78,235,241,153,174,227,194,154,113,139, 80,171, 37, -219,169, 91, 34, 78, 33, 48, 72,178, 44, 40, 89,168,149,178,177,149,228,197, 60, -125,114,209,206,219, 22, 19,142, 48,182, 47,173, 20, 51,130, 31, 71,245, 66, 61, -230,118, 0, 55,146, 15, 80,243, 22, 32,218,246,238,127,206, 18, 58, 67,234,237, -230,232, 77,133,253, 5,235,214,126, 48,248,180, 43,184,141, 85,154, 16, 76,129, -111,212,191,101, 3, 28, 17, 54,230, 69, 10,253,216,140,115,204, 65,255, 10,100, - 93,213, 45, 79,133,121,108,250, 55,133,127, 82,203,226, 58,210,125, 1,159, 33, -156,126,187, 98, 4,181,132,225,229,157, 49,141,101, 88,209, 35,216, 58,117,252, -204, 63, 0,167, 9,120, 84,146,120, 45, 5,237, 57, 15, 26,110, 6, 89,180,216, -124, 56,116,182,232, 18,142,238, 10,173,200, 88, 53, 76, 99,175,238,136,209,146, -104,182,116,190,165,108, 91,166,249, 15,140, 76, 58,133,154,252,167, 10,131,157, -107,131, 89,218,220, 24, 7,159,167, 23,174,195,205, 8,138,144,212,159,165,125, -149,114,142, 29,212,197,181, 39,187,115,210, 17,151,220,162, 84, 64, 27,247, 9, -220,254, 72,186,209,126,172,120, 12,170,143,143, 38, 57,192,215, 1, 81,192,166, -229, 83,199,146,247,185, 37,166, 62, 79,102, 15, 10,145,237, 33,105, 51,236,230, -195,223,133, 40, 46,221, 45,170,121,112, 14, 75,111,228,102, 13, 34,107, 38,114, - 79,184, 23,249, 0,168, 97, 43,126,153, 79,156,209, 19,122, 39,116, 42,153,167, - 53,156,129,105,120,124, 73,209,195,196, 31,249,151,166,148, 74,250,229,237,156, - 17,160,203, 89,144,215,162, 32,243,175, 71, 67,192, 21,107,247, 53, 58,203,134, - 91,202, 29,190,133,161, 73, 23,118, 77,170, 40,106,224, 56, 63, 29, 70,105, 43, -166,128, 60,104,103,144,113, 16,182, 58, 77,209,250,100,114,115, 60,149,213,111, -164, 82,215, 31,237, 95, 81, 92,201, 4,239, 34, 50,250, 1,236,150,125, 12,140, -182,102, 75, 35, 49,244, 29, 44,111,107,181, 78, 73,189,162,122, 24,232,140, 29, - 93,230, 18,204, 31,163, 40, 97, 82, 60,164,124, 20, 35,134, 72, 90,235,211, 45, -200, 86,210,193, 27,108,136,196, 78,108,243,120,188,117, 99,211,134, 83,186, 94, -157, 8, 9, 32,205, 47,156,134,203, 7,138,247, 78, 44, 57,245,142,225,180,173, - 93,146,210,199, 44,211,230, 79,188,223, 52, 37, 13, 61, 37, 12, 56, 13,170,217, -239, 70, 48,213, 2,185,255, 78,121, 20,199,159, 0, 29, 21,101,113,205, 99,231, -134,157,227,236,182, 23,108, 21,183, 54, 66,243, 57,149,205,110,141, 55, 57,118, -108,222, 69,236,177,222,150, 67, 45, 87, 95, 29,154,170,148,130, 56, 19,126,152, - 32, 47, 83,115,204, 85, 91, 92, 77,183, 18,187,238, 32,212,127, 48, 43,245,184, - 89,102,176,211, 50,251,255,189,153, 11, 83,219,205, 68,116,140,147, 54, 54,234, - 41,167,131, 11, 45,245,196,228,125, 66,229, 18, 36,155,103, 27,126, 97,245,122, -184,215, 77, 87,190,121,208,207, 43, 34, 66, 11,185,130,144,113, 93,180,188,127, - 20, 85,138,180,164,148,145,200, 57,169, 91,158,221,197,180,160, 45, 61,182, 34, - 73,134,195,250,149, 26, 88,152, 91, 33,198, 63,176, 55,143,145,130, 15, 41, 58, - 61,193,117,123, 95,250, 9, 93, 3,129,131,164, 20, 13,168,151, 61,170,103,126, -213,233,222,110, 10,141,100,154, 9,191,184,173,194, 42, 90, 24,161,170, 97,137, - 0,246, 65,158,207, 74,140, 50, 3,206, 18,192,208, 44, 20,249, 52, 70,186, 74, -249, 74,192, 80,115, 96,140,220,232,136, 22,249,131, 44, 5, 83, 66,184, 71,101, - 95, 65,130, 49,204, 20,107, 4,108, 25, 89, 32,161, 0, 51, 35, 16, 56, 79, 10, - 73,128, 60,126, 76,253,129,157,254,114, 73, 95,176, 81,245, 28, 58,170,220,166, - 63,187,142, 49, 54, 40, 92,212, 72,171, 70, 5,145, 63,176,186,182,204,212, 32, - 8, 30, 41,150, 96,188, 87,254, 19, 60,203,137,134, 20,106, 52,240,209, 82,235, -210, 88, 0, 60,254, 52,199, 30,231, 82,216,207, 65,169, 81, 15,244,171, 16,202, -136,207, 58,248,100, 68,205,203,246, 5, 97,165, 75,145,254, 87,109,197, 5,110, -164,201,127, 50,189,103,155,170,143, 38, 81,222, 5,179,243, 90,220,196,182,248, -146,210,226, 38,214, 14, 48, 26,159,253,159, 26, 20,170, 98, 16, 91, 33,237, 32, - 47, 95,145,133,147,248,100, 34,221,115,137,116, 37,226, 37,248, 76, 78,207, 82, - 34,242,150,153,242, 45, 14,143,123,139, 44,156,228,131, 44,161,171, 28, 49,241, -237,228, 42,134,153, 26, 62,219,201,237,139, 75, 22, 59,153, 72, 74,182, 19,143, -216, 78,174, 2,219,137, 71, 54, 39, 87, 91,155,212, 92,186,162, 79,124, 58, 8, -161, 35, 52, 88,161,237,124,114, 50,252, 42, 24, 79,132, 27,145,169,183, 20, 94, -186,151, 14,228,174, 44,193,234, 44,108, 3,102,152,199, 36,141, 45, 96, 89,217, -197, 22, 18,187, 27,228, 69, 88,250,158,229, 76,133, 89,109,193,189,248, 98,220, -131,137,237, 89,129,209, 72, 97,171, 7, 41, 94,109, 22, 2,255, 20,184, 69, 55, -228,215,194,168,248,103,117,232,166, 98,146, 66, 78, 21,150, 80, 42,171,112, 64, - 85,237,175,206, 67,100,149,245,220,160,107,173,231, 37,222,224,186,129,146, 53, - 21, 3,157,240, 0,182,118,164, 40,208,178,232, 1,164, 41,186,150,149,226,239, -136, 90, 80, 65,230,165,216, 5, 66, 96, 40, 9, 19, 22,197, 96, 15,188,234,197, -216,254, 2, 95, 60,192,106, 3, 2,155, 0,153, 0,150, 0, 14,118,187,154,221, -178, 70,115,235, 69,243,222,250, 70, 68,252,192,114,119,170,138,188,193,226, 32, -185,128,240, 56, 49,251,153,163,107,158,251,125,161, 34,199, 56, 41,199, 90,198, -230,253, 17,178, 25,122,192, 37,228,220, 69, 3,195, 43, 57,122, 92,152, 11,250, -102, 25,141, 6,234,248,104,144,195,149, 73,224,164,203,233, 30,161,107, 66,191, -117,222, 46,215,145,230, 70, 87, 95, 82,166,109,142,100, 81, 5,211,148,247,107, - 82,237,200, 76,147,212,159,253,246, 50,220,231,121,237, 93,234, 58, 22,104,135, -191,231, 57,152,255,147,101,153,234,247,140,222,141,171,246, 57, 57,214,156, 85, -107, 33,204,205, 48, 80,189, 38,152, 3, 25, 11, 16,184,120,213,140,165, 25,197, -104,239, 36, 0, 21, 36,110,207,211,236, 90, 54, 42,110,215,205,191,171, 4, 80, - 20, 79, 70,202, 77,172, 86,253, 81,243,150, 61,245,240,231,158,147,161,123, 83, -138, 91,188,221,119,182,102, 80, 90, 0,166, 71, 83,251,115,240,110,203,162, 44, -203,170,170, 72,229,150, 85, 57,101, 69, 40,183, 40,175,168,119,249, 88, 38,214, -165, 63,162,221, 37,222, 24, 40, 71, 79, 96,151,249,198, 90, 33,200,242,174,221, -239,104,135, 59,229, 45, 31,187,169,246, 91, 87,151, 92,154,254,194,232,236,198, -186, 20, 11, 28, 82, 64,165, 74,122,168, 38, 15, 52, 46,175,117,231,100,116,174, -156,205, 7,155,148,242,229,235,141,253,136, 73,248, 34,199,216, 3,252,231,203, -199,244,134,203,141,105,138,229, 70,229, 90,252,255, 32, 79, 58, 23, 43, 72,212, -152, 52, 50, 58,246, 48, 7,129, 76,208, 53, 31,225,228, 14,147, 23,206,118,153, -201, 46, 78, 84,106, 9,161,252,152,243, 50, 93,123, 30,195,153,148,191, 58, 20, -218,154,117,168,135,106,250,171,164, 96,249, 52,213, 22, 24, 74,136, 32, 58, 77, - 48,223, 76,171,222, 18,215,103,155,182,101, 38, 68,173,121, 83,175,248,128,209, -154, 49,254, 94,229,156, 75, 87,240, 23,113,150,196, 39, 88, 69,150,172,240,133, - 64, 36,215, 59,137,187,104,142,181,235, 84,219,208, 31,207,227,123, 16,226,239, - 57,231, 31,156,121, 22,201,196,138,188, 39,157,186,250, 49,252,121,230,131,110, -147, 76,172,136, 59, 0,128, 69, 50,177, 34,147, 74,163,118, 71,232, 18, 78,142, - 35,199,199,122,228,224,240, 72, 6, 29, 45,234,116, 58,223,121,215,233,192,124, -175,198, 20,154,202,215,163,133, 90,101,211, 68, 76, 27,236, 19,108, 60,246,162, -116, 83,186,219,245,118,183,205,205,168,125, 10, 8,105,189,185, 94,124, 44, 37, -123, 31, 31, 5,187, 87,197,248, 49,173, 63,223, 72, 61, 98, 88, 21,101,105,250, -139,246, 29,186,164, 80, 42, 9,148, 4,127,205,117,137,160, 73,253,255,232,140, -172,128,124, 80,219,139, 33,172,244, 26, 70,143, 52, 8, 2, 35,129, 0, 0, 12, -141,139, 68,114,161, 60,158,231,105, 28,242, 13,243,194, 98, 29,203, 84,216, 22, -205,239,215, 40,190,242,236,137,146,145,211,102,250,228, 69, 49, 9, 72,156, 13, -210, 12, 34, 34, 66,136,124, 34,240,251, 28,219, 21, 37,246, 78, 13, 94,235,155, - 70, 51, 48,165, 94, 82, 88, 87,207,133,242, 43,201,159, 68, 50,152, 31, 26, 62, - 20,217,175, 71,123,206,206,160,218,173,247,115, 94,243,149,167,251,213,163, 90, - 7,241,162, 25,205, 54,124, 8,175,111,245,237,121, 37, 5,234,125,225,177, 43, -113,140,154, 11,130,161,193,187, 17, 63,251,165,184, 50,152,178, 43,136,106,224, - 99, 5,125, 35,199, 78, 16, 65, 60,120, 91,184,208,200, 86, 56,191, 31,223, 80, - 49,104,222,136, 52,123,255,143,159, 79, 2,128, 62, 65,206,166,112,173, 78, 1, - 75, 31, 8, 9, 71,239,148, 72,124, 85,120,156,238, 32,176,171,134,101,188,184, -118, 18,200, 24, 68,232,108,252,132,129, 43,148, 44,127,193,120, 8,109, 40,137, -222, 31,219, 11,230,223, 55,253,166,162,236,216, 11,108,247,209,175, 90,186,108, -109,162,157,166,140, 94,117,148,227, 57,133,227, 18, 50,213,178,219,220,224, 49, - 50,121,242, 32, 98, 93, 60, 37,219, 37,150,130,112,240, 13,196,125, 36,228,207, -243,152, 47,171,115, 21, 64,250, 99, 80, 47,187,161,147,153,159,166,127,250,233, - 51, 23,135,206,227,155,119, 15,192, 70, 48,182,250,232, 4,208,111, 60,197,226, -147, 64, 31, 87, 98,243, 57,118,224, 5, 22,203, 61,157,158,208, 66, 51, 59, 65, - 74, 40, 26,228,206, 27,126, 39,100,101,230,184,171, 91, 27,122, 57,114, 10, 37, - 48,140, 70,133,106, 41,152,172, 39,207,151,193,116,144,170, 64,102,146,166, 86, - 0,156,153,203, 92,194, 8,139,193, 28,157, 92, 55,193,236,229, 36,178,229, 92, -129,242, 23,244,238,192, 90, 52,253, 41,200,238,178, 60, 46,227,184, 67, 4,140, -243,195,203,210, 62, 61,244,220, 53,230, 53,137,218,222,249,123,184,175,252,222, - 52, 58, 98,228,185,230, 57, 93, 21,129, 16, 7,178,166,106,110,236, 66,171, 57, - 31,100,180,167,117,186, 81,167,124,199, 62,211,147,205,128,159,193, 6,233,121, -142, 71, 30,158,146,216, 79, 80,161,179,106,212, 9,142, 45, 17, 63,228,213,118, -174, 54,240,140,162,223, 55, 69,203,247, 1,106,244,128, 28,118, 53,163,124,158, - 93, 30,159,208,189,126,215,156, 34,234,148, 55,250,145,190,217, 3,210,193,128, -140, 10, 33, 49,233, 68,182,185, 61,182, 56,195,213, 86,198, 86,252,201, 41, 13, -228, 94, 31, 55, 76,234, 36, 29,212,101,142, 58, 97,254,169, 4,173,163,110,180, - 6, 62, 39, 10, 15, 92,179,204,254,173,188, 47,198,238, 20, 48, 87,182,232, 27, -166,143, 44,117,149,133,217,233,198, 96,115,211, 61,193,236, 59, 40,126,155,157, -220,213,134,186,242,250, 26,140,229,116,145, 62, 86, 24,172, 79,132, 24, 23,175, -109,243,190,245,229,129,100,255, 61,241,152,130, 76,115,163,229,222,205, 60,153, - 3,188,215,164,121, 5,206, 11, 3,118, 58,178, 85,235, 68,138,224, 93,140,152, - 23,111,131,202, 87,127, 46,172,144, 79,199,238, 96, 49,184,198, 36,126, 24, 18, - 98,124,145,206, 72,148,252,210, 34,177, 97,230, 86,228,219, 95, 69,109,180,114, -193,240,149,211,169,137,239,246,193, 45, 92,252,121,179,153,118,126,164, 61,201, - 93,183, 11,143, 70, 27, 4, 75,142,215,240,250, 17,215, 25, 25, 91,112, 72,219, - 75, 72, 76, 2,190,127,249, 33, 29, 9,176,199, 1, 51, 27,194, 26,136,166, 60, -125,140,177, 36,112, 76, 85, 84, 5,230,169, 71, 6, 6,253,118, 87, 87, 47,168, - 40,172, 1,110, 10,198, 68,150,148,255,168, 7,165,131, 71,243,193,140, 28,118, -191,140, 58,180, 74,171,159,176,160,175, 83, 7,167, 96,101,133, 25,189, 97, 10, - 10, 56,241,203,243, 75,132, 9,207,151,130,231,134,105,228, 98,146, 26, 71, 88, -231,119,127,220,141,205,171, 11,243, 91, 95, 37, 21,167,195,110,181, 36,112,173, -233, 38,198, 30,155,169,159,233,222, 23,178, 54,227, 83,150,172, 99,170,224, 44, - 13, 64,190, 6,220,129, 82, 72, 87,160,171,174, 62,246,149, 9,226, 50,228, 77, -120,186,141, 23,254, 80,193, 50,142, 25,131,130,212, 54,161,164, 88,119, 55,214, - 65,242, 90, 67,165,128,153,144, 53,236,225,121,162, 90, 69,181, 15,124, 60,112, - 67,179, 91,227,247, 62,178,134,124, 20, 17, 65, 92,244,130,120,232, 66,202,201, -194,147, 20,186,242, 77,136,204,107,223,253,204,228,195,206,173,199,152, 66,145, - 33,124,225, 74, 1,161, 57,160,184,215, 71, 85, 54,190, 2, 96, 55,145, 77,121, -136,125, 1,210,101, 78, 41, 4,135,156,121, 58, 89,128,166, 18, 77,179,178,155, -191,176, 5, 83, 92,147,184, 3, 93,221,222,230,172,199, 80,252, 34,136,211,171, - 19,118, 62,184, 46,114,175,253, 98, 84, 53,148,227, 21,167,134, 4,119,111,100, -184,249,149,254,101,210, 81,223, 0, 66,114, 34,246,224, 8, 58, 73,211,229,174, - 73,177, 39,216,217,178,111,140, 36, 44,103, 74,110,105, 12, 6,250,212,154, 37, -214, 59,113, 59, 64,238,189, 34,156, 2, 21, 67,244, 18,198, 16, 24,232, 44,154, -163, 86, 84,225,234,159,206,237,156,110, 87,188,123, 73, 71,148,225,190,116, 4, - 84, 31,174,223, 97,127, 82, 50,241,153,226,195,151,203,136,210,203,150, 52,216, - 7,193,151, 15,208,251, 50, 99, 11, 50,205,198,136, 51,216, 13, 83, 61,224,185, - 0,219,226,122,248, 40,132, 32,127,152,128, 82,140,135,178, 16,121,146, 23,180, - 73, 92, 42,108,221,228, 82,139, 87, 69, 98,199,201,145, 30,182,172,172, 94,104, -211,171,188,248,167,207,101, 26, 79, 91,224,247,223,123,134,225, 64,121, 18,184, -156,199,143,107,124,103, 92,237,162, 57,245,119, 38, 51, 89,204,244,255,125, 2, -195, 38,139,188, 41,241,186,224,129,144,237, 32,185,200,161,128,106,141,224,107, - 30, 23,195,167, 29,192,113, 65, 70, 65, 97,103,165,183,255,114,144,204,215, 93, -212,233,113, 93, 17,186, 32, 32,214,141, 84, 12, 76, 9, 48, 68, 47, 57,186, 19, -199,124,185,103,182,109, 53,212,212, 92, 93,233, 15,241,107,150, 50,121, 40,176, - 18,162,201, 76,242,233,214,155, 84, 8,167,164, 21, 41, 26, 68, 46,150,226,233, -199,222,163,110, 54, 11,193,195, 44, 55, 85,190, 89, 47, 15,101, 99, 83,213, 75, - 64,255,234, 1, 15, 65,190,238,133, 25,208,183, 64, 12,235,124,235,171,217,123, - 60,125, 99,161,151,239, 23,213, 27, 36,228,205, 6,140, 4, 65, 9,221,174,176, - 92, 42,175, 1,160, 64,167,180,191, 29, 72,143, 60,151,233,102,245, 45, 10, 27, -237,202,187, 8,208, 47,102,119, 48,118, 13,184, 14,249, 44,101,181,157, 16,144, -178,139, 47, 82,246,142,210,228,155,196, 85,239,124, 10, 23,132,167,195,248,171, - 60,196,129,192, 25,114,255,207,229, 82, 4,137, 37, 31, 63,136,183, 16,181,233, -170,232,143,111,153,114,119,198,141,182,185,202,106,199, 92, 87, 16,112, 38, 69, -137,162,193, 40,228, 21, 22,242, 7,224,140,143, 28,150,201,221,168,131, 6, 67, -177,192, 73, 92, 74,169,212, 45,207,199, 11, 11,246, 15,239,163, 46, 73, 70, 6, -219,131,150,214,105, 84,157, 39,240, 1, 9,191,112,229,183,110,151,141,114,136, - 79,190,242,101,233,101,142,171, 31, 27,157,250,225, 67,247,116,212, 84,147, 11, - 36, 58,182, 39,141,132,150, 25,255,171,120, 78, 61, 4,188,157,208,217, 95,142, -122,121,228,192, 93,153,117,227,128,213,113,240,241, 53,253, 70, 89,138,108,172, - 3,223,117,134, 53,181,131, 56,130, 23, 89, 23, 66, 64, 76,220, 27, 13, 40, 58, - 96,215,196,215,217, 26,211, 82,116, 17,219, 29,145, 35,152, 45,130,222,249,147, - 10,245,201, 46,153,179,129,252, 64, 37,214,225,133, 57,218, 70,196,229, 25, 30, - 59,245, 4, 97,236,191,107, 86, 66, 33, 57,225, 97,133, 43,255,252,102, 59,216, -232,249, 31, 8, 66,166,254, 56, 65,207, 3,134,176,144,131,137, 64, 26,140, 1, -197,186, 67,200, 97, 56, 75, 57,179, 47,109,117, 1,171,112,246,146, 70, 28, 74, -130,224,232, 73, 99,110,208,161,237,108,213,137,141,216,143,190,102,133,245,135, -208, 33,227, 86,165, 60,107,219,242,153,241,208,146, 64, 32, 58,180,140, 11,229, - 2, 60,119,218,166, 84, 33,143,222,121, 39,187,219,149,200,239, 41, 1,200,246, - 53,202, 68,176,244,185,225,224, 1,105, 87,157,253,208,140, 23,247,160,241, 15, - 84, 35,165, 79,149,119,253, 90,113, 96, 70, 54,133,128,204, 38,165, 57,174,191, -246,126,129,131,136,110,185, 68,218,207, 54, 71,216,169, 70,225,254,100,248,105, -177, 18, 51,250,144, 88,144,138,144,113, 27,243,191, 50,153, 99,247, 20,194, 9, -127,117,206, 17, 46,110,170,127, 35, 79,106,141, 31, 30,125,144, 79,159,145,157, -236, 43, 30,207,133, 61, 20, 93,137,106, 74,219, 19,233,168, 13,206, 27,123,163, -165,186, 61, 80, 65,232,227,156,200, 20, 95,156,235, 79,132, 22,252, 18,190, 26, -110,142, 37, 41,211,248,208,217, 73,133, 65,123, 66, 79,113,149,105, 90, 73, 17, -227,165,165,160,215, 17, 32, 17, 90, 7, 17,100, 50,148,255,112, 20,151,213,112, - 97,182, 13, 45,212,216,189,251,195, 81, 36,239, 80, 2,178,189,160,224, 54,202, - 95,141, 88, 64, 8, 73,155,115,175,245,146, 29, 66,122, 99, 82,208,235,202,205, -151, 89, 73,253, 81,126,121,189, 71, 10,244,104,118, 99,226, 47,152,155, 13,191, - 49, 86,147, 75, 50,143, 57,231,118, 14, 57,197, 5,125, 76,192,234,221,124,113, -124,112,171, 17,177,154, 54,228,231, 52,126,171, 47,121,252,152,202,230,123,199, -162, 88, 58,212, 50, 58,227, 51,158, 86, 57,104,150,120, 14, 87,241, 66,166, 79, -118,255,198,174, 97, 99,180,105,114,188,156,175,199,115, 29,195,117, 99,147, 94, -110,138, 31, 62,234,162,101,100, 99, 2,228,158, 16, 68, 55,225, 76,160,219,152, - 94,223,215,187,144,250,211,168, 0, 69, 68, 71,193, 7,229, 2, 13,206,197,113, -237, 37,216,134,197, 18, 4, 3,104,231, 71,218,188, 82, 78, 85, 52,127,157,119, -191, 3,201, 36, 58,111,113,187,240,168,138, 59,123,200,157, 3, 13, 48,134, 42, - 57, 2,195,130,211,247, 54, 91,174, 10, 33,183,177,210,213,102,105, 29, 4,147, -127,171,181,250, 19,178,253,232,179,212, 51,176,201,179,188, 10, 64,253,214, 95, - 46,235,205, 6, 83, 23, 54,241, 24, 75, 58,178, 50,145,118, 5,230,105,171, 47, -176,188,133,113,106,171,194,160, 89,208,154, 73, 97,167,246, 77,245,111, 91,138, - 41,213, 6, 77,102,216,243,134,218,161,169,218,192,201,128, 43, 96,131,226,122, - 31, 58,102, 54, 68,105,179, 54, 74, 56,105,214,124, 79,128, 36, 4, 22, 19, 71, - 88,190, 35,158, 42,129,155, 82,180, 94, 56, 23, 39, 71,228,108,116,170, 17, 4, - 50,236,112,205, 54,211, 89,198,139, 84,140,137, 81, 70, 46, 98,223, 80,146, 84, - 97,191, 70, 63, 61,205, 46, 55, 80,131, 47, 71,139,151, 11, 34, 64,195, 40,159, -155,240, 4, 31,149,120,158,228, 3, 11,129,159,194,239, 5,174,239,188,133, 41, -182, 27, 65,191,122, 60, 62, 37, 67, 82,169,113, 98, 48,176,195,108,234,111, 20, -215,225,211, 3, 84, 41,240, 79, 74, 47,118,154,210,193, 13,226,202,185, 48,109, -166,170,222,224, 35, 3, 35,118, 18,176,130, 44, 50,214,167,168,195,116, 95,211, - 18,196,153,231,114,246,116,217,119,197, 93, 16, 78, 49, 99, 82, 76,120, 82,128, -133,207, 58, 40, 23, 53,217,183,195,110,141,179, 22,203,131, 57, 43, 24, 35,218, -124,237, 45, 62,180, 1, 26, 39, 54,187, 96,223,235,118, 59, 9, 14,121,133,137, - 20, 70,215,240,136,214,234,157,238,189, 64,190, 17,114, 76,142,242,227,134,253, -253,237,186, 29,165, 8,122,118, 34,226, 79,136, 17,132,105,103,185,146, 22, 52, -216, 85,181, 47,160,249,115,150, 52,119, 15, 85,165, 23,190,155,237, 86,123,230, - 13, 64,107, 96,138,121, 69,192,118,162, 72, 88, 21,143,206,231, 81, 13,202,144, -140, 40,187,136, 66,131,143,250, 5,119, 14, 88, 7, 79,120, 78,157,250,187, 15, -221,184,187, 29,218,167, 1, 46, 56, 81, 68, 66,100,185, 78, 79, 2,163, 36, 13, -132,195,157, 94,226,128,236,172, 73,164,178, 85,166, 43,157, 57,228, 98,104,226, -154,199,112,110, 33,228,124,174,152,170, 75,231, 10, 61, 20, 34,155, 61,164, 25, -180,245,138,118,157, 51,244, 20, 68, 7, 94,145, 10, 24,237,208,106,135,211, 50, - 32,171, 46, 5, 8,106, 98, 69, 49,144,171,227,158,186,226, 45,234,109, 56, 6, -225, 76, 82,136,188,209, 0,161,213, 58,149,173, 88,138, 47, 64, 80, 99, 16, 32, - 49,252, 0, 27, 26,179,194, 54,181, 95, 64,208,124,117,253,122,185,250, 30,220, - 68,119, 1,219,165,179, 3,173, 1, 63, 42, 62, 69,254, 59,247,160,184,149, 74, -193,113, 11,132,135, 18,138, 65,197,134, 66,222,168,123,119,251, 4,198, 13, 31, -227,216,114, 67,235,126,119,255,128,199, 0,153,227,214,210,173,112,118,128,198, -174,186,248, 48,196, 61, 74,149,237, 5,125, 51,241, 36,101,125, 60,209,114, 2, - 40,243,157,138,112, 1,221,227, 85,240, 91, 91,201, 45,202, 55, 92, 64, 26, 54, -185, 78, 0, 17,190,198, 40,168, 56,235, 22, 29,221, 99, 86,250, 86, 4,161, 6, - 4,249,213, 63, 59, 65,112, 17, 28,143,102, 65,215, 2,180,196,154, 90,250,159, -209, 12,128,196,170,125,107,154,148, 1, 86,240, 30,243, 31, 46,173,113,231,124, -235, 86,155, 23,248,170, 55, 10, 57, 38, 61, 68,234,117,126, 76, 4, 62,100,187, -160, 8,209, 88,238, 51,156, 8, 60,210, 26,206, 44,166,211,213,100,108,115,225, -138,247, 30, 9, 12,129,139, 2,193,137, 47,253,189,118, 31,242,147,159,120,172, - 24,131, 30,152,142,204,181,247,109, 12, 77,110,124, 29,181, 34, 47,108, 34,200, -148,230,164,148, 1, 85,231,110, 26, 93,244, 58, 66, 15,254,211,193,109,129,215, -167, 33,115,154, 12, 81, 98,180,235,133,226, 72, 77, 18, 2,143, 74, 2, 11,143, - 40, 23,170,253,181,195, 4, 35,205, 55,134,141,197,198,172, 25, 32, 22, 92,250, -240,166, 42, 83,237,142, 48, 50,140, 86,253, 41, 62,196, 91, 61, 32,134,254,229, -220,242, 99, 14, 64,170,119,130, 2,196,102,251,123, 84, 39,199, 99,173, 71,160, -255,127,254, 87,135,174, 78, 20, 16, 53,208,213,164,227,142,186, 67, 49,110,195, -107,128,133,248,226, 25,153,219,195,194,173, 81, 19,184,113, 55,186, 41, 70, 3, -157,115,166,181,224,170,217,255, 68,175,127,162, 92, 97,189,166, 32,157,255,134, - 87, 75, 40,123, 26,118, 59, 46,166, 65,125, 52, 99, 35,225,114, 92,162, 50, 45, -105,158, 21,115,120,115, 11, 45,102,204,152, 49, 30,165,211,217,120, 25,172,109, -227,207,137, 79, 88, 22, 80, 99, 26,174,107, 51, 79,238, 0,218,189,198, 96,143, -132, 33,197, 5, 71,146, 29,148,214, 11,146, 78,148,100, 79,199,107,215,228,211, - 52,199,231, 51, 39,117,182,235,181, 77, 17, 95, 5,186,204,180,126,106,231,204, - 38, 90,108, 17,193,215, 3,157,175, 50,182,194,150,147, 42, 27,235, 84,116,192, -134,144, 7, 39,199, 64,251, 69, 50, 35, 2,100, 63,151, 71, 59, 44, 98, 51,229, - 96,109,220,225, 58, 4, 86, 68,232,105,123,155, 66, 22,174, 6,164, 89, 57,225, - 82,220,207, 8, 74, 85, 20, 73, 3,254, 37, 83,248,128,203,119,103, 11,218,190, - 81, 75, 56, 56, 53,204, 74,142,166,113, 18,100, 82,190, 58,135,216,245, 39, 71, - 54, 43, 65,132, 94,100,152, 46,124,108,198,250,227,239, 32,104, 98,223, 54, 59, - 4, 57, 16,146,100,129,236, 98, 89,212,165,193, 41,136,139,145, 61,115, 52, 71, -134,250,147, 83, 19,139,134,139,147, 79, 99,247,113,116,110,160,122, 80,178, 32, - 57, 31, 16,184,136,229,254,254,113,125,253, 89, 44, 44, 76, 20,155,210, 26,182, -218,239, 82,163, 7,132,187, 68,121, 38, 81, 55, 30,111,208, 99,213, 96,148,164, -143,129, 29,196,120, 60,118,119,120,207,219,227,235, 60,142,254, 78,233,139,168, -137, 65,197, 11, 86, 53,128, 21,165, 6,130, 34,160, 32, 2, 97, 44,228,158,113, -120,158, 62,175,145,141, 47,185,118,187,216, 74,209,114, 97, 89, 19, 94, 62,105, -163,231,212,176,138, 34,170,180,202,210,136,200,193,193, 22, 90, 30, 3, 10,179, -243, 73,102,174, 24,187, 29, 90,120, 0,173,213, 93,124,184,139, 97,210,195, 25, - 70, 28, 70,162, 67, 18,125,172, 72, 52, 15,155, 47,170,228,156, 47, 61, 12,172, -254, 37,203,117,164, 86,125, 78, 39,110,170,252,182, 0,244,210, 9, 4, 94, 75, -233, 27, 50,240, 26,108, 7,208,101, 84,221, 15,193,222, 7, 85,203,171,134,133, - 89,218, 85,128, 25,129,181, 98, 99, 14, 50, 72,106,191,163, 70, 0, 94, 25,153, - 30, 19,250, 92, 35, 71, 2, 23, 1,231, 32,190, 45, 47, 76, 73,166, 75,176,239, - 35, 81,201, 63,166, 43, 51, 60,205, 35,133,227, 32,145,216,163,203,159, 93, 53, -118,237, 69,102, 80,160, 6, 53,179,119,125,173,200,156, 48,167,142,122,192,222, -254, 43, 78,233,144,119,191,200,128,129, 53, 74,182,222, 71, 72,193,131,246, 94, -165, 46, 31,142,115,125, 1, 81,171, 70,254,245, 94, 48, 82, 70,244, 90,131, 99, -246,117,117, 52,128, 78, 64,164,219, 20, 27, 11, 69,232, 13,156,108, 73,114,237, -131,170, 54,219,147,183, 2,253, 54, 59,178, 9, 61, 1, 76, 57, 66,229, 8, 22, - 22, 57, 67,220, 41,108,141, 51, 47, 83, 22, 43,101,159, 21,127,192, 56, 37,232, -169,225,210, 84,136,166, 74,112,122, 53,202,247, 30, 51,218,230,199,244,160,102, - 80,206,112, 37, 74,239,203,161,152, 56, 37,254, 71,121,255,227, 80,108, 23,228, - 45, 24, 8, 67, 10,106,221,168, 62,168,203, 45, 11,210,172,101,189,251,216, 57, - 21, 36, 10, 57, 5, 84, 43,207, 35, 31, 21, 82, 4,186,104, 17,140,164,109, 7, - 71, 51, 21, 58,182,171, 57,108,224, 15, 26,190,118,162,196,156, 99,225, 94,177, - 91,170,172,141,140, 5,186,157,190,108,219, 33, 78, 80,137, 5, 50, 68,199, 98, -239,174,129, 65,169,143,245,214,168, 82,238,247,149,135, 51, 72,144,161,133,255, -142,127,192,195,234,120,152, 44,135,114,105,141,242, 73, 51, 87,199,183,182,152, - 64, 52, 9, 65,120, 99,254, 99,218,118,194,177,248, 70,149, 55, 53,228,103, 82, -198,168,119,201,105, 13,207, 96, 4,161,161, 43,122,234, 72, 4,220, 22,196, 9, -189,199,165,224,111, 9, 70,198,115,147, 59,176,231, 20,229,167,159, 71,160, 7, -133,240,148,205, 5, 77,249,199, 95, 12,226,236, 23,243,149,192,109,115, 82, 89, -219, 25,128, 8, 41,233,145,237,157,186,134,240,171, 18,126, 40, 41,131,117,236, - 9,105, 72, 39,182,117,147,204, 24, 60, 66,104,160, 4,249, 63,220, 28, 35,143, - 54, 71, 18, 29,232, 9, 56, 57,110, 33, 48, 95,161,242, 24, 10,236, 85,248, 0, - 90,250,155, 66,140,189, 8,106,200, 27,148,223, 93,214, 58, 44,185,118,186,153, - 32, 97, 57, 45,228,224, 76,203,243,109,135,168,202, 97, 9, 40,138,182,219,152, - 13,189,130,101, 21,171, 42,116, 78,174, 64,165,125,101,146,196,132,111,202,231, -248,115, 80, 83,247, 36, 69,229, 54, 16,117,149,156,226, 70, 53,161,129,166,104, -243,139, 81, 22,179,118,103,227, 60,140,203, 31, 84,151, 23, 37,107,140, 56,171, -151,133,109,116, 96, 75, 95,213,255,188, 32,122, 93, 81, 52,113,173, 75,218,162, -110,105, 57,205, 85, 22,214,102,207,124, 29, 16, 73, 37,174, 96,142, 39,116, 90, - 7,155, 10,155,192,237, 82,200,162,182,255,209, 73, 89, 60, 49, 75, 19,164,203, -228, 72, 4, 4,163,105, 4, 21,193,197,148,239, 50, 24,197,111, 5, 73,233,217, -221, 81,191,137, 44,217, 54, 80, 15,236, 25,248,187,227, 85, 63,168, 22, 35,160, -168,159, 38, 16, 14,175, 24, 1, 2,255,140, 62, 22, 12, 62, 8, 78,140,122,170, - 42,196,113,164,126, 74,239,238,228,245, 81,162, 33, 6,193,153,139,103,148, 80, - 71, 21, 63, 13, 72,101,222,125, 86,233, 78,202, 49, 15,140,126,150,246, 13,160, - 1, 69, 21,173, 42,213,120, 50, 63,242, 88, 28, 47,117, 53,194,212,135,106,114, - 17, 6, 29, 47, 91,204,191,185, 88,211, 44, 99, 38, 69, 82, 39, 41, 91,207,143, - 86,106, 8, 20,234,158,202, 43, 71,155,235,206,175, 99, 91, 34,197,135,152, 15, - 49,203, 85,217,242,119, 95,114,116,193, 32,178, 54, 88,231, 71,238,142, 29,149, -203,192, 36, 4,235, 7, 50, 24, 17,241,124,151,157, 51, 71,234,194,212,199,227, - 5,188,184, 88, 26, 83, 52,162,201, 58,147,177, 53,206,128,169,109, 29,194, 14, -100,129,164, 37, 57, 49,229, 54,111, 4, 33,165, 95,122,218, 20,196,155,153, 59, - 48,230,254,243, 58,128,198, 83, 64,253, 26,165, 37, 57,253,103, 65, 85,161, 21, -243, 23,227,207,120, 47,210, 30, 45,195,131, 58, 9, 98,111,152, 5,189,204,107, - 93,107,138,223,238, 87,203, 2,132, 7,223,103,115, 59,107,127,149, 98, 46, 28, - 81, 26, 78, 93,240,197,241, 94,225, 70,130, 29,195,139, 70,171, 84,117,180, 86, - 84,166,207, 27,104,121,171,105,118,197,238, 35, 71, 7, 43,134, 4, 45,158,245, -194,209, 0,149, 5,159, 68,249, 38, 36,184,253, 51, 98, 8, 34,213,193,119,112, - 54, 65,125,159, 57,164,249, 98, 2,247,247,145,142,230, 76, 64, 50,214,224,225, -185, 55,176,183,184, 46,169, 1,106,214, 2,203, 52,165, 39, 50, 57,191,129,213, - 16,222,249, 44,197, 1, 62, 14, 8,150,158, 45, 98, 90, 47,144,201, 33, 1, 3, -128, 30, 20,167, 56,204, 75,119, 36,196,159, 70,198,162, 28,228,207,248, 2,101, -163,215, 67, 19, 24, 82,211,165,213,181, 44,216, 27,171,220,164, 42, 23,103,191, -188,107,212, 16,217, 94, 71,149,237,175, 16,229,110,205,129, 0,232,140, 40, 53, -110,178,205,219,216,160, 8, 20, 37,116,149,164,134, 72,120,146,211,123,113, 55, -110, 33,153,147,207, 83, 10, 72,181,224,145,125, 27,113, 10,229, 91, 59,216,102, -246, 13, 66,235, 96,204,238, 25,218, 85,112, 61,108,187, 14,236,246, 94,182, 31, - 22,162, 77, 90,155,202, 96, 77,254,224, 15,159,190, 71,200,206, 92, 78,209,213, -240,234, 86,108,140,114,187, 45, 41,153,115,245,230, 81, 65, 17,163, 97,202,136, -195,109,108,244, 25, 15,254,142,136,237,207,109,138,182, 37,112, 30,191,214,246, -187,227,111,216,253,134,162,235, 34,197, 3,155, 41,115,185,136,151,217, 46,130, -182,140, 90,177,112, 95,235,171,188,169,141,202,120, 95,231,222, 18,205, 75, 67, - 82, 40, 13, 30, 7,107,122,150,165,189, 35, 93, 42, 1,232,238, 98,183,240, 51, -133, 23,123, 68,165,109,156,241,217,228,250, 53, 93,197, 52,254,198,163,177, 26, - 77,248, 45,206,227,153,182, 41, 37, 78,119, 69,187, 76, 4,115,206, 96, 69, 76, -179, 2, 38,100,139,213, 19, 39,238,111, 85,161,238, 50,105,131,189, 25, 21,122, -227,146,211, 69, 30, 85,252, 8,141,235, 29,145,155, 36,115, 60,251, 4, 10,169, - 31, 23,114, 18,241, 99,184, 3,108,190, 23, 75, 67,238,193,127, 67, 81,189,111, -117,146, 79, 29,179,105,105,121,255,101, 68,232,248, 85,137, 24, 97,236, 47,146, -242,210, 65,242,135,155, 7, 46,159,169, 25, 21, 87,199,172,121, 84, 46,146,241, - 63, 44,174,186, 2, 72, 70,188, 75,150,213, 48, 52,100,232,131, 49,143, 58,149, -149,128,214, 22,110, 7, 24,231,218, 0,219,123, 49, 19, 32, 39,151,252,167,209, - 57,129,130,199, 16,101, 13,238,164, 77, 98,226,230,222, 83, 97, 47, 97,186,124, -199, 65,203, 90, 32,193,251,195,240, 98,224,229,126,231,229, 0,102,124,194,163, - 22, 3,120,251,185,114,112,243,127,142, 20, 93,251,179,113, 89,112, 61,111,151, -253, 73,128,223,162, 68, 35, 23,187,109, 58, 84,108, 11,167, 98,252,187, 29, 58, -220,243,244, 26, 31, 67,139,249, 49, 37, 53,107, 66, 48,254, 64,193, 71,246,178, -178, 7, 98,111, 22, 70, 65, 23, 32, 3,156,218, 42,225, 35, 68, 93,107,226, 34, - 61, 12,133,232,170,181,201, 37,252,141,184,243, 2, 3,175, 69, 64,234,207, 64, -228, 76,232, 89,253, 75, 54,113,224,230,183,185,199, 0, 92,218,153,132,245, 0, - 23,163,167,105,180,106, 6, 58,198, 21,117,255, 71, 13, 26, 81,249, 56, 26, 31, -177, 46,107,127, 95, 61, 42, 90, 80, 58,214, 95,158,140, 20,190,190, 81, 71, 85, -232,109, 11,129, 43, 50, 11,101,152, 78,247, 20, 56,103, 70,254,103, 45, 52,210, -177, 59,207,241, 37,151,135,229,114,128,117,206, 50,116,129, 73, 44,119,161,125, -195,196,222,144, 38,111,238,156, 81,139,108, 21,155,102,225, 11,252,195, 96,135, - 46,143,206,223, 94,194,204,236,197,100, 95,189, 53, 59,208, 26,122, 46,136, 17, -230, 55,104,230,162,115,232, 77, 62, 8,247, 14,189, 5,205, 48,169, 66,186, 43, - 40,202, 76,230, 89,252,134,169,216,223, 78, 25,212,167, 88,215,176,171,139,106, -195, 66, 61,145, 61, 88, 38, 48,157, 34,203,197,162,109,227,180,236, 1,114,153, -217, 33,135, 90, 98, 28, 57,155, 90,235,220,172,216, 3, 76,190, 7, 24, 66,202, - 77,212, 31,179,215, 40,247,128, 18, 22,200,112,231, 67,242,139, 95,134,140,239, -226, 22,131,183,201,161,143, 39, 99,160,178,108,104,129,137, 40, 61, 10,247,118, -144, 45, 0, 63,119, 29,147,151, 32, 88,158,213, 12,232,166,199, 94, 52, 50, 55, -162,142,243, 53,209,144, 47,149,155,107, 92,179,153,209,253,101,239,151,236,210, - 10,118, 90, 20,242,229, 10, 30,235,127,160, 69,211,243,101,185,175,248,230, 12, -239, 21, 92,101,206, 25,214,180, 40, 44, 65,239, 50,161, 22,148,240, 35,120,184, - 77, 4, 62,202, 61,125,235,251, 58, 50,169, 33, 43, 72,229, 82, 40, 49,179,170, - 6, 47, 14,117,220,188, 80, 28,110, 62,134, 35, 30, 7,200,209, 70, 40,150,117, - 85, 44,219, 99, 77,224, 96,216, 43, 57,132,146,114,163, 71, 74, 65, 45, 52,151, -111, 56, 77, 6, 49, 66,144, 37,200, 16,228,208, 15, 61,122,110,158, 21,163, 60, -238,167,249,195, 11, 12,225, 61, 55,138,111, 2,106,116, 85, 25,170,189, 89,177, -139, 63, 76, 59,160, 48, 42,198, 80, 82,106, 75,198,104,228,144, 22, 39, 77,163, - 3,218,240,216,112, 76,153,114, 19, 37,152, 65, 96, 78,108,234,248, 8, 87,239, -176,169, 11,249,157,161,137,215,217, 37,112, 26,234,207,188,175, 22,134,113,210, -189,206,236,143,225,224, 39, 41,200,128, 95, 90, 71,166,131, 65,142, 15, 45,158, -188, 92,243,169,229,133, 88,118,198,254,165,103,249, 78,180,139, 99, 8, 50, 56, - 71,129, 94, 67, 73, 37,229, 77,185,240, 77,130,165,243, 15, 11,141,202, 76,216, - 96,250,130, 48,156,186,178, 66, 81,177, 69,168, 45,247,101, 1, 93,147,103,147, -232,227, 48, 38, 27,123, 60,145, 21,234,227, 28,245,158,164, 6, 52,175,122,193, - 14,222, 11,147, 36,239,236,138, 66, 51,134,152, 61,162, 29,172,129,238, 89, 65, -209,118,204, 9, 19,207, 64, 76, 63,144, 76, 83, 96,197,189,229, 15,183, 91,254, -215,255, 68, 16, 89,177, 3,255, 34, 89,192, 1,181,218,114, 16, 72,160,246,149, -191,243,124,241,130,202,108,152, 56, 44,108,127,211,218,173,221,250, 63, 10, 99, -202, 10,212,223,186, 92, 86, 18,176,162,226, 44,179, 34,173,175, 12, 5,135,176, -107,219, 19, 84, 88, 29,140,189, 37,142, 86, 44, 38, 17,215,243,152, 74, 65,195, - 45, 51,188,129, 42,115,149, 25,101, 54,236,133, 93,230, 76, 64,208,217,238,124, - 36,174, 93,164,218,218,120,120, 85,162,169,118, 42, 2, 89,121, 60,201,183,201, - 81, 65,224, 71,147,165,199,145, 13,159, 92,132, 63, 46, 19,225, 79,225,239,174, -209,205,109, 40,147,147,165, 63,171,244,230, 52,130,205, 14,180, 9, 2,145,121, -158,253, 4, 97,212, 23, 25,174,188,167,234,172,182,141,150, 86,108, 17, 51,181, -220, 88,117,180,158,204,114, 85,249, 24, 99, 21,128,245, 29, 58, 42, 16,108,234, -246,213,226, 94, 28, 10, 40, 87, 37,113,219,166,184,254,246, 13,179, 92,207,251, -206, 38, 56, 40,163,213,225,143,199, 82, 2, 62, 80,109, 86, 32,153,234, 90,240, - 24, 92, 51, 26, 95,189,127, 70, 14, 55,205,215,219,152,160,129,112,110, 24, 68, - 44, 4, 13, 16, 76,221,215,130,126, 60, 4, 4, 7, 58,171,179,143, 12,166, 23, -111,197,244,232,167, 49,116,189,113, 54, 85,113,129,231, 13, 23, 18,157,181,215, -133, 80,146,196, 51,208,103,189,157,225, 92,220, 6, 10,149, 6,192,183,250,204, -164,229, 59,108,206,226, 32, 50,133,212,128,161, 98,160, 3,150,175,235,173,217, -177, 94,203,240,236,236, 49,155,237,176, 7,208,214, 78, 83, 8, 52,183, 74, 32, -129,103,235,106, 96, 82,104, 47,100, 49,138, 72, 24,198,198, 87, 32,147,219,152, -116, 75,219,224, 7,131,190,177,216, 81,216,180, 48, 82,169, 66, 23, 76, 12,124, - 34,221,203,244, 2,228,203,244, 21,226,194,252,252, 10,177,159, 6,241,191, 71, -199,203, 4, 68,134, 0, 32, 37,104,132, 63, 45,172,228,192,205,214,184,160, 31, -169, 58, 18,243,254,193, 24, 67,129,132, 4,227,189,139,180,148, 63, 96,112,200, -112,202, 97, 94,104, 59, 46,250,242, 48,250,185,160,139, 69,211, 80,183,240,217, -111,106, 93, 76,213, 50, 50,124, 24,165, 85, 96,232,131, 38, 17,101,163,236,128, -213,237,118,167,228,242,231, 61, 5, 0, 93, 7,253,218,110,199,224,104, 41,233, - 59,130,123,180,161,132,231, 53,122, 95,189, 48,208,240,177, 43,107, 6,203,142, - 65,239,233,192, 47, 43,171,245,252,231,111, 72, 87, 71,149,198,211, 53, 60, 22, -124,224,120,175, 54,143, 76,153, 89, 78, 21,149, 11, 18, 63,224, 92,142,116,169, -101,177,103, 6, 86,208,248, 95,254, 44, 7, 51, 48, 21,130,182,160, 31, 75, 66, -164,221,252, 14,189,101, 80, 66,248, 34,126,222,134,195,181,146,103,188,177, 24, -206, 8, 15,211,124,250, 24, 33, 39,113,182, 4, 86,198,138, 25, 25,115,217,181, - 23,153,171,164,111,182,194,124,255, 16,125, 57, 10, 46,189, 16,191,125,128,107, - 86,136,123,175, 80,182,229,172,201,174,130, 51, 77,191, 86,224, 87, 39, 40,177, -183,245,225, 45, 70, 65, 87,111,123,104,169,185,115, 18, 14,226,210,145, 91, 24, - 72, 81, 29,169,108, 72,207,114,226,167,195,104,224, 94,128,163,222,138,147, 50, - 11,247, 36, 28, 94,103,158,230, 75,122, 94,144,190, 0,163,145, 96, 51, 10, 90, - 95, 98, 0,227,150, 71,103,174,209,188, 1,125,172, 29,146,234,207, 25,100,156, -146,215,154, 86, 5,149,217, 74,222,139, 16,119, 45, 13, 1, 91,185,129,106,140, -172,249,186,208,101, 49, 54, 66,252, 59,166, 73, 59,252,140,220, 87, 3,246,121, -223, 73,251,189,130,221,102,175, 52,165,153,111,211, 22, 77, 97,161,174, 70,105, - 20,109,205, 2,248,137,187,104, 94, 4,241, 26,233,221,247,228,197, 68, 69,197, - 88,181, 38,236,179,183, 36,207,195, 22, 58, 48,185, 33,215,238, 4, 11, 56,175, - 7, 36,169,174,161,117,120,144, 12,205,124,116,227,227, 28, 8, 22,153, 8,109, - 16, 25,246,161, 39,232,218, 50, 34,102,212,206, 30,180,157,215,130, 26, 8,195, -108, 30, 70,248,158, 72,230, 85, 45,181,245,181,198,194,140,169,128, 65,254,141, -246, 11, 22,106,125,192,137,206,192,239,185, 56,148,105,123,141,129,249, 58,236, - 10,169, 5, 13,152, 80, 1, 15,212, 60,118, 8,211,155,211, 86, 22, 27,174,144, - 73,231,232,139,124,199,107, 0, 16, 9,178, 82, 80,170, 50,226,246, 24, 12,167, - 81, 41, 82, 23,242,214,216,198, 31,124,189,206, 83,146,200, 59,116,239, 85, 84, - 70,218, 8, 11, 17,114,205, 19, 23, 42, 41,198,138, 57,241, 99, 75,240,198,245, - 51,221,132,214,129,184,199, 50, 14,149, 2,215, 83, 89, 77, 2,222, 27,112, 93, -174, 23,220, 38,198,179, 48, 87, 46,146,188,211, 56, 48, 79, 12, 83, 32,172,154, -102,234,144,132, 97, 98, 12,221,244,133, 45,139, 3, 86,100, 4,158,175, 2, 23, -175,191,134,215,219, 2,157,222, 9, 19,235,150,212, 9, 6,105,240,106,170,175, - 5,211, 53, 6, +uint8_t GB_JITpackage_0 [56523] = { + 40,181, 47,253,160,169,243, 8, 0, 44,209, 0,154,186,164, 33, 45,160,142, 89, + 55,186,140,104,187,208, 76,190,242,248, 41,106,148,203, 60, 45,209, 69,224,238, +215,166,119,115,157,106,230, 22,219,144,128,117, 90,111,120, 29, 94, 7,167,195, +168, 25,234, 1, 30, 2, 31, 2, 94,187,198,116, 59,189,185,106, 41,219,202,158, +133,183,116, 43,251,211,172,252,216,206,183,211, 29,148,206,143,164,150,101,236, +251,146,126,182,251, 79,195, 74,182,148,110,249,195, 28,121,106, 57, 94,232, 27, +220,222,159, 93,131,244,200,117,134,206, 91,163,199,143,179, 60, 54,213,238,132, +127,181,150,192,177, 92, 39,196,165,243,225,219,139,149,107,123, 38,247,255,111, +159,110, 83,235, 14,198, 23,134,122,239,173,107,209,187, 87, 38, 1,101,240,253, +184,113,100, 11,181,217,117,220,122, 33,106, 59, 16,205,225, 26, 53,110,255,110, +236,141,181,233, 93, 59, 35,131, 64, 42,190, 48, 11,117,227,115,136, 86,203,237, +221,105,254, 91,211, 34, 55,135,175,173,124,255,243, 66,247,227, 48,108,202,153, + 63, 61, 28,162, 52,106,179,118, 90, 95,254,175,187, 63, 39,167, 43,103,146, 12, + 6,117,119,126,248,155,114, 98,213,234,183,241,167, 55,166,152,167,150, 31,213, +234, 12,192, 86,243,254,175,206,120,171,213,184,233,220,248,103,167,153, 94,243, +186,187, 53,114, 77,187, 90,150,253,145,195,239,117,119,186,229,234,188,177, 93, +227, 14,183,159,246,162,111,220,158,249,223,222,161,223,230,253,177, 29, 57, 61, +214,185,251,221,218, 52,122,230, 55,161,185, 61,106, 19,126,107, 33,173,182, 22, + 37,200,104, 47,203,158,180,211,137, 92,187,107,192, 60,125,119, 66,183, 70,126, +183,161,219,211,163,135,101,223,233, 77, 90, 63,190,111, 61, 26,185, 58,255, 99, +248, 92,157, 62,189,142,206,105,142, 70,217,178,246, 5, 53,215, 24,189, 59,150, + 65,211,111,244,248,111,127,119,218,236, 62, 12,165, 71, 89,227,253,205,114,188, +181,189,201,125,155,118, 60,171,113,228,159, 12,209, 29,197, 17,239,185,205, 91, + 91, 94, 16,253,181,181, 73,129,224,152, 96, 38,217, 30,239,239, 12,255,237,184, +153, 97, 74, 41,134, 19, 18, 15, 9, 8, 3,144,135, 4, 75, 90,196,240,167, 39, + 78,120,162, 56,212, 93,235, 77, 13, 67,134,230, 98,135, 22, 59,220,221,101,183, + 27,127,181,243,206, 58,183,150, 28,233, 38,134,136,136, 96,120, 76, 18,211, 1, +198, 40,138,164,235, 68,207,136,244,123,236, 96,125,231,135,113, 68, 68, 30,233, +167,205,235,177, 19,201, 56,226, 99, 34, 48, 65, 30,144, 0,132, 88,172,202,245, +161,137,169,206,105,154,164, 9,248,128, 18,145,133,137,108,152,167, 59,159, 35, +127,191,111,123,243, 66,112,145, 59,180,238, 52,111,142,247, 85,251,185, 78,173, +219,202,145,139, 4, 89,166,105,158,202,212, 53,185, 54, 44, 89, 86, 85, 27,150, +140,105,243,127,180,163,221,111,151,174,236,129, 7,176, 36,121, 36, 69,145, 20, + 69, 16, 30,215,161,106,177, 34, 49, 81,176,166,113, 31,198,103, 37,223,104,233, +198, 0, 97,236,146,169,168, 74,134, 81, 26, 25, 71, 44,177,140, 88,154,208, 35, + 12,142,138, 0,197,196,130,111, 38, 49, 81, 97, 96, 92, 95,130,187,217, 89,225, +176, 40,178, 55,218,116,242,189,152,167,110,138,192, 34, 90,243,207, 98, 17, 29, +208,163,226, 64,123,223,127,100,160, 84, 60, 8, 20,128, 60, 42, 42, 42, 32, 28, +169,168,144,128, 64, 32,148, 7, 36, 98, 32,203, 44,151, 11,155,100,237,137,157, +149,220, 92,252,184, 26, 41,236,238,108, 32,127,202,109, 62, 42, 42,190, 83,146, +110, 63,161,238, 96,136,248,239,116,123,233, 23,159,167,254,136,149, 26,158, 66, + 30,253,122,214, 55,134,213,114,117,105, 40, 13, 70,169,228, 40,203,184,186,189, +110, 33,255,199,202, 58, 27,196,138, 53,153, 11,134,195,202, 40,148, 73,134,133, +162, 88,176, 64,185, 48,149, 75,149, 81, 44,141,229,202,162,140,181,145, 85, 88, + 37,155, 58,211,181,111, 9, 95, 78, 91,173,199, 16, 74, 18, 19, 24,140, 12,219, + 80, 48,221, 49,169,132,118,205, 68, 35,199, 82,143, 84,107, 25,161, 80,146, 11, + 37,195,155,206,109,202, 42,145,244,111,250,105, 7, 96,104,232,166, 6, 16, 8, +196,225, 25, 9,196, 48,171,100, 68,204, 44,129,162, 9,162,218,218,253,185, 29, +187,239,143,237, 24, 62,237,234,221,225,159,166,217,111, 43,189, 39,245,232,237, +225,126,171,213,249, 12, 63,150, 82,219, 90,220, 20,200,136, 8,102,102, 6,137, +173,202,165,177,108, 50,153,230, 90,144, 1, 96, 1, 2, 88,138,152, 66,109, 88, + 33, 14, 16,128, 65, 44,133, 32, 40,146,208, 80,149,247,141, 52, 66, 50, 44,161, + 40, 26,170,226,197,218,206,121,188,117, 82,107, 57,156, 73,101,117,239, 4,221, +100,167,188,143, 32,196, 97,217,238,252, 23, 1, 24, 52, 50, 13, 12,149,201,224, +173,101,221,102, 0,105,187,235,223,253,182,251,159,157, 30,234,143,238,177, 1, + 20,230, 64, 72,198,118,106, 64,179,193,116, 26,197,117, 61, 43, 11,104, 84, 26, +170,130, 93, 84,229, 50,121,203,249, 44, 1, 25, 57,237,217,103, 11, 14, 78, 64, + 76, 54, 44,151,253, 58, 18,153, 11, 38,147, 77, 97,210,200,181, 31, 66, 32,248, + 98, 98, 61,184, 40,148,229,178,108,254,139, 29,168, 43, 14, 60, 12,240, 5,182, +161, 52, 56, 44,134,254,150, 36,192, 25, 81, 16,194, 23,108,109,178, 72,141,144, +210,254, 48,124,240, 5, 99,152, 85, 85, 27,172, 2,131, 71,214, 84,214, 2,201, + 37,115,160,193, 84,172,137,165,185, 88, 44,208, 68,225,233,120,246,122,205,213, +216, 85,158,247,190,218, 33, 57,229,196, 4,185,223,147,219,173,199,219,247,252, +241,179,221, 40,253,187,237, 20,141,211,186, 75,160,123,103, 87,235,189, 89, 72, + 16,134, 96,233, 65,193, 8, 16, 64, 34,150,162, 72,242,160,136, 32, 1, 25,224, +179, 63, 26, 61,247,155,115, 14,107, 98,177,224,207,237,213,126,122, 83,194,201, +213,251, 40,127,172, 71, 64,176, 66, 93, 24,195,235,205,161, 51, 99,154,178,217, + 1, 82,236,177,235,164,240,102,235,164,184,118,154, 1,135,188,246, 94, 80,113, +144, 48, 79, 29,154,117, 47, 74,168, 45,225,106,116,192,212, 99,197, 48,250,108, +183, 21,118,232,183, 11,106,164,116, 86,180, 10,223,107, 53,236,239,141, 21,237, +163,159,132,235,148, 33, 10, 70, 96,197,255,211,243,238, 84,111,143,229,186, 39, +217,211,242,108,134, 19,203,197,128, 29, 88, 40,198,184, 38,150, 75,197,153, 11, + 99, 22,149,201, 80, 13, 52, 52, 87, 3,136, 93, 24, 37,225, 6, 8,216,197, 63, +167,108,143,159,187,217, 59,221,185,248,137,244,155,214, 77,196, 71,112,110,167, + 56,125, 62,159, 10,225, 70,230, 88,230,207, 58,104,173,198, 89,167, 6,234, 80, +244,248,179, 33,182,144, 26, 32, 52, 64,136, 24, 50, 75, 11,179, 88,213, 69,105, +168, 16,166,208,157,117,195, 21, 1, 20,127, 4, 53, 87, 45, 22,192,211,212, 48, +246,174,110,167, 39,204,211,127, 68, 68,164,115,111, 87, 33, 52, 52,104, 54, 23, + 9,197,241,251,236,112, 63,203,137, 14,144, 97,218,128, 20,128,176,199, 90, 30, +204, 44,217, 96, 18,150,235, 0,103, 46, 11,168, 10,195, 3, 26,106,210,208,192, + 86,133,178,100,146, 68,161,108, 30,143, 7,228, 65,226,124, 15,221,214,233, 65, +183, 18,162, 23, 61,109, 79, 83,111,174, 47, 71,142, 88, 88,134,194, 96,150,230, +218, 68, 56,144,128,127, 87,251,252,254,125,139,247,112,251,167, 65, 38, 32, 18, + 21,114, 96,114,101, 82,196, 6, 24, 88, 54, 26, 21, 5, 54,161,172,140,134,198, +242,111, 59, 23, 73,123, 98,100,210, 35, 63,100, 15,245,251, 88,250,149,133,185, +101,201,111,196, 26,140,146, 32, 28,241, 3,239,207,218, 49, 43,115,181,222,182, +230,106, 37,135, 45, 62, 20, 63, 52, 70, 92,125, 39, 4,173, 55,133, 24,175,189, +175, 49, 97,181,236, 77,237,117,251,176, 29,188, 79,130,195,140,145,175, 45, 43, + 56,169,144,223,218, 13, 29,164, 73,241, 69, 68,211,148,222, 59,169,123, 34, 26, +150, 19, 53,255, 58, 16, 52, 74,107,185,141,137,162,177,181,216,121,237, 35, 34, + 7,223,161,218, 15,193,136,229,130,109, 80, 25, 17,254,212, 90,126,119,208,219, +125,212,120, 79,188,255,129,166,199,145,168, 98,142, 56,192,112, 80, 24,199, 27, +229,182, 89,103, 8,250,125, 59, 79,252,159,182,245,116, 78,198,231,246,126,241, +175,214,180,159,165,232,167,127,221,249,103, 55, 15,228,129, 30,232,129,188, 58, + 25, 74, 30,168, 91,237,236, 38, 22,136,146, 29,129, 92,142,211,179,193, 60,133, +226,135,214,139,237,124,141, 14,127, 66,124,188,239,115,211, 60, 48,156, 27,101, +123,203,249,183, 57, 27,255,254,124, 80,231, 3, 62,184,152, 21,127,141,237, 49, +228,194,115, 91,111, 63,180, 50, 27, 77,181,201,104, 48,200, 0,163, 42, 15, 44, +248,113, 81, 89, 60,152,146, 6, 86,209, 5, 39,168, 32,168,234, 53,117,124,244, +190,120,183,201, 21, 87, 72,193, 88, 25,183,172,161,108, 40, 12,107, 18,153,222, + 78, 79,236,154, 35,173,156, 60,240,229,230,215,111,170,159,243,198,109, 78,226, +110,223,184,157,161, 6,165,155, 53,133,249, 17, 75,156,101, 15, 17, 63,176,156, +214, 3,181,219, 12, 53,143, 65, 18,131,173, 81,231,227,235,241,126, 67,213, 80, +145, 62,250,216,138, 13, 38, 35,131, 92,157, 28,209, 96, 80,153, 9,215,207,176, + 92, 12,170, 11, 69, 98,169, 92,172,209, 99, 43,187,115,183,166,221, 67,158, 52, + 75, 57,204, 17,239, 35, 79, 33,187, 53,135,235,220,216,130,237,198,112,129,129, + 33, 50, 5, 44,128, 77, 44,157,207,253,231,163,227, 62, 91,155, 67,209, 61, 90, + 21,117, 85, 23, 6,198, 6, 11,185,245,218,147,112,144,185, 84,172, 74,134,113, +201, 62,182,118,212,239, 81, 93,150,135,218,168,179, 57,138,150,132, 76,141,204, + 72,146, 36, 25,198,147, 80, 16, 12, 16, 15,149, 77,136,115,121, 90, 31, 3, 81, + 51,121, 41, 28, 19,148, 24,228, 17,194, 8, 49,196, 16, 18, 17, 17, 17,145, 64, + 36, 72,146,230, 1,182, 99, 56, 25,141,205, 95, 7,230, 46,196,178,194,139, 96, +199,119,108, 98,179, 66,168,255, 28, 96,136,221, 66, 34,111,112,206, 57,183,154, +108,212, 84,214,221,160, 95, 49, 54,208,248, 60, 42,243,194, 35,211, 38,251,150, +149,243,237,100,138,238,202,132,153, 79, 0, 60, 52,155,228, 0,179, 10,114,189, +165,110, 33,140,238, 33,249,106,130, 22, 70,192,231,179, 20,201,105,133,213, 63, +185, 4, 58,246, 67,195,202, 26,255, 64,212, 52, 80,191, 14, 60,139,150, 49,191, + 0,239,230,161,136, 13,190,113,212, 58,130,122,231, 76,216,131, 35, 4,236,188, +160, 76,149, 72,237,188, 64,216,177,190, 72,103, 67, 23,160,196, 28, 39, 41,194, + 62,216, 15,102,133, 11, 41,161, 67, 92,166, 51,131, 36,152, 79, 80,197, 86,122, +209, 11, 43,136,209, 84,211,141, 94, 68, 16, 43,228,225,176,207,116,120, 11, 31, + 62,123, 46, 49, 36, 4, 71, 78,109, 70,100,223,244,162, 43,168,130, 12,202,116, +182, 99,146,121,177, 46,170,221, 51,187, 22, 51,211, 48, 52,122, 97,100,244,207, +106,247,183,229, 70,138, 2, 5, 54,129, 8, 99,105,172, 19, 95,174,235,135,230, + 27, 35, 0, 32,154, 49,249,181,100, 69, 33, 62, 66, 43, 3,234, 76,127,174,157, +173, 6,205,176,234, 7,201,223,144, 46, 11,177, 51,245, 93,106, 2,158,238,228, + 20, 29, 52, 6, 53, 51,175,243, 41, 62, 77,212, 20,221,252,227, 13, 38,248,162, +196,112,170, 24, 71, 30,134, 11,186, 42, 32, 48,108, 59, 48, 17, 90,235,125, 1, +161,203,102,163, 22, 8,211,136, 58,212,160,221, 6, 24,201,247, 39, 38, 33, 0, +184,197,125,205, 77,190,187,110,201,192, 42, 82, 34,125,131,212, 82,255,152, 92, +175,184, 65,220,141,229,119, 61, 63,160, 40,127,171,118, 54, 0,231,174,226,110, + 57, 45, 99, 89, 60,118,106,234,243,179, 1,219,218,101,206,165,116, 40,140,190, + 99, 21, 4,121,226, 85,142,177,222,182, 91,121,106, 38,117, 29,155,104,243,136, + 30,180,132,134, 0,111, 32,110, 90,198, 10, 75,147, 53,226,106,147,116,250,168, + 82, 13, 10,250,234, 20,221, 32, 89, 8, 6,146, 7, 32,141, 67, 50,146,230,169, + 66, 39, 72,197, 32,198,170,162, 87,192,200, 75,105,182, 46,174,135,126,191, 81, +165, 91, 67,164,114,139,250,172,178,228, 19,180, 10,138, 36,255, 28,233, 64, 34, +201, 48,244, 89,238, 55,235,110,182,145, 67,154, 92, 58,102, 18, 48,107,229,160, +127,189,242, 96, 1,135,164,106,196,209,112, 85,111, 45,234, 94,208,227, 1, 0, +156,252,200,121,159, 39,240,196,161, 92,228,255, 76,230, 66, 96, 68,234,162,114, +188, 94, 58,218, 51,229, 84,120,149, 92,132, 11, 51, 49,108,144,225,127,153, 59, + 65, 78,145,119,178,157,191, 72, 67, 96,203,230,242,103,231,240,100,151, 18, 90, + 73,137,195, 13,117, 27,253,254, 67,201,248,180,245, 14, 53,122, 4,171,239, 91, + 22,235, 58, 86, 82,245, 22,184,244,140,228, 92, 19,174, 18, 14, 71,193,232, 28, +194,235, 83, 47,213,104, 64,117,163,144, 30,245,131,114,168,204,169, 75,233,158, +139, 62,144, 52, 97, 64,105,191, 9,148,130,123,186, 98,137, 64, 89,192,206,145, +168,124,104,204,190, 26,156,202,243, 98,140,125,128,214,240,192,112,169,176, 69, +171, 32, 27,229,228, 96, 33,242, 70,101, 2,175,164, 65,148, 95,155,217,227,129, + 58, 0, 79, 69, 23,110, 70,208, 52,168,160,181,194, 82, 64, 47,167,144,144, 27, +180, 90,129,196, 81,194, 53,168,132, 93,194,171, 12, 37, 25, 51,116, 62, 31, 45, +122,254,108,118, 53, 59,190,167,144, 79,125, 3,169,117, 69,105,202, 2,116,189, +205,192, 36,231, 44,196, 66,106,155, 10,206, 27,102,105,221, 69,164,135,100, 88, +129,106,156, 84, 61,198, 35,231,229,144,192,204, 54, 25,141,230,164, 48, 55,247, +123,144,138, 43, 20, 36,107,205,194,212,170, 64,230,142, 28,176,194, 54,110, 99, +246,132, 9, 77,234, 80, 58, 37,231,208, 96,234, 25, 54, 93, 65,230,228,113, 67, +241, 44,191, 72,142,241,166,107,157, 12, 81, 4,226,137,244,177, 17, 73,127, 79, +124, 86,141,164,179, 2, 2, 32,235, 63,100, 2,213,109,200,144,173,166,172, 52, +235,180,236,245,236, 80, 55,184, 88,138, 7,220, 99,156,226, 11, 5,243,126,150, +211,178, 62, 17, 68, 46,199,151,177,108,228,138,135,160,148,220, 61,145,216,112, +238,202,146,231, 83,236,111,127,165,245,169,220,222,208,181, 51, 46,165, 6,198, +208,138,234, 42,208,225,243,109, 0, 24,133,251,172, 46,196,190,232,131, 64,132, +180,238,209,214,252,152,204,221, 95,109,117,129,254, 69,240,253,224,171, 72, 95, +227,163, 15,120, 23, 66,147, 21,248,118, 75, 21,100,159, 80,179,253, 86, 55, 35, + 0, 30,138,156,151, 47,201,199, 63, 13, 16,154, 94, 96,244, 17,162,103,191,242, +196,134,245, 55,214,188, 63, 99, 7,141,238,214, 47, 62,196,235,121,152,243,138, + 11,113,179, 30, 57, 90, 25,163,222,217,160, 98, 26,183,225, 82, 37, 21,108,248, + 48,161, 32,191, 13,237,241, 20,185, 93,186,200,217,164, 2,108, 65,122,250,136, + 82,173,161,194, 34, 76,194,199,200, 56, 88,251,228, 13,139, 50, 80,142, 10,147, +131,100,171, 44,135,185,142, 32, 39, 39, 14, 59, 35,236,171, 98,178,109,213, 32, +129,202,193,168,249,242,155,248,195,239,154,253,191,190,170, 18, 99, 2,232, 80, +100, 17,179,196,239,232,229, 24,182, 49,197, 60,142,156,222,112, 89,141,177,209, + 51,182,251, 25,254, 99, 74,211, 85,186,149,253,135,145,188,130, 94,166,123,253, +201,162,169, 35, 52,194,119,193, 66,177,126,167, 88, 6,252, 72,140,180,197,156, +158,246, 36, 1,230,108,218, 82, 37, 62, 6, 2,110,200, 71, 64,200,162,187, 89, +184, 18, 38,230, 16,124, 53,184, 63,138,109, 97, 32, 10,154,167, 21, 36, 21, 31, + 10,131,171, 72,116,247,120,123, 41, 16,192,148,213,140, 66,158, 61,240, 68,127, +117, 69, 56, 43,196,156,236, 88,114,250,192, 2, 22,114, 72, 82,184,178,133,129, + 39,219,180,189,212,120, 9,210, 11,147,251, 29,208,168,124, 1,194,103, 19,252, +205, 43,141, 79, 92,132, 98, 98,175,195,243,172, 91,136,106, 67, 76,237,102, 56, + 48,146,205,223, 70,254, 44,191,224,191,252, 47,148, 17,161, 35,176,240,100,110, +151,158, 28, 12,181,223, 64,163,182, 87, 48,132, 25, 10,247,244,239, 87,146,111, + 92, 34, 28, 85,109,108, 96, 20,198, 91,196, 5,253,147,124,213,107, 0, 81,124, + 58, 61,205,152, 72,109, 38,206,100,216,238,194, 13, 31, 97, 61, 26, 56, 20,217, + 46,180,180, 40,185,132, 9, 23,248,202,204,223,162, 65, 58, 18, 0,248,230, 97, +185,198,106,155,239,114,238,239, 95, 83,102,241, 38, 65, 32, 87,131,214, 17, 50, + 29,107,199, 63, 39, 32,137,125, 48,238,198,134, 94,254,113,105,246,173,207, 13, +126,194, 41,251, 85,145, 16,103,148, 83,184,147,192,222, 19,159, 58,201, 13, 81, +243, 75,114, 31,209,183,157, 58,142, 16,116,116, 1, 49, 80, 5,192, 34,216,153, +241,162,124, 22,224, 97,185,220,115,192,132,140,203,190,107, 56,104, 28,219,231, +198,112, 1,188, 5,143, 63,245,110, 50,118, 34, 50,132,137,228,190, 99,225,124, +120, 74, 92,218,107,213,247, 79,220, 49, 82, 65,192, 18, 57,165,198, 17,187, 98, +255,230,138,148, 16,234, 17, 90, 69,224,168, 82,154,211,245,194,121,160, 28, 22, + 70, 66,154, 27, 39, 64,161,172,240,172,254,189, 60,219,135,131, 80,118, 28, 41, +193, 77, 99,206, 45,240,133,140,211,197, 64,113,240, 11,155,234,208, 33, 91,110, + 15, 82,188,120, 30,189,145, 9,152,184,110, 67,184,176, 61,235,221,139,106, 12, + 32,137,123,141,192, 41,225,117,136, 31, 30, 80, 96, 34, 86,175, 23,162,154,223, +206,230,143,132, 77, 73,161,145,118,160,228,247,239, 7,245, 77, 70,212,187,173, +105,114,221,248,177, 0,161,116,232, 40,110,107,131,128,241, 26, 83,219,102, 68, +105,202,151,189,219,230, 9, 63,149,136,163,153, 69, 80, 98, 49,243,106, 39,243, +168, 48,156,173, 65, 59,117,210, 77,181,110, 69,108, 54, 24,101,201,160,211,145, +198,165, 89, 78,220,159,222,192, 31,228,181, 46, 15, 89, 30, 16, 68, 40, 13, 3, +171,147, 89, 69,109, 15, 30,154,101, 91,225,133, 55,157, 90,120,167, 68,100, 38, +192, 44,111, 84,129, 79,253,123,158,191,147,190,127,235, 67,189, 19, 94, 95,177, +224,151,151, 83, 63, 8,222, 90,241,213, 99,240,122,204, 69,168, 8, 71, 50, 36, +254, 75,152,232, 68, 69, 0,196, 35,130,111, 52, 2,130,182,193,177, 2,142,149, + 22,170,103,147,155, 77,112,110, 32,199,152,199,156,217, 1,164,250,216,127, 88, + 66,101,233, 59,127, 4,207,213, 45, 96,160,110,223,147, 52,143,113, 62,122,213, +179, 16,245,210, 39, 4, 0, 25,140,157,219,138,102,194,145, 13, 59,218,146,229, + 54,185,103,170,120,200,158, 99,110,130,161,115,212, 23, 48,105,133,147,190, 82, + 74,220,224,164, 73,225, 78, 10,202,209, 79, 96,207, 35, 29,179,127,215,243, 25, +190,230, 37,123,103,242,136, 41,243, 99,201,109, 92, 79,169,104,171,130,112,237, + 41,198,229, 1,208,116, 99,161,141, 10,240, 80, 99,231,247, 82,101,137, 49, 14, +106, 77,132, 8,107, 11, 56,244, 67,214,205,221,131, 34,176,153,137, 31, 0, 21, + 8, 52,117,153, 66, 9,125,147,133, 1,127,119, 95, 41,250,142, 7, 42, 77, 47, +210, 25,136,178,254, 65, 69,215,162,254,215,218, 20, 42,214, 34,101,198,104,152, +252,141, 41, 45,133, 57,234,169,208, 5,221, 59, 37, 79, 94, 60, 85,149, 71, 34, +137, 54, 22, 59,230,159,225,215, 44,169, 2,152,167, 54, 57,159,168, 80, 43,115, + 31, 51, 8,169,173,147,135, 56,141, 20,119,233, 3, 80, 77,172,235,231,222, 99, + 36,249, 94,180, 52, 97,169, 0,151,246,176, 34, 13,227,203, 97, 85, 23, 44,148, + 19, 57,159,180,242, 21,111,191,121,163, 52,145,165,183,191,166,247, 30, 73,176, +247,199, 63,181,224, 52, 63,196,254,240,103, 88, 45,237,165, 41,171,248,253, 92, + 21,128, 80,152, 70,154,179,172,106,203,132,105,200,201,153, 83, 8,159, 66, 34, + 4, 76,150,251, 87,117,140,107, 41, 35, 13, 15, 15, 17, 75, 83,222,128,149,145, +183, 98, 71, 61,215, 35,105,251,171, 20,224, 85,200,124, 41,221, 49, 52,190,120, +157, 43,163,113,238,193, 30, 63,244, 50,207, 30, 54,239, 8,253, 1,124, 41, 50, +129,111, 64,213, 75,172, 77,202, 27, 40,129,111,200,245,210, 79, 49,211,237, 40, +132,109,137, 28,186, 67, 78, 12, 95,203, 73,206,225, 20,140,248, 58,101,188,119, + 22,144,175,216, 90,124,167,106,230, 72, 52,107,196, 5,163, 15, 29, 65,161,248, + 92,169,168, 55,174, 83,183,228, 49, 15, 31, 97, 67,132,226, 69,134,149, 8, 57, +159,241, 97, 83,112,161,221,224,136,233,184, 11,173,188, 92,134,215, 42, 25, 51, +118,194,122,217,206, 81,108, 44,239, 36,121, 79,112, 95,186, 8,102, 0, 34,248, + 9,197,117, 87,138,176, 79, 76,134,133,141,219,109, 82, 12,139,121,169,134,138, + 2,163,160,141,250,233,141,178, 3,228, 79,167,236,105,111,218,213, 79,237,208, +199,163,225,233,204,147,242, 16, 30,199,248, 90,161, 64,102, 30,172, 55, 80, 73, + 76, 2,188, 25,211,244,244,232,112, 99,142,253,239, 61, 98,248, 80, 5, 43,148, + 41,152, 2, 85,161,116, 15, 39, 46,221,141,252,134,100,156, 17,147,204,165, 14, + 79,122, 6,177,136,182,142,248,137,241,247, 33,136,174,129,233,153,118, 44, 83, + 32, 50, 29,176,212,130, 51, 97, 70, 9,178,136, 97,112,228,150,103, 32,170,113, +140,168,200,158,149,233,119, 5, 44,171, 80,140, 93, 35,200, 38,167,218,129, 53, + 74,204,143, 95,255, 47, 71, 74, 55,191,117, 63, 77,223,222,109, 79,247,110,204, +167, 79, 44,205,147, 75, 1, 76,192, 96, 56, 38, 24, 74,104,163,101, 10,117, 89, + 23, 65,147, 37,212, 11,163,200, 0,216,189, 75,208,112,136, 50, 39,252,168,105, +186,186, 70, 80,236, 97, 73, 42,133,117,211,198, 19,184,115,186,204,170, 98,226, +118,236, 4,213,230, 25, 5, 49,166, 80, 10,158, 48,223,192, 15,101, 70,156,193, +242, 34,226,146, 15, 83,115,124, 7, 34, 39, 58,117,174, 15,152, 30,192,195, 43, +232, 89,131,122, 95, 15, 37,131,180, 68,217,165,208,170, 48,152,118,139, 37,202, + 75, 19,224,191, 49,222,129, 19,186,162,218, 98, 54,176, 83,169,146,125,127,202, + 76, 67,209,141,255,108, 73, 56,214,148, 28,157,107, 67,130, 24,171,167, 65,238, +100,124,136, 73,128,164,138, 95,218, 68, 91, 15,223, 91,113, 20,165, 40,175, 1, +217,186,108,249,167,145,132, 55, 72, 81,154,217, 6,167, 71,167, 14,155, 34,153, + 25, 81,236,121,201, 47,213,160, 40,112,194,170,244,122,169,240,186,106,113,164, +108,194, 54, 87, 33, 86, 84,133,109,104, 41,117,154,134, 71,155,111, 73, 32, 84, + 25,137,213,109,238, 0, 70,106,121,116, 19, 88,110,218,178,111, 57,212, 73,190, +235,177, 41,231,251, 50,195,199,246,171, 34,213, 51, 61,218,171, 15,133,123,228, + 56,112, 65,133, 25,164, 6,145,135,175,188,241,247,144,119,234, 1, 58,131,138, + 37, 24,149,196,220,108,141,156,150,186,119, 46, 99,128,242,177,218,134, 24,249, +147, 85, 27, 42,101,207, 61, 91, 29,232,151, 22, 90, 68,196,172,164,242,101, 86, + 63,125,238,154,186, 49,108,247, 3, 30,237,127, 18, 47,122, 7, 91,177, 84,247, +177, 42, 91,222, 55,108,192,168,115,234, 59,179,224, 25, 66, 29,245, 10,125,232, +224, 5,255, 90,172, 14, 98,131, 63, 6, 9,180, 45, 12,255, 1, 34,221,203, 18, +227,183,205,233,246, 61, 71,119, 36,176,244,125,112,154,171,131,194,149,192, 83, +124, 25,158,120,232,136,160,160,240, 53,124,240, 15,227, 75,240,197,117,192,205, +114,186,218, 8,244, 62,242, 22,112,102, 93,152, 4,218,190, 89,152,143, 1, 59, + 98,134, 76,218, 16, 74,250,178, 40,100,171,100,230, 80, 3, 23,181, 60,225,236, + 17,162, 63, 56, 93, 99,107, 46,253, 60,147,126,246,184,137,128, 34,183,194,234, +218, 66,130,124, 29,113, 45, 34,215, 96,225,166,125,219,153,117,187,222,152,255, +103,131,251,148,156, 16, 47, 1, 32,151,109,155, 19, 16,180,166, 14,181, 75, 20, +242,152, 58, 40,147,115,220, 18,152, 35,223,176, 14,171,198,152, 13, 17,212,102, + 97,231,141, 90,114,196,113, 33, 7,181, 65, 51, 56,113,107,191,209,185, 22, 24, +233,230,157, 41,244,109, 43,101, 46,236, 35,215, 37, 23, 0, 63,234,197,254,174, +173, 19, 33,149,201,223,249,200, 20,254,225,124, 59,158, 31,101, 67,228, 63,153, + 73, 39,174, 64,138,163,238,125, 0,128,194,135, 70,206,210,170, 44,133,128,149, + 1,200,229,238,252,148,117, 60,110, 97,172,119,143,240,174,116,106, 2, 3,175, + 34,166,214, 72, 20, 33, 40,189,195, 42,144,174,242, 99,229, 39,168, 87,218,115, +182, 43,232,226,103,198, 53, 68,231, 91, 29,219, 19, 1,159, 57,160, 92,241,198, +239, 40,165,232,130,158,132, 85, 9,168, 17,107,179, 93, 65, 26,107,182, 59,107, +205,247,168,137,206, 53, 5,237,110, 46, 69, 56,155,247,200, 29, 26,195,230,152, + 19, 55, 6, 78, 10, 46, 2,149,117, 67, 61,252,123, 86, 21, 74,135,192, 85, 33, + 19, 20, 45,134,194, 45, 63, 31,160,117,238,199,122,214, 53,211,173, 72,169, 62, + 79, 36,206,203, 24,228,205, 48,239,227, 15,187,120, 73,155, 89, 86,162,106,173, +139, 46,191, 50, 3,198, 27,206,134, 14, 99, 27,212, 67,178,164,202,149,143,124, + 92,228, 22,179, 59, 89, 88, 19, 43,148,216,138, 1,155,110,178, 0,142, 46, 81, +153, 61, 13,142, 34, 4, 95, 43, 87, 81,156, 72,115,165, 73,104,223,188,234, 84, +204, 8,132,118,142,202,208, 43, 36,232,146,122, 88,182,163,168, 57, 80,138,204, +154, 49, 39, 36, 38,253, 88, 50, 6,101, 85, 34, 3,144,208, 42,149,225,225,240, +176,176,100,172,246,117, 7,117,107, 62,123, 85, 8,191,161,132, 26,109,189, 31, + 60, 31, 67, 21,212,116,200,150,205,254,159,215,251,172,130, 9, 49,128, 79,144, + 78,141,156,143, 81, 40, 79,176, 50,154,254,158, 31, 40,216, 78, 98,207,255,137, +232, 11, 52,231,176, 40, 1,227, 59,209,220,198, 63,155,212, 87,224,170,172, 45, + 89, 73,200,121,130, 33,233,151,140, 30,124, 36, 50,225, 12,107,219,202, 85,125, +140,249,123,225,176,134,253,131,235,229,229,143,185,181, 65, 40,190, 67, 52, 58, + 74, 81, 84, 87, 89,195,208,190,252,157,122, 29, 31, 69,151,248, 34, 0, 95, 83, +219,132,220,195,214,145,153, 59,220,219, 75,207,254, 51,195, 18,174, 7, 93,247, +129,198,213, 4,133, 62, 50, 0, 51, 84,148,138, 73,239,220,188, 37, 1, 62,180, +122,177, 8,238, 87,173,145,220, 44, 18,210,179, 87, 50, 34,124,137, 12, 67,100, +174,203,176, 94, 30, 10,249,218,111, 23, 68, 68,128,113,140,189,204, 50,122, 83, + 96, 84, 24,196,150, 11,158, 96,242, 1, 48,203,142,171, 97, 72, 59, 23, 18,177, +105, 17, 76,247,143, 26,249, 73,239, 27, 45,166,181,129, 62,156, 37, 72,228, 28, + 72,205,215,179,124,176,153, 95, 70,219, 12, 30,160, 77,223, 72, 66,123,193,177, + 60,159,149, 17,183,123,147,130, 72, 84,108,155,246,173, 76,175,142,175,242,115, +215,239,107, 20, 33, 79,227,240,223,157, 26,170, 0,246,224,218,225,170,190, 7, +194,231,241,188, 12,105,163,225,156,168, 30,194,203, 50, 96,156, 58, 15, 44,128, +142,114, 56, 71,141, 76, 37, 8, 73,171, 61,206, 83,116, 23, 38, 13,194,213,133, + 93, 56,226,253, 21,188,118,239,163,247,104,128,161, 67, 75, 62, 80,150,129,141, +140, 38,134, 73,248,241,215,252,123, 20,197, 63, 60, 40,225, 90,206,243,242,241, +196, 76,228, 88,175,207,111,199,228,255,246, 95,159, 90,159,184,188, 52, 54,156, + 58, 49,213, 67,135, 53,242, 66, 56,157, 57,129, 15, 70, 93, 23,249,173,119,241, + 17, 17,227,198,225, 2, 37,247,166,250, 74, 72,196, 23,189,173, 2,132,199,157, +201,229, 81,240,110, 11, 26,140,188,226,193,100,103, 31, 25,144, 2,118,207,128, +213,235,135,106, 66,109,122,110, 54,158,121, 36,117, 31,165,178,139,153, 73,201, + 50, 90, 65,163,250, 61, 67,110, 82,224, 19, 35,222, 52,127, 28,180, 26,170, 20, +174, 87,167,137,132,132,134,222,154, 53,189,111,255,160,239,244,176,135, 99, 80, + 53,125,212,150, 59,243, 74,133,138,191,163, 99,211, 47, 87,136, 61, 19,200,241, +122,122,121, 96, 85,167,233,170,166,106,105,126, 6, 44,201, 52,122,114,244, 14, +115,163,118,194, 48,167,215, 62,117, 82, 53,189,110, 80,204,246, 74, 55,222,233, +207, 1, 98,251,154, 63,200, 30,127, 39, 46,203,151,220,185, 30,211,180,223, 88, + 97,199,203, 66,221, 86,132,253, 72,109,209, 63, 79, 90,179, 67,177, 17,204,100, +197,248, 43, 99,192, 24, 2,134, 30, 11, 0,170,252,233, 53, 52, 69, 56,124,122, +231, 0, 66, 13, 14, 68,119,166,193, 65, 60,156, 52,248,228,174, 50,102,101,165, +234, 32,129, 88,170,148, 32,227,105, 7,219,238, 67,137,247,147,106,188,204,162, +203, 36, 13,240, 35,246,222,246, 84, 80, 81,169, 15, 22, 85, 20,220,144, 21, 41, +249, 58,121, 67, 2,179,230,232,173,233, 77,216,135,150,144, 2, 59,125,244, 67, +170, 23,213,195,252, 76, 93,153,184,149, 13,197,136, 83,178,254,103,141,105,205, + 91,136, 42, 54,241, 8, 8, 33, 43, 92,100, 90,143, 93, 23, 30, 3, 42,172,116, +171,136,145, 42, 19,243, 40,248,205, 38,157, 35, 6,187, 35,132,140,181,117,246, +173, 82,204, 45,186, 47, 55,190,159, 12,222, 61, 34,209,112,212, 59, 93,202, 27, + 59,192, 41, 72, 92,246, 11,219, 72,234,185,205,207,248,176, 37,122,140,255,104, +101,219, 21,129, 42,122,136, 74, 79,108,186,197,244,217, 94,226, 31, 76, 10,242, + 24, 71,186, 4,243, 90, 54,204, 97,144, 2,157, 44,132,204, 21, 69,115, 29,117, +111, 68,193, 53,246, 2,166, 89,243,249,184,109, 23,139, 73,120, 79, 68,144,250, + 63,232,209,143,129,255, 33, 79, 84, 68,143, 4,236, 71,210,173,182,129,194,104, +175,226, 72, 29,159,178, 19, 19,130,184,239,195,126,247, 56,206, 13,186,228,163, + 31,108,195,141,153,245,133,163,134,102,241, 63,152, 20,133,214, 11,200,100,150, +250, 73,240,159,207, 78,225, 73, 55, 56,195,229, 72,180,207, 68,205,117,166,106, + 19, 41,179, 23, 55, 77,210,125, 86,254, 87,220,137, 64,252,127,242, 84, 12,252, + 74, 93, 24,117, 3, 84,143, 0,214, 53,167, 40,192,208,204, 3,200, 4,135, 29, +122,209, 73,228,129,127,222, 14,103,174,203,128, 89,139,146,202,167, 74,213, 61, +157,106, 35,134, 46, 96,154, 4, 65,150,229, 46,154, 0,155, 0,154, 0, 46, 57, +238,145, 91, 46,201,136,179,112,191,113, 31, 27, 93,110,151,218, 61,211,198,144, + 75,163,220, 82,203, 80,116,103,248, 77, 16, 69,140, 64,168, 16,170,204, 73, 72, +216, 56, 70,211, 44, 44,188, 31,138,182,179,102,184, 55,215,214, 79,174,243,163, + 24, 75,145,131, 33, 56,115,190,174,181, 42,207,236,254, 11,231,125, 10,198, 97, +145,205, 55,140,227, 34, 24, 22,137,200,106,195,193, 56, 11,229,238,149, 3, 88, +154,159, 50,164, 79, 16, 52, 12, 18, 3,119, 76,217,119,250,124,168,207,207, 19, +127,158, 58,249,251,156,124,138, 26, 31, 90, 78,131, 91,151,184,212, 35,146, 39, +242, 3, 10, 52,233, 68,143,221,161,126, 76, 5,146,148,238,169,118, 83, 50, 11, +134, 99, 65,207,151, 20,161,193,108,228, 93, 13,121,230,227, 33, 31, 15, 57, 16, + 65,236,204,139, 26, 27,244, 14,167,248,197,196,194, 53, 71,166, 29, 74, 98, 48, +161,118,135,154,200, 4, 4, 87,240, 9,193,100, 66,168,228, 83, 51, 63, 30,255, + 15, 74, 95, 51,245,125, 98,149,248,206,220,253,125, 80,151, 32,169, 64,249, 83, +231,231,250,193,104,215,199, 82, 74, 73,140,114,167, 5, 36, 29,233,135,235,156, +239,220,176, 40,174,245, 45,119,243, 82,143, 20,185,130,119, 28,207, 78, 30,121, +101,203, 64,118,103,222, 92,113, 71,196, 27,143, 29, 99,106,243,215,121, 76,221, + 45,205,194,148,165,228, 50, 27, 78,195,178, 75,253,140,109, 87,169, 68,211,160, +109, 54, 8,206, 37,161,158,158,175, 6,150, 38,145, 75, 81,132,149, 67,239, 24, + 35, 99, 58,239,235,128,250,243,179,182, 2, 9,217,111,210,143,171, 88,178,137, +105, 40,211, 78, 22, 63,235, 62,171, 5,197,108,107, 7,119, 30, 64, 99,114,163, +101,152,204, 37, 43, 54,151, 77,102, 89,248,204,234, 19, 83,144,238, 76,165,136, + 43, 4,184,142, 60,160,160,162,244,168,169,231,137, 24, 99, 6, 87,112,200, 52, + 77,117,130,226,231,187,253,205,141, 16,207,171, 71, 45, 71,207,170, 31, 79,210, +145,167, 48,186,232, 86,168,237,251, 53, 98, 58,117,237, 4,145,100,198, 63,221, +214, 18,151,133, 93, 48,233, 77,233, 77, 48,161, 89,184, 13,183, 93, 60,100,195, +253,148,121, 43, 27,206,118,185, 52, 86,100, 80,225,174,192,130,115, 97,203,189, + 37,237,208,138,214, 90,107, 61,134, 86,102, 60, 45, 71,233, 69,218,245, 40, 71, + 57,185,212, 85,151,166,104, 96,128,193,103,230,245,171, 87, 41,166,219,213,112, +101, 46,151,101,187,255,121,144, 90, 15,153,134, 97,161,216, 32,160,149,185,206, +106, 31, 99,154,235,131,243,122,149,124, 59, 12,219,149,201, 92, 13, 24,239,230, + 7,193,255,124,247, 53,145,170,202, 72,194, 72, 85,129, 18, 44,219, 54, 77,195, + 48, 96, 46, 22,172,171,215,126,116,118,153,136,172,193, 1, 4,186,178, 43,135, +218,168,211,156,177,170, 77,210, 1,195,243, 16, 12, 52, 10,203, 99,114, 49,203, +178,248, 1, 67, 80,146,128, 65, 40, 34,142,163, 24,100, 66, 32, 66, 24, 49, 68, + 17, 66, 8, 33, 18,140, 8,137, 8,141, 72, 29,120, 48,235, 61, 9, 44, 96,187, + 4,162,229,184,135,105, 37,199, 53, 20, 77,142,143, 27,141, 72, 89, 3, 46,237, +166,252, 39, 58,164,220,179, 52, 92, 39, 50,211, 11, 11,240,206,109,229,217, 86, + 98,188, 54,255,149,209, 24,240,136,223,145,104,239, 86, 56,202, 91,212, 73, 31, +245,135,121,120,201,116,196, 36,203,202,103, 76,112,124, 47, 58,108, 24, 90, 37, + 18, 21, 96,202, 25, 23,186,199, 5, 17,118,124, 99, 13, 9,234, 83, 63, 45, 6, + 51, 66,162,237, 3,178,229, 10,136, 58,156,113, 5,182,198,202, 47, 69,141,127, + 27, 57,206, 50, 92,158,142,134, 65, 70,118,106,133,151,147, 70, 67,173, 69,158, +132, 26,182, 85, 69,209,242, 68,145, 92, 44,155,171,224, 40,211, 61, 34, 57, 18, +161,217,120,204,234,250, 42, 14, 30, 90,178,149, 14,168, 50, 26, 97,140,211, 47, + 46,244,212,255,152, 59,203,193,111,123,115,135, 96,207,221,166, 59, 8,227,192, +211,122,226,182,163,200,115,139, 17,115, 95,198, 17,135,203, 3, 82, 78, 95, 1, + 40, 20, 20,119,127,195,177,130,181,255, 99,105, 90, 34, 86, 50,194, 22,193,200, + 70,176, 65,222,203,216,232,114, 1,220,134,244,222,145,101, 2,253,216,105, 29, +102, 13,238,131, 69, 47,107, 70,209,147,181,199, 77, 58, 58,214,230,183,237, 17, + 7,252,119,170,209,101,253,177,217,116,144,159, 86,217, 66,174,252,160, 23, 77, +232,216,216, 2,193,120,130, 95, 3,199,215,200,123,168,219,123, 13,227, 34, 52, + 86, 26,121,205, 47,162,141,175, 17, 40,212,234,224, 43,214,173, 57,218,218, 22, + 29,149, 25,160, 26,210,157,111,243, 50,231, 17,142, 80,157,224,139,165,223,206, +114, 4,179, 29, 75,185,163,113,187,201,177, 45,178,110,133, 1,213, 72,127,141, +232, 79,255,100, 18,142, 91,117, 20, 2, 31, 72, 25, 2,123, 55,133, 46,141, 36, + 2,125, 8,250,136, 40,209,141,145,195, 98,216, 76,134,162, 61,250,160,238,127, +212, 36,144,186, 51,155,124,184, 13, 48,103,104,155, 37, 31,165, 55,120, 36, 29, + 5, 25, 17,162, 61,115,162, 52,117,187, 38,214,174,222,255,198,153,152,245,246, +239,240,227,125,232, 19,163,207,139, 62,220,187, 84,235,148,243,128, 20, 82,184, + 52,249,154, 3,237,165,159,188,156,251,174,253, 28, 69, 3,212, 48,165,159, 53, +182,104,154,175,198,109,150, 8,189, 45,138,145,247,105, 44, 80, 32, 51, 74, 53, +102,210, 68,103,200, 98, 78,239,204, 82, 31,159,137,171,180, 45,179, 57,231,150, +100, 33, 25,145, 93,228,211, 7, 98,241,160,234,171, 11, 34,223, 32, 3,182, 73, + 39, 13,205,176,135, 44,149, 64, 15, 87,120, 96, 55, 68,200, 65,129,187,122, 17, + 12,166,165, 51,202, 68,159, 72,170,253, 15, 22,181,233,111,147,224,195, 54,184, +135, 43,141,121,211,108, 60,105,150,163,224,104,193, 40,105, 12,187, 46, 33, 74, +207, 90, 60, 7,246, 66,107, 20,250,106, 26, 27,167,106,166, 68, 77,131,166, 48, + 57,106,217,213,101, 20,168, 56, 55,157,199, 89,254,148,187,107,145, 50, 22, 23, + 37,141,188, 98, 88,176, 97,160,239, 79,236,169,160,160,183,228, 46, 66, 73, 1, +219,227,209,246,149,176,197,213, 81, 70, 30, 33, 54, 67, 9,170, 3, 83,247,234, +199, 25, 25,220, 74,250,233, 24, 70, 10,234,130,219,108, 17, 46,212, 37, 37,105, +170, 88, 46,208,124, 93, 89,143, 79,130, 10, 63, 8,175,209,208, 7, 92,203,108, +136,189,118,208,239, 3,165,216,195,133, 52, 99, 60,126, 21,166,210,205, 57,126, +225,241,196, 70, 24, 45,102, 81,150, 69, 25, 13, 81, 32,158,121,219, 86,153,157, +133,209,169,117,255,162, 51,106, 73, 42, 9, 81,163,145, 40,191,176,152,184, 14, +206, 43,204,216,147, 97, 47,183, 12,115,119,122,157, 81,104,232,135, 88, 66,120, +124,110, 47,254, 20, 46,120, 91,118, 8, 18,176, 85,159,127, 57, 1, 19, 4,209, + 41,115,112,106,233,226, 31,159,101, 26,135,119,205, 22,250,168, 73, 63,204,237, +236,236,162, 27,219,215, 40, 87, 60,178,137,174,105,216, 33, 24,253,246, 49, 70, + 20, 71, 4,175,112,164,252, 13, 44,229, 37,106, 24,181,103,102,239,201,137, 20, + 57,144, 31, 41,254, 45, 8,196,180,185,112,130, 53,133,233,194, 73, 16, 55,203, + 82,103, 1,156,194, 42,174, 83,110,255, 35, 64,124, 60,237,255, 20, 94,225, 81, +129,105,159,119,124, 9, 68,133, 75,251, 38,216,252, 48,147, 59,134, 25, 29,178, + 0,103,194,215,135, 59,191,115, 2,170,204, 71, 38, 96, 24,252, 83, 73,111,134, +249, 50,213, 78, 63,103,156,253,190,118, 97,193, 43,248,109,182,185, 73,219, 89, + 37, 30, 27,128,160,144,214, 96,156,138,133,250,202,253,183,204, 39, 50, 82, 71, +190,193, 76,187,196,182, 95,189, 46,187,180,226, 50,142, 94,233,160,143,134, 57, +109,141, 63,172, 26, 34, 72,181,170,120,109, 88,168, 76,186, 71,169, 18,237,126, + 36,200,178, 43,243,185,103,209,139, 16,197,184, 25, 83,159,160, 68,232,131,161, +212, 91, 75,134, 43,248, 54, 85, 76, 60, 47,186,199,147,166, 66,151,179,132, 25, +148,133, 23, 99, 33, 74,182, 66,101,206, 6, 4,241,100, 81,172,252, 44,212,234, + 19,127, 95, 97,178, 9,192,188,192, 18, 75, 91,210,237, 70,109, 6, 26,147, 34, + 11, 96,120, 55,250,111,131,198,247, 74, 55,144, 38,124, 5,105, 50,221, 81,203, + 2, 81, 15,161,166, 27, 30,168, 21,127,136,198,208, 88,208, 82,114, 14, 12,228, +144, 74,128,158,114,142,205,255,183,135,102,180,255,181, 49, 75, 92,145, 72,234, + 29,113,107,249, 1, 46, 85,173,203,120,222,252, 18, 88, 64, 14, 47, 84,233,157, +133,233,185,100, 34,218,135,220,167,102, 36,118,189, 40,138, 32,148,160, 17,145, +188, 72,147, 45,190,238, 85, 5, 74, 5,105, 35, 50,211,147, 61, 1,137,220, 10, +233, 54, 92,240, 21,242,111,255, 20,247, 56,145,210, 81,106, 70,103,244, 4,255, +183,142, 1,179, 7,144,172, 88, 40, 59,211,171, 72, 99, 92,220,127, 47, 85,111, + 11, 22, 31,187, 23,252,242, 74,186, 49,112,219, 66, 81,194,253,243,217,234, 22, +140,100,205,197, 59, 5,215,204,189, 50, 71,184,122,200, 20, 84,243,102, 17, 57, +192, 21,253, 60,135, 37,191,252, 72, 10,161, 69,209,221, 69, 33,124,204, 65, 9, + 12, 28, 14,195, 86, 17, 83,178, 73, 93,147,130,161, 21,124, 40, 65, 32,120,135, +184, 28, 57,248,239,139, 80,178,161, 42, 45, 11,109,180,180,223,115,125,153,120, + 16, 77,246,227, 69,149, 62,136, 70, 31,106,163, 20, 50,133, 65, 65,210, 12,124, +224,122,200,196, 19,171,122, 51, 38, 0,216,143,194,197, 35,211,242, 83, 82, 95, +150,208, 27, 49,150,164,223,196,248, 48, 55,162,219,149,121,186,141,178,247,206, +157,228,236, 85, 69, 52,248,137,227,241, 10,131, 2,110,114,226,122, 6,140,163, + 0,192,254, 68, 58,170,152,193,239,150,250, 20, 70,251, 4, 0,109, 39,127,236, + 89, 52,196, 94,205,177,144,205,193, 95,126, 27, 66,249, 63,252,247,241,121, 16, + 62,143, 26,242, 64,210, 47,171,232,209, 12,185, 1, 35, 73,198, 19, 62, 65, 45, +228, 70,152, 88, 87,241,237,133,151,227,210,122, 4,196,199,142, 28, 67, 76, 43, +179, 84, 27,168, 33,226,141, 63,217,154, 99,201,122,100,202,116,160,244, 20,232, + 76, 88, 84, 83, 70,224, 16, 18,204, 68, 94,173, 3,204, 88,245, 69,224,197,221, +142, 80,143, 76, 97, 40, 6,251, 9,164,251, 13,102, 29, 39,197, 44,100,149,116, + 75,140,236,197, 10, 35, 89, 46, 18, 57, 62, 22,173,128,211,192, 13,247, 82,248, +129,155, 21,150,228, 20, 36,225,252, 32, 91, 7,211, 42,214, 10, 43,236, 19,120, +102,191,148,211, 36,139,202, 63,193,155,190, 40,230,188,177,235, 20,110,120, 88, +197,169, 60,169, 34, 41, 95,231, 94, 86, 57,181,139,255, 89,202, 75,198,238,126, +101, 42,203, 99,121,242, 18, 27,226,198,241,186, 16,107,114,244, 15,200,132,189, +198,151,141,203,215, 29,116,196,206, 69,228, 74,198,201, 92,103, 6,119, 32,116, +196,104, 21, 17,248,186, 78,215, 69,248,199,233, 83,234,109,125,152,160,249,165, +233, 71,247,195, 19,109,126, 25, 42,135,125,188, 41,105,242,145, 44, 32,196,247, + 1, 23, 12,218,233, 57, 4,169,142,204, 41, 26, 95,128, 17,149, 31,195,171, 79, + 78,130,217, 88,175, 28, 32,117, 4,187,110, 93,149,115,102,217, 50,162, 17,168, + 49,139, 34,251,145,190,222,141,165, 11,182, 61, 17,244, 91, 96,156,232,235,167, +190, 94,182,161, 95,172,142, 73, 45,212,168,253,234,158,215, 17,234, 36,171,242, +140, 79,121, 34, 29, 34,204, 14, 82, 18,208,205, 59, 56, 3, 18,185, 99,133, 77, +173,223,143, 66,191, 71, 60,221,111,143,191,157,203, 31, 94, 26, 6,195,131, 42, +205, 48,249, 36,114, 56, 5,208,224,217,179,170,243,198, 6, 41,133,223,172, 93, +104,153, 42, 23,230, 86,252,115,220,238,215,235,251, 42, 89,247,225,105, 45,164, +125, 17, 26,116, 80,185,125,103,122,109,132,133,254, 31, 7,208, 80, 81, 23, 47, +172,135,150, 88,148, 88,163, 68,190,193, 1,111, 36, 50, 30, 31,151, 36,253, 57, +133,161, 47, 77, 0, 48,186,254,165,113,185,190, 72, 92, 71,158, 93, 80,254,141, + 28, 25, 94,138, 29, 6,204,104,208,109,132,105, 77,200, 13,211, 84,247, 0, 58, + 70, 44, 89, 0,137, 50, 1, 38,104,130,120, 49,147, 0,126,169, 91,221, 70, 68, +237,129,214,129, 10, 14, 50, 3, 94, 98, 8, 95,143, 57, 78, 0,219, 85, 96,104, +102,245,226,119,255, 99,252, 0,130,216, 88,155, 32, 22,179,102,107,232, 36,176, + 20, 66, 56,143,166, 69, 88,196,189, 55,194, 64, 19, 50, 45,101,159, 21,150, 56, + 53,147, 30, 89, 5,225,244, 50,230,128,169,243,146, 21, 93, 8,160, 70, 25, 3, +228,153, 28, 7,159,107,100,134,133,121,214,179, 64, 15, 24, 44,211,180, 63,205, +187, 50,229,134, 92, 29,246,194, 71,189,255, 56,179, 77, 96, 64,243, 38, 63,142, +169, 80, 7,122, 95, 69, 25,168, 55,144,146,254,196,212,142,150, 65,134,121, 9, +179, 33,193,247,212,180, 52, 33, 64, 88, 94,159, 56,159,253,131, 20,158,204,147, +207,203, 74, 28, 10,211, 52,241,140, 89,141,245, 42,166,159,149, 82,213,151,109, +121, 86, 86,156,105,246,140, 90, 61,243, 23,100,133,187,209,168,108, 46,214, 74, +120, 92,138,217,166,252,195,131, 27, 48,189,197, 84,180,175,185, 31, 14,217,235, + 28,168, 46,155, 33, 41, 15,137,121, 8,243,172,183,110,232,146,203, 53,120,128, +155, 18, 60, 8,235,110,244, 2,223, 43,153,248,192,185, 3, 3,209, 70,189,130, +149,155, 47, 22,110,116,142, 96,131,231,246,158, 7,178, 20,142, 89,238,179,237, + 65, 4, 12, 16,104,232,146,208,158,191, 76,122,165,160,209, 73,169, 57,255,167, + 66,127,163,106,192, 35, 31, 52,159,186,134, 34, 9, 1, 25,123,194,186, 31,116, +205,243,165,121,231,214,190,151,209,143,248,133,226,177, 73,139, 31, 38, 39,159, +251,111,127, 58,116,171,147, 61,142,181,112, 57, 27,114,110,163, 0, 63,217, 38, +174,217, 77,230,150,226, 60, 48, 16,153,177, 50,182,102, 14,165,225, 11, 74,173, +203,238,167, 38,136,247,202,240, 54,251, 37,186, 92,158,126,186,133, 98, 23,132, + 89,191, 58,191, 57, 50, 44, 0, 56, 70,190,110, 7,178,105,130,205,121,195, 8, +136, 23,121,191, 51,207,225,177,167, 6, 34, 69, 1, 51, 67, 82,202, 41, 2,141, +140,162, 81, 90,236, 3, 92, 23,217, 9,101, 73, 59,232,157,166, 1,235, 85,110, +218,111, 51,170,189,244, 19, 14,132,202,202,232, 75,118,209,135,105, 15, 66, 87, + 93,104,194, 71,226,246, 78,169,140,115,250, 53, 72,117, 70,233, 94,213,249,101, +175,197, 9,125, 38,149, 61, 12,245,170,129,251, 2, 97,232, 44,173, 34,105, 11, +125, 22, 21,195, 1, 33, 44, 54, 32, 40, 32,227,224, 35,206, 85, 27,161,247,149, +208,147,191,103,232, 38,172, 45,178, 59,248, 67,204, 4, 20, 97,176, 84,128,156, +170,144, 9, 80,181,218,245,242,158,124, 52,174, 35,113,189, 36,123, 4, 81,153, + 87, 6, 60,146,253, 72, 73,141,129,149,233,201, 53,215,113,189, 78, 57, 44,109, +176, 42, 80,104,255, 81,149,192, 72,134,155,231,201,143, 79, 0, 71, 50,132,151, + 30,192, 62,226, 4, 32,141, 67, 15,153,159,218, 25,161, 6,221, 42,113, 71,208, +103,204,139, 42, 9,185, 41, 95,255,166,133, 12, 40,133,123,102,166,210, 94, 71, + 7,197,156, 48, 79,174,253,227,183,172,129, 21,214,161,117,157, 32,241,144,115, +169,179,208,205, 37,130,137, 18,241, 26,253, 3,191, 52,209, 66,252, 94,191,182, +166, 69, 11,227,247,234,154,218, 45, 42, 38,223,194,150, 4, 9, 40,208,240, 22, +245, 47,224, 11,223, 29, 95,139, 80, 16,109, 91,247, 84,240,153,247,201,253,241, +202, 17, 74, 81,162,226,166,213,123,151, 64,133,139,102, 68,165, 89, 1, 84,176, + 8,240,186, 21,165,244,224,194,191,243, 65, 31,120, 41, 93,154, 23,227, 79,111, + 21,132,234,255,184, 28,227, 47,251,151,143, 76,103,169,137,155, 22,242,159, 64, +215,217,207,126,132,239, 44, 92,116,251, 66, 57,177,229, 50, 26, 32,236, 14, 50, +221,231,213,133,173,162,161, 59,246,148,110, 78, 80, 78, 44, 52,114,253,148,255, + 66, 92,178,146,197,191,223,151,220, 21,245,118,150, 75,133,100,210,113,115,138, + 58, 38,250,234,168,139, 37,132,177,209,211,215,186,148,145,117, 29, 46,229,167, +195,245, 35, 73,165,156,111,190, 60,248,224,150,118, 19, 75, 29,227,101,192, 72, +117,133,197,102, 46, 40, 98, 43,253,203,171,145,105, 67, 13,117, 87,103,155,210, +230,218, 51,130, 79,198, 49,229, 37,213, 98,221, 56,192, 77, 2,250,225,199, 47, +124,159,133, 14,167,160,217,221,247,153,206,174,103, 26,243,191,161,247,185,104, +198, 4, 71,194,187,116, 40, 63,199,242,115,145, 98,164,137, 32,227,116, 95, 86, + 90,222, 83,124, 68, 48,192,209, 4,137,142,138,202,124,182,108, 98,189,129, 69, +183, 77,181,108,141, 80,138,112,203,121,222, 80,154, 93,189,167, 79,229,134,246, + 64,138,255,246,192,246,127,107, 14, 74,200, 3, 67,214,167, 88, 94, 56, 25,163, + 57, 61,228,126,167, 3,148,141,234, 6,240,162, 81,103,224,167,225, 52,156,125, +112, 88,195,215,168, 27, 9,103,131,178, 33, 26, 72, 21,105, 8, 71, 65, 70, 65, +132, 83,125,116,190,142,153, 56,116,129,108,170,103,123, 65, 68, 21, 54, 87,204, +154,182,116, 88, 14, 32,176,138, 30,231, 33,122,157, 40, 9, 74,107,229,195, 4, +132,186,127,135, 63, 18,144,171,192,102, 47, 13,240, 58, 51, 44, 41,235,186,158, + 31,173, 43, 36, 57,222, 87, 94,184, 35,105, 68, 14, 77,120,246, 32,210,102, 78, +238,116,243,107, 58,163, 42,162, 33,240,115,144,204,159,237, 23,211, 82,135, 69, +174,194,173,131, 45,142, 10, 36,229,232, 96,226,147,117, 83, 36, 41,225, 77, 31, +214,251,104,186,216,200,146,239,200,250,205, 16, 84,159, 48,110, 97, 16,171, 24, +217,240, 34,173,110,208, 92,159, 6, 85, 39,228,230,178,204, 62, 80,133, 77,252, +109,182,108, 30, 6,169,243, 76,150,190,242, 22, 83,215,198,132,235,192, 33, 65, + 26, 38, 17,132, 20,213,115, 27, 19,136, 60,169,232,156,210,157, 64,113,111, 38, + 31, 77,226,241,153,176,172, 36, 14, 6,208,219,140, 11,235,241,202,100,115,143, + 48, 72,198, 84,131,110,130, 40,214, 35,178, 82, 24,189,124, 6,115, 50,121,192, +240,209,226, 52, 4,156,142, 9, 11,164,219,175,167, 42, 25,206,188,166,169,222, +201,248,141,227,142,141, 86, 56, 19, 93, 77, 42,165,221,112,199,236,193, 67,114, +132, 18, 93,106,236,228, 84, 56,255, 88, 51,115,104, 78,243,146,214,110, 79,106, + 16,103,105, 40, 74,119, 81, 77, 40,152,159,208,101, 57,128,139,193,171, 1, 49, + 22,210,111, 15, 36,251,222,227,199,181, 13,130,222,131, 10, 44, 99,244,154,227, + 95, 86,210,224,131,247,193, 4,206, 23,201,106, 33,174,126, 55,111,207, 82, 84, +138, 94,191,200, 41, 40,254,235, 82,100,212,206, 32, 41,237, 74,123, 34, 94,144, +108, 37, 34,161, 10,209, 26,211,136,160,205, 84,224,132,164, 19,250, 12,207, 99, + 65,195,190,207,245, 2,240,175,147,213,111,191, 59, 99,193,239, 24, 70,190,187, + 91,164,132, 60,157, 46,225, 91, 96,251,211, 19,157,158,204, 8, 88,195, 53,174, + 3,117,200, 91,175, 6, 62,255,203,189, 46,227, 68,213, 7,235,239, 0,251,172, +194,244, 46, 5,211,111,125, 15,174, 11,145, 3, 28,194, 89, 69, 5,147, 41, 71, + 26,148,200,181,140, 16, 50,198, 49,147,162,113, 88, 21,169,170,229, 62, 34,124, +119, 78,217,178,176,230, 42,141,127,212, 89,170, 87, 77,172,155, 29, 82,254, 58, +147, 35,224,190,191,172,236, 15,207, 19,209,133, 88,139,141,147, 76, 68,247,246, + 72,120, 90, 65, 44,137,244,236,215, 99, 43,146, 84, 58, 59, 27, 73, 62,249, 92, + 37,210,115,104,253,207, 30, 3,179, 51, 12,187, 75,212,123,184,131,144,100, 21, + 80,179,144,216, 40,211,143,226,171,200,243, 79, 83, 79,214,104, 9,179, 42, 96, +206,241,213,126,222, 42, 46,126,233,175,156,117,168,171, 27,166,188, 50, 35,134, +150,228, 62,207, 16,254, 64,106,109,152,219,107, 43,231,108, 23,176,102,167, 76, +227,199,202,116,124,216,170, 4,136,133, 86, 15,129, 79, 90,111,187,160,249,204, + 92,140,189,177,135,233, 86,159,228,147,253,232, 8,206,164,199,223, 69,105, 32, + 7, 67, 23,164,211,183,208,209,112, 37, 85,239,197,122, 70, 85, 16, 5,173,223, +251,197,104,129, 41,229,117, 0,141,178,251, 98, 44, 40,192,172,111, 64,214, 84, +160,247, 84,238,112, 34,227,111,228, 7, 27, 36, 65, 14,172, 29, 1, 10, 75,252, + 13, 40,192,212,113, 3,120, 59, 0,177,120, 45,221,211,170, 3, 57, 51, 2,128, + 55, 40,127,212, 25, 16, 52, 90,121, 77,227,184,177,238,248,244,187,138, 98, 8, + 2, 84,215, 0,216, 0,216, 0, 7, 92,153, 76, 42,157,204, 72, 57,201,212,252, +176, 51,101,242,151, 40, 15, 97, 58, 24,141,196, 80,220,178,130,197, 31,153,110, +242,232,252,159, 92,159, 35,221,227, 7, 34, 9, 54,135,238, 17,241, 84,210,202, + 32,231,202, 79,166,125,189,115,235,162,174,156,170,242,147, 75,238, 77,121,121, +140, 34, 56, 18, 13,150,190,162,234,189,180, 92,193,216,193,186, 20, 8,114,242, +142, 4,187,151, 98,153, 61,147,131,252, 59,223, 80, 71, 35,210, 54,153, 84,233, +231,201,147, 41,225, 14,203, 87,239,220, 62,178,199, 0, 65,116,152,179,115, 75, + 97, 40,180, 15, 69,196,232, 3,194,144,232,230, 70, 93,170,102,183, 85,149, 87, + 63,214,164, 48,244,241,112,115,115,198,180,146, 48, 3, 3,244,231, 95, 8,219, + 99, 22, 35, 79, 43, 85,212, 85, 90,103,180,113,120,168,208,238,229, 98, 37,255, +252,148,196,184,171, 60,227,101, 6,125, 84, 47,229,133,225,193, 92, 42,173,193, +181,148, 27,118,178,121,176, 46,244, 34,119,133,198,177,210, 88,194,173,121, 66, +220,215,110,220, 78,167,237,221,152,207, 61,218,112, 71, 11,195,230,124,206, 72, +178, 27, 51, 43,167,199, 30,189, 62, 30,163, 5, 25,160, 37, 63,102,126, 72, 5, +133, 3,134,131,216, 86,167,242,149, 71,122, 48, 10,133,219, 68, 57, 5,152, 65, +228, 44, 65,129,129, 53, 77,227,204,109,122,222,236,184,202,251,202,183,137,124, +207,101,140, 88,196, 24,235, 92,114, 51,197,243,244,192,147,178, 72, 87,153, 47, +102, 10, 75, 21,123, 31,153, 47, 61,216,160, 31, 98,182,174,129,133, 92,192, 5, +119,154,252, 53, 32, 38,128,204, 37, 94, 76,126, 7, 6, 64,170, 8, 3,178,128, +240,208, 54,179,235,173,210,151,204,125,219, 75,238,186, 40,231, 34,178,112,166, + 45, 10, 53, 17,163,115, 98,156, 33,222, 9, 9,129,153,203, 10,185,240,165,128, + 51,209,214, 7,228,123,205,247,139, 89, 73, 88,120,231,223,102, 68,232, 8, 21, + 26, 92, 15, 14, 23, 69, 99,191,239,251,172,203,218,238, 41, 65,236,236,184,234, +165, 74,241,176,217, 56,140, 58, 1,154,199, 2,114, 86,161, 93,143,148,167, 89, + 44,184, 25,198,111, 50,213,128, 11,199,125, 15, 22,223,137, 74,239, 60,102,126, + 71,117,159,164,111, 20, 84,102,221, 2,135,161,234,213,110,174, 60,233,121,202, + 75,242,242,189,149,106, 77, 38,151, 47, 62, 33,173,211,249,104,236,230,109, 65, +182,248,162,186,202,150,195,149,197, 90,234,152,175,228,229,118,110,148, 75,174, +166,106,201,192,243, 44,174, 66,109,212,209, 70, 27,128,254,132,180,140,136,136, +207, 6,195,129,176,232, 14, 39,131,208, 70, 24,141, 22, 2,105, 16,144,255,222, +123,239,189,214, 90,155,105,125, 47,223,203,242,204, 92,213, 15,201,158,155, 70, +152,235, 67,234,153, 12,103, 11,177,194,157,201, 8, 15,172, 95,105,247,121, 39, + 59, 14, 41, 57, 7, 43, 92,225,182, 55, 58,216,201,229, 15,214, 10,106,172, 0, + 91, 72, 37,146, 66,155,196, 93, 53,224,152,248,194, 28,164, 46,105,142,198,143, + 30,178,255,100,234,252,238,252,162,213,202,246,202, 57,115,141,253,186, 45,135, + 35,220, 22,132, 36,171,123, 4,146,218, 59,141,253, 72, 28,143, 57, 48,245,161, +154,164,142,205,129, 23, 30, 97,206, 40,255,121,210,123,174,239,171, 94, 89,190, +145,139, 3,133,145,210, 94, 93,211, 31,244,109, 33,180,223, 54,219,218,127,173, + 36, 59,207,206,126,203, 90,182, 31, 86, 58, 77, 87, 57,238,123,102, 11,173,198, +242,103,223,246,183, 55, 53,111,254,195,236, 5,230, 73,190,197, 91,145,187,202, + 24,188,166,123,243,228,149,228, 95, 85,150,252,229,199,203,238, 46,179,188,124, +175, 76,155,113,183,109,242, 18,117,239,236,253, 18,228,106,203,178, 86,119,119, +119, 87,188, 74,169,132, 87,170,182, 41, 83, 22,119, 67,200, 5,143,180,168, 4, +251,245, 18,141, 64, 16, 0, 3,164, 0, 8, 26, 9, 10,100, 18,105,154, 73,138, +252,180, 32,135,131, 28,134,137,143,140, 69,162,160, 70, 16, 15, 0, 36,128, 1, + 28,130, 0, 12, 0, 24, 64, 1, 64, 1, 2,144, 2, 12,179, 15,202,183,128, 6, +127, 92, 23, 52,143,230, 24,184,172,246,205, 93,193, 81,182,217,192,189,138, 33, + 51,248,251,236,204,130, 45,229,171, 50, 28,242,105, 34,123, 1,175,157, 57, 98, +182,189, 65,134, 57,106, 42, 55, 67,158, 75,105,112, 74, 14,158,133,129,205, 66, + 55, 56, 41,135,176,194,214,122,146,186,219, 62,235,217, 68,183, 62,140,164, 80, +239, 13, 79,213,109,159,242, 9, 81,120, 93,246,130, 38, 73, 30,183,193,211, 85, +203,193,240,227, 46,249, 32, 60,229,155, 31,167,108,210, 36, 92, 43,159,237, 56, +101, 51, 49,225, 90,249,242, 6, 71,182,193, 76,174,167,116, 71, 47,248, 38,131, +158,200, 13,161,237,189,134, 91, 26,112,118, 13, 78, 54,200, 66, 48, 63,197, 37, +113,158, 22,186,161,171,220,137,209, 85,211,194, 23,124,141,201, 89, 28,165,197, +198,101,212, 67, 80,166, 0,217, 31,132,166, 4, 3, 47,157,178,129,188,125,198, + 22,255, 30, 0,223, 95,188,179, 75,251,209,108, 34,202, 24,144,114, 3,237,212, +249,224,172, 74, 50, 8, 46,114,148,145,189, 8, 54, 17,209,231,104,209,232,209, +103,226,186, 89,167,110,179,237, 56, 90,182,169,124,168,105,184, 9,194, 49,251, +108, 38, 3,210, 0,131,248,227, 38,130, 23, 92, 60,105, 49,228,120,229, 23,173, +212,170, 64,138,191, 38,238,188, 10, 34,181,115,245, 18,207,157,230, 12, 69,115, + 1, 11,166,153,153, 20,123,134,230,128,176,151, 59,112,199,167, 16,236, 29, 7, +211, 27,138,250,235,238,199,113, 8,198,228,122,250,187, 88, 65,240,141,181,255, +151,144,226,147,230, 69,147,228,112,199,148,196, 20,135, 85,142,143, 85,112, 93, +236,185,179,216,111, 68,123,147,124, 28,202,135, 36,123,200,155,231,102,241,176, +159,161, 44,137, 98,215,112,203,120,246, 87, 19,149,113,185,202, 37,175,165, 76, +200,140,185, 68, 77, 71,117,188, 96,118,117,217,206,241, 86,100,228,120, 51,182, + 64, 49, 55,111, 42, 84, 2,182,161, 82, 90,246, 74, 76, 19, 41,230,128, 24,141, +162,177,196, 6,146,174, 77,142,151, 66,241, 43, 4,202,105, 19,125, 2,158, 35, + 81,181,121, 2,110, 51, 34,151,162,106, 33, 83,172,194,159,165, 24,226, 96, 31, + 33,179,158,192,141,139, 31,169,211,158, 88,188,253,206, 4,215, 9,195,109, 69, + 89,161, 25,105,233, 19, 32, 76, 92,207, 75,153,119,250, 6,230,177,165,199, 20, +240, 39,195,134,224, 19,195, 32,160,108, 21,194, 36, 12,193, 64,217, 39,132,229, + 47,132, 5,101, 92, 8,232,188, 16, 26,148, 69, 33,196,232,130,152, 80, 86,146, +112,146,208,177, 80,240,196,101,211, 66, 88, 67,233, 12, 39, 34,203, 89,206,193, +199, 98,116, 15, 93,191, 20,228,160,190, 45, 48,124, 27,147,237, 80,239,190,245, +196,123,133,220,117,106, 74,161, 78,175, 28,167,115,134, 80, 46, 67,102, 92,188, +178,124, 37,241, 95,175,236, 17,179, 39, 32, 42, 51,154, 2, 66,108, 41, 57, 15, + 90,243,222, 5,170, 59,192,227, 49, 21,158,187, 92,185, 16,104,224,167,156, 73, +126,105, 36,185,101, 29, 20,192,163,217,165, 90, 4,211, 68,226,203,203,162,152, + 81, 58,252, 51,172,130,233, 38, 21, 56,208, 56,232, 93, 12,104,129, 82,128, 16, +159,190,250, 32, 17, 63, 52, 4,195,241,226, 55,114, 31,127,251,207,139, 74, 37, +245,111,158, 93,151,220,223,115, 24,244, 42,142, 15,181,203,164, 51, 62,224, 97, +135,177,232, 70,159,149, 24,207, 27, 34, 58, 6,162, 12,252, 20,160, 46,255, 7, + 2, 66,144,161,103, 32, 67,154, 67,193,104,204,127, 18, 12, 61, 25, 24, 47, 89, +243, 16,201,223,179,131,175,159, 52,107,152,128,158,235, 31,242,218, 33, 25,120, +120,138,182,116,142,189, 10,144,148, 21, 9,204, 16,225, 63,170, 73, 16,237, 18, + 7,209,224,139,134, 55, 70, 10, 0, 25,214, 2, 6,205, 13,154,195, 16,142, 98, +210, 53,145, 98,199,137,142,148,150,228, 2, 57,158, 90, 44, 42,101,131, 70,241, +251,112,122,151,226,107, 17,213, 68, 29,152,194, 40, 69, 52,140, 48,250, 4,253, +117, 66,123,216, 75,189, 10,205, 37, 12, 29, 57, 77,134,132,180, 76, 91, 46, 46, +222, 92,142,168, 17, 0,166, 44,115, 94, 75, 43, 87, 58,110,167, 77,220,246, 36, +175, 58, 25,193, 18,196,234, 78, 77, 50, 9,165,221,220, 39,173,182,135, 77, 70, +147, 12, 54, 32,116, 80,156, 49,165, 9,105,159, 10,133,107, 69, 38, 70,246, 65, +114, 95, 0,246,164, 68, 56,180, 68,209,212,244, 45,137,201, 60, 61,182, 25,186, +184,131,234, 55,215, 62,191,147, 47,114,147,247, 88,235,188, 38,180,236,141,178, +190,203,187, 76, 83,101, 69,253,125,109, 40,182, 22,125, 60, 87,116,153,158,114, +217,227,117, 77,120,144,166,220, 47,163,133,165, 76,126,107, 76, 45,141,158,130, +203, 39, 43, 70,210,218,203,231,107,158,203, 46,152,114,152,176,128, 40, 93,197, + 84, 32,142, 37, 49,129,209, 84,147, 93, 47, 39, 54,158, 98,242, 14,239,121,188, + 36,219,250, 26, 34, 29,205, 5,226, 7,153,205,178, 17,166,107, 27, 37,145, 64, + 47,147,212,119,188,143,223,214,192, 56, 63, 0,161, 8,221, 37,205, 43,203, 9, +230,245,254,192,158,228, 39,195, 82, 82, 11, 9, 43, 39, 62,189,101,182,111,221, +163,152,243,186, 72,192, 64, 53,160,102,206, 73, 51,121, 31, 59, 87,113, 29, 6, + 58,226, 66,117,151, 45, 31, 47,214,131, 1,237, 92, 10,238,209, 5,117, 78, 33, +117,228,112, 18,221,131, 3,121,115, 77, 79,254, 30, 28,203, 7, 60,192,171,121, + 70,212, 56,221, 91,148, 76, 79,147,161, 98,106, 43,208, 19, 38,154, 90,156,207, +182,120,104, 64,188,152,187,205,100,119, 11,180,219, 74,216,183, 51,255, 18,225, +181,109,106,135,130,235, 80,163,247, 6,187,157,219,101,116,124,130, 83,250,198, + 97,185, 6,112, 87, 4,183,173,104,119, 76,192,123,127,227,132,137,245, 78,254, + 17, 45, 21, 76,105,131,214,136,159,190,224,154,199,237,228, 8,250,128, 8, 3, +236, 36,185, 51,146, 59,124,188,137,255,143, 44,155,220, 34, 61,102, 71,134,204, +143,227,185,110, 21,180,192,238, 37, 7,114,198,245, 88, 13,180, 28,129,202, 68, + 49,136, 92, 22, 64,255, 69,114,186,137, 12,253, 93,175,152, 92,147, 55,184, 28, + 61,212,121, 12,109,103, 45, 3,215,141,233,162, 20,175, 20,227, 6, 95,109,205, + 39,169,219, 16, 44,104, 91, 3,114, 7,187, 69,133, 56, 51,163,241, 52,222, 58, + 2, 50,181,155, 16,187, 62,222, 45, 62, 10, 49, 72,147, 58,243,226, 13,158, 64, + 0,184, 27,204, 51,137,131,183, 11,147,236,218,183, 66,193, 70,161, 97,114,149, +166, 5,240,150,212,157, 21, 59, 25,109,201,140,132,165,104,143,107,136, 72,203, +175, 9,246,245, 79,107,161,103,145,247,185, 47,139,198,202,162,204, 27,203, 58, + 92, 88,220, 33,142,175, 60,196, 31,115, 93, 65,167,127,157,138, 39,222, 19,189, + 68, 40, 56, 57, 35, 82,151,234, 24,175,252, 22, 49, 75,231,171,224, 22,173,166, + 44,168,178,172, 39, 87,242,232,148, 49,164, 68, 66, 49, 74,138, 56,204,189,191, +135,251,239,108,241,221, 3,143,108,131, 46,185, 90, 51, 89,231,205,186,165,230, +223,196, 65,255,230, 33,148,184, 79,213,138, 3, 83, 36,207,237,234,213, 48, 58, +242,139,194,216,158, 71,237,137, 8, 17,201,216,171, 1, 88,145,235,185,192,154, +165,147, 34,192, 33, 19, 71, 21,233,186, 56, 84,115,212,151,112,221, 1, 86,135, +228,235,189,226, 92, 18, 36, 82,115, 33,236, 59,200, 36, 58,143,247,209, 8,153, +245, 64, 48, 10, 41, 50,173,142,139, 58,148,227, 74,164, 27, 66, 58, 76, 75,146, + 66,209,176, 89, 28, 16, 41, 47, 82,231, 99, 16, 74,222, 31,187,246, 8,179,252, + 66,154,249, 60,132,103, 60, 36,215,178, 98, 29, 30,168, 57,226,177,189, 97,177, + 34, 84, 17,129,254,237, 31,104,240, 43,210,179,243,134,192,221, 58,206,200,199, +161,237, 8,214,137,252,222,110, 17,133, 40, 73,195,117,228,111, 7,239, 16, 93, +180, 67,101,162,138,120,108,120, 54,193, 92,239, 64,223,218, 1,114, 58,194,132, +116,110, 29,159,122,106,251,210, 22,221,130, 45,191, 55,198,209,142,122,228,221, + 54,181,214, 57,156, 32, 29, 22,132,217,126,147,119,156,119,103, 75, 14,249,189, +182, 8,164,175, 50,227,113,151,209, 71, 25, 17,226, 9,140,108, 2,202, 69,139, +160, 24,107, 95,254, 75, 7, 97,244,140, 50,131, 26,161, 82,139,120,133, 73,180, +107,176,139, 41,145, 17,147,231, 98, 51,144,221,115, 74, 94,178, 27,167,238,243, +189, 56, 13, 82, 17,159, 4,131,235,209,244, 10,139,142, 86, 55, 65,156,241,231, +140, 54, 83,167,242, 11, 29, 17,192, 39,240,250,185, 1, 64,168,223, 16,218,167, +213, 47,136, 34,192,229, 49, 13, 96,156,168,196,142, 68,114, 21,152,204, 99, 99, + 46, 42, 49,193,157,159, 22,251,122,238,213, 14,149, 49,148, 99, 61, 12,253, 14, + 76, 89, 49, 11, 14, 50,130, 2, 0,105, 33,232, 99,172,238, 61,216,254, 31,189, +161, 82, 41, 51, 12,187, 11,192, 57,200,187,166, 37, 4,132,250,222,166,123,229, + 64,251,156,195,151, 22, 42, 33,110,251,118, 59, 67,108,201,188,131, 71, 97,181, +243,135, 37,157,221,230,207, 75,123, 48,215, 15,101, 12, 37, 84, 0,189,167, 21, + 79, 35,234,224,134, 75,138,180, 96, 0,222, 84, 45, 54, 70, 33,143,160, 98,159, + 29,216,115,246, 14, 26,134,226, 49,110,117, 43,184, 8,157,116,250, 83,232,215, +181, 73, 58,137,118, 71,253, 81, 25,107, 71,211, 45,207, 64,254, 16, 1,141, 3, +161,120, 17,160, 8, 78,144, 4,118,168,205, 28,175,238,130,222,197,181, 17, 72, + 95, 26,206, 12, 79, 13, 23,191, 61, 20, 61,119,161,230,248, 12,135, 78, 45,128, + 49,137,205,205, 6, 26,110,124, 84, 51, 35, 75,232, 41,112, 76,131,192,152, 31, + 2,232,107,196,247,116, 36,124,136,154,227, 35, 7, 85, 11,117, 90, 93,204,145, +207, 76,134, 88,122, 80,185,154, 79, 98,253,212,219, 9, 26, 3,225,240,219, 51, +188, 40, 76,232, 35,110, 40, 8, 3,162, 92,104,169, 59,193, 3,190,208,200,185, + 25, 97, 82, 78,177, 94,110,108,206,148,232,159,158,236, 55,161,233, 37,133, 80, + 94,193,133, 36,112, 38, 27, 41, 64,217,233,111,142,144,142,152,107, 96,126,180, +100, 74,178,237, 13, 14, 71,238,147, 16,155, 77, 22, 10, 39, 74, 76, 50,134,243, + 75, 74,150,142, 17, 75, 86, 9, 44,115,197,234, 87, 39,154,208, 54,135,192, 25, + 86, 13,206,255,131,200,249,121, 36,133, 96, 78, 45, 47,182, 36,249, 66, 19,181, + 30, 67, 15, 47,204,166,202,135, 90,234,241, 5,148, 46, 17,205,197, 53,167,126, +194, 72,162,159,163,117, 98,118,158, 72,216, 31, 8,186,166,128, 48, 74,158,148, +184,246,117,194,115, 17,219,154,113,131, 38, 15, 61,197,196, 98, 28,223,208,229, +233,191,232, 10,121,173,227,161,245,122,196,226,205,146,120,203,213,253, 5, 2, + 59,233,125,152,234, 13, 23, 81,208,238,190,157, 92,108,175, 23,188, 78,130,183, + 14,120,123,185,230,231, 40,206, 92,233, 73, 32, 68,146,188, 3,106, 25,116, 71, + 21,191,136,159, 22,198,156, 88,244,188,109,127,234, 38,254,254,197, 91,218,197, + 73,246, 15,131, 51,164, 91,252,103,143,120,215,123, 4, 90,222, 92,248,188,144, +165, 1,177, 72, 88, 25, 97,219, 99, 17,114, 53, 11,103,111,236,207,188, 86,235, + 96, 38,202,185,104,249, 1,150,165, 92,114, 41, 86,166,129, 15, 30,235, 59,117, +102, 90,106, 91,126,199,212, 89,131,143,156, 70, 1,137,147,174,184, 1,144, 75, +196,247,167,213,134, 94,176,183, 53,173, 88, 33, 7, 14, 96,242,104,217,170, 42, +170, 73, 18, 50, 38, 42,192, 18,139,114, 31,225,114,216,222,164,197, 36, 85, 44, + 11, 11, 89,165,204,192, 36,230,185,141, 23, 90, 55,160,155, 48,136, 42,162, 73, + 40,143, 22,129, 76, 32, 64,130,205,230, 61, 51,192,123,183,156, 30,217, 0, 74, +164,243,120,230,185, 62,157,190,175,233,218,255, 86,248,105,110,232,127,236,133, + 3,226,254, 18,115, 26,132,201, 97,160, 80,189, 34, 97, 47, 87, 89,108, 6,228, + 2, 96,109, 4, 69,188, 17, 97, 2, 87,248,216, 85, 50, 24,182, 88, 70,246,142, + 52,242,217, 14,172, 13,132, 38,199,151,193,101,145,216,209,255, 54,120,178,135, + 69, 59, 34, 60, 81,140,138, 3,133, 78,140, 28,172,145,197, 63, 99,201,185,135, +184, 74, 74,185,106,179, 65, 20,121,155, 52,142, 9,127, 60, 78,110,178, 5,154, + 69, 31, 65, 32, 16,215, 83, 75,250,224,148,233, 21,102,203,144,115,107, 25,131, +125, 58, 94, 5,154,169,155,143, 66,187, 59, 10,222, 43,234,142,205,187, 8, 97, +146,145,205, 44, 3,248, 98,248,197,205, 63, 81, 67,195, 92,166, 34,172, 17,250, +105,150,125,228,232,228,107, 80,238,189, 13,230,127,115,234, 45,223, 33,124,209, +243, 21,159, 78,147,121, 95, 45, 14,181,216,115,236,248,233, 78,240,147, 14, 26, +217, 1,208, 37, 29,181,133,221, 80,185,239,214, 88,173,154,203, 81,132,199,220, +126,226,110,215,188, 1,160,113, 72,199,103, 93,124,166, 70, 62,134,192, 54,195, +170,169,117,148,245,205, 69, 47, 91,198,108,225,122, 70,248, 56,148,126, 43,162, +133,213, 4, 99, 97,176,144, 24,164, 48, 99,114, 25, 99, 1,157,189, 24,242, 85, + 46, 71, 12, 26,196,224, 75,189,226, 82,180,245, 15,197,105,232,225,163,233, 38, + 22,197, 87, 73,221,133,156,178, 1, 43, 37,113, 37, 18, 81,114,126, 24,118,138, +223,254,224, 21, 86,178,226, 1,130,184,114,116, 29,115, 65, 44,195,104,217,209, +156,155, 32,134, 13, 95,134,163,248, 62, 42,102, 29,179,253, 28,166,235, 16, 70, +138,185,181, 67, 45, 13,233,121, 82,120,237,181, 3, 97,239, 1, 94,253, 34, 67, +183, 46, 74, 21,134,149, 12,188,233, 93, 29,150,130, 81, 71, 77,170, 0,236, 72, +152, 46,135, 23,242, 98, 44, 35,197,106,252, 48, 65, 33, 45, 83,254,145, 70,156, +149, 11,185,113,208, 75,230,250,252, 19, 71,221,116,210,196,188,255, 18,115, 14, +209, 38, 78,133,227,240,104, 24,134, 71,103,232, 88,190,155,129,101,117, 31, 3, +161, 22,147,158,203, 26,191,210, 95,180,209, 82,110, 12,160,146, 26,187,142,131, +109, 82,154, 23,213,104,182, 35,205, 54,251,208, 2,229,222, 17,168,172, 19,227, + 42, 26, 93,212,183,114,238,225,121,166, 90,150,250,133,144, 17,186, 97,123,190, +253, 16,178, 86, 65,126,140,139,126, 41,195,157,159, 27, 53,146, 66, 63, 53,120, +151,125, 97,162,103,133, 8,141,124, 43,194, 33, 27, 69,223, 21, 37,106,229,233, +230,199,141,251,194,220,243, 88,166,151,190,233, 24,198, 63, 31,140,150,225, 39, + 4, 20, 65,234, 29, 87, 52, 60,210,195,210, 5, 66, 5, 61,182,200,100,211,120, + 62, 73, 46,100, 88, 70,222, 31, 5, 5,203,130,180, 9,182,227, 41,217,155,208, + 70,116,200, 98,163,195,246, 56, 47,235,242, 69, 1,186, 59,111,144, 17, 31, 67, +241,168, 8,147,228,158,230,101,189,127, 81,128,122,199, 13,129,226, 63, 67, 42, +220,180, 81, 93, 81,195, 16,188,203, 5,147,252,159,231,210,119,180, 34, 32,220, +112, 82,227,175,253,227,149, 23,183,103,177,192,138, 72, 84, 30, 40,240, 11,228, + 9,112,187,164, 34, 43, 96,235, 56, 87, 38, 79, 96,176, 99,127, 74,136,194,109, +145, 89, 99,178,174, 31, 4,206,160,221,254,131, 31, 97, 15,106,113, 35,152,144, +193, 90,228,247, 56,131,245,198, 12,218,101,116,144,142,162, 26,120, 17,154,109, + 97,152,153,112, 93,167, 3, 98,177,132, 87,111,102,148,132,189,222,103, 61,203, +150, 96,118, 0, 15, 79, 52, 57,147, 73,183,208,225,140, 71,218, 13,102,239, 36, +105,177, 9,213,210, 86, 96,214, 85, 78, 0,143,105, 97,100,123, 58, 70, 10, 93, +221,171,210,226, 22,165, 48,217, 87,168, 75,168,107,160, 98, 91, 18, 13,201,121, + 81, 96, 91, 58, 61,104,159, 22, 97,131, 44, 90, 94, 53, 71,157,152,132, 10,232, + 39, 35, 17,165,230, 97,169,114,135,206,176,245,133, 68,100, 72,208, 78, 30, 41, + 10, 88,190,229,150,164,236,121, 41,237, 6,110,220,153,253,107,113,127, 24,141, + 14,168,205,101, 7, 25,160, 14,159, 51, 95,137, 27,106, 63,223, 11,141, 98,190, +225, 47,138, 67,156,252, 14, 78,238, 76, 44, 0, 86, 48,152, 0,169, 89,171,135, + 31, 52,172,147, 56,177,179,159, 74,149,206,198, 42,165,168, 83,244, 97, 84,235, + 86,156,210,163,160,232,215,183, 10,128, 81, 16, 24, 68, 8,224,172, 22, 42,150, +170,195,101,202,125,148,113,251, 83,242, 52, 82, 50,211,130,244,176, 49,177,186, + 39, 83,136,254, 90,107,204, 84, 0, 83,166,134, 31, 84, 24,123,216, 73, 53,254, + 58,174,206,145, 21,212,251,182, 6,233,245,240,252, 70,168,165, 73,229,192,211, + 12,253, 68, 65,152,165, 71,117,185, 43,192, 4,211,148,185,228,106,249, 39, 45, + 81, 55,246, 91,250,150,201,251, 26,248, 77,130,228, 13,249,181, 29, 74,244, 68, +238,156,171,198,148, 39, 66, 31,116,176,189, 77,119,114,113,207,203, 98, 13,129, +213,170, 48, 14,149, 56,164, 38,179,129,210, 58,203, 4,146,252,234,184,252, 79, + 35, 43,226,211,205,239, 15, 82, 61, 89, 56,173, 80, 93,133, 91, 84, 75, 73, 87, + 66,156,140,159,111,188,151,175,125,171,244,143,195,167,151, 22,218,111,224,138, + 35,114,198, 9,241,220, 9,131,146,207, 33, 40,151, 7,242,147, 42, 35,239,219, +245,224,154,228,205, 10,133,185,197,116, 29,206,247,121, 50,151, 8,160, 38,184, +190,103,246,112, 26, 78,140, 73,198,130,243, 57,132,113,112,207,147, 72,191,136, +221,252,128,211,135,139,115, 61,123,155,132,208,103,226, 61,220, 82, 48, 51,193, + 73,132, 61, 43,140, 92,207,139,122, 76,208, 20,211, 57, 0,142,241,111,153,114, + 70,122,137,108, 41,141, 9,207,163, 62, 63, 49, 88, 62,118, 91,109, 54,202,206, + 1,191,238,237,201, 95,162,128,180,206, 83,206,224, 89, 67,163, 56,249,102,153, +145,212, 74,159, 19,129,110,193,118,154,165,121, 71, 2,244,120,187, 79,221, 12, + 10,180,166,207,160, 45, 49, 99, 21, 67,172, 36, 66,196, 33, 39,180,189,223,102, + 36, 47, 45, 80, 68, 16, 98, 59, 89, 39, 88,222, 7,116,142, 11, 90,226,246, 78, +110,229, 94,231,187, 62,195, 95,166,216,175,124,191, 72,211, 14,198,189, 21, 66, +214,153,178, 34,162, 73,154, 84, 31, 77,227,231, 21, 29, 39, 5, 56,176, 58,146, +185, 22,219,117, 53, 63,126,235, 73,221,103,133,159, 43, 52, 29,219,132,166, 79, +136,216,218,112,212, 79,136, 64, 67,222,141, 2, 47,248, 27,125,240,186, 36,130, +188, 19, 10, 8,199,186,144,226, 42,206, 11,190, 87,199, 40, 39,221, 69, 28,207, +162, 92, 87,108,100,167, 30,208, 95,166, 24,196,252, 17,167,148,208,254,140,233, + 32, 71, 50,146,175, 17, 29, 65,113,205,245,135, 64, 81,172, 75,247, 92,128, 35, + 12,168, 32,146, 78, 66, 57,209,115,140,104,243,161, 26,198,142,156,166,241,176, + 45, 21,133,140,249,210,133,225, 54, 41, 33, 41, 99, 56,220, 5, 5,206, 52,215, +159, 62,246, 91,179,148,242, 88,169,206,168,124,234, 46, 63, 20, 42, 19,253, 32, + 4,214, 3,141,110,213,247,195, 71,136, 34,239,179,127, 2,171,193, 49,153,182, + 60, 66,182, 68,231, 45,216,131,204,198, 47,128,201,214,254, 52,120, 70,117,158, + 28,247,238, 74,252,153, 29,142,116,105,196, 5,176, 39,223,201, 73,136,104,226, + 79,134,141,139,107,164,115,147,243, 85,145, 2, 28,181,147, 22, 12,242, 13,199, + 21, 53, 77,189, 68, 93,187, 39,134,161,148,145, 61,178, 60, 66, 26,114, 1,145, +221,114,147,181, 92, 47,216,211,184,197,155, 66, 78, 45, 86, 37,153,236,233, 21, + 85,218,104,198,162,167, 51, 49,170, 83,161,102,224,150,218,243,101, 16,152, 40, +104,182, 12, 38, 38,224,130,233, 35,240,191,160,246, 6,147,100, 96,162,184, 24, + 63,103,235, 14, 15, 74,253, 51, 10,142, 50, 87,182,222,225,115,134,201,108, 53, +252,192, 83, 56,238, 3, 48, 17, 64,211,231,173,255,170, 15, 71,208,115,148,179, +161,239,198,241, 6,206, 44,165,232, 94, 45,195,179,215,139, 6,149,180, 87,228, + 96, 47,251, 97,198,149, 97, 17,238,116,136, 17,210, 95, 42,201, 10,172, 43,236, +195, 21, 52,189,150, 71, 55,160,245,111,208, 77,243,189,205, 62,208,137, 52,222, +192,138,138,167,205,151,187,209,186,124,209,203, 39,202,112,116,119,155,238, 87, + 25,131, 13, 9,136,147,232,255,165, 12,144, 10, 26,108, 98,150,157, 13, 28, 60, + 94,207,124, 28,137,199,171,122, 88,113,147,136,177,184,105,128,216,162, 81, 47, + 55,240, 32,234,141,235, 6,141, 62,119,180, 84, 69,189, 55, 66, 61, 85, 54,204, +220,215,130,143,163,211,250,238,163, 26,117,230,205,152,226,102, 83,227,121,141, +156,202,185, 41, 48, 89,157,107, 70, 7, 96,245,194,173,163,224, 75,238, 26, 55, +183,192,145, 91, 10, 20,145,129,243,144,146,193, 39, 54,196,108,228,232, 10, 9, + 48,114, 68, 16,247,197,143,155, 33,164, 24,137,224,212, 50,228,232, 17, 46,136, + 56, 76, 45,246, 60,158,146, 30, 2,165, 91, 36,130, 28,253, 86,237, 3, 57, 78, +162,196,202, 29,133,179,192,134,211,227,174,247,106,111, 16,238,214,223, 16, 27, + 20,133,142, 35, 82,112, 45,233,117,107,205, 73, 56,218, 1, 26, 57,114, 54, 30, + 92, 42, 35,254,179,173, 59, 27, 37,176, 33, 44, 38, 85,178,111,112, 92,202, 94, +222, 56, 38, 83, 28,220,184,103,119,218,118, 27,231,234,108,156,223, 18,191,184, +107,126, 54,231,197,137,215,146,106, 23,183, 52,113, 49,112,143, 82,224,231, 42, +174, 62,161,227,236,103, 28,144,181,168, 35, 15,199,253,147, 93, 46, 57,102, 20, +214,142, 68,125, 53, 88, 86, 18,109,204,105,123,120,150,229, 26,236,223, 21, 65, +107,144, 11, 88,248,239, 69,101, 18,161, 62,151,120,180, 2, 94, 53,117,223,192, +187, 61, 39, 46, 75, 97,188,237,128,217,117, 83,135, 4,233, 99,216,207, 52,230, + 42, 35,244, 70, 48,130,171,184,238, 29,129,228,195, 72, 48,141,203,233, 79, 15, +227, 20,110,241,100, 37,161, 70, 53, 78, 43,214,143,158,142, 57,146, 48, 70, 68, +145, 8,204, 18, 65,240, 38, 66,202, 29,195, 10,122,135, 18, 37,167, 79,235,105, +245,190,207,229, 35, 41, 25, 67, 14, 63,130,239,200,108,206,117, 7, 9, 83,241, +253,202,134,105, 3, 2, 74,208, 70,177,204,105,184,126, 76, 12,196,107,120,187, + 31,147, 6,136, 43,233, 83,252, 3, 12,208,112,184,130,161,109, 6, 46, 54, 23, +113, 12,132, 5, 77, 57,131, 28, 5, 96,245,242,108,197, 24,236, 70,236,120, 77, + 31, 64,160, 18,192,235,194,192, 73,106,172,232, 6, 40, 4, 81, 60, 30,173,177, +171,115, 10, 61,161,132,159,148,254, 1,145,161, 54,126,221, 47, 31, 35, 8,226, + 73,123, 46,247, 72,137,183,102,178, 50, 82,173, 5,220, 1, 27,210,147, 13,244, +186, 58,131,117, 48,113, 45, 13,206, 43,252, 48,198, 34,193,233, 38, 41,220, 83, + 63,165,136, 40, 57, 9,199, 21,192, 22,123, 9,233, 75,103,158,164,118,211,132, +142,238,177,194,173, 2,233,187, 95,216, 10, 33,226,121, 24,192,131, 66, 62, 85, + 21,219,203,225, 79, 43,213,227, 17,170, 81,215, 37,125,113,162, 45,128,146, 24, + 5, 30,154,137, 30, 86,212, 6,236,144,235, 14,131,226, 69,245, 93, 66, 56, 58, +173,130,209, 94, 67,214, 74,215,215, 6,208,242,159,186, 64,252,181,140,134,227, +233,181,203, 96, 75,254, 37,216, 80,207, 65,162, 98,189, 4, 69,130, 57,212,134, +179,190,108,210,120,209,150,161,191,104,119, 67,213,165, 49,111,170,175, 92,109, +231, 93, 64,109, 4, 30, 99, 51,212,178, 96,125, 78,121,196, 19,109, 69, 81, 54, +172,191,194, 10,144, 91,168,168,234,154,229,132, 19,165,210, 35,143,242, 5, 4, + 34,243,162,194, 94,144,158,145,229,204, 97,249, 90, 0, 66,134,120,173,118,148, +220, 85,240, 85, 82,127,249, 65,109, 47,218,102, 17,253,109,206,162, 91, 8, 23, +233, 66, 55,242,145,220,254, 9,235,219,193,245,194, 86, 20,190, 30, 93,131,180, +239, 52,182, 19,254, 8,224, 94, 79,169,228,211,229,167,117,191,164,195, 82, 0, +176,155, 21, 10, 11, 52, 76, 98, 2,248,141,246,141, 92,116,166, 46, 79,109,121, +199,122,251,185, 42,150, 0, 58,199, 80,115,171, 64, 85,175,255, 55,141,243,244, + 47, 28,187,106,208, 9,229, 85,216,202,112, 66,107, 91,204,211, 81, 33,133, 7, +176,104, 66, 65,161,248,127, 15,216,149,187,182, 15,188, 1,124, 88, 56,125, 62, +163,127,230, 88,247, 57, 38,175, 9,245, 63,176,224,216, 46,245,148, 40,212,253, +190,169, 69, 49,154,134,244, 96,114, 56,207, 24, 6,125, 88,160, 28, 47, 27,232, +109,183,176, 1, 23,234,171,140,231,209, 75, 33, 88, 25,192,149,157, 25,246,235, + 1, 36,231,232,211,236,220, 53,201, 38,247,133,169,167, 12,207,155, 87, 80, 63, +154,143,104,143,194,150,178, 38,163,176, 99,152, 63, 54, 3, 20,236, 25,238,248, +168,164, 94, 32, 98, 11,117,190, 71, 88,251, 63,222,153,196, 63, 72,168,196,171, +241,188,163, 46, 33, 29,246,197, 27,248, 17,197,111,229, 25, 18,202, 13,162,150, +216, 36,115,128, 39, 20,107, 8,147,106,103, 96, 13, 64,243,113,188, 69,132,140, +192, 43, 14,177,238,109,188,252, 85,112,156, 24,249,255,150, 52, 5,183, 31, 26, + 83, 3,107,188,104, 65,101,106,141, 27, 39, 0, 15,111,231, 49, 22,227,152,173, +137, 85, 23,121, 38, 8, 65, 85, 78,230, 67,157,128, 56, 99, 56, 37,208,214,199, +129,140, 48, 84,109,112,105,225, 36,141,140,178,131,133, 16,183,141, 53, 51,182, +120,249,232, 83, 26, 16,119,129,212,136,114, 39, 32, 63,154,209, 59,152,192,245, +118, 40,220, 44,229,251, 66,189,136, 98,128, 95,189, 78,155,203,249,187,188,123, +149,111, 61,158,138,139,248,226,174,156,130, 48,149,116,169, 42, 48,139, 1,128, +237,127,202,133, 95,162,228,206, 79,118,113,127, 76, 92,220,129, 76,150, 64,218, +122, 11, 28,225, 96, 33,207,252,194, 55,206,174,203,212, 37,194,244, 69,210,121, +125,168,246, 99, 61,123,170,178, 23,201, 45,110,118,180,180,150, 25,146, 88, 69, +107,195, 27,149,230, 94,145,158, 23, 9,124, 91,130,200,237,104, 22,178,201, 66, +196,228, 8, 72, 85, 88,250, 10,185,217, 20,217, 11,129,204,134,105, 9, 64,207, + 8,114, 18,143,236,128,104,214,227,113,199,100, 81, 28,135,152,246,159, 88,210, +117,147, 2,240,156,233, 85,199,116, 32,130, 34,183, 43,214,198,156, 78,237, 84, +173, 26,252, 85,118,223, 1,154, 3, 25, 48,158,182,230, 37,178,189,168,175,218, +127, 10,224,203, 46,169,252,185, 29,125,197,205, 86,228,235, 96, 51, 56, 46,141, + 29, 54, 21, 97,123,179,166,189,140,100, 42,190, 29,190,110,244,168, 28, 73, 6, + 88,101,103,247, 95,154,181,177,108,231,199,152, 34, 53, 22,147,113,134,243,218, + 3,216,240, 60,226, 6,171, 28, 27, 65, 26, 44,248, 11,226,213, 2, 21,254, 34, + 13,120,165,148, 84, 45, 83,154,106, 37, 2,155,142,204, 76, 81, 61,235, 93, 10, +122, 40, 47, 78,118, 39, 66, 55, 45, 77,245,110, 85,168, 65,113,135,166, 65, 87, +205, 49, 95,154,226, 92, 33,127, 62,202,143, 24,138,226,140,241,232, 80,200, 77, +108, 65, 69, 30,210, 3, 63, 52, 76,118,218,236, 93,165, 9,111, 90,244,210,109, +233,210, 35, 26, 50,162,102,204,209, 54,161, 29, 76,156, 17, 13,113,128,254, 48, +132,243, 60,251, 30, 85,190,227,231,119,238,118, 22, 3,129,186, 97,144,227,194, +140,242,208,148,128, 87, 73, 41, 2,143,111,160,161,176, 91,152,234,212, 39, 70, +202, 27,227,112, 9,218,109,159,156,145,102,201, 61, 67,233,217,177,188,172, 33, +192, 68,168,131,242,198,166,114,245, 51, 43,182,166, 3, 0, 80, 29,164,165, 50, +129, 46,202,174,182,201, 19,186,195,217,200, 1, 8,153,158, 47,107, 53,163,182, +183,111, 67, 9,242,252, 78,220,174,198, 72,184, 13, 49,232,225, 77,220,125,242, + 19, 41,189,151, 46,150, 29,214,131,133,198,163, 60, 90,134, 19, 24, 23, 0,208, + 75, 66, 27, 25, 23,236, 1,101,129,144, 86,122,112,146, 49, 46, 20, 55,229,135, + 58,239,223,101, 88,209,187,111,173,228,241,102,225,131,211, 18,184,196,188, 44, + 82,241,111, 87,138, 71, 97,188,116, 17,230, 37,244,134, 75, 81, 52, 7, 94,253, +104,211,128,220,197, 93, 22, 66, 27,110, 5, 87, 70,141,157, 34,224,120, 44, 77, + 1, 91,224,237,202, 6, 23, 96,232, 69, 23,107,196,144,148, 48, 32,124,124,185, + 86, 40,172,153, 34, 50,135,115, 97,175,128,180,229,112, 49, 11,118,166,157,221, +113, 17,216,227, 51, 41,210,218, 20, 45, 73,105,173,183,100, 6, 74, 31,252, 14, +182, 10,125,199, 48, 87, 4,225, 58, 8, 29, 54,150,211,147,119, 88,162, 12, 69, +251,118,108,227, 6, 20,247, 96,207, 98,153,197,120,157, 75,168,201,255,137,254, + 40, 73,145,123,118,203,146,129, 83, 38,180,166, 66, 48,246,113,174,149, 3, 79, +120,121, 14,225,132, 14,154, 10,226,192,200,191,198, 27, 88, 23, 47,175,249,223, + 5, 82, 34,123, 29,229, 84,184, 46,251, 34,198, 29,251,162, 67, 51,254,164, 1, + 28,176,252, 54,155, 81,186, 41,231,152, 24, 63, 39,136, 38, 41,255,172,203, 42, +171,123,206,171, 56, 92,112,208, 94, 38, 69, 12, 16, 31,177,208, 18,243,252, 97, + 36, 48,116,237,135,185, 64,252,184,191,205, 39,242,164,171,238,151, 95,243, 8, + 25, 82, 18,180,179, 32,157,145,140,136,236,198,241, 79,237,140,242,253, 27,113, +233,206, 39,230,193, 75, 53,146, 3, 7, 95, 57,121,221,124, 76,216,174,187,139, +107,215,107,221,133,202,169, 27,227,142, 8,180,157, 84, 46,151, 61, 61, 21, 6, + 67,238, 98,163,119,230, 7, 85,212,144, 2,167, 76,237, 86, 18,226, 47,200,209, +158, 34, 33,244, 33,213,216,213, 85, 73, 62, 89,121, 58,235, 86,166, 20,195,253, + 80,249,123,112, 71,212, 41,105,237,252,162, 7, 13, 50,116,134,159,170, 73,156, +163,181, 86,168, 79,137,244,114, 94, 84, 90,237, 72,204, 72,162,197,161,181,171, + 71,248,180,169, 34, 66,189, 0,147,245,227, 25, 30,119,231, 94, 17,110, 19,234, +102,151,142,117,100,135, 35, 8,152,106, 1,144, 61,139,192, 84,214,132,138, 92, + 50, 32, 7,161, 6,167,236, 85,175,231,118,113,249,221,238,182,189, 61,250,111, +133,160, 78,208,144, 82,157,246,208, 91,207, 27,161,148,220,130, 69, 25, 6,200, + 34, 12, 1,144, 4, 39,164, 8,166, 40,206,199,190,205, 97,240,154,247, 39, 17, + 80, 2, 5, 46,231, 24, 71,248, 22, 68, 2, 27,109, 70, 73,170,165, 55, 40,245, +206,163, 48,229,252,112, 25,116, 74, 96,120,158, 23,182,159,193,253,243, 28, 8, + 79,237, 12,155,155, 54, 2,253,122,185, 84,214,129,149, 60,190, 27,160,198, 13, + 49, 39,142,240,112,121,209, 99, 31,178, 78,160,218, 94,145,245,216,187,107,121, + 13,201,216, 5,153, 15, 18, 53, 68,167,133,125, 17,246,229,123, 42, 68, 62,193, +139,212, 68,190,252,227,184, 57,196,247,134,248, 22,152,113, 23,155,111,164,235, +106,233,146,217, 16, 41,220,169,177,115,140,166,108,173,141,222,128,184,116,110, +163,130,243, 88, 29,240, 92, 33,103,131, 1,255,237, 85, 76,253,241,179,139,127, + 3,201,136, 99, 24,158,247, 20,182,150, 87,172, 51, 2,212, 85, 89,173,231,163, + 75,148, 2,215,247,187, 88,117, 16, 36,232,109, 55, 41,239, 11,204,160, 30,255, + 8,111,148,181,227, 37,104, 78,111,133,244, 34,179,109, 37,234, 98,214,189,179, +244,100,120, 14,220,251, 63, 96,108, 51,173,105, 3,190, 44,148,127, 97,236,209, + 50,196,174,224, 52,199,151,207, 83, 17,156, 39,134, 86, 42, 12,243, 61, 61,153, +140, 14, 91,246,127,248, 32, 86,208, 57,190, 56, 7,204, 95, 21, 29,215,143,157, +123, 27,169,217,143,187,212,212, 61, 84,169, 76,141, 2,193,100, 21,198,128, 15, +127,152,150, 37, 52, 79,187,190, 58,133, 43, 86,162,153, 81,250,198,141, 28, 90, + 24,131,244,102,184, 90,232,121, 93,208,237,186,186, 25,147, 45,198,182, 68, 17, + 32,132, 98,107,147, 76,167, 14,166, 39, 14, 15,243,132, 82, 30,109,167,195, 17, +139, 26, 4,218, 83,246,110, 32,205, 28,192,180, 90, 81, 56,145,180, 13,102,105, +140, 79,168,136, 9, 0,240,246, 68, 37,141, 71,223, 18, 96,214, 69, 5, 55, 63, + 27, 37,134, 70,136,111, 92,140,154,119,121, 96, 32,255,136,168,178,209, 62,149, + 38, 29,184,106,230, 3,185, 9,133, 70,223, 53, 21, 58,145, 62, 13, 69,213,218, +190, 22, 74,163,200,239, 41,221,122, 44,234, 62, 92,102, 12, 57, 58, 36, 2,148, +115, 10,120,216,129,174, 20,210,218,153,126,188,236,140, 30,215,198, 74, 7, 52, + 89, 11, 39,116,120, 8,124,200,137, 78,233,140,130, 27,235, 14, 39, 49,174,131, + 88,221,163, 66,138,159,221,200, 30,201, 19, 53, 38,166,141,137, 14, 22,136,241, +177, 33, 11, 93, 19, 63,255,145, 42, 89, 55,116, 31,224, 13,187,149, 11,246,188, + 12,175, 2,227, 38,239, 46,119,110, 14, 18,111, 71, 75,128,232,208, 34,203, 35, + 88,235, 33, 21, 2,110, 28,204,151, 75,160,225,197, 18,237,133, 18,149,100,221, + 85, 57, 76, 73,148,245,166, 29, 80,132, 88,246,176, 55, 30,192, 92,245,172,169, +136,167,134,132,208, 28, 91, 6,131, 78, 45, 83,180, 46, 54,114,116, 68, 42,255, + 24, 33, 23,210,124,156, 87,106, 77,247,220, 86,167, 51, 56,209,235, 15,196,157, +229, 29,212,102,120,212,160,136,199,147, 71,250,138,119, 80,114, 66,203,210,110, +175, 53, 75, 77, 69, 94,173,168,215, 9,141,204, 84,128, 51, 29,235,243, 10,150, +115, 87,248,121, 99,175,199, 9,244, 23,216,149,167, 22, 32, 27, 6,177,233, 61, +245,248, 24, 7,226,214,254,112, 41, 20,189,141,125,166, 80,130, 38, 81, 72, 88, +156, 36, 55, 69,139,136, 42, 2,145, 39, 34,211,144,193,207,110, 41,191, 55,240, +163,250, 4, 43, 96,228,180,123,110,140,226, 3, 54,122,156, 32,141, 72, 72, 81, +212,104,105, 20, 66, 21, 91, 79,249, 86,128, 20, 20, 16, 33,218,111, 68, 50, 12, + 79, 90,183, 6, 30, 81,141, 89,248, 64,119,243,184,239,203, 71,200,189, 8, 49, +132,253,101, 23, 86,244, 82,146, 73,222,121,193, 23, 33,186, 62,226,129, 48,166, + 41, 68, 58,121,145,160, 98,242,139, 92,191, 90,178,197,148,121,103,192, 29,216, +180, 85,221, 9,146,151,217, 68,142,130, 71, 50, 38,192, 42,227, 5, 75,105, 45, +210,197, 88, 66, 62, 57,246, 75, 69, 28, 94,144,235, 89,235, 7, 77,119,132, 68, +157, 82, 82,230, 20,164,101,239,161, 12, 21, 53,113, 5, 37,121,140, 85,193, 64, + 37,130, 60, 18,135,116,164,142, 64,181, 83,254, 99,112, 49,154, 1, 59, 73,165, +123,173, 16, 45,136,151, 83, 54, 39,166, 80, 80,243, 70,145, 38,202,112,166, 65, +191, 33,123,130,184,116,131, 35, 49,197, 47, 28, 35,125, 88,187, 5, 88, 33, 97, + 55,197,172,102,252,216,106, 95,235,159, 62, 73, 9, 78,252,127,206,158,136,183, + 76,145,166, 40, 40, 35,131,136, 28,215,233, 71, 75, 99,116,226,174,206,102, 43, + 42, 21,118, 55,162, 40, 29,136,151, 86, 26, 42,242, 78, 35,220,106,230,213,232, +254,248,202, 49, 95,252,234, 61, 66,217,162,157,155, 35,197,223,153,113,248,229, +170, 60, 75,234,184,240, 0, 67, 17, 70,103,252,254,183, 55, 13,145, 54, 33, 72, + 20, 77, 45,214, 57,162, 76,224,162,179,148, 20, 66,239, 29,170, 16,171, 26,254, +180, 45,123,154, 2, 18, 41,213, 89, 21,120,141, 41,195,172, 3,164,147, 78, 5, +216, 42,104,183,178,255,105,225, 49, 29,232,241, 22, 37, 82,111, 61,108,232,227, + 86, 78, 88,149,138, 10,100,152,157,106, 47, 67,143, 70,164,152, 66, 65,255,113, + 36, 61, 21, 75,128, 50, 86,138, 48,179,129, 80,148,183, 40, 20, 48, 77, 97,168, +223,131, 60, 9, 95,209,203, 28, 54, 2,101, 33,176,215,170,130,146, 54,117,129, +110,146,103, 19,195,128,119,192, 37,173,105,235,187,216,162, 35,128,231, 12, 14, + 42,120, 15,234, 32,201, 99,182, 17,207, 93,253, 84,116,119,231,204, 95,228, 53, +121, 8, 67,204, 83,208,191,236, 35, 83,203, 22,214,223,127,153, 22,155,199, 95, +159, 50,242, 36, 93, 61, 61, 44, 93,148, 2,108,182,148, 73,174, 65,247, 82, 38, +129,216,146,228,152, 64, 16,155,219,175,188, 47, 98,113, 58,175, 72,180,202,248, + 94,103,244, 39, 12, 65,158,182, 41, 53, 69, 39, 12, 65, 24,204,184,135,149, 34, + 29,184, 40, 52,124,122,208,170, 94,170, 10,161,106, 98,118, 4, 81,157,117,130, +130,212, 41,200,132,104, 97,129,171, 41, 80, 80,200, 79, 41, 45,199,102, 41,173, +181, 53,199,114, 2,130,140, 8,175,228, 67,121,118,243,100,178,238, 14, 19,224, +101, 5,144, 32,131,115, 71,137,230,251,153,187, 91,147,156, 89,226,162, 14, 54, +218,226,102,152, 55,189, 25,216, 20,109, 60,118,140, 19, 8,153, 3,169,210,197, + 19, 44,187, 32,107,124, 92, 56,115, 3,137,208,160,161, 26,193, 69,101, 7, 26, +112,148,149, 6,113,120,198, 92, 84,250, 66,138,222, 98,155, 31, 5,138,166,142, +181,177,115,208, 32,157, 80,213, 14,155,177,100, 25,251,211, 78,153,252,198, 39, +184,165,135,192, 16,232,198,247,223,120,242,197,225,179,180,238, 30,133,212, 26, + 66, 45,101,152,156,104,248, 16, 91,141, 90, 25, 67, 39,149, 52,250, 4,196, 91, + 1,202,103,224, 19, 41,192,240,108, 3,250, 31,141,146,212, 35,245,104,138, 81, +190,178,156, 50,111, 1,189,255,118,143,244,230, 0,223,157, 36,227,247,168, 33, +219,166, 40,186,174,115, 1, 37, 1, 65, 1, 49, 1,162,119,162, 37,177,181,184, +170,145, 89, 82,250,175,233, 91, 95, 81, 60,173,222, 39,212,209,138, 62,197, 44, + 61,155, 42,244, 39,232,166, 28,211, 55,196, 58,191,233,241, 32, 33, 25,196, 4, +201, 79,162,152, 89, 15, 76, 62,209,216,171,231,235,186,220,143, 81,243, 61,211, +123, 38, 19,196,138,215,244,120,189,177,137,210, 34,251,200,215,212,175,113,133, +177,152,203,209, 58,154,183,201,253,179, 0, 37,242,236,250,243,223, 92,134,147, + 58,178, 55,111, 80,135, 77,128, 74, 19, 32, 60,145, 51,153, 45, 50, 44, 45, 70, +125,150, 24,181,126, 85,125, 42,243,147, 86,196,162,185,245,202, 98,227, 39,141, + 54,174,208,126,178,228,198, 34,127,179,164,252,134,150,244,194, 91,225,146,173, + 74, 21,245, 26, 83,227, 88,194, 30,103,242,212,166, 29,105, 28, 90,247,242,181, + 53, 78, 47, 7,228, 16, 50,211,200, 32,249,186, 46, 45,115,215,192, 30,155,232, +174,120,181, 6, 70,221, 55,227,126,133, 99, 73,194, 28,193, 73, 31,241,118,210, + 6,149, 30,217,194, 19,110,150, 37, 75, 66, 50,246,112,188, 36, 18,251,229,121, +198,216, 67,229,124,241,120,210,219,142,210,138,169,170,151,122,197,212,106,166, +183,150,252, 61,143, 74,189,228,222, 99, 60,140,135,241, 48, 24,175,234,234, 85, +171, 28,145,104,101, 6,151,114, 1,255, 13,189,113,240, 91, 82, 99, 59,210,119, +204,231, 63, 34,144,170,170, 20,197,249,174,115, 0,173,253,191,114, 60,159,234, +177, 17,249, 83, 90, 52, 41,176, 91, 69,185,150,249,183,129, 28,179,116, 50,180, + 29,224, 26, 89,236,127,205,157,173,198, 9, 97, 6,241,194,251, 63,217,214, 82, + 57,153,200, 68,251,128,167,155, 79,179,243,169, 13,225, 13,109, 57,142, 99,167, + 1, 0,240,216,246, 25,124, 79, 32,241,120,155, 79, 66,200,227,100, 50,181,154, + 12,100, 29, 39, 41,248,237,181,207, 40,179,244,223, 62, 20, 18,144, 3,130, 95, +167,125,157,143,201,146,163,172,243, 49, 84, 13,105,219, 83,181,124,188, 8, 38, +241,212,134,208,183,224, 85,208,179,241,106,194,119, 49,193,119, 49,101, 60, 50, +108,116, 71,161,102, 18, 60,255,205,203,180,196,242,117,106, 37, 11,101, 56,156, +134, 16, 73,159, 99,182,208,249,100, 40,118,198,230, 9,211, 18, 60,155, 11,216, + 48,194, 91,151,217, 32, 83, 1, 63,149,234,210,164, 41,159,164,244, 41, 13,154, +124, 79,156, 6,205,230,107,224, 16,100, 28, 56,144,109, 89,118,105,168, 89,168, +109,197, 99,153, 65, 65, 6,252, 16,108, 27,114,218, 33,161,124,160,162,182, 8, +176,130,149, 75,230,134,146,207,194,209, 68,116, 94,199,139,128,157,215, 60, 85, + 3,114, 18,178,134,170,241, 92,202,253, 24,134, 17, 92, 30, 58, 33,240,235,174, +142, 0, 96, 40,236,124, 6,159,244,241,120, 60,200,128, 71, 62,195,176,158, 74, +170,250,206,191, 58,149,221, 87,158,187,123,245,149,175,127, 42,255,220, 39, 59, +226,174, 74,241,160,148,125,161,214,117,122, 41, 32,188, 1,101, 5,182,167,208, +180,164, 13,177, 7, 88, 87, 64,197,186, 30,162, 57,107, 69,207,125, 65, 90,142, +211,191,194, 81,129, 86, 42,222, 57, 44,135,227,225,120,138, 68, 62,171,138, 85, +221,188,104,135,166, 36,250, 29,174,156, 74, 42,116,232, 75, 97, 53, 4,127,247, + 21,117,173,201,114, 66, 93, 25, 63,128,223, 8,209,119, 20,217,173,239,198,182, +226, 59,235,169, 47, 99,217,212, 5,157, 69, 81, 20, 67,161,142, 2, 88, 67,213, + 33, 20,242,238,171,235,186, 62, 19, 77, 75, 89,214, 54, 75,157,101, 15,255, 80, +100, 89,239,127, 89,161, 15,189,101,158, 34, 43,181,100, 40,107, 11, 52,225, 34, +139,116,165,118,103, 11,253,214, 44, 5, 40,107, 55,214, 26,135,126, 69, 43,230, + 43,190,149,249, 1,192,101,201,128,156,135,144, 7,226, 27,153,103,169,187,157, + 94, 10,172, 11, 94, 68,136,178, 24,213,184, 45,136,112, 89, 36, 87,220,235, 7, + 52, 14, 19,223, 44,173,206,247,219,116, 34,234, 67,166, 35, 32,224,153, 35,184, +182,149,133,221,154, 67,178,178,165,121,150, 41, 75,170, 64, 10,108,202, 37,229, +122,180,214,116, 97,220,249, 83, 85,160,122, 28,166,153,110,220,198,109,220,198, +105, 18, 77,162, 73,204,174, 51,187,206, 51,241,119, 3,223,189, 87, 3,105,154, +122, 44,107, 28,109,196,243, 18, 54,110,227, 54,110,227, 52,137, 38, 73,107, 45, +229,247,188,132,141,219,184,141,219, 56, 77,162, 73,206,207, 41,145,166,213,121, + 98,139,113,227, 17, 78,159,180, 39,239, 64, 19, 33,135, 3,215,243,211,244, 76, + 43,130,167, 37,236,143,177,164,227,196, 20,130,131,172, 40,193,236, 36, 79,207, +192,100,100, 92, 50, 72, 13,229,225,238,126,209, 35,182, 20, 94, 93,168, 10,215, + 29, 38,177,190,188,238,183,252,152, 82, 69,168,194,199,249, 47,127, 62, 89,238, + 72,105, 44,189, 18,174, 46, 84,166,153,214, 39,254, 32,201, 62,137,230,214,118, +196,254, 32,205, 55,231,188,192,177,108,194,239, 40,235, 52, 72,135,101,101,198, + 40,215,103,120,110,156, 69, 75,122,155,139,214,177,128,245,129,193,171,149, 12, + 82, 65, 84, 77, 41, 95, 37,189, 49,159,229, 2, 82, 42,253,126,125, 10,155,170, + 53,206,150,205, 7,218, 92, 20,190,202,229,181,203, 59, 37,151,215, 40,227,240, +134, 85,152,111,151,177,120, 69,148, 68,251, 9,134,114,233,168,113,204,149,166, + 60, 62,177,162,179,251,175,164,255,150,116, 26,173,221, 87,164,253,183,182,162, +202,213,227,125,116,161,125,212, 74,229, 20,121,181,174,177,219, 28,144,130,168, +212,249, 86, 37, 27, 18, 0, 20, 0,195,178, 0, 8, 10, 11,141, 69, 18,137,156, + 7,138, 82,123,148,192, 6, 68,152, 6,139, 16,140,133,133, 33,105, 48,104, 0, + 8,138,129, 1,144, 0, 3, 64, 0, 1, 3,160, 0,128, 1, 20, 0,114,128,164, + 17,249, 41, 92, 66,110, 64, 72,150,224, 76,142, 26, 61, 19,148,187, 88,170,233, + 53,132, 82, 9, 1,205, 32,204,192,159,123,130,123, 83, 29,124, 88,128,188,213, +146, 17,124,161,165, 24,151, 12,124,208,184,140,212, 58, 7,149,159, 43,192,220, + 95, 67,179,182,115,246,130, 24,204,137,110, 14,237, 60,109,166, 63, 7, 68,226, +116, 70, 1,105, 49, 27,175,109, 27,216, 5, 58,191, 38,220, 4,231,171,128,229, + 9,207, 66,193,127, 29,220,122,193, 37, 36, 28, 45,136, 65,196, 66,221,250, 23, + 5,181, 35, 12, 0,205,246, 72,193, 22,200, 77, 64,224,215,230,182, 7,200,120, +215, 35, 5,136, 97,191, 96, 86,254,236,133,185,159, 57, 87,124, 34,208,160, 71, +159,236, 39, 48,132,165,209, 60,100, 79,118,251, 6,187, 12, 47, 89,149,190, 64, + 25, 72,159,104,132,225, 58,251,180,176, 23,110,148, 11,237, 26,173, 72, 75,209, + 15, 39,144,214, 22,189,114, 24, 78,163, 63,155,118, 90, 73,237, 9,186, 1, 87, +203, 24,198,149, 68,134,177, 74, 77, 96,200,170, 56, 55,228, 61,148, 97, 92,145, +203, 48, 94,109, 61,190,148,145,128,242,154,226, 25,127,144,197, 35, 99, 93, 60, +252, 2,220,167, 27,171,211,146,118, 40,159,170,114,148,174,201, 53,117, 65, 41, + 85, 41,182, 73, 29, 72, 69,224, 81,154,155, 3, 37,161, 67,228,104,194,116,213, +197, 13,106,176,154, 25,156,156,204, 0,198, 41,226,210,209,222,119, 64, 65, 21, + 38, 51, 80,184,252, 30, 94, 77,215,114,206,112, 14,221,107,243, 72, 28, 26, 38, +125, 9, 83, 16, 29,231, 44,252,151,248,134,244,225,116,148,173,196,113,126,203, + 36,220, 89,244,155,157,204, 73,115, 28, 46, 25,202,228,140,143,133, 94, 52, 71, + 66,244, 49, 28, 18,159,209,204, 96,129,148,176, 52,212,221, 21,137, 42, 62,145, +231, 2,146, 3,248, 52,228, 39,241, 22, 95, 72,179, 28,240, 97, 11,105, 20,186, +117, 35, 18,220, 41,205,141,144, 69, 42, 13,166,225,243,204, 16,191,184,126, 80, +244,180,112,124,133, 25, 70,241, 28,241,214, 54,161,248, 80,249,244,193,218, 42, + 89,150,196,221,125, 97,159,219, 69,180, 6,143, 8,219, 36,173, 20,196, 16,119, +139,156,145, 23,120,145,187,218,197, 38,206,200,147,136,212,163, 58,111, 25,222, +107, 34,140,112,156,124,186,206, 17, 71,140,164, 28,156,125, 3,219,164,132, 94, + 45, 37,249, 42, 50,153, 48, 94,164, 11, 85, 79,169,132,216, 81,161, 87, 35, 10, +134,143,247, 24,150,112, 81,225, 41,100,115,240, 93, 66, 53, 9,150,130,139, 62, + 36,130, 56,202, 15,238,167,147,192, 66, 28,101, 40,225,235,217,205,198, 24,135, + 82, 33,197,166,162, 32,235,101,187,100,220, 26,252, 15,153,110, 79,168,165, 16, + 45,158, 40,149, 16, 21,244, 48,212, 33,242, 38, 30, 5, 28, 17, 33,137,161, 84, +163, 33, 10,254,237, 13, 30,228, 45,140, 15,254,220, 97, 41,116,225, 17, 90, 81, +144,159, 17,176, 1,193,122, 69,183,194,230, 90, 65, 38,240,111, 7, 48,185, 32, + 42,156, 17, 21,107,172, 17,111,181,158, 5, 65, 86, 0,132, 52, 53, 55,176,230, +139, 56,177, 58,208, 37,187, 61, 54,108,158,166,175, 33, 28,173,129,208,194, 81, + 27, 89,172, 65,244, 96,221,157,198,191,148,211, 53, 65, 8, 85,212, 32,210,131, + 82,232,131, 53, 85, 69, 26, 4, 42,181, 9, 57,133, 65,176,140,105,201, 13, 20, +245, 66, 20, 32,140, 8,189, 87, 72, 41, 8,183, 4, 90,162,144,165, 29, 16,134, + 24,171,208, 49, 52,142,164,203, 6, 35, 32, 70,218, 14, 68,208,152,220, 73,174, +150, 10,192,182,254,144,124,133, 75, 66, 56, 37, 15, 11, 71, 56, 26, 26,190, 11, +225,220,195, 16,162,119,181, 0, 32, 24,241, 54,207,186, 47, 16, 59,137,189, 7, +186,228, 40,196,102, 65,118,245, 27, 0,129,186, 86, 55,240, 12, 42, 26,194,148, +128,255,126, 14,108, 7,105,201,167, 95, 52,119,210, 37,199, 78, 16,227,134, 51, + 19, 50,156,210,166, 72, 89,212, 41,229,226,163,161, 11, 97, 67, 26, 51,194, 24, +142,210,137,139,182, 70, 59,109,133,126,218, 68,207, 3, 92,186,110,112,210,138, + 34, 98,142,125,119, 34,246,187,152,238,167,231,179, 37,156, 89, 4,208,233,143, +221, 12,196,204,231,143,191,125, 42,174,215,245, 78,158, 78,169,247,175,234, 79, +167, 69,232,247,217, 59,113,224, 65, 26,104,157, 60,121,118,185,198, 60,172,175, +121, 88,228,203,104, 83, 47, 20,213,213,156, 28, 11,180, 93,153,220,233, 73,169, +194,187,180, 27, 0,166,227, 56, 98,119,234, 93, 0,149,251, 49,180,226, 79, 97, +223,193,187,253, 75,225,115, 60,150,142,234,215,224,138,116, 76,243, 91, 49, 62, +183,106, 12, 35,150,202,185, 32,234, 96,250,101, 93, 20, 75, 90,182, 95,177,102, +161,183,168,179, 3,114,225,214,206,125,131,217,250, 63,246, 78,192,181,192,199, + 36,120,231, 33,153,101,210,200, 55,169,249,180, 54,107, 31,193, 32,190,198,230, + 51, 48, 16,208,174,216, 78, 51,156, 86,175,192, 14, 40, 33,182,100,254, 26,165, +155, 41, 62,238,164,209,167,238, 19,117,148, 76, 96,161,136,114,130,255, 17,250, +255, 80,133,232,233,237,182,235, 96,110, 31, 99, 92,166,213, 22, 49,208, 28,216, +240, 16, 55, 78,176, 94,241,234, 9, 68, 87,201,187,255,116, 77, 93,146,160, 27, +203,112,222,117, 87,104, 10, 53,159,251,213,112, 50, 47, 31,173,141,107,240,133, + 68,237,186,173, 70,146, 35, 22, 71,198,198,142,217,193, 52,101,136, 13, 4, 78, + 16,201, 53,202,242,251,188, 69, 42,232,243,130, 72,138, 77,236, 64, 61, 38,178, + 49,144,144,191, 4, 81,122, 4, 58,228,185,163,195,174,150,190,248, 54,223, 20, +187,115, 20,255, 65,127,198,115, 67,194,201,144,128, 4, 72,180,226,246,218, 98, +152,214, 21,122, 99, 1, 60,139,141,196,122, 44, 63,232,132, 71,136,193, 66,193, +210,156, 1,157,242, 64,107,187,134, 90,195,242,240,141,143,253, 55, 20, 70, 3, +153, 2, 1,105,245,195, 1,226, 72,236,139,186, 34,176, 75,128, 90,130, 85, 23, +145, 8, 55,154,155, 73,199, 97, 78, 17, 98, 9, 55, 43,125,173,245, 85, 28,172, + 42, 18, 58, 18,151, 28, 93, 0, 19,158,245, 45,236,195,129,232, 81, 49, 71,183, +127,130,234, 24, 27,139,142, 7, 68, 69, 99,115,236, 92, 88, 33,127, 84,134, 34, +227, 77,220,163, 57, 28,101,157, 42,148, 42,237,141, 21,165,107,192,139,229,231, +156,244,214,240,195,112,156,132,166,132,173, 10,100, 69, 43, 47, 28,153,217,131, +159,251, 72,107, 51, 79,200, 27,160, 51,116, 83, 4, 22, 20,238,137, 90, 79,146, +191,104, 26, 98,125, 86, 91, 54,231, 71, 82, 36,217, 76, 68,172, 40,197,188, 84, +250, 30, 82,230,142,142,117, 84, 44, 23, 8,176,161, 80,128, 21, 69, 42,138, 7, + 88, 65, 34, 49,209,159,186, 42, 17,224, 42,117, 76, 73,168,131, 21,160,122,152, + 39,252,133,199,149, 38,119,105,122,161,142, 96,231,204, 26, 8, 69, 22,219, 29, + 69, 66,148,147, 3,162,234,236,193,189,128, 31,211,174,120, 83, 92, 65,250, 83, +234, 67,227,171,255,232, 65, 70, 0, 13,107, 10,233,174,234, 87,193, 99, 82,113, +195,129,201,182,185,150,160, 76, 8,178,198,230,100,218, 56,203,247,101,232, 90, + 16, 2,169,248,129,124,160, 14, 75, 13,120, 91, 50, 52, 56, 18, 53, 20,231, 17, +179,159, 56,106, 24,241, 18, 41,166,112,111,253, 53, 12,247,130, 93,157, 80, 10, +251,105, 40, 72, 43, 8,232,118, 75,186,172,242,191, 49, 37,147,188,114, 66, 84, + 27, 21, 53, 64, 59,114,192, 41, 36, 50,135,255,143,251, 54, 88,102,137,167, 92, + 74,155,108,246,103,159, 73,238, 6,114,197,139,193, 52, 14, 95, 65,174, 71,180, + 72, 0, 27, 31,114, 41, 75,170, 58,103,197,124,135,188, 71,214,146,146,167,224, + 77,138, 66, 84, 4, 66,107,200,163, 31,164, 30, 53,177, 10, 7,100,117, 61, 55, +174, 64,127, 25, 74,137,138,115,153,202,222,220, 33,235, 16, 4, 39,208,111, 86, + 2,109, 68, 4,222,112, 84, 67, 77, 10,125,120,180, 42, 36, 10, 96,229,225,216, + 44,125, 53,189, 15,163,140, 13,129,220, 26,235,119, 32,160,179,175, 20,117, 12, +201,132, 19,195,133,184,172, 47,190, 19,212,133,208, 39, 13,142,160, 54,214, 47, + 66,145,181, 10, 78,233,121,246,200,144,248,206, 31,162, 56, 13, 45,234,254, 48, + 68, 34, 74,154,117, 84, 37,140, 33, 13,236, 43, 74,196,181, 65, 59, 67, 25,150, + 7,227,232,143,203,217,117,218,212,167,113, 6,100,253,125,167, 91, 23,131,239, + 74, 43,156, 72,221, 36,151,198, 72, 41,156, 61,133,238,136, 48,224,105,183, 5, +117, 15,152,105, 4,245, 29, 69, 75,105,201,173,196, 70, 20,145,165,130,184,192, +118,201,191,148, 3,152, 34, 82, 96,157,163, 55,255, 9, 28,227, 90, 68,222, 59, +234, 99,108,119, 72, 49, 58, 12, 1,140, 73,207,213,239, 65,167, 41, 5,117,193, +193, 82, 24,213,182, 97,118,207, 3,170, 61, 33,112, 75, 5, 58, 12, 55, 10, 4, + 64,231,108,132, 11, 37,144,249,107,104, 50,102,110, 8,110, 20,199,239,144,101, +161, 98,189, 80,151, 53,134,222, 46,170,231,239,208, 12,132,191, 70, 45,182,104, +144,234, 57, 72,117,192,110, 67,255,149,210,202,135,113,170, 66, 36, 83,221,188, +230,228,232,220, 42, 82, 30, 15, 14,204,184, 40, 34,182, 22, 77,111, 1,221,194, +164, 6,136,231,175, 77,152,184,214, 58,126,188,186,174,214,196,140, 94, 41, 52, +182,206,250,242, 55,134,114,217, 88,138, 68,205,104,151,108,189,197,247,230,137, + 4,199, 50, 63, 9,123,121, 19,239,163,139, 19, 65,223, 16, 11,149,242,137,186, +117,140,133,203, 0,157, 76, 19, 34,195, 27,228,184,180,212,145, 66, 67,227,106, +100,227,116, 64, 96, 38, 71,119,153, 8, 77,177, 67,179,238, 21,151, 44,169,204, + 9,210,120,130,179,168,140, 42, 0,201,228,166, 30,112,224,236,237,167,136, 39, +131,196,135, 93, 97, 57,186,162,174, 95,243,193,133, 12, 8,161,164,231, 38,243, +238,175, 3,131, 39, 48, 37,128,160,134,130, 61, 3,131, 5, 4, 43,102,199,196, +252,115, 61,189,179,109, 26,238, 73,191,126,160, 65,214, 27,179,103, 88, 18, 96, + 79,130,173, 23,236, 79,120,179, 46,165,115,253,111, 17,131, 30,137, 82, 11,186, +146,251,138,114,146, 74,208,220,206, 5,231, 51,102,234,102,225,156,205,130,175, + 79,151, 7, 25, 92,154,208,124,150, 40,124, 32,121,179,168,113, 73,198, 47,131, +234,172, 80,191, 71, 31, 14,216,101, 82,238,144,168,174, 45, 48,183, 69, 49,154, +192, 26,155, 21, 5, 51, 22,212, 33, 19,167,218,169, 96,176,237,190,199, 65,118, +165, 83,230,227,218, 86,135, 56,151, 1, 62, 33,185, 17,172,107,127,181,226,117, +156,155,241,111, 85, 87, 16,189, 96, 63,201,101, 60,185,106,247,241,211,203,216, +157,188,186,140, 42,159,172, 4,211, 1,222,254,104,150,155, 82, 7,145,132, 21, + 63,187,149,254,203, 32,230,251, 51, 5,137, 47,129,156,172,236,198,143,120, 37, +165, 94,135,208, 18,222, 97,180, 54,136, 91, 1, 8,122,194, 36, 0, 97,218,169, +248,191,227, 54,196, 82,183,219, 68, 73, 74, 65,219,219,254, 91, 54,225,160, 94, +182, 30,202, 70,138,229,114,221, 19,106, 14,190,103, 29, 68,125,166, 84, 68,229, + 17,169, 74,162,152, 79,248,252,227,126,155,230,252, 57,255,199,253,106,169, 12, + 52, 10, 77,132,230, 54, 74, 80,230,185, 19, 59,225,233,151, 0, 64,165,228,159, +192, 66,134,147, 62,126,207,166,130,157, 32,235,192, 68,136,187, 96, 80,105,130, +141,230, 16,173, 41,232,243, 70,137, 76, 56,143, 85,148, 75, 83,242,215, 4, 51, +108,212, 18, 72,118,213,155, 53, 85, 21,112,183, 32, 90,175,204,252, 63, 90,112, + 11, 31, 74, 90, 2,230,209, 57, 32,115,253,124,174,203,105,145,229,114, 69, 32, + 23,150,243,101,102,232,171,216,196, 9,184,190,140,170,229,175,170,231, 59,119, +234,161, 57,163,161,199,114,155, 99, 84,225, 7, 86,246,243, 27,153, 91, 23, 45, +150,188,214, 72,158,141, 2,102,151,106, 15, 90,225,148, 9,193,113, 9,142,168, +165,112, 99,230,200, 26,145,177,185,115, 5, 54, 81,190,141,227, 71,177, 87, 13, + 30,130, 56,232, 93, 1, 90, 90, 69,144,118,123, 34,125, 31,140,157, 18, 22,165, + 15, 62,145,240,107,112,235,218,138,254, 38,139,233,236, 2,141,185,141,217, 38, + 37,232,210,149,162,221,148,237, 90, 25,186, 11, 78, 37,202,222,204, 98,151, 13, + 88, 60, 8, 69, 64,188,103, 26,160, 58,170, 98,225, 73,215,155,143,224, 60, 29, +212,175,208, 78,236,243, 0, 31,246, 83,128,249,228,195,216,225,152,214,154, 72, + 3, 51,228,154,122, 98,143,170,206,185,205, 34, 75, 11,107, 84, 23,189,130,217, + 86, 42,189,118, 98,212,194,185, 43, 48,179,171, 43, 77,177,136,191,156,107,152, + 37, 16,213,146,250,175,227,219,255,153, 97,246,121,128,183,252, 88,178, 66,254, + 64, 15,127,108,114, 17,231,192, 48,104, 34,185, 17,241,115,148,132,133,221,143, + 23, 47, 88, 73,117, 31, 66,167, 24,154, 53, 52,115, 82,196,252,215,251,226,134, +152,241,141, 1, 0, 82,216, 49, 29,163,224, 65,183,104,139,225,174, 39, 11,189, +125,104,221, 55,202, 17,114,100, 45,240,151, 35, 49,122,182,162,184,205,249, 47, +145,191, 76,107, 8,238, 61, 88, 97, 97, 69,220, 17,128, 88,198,242, 29, 76,208, +229, 16, 46, 93, 34, 2,163,250,169, 56,225,117,131,203,144,239, 62,145,129, 34, + 30,197,128,167,218,222, 38, 24,170, 2,224,249,205, 75,165,150, 83,160,187, 77, +115, 68, 89, 60, 91,176,150,173, 31, 1,115,107,171,197,138, 45, 56,140,110,100, + 81, 67, 25,229,223, 37,179,104,108,103, 91,178,107,246,165, 43,186, 97, 85,176, +126,217,137, 24, 92, 80,140,240,178,168, 17,184, 85,232,254,199,204,127,183, 76, + 58,225,166,178,179,128, 63,205, 84,131,199, 71, 83,221, 57, 83, 22,248, 68,116, +239, 89,211,116, 75, 63, 68,106, 90,128,203, 72,174,188,217,127,105,229,135,178, + 62, 28, 49, 58,122,222, 44,198, 78,206, 38, 41, 79, 19,109,210, 22, 81,226,190, + 14,164, 80, 32, 19,225, 20,132,255,240,133,113, 41, 76,249, 72,227,164,191, 27, +185, 4,118,105,204, 33,234, 17, 47,171,130,173, 81, 21,225,193,128, 80,132, 1, +225,248,123,154,161, 96, 2, 63,209,123, 82, 52,147,164,131,172, 11,102,253, 55, +129, 3, 98, 53,101,132, 87,246,139, 9,210, 10,167, 67, 19, 86,169, 95, 18,106, +164,146,144, 64,228,228, 56,229,141,102, 98, 28, 40, 69,100, 52,228,100, 20,182, +130, 69,148, 25,132,250,103,192, 95, 73,201, 39,136,108,112,147,170,167,100, 5, +126,107, 24,131,149, 42,115,210, 85, 27, 3, 57, 0,112,111,242,179,217, 3,150, + 78, 22,127,114,190,178,158,239,242,188,234,230,140,248, 48, 16,101,182,142,150, +193,170, 75,134,230, 92,230, 86,195,219,228,167,204,180, 92, 86, 52,167,228,111, +102, 53, 79, 87,165,111,215,148, 14, 71,139,249,107,174, 81,147,179, 83,172,128, +106,251,216,213,125, 43,214,106,242,192,170,110,206, 33,115, 85,224,223, 43,154, + 62,115,174,216,160,134,174,171,115,106, 16, 48,129, 69,253,181,156,157,125,236, + 39,227,140, 17,178,103,127,231,184, 95, 71,163,233, 6, 83,220,103,229,242, 77, +188, 47,158, 96, 46, 80, 43,162,167, 53,104,247, 25, 35, 64,172,212,224, 65,235, +171, 38,179, 29,155,172, 24,132, 49,151,102,211, 97,146,137,163, 64,116,133,184, +204,194,160,243, 80, 3,226,134, 98,182,216, 78,127,241,224,142,209,130, 20, 57, +151, 81,141, 45,114,235,136,214,212,205,167,114, 25, 74, 62, 92,171,226, 34,179, +233,136,202, 34, 1,165, 21, 16,201,216,174, 81,155,213,243,246,148,233, 17, 36, + 94,128,128, 27,105, 17, 58, 95,154,106,212, 17,211,230,253,196,183, 88,142, 48, +252, 59,104, 8, 48,216,187, 4,241,232,242, 24,202,208, 69,193, 58,124,147,104, +189,115, 32,137, 78, 42,193, 39, 75,209, 21, 0,202, 82,228, 2, 70,195,223,100, + 88, 30, 41,184,234, 11,168, 36, 20,227, 73,230, 31,112,170,132,152, 23,116, 41, +204,248, 95,178,248,220,224, 63, 43, 46, 54, 69,109,113, 38,185, 29,217, 51,139, +178, 43,253, 97, 90, 29, 6,225,184,202,192,172, 88,217, 81, 98,201,186, 64,156, + 10,195,229,247,143,194,219,223, 69,250, 32, 29,255, 64, 40, 54,105,125, 74, 55, +151, 44,126, 92,219, 43,199,158,141,129,203, 55,186,130,169,218,232, 41,200, 44, +207, 97, 98,148,117,149, 76,243, 71, 86,253, 38,213,187,151, 47, 85,185,242, 97, + 43, 88, 65,153,151, 12,180,132, 58, 94, 68, 76,206,102, 33, 65,103, 47,126,244, + 42, 14,206, 72,240, 82,189,237, 37, 40,147,229,158,167, 76, 21,209, 98, 46, 91, +173,147,149,135, 51, 33,204,101, 54, 21, 16,205, 1,250, 6,225,187, 57,118,226, +248, 68,109, 96,233,154,205, 88, 3,128, 11, 84, 84,100,106,203,166, 99, 7,232, +138,227,215,217,214, 89,247, 96,193,116,230,127,126,166,209,202, 96, 20,132, 1, + 82, 35,114, 29, 34,157, 62,117,224,114, 21, 28, 70,138,188,192,224, 26,182, 68, +142, 58, 3,155, 18, 17, 96, 61,214,238, 36,150,162,183,135, 27, 12,144,105,181, +212,126,136,104, 0, 37,210,234, 78,152,175, 49, 48, 93, 37,188, 40, 16, 56,132, + 72, 93, 53,204, 70,159,252, 24, 73, 12, 85, 17, 28, 85,173,220,232,192, 16, 39, +210,111,129, 93,132, 99,222, 25, 17,236, 23,254,116,167,230, 35, 72, 14,186,230, +178,158,171,225, 21, 40,229,191,125,168, 42,207,145,168, 41,214,248,128,252, 8, +147,227, 75,154, 51,184, 51,143, 13, 55, 28, 72, 71,122,101, 66, 67,214, 30,188, +252, 40,212,237,241, 38, 28,173, 2, 25,198,219,119,213, 3,241,139,206,162,228, +170,236, 83,216, 35,133,232,217,225,165,200,147,216, 96,255, 94,160,206,188, 48, +159, 74,138, 16,120,121,208,243, 45,117, 53, 58,156, 32,176, 77,216, 4, 91,199, +162, 13,160,175, 22,178,126, 7, 87,218,233,151,215,176, 37, 83, 80, 98,111,200, +165, 94,154,173,163,130,225, 39,170, 80,157, 9,144,135,253, 59,175, 93,245, 33, + 65, 54,190, 17, 0, 3,107,111, 64,213,232,212, 85, 23,105, 13, 79, 22,202, 21, + 96,173,236, 31,155, 9, 80,209, 42, 47,176, 59,207,195,231, 31,206,119,177,177, +254,212,194, 67,165, 98,250, 54, 97, 49,113,202,200,135,199,115, 83,233, 51, 8, + 45, 55,105,241,139,151,119, 83, 81, 20, 68,135,247,193, 77,133, 24, 30, 41, 15, + 58,188,142, 49,207, 81, 15, 99,151, 80,255,151, 5, 29,167, 73,145,195, 70, 36, +186, 63,243,154,245,254,245,160, 41,198,251, 70,144, 16,252, 52, 4, 68,187, 51, +117, 36, 33, 21,110,204,148, 38, 17,150, 47, 43,221, 5,249,199,191, 75,154,214, + 60, 15, 18, 51,141,223,186,160,121, 52,239, 85, 51,237,176,192,180,254,156, 72, + 92,175, 81,113, 15, 17,117, 50,200,126,190,186, 65, 17,185, 98, 96,100,128, 22, + 13, 9,201, 15, 79,155,196, 58,226, 10,119, 16, 13,250,214,215,166,213, 66,153, +166,187,207,220, 73,135,156, 37, 49,246,244,200, 93,143,254, 50, 3,130,207,213, +141, 83, 8,109, 52, 32,100,104,125, 84, 65,174,244, 60,186,104, 6, 88, 5,107, + 11,208,129, 68,158, 76,116, 16, 55, 89, 40,201,241,195, 17, 68, 32,248, 91,253, +156,192, 34, 97,143,110,114, 41,158,202,189,172,118, 80,229,199, 2,114, 59,170, +170,236, 38, 16,131, 96,207,178, 18,173, 71, 9,207,167,128,165,114,186,241, 59, + 68, 73, 75, 20,176, 90, 58, 19,177,215, 56,208, 31,204,183, 41,125,124, 30,154, +213,229,170,137, 3,113, 58,222, 63, 11,175,201, 83,158,158,132,138, 77,137,110, +102,153, 22,101, 21, 55, 87, 12,100, 26,245, 47, 22, 59, 21, 67, 19,198, 36, 23, + 67, 24,244, 64,166,146, 17,152,248,162,149,220,125,231,235, 53,125,215,204,236, + 82,209, 53, 92,189,154,161,132, 53,106, 97,238,173,213, 76,251, 9,178,148,166, +183, 88,253, 48, 1, 69,195, 9,161,154,128,242, 41,135, 81, 6,175,186, 20,152, +255, 28,134, 15,160, 9,142, 47,232, 69, 16, 15,194, 67, 72,252,112,215,224,104, +224,144, 28,249,163, 7, 63, 2,213,216,124, 1,203,238,117,104,144,251,176,226, +230,140, 3, 60,109,126, 98,221,219,110, 92,179,123,128,194,123,131, 31,120,102, +146,117, 83,134,122,233, 29, 20,238,240, 46,226,195,186,242,208,186, 80,132,221, + 7,255, 61,229,102,144,116,131,145,143, 29, 4, 62,218, 33,221,243,110,166,245, +184,132,227,207,226,106, 79,255, 23,108, 4,148, 69, 66,218, 78,255, 29,186, 28, +242,230,216, 16,176,221, 53, 51,253,164,161, 56, 14,170, 51,138,217,181, 10, 92, +106,115, 47, 45, 43,194, 17,228,129,107, 62, 68, 56,144, 13, 43, 6, 98, 32,213, + 44, 74,115,213,121,168,247, 87, 90,170, 5, 84,214,159, 51, 87,199, 88,121, 66, + 70,219, 7,119, 50,146, 55,125, 10, 34, 6, 89, 35, 5,141, 74, 95, 90,147,114, + 64,229,193,127,222,209,209, 41, 23,169,162,215, 56, 40,251,118,146,126,211, 98, +252,115,147, 17,112,236, 78, 34,181, 51, 3, 67, 47, 32,121,115,117,104, 71,116, +139,205, 47, 24, 8, 10, 54, 23,227,187,244, 84,101,212, 35, 35, 39,223,171, 24, +162,233,227,101, 93,253, 12, 97,159, 31, 99,217,201, 86,109,114,195, 52,241,178, +179,169, 10,227,115,232, 35,206, 56, 85,208,150,252,114, 25, 8, 14,174, 91, 73, + 92, 50,130,206, 72,239,238, 75,120,241, 52,156, 84, 50, 24,248,101,189, 43, 17, + 72,133, 83,213,135,168,200, 70,204, 0, 19, 83,233, 89, 58, 96,154, 37,227, 85, + 3, 7,142, 0,208, 75, 96,191,181, 20,236,241,198, 15,251,102, 31,106,127,196, + 63, 40,143,239,145, 70,189,238, 65, 42,150, 35, 12,154, 96,234,144,252, 44, 58, + 85,152,223,145,201, 4,254, 95, 3,117,183,147, 95, 5, 31,226,225,110,149,173, +136,181, 8,144,187,248,135,150,101,120, 76, 64,203, 1, 1, 5,114,141, 6, 51, +200,106,248, 63,193,180,112,214,103, 92, 63,163, 52,143,243,213,249,139,228, 24, + 43, 18,149,249,161,215, 96,186,206,154,203,177,128,205, 97, 9, 64, 27,212, 84, + 55,155,129, 35, 92, 88, 3,153,221, 82,203,206,131,219, 37,232,158,193,238, 35, +194,202, 88,112,154, 33, 3,241,136,176,223, 99, 2,211,146,160,231, 28, 10,164, + 84,215, 26, 74,210,117,119,174,208,174,248, 81,133,217,229, 21,223, 75,125,170, +202,138,127,141,100,116, 65, 9, 54,219,193,152,177,138, 2,160, 94,122,203,147, +247,143,217, 77,229,210,226,194,113,204,170,223, 23, 54,150, 16, 44, 78,186, 54, +223,227,162, 84,157, 88,248,219,226,119,226, 68,210, 97,188,212,245,236,124, 49, + 98,174, 42, 56,138,223,190,205,196,229, 62,211,242,216,201,100,100, 7, 68, 21, + 83,251, 65,184,167, 78, 98,128,154, 35,173,203, 56,108,155,105,104, 3,100,220, +117,115,128,129,119,211, 89, 82,180,165, 85,208,254, 18,248,205,132, 52,145, 74, + 63,174,169, 23,121, 31,251,191,120, 90, 43,209,247,167,225, 60,205,172,108,136, +146,159,191,185,175, 34,160,204,241,250,137,104,127, 60,210, 21, 50, 13,253, 1, + 9,183,194,251, 0, 28, 36,195,222, 59,173,243,156,158, 92,163, 93, 16,194,182, + 22, 28,130, 42,210,201, 30,107, 59,204, 62,213, 74,116, 45, 74,107,225,217,248, + 81,126,146,205,220,128,233, 55,179,122,131,255,224,177,123,230,134, 58,243, 66, +174, 14, 24,247,231,149,213, 63,224,172,150,104,255,220,252, 92, 32, 13,127, 69, +211, 49, 36, 74,112,206, 97, 70,230,149, 8,211,250,240, 64, 25,213,242,211, 18, +228,103,193,225,230, 50,195, 22,167,222,135,166,118, 16, 47,254, 69,106, 46,210, +120, 72, 36, 31,226,215,120, 47,105,234,218, 25, 97, 14,138, 53,247,170,125,120, +255,211,187,180,251,178,187,195, 96, 75, 27,243,118, 36,131,183,119,230,245,216, + 40,171, 96,139, 20,102, 30,113,231, 29,140,118,182, 61, 82,178, 32,137, 88, 82, +209, 73, 14,112,206,234,110,191,149,211, 91, 95,208, 90,191, 43,230, 35, 7,200, +109, 32, 3, 74,164, 93, 52, 19, 38, 92,210,160, 17, 39,130,169,227, 33, 64,166, +228,252,128, 43,193, 80, 62, 94, 24,158, 29,196,243,192,212,157, 48, 24,140, 13, +251,175, 98,193, 96, 91,126, 11, 91,110,202, 31, 95,114, 48,156,108, 23, 98,141, +134, 6, 65, 61,146, 18, 57,108,185, 68,225,216, 18, 45,110, 49, 44,151, 51, 28, +136,213, 31,169,205, 64,129, 93,100, 15, 84, 75,201,138,114, 25,139, 1, 8,117, + 88,126, 23,120,202,191,120, 46,127, 16,117, 56,167,128,149, 75,213, 4,150,160, + 92,176,187,148, 75,142, 9,255,101, 52, 82,193,203,173,190, 90,142,222,147, 75, +127,211,190,201, 91,175,148,114,120,176,243, 61, 29, 71,227,216, 88,247,100, 33, +255,213, 82,125,102,219,195, 18, 88,122, 10,167, 70, 61,126, 47,117,221,225, 30, + 40, 45, 81, 20, 16, 47, 64, 21,111, 30, 20, 78,165,165,250, 14,173, 86, 82,182, + 56, 54,223,154,221,119,231,103,157,119, 74,254, 88,112,221, 86,135,124, 61, 98, + 95, 81,197, 85,232, 65,237, 99,229, 94, 8, 84,215,221, 10, 30, 87,210, 11, 96, + 61,146,161,216, 9,216, 12,217,106,111, 81, 0, 17, 64,206,195, 72,252, 32, 15, +164, 71, 37,131,194,153, 21,194, 22, 99,189,189, 14, 38, 47,148, 8, 29,254, 88, +129,197,105, 54,222, 58,152,221,142,131,136, 71,126,118,129, 3, 63, 11,217,204, +209, 72, 83,199, 92,147, 11, 0,131,159,193,172,183, 35,118,153,181,240,119,236, + 27, 33,112,217,146, 60,114,251,173,120,145, 42,243,204, 87, 28, 42, 77,172, 49, +218, 95,151, 16, 87,215,252, 26,195, 20,231, 23, 61,245,233, 37,102,145, 74,111, +107, 16, 53, 56,154,128,104,107, 52,195,169,152,184, 64,216,140,137,104, 43,201, +252,241,163,180,128,162, 69,203,193, 60,196, 32, 99, 27, 87,137,209,230,186,104, + 20,122,240, 85,194,236,171, 50, 29,224,107, 18, 6,186,204, 38, 12, 69,200,170, +239,236, 28,152, 20,231, 22, 24,198,188,100, 7, 53,218, 16,221, 32, 78, 57, 89, +189,216, 61, 28,248,171, 37,185,153, 58,202,195,204, 98, 86,217,177, 3,254, 16, +149,168, 21, 48,149,221,251,106,207,231, 3, 24,192, 88, 12, 80, 93, 30,149, 27, + 89,238,175,166, 13,104,123,242, 32, 48, 23,233,177, 27,124,235,235,244,111, 70, +137,183, 54,152,189, 46,123,227,221,217, 18, 72,142,227, 25,233,135, 71, 19, 43, + 83, 3,105,156, 92, 66, 55, 56,163, 40,108, 52, 63,120,251, 6, 47,247, 11,192, + 77, 26,140,156,246, 13,154, 72,252,205, 54, 31, 1,151,232, 25,170,123,203,252, + 85,157,162,190, 75,206,146, 65, 13,230, 39,119,171,184,177, 36,102, 52,184,134, +135, 68,194, 4,249, 70,109, 94, 9,181,193, 49,219, 91, 73,205,163, 12,230, 19, + 65, 61,126,114,158, 93,246,208,231, 94,239,122,107, 87,161, 15,253,204, 14, 19, + 40,161,134, 93,185, 63, 36, 90,132,138,245, 19, 22, 15, 46, 23, 65, 92, 75, 19, +191, 0,127,252, 35,229, 72,191, 92, 3, 17,143,238,180,159,222,182, 99,112, 94, +117,213, 48, 8,229,248,226,232, 4,209, 9,223,147,224,151,223, 68,139,214, 33, +127,171,189,168,191,136, 53,102,113,239, 68,199,123, 76, 10,111,147, 6, 88,193, + 20,244,233,205, 81, 14, 83,248,114, 31, 87, 21,242, 84, 22,126,248,103, 19,212, + 63, 92,112,238,246,118,217,254,167, 30,211,206, 39, 6,206,168,169,100, 35, 45, +242,166,202, 87, 72,197,202, 62,217,144, 50,107,242,156,199, 32,204,176,123,111, +120,228,167,126,255,169, 45,255,121,141,176,227, 52,109, 19,106,215,139, 1,137, +193, 61, 47,166,104,120, 92,135, 9, 36, 69,176,194, 34,136,161,159,133,205,212, +149,140,104,238, 76,178, 41,208,185,194, 54,180,126, 3,167, 76,105, 81,153,241, + 34, 41, 12,141, 27,107, 98, 71, 34,209,213, 22, 32,181, 12, 23,231, 64, 34, 58, + 37,130,254,224,203,125,166,226,194,232,163, 11,133, 25, 27, 25,151,138,101, 66, + 21,171,129, 48, 72, 61,178, 21, 13, 66, 40, 14,142,215,116, 32,191, 31,206, 9, +156,117, 68, 17, 92, 92,169, 44, 75,130,160,205,120,178, 68,217, 5,129,191, 6, + 56,113, 18,183,123,244,111,230,146, 3,158, 23,109,240, 5,145,118,195,114,137, + 65, 28, 17,173,227,159,148, 34,247,168, 75,132,245, 73, 18, 19,116,230,246,227, + 15,199,100,139,205, 32, 22, 24, 10, 87,179, 77,202, 9,208,215,183, 41, 19, 36, +238, 65, 41,156, 85,160, 69,241,178,206, 63,210,156,178,214,200, 93,231,244,154, + 4,106,110,228, 99, 93,248,203, 27,106,118,227, 26, 27,155,213,197, 74,123,180, +143, 49,144, 42, 7,180,192,214,207,190, 83, 99,230,216,224,176, 62, 85,103,139, +213,170,168, 59,175,218, 5, 96,166,128,146, 5,200,143,189, 72, 59, 78,220, 96, +167,166, 7,117,189,163, 98, 79, 68, 89, 93, 72,198, 62, 76, 2,157,196,140, 72, +227,119, 97, 49,122,220,105, 37,122,205,201,162, 40,205, 67, 81,157, 98, 60,150, +228,252,142, 64, 76, 77, 37,162, 8, 54,140, 61, 29, 76,213, 22, 85,220,180, 41, + 51,205,241,151,228,113,204, 89,252,176, 51,134,179, 29,120,219,192,114, 85, 49, + 69, 91, 14,184,182, 73,157, 58,209,209, 11, 40, 52, 21, 79,134, 63,233,142,165, +219, 98,160, 4,214, 11,155, 31,167, 57, 60,137,154,142,210, 13,107,190, 7, 32, + 64, 66, 2, 78,214,145,239, 26,247,178, 43,222, 53, 96, 28,214,225, 0, 55,137, +181, 48,226,235, 82,104,118, 0,232,180,167,140,136, 52, 1, 28, 79,242,155,116, +240,177,104, 92,214,234, 81, 98, 35,144,242, 64, 81,162, 36,104,196,112, 57,116, +209,163, 52, 90,169, 73, 74,225,105, 58,218, 76, 73,184,234,196, 62, 63, 70,169, + 3,234, 8,144,217,127,132,206, 95,198,249, 93, 54,121,134, 83, 71, 98,252, 23, + 75,205, 77,240,223, 47,230,138,161,248,138, 30,241,150,108,156, 57, 49, 70,136, +231, 54,137, 6,204,142, 20,122,245,226, 6,215, 35,186,210, 93, 40,141, 62, 51, + 76,217, 20, 52,224, 32, 8,130,104,158,196,167, 32, 51,196,138, 87,234, 87, 47, + 1,195,235, 54,137,134,189,226,146,226,208,161, 34, 61,102, 97,190,122, 48, 43, +141,131, 68, 81,134,145, 83,224,110, 35,209, 89, 37, 67,189,210, 60,115,156,134, +181,108, 70, 11, 21, 14,114, 85,209, 20,254, 18,116,102, 41,127,241,103, 41, 13, +145, 44,187,148,211,245, 31,188,168,134,246, 60,218,190,180,245,221,109, 21, 23, + 13, 71,144,180,151,117, 54,113, 4,196,158, 0, 70,229, 29, 40,138,193,135,245, +128, 98,224,120, 26, 59,114,198,232,251, 32,206,166, 9,139, 15, 55, 43, 77,159, +167, 73,207,198,106,163,108, 18, 52,201, 86,135,225,181,138,192, 4, 38, 42, 18, + 71,224, 93,134, 53,253, 73,139, 93, 25, 9, 98,115,196, 4,224, 45, 39,208, 74, + 24,123, 10,212,127, 16,111,194,172,128, 65,205,199, 91, 91,131,212, 65,232,199, + 90, 33, 47, 56,127,211,212, 12,145,166,232,247,163,152, 81,202,207,223,254,147, +111,141,208,172, 65,211,133, 11,110, 19, 18, 46,243, 86,159, 40, 90, 32, 54, 35, + 2,223,161,206,188, 11, 57, 46,105, 26,165, 17,124,108,247,186,218,165, 73,107, +188,254,172,223,168,143,112, 33,172, 77,166,175, 37, 88,187, 9,236,161,169,145, +181, 5, 71, 45,145, 89, 16,105, 36,232,218, 51,215, 44,233,112,250,182,166,154, + 41, 0,245,134,133,165,135,149,246,240,112, 3, 13, 5, 48,188,121, 22, 26,143, + 69,181, 49,217,188, 16,120, 86, 16, 52,168,226,110,179,201, 37, 82, 44,240, 56, + 43, 53,129, 66, 62,105,104, 79, 75, 56, 75,134, 53, 56,121, 4,250, 93,142, 75, +197, 65,125, 95, 67,244,236,166, 18, 14,255,250,151,120,213, 44,105, 27, 67, 15, + 83,106,237,125,120,211, 98, 94, 49, 96, 98,188,136,226,220, 51, 88, 50,220,150, +115, 86,220,185,188,121, 22,230,234,220,197,114,146, 66,137,155, 81, 21, 49, 6, +124,241, 92, 13,248,124, 86, 18,175,111,116,112,102,149, 17, 12, 28, 7,193, 22, + 9, 18, 35,144,195,149, 12, 62, 92,240, 28, 61,137,240,228, 69, 4, 88,205,102, +118,251, 22,198,242, 28, 72,220,196,195, 1,162,110, 29,104,118,118,253,214,210, +112,112,102,166,143,153, 99,231,131,234,197, 19,120, 46, 24,155, 32, 84, 18,249, + 92,109,202,189, 23, 39, 46,209,148,105,174, 21,103, 34, 72,134,120,193,139,168, +237,186,213,204, 80,252, 93,110, 44,102,137, 37,189, 77,151, 44,138, 92,200, 78, +161,218, 70,157,145,184,136, 19, 22, 94, 34, 37, 4,230, 96,226,134, 75, 3, 10, +224, 86, 8, 38, 64, 33,102, 61, 26,186, 12, 1, 58,189,196, 26,116, 0,210, 48, +240,207,219, 50,197, 23, 60,223, 21,205, 68, 39,195,175, 76,240,109,221,196,216, +154,160,128,168, 83,152, 14, 93,209, 66,133, 56,107,224, 66,104,224,213,133, 84, + 84,247, 76,201,176,108,247, 27, 24,125,121,219, 27, 19, 67, 44, 70,140, 87, 99, +137,136,228,152,159,106,145,127,215,133,206, 20, 94, 27,109,177,150, 96,154, 61, +118,129, 71,229, 9,133,118,208, 81, 15, 89,151,107, 69, 4, 59, 91, 47,166,129, +104,214, 93,159,244, 27, 18, 70, 95, 16,161,174, 34,109, 7,146,132,100, 89,218, +106, 96, 43, 19, 61,144, 37, 70,122,109, 64, 69,125,219,134,172, 78,217,161, 24, +136, 16,250,113,195,192,196,224,153,118,105,214, 83, 59,137, 10, 78,102,199, 48, +128, 2,243,192, 64, 36, 29,196,105, 53,178,148,165,175,236, 74,195,194,250, 63, + 40,126,156,242,104, 12, 0,140, 90, 73, 78,187,161, 95,218,135, 52, 86,232,117, + 29,225,239,213,157,203, 77,143,117,193,102,133,121,239,133,188, 75, 51,165,215, +227, 84,114,129, 67, 93, 79,172,226,215, 34,197, 19, 93,247, 41, 51,100, 44, 78, +148,113,226,105, 71, 0,202, 59,139,113, 57,129,195,203, 83,231, 12,204, 96, 22, +108,136, 41, 85,117,240,222,243,142, 27,103,243,225, 62, 51,118, 81,192,117,227, + 86,214,225, 62, 68,177, 56, 12, 62,190, 72, 36,126, 79,224, 75,204, 89,210,139, +108,201, 52, 54,172,219, 46, 29,168,164,207, 99,226,235,114,209,235, 31,227,225, + 10,178,191, 89, 73, 41,228, 32,162,188, 34, 95,146,130,131,184,173, 6,182,111, + 51, 49,132,130,201, 7, 93, 76,138, 64,192,230,162,166, 43,145, 9,250,184, 69, +191, 43,240, 58,241, 61,213, 76,252, 73, 27,117,137, 83,138,108, 11,250,151, 86, + 16, 17,100, 50,247,162,161,163,160,203,110, 94,135, 17,187,230, 27,235,202,226, + 57,209, 6,114,242,103,105, 97, 58,163,203,228, 44, 45, 98, 88,140, 23,133, 4, +132,251, 54,217,208,189, 17, 10,117,245,239,170, 82, 9,191,130,181,246,176, 29, + 82,147, 4, 13, 0,254, 31,155, 45,110,192,253,133,241,230, 60,106, 27,247,134, + 56,156, 82,242, 17, 53, 87, 78, 77,147,180,142,144, 88, 65, 36,118,229, 52, 94, +183,116,181, 22, 71,213,198, 47,247,251, 79,222, 91,126, 9, 9,135,176,194,189, +164, 38, 18,253, 81, 61,249, 99,195, 9, 68,242,208,207,206,192,190, 1, 8, 64, +154, 75,220,241, 70,235, 34,145, 36, 64, 10,215,232,119, 82,250, 84, 29,204,100, + 72,175, 8, 79,255, 7,173, 9, 18, 68, 36,200, 91, 45, 37, 49,119,183,100, 76, + 75, 60,169,135, 69, 78,140,168,168,213,232,142,229, 83,203,158, 12, 43,168,127, + 83,110, 66, 28,145, 49, 3,226, 36, 56, 25,106,113,144,241,176,166, 2, 41, 44, + 81,195,142,234, 72, 74,253, 98, 96,131,243, 92, 73, 81, 53,169,197, 36,132,135, + 92,202, 48,244,189, 11,171, 60,211, 13,202,112,144,108, 38,192,232, 4, 40, 48, + 28,213, 88, 6, 69,124, 57,176,250, 96, 75,147,179, 54,150, 60,107,210, 33,195, +169,176, 86, 19,120,218,249,243,208,198,175,125,217, 90,189,128,164,181, 90,208, +211,124,222,180, 22,180,134,177,234,111,185,193, 39, 87,129,209, 65, 4,219,244, + 63,183,193, 91,189, 58,114,182,186,112, 94,102,191, 42,131,159, 5,158,205,211, + 57, 53,139, 38, 20, 43, 78, 95,177,201,204,159,172,222, 46, 64,131, 96, 63, 37, + 37, 66, 50,110,130,159,193, 35,185,162,144, 28, 42, 85, 76,129,159,176,145, 47, +197, 97, 20, 48, 27,151,233, 72, 14, 98,157,111, 39,225, 94,107,195, 90,135,125, +184, 40,201,175, 25, 98,124, 93,126, 42,112, 36,100,197, 65,234,205,162,126,207, +134,142,168, 31,216, 35, 35,177,180, 71,163,196,180,246, 54,164,217,195,106, 80, +209,236,206,255, 78, 0,192, 9,175,198,164,158, 84,209, 49, 1, 52,164, 14,168, + 87,114,221,226,187, 60, 33,161, 17, 32,140, 75,222,171,118,124,116,253,103, 15, +123,165,168,168, 6, 84,232, 72,203,248, 84,211,245,232,100,111,209,232,222,220, +244, 79, 81, 73,183,228,148,113,106,100,207, 66, 73, 95,109, 58, 77,124,193, 28, + 65, 55,118,250,169,169, 62, 79, 16,116,231,226,147,228, 17,135, 6, 27, 23,102, +156,130,122, 57, 32,153, 98, 73,154,129,188, 91, 94,106,173, 41,189,230,254,138, + 99,239, 21,198,220,132, 28, 35, 18, 69,148, 43, 34,131,160, 63,142, 64,197,200, +246,198, 8,243, 10, 25,111,213, 66,113, 43,242,122, 52,136, 48,216, 31, 82,246, +156, 22, 15, 73,177, 3,159, 83,244,224,216,181, 89,118, 44,216, 15, 73, 87, 22, + 39, 78,111,215,175,147,175,122, 20,222, 6, 25,225, 55,238,164, 33, 65,104,146, +253,202,191,138,238, 59,255, 46,160, 79,183,143, 99, 45, 86,115, 53,241,155,202, +167,136,174,170, 37,242, 69, 15,114,135,176, 79,133, 95,109,128, 35,133, 2,247, +194,140,110,218,135,175, 17, 81,108,220,178,185, 6,132, 23, 0, 50,105,172, 26, + 33,214,106,216,172,229,161, 13, 27,179, 86,144,227,138,182,101, 33,166, 83,242, +155,242, 9, 57, 45,226,212,130, 96,112,209,134, 44, 61,178,115,188,106, 97,183, +184, 4, 26,238, 85,147,199,224,188,212, 92,210, 20, 92,127,152,154,244,215,134, + 5,241, 74,135,190, 64, 30,245, 57, 57, 52,156,114,194, 6,232, 41,217,165, 66, +156, 28, 4, 88, 87, 88, 44, 23, 42,141,137,224, 0,226,245, 2,204, 83, 77,192, +185,166,102,248, 78, 88, 21, 22, 36,147,185, 69, 69,138,128,225,173, 79, 97, 15, +104,106,204,198, 91,135,124,236, 43,191, 24,159, 0,148,216, 52,186,152,103, 29, +148, 86,132,150, 0,248, 18, 28, 34, 17, 88,184,161,141,130,218,236,107,162, 86, +108,241,197,118,229, 62,248, 79,207, 78, 94,160,137,173, 57, 63,212,100,182,253, + 18,223,153,122,202,211,227,118, 19, 31,190, 27,154,115, 67, 10,255,240,247, 8, +241,164, 81,101,201, 38, 63, 42, 14, 81,174, 19,152,106, 17,103,126,180,113, 34, + 48,191,122, 85,145,158,182, 76, 86,204,232,226,176, 14,247,119,223,126, 81, 57, +132,248,239,155, 28,117,195,152, 18,193,182, 45, 78,231,110, 92,217, 42,183,250, +128, 8,249, 19,174,159,179, 98, 35, 69, 81,230, 4,179,180, 55,143,117,104, 5, + 86, 22, 52, 64, 4, 76, 34,122,229,251, 46, 44, 14, 37,232, 73, 3, 0,201,139, +209, 60, 84,113, 53,252, 53,107, 84, 63,144, 63,221, 93, 85,243, 13,205,125, 6, + 49,125, 16,235,158,145, 68,188, 34,136, 47, 93,168, 1, 65,194,153, 16, 21, 35, + 50,230, 24,152, 81,142, 26, 54, 51, 21, 84,197,157, 67, 98,160, 28, 75,121, 72, +184,247,205,101, 83,170,222,126, 13,232,184,245,156,124,252,137, 7,210,185, 88, + 20,111, 94,226, 81, 92,109, 76,151, 24,188,243,100,175, 32,248,207,214,223,234, +219,129, 20, 23, 51, 24, 62, 90,247, 34,214,109,206, 95, 67,232, 87,153,138,219, + 23,128, 36,107, 2, 41,172,132, 91,254,234,211,191,163,186, 38,255,207,101, 49, + 35, 99,116,136, 80, 50, 40, 70,195,243, 63,119, 94,225, 95,251,172, 90, 10,106, +218, 65,103,231, 55,240,235,208, 58,202,177,243, 35,217,100, 83, 33,253,101, 49, +143, 23,193, 41,230, 83, 50,207,128,168,213,108,137, 23, 19, 26,112,231,194, 88, +215,148, 59,142,251, 54, 7,135,146,192,130,226,103,217,218, 7, 56,195, 79, 74, +225,137, 50,104,255,113,119,199,165, 57, 64,231, 70, 33,239,217,104,215,246, 62, + 84, 75, 4,247, 27, 61,162,221,134,106,136, 58,247, 70,139, 52,238, 97,205,209, +203,220,208, 34,179, 61,172, 45,198,117,246,219,148,236,205,155,240,157, 55,104, + 14,140,221,161,246,183,113, 75, 58, 67,188,102,211,254,245,165, 66,247, 30, 53, +170,191,122, 87, 27,245, 89,168,228, 16, 84,166,172, 21, 79, 84,149,137,236,210, +241,130,168,197,144,157,171,138,206,157,232,168,230, 43, 73, 53,247, 23,126,192, +244,238, 28, 80, 45, 45, 30,208, 47,156,186,189,244, 69, 16,205,169,133, 87,242, +103, 70,246, 90,102,157,202,109,106,239,206,228,174,137,110,183,119, 25,192, 93, + 51, 19, 59,149,160, 17, 81,150,248,205, 43,170,213, 6,106, 42,145,214, 28,163, +253,128,122,166, 54,199, 71,116,245,183, 98,122, 65, 20, 96, 55,152,150,233,156, + 79,185,204,163, 76,252, 9,205, 95, 58,206, 83,123,122,105,192, 35, 45,115,242, +111,252, 79,234, 32,240,253,198,202,206,199,185, 81,161, 75,219,151,113, 75,140, +180,217,209,177,179,105,134, 26, 98, 0, 71,199,100,225, 72, 35, 87, 42,180, 45, + 17,180,255,157,104,120,105,108, 41,211, 66,159, 39, 1,193,109,182, 38,224,140, + 88,107, 22,182,182, 22, 96,187,244, 33,197,252,253, 92,141,234, 12,224,122, 59, +203,239,186,169, 81, 63,216,182,118,229,196, 40,164,202, 50,234,213,210, 8, 36, +236, 58,251,115,178,166,104,179, 75,178,101,165,141, 27, 18, 62,134,139, 3,112, +126, 6,128, 88,229, 88,220, 64,137, 3, 41,204,200,225,101,175,155,209, 90, 16, +123,194, 59,142, 0,231,132,213, 16, 50,182,172,143,147,111, 19, 89, 57,137,173, +120,165,126,249,253, 18,214,153, 53, 88,187,247,196,130,121,159, 58,173, 96,192, +107,217,230,101,105,180, 27,181,112,228,195, 57, 75, 0,152,130,115, 28, 21, 40, + 43,158,242, 9, 0, 11,158,194,113, 26, 15,105,179, 80,240,252,212,114,206, 48, +240, 98,167, 22,176, 21,152,214,228,113,214, 9, 24, 0,163,241,236, 24,192,171, + 99,148,135, 48, 87, 96, 29,126,232,240,247,137,162,120,211,247,245, 46,108, 93, +128, 69, 19,145,247,147,191, 74, 57,187, 51, 46,179,220, 21, 0,196, 45,238, 50, + 31, 81,221,204, 0,162, 85,108,184,176,230, 58, 3,169,108, 15,134, 60, 23,183, + 14, 62, 55, 90,123,152,199,183, 36,240, 56,102,138,161,140,182,125,135, 69,230, +134, 15,205,119,109, 0, 24, 82, 28,180, 92,145,241,148,176,181,125,233, 80,210, +207, 62,192,106,241,147,135, 86, 96, 54, 62,128,193,213,203,194,122,142,170, 57, + 14, 27,161, 26,139, 96,156,202, 18, 30,208, 0,246, 54,200, 66,181, 72,244, 88, +150,177, 3,188,159,241,198,173,255,179,120, 45, 4,103,132, 5,217,141, 63,255, + 99,157, 35,255,155, 12, 18,243, 73, 84,112,190,214,218,129, 3,126,108,118,253, +208,185, 39,175, 86,213,199,254,215,128,211,123, 8,195, 30,139,119, 27, 62,203, +220, 46, 55,128, 97,167,220,153,111,180,196,218,231,134,161,203,215,251,238,167, +172, 16, 53, 87,241, 3,194,179,154, 21,250,105,181,118,105,155,252, 76,176,182, +114, 47,115, 28,157,171,166,114,199,185, 38,231,244, 55, 49,109, 50,243, 20, 34, +179,195, 52,121, 25, 3,252,167,140, 84,153,164,244, 50,128,183,104, 21, 87,204, +151,174, 4,240, 20,123, 99,149,105,254, 19,131,248, 15, 28,169, 82, 73, 69, 50, + 58,111,236, 15,159,229, 75, 5,105,229, 9,195, 49, 99,105, 1, 29, 30,250,231, + 14,191,101,182, 64,113, 50, 61,236, 57,105, 46,193,121, 96, 26,116, 22, 56, 7, +232, 45,107, 27, 18,243,216, 68,115,251, 91, 26, 5, 93, 72,102, 15,200, 29, 34, +132,211,212,182,229,242,161,152,238, 76,207,213, 60,142,193, 11,216, 42, 6,160, +146,172, 26, 88,187,196,240,157,221,148, 30, 68,109,150,170,240,236, 81,239, 7, + 37,191,233, 90, 61, 39, 59,207, 99,132,193, 43,192, 87,150,102, 26,151, 79, 89, +104,147, 75, 40, 40, 85, 80, 8,143,217,173,170,214, 13,197, 22,119, 94,183,152, + 7,139,206, 26,189,240,239, 28,208, 76,194,131, 37,239, 89,245,119, 64,135,208, +173,231,198, 53, 44, 55,248, 68, 21,103,143,207,140,243,213,119,229,233, 60,189, +161,144, 99, 74, 35, 69,183,187,216, 62, 5, 60, 36,232,198,155,232,134,189,192, + 56, 39,127,221,213, 93, 42, 21,206,160, 21, 92,160, 20, 42,210, 38, 27, 34, 25, +125, 66,186, 54,122,101, 91,216,131,162,176,137,184, 46,143,194, 54, 32, 62,203, +104,161, 65,224,100,192,226, 62,189,238, 70,167,107,176,164, 8, 80,158, 84,121, +177, 27, 9,193,137, 34,208,190, 12, 57,132,117, 4,175,111, 50,205, 10, 24,245, +220, 66,137,216, 91,253,197,184, 38,148, 98, 0,102, 18, 58, 30, 48,145,115, 6, + 52,189,222,113,172,228,159,238,119, 56,199, 75,219,121, 8,162,203, 94,207,131, + 8,165,129, 1, 15,226, 48, 0, 48, 0, 50, 0,252, 64,134,236,158,123,252,104, + 26, 17, 84, 35,173,181,214, 90, 63, 43, 85,185, 8,138,148, 31,200,144,221,115, +143, 31, 58, 91,134, 61,152, 33, 10,226,167,211,206,254,255,117, 93, 87,164, 1, +167,245,244, 84,101,185, 56, 16,163, 41,101,169,159,244, 8,199, 36, 90,141, 85, +117,163, 62, 43, 81,130, 28, 65, 18,100,247,234, 5,221, 17, 20,169, 4, 25,178, +123,238,241, 19, 5,111,173, 99,139,134,193, 80, 8,148,140,242, 66,181,169,178, +153, 9, 4,218, 54,150, 65,154,225, 6,231,253, 8,224,108,195, 38, 69, 11,144, + 33,187,119,103,111,248,180,181, 29, 13, 9,164,104, 91,219,254,251, 41,109,106, + 68, 19, 34, 74, 80, 55,134, 57, 83, 74,141,101,101, 46,107, 35,221,125,121, 81, +200,144,231,164,164,148, 59, 89,217, 94,202, 61, 28, 14, 15,196,238, 39,140,142, + 3, 71, 66,218, 15, 36, 29,132,218,168,211, 93,147,179,172, 1,227, 52, 17, 8, + 6,134, 70,130, 1, 73, 18, 68,195, 90,218, 3, 83, 80, 65, 32, 33, 28, 16,134, + 2, 65, 16, 18, 12, 10, 2, 65, 65, 32,132, 68, 16, 4, 66, 16,132,128, 34, 64, + 48, 4, 66, 56, 10,161, 48,134, 75, 63, 65,131, 36,170,105, 36, 26, 28,197,163, + 38,123,238,120, 24, 37,201,166, 16,195,225,233,125,157,143, 31,212, 20,236,151, + 98,235,148,103, 89,216,169,230,149,154, 64, 47,130,225, 35,142,242,121, 13,146, +142,158, 53,246,114,245, 0,148,216,253,118,102, 67, 60,130, 97,134,171,142, 96, + 39,210, 82,180, 30, 58, 20,215,193, 24, 85,220,171,157,182,197,177, 8, 73,223, + 15,234,220,203,163, 36, 7,249, 27,132,164,231,171, 18,214, 6, 30,120,182, 62, + 47, 89,149,223,250,139, 66,198,183,141, 89, 98,210, 57,185, 30,168,239,226, 53, +252, 99, 60, 34, 77, 44, 12, 11,188,237, 16,174, 16,121,215,103, 75, 84, 25,171, +194,110, 6, 83,157,110,181, 46,200, 26,104,115, 80,139,148, 24, 17,110,230, 24, + 26, 20,105, 21, 97,142,227,226, 16,142,235, 50, 1, 45, 64,191,241, 77,146,201, + 32, 39,173, 78,242, 98, 3,150,135, 9,172,202,215,181, 71,150,103, 90, 10, 62, + 33,215,121, 14, 40,205,228,146, 34,108,118,236,200,223, 93, 5,105, 6, 25,165, +182,113,255, 39,211,198, 18,160, 91, 26, 34, 90,254, 71, 33,131, 47, 96, 5,127, +235, 54, 16, 49, 13,227,246, 14,177,134, 36,217,199,161,157,206, 99, 32,148,166, +215,184,150,166,116, 45,131, 99,236, 80, 87, 91,209, 82, 98,100,115,173,240,249, +128,205, 7, 68,138,199,250,214,166,103,100,154,246,113,192,119, 27,229,110, 78, +100,251, 32,131,154, 22,237,214,115,159,200,143,108, 73, 50,217, 96,102, 93, 67, + 20,116,186,233,159, 24,115,154, 78,150, 81,155,162,226,182, 65, 85,155, 99,121, +198,174, 62, 56,115, 26, 90, 67, 2,107, 53, 63,118,148, 84, 40,201,129,119, 65, + 30,124,148, 72,178,168, 13, 47, 7, 68,195,136,217,107, 99,229,114,240, 82,125, +197,148, 54,214,195,164, 66, 13, 21,168,220,150,191,155, 50, 89, 36, 73,181,135, +124, 76,164, 64,100,114, 19,122, 57,253,172, 50,103, 50,198, 99, 79, 87,176,243, +194,210, 55, 60,158,238,204, 61, 26, 4,104,185,226,212,143,158,210,218,141,247, +185,217,180,175, 44, 84, 29,255, 6,185,227,207,238,104,255, 28, 81, 96, 10, 20, +117,227,164,125,121, 20, 18, 68,139,188, 5, 37,130, 60,117,132,247,193,210, 82, + 68, 39,214,107,209,100, 94,254,128, 44,174,122, 16, 64, 1, 49, 53,138,214,250, +110, 73, 56,158,147, 91, 64, 9,219,244,253,232,199,217, 83, 84,235, 66,225, 59, +129,165, 18, 85, 54, 37,201, 12,201, 5,124,118,106, 88, 27,222,193, 24, 20,102, +121, 5, 28, 29,180,130,161,251, 63,140, 14,151, 52,225,104, 1,191, 91,146, 17, +147, 43, 78,135,161,255,254,211,144,217, 91, 51,166,108, 9,222,107, 64, 28,234, + 64,195,171,162,245,135, 70,157, 80,173, 43, 61,165,206, 72, 76,213,112,223,129, + 28,237, 79,120, 45,111,117, 7,192, 71,164,139,137,249, 1,201, 45, 62,236, 82, +123,108,109, 63,244,221, 15,194,116, 40, 5,183,239,204, 24, 96,148, 11,169, 67, + 4,179, 28,244,106,103, 76,233,236,220,230, 12,192, 62, 81,149,116,121,140, 3, +111,139, 35,236,128,142,101, 8, 92,213,156,145, 21, 87, 71,176, 16,109,168,247, +133, 89,116,239,218, 0, 58,176,196,149, 3,176,145,203,253, 91,115,193, 49,207, + 2,239,194,125, 4,247,155,198,232, 8, 60,227, 11,239,124,115,112, 95, 9,247, +218,132,157, 24,118,212,232,108, 34, 80,193,134,159,190, 80,193, 97, 75,252,168, + 4, 49,163,199,205,190,110, 96,140,141,204,197,171,150,199, 77, 55, 21,150, 39, +176, 47,161,129,156, 58, 13,218,236, 10, 49,204,213,243,114,174,218,163, 91,178, + 79, 88, 89, 87, 52, 69,125, 0,194,129, 62,251,106,129, 18,146,102, 45, 61,201, + 99, 66, 78, 36,244, 79,159,215, 74,186,105,103,188,217,175, 70,254,139,172, 32, +225,164,191,136,105,113,199,135,177,188, 64,137, 0, 14, 18,145, 84, 27,244,111, +165, 26,227,119, 33, 57, 90,164, 57,147,120,166, 11, 96,206,109, 18,204,178,184, +230,160,159,135,249,135,198, 38,112, 13,215, 65, 84,193,161,129,188,226,103,163, +229, 39,211, 91,175,150,207,208,114,178, 38, 40,182, 27,208, 35,188,209, 63,241, +103, 80,241, 10, 9, 75,162, 70,208, 64,124,123,175,139,104,239,173,234,171, 98, + 84,212,216, 39, 88, 42,123,170, 50,143,160, 71,193, 9, 5,137, 1,209, 73, 64, + 58,127, 66, 24, 95,192, 89,250, 77, 5,169,114,176,150,178, 80,196,228,208, 45, + 45,224, 42,228, 82, 2, 8,255, 21, 63, 81, 65,216,165, 40, 32,254, 39,243,232, + 97,199, 45, 96,160, 40,159, 2, 2,139,113, 70, 9, 29,160,122, 24,236, 80, 30, +166,208, 55, 62, 6,142, 88,210, 2,138, 86,147, 2, 60,145,238, 51, 64, 89, 1, +101,250, 53, 13,178, 72, 96,166, 40,144,149, 41,234, 26,252, 91,192,153, 76,191, + 13, 46, 80, 0,154,228,154, 51,102, 49,111,112,192, 33,124, 28,102,247,195, 32, + 7,142,242, 65,145,227,157,251, 33,146,147, 64,249,128,201,249,227,126,248,228, + 72, 80, 62,152,114, 94,220, 31, 90, 57,210, 41, 31,104, 57, 7,238,135, 93,206, + 52,202, 7, 97,142,131,251, 33,153, 51,139,242, 1,154, 99, 94,209,238,135,107, +142, 80, 69, 86, 94,240,230,212,203, 8,175, 17, 11,149, 79, 50,107, 70,229,214, +114,188,169,140,173, 87,134, 18, 65, 94,199,244,208, 38,255,143,108,203, 16,213, +134,166,109, 22,155, 29,170,235,200,206,209, 31,128, 74,196, 85,177, 32,210,226, +223, 67,224,248,181, 78, 22,150,141,155, 43,132,142, 42, 41, 10, 32, 34,165, 36, +121,243, 5,184, 66,168, 97, 98,138,104, 74,246, 86, 29, 55, 80,204,184, 62, 1, +231,160, 55,115, 50,141,115,244, 53, 59, 21,165, 35,246,151, 31, 32,144,231,225, + 2, 51, 65, 42,197,188, 32, 39,121, 42, 50, 25, 39,113,225,176,204,192,201,167, + 54,119, 0,229,189, 1,100,240,242, 88,169,208,200, 73,145, 2, 25, 18, 91,194, + 2, 78, 91,247,140, 75, 17, 91,210, 39,135, 15,173, 49,169,252, 26,172, 20, 29, + 26,155, 20,121,119, 67,138, 60,158,132, 99, 45, 32,136, 24, 31, 68, 42,187,180, +113,181,116,202, 64,222, 7,203,191,109, 85, 26,177,166, 39, 31,121, 62, 32,193, +175,111, 95,252,226, 4,235, 43,219, 10, 70,107, 33,242,115, 52, 51,188,209, 12, +200,204, 25,102, 43,159, 16,232, 79,249,117,182, 92, 69,162, 56,234,223, 93,102, + 35,132,193, 82,163,233,247, 91, 96,125, 1,249,117, 73, 13,123, 9,195,202,191, + 8,153,109,106, 40, 78,120, 69,111,163, 95, 55, 50,247,155,254,144,160,183, 18, +171,224, 44,183,139,212, 21,240,112, 69,105,234, 97, 12,185,155,201,233, 30,169, +193, 13, 23,211,151,121,247,228, 81,152,193,172,172,161, 4, 76,199, 35,148,107, + 34, 14,132,191,114,111, 37, 24, 71, 77,193, 51, 89,151, 59,201,159,206,251, 22, + 10,158, 27,147,186,105, 67,225,141,151,165, 0,172,160,240,135,104,165,210, 50, + 94,161, 21,232,120, 1, 39, 11,215, 10,220,130, 8, 89,212,130,235,239, 5,238, + 75,165, 50,112,161,245,223, 89, 72,196,212,113,198, 46,148, 12,222, 98,236, 97, +231, 11,243,131,182,208,177,232, 4,195,122,176, 22,233, 61, 48, 10,136, 1,104, + 6,105,209,170, 71, 12,148,111, 83, 85, 23,202,208, 8,212,130, 83, 55, 23,205, + 0, 13,116,204,169,152, 26,208,160,248, 35,181, 83,147,140,105,232,246,189, 56, +204, 83,179, 3,214,208,119,124, 33, 8,179,219,130,212,149,249, 84, 63, 69,119, +174,119,188,167,246,248,129, 4, 93,208, 71,254, 9,226,176, 7,106,252, 5,188, + 71,144,131,204, 55, 53, 6,244, 8,241,224, 25,107, 98,149,191,235,142, 71, 42, +129, 53,254,104,153,175, 59, 82, 30,120, 25,246, 64,194, 28, 82,113, 91,248, 12, +107,145,227,151, 88, 21, 58,163, 87, 3, 28, 71, 34, 11,155,193, 46,178,129,248, + 37,112, 91,200,140, 76,162, 60, 72, 68, 29, 98,131,138,188,226, 99, 0,192, 32, +140, 97,146, 21,128, 14,220,179, 31,231,207, 72,113, 96,141, 90,218,126, 10,190, + 1,117,210, 73, 29,222, 38, 36,164,222,233,210, 50,224,166, 71,210, 98, 72,108, +143,108,140,110,220,182,142, 36,167, 57, 20, 72,228,254, 7, 53,213,202, 9, 72, +106, 41, 97,169,226,122,165, 97,223,129,245,215, 76,166,186,139,128,103, 9, 56, +213, 80, 46, 58,131,120,227, 78,240,169,138,135,106, 72,241, 8,218,196, 35,170, +202, 12, 57,227, 90, 71,190,107, 92,170, 34, 31, 61, 99, 0,204, 89, 33,147,143, +156,161,197,170, 83,213,237,163,102,128, 4,219,104,142,144,219,143,152, 81, 63, + 48,192, 34, 9,199, 18, 22, 61,215,185,119, 40,110,209,105,141,225,161, 13,173, +134,115,181,166,102,174, 10, 13,213,200,111, 69, 32,243, 20,175, 6,212,113, 97, +122, 48,201, 31,137, 6, 19, 3, 1,177,200,203, 68, 24,130, 18, 42, 62,139, 77, +180,118, 72,235,224,116,102, 12,204,175,106, 41, 42, 9,225, 14, 88,137, 92,123, +207,169, 91,171,112, 38, 1,204,198, 75, 48,158, 0, 89, 85,183, 89, 15, 26,128, + 33,181,228, 11,107,108, 82, 48,244, 41,196, 48, 76, 17, 77, 76, 52,140, 97,165, + 16,195,160,151, 68, 50,136, 50,148,209,160, 12, 63, 18, 98, 6, 71,195,189, 16, +175, 25,190, 18, 39,226,153, 47, 83, 34,206,253,145, 9, 12,134, 17, 91,167, 15, + 27, 78,161, 70, 54,200,146,249,130,168,242, 78,225,136, 22,121,221,142,218, 34, + 2, 20,147,121, 36,134,163,245,136, 52, 60,224, 28, 50, 4, 87, 64,128,146,208, + 65, 31, 25,165, 1,234, 0,137, 60,213, 47, 6, 33,187, 9, 59,123,128, 16, 35, +151,232,173, 68,147,208,146,154, 13,198,103,146,252,164,164,212,128,108, 81, 1, + 80, 18, 9,172, 28,133, 55,185, 91,143,233,190, 91, 97,216,152, 95, 31, 69, 17, + 19, 62,109,189,137, 8, 40,182,113, 78, 22, 44, 0, 62,134, 55,225, 32,226, 56, +133, 44,189, 11,111, 98,137,184, 26, 75,146,204, 48, 69,153,108, 14, 83,132,197, +228, 4, 27, 90, 81,229, 58,197,244,225,143,177,129,170,138, 59,197,198, 82, 43, +238, 20, 19, 58,182, 1,197, 25, 68,233,248, 27,129,136,147, 25,243,174,174, 55, + 49, 32,226,128, 1, 37, 39,216, 74,201, 6,240,240, 46, 34, 0,148,247,254, 37, + 44,201, 58,131, 9,159,202,212, 45, 57, 16, 44, 38,177,218,235,104,110, 7,144, +196,199, 23,100,146, 95, 23, 55, 72,180,161,152,196, 11,117,192, 88, 31,141, 74, +119,111, 84,134,249, 26,249,193,228,166, 10,212,203,119,195,212, 6,230,182,155, + 64, 59, 39,149,112, 48, 51, 51,159,206,117,244,180,210,106, 32,228,103,126, 77, +155, 73,249,236,172, 76,228,143, 66, 98, 99, 34, 38,252, 11,200, 27, 88, 18,136, + 51,212,190,245,147,137,204, 47,155, 76,114, 42,191, 94, 61,153,202, 86,132, 84, + 43,165,120, 76, 91,146, 15,154,189,166,132, 3, 40,171,159,208,148,146, 27,136, +195, 59,133, 0, 73,126, 7, 59,177, 45,153,138, 45,101,183, 96,150,254,183,252, +188,246,229, 32, 90, 29,102,191,166, 32,126,191,208,231,141,185,158,254, 71,235, + 44, 3,130,195,181, 2,100,112,143,120,167,144, 78, 55, 17, 80,161,129,101, 54, +153, 50,140,174,103,187, 50, 47, 78,121,131,106,198, 32,215,249, 0, 74, 97, 50, +107, 4,103,191,151,111, 91,129,242,115,128,238,118,103,120,201,113, 17,251,233, + 13, 11, 47,165,161, 90,208, 69,155,128,115,196,254,234, 97, 57,174, 21, 80, 72, + 32, 94, 24, 59,147,201, 10, 59,189,120,127, 65,131, 19, 40,174,243, 30, 22, 90, +254,115, 33,144,131,117,148, 92, 73,235, 79,239, 92, 65,128,132,225, 41, 5,211, + 59,160,143,158,128,170,128, 6, 36,144,175, 98,110, 79,118, 59,160,223,241, 93, + 44, 74,163, 49,105, 47, 13, 57, 34, 65,209,198, 59, 38, 8,112, 79,227, 65,204, +128, 65, 52,116, 90, 9, 26,240,160,141, 34,190, 38,182,240,252, 27,192,157,255, + 62,182,176,154, 7, 6,202, 98,158, 29, 62, 4, 96,209, 28,113,247,225,240,182, + 57, 80,154, 41, 67,118,142,192,140, 6, 21, 44,108, 79,189,141, 48,237, 61,149, + 83,222,249,179, 77,182,246, 68, 99,149,192,129,229, 56, 32,175, 77, 3, 94,131, + 24,112,114,188,136,221, 48, 52, 23,194,174,193,125,244,220,101,121, 33,248,205, +166,221, 77,103, 21, 34,136,177,210, 93, 96, 55,132,215, 12,166,175,103, 70,160, +208, 17,172,117,226,150,127,221,216, 8,190,152,112, 55, 2,233, 30,147, 36,112, +101,161, 6, 48,129,254, 90, 37, 2, 79, 44, 42,112, 15,118, 9,231,139,152, 54, +172, 48, 16, 73,240,100, 30,157, 21,254,134,229, 6,166, 22,216,220,128, 88,123, + 96,212, 44,180, 52, 87, 58,234, 88,136,160, 56, 1,147,240,195,224,197,196,170, + 4,229, 19, 86,169, 24, 90,240, 42, 84,162,224,191, 48,152, 73,175,152, 85,175, + 96, 45, 60,151,146,179, 28, 21, 47,136, 22,116,102, 58,163,176, 42, 25,132, 90, +104,105, 76, 29,204,224,176,172, 65, 58,248,173,140,202, 12,172,113,144, 35, 8, +173, 66,136, 27, 86, 59,120, 17,182, 23,113, 33,195,186, 7,151,132, 49,153,143, + 51, 76,107, 13,111, 1, 60, 86, 0,182, 20, 67, 32, 16,181, 27,149,146,139, 91, +225, 49,140,191,141,136, 15, 19, 37,249, 20, 31,180,223,237,133, 8,214, 70,137, + 8, 0, 0, 40, 16, 57, 0, 58, 0, 59, 0,179,146,245, 71, 46,179, 91, 32,122, +155, 83,255,171,160, 53, 85,107,174, 81,221,226, 81,161, 84, 38,157, 59,136,239, +212, 90, 37,179,230,212,212, 49, 42, 60, 49, 69,186,181,175, 31,175, 94,252, 31, +128,229,218, 53,173,232,209, 11, 93, 37, 25, 12,199,165, 47,238,113,155, 58, 87, +150, 99, 29,220, 57,227,247,220,114,141, 16, 52, 23,114, 62, 49, 76,102, 76, 31, +250, 82,194, 76,163, 17,198,159,250,177, 32,123, 73,196,151, 78, 22, 6,165, 31, +220, 52,149,175, 75, 3,158, 0,124,236,201,244,210, 10,106, 42, 33, 15, 9,145, +254, 40, 60,206,132,153,170,208,222, 87,102,101,107, 25,230,133,117,162,202,185, +244,123,252, 73,137, 97, 12, 73,103,219, 68,103, 40,228,115, 64,186,244, 11, 41, +168,253, 45, 13, 5, 87,230, 4,138,138,159,191, 50,107,102,210,189, 53, 31, 84, +239, 86,251,125, 22,204,217,186,181, 53, 54, 11,217, 53, 59,176,101,206, 91,176, +230, 12,216, 74,156,109,174,235,114,108,111,159,252, 98,156, 51,104, 71,222,219, +132,218,168,179, 77,147, 36, 5,201,114,195, 4, 17, 20, 28,141, 9, 67,138, 34, +164, 20, 68,134,251, 99, 80, 97, 80, 41, 44, 42, 12, 67, 65,144, 19,132, 66, 24, + 20, 81, 2, 41, 32, 2, 66, 4, 70, 0, 5, 4, 17, 34,101, 82,166, 3, 68,198, + 55,203,113,109,162, 13,203, 42,154,134,187,150,106, 62, 81, 3,216,194, 69, 81, +123,178,146, 67, 52,161, 99, 21,193, 66, 67,169,121, 91, 77,107,120,157, 49,131, + 48, 6, 51,217,194, 76, 71, 29,213, 34,199,106,209, 70,161,195, 64,199,146,179, +214,234, 67, 39, 28,109,178, 78,193,174,219,166,189,100,238,143,206,231,115,241, +113,163, 94,199,161,215, 24,214,155, 22,103,193,209,149, 72, 37, 72, 38,126,115, +183, 26,113, 75,157,236,138, 65,195,159,209,102, 41, 83, 89,159, 77,168,221,104, + 38, 59,235,228,180, 43, 13,210,233,101, 48,233,134,145,193, 88,205, 1, 59, 44, + 74, 69,118,117,248,122,213, 18,222,121,118, 91,215, 82,227, 80, 84, 63, 44,199, + 91,210, 9, 58,149, 92,157, 62,147, 92,189, 86,175, 41,195, 19, 85,158, 5,178, + 78,182,117,116, 10,102,112, 86,103,194,204,234,153, 16, 89,195,249,140, 51,242, +109,130, 63,119, 37,203,118, 10, 92,141,142,219,116,162, 91,141,171, 34, 69, 55, +211, 28, 7, 3, 29, 75,206, 58,229, 48,186,164,177,164,137, 59,125, 92, 13, 82, + 63,171, 94, 52, 39, 59,189,124,173,106, 9,239, 60, 86,163,180,214,228,174,144, +238,236,154, 74,116,218,150,156,245,176, 8,245,164, 48, 78,111, 47,135, 31, 42, +114, 20, 19, 40,211,108, 98,166,109, 34, 85,207, 42,219, 41,184,105,169,132,243, +156,115,121,108, 88, 4,209,250,142,236,134,207,159,156, 77,147,192, 46,135, 60, +138, 90,171,188, 12, 15,216,242,104, 51,205, 41, 90,251,179, 21, 98,116,147,248, +149,134, 1, 50,132, 82,109,168,137, 91,207,121,114, 30,209, 18, 16,150,128, 22, +101, 28, 13,221,222,162,252, 29, 49,128, 40,222,174,138,182, 20,215,243,235,202, +111,176, 73, 61, 29,165, 37,235,114,215, 61,222,248, 6,130, 90,202, 98, 72,198, + 6,199,254, 61,222, 37, 80, 27,147,187, 49,179, 49, 10, 31,187, 77,239, 59,168, + 83, 46,106,251,109,154,174, 90, 15, 42, 72,186,168,143, 14,199, 94, 82,108,119, +251, 82, 32,119, 59, 38, 76, 59,238,254, 99, 48,119, 65,116,196, 12,220, 70, 70, +152,249, 66, 43,201,146,168,173, 76, 85, 95,109,128, 89,114, 16,116, 25,194, 14, +108,225,165,217,162,246,209,164, 46,155, 90,176, 50,171, 89,253,202,113, 85, 59, + 65,208, 64,181, 65,130, 90,104,238,224,197, 38,158, 23,215,223,136,109,148, 73, + 45,231,130,228, 28,228,210, 84,236,126, 28, 26,184,184,103,137, 68,111, 65,221, +143,119, 83, 66,190, 93,109, 57,140,139, 59, 66,248,196,122, 93,204,211, 18, 3, +142,115, 99, 74, 74,252,111, 99,127, 48, 61, 57,194,120,107, 13, 56, 10,231, 66, +190,171,135,112,234, 54,239,114,166,118, 50, 78,155,179, 60,254,228, 65, 79,130, + 63,213, 65, 78,202,157,142,231, 40,213, 37,252,152, 90, 57, 46, 17,215,159,149, +103,154,185, 12,250,144, 64,197,187,226, 29,252,187,217,105,201, 20, 89,206,243, +213, 47,106, 48,214,144,239, 60, 65,212, 49, 23, 68, 94,187, 31, 14, 58,230, 24, +180,234,167, 82, 24, 8, 8,234,233,112, 97,183, 34,119,110, 9,236,129,219,214, + 66,143, 23,180,211,253, 7, 10,206,235,128,151,208,230, 78,235,196, 18,115, 31, +204, 82,134,101,142, 95, 55,204, 22, 28, 84,116, 94,156,161, 31,179, 88, 64,119, +120,117,131, 22,183,245, 16, 28,165, 81, 86, 36,244,216,121,226,188, 69,224,251, +198,176, 22, 22,209, 60,247,208, 75,234,100,213, 93, 41,207,172, 16,160,224,170, +234, 21, 77,237, 92,213, 82, 90,101, 78,159, 57,170, 10, 98, 85,173,200,201, 70, +176,169, 29,156,178,163, 55, 15, 31,193, 50,148, 48,245, 37,184,155, 99,186,167, +237, 2,175,226, 45,122, 82, 34,158, 68, 67, 4,210,182,103,220, 38, 53, 55,122, + 66,219,119, 86,115,118,162,225, 22,248, 44, 72, 97,100,138,229,191,130,121,254, +129,100,215,201, 32, 90,220,147, 89,128, 73,140,163, 44,182,253, 93, 36,196, 75, + 69,243,179,250,156, 61, 94,204,160,207,178,139,243,107,224, 41,193,102,250, 34, + 60,197,207, 61, 38, 2, 84,231, 86, 74,181,116,127, 47,185,167,196,159,237, 2, + 51,206,117,126, 29, 2,239, 73,236,213,106,229,174,218, 21, 79,102,121,148,153, +210, 61, 94,122, 32,249,102,233,249,201,166,207, 62,126,242,146,248,137,152,218, + 5, 29, 94, 37,162,164, 28,113, 83, 21, 89, 67,148, 9,184, 12,227,113,116,196, + 91,213, 78, 37,152,196, 8,237, 25, 5,241,222,128, 21,132,182,139, 58, 13,128, +255,189, 8,184,128,217,208,235,249,171,128,181,213,164, 73,211,243,199,178, 3, +142, 32,247,206,211, 54, 13,148,153, 21,192,185,141,111,138,103,174,167, 79, 4, +216,178, 57,242, 70,103,146,130,174,164,215,196,190,188,255,231,163,220,143,239, + 87,225,191,180,202,217,207, 97,182,255,107, 38, 75,243,207,165,136,145,113,248, + 88, 17,132, 56,163,194,167, 32,243,213, 56,203,129, 1,115, 17,133, 11,206, 60, + 51,176,239, 46,104,122,204,158, 9,127,132,144,126,108, 89, 41,133,229, 2,118, + 67, 78,150,147, 27, 67,184,164,208, 31, 70,186,255, 91,251,165, 36,163, 31,152, +238,151,131,130, 63,176, 1, 78,149,107,104,127,162,196, 46,155,157,175,210, 78, + 77,195,163, 53,211,135,203,127,244, 66,224,175, 33, 43,102,144,211, 99,122,129, +199, 51,211, 95,141,126, 31,140,179,185,158, 43, 77, 54,215, 62,108,208, 52,199, + 21,147, 93, 75, 50,252,249,155,155, 13, 65, 27, 52,229,245, 77, 44,142,214,154, +250, 89,107, 90, 50,178,177, 11,179, 65, 18,240,165, 57,217, 23, 79, 49,255,186, +113,208,190, 55, 50,246,118,250,247,189,239, 65, 19,153,159, 16,201,165,200,200, + 38,191,249,206,149,166,163, 45, 23,240, 84, 23, 51,101,213,239,186, 12,145,199, +123,193, 29, 92,191,197, 17,223,194,129,111,194, 79,161, 64,108,168,250,109,250, + 52, 69,146, 97,159, 66,128,225, 55, 45, 20, 70,202, 13, 45, 46,133, 88,230,251, + 41, 67, 14, 78, 19,250,101, 54,152, 35,107,189, 63, 30, 74,183,121,118,239,157, +223, 7,253,110,232,235,113, 93,105,165, 50, 85,133, 52,143, 75,229,149, 7,179, +201,150, 99, 9,249, 77, 75,142,252,141,111, 12,216,153, 80,164, 28, 9, 41,117, + 53,251,254,210,105, 90, 8,184,233,178, 80,121,109,204, 44, 80,169,126,150,242, + 91,128,250,206,104,143, 19,244, 25,187,231,147, 98,104,158, 39,220, 85,131, 29, +173, 17,120, 0,176,240,146, 53,203, 70,118, 42,228, 18, 83,251, 88,135, 77,141, +176, 65,114, 10,195, 50, 80,156,166, 91, 71,103, 20, 82,144,240,176,243,249,143, + 72,237,143,229,207,202, 34, 16, 88,113, 64, 72,174, 8, 79,155, 55,160, 63, 57, +167, 45,130,170, 84,147,170,107,134,108, 53,115,148, 5,189, 2, 5, 76,179,131, +135,151, 36,217,232,218,239, 95,217, 11,113,116,110,121,227, 51, 38, 64,129,122, + 3, 78, 19, 9,227,162,106,125,121, 44, 7,185,228,152,209, 81,209,216, 91, 7, + 46, 39, 25,210, 69,115,112,188,159,197,190,185,158, 21, 87,223, 72,213,172,247, + 35, 88, 13,149,168,111, 42, 66,105,182, 60, 90,140, 11, 63,114,200,162,227, 68, + 32, 59, 10,156, 75,120,156,184,143, 80, 19,104,120,192, 46, 4, 5,146, 40,146, + 80,148, 84,160,119,192,163,173, 44, 47, 89,127, 69, 75, 26,165, 88,183, 1,236, + 66,128,162, 43,196,161, 37,162,143,159,162,254, 21,123,113, 75,148,230,243, 94, +248, 50,195,222,215,217, 89,206,127,111,213,122, 20,214, 36, 98,114,192,128,164, +160,242,140, 16, 36, 86,121,104, 37, 92, 50, 76,189,156, 31,161,222,104,251,152, +116, 57,228,255,244, 99, 99, 63,252,122, 20,231,224, 5,149,118,146, 57,117,212, +199,198,250,187,189,103, 51, 37, 94,243,109,218, 87,102, 97,164,140, 97,160, 33, + 87, 24,227,160,161,150, 48, 39,138,223, 11,151,236,196,211,204,192, 94,103,193, +185,101,190,141,200,152,100,234, 97, 40, 39, 85, 57, 62, 59,164,173,159, 68,106, + 30,253,241,182, 13, 29, 20, 24,193,247, 61, 24, 98,204, 20, 17,129, 0, 76,128, + 41,220,187,130, 65,140,107,250, 16, 41, 95, 37, 60,120,218, 38, 66,230,242, 73, + 39,232,100,238, 71,225,223, 0,188,159,210,149,125,198, 54, 89,139, 78,115,227, + 27, 72, 48, 32,116, 10, 70, 61, 90,188, 0, 53,218,181,187,217,163,104, 48, 81, +114,136, 58,209,210, 92, 8,173, 67,218,174, 51,250,174,222,177,210, 92, 9,225, +113, 20,146, 3,142,226,161, 26,217,212,171, 99,129,214,147,198,190, 25,234,160, +224,192,206,246,241, 14, 62, 50,161,126,128,152,165,145,122, 88,201,247,214,211, +125, 98,198, 6,247,146,122,251,207,107,193,163, 56,194,110,126, 16,156, 75,135, +234, 95,245, 0,162,214, 71,250,212,162,121,179, 66, 60, 34,239, 31, 30,194, 17, +129,252,138, 88,203,173, 63, 44, 48,180,220,176, 19,213,248,101, 81,173,104, 28, +194,178, 6, 1,227, 27,216,120,113, 9, 24,219, 29, 72, 58, 6,152,107,232, 14, + 5,133,214, 67,129,168,195,131,243, 67,230, 47,161,144, 33, 78, 4,141,153, 80, + 72, 58,227, 17, 72, 83, 75,176,113, 19, 83,161,235, 74,150, 68, 40,100,249, 45, + 18, 39,133,214, 33,101,195,169,199,151,214, 9, 9, 30,136,208, 44,150, 25,128, + 70, 83, 73,114,114, 18, 24,119, 11,230,206, 32, 87,215, 62,164,158, 83,163, 72, + 32,105,104, 92, 35,111,125,208, 49,201,132, 23, 25, 67,202, 24,232, 33,145, 43, + 23,219, 20,212, 90,207,183, 18, 69,114,254,138,168,155, 28, 83,132,115, 5,106, + 23, 47,250, 73,186,149,112, 68, 31, 9,105, 20, 5,255, 23, 36, 99, 46,141, 50, + 5,217, 30, 41,151, 18, 21,116, 78, 28,216, 55, 24, 59,175, 77,243,152,204,255, +180, 44,106, 25, 7,139,189,241, 71,211,127, 1, 7,187, 84,111,169,241,124,188, +140, 6,218,155, 92,147,130,167,248, 5,149, 46,231,248,156,145,161, 37,171,253, +254,120,248,228,222,227, 68,199, 7, 31, 82,219,212,192,245, 62,205,137,103,108, + 15, 92, 84,255,103,195, 1, 4,187,255, 2,204, 3, 22,164,210,160,130,187, 96, +171,205, 58, 40,163,199,104, 44, 65,189, 51, 24,244, 15, 69, 24,150,223,222,191, +113,253,242,203,159,169,151,115,101,128, 62,145,221,228,210,249,192, 94, 0, 41, + 75, 47, 34, 37, 24,167, 36, 22, 98,190,161,196,122, 44,229, 61, 6,187, 6, 71, + 85,142,248,241,110,205,207, 93,149, 26, 64,131,137, 51,147,234,206, 78, 90,251, + 26,226, 26, 17,177,198,100, 79, 1, 86, 8,222,203,109, 6,161, 11,193, 80,224, +157,140, 51, 43, 52,197,218,165,246,200,208,198,105, 26,138,103, 69,200,251,241, + 97, 20,208,112, 18,190, 25,108, 98,165,106,219,129, 32,222,131, 66,227,133, 82, +111,146,218,101, 78,233,129,158,183,144, 50,149,211,138,136,200, 4,203,136,239, +174,174,227,127,141,170, 8, 53, 9,131, 44,180, 94,188,205,218, 66,118, 32,132, +137,156,176,155, 75,136,214,238,248,241,215, 14,196,177,172,160, 66,192, 88,104, + 26,135, 6,136, 3,205,192,233,146,248,174, 15,138, 7,165,168,195, 55, 30, 58, +255, 80,162,229,202,181, 99, 9,180, 27, 0,104, 65, 85, 82, 71, 84, 76, 76, 71, + 69, 76, 76, 76, 88,134,128,168,243,207, 1, 99, 61, 68,192, 26,169, 81, 73,154, + 3, 35, 48, 16,192,134, 64, 80,145, 8, 4,130,114, 9, 36,106,162, 80,249, 71, +242,204, 55,129, 75, 57, 87,123,156,224, 86, 11, 92, 61, 31,137, 52,171,215, 22, + 44,149, 30,146, 43, 68,146,162, 34,133, 73,145, 49,253, 47, 4, 12,157, 17,218, + 18, 88, 52, 34,106, 92, 99, 82,102,169, 70,103, 71,185, 88,163,123, 47, 77, 64, + 73,253, 67, 44,218,228, 7, 20, 5, 26,247,209,119, 33,160,228,200, 25,146,224, +170, 0,113, 35,150,253,235, 56,224,229,159, 42, 0,107,181, 24, 85, 56,141, 54, + 73, 76, 91, 74,210,218, 4,198,242, 26, 38,238, 66, 64,201,153, 93, 4,193, 65, + 91,218, 12, 22, 74, 46,116,189,160,231, 90, 2, 84,146,127, 99,222,211,144,192, +162,104,152,255, 19, 1, 82,167, 24,237, 9, 60,154,156,154,103,196,206,213, 0, + 52,116,253,110, 73,119,132,212, 75,219,137, 9,161, 10,156, 57, 33, 90, 4,141, +172,129, 9,107, 37,105,235,230,225,172,208,181, 46,159,107, 19, 80, 82,238,157, + 89, 87, 71, 4,154, 34, 99,250, 93, 9, 8, 59, 35, 84, 36,176,104, 68,212,152, +161,108,174, 2,208,164,227,115,105, 2, 82,234,159,153,245, 53, 72, 97, 82,100, + 76,255, 11, 1, 67,103,132,182, 4, 22,141,136, 26, 51,148,205, 85, 5, 96,171, + 69,122,217,195, 24,158, 32,109, 87,225,180, 39, 31, 30,177, 69, 14,237, 51,144, + 86,179, 41,163, 9,107,228,162, 10,145, 32, 65,163, 18,209, 90, 54,121,168,213, + 42,106,169,167,209, 91,161, 71, 39, 20,221,209,196,234, 2,180,117,238,120,159, + 76,171, 92,112, 83, 9, 59, 56, 83,250,148,201, 95,243,115,172, 72, 35,170,125, +146,109, 95,206, 20, 41, 50,213, 77, 66,183,115,172, 72, 35,170,157,206,208,142, + 51,223,199,237, 33, 82,192, 27, 4, 71, 52, 1, 40, 42,108,172, 96,115, 64,160, + 68, 94,169, 99,123, 60,236, 2, 69,167,116, 85,164,175, 95,216,130,134,146, 67, +234,137,208,164,208,200, 32, 73, 52,166,255,133, 32,161, 51, 68,151, 4,141, 74, + 68,107,217,228, 97, 35,180, 84,197, 56,117, 43,221,121, 47, 77,104,148, 18, 36, + 89,103,219, 67,242, 98, 22,139, 14, 80,214,163, 47, 12, 1, 82, 63, 9, 61, 74, + 19,105,219,216, 95,154,172,232,255, 84, 1, 88,171,197,232, 66, 29,109, 2,137, + 10, 39, 8, 26, 89,147,116, 44,116,142, 50,230, 61,205,110,240, 75,194, 74, 85, +246,145, 32,137,177, 60, 19,173, 98,192,213,162, 46,107, 25,173, 7, 46,130,182, +206,157, 76, 42,171,170, 40,246,138,201, 84,170,105,189,188, 49,114,135, 72,195, + 42, 77,184,221,113,102, 73,237, 89,205,176,187, 24, 54,164, 27,209,131,175, 15, +159,161, 82, 34,173,132,141, 56, 47,232,213, 85,253, 80, 95, 38,211,244,130,170, +122, 72,119,172, 92, 37, 55, 33,173, 54, 73,244,247,231,130, 34,151, 84, 71,199, + 85, 17, 93, 2,144,170,130,134,152,199, 79,248, 69,106, 65, 91, 38, 35, 62,116, + 64,189,164,253,220, 23, 46, 89, 82,120,148, 22,188, 46,249,220,164,193, 84, 21, +234,204,176, 36,189,139, 30,124,253, 24, 67,124,202, 70,100, 51, 88,199,140,218, +151,132,220,243, 14, 37,107, 66,228, 56,185, 42,142,148, 75,187,213, 98, 84, 30, +221,247, 90, 66,198,212,208,250, 20,176, 83, 15,186,254, 76, 82, 51, 56,104, 34, +180, 36,230, 70, 80, 42, 68,212,155,165,208,194, 11,112,208, 45, 44,128, 90,185, + 56,109,169, 35,230,241, 19,126, 41, 32,125,196,202, 53,201, 61, 95,245,105,198, + 58, 33,141,104, 58,238,118,153,233,164,193, 84,135,238,204,177, 36,189, 75,180, +140,126,153,201,182,164,217, 84,135,238,198,177,112,143,104,117,220,118, 48,211, +221, 99,180, 19, 75,163, 51,222, 38, 45, 70,200,245,119,234, 74, 27,141,227, 8, +113,186, 19,189, 95,110, 52,198,162,104, 18, 4, 28, 28,114, 40,108, 3,100,108, +133,142,136,176, 75, 54, 58, 50,182, 66, 61,226, 34, 47,175, 64,221,116, 57, 0, + 82,133, 19, 24,128,205, 3, 32,172, 93,180,189, 4,167, 4,147,108,169,161, 88, +226,201, 4,242,165, 25, 56, 16, 65,183,151, 26, 96,204,146, 64, 73, 27,156,133, + 80,249,148, 84, 18,175,177, 90,153,245,118,207, 35, 74, 75,155,176,174, 88,133, +172,226,202,164,229,254, 63,122,244,255, 55,220,240, 56,227, 92, 13, 35,172, 60, + 47,134,129,168,115,111, 51, 28, 99,122, 4, 8, 19,210,152,131,202,204, 80, 74, + 7, 51,112, 32,200, 24, 24, 30,143, 65, 65, 32, 45, 4, 17,162,201, 4, 40, 16, +145, 64, 36, 40, 41, 40,104,210, 6,192,249,177, 11,248,122, 62,202,224,129,175, +249,160,194, 26,172,239, 82, 23,200,152,240,107,104,228, 10, 19,193, 13,130, 98, + 61, 94,216,128,179, 66,232, 93,149,129,201,201,216, 8, 53,171, 46,173,171,129, +117, 19,208,126,123, 71,244,224,112,161, 24,188, 45, 4, 59, 57, 88, 92,189,179, + 31, 34, 47,176, 83,197,199, 92, 35,200,137,184,118,136,110,105,198,178,165,134, + 71,166,214,135, 72,203,241,177,187,133, 17,113, 35, 34, 72,201, 6, 71,109,201, +171, 97,252, 22,161, 94, 0,154,204,176, 78, 10,228,182,237,208, 32, 24, 52, 96, + 96,183,169,143,202, 17,188,140,118,205,124,128,135,242,198,116,185,129,122,126, + 8,199, 74,173,174, 40, 32, 68,176,110, 12,100,189,217,105, 17,193, 30,217,250, + 51,196,245, 72, 54, 93,107, 27, 47, 26,144, 35, 95, 61,128,147,171,244,188, 0, + 83, 16,154,140,133, 81,230,134, 53, 49,169, 81,121, 32,145,132,134, 7,233, 33, +181,101,243,223,106,176,153, 44, 10,220, 33, 4,124, 4,123,239,131, 2,218, 2, + 2, 24, 3,100, 72, 55, 3,180, 32, 15,214, 56, 99, 56, 14, 89,216,218,233, 17, +118, 70,102,124,200,218, 31,252,110,194,140,108, 62, 52,154,222, 25, 10,110,198, +154, 19,119,197,117, 69,115,113,139,189, 17, 53, 78,217,114,144, 95, 87, 91,246, +175, 92, 27,165,251,101, 72,232,244,233, 45, 17,188,250,237, 17,144,131, 22,202, + 35,226, 61, 82, 61,110,184,120,237,208,204,184,247, 71,137, 37, 35,255, 11,119, +209,110, 51, 93,219,169,179,250, 56,253,171,186,160,204,234,169,191,174,236,215, + 6,124,126,178,102,214,154, 15, 67,142,194, 14, 85,251,207, 78,169, 6,234, 10, +249, 12,170,172, 16, 58,181,246,230,207, 37,243,115, 49,231,174, 48, 71,123, 72, +255,188,137, 17, 93, 25, 90,100,153,208, 35, 70, 86,238, 78,115,161,223, 26, 59, +101,118, 60,143,214, 4,228,251, 99, 26, 17,220, 11, 29,235,207,234, 8,186, 53, + 30, 50,184,158, 1, 90,151,190,117, 47,214, 32, 8, 77,164,196,244,218,133, 65, + 58,249,182,104,135,149,161,229, 48,240, 45, 52,171,227, 9, 38,107,156, 46, 42, +239,215,126,241, 79,177,192,229,171, 3,178, 36, 61,210, 73, 40, 82, 76, 45,213, + 36, 23, 20,169,212,190,228, 64, 17,125,254,192, 73,183,239,151, 82,220,191, 32, +186,161, 79, 36, 13,209, 68,107, 46, 58,219, 23, 78, 30,230,221,151,209,154,112, +155,221, 62,137,202,169,208,229,115, 0, 61,112,179, 42,130,214,192,242, 80,107, +195, 91,200, 96,139,240, 93,176, 93, 15, 2,193,170,147, 8,176,163, 12, 12, 60, +219, 38,186,122,204,100, 10,145,188,185,223, 21,178,237,115, 27,137,126,180, 30, +207,132,216,139,248,211, 57,105, 17,184,175,201, 62,186,102,204, 70,127,251, 42, + 53,170,120,220, 33, 68,153,204, 54,180,206,218, 97,184,235,245,174,149, 57, 69, +183, 97, 67,215, 49, 51, 50,200, 62, 92,145,183,192,195,204,100, 0, 55,141,245, +204, 95,221, 68, 63, 69,221,113, 31,196, 37,211, 1,237, 2, 68,128,182,116,167, +254,181, 34,167,162, 51, 58, 51, 55, 17,131,198,224, 48, 15,145,205, 46, 76,235, + 34,143,227,229,128, 70,176,225,196,133,209,164,181,169,237, 92,118,158, 80, 33, + 2,167,105,200,215,179,238, 88,107,162,204,112, 63, 25,160,254, 39, 68, 86, 44, + 33, 74,140,149,255, 67,159,228,250, 88, 34, 15, 46, 48,224,177,242,142,197,124, +250,198, 18,157,148,252,170,102, 82, 55,203,184,229, 91,128,118,189,133,163,141, +167,180,111, 38,101,186,248,146, 12,177,193,180,122, 7,158,133,230, 35,240,135, +157,171, 51, 50,209, 82,167,172, 0, 47,141,107,187, 40,188,160,126, 96, 81, 15, + 53,169,192,233, 54, 68, 78, 99, 15,241, 98,110,154,143,101,174,162, 43, 89, 24, +158,199,216,225,138, 8,158, 94,174, 53,229, 81, 28,211,246,254, 80,213,188,112, + 49, 47,248,171,134,203, 44,177,189,158, 69, 26,152,127,218,250,127,104,151,124, +124,165,130,174, 54,238, 79, 56, 75,150,167, 38,102,213,165,201,110,102, 72,238, + 26,181,107,211,140,154,154,127,228,182, 84,134,201, 65,163,181,210,183, 76, 78, +160, 75,145,189,209, 23,165,116, 83,186,245,205,111, 45,153, 42,103,151, 92,162, + 6,219, 93,209,204, 31,120, 58,255,121,144, 72, 82, 29,170,173,111, 61,147,225, +176,138,162, 38,125,172,165,119, 23, 7,161,186,232,163, 91,209, 90,223,183, 98, + 61, 97,180,199, 75,200,214,110,190,208,253, 97, 30,209, 40, 54,173,177,242,251, +192,168,195, 26,113, 18, 45, 46,154,246,164,174,183, 66,178,127, 73,125, 80,167, + 15,154, 41,167,163, 35,172,109,105, 28,209, 47,109, 96, 0,205,232, 96,185, 89, + 53, 67,244,199, 46,215,243,115,230, 96,208, 11,153, 31,198,133, 65,253, 57, 38, + 58, 34,255, 94, 92,242, 56, 25, 29, 22,226,184,210,234,150,198,131,178, 80,151, + 58,211, 72, 32, 22,205, 38,205,134, 84,232,233,239,129, 21,156,241, 75,204, 9, +136, 42,193, 70,174, 1,144, 13,123,113, 51, 68,128,126,238, 52,223,122,171, 11, +249,126, 2,191,109, 6,112, 80,227,170, 36,111,135,206, 74,161,106,238,186, 34, +194,218,172, 96,239,164,154,119,174, 74,241,190,190, 93,124, 84,129,218, 14,243, + 29,223,182, 97,148,234, 51, 1,188, 80,115, 35, 54, 91,245, 26,174,148, 37,101, +249,224,240,230, 42,189,129, 55,180, 84,193, 11,131,139,158,126,228, 57,194,199, + 92,144, 38,226,223,172,139, 46,187,137,101, 57, 48,172, 78, 24,189, 92,193,110, + 20, 4,111,127, 30, 43,164,244, 38, 81,128,196, 99,165, 92,179,198,187,136, 70, + 17,154,195,101,151, 14, 22, 35, 59, 18, 28, 76, 60, 76, 69,107,204,129, 91, 39, +103,160,104, 27, 18, 65, 55, 97,154, 92, 20,150, 68,169,253, 68, 27,109, 61,174, + 27,220,169,235,182, 27,146, 28, 41, 85,179,161, 65, 45,225,228, 75,137, 2,130, +254,162, 28, 96, 42,135,133, 88,159, 94, 81,180,116,249,158,209,196, 30,242, 61, +207, 95,114,163, 65,185,112,242,253,197,238,158,156, 37,255,252,226,227,118,193, + 18,226, 46,114,117, 49, 42, 3, 62,174,199,246,121,180,210,101,182,217, 38,226, +178,183,187, 15,241,183, 48,146, 28,137, 86,179,161, 65,173,224,228, 75,137, 2, +130,127, 81, 29,224, 44,199, 66,172, 15, 91,113,177,116,249,158,209,196, 30,242, + 61,165,209,201,190,133,128,121,105,118, 57, 99, 15,249,158,231,183, 58, 62,209, + 89,217, 97, 8,111, 27,177,122,236,149, 9, 23,218, 69, 59, 52, 90,233, 50,219, +108,147,109,228,107, 63,127,108, 71,137,226,200,225,254, 11,191, 91,182, 10,255, + 90,155,143,251, 2, 36,192, 95,116,215,165,168, 25,240,186, 22,183,219, 57,189, +230, 98,209, 53, 71, 52, 53,185,228, 69,103,232, 35,176,142,141, 63,124,107, 5, +213,218, 7,233,198,117,108,208, 5,171,205,189,154, 22, 92,108,111,170,223, 61, +107,118,226,245,222,172,182, 79,212,112,146,181, 70,164, 90,249, 96,209, 52, 93, +214,186, 54,216,168,134,106, 18, 13,103,104, 25,108, 26, 27,175,235,156,109, 37, +214,154, 32,212,215, 10, 95, 18,169,236, 92,104,225, 2,234,239, 5,145, 8, 19, + 83, 1,186, 24, 78, 24,114,154,118,235, 64, 17,190, 0, 3,225, 95,185,164,175, +209, 27, 56, 18, 28,131,129,101, 53, 93, 21,197, 11,196,237,178, 97, 94, 63, 6, + 63,172, 60, 72, 34,236, 42, 35,213, 94, 29,241,197, 24, 42,108,171, 10,174,164, +219,109,186,239, 5, 70, 71, 96, 92,105,196,230,136,110, 36,102,101,186,161,186, +193,209,179,226, 8, 66, 78,136, 91, 22,233,162, 22,130,219,118,217,176, 10,130, +123,235, 89, 72,174, 88,128, 15, 43,213,239,254, 6, 17,197,126,152, 73,179,142, +233, 39,154,104, 62, 96, 11,199,102, 39,245,188, 88,184,187,149, 30, 2,124, 12, + 1,118, 56,169, 38,224,148,186, 1,104, 70,246,123, 27,174,223,231,114,220,139, +215,188, 74,187, 46, 39,190,142, 35, 29, 15, 27, 77,245,114,138,164, 12,102, 88, + 99,188, 16,161, 0,154, 0,157, 0,180,251,167, 88, 87,238,224,210, 3, 11, 8, +171,174,222,163, 95,251, 67, 39,124,197,147,145,132, 10, 69, 96,178,129,241,128, + 0, 77,116,182,249, 25, 76,180,176,232,168,206,216,228,126, 58,103,118,182, 12, + 34,179, 6, 36, 19, 66,236,208, 16,194,166,113, 25,101,191,170, 48,250,214,214, + 14,230,144,227, 98,211, 56,220,255,124,220,153,152,246,181, 71,232,243,220,222, + 55,154,185,101, 92,133,193,199,213,121,132,155,126, 62,207,150, 85,144, 41,198, + 65,197,179,102,158,113,231,255, 52,155,220,213,194,195,234,225,136,138, 77, 99, +140,118,180, 66,228, 89,186, 29,155,123,151, 41,110,250,147,110, 26,202, 18, 45, +241,167,155,200,163, 17,193,240,113, 9,240,129,149,201,132,159, 71,164,114, 20, +189,244, 73,176,186,234,218, 69,231, 75, 37, 6,195, 56, 9,204, 3,119, 38, 26, +179, 81,255,130,233,123,223,248,222, 39,217,251, 36, 54,188, 42, 10, 11, 64, 81, +223,156,179, 77,121,247, 56,222,238,198,199,119,114, 74, 26,106, 30,157,110,236, + 43,114,123,228,158, 34,183, 22,185,173,136,209, 28, 84,145, 55,226,193,202,195, +232,199,230, 70, 59,250,182,210,206, 53,148,243,118,106, 24, 7,222, 54,161, 38, +213, 71,236,127,150, 89,154,106,217, 25, 78,175, 59,152,205,236,220, 50, 56, 95, +231, 9, 52,183,126,163,155,217, 27,199,106, 23, 20, 72,174,206, 19,206,164, 78, +106, 82,107, 11, 26,183,201, 50, 44,227, 96,128, 64,129, 40, 10, 29,243, 52, 73, + 41,165,148,211, 36,165,101,185, 75,121, 41,206,141,118,179,254, 80, 63,157, 66, +209, 8, 47,244,246,248, 40,221, 42,167,121,166,169,235,164,174,235, 56,171,117, +206,174,235,186,206,187,150, 82, 74, 50,178,244, 92, 5, 82, 74, 41,167, 72, 80, +225,111,191, 10,156, 41, 19, 72,192,156,166,158,226,227, 13,151,165,160, 72,233, + 46,229, 35,165,220,108, 54, 13,236, 28,139,162,197, 45,107,235, 98, 89,150,229, + 78,146, 97,174,203,237,229, 82, 74,247,199,163, 75, 41,223, 47,132,150, 31,226, + 32, 90,136,219, 16, 41, 4,164, 1,130,253,149,171,188,239,229,171,223,229,235, + 10,207, 86,159,248, 13, 41,229, 37,178, 64,151,232, 18, 93, 34, 11,100,129, 44, + 80, 84,137, 42,125, 32,113,244,229,142, 12, 27,222, 8, 45,167,234,248,224, 38, +111,134,196, 37,178, 64, 29, 92,199, 37,186, 68, 22,200, 2, 69,149,168,226,247, + 58,212, 28, 62,150, 96, 11, 6,134,124,152, 13, 9,250,105,253, 49, 53, 57, 85, +149,181,229, 50,205,130,147, 4, 51,249, 9, 62, 62,125,230, 12,135,193, 50, 59, +150, 50, 44,101, 52,254,243,129,121,102,190, 51, 61, 13,184,173, 99,222, 48, 62, +254,185,209,204, 76, 79, 75, 51,206, 68,137,112, 96,224,250,117,171,181, 56, 96, + 51,157, 25,144, 48,248,224,219,184,145,234, 29,140,218,233,126,193, 63, 97,197, +141, 1,168, 4, 27, 54,109, 6, 0, 65, 3, 99,114, 0, 0, 10,138,137, 67, 82, +153, 76, 20, 70, 81, 12,244, 3,164, 0,134, 66, 26, 6, 12,151, 14, 69,195, 64, + 5, 32, 44,134, 97, 50, 16, 0, 4, 8, 0, 1, 0, 2, 56, 0, 40,128,136, 82, +192, 56,103,249,169,167, 95, 15,253,128, 6, 44, 34,180,229, 12,224,184, 25, 15, + 9,248,181,115, 86,123,195, 10,245, 97,187,196,187,221,252,206, 42, 68,243,203, + 75,188,106,222, 90,159,114, 33,238, 72,250,132,140, 72, 91,202,231,228,240, 78, +144, 40, 15,166,180, 90,148,213,231,111, 12,117,110, 41, 66, 32, 7, 67,253,148, +210,194,136,248, 9,243, 20,251,171,185,191,209, 44,153,173, 33,228, 38,212,139, +147, 65, 47,164, 28,135,161, 95, 66, 86, 76, 3, 3,137, 31,233,140, 22, 96,103, +221, 0, 6, 47,165,177, 80,206, 27,230,215,130,141,244,245, 99, 65,104,186, 72, +112, 50,152,175,235,184, 19,214,176,136,158,134,177,131,112,160, 71,118, 92,112, +112, 60, 1,252, 51, 95,115,103,132, 17,108, 61,165,246,211,163, 29, 74, 53, 59, +224,133, 32, 75, 39,228, 46,195,235, 28,211,243,119,181, 55, 91, 7, 93, 84,158, +179,174,128, 58,125, 49,108,195,183, 63,235, 34,101, 31,141,122, 79,138,165, 6, + 14,170, 11, 22, 63, 13,123, 16,112,149,250,130, 43,157,236, 91, 62, 99,228,238, +176,221,187,248,235,245,159,236, 44, 55, 61,173,227, 17,217, 26,182,121,189, 60, +250,209,205,243,110, 60,152, 73,103,232,135,136,147,156,100,147,245, 47, 84,121, + 90, 36,147,215,209,132,122, 47, 86,185, 11,169, 46,163,229, 44,169, 47,104,235, + 55,145, 42, 29,196,208, 59,187, 77,228, 36,187,104,147,242,240, 43,237,226,117, + 25, 36,234, 97, 6, 64,154,202,171, 68, 15,134,161, 53, 33, 35,155,148, 17,150, +182,189,182, 33, 36,228, 89,242, 4,246,190,212,222, 87, 20,123,207, 11,215, 44, + 91,224, 13, 47,157,196,108,189,150,211, 46,136,109, 59, 97,185,120, 71, 99,196, +199,238, 91,128, 9,141,205,174,136,208, 16,203,246,166,189,182,164,144, 82,172, +204,157, 28, 75,190,193, 37,109,244,211, 13,225, 4,191,192,134, 78,222, 98,120, + 17,201, 77,113,144, 22, 92,163,203,185,175,169, 16, 87, 79,142, 69,197,194,240, + 90, 1,140, 12, 61, 35,223,173,149,233,127, 10, 76, 85,242,181, 84, 96,204, 18, + 4, 0,202,206, 80, 47,155, 46,120,210, 30, 72, 94,169, 43, 66,197, 98,129, 64, + 78, 18, 2, 24,194,207,221, 46,240,204, 74, 67, 92,253,207, 16,234, 21, 29, 17, + 30,179, 50,202,178,144, 13,240,201,243,238, 9, 37, 60, 94,244, 92,136,155,163, +200,249,216,248,214,242,128,241,189,225,194,184, 5, 4, 82,140,128, 17,180, 33, + 47, 0,220, 88,157, 8,107, 69,114, 42,168, 11,237,113,115,222,123,150,226, 59, + 73, 64,147,208, 52,196,138,170,247,135, 64,122,223,194,124, 26,132,247,128, 62, +209,202,125,247, 85,198, 56, 62,250, 29,218, 87,201, 25,210, 23,246,177,110, 30, +233, 42,135,245, 41,214,223, 6,127,150,233, 29,147,113,170, 15,216, 57,164, 79, +119,226,106, 64, 31,134, 61,252,142,254, 68,227,110, 12,231,163, 34,218, 3,160, +172, 13,101, 34,188,134,203,113,204,240,197,155, 96,175,254,244, 61, 30,208, 25, +176, 72,119, 2, 38,179, 9,229, 26,187,165,159, 56, 12,252, 10, 17, 99,132,125, + 4,124, 15, 63,104,195,203,252,162, 72,111,158,192,220, 65, 6, 10,234,124,255, +142, 66, 1,144, 62,241,199,250, 46, 50, 11, 82, 16,178,106, 67, 30,214,175,118, +187,177, 68, 85,243, 3, 23, 25,211,234, 71,121, 95,179,136,176,170, 29,158, 4, +137, 3,106, 1,220,151,191, 67,141, 68,180,247, 36,233, 91,183,121, 49,148, 62, +111, 58, 32,148,173,176, 38, 48, 93, 10, 24, 54, 75, 22,245, 84,234,236,210,123, + 60,121,116, 51,191,165, 83,112,182,218,251, 16,135, 29,206, 69, 34,213,106,146, +125, 9,171, 86,124,226,136,245,185,217,159,185, 36,200,134, 84, 10,151,112,227, + 31,177,126,114,155, 42,112,252,101, 66, 95,214, 22, 28, 26,116,248, 99,221,127, + 33, 68, 1, 40, 40,109,227, 39,226,250, 23,243,106, 8,219,204,143,194,157, 29, +107, 32,254, 26,165,118,130, 26,223, 70, 16, 87,220,102,149,105,244,136,124, 23, +220, 74, 1,115,165,118, 25, 54, 94,126,113,183,117, 73,211, 53,108, 25,111, 29, +217, 88,218, 42,237,177, 55,142,147,144, 48, 95, 1,119,148, 67, 44,205,119,125, +205, 77, 79, 83, 5, 21,206, 87,234, 36, 14,131, 6,108, 95, 10, 1,133,100,255, +168,158, 35,184,142,177,128,175,172,100,161, 62,235,171, 63, 58,121,241, 10, 92, + 58, 43, 0,111, 76,210, 82,133,186,189,174,163, 91,155,191,114, 43,245, 90, 25, +112,234,105,137,197,119,187,169,228, 93,204,144,200,157, 94, 49,201,236,219,178, +190,228, 81,247, 47, 57, 26, 56, 75,112,193,164,170, 58, 84,204, 39, 77,187,250, +120,150,221,233, 87, 81, 76, 47,215, 46,131, 69,144, 21, 53, 78, 15,239,121, 16, + 27,238, 14,176,207, 77, 8,106, 11,132,157,221, 94,104, 59, 68,116, 21, 84,197, +141,121,157,179,227, 79,228, 58, 67, 23,218,179, 72, 17, 34, 98,214,117,105,188, + 58,235, 17, 27,212, 85, 7, 55,150,109,214,129,145, 89,216,163, 96,136, 1, 59, + 63,203, 25, 92,250,235,120,152, 51, 82, 53, 55,219,249,187,148,150, 38, 19,142, +105, 84,214,137, 44, 43,137, 67,103,187,129, 24,119, 63,111,222, 17,166,100,254, +220, 4, 25,224, 1,129, 23,227, 3, 43, 96, 7,146,110,180, 57,154, 78, 65,180, +124,166,126, 15, 85, 80,103, 2,105,149, 51,155, 99, 99,123,198,122,123,235, 42, +144,231,177,193,116,112,173, 49, 48, 44,212,172,161,110, 19, 59,100,156,237,123, +184, 6,171, 39, 24,173, 64, 14,245, 73,163, 76,212,254,252, 91, 33, 10, 36, 23, + 80, 66,101, 69, 81,142,247,194, 68, 0, 4,142,109,161, 32,103, 25,255, 89,100, +130, 10, 97,115,150,230, 4, 95, 4,208,244,173,210,178,180, 74, 65, 93,173,220, +166,167, 80, 22, 0, 80,147, 83,128,116, 51, 96,138, 74, 96,115, 38,188,204, 74, +160,200,193,103,130,227, 91, 98,158,240,165, 73, 85,154,144,207,197,107,164, 81, + 39,226, 75,189,219,110,168,129,223, 1,235,130,158,142,169, 91, 46, 55,162, 38, +156,244,140,154, 36, 44,204,228,136,206,140, 89,214,149, 39,233,228,174, 32, 51, +236,211, 74, 87,162, 44,119, 70,253,170,116, 39, 11,122, 84,214, 53, 72,222, 86, +244, 31, 68, 80,246,142,139, 71,229, 45,220,232,230, 1, 98,127,238,135, 13, 71, +110,130,104, 98, 7,220, 36, 78,138,227,118, 49,128,133,181,219, 73,138, 70,162, +116,147,106, 4,227,242, 14,203,217,151,248,204,133, 30, 92, 6, 20,144,124,144, +197,128,158,208,215,231, 3, 17, 43, 74,248,125,130,171,245,104,215, 26, 24, 19, + 12,140, 73,137,110, 1, 52,253,164,167, 80,139, 73, 26, 11, 97, 41,182,234, 67, + 18, 6,115, 56,243, 17, 7,229,217, 37,217, 75,157,224,233,250,243,227, 55, 51, + 39, 1, 79,191,208, 90,155, 42,186,136, 67,237,226, 79,197,127,190,221,128, 86, +193,138, 43,172, 63,152,140, 86, 79,130, 88,161,191,174,232,155,103,102, 65,161, +242, 3, 46,111,202,222,174, 35,120,200,116, 92,221, 83, 81, 88,232,107,239,122, +136, 95, 99,173,176,102,180,200,198,209,102,252, 39,112,200,193,156,169,131, 20, +226,105,245, 23,117, 48,158, 31,202,161, 0, 73, 68,155,227, 54,223, 64, 79, 35, + 0,117, 6,248,236,137,138,186, 92,200,242,224,225,247,229, 7,194, 78, 73, 97, +168,255,125, 74, 7,254,242, 9,169, 53,120, 28,199,102, 70,243, 20,239,145,236, + 35,216, 92, 66,119, 34, 23,136,143, 89,112, 47, 52, 32,186, 12, 74,170, 84,202, + 83, 97, 57,164,116,188, 38, 43,101,148, 29,249, 36,211,186, 81,226,204,232, 75, +172, 81,247,166, 67, 3,249,193,203,202,173,203,122, 17,242, 82, 64,162,221,240, +170, 40, 41, 92,242, 60,195, 21,112,155,115, 6,123, 54, 50,220, 85,201, 96,204, +216, 34,103, 83, 63,192,161,199,251,111, 18, 92,157,254,133, 10,126,144,175,175, + 85, 33,167,213,221,236, 43,237, 2,149,147,203, 65,193, 93,184,113, 92,102, 15, + 73,243,229, 32, 34, 93,255,158, 22, 1,118,213, 13, 1,163, 28,176,200, 23,150, +122, 4,188,204,100, 67,145,246,243,254,198,219,248,176,206,150, 60, 40,239,143, + 21,205,128, 10, 77,105, 60,252,236,148,180, 75,246,214,102, 40, 64,178, 81,129, +209, 26,158, 23,168,237,206,225, 99,200,206, 41,124, 10,172, 43, 13, 51, 67,205, + 75, 48,243, 64, 20, 65, 44,167,113,168,173, 89,187,129,230, 89,185,248,114, 91, + 37,181,232, 61, 98, 46, 34, 81, 12,122,107,126,172,135, 66,181,163,178,104,207, +222,151, 35, 0, 16, 73,220, 9, 97, 24,130,226, 75, 81, 60,219,163, 74,112, 40, + 47,128,130,250, 35, 72, 89, 68,100,121,255, 89,255,183, 7, 34,185, 24,205, 77, + 71,231, 41, 97, 90,249,247, 69, 75,224, 64,214,189,234,137, 16,141,101,111, 70, +139, 98,122,252, 41,229,254,116,209, 5,148,151,148, 36, 72, 81,191,230,179,123, + 15,235,232,155,187, 8, 13,252,193,255, 50, 93,135,119,250,232, 29, 49, 57, 55, + 37,127, 21,136,195, 46,212, 79, 72,182, 43,187,176, 89,214, 22,115,217, 92,232, + 25, 18,225, 57, 7,181,138,121, 16, 2,193,208,208,133, 8,106,253, 75,202,181, + 56,110,230, 0, 62, 46,238, 60, 46,187,197,221, 59,165,216,168,207, 68, 90, 0, +232,176,170, 25,208,167, 55,120,112,107,236,217,223,222,232,177,232,195,196, 12, +217,161, 3,249,168, 46,249,255,164, 51,118, 28,105,206, 79, 78,119,143,186, 18, +169, 62, 9, 86, 80,155,166,102,253, 44, 22, 2,170, 40,124,117,253, 25,109,222, + 78,216, 19, 19,121,134, 28, 71,166,214, 14, 67,193, 86,127,142, 81,207,230,194, + 82,118,163,226,197,132,193,244,186,184,131, 92,103, 64, 40,231,162, 61,133,151, + 91,111, 78,206, 64, 76,153, 47,204,101, 48, 4,222,145,134,181,242, 21, 67, 83, +205,238,207,191, 7,219, 33,145,197,218, 96, 53, 40,115,192,206, 27,143,171, 94, + 18,130,255, 44,202,139, 23,132,158, 72,104,120,134, 86,207,226,166,238,151,142, + 55,176,239,230, 3, 80,231,130, 11,119,185,185,193, 92,211, 18,251,159, 5,170, + 88,135,251,222, 70,132, 3,203, 31, 84, 28,231,201,151,205,149,107,249, 88,145, + 9,134,156,128, 79,140,215,112, 27, 71,240, 28,192, 7, 80,237,197, 75,170, 73, + 42,139,136,253, 55, 67, 38,103,241,141,142, 24,136,249,177,180,231,225,124, 48, +233,234, 23,197,128,139,217, 32, 90,170,150, 3, 95,120, 58,203,137,213,145,205, +164, 43,220,227,245, 83,233, 85, 74, 61,126, 28, 92, 4,155, 17,238, 56, 63, 39, +211, 38,198, 19,171, 88,191,214,197, 19,224, 59,142, 32,228, 8, 24,206, 40,103, +161, 1,132, 50,138,247,191,251,115,210, 76,197,122, 45,251,169, 64, 38, 27, 93, + 47,157,147,168, 2, 61, 99, 32, 40,162,148,199, 8,203,248, 7,194, 85,101,195, + 72, 91, 9,148,156,240, 93,143,154, 27, 92,205, 98, 84,195,249, 30,186, 72,214, +241,136, 28,145, 56, 75, 63, 33,208, 25, 27,162,152,240,117,215,235, 33,166,208, + 84, 72, 86,116,174, 77,192,128,105,222, 16,161,213, 77, 68, 22,183,246,169, 40, + 9, 63,138, 77, 47,136,138,200,154, 20, 31,203,119,198,210,223,169,125, 35, 79, +171,153,128,247,233,235,132, 3,155,176, 56, 9, 6,221,198, 5,140,148, 35,229, + 17, 66,209,237,217, 62,193, 82,166, 32, 5, 91,226, 49, 48, 72,202,240,176,167, + 10,248, 37, 4,199,250,198,181,156,194, 25,241, 61, 10,222,104, 57,218, 14, 0, +222,156,173, 29, 89, 90, 69,172, 87,215,231,183, 74,198, 63, 66, 56, 51, 72,101, +241,167, 51, 65,228,194,135, 71,141,248,175,124, 84, 21, 33, 32, 19, 52,100,111, +253, 5, 80, 26,193,213,225,145, 97,208, 50,195, 31,222,124,190,117,114,162, 15, + 21, 51,147, 58, 42,188,198, 42,240,195,168,234, 32,116, 13,214,166, 50,177,134, +206, 75,191,233,145,245,129,133, 70,143,180, 1,233, 33, 78, 85, 68, 11,236,232, +230,118,135, 97,151, 42,111, 33,245,184, 81, 68,205, 13,206,192, 2, 19,149,199, +100, 50,143, 95,229,160, 23,206, 10,177, 72, 16, 15,125,201,222,249,172,136,105, + 12, 84,138,146,136, 3, 98, 57, 6,104, 91,218, 39, 45, 79,158,239,145,210,170, + 41, 82,192,141, 1,130,163,141,205,158, 66, 65,121, 63, 55,108,235,227, 32, 15, + 43,204, 4,251,185,167,201,132, 72,105,215, 12,152,101, 73, 90,119, 82, 28, 21, +162,142,117,209,104,105, 65, 35,198,162,176,173, 28, 21, 31,255,129, 17, 93,206, + 31,129,253,119,228,250, 35,153, 51, 22,217,182,171, 22, 92, 65,189, 9, 61, 2, +197, 33, 34, 43,124, 16,232, 26,212, 69, 10, 31,171,156,153,173, 17,125,140, 80, +244,121,216, 60, 7, 18,200,111,116, 96, 53, 5,106, 69, 44, 63,197,160, 20,226, +103, 93,203, 9,224, 26, 67, 38, 90, 86, 55,165,105,196,136, 53, 37,225,171,225, +209, 93, 0, 3,200, 69, 95,206,148,166,187,207, 40, 81, 21,127, 29,228, 52,172, +198,181,195, 38,124,128, 17,165, 44,120,242, 68,123,252,176,129, 36, 15, 13,167, +222,103,138,177, 90,171, 60,131,121,181, 15,159,143,193,234, 7,197,106,100,114, + 30,101,105, 68,164,101,222, 62,221,224,208, 15,238, 48,238, 12, 23, 82,113,217, +158, 42,247,114,245, 98,216,184,146, 88,133,178, 2,176, 1,221, 7,241, 64, 63, +252, 95, 64,153,140,185, 11, 9, 31, 25,171,197,224,228, 3,105, 42, 99,177, 49, +108,152,251, 15, 56,111,154, 76,207,130, 63, 82, 67, 89, 68, 26,161, 87, 22,123, + 26,223,178,111,163,175,192, 56, 86, 94,223,255,196, 96,195, 77, 86,246, 50, 43, + 61, 8, 18,160, 62, 23, 62,112, 11, 7, 62, 46,225,177,159,104, 24,103,215, 80, +122,244,194,242,170,100, 51, 33, 15,253,117,216,225,164,117, 31,163,215, 2,110, + 45, 58, 74, 14,150, 67,176,248,219,177,182,192,101,195, 38,176,225,215, 50,236, +211, 10,178,121, 66,203,248,211, 2,107,182,176,180,101,217, 3, 69,112,115,160, +184, 24,129, 56, 31,226,137, 66,103,195,230,120, 96,164, 63,137,115,126,238,156, +170,121, 53,121, 77,116,174,132,113,240, 66,119,248,189,210, 95,186,101, 80, 78, + 91,202, 73, 38, 49,141,196,144, 43, 47,213,177, 58,139, 47, 19,202, 18,127,249, +204,108,212, 68, 77,114, 7,115,216,190,120,177,196,163,166, 70, 60,126,146,133, + 15,119,207,205, 12,215, 46,103,101,194, 21,171,165,132,145,173,209,159,117, 91, + 47, 0,123,126,162, 9,107, 32,255, 30,253, 73,130,100,219, 30,122,221,247,157, +150,146, 90,161, 21,162, 60,182,205, 93,124, 63, 67, 58, 88,249,151,255,201,158, +132,108,251, 52,103,115,215,227,119, 71,177, 55,107,171,180,240, 17,221,146,247, + 92,182,153, 93,125,138,140,148,194, 19, 28,111, 84,253,206,134,125,211, 57, 13, +116, 96, 14,163, 3,201,254,196, 7, 7, 20,104,176,231, 1,195,103,185, 75, 97, +206, 72,240,221,185, 82,233,142,158,157,164, 6,155,141,248, 99, 48,239,108,132, + 82, 29, 41, 69, 91, 17,176,162,109,151, 22,109,198,127, 93, 75,133, 50,131,150, + 55, 29, 91,223,246,108, 17, 55, 0,102, 91,131,106, 23, 8,157, 57, 66,224, 17, +117, 27, 59,102,219, 94, 2,178,215, 22,131,205,148,108,172,176,105, 6,190,215, +173,177, 53,214,254,164, 90, 23, 92,219,104,181,200, 64,138,201,214,184,113, 75, + 25,173,102,169, 73,153,197, 32, 83,232,255, 4,160,121,217, 67,122, 69, 51, 90, +112,218, 16,241, 45,115,137,227,192, 69,186, 39,102, 10, 85,226,131,107,232, 27, + 77,250,195, 41,124, 2,157, 55,221, 55,235,217,182, 6,194, 58,192, 20, 44, 61, +110, 20, 35,189,210,213,249,182, 96,172,206,145, 24, 80,189,207, 99, 56, 37,132, + 78, 3, 49,193, 18,141,232, 12, 3, 25, 5,107,104,170,175, 22,205,255,210,203, +205,189,104,171,248, 81,247,120,115, 81,244,147,140,224,133,203,171,207,169,208, +147,208, 6, 23, 83, 22, 95,108, 8, 42,227, 71,183,218,173,145,170,136, 13, 38, +208, 36,241,169,106,151,217, 55, 83,224, 54, 63,196,154, 6,199,192,252, 50,215, + 66, 93,240, 22,190, 63, 8, 31, 88, 66,137,206,211, 0, 29,207,245,173,195, 95, +115, 50,159,164,109, 57, 34,106, 54,103, 61, 45, 15, 12,152,135,108,212, 46,156, +241, 36,255,154, 56,101,241, 46, 9,109, 49, 18,223,140,164, 38,187,155, 44, 35, + 38, 48, 43,245,129,122,106,198,106,192,157, 42, 2, 85,157,117,103,108, 90, 6, + 98,207, 48, 76,200,194,192, 52,137,124,144, 29,204,220,215,109,120, 24,213,159, + 58,196,217,155, 61,232,237, 52,174, 63,254,128,160,182,214, 27, 76, 92,249,198, + 76,114, 43,185,185,106, 25, 23,178,162, 27, 90,223,222,192, 82, 64,108,223, 22, + 27,169, 54, 45, 84,121, 82, 30,184, 61,134,251,152,133, 6,220,182, 73,231,135, +192,205,223, 84,246,196, 85,102, 82,133,113, 59,118,111, 95, 13,182, 32, 24,255, +225,138,227, 86,213,212, 16,220, 87,193,128,220,202, 40,248,139, 91,235, 47, 27, +125,238, 36,163,145, 49,144,115, 10,110,245, 55, 4, 42, 75,144,155,106, 1,117, +181, 87, 23, 9,166,212, 49,205,199,176, 1,189,191, 76,201,136,255,127, 73,210, + 92,184,143, 34,165,234,138,221,206, 88,201, 94, 65,113, 91,131, 2, 57,175,183, + 40,248,175,147,134, 7,109,187, 8, 1,139, 67,170, 74, 41, 0,129,144, 24,112, +231, 92, 11, 39, 71, 50,142, 61, 91, 34,251, 27,187,128,241,135,163,139,231,152, +247,241,187, 31,218, 53, 28, 50, 25, 75, 10, 91, 30,188,181, 62,240, 88, 40, 94, +122,106,244,198,237,140,219, 81,242,183, 4,221, 59,190,243,213, 18,181,221,145, +251,169, 65,202, 95,200, 71,167,178,183,131,145, 45,206,174,129,135, 9, 85, 25, +126,185, 96,211, 96, 88,217,244,138,182, 56, 84,218,195,154,151,187, 36, 7,243, +117, 22,226, 95,227,162, 19, 27, 65, 27,219,173,165, 49,161,231, 34,243,118,223, +176, 33,206, 46,185, 46, 0,137, 78, 45,177, 98, 40, 26,189,173, 49, 55, 4, 65, + 26,204, 71, 49,193,219, 36,228,216,116, 81, 96,126, 8,156,104, 75, 31, 20,170, + 40,134,145,198, 58,182, 17, 38,173,129,150,176, 48,217, 76,132, 22,196,161,194, +253, 28, 73, 66,250, 0,137,169,222,242,104,220, 42, 11, 37,142,212,243, 47,222, + 8,202,180, 69, 59, 25,218,108,249,153,202, 38, 37,153, 19,122,230, 57,252,214, + 95,255,203, 50, 61,142,202,214,179, 71, 19, 7,139,233,168, 3, 62,220,123,108, + 60,139,179, 59, 10, 19,115,227, 46, 53,158,244,187, 77, 34, 49, 40,151, 8,131, + 4, 1,180, 65,209, 31,230,232,253,202,181, 51,227,235,177, 9, 8, 55,255, 49, + 14,166,193,214,225,171,208,233, 89,161,120,129, 78,250,180,209, 18,151,169, 85, +200, 51,199,238, 36,235, 74, 45, 2, 71,180,206,193,249,253,223,207,210, 43, 25, + 12,200, 26,154,152,162, 89, 58, 24,216,168,135,149, 10, 43,133,206,189, 50, 22, +162, 63,136,164, 12,170, 41,214, 96, 59,166,247,163,197, 85, 52, 4,115,173,244, +217, 18, 87, 53,151,176, 82,171, 23,130, 75,224,106, 17,126,148,127,119, 72,121, +187,150,119,156, 77,145,121,118,133,246,136, 22,226,106,235,108,149,155,223,132, +177, 50, 8, 18, 60,198,145, 93,193, 29,218,208, 33,152, 84,187, 71, 20, 84,173, +144,125, 53,182,184,128, 75,121, 77,170,186,171,129, 46,157, 56,151,147,158, 98, +104,111,218, 25,225,192,232,174,123,220,151,123,186, 8,157,175,153, 75,176,102, +146, 99, 68,199,242,195,164, 46,210, 62, 49,168,246,168,173, 98,179,178, 69, 25, +157,110,232,185,230, 22,171,235,171,235,219, 8, 96, 71, 12, 34, 8, 91, 29, 90, +136,235,116,188,117,251, 72, 63, 69,221,241,131, 20, 7,255,112,119, 42,178,232, + 40,196, 81,175, 50,127,207, 60,145, 33,210,255,101,186,210,133, 71,161,142,136, + 78,226,214,176,226, 29, 44,144,222,206, 41, 36, 44,155, 41, 2, 84,238, 50, 60, + 57, 97, 38, 88, 61,105, 91, 48,217, 86,164, 93,157, 29,142,141,206,136,102,100, +218, 51, 17,167, 91, 50, 34,207,221, 14, 19, 68, 19, 84,152, 15, 78, 22,140,206, +238,254, 56, 4,203,158,224,236,108,214,142,171,141,150,231,200,168,174,179,183, + 62,194,136, 12,225, 56, 18, 36,231,160,176, 92, 11,167, 75, 96, 69,108, 16,101, + 79, 4, 4, 81, 77, 38, 72, 39, 90,186, 10,173,166,238, 29,131, 22,243,154,180, +234,160,122, 74,189, 5, 75,173,122, 0, 67,194,201, 22,106,228, 41, 6, 30,179, +217,148,227,187,163, 80,130,241,245,163,157, 64, 64, 57,147,198, 23, 43, 39,173, + 54, 34,132,222,129, 34,136, 5,201,135, 14,218, 52, 47,195, 73, 49,140, 80, 62, +193, 86,139,221,113,192, 14, 12,106,164,122,204, 82, 83,218,101, 62,204, 7, 80, +227, 37, 84,162,126,250,155, 95, 90,134,193, 81, 90,213, 2,230,222, 7,254, 39, + 36,231, 71, 35, 91,113,189,192,118,140,175, 67, 26,183, 66,100,172,170,150,174, + 15,130,145, 65,244,143,155, 14,255,203,146,207, 79, 36, 98,161,130,127,203,213, + 66,148,196,229,101,178, 44, 3,181,112,101, 58, 32,174, 24,238, 17,211,108,190, + 8, 80,124, 69,214, 8, 36,197, 64,165,181,160, 32,143, 38, 31, 13, 43,199,183, +234, 10, 54,147,119, 30,195,113,121, 38, 74, 13, 19,226, 90,205, 59,229,249,136, +174, 16, 15,174, 67,213,236, 40,217,153, 21,162, 63,106, 22,115,195, 89,210, 14, +207,132,205, 59,177,197,228,205,112, 82, 26, 64, 10,183,249,230,128, 38, 96,116, + 64,196,234,128,240,245, 26,231, 94,134, 57,228,112, 32,103,231,138,144,211, 65, +140,136, 61, 88,126,132, 96,175,183, 24,228, 23,144,180,200,199,145,117,253, 16, +177, 84, 88,125, 25,186,221,232,153,226,175,190,179,188,149,206, 9,175,190,200, +148,194, 1, 91,134, 28, 17, 98,129, 54,113, 31, 77,150,151,105,169, 13,103, 82, +164,242, 97, 5, 95,137,192,109, 92, 81, 12,225,215,169,181, 84,205, 15, 13,116, + 79,167,170,225,160,134, 15,166,195,180,229, 40,210,249,164, 53,208,121,247,210, + 4,246,198, 94,107, 94, 23,208,122,200,134, 86,241,223, 28, 15,148, 35, 17,214, + 64, 48, 95,121, 79,169,175,168,193, 84, 41, 84, 2,109, 77,129, 23,181,225,214, +104,152,184,108,214, 49,138, 97,155,228, 65, 0,107,230,244,217, 69, 21, 17,158, + 76, 75,248,112, 82,139, 16,170, 16, 74, 56,154,180, 97, 52,105,243,204,227,141, + 65,109, 97, 29,122,152, 66,165, 45,144,108,133,184,167, 66,195, 41,177,198, 37, +255,124, 22,138,241,141, 97, 80, 4,137,165, 58, 87,161, 40, 45,157,232,185,246, +164,132,242,157,206,136,173,212,113,116,156, 95,100, 94,179,197, 4, 80,229,216, + 30, 65, 61,150,138,195,116,245,187, 80,115, 8, 81,131, 9, 54,169,181, 72,187, +102,197, 64,244,127, 9,113,181, 59, 5, 0,226,157,181, 79, 66, 57, 51, 22,155, +150,164,221,216, 12, 24,201, 94,195,107, 59,155,200,215,234,180,152,142,137, 98, +137,185,187, 66, 40,245,111, 41,190, 20, 62, 88,240, 9,233, 73, 12,241,118,121, + 25,223, 66, 75,110, 3,226,157,251,139, 24,116,212, 18,148, 95, 53,102,156,250, + 70,156, 56, 46,211,121, 63,106, 95, 97,113,134,234,113, 96,184,156,231,113,224, +122, 26,137, 9, 56,136, 89,212, 59, 14, 73,185,189,227,136,210, 84, 17, 62, 89, +235, 86, 71,166, 96, 41,180, 11,193,244,244,218, 28,190, 93, 43,125,169,160,201, + 87,165, 89,167,163,231,197,247,181, 85, 0,250, 33,129,240, 71,206,179,216, 80, +210, 68,105, 10,121, 81,210, 33,194,113,136, 31,165, 28,116,185, 28,239, 81, 14, +244, 23, 58,236, 59,171,169,195,235,216,177,130, 91, 15,102, 35, 22,130, 48, 24, +195, 23,187, 13,219, 59, 49, 10, 1,185, 62,150,183, 76,117, 69,163,252, 59, 49, +225, 1, 2, 18, 69,120, 58,131, 56, 42, 20, 48,183,158,154, 69,212,163,236,189, + 51, 6, 79,158,179, 16,154, 81,131, 67,132,222, 14,109,248,213, 67,233,217, 39, + 24,206,132,238,182,168,187,210, 11,230,154,117,118,158,238, 47,237,238, 77,218, +182,175,108, 94, 64,183, 83,111, 89,146, 59,193,134,211, 37, 11, 89,168,124, 22, + 82,214, 40,103,148,177, 88,172,206, 2,106,216, 33,104, 20,167,143,116,220,145, + 42,107, 61, 78, 46,176, 15, 37, 98, 5, 14, 23,188, 98,160, 33,160,151,238,100, +232,100,171,220, 27,161,165,108, 43,139, 98,143,123,109, 92, 41, 52,180, 29, 97, +240, 65,206,181, 81, 65,141, 93, 10,215, 63,189, 86, 16,155,190,246, 85,181,126, + 5,169,176,196, 5,241,116,119, 26,135,116,166,141,113, 25,206, 56,173, 11,126, +102,126, 42, 52, 36,216,200,226, 42,204, 72,216,192,205,220,186,214,211,180, 34, +253,218,213, 16,169, 88,217,179,125,208, 72,117, 34,117,223,208, 20,119, 1,107, +213,214,190, 39,160,148,235, 59,196, 91,255,172, 98,140,161,213, 64,106, 42,214, +120, 39,129,253,128,162,175, 56,246, 36,118,191,207,213, 80,176, 89, 17,218, 87, + 14, 42, 82, 9, 71, 92, 85,223, 36, 24, 74,215, 78,123,216, 49, 55, 59, 55,172, + 62,114,106,242,151,106,196, 88,129, 57,229,215, 91, 56,148,113, 9,132, 80, 56, + 36,215,136,238,242, 36, 8, 95, 53,194,247,180,192, 98, 5, 3, 86, 46,250, 19, + 8,156, 27, 97,145,139, 89, 76,113,107,217, 66, 70,216,111, 64, 24,252,188,231, + 28, 80,170, 10, 58,255, 88, 36,159, 57, 98,253, 85, 5,237,215, 21,126,103,138, + 87, 75,169,197, 53, 12, 1, 77, 6, 78,202,108,255,173, 9, 14,154, 69,150, 19, + 95,116, 39,124, 34, 79,105, 2,168, 16, 11,190,103,136,216,192,204, 75, 97, 59, +165,130,198, 65, 34,221, 64,242,153, 42, 77,151, 94,169,101, 78, 5, 27, 93,113, + 62,119,164,105,193,128,254,171,157, 38, 78, 35,147,187, 63,216, 87, 36,195,225, + 66,176, 81,148,136,177,135,185, 36, 31, 44,196,182,241,196,224, 79,120,114,217, +247,139,179, 52,240, 72, 77, 40,192, 1,119,155, 5,121, 56,133,168,180, 30, 15, +128, 13,107,150, 40,178,156,200, 55, 76, 20,235,210, 75,128,199,168,179,129,213, +177,242, 11,124,223,179, 64, 73, 57,249,205,237,179, 19,186, 4, 43,231,234, 65, + 89,120,250,212,119,179, 28, 6, 97, 81,145, 41,105,162, 16, 22,202, 12, 39,184, + 21,168, 63, 84, 31,116,145,199,205,104,101,161, 29,114,139, 54,163, 24,171,108, +172,161,197, 64,118, 87,212, 42, 15,176,187,214, 26, 12,132,152, 36,163,240,252, +106, 38,120,192,137,104, 27,206,250,171, 69,251,204,247,251,124,177, 65,110, 24, + 56,110,137, 37,106, 94,128, 31,234, 7,174,216, 74, 37,198,192,223,141,151, 57, +194, 15,201,231, 32,148,145,221,249, 96, 38, 23, 55, 61, 91, 79, 34, 40,130, 36, + 23, 36,222, 4,121,120, 91, 81, 32,152,250,174,250,246, 61,212, 22,155,190,179, + 50,138, 67,181, 46, 95,187,125,240,161,168, 29, 88,138,102, 0, 15, 74, 76, 73, + 78, 47, 72,142,146, 22,223,229, 67, 71, 66, 37, 76, 51,192,177, 50,124, 47,161, +227, 76, 7, 55, 29,232,147, 41,220, 82, 30, 63, 81,171, 72,129, 76,211,105,224, +102, 5,250,107,133,206, 84,241,136,205, 66, 84,239,118,114,251,227,244,215,141, + 53,209, 74,119, 71, 51,240, 62, 10,251, 97,193, 34, 1, 82,211,139,229,194, 61, +250, 67,213, 77,157, 73, 77,123,184,145,142,245,117, 83, 63,145, 30, 67,219, 17, +167, 71,154,169,187,199, 47, 32,199, 21, 10,122,140,171,121,209,210, 53,208,142, +138, 79,217,117,231,176,108, 74,134, 66, 40, 87,232,192, 54,238,100,105,150, 57, +192,169,138,244,254,100,156, 15, 36, 34,201, 51,247, 57,205,173,104, 31,254,225, +104, 38, 37,226, 99,164,232,246, 4, 37,169,153, 96,124, 98,115, 35, 66,120, 68, +118,254, 3, 91,144, 47,230,226,169,180,175,226,239, 74,239, 73,254, 82, 56, 88, + 24, 71,190,234,227,219, 85,222,160,147, 35, 71,199,211, 56, 60,116,122, 54, 27, + 39, 40,187, 91,235,126,118, 69,246,231, 29,107,111,237, 54,152,198, 13,234,217, + 80,134,104,142,233, 60,144,215,253,239, 44, 14,105,183,239,172,131,159,106,218, +137,171,207,179, 97,240,248, 88, 28, 35, 44, 77, 19,151, 16,168, 66,106,251,160, + 6, 2,173,203, 70,172, 45,171,152, 39,154, 1,154,145,152,153,131, 57, 13, 14, +115,145, 35,163, 92, 63, 20,156,253,213,246,159,206, 89,122,224, 7,250,211,134, + 67,250, 33, 17,145,182,142,142,170,213, 81,173, 88, 65,245,249, 7, 16, 51, 25, +196, 48, 86,243,217,130,116, 89, 89,183,189, 99, 38,116,136, 43,182, 79,165,160, +225, 71, 46, 50,166, 51,251, 34, 67,105, 47,154, 99, 71, 89,154,225, 19,108,158, + 8,248,133,164,223,221, 15, 70,117, 15,159,156,111,243, 73, 68, 45,195, 23, 34, + 11,109,139,125,152,129,142,232,226,133, 50,222,176,226,164,232, 50, 13,159, 37, + 98,247, 57, 98,178,219, 67, 25, 93,179, 28, 29,118, 16, 71, 35,114,176,141,203, + 85,232,132,230, 41,133,140,223,216,222,224, 67, 20, 12,120,183,236,220,207, 82, + 54,245,179, 65, 6, 59,232, 24, 81,110, 33,177, 84,219, 60,183,236,103, 42,241, +199,192,182,201,177,147,221, 21, 94,191,122,174,109, 68, 30, 37,112,234,145, 90, +151, 60,101, 82,213, 16,168,114,166, 44, 80, 86, 62,155, 32, 52, 1,224,102,134, +212, 72,139,244,188, 73, 28,112, 35,208,251,179,237,164,220, 0,104,197, 39,126, + 29,173,194,165, 86,152,211, 27,128,185, 62,191, 12, 91, 31,135, 23, 73,184, 57, + 73,158,192, 89, 19,146,189,210, 81,212,153, 93,174, 54,176, 62,111,236,103, 13, + 39, 25,187,198,137,130,215,150,220, 27,230,203, 9,240,211,153, 22, 84, 38,113, + 23, 48,206,149, 0, 88, 19,208,218,191,190, 31, 98, 63,153, 89, 46, 38, 72,163, + 34,137,200,123, 62, 16,204, 17, 53, 66,113,197, 42,127,129, 15,222,102, 40,114, +189, 17, 54, 11, 94, 89, 45,237,152, 9,183,199,222,124, 86,192,206,163, 32,109, +105, 62, 86, 26, 16,113,154,194, 73,186, 93,178,106, 16,212, 67,240,157, 57, 13, + 80, 39, 19, 58,239,169, 24,144, 12,108, 86,125, 91,136,116, 90,163,163,201,248, +247, 28, 38, 78, 73, 67, 91, 0, 16,189, 35, 96,192, 75, 77, 82,253, 17,139, 11, +188, 84, 97,203, 92, 54, 96, 49, 20, 51,252,162,188,156, 21, 34, 9,211,189,140, + 5,205,130,242, 38,220, 70,249, 74, 60,111,221,111,201, 98,211, 50, 80, 36,106, +122,216, 62,133,130,161, 43,166, 67,138,194, 62,104,107,196,240,123,118,116, 3, + 79, 58,101,239, 6, 99,226, 8,161,139, 33, 33, 74, 23, 14, 59, 77, 16, 70, 35, +175, 88,211,216,143,116,249, 89,118,233,202,168,246,124,156, 52,252, 81,109,136, +154,145,193,146,230,132,220,112, 17, 32, 32,246,119,166, 27,221, 17, 55,235, 83, + 66,158,160, 54,114,245,192, 42,212,227,227,214,113,225,159, 49,139, 80,163, 35, +219, 41,177,196, 37, 39,176, 50,178,172,209,161, 80,171,213,216,202,243, 98,126, +250, 36,153,157,183,216, 19,142, 32,210, 75,235,107,102, 57, 51,238,249,214,122, +204, 23, 0, 30,178, 6,168,185, 4,160,215,118,208,127, 14, 38,232, 52,198,219, +109,235,237,136,253,162,234,190, 44, 88,239,100, 47,184, 65,229, 8,205, 45,154, +254,168,181,102,243,142, 8,155,224, 5, 5, 42,178,185,234,200, 66, 11, 10,222, +117, 85, 87, 38, 1, 75, 50,235,191, 41, 54,144, 18,139,235,204,241, 5, 60,145, +112,250,213,168,145, 61, 9,241,199,111, 99, 20,203,172,232, 17, 60,117,106,126, +228, 31,192, 74, 19,240, 48,145,240,195, 5,141,144, 7,120,237,232,223,208, 98, + 43,224,208, 26, 64, 63, 59, 90,139,194,221, 31,162,120,191,186,195,115, 75,162, + 25,216,249, 86,191,109, 89,164,127,226, 50,105, 0,234,201, 63,183, 48,216, 57, +225,204, 10,121, 99,188, 35, 79,127,166, 21, 86, 71,208,218,164, 38,150,246,189, +174,115,217, 65, 3, 45,121,126, 72,126,114, 51, 46,249,204, 21,208,122,250, 4, +158,102, 36, 45,176, 31, 59, 49, 6,213,247, 71,147, 75,192,215,129, 83, 96,211, + 88,234,216, 8,245,185,121, 83, 57,147,217, 39,129,200, 54, 94,233,211,177,227, +171,223,222, 40,164,194, 45,213, 60,102, 14, 75,173,230,109, 13, 96, 62,147,114, +165,184, 15,190,251,107,216,133, 95,230,245,206, 92, 8,219, 27, 42,152,213,211, +154,235,129, 81, 10,190, 84,232, 97, 62,136,252,187, 39, 57,145,254,188, 20, 96, + 4,142,203,153, 33,175, 19, 65, 21, 95,223,207, 0,127,107,247,165,113,114, 13, +124, 41,119,253, 11,235, 73, 23, 52, 76, 25,163,168,241, 96,126, 58, 73,157, 86, + 76, 49,242,160,237, 32,227, 62,216,234,174,162,245,201,197,222,137, 49,118,177, +190, 46, 50,237,223, 7,113, 37,143,189,139,184,174, 67,168, 91,182, 29, 24,119, +154, 45, 37,102,232, 11,185,188,125,171,117,138,246, 10,233, 97,128, 24, 15,210, + 37,159, 96, 62,180,162,108, 38,197,131,195,103,157, 56,217, 69,210,158,144, 14, +222, 80, 25, 98,222, 99, 29,109,118, 98,187,231,120, 43, 8,108, 56,221,218,146, + 78, 94,212, 24,151, 0,246,205, 23, 78, 25,221,199,243,189, 19, 24, 78, 1, 99, + 56,101,235,202, 30,227,152,101, 10,250,227,247,155,222,210,144,200,184, 1,167, + 98, 85,234,125, 20,124,200, 25,255,119, 58, 43,142,127, 40,186, 97,148,197, 47, +207, 48,110, 8,228,113,232,218, 42,254,110, 35,116,160,112,192,249,150,195,177, +136, 44, 8, 76,117, 3,161,184,170,175,166,238,112,179, 9,122,152,164, 91,139, + 43,255,182, 18,187,155, 32,212,127, 48,139,122,220, 65,207,224,172,100,111,255, +123,243,118, 22,214,110,224,117,140,235, 55,228,247,148,211,239,133, 6,120, 98, +210,129,196,115, 71,160,109,158, 31,126,225,187,153,177,215, 77,111, 2,163,199, +159,241, 79,132,118, 46, 40,194,130,186,104,223,241, 65, 84, 41,220,154, 82, 70, +236,113, 82,215,122, 76, 15,211,130,218, 62,118,208,109,242,158,250, 21, 1, 11, +211, 84,184,246, 15,188,103,143,121, 7, 7, 82,228,158, 96,241, 94, 75,127,130, +212, 32,123,162, 92,209, 0,180,101, 15,241,154,143, 26,251,183,155,142,147, 86, + 51, 79, 20,183, 61, 93, 53, 11, 35, 76, 55, 83,245, 73,132,188, 80,242, 64, 23, +172,107,194, 18,128,220, 46, 20,249, 50,116,186, 74,253,167, 97,248, 60, 48,102, +105,234,151, 22,137,134, 44,165,190, 66,112,125,101, 95,111,130, 49, 4, 17,107, +100, 13, 48, 17, 91, 83, 0,195, 40, 5, 48, 39,133,228, 67, 30, 3, 80,127, 0, + 41,189, 92,154, 37, 88,160,158,131, 29, 85,166,233,207, 12,223,198, 6,185, 70, +141,116,209,168,128, 93, 7, 86, 55,152,153,154,128,224,113,105, 9,198,251,230, + 61,193,115, 63,209, 28,160, 70, 51, 63, 90, 26, 92,154, 99,218, 83,159,230,192, + 3,158,164,246, 19, 16,106, 62, 2, 45, 74,100,225,161, 89, 7, 80,198,166,121, +177, 47, 28, 56,200,165, 72,175,121, 91,209,118,222,230,237,159, 29,199,101,133, +150,203, 28,209,151, 65, 8,198, 2,118,106,100,246, 72, 9,244, 76, 39, 0, 9, +244,129,127,183,161, 52,191, 7,142,203,109, 7,206, 93,221, 46,240, 40,228,143, +149,152,123, 82,164, 16,163,207,155,236, 88,213,225,228,121,244,201,245,114, 72, + 17, 52,121, 33,135,103,240,141, 46, 39, 34,242,153, 39,167, 99,207, 45, 35,255, +234,201,153,135,140, 74, 29, 37, 6,239,227,103,224,135,149,135,224,153,194,185, + 75, 11, 4,127,178,185,174,107, 6,213,101,144, 70,208,132, 57, 45,160, 29,122, + 98, 72,193,111, 60, 59,209,125, 25,227, 32,156,189, 17, 28,208, 29, 94,130, 52, + 97,145, 2,204,176, 40,228,218,103,128, 0, 62,112,103,195, 18, 75, 63,134,194, +223,140,194,148,250,139,141,241, 79, 31, 49,167, 14, 62, 60,151, 2, 46, 18,149, +133, 53,160,126,122,129,192,248,180, 64, 55,175, 33, 15,231,163,200, 31,153, 14, + 77, 17,167, 96,152,202, 11, 96,121, 86,110,192,128,165,175, 12,115,108, 43, 43, +175,208,148, 90,184, 6,165,113, 17,133,226, 20,229,240, 0,102, 56,169, 40,224, +176,234, 1,228,109,131,140,130,230, 91,101,196,250,248,252, 0, 63,148, 54,240, + 46,163,184,184, 56,178,109,219, 37,183,206, 72, 78,196, 24, 25, 33,252, 2,158, + 0,158, 0,157, 0,247,203, 26,182, 89,205,123,107, 12, 17,113,131,202,221, 39, + 10,114,134, 74,131,196,226,193,231,181,221,207, 25,109,243,181,223, 21, 40,242, +156, 23,197,163,123, 29,118,243,254,249, 92, 12, 45,224,244,129,208,146,113,225, +148, 60,125, 42, 92, 26,115,152,166, 61,155, 78,247, 64,191,214,195,154, 83,174, + 1, 72,157, 94,238,243,201,174,231,183,206, 95,230, 26,210, 48,180, 63,140,117, + 22,113,221,206, 68,213, 68, 32, 73,121,127, 23,217, 13, 38, 73, 84,119,246, 95, +188, 16, 57,223, 69, 92,225, 70,161,110,252, 57, 17,202,252, 29,142,203, 87,191, +115, 21, 99,160,189,159,193,106,151,167,205,156,189,216,223,231,130,185,203, 99, + 51, 73, 6,217, 11, 24,128,153,197,110,229,234,165,123, 40,121, 80,144,185, 57, + 95, 57, 92,209,160,192,109, 49,255,144, 2, 48, 77, 68, 58, 39,120,109,214,234, + 14,155, 63,238, 43,135, 71,248,246,226, 25,172,238, 93, 45,191,209,251,240,195, +234,251, 74,218,225, 42,143,203,161, 75, 79,183, 34,148, 23,239,170,170, 42,138, +138, 80, 94, 85,148, 79, 85,100,242,106,114,106,138,150, 78,101, 82, 69,180, 59, +245,190,133,154,209, 18,158,211,140,167,126,107,159,167, 18,241,221, 15,235,198, +221,250, 74,231,238,218,253,214,214, 35,143,164,199, 84,194,139,185, 30, 77, 2, +135, 16,212,136,162,156,218, 81, 3,205,169,103,116,182, 25,204, 55,220, 15,119, + 1,244,233,235, 71,132,185, 63, 55, 42, 35,228,158,231, 0,254,215,211,223,180, +134,211,189,233,234, 81, 13, 10,190,222,127,132, 68, 10,225,164, 32, 51,131,114, + 32,105,116,250, 22, 55, 8,129, 72,210,181,159, 82,114,184, 81, 75,102, 83, 44, +195, 9, 31, 82,165, 88,107, 42, 37,237,184, 46,203,229,154,243,151,204,101,125, +166,169,242, 90, 78, 83, 57,181,211,111,169,229,209,168,171,174,240, 30, 4,232, +169,146, 36, 51,206,213,234,215, 68,100,207,125,221,135, 93, 15,214,102,140,205, +166,195, 86,109,190,120,140, 20,132, 78, 61,193, 99, 4, 86, 18,151,160, 75, 10, +170, 40,229, 97, 8, 68,146, 61,148, 64, 75,231, 94,135,189,118,152, 26, 29,209, +103,140, 18,226, 49, 66,232, 29, 15,139, 21,201,164,138,196, 72,125,194,250, 47, + 60,114,174, 40,161,127,146, 73, 21,113,127, 60, 42,146, 73, 21,153, 80, 93,189, +123, 74,167, 82,114,111,110,116,174,207,141, 13, 78, 84,160,233, 32,141, 70,243, +154,135, 26,141,204, 24,107,111, 98,202,216,231,149, 29,229,211,166, 87, 25,238, + 15,104,252, 22, 39,133, 87,132,183,235, 15,127, 24,204,213,251, 19, 82,126,181, + 56, 91,139,206,181,184,248, 51, 90, 27,206,172,231,253,166, 51,158,213,231,182, +109, 20,148,163,203,227,188,239,210,169,101, 81, 16, 44, 4,255,119, 13, 59,141, + 7, 29,213,255,177, 94,208, 13,160, 81,234,251, 81, 26,139, 23,172,228, 26, 86, +113,154, 8, 2, 35,113, 0, 0, 12,140,139, 68,114,153, 60, 30,231,105, 28,210, + 15,243,130,197, 58,214, 43,108,139,126, 12,214,168,114,179,204, 27, 5,156, 19, +198,244, 73,191, 58, 29, 72,242, 6,210, 6,144,136,228,135,104,157, 31,239,115, +236, 22, 41,212, 84,106,154,215, 55, 90,205,228, 28,181, 97,212, 72,192,203,247, + 43, 63,213,232, 99, 18,115,200,241, 80,184,253, 10,158,115, 58, 3,249,221,250, +217,229,250, 87, 62,174, 95,253,171,117,228,139,204, 24, 32,198,135, 19,111,207, + 8,123,160, 75,114,102,250,243,252, 45, 8,163,122,107, 44, 52,233,104,173,159, +127, 89,178,130,238,116,229,203, 40,124,136,199, 73,196, 70, 61,126, 72, 7,207, + 51,146, 53,146,141, 14,225,227, 27, 68,216,246, 47, 98,239, 77,204, 31,103, 75, + 2,255, 63,209, 8, 64, 93,255, 78, 1, 75,165, 8, 89, 74,239, 56, 76,124,101, + 54, 78,119,114,217,245,202, 50,192,120,108, 18,153, 49,136,137,113,249,132, 1, +159,105,174,167, 34, 66,104, 67,169,244, 46,189, 93, 48, 95, 12,171,159,206, 40, +251, 75,252,236,197, 8, 86,173, 27,113, 19,237,255,203,232, 85,171,110, 55,184, + 40, 64, 37,183, 55,240, 32,132, 16,220,119,135,136,140, 83,140, 95,228, 83, 98, +231, 52,153,213, 0,184,169,154,114,158,142,216, 13, 96,102, 0,144, 62,158,180, +101, 55, 40, 9,251,211,243,159,150,231,205,197,161,245,248,158,185,107, 26, 99, + 42,169, 3,107, 96,248, 27,255,120,126,145,208,143, 18, 13,158,146,160,241, 2, + 77,186, 15, 48, 60,142,208,204, 78,144, 18, 8, 0,208,243, 6,235,137,180, 50, +115,237, 74,215,134,181,115,156,194,156, 25, 70,121,161, 90,110, 77,150,147,231, +193,193,116, 63, 84, 32,152,146,102, 24, 0,221,203, 63,184, 96, 90, 94, 12, 17, +222,201,149,166, 4,238, 6,137,201,156, 43, 44,242, 5,212, 4,214,162,139,158, +130,254, 44, 11,188, 50,142, 11,106, 7,227, 68,113,145,246,171,148,204, 93,255, + 95, 35, 71,219,135,125,143,119,165,245,166,241, 96, 70, 30,100,190,118,229, 14, +132,120,225, 53,207,114, 99,231, 72,205,249, 33,163,241,173,211,230, 90, 80, 59, +118, 26,157, 44, 8,172, 0,139, 88,207,115,200,240,240, 4, 32, 55,245,211, 35, +177,209, 70,157,155,161,250,240,131, 59, 55,207, 21, 36,201, 40, 82,125, 83, 28, + 92, 31,160,142, 30,144,222,172,102,106, 54,192,149,199,175,243,161,238,202, 35, +162, 78,139, 94, 63,228,205, 54, 71, 7,163, 40, 42,196,178,164, 19, 33,229,246, + 75,225, 12,104,219,114, 43,190,146,211, 5,200,189, 70,165, 76,234, 52, 29, 20, +102, 86,107,194, 64, 43, 65,235,188, 55, 90, 71,206, 19,113, 41,179,121,234,127, +171,196,137,177,127, 18,249, 43, 35,250,134, 9, 82, 44,117, 81,195,236, 20, 99, +224,112, 35, 34,193,136, 27, 52,251, 54,207,187,203, 19,117,229, 21, 48, 24, 61, +240, 69, 44,173, 48, 88,252, 32,177, 23,174, 97,200,251, 54, 76, 31,168,244,123, +226,251,130,220,229,209,114,111, 68,254,198, 1,142, 64,211,188,182,255,133, 52, +118, 58, 50, 82,235,126,138,144, 39,198,135,139,233,201,202,215,201,151,188,144, + 16,197,238, 70,216,112, 45, 5,252, 48, 10, 98,124,133,157,145,120,164, 68,139, + 68,234,204, 99,200, 55,188, 10,200,109, 17,178, 88, 43,189, 85,132,143,223, 16, +180,150,248,121,139,116,218, 57,163, 61, 79,124,221, 6, 30, 94, 27, 4,203,136, +215,240,160, 17,151, 0,243, 86,129,196,182, 71,224, 49, 53,124,255, 18, 41,205, + 23, 96,241, 3,118,197, 8,107, 98, 48,229, 29,140, 49, 61, 28,174, 34,213, 2, +115,234,177,129, 1,102, 15,171,171, 55, 93, 20,214, 7,247, 5, 99, 34, 75,202, +126,212,187,210,125, 29,249,112,102, 18,187, 95, 38, 46,168, 48,186, 76, 88,212, +175,147, 3,167, 96, 96,133, 25,112, 99, 10, 30, 0,226,151,211, 47,114,124,244, +178,228,156, 55,236, 30, 23,147,219, 96,132, 17,127,151, 64,221,166,125, 93,152, +217,202, 46, 41, 80, 59,172,175, 79,205,107,141, 48, 49, 64,154,201,252, 25,252, +125, 57, 70, 99,156,178,194,146,167, 74,146,200,123, 64,105,208, 36,168,136,116, + 5,186,234,170, 86, 95, 17,136, 26,113,111, 66, 89,186,185,160,103,212,198,231, +248,233, 65, 72,109,205,173, 20,171, 66, 99,145, 37,117, 52, 84, 10,149, 25,178, + 46, 31,158, 39,144, 85,204,134,115,101, 15,144, 60,187,213,126,237, 55,163, 33, +251, 64,148,242, 69, 46,144,145, 93, 72, 56, 89,120,215, 10, 93, 13, 40, 68,166, +222,159,122, 38,248,176,115,227, 49,245,160,244, 38,124,209, 15, 64, 24, 30, 80, + 28,233, 40, 33, 27, 68, 0,193, 52,145,171, 60,116,189, 64, 51,153, 83, 30,199, + 33, 39, 60,125, 40, 83, 83, 9, 9, 64,217,101,255,216,152, 89,188, 96,220, 73, + 94,221,126, 35, 88,143, 39,233, 69,188,211,123, 10, 59,130,186, 46, 38, 94,171, + 14, 85, 9,229,184,214, 75, 13,191,142, 55, 18,251,249, 73,254,203,154,163,180, + 1, 38,114,206,237,211, 8,146, 73, 19,215,238,154,226, 55,106,103, 75,178,113, +164,176, 36, 83,122,164, 49,181,208,231, 50,139, 91, 15,137,236, 0,162,123,237, +225,212,131, 24, 34,150, 48, 66, 96,224, 52,137,206, 81, 97, 81,184,140, 79,225, +118, 79,183,136,222,125,161,163, 6,112, 95,114, 4,223, 7,116,223,225,249, 41, +153,108, 65,233, 3, 44,151,195, 74, 47, 32,105, 16, 58,130,155,113, 88,254, 0, +198, 22, 83,154,141, 0,206,192, 27,152,122,192, 55,130, 68,193,245, 80, 95, 8, +133,124,152,249, 74, 49, 66,102, 33,122, 74, 8,100, 61, 46, 29,109,253,114,137, + 5,175, 74, 49,140,163,103,123,216,190,178,122, 97, 70,175,178,248, 79, 87, 6, + 41,158,182,192,239, 76,231, 25,158,129,210, 37,192,150,199,199,215,224,103, 92, + 73, 68, 83,255,119, 70,102,106,146,233,195,251, 4,102, 88, 22, 57,181, 68,213, +130,247, 66,237,139,228, 58,167, 2,170, 45,130, 94,243,184,151, 47,150, 2,199, +117,131, 66,133,157, 77,219,134,206,193, 53, 95, 55, 81, 79,128,235,254,244,167, + 18,177,174, 39,113,131, 18,208, 17, 53,120,116,231,143,249,114,111, 45, 11,215, +100, 86, 73,235, 74, 93, 5,103,102, 41,172,199, 64, 42, 33,132,207,184,239,109, + 61,116,229,103,146,204, 31, 41, 26,133,136,165, 69,166, 99, 47, 45, 45,175, 44, +234, 39,100,110,194,188,205,122,131, 41,241,153,170, 94, 28,250,215, 18, 60, 68, +105,117,111,132, 1,125,255, 98,171,206, 55,128,155,189,204,211,247, 30,122,145, +190,168,139, 75, 66,222, 50, 72, 99, 15,170, 61,237, 4,150,235,242,226, 5, 20, + 13,148,246,223, 65,111,200, 75, 49, 45, 90, 45,128,194,182, 93, 14, 23, 97,235, +197,222,125,166,222, 96,169, 43, 66, 76, 97,216,174, 10, 82, 58,235,170, 25, 53, +124,160,215, 29,130, 24,238, 57,148,105,253,135, 89,168, 84, 36, 14,235,196,112, +216,159, 56, 72, 61, 82,109,102,237, 65,236,130,104,208, 85,231, 61,190,253,232, +110, 18, 54,194, 41, 42,171, 30, 70, 59, 65,192,197,169, 52,202, 4,140,150,247, + 92, 28, 21,128,187, 59, 34, 72,147,157,163,254,108, 16,136, 5,122,226, 82, 74, + 37,239, 20,115,121, 88,112,159,244,143,226,150,140, 28,221, 30,190,180,142, 38, +234, 0,196,113, 72,248, 55,150,161,173,124, 78,148, 67,248,132, 48, 95, 75, 47, + 67, 94, 49,139,209,209, 15, 47,234,158,191,153,107,114,233,137,203,246,168, 24, +231,249,224,254, 50,207,161,216, 7,188,205, 32, 68, 45,237,119,121, 26, 26, 95, + 41,190,241, 9, 79,121,240,241,142,253, 70, 65,100,125, 44, 96,223,117,122, 28, +217, 18,249, 2,246,100, 17, 2,130,152, 31, 57,154, 44, 58, 96, 87,136, 63,157, + 53,166,245,220,197,193,119,196, 70,180, 97, 17,124,231, 79, 54,171,143,193,200, +156, 63,100, 41, 42, 85,231, 38, 12,175,220,136, 53,229, 25, 54, 2,255,144,177, +191,222,172,160, 17, 57, 81,221, 10,124,254,236,102, 35,250, 72,234,191, 21, 58, + 84,127, 35, 65,106, 15,232, 97, 33, 55,136,148, 31,140,207,185,238,128,119, 24, +246,167, 76,178, 90, 91,221,194, 42, 76,190, 36,207, 12, 37,128,112,116,165,113, +183,202,161, 69,213,170, 25,146,216, 18,251, 74, 23,214,223,152, 14,121,171, 50, + 62,190,180, 13, 50, 19, 66,191,129, 93,116,152, 27,247,187, 6,240,234,180, 87, + 41, 81, 30, 61,117, 78,246,108, 87, 32, 63,142, 5, 72,162,215,208, 37, 2,233, +115,183,202,195,221,174, 82,246,195, 63,215,249,166, 70,110,101, 26,103, 79,197, + 73,244,195,136,131, 63,178, 59, 4,165, 73,182,147,227, 90,178, 7, 4,239,236, +186, 37, 42,210,122,182, 85,140,157,194, 20,238, 79,129,159,150, 85, 98, 70, 31, +242, 6,169,232, 96,220,118,254, 87, 68,230,240,158,194, 1,194,255,156,115, 68, +196,220, 52, 5,224,147,238,234, 91,141, 15, 90,241,103, 4, 35,251, 76,175,203, + 97,207,136, 93,237,106, 90,150,137,212,174,155,206, 55,246,164,165,176, 61,224, + 49, 84, 64, 39,200, 84,107, 22,255,199,208,131, 95, 34, 39, 83, 8,157,131,147, + 50, 21, 31,212, 78, 53, 12,159, 14,189, 10, 85,239,208, 74, 32,185,150,150, 74, +201,136,128, 76,104, 93,175, 32,218,134,234,208, 81, 24, 86,195, 97,222,182,179, + 80,179,206,227, 41, 68, 66, 42, 73, 16, 80,252, 5,216,109,142, 63,143, 88,110, + 16,146, 90,206,189,217, 75,246,163,244,184, 73,177,234,202,101, 88,102,253,242, + 71, 84,121, 33, 99, 41,210, 35,214,141,109,105, 48,191,156, 37,183,154,112, 73, +123,152, 27, 38,231,193, 20, 97,208,175, 1, 43,118,243,149,218, 51,174,182,219, +106,158,117,126,142,242, 91,219,200,227, 71,160,108,102, 98, 22, 69,125,168,101, +107, 24,251,120, 90,121,129,180,196,115, 81, 69, 21, 50,125,185,251,151,169,134, +141,101,211, 92,191,156,135,199,115, 64, 12,215,108,211, 91,184, 41, 82,253,156, + 64,203,149,192, 84,229,158, 68, 52,174,196,153, 0,173,193,122,157, 99,239,130, +127, 79, 35, 4, 40, 58, 58,170, 25,202, 5, 13,220,135, 19,215,151,114, 27, 86, +180, 4, 30,105,219,143, 56,120,165, 50, 80,180,185,158,247, 32, 3, 45,146, 80, +213,130,119,225, 97, 21, 43,244, 24, 58,199,185, 48,150,103,118,128,193,130,209, +238,237,111,185,234, 32,119,219,117, 76, 88,252,131,132,169,199,106, 91,173,134, +100, 63, 22, 47,245, 1,108, 18, 47, 47, 5, 80,231,254,151, 43,176,217, 56,235, +194, 90,108, 99,217,220,202,183,116, 82,160,141,182, 84, 2, 43,129, 24,215, 72, + 85, 24,244, 15,100, 38, 53,236,212,183, 81, 47,109, 67, 58, 37,181,177,201,196, +243, 28,168, 29,158,170,197,156, 12,232, 61, 14,138,251,249,224, 50, 35, 17,165, +123,109,148, 82, 77,179, 74,123, 2, 36, 79, 96, 76, 28, 76,229,107,111,168,178, +183, 41,247,235,134,115,241,210,136,228, 67,167,122,102, 39,195,174,212,188, 36, +211,160, 38,117,156,174,203, 88, 65, 76, 16,106,151,202,233, 87,231,167, 45,118, +185, 89,159,106, 57, 42,114,147, 77, 4,252,174,124, 8,132,132,249, 40,199, 51, +166,207, 64, 4,126,208,248, 1,112,253, 10, 65,112,205, 45,182, 95, 89, 63, 62, +248, 70,146,174,141,147, 53, 27,189, 3,234,197,157, 75,124, 40, 80,165,204,158, +144,198,173, 59,165,133,141,223, 53,112,113,109,166,118,222,224, 75, 14,182,237, + 16,176, 50, 90,100,212, 77, 72,134,105, 1,154, 86, 16,103,178,150,179,154,130, +222, 21,167,111,112,138,143, 37,197,235, 41, 97, 61, 73,178,131,114,250,132,182, +195,234, 50,103, 45, 34, 6,243,106, 48,134, 6,251,218, 23, 31, 90,191,206,231, +216,172,169,239,117,177,157,156,134, 36, 15, 19,105, 75,119,246,136, 62,233,157, +218, 95,146,111,208,143,249,165,252, 56, 81,127,127,106,108, 71,165,130,158,209, + 68, 60,147,136, 73, 97,218,181,172,164, 5,157,236, 42,237, 27,208,252, 85, 39, +105,238, 11,213, 50, 14,223,149,223,173,188,244, 13, 64, 11, 96,138, 89,138,176, + 52,162,200, 97,213, 88, 7,223,163,108,148,127, 51,162,140, 34, 10, 13, 31,181, + 12,238, 60,207, 58, 76,194,115, 38,164,135,147,160,140,203,219,193,181, 68,161, +131,219,195, 39,116, 40, 23,113,162, 97,148,164,159, 56,156, 81,137,211,193,206, + 26, 70,170, 92,101, 86,216,153,255, 45,102, 69,178,121, 40,201, 3,132, 92,238, + 54, 80,117,137,190,138, 11, 10,189,202, 30,234, 67,115,189,114, 94,251, 76, 52, + 53, 25, 2,175,130, 2,218,237,220,219,225, 36, 25, 53,169, 46,255, 16,113, 98, +149, 96, 32, 71,227,158, 85,197,195,234,213,216, 49, 8, 77, 73,193, 58,147, 6, + 8,253,117,234,240,197,130,121, 1,130,134, 65, 78, 98,156, 3,181,104,204, 90, + 8,129,248, 5,132,230,165,245,235,245,164,247, 0, 78,244, 35,110,151, 18, 60, +208, 34,242, 76,196,167,196,190,243, 49,136,110,165, 98, 56,174, 3,225,193,114, + 97, 80, 19, 80,200,187,233,222, 53,158,192,148,135,207,203,120,116, 67,207,123, + 4,255, 3, 62, 65,230,123,107, 9, 67,112,118,209,198,202, 93,124,160,221, 61, +206, 78,225,182,155,147,196,246,241,212,117, 9,160,200,116, 42,170,198,190, 59, + 82,193,239,241, 72,110,185,250,112,105,208,244,202,117,149, 49, 49,223, 76, 55, + 40,206,231,226,156,123, 84, 15,220,138, 79,209, 0, 34,254,244,102,103, 29,176, + 16,199,139, 62, 60,144, 0,205, 10,228,247, 34,103, 68, 7, 64,218,106, 95, 64, + 78, 74,183, 21,164,189,249, 15,100, 42,238,232,222,116, 43, 16, 10,124,245, 99, +142, 15,152, 76, 21, 29,185,252,191, 19,120,152,219, 5,109,113, 3, 44,207, 48, +123,158, 11, 54,204,223, 48, 35,169,249,146,205,133, 75,220,211,145,100, 8, 21, + 8,140, 18, 21,237,239,245,146,200,127, 62,176,157, 74, 51,232,123,116,248,195, +181,131,166,187, 92,240,117, 98, 46,121,177, 19, 65,102,162, 37, 18, 25,181, 59, +119,139,126,209,107, 84,108,248,151, 14,220, 33,193,159,134,186,104, 50,180,100, +113, 70, 47,228, 26,234, 74, 56, 30,221, 16, 44,124,161,140, 83, 45,111,199, 48, + 24,105,193, 24, 54, 95,109, 76, 69, 1,226,217,165, 15,239,171,108,118,118,132, +117,221, 88,117,143,126,136,104,245,112, 28,250, 23,100,203,143,167, 72,170, 78, + 33, 20, 32,146,219,217,209,108,121, 27,107,219, 2,253,202,240,255, 77, 90,114, + 34,208,112, 49, 51,147,170,142,168,133,145,196,134,215,134, 85,208,197,131, 10, +175,100,194,173, 22, 39,112,131,108, 14, 92,140, 52, 14,231, 96, 55,193,213,157, +255, 68, 9, 60,112,116,133, 5, 58,131,116, 0, 0, 47,251,177, 68,211, 8,219, + 33,201, 8,234,162, 25,136,132,171,227, 18, 29,234,100,242,108,158, 51,152,123, +111, 49, 3,247,140,217,241, 98,143,141,201, 96,141, 18,127,142,234,132,245,162, +181,211,177, 98, 54,243,116, 7, 16,194,181, 8,150, 70, 88,170, 80, 16, 28,236, +128,208,186, 18,101,139,130,204, 67,227,181,113,245, 81,106, 78, 13, 9,138,128, +150,252,122, 80,145,166,106, 70,153,105,213,212, 14, 99,241, 8,145, 34, 76, 95, +171,199,207, 87,127, 37, 53, 65,214, 9,209, 29, 27, 66,122,155, 28, 3, 77, 41, + 18, 25,145,144,253,177, 60, 89, 89,196, 54,200,193, 42, 80,133,106, 8,172,136, +140,211, 86, 38, 8, 67, 70,117, 29,163,228, 84, 81,238,126, 66, 40, 26,163, 2, + 26,240, 95, 50,133, 6, 28,169,171, 48,209,246,115,180,242,193,161,194,156,229, +168, 55, 14,148, 39,229,171,141, 16,163,115,114,216, 24,220,137,144,152,130,233, +115, 52,155, 57,181,254, 29, 4,221,168,111,219, 31, 98,156, 10,201, 23,192,186, + 88,214,106,220,224,180,141, 11,101,143, 50,205,209, 95,253,121,168, 9,201,224, +194,216,167, 41, 62, 75,157,187,171,180,161,100, 21,243, 16, 16, 44,131,245,196, +253,217,127,189, 90,172,118, 77,148,213,166, 53,177,218,183, 86,163,135,188, 7, +206,242, 54, 81, 55, 60, 30,234, 97,130,193, 40,133,207,151, 29,185, 57, 90,169, +220, 97, 7,111,247,209,121, 44,253,181,245,139,168,229,130,244, 5,172,130, 7, + 43, 34, 11, 4, 18, 65, 65, 9, 97,172,232,253,192, 97,127,153,177, 70,202,253, +228,194,119, 38,171, 29,203,165, 98,157,241,178,177,231, 57,127, 21, 37, 86,105, +141, 5, 78, 76,203,103, 11,173, 15, 6, 84,183,195, 64, 70, 81, 49,118, 75,104, +193, 2, 77,218, 93,124,150,138, 1,243, 73, 77, 45, 68,130, 37,137,214, 91,145, + 82, 60,108,254,164,228,156, 43, 93, 76, 68,251, 75,182,235,137,219,248, 57,253, +213, 84,249, 21, 3, 64, 75, 33,136,243, 90,234, 89,184, 1, 41,112,249,192, 92, + 70, 85,154, 15,230,125,208, 34,254,209,176,214,150, 86, 5,152, 59, 90,108,102, +197,193,130,164,153,119,140, 5,224,213, 71,166,116,232,163, 26, 19,131, 94,252, + 56, 55,144,182,188, 80, 51,153, 42,137,125,191, 43, 74,197, 99, 50,198,144,111, + 30, 97, 63, 14,210,137,123,228,255,151,168,177, 7,189,200, 44, 6,226,160,102, + 38,173,211,190, 48, 39,112,168,235, 62,224, 35, 11, 87, 84,116, 72,117, 93,148, +139,129, 21, 36, 91,183, 17, 94,240,112,123,105, 83,151, 31,180,115,186,128,152, +121, 93,254,178, 23, 96,203, 8,244, 90, 85, 48,243, 10, 24, 13,136, 79,148, 72, +158,105, 72, 44, 84,229, 27,159,108,105,147,214, 62, 89,219, 84, 4,222, 10,116, +104,118, 4, 76, 8, 1,152, 18, 16, 42, 22, 72, 97, 81, 5,145, 76,225,214,160, +251, 50,101,135,172,118, 90,241, 14, 24,103,130,158, 48, 92,154,133,104, 98, 9, +170,149,162, 56,222, 3,211, 54, 63,226,131, 26,179,254,134, 43,237,145, 95,238, +143, 65,162,247, 31,152,196,154, 7, 84,187, 2,220,130, 9, 26, 65,215, 58,184, + 14,185, 46, 55, 53,105,214,253,189,251,152,103, 42,208, 40,254, 11,168,220, 60, +147,252, 97, 72,195,117,166, 38,162,164,109,244,141,150, 22,189,108, 87,255,147, + 96,160, 72,249,218,105, 8,184, 99,177, 83,177,219, 21, 89,155,172, 29,116, 59, + 87,109,219,161, 55, 83,137, 79, 25, 24,209,138,119,243,192,160,204,199,122, 48, + 88, 89,156,247,213, 38,103, 16,150,161, 45,191,227, 23, 39,233, 44,207,255,129, +232, 18, 82, 99,126,162,152, 11,252,103,176,184,153,101, 18, 66,101, 99,254,219, + 90,221,132, 43,226,123, 41,111,138,203,207,112,140, 81, 95, 37,106,245,141,185, + 8,130,150,174,232, 24,158, 8, 48, 7,148,114,223,203, 4, 2,122, 49, 62,217, +206, 77,110, 96,207,201,150,159, 62,177,128, 30,168,224, 41, 11, 6, 77, 13,194, +190,216,194,217,155,243,149, 44,109,115,130,184,182,106, 0, 34,172,210, 35,219, + 59,245,120,194,103,149,112, 95,122, 11,172,123, 79,168, 29,158,216,150,222,100, +198, 98, 43, 66, 59, 72,144,119, 67,123, 68,122,164,136, 62, 58,208, 33,185,228, +184, 41,236, 77,127,119, 8,108, 45,124,182,205,240,166, 58,140,101,194, 45,178, + 67, 72, 1, 42, 68,250,181,228,130,119,115, 12,161,128,118,200,224, 76, 60,231, +219, 54,122,148,195, 26, 41,138,222,216, 24, 45,244, 10, 39, 47, 86,125,209, 57, +181, 64, 37,176,242, 36, 41,203, 55,195, 57,254, 68,212, 20,243,239,181,231,182, + 82,117,149, 95,113,232, 58,161,129,118,209, 6,139, 45,111,179, 86,179,113,182, +199,229,239, 76,146, 15, 65,104, 76,152, 31,144,133, 61,101, 96,145,190,166,255, +188,230,112, 93, 86, 52,113, 65,151,180, 37, 93,105,205, 52, 47, 17, 86,137,145, + 73, 13,224, 72, 37,160,193, 64,134,116,178,110,155, 96,239, 44,201,165,232,162, +188,119,196, 73, 63,241,100, 86, 4,210,127,229, 40, 17, 9, 70,170, 17, 84,180, +207,148,201, 34,175, 98, 52, 1, 2,198,182,233, 81, 78, 80, 76,102, 47,180,109, + 62, 0,255, 17,219,253,125,117,143,124, 7,255, 20,100, 42,112,192, 56, 33, 0, +200,232,155,149,217,199, 48,179,209,193,149,150,184,165,212, 99,244,206,145,191, +190, 21, 26,187, 65,230,170,216,141, 18,170,136,229,105, 63,149,213,132,172,178, +114,237, 97,168, 98,126,150,222, 30, 64,251, 2, 85, 36,169,241,196,121, 23, 99, + 39,112,162, 10,120,214, 88, 85,255,116,162,138, 48,232,238,178, 53,146,155,235, + 7,179,152, 49, 41, 18, 33, 65,180,158,127, 84,186, 43, 80, 72, 63,177, 92, 14, + 60,215, 67,188,131,182,174, 20,202,177, 59, 68,142,235,131,150, 20, 91,147, 71, +195,106,162,228,192,176,143,220,197,117, 84, 82, 0, 28, 16,176, 14, 79,211,224, +192,243,157, 47, 24,113,122,142, 9, 76, 76, 47,224,109,139,165,209,211,124, 76, +220,153,204,110, 18, 64, 12,120,232,112, 53,132,157, 36,253,132, 19,159,187,197, + 69, 12, 40,253,137, 3,153,178,113,222,220, 97,199, 54, 10,175, 3,116,188, 31, +104,128, 70,178,207, 63,255, 68,169, 50,183, 14,125,202,217,220,235, 69, 66, 71, + 43,185,148, 58, 9,211,155,158, 71, 47, 19, 89,215, 26,249,127,226,171, 5, 1, +161, 33,220,111,112, 68,237,175, 82,159, 11,135,142,134, 79, 23,222,226,232,220, + 43,142,193,218,169, 85,170, 93,192, 86, 84, 25,204, 27,214,229,190,105,118, 19, +194,119,172, 81, 98,183,160,197,220,191,112,116,160,178,146,146, 16, 35, 51, 9, +238,191,182, 24, 66, 34,213,193,111,168,155,160,218,102, 14,161,197, 36, 81,181, +133, 62,154, 52,142,128,100,252,209,118, 14, 92, 23,192,241,225, 1, 74,202, 2, + 43,153, 60, 19,129,156, 95, 79,100, 8, 73,125,150,226,200,142,131,148,165, 7, +137,152,198, 38,200,100,124, 5, 3,128, 18, 20,167,208,244,210, 53, 38,196,247, + 38,227, 92, 29,100, 47,190, 48,204,166, 99, 71,211, 81,164, 62,155,254, 85, 43, +150,238,166,203,185,184,240, 82, 75,163,248, 72, 87, 28,157,108, 4,147, 40, 71, +214,156, 11,128, 60,200, 81, 99, 98,111,222,228,245,101,202, 80, 90, 86, 25,111, + 28,152, 39,209,247,178, 88,220, 66, 22, 78, 62,107, 64, 32,203,238, 49,216, 51, +109,171, 43,144,218,193, 22,162, 15, 32, 52, 32, 96,246,153, 65,187, 8,242,195, + 48,236,172,111,230,219,251,225,138,180, 73,139,166, 92, 44, 20, 95,193, 31, 20, + 29,155, 93,187,156, 98,163,129,170,122,108,108,236,118, 59, 82,106,206,245,230, +116, 52,157,233,150,148,145,206,200, 2,232, 51, 30,224, 59,254,219,251,109,102, +208, 86,234, 60, 69,173,205,118,173,191, 60,238,247,158,174,219, 86,120,133,228, +180,143, 47,179, 9, 39,218,210, 90, 61,123, 95, 43,180,242,138, 16, 85,184,207, +115,111, 33, 52, 47,237,115,113, 8, 65, 84,207, 50,139, 46, 74, 55, 34,216,174, +187,152, 20, 30, 86,225,197,136,168,180,144, 78,245,196,190,190, 32,169, 26, 79, +185,241,162, 88,141, 78, 97, 22,103,121, 40,109,205,165, 97,119,149,190, 76,183, +121,229, 42, 32,132, 69, 91, 12,176,132,230,142,174,155, 50,230,144, 56, 13, 66, +217,122,144,222, 16,117, 51,209, 62,221,229,212,105, 34, 52,239,254, 8,107,146, +236, 76,227, 88,104,165, 62, 46,102, 70, 44,138, 49, 10,176, 17, 95,188,144, 31, + 88, 42, 82,216, 69,138, 60,251, 22,136,124,234, 12,152,150, 70,246, 95, 38,161, + 99,169, 18,177, 86, 99,127,157, 41,151, 7, 18, 63,220, 4,101,249,172,205,168, + 0, 61,198, 77, 71,229, 98, 81,231, 60,196,138, 30, 32, 25,214, 46,153,150,134, +161,101,162,191,152, 60, 89,157, 5, 83,104, 97,224,118,128,189,213, 6, 24,239, +133, 50, 1,178,127,105, 63,202,206, 9,218, 63, 70, 29,176,177,251,154,153, 61, +110, 61,115, 42,140, 30, 76, 22,117, 28, 4, 84,243, 17,156, 77, 12, 87, 31, 14, +222,239,124,231,101,198,167, 36, 10,208, 0,105,127,174, 84,110,254, 61,144,162, + 54,246, 15,164, 10, 66, 35,236,178, 87, 11,142, 90,116, 41, 95,177,149, 77, 34, + 21, 84,195,169,216,145,209,200, 47,237,122,122,141,133,161, 71,113, 76, 73, 76, + 53,225, 7,127,160,130,145, 65,133,217, 3, 17, 26, 11,171, 67, 26,100,128,197, +174,202,254, 8, 17,178,229,184,144, 63,228, 80,173,141,144,240,102,196,157, 19, + 12,188,158, 7, 82,159, 20, 68,178,196,116,235, 95,132, 41,199,223,124, 98,113, +212,137, 75,130, 73, 24, 33,192,236,246, 52,169,162,154,177,130,113,197,136,255, +168, 8,162,173, 52, 98, 22, 62,137,101,251,239,149, 30, 34, 11,125,142,245,221, + 79, 70, 8, 91,223,168, 86, 21,186,119, 33,208,142, 40, 40, 67,104,186,223,194, +185, 51, 6,153, 86,214,151,162,119,158,223, 47,151,135,174,202, 1,192,249,137, +216,176, 94, 29,203,133,246, 79, 77,124, 67, 26, 73,115, 16,143,154,198, 85,172, +192,194,151,148, 15,131, 73,244, 60, 58,127, 3,132,153,197, 20,147,128,122, 83, +157,207, 26, 59, 46,186, 17,190,251, 52,115,113,220,153, 38,175,236,189, 67, 53, +118,103,182, 85,193,202, 10,114, 76,233,230, 89,228,102, 42,236, 55,167,128,173, +143,112,215, 24, 46,146, 29,118,112,205,226,120,176,140,182, 78,101,151,203, 19, +183,141,179,218, 3, 4,183,121, 40, 40, 18, 99,114,241,108,106,137,229,102, 69, + 0, 48,121, 21, 96,129, 20, 48,209, 78,204,238, 21,220,227,149,248,145,225,222, + 20,146,199,247, 50, 52,248,114, 91, 28, 97, 82, 45,227,120, 50,142,202, 50,214, + 43, 80,102,212, 16,133,255,234,105,204, 9,108,121, 91,147,217,117, 62,154, 75, + 3, 93,166, 23, 47,110,156, 27,241,244,124,205, 58,228,163,114,115,196,213,108, +206,107,255,254,253,146,138,218,128,157, 34,129,124,185,126,137,245,127,104,209, +121,228,139, 72,175, 72,136, 12, 79, 20,172,101,206,193,214, 92, 87, 88, 50,222, + 69, 21,181, 11,238,103,208,176,249, 9,124,212,233,127, 43, 58,116, 53,169, 97, + 39, 77,229,210,214, 49,179,141, 38, 94,135,218,109, 94, 40,142,238, 89,195, 1, + 82, 7, 72,105, 35,164,201,220, 14, 22,234,180, 38,192, 25,180, 53, 57,121, 36, +163, 17, 95,165, 0, 25,250,225, 13,255,203, 56,166,216,200, 5, 89, 48, 14,181, +160,199,206, 77,217,196,120, 25,247, 19,253,230,129, 33,124,140,141,226,113, 2, +125,184,170, 12,226,158, 2,181, 93,204, 25,161,153,177, 64, 3,173, 74,109,145, + 34, 76, 72, 89,144,166, 82, 7,180,244,177, 65, 50,101, 30, 78,148,114, 6, 81, + 3,177,145,248, 17,100,189,195,178, 46,196, 12, 7,184, 51, 4,151, 52,177, 10, +183, 17,159, 23,134,225,243,138, 91,220, 13,204,240, 9, 19, 7,194, 0,214,235, +104,118, 48,184,247,121, 23, 79,126,228,120,194,242,194, 85, 54,196,254,197, 94, +165,119,180, 99, 7, 66, 30,206, 13,157,215, 80,107, 73,121, 34, 23,190, 3, 33, + 29,247,195, 98, 65,101, 58,108, 48, 4,193,152,167,206,130,130,171,162, 33,212, +130,251,178,254,174,201,121,147,232,137,129,201,254,123,122,144, 21,170,118,142, + 58,173,164, 70, 56,119,237, 5,195,238,133,233,201, 21, 44, 9, 15, 55,231, 9, + 63,130,199, 47, 48,239,162,160,104,113,207, 9, 59,207, 72, 76, 19,100,157,158, + 90,120, 85, 32,151,254, 86,124,203, 11,244,145, 8,186, 8, 38, 71, 56, 87, 9, +113, 40, 90, 37,240, 17, 36,144,146,202,251,244,124,161, 27,203, 24, 76, 92, 21, +182,239,210,218, 22,190,157,159,183,146,178, 98,226,111,125, 38,192, 83,141, 21, +213, 70,153,197,166,245,113, 33,120, 8,243,108,187, 59, 23, 86, 39, 98,111,137, + 3,139,225,169,211,125,138,105, 28, 24,222, 50,233, 13, 20,151,235,213,149,176, +237, 39, 44,103, 92,111, 8, 26,188, 0, 31,137, 29, 46,127,146, 26, 15,255,196, +114,213, 78, 21,200,159,207,162,233,173, 53,234, 10,252,136, 68,233,165,201,134, + 7,132,240,245,227,123, 24, 20,254,158,103,116, 51,126,148,201,163,244,167, 48, +122, 51, 10,193,102, 68, 90, 88, 82,239,158, 83, 63,225, 74, 61, 34,195, 47,239, +169,218, 84,123,204,210,138,239, 98,166, 98,172,172, 42, 90, 91,176, 92,149, 15, + 63,214, 29,172,239, 21,168,218,176, 97,247,247,187, 75, 59, 42, 80,174,178,221, +169,186,231,174,176,111,143,165,126,222, 48, 54,121,184,101, 52, 16,190, 26,150, +188,241, 0,198,102,104,201, 84,170,129,199,251,104, 18,240,162,253,243,186,192, +202,124,178,198, 14, 52, 68, 92,195, 70, 88, 48,122, 64, 67,116, 95,249,254,120, +216,103,140,232,172, 86, 30, 25, 92, 47,222,234,233,202, 39, 32,208, 37,133,100, + 16,128, 43, 61,111, 56,114, 49, 76,188, 32, 19,223, 97,227, 19, 30, 59,195, 37, +119, 10,108, 79, 83,110,234,234, 51, 72, 11,123, 56, 48,139,219,201, 93, 69, 0, +171, 98, 96, 26,203, 63,212, 91,211,177, 82,150, 41, 77,237,131, 22,210,176, 95, + 67, 35,131, 83, 8,204,125, 21, 72,160,125, 94,157,153,214, 52,165, 33, 78, 40, +132,173,140, 14, 5, 6,185, 61, 55,123,110,203,251, 96,208,199, 45, 14, 99, 93, + 11,102, 74, 21,150, 96,194,222, 39, 84,120,185, 88,128, 3, 78, 95,109, 46,204, + 71, 89,174,109,237,148,176,193,203,241,120, 98,114,131, 2,176,221,104,132,107, + 47,244,229,144,217, 90, 22,244, 43,213,146, 50, 94,252,254, 97, 34, 6,133,138, +214,102,195,171, 46,209,159, 50, 56,152,116, 3, 58, 47,180,221,120,244,229, 65, +250,185,248, 11,246,105, 34,110,225, 51,142,100,107, 49, 85,106,144,225,179, 73, + 68,187,173, 16,144,248,118,123, 57,114,241,243,127, 0, 72,111, 71,191,246,213, +197,192,104,233,233, 59, 21, 61, 94, 76, 9,207, 30,189, 87,191, 48,156,225, 67, + 87,214,113,203,142,177,239,233, 48, 94, 86,175,198,194,207,223,144,172,142,170, +139,167,235,248, 88,112,194,241, 94, 58, 60, 50,169,127,185,187, 82,126, 37,126, +228, 92, 14,210, 82, 27,194,158,201, 88,241,244,127,223,176, 28,156,129,169, 64, +218,130,222,197, 37, 68,228,230,119,250,150, 33,135,240, 85,228,188, 13,245, 91, +131,204,222, 80, 12,103, 78, 13,211,144,138, 97,132,117,135,149,105,104, 70, 38, + 93,118,101, 98,230,250,210, 55, 83,102,126,255,184,176, 28, 5,117, 87,136, 63, + 54,236,126,126,197,189,191, 43,160, 56,107, 72, 59,193,153,226,104,173, 64,215, +105, 47,133,129,124,120, 51, 83,208, 53,156,231,148,202, 49,135,225, 0,102, 58, +192,194, 0,246, 60, 28,241,126, 67,204,157,196, 84,231,152,208,190,136, 70,133, +149,193,102, 22,126,216,236,238,220, 60,205,200,244,188, 78,250, 2, 76, 65,154, +205, 40,200, 94, 98,124, 99,165,199,250, 92,145,188, 49,247, 88,187,216,171, 63, +197,200, 88, 37, 71,107,234,110, 86,102, 76,222, 11, 27,119,109,128, 3,118, 16, + 3, 85,190,179, 6,241,234,178, 24,115,132,152,116,124, 67,118,248, 55,187,169, + 13, 24,119,175,149,222,247, 10,166, 53,123,165,154,102,122, 26,106, 25, 27,138, +186,253,210, 40,166,102, 1,103,137,187,240, 94,204,110,141, 52,146,239,201, 19, + 35, 88,213,176,106, 93,216,103,155,240,129,135,173, 2, 60,185,185,175,144, 9, +163,112, 30,116, 72, 82, 27, 67,193,240,160, 22, 77,101,116,227,248,117,122, 18, +113, 11, 71,140, 12, 99,169, 39,184,216, 50, 66, 27, 93,134, 4, 52,240,235,207, +202, 39, 55,155,135, 18,190,167,187,121, 85, 0,181, 27,173,203, 97,150,203, 96, +252,255, 67,255,226, 13,181,250,224, 36,165,193, 96, 47, 11,101,218,222,232,208, + 34,208,151, 68,212,130,225,152, 80,157,148, 2,108, 55, 62,145, 57,109, 21, 39, +112, 5, 59, 58,180, 23,249, 49, 90, 3,104,102, 64, 86, 48,165, 42, 73,110,207, +248,176, 54, 42,181, 82,219,249,131,127,237,121,138, 16, 97,133,238,125, 71, 69, +110, 55,194, 66,157, 92,240,100, 6, 37, 69, 55,227, 28,159,144,184,214,207,132, + 16, 90,135,197, 30,171, 62, 84, 42,165,167, 66,159, 4,220,101,192, 5,117,175, +225, 54,114,158,133, 9, 99,145,100,234, 63,129,253,132,210, 2, 97,206, 52, 83, +224, 72,224,211,147, 97, 76, 95, 88,247,104,192,138,204,208,243,245, 30,177,215, + 95,253,247, 22,178,248,109,152, 88,143,226,157, 96,144, 6,208,170, 80, 82,254, +128,157, 4, } ; // ../Source/Template/GB_AxB_dot2_meta.c: @@ -15298,7 +15299,7 @@ uint8_t GB_JITpackage_216 [712] = { GB_JITpackage_index_struct GB_JITpackage_index [217] = { - { 586666, 56504, GB_JITpackage_0 , "GraphBLAS.h" }, + { 586665, 56523, GB_JITpackage_0 , "GraphBLAS.h" }, { 12343, 2052, GB_JITpackage_1 , "GB_AxB_dot2_meta.c" }, { 8501, 2026, GB_JITpackage_2 , "GB_AxB_dot2_template.c" }, { 6513, 1649, GB_JITpackage_3 , "GB_AxB_dot3_meta.c" }, diff --git a/GraphBLAS/README.md b/GraphBLAS/README.md index 03b833f9a..296f882a6 100644 --- a/GraphBLAS/README.md +++ b/GraphBLAS/README.md @@ -4,7 +4,7 @@ SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2023, All Rights Reserved. SPDX-License-Identifier: Apache-2.0 -VERSION 8.0.2, June 16, 2023 +VERSION 8.2.0, Sept 8, 2023 SuiteSparse:GraphBLAS is a complete implementation of the GraphBLAS standard, which defines a set of sparse matrix operations on an extended algebra of @@ -199,8 +199,44 @@ McGinnis, kmcginnis@txamfoundation.com) for details. SuiteSparse:GraphBLAS, is copyrighted by Timothy A. Davis, (c) 2017-2023, All Rights Reserved. davis@tamu.edu. +----------------------------------------------------------------------------- + +## For distro maintainers (Linux, homebrew, spack, R, Octave, Trilinos, ...): + +Thanks for packaging SuiteSparse! Here are some suggestions: + + * GraphBLAS takes a long time to compile because it creates many fast + "FactoryKernels" at compile-time. If you want to reduce the compile + time and library size, enable the COMPACT mode, but keep the JIT + enabled. Then GraphBLAS will compile the kernels it needs at run-time, + via its JIT. Performance will be the same as the FactoryKernels once + the JIT kernels are compiled. User compiled kernels are placed in + ~/.SuiteSparse, by default. You do not need to distribute the source + for GraphBLAS to enable the JIT: just libgraphblas.so and GraphBLAS.h + is enough. + + * GraphBLAS needs OpenMP! It's fundamentally a parallel code so please + distribute it with OpenMP enabled. Performance will suffer + otherwise. + -------------------------------------------------------------------------------- +## References: + +To cite this package, please use the following: + + T. Davis, Algorithm 10xx: SuiteSparse:GraphBLAS: parallel graph + algorithms in the language of sparse linear algebra, ACM Trans on + Mathematical Software, just acceped, 2023. See the pdf in + https://github.com/DrTimothyAldenDavis/GraphBLAS/tree/stable/Doc . + https://doi.org/10.1145/3577195 + + T. Davis, Algorithm 1000: SuiteSparse:GraphBLAS: graph algorithms in + the language of sparse linear algebra, ACM Trans on Mathematical + Software, vol 45, no 4, Dec. 2019, Article No 44. + https://doi.org/10.1145/3322125. + +-------------------------------------------------------------------------------- ## Software Acknowledgements SuiteSparse:GraphBLAS relies on the following packages (details in the LICENSE diff --git a/GraphBLAS/Source/GB_jitifyer.c b/GraphBLAS/Source/GB_jitifyer.c index cd11db5a5..b956dc545 100644 --- a/GraphBLAS/Source/GB_jitifyer.c +++ b/GraphBLAS/Source/GB_jitifyer.c @@ -268,7 +268,11 @@ GrB_Info GB_jitifyer_init (void) size_t len = strlen (home) + 60 ; GB_MALLOC_STUFF (GB_jit_cache_path, len) ; snprintf (GB_jit_cache_path, GB_jit_cache_path_allocated, - "%s/%sSuiteSparse/GrB%d.%d.%d", home, dot, + "%s/%sSuiteSparse/GrB%d.%d.%d" + #if defined ( GBMATLAB ) && defined ( __APPLE__ ) + "_matlab" + #endif + , home, dot, GxB_IMPLEMENTATION_MAJOR, GxB_IMPLEMENTATION_MINOR, GxB_IMPLEMENTATION_SUB) ; diff --git a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f000bba0bbacf__plus_my_rdiv2.c b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f000bba0bbacf__plus_my_rdiv2.c index 586dc8aab..43ae206a4 100644 --- a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f000bba0bbacf__plus_my_rdiv2.c +++ b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f000bba0bbacf__plus_my_rdiv2.c @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // GB_jit__AxB_dot2__2c1f000bba0bbacf__plus_my_rdiv2.c //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS v8.0.1, Timothy A. Davis, (c) 2017-2023, +// SuiteSparse:GraphBLAS v8.2.0, Timothy A. Davis, (c) 2017-2023, // All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // The above copyright and license do not apply to any @@ -123,7 +123,7 @@ GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) ; GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) { (*hash) = 0x31aff911c5850713 ; - v [0] = 8 ; v [1] = 0 ; v [2] = 1 ; + v [0] = 8 ; v [1] = 2 ; v [2] = 0 ; defn [0] = NULL ; defn [1] = GB_my_rdiv2_USER_DEFN ; defn [2] = NULL ; diff --git a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f000bbb0bbbcd__plus_my_rdiv.c b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f000bbb0bbbcd__plus_my_rdiv.c index cfe68d972..0c53074c3 100644 --- a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f000bbb0bbbcd__plus_my_rdiv.c +++ b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f000bbb0bbbcd__plus_my_rdiv.c @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // GB_jit__AxB_dot2__2c1f000bbb0bbbcd__plus_my_rdiv.c //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS v8.0.1, Timothy A. Davis, (c) 2017-2023, +// SuiteSparse:GraphBLAS v8.2.0, Timothy A. Davis, (c) 2017-2023, // All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // The above copyright and license do not apply to any @@ -123,7 +123,7 @@ GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) ; GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) { (*hash) = 0x227f98d0b09e286f ; - v [0] = 8 ; v [1] = 0 ; v [2] = 1 ; + v [0] = 8 ; v [1] = 2 ; v [2] = 0 ; defn [0] = NULL ; defn [1] = GB_my_rdiv_USER_DEFN ; defn [2] = NULL ; diff --git a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f046bbb0bbbcd.c b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f046bbb0bbbcd.c index 19b240e59..fc9190598 100644 --- a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f046bbb0bbbcd.c +++ b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f046bbb0bbbcd.c @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // GB_jit__AxB_dot2__2c1f046bbb0bbbcd.c //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS v8.0.1, Timothy A. Davis, (c) 2017-2023, +// SuiteSparse:GraphBLAS v8.2.0, Timothy A. Davis, (c) 2017-2023, // All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // The above copyright and license do not apply to any @@ -105,7 +105,7 @@ GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) ; GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) { (*hash) = 0xdf8cbb0c0ac7ce22 ; - v [0] = 8 ; v [1] = 0 ; v [2] = 1 ; + v [0] = 8 ; v [1] = 2 ; v [2] = 0 ; defn [0] = NULL ; defn [1] = NULL ; defn [2] = NULL ; diff --git a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0baacf__plus_my_rdiv2.c b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0baacf__plus_my_rdiv2.c index 81a5b1f4f..f0a248370 100644 --- a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0baacf__plus_my_rdiv2.c +++ b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0baacf__plus_my_rdiv2.c @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // GB_jit__AxB_dot2__2c1f100bba0baacf__plus_my_rdiv2.c //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS v8.0.1, Timothy A. Davis, (c) 2017-2023, +// SuiteSparse:GraphBLAS v8.2.0, Timothy A. Davis, (c) 2017-2023, // All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // The above copyright and license do not apply to any @@ -123,7 +123,7 @@ GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) ; GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) { (*hash) = 0x422f36dae3aeca51 ; - v [0] = 8 ; v [1] = 0 ; v [2] = 1 ; + v [0] = 8 ; v [1] = 2 ; v [2] = 0 ; defn [0] = NULL ; defn [1] = GB_my_rdiv2_USER_DEFN ; defn [2] = NULL ; diff --git a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0babcd__plus_my_rdiv2.c b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0babcd__plus_my_rdiv2.c index 5908dc9d7..25fb5fa16 100644 --- a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0babcd__plus_my_rdiv2.c +++ b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0babcd__plus_my_rdiv2.c @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // GB_jit__AxB_dot2__2c1f100bba0babcd__plus_my_rdiv2.c //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS v8.0.1, Timothy A. Davis, (c) 2017-2023, +// SuiteSparse:GraphBLAS v8.2.0, Timothy A. Davis, (c) 2017-2023, // All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // The above copyright and license do not apply to any @@ -123,7 +123,7 @@ GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) ; GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) { (*hash) = 0x654ba0e0a34027e9 ; - v [0] = 8 ; v [1] = 0 ; v [2] = 1 ; + v [0] = 8 ; v [1] = 2 ; v [2] = 0 ; defn [0] = NULL ; defn [1] = GB_my_rdiv2_USER_DEFN ; defn [2] = NULL ; diff --git a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0babcf__plus_my_rdiv2.c b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0babcf__plus_my_rdiv2.c index 4ec7763ca..89d555f44 100644 --- a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0babcf__plus_my_rdiv2.c +++ b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0babcf__plus_my_rdiv2.c @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // GB_jit__AxB_dot2__2c1f100bba0babcf__plus_my_rdiv2.c //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS v8.0.1, Timothy A. Davis, (c) 2017-2023, +// SuiteSparse:GraphBLAS v8.2.0, Timothy A. Davis, (c) 2017-2023, // All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // The above copyright and license do not apply to any @@ -123,7 +123,7 @@ GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) ; GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) { (*hash) = 0x98afaa59c37fb8bb ; - v [0] = 8 ; v [1] = 0 ; v [2] = 1 ; + v [0] = 8 ; v [1] = 2 ; v [2] = 0 ; defn [0] = NULL ; defn [1] = GB_my_rdiv2_USER_DEFN ; defn [2] = NULL ; diff --git a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0bbac7__plus_my_rdiv2.c b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0bbac7__plus_my_rdiv2.c index ab438610e..6a6b99766 100644 --- a/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0bbac7__plus_my_rdiv2.c +++ b/GraphBLAS/Tcov/PreJIT/GB_jit__AxB_dot2__2c1f100bba0bbac7__plus_my_rdiv2.c @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // GB_jit__AxB_dot2__2c1f100bba0bbac7__plus_my_rdiv2.c //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS v8.0.1, Timothy A. Davis, (c) 2017-2023, +// SuiteSparse:GraphBLAS v8.2.0, Timothy A. Davis, (c) 2017-2023, // All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // The above copyright and license do not apply to any @@ -123,7 +123,7 @@ GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) ; GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) { (*hash) = 0xfaa3c6cd7f90ec16 ; - v [0] = 8 ; v [1] = 0 ; v [2] = 1 ; + v [0] = 8 ; v [1] = 2 ; v [2] = 0 ; defn [0] = NULL ; defn [1] = GB_my_rdiv2_USER_DEFN ; defn [2] = NULL ; diff --git a/GraphBLAS/Tcov/PreJIT/GB_jit__user_op__0__my_rdiv.c b/GraphBLAS/Tcov/PreJIT/GB_jit__user_op__0__my_rdiv.c index faa0d8d48..1b8f5f796 100644 --- a/GraphBLAS/Tcov/PreJIT/GB_jit__user_op__0__my_rdiv.c +++ b/GraphBLAS/Tcov/PreJIT/GB_jit__user_op__0__my_rdiv.c @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // GB_jit__user_op__0__my_rdiv.c //------------------------------------------------------------------------------ -// SuiteSparse:GraphBLAS v8.0.1, Timothy A. Davis, (c) 2017-2023, +// SuiteSparse:GraphBLAS v8.2.0, Timothy A. Davis, (c) 2017-2023, // All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // The above copyright and license do not apply to any @@ -37,7 +37,7 @@ GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) ; GB_JIT_GLOBAL GB_JIT_QUERY_PROTO (GB_jit_query) { (*hash) = 0xa98ff14e387744fe ; - v [0] = 8 ; v [1] = 0 ; v [2] = 1 ; + v [0] = 8 ; v [1] = 2 ; v [2] = 0 ; defn [0] = GB_my_rdiv_USER_DEFN ; defn [1] = NULL ; defn [2] = NULL ; diff --git a/GraphBLAS/Tcov/log_May18.txt b/GraphBLAS/Tcov/log_May18.txt deleted file mode 100644 index 73e6035f7..000000000 --- a/GraphBLAS/Tcov/log_May18.txt +++ /dev/null @@ -1,216 +0,0 @@ - ----------------------------------------------- [malloc] [cover] -18-May 11:06:11 test268 0.1 sec 167: 21889 of 22136 1.1% 2172.67/s -18-May 11:06:13 test145 1.8 sec 338: 21551 of 22136 2.6% 189.72/s -18-May 11:06:13 test145 0.0 sec 3: 21548 of 22136 2.7% 61.60/s -18-May 11:06:13 test145 0.0 sec 26: 21522 of 22136 2.8% 1138.55/s -18-May 11:06:13 test145 0.0 sec 4: 21518 of 22136 2.8% 218.53/s -18-May 11:06:15 test145 1.4 sec 52: 21466 of 22136 3.0% 37.73/s -18-May 11:06:15 test145 0.0 sec 5: 21461 of 22136 3.0% 382.09/s -18-May 11:06:15 test240 0.2 sec 69: 21392 of 22136 3.4% 276.26/s -18-May 11:06:15 test240 0.2 sec 1: 21391 of 22136 3.4% 5.61/s -18-May 11:06:15 test237 0.1 sec 37: 21354 of 22136 3.5% 442.55/s -18-May 11:06:17 test237 1.7 sec 27: 21327 of 22136 3.7% 16.36/s -18-May 11:06:17 test237 0.0 sec 19: 21306 of 22136 3.7% 457.65/s -18-May 11:06:17 test237 0.0 sec 6: 21300 of 22136 3.8% 533.29/s -18-May 11:06:17 test237 0.0 sec 4: 21296 of 22136 3.8% 109.51/s -18-May 11:06:18 test267 0.7 sec 33: 21263 of 22136 3.9% 47.59/s -18-May 11:06:18 test267 0.0 sec 1: 21262 of 22136 3.9% 1647.45/s -18-May 11:06:18 test266 0.0 sec 4: 21258 of 22136 4.0% 99.88/s -18-May 11:06:18 test265 0.4 sec 105: 21153 of 22136 4.4% 252.14/s -18-May 11:06:18 test264 0.0 sec 194: 20959 of 22136 5.3% 5285.96/s -18-May 11:06:19 test263 0.8 sec 28: 20931 of 22136 5.4% 36.57/s -18-May 11:06:19 test262 0.0 sec 89: 20842 of 22136 5.8% 2325.76/s -18-May 11:06:19 test261 0.0 sec 29: 20813 of 22136 6.0% 848.18/s -18-May 11:06:19 test260 0.0 sec 3: 20810 of 22136 6.0% 95.57/s -18-May 11:06:22 test259 2.2 sec 4: 20806 of 22136 6.0% 1.78/s -18-May 11:06:22 test258 0.2 sec 26: 20780 of 22136 6.1% 111.04/s -18-May 11:06:22 test257 0.2 sec 65: 20715 of 22136 6.4% 310.72/s -18-May 11:06:22 test255 0.0 sec 8: 20707 of 22136 6.5% 217.44/s -18-May 11:06:22 test254 0.1 sec 29: 20678 of 22136 6.6% 358.27/s -18-May 11:06:26 test254 4.3 sec 20: 20658 of 22136 6.7% 4.67/s -18-May 11:06:27 test254 0.1 sec 1: 20657 of 22136 6.7% 11.96/s -18-May 11:06:27 test253 0.2 sec 27: 20630 of 22136 6.8% 157.53/s -18-May 11:06:27 test252 0.0 sec 11: 20619 of 22136 6.9% 250.05/s -18-May 11:07:21 test251 54.5 sec 494: 20125 of 22136 9.1% 9.06/s -18-May 11:09:39 test251 138.1 sec 12: 20113 of 22136 9.1% 0.09/s -18-May 11:12:10 test251 151.1 sec 78: 20035 of 22136 9.5% 0.52/s -18-May 11:12:14 test250 3.1 sec 170: 19865 of 22136 10.3% 55.20/s -18-May 11:12:17 test250 3.6 sec 13: 19852 of 22136 10.3% 3.64/s -18-May 11:12:18 test249 0.9 sec 29: 19823 of 22136 10.4% 31.54/s -18-May 11:12:18 test247 0.0 sec 24: 19799 of 22136 10.6% 591.48/s -18-May 11:12:29 test246 11.0 sec 74: 19725 of 22136 10.9% 6.73/s -18-May 11:12:46 test01 16.9 sec 1460: 18265 of 22136 17.5% 86.56/s -18-May 11:12:57 test01 11.2 sec 22: 18243 of 22136 17.6% 1.96/s -18-May 11:12:58 test245 0.9 sec 34: 18209 of 22136 17.7% 38.01/s -18-May 11:12:58 test245 0.0 sec 8: 18201 of 22136 17.8% 208.55/s -18-May 11:12:58 test199 0.0 sec 1: 18200 of 22136 17.8% 208.68/s -18-May 11:12:58 test83 0.0 sec 15: 18185 of 22136 17.8% 369.55/s -18-May 11:12:58 test210 0.0 sec 9: 18176 of 22136 17.9% 3282.28/s -18-May 11:12:59 test165 0.0 sec 1: 18175 of 22136 17.9% 187.86/s -18-May 11:12:59 test219 0.0 sec 9: 18166 of 22136 17.9% 217.96/s -18-May 11:12:59 test219 0.2 sec 3: 18163 of 22136 17.9% 13.21/s -18-May 11:12:59 test241 0.1 sec 10: 18153 of 22136 18.0% 131.91/s -18-May 11:12:59 test220 0.1 sec 15: 18138 of 22136 18.1% 221.23/s -18-May 11:12:59 test211 0.0 sec 15: 18123 of 22136 18.1% 420.02/s -18-May 11:12:59 test202 0.1 sec 83: 18040 of 22136 18.5% 1269.85/s -18-May 11:12:59 test202 0.0 sec 1: 18039 of 22136 18.5% 28.57/s -18-May 11:13:02 test152 2.9 sec 827: 17212 of 22136 22.2% 281.60/s -18-May 11:13:06 test152 3.7 sec 13: 17199 of 22136 22.3% 3.51/s -18-May 11:14:19 test152 73.6 sec 245: 16954 of 22136 23.4% 3.33/s -18-May 11:14:20 test222 0.1 sec 18: 16936 of 22136 23.5% 252.55/s -18-May 11:14:20 test256 0.2 sec 50: 16886 of 22136 23.7% 231.08/s -18-May 11:14:22 test186 1.9 sec 43: 16843 of 22136 23.9% 22.97/s -18-May 11:14:22 test186 0.3 sec 1: 16842 of 22136 23.9% 3.21/s -18-May 11:14:22 test186(0) 0.3 sec 5: 16837 of 22136 23.9% 17.65/s -18-May 11:14:31 test150 8.9 sec 39: 16798 of 22136 24.1% 4.38/s -18-May 11:14:31 test150 0.1 sec 4: 16794 of 22136 24.1% 28.48/s -18-May 11:14:31 test239 0.1 sec 15: 16779 of 22136 24.2% 240.12/s -18-May 11:14:32 test239 0.8 sec 2: 16777 of 22136 24.2% 2.66/s -18-May 11:14:32 test235 0.0 sec 4: 16773 of 22136 24.2% 105.83/s -18-May 11:14:32 test226 0.0 sec 8: 16765 of 22136 24.3% 754.01/s -18-May 11:14:32 test223 0.0 sec 2: 16763 of 22136 24.3% 103.53/s -18-May 11:14:32 test204 0.1 sec 14: 16749 of 22136 24.3% 241.92/s -18-May 11:14:32 test203 0.0 sec 19: 16730 of 22136 24.4% 622.58/s -18-May 11:14:32 test183 0.0 sec 12: 16718 of 22136 24.5% 474.85/s -18-May 11:14:33 test179 0.1 sec 15: 16703 of 22136 24.5% 225.69/s -18-May 11:14:34 test179 1.7 sec 4: 16699 of 22136 24.6% 2.36/s -18-May 11:14:34 test174 0.1 sec 10: 16689 of 22136 24.6% 153.75/s -18-May 11:14:34 test155 0.1 sec 44: 16645 of 22136 24.8% 522.44/s -18-May 11:14:35 test156 0.5 sec 227: 16418 of 22136 25.8% 495.23/s -18-May 11:15:19 test156 43.9 sec 37: 16381 of 22136 26.0% 0.84/s -18-May 11:15:19 test136 0.1 sec 57: 16324 of 22136 26.3% 559.48/s -18-May 11:15:20 test02 0.5 sec 22: 16302 of 22136 26.4% 42.24/s -18-May 11:15:20 test109 0.3 sec 10: 16292 of 22136 26.4% 30.07/s -18-May 11:15:20 test109 0.0 sec 4: 16288 of 22136 26.4% 1379.31/s -18-May 11:15:20 test109 0.3 sec 8: 16280 of 22136 26.5% 29.81/s -18-May 11:15:20 test04 0.1 sec 15: 16265 of 22136 26.5% 231.46/s -18-May 11:15:20 test207 0.0 sec 2: 16263 of 22136 26.5% 551.72/s -18-May 11:15:20 test221 0.0 sec 2: 16261 of 22136 26.5% 265.36/s -18-May 11:15:20 test162 0.0 sec 5: 16256 of 22136 26.6% 127.86/s -18-May 11:16:05 test159 44.4 sec 80: 16176 of 22136 26.9% 1.80/s -18-May 11:16:06 test159 1.7 sec 55: 16121 of 22136 27.2% 31.90/s -18-May 11:16:07 test09 0.0 sec 5: 16116 of 22136 27.2% 613.12/s -18-May 11:16:07 test132 0.1 sec 8: 16108 of 22136 27.2% 137.29/s -18-May 11:16:44 test141 37.4 sec 476: 15632 of 22136 29.4% 12.73/s -18-May 11:16:53 test141 9.1 sec 77: 15555 of 22136 29.7% 8.47/s -18-May 11:21:14 test141 260.4 sec 2: 15553 of 22136 29.7% 0.01/s -18-May 11:21:15 testc2(1,1) 1.1 sec 20: 15533 of 22136 29.8% 17.73/s -18-May 11:21:21 testc2(1,1) 5.3 sec 4: 15529 of 22136 29.8% 0.76/s -18-May 11:21:21 test214 0.0 sec 3: 15526 of 22136 29.9% 398.62/s -18-May 11:21:21 test213 0.0 sec 2: 15524 of 22136 29.9% 174.67/s -18-May 11:21:22 test206 1.6 sec 219: 15305 of 22136 30.9% 135.75/s -18-May 11:21:34 test206 11.3 sec 8: 15297 of 22136 30.9% 0.70/s -18-May 11:21:34 test212 0.0 sec 9: 15288 of 22136 30.9% 372.32/s -18-May 11:21:34 test212 0.2 sec 2: 15286 of 22136 30.9% 11.18/s -18-May 11:21:34 test128 0.3 sec 49: 15237 of 22136 31.2% 191.06/s -18-May 11:21:34 test82 0.1 sec 18: 15219 of 22136 31.2% 247.33/s -18-May 11:21:37 test229 2.4 sec 9: 15210 of 22136 31.3% 3.70/s -18-May 11:21:38 test229 0.8 sec 1: 15209 of 22136 31.3% 1.19/s -18-May 11:21:38 test144 0.4 sec 2: 15207 of 22136 31.3% 4.48/s -18-May 11:22:41 test14 63.3 sec 664: 14543 of 22136 34.3% 10.48/s -18-May 11:23:05 test14 23.8 sec 2: 14541 of 22136 34.3% 0.08/s -18-May 11:26:28 test14 202.3 sec 117: 14424 of 22136 34.8% 0.58/s -18-May 11:26:34 test180 6.1 sec 134: 14290 of 22136 35.4% 22.08/s -18-May 11:26:37 test236 3.0 sec 74: 14216 of 22136 35.8% 24.96/s -18-May 11:26:39 test232 2.5 sec 20: 14196 of 22136 35.9% 8.11/s -18-May 11:26:54 test228 14.7 sec 28: 14168 of 22136 36.0% 1.90/s -18-May 11:28:26 test154 91.4 sec 1502: 12666 of 22136 42.8% 16.43/s -18-May 11:33:29 test154 303.3 sec 2: 12664 of 22136 42.8% 0.01/s -18-May 11:33:39 test238 9.9 sec 50: 12614 of 22136 43.0% 5.03/s -18-May 11:34:40 test238 61.2 sec 2: 12612 of 22136 43.0% 0.03/s -18-May 11:36:00 test151b 80.3 sec 173: 12439 of 22136 43.8% 2.15/s -18-May 11:37:43 test151b 102.0 sec 1: 12438 of 22136 43.8% 0.01/s -18-May 11:45:58 test151b 495.1 sec 1: 12437 of 22136 43.8% 0.00/s -18-May 11:46:05 test184 4.0 sec 38: 12399 of 22136 44.0% 9.59/s -18-May 11:46:22 test191 16.9 sec 21: 12378 of 22136 44.1% 1.24/s -18-May 11:46:48 test191 26.0 sec 3: 12375 of 22136 44.1% 0.12/s -18-May 11:53:42 test188 413.4 sec 183: 12192 of 22136 44.9% 0.44/s -18-May 11:55:34 test188 112.1 sec 3: 12189 of 22136 44.9% 0.03/s -18-May 11:55:38 test224 3.7 sec 24: 12165 of 22136 45.0% 6.40/s -18-May 11:55:40 test196 2.2 sec 11: 12154 of 22136 45.1% 5.08/s -18-May 11:55:45 test209 4.4 sec 20: 12134 of 22136 45.2% 4.58/s -18-May 11:55:58 test104 12.8 sec 40: 12094 of 22136 45.4% 3.12/s -18-May 11:56:06 test189 8.7 sec 1: 12093 of 22136 45.4% 0.11/s -18-May 11:57:01 test194 54.3 sec 5: 12088 of 22136 45.4% 0.09/s -18-May 11:57:10 test76 9.6 sec 15: 12073 of 22136 45.5% 1.56/s -18-May 11:57:41 test244 30.9 sec 17: 12056 of 22136 45.5% 0.55/s -[malloc debugging turned off] -18-May 11:57:41 test201 0.0 sec 3: 12053 of 22136 45.6% 590.32/s -18-May 11:57:41 test225 0.1 sec 4: 12049 of 22136 45.6% 30.75/s -18-May 11:57:41 test176 0.1 sec 5: 12044 of 22136 45.6% 74.30/s -18-May 11:57:41 test208 0.0 sec 5: 12039 of 22136 45.6% 308.91/s -18-May 11:57:41 test216 0.0 sec 3: 12036 of 22136 45.6% 63.36/s -18-May 11:58:46 test142 64.3 sec 630: 11406 of 22136 48.5% 9.80/s -18-May 11:59:04 test142 17.8 sec 2: 11404 of 22136 48.5% 0.11/s -18-May 12:01:59 test142 175.4 sec 2: 11402 of 22136 48.5% 0.01/s -18-May 12:02:17 test142 17.3 sec 2: 11400 of 22136 48.5% 0.12/s -18-May 12:02:17 test137 0.3 sec 3: 11397 of 22136 48.5% 11.75/s -18-May 12:02:17 test137 0.0 sec 2: 11395 of 22136 48.5% 278.55/s -18-May 12:02:17 test139 0.3 sec 2: 11393 of 22136 48.5% 6.52/s -18-May 12:02:18 test172 0.1 sec 3: 11390 of 22136 48.5% 48.08/s -18-May 12:02:18 test148 0.5 sec 4: 11386 of 22136 48.6% 8.08/s -18-May 12:02:19 test157 0.4 sec 12: 11374 of 22136 48.6% 28.64/s -18-May 12:02:19 test182 0.7 sec 8: 11366 of 22136 48.7% 11.61/s -18-May 12:02:20 test108 0.4 sec 2: 11364 of 22136 48.7% 4.72/s -18-May 12:02:20 test108 0.3 sec 1: 11363 of 22136 48.7% 3.51/s -18-May 12:02:21 test130 0.6 sec 26: 11337 of 22136 48.8% 45.04/s -18-May 12:02:21 test124 0.1 sec 3: 11334 of 22136 48.8% 28.02/s -18-May 12:02:21 test138 0.1 sec 1: 11333 of 22136 48.8% 18.94/s -18-May 12:02:24 test227 3.5 sec 27: 11306 of 22136 48.9% 7.68/s -18-May 12:02:44 test125 20.1 sec 630: 10676 of 22136 51.8% 31.33/s -18-May 12:04:36 test234 111.6 sec 396: 10280 of 22136 53.6% 3.55/s -18-May 12:07:34 test234 177.4 sec 2: 10278 of 22136 53.6% 0.01/s -18-May 12:08:03 test242 29.2 sec 77: 10201 of 22136 53.9% 2.63/s -18-May 12:08:04 test173 1.1 sec 11: 10190 of 22136 54.0% 10.47/s -18-May 12:08:06 test200 2.0 sec 10: 10180 of 22136 54.0% 5.00/s -18-May 12:08:06 test197 0.1 sec 1: 10179 of 22136 54.0% 8.89/s -18-May 12:08:07 test84 0.9 sec 18: 10161 of 22136 54.1% 21.06/s -18-May 12:08:15 test19b 8.0 sec 58: 10103 of 22136 54.4% 7.28/s -18-May 12:08:19 test19b 3.8 sec 5: 10098 of 22136 54.4% 1.31/s -18-May 12:08:19 test133 0.3 sec 2: 10096 of 22136 54.4% 7.69/s -18-May 12:08:22 test80 3.4 sec 12: 10084 of 22136 54.4% 3.56/s -18-May 12:08:35 test151 12.6 sec 73: 10011 of 22136 54.8% 5.79/s -18-May 12:09:33 test151 58.1 sec 2: 10009 of 22136 54.8% 0.03/s -18-May 12:10:37 test23 63.4 sec 146: 9863 of 22136 55.4% 2.30/s -18-May 12:11:21 test23 44.6 sec 2: 9861 of 22136 55.5% 0.04/s -18-May 12:11:23 test135 1.3 sec 7: 9854 of 22136 55.5% 5.27/s -18-May 12:12:22 test160 59.3 sec 23: 9831 of 22136 55.6% 0.39/s -18-May 12:13:20 test160 57.8 sec 1: 9830 of 22136 55.6% 0.02/s -18-May 12:13:23 test54 2.9 sec 20: 9810 of 22136 55.7% 6.95/s -18-May 12:13:23 test129 0.7 sec 4: 9806 of 22136 55.7% 5.97/s -18-May 12:13:24 test69 1.2 sec 3: 9803 of 22136 55.7% 2.59/s -18-May 12:14:26 test230 61.7 sec 114: 9689 of 22136 56.2% 1.85/s -18-May 13:12:44 test74 3497.5 sec 6588: 3101 of 22136 86.0% 1.88/s -18-May 13:36:03 test74 1398.9 sec 7: 3094 of 22136 86.0% 0.01/s -18-May 13:40:45 test127 282.0 sec 1633: 1461 of 22136 93.4% 5.79/s -18-May 13:50:08 test127 562.8 sec 18: 1443 of 22136 93.5% 0.03/s -18-May 14:51:21 test127 3673.1 sec 2: 1441 of 22136 93.5% 0.00/s -18-May 14:52:29 test19 2.1 sec 12: 1429 of 22136 93.5% 5.76/s -18-May 14:52:31 test11 2.5 sec 3: 1426 of 22136 93.6% 1.22/s -18-May 14:52:34 test215 2.4 sec 1: 1425 of 22136 93.6% 0.42/s -18-May 14:52:44 test193 10.7 sec 5: 1420 of 22136 93.6% 0.47/s -18-May 14:54:49 test195 124.1 sec 39: 1381 of 22136 93.8% 0.31/s -18-May 14:55:09 test243 20.0 sec 7: 1374 of 22136 93.8% 0.35/s -18-May 14:55:20 test29 11.8 sec 1: 1373 of 22136 93.8% 0.08/s -18-May 14:55:33 test29 12.3 sec 2: 1371 of 22136 93.8% 0.16/s -18-May 14:55:53 testc2(0,0) 20.5 sec 2: 1369 of 22136 93.8% 0.10/s -18-May 14:55:55 testc2(0,0) 1.3 sec 6: 1363 of 22136 93.8% 4.77/s -18-May 14:55:56 testc2(0,0) 1.6 sec 1: 1362 of 22136 93.8% 0.64/s -18-May 14:55:57 testc4(0) 0.5 sec 4: 1358 of 22136 93.9% 8.17/s -18-May 14:56:11 testc7(0) 14.5 sec 1: 1357 of 22136 93.9% 0.07/s -18-May 14:56:16 testcc(1) 4.5 sec 1: 1356 of 22136 93.9% 0.22/s -18-May 14:56:23 test187 7.2 sec 3: 1353 of 22136 93.9% 0.42/s -18-May 14:56:28 test192 5.0 sec 1: 1352 of 22136 93.9% 0.20/s -18-May 14:56:39 test181 11.0 sec 10: 1342 of 22136 93.9% 0.91/s -18-May 14:58:02 test185 82.9 sec 6: 1336 of 22136 94.0% 0.07/s -18-May 14:58:39 test53 37.0 sec 4: 1332 of 22136 94.0% 0.11/s -18-May 14:59:18 test17 38.5 sec 28: 1304 of 22136 94.1% 0.73/s -18-May 15:04:35 test231 317.5 sec 162: 1142 of 22136 94.8% 0.51/s -18-May 15:52:12 test10 2856.6 sec 946: 196 of 22136 99.1% 0.33/s -18-May 15:56:49 test75b 252.2 sec 151: 45 of 22136 99.8% 0.60/s -18-May 15:57:59 test21b 68.9 sec 26: 19 of 22136 99.9% 0.38/s -18-May 15:58:41 testca(1) 41.5 sec 5: 14 of 22136 99.9% 0.12/s -18-May 16:00:04 test81 83.2 sec 1: 13 of 22136 99.9% 0.01/s -18-May 16:04:19 test18 255.4 sec 13: all 22136 full 100% 0.05/s -[malloc debugging turned back on] diff --git a/GraphBLAS/Tcov/log_May28.txt b/GraphBLAS/Tcov/log_May28.txt deleted file mode 100644 index a6e5d60fe..000000000 --- a/GraphBLAS/Tcov/log_May28.txt +++ /dev/null @@ -1,217 +0,0 @@ - ----------------------------------------------- [malloc] [cover] -27-May 21:59:34 test272 0.1 sec 113: 21943 of 22139 0.9% 1626.13/s -27-May 21:59:34 test268 0.1 sec 131: 21812 of 22139 1.5% 2000.79/s -27-May 21:59:37 test145 2.5 sec 293: 21519 of 22139 2.8% 115.49/s -27-May 21:59:37 test145 0.1 sec 3: 21516 of 22139 2.8% 26.55/s -27-May 21:59:37 test145 0.0 sec 26: 21490 of 22139 2.9% 556.61/s -27-May 21:59:37 test145 0.0 sec 4: 21486 of 22139 2.9% 98.68/s -27-May 21:59:39 test145 2.3 sec 52: 21434 of 22139 3.2% 22.26/s -27-May 21:59:39 test145 0.0 sec 5: 21429 of 22139 3.2% 168.30/s -27-May 21:59:40 test240 0.4 sec 66: 21363 of 22139 3.5% 157.45/s -27-May 21:59:40 test240 0.3 sec 1: 21362 of 22139 3.5% 3.26/s -27-May 21:59:40 test237 0.2 sec 37: 21325 of 22139 3.7% 219.90/s -27-May 21:59:42 test237 2.0 sec 27: 21298 of 22139 3.8% 13.67/s -27-May 21:59:43 test237 0.1 sec 19: 21279 of 22139 3.9% 138.18/s -27-May 21:59:43 test237 0.0 sec 6: 21273 of 22139 3.9% 301.22/s -27-May 21:59:43 test237 0.1 sec 4: 21269 of 22139 3.9% 37.58/s -27-May 21:59:44 test267 1.0 sec 35: 21234 of 22139 4.1% 34.89/s -27-May 21:59:44 test267 0.0 sec 1: 21233 of 22139 4.1% 633.71/s -27-May 21:59:44 test266 0.0 sec 4: 21229 of 22139 4.1% 241.02/s -27-May 21:59:44 test265 0.6 sec 92: 21137 of 22139 4.5% 165.80/s -27-May 21:59:44 test264 0.0 sec 191: 20946 of 22139 5.4% 21405.36/s -27-May 21:59:46 test263 1.1 sec 28: 20918 of 22139 5.5% 24.71/s -27-May 21:59:46 test262 0.0 sec 88: 20830 of 22139 5.9% 6593.74/s -27-May 21:59:46 test261 0.0 sec 29: 20801 of 22139 6.0% 3695.21/s -27-May 21:59:46 test260 0.0 sec 3: 20798 of 22139 6.1% 352.90/s -27-May 21:59:49 test259 3.5 sec 4: 20794 of 22139 6.1% 1.15/s -27-May 21:59:50 test258 0.3 sec 22: 20772 of 22139 6.2% 64.91/s -27-May 21:59:50 test257 0.3 sec 65: 20707 of 22139 6.5% 210.89/s -27-May 21:59:50 test255 0.0 sec 8: 20699 of 22139 6.5% 1068.95/s -27-May 21:59:50 test254 0.2 sec 29: 20670 of 22139 6.6% 149.32/s -27-May 21:59:57 test254 7.3 sec 20: 20650 of 22139 6.7% 2.75/s -27-May 21:59:58 test254 0.3 sec 1: 20649 of 22139 6.7% 3.26/s -27-May 21:59:58 test253 0.4 sec 27: 20622 of 22139 6.9% 74.30/s -27-May 21:59:58 test252 0.0 sec 11: 20611 of 22139 6.9% 1142.50/s -27-May 22:01:36 test251 97.3 sec 494: 20117 of 22139 9.1% 5.08/s -27-May 22:04:22 test251 166.7 sec 12: 20105 of 22139 9.2% 0.07/s -27-May 22:06:28 test251 126.0 sec 78: 20027 of 22139 9.5% 0.62/s -27-May 22:06:31 test250 2.6 sec 170: 19857 of 22139 10.3% 65.27/s -27-May 22:06:34 test250 3.1 sec 13: 19844 of 22139 10.4% 4.18/s -27-May 22:06:35 test249 0.9 sec 29: 19815 of 22139 10.5% 31.05/s -27-May 22:06:35 test247 0.0 sec 25: 19790 of 22139 10.6% 740.54/s -27-May 22:06:47 test246 11.3 sec 73: 19717 of 22139 10.9% 6.48/s -27-May 22:07:01 test01 14.2 sec 1452: 18265 of 22139 17.5% 102.03/s -27-May 22:07:09 test01 8.7 sec 22: 18243 of 22139 17.6% 2.53/s -27-May 22:07:10 test245 0.8 sec 34: 18209 of 22139 17.8% 42.05/s -27-May 22:07:10 test245 0.0 sec 8: 18201 of 22139 17.8% 168.96/s -27-May 22:07:10 test199 0.0 sec 1: 18200 of 22139 17.8% 199.56/s -27-May 22:07:10 test83 0.0 sec 15: 18185 of 22139 17.9% 2372.29/s -27-May 22:07:10 test210 0.0 sec 9: 18176 of 22139 17.9% 2234.36/s -27-May 22:07:10 test165 0.0 sec 1: 18175 of 22139 17.9% 206.78/s -27-May 22:07:10 test219 0.0 sec 9: 18166 of 22139 17.9% 1219.68/s -27-May 22:07:11 test219 0.2 sec 3: 18163 of 22139 18.0% 18.34/s -27-May 22:07:11 test241 0.1 sec 10: 18153 of 22139 18.0% 100.01/s -27-May 22:07:11 test220 0.0 sec 15: 18138 of 22139 18.1% 396.00/s -27-May 22:07:11 test211 0.0 sec 15: 18123 of 22139 18.1% 419.51/s -27-May 22:07:11 test202 0.0 sec 83: 18040 of 22139 18.5% 1860.32/s -27-May 22:07:11 test202 0.0 sec 1: 18039 of 22139 18.5% 20.64/s -27-May 22:07:14 test152 2.8 sec 827: 17212 of 22139 22.3% 298.94/s -27-May 22:07:17 test152 3.7 sec 13: 17199 of 22139 22.3% 3.51/s -27-May 22:08:23 test152 65.2 sec 245: 16954 of 22139 23.4% 3.76/s -27-May 22:08:23 test222 0.0 sec 18: 16936 of 22139 23.5% 830.60/s -27-May 22:08:23 test256 0.2 sec 50: 16886 of 22139 23.7% 288.02/s -27-May 22:08:24 test186 1.3 sec 43: 16843 of 22139 23.9% 32.29/s -27-May 22:08:25 test186 0.3 sec 1: 16842 of 22139 23.9% 3.28/s -27-May 22:08:25 test186(0) 0.3 sec 5: 16837 of 22139 23.9% 18.37/s -27-May 22:08:30 test150 5.4 sec 39: 16798 of 22139 24.1% 7.24/s -27-May 22:08:31 test150 0.2 sec 4: 16794 of 22139 24.1% 23.30/s -27-May 22:08:31 test239 0.0 sec 15: 16779 of 22139 24.2% 422.25/s -27-May 22:08:31 test239 0.5 sec 2: 16777 of 22139 24.2% 4.21/s -27-May 22:08:31 test235 0.0 sec 4: 16773 of 22139 24.2% 89.02/s -27-May 22:08:31 test226 0.0 sec 8: 16765 of 22139 24.3% 605.79/s -27-May 22:08:31 test223 0.0 sec 2: 16763 of 22139 24.3% 91.67/s -27-May 22:08:31 test204 0.0 sec 14: 16749 of 22139 24.3% 1439.74/s -27-May 22:08:31 test203 0.0 sec 19: 16730 of 22139 24.4% 2960.89/s -27-May 22:08:31 test183 0.0 sec 12: 16718 of 22139 24.5% 442.22/s -27-May 22:08:31 test179 0.0 sec 15: 16703 of 22139 24.6% 333.64/s -27-May 22:08:33 test179 1.5 sec 4: 16699 of 22139 24.6% 2.59/s -27-May 22:08:33 test174 0.1 sec 10: 16689 of 22139 24.6% 146.37/s -27-May 22:08:33 test155 0.1 sec 44: 16645 of 22139 24.8% 769.26/s -27-May 22:08:33 test156 0.4 sec 227: 16418 of 22139 25.8% 527.08/s -27-May 22:09:13 test156 39.6 sec 37: 16381 of 22139 26.0% 0.93/s -27-May 22:09:13 test136 0.1 sec 57: 16324 of 22139 26.3% 977.79/s -27-May 22:09:14 test02 0.5 sec 22: 16302 of 22139 26.4% 48.62/s -27-May 22:09:14 test109 0.2 sec 10: 16292 of 22139 26.4% 56.93/s -27-May 22:09:14 test109 0.0 sec 4: 16288 of 22139 26.4% 1310.62/s -27-May 22:09:14 test109 0.2 sec 8: 16280 of 22139 26.5% 46.42/s -27-May 22:09:14 test04 0.0 sec 15: 16265 of 22139 26.5% 304.42/s -27-May 22:09:14 test207 0.0 sec 2: 16263 of 22139 26.5% 543.48/s -27-May 22:09:14 test221 0.0 sec 2: 16261 of 22139 26.6% 236.83/s -27-May 22:09:14 test162 0.0 sec 5: 16256 of 22139 26.6% 106.68/s -27-May 22:09:44 test159 29.5 sec 80: 16176 of 22139 26.9% 2.72/s -27-May 22:09:46 test159 1.9 sec 55: 16121 of 22139 27.2% 28.71/s -27-May 22:09:46 test09 0.0 sec 5: 16116 of 22139 27.2% 573.46/s -27-May 22:09:46 test132 0.0 sec 8: 16108 of 22139 27.2% 391.39/s -27-May 22:10:19 test141 33.8 sec 476: 15632 of 22139 29.4% 14.10/s -27-May 22:10:30 test141 10.1 sec 77: 15555 of 22139 29.7% 7.66/s -27-May 22:14:09 test141 219.3 sec 2: 15553 of 22139 29.7% 0.01/s -27-May 22:14:10 testc2(1,1) 0.9 sec 20: 15533 of 22139 29.8% 22.91/s -27-May 22:14:15 testc2(1,1) 4.4 sec 4: 15529 of 22139 29.9% 0.91/s -27-May 22:14:15 test214 0.0 sec 3: 15526 of 22139 29.9% 257.05/s -27-May 22:14:15 test213 0.0 sec 2: 15524 of 22139 29.9% 152.36/s -27-May 22:14:16 test206 1.4 sec 219: 15305 of 22139 30.9% 153.67/s -27-May 22:14:27 test206 10.2 sec 8: 15297 of 22139 30.9% 0.79/s -27-May 22:14:27 test212 0.0 sec 9: 15288 of 22139 30.9% 340.68/s -27-May 22:14:27 test212 0.2 sec 2: 15286 of 22139 31.0% 11.46/s -27-May 22:14:27 test128 0.2 sec 49: 15237 of 22139 31.2% 207.24/s -27-May 22:14:27 test82 0.1 sec 18: 15219 of 22139 31.3% 282.24/s -27-May 22:14:29 test229 2.0 sec 9: 15210 of 22139 31.3% 4.46/s -27-May 22:14:30 test229 0.9 sec 1: 15209 of 22139 31.3% 1.12/s -27-May 22:14:30 test144 0.4 sec 2: 15207 of 22139 31.3% 4.55/s -27-May 22:15:19 test14 48.1 sec 664: 14543 of 22139 34.3% 13.81/s -27-May 22:15:42 test14 23.1 sec 2: 14541 of 22139 34.3% 0.09/s -27-May 22:18:14 test14 152.1 sec 117: 14424 of 22139 34.8% 0.77/s -27-May 22:18:20 test180 5.5 sec 134: 14290 of 22139 35.5% 24.46/s -27-May 22:18:22 test236 2.8 sec 74: 14216 of 22139 35.8% 26.53/s -27-May 22:18:25 test232 2.1 sec 20: 14196 of 22139 35.9% 9.53/s -27-May 22:18:39 test228 14.9 sec 28: 14168 of 22139 36.0% 1.88/s -27-May 22:20:07 test154 87.9 sec 1502: 12666 of 22139 42.8% 17.08/s -27-May 22:24:56 test154 288.5 sec 2: 12664 of 22139 42.8% 0.01/s -27-May 22:25:04 test238 7.9 sec 50: 12614 of 22139 43.0% 6.35/s -27-May 22:25:47 test238 43.6 sec 2: 12612 of 22139 43.0% 0.05/s -27-May 22:26:41 test151b 53.6 sec 173: 12439 of 22139 43.8% 3.23/s -27-May 22:27:56 test151b 75.2 sec 1: 12438 of 22139 43.8% 0.01/s -27-May 22:32:52 test151b 295.2 sec 1: 12437 of 22139 43.8% 0.00/s -27-May 22:32:55 test184 2.4 sec 38: 12399 of 22139 44.0% 16.15/s -27-May 22:33:03 test191 8.2 sec 21: 12378 of 22139 44.1% 2.55/s -27-May 22:33:23 test191 20.7 sec 3: 12375 of 22139 44.1% 0.15/s -27-May 22:39:03 test188 339.2 sec 183: 12192 of 22139 44.9% 0.54/s -27-May 22:40:55 test188 111.2 sec 3: 12189 of 22139 44.9% 0.03/s -27-May 22:40:58 test224 3.6 sec 24: 12165 of 22139 45.1% 6.72/s -27-May 22:41:00 test196 2.1 sec 11: 12154 of 22139 45.1% 5.15/s -27-May 22:41:04 test209 4.1 sec 20: 12134 of 22139 45.2% 4.85/s -27-May 22:41:17 test104 12.5 sec 40: 12094 of 22139 45.4% 3.19/s -27-May 22:41:26 test189 8.6 sec 1: 12093 of 22139 45.4% 0.12/s -27-May 22:42:18 test194 52.3 sec 5: 12088 of 22139 45.4% 0.10/s -27-May 22:42:27 test76 9.3 sec 15: 12073 of 22139 45.5% 1.62/s -27-May 22:42:58 test244 30.5 sec 17: 12056 of 22139 45.5% 0.56/s -[malloc debugging turned off] -27-May 22:42:58 test201 0.0 sec 3: 12053 of 22139 45.6% 679.96/s -27-May 22:42:58 test225 0.1 sec 4: 12049 of 22139 45.6% 34.81/s -27-May 22:42:58 test176 0.1 sec 5: 12044 of 22139 45.6% 93.84/s -27-May 22:42:58 test208 0.0 sec 5: 12039 of 22139 45.6% 362.29/s -27-May 22:42:58 test216 0.0 sec 3: 12036 of 22139 45.6% 175.02/s -27-May 22:43:54 test142 56.4 sec 630: 11406 of 22139 48.5% 11.16/s -27-May 22:44:11 test142 17.0 sec 2: 11404 of 22139 48.5% 0.12/s -27-May 22:46:52 test142 160.4 sec 2: 11402 of 22139 48.5% 0.01/s -27-May 22:47:09 test142 17.2 sec 2: 11400 of 22139 48.5% 0.12/s -27-May 22:47:10 test137 0.2 sec 3: 11397 of 22139 48.5% 17.47/s -27-May 22:47:10 test137 0.0 sec 2: 11395 of 22139 48.5% 339.16/s -27-May 22:47:10 test139 0.2 sec 2: 11393 of 22139 48.5% 9.80/s -27-May 22:47:10 test172 0.1 sec 3: 11390 of 22139 48.6% 58.36/s -27-May 22:47:10 test148 0.3 sec 4: 11386 of 22139 48.6% 11.76/s -27-May 22:47:11 test157 0.4 sec 12: 11374 of 22139 48.6% 32.87/s -27-May 22:47:11 test182 0.7 sec 8: 11366 of 22139 48.7% 11.94/s -27-May 22:47:12 test108 0.3 sec 2: 11364 of 22139 48.7% 7.04/s -27-May 22:47:12 test108 0.3 sec 1: 11363 of 22139 48.7% 3.83/s -27-May 22:47:12 test130 0.5 sec 26: 11337 of 22139 48.8% 53.76/s -27-May 22:47:13 test124 0.1 sec 3: 11334 of 22139 48.8% 27.72/s -27-May 22:47:13 test138 0.0 sec 1: 11333 of 22139 48.8% 23.63/s -27-May 22:47:15 test227 2.7 sec 27: 11306 of 22139 48.9% 10.15/s -27-May 22:47:34 test125 19.0 sec 630: 10676 of 22139 51.8% 33.18/s -27-May 22:49:04 test234 89.3 sec 396: 10280 of 22139 53.6% 4.44/s -27-May 22:51:53 test234 169.4 sec 2: 10278 of 22139 53.6% 0.01/s -27-May 22:52:23 test242 29.4 sec 77: 10201 of 22139 53.9% 2.62/s -27-May 22:52:24 test173 1.0 sec 11: 10190 of 22139 54.0% 10.53/s -27-May 22:52:26 test200 2.0 sec 10: 10180 of 22139 54.0% 4.92/s -27-May 22:52:26 test197 0.1 sec 1: 10179 of 22139 54.0% 9.01/s -27-May 22:52:27 test84 0.9 sec 18: 10161 of 22139 54.1% 19.68/s -27-May 22:52:34 test19b 7.8 sec 58: 10103 of 22139 54.4% 7.48/s -27-May 22:52:38 test19b 3.8 sec 5: 10098 of 22139 54.4% 1.33/s -27-May 22:52:38 test133 0.2 sec 2: 10096 of 22139 54.4% 8.16/s -27-May 22:52:42 test80 3.2 sec 12: 10084 of 22139 54.5% 3.73/s -27-May 22:52:54 test151 12.2 sec 73: 10011 of 22139 54.8% 5.97/s -27-May 22:53:33 test151 39.2 sec 2: 10009 of 22139 54.8% 0.05/s -27-May 22:54:28 test23 54.3 sec 146: 9863 of 22139 55.4% 2.69/s -27-May 22:55:11 test23 43.3 sec 2: 9861 of 22139 55.5% 0.05/s -27-May 22:55:12 test135 1.3 sec 7: 9854 of 22139 55.5% 5.31/s -27-May 22:56:08 test160 55.8 sec 23: 9831 of 22139 55.6% 0.41/s -27-May 22:57:03 test160 54.7 sec 1: 9830 of 22139 55.6% 0.02/s -27-May 22:57:06 test54 2.7 sec 20: 9810 of 22139 55.7% 7.34/s -27-May 22:57:06 test129 0.7 sec 4: 9806 of 22139 55.7% 6.07/s -27-May 22:57:08 test69 1.3 sec 3: 9803 of 22139 55.7% 2.26/s -27-May 22:58:09 test230 61.6 sec 114: 9689 of 22139 56.2% 1.85/s -27-May 23:39:19 test74 2469.9 sec 6588: 3101 of 22139 86.0% 2.67/s -28-May 00:01:37 test74 1338.3 sec 7: 3094 of 22139 86.0% 0.01/s -28-May 00:05:49 test127 251.2 sec 1633: 1461 of 22139 93.4% 6.50/s -28-May 00:15:02 test127 553.0 sec 18: 1443 of 22139 93.5% 0.03/s -28-May 01:06:17 test127 3074.8 sec 2: 1441 of 22139 93.5% 0.00/s -28-May 01:07:17 test19 1.8 sec 12: 1429 of 22139 93.5% 6.67/s -28-May 01:07:19 test11 2.0 sec 3: 1426 of 22139 93.6% 1.47/s -28-May 01:07:21 test215 2.3 sec 1: 1425 of 22139 93.6% 0.44/s -28-May 01:07:31 test193 10.0 sec 5: 1420 of 22139 93.6% 0.50/s -28-May 01:09:22 test195 111.0 sec 39: 1381 of 22139 93.8% 0.35/s -28-May 01:09:37 test243 15.2 sec 7: 1374 of 22139 93.8% 0.46/s -28-May 01:09:46 test29 8.5 sec 1: 1373 of 22139 93.8% 0.12/s -28-May 01:09:54 test29 8.6 sec 2: 1371 of 22139 93.8% 0.23/s -28-May 01:10:06 testc2(0,0) 12.1 sec 2: 1369 of 22139 93.8% 0.17/s -28-May 01:10:07 testc2(0,0) 0.8 sec 6: 1363 of 22139 93.8% 7.58/s -28-May 01:10:08 testc2(0,0) 1.1 sec 1: 1362 of 22139 93.8% 0.93/s -28-May 01:10:09 testc4(0) 0.3 sec 4: 1358 of 22139 93.9% 14.91/s -28-May 01:10:20 testc7(0) 11.0 sec 1: 1357 of 22139 93.9% 0.09/s -28-May 01:10:24 testcc(1) 4.1 sec 1: 1356 of 22139 93.9% 0.25/s -28-May 01:10:30 test187 5.9 sec 3: 1353 of 22139 93.9% 0.51/s -28-May 01:10:34 test192 4.0 sec 1: 1352 of 22139 93.9% 0.25/s -28-May 01:10:43 test181 9.3 sec 10: 1342 of 22139 93.9% 1.08/s -28-May 01:12:01 test185 77.7 sec 6: 1336 of 22139 94.0% 0.08/s -28-May 01:12:25 test53 23.9 sec 4: 1332 of 22139 94.0% 0.17/s -28-May 01:12:55 test17 30.7 sec 28: 1304 of 22139 94.1% 0.91/s -28-May 01:17:49 test231 293.8 sec 162: 1142 of 22139 94.8% 0.55/s -28-May 01:59:48 test10 2518.7 sec 946: 196 of 22139 99.1% 0.38/s -28-May 02:04:23 test75b 250.8 sec 151: 45 of 22139 99.8% 0.60/s -28-May 02:05:31 test21b 67.4 sec 26: 19 of 22139 99.9% 0.39/s -28-May 02:06:12 testca(1) 41.1 sec 5: 14 of 22139 99.9% 0.12/s -28-May 02:07:33 test81 80.7 sec 1: 13 of 22139 99.9% 0.01/s -28-May 02:11:45 test18 252.3 sec 13: all 22139 full 100% 0.05/s -[malloc debugging turned back on] diff --git a/GraphBLAS/Tcov/log_Sept5.txt b/GraphBLAS/Tcov/log_Sept5.txt new file mode 100644 index 000000000..bf59d15b4 --- /dev/null +++ b/GraphBLAS/Tcov/log_Sept5.txt @@ -0,0 +1,217 @@ + +---------------------------------------------- [malloc] [cover] +05-Sep 10:12:35 test272 0.1 sec 113: 21943 of 22139 0.9% 1216.96/s +05-Sep 10:12:35 test268 0.2 sec 131: 21812 of 22139 1.5% 566.82/s +05-Sep 10:12:37 test145 2.4 sec 293: 21519 of 22139 2.8% 122.08/s +05-Sep 10:12:37 test145 0.0 sec 3: 21516 of 22139 2.8% 63.06/s +05-Sep 10:12:37 test145 0.0 sec 26: 21490 of 22139 2.9% 1410.44/s +05-Sep 10:12:37 test145 0.0 sec 4: 21486 of 22139 2.9% 248.02/s +05-Sep 10:12:39 test145 1.4 sec 52: 21434 of 22139 3.2% 37.92/s +05-Sep 10:12:39 test145 0.0 sec 5: 21429 of 22139 3.2% 323.73/s +05-Sep 10:12:39 test240 0.4 sec 68: 21361 of 22139 3.5% 176.93/s +05-Sep 10:12:40 test240 0.2 sec 1: 21360 of 22139 3.5% 4.19/s +05-Sep 10:12:40 test237 0.1 sec 37: 21323 of 22139 3.7% 405.72/s +05-Sep 10:12:42 test237 2.0 sec 27: 21296 of 22139 3.8% 13.42/s +05-Sep 10:12:42 test237 0.0 sec 19: 21277 of 22139 3.9% 398.82/s +05-Sep 10:12:42 test237 0.0 sec 6: 21271 of 22139 3.9% 482.08/s +05-Sep 10:12:42 test237 0.0 sec 4: 21267 of 22139 3.9% 113.80/s +05-Sep 10:12:42 test267 0.6 sec 35: 21232 of 22139 4.1% 57.85/s +05-Sep 10:12:42 test267 0.0 sec 1: 21231 of 22139 4.1% 1776.20/s +05-Sep 10:12:43 test266 0.1 sec 4: 21227 of 22139 4.1% 38.51/s +05-Sep 10:12:43 test265 0.5 sec 92: 21135 of 22139 4.5% 190.45/s +05-Sep 10:12:43 test264 0.1 sec 191: 20944 of 22139 5.4% 1651.15/s +05-Sep 10:12:44 test263 0.8 sec 28: 20916 of 22139 5.5% 36.50/s +05-Sep 10:12:44 test262 0.1 sec 88: 20828 of 22139 5.9% 899.25/s +05-Sep 10:12:44 test261 0.1 sec 29: 20799 of 22139 6.1% 296.19/s +05-Sep 10:12:44 test260 0.1 sec 3: 20796 of 22139 6.1% 30.79/s +05-Sep 10:12:47 test259 2.3 sec 4: 20792 of 22139 6.1% 1.72/s +05-Sep 10:12:47 test258 0.4 sec 22: 20770 of 22139 6.2% 62.84/s +05-Sep 10:12:47 test257 0.3 sec 65: 20705 of 22139 6.5% 235.22/s +05-Sep 10:12:48 test255 0.1 sec 8: 20697 of 22139 6.5% 86.44/s +05-Sep 10:12:48 test254 0.1 sec 29: 20668 of 22139 6.6% 360.02/s +05-Sep 10:12:52 test254 4.4 sec 20: 20648 of 22139 6.7% 4.50/s +05-Sep 10:12:52 test254 0.1 sec 1: 20647 of 22139 6.7% 8.72/s +05-Sep 10:12:53 test253 0.2 sec 27: 20620 of 22139 6.9% 149.11/s +05-Sep 10:12:53 test252 0.1 sec 11: 20609 of 22139 6.9% 113.08/s +05-Sep 10:14:06 test251 73.0 sec 492: 20117 of 22139 9.1% 6.74/s +05-Sep 10:17:11 test251 185.7 sec 12: 20105 of 22139 9.2% 0.06/s +05-Sep 10:20:23 test251 191.2 sec 78: 20027 of 22139 9.5% 0.41/s +05-Sep 10:20:24 test250 1.2 sec 170: 19857 of 22139 10.3% 137.23/s +05-Sep 10:20:26 test250 1.6 sec 13: 19844 of 22139 10.4% 7.98/s +05-Sep 10:20:27 test249 1.4 sec 29: 19815 of 22139 10.5% 21.39/s +05-Sep 10:20:27 test247 0.0 sec 25: 19790 of 22139 10.6% 1201.52/s +05-Sep 10:20:38 test246 11.1 sec 73: 19717 of 22139 10.9% 6.55/s +05-Sep 10:20:56 test01 17.2 sec 1452: 18265 of 22139 17.5% 84.53/s +05-Sep 10:21:08 test01 12.4 sec 22: 18243 of 22139 17.6% 1.77/s +05-Sep 10:21:09 test245 0.9 sec 34: 18209 of 22139 17.8% 39.75/s +05-Sep 10:21:09 test245 0.0 sec 8: 18201 of 22139 17.8% 175.85/s +05-Sep 10:21:09 test199 0.0 sec 1: 18200 of 22139 17.8% 132.57/s +05-Sep 10:21:09 test83 0.1 sec 15: 18185 of 22139 17.9% 119.44/s +05-Sep 10:21:09 test210 0.0 sec 9: 18176 of 22139 17.9% 1893.94/s +05-Sep 10:21:09 test165 0.0 sec 1: 18175 of 22139 17.9% 169.41/s +05-Sep 10:21:10 test219 0.1 sec 9: 18166 of 22139 17.9% 89.94/s +05-Sep 10:21:10 test219 0.2 sec 3: 18163 of 22139 18.0% 12.96/s +05-Sep 10:21:10 test241 0.1 sec 10: 18153 of 22139 18.0% 83.60/s +05-Sep 10:21:10 test220 0.1 sec 15: 18138 of 22139 18.1% 107.08/s +05-Sep 10:21:10 test211 0.0 sec 15: 18123 of 22139 18.1% 432.81/s +05-Sep 10:21:10 test202 0.1 sec 83: 18040 of 22139 18.5% 604.97/s +05-Sep 10:21:10 test202 0.0 sec 1: 18039 of 22139 18.5% 23.10/s +05-Sep 10:21:13 test152 2.6 sec 827: 17212 of 22139 22.3% 314.90/s +05-Sep 10:21:17 test152 4.0 sec 13: 17199 of 22139 22.3% 3.24/s +05-Sep 10:22:25 test152 68.2 sec 245: 16954 of 22139 23.4% 3.59/s +05-Sep 10:22:26 test222 0.2 sec 18: 16936 of 22139 23.5% 89.56/s +05-Sep 10:22:26 test256 0.3 sec 50: 16886 of 22139 23.7% 165.66/s +05-Sep 10:22:29 test186 2.8 sec 43: 16843 of 22139 23.9% 15.15/s +05-Sep 10:22:29 test186 0.4 sec 1: 16842 of 22139 23.9% 2.24/s +05-Sep 10:22:30 test186(0) 0.4 sec 5: 16837 of 22139 23.9% 12.61/s +05-Sep 10:22:41 test150 11.7 sec 39: 16798 of 22139 24.1% 3.35/s +05-Sep 10:22:42 test150 0.2 sec 4: 16794 of 22139 24.1% 19.78/s +05-Sep 10:22:42 test239 0.1 sec 15: 16779 of 22139 24.2% 115.27/s +05-Sep 10:22:43 test239 0.9 sec 2: 16777 of 22139 24.2% 2.21/s +05-Sep 10:22:43 test235 0.0 sec 4: 16773 of 22139 24.2% 94.81/s +05-Sep 10:22:43 test226 0.0 sec 8: 16765 of 22139 24.3% 620.01/s +05-Sep 10:22:43 test223 0.0 sec 2: 16763 of 22139 24.3% 60.38/s +05-Sep 10:22:43 test204 0.2 sec 14: 16749 of 22139 24.3% 75.71/s +05-Sep 10:22:43 test203 0.1 sec 19: 16730 of 22139 24.4% 196.99/s +05-Sep 10:22:43 test183 0.0 sec 12: 16718 of 22139 24.5% 402.19/s +05-Sep 10:22:44 test179 0.1 sec 15: 16703 of 22139 24.6% 107.30/s +05-Sep 10:22:45 test179 1.8 sec 4: 16699 of 22139 24.6% 2.25/s +05-Sep 10:22:45 test174 0.1 sec 10: 16689 of 22139 24.6% 157.67/s +05-Sep 10:22:46 test155 0.2 sec 44: 16645 of 22139 24.8% 271.85/s +05-Sep 10:22:46 test156 0.7 sec 227: 16418 of 22139 25.8% 347.62/s +05-Sep 10:23:30 test156 44.1 sec 37: 16381 of 22139 26.0% 0.84/s +05-Sep 10:23:31 test136 0.3 sec 57: 16324 of 22139 26.3% 226.47/s +05-Sep 10:23:32 test02 0.7 sec 22: 16302 of 22139 26.4% 30.63/s +05-Sep 10:23:32 test109 0.5 sec 10: 16292 of 22139 26.4% 21.56/s +05-Sep 10:23:32 test109 0.0 sec 4: 16288 of 22139 26.4% 1192.25/s +05-Sep 10:23:32 test109 0.3 sec 8: 16280 of 22139 26.5% 25.54/s +05-Sep 10:23:33 test04 0.1 sec 15: 16265 of 22139 26.5% 105.91/s +05-Sep 10:23:33 test207 0.0 sec 2: 16263 of 22139 26.5% 411.44/s +05-Sep 10:23:33 test221 0.0 sec 2: 16261 of 22139 26.6% 258.26/s +05-Sep 10:23:33 test162 0.1 sec 5: 16256 of 22139 26.6% 88.30/s +05-Sep 10:24:31 test159 58.7 sec 80: 16176 of 22139 26.9% 1.36/s +05-Sep 10:24:34 test159 2.4 sec 55: 16121 of 22139 27.2% 23.01/s +05-Sep 10:24:34 test09 0.0 sec 5: 16116 of 22139 27.2% 475.33/s +05-Sep 10:24:34 test132 0.1 sec 8: 16108 of 22139 27.2% 68.57/s +05-Sep 10:25:14 test141 39.5 sec 476: 15632 of 22139 29.4% 12.05/s +05-Sep 10:25:26 test141 12.1 sec 77: 15555 of 22139 29.7% 6.34/s +05-Sep 10:30:09 test141 282.7 sec 2: 15553 of 22139 29.7% 0.01/s +05-Sep 10:30:11 testc2(1,1) 1.3 sec 20: 15533 of 22139 29.8% 14.86/s +05-Sep 10:30:17 testc2(1,1) 6.3 sec 4: 15529 of 22139 29.9% 0.64/s +05-Sep 10:30:17 test214 0.0 sec 3: 15526 of 22139 29.9% 257.60/s +05-Sep 10:30:17 test213 0.0 sec 2: 15524 of 22139 29.9% 150.33/s +05-Sep 10:30:20 test206 2.3 sec 219: 15305 of 22139 30.9% 95.31/s +05-Sep 10:30:32 test206 12.2 sec 8: 15297 of 22139 30.9% 0.65/s +05-Sep 10:30:32 test212 0.0 sec 9: 15288 of 22139 30.9% 445.46/s +05-Sep 10:30:32 test212 0.2 sec 2: 15286 of 22139 31.0% 11.47/s +05-Sep 10:30:33 test128 0.4 sec 49: 15237 of 22139 31.2% 130.38/s +05-Sep 10:30:33 test82 0.1 sec 18: 15219 of 22139 31.3% 171.29/s +05-Sep 10:30:36 test229 3.0 sec 9: 15210 of 22139 31.3% 3.00/s +05-Sep 10:30:37 test229 1.1 sec 1: 15209 of 22139 31.3% 0.90/s +05-Sep 10:30:38 test144 0.6 sec 2: 15207 of 22139 31.3% 3.33/s +05-Sep 10:31:55 test14 77.5 sec 664: 14543 of 22139 34.3% 8.57/s +05-Sep 10:32:24 test14 29.3 sec 2: 14541 of 22139 34.3% 0.07/s +05-Sep 10:36:31 test14 246.2 sec 117: 14424 of 22139 34.8% 0.48/s +05-Sep 10:36:39 test180 8.1 sec 134: 14290 of 22139 35.5% 16.56/s +05-Sep 10:36:43 test236 3.6 sec 74: 14216 of 22139 35.8% 20.55/s +05-Sep 10:36:45 test232 2.5 sec 20: 14196 of 22139 35.9% 8.10/s +05-Sep 10:37:04 test228 18.1 sec 28: 14168 of 22139 36.0% 1.54/s +05-Sep 10:38:48 test154 104.7 sec 1502: 12666 of 22139 42.8% 14.35/s +05-Sep 10:44:56 test154 367.6 sec 2: 12664 of 22139 42.8% 0.01/s +05-Sep 10:45:07 test238 11.5 sec 50: 12614 of 22139 43.0% 4.36/s +05-Sep 10:46:09 test238 61.3 sec 2: 12612 of 22139 43.0% 0.03/s +05-Sep 10:47:42 test151b 93.1 sec 173: 12439 of 22139 43.8% 1.86/s +05-Sep 10:49:18 test151b 96.1 sec 1: 12438 of 22139 43.8% 0.01/s +05-Sep 10:56:19 test151b 421.3 sec 1: 12437 of 22139 43.8% 0.00/s +05-Sep 10:56:24 test184 3.2 sec 38: 12399 of 22139 44.0% 12.04/s +05-Sep 10:56:36 test191 12.7 sec 21: 12378 of 22139 44.1% 1.66/s +05-Sep 10:57:05 test191 28.2 sec 3: 12375 of 22139 44.1% 0.11/s +05-Sep 11:03:55 test188 410.7 sec 183: 12192 of 22139 44.9% 0.45/s +05-Sep 11:06:21 test188 145.0 sec 3: 12189 of 22139 44.9% 0.02/s +05-Sep 11:06:26 test224 4.7 sec 24: 12165 of 22139 45.1% 5.05/s +05-Sep 11:06:29 test196 2.4 sec 11: 12154 of 22139 45.1% 4.51/s +05-Sep 11:06:33 test209 4.7 sec 20: 12134 of 22139 45.2% 4.29/s +05-Sep 11:06:50 test104 16.8 sec 40: 12094 of 22139 45.4% 2.38/s +05-Sep 11:06:58 test189 8.2 sec 1: 12093 of 22139 45.4% 0.12/s +05-Sep 11:08:02 test194 63.4 sec 5: 12088 of 22139 45.4% 0.08/s +05-Sep 11:08:16 test76 14.4 sec 15: 12073 of 22139 45.5% 1.04/s +05-Sep 11:08:55 test244 38.5 sec 17: 12056 of 22139 45.5% 0.44/s +[malloc debugging turned off] +05-Sep 11:08:55 test201 0.0 sec 3: 12053 of 22139 45.6% 315.89/s +05-Sep 11:08:55 test225 0.2 sec 4: 12049 of 22139 45.6% 26.63/s +05-Sep 11:08:55 test176 0.1 sec 5: 12044 of 22139 45.6% 71.58/s +05-Sep 11:08:55 test208 0.0 sec 5: 12039 of 22139 45.6% 309.79/s +05-Sep 11:08:55 test216 0.1 sec 3: 12036 of 22139 45.6% 29.06/s +05-Sep 11:10:10 test142 74.2 sec 630: 11406 of 22139 48.5% 8.49/s +05-Sep 11:10:33 test142 22.9 sec 2: 11404 of 22139 48.5% 0.09/s +05-Sep 11:13:36 test142 183.0 sec 2: 11402 of 22139 48.5% 0.01/s +05-Sep 11:14:00 test142 23.2 sec 2: 11400 of 22139 48.5% 0.09/s +05-Sep 11:14:00 test137 0.4 sec 3: 11397 of 22139 48.5% 7.36/s +05-Sep 11:14:00 test137 0.0 sec 2: 11395 of 22139 48.5% 228.18/s +05-Sep 11:14:01 test139 0.5 sec 2: 11393 of 22139 48.5% 3.97/s +05-Sep 11:14:01 test172 0.1 sec 3: 11390 of 22139 48.6% 37.90/s +05-Sep 11:14:02 test148 0.9 sec 4: 11386 of 22139 48.6% 4.59/s +05-Sep 11:14:02 test157 0.6 sec 12: 11374 of 22139 48.6% 19.60/s +05-Sep 11:14:03 test182 1.0 sec 8: 11366 of 22139 48.7% 8.16/s +05-Sep 11:14:04 test108 0.6 sec 2: 11364 of 22139 48.7% 3.21/s +05-Sep 11:14:04 test108 0.4 sec 1: 11363 of 22139 48.7% 2.69/s +05-Sep 11:14:05 test130 0.8 sec 26: 11337 of 22139 48.8% 32.95/s +05-Sep 11:14:05 test124 0.2 sec 3: 11334 of 22139 48.8% 16.21/s +05-Sep 11:14:06 test138 0.1 sec 1: 11333 of 22139 48.8% 19.29/s +05-Sep 11:14:10 test227 4.0 sec 27: 11306 of 22139 48.9% 6.81/s +05-Sep 11:14:36 test125 26.4 sec 630: 10676 of 22139 51.8% 23.90/s +05-Sep 11:16:47 test234 131.5 sec 396: 10280 of 22139 53.6% 3.01/s +05-Sep 11:20:27 test234 219.1 sec 2: 10278 of 22139 53.6% 0.01/s +05-Sep 11:21:07 test242 40.5 sec 77: 10201 of 22139 53.9% 1.90/s +05-Sep 11:21:09 test173 1.5 sec 11: 10190 of 22139 54.0% 7.47/s +05-Sep 11:21:11 test200 2.7 sec 10: 10180 of 22139 54.0% 3.72/s +05-Sep 11:21:12 test197 0.1 sec 1: 10179 of 22139 54.0% 7.35/s +05-Sep 11:21:13 test84 1.2 sec 18: 10161 of 22139 54.1% 15.33/s +05-Sep 11:21:23 test19b 10.0 sec 58: 10103 of 22139 54.4% 5.81/s +05-Sep 11:21:28 test19b 5.2 sec 5: 10098 of 22139 54.4% 0.96/s +05-Sep 11:21:28 test133 0.4 sec 2: 10096 of 22139 54.4% 5.15/s +05-Sep 11:21:33 test80 4.2 sec 12: 10084 of 22139 54.5% 2.89/s +05-Sep 11:21:48 test151 15.4 sec 73: 10011 of 22139 54.8% 4.73/s +05-Sep 11:22:59 test151 70.9 sec 2: 10009 of 22139 54.8% 0.03/s +05-Sep 11:24:17 test23 78.4 sec 146: 9863 of 22139 55.4% 1.86/s +05-Sep 11:25:19 test23 61.1 sec 2: 9861 of 22139 55.5% 0.03/s +05-Sep 11:25:21 test135 1.9 sec 7: 9854 of 22139 55.5% 3.66/s +05-Sep 11:26:37 test160 76.2 sec 23: 9831 of 22139 55.6% 0.30/s +05-Sep 11:27:53 test160 75.6 sec 1: 9830 of 22139 55.6% 0.01/s +05-Sep 11:27:58 test54 5.1 sec 20: 9810 of 22139 55.7% 3.90/s +05-Sep 11:27:59 test129 1.0 sec 4: 9806 of 22139 55.7% 4.09/s +05-Sep 11:28:01 test69 2.0 sec 3: 9803 of 22139 55.7% 1.50/s +05-Sep 11:29:22 test230 81.0 sec 114: 9689 of 22139 56.2% 1.41/s +05-Sep 12:49:06 test74 4784.6 sec 6588: 3101 of 22139 86.0% 1.38/s +05-Sep 13:21:22 test74 1935.1 sec 7: 3094 of 22139 86.0% 0.00/s +05-Sep 13:27:05 test127 343.4 sec 1633: 1461 of 22139 93.4% 4.75/s +05-Sep 13:39:24 test127 738.7 sec 18: 1443 of 22139 93.5% 0.02/s +05-Sep 14:27:40 test127 2896.1 sec 2: 1441 of 22139 93.5% 0.00/s +05-Sep 14:28:14 test19 3.1 sec 12: 1429 of 22139 93.5% 3.86/s +05-Sep 14:28:17 test11 3.5 sec 3: 1426 of 22139 93.6% 0.87/s +05-Sep 14:28:21 test215 3.2 sec 1: 1425 of 22139 93.6% 0.31/s +05-Sep 14:28:36 test193 15.0 sec 5: 1420 of 22139 93.6% 0.33/s +05-Sep 14:31:13 test195 157.4 sec 39: 1381 of 22139 93.8% 0.25/s +05-Sep 14:31:35 test243 21.6 sec 7: 1374 of 22139 93.8% 0.32/s +05-Sep 14:31:48 test29 12.7 sec 1: 1373 of 22139 93.8% 0.08/s +05-Sep 14:31:58 test29 10.4 sec 2: 1371 of 22139 93.8% 0.19/s +05-Sep 14:32:15 testc2(0,0) 17.2 sec 2: 1369 of 22139 93.8% 0.12/s +05-Sep 14:32:16 testc2(0,0) 1.2 sec 6: 1363 of 22139 93.8% 5.08/s +05-Sep 14:32:18 testc2(0,0) 1.4 sec 1: 1362 of 22139 93.8% 0.70/s +05-Sep 14:32:19 testc4(0) 0.6 sec 4: 1358 of 22139 93.9% 6.58/s +05-Sep 14:32:33 testc7(0) 14.1 sec 1: 1357 of 22139 93.9% 0.07/s +05-Sep 14:32:38 testcc(1) 5.0 sec 1: 1356 of 22139 93.9% 0.20/s +05-Sep 14:32:45 test187 7.5 sec 3: 1353 of 22139 93.9% 0.40/s +05-Sep 14:32:50 test192 5.1 sec 1: 1352 of 22139 93.9% 0.20/s +05-Sep 14:33:06 test181 15.9 sec 10: 1342 of 22139 93.9% 0.63/s +05-Sep 14:34:55 test185 109.0 sec 6: 1336 of 22139 94.0% 0.06/s +05-Sep 14:35:36 test53 41.1 sec 4: 1332 of 22139 94.0% 0.10/s +05-Sep 14:36:22 test17 45.5 sec 28: 1304 of 22139 94.1% 0.61/s +05-Sep 14:42:42 test231 380.3 sec 162: 1142 of 22139 94.8% 0.43/s +05-Sep 15:27:01 test10 2658.7 sec 946: 196 of 22139 99.1% 0.36/s +05-Sep 15:34:32 test75b 426.3 sec 151: 45 of 22139 99.8% 0.35/s +05-Sep 15:35:55 test21b 81.3 sec 26: 19 of 22139 99.9% 0.32/s +05-Sep 15:36:46 testca(1) 51.4 sec 5: 14 of 22139 99.9% 0.10/s +05-Sep 15:38:39 test81 112.9 sec 1: 13 of 22139 99.9% 0.01/s +05-Sep 15:43:51 test18 311.6 sec 13: all 22139 full 100% 0.04/s +[malloc debugging turned back on] diff --git a/GraphBLAS/cmake_modules/FindGraphBLAS.cmake b/GraphBLAS/cmake_modules/FindGraphBLAS.cmake deleted file mode 100644 index 792554b25..000000000 --- a/GraphBLAS/cmake_modules/FindGraphBLAS.cmake +++ /dev/null @@ -1,169 +0,0 @@ -#[=======================================================================[.rst: -FindGraphBLAS --------- - -The following copyright and license applies to just this file only, not to -the GraphBLAS library itself: -LAGraph, (c) 2019-2023 by The LAGraph Contributors, All Rights Reserved. -SPDX-License-Identifier: BSD-2-Clause -See additional acknowledgments in the LICENSE file, -or contact permission@sei.cmu.edu for the full terms. - -Find the native GRAPHBLAS includes and library. - -IMPORTED Targets -^^^^^^^^^^^^^^^^ - -This module defines :prop_tgt:`IMPORTED` target ``GRAPHBLAS::GRAPHBLAS``, if -GRAPHBLAS has been found. - -Result Variables -^^^^^^^^^^^^^^^^ - -This module defines the following variables: - -:: - - GRAPHBLAS_INCLUDE_DIR - where to find GraphBLAS.h, etc. - GRAPHBLAS_LIBRARY - dynamic GraphBLAS library - GRAPHBLAS_STATIC - static GraphBLAS library - GRAPHBLAS_LIBRARIES - List of libraries when using GraphBLAS. - GRAPHBLAS_FOUND - True if GraphBLAS found. - -:: - -Hints -^^^^^ - -A user may set ``GRAPHBLAS_ROOT`` or ``GraphBLAS_ROOT`` to a GraphBLAS -installation root to tell this module where to look. - -Otherwise, the first place searched is in ../GraphBLAS, relative to the LAGraph -source directory. That is, if GraphBLAS and LAGraph reside in the same parent -folder, side-by-side, and if it contains GraphBLAS/Include/GraphBLAS.h file and -GraphBLAS/build/libgraphblas.so (or dylib, etc), then that version is used. -This takes precedence over the system-wide installation of GraphBLAS, which -might be an older version. This method gives the user the ability to compile -LAGraph with their own copy of GraphBLAS, ignoring the system-wide version. - -If SuiteSparse:GraphBLAS is the GraphBLAS library being utilized, -all the Find*.cmake files in SuiteSparse are installed by 'make install' into -/usr/local/lib/cmake/SuiteSparse (where '/usr/local' is the -${CMAKE_INSTALL_PREFIX}). To access this file, place the following commands -in your CMakeLists.txt file. See also SuiteSparse/Example/CMakeLists.txt: - - set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} - ${CMAKE_INSTALL_PREFIX}/lib/cmake/SuiteSparse ) - -#]=======================================================================] - -# NB: this is built around assumptions about one particular GraphBLAS -# installation (SuiteSparse:GraphBLAS). As other installations become available -# changes to this will likely be required. - -#------------------------------------------------------------------------------- - -# "Include" for SuiteSparse:GraphBLAS -find_path ( GRAPHBLAS_INCLUDE_DIR - NAMES GraphBLAS.h - HINTS ${GRAPHBLAS_ROOT} - HINTS ENV GRAPHBLAS_ROOT - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../GraphBLAS - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/GraphBLAS - PATH_SUFFIXES include Include - ) - -# dynamic SuiteSparse:GraphBLAS library (or static if no dynamic library was built) -find_library ( GRAPHBLAS_LIBRARY - NAMES graphblas graphblas_static - HINTS ${GRAPHBLAS_ROOT} - HINTS ENV GRAPHBLAS_ROOT - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../GraphBLAS - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/GraphBLAS - PATH_SUFFIXES lib build build/Release build/Debug - ) - -if ( MSVC ) - set ( STATIC_NAME graphblas_static graphblas ) -else ( ) - set ( STATIC_NAME graphblas ) - set ( save ${CMAKE_FIND_LIBRARY_SUFFIXES} ) - set ( CMAKE_FIND_LIBRARY_SUFFIXES - ${CMAKE_STATIC_LIBRARY_SUFFIX} ${CMAKE_FIND_LIBRARY_SUFFIXES} ) -endif ( ) - -# static SuiteSparse:GraphBLAS library -find_library ( GRAPHBLAS_STATIC - NAMES ${STATIC_NAME} - HINTS ${GRAPHBLAS_ROOT} - HINTS ENV GRAPHBLAS_ROOT - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../GraphBLAS - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/GraphBLAS - PATH_SUFFIXES lib build build/Release build/Debug - ) - -if ( NOT MSVC ) - # restore the CMAKE_FIND_LIBRARY_SUFFIXES variable - set ( CMAKE_FIND_LIBRARY_SUFFIXES ${save} ) -endif ( ) - -# get version of the library from the dynamic library name -get_filename_component ( GRAPHBLAS_LIBRARY ${GRAPHBLAS_LIBRARY} REALPATH ) -get_filename_component ( GRAPHBLAS_FILENAME ${GRAPHBLAS_LIBRARY} NAME ) -string ( - REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" - GRAPHBLAS_VERSION - ${GRAPHBLAS_FILENAME} - ) - -# set ( GRAPHBLAS_VERSION "" ) -if ( EXISTS "${GRAPHBLAS_INCLUDE_DIR}" AND NOT GRAPHBLAS_VERSION ) - # if the version does not appear in the filename, read the include file - file ( STRINGS ${GRAPHBLAS_INCLUDE_DIR}/GraphBLAS.h GRAPHBLAS_MAJOR_STR - REGEX "define GxB_IMPLEMENTATION_MAJOR" ) - file ( STRINGS ${GRAPHBLAS_INCLUDE_DIR}/GraphBLAS.h GRAPHBLAS_MINOR_STR - REGEX "define GxB_IMPLEMENTATION_MINOR" ) - file ( STRINGS ${GRAPHBLAS_INCLUDE_DIR}/GraphBLAS.h GRAPHBLAS_PATCH_STR - REGEX "define GxB_IMPLEMENTATION_SUB" ) - message ( STATUS "major: ${GRAPHBLAS_MAJOR_STR}" ) - message ( STATUS "minor: ${GRAPHBLAS_MINOR_STR}" ) - message ( STATUS "patch: ${GRAPHBLAS_PATCH_STR}" ) - string ( REGEX MATCH "[0-9]+" GRAPHBLAS_MAJOR ${GRAPHBLAS_MAJOR_STR} ) - string ( REGEX MATCH "[0-9]+" GRAPHBLAS_MINOR ${GRAPHBLAS_MINOR_STR} ) - string ( REGEX MATCH "[0-9]+" GRAPHBLAS_PATCH ${GRAPHBLAS_PATCH_STR} ) - set (GRAPHBLAS_VERSION "${GRAPHBLAS_MAJOR}.${GRAPHBLAS_MINOR}.${GRAPHBLAS_PATCH}") -endif ( ) - -set ( GRAPHBLAS_LIBRARIES ${GRAPHBLAS_LIBRARY} ) - -include ( FindPackageHandleStandardArgs ) - -find_package_handle_standard_args( - GraphBLAS - REQUIRED_VARS GRAPHBLAS_LIBRARY GRAPHBLAS_INCLUDE_DIR - VERSION_VAR GRAPHBLAS_VERSION - ) - -mark_as_advanced( - GRAPHBLAS_INCLUDE_DIR - GRAPHBLAS_LIBRARY - GRAPHBLAS_STATIC - GRAPHBLAS_LIBRARIES - ) - -if ( GRAPHBLAS_FOUND ) - message ( STATUS "GraphBLAS version: ${GRAPHBLAS_VERSION}" ) - message ( STATUS "GraphBLAS include: ${GRAPHBLAS_INCLUDE_DIR}" ) - message ( STATUS "GraphBLAS library: ${GRAPHBLAS_LIBRARY}" ) - message ( STATUS "GraphBLAS static: ${GRAPHBLAS_STATIC}" ) -else ( ) - message ( STATUS "GraphBLAS not found" ) - set ( GRAPHBLAS_INCLUDE_DIR "" ) - set ( GRAPHBLAS_LIBRARIES "" ) - set ( GRAPHBLAS_LIBRARY "" ) - set ( GRAPHBLAS_STATIC "" ) -endif ( ) - diff --git a/GraphBLAS/cmake_modules/GraphBLAS_JIT_paths.cmake b/GraphBLAS/cmake_modules/GraphBLAS_JIT_paths.cmake index fabe56d67..d50b686df 100644 --- a/GraphBLAS/cmake_modules/GraphBLAS_JIT_paths.cmake +++ b/GraphBLAS/cmake_modules/GraphBLAS_JIT_paths.cmake @@ -21,6 +21,13 @@ if ( DEFINED ENV{GRAPHBLAS_CACHE_PATH} ) elseif ( DEFINED ENV{HOME} ) # use the current HOME environment variable from cmake (for Linux, Unix, Mac) set ( GRAPHBLAS_CACHE_PATH "$ENV{HOME}/.SuiteSparse/GrB${GraphBLAS_VERSION_MAJOR}.${GraphBLAS_VERSION_MINOR}.${GraphBLAS_VERSION_SUB}" ) + if ( GBMATLAB AND APPLE ) + # MATLAB on the Mac is a non-native application so the compiled JIT + # kernels are compiled to x86 assembly. The primary libgraphblas.dylib + # called from a C application would likely be native, in ARM assembly. + # So use a different JIT folder for MATLAB. + set ( GRAPHBLAS_CACHE_PATH "${GRAPHBLAS_CACHE_PATH}_matlab" ) + endif ( ) elseif ( WIN32 ) # use LOCALAPPDATA for Windows set ( GRAPHBLAS_CACHE_PATH "$ENV{LOCALAPPDATA}/SuiteSparse/GrB${GraphBLAS_VERSION_MAJOR}.${GraphBLAS_VERSION_MINOR}.${GraphBLAS_VERSION_SUB}" ) diff --git a/GraphBLAS/cmake_modules/GraphBLAS_version.cmake b/GraphBLAS/cmake_modules/GraphBLAS_version.cmake index 64cf59fac..797aa76ba 100644 --- a/GraphBLAS/cmake_modules/GraphBLAS_version.cmake +++ b/GraphBLAS/cmake_modules/GraphBLAS_version.cmake @@ -8,10 +8,10 @@ #------------------------------------------------------------------------------- # version of SuiteSparse:GraphBLAS -set ( GraphBLAS_DATE "June 16, 2023" ) +set ( GraphBLAS_DATE "Sept 8, 2023" ) set ( GraphBLAS_VERSION_MAJOR 8 ) -set ( GraphBLAS_VERSION_MINOR 0 ) -set ( GraphBLAS_VERSION_SUB 2 ) +set ( GraphBLAS_VERSION_MINOR 2 ) +set ( GraphBLAS_VERSION_SUB 0 ) # GraphBLAS C API Specification version, at graphblas.org set ( GraphBLAS_API_DATE "Nov 15, 2021" ) diff --git a/GraphBLAS/xxHash/README.txt b/GraphBLAS/xxHash/README.txt index c0fe054d8..911c9b563 100644 --- a/GraphBLAS/xxHash/README.txt +++ b/GraphBLAS/xxHash/README.txt @@ -13,8 +13,8 @@ Files in this folder: LICENSE BSD 2-clause, Copyright (c) Copyright (c) 2012-present, Yann Collet - xxhash.h unmodified from the xxHash library, dev branch as of - June 16, 2023 + xxhash.h from the xxHash library, dev branch as of June 16, 2023, + slightly modified for GraphBLAS to fix the XXH_ALIGN macro. README_xxhash.md xxhash/README.md README.txt this file diff --git a/GraphBLAS/xxHash/xxhash.h b/GraphBLAS/xxHash/xxhash.h index a600cc6fd..78340db86 100644 --- a/GraphBLAS/xxHash/xxhash.h +++ b/GraphBLAS/xxHash/xxhash.h @@ -1181,32 +1181,25 @@ struct XXH64_state_s { #ifndef XXH_NO_XXH3 //-------------------------------------------------------------------------- -#if defined ( _MSC_VER ) /* GraphBLAS modification */ - // MS Visual Studio is badly broken. It states that it complies with - // ANSI C11, but it does not provide the required stdalign.h. - #define XXH_ALIGN(n) __declspec(align(n)) -#else -// unmodified rules from the original xxhash.h: -//-------------------------------------------------------------------------- - -#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) /* >= C11 */ -# include -# define XXH_ALIGN(n) alignas(n) +#if defined( _MSC_VER ) && (_MSC_VER < 1930) /* GraphBLAS modification */ +/* MS Visual Studio before MSVC 2022 doesn't provide albeit + * defining __STDC_VERSION__ >= 201112L. */ +# define XXH_ALIGN(n) __declspec(align(n)) +/* moved C++11 before C11 */ #elif defined(__cplusplus) && (__cplusplus >= 201103L) /* >= C++11 */ /* In C++ alignas() is a keyword */ # define XXH_ALIGN(n) alignas(n) +#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) /* >= C11 */ +# include +# define XXH_ALIGN(n) alignas(n) +// unmodified rules from the original xxhash.h: +//-------------------------------------------------------------------------- #elif defined(__GNUC__) # define XXH_ALIGN(n) __attribute__ ((aligned(n))) -#elif defined(_MSC_VER) -# define XXH_ALIGN(n) __declspec(align(n)) #else # define XXH_ALIGN(n) /* disabled */ #endif -//-------------------------------------------------------------------------- -#endif /* GraphBLAS modification */ -//-------------------------------------------------------------------------- - /* Old GCC versions only accept the attribute after the type in structures. */ #if !(defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)) /* C11+ */ \ && ! (defined(__cplusplus) && (__cplusplus >= 201103L)) /* >= C++11 */ \ diff --git a/KLU/CMakeLists.txt b/KLU/CMakeLists.txt index 55026d266..833e2e2fd 100644 --- a/KLU/CMakeLists.txt +++ b/KLU/CMakeLists.txt @@ -10,12 +10,12 @@ # get the version #------------------------------------------------------------------------------- -cmake_minimum_required ( VERSION 3.19 ) +cmake_minimum_required ( VERSION 3.20 ) -set ( KLU_DATE "June 16, 2023" ) +set ( KLU_DATE "Sept 8, 2023" ) set ( KLU_VERSION_MAJOR 2 ) -set ( KLU_VERSION_MINOR 0 ) -set ( KLU_VERSION_SUB 4 ) +set ( KLU_VERSION_MINOR 2 ) +set ( KLU_VERSION_SUB 0 ) message ( STATUS "Building KLU version: v" ${KLU_VERSION_MAJOR}. @@ -27,48 +27,94 @@ message ( STATUS "Building KLU version: v" #------------------------------------------------------------------------------- set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} - ${CMAKE_SOURCE_DIR}/cmake_modules - ${CMAKE_SOURCE_DIR}/../BTF/cmake_modules - ${CMAKE_SOURCE_DIR}/../AMD/cmake_modules - ${CMAKE_SOURCE_DIR}/../COLAMD/cmake_modules - ${CMAKE_SOURCE_DIR}/../CAMD/cmake_modules - ${CMAKE_SOURCE_DIR}/../CCOLAMD/cmake_modules - ${CMAKE_SOURCE_DIR}/../CHOLMOD/cmake_modules ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/cmake_modules ) +option ( ENABLE_CUDA "Enable CUDA acceleration" on ) + include ( SuiteSparsePolicy ) #------------------------------------------------------------------------------- # define the project #------------------------------------------------------------------------------- -project ( klu - VERSION "${KLU_VERSION_MAJOR}.${KLU_VERSION_MINOR}.${KLU_VERSION_SUB}" - LANGUAGES C ) +if ( SUITESPARSE_CUDA ) + # KLU with CHOLMOD (which can use CUDA) + project ( klu + VERSION "${KLU_VERSION_MAJOR}.${KLU_VERSION_MINOR}.${KLU_VERSION_SUB}" + LANGUAGES C CXX CUDA ) +else ( ) + # KLU without CHOLMOD (thus no CUDA) + project ( klu + VERSION "${KLU_VERSION_MAJOR}.${KLU_VERSION_MINOR}.${KLU_VERSION_SUB}" + LANGUAGES C ) +endif ( ) #------------------------------------------------------------------------------- # find library dependencies #------------------------------------------------------------------------------- -find_package ( SuiteSparse_config 7.1.0 REQUIRED ) -find_package ( BTF 2.0.4 REQUIRED ) -find_package ( COLAMD 3.0.4 REQUIRED ) -find_package ( AMD 3.0.4 REQUIRED ) +find_package ( SuiteSparse_config 7.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH ) +if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) + find_package ( SuiteSparse_config 7.2.0 REQUIRED ) +endif ( ) +find_package ( BTF 2.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../BTF/build NO_DEFAULT_PATH ) +if ( NOT TARGET SuiteSparse::BTF ) + find_package ( BTF 2.2.0 REQUIRED ) +endif ( ) + +find_package ( COLAMD 3.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../COLAMD/build NO_DEFAULT_PATH ) +if ( NOT TARGET SuiteSparse::COLAMD ) + find_package ( COLAMD 3.2.0 REQUIRED ) +endif ( ) + +find_package ( AMD 3.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../AMD/build NO_DEFAULT_PATH ) +if ( NOT TARGET SuiteSparse::AMD ) + find_package ( AMD 3.2.0 REQUIRED ) +endif ( ) option ( NCHOLMOD "ON: do not use CHOLMOD. OFF (default): use CHOLMOD" off ) if ( NOT NCHOLMOD ) # look for CHOLMOD (optional fill-reducing orderings) - find_package ( CHOLMOD 4.0.4 ) - find_package ( CHOLMOD_CUDA 4.0.4 ) + find_package ( CHOLMOD 4.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../CHOLMOD/build NO_DEFAULT_PATH ) + if ( NOT TARGET SuiteSparse::CHOLMOD ) + find_package ( CHOLMOD 4.2.0 ) + endif ( ) + + if ( SUITESPARSE_CUDA ) + find_package ( CHOLMOD_CUDA 4.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../CHOLMOD/build NO_DEFAULT_PATH ) + if ( NOT TARGET SuiteSparse::CHOLMOD_CUDA ) + find_package ( CHOLMOD_CUDA 4.2.0 ) + endif ( ) + endif ( ) + # look for CHOLMOD's dependencies: AMD and COLAMD are required. CAMD and # CCOLAMD are optional, but must be found if CHOLMOD was built with them. - find_package ( CAMD 3.0.4 ) - find_package ( CCOLAMD 3.0.4 ) + find_package ( CAMD 3.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../CAMD/build NO_DEFAULT_PATH ) + if ( NOT TARGET SuiteSparse::CAMD ) + find_package ( CAMD 3.2.0 ) + endif ( ) + + find_package ( CCOLAMD 3.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../CCOLAMD/build NO_DEFAULT_PATH ) + if ( NOT TARGET SuiteSparse::CCOLAMD ) + find_package ( CCOLAMD 3.2.0 ) + endif ( ) + if ( NOT CHOLMOD_FOUND OR NOT AMD_FOUND OR NOT COLAMD_FOUND ) # CHOLMOD not found so disable it set ( NCHOLMOD true ) endif ( ) + if ( SUITESPARSE_CUDA AND NOT CHOLMOD_CUDA_FOUND ) + set ( NCHOLMOD true ) + endif ( ) endif ( ) if ( NCHOLMOD ) @@ -94,8 +140,7 @@ configure_file ( "Config/klu_version.tex.in" # include directories #------------------------------------------------------------------------------- -include_directories ( Source Include User ${SUITESPARSE_CONFIG_INCLUDE_DIR} - ${AMD_INCLUDE_DIR} ${COLAMD_INCLUDE_DIR} ${BTF_INCLUDE_DIR} ) +include_directories ( Source Include User ) #------------------------------------------------------------------------------- # dynamic klu library properties @@ -103,24 +148,29 @@ include_directories ( Source Include User ${SUITESPARSE_CONFIG_INCLUDE_DIR} file ( GLOB KLU_SOURCES "Source/*.c" ) -add_library ( klu SHARED ${KLU_SOURCES} ) +add_library ( KLU SHARED ${KLU_SOURCES} ) -set_target_properties ( klu PROPERTIES +set_target_properties ( KLU PROPERTIES VERSION ${KLU_VERSION_MAJOR}.${KLU_VERSION_MINOR}.${KLU_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON + OUTPUT_NAME klu SOVERSION ${KLU_VERSION_MAJOR} PUBLIC_HEADER "Include/klu.h" WINDOWS_EXPORT_ALL_SYMBOLS ON ) +target_include_directories ( KLU + INTERFACE $ + $ ) + #------------------------------------------------------------------------------- # static klu library properties #------------------------------------------------------------------------------- if ( NOT NSTATIC ) - add_library ( klu_static STATIC ${KLU_SOURCES} ) + add_library ( KLU_static STATIC ${KLU_SOURCES} ) - set_target_properties ( klu_static PROPERTIES + set_target_properties ( KLU_static PROPERTIES VERSION ${KLU_VERSION_MAJOR}.${KLU_VERSION_MINOR}.${KLU_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON @@ -128,9 +178,14 @@ if ( NOT NSTATIC ) SOVERSION ${KLU_VERSION_MAJOR} ) if ( MSVC ) - set_target_properties ( klu_static PROPERTIES + set_target_properties ( KLU_static PROPERTIES OUTPUT_NAME klu_static ) endif ( ) + + target_include_directories ( KLU_static + INTERFACE $ + $ ) + endif ( ) #------------------------------------------------------------------------------- @@ -141,20 +196,24 @@ if ( NOT NCHOLMOD ) file ( GLOB KLU_CHOLMOD_SOURCES "User/*.c" ) - add_library ( klu_cholmod SHARED ${KLU_CHOLMOD_SOURCES} ) - include_directories ( ${CHOLMOD_INCLUDE_DIR} ) + add_library ( KLU_CHOLMOD SHARED ${KLU_CHOLMOD_SOURCES} ) - set_target_properties ( klu_cholmod PROPERTIES + set_target_properties ( KLU_CHOLMOD PROPERTIES VERSION ${KLU_VERSION_MAJOR}.${KLU_VERSION_MINOR}.${KLU_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON + OUTPUT_NAME klu_cholmod SOVERSION ${KLU_VERSION_MAJOR} PUBLIC_HEADER "User/klu_cholmod.h" ) + target_include_directories ( KLU_CHOLMOD + INTERFACE $ + $ ) + if ( NOT NSTATIC ) - add_library ( klu_cholmod_static STATIC ${KLU_CHOLMOD_SOURCES} ) + add_library ( KLU_CHOLMOD_static STATIC ${KLU_CHOLMOD_SOURCES} ) - set_target_properties ( klu_cholmod_static PROPERTIES + set_target_properties ( KLU_CHOLMOD_static PROPERTIES VERSION ${KLU_VERSION_MAJOR}.${KLU_VERSION_MINOR}.${KLU_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON @@ -162,9 +221,14 @@ if ( NOT NCHOLMOD ) SOVERSION ${KLU_VERSION_MAJOR} ) if ( MSVC ) - set_target_properties ( klu_cholmod_static PROPERTIES + set_target_properties ( KLU_CHOLMOD_static PROPERTIES OUTPUT_NAME klu_cholmod_static ) endif ( ) + + target_include_directories ( KLU_CHOLMOD_static + INTERFACE $ + $ ) + endif ( ) endif ( ) @@ -173,66 +237,89 @@ endif ( ) # add the library dependencies #------------------------------------------------------------------------------- -# suitesparseconfig: -target_link_libraries ( klu PRIVATE ${SUITESPARSE_CONFIG_LIBRARIES} ) +# SuiteSparseConfig: +target_link_libraries ( KLU PRIVATE SuiteSparse::SuiteSparseConfig ) if ( NOT NSTATIC ) - target_link_libraries ( klu_static PUBLIC ${SUITESPARSE_CONFIG_STATIC} ) + if ( TARGET SuiteSparse::SuiteSparseConfig_static ) + target_link_libraries ( KLU_static PUBLIC SuiteSparse::SuiteSparseConfig_static ) + else ( ) + target_link_libraries ( KLU_static PUBLIC SuiteSparse::SuiteSparseConfig ) + endif ( ) endif ( ) # libm: if ( NOT WIN32 ) - target_link_libraries ( klu PRIVATE m ) + target_link_libraries ( KLU PRIVATE m ) if ( NOT NSTATIC ) - target_link_libraries ( klu_static PUBLIC m ) + set ( KLU_STATIC_LIBS "${KLU_STATIC_LIBS} -lm" ) + target_link_libraries ( KLU_static PUBLIC m ) endif ( ) endif ( ) -# amd: -target_link_libraries ( klu PRIVATE ${AMD_LIBRARIES} ) +# AMD: +target_link_libraries ( KLU PRIVATE SuiteSparse::AMD ) +target_include_directories ( KLU PUBLIC + "$" ) if ( NOT NSTATIC ) - target_link_libraries ( klu_static PUBLIC ${AMD_STATIC} ) + if ( TARGET SuiteSparse::AMD_static ) + target_link_libraries ( KLU_static PUBLIC SuiteSparse::AMD_static ) + else ( ) + target_link_libraries ( KLU_static PUBLIC SuiteSparse::AMD ) + endif ( ) endif ( ) -# colamd: -target_link_libraries ( klu PRIVATE ${COLAMD_LIBRARIES} ) +# COLAMD: +target_link_libraries ( KLU PRIVATE SuiteSparse::COLAMD ) +target_include_directories ( KLU PUBLIC + "$" ) if ( NOT NSTATIC ) - target_link_libraries ( klu_static PUBLIC ${COLAMD_STATIC} ) + if ( TARGET SuiteSparse::COLAMD_static ) + target_link_libraries ( KLU_static PUBLIC SuiteSparse::COLAMD_static ) + else ( ) + target_link_libraries ( KLU_static PUBLIC SuiteSparse::COLAMD ) + endif ( ) endif ( ) -# btf: -target_link_libraries ( klu PRIVATE ${BTF_LIBRARIES} ) +# BTF: +target_link_libraries ( KLU PRIVATE SuiteSparse::BTF ) +target_include_directories ( KLU PUBLIC + "$" ) if ( NOT NSTATIC ) - target_link_libraries ( klu_static PUBLIC ${BTF_STATIC} ) + if ( TARGET SuiteSparse::BTF_static ) + target_link_libraries ( KLU_static PUBLIC SuiteSparse::BTF_static ) + else ( ) + target_link_libraries ( KLU_static PUBLIC SuiteSparse::BTF ) + endif ( ) endif ( ) if ( NOT NCHOLMOD ) - # cholmod: + # CHOLMOD: # link with CHOLMOD and its dependencies, both required and optional - target_link_libraries ( klu PRIVATE - ${CHOLMOD_LIBRARIES} ${CHOLMOD_CUDA_LIBRARIES} - ${AMD_LIBRARIES} ${COLAMD_LIBRARIES} - ${CAMD_LIBRARIES} ${CCOLAMD_LIBRARIES} ) - target_link_libraries ( klu_cholmod PRIVATE - ${CHOLMOD_LIBRARIES} ${CHOLMOD_CUDA_LIBRARIES} - ${AMD_LIBRARIES} ${COLAMD_LIBRARIES} - ${CAMD_LIBRARIES} ${CCOLAMD_LIBRARIES} ) + # CHOLMOD without CUDA + target_link_libraries ( KLU PRIVATE + SuiteSparse::CHOLMOD ) + target_link_libraries ( KLU_CHOLMOD PRIVATE + SuiteSparse::CHOLMOD ) if ( NOT NSTATIC ) - target_link_libraries ( klu_static PUBLIC - ${CHOLMOD_STATIC} ${CHOLMOD_CUDA_STATIC} - ${AMD_STATIC} ${COLAMD_STATIC} - ${CAMD_STATIC} ${CCOLAMD_STATIC} ) - target_link_libraries ( klu_cholmod_static PUBLIC - ${CHOLMOD_STATIC} ${CHOLMOD_CUDA_STATIC} - ${AMD_STATIC} ${COLAMD_STATIC} - ${CAMD_STATIC} ${CCOLAMD_STATIC} ) + set ( KLU_STATIC_MODULES "${KLU_STATIC_MODULES} CHOLMOD" ) + if ( TARGET SuiteSparse::CHOLMOD_static ) + target_link_libraries ( KLU_static PUBLIC SuiteSparse::CHOLMOD_static ) + target_link_libraries ( KLU_CHOLMOD_static PUBLIC SuiteSparse::CHOLMOD_static ) + else ( ) + target_link_libraries ( KLU_static PUBLIC SuiteSparse::CHOLMOD ) + target_link_libraries ( KLU_CHOLMOD_static PUBLIC SuiteSparse::CHOLMOD ) + endif ( ) endif ( ) # klu: - target_link_libraries ( klu_cholmod PRIVATE klu ${BTF_LIBRARIES} ) + target_link_libraries ( KLU_CHOLMOD PRIVATE KLU SuiteSparse::BTF ) if ( NOT NSTATIC ) - target_link_libraries ( klu_cholmod_static PUBLIC - klu_static ${BTF_STATIC} ) + if ( TARGET SuiteSparse::BTF_static ) + target_link_libraries ( KLU_CHOLMOD_static PUBLIC SuiteSparse::BTF_static ) + else ( ) + target_link_libraries ( KLU_CHOLMOD_static PUBLIC SuiteSparse::BTF ) + endif ( ) endif ( ) endif ( ) @@ -241,32 +328,143 @@ endif ( ) # KLU installation location #------------------------------------------------------------------------------- -install ( TARGETS klu +include ( CMakePackageConfigHelpers ) + +install ( TARGETS KLU + EXPORT KLUTargets LIBRARY DESTINATION ${SUITESPARSE_LIBDIR} ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} RUNTIME DESTINATION ${SUITESPARSE_BINDIR} PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} ) -install ( FILES - ${CMAKE_SOURCE_DIR}/cmake_modules/FindKLU.cmake - ${CMAKE_SOURCE_DIR}/cmake_modules/FindKLU_CHOLMOD.cmake - DESTINATION ${SUITESPARSE_LIBDIR}/cmake/SuiteSparse - COMPONENT Development ) if ( NOT NSTATIC ) - install ( TARGETS klu_static + install ( TARGETS KLU_static + EXPORT KLUTargets ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} ) endif ( ) +# create (temporary) export target file during build +export ( EXPORT KLUTargets + NAMESPACE SuiteSparse:: + FILE ${CMAKE_CURRENT_BINARY_DIR}/KLUTargets.cmake ) + +# install export target, config and version files for find_package +install ( EXPORT KLUTargets + NAMESPACE SuiteSparse:: + DESTINATION ${SUITESPARSE_LIBDIR}/cmake/KLU ) + +configure_package_config_file ( + Config/KLUConfig.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/KLUConfig.cmake + INSTALL_DESTINATION ${SUITESPARSE_LIBDIR}/cmake/KLU ) + +write_basic_package_version_file ( + ${CMAKE_CURRENT_BINARY_DIR}/KLUConfigVersion.cmake + COMPATIBILITY SameMajorVersion ) + +install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/KLUConfig.cmake + ${CMAKE_CURRENT_BINARY_DIR}/KLUConfigVersion.cmake + DESTINATION ${SUITESPARSE_LIBDIR}/cmake/KLU ) + +#------------------------------------------------------------------------------- +# create pkg-config file for KLU +#------------------------------------------------------------------------------- + +if ( NOT MSVC ) + set ( prefix "${CMAKE_INSTALL_PREFIX}" ) + set ( exec_prefix "\${prefix}" ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) + if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) + set ( libdir "${SUITESPARSE_LIBDIR}") + else ( ) + set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") + endif ( ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) + if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) + set ( includedir "${SUITESPARSE_INCLUDEDIR}") + else ( ) + set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + endif ( ) + configure_file ( + Config/KLU.pc.in + KLU.pc + @ONLY + NEWLINE_STYLE LF ) + install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/KLU.pc + DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) +endif ( ) + +#------------------------------------------------------------------------------- +# KLU_CHOLMOD installation +#------------------------------------------------------------------------------- + if ( NOT NCHOLMOD ) - install ( TARGETS klu_cholmod + install ( TARGETS KLU_CHOLMOD + EXPORT KLU_CHOLMODTargets LIBRARY DESTINATION ${SUITESPARSE_LIBDIR} ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} RUNTIME DESTINATION ${SUITESPARSE_BINDIR} PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} ) if ( NOT NSTATIC ) - install ( TARGETS klu_cholmod_static + install ( TARGETS KLU_CHOLMOD_static + EXPORT KLU_CHOLMODTargets ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} ) endif ( ) + + # create (temporary) export target file during build + export ( EXPORT KLU_CHOLMODTargets + NAMESPACE SuiteSparse:: + FILE ${CMAKE_CURRENT_BINARY_DIR}/KLU_CHOLMODTargets.cmake ) + + # install export target, config and version files for find_package + install ( EXPORT KLU_CHOLMODTargets + NAMESPACE SuiteSparse:: + DESTINATION ${SUITESPARSE_LIBDIR}/cmake/KLU_CHOLMOD ) + + configure_package_config_file ( + Config/KLU_CHOLMODConfig.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/KLU_CHOLMODConfig.cmake + INSTALL_DESTINATION ${SUITESPARSE_LIBDIR}/cmake/KLU_CHOLMOD ) + + write_basic_package_version_file ( + ${CMAKE_CURRENT_BINARY_DIR}/KLU_CHOLMODConfigVersion.cmake + COMPATIBILITY SameMajorVersion ) + + install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/KLU_CHOLMODConfig.cmake + ${CMAKE_CURRENT_BINARY_DIR}/KLU_CHOLMODConfigVersion.cmake + DESTINATION ${SUITESPARSE_LIBDIR}/cmake/KLU_CHOLMOD ) + + #--------------------------------------------------------------------------- + # create pkg-config file for KLU_CHOLMOD + #--------------------------------------------------------------------------- + + if ( NOT MSVC ) + set ( prefix "${CMAKE_INSTALL_PREFIX}" ) + set ( exec_prefix "\${prefix}" ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) + if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) + set ( libdir "${SUITESPARSE_LIBDIR}") + else ( ) + set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") + endif ( ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) + if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) + set ( includedir "${SUITESPARSE_INCLUDEDIR}") + else ( ) + set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + endif ( ) + configure_file ( + Config/KLU_CHOLMOD.pc.in + KLU_CHOLMOD.pc + @ONLY + NEWLINE_STYLE LF ) + install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/KLU_CHOLMOD.pc + DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) + endif ( ) endif ( ) #------------------------------------------------------------------------------- @@ -293,10 +491,10 @@ if ( DEMO ) endif ( ) # Libraries required for Demo programs - target_link_libraries ( klu_simple PUBLIC klu ) + target_link_libraries ( klu_simple PUBLIC KLU ) if ( NOT NCHOLMOD ) - target_link_libraries ( kludemo PUBLIC klu_cholmod klu ${CHOLMOD_LIBRARIES} ) - target_link_libraries ( kluldemo PUBLIC klu_cholmod klu ${CHOLMOD_LIBRARIES} ) + target_link_libraries ( kludemo PUBLIC KLU_CHOLMOD KLU SuiteSparse::CHOLMOD ) + target_link_libraries ( kluldemo PUBLIC KLU_CHOLMOD KLU SuiteSparse::CHOLMOD ) if ( NOT WIN32 ) target_link_libraries ( kludemo PUBLIC m ) target_link_libraries ( kluldemo PUBLIC m ) diff --git a/KLU/Config/KLU.pc.in b/KLU/Config/KLU.pc.in new file mode 100644 index 000000000..ae7f5bfe4 --- /dev/null +++ b/KLU/Config/KLU.pc.in @@ -0,0 +1,17 @@ +# KLU, Copyright (c) 2004-2023, Timothy A. Davis. +# All Rights Reserved. +# SPDX-License-Identifier: LGPL-2.1-or-later + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: KLU +URL: https://github.com/DrTimothyAldenDavis/SuiteSparse +Description: Routines for solving sparse linear systems of equations in SuiteSparse +Version: @KLU_VERSION_MAJOR@.@KLU_VERSION_MINOR@.@KLU_VERSION_SUB@ +Requires.private: SuiteSparse_config AMD COLAMD BTF @KLU_STATIC_MODULES@ +Libs: -L${libdir} -lklu +Libs.private: @KLU_STATIC_LIBS@ +Cflags: -I${includedir} diff --git a/KLU/Config/KLUConfig.cmake.in b/KLU/Config/KLUConfig.cmake.in new file mode 100644 index 000000000..a1049ed13 --- /dev/null +++ b/KLU/Config/KLUConfig.cmake.in @@ -0,0 +1,121 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/KLU/cmake_modules/KLUConfig.cmake +#------------------------------------------------------------------------------- + +# The following copyright and license applies to just this file only, not to +# the library itself: +# KLUConfig.cmake, Copyright (c) 2023, Timothy A. Davis. All Rights Reserved. +# SPDX-License-Identifier: BSD-3-clause + +#------------------------------------------------------------------------------- + +# Finds the KLU include file and compiled library. +# The following targets are defined: +# SuiteSparse::KLU - for the shared library (if available) +# SuiteSparse::KLU_static - for the static library (if available) + +# For backward compatibility the following variables are set: + +# KLU_INCLUDE_DIR - where to find klu.h +# KLU_LIBRARY - dynamic KLU library +# KLU_STATIC - static KLU library +# KLU_LIBRARIES - libraries when using KLU +# KLU_FOUND - true if KLU found + +# Set ``CMAKE_MODULE_PATH`` to the parent folder where this module file is +# installed. + +#------------------------------------------------------------------------------- + +@PACKAGE_INIT@ + +set ( KLU_DATE "@KLU_DATE@" ) +set ( KLU_VERSION_MAJOR @KLU_VERSION_MAJOR@ ) +set ( KLU_VERSION_MINOR @KLU_VERSION_MINOR@ ) +set ( KLU_VERSION_PATCH @KLU_VERSION_SUB@ ) +set ( KLU_VERSION "@KLU_VERSION_MAJOR@.@KLU_VERSION_MINOR@.@KLU_VERSION_SUB@" ) + +include ( ${CMAKE_CURRENT_LIST_DIR}/KLUTargets.cmake ) + +# The following is only for backward compatibility with FindKLU. + +set ( _target_shared SuiteSparse::KLU ) +set ( _target_static SuiteSparse::KLU_static ) +set ( _var_prefix "KLU" ) + +get_target_property ( ${_var_prefix}_INCLUDE_DIR ${_target_shared} INTERFACE_INCLUDE_DIRECTORIES ) +if ( ${_var_prefix}_INCLUDE_DIR ) + # First item in SuiteSparse targets contains the "main" header directory. + list ( GET ${_var_prefix}_INCLUDE_DIR 0 ${_var_prefix}_INCLUDE_DIR ) +endif ( ) +get_target_property ( ${_var_prefix}_LIBRARY ${_target_shared} IMPORTED_IMPLIB ) +if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} IMPORTED_LOCATION ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) +endif ( ) +if ( TARGET ${_target_static} ) + get_target_property ( ${_var_prefix}_STATIC ${_target_static} IMPORTED_LOCATION ) +endif ( ) + +# Check for most common build types +set ( _config_types "Debug" "Release" "RelWithDebInfo" "MinSizeRel" ) + +get_property ( _isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG ) +if ( _isMultiConfig ) + # For multi-configuration generators (e.g., Visual Studio), prefer those + # configurations. + list ( PREPEND _config_types ${CMAKE_CONFIGURATION_TYPES} ) +else ( ) + # For single-configuration generators, prefer the current configuration. + list ( PREPEND _config_types ${CMAKE_BUILD_TYPE} ) +endif ( ) + +list ( REMOVE_DUPLICATES _config_types ) + +foreach ( _config ${_config_types} ) + string ( TOUPPER ${_config} _uc_config ) + if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} + IMPORTED_IMPLIB_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) + endif ( ) + if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} + IMPORTED_LOCATION_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) + endif ( ) + if ( TARGET ${_target_static} AND NOT ${_var_prefix}_STATIC ) + get_target_property ( _library_chk ${_target_static} + IMPORTED_LOCATION_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_STATIC ${_library_chk} ) + endif ( ) + endif ( ) +endforeach ( ) + +set ( KLU_LIBRARIES ${KLU_LIBRARY} ) + +macro ( suitesparse_check_exist _var _files ) + # ignore generator expressions + string ( GENEX_STRIP "${_files}" _files2 ) + + foreach ( _file ${_files2} ) + if ( NOT EXISTS "${_file}" ) + message ( FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist!" ) + endif ( ) + endforeach () +endmacro ( ) + +suitesparse_check_exist ( KLU_INCLUDE_DIR ${KLU_INCLUDE_DIR} ) +suitesparse_check_exist ( KLU_LIBRARY ${KLU_LIBRARY} ) + +message ( STATUS "KLU version: ${KLU_VERSION}" ) +message ( STATUS "KLU include: ${KLU_INCLUDE_DIR}" ) +message ( STATUS "KLU library: ${KLU_LIBRARY}" ) +message ( STATUS "KLU static: ${KLU_STATIC}" ) diff --git a/KLU/Config/KLU_CHOLMOD.pc.in b/KLU/Config/KLU_CHOLMOD.pc.in new file mode 100644 index 000000000..a0db411bb --- /dev/null +++ b/KLU/Config/KLU_CHOLMOD.pc.in @@ -0,0 +1,16 @@ +# KLU_CHOLMOD, Copyright (c) 2004-2023, Timothy A. Davis. +# All Rights Reserved. +# SPDX-License-Identifier: LGPL-2.1-or-later + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: KLU_CHOLMOD +URL: https://github.com/DrTimothyAldenDavis/SuiteSparse +Description: Routines for sample ordering for KLU in SuiteSparse +Version: @KLU_VERSION_MAJOR@.@KLU_VERSION_MINOR@.@KLU_VERSION_SUB@ +Requires.private: KLU BTF CHOLMOD CHOLMOD_CUDA +Libs: -L${libdir} -lklu_cholmod +Cflags: -I${includedir} diff --git a/KLU/Config/KLU_CHOLMODConfig.cmake.in b/KLU/Config/KLU_CHOLMODConfig.cmake.in new file mode 100644 index 000000000..73a849d4a --- /dev/null +++ b/KLU/Config/KLU_CHOLMODConfig.cmake.in @@ -0,0 +1,121 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/KLU/cmake_modules/KLU_CHOLMODConfig.cmake +#------------------------------------------------------------------------------- + +# The following copyright and license applies to just this file only, not to +# the library itself: +# KLU_CHOLMODConfig.cmake, Copyright (c) 2023, Timothy A. Davis. All Rights Reserved. +# SPDX-License-Identifier: BSD-3-clause + +#------------------------------------------------------------------------------- + +# Finds the KLU include file and compiled library. +# The following targets are defined: +# SuiteSparse::KLU_CHOLMOD - for the shared library (if available) +# SuiteSparse::KLU_CHOLMOD_static - for the static library (if available) + +# For backward compatibility the following variables are set: + +# KLU_CHOLMOD_INCLUDE_DIR - where to find klu_cholmod.h +# KLU_CHOLMOD_LIBRARY - compiled KLU_CHOLMOD library +# KLU_CHOLMOD_STATIC - static KLU_CHOLMOD library +# KLU_CHOLMOD_LIBRARIES - libraries when using KLU_CHOLMOD +# KLU_CHOLMOD_FOUND - true if KLU_CHOLMOD found + +# Set ``CMAKE_MODULE_PATH`` to the parent folder where this module file is +# installed. + +#------------------------------------------------------------------------------- + +@PACKAGE_INIT@ + +set ( KLU_CHOLMOD_DATE "@KLU_DATE@" ) +set ( KLU_CHOLMOD_VERSION_MAJOR @KLU_VERSION_MAJOR@ ) +set ( KLU_CHOLMOD_VERSION_MINOR @KLU_VERSION_MINOR@ ) +set ( KLU_CHOLMOD_VERSION_PATCH @KLU_VERSION_SUB@ ) +set ( KLU_CHOLMOD_VERSION "@KLU_VERSION_MAJOR@.@KLU_VERSION_MINOR@.@KLU_VERSION_SUB@" ) + +include ( ${CMAKE_CURRENT_LIST_DIR}/KLU_CHOLMODTargets.cmake ) + +# The following is only for backward compatibility with FindKLU_CHOLMOD. + +set ( _target_shared SuiteSparse::KLU_CHOLMOD ) +set ( _target_static SuiteSparse::KLU_CHOLMOD_static ) +set ( _var_prefix "KLU_CHOLMOD" ) + +get_target_property ( ${_var_prefix}_INCLUDE_DIR ${_target_shared} INTERFACE_INCLUDE_DIRECTORIES ) +if ( ${_var_prefix}_INCLUDE_DIR ) + # First item in SuiteSparse targets contains the "main" header directory. + list ( GET ${_var_prefix}_INCLUDE_DIR 0 ${_var_prefix}_INCLUDE_DIR ) +endif ( ) +get_target_property ( ${_var_prefix}_LIBRARY ${_target_shared} IMPORTED_IMPLIB ) +if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} IMPORTED_LOCATION ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) +endif ( ) +if ( TARGET ${_target_static} ) + get_target_property ( ${_var_prefix}_STATIC ${_target_static} IMPORTED_LOCATION ) +endif ( ) + +# Check for most common build types +set ( _config_types "Debug" "Release" "RelWithDebInfo" "MinSizeRel" ) + +get_property ( _isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG ) +if ( _isMultiConfig ) + # For multi-configuration generators (e.g., Visual Studio), prefer those + # configurations. + list ( PREPEND _config_types ${CMAKE_CONFIGURATION_TYPES} ) +else ( ) + # For single-configuration generators, prefer the current configuration. + list ( PREPEND _config_types ${CMAKE_BUILD_TYPE} ) +endif ( ) + +list ( REMOVE_DUPLICATES _config_types ) + +foreach ( _config ${_config_types} ) + string ( TOUPPER ${_config} _uc_config ) + if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} + IMPORTED_IMPLIB_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) + endif ( ) + if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} + IMPORTED_LOCATION_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) + endif ( ) + if ( TARGET ${_target_static} AND NOT ${_var_prefix}_STATIC ) + get_target_property ( _library_chk ${_target_static} + IMPORTED_LOCATION_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_STATIC ${_library_chk} ) + endif ( ) + endif ( ) +endforeach ( ) + +set ( KLU_CHOLMOD_LIBRARIES ${KLU_CHOLMOD_LIBRARY} ) + +macro ( suitesparse_check_exist _var _files ) + # ignore generator expressions + string ( GENEX_STRIP "${_files}" _files2 ) + + foreach ( _file ${_files2} ) + if ( NOT EXISTS "${_file}" ) + message ( FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist!" ) + endif ( ) + endforeach () +endmacro ( ) + +suitesparse_check_exist ( KLU_CHOLMOD_INCLUDE_DIR ${KLU_CHOLMOD_INCLUDE_DIR} ) +suitesparse_check_exist ( KLU_CHOLMOD_LIBRARY ${KLU_CHOLMOD_LIBRARY} ) + +message ( STATUS "KLU_CHOLMOD version: ${KLU_CHOLMOD_VERSION}" ) +message ( STATUS "KLU_CHOLMOD include: ${KLU_CHOLMOD_INCLUDE_DIR}" ) +message ( STATUS "KLU_CHOLMOD library: ${KLU_CHOLMOD_LIBRARY}" ) +message ( STATUS "KLU_CHOLMOD static: ${KLU_CHOLMOD_STATIC}" ) diff --git a/KLU/Demo/kludemo.out b/KLU/Demo/kludemo.out index 1e074bbb4..f9d1cc1c9 100644 --- a/KLU/Demo/kludemo.out +++ b/KLU/Demo/kludemo.out @@ -1,3 +1,175 @@ +( cd build && cmake .. && cmake --build . --config Release -j8 ) +-- Building KLU version: v2.2.0 (Sept 8, 2023) +-- Source: /home/faculty/d/davis/dev2/SuiteSparse/KLU +-- Build: /home/faculty/d/davis/dev2/SuiteSparse/KLU/build +-- Install lib: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Install include: /home/faculty/d/davis/dev2/SuiteSparse/include +-- Install bin: /home/faculty/d/davis/dev2/SuiteSparse/bin +-- Install rpath: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Build rpath: /home/faculty/d/davis/dev2/SuiteSparse/KLU/build;/home/faculty/d/davis/dev2/SuiteSparse/lib +-- Build type: Release +-- Fortran: /usr/bin/f95 +-- Looking for CUDA +-- Find CUDA tool kit: +-- Found CUDAToolkit: /usr/local/cuda/include (found version "11.7.99") +-- CUDA toolkit found: TRUE +-- CUDA toolkit version: 11.7.99 +-- CUDA toolkit include: /usr/local/cuda/include +-- CUDA toolkit lib dir: /usr/local/cuda/lib64 +-- CUDA: enabled +-- SuiteSparse_config version: 7.2.0 +-- SuiteSparse_config include: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config +-- SuiteSparse_config library: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.so.7.2.0 +-- SuiteSparse_config static: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.a +-- BTF version: 2.2.0 +-- BTF include: /home/faculty/d/davis/dev2/SuiteSparse/BTF/Include +-- BTF library: /home/faculty/d/davis/dev2/SuiteSparse/BTF/build/libbtf.so.2.2.0 +-- BTF static: /home/faculty/d/davis/dev2/SuiteSparse/BTF/build/libbtf.a +-- COLAMD version: 3.2.0 +-- COLAMD include: /home/faculty/d/davis/dev2/SuiteSparse/COLAMD/Include +-- COLAMD library: /home/faculty/d/davis/dev2/SuiteSparse/COLAMD/build/libcolamd.so.3.2.0 +-- COLAMD static: /home/faculty/d/davis/dev2/SuiteSparse/COLAMD/build/libcolamd.a +-- AMD version: 3.2.0 +-- AMD include: /home/faculty/d/davis/dev2/SuiteSparse/AMD/Include +-- AMD library: /home/faculty/d/davis/dev2/SuiteSparse/AMD/build/libamd.so.3.2.0 +-- AMD static: /home/faculty/d/davis/dev2/SuiteSparse/AMD/build/libamd.a +-- Found CUDAToolkit: /usr/local/cuda/include (found suitable version "11.7.99", minimum required is "11") +-- CHOLMOD_CUDA version: 4.2.0 +-- CHOLMOD_CUDA library: /home/faculty/d/davis/dev2/SuiteSparse/CHOLMOD/build/GPU/libcholmod_cuda.so.4.2.0 +-- CHOLMOD_CUDA static: /home/faculty/d/davis/dev2/SuiteSparse/CHOLMOD/build/GPU/libcholmod_cuda.a +-- CHOLMOD version: 4.2.0 +-- CHOLMOD include: /home/faculty/d/davis/dev2/SuiteSparse/CHOLMOD/Include +-- CHOLMOD library: /home/faculty/d/davis/dev2/SuiteSparse/CHOLMOD/build/libcholmod.so.4.2.0 +-- CHOLMOD static: /home/faculty/d/davis/dev2/SuiteSparse/CHOLMOD/build/libcholmod.a +-- CHOLMOD_CUDA version: 4.2.0 +-- CHOLMOD_CUDA library: /home/faculty/d/davis/dev2/SuiteSparse/CHOLMOD/build/GPU/libcholmod_cuda.so.4.2.0 +-- CHOLMOD_CUDA static: /home/faculty/d/davis/dev2/SuiteSparse/CHOLMOD/build/GPU/libcholmod_cuda.a +-- CAMD version: 3.2.0 +-- CAMD include: /home/faculty/d/davis/dev2/SuiteSparse/CAMD/Include +-- CAMD library: /home/faculty/d/davis/dev2/SuiteSparse/CAMD/build/libcamd.so.3.2.0 +-- CAMD static: /home/faculty/d/davis/dev2/SuiteSparse/CAMD/build/libcamd.a +-- CCOLAMD version: 3.2.0 +-- CCOLAMD include: /home/faculty/d/davis/dev2/SuiteSparse/CCOLAMD/Include +-- CCOLAMD library: /home/faculty/d/davis/dev2/SuiteSparse/CCOLAMD/build/libccolamd.so.3.2.0 +-- CCOLAMD static: /home/faculty/d/davis/dev2/SuiteSparse/CCOLAMD/build/libccolamd.a +-- Using CHOLMOD for addtional pre-ordering options +-- Also compiling the demos in KLU/Demo +-- ------------------------------------------------------------------------ +-- SuiteSparse CMAKE report for: klu +-- ------------------------------------------------------------------------ +-- inside common SuiteSparse root: true +-- install in SuiteSparse/lib and SuiteSparse/include: 1 +-- build type: Release +-- NSTATIC: false (build static library) +-- use OpenMP: no +-- C compiler: /usr/bin/cc +-- C flags: +-- C++ compiler: /usr/bin/c++ +-- C++ flags: +-- C Flags release: -O3 -DNDEBUG +-- C++ Flags release: -O3 -DNDEBUG +-- Fortran compiler: /usr/bin/f95 +-- compile definitions: SUITESPARSE_CUDA +-- CUDA architectures: 52;75;80 +-- ------------------------------------------------------------------------ +-- Configuring done (0.3s) +-- Generating done (0.0s) +-- Build files have been written to: /home/faculty/d/davis/dev2/SuiteSparse/KLU/build +gmake[1]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/KLU/build' +[ 3%] Built target KLU_CHOLMOD_static +[ 48%] Built target KLU_static +[ 93%] Built target KLU +[ 95%] Built target KLU_CHOLMOD +[ 96%] Built target klu_simple +[ 98%] Built target kludemo +[100%] Built target kluldemo +gmake[1]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/KLU/build' +( cd build && cmake -DDEMO=1 .. && cmake --build . --config Release -j8 ) +-- Building KLU version: v2.2.0 (Sept 8, 2023) +-- Source: /home/faculty/d/davis/dev2/SuiteSparse/KLU +-- Build: /home/faculty/d/davis/dev2/SuiteSparse/KLU/build +-- Install lib: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Install include: /home/faculty/d/davis/dev2/SuiteSparse/include +-- Install bin: /home/faculty/d/davis/dev2/SuiteSparse/bin +-- Install rpath: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Build rpath: /home/faculty/d/davis/dev2/SuiteSparse/KLU/build;/home/faculty/d/davis/dev2/SuiteSparse/lib +-- Build type: Release +-- Fortran: /usr/bin/f95 +-- Looking for CUDA +-- Find CUDA tool kit: +-- Found CUDAToolkit: /usr/local/cuda/include (found version "11.7.99") +-- CUDA toolkit found: TRUE +-- CUDA toolkit version: 11.7.99 +-- CUDA toolkit include: /usr/local/cuda/include +-- CUDA toolkit lib dir: /usr/local/cuda/lib64 +-- CUDA: enabled +-- SuiteSparse_config version: 7.2.0 +-- SuiteSparse_config include: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config +-- SuiteSparse_config library: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.so.7.2.0 +-- SuiteSparse_config static: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.a +-- BTF version: 2.2.0 +-- BTF include: /home/faculty/d/davis/dev2/SuiteSparse/BTF/Include +-- BTF library: /home/faculty/d/davis/dev2/SuiteSparse/BTF/build/libbtf.so.2.2.0 +-- BTF static: /home/faculty/d/davis/dev2/SuiteSparse/BTF/build/libbtf.a +-- COLAMD version: 3.2.0 +-- COLAMD include: /home/faculty/d/davis/dev2/SuiteSparse/COLAMD/Include +-- COLAMD library: /home/faculty/d/davis/dev2/SuiteSparse/COLAMD/build/libcolamd.so.3.2.0 +-- COLAMD static: /home/faculty/d/davis/dev2/SuiteSparse/COLAMD/build/libcolamd.a +-- AMD version: 3.2.0 +-- AMD include: /home/faculty/d/davis/dev2/SuiteSparse/AMD/Include +-- AMD library: /home/faculty/d/davis/dev2/SuiteSparse/AMD/build/libamd.so.3.2.0 +-- AMD static: /home/faculty/d/davis/dev2/SuiteSparse/AMD/build/libamd.a +-- Found CUDAToolkit: /usr/local/cuda/include (found suitable version "11.7.99", minimum required is "11") +-- CHOLMOD_CUDA version: 4.2.0 +-- CHOLMOD_CUDA library: /home/faculty/d/davis/dev2/SuiteSparse/CHOLMOD/build/GPU/libcholmod_cuda.so.4.2.0 +-- CHOLMOD_CUDA static: /home/faculty/d/davis/dev2/SuiteSparse/CHOLMOD/build/GPU/libcholmod_cuda.a +-- CHOLMOD version: 4.2.0 +-- CHOLMOD include: /home/faculty/d/davis/dev2/SuiteSparse/CHOLMOD/Include +-- CHOLMOD library: /home/faculty/d/davis/dev2/SuiteSparse/CHOLMOD/build/libcholmod.so.4.2.0 +-- CHOLMOD static: /home/faculty/d/davis/dev2/SuiteSparse/CHOLMOD/build/libcholmod.a +-- CHOLMOD_CUDA version: 4.2.0 +-- CHOLMOD_CUDA library: /home/faculty/d/davis/dev2/SuiteSparse/CHOLMOD/build/GPU/libcholmod_cuda.so.4.2.0 +-- CHOLMOD_CUDA static: /home/faculty/d/davis/dev2/SuiteSparse/CHOLMOD/build/GPU/libcholmod_cuda.a +-- CAMD version: 3.2.0 +-- CAMD include: /home/faculty/d/davis/dev2/SuiteSparse/CAMD/Include +-- CAMD library: /home/faculty/d/davis/dev2/SuiteSparse/CAMD/build/libcamd.so.3.2.0 +-- CAMD static: /home/faculty/d/davis/dev2/SuiteSparse/CAMD/build/libcamd.a +-- CCOLAMD version: 3.2.0 +-- CCOLAMD include: /home/faculty/d/davis/dev2/SuiteSparse/CCOLAMD/Include +-- CCOLAMD library: /home/faculty/d/davis/dev2/SuiteSparse/CCOLAMD/build/libccolamd.so.3.2.0 +-- CCOLAMD static: /home/faculty/d/davis/dev2/SuiteSparse/CCOLAMD/build/libccolamd.a +-- Using CHOLMOD for addtional pre-ordering options +-- Also compiling the demos in KLU/Demo +-- ------------------------------------------------------------------------ +-- SuiteSparse CMAKE report for: klu +-- ------------------------------------------------------------------------ +-- inside common SuiteSparse root: true +-- install in SuiteSparse/lib and SuiteSparse/include: 1 +-- build type: Release +-- NSTATIC: false (build static library) +-- use OpenMP: no +-- C compiler: /usr/bin/cc +-- C flags: +-- C++ compiler: /usr/bin/c++ +-- C++ flags: +-- C Flags release: -O3 -DNDEBUG +-- C++ Flags release: -O3 -DNDEBUG +-- Fortran compiler: /usr/bin/f95 +-- compile definitions: SUITESPARSE_CUDA +-- CUDA architectures: 52;75;80 +-- ------------------------------------------------------------------------ +-- Configuring done (0.3s) +-- Generating done (0.0s) +-- Build files have been written to: /home/faculty/d/davis/dev2/SuiteSparse/KLU/build +gmake[1]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/KLU/build' +[ 3%] Built target KLU_CHOLMOD_static +[ 48%] Built target KLU_static +[ 93%] Built target KLU +[ 95%] Built target KLU_CHOLMOD +[ 96%] Built target klu_simple +[ 98%] Built target kludemo +[100%] Built target kluldemo +gmake[1]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/KLU/build' ./build/klu_simple x [0] = 1 x [1] = 2 @@ -7,188 +179,188 @@ x [4] = 5 ./build/kludemo < ./Matrix/1c.mtx default ordering: -KLU: Jan 9, 2023, version: 2.0.3 +KLU: Sept 8, 2023, version: 2.2.0 n 1 nnz(A) 1 nnz(L+U+F) 1 resid 0 recip growth 1 condest 1 rcond 1 flops 0 peak memory usage: 492 bytes CHOLMOD AMD ordering: -KLU: Jan 9, 2023, version: 2.0.3 +KLU: Sept 8, 2023, version: 2.2.0 n 1 nnz(A) 1 nnz(L+U+F) 1 resid 0 recip growth 1 condest 1 rcond 1 flops 0 peak memory usage: 492 bytes CHOLMOD METIS ordering: -KLU: Jan 9, 2023, version: 2.0.3 +KLU: Sept 8, 2023, version: 2.2.0 n 1 nnz(A) 1 nnz(L+U+F) 1 resid 0 recip growth 1 condest 1 rcond 1 flops 0 peak memory usage: 492 bytes ./build/kludemo < ./Matrix/arrowc.mtx default ordering: -KLU: Jan 9, 2023, version: 2.0.3 +KLU: Sept 8, 2023, version: 2.2.0 n 100 nnz(A) 298 nnz(L+U+F) 298 resid 1.68007e-14 recip growth 0.019999 condest 295.99 rcond 0.019999 flops 297 peak memory usage: 32244 bytes CHOLMOD AMD ordering: -KLU: Jan 9, 2023, version: 2.0.3 +KLU: Sept 8, 2023, version: 2.2.0 n 100 nnz(A) 298 nnz(L+U+F) 298 resid 1.68007e-14 recip growth 0.019999 condest 295.99 rcond 0.019999 flops 297 peak memory usage: 32244 bytes CHOLMOD METIS ordering: -KLU: Jan 9, 2023, version: 2.0.3 -n 100 nnz(A) 298 nnz(L+U+F) 298 resid 5.67084e-15 +KLU: Sept 8, 2023, version: 2.2.0 +n 100 nnz(A) 298 nnz(L+U+F) 298 resid 2.93788e-14 recip growth 0.019999 condest 295.99 rcond 0.019999 flops 297 peak memory usage: 32244 bytes ./build/kludemo < ./Matrix/arrow.mtx default ordering: -KLU: Jan 9, 2023, version: 2.0.3 +KLU: Sept 8, 2023, version: 2.2.0 n 100 nnz(A) 298 nnz(L+U+F) 298 resid 1.77636e-15 recip growth 0.0204082 condest 303 rcond 0.0204082 flops 297 peak memory usage: 20412 bytes CHOLMOD AMD ordering: -KLU: Jan 9, 2023, version: 2.0.3 +KLU: Sept 8, 2023, version: 2.2.0 n 100 nnz(A) 298 nnz(L+U+F) 298 resid 1.77636e-15 recip growth 0.0204082 condest 303 rcond 0.0204082 flops 297 peak memory usage: 20412 bytes CHOLMOD METIS ordering: -KLU: Jan 9, 2023, version: 2.0.3 -n 100 nnz(A) 298 nnz(L+U+F) 298 resid 1.77636e-15 +KLU: Sept 8, 2023, version: 2.2.0 +n 100 nnz(A) 298 nnz(L+U+F) 298 resid 1.9762e-14 recip growth 0.0204082 condest 303 rcond 0.0204082 flops 297 peak memory usage: 20412 bytes ./build/kludemo < ./Matrix/impcol_a.mtx default ordering: -KLU: Jan 9, 2023, version: 2.0.3 +KLU: Sept 8, 2023, version: 2.2.0 n 207 nnz(A) 572 nnz(L+U+F) 615 resid 6.98492e-10 recip growth 0.00957447 condest 4.35093e+07 rcond 4.5277e-05 flops 259 peak memory usage: 34276 bytes CHOLMOD AMD ordering: -KLU: Jan 9, 2023, version: 2.0.3 +KLU: Sept 8, 2023, version: 2.2.0 n 207 nnz(A) 572 nnz(L+U+F) 616 resid 6.98492e-10 recip growth 0.00957447 condest 4.35093e+07 rcond 4.5277e-05 flops 264 peak memory usage: 34276 bytes CHOLMOD METIS ordering: -KLU: Jan 9, 2023, version: 2.0.3 +KLU: Sept 8, 2023, version: 2.2.0 n 207 nnz(A) 572 nnz(L+U+F) 610 resid 4.65661e-10 recip growth 0.00588235 condest 4.35093e+07 rcond 2.44261e-05 flops 231 peak memory usage: 34548 bytes ./build/kludemo < ./Matrix/w156.mtx default ordering: -KLU: Jan 9, 2023, version: 2.0.3 +KLU: Sept 8, 2023, version: 2.2.0 n 156 nnz(A) 362 nnz(L+U+F) 396 resid 6.23816e-08 recip growth 0.00889922 condest 1.79787e+09 rcond 0.000124785 flops 175 peak memory usage: 39516 bytes CHOLMOD AMD ordering: -KLU: Jan 9, 2023, version: 2.0.3 +KLU: Sept 8, 2023, version: 2.2.0 n 156 nnz(A) 362 nnz(L+U+F) 396 resid 6.23816e-08 recip growth 0.00889922 condest 1.79787e+09 rcond 0.000124785 flops 175 peak memory usage: 39516 bytes CHOLMOD METIS ordering: -KLU: Jan 9, 2023, version: 2.0.3 -n 156 nnz(A) 362 nnz(L+U+F) 402 resid 5.08832e-10 -recip growth 0.00484701 condest 1.79787e+09 rcond 4.56786e-05 flops 191 -peak memory usage: 39868 bytes +KLU: Sept 8, 2023, version: 2.2.0 +n 156 nnz(A) 362 nnz(L+U+F) 406 resid 6.14058e-10 +recip growth 0.00285463 condest 1.79787e+09 rcond 2.69023e-05 flops 207 +peak memory usage: 40060 bytes ./build/kludemo < ./Matrix/ctina.mtx default ordering: -KLU: Jan 9, 2023, version: 2.0.3 +KLU: Sept 8, 2023, version: 2.2.0 n 11 nnz(A) 36 nnz(L+U+F) 45 resid 4.44089e-16 recip growth 1 condest 56 rcond 1 flops 73 peak memory usage: 4268 bytes CHOLMOD AMD ordering: -KLU: Jan 9, 2023, version: 2.0.3 +KLU: Sept 8, 2023, version: 2.2.0 n 11 nnz(A) 36 nnz(L+U+F) 45 resid 4.44089e-16 recip growth 1 condest 56 rcond 1 flops 73 peak memory usage: 4268 bytes CHOLMOD METIS ordering: -KLU: Jan 9, 2023, version: 2.0.3 -n 11 nnz(A) 36 nnz(L+U+F) 41 resid 4.44089e-16 -recip growth 1 condest 56 rcond 1 flops 49 +KLU: Sept 8, 2023, version: 2.2.0 +n 11 nnz(A) 36 nnz(L+U+F) 42 resid 4.44089e-16 +recip growth 1 condest 56 rcond 1 flops 54 peak memory usage: 4268 bytes ./build/kluldemo < ./Matrix/1c.mtx default ordering: -KLU: Jan 9, 2023, version: 2.0.3 +KLU: Sept 8, 2023, version: 2.2.0 n 1 nnz(A) 1 nnz(L+U+F) 1 resid 0 recip growth 1 condest 1 rcond 1 flops 0 peak memory usage: 600 bytes CHOLMOD AMD ordering: -KLU: Jan 9, 2023, version: 2.0.3 +KLU: Sept 8, 2023, version: 2.2.0 n 1 nnz(A) 1 nnz(L+U+F) 1 resid 0 recip growth 1 condest 1 rcond 1 flops 0 peak memory usage: 600 bytes CHOLMOD METIS ordering: -KLU: Jan 9, 2023, version: 2.0.3 +KLU: Sept 8, 2023, version: 2.2.0 n 1 nnz(A) 1 nnz(L+U+F) 1 resid 0 recip growth 1 condest 1 rcond 1 flops 0 peak memory usage: 600 bytes ./build/kluldemo < ./Matrix/arrowc.mtx default ordering: -KLU: Jan 9, 2023, version: 2.0.3 +KLU: Sept 8, 2023, version: 2.2.0 n 100 nnz(A) 298 nnz(L+U+F) 298 resid 1.68007e-14 recip growth 0.019999 condest 295.99 rcond 0.019999 flops 297 peak memory usage: 39000 bytes CHOLMOD AMD ordering: -KLU: Jan 9, 2023, version: 2.0.3 +KLU: Sept 8, 2023, version: 2.2.0 ------------------- KLU User n 100 nnz(A) 298 nnz(L+U+F) 298 resid 1.68007e-14 recip growth 0.019999 condest 295.99 rcond 0.019999 flops 297 peak memory usage: 39000 bytes CHOLMOD METIS ordering: -KLU: Jan 9, 2023, version: 2.0.3 +KLU: Sept 8, 2023, version: 2.2.0 ------------------- KLU User -n 100 nnz(A) 298 nnz(L+U+F) 298 resid 5.67084e-15 +n 100 nnz(A) 298 nnz(L+U+F) 298 resid 2.93788e-14 recip growth 0.019999 condest 295.99 rcond 0.019999 flops 297 peak memory usage: 39000 bytes ./build/kluldemo < ./Matrix/arrow.mtx default ordering: -KLU: Jan 9, 2023, version: 2.0.3 +KLU: Sept 8, 2023, version: 2.2.0 n 100 nnz(A) 298 nnz(L+U+F) 298 resid 1.77636e-15 recip growth 0.0204082 condest 303 rcond 0.0204082 flops 297 peak memory usage: 29584 bytes CHOLMOD AMD ordering: -KLU: Jan 9, 2023, version: 2.0.3 +KLU: Sept 8, 2023, version: 2.2.0 ------------------- KLU User n 100 nnz(A) 298 nnz(L+U+F) 298 resid 1.77636e-15 recip growth 0.0204082 condest 303 rcond 0.0204082 flops 297 peak memory usage: 29584 bytes CHOLMOD METIS ordering: -KLU: Jan 9, 2023, version: 2.0.3 +KLU: Sept 8, 2023, version: 2.2.0 ------------------- KLU User -n 100 nnz(A) 298 nnz(L+U+F) 298 resid 1.77636e-15 +n 100 nnz(A) 298 nnz(L+U+F) 298 resid 1.9762e-14 recip growth 0.0204082 condest 303 rcond 0.0204082 flops 297 peak memory usage: 29584 bytes ./build/kluldemo < ./Matrix/impcol_a.mtx default ordering: -KLU: Jan 9, 2023, version: 2.0.3 +KLU: Sept 8, 2023, version: 2.2.0 n 207 nnz(A) 572 nnz(L+U+F) 615 resid 6.98492e-10 recip growth 0.00957447 condest 4.35093e+07 rcond 4.5277e-05 flops 259 peak memory usage: 44800 bytes CHOLMOD AMD ordering: -KLU: Jan 9, 2023, version: 2.0.3 +KLU: Sept 8, 2023, version: 2.2.0 ------------------- KLU User ------------------- KLU User n 207 nnz(A) 572 nnz(L+U+F) 616 resid 6.98492e-10 @@ -196,7 +368,7 @@ recip growth 0.00957447 condest 4.35093e+07 rcond 4.5277e-05 flops 264 peak memory usage: 44800 bytes CHOLMOD METIS ordering: -KLU: Jan 9, 2023, version: 2.0.3 +KLU: Sept 8, 2023, version: 2.2.0 ------------------- KLU User ------------------- KLU User n 207 nnz(A) 572 nnz(L+U+F) 610 resid 4.65661e-10 @@ -205,42 +377,42 @@ peak memory usage: 45152 bytes ./build/kluldemo < ./Matrix/w156.mtx default ordering: -KLU: Jan 9, 2023, version: 2.0.3 +KLU: Sept 8, 2023, version: 2.2.0 n 156 nnz(A) 362 nnz(L+U+F) 396 resid 6.23816e-08 recip growth 0.00889922 condest 1.79787e+09 rcond 0.000124785 flops 175 peak memory usage: 47480 bytes CHOLMOD AMD ordering: -KLU: Jan 9, 2023, version: 2.0.3 +KLU: Sept 8, 2023, version: 2.2.0 ------------------- KLU User n 156 nnz(A) 362 nnz(L+U+F) 396 resid 6.23816e-08 recip growth 0.00889922 condest 1.79787e+09 rcond 0.000124785 flops 175 peak memory usage: 47480 bytes CHOLMOD METIS ordering: -KLU: Jan 9, 2023, version: 2.0.3 +KLU: Sept 8, 2023, version: 2.2.0 ------------------- KLU User -n 156 nnz(A) 362 nnz(L+U+F) 402 resid 5.08832e-10 -recip growth 0.00484701 condest 1.79787e+09 rcond 4.56786e-05 flops 191 -peak memory usage: 47928 bytes +n 156 nnz(A) 362 nnz(L+U+F) 406 resid 6.14058e-10 +recip growth 0.00285463 condest 1.79787e+09 rcond 2.69023e-05 flops 207 +peak memory usage: 48152 bytes ./build/kluldemo < ./Matrix/ctina.mtx default ordering: -KLU: Jan 9, 2023, version: 2.0.3 +KLU: Sept 8, 2023, version: 2.2.0 n 11 nnz(A) 36 nnz(L+U+F) 45 resid 4.44089e-16 recip growth 1 condest 56 rcond 1 flops 73 peak memory usage: 5144 bytes CHOLMOD AMD ordering: -KLU: Jan 9, 2023, version: 2.0.3 +KLU: Sept 8, 2023, version: 2.2.0 ------------------- KLU User n 11 nnz(A) 36 nnz(L+U+F) 45 resid 4.44089e-16 recip growth 1 condest 56 rcond 1 flops 73 peak memory usage: 5144 bytes CHOLMOD METIS ordering: -KLU: Jan 9, 2023, version: 2.0.3 +KLU: Sept 8, 2023, version: 2.2.0 ------------------- KLU User -n 11 nnz(A) 36 nnz(L+U+F) 41 resid 4.44089e-16 -recip growth 1 condest 56 rcond 1 flops 49 +n 11 nnz(A) 36 nnz(L+U+F) 42 resid 4.44089e-16 +recip growth 1 condest 56 rcond 1 flops 54 peak memory usage: 5144 bytes diff --git a/KLU/Doc/ChangeLog b/KLU/Doc/ChangeLog index 3744c0524..79a2222ff 100644 --- a/KLU/Doc/ChangeLog +++ b/KLU/Doc/ChangeLog @@ -1,3 +1,7 @@ +Sept 8, 2023: version 2.2.0 + + * cmake updates: SuiteSparse:: namespace by Markus Muetzel + June 16, 2023: version 2.0.4 * cmake build system updates: update by Markus Muetzel diff --git a/KLU/Doc/KLU_UserGuide.pdf b/KLU/Doc/KLU_UserGuide.pdf index 8f0997036..4d9ef7d87 100644 Binary files a/KLU/Doc/KLU_UserGuide.pdf and b/KLU/Doc/KLU_UserGuide.pdf differ diff --git a/KLU/Doc/klu_version.tex b/KLU/Doc/klu_version.tex index 5afb99073..47eff9253 100644 --- a/KLU/Doc/klu_version.tex +++ b/KLU/Doc/klu_version.tex @@ -1,2 +1,2 @@ % version of SuiteSparse/KLU -\date{VERSION 2.0.4, June 16, 2023} +\date{VERSION 2.2.0, Sept 8, 2023} diff --git a/KLU/Include/klu.h b/KLU/Include/klu.h index 136496501..48bcfbba2 100644 --- a/KLU/Include/klu.h +++ b/KLU/Include/klu.h @@ -814,10 +814,10 @@ void *klu_l_realloc (size_t, size_t, size_t, void *, klu_l_common *) ; * #endif */ -#define KLU_DATE "June 16, 2023" +#define KLU_DATE "Sept 8, 2023" #define KLU_MAIN_VERSION 2 -#define KLU_SUB_VERSION 0 -#define KLU_SUBSUB_VERSION 4 +#define KLU_SUB_VERSION 2 +#define KLU_SUBSUB_VERSION 0 #define KLU_VERSION_CODE(main,sub) ((main) * 1000 + (sub)) #define KLU_VERSION KLU_VERSION_CODE(KLU_MAIN_VERSION,KLU_SUB_VERSION) diff --git a/KLU/cmake_modules/FindKLU.cmake b/KLU/cmake_modules/FindKLU.cmake deleted file mode 100644 index 2b7e8d953..000000000 --- a/KLU/cmake_modules/FindKLU.cmake +++ /dev/null @@ -1,129 +0,0 @@ -#------------------------------------------------------------------------------- -# SuiteSparse/KLU/cmake_modules/FindKLU.cmake -#------------------------------------------------------------------------------- - -# The following copyright and license applies to just this file only, not to -# the library itself: -# FindKLU.cmake, Copyright (c) 2022-2023, Timothy A. Davis. All Rights Reserved. -# SPDX-License-Identifier: BSD-3-clause - -#------------------------------------------------------------------------------- - -# Finds the KLU include file and compiled library and sets: - -# KLU_INCLUDE_DIR - where to find klu.h -# KLU_LIBRARY - dynamic KLU library -# KLU_STATIC - static KLU library -# KLU_LIBRARIES - libraries when using KLU -# KLU_FOUND - true if KLU found - -# set ``KLU_ROOT`` to a KLU installation root to -# tell this module where to look. - -# All the Find*.cmake files in SuiteSparse are installed by 'make install' into -# /usr/local/lib/cmake/SuiteSparse (where '/usr/local' is the -# ${CMAKE_INSTALL_PREFIX}). To access this file, place the following commands -# in your CMakeLists.txt file. See also SuiteSparse/Example/CMakeLists.txt: -# -# set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} -# ${CMAKE_INSTALL_PREFIX}/lib/cmake/SuiteSparse ) - -#------------------------------------------------------------------------------- - -# include files for KLU -find_path ( KLU_INCLUDE_DIR - NAMES klu.h - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/KLU - HINTS ${CMAKE_SOURCE_DIR}/../KLU - PATH_SUFFIXES include Include -) - -# dynamic KLU library (or static if no dynamic library was built) -find_library ( KLU_LIBRARY - NAMES klu klu_static - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/KLU - HINTS ${CMAKE_SOURCE_DIR}/../KLU - PATH_SUFFIXES lib build build/Release build/Debug -) - -if ( MSVC ) - set ( STATIC_NAME klu_static klu ) -else ( ) - set ( STATIC_NAME klu ) - set ( save ${CMAKE_FIND_LIBRARY_SUFFIXES} ) - set ( CMAKE_FIND_LIBRARY_SUFFIXES - ${CMAKE_STATIC_LIBRARY_SUFFIX} ${CMAKE_FIND_LIBRARY_SUFFIXES} ) -endif ( ) - -# static KLU library -find_library ( KLU_STATIC - NAMES ${STATIC_NAME} - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/KLU - HINTS ${CMAKE_SOURCE_DIR}/../KLU - PATH_SUFFIXES lib build build/Release build/Debug -) - -if ( NOT MSVC ) - # restore the CMAKE_FIND_LIBRARY_SUFFIXES variable - set ( CMAKE_FIND_LIBRARY_SUFFIXES ${save} ) -endif ( ) - -# get version of the library from the dynamic library name -get_filename_component ( KLU_LIBRARY ${KLU_LIBRARY} REALPATH ) -get_filename_component ( KLU_FILENAME ${KLU_LIBRARY} NAME ) -string ( - REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" - KLU_VERSION - ${KLU_FILENAME} -) - -# set ( KLU_VERSION "" ) -if ( EXISTS "${KLU_INCLUDE_DIR}" AND NOT KLU_VERSION ) - # if the version does not appear in the filename, read the include file - file ( STRINGS ${KLU_INCLUDE_DIR}/klu.h KLU_MAJOR_STR - REGEX "define KLU_MAIN_VERSION" ) - file ( STRINGS ${KLU_INCLUDE_DIR}/klu.h KLU_MINOR_STR - REGEX "define KLU_SUB_VERSION" ) - file ( STRINGS ${KLU_INCLUDE_DIR}/klu.h KLU_PATCH_STR - REGEX "define KLU_SUBSUB_VERSION" ) - message ( STATUS "major: ${KLU_MAJOR_STR}" ) - message ( STATUS "minor: ${KLU_MINOR_STR}" ) - message ( STATUS "patch: ${KLU_PATCH_STR}" ) - string ( REGEX MATCH "[0-9]+" KLU_MAJOR ${KLU_MAJOR_STR} ) - string ( REGEX MATCH "[0-9]+" KLU_MINOR ${KLU_MINOR_STR} ) - string ( REGEX MATCH "[0-9]+" KLU_PATCH ${KLU_PATCH_STR} ) - set (KLU_VERSION "${KLU_MAJOR}.${KLU_MINOR}.${KLU_PATCH}") -endif ( ) - -set ( KLU_LIBRARIES ${KLU_LIBRARY} ) - -include (FindPackageHandleStandardArgs) - -find_package_handle_standard_args ( KLU - REQUIRED_VARS KLU_LIBRARY KLU_INCLUDE_DIR - VERSION_VAR KLU_VERSION - ) - -mark_as_advanced ( - KLU_INCLUDE_DIR - KLU_LIBRARY - KLU_STATIC - KLU_LIBRARIES - ) - -if ( KLU_FOUND ) - message ( STATUS "KLU version: ${KLU_VERSION}" ) - message ( STATUS "KLU include: ${KLU_INCLUDE_DIR}" ) - message ( STATUS "KLU library: ${KLU_LIBRARY}" ) - message ( STATUS "KLU static: ${KLU_STATIC}" ) -else ( ) - message ( STATUS "KLU not found" ) - set ( KLU_INCLUDE_DIR "" ) - set ( KLU_LIBRARIES "" ) - set ( KLU_LIBRARY "" ) - set ( KLU_STATIC "" ) -endif ( ) - diff --git a/KLU/cmake_modules/FindKLU_CHOLMOD.cmake b/KLU/cmake_modules/FindKLU_CHOLMOD.cmake deleted file mode 100644 index a97f82e7a..000000000 --- a/KLU/cmake_modules/FindKLU_CHOLMOD.cmake +++ /dev/null @@ -1,137 +0,0 @@ -#------------------------------------------------------------------------------- -# SuiteSparse/KLU/cmake_modules/FindKLU_CHOLMOD.cmake -#------------------------------------------------------------------------------- - -# The following copyright and license applies to just this file only, not to -# the library itself: -# FindKLU_CHOLMOD.cmake, Copyright (c) 2022-2023, Timothy A. Davis. All Rights Reserved. -# SPDX-License-Identifier: BSD-3-clause - -#------------------------------------------------------------------------------- - -# Finds the KLU_CHOLMOD include file and compiled library and sets: - -# KLU_CHOLMOD_INCLUDE_DIR - where to find klu_cholmod.h -# KLU_CHOLMOD_LIBRARY - compiled KLU_CHOLMOD library -# KLU_CHOLMOD_LIBRARIES - libraries when using KLU_CHOLMOD -# KLU_CHOLMOD_FOUND - true if KLU_CHOLMOD found - -# set ``KLU_CHOLMOD_ROOT`` to a KLU_CHOLMOD installation root to -# tell this module where to look. - -# All the Find*.cmake files in SuiteSparse are installed by 'make install' into -# /usr/local/lib/cmake/SuiteSparse (where '/usr/local' is the -# ${CMAKE_INSTALL_PREFIX}). To access this file, place the following commands -# in your CMakeLists.txt file. See also SuiteSparse/Example/CMakeLists.txt: -# -# set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} -# ${CMAKE_INSTALL_PREFIX}/lib/cmake/SuiteSparse ) - -#------------------------------------------------------------------------------- - -# include files for KLU_CHOLMOD -find_path ( KLU_CHOLMOD_INCLUDE_DIR - NAMES klu_cholmod.h - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/KLU/User - HINTS ${CMAKE_SOURCE_DIR}/../KLU/User - PATH_SUFFIXES include Include -) - -# include files for KLU -find_path ( KLU_INCLUDE_DIR - NAMES klu.h - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/KLU - HINTS ${CMAKE_SOURCE_DIR}/../KLU - PATH_SUFFIXES include Include -) - -# dynamic KLU_CHOLMOD library (or static if no dynamic library was built) -find_library ( KLU_CHOLMOD_LIBRARY - NAMES klu_cholmod klu_cholmod_static - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/KLU/User - HINTS ${CMAKE_SOURCE_DIR}/../KLU/User - PATH_SUFFIXES lib build build/Release build/Debug -) - -if ( MSVC ) - set ( STATIC_NAME klu_cholmod_static klu_cholmod ) -else ( ) - set ( STATIC_NAME klu_cholmod ) - set ( save ${CMAKE_FIND_LIBRARY_SUFFIXES} ) - set ( CMAKE_FIND_LIBRARY_SUFFIXES - ${CMAKE_STATIC_LIBRARY_SUFFIX} ${CMAKE_FIND_LIBRARY_SUFFIXES} ) -endif ( ) - -# static KLU_CHOLMOD library -find_library ( KLU_CHOLMOD_STATIC - NAMES ${STATIC_NAME} - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/KLU/User - HINTS ${CMAKE_SOURCE_DIR}/../KLU/User - PATH_SUFFIXES lib build build/Release build/Debug -) - -if ( NOT MSVC ) - # restore the CMAKE_FIND_LIBRARY_SUFFIXES variable - set ( CMAKE_FIND_LIBRARY_SUFFIXES ${save} ) -endif ( ) - -# get version of the library from the dynamic library name -get_filename_component ( KLU_CHOLMOD_LIBRARY ${KLU_CHOLMOD_LIBRARY} REALPATH ) -get_filename_component ( KLU_CHOLMOD_FILENAME ${KLU_CHOLMOD_LIBRARY} NAME ) -string ( - REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" - KLU_CHOLMOD_VERSION - ${KLU_CHOLMOD_FILENAME} -) - -# set ( KLU_CHOLMOD_VERSION "" ) -if ( EXISTS "${KLU_INCLUDE_DIR}" AND NOT KLU_CHOLMOD_VERSION ) - # if the version does not appear in the filename, read the include file - file ( STRINGS ${KLU_INCLUDE_DIR}/klu.h KLU_CHOLMOD_MAJOR_STR - REGEX "define KLU_MAIN_VERSION" ) - file ( STRINGS ${KLU_INCLUDE_DIR}/klu.h KLU_CHOLMOD_MINOR_STR - REGEX "define KLU_SUB_VERSION" ) - file ( STRINGS ${KLU_INCLUDE_DIR}/klu.h KLU_CHOLMOD_PATCH_STR - REGEX "define KLU_SUBSUB_VERSION" ) - message ( STATUS "major: ${KLU_CHOLMOD_MAJOR_STR}" ) - message ( STATUS "minor: ${KLU_CHOLMOD_MINOR_STR}" ) - message ( STATUS "patch: ${KLU_CHOLMOD_PATCH_STR}" ) - string ( REGEX MATCH "[0-9]+" KLU_CHOLMOD_MAJOR ${KLU_CHOLMOD_MAJOR_STR} ) - string ( REGEX MATCH "[0-9]+" KLU_CHOLMOD_MINOR ${KLU_CHOLMOD_MINOR_STR} ) - string ( REGEX MATCH "[0-9]+" KLU_CHOLMOD_PATCH ${KLU_CHOLMOD_PATCH_STR} ) - set (KLU_CHOLMOD_VERSION "${KLU_CHOLMOD_MAJOR}.${KLU_CHOLMOD_MINOR}.${KLU_CHOLMOD_PATCH}") -endif ( ) - -set ( KLU_CHOLMOD_LIBRARIES ${KLU_CHOLMOD_LIBRARY} ) - -include (FindPackageHandleStandardArgs) - -find_package_handle_standard_args ( KLU_CHOLMOD - REQUIRED_VARS KLU_CHOLMOD_LIBRARY KLU_CHOLMOD_INCLUDE_DIR - VERSION_VAR KLU_CHOLMOD_VERSION -) - -mark_as_advanced ( - KLU_CHOLMOD_INCLUDE_DIR - KLU_CHOLMOD_LIBRARY - KLU_CHOLMOD_STATIC - KLU_CHOLMOD_LIBRARIES -) - -if ( KLU_CHOLMOD_FOUND ) - message ( STATUS "KLU_CHOLMOD version: ${KLU_CHOLMOD_VERSION}" ) - message ( STATUS "KLU_CHOLMOD include: ${KLU_CHOLMOD_INCLUDE_DIR}" ) - message ( STATUS "KLU_CHOLMOD library: ${KLU_CHOLMOD_LIBRARY}" ) - message ( STATUS "KLU_CHOLMOD static: ${KLU_CHOLMOD_STATIC}" ) -else ( ) - message ( STATUS "KLU_CHOLMOD not found" ) - set ( KLU_CHOLMOD_INCLUDE_DIR "" ) - set ( KLU_CHOLMOD_LIBRARIES "" ) - set ( KLU_CHOLMOD_LIBRARY "" ) - set ( KLU_CHOLMOD_STATIC "" ) -endif ( ) - diff --git a/LDL/CMakeLists.txt b/LDL/CMakeLists.txt index c2d4b97d1..09667121c 100644 --- a/LDL/CMakeLists.txt +++ b/LDL/CMakeLists.txt @@ -9,12 +9,12 @@ # get the version #------------------------------------------------------------------------------- -cmake_minimum_required ( VERSION 3.19 ) +cmake_minimum_required ( VERSION 3.20 ) -set ( LDL_DATE "June 16, 2023" ) +set ( LDL_DATE "Sept 8, 2023" ) set ( LDL_VERSION_MAJOR 3 ) -set ( LDL_VERSION_MINOR 0 ) -set ( LDL_VERSION_SUB 4 ) +set ( LDL_VERSION_MINOR 2 ) +set ( LDL_VERSION_SUB 0 ) message ( STATUS "Building LDL version: v" ${LDL_VERSION_MAJOR}. @@ -26,8 +26,6 @@ message ( STATUS "Building LDL version: v" #------------------------------------------------------------------------------- set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} - ${CMAKE_SOURCE_DIR}/cmake_modules - ${CMAKE_SOURCE_DIR}/../AMD/cmake_modules ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/cmake_modules ) include ( SuiteSparsePolicy ) @@ -44,8 +42,16 @@ project ( ldl # find library dependencies #------------------------------------------------------------------------------- -find_package ( SuiteSparse_config 7.1.0 REQUIRED ) -find_package ( AMD 3.0.4 REQUIRED ) +find_package ( SuiteSparse_config 7.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH ) +if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) + find_package ( SuiteSparse_config 7.2.0 REQUIRED ) +endif ( ) +find_package ( AMD 3.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../AMD/build NO_DEFAULT_PATH ) +if ( NOT TARGET SuiteSparse::AMD ) + find_package ( AMD 3.2.0 REQUIRED ) +endif ( ) #------------------------------------------------------------------------------- # Configure ldl.h with version number @@ -62,8 +68,7 @@ configure_file ( "Config/ldl_version.tex.in" # include directories #------------------------------------------------------------------------------- -include_directories ( Source Include ${SUITESPARSE_CONFIG_INCLUDE_DIR} - ${AMD_INCLUDE_DIR} ) +include_directories ( Source Include ) #------------------------------------------------------------------------------- # dynamic ldl library properties @@ -71,24 +76,29 @@ include_directories ( Source Include ${SUITESPARSE_CONFIG_INCLUDE_DIR} file ( GLOB LDL_SOURCES "Source/*.c" ) -add_library ( ldl SHARED ${LDL_SOURCES} ) +add_library ( LDL SHARED ${LDL_SOURCES} ) -set_target_properties ( ldl PROPERTIES +set_target_properties ( LDL PROPERTIES VERSION ${LDL_VERSION_MAJOR}.${LDL_VERSION_MINOR}.${LDL_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON + OUTPUT_NAME ldl SOVERSION ${LDL_VERSION_MAJOR} PUBLIC_HEADER "Include/ldl.h" WINDOWS_EXPORT_ALL_SYMBOLS ON ) +target_include_directories ( LDL + INTERFACE $ + $ ) + #------------------------------------------------------------------------------- # static ldl library properties #------------------------------------------------------------------------------- if ( NOT NSTATIC ) - add_library ( ldl_static STATIC ${LDL_SOURCES} ) + add_library ( LDL_static STATIC ${LDL_SOURCES} ) - set_target_properties ( ldl_static PROPERTIES + set_target_properties ( LDL_static PROPERTIES VERSION ${LDL_VERSION_MAJOR}.${LDL_VERSION_MINOR}.${LDL_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON @@ -96,9 +106,14 @@ if ( NOT NSTATIC ) SOVERSION ${LDL_VERSION_MAJOR} ) if ( MSVC ) - set_target_properties ( ldl_static PROPERTIES + set_target_properties ( LDL_static PROPERTIES OUTPUT_NAME ldl_static ) endif ( ) + + target_include_directories ( LDL_static + INTERFACE $ + $ ) + endif ( ) #------------------------------------------------------------------------------- @@ -107,37 +122,103 @@ endif ( ) # libm: if ( NOT WIN32 ) - target_link_libraries ( ldl PRIVATE m ) + target_link_libraries ( LDL PRIVATE m ) if ( NOT NSTATIC ) - target_link_libraries ( ldl_static PUBLIC m ) + set ( LDL_STATIC_LIBS "${LDL_STATIC_LIBS} -lm" ) + target_link_libraries ( LDL_static PUBLIC m ) endif ( ) endif ( ) -target_link_libraries ( ldl PRIVATE - ${SUITESPARSE_CONFIG_LIBRARIES} ${AMD_LIBRARIES} ) +target_link_libraries ( LDL PRIVATE + SuiteSparse::AMD SuiteSparse::SuiteSparseConfig ) +target_include_directories ( LDL PUBLIC + "$" ) if ( NOT NSTATIC ) - target_link_libraries ( ldl_static PUBLIC - ${SUITESPARSE_CONFIG_STATIC} ${AMD_STATIC} ) + if ( TARGET SuiteSparse::AMD_static ) + target_link_libraries ( LDL_static PUBLIC SuiteSparse::AMD_static ) + else ( ) + target_link_libraries ( LDL_static PUBLIC SuiteSparse::AMD ) + endif ( ) + if ( TARGET SuiteSparse::SuiteSparseConfig_static ) + target_link_libraries ( LDL_static PUBLIC SuiteSparse::SuiteSparseConfig_static ) + else ( ) + target_link_libraries ( LDL_static PUBLIC SuiteSparse::SuiteSparseConfig ) + endif ( ) endif ( ) + #------------------------------------------------------------------------------- # LDL installation location #------------------------------------------------------------------------------- -install ( TARGETS ldl +include ( CMakePackageConfigHelpers ) + +install ( TARGETS LDL + EXPORT LDLTargets LIBRARY DESTINATION ${SUITESPARSE_LIBDIR} ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} RUNTIME DESTINATION ${SUITESPARSE_BINDIR} PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} ) -install ( FILES ${CMAKE_SOURCE_DIR}/cmake_modules/FindLDL.cmake - DESTINATION ${SUITESPARSE_LIBDIR}/cmake/SuiteSparse - COMPONENT Development ) if ( NOT NSTATIC ) - install ( TARGETS ldl_static + install ( TARGETS LDL_static + EXPORT LDLTargets ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} ) endif ( ) +# create (temporary) export target file during build +export ( EXPORT LDLTargets + NAMESPACE SuiteSparse:: + FILE ${CMAKE_CURRENT_BINARY_DIR}/LDLTargets.cmake ) + +# install export target, config and version files for find_package +install ( EXPORT LDLTargets + NAMESPACE SuiteSparse:: + DESTINATION ${SUITESPARSE_LIBDIR}/cmake/LDL ) + +configure_package_config_file ( + Config/LDLConfig.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/LDLConfig.cmake + INSTALL_DESTINATION ${SUITESPARSE_LIBDIR}/cmake/LDL ) + +write_basic_package_version_file ( + ${CMAKE_CURRENT_BINARY_DIR}/LDLConfigVersion.cmake + COMPATIBILITY SameMajorVersion ) + +install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/LDLConfig.cmake + ${CMAKE_CURRENT_BINARY_DIR}/LDLConfigVersion.cmake + DESTINATION ${SUITESPARSE_LIBDIR}/cmake/LDL ) + +#------------------------------------------------------------------------------- +# create pkg-config file +#------------------------------------------------------------------------------- + +if ( NOT MSVC ) + set ( prefix "${CMAKE_INSTALL_PREFIX}" ) + set ( exec_prefix "\${prefix}" ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) + if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) + set ( libdir "${SUITESPARSE_LIBDIR}") + else ( ) + set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") + endif ( ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) + if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) + set ( includedir "${SUITESPARSE_INCLUDEDIR}") + else ( ) + set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + endif ( ) + configure_file ( + Config/LDL.pc.in + LDL.pc + @ONLY + NEWLINE_STYLE LF ) + install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/LDL.pc + DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) +endif ( ) + #------------------------------------------------------------------------------- # Demo library and programs #------------------------------------------------------------------------------- @@ -161,17 +242,17 @@ if ( DEMO ) add_executable ( ldllmain "Demo/ldllmain.c" ) # Libraries required for Demo programs - target_link_libraries ( ldlsimple PUBLIC ldl ${SUITESPARSE_CONFIG_LIBRARIES} ) - target_link_libraries ( ldllsimple PUBLIC ldl ) - target_link_libraries ( ldlmain PUBLIC ldl ) - target_link_libraries ( ldllmain PUBLIC ldl ) + target_link_libraries ( ldlsimple PUBLIC LDL SuiteSparse::SuiteSparseConfig ) + target_link_libraries ( ldllsimple PUBLIC LDL ) + target_link_libraries ( ldlmain PUBLIC LDL ) + target_link_libraries ( ldllmain PUBLIC LDL ) if ( AMD_FOUND ) message ( STATUS "AMD found for ldlamd and ldllamd" ) add_executable ( ldlamd "Demo/ldlamd.c" ) add_executable ( ldllamd "Demo/ldllamd.c" ) - target_link_libraries ( ldlamd PUBLIC ldl ${AMD_LIBRARIES} ) - target_link_libraries ( ldllamd PUBLIC ldl ${AMD_LIBRARIES} ) + target_link_libraries ( ldlamd PUBLIC LDL SuiteSparse::AMD ) + target_link_libraries ( ldllamd PUBLIC LDL SuiteSparse::AMD ) endif ( ) else ( ) diff --git a/LDL/Config/LDL.pc.in b/LDL/Config/LDL.pc.in new file mode 100644 index 000000000..eac2e9326 --- /dev/null +++ b/LDL/Config/LDL.pc.in @@ -0,0 +1,17 @@ +# LDL, Copyright (c) 2005-2023, Timothy A. Davis. +# All Rights Reserved. +# SPDX-License-Identifier: LGPL-2.1-or-later + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: LDL +URL: https://github.com/DrTimothyAldenDavis/SuiteSparse +Description: A sparse LDL' factorization and solve package in SuiteSparse +Version: @LDL_VERSION_MAJOR@.@LDL_VERSION_MINOR@.@LDL_VERSION_SUB@ +Requires.private: AMD SuiteSparse_config +Libs: -L${libdir} -lldl +Libs.private: @LDL_STATIC_LIBS@ +Cflags: -I${includedir} diff --git a/LDL/Config/LDLConfig.cmake.in b/LDL/Config/LDLConfig.cmake.in new file mode 100644 index 000000000..948a34a58 --- /dev/null +++ b/LDL/Config/LDLConfig.cmake.in @@ -0,0 +1,121 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/LDL/cmake_modules/LDLConfig.cmake +#------------------------------------------------------------------------------- + +# The following copyright and license applies to just this file only, not to +# the library itself: +# LDLConfig.cmake, Copyright (c) 2023, Timothy A. Davis. All Rights Reserved. +# SPDX-License-Identifier: BSD-3-clause + +#------------------------------------------------------------------------------- + +# Finds the LDL include file and compiled library. +# The following targets are defined: +# SuiteSparse::LDL - for the shared library (if available) +# SuiteSparse::LDL_static - for the static library (if available) + +# For backward compatibility the following variables are set: + +# LDL_INCLUDE_DIR - where to find ldl.h +# LDL_LIBRARY - dynamic LDL library +# LDL_STATIC - static LDL library +# LDL_LIBRARIES - libraries when using LDL +# LDL_FOUND - true if LDL found + +# Set ``CMAKE_MODULE_PATH`` to the parent folder where this module file is +# installed. + +#------------------------------------------------------------------------------- + +@PACKAGE_INIT@ + +set ( LDL_DATE "@LDL_DATE@" ) +set ( LDL_VERSION_MAJOR @LDL_VERSION_MAJOR@ ) +set ( LDL_VERSION_MINOR @LDL_VERSION_MINOR@ ) +set ( LDL_VERSION_PATCH @LDL_VERSION_SUB@ ) +set ( LDL_VERSION "@LDL_VERSION_MAJOR@.@LDL_VERSION_MINOR@.@LDL_VERSION_SUB@" ) + +include ( ${CMAKE_CURRENT_LIST_DIR}/LDLTargets.cmake ) + +# The following is only for backward compatibility with FindLDL. + +set ( _target_shared SuiteSparse::LDL ) +set ( _target_static SuiteSparse::LDL_static ) +set ( _var_prefix "LDL" ) + +get_target_property ( ${_var_prefix}_INCLUDE_DIR ${_target_shared} INTERFACE_INCLUDE_DIRECTORIES ) +if ( ${_var_prefix}_INCLUDE_DIR ) + # First item in SuiteSparse targets contains the "main" header directory. + list ( GET ${_var_prefix}_INCLUDE_DIR 0 ${_var_prefix}_INCLUDE_DIR ) +endif ( ) +get_target_property ( ${_var_prefix}_LIBRARY ${_target_shared} IMPORTED_IMPLIB ) +if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} IMPORTED_LOCATION ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) +endif ( ) +if ( TARGET ${_target_static} ) + get_target_property ( ${_var_prefix}_STATIC ${_target_static} IMPORTED_LOCATION ) +endif ( ) + +# Check for most common build types +set ( _config_types "Debug" "Release" "RelWithDebInfo" "MinSizeRel" ) + +get_property ( _isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG ) +if ( _isMultiConfig ) + # For multi-configuration generators (e.g., Visual Studio), prefer those + # configurations. + list ( PREPEND _config_types ${CMAKE_CONFIGURATION_TYPES} ) +else ( ) + # For single-configuration generators, prefer the current configuration. + list ( PREPEND _config_types ${CMAKE_BUILD_TYPE} ) +endif ( ) + +list ( REMOVE_DUPLICATES _config_types ) + +foreach ( _config ${_config_types} ) + string ( TOUPPER ${_config} _uc_config ) + if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} + IMPORTED_IMPLIB_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) + endif ( ) + if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} + IMPORTED_LOCATION_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) + endif ( ) + if ( TARGET ${_target_static} AND NOT ${_var_prefix}_STATIC ) + get_target_property ( _library_chk ${_target_static} + IMPORTED_LOCATION_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_STATIC ${_library_chk} ) + endif ( ) + endif ( ) +endforeach ( ) + +set ( LDL_LIBRARIES ${LDL_LIBRARY} ) + +macro ( suitesparse_check_exist _var _files ) + # ignore generator expressions + string ( GENEX_STRIP "${_files}" _files2 ) + + foreach ( _file ${_files2} ) + if ( NOT EXISTS "${_file}" ) + message ( FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist!" ) + endif ( ) + endforeach () +endmacro ( ) + +suitesparse_check_exist ( LDL_INCLUDE_DIR ${LDL_INCLUDE_DIR} ) +suitesparse_check_exist ( LDL_LIBRARY ${LDL_LIBRARY} ) + +message ( STATUS "LDL version: ${LDL_VERSION}" ) +message ( STATUS "LDL include: ${LDL_INCLUDE_DIR}" ) +message ( STATUS "LDL library: ${LDL_LIBRARY}" ) +message ( STATUS "LDL static: ${LDL_STATIC}" ) diff --git a/LDL/Demo/ldlamd.out b/LDL/Demo/ldlamd.out index 748a3b7f5..1be9e859e 100644 --- a/LDL/Demo/ldlamd.out +++ b/LDL/Demo/ldlamd.out @@ -6,7 +6,7 @@ name: Dense/0 n: 0 entries: 0 -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -14,7 +14,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK n, dimension of A: 0 @@ -37,7 +37,7 @@ name: Dense/0 n: 0 entries: 0 (jumbled version) -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -45,7 +45,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK n, dimension of A: 0 @@ -68,7 +68,7 @@ name: Dense/1 n: 1 entries: 1 -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -76,7 +76,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK n, dimension of A: 1 nz, number of nonzeros in A: 1 @@ -119,7 +119,7 @@ name: Dense/1 n: 1 entries: 2 (jumbled version) -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -127,7 +127,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK, but jumbled n, dimension of A: 1 nz, number of nonzeros in A: 1 @@ -170,7 +170,7 @@ name: Dense/2 n: 2 entries: 4 -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -178,7 +178,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK n, dimension of A: 2 nz, number of nonzeros in A: 4 @@ -221,7 +221,7 @@ name: Dense/2 n: 2 entries: 5 (jumbled version) -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -229,7 +229,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK, but jumbled n, dimension of A: 2 nz, number of nonzeros in A: 4 @@ -272,7 +272,7 @@ name: Dense/3 n: 3 entries: 9 -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -280,7 +280,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK n, dimension of A: 3 nz, number of nonzeros in A: 9 @@ -323,7 +323,7 @@ name: Dense/3 n: 3 entries: 11 (jumbled version) -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -331,7 +331,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK, but jumbled n, dimension of A: 3 nz, number of nonzeros in A: 9 @@ -374,7 +374,7 @@ name: HB/can_24 n: 24 entries: 160 -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -382,7 +382,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK n, dimension of A: 24 nz, number of nonzeros in A: 160 @@ -425,7 +425,7 @@ name: HB/can_24 n: 24 entries: 188 (jumbled version) -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -433,7 +433,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK, but jumbled n, dimension of A: 24 nz, number of nonzeros in A: 160 @@ -476,7 +476,7 @@ name: FIDAP/ex5 n: 27 entries: 279 -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -484,7 +484,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK n, dimension of A: 27 nz, number of nonzeros in A: 279 @@ -527,7 +527,7 @@ name: FIDAP/ex5 n: 27 entries: 325 (jumbled version) -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -535,7 +535,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK, but jumbled n, dimension of A: 27 nz, number of nonzeros in A: 279 @@ -578,7 +578,7 @@ name: HB/bcsstk01 n: 48 entries: 400 -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -586,7 +586,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK n, dimension of A: 48 nz, number of nonzeros in A: 400 @@ -629,7 +629,7 @@ name: HB/bcsstk01 n: 48 entries: 472 (jumbled version) -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -637,7 +637,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK, but jumbled n, dimension of A: 48 nz, number of nonzeros in A: 400 @@ -680,7 +680,7 @@ name: HB/bcsstm01 n: 48 entries: 24 -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -688,7 +688,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK n, dimension of A: 48 nz, number of nonzeros in A: 24 @@ -731,7 +731,7 @@ name: HB/bcsstm01 n: 48 entries: 26 (jumbled version) -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -739,7 +739,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK, but jumbled n, dimension of A: 48 nz, number of nonzeros in A: 24 @@ -782,7 +782,7 @@ name: Pothen/mesh1e1 n: 48 entries: 306 -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -790,7 +790,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK n, dimension of A: 48 nz, number of nonzeros in A: 306 @@ -833,7 +833,7 @@ name: Pothen/mesh1e1 n: 48 entries: 359 (jumbled version) -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -841,7 +841,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK, but jumbled n, dimension of A: 48 nz, number of nonzeros in A: 306 @@ -884,7 +884,7 @@ name: Bai/bfwb62 n: 62 entries: 342 -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -892,7 +892,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK n, dimension of A: 62 nz, number of nonzeros in A: 342 @@ -935,7 +935,7 @@ name: Bai/bfwb62 n: 62 entries: 407 (jumbled version) -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -943,7 +943,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK, but jumbled n, dimension of A: 62 nz, number of nonzeros in A: 342 @@ -986,7 +986,7 @@ name: HB/bcsstk02 n: 66 entries: 4356 -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -994,7 +994,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK n, dimension of A: 66 nz, number of nonzeros in A: 4356 @@ -1037,7 +1037,7 @@ name: HB/bcsstk02 n: 66 entries: 5175 (jumbled version) -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -1045,7 +1045,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK, but jumbled n, dimension of A: 66 nz, number of nonzeros in A: 4356 @@ -1088,7 +1088,7 @@ name: HB/bcsstm02 n: 66 entries: 66 -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -1096,7 +1096,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK n, dimension of A: 66 nz, number of nonzeros in A: 66 @@ -1139,7 +1139,7 @@ name: HB/bcsstm02 n: 66 entries: 72 (jumbled version) -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -1147,7 +1147,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 4 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK, but jumbled n, dimension of A: 66 nz, number of nonzeros in A: 66 diff --git a/LDL/Demo/ldllamd.out b/LDL/Demo/ldllamd.out index bd051f7d3..a0646c728 100644 --- a/LDL/Demo/ldllamd.out +++ b/LDL/Demo/ldllamd.out @@ -6,7 +6,7 @@ name: Dense/0 n: 0 entries: 0 -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -14,7 +14,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK n, dimension of A: 0 @@ -37,7 +37,7 @@ name: Dense/0 n: 0 entries: 0 (jumbled version) -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -45,7 +45,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK n, dimension of A: 0 @@ -68,7 +68,7 @@ name: Dense/1 n: 1 entries: 1 -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -76,7 +76,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK n, dimension of A: 1 nz, number of nonzeros in A: 1 @@ -119,7 +119,7 @@ name: Dense/1 n: 1 entries: 2 (jumbled version) -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -127,7 +127,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK, but jumbled n, dimension of A: 1 nz, number of nonzeros in A: 1 @@ -170,7 +170,7 @@ name: Dense/2 n: 2 entries: 4 -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -178,7 +178,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK n, dimension of A: 2 nz, number of nonzeros in A: 4 @@ -221,7 +221,7 @@ name: Dense/2 n: 2 entries: 5 (jumbled version) -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -229,7 +229,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK, but jumbled n, dimension of A: 2 nz, number of nonzeros in A: 4 @@ -272,7 +272,7 @@ name: Dense/3 n: 3 entries: 9 -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -280,7 +280,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK n, dimension of A: 3 nz, number of nonzeros in A: 9 @@ -323,7 +323,7 @@ name: Dense/3 n: 3 entries: 11 (jumbled version) -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -331,7 +331,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK, but jumbled n, dimension of A: 3 nz, number of nonzeros in A: 9 @@ -374,7 +374,7 @@ name: HB/can_24 n: 24 entries: 160 -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -382,7 +382,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK n, dimension of A: 24 nz, number of nonzeros in A: 160 @@ -425,7 +425,7 @@ name: HB/can_24 n: 24 entries: 188 (jumbled version) -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -433,7 +433,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK, but jumbled n, dimension of A: 24 nz, number of nonzeros in A: 160 @@ -476,7 +476,7 @@ name: FIDAP/ex5 n: 27 entries: 279 -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -484,7 +484,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK n, dimension of A: 27 nz, number of nonzeros in A: 279 @@ -527,7 +527,7 @@ name: FIDAP/ex5 n: 27 entries: 325 (jumbled version) -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -535,7 +535,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK, but jumbled n, dimension of A: 27 nz, number of nonzeros in A: 279 @@ -578,7 +578,7 @@ name: HB/bcsstk01 n: 48 entries: 400 -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -586,7 +586,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK n, dimension of A: 48 nz, number of nonzeros in A: 400 @@ -629,7 +629,7 @@ name: HB/bcsstk01 n: 48 entries: 472 (jumbled version) -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -637,7 +637,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK, but jumbled n, dimension of A: 48 nz, number of nonzeros in A: 400 @@ -680,7 +680,7 @@ name: HB/bcsstm01 n: 48 entries: 24 -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -688,7 +688,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK n, dimension of A: 48 nz, number of nonzeros in A: 24 @@ -731,7 +731,7 @@ name: HB/bcsstm01 n: 48 entries: 26 (jumbled version) -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -739,7 +739,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK, but jumbled n, dimension of A: 48 nz, number of nonzeros in A: 24 @@ -782,7 +782,7 @@ name: Pothen/mesh1e1 n: 48 entries: 306 -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -790,7 +790,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK n, dimension of A: 48 nz, number of nonzeros in A: 306 @@ -833,7 +833,7 @@ name: Pothen/mesh1e1 n: 48 entries: 359 (jumbled version) -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -841,7 +841,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK, but jumbled n, dimension of A: 48 nz, number of nonzeros in A: 306 @@ -884,7 +884,7 @@ name: Bai/bfwb62 n: 62 entries: 342 -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -892,7 +892,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK n, dimension of A: 62 nz, number of nonzeros in A: 342 @@ -935,7 +935,7 @@ name: Bai/bfwb62 n: 62 entries: 407 (jumbled version) -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -943,7 +943,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK, but jumbled n, dimension of A: 62 nz, number of nonzeros in A: 342 @@ -986,7 +986,7 @@ name: HB/bcsstk02 n: 66 entries: 4356 -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -994,7 +994,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK n, dimension of A: 66 nz, number of nonzeros in A: 4356 @@ -1037,7 +1037,7 @@ name: HB/bcsstk02 n: 66 entries: 5175 (jumbled version) -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -1045,7 +1045,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK, but jumbled n, dimension of A: 66 nz, number of nonzeros in A: 4356 @@ -1088,7 +1088,7 @@ name: HB/bcsstm02 n: 66 entries: 66 -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -1096,7 +1096,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK n, dimension of A: 66 nz, number of nonzeros in A: 66 @@ -1139,7 +1139,7 @@ name: HB/bcsstm02 n: 66 entries: 72 (jumbled version) -------------------------------------------------------- -AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering +AMD version 3.2.0, Sept 8, 2023: approximate minimum degree ordering dense row parameter: 10 (rows with more than max (10 * sqrt (n), 16) entries are considered "dense", and placed last in output permutation) @@ -1147,7 +1147,7 @@ AMD version 3.0.4, June 16, 2023: approximate minimum degree ordering size of AMD integer: 8 -AMD version 3.0.4, June 16, 2023, results: +AMD version 3.2.0, Sept 8, 2023, results: status: OK, but jumbled n, dimension of A: 66 nz, number of nonzeros in A: 66 diff --git a/LDL/Demo/ldlsimple.out b/LDL/Demo/ldlsimple.out index af2dfb109..f0e8feb37 100644 --- a/LDL/Demo/ldlsimple.out +++ b/LDL/Demo/ldlsimple.out @@ -1,4 +1,4 @@ -LDL 3.0.4 in SuiteSparse 7.1.0 +LDL 3.2.0 in SuiteSparse 7.2.0 Nonzeros in L, excluding diagonal: 13 x [0] = 0.1 x [1] = 0.2 diff --git a/LDL/Doc/ChangeLog b/LDL/Doc/ChangeLog index ac503e7a4..a9adb7f8e 100644 --- a/LDL/Doc/ChangeLog +++ b/LDL/Doc/ChangeLog @@ -1,3 +1,7 @@ +Sept 8, 2023: version 3.2.0 + + * cmake updates: SuiteSparse:: namespace by Markus Muetzel + June 16, 2023: version 3.0.4 * cmake build system updates: update by Markus Muetzel diff --git a/LDL/Doc/ldl_userguide.pdf b/LDL/Doc/ldl_userguide.pdf index d92239280..5babfec81 100644 Binary files a/LDL/Doc/ldl_userguide.pdf and b/LDL/Doc/ldl_userguide.pdf differ diff --git a/LDL/Doc/ldl_version.tex b/LDL/Doc/ldl_version.tex index 045c00dd8..23044db3d 100644 --- a/LDL/Doc/ldl_version.tex +++ b/LDL/Doc/ldl_version.tex @@ -1,2 +1,2 @@ % version of SuiteSparse/LDL -\date{VERSION 3.0.4, June 16, 2023} +\date{VERSION 3.2.0, Sept 8, 2023} diff --git a/LDL/Include/ldl.h b/LDL/Include/ldl.h index 453c9641e..913a2d375 100644 --- a/LDL/Include/ldl.h +++ b/LDL/Include/ldl.h @@ -106,10 +106,10 @@ int64_t ldl_l_valid_matrix ( int64_t n, int64_t Ap [ ], int64_t Ai [ ]) ; /* === LDL version ========================================================== */ /* ========================================================================== */ -#define LDL_DATE "June 16, 2023" +#define LDL_DATE "Sept 8, 2023" #define LDL_MAIN_VERSION 3 -#define LDL_SUB_VERSION 0 -#define LDL_SUBSUB_VERSION 4 +#define LDL_SUB_VERSION 2 +#define LDL_SUBSUB_VERSION 0 #define LDL_VERSION_CODE(main,sub) ((main) * 1000 + (sub)) #define LDL_VERSION LDL_VERSION_CODE(LDL_MAIN_VERSION,LDL_SUB_VERSION) diff --git a/LDL/cmake_modules/FindLDL.cmake b/LDL/cmake_modules/FindLDL.cmake deleted file mode 100644 index e2f34af83..000000000 --- a/LDL/cmake_modules/FindLDL.cmake +++ /dev/null @@ -1,129 +0,0 @@ -#------------------------------------------------------------------------------- -# SuiteSparse/LDL/cmake_modules/FindLDL.cmake -#------------------------------------------------------------------------------- - -# The following copyright and license applies to just this file only, not to -# the library itself: -# FindLDL.cmake, Copyright (c) 2022-2023, Timothy A. Davis. All Rights Reserved. -# SPDX-License-Identifier: BSD-3-clause - -#------------------------------------------------------------------------------- - -# Finds the LDL include file and compiled library and sets: - -# LDL_INCLUDE_DIR - where to find ldl.h -# LDL_LIBRARY - dynamic LDL library -# LDL_STATIC - static LDL library -# LDL_LIBRARIES - libraries when using LDL -# LDL_FOUND - true if LDL found - -# set ``LDL_ROOT`` to a LDL installation root to -# tell this module where to look. - -# All the Find*.cmake files in SuiteSparse are installed by 'make install' into -# /usr/local/lib/cmake/SuiteSparse (where '/usr/local' is the -# ${CMAKE_INSTALL_PREFIX}). To access this file, place the following commands -# in your CMakeLists.txt file. See also SuiteSparse/Example/CMakeLists.txt: -# -# set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} -# ${CMAKE_INSTALL_PREFIX}/lib/cmake/SuiteSparse ) - -#------------------------------------------------------------------------------- - -# include files for LDL -find_path ( LDL_INCLUDE_DIR - NAMES ldl.h - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/LDL - HINTS ${CMAKE_SOURCE_DIR}/../LDL - PATH_SUFFIXES include Include -) - -# dynamic LDL library (or static if no dynamic library was built) -find_library ( LDL_LIBRARY - NAMES ldl ldl_static - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/LDL - HINTS ${CMAKE_SOURCE_DIR}/../LDL - PATH_SUFFIXES lib build build/Release build/Debug -) - -if ( MSVC ) - set ( STATIC_NAME ldl_static ldl ) -else ( ) - set ( STATIC_NAME ldl ) - set ( save ${CMAKE_FIND_LIBRARY_SUFFIXES} ) - set ( CMAKE_FIND_LIBRARY_SUFFIXES - ${CMAKE_STATIC_LIBRARY_SUFFIX} ${CMAKE_FIND_LIBRARY_SUFFIXES} ) -endif ( ) - -# static LDL library -find_library ( LDL_STATIC - NAMES ${STATIC_NAME} - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/LDL - HINTS ${CMAKE_SOURCE_DIR}/../LDL - PATH_SUFFIXES lib build build/Release build/Debug -) - -if ( NOT MSVC ) - # restore the CMAKE_FIND_LIBRARY_SUFFIXES variable - set ( CMAKE_FIND_LIBRARY_SUFFIXES ${save} ) -endif ( ) - -# get version of the library from the dynamic library name -get_filename_component ( LDL_LIBRARY ${LDL_LIBRARY} REALPATH ) -get_filename_component ( LDL_FILENAME ${LDL_LIBRARY} NAME ) -string ( - REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" - LDL_VERSION - ${LDL_FILENAME} -) - -# set ( LDL_VERSION "" ) -if ( EXISTS "${LDL_INCLUDE_DIR}" AND NOT LDL_VERSION ) - # if the version does not appear in the filename, read the include file - file ( STRINGS ${LDL_INCLUDE_DIR}/ldl.h LDL_MAJOR_STR - REGEX "define LDL_MAIN_VERSION" ) - file ( STRINGS ${LDL_INCLUDE_DIR}/ldl.h LDL_MINOR_STR - REGEX "define LDL_SUB_VERSION" ) - file ( STRINGS ${LDL_INCLUDE_DIR}/ldl.h LDL_PATCH_STR - REGEX "define LDL_SUBSUB_VERSION" ) - message ( STATUS "major: ${LDL_MAJOR_STR}" ) - message ( STATUS "minor: ${LDL_MINOR_STR}" ) - message ( STATUS "patch: ${LDL_PATCH_STR}" ) - string ( REGEX MATCH "[0-9]+" LDL_MAJOR ${LDL_MAJOR_STR} ) - string ( REGEX MATCH "[0-9]+" LDL_MINOR ${LDL_MINOR_STR} ) - string ( REGEX MATCH "[0-9]+" LDL_PATCH ${LDL_PATCH_STR} ) - set (LDL_VERSION "${LDL_MAJOR}.${LDL_MINOR}.${LDL_PATCH}") -endif ( ) - -set ( LDL_LIBRARIES ${LDL_LIBRARY} ) - -include (FindPackageHandleStandardArgs) - -find_package_handle_standard_args ( LDL - REQUIRED_VARS LDL_LIBRARY LDL_INCLUDE_DIR - VERSION_VAR LDL_VERSION -) - -mark_as_advanced ( - LDL_INCLUDE_DIR - LDL_LIBRARY - LDL_STATIC - LDL_LIBRARIES -) - -if ( LDL_FOUND ) - message ( STATUS "LDL version: ${LDL_VERSION}" ) - message ( STATUS "LDL include: ${LDL_INCLUDE_DIR}" ) - message ( STATUS "LDL library: ${LDL_LIBRARY}" ) - message ( STATUS "LDL static: ${LDL_STATIC}" ) -else ( ) - message ( STATUS "LDL not found" ) - set ( LDL_INCLUDE_DIR "" ) - set ( LDL_LIBRARIES "" ) - set ( LDL_LIBRARY "" ) - set ( LDL_STATIC "" ) -endif ( ) - diff --git a/Makefile b/Makefile index 2cc6e3a29..40a9d5db5 100644 --- a/Makefile +++ b/Makefile @@ -227,6 +227,6 @@ debug: ( cd SuiteSparse_GPURuntime && $(MAKE) ) ( cd GPUQREngine && $(MAKE) ) ( cd SPQR && $(MAKE) debug ) - ( cd GraphBLAS && $(MAKE) debug ) + ( cd GraphBLAS && $(MAKE) cdebug ) ( cd SPEX && $(MAKE) debug ) diff --git a/Mongoose/CMakeLists.txt b/Mongoose/CMakeLists.txt index b802c5ec4..6921f1b2a 100644 --- a/Mongoose/CMakeLists.txt +++ b/Mongoose/CMakeLists.txt @@ -29,7 +29,7 @@ # # make distclean -cmake_minimum_required ( VERSION 3.19 ) +cmake_minimum_required ( VERSION 3.20 ) #------------------------------------------------------------------------------- # SuiteSparse policies @@ -43,11 +43,11 @@ include ( SuiteSparsePolicy ) #------------------------------------------------------------------------------- -set(Mongoose_DATE "June 16, 2023") -set(Mongoose_NUMERIC_DATE "2023-06-16") +set(Mongoose_DATE "Sept 8, 2023") +set(Mongoose_NUMERIC_DATE "2023-09-08") set(Mongoose_VERSION_MAJOR 3) -set(Mongoose_VERSION_MINOR 0) -set(Mongoose_VERSION_PATCH 5) +set(Mongoose_VERSION_MINOR 2) +set(Mongoose_VERSION_PATCH 0) project(Mongoose VERSION "${Mongoose_VERSION_MAJOR}.${Mongoose_VERSION_MINOR}.${Mongoose_VERSION_PATCH}" @@ -73,7 +73,11 @@ configure_file ( NEWLINE_STYLE LF ) -find_package ( SuiteSparse_config 7.1.0 REQUIRED ) +find_package ( SuiteSparse_config 7.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH ) +if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) + find_package ( SuiteSparse_config 7.2.0 REQUIRED ) +endif ( ) include_directories("${PROJECT_BINARY_DIR}") @@ -166,8 +170,6 @@ include_directories(Include set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) -include_directories ( ${SUITESPARSE_CONFIG_INCLUDE_DIR} ) - # set the output directories # set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) # set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) @@ -175,57 +177,75 @@ include_directories ( ${SUITESPARSE_CONFIG_INCLUDE_DIR} ) if ( NOT NSTATIC ) # Build the Mongoose library - add_library ( mongoose_static STATIC ${MONGOOSE_LIB_FILES} ) -# set_property ( TARGET mongoose_static PROPERTY POSITION_INDEPENDENT_CODE ON ) - set_target_properties ( mongoose_static PROPERTIES + add_library ( Mongoose_static STATIC ${MONGOOSE_LIB_FILES} ) +# set_property ( TARGET Mongoose_static PROPERTY POSITION_INDEPENDENT_CODE ON ) + set_target_properties ( Mongoose_static PROPERTIES OUTPUT_NAME mongoose ) if ( MSVC ) - set_target_properties ( mongoose_static PROPERTIES + set_target_properties ( Mongoose_static PROPERTIES OUTPUT_NAME mongoose_static ) endif ( ) - target_link_libraries ( mongoose_static PUBLIC ${SUITESPARSE_CONFIG_LIBRARY} ) + target_include_directories ( Mongoose_static + INTERFACE $ + $ ) + + if ( TARGET SuiteSparse::SuiteSparseConfig_static ) + target_link_libraries ( Mongoose_static PUBLIC SuiteSparse::SuiteSparseConfig_static ) + else ( ) + target_link_libraries ( Mongoose_static PUBLIC SuiteSparse::SuiteSparseConfig ) + endif ( ) endif ( ) # Build the Mongoose library for dynamic linking -add_library ( mongoose SHARED ${MONGOOSE_LIB_FILES} ) -set_property ( TARGET mongoose PROPERTY POSITION_INDEPENDENT_CODE ON ) -set_target_properties ( mongoose PROPERTIES +add_library ( Mongoose SHARED ${MONGOOSE_LIB_FILES} ) +set_property ( TARGET Mongoose PROPERTY POSITION_INDEPENDENT_CODE ON ) +set_target_properties ( Mongoose PROPERTIES OUTPUT_NAME mongoose WINDOWS_EXPORT_ALL_SYMBOLS ON ) -target_link_libraries ( mongoose PRIVATE ${SUITESPARSE_CONFIG_LIBRARY} ) +target_include_directories ( Mongoose + INTERFACE $ + $ ) + +target_link_libraries ( Mongoose PRIVATE SuiteSparse::SuiteSparseConfig ) +target_include_directories ( Mongoose PUBLIC + "$" ) # if(CMAKE_MAJOR_VERSION GREATER 2) -# set_target_properties(mongoose PROPERTIES VERSION ${PROJECT_VERSION}) -# set_target_properties(mongoose PROPERTIES SOVERSION ${Mongoose_VERSION_MAJOR}) +# set_target_properties(Mongoose PROPERTIES VERSION ${PROJECT_VERSION}) +# set_target_properties(Mongoose PROPERTIES SOVERSION ${Mongoose_VERSION_MAJOR}) # else() - set_target_properties ( mongoose PROPERTIES + set_target_properties ( Mongoose PROPERTIES VERSION ${Mongoose_VERSION_MAJOR}.${Mongoose_VERSION_MINOR}.${Mongoose_VERSION_PATCH} SOVERSION ${Mongoose_VERSION_MAJOR} ) # endif() -set_target_properties ( mongoose PROPERTIES PUBLIC_HEADER Include/Mongoose.hpp ) -target_include_directories ( mongoose PRIVATE . ) +set_target_properties ( Mongoose PROPERTIES PUBLIC_HEADER Include/Mongoose.hpp ) +target_include_directories ( Mongoose PRIVATE . ) #------------------------------------------------------------------------------- # Build the Mongoose debug/test library -add_library ( mongoose_static_dbg STATIC ${MONGOOSE_LIB_FILES} ) -set_target_properties ( mongoose_static_dbg PROPERTIES +add_library ( Mongoose_static_dbg STATIC ${MONGOOSE_LIB_FILES} ) +set_target_properties ( Mongoose_static_dbg PROPERTIES OUTPUT_NAME mongoose_dbg ) -target_link_libraries ( mongoose_static_dbg ${SUITESPARSE_CONFIG_LIBRARY} ) +if ( TARGET SuiteSparse::SuiteSparseConfig_static ) + target_link_libraries ( Mongoose_static_dbg SuiteSparse::SuiteSparseConfig_static ) +else ( ) + target_link_libraries ( Mongoose_static_dbg SuiteSparse::SuiteSparseConfig ) +endif ( ) # Build the Mongoose executable add_executable ( mongoose_exe ${EXE_FILES} ) set_target_properties ( mongoose_exe PROPERTIES OUTPUT_NAME mongoose ) if ( NSTATIC ) - target_link_libraries ( mongoose_exe mongoose ) + target_link_libraries ( mongoose_exe Mongoose ) else ( ) - target_link_libraries ( mongoose_exe mongoose_static ) + target_link_libraries ( mongoose_exe Mongoose_static ) endif ( ) # Build the Demo executable @@ -233,9 +253,9 @@ add_executable ( demo_exe ${DEMO_FILES} ) set_target_properties ( demo_exe PROPERTIES OUTPUT_NAME demo ) if ( NSTATIC ) - target_link_libraries ( demo_exe mongoose ) + target_link_libraries ( demo_exe Mongoose ) else ( ) - target_link_libraries ( demo_exe mongoose_static ) + target_link_libraries ( demo_exe Mongoose_static ) endif ( ) # Coverage and Unit Testing Setup @@ -246,7 +266,7 @@ set(TESTING_OUTPUT_PATH ${CMAKE_BINARY_DIR}/tests) add_executable(mongoose_test_io Tests/Mongoose_Test_IO.cpp Tests/Mongoose_Test_IO_exe.cpp) -target_link_libraries ( mongoose_test_io mongoose_static_dbg ) +target_link_libraries ( mongoose_test_io Mongoose_static_dbg ) set_target_properties(mongoose_test_io PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTING_OUTPUT_PATH}) add_test(IO_Test ./runTests -min 1 -max 15 -t io -k) @@ -255,7 +275,7 @@ add_test(IO_Test ./runTests -min 1 -max 15 -t io -k) add_executable(mongoose_test_edgesep Tests/Mongoose_Test_EdgeSeparator.cpp Tests/Mongoose_Test_EdgeSeparator_exe.cpp) -target_link_libraries ( mongoose_test_edgesep mongoose_static_dbg ) +target_link_libraries ( mongoose_test_edgesep Mongoose_static_dbg ) set_target_properties(mongoose_test_edgesep PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTING_OUTPUT_PATH}) add_test(Edge_Separator_Test ./runTests -min 1 -max 15 -t edgesep) @@ -267,7 +287,7 @@ add_test(Target_Split_Test ./runTests -min 1 -max 15 -t edgesep -s 0.3) add_executable(mongoose_test_memory Tests/Mongoose_Test_Memory.cpp Tests/Mongoose_Test_Memory_exe.cpp) -target_link_libraries ( mongoose_test_memory mongoose_static_dbg ) +target_link_libraries ( mongoose_test_memory Mongoose_static_dbg ) set_target_properties(mongoose_test_memory PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTING_OUTPUT_PATH}) add_test(Memory_Test ./runTests -min 1 -max 15 -t memory) @@ -277,9 +297,9 @@ add_executable(mongoose_test_performance Tests/Mongoose_Test_Performance.cpp Tests/Mongoose_Test_Performance_exe.cpp) if ( NSTATIC ) - target_link_libraries ( mongoose_test_performance mongoose ) + target_link_libraries ( mongoose_test_performance Mongoose ) else ( ) - target_link_libraries ( mongoose_test_performance mongoose_static ) + target_link_libraries ( mongoose_test_performance Mongoose_static ) endif ( ) set_target_properties(mongoose_test_performance PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTING_OUTPUT_PATH}) add_test(Performance_Test ./runTests -min 1 -max 15 -t performance -p) @@ -290,28 +310,28 @@ add_executable(mongoose_test_reference Tests/Mongoose_Test_Reference.cpp Tests/Mongoose_Test_Reference_exe.cpp) if ( NSTATIC ) - target_link_libraries ( mongoose_test_reference mongoose ) + target_link_libraries ( mongoose_test_reference Mongoose ) else ( ) - target_link_libraries ( mongoose_test_reference mongoose_static ) + target_link_libraries ( mongoose_test_reference Mongoose_static ) endif ( ) set_target_properties(mongoose_test_reference PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTING_OUTPUT_PATH}) # Unit Tests add_executable(mongoose_unit_test_io Tests/Mongoose_UnitTest_IO_exe.cpp) -target_link_libraries ( mongoose_unit_test_io mongoose_static_dbg ) +target_link_libraries ( mongoose_unit_test_io Mongoose_static_dbg ) set_target_properties(mongoose_unit_test_io PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTING_OUTPUT_PATH}) add_test(Unit_Test_IO ./tests/mongoose_unit_test_io) add_executable(mongoose_unit_test_graph Tests/Mongoose_UnitTest_Graph_exe.cpp) -target_link_libraries ( mongoose_unit_test_graph mongoose_static_dbg ) +target_link_libraries ( mongoose_unit_test_graph Mongoose_static_dbg ) set_target_properties(mongoose_unit_test_graph PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTING_OUTPUT_PATH}) add_test(Unit_Test_Graph ./tests/mongoose_unit_test_graph) add_executable(mongoose_unit_test_edgesep Tests/Mongoose_UnitTest_EdgeSep_exe.cpp) -target_link_libraries ( mongoose_unit_test_edgesep mongoose_static_dbg ) +target_link_libraries ( mongoose_unit_test_edgesep Mongoose_static_dbg ) set_target_properties(mongoose_unit_test_edgesep PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTING_OUTPUT_PATH}) add_test(Unit_Test_EdgeSep ./tests/mongoose_unit_test_edgesep) @@ -366,8 +386,8 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") # using Visual Studio C++ endif () -set_target_properties ( mongoose_static_dbg PROPERTIES COMPILE_FLAGS "${CMAKE_CXX_FLAGS_DEBUG}" ) -set_target_properties ( mongoose_static_dbg PROPERTIES LINK_FLAGS "${CMAKE_EXE_LINKER_FLAGS_DEBUG}" ) +set_target_properties ( Mongoose_static_dbg PROPERTIES COMPILE_FLAGS "${CMAKE_CXX_FLAGS_DEBUG}" ) +set_target_properties ( Mongoose_static_dbg PROPERTIES LINK_FLAGS "${CMAKE_EXE_LINKER_FLAGS_DEBUG}" ) # Add debug compile/linker flags set_target_properties(mongoose_test_io PROPERTIES COMPILE_FLAGS "${CMAKE_CXX_FLAGS_DEBUG}") @@ -389,16 +409,16 @@ set(CMAKE_CXX_OUTPUT_EXTENSION_REPLACE 1) # Necessary for gcov - prevents file.c file(COPY Tests/runTests DESTINATION ${CMAKE_BINARY_DIR}) # if ( NOT NSTATIC ) -# add_custom_command ( TARGET mongoose_static +# add_custom_command ( TARGET Mongoose_static # POST_BUILD -# COMMAND ${CMAKE_COMMAND} -E copy $ ${PROJECT_SOURCE_DIR}/Lib +# COMMAND ${CMAKE_COMMAND} -E copy $ ${PROJECT_SOURCE_DIR}/Lib # COMMENT "Copying libmongoose (static) to root Lib directory" # ) # endif ( ) -# add_custom_command ( TARGET mongoose +# add_custom_command ( TARGET Mongoose # POST_BUILD -# COMMAND ${CMAKE_COMMAND} -E copy $ ${PROJECT_SOURCE_DIR}/Lib +# COMMAND ${CMAKE_COMMAND} -E copy $ ${PROJECT_SOURCE_DIR}/Lib # COMMENT "Copying libmongoose (dynamic) to root Lib directory" # ) @@ -428,20 +448,74 @@ add_custom_target(userguide # Mongoose installation location #------------------------------------------------------------------------------- -install ( TARGETS mongoose +include ( CMakePackageConfigHelpers ) + +install ( TARGETS Mongoose + EXPORT MongooseTargets LIBRARY DESTINATION ${SUITESPARSE_LIBDIR} ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} RUNTIME DESTINATION ${SUITESPARSE_BINDIR} PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} ) if ( NOT NSTATIC ) - install ( TARGETS mongoose_static + install ( TARGETS Mongoose_static + EXPORT MongooseTargets ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} ) endif ( ) install ( TARGETS mongoose_exe RUNTIME DESTINATION ${SUITESPARSE_BINDIR} ) -install ( FILES ${CMAKE_SOURCE_DIR}/cmake_modules/FindMongoose.cmake - DESTINATION ${SUITESPARSE_LIBDIR}/cmake/SuiteSparse - COMPONENT Development ) + +# create (temporary) export target file during build +export ( EXPORT MongooseTargets + NAMESPACE SuiteSparse:: + FILE ${CMAKE_CURRENT_BINARY_DIR}/MongooseTargets.cmake ) + +# install export target, config and version files for find_package +install ( EXPORT MongooseTargets + NAMESPACE SuiteSparse:: + DESTINATION ${SUITESPARSE_LIBDIR}/cmake/Mongoose ) + +configure_package_config_file ( + Config/MongooseConfig.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/MongooseConfig.cmake + INSTALL_DESTINATION ${SUITESPARSE_LIBDIR}/cmake/Mongoose ) + +write_basic_package_version_file ( + ${CMAKE_CURRENT_BINARY_DIR}/MongooseConfigVersion.cmake + COMPATIBILITY SameMajorVersion ) + +install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/MongooseConfig.cmake + ${CMAKE_CURRENT_BINARY_DIR}/MongooseConfigVersion.cmake + DESTINATION ${SUITESPARSE_LIBDIR}/cmake/Mongoose ) + +#------------------------------------------------------------------------------- +# create pkg-config file +#------------------------------------------------------------------------------- + +if ( NOT MSVC ) + set ( prefix "${CMAKE_INSTALL_PREFIX}" ) + set ( exec_prefix "\${prefix}" ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) + if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) + set ( libdir "${SUITESPARSE_LIBDIR}") + else ( ) + set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") + endif ( ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) + if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) + set ( includedir "${SUITESPARSE_INCLUDEDIR}") + else ( ) + set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + endif ( ) + configure_file ( + Config/Mongoose.pc.in + Mongoose.pc + @ONLY + NEWLINE_STYLE LF ) + install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/Mongoose.pc + DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) +endif ( ) #------------------------------------------------------------------------------- # report status diff --git a/Mongoose/Config/Mongoose.pc.in b/Mongoose/Config/Mongoose.pc.in new file mode 100644 index 000000000..835e8c789 --- /dev/null +++ b/Mongoose/Config/Mongoose.pc.in @@ -0,0 +1,16 @@ +# Mongoose, Copyright (c) 2018-2023, Timothy A. Davis. +# All Rights Reserved. +# SPDX-License-Identifier: GPL-3.0-only + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: Mongoose +URL: https://github.com/DrTimothyAldenDavis/SuiteSparse +Description: Graph partitioning library in SuiteSparse +Version: @Mongoose_VERSION_MAJOR@.@Mongoose_VERSION_MINOR@.@Mongoose_VERSION_PATCH@ +Requires.private: SuiteSparse_config +Libs: -L${libdir} -lmongoose +Cflags: -I${includedir} diff --git a/Mongoose/Config/MongooseConfig.cmake.in b/Mongoose/Config/MongooseConfig.cmake.in new file mode 100644 index 000000000..84089876e --- /dev/null +++ b/Mongoose/Config/MongooseConfig.cmake.in @@ -0,0 +1,121 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/Mongoose/cmake_modules/MongooseConfig.cmake +#------------------------------------------------------------------------------- + +# The following copyright and license applies to just this file only, not to +# the library itself: +# MongooseConfig.cmake, Copyright (c) 2023, Timothy A. Davis. All Rights Reserved. +# SPDX-License-Identifier: BSD-3-clause + +#------------------------------------------------------------------------------- + +# Finds the Mongoose include file and compiled library. +# The following targets are defined: +# SuiteSparse::Mongoose - for the shared library (if available) +# SuiteSparse::Mongoose_static - for the static library (if available) + +# For backward compatibility the following variables are set: + +# MONGOOSE_INCLUDE_DIR - where to find Mongoose.hpp +# MONGOOSE_LIBRARY - dynamic Mongoose library +# MONGOOSE_STATIC - static Mongoose library +# MONGOOSE_LIBRARIES - libraries when using Mongoose +# MONGOOSE_FOUND - true if Mongoose found + +# Set ``CMAKE_MODULE_PATH`` to the parent folder where this module file is +# installed. + +#------------------------------------------------------------------------------- + +@PACKAGE_INIT@ + +set ( MONGOOSE_DATE "@Mongoose_DATE@" ) +set ( MONGOOSE_VERSION_MAJOR @Mongoose_VERSION_MAJOR@ ) +set ( MONGOOSE_VERSION_MINOR @Mongoose_VERSION_MINOR@ ) +set ( MONGOOSE_VERSION_PATCH @Mongoose_VERSION_PATCH@ ) +set ( MONGOOSE_VERSION "@Mongoose_VERSION_MAJOR@.@Mongoose_VERSION_MINOR@.@Mongoose_VERSION_PATCH@" ) + +include ( ${CMAKE_CURRENT_LIST_DIR}/MongooseTargets.cmake ) + +# The following is only for backward compatibility with FindMongoose. + +set ( _target_shared SuiteSparse::Mongoose ) +set ( _target_static SuiteSparse::Mongoose_static ) +set ( _var_prefix "MONGOOSE" ) + +get_target_property ( ${_var_prefix}_INCLUDE_DIR ${_target_shared} INTERFACE_INCLUDE_DIRECTORIES ) +if ( ${_var_prefix}_INCLUDE_DIR ) + # First item in SuiteSparse targets contains the "main" header directory. + list ( GET ${_var_prefix}_INCLUDE_DIR 0 ${_var_prefix}_INCLUDE_DIR ) +endif ( ) +get_target_property ( ${_var_prefix}_LIBRARY ${_target_shared} IMPORTED_IMPLIB ) +if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} IMPORTED_LOCATION ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) +endif ( ) +if ( TARGET ${_target_static} ) + get_target_property ( ${_var_prefix}_STATIC ${_target_static} IMPORTED_LOCATION ) +endif ( ) + +# Check for most common build types +set ( _config_types "Debug" "Release" "RelWithDebInfo" "MinSizeRel" ) + +get_property ( _isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG ) +if ( _isMultiConfig ) + # For multi-configuration generators (e.g., Visual Studio), prefer those + # configurations. + list ( PREPEND _config_types ${CMAKE_CONFIGURATION_TYPES} ) +else ( ) + # For single-configuration generators, prefer the current configuration. + list ( PREPEND _config_types ${CMAKE_BUILD_TYPE} ) +endif ( ) + +list ( REMOVE_DUPLICATES _config_types ) + +foreach ( _config ${_config_types} ) + string ( TOUPPER ${_config} _uc_config ) + if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} + IMPORTED_IMPLIB_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) + endif ( ) + if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} + IMPORTED_LOCATION_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) + endif ( ) + if ( TARGET ${_target_static} AND NOT ${_var_prefix}_STATIC ) + get_target_property ( _library_chk ${_target_static} + IMPORTED_LOCATION_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_STATIC ${_library_chk} ) + endif ( ) + endif ( ) +endforeach ( ) + +set ( MONGOOSE_LIBRARIES ${MONGOOSE_LIBRARY} ) + +macro ( suitesparse_check_exist _var _files ) + # ignore generator expressions + string ( GENEX_STRIP "${_files}" _files2 ) + + foreach ( _file ${_files2} ) + if ( NOT EXISTS "${_file}" ) + message ( FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist!" ) + endif ( ) + endforeach () +endmacro ( ) + +suitesparse_check_exist ( MONGOOSE_INCLUDE_DIR ${MONGOOSE_INCLUDE_DIR} ) +suitesparse_check_exist ( MONGOOSE_LIBRARY ${MONGOOSE_LIBRARY} ) + +message ( STATUS "Mongoose version: ${MONGOOSE_VERSION}" ) +message ( STATUS "Mongoose include: ${MONGOOSE_INCLUDE_DIR}" ) +message ( STATUS "Mongoose library: ${MONGOOSE_LIBRARY}" ) +message ( STATUS "Mongoose static: ${MONGOOSE_STATIC}" ) diff --git a/Mongoose/Doc/ChangeLog b/Mongoose/Doc/ChangeLog index c9fad5289..a15f7efd3 100644 --- a/Mongoose/Doc/ChangeLog +++ b/Mongoose/Doc/ChangeLog @@ -1,3 +1,7 @@ +Sept 8, 2023: version 3.2.0 + + * cmake updates: SuiteSparse:: namespace by Markus Muetzel + June 16, 2023: version 3.0.4 * cmake build system updates: update by Markus Muetzel diff --git a/Mongoose/Doc/Mongoose_UserGuide.pdf b/Mongoose/Doc/Mongoose_UserGuide.pdf index 919a89f43..38ac224a1 100644 Binary files a/Mongoose/Doc/Mongoose_UserGuide.pdf and b/Mongoose/Doc/Mongoose_UserGuide.pdf differ diff --git a/Mongoose/Doc/title-info.tex b/Mongoose/Doc/title-info.tex index ff6264120..071ffb6e5 100644 --- a/Mongoose/Doc/title-info.tex +++ b/Mongoose/Doc/title-info.tex @@ -1,3 +1,3 @@ -\title{Mongoose User Guide, Version 3.0.5} +\title{Mongoose User Guide, Version 3.2.0} \author{Scott Kolodziej, Nuri Yeralan, Tim Davis, William W. Hager} -\date{June 16, 2023} +\date{Sept 8, 2023} diff --git a/Mongoose/Include/Mongoose.hpp b/Mongoose/Include/Mongoose.hpp index 8a0872cc5..286065378 100644 --- a/Mongoose/Include/Mongoose.hpp +++ b/Mongoose/Include/Mongoose.hpp @@ -19,9 +19,9 @@ // Configuration information from CMake #define Mongoose_VERSION_MAJOR 3 -#define Mongoose_VERSION_MINOR 0 -#define Mongoose_VERSION_PATCH 5 -#define Mongoose_DATE "June 16, 2023" +#define Mongoose_VERSION_MINOR 2 +#define Mongoose_VERSION_PATCH 0 +#define Mongoose_DATE "Sept 8, 2023" namespace Mongoose { diff --git a/Mongoose/cmake_modules/FindMongoose.cmake b/Mongoose/cmake_modules/FindMongoose.cmake deleted file mode 100644 index 728137dea..000000000 --- a/Mongoose/cmake_modules/FindMongoose.cmake +++ /dev/null @@ -1,135 +0,0 @@ -#------------------------------------------------------------------------------- -# SuiteSparse/Mongoose/cmake_modules/FindMongoose.cmake -#------------------------------------------------------------------------------- - -# The following copyright and license applies to just this file only, not to -# the library itself: -# FindMongoose.cmake, Copyright (c) 2022-2023, Timothy A. Davis. All Rights Reserved. -# SPDX-License-Identifier: BSD-3-clause - -#------------------------------------------------------------------------------- - -# Finds the Mongoose include file and compiled library and sets: - -# MONGOOSE_INCLUDE_DIR - where to find Mongoose.hpp -# MONGOOSE_LIBRARY - dynamic Mongoose library -# MONGOOSE_STATIC - static Mongoose library -# MONGOOSE_LIBRARIES - libraries when using Mongoose -# MONGOOSE_FOUND - true if Mongoose found - -# set ``MONGOOSE_ROOT`` or ``Mongoose_ROOT`` to a MONGOOSE installation root to -# tell this module where to look. - -# All the Find*.cmake files in SuiteSparse are installed by 'make install' into -# /usr/local/lib/cmake/SuiteSparse (where '/usr/local' is the -# ${CMAKE_INSTALL_PREFIX}). To access this file, place the following commands -# in your CMakeLists.txt file. See also SuiteSparse/Example/CMakeLists.txt: -# -# set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} -# ${CMAKE_INSTALL_PREFIX}/lib/cmake/SuiteSparse ) - -#------------------------------------------------------------------------------- - -# include files for Mongoose -find_path ( MONGOOSE_INCLUDE_DIR - NAMES Mongoose.hpp - HINTS ${MONGOOSE_ROOT} - HINTS ENV ${MONGOOSE_ROOT} - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/Mongoose - HINTS ${CMAKE_SOURCE_DIR}/../Mongoose - PATH_SUFFIXES include Include -) - -# dynamic Mongoose library (or static if no dynamic library was built) -find_library ( MONGOOSE_LIBRARY - NAMES mongoose mongoose_static - HINTS ${MONGOOSE_ROOT} - HINTS ENV ${MONGOOSE_ROOT} - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/Mongoose - HINTS ${CMAKE_SOURCE_DIR}/../Mongoose - PATH_SUFFIXES lib build build/Release build/Debug -) - -if ( MSVC ) - set ( STATIC_NAME mongoose_static mongoose ) -else ( ) - set ( STATIC_NAME mongoose ) - set ( save ${CMAKE_FIND_LIBRARY_SUFFIXES} ) - set ( CMAKE_FIND_LIBRARY_SUFFIXES - ${CMAKE_STATIC_LIBRARY_SUFFIX} ${CMAKE_FIND_LIBRARY_SUFFIXES} ) -endif ( ) - -# static Mongoose library -find_library ( MONGOOSE_STATIC - NAMES ${STATIC_NAME} - HINTS ${MONGOOSE_ROOT} - HINTS ENV ${MONGOOSE_ROOT} - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/Mongoose - HINTS ${CMAKE_SOURCE_DIR}/../Mongoose - PATH_SUFFIXES lib build build/Release build/Debug -) - -if ( NOT MSVC ) - # restore the CMAKE_FIND_LIBRARY_SUFFIXES variable - set ( CMAKE_FIND_LIBRARY_SUFFIXES ${save} ) -endif ( ) - -# get version of the library from the dynamic library name -get_filename_component ( MONGOOSE_LIBRARY ${MONGOOSE_LIBRARY} REALPATH ) -get_filename_component ( MONGOOSE_FILENAME ${MONGOOSE_LIBRARY} NAME ) -string ( - REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" - MONGOOSE_VERSION - ${MONGOOSE_FILENAME} -) - -# set ( MONGOOSE_VERSION "" ) -if ( EXISTS "${MONGOOSE_INCLUDE_DIR}" AND NOT MONGOOSE_VERSION ) - # if the version does not appear in the filename, read the include file - file ( STRINGS ${MONGOOSE_INCLUDE_DIR}/Mongoose.hpp MONGOOSE_MAJOR_STR - REGEX "define Mongoose_VERSION_MAJOR" ) - file ( STRINGS ${MONGOOSE_INCLUDE_DIR}/Mongoose.hpp MONGOOSE_MINOR_STR - REGEX "define Mongoose_VERSION_MINOR" ) - file ( STRINGS ${MONGOOSE_INCLUDE_DIR}/Mongoose.hpp MONGOOSE_PATCH_STR - REGEX "define Mongoose_VERSION_PATCH" ) - message ( STATUS "major: ${MONGOOSE_MAJOR_STR}" ) - message ( STATUS "minor: ${MONGOOSE_MINOR_STR}" ) - message ( STATUS "patch: ${MONGOOSE_PATCH_STR}" ) - string ( REGEX MATCH "[0-9]+" MONGOOSE_MAJOR ${MONGOOSE_MAJOR_STR} ) - string ( REGEX MATCH "[0-9]+" MONGOOSE_MINOR ${MONGOOSE_MINOR_STR} ) - string ( REGEX MATCH "[0-9]+" MONGOOSE_PATCH ${MONGOOSE_PATCH_STR} ) - set (MONGOOSE_VERSION "${MONGOOSE_MAJOR}.${MONGOOSE_MINOR}.${MONGOOSE_PATCH}") -endif ( ) - -set ( MONGOOSE_LIBRARIES ${MONGOOSE_LIBRARY} ) - -include (FindPackageHandleStandardArgs) - -find_package_handle_standard_args ( Mongoose - REQUIRED_VARS MONGOOSE_LIBRARY MONGOOSE_INCLUDE_DIR - VERSION_VAR MONGOOSE_VERSION -) - -mark_as_advanced ( - MONGOOSE_INCLUDE_DIR - MONGOOSE_LIBRARY - MONGOOSE_STATIC - MONGOOSE_LIBRARIES -) - -if ( MONGOOSE_FOUND ) - message ( STATUS "Mongoose version: ${MONGOOSE_VERSION}" ) - message ( STATUS "Mongoose include: ${MONGOOSE_INCLUDE_DIR}" ) - message ( STATUS "Mongoose library: ${MONGOOSE_LIBRARY}" ) - message ( STATUS "Mongoose static: ${MONGOOSE_STATIC}" ) -else ( ) - message ( STATUS "Mongoose not found" ) - set ( MONGOOSE_INCLUDE_DIR "" ) - set ( MONGOOSE_LIBRARIES "" ) - set ( MONGOOSE_LIBRARY "" ) - set ( MONGOOSE_STATIC "" ) -endif ( ) - diff --git a/Mongoose/codemeta.json b/Mongoose/codemeta.json index 3bc9eacc0..e263981b1 100644 --- a/Mongoose/codemeta.json +++ b/Mongoose/codemeta.json @@ -7,8 +7,8 @@ "codeRepository": "https://github.com/ScottKolo/Mongoose", "issueTracker": "https://github.com/ScottKolo/Mongoose/issues", "license": "https://spdx.org/licenses/GPL-3.0-only.html", - "version": "3.0.5", - "softwareVersion": "3.0.5", + "version": "3.2.0", + "softwareVersion": "3.2.0", "author": [ { "@type": "Person", @@ -47,7 +47,7 @@ }, "contIntegration": "https://travis-ci.com/ScottKolo/Mongoose", "developmentStatus": "active", - "downloadUrl": "https://github.com/ScottKolo/Mongoose/archive/v3.0.5.zip", + "downloadUrl": "https://github.com/ScottKolo/Mongoose/archive/v3.2.0.zip", "funding":"Office of Naval Research grant N00014-11-1-0068", "funding":"Office of Naval Research grant N00014-15-1-2048", "funding":"Office of Naval Research grant N00014-18-1-2100", @@ -66,7 +66,7 @@ ], "dateCreated":"2018-04-09", "datePublished":"2018-05-25", - "dateModified":"2023-06-16", + "dateModified":"2023-09-08", "programmingLanguage": "C++", "programmingLanguage": "MATLAB" } diff --git a/RBio/CMakeLists.txt b/RBio/CMakeLists.txt index 7b74e1813..f82f62f96 100644 --- a/RBio/CMakeLists.txt +++ b/RBio/CMakeLists.txt @@ -9,11 +9,11 @@ # get the version #------------------------------------------------------------------------------- -cmake_minimum_required ( VERSION 3.19 ) +cmake_minimum_required ( VERSION 3.20 ) -set ( RBIO_DATE "June 16, 2023" ) +set ( RBIO_DATE "Sept 8, 2023" ) set ( RBIO_VERSION_MAJOR 4 ) -set ( RBIO_VERSION_MINOR 0 ) +set ( RBIO_VERSION_MINOR 2 ) set ( RBIO_VERSION_SUB 0 ) message ( STATUS "Building RBIO version: v" @@ -26,7 +26,6 @@ message ( STATUS "Building RBIO version: v" #------------------------------------------------------------------------------- set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} - ${CMAKE_SOURCE_DIR}/cmake_modules ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/cmake_modules ) include ( SuiteSparsePolicy ) @@ -43,7 +42,11 @@ project ( rbio # find library dependencies #------------------------------------------------------------------------------- -find_package ( SuiteSparse_config 7.1.0 REQUIRED ) +find_package ( SuiteSparse_config 7.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH ) +if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) + find_package ( SuiteSparse_config 7.2.0 REQUIRED ) +endif ( ) #------------------------------------------------------------------------------- # configure files @@ -57,7 +60,7 @@ configure_file ( "Config/RBio.h.in" # include directories #------------------------------------------------------------------------------- -include_directories ( Source Include ${SUITESPARSE_CONFIG_INCLUDE_DIR} ) +include_directories ( Source Include ) #------------------------------------------------------------------------------- # dynamic rbio library properties @@ -65,24 +68,29 @@ include_directories ( Source Include ${SUITESPARSE_CONFIG_INCLUDE_DIR} ) file ( GLOB RBIO_SOURCES "Source/*.c" ) -add_library ( rbio SHARED ${RBIO_SOURCES} ) +add_library ( RBio SHARED ${RBIO_SOURCES} ) -set_target_properties ( rbio PROPERTIES +set_target_properties ( RBio PROPERTIES VERSION ${RBIO_VERSION_MAJOR}.${RBIO_VERSION_MINOR}.${RBIO_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON + OUTPUT_NAME rbio SOVERSION ${RBIO_VERSION_MAJOR} PUBLIC_HEADER "Include/RBio.h" WINDOWS_EXPORT_ALL_SYMBOLS ON ) +target_include_directories ( RBio + INTERFACE $ + $ ) + #------------------------------------------------------------------------------- # static rbio library properties #------------------------------------------------------------------------------- if ( NOT NSTATIC ) - add_library ( rbio_static STATIC ${RBIO_SOURCES} ) + add_library ( RBio_static STATIC ${RBIO_SOURCES} ) - set_target_properties ( rbio_static PROPERTIES + set_target_properties ( RBio_static PROPERTIES VERSION ${RBIO_VERSION_MAJOR}.${RBIO_VERSION_MINOR}.${RBIO_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON @@ -90,26 +98,38 @@ if ( NOT NSTATIC ) SOVERSION ${RBIO_VERSION_MAJOR} ) if ( MSVC ) - set_target_properties ( rbio_static PROPERTIES + set_target_properties ( RBio_static PROPERTIES OUTPUT_NAME rbio_static ) endif ( ) + + target_include_directories ( RBio_static + INTERFACE $ + $ ) + endif ( ) #------------------------------------------------------------------------------- # add the library dependencies #------------------------------------------------------------------------------- -# suitesparseconfig: -target_link_libraries ( rbio PRIVATE ${SUITESPARSE_CONFIG_LIBRARIES} ) +# SuiteSparseConfig: +target_link_libraries ( RBio PRIVATE SuiteSparse::SuiteSparseConfig ) +target_include_directories ( RBio PUBLIC + "$" ) if ( NOT NSTATIC ) - target_link_libraries ( rbio_static PUBLIC ${SUITESPARSE_CONFIG_STATIC} ) + if ( TARGET SuiteSparse::SuiteSparseConfig_static ) + target_link_libraries ( RBio_static PUBLIC SuiteSparse::SuiteSparseConfig_static ) + else ( ) + target_link_libraries ( RBio_static PUBLIC SuiteSparse::SuiteSparseConfig ) + endif ( ) endif ( ) # libm: if ( NOT WIN32 ) - target_link_libraries ( rbio PRIVATE m ) + target_link_libraries ( RBio PRIVATE m ) if ( NOT NSTATIC ) - target_link_libraries ( rbio_static PUBLIC m ) + set ( RBIO_STATIC_LIBS "${RBIO_STATIC_LIBS} -lm" ) + target_link_libraries ( RBio_static PUBLIC m ) endif ( ) endif ( ) @@ -117,19 +137,73 @@ endif ( ) # RBIO installation location #------------------------------------------------------------------------------- -install ( TARGETS rbio +include ( CMakePackageConfigHelpers ) + +install ( TARGETS RBio + EXPORT RBioTargets LIBRARY DESTINATION ${SUITESPARSE_LIBDIR} ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} RUNTIME DESTINATION ${SUITESPARSE_BINDIR} PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} ) -install ( FILES ${CMAKE_SOURCE_DIR}/cmake_modules/FindRBio.cmake - DESTINATION ${SUITESPARSE_LIBDIR}/cmake/SuiteSparse - COMPONENT Development ) if ( NOT NSTATIC ) - install ( TARGETS rbio_static + install ( TARGETS RBio_static + EXPORT RBioTargets ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} ) endif ( ) +# create (temporary) export target file during build +export ( EXPORT RBioTargets + NAMESPACE SuiteSparse:: + FILE ${CMAKE_CURRENT_BINARY_DIR}/RBioTargets.cmake ) + +# install export target, config and version files for find_package +install ( EXPORT RBioTargets + NAMESPACE SuiteSparse:: + DESTINATION ${SUITESPARSE_LIBDIR}/cmake/RBio ) + +configure_package_config_file ( + Config/RBioConfig.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/RBioConfig.cmake + INSTALL_DESTINATION ${SUITESPARSE_LIBDIR}/cmake/RBio ) + +write_basic_package_version_file ( + ${CMAKE_CURRENT_BINARY_DIR}/RBioConfigVersion.cmake + COMPATIBILITY SameMajorVersion ) + +install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/RBioConfig.cmake + ${CMAKE_CURRENT_BINARY_DIR}/RBioConfigVersion.cmake + DESTINATION ${SUITESPARSE_LIBDIR}/cmake/RBio ) + +#------------------------------------------------------------------------------- +# create pkg-config file +#------------------------------------------------------------------------------- + +if ( NOT MSVC ) + set ( prefix "${CMAKE_INSTALL_PREFIX}" ) + set ( exec_prefix "\${prefix}" ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) + if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) + set ( libdir "${SUITESPARSE_LIBDIR}") + else ( ) + set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") + endif ( ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) + if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) + set ( includedir "${SUITESPARSE_INCLUDEDIR}") + else ( ) + set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + endif ( ) + configure_file ( + Config/RBio.pc.in + RBio.pc + @ONLY + NEWLINE_STYLE LF ) + install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/RBio.pc + DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) +endif ( ) + #------------------------------------------------------------------------------- # Demo library and programs #------------------------------------------------------------------------------- @@ -150,7 +224,7 @@ if ( DEMO ) add_executable ( RBdemo "Demo/RBdemo.c" ) # Libraries required for Demo programs - target_link_libraries ( RBdemo PUBLIC rbio ${SUITESPARSE_CONFIG_LIBRARIES} ) + target_link_libraries ( RBdemo PUBLIC RBio SuiteSparse::SuiteSparseConfig ) else ( ) diff --git a/RBio/Config/RBio.pc.in b/RBio/Config/RBio.pc.in new file mode 100644 index 000000000..fea425c95 --- /dev/null +++ b/RBio/Config/RBio.pc.in @@ -0,0 +1,17 @@ +# RBio, Copyright (c) 2009-2023, Timothy A. Davis. +# All Rights Reserved. +# SPDX-License-Identifier: GPL-2.0-or-later + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: RBio +URL: https://github.com/DrTimothyAldenDavis/SuiteSparse +Description: MATLAB Toolbox for reading/writing sparse matrices in Rutherford/Boeing format in SuiteSparse +Version: @RBIO_VERSION_MAJOR@.@RBIO_VERSION_MINOR@.@RBIO_VERSION_SUB@ +Requires.private: SuiteSparse_config +Libs: -L${libdir} -lrbio +Libs.private: @RBIO_STATIC_LIBS@ +Cflags: -I${includedir} diff --git a/RBio/Config/RBioConfig.cmake.in b/RBio/Config/RBioConfig.cmake.in new file mode 100644 index 000000000..2d0f259e0 --- /dev/null +++ b/RBio/Config/RBioConfig.cmake.in @@ -0,0 +1,121 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/RBio/cmake_modules/RBioConfig.cmake +#------------------------------------------------------------------------------- + +# The following copyright and license applies to just this file only, not to +# the library itself: +# RBioConfig.cmake, Copyright (c) 2023, Timothy A. Davis. All Rights Reserved. +# SPDX-License-Identifier: BSD-3-clause + +#------------------------------------------------------------------------------- + +# Finds the RBio include file and compiled library. +# The following targets are defined: +# SuiteSparse::RBio - for the shared library (if available) +# SuiteSparse::RBio_static - for the static library (if available) + +# For backward compatibility the following variables are set: + +# RBIO_INCLUDE_DIR - where to find RBio.h +# RBIO_LIBRARY - dynamic RBio library +# RBIO_STATIC - static RBio library +# RBIO_LIBRARIES - libraries when using RBio +# RBIO_FOUND - true if RBio found + +# Set ``CMAKE_MODULE_PATH`` to the parent folder where this module file is +# installed. + +#------------------------------------------------------------------------------- + +@PACKAGE_INIT@ + +set ( RBIO_DATE "@RBIO_DATE@" ) +set ( RBIO_VERSION_MAJOR @RBIO_VERSION_MAJOR@ ) +set ( RBIO_VERSION_MINOR @RBIO_VERSION_MINOR@ ) +set ( RBIO_VERSION_PATCH @RBIO_VERSION_SUB@ ) +set ( RBIO_VERSION "@RBIO_VERSION_MAJOR@.@RBIO_VERSION_MINOR@.@RBIO_VERSION_SUB@" ) + +include ( ${CMAKE_CURRENT_LIST_DIR}/RBioTargets.cmake ) + +# The following is only for backward compatibility with FindRBio. + +set ( _target_shared SuiteSparse::RBio ) +set ( _target_static SuiteSparse::RBio_static ) +set ( _var_prefix "RBIO" ) + +get_target_property ( ${_var_prefix}_INCLUDE_DIR ${_target_shared} INTERFACE_INCLUDE_DIRECTORIES ) +if ( ${_var_prefix}_INCLUDE_DIR ) + # First item in SuiteSparse targets contains the "main" header directory. + list ( GET ${_var_prefix}_INCLUDE_DIR 0 ${_var_prefix}_INCLUDE_DIR ) +endif ( ) +get_target_property ( ${_var_prefix}_LIBRARY ${_target_shared} IMPORTED_IMPLIB ) +if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} IMPORTED_LOCATION ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) +endif ( ) +if ( TARGET ${_target_static} ) + get_target_property ( ${_var_prefix}_STATIC ${_target_static} IMPORTED_LOCATION ) +endif ( ) + +# Check for most common build types +set ( _config_types "Debug" "Release" "RelWithDebInfo" "MinSizeRel" ) + +get_property ( _isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG ) +if ( _isMultiConfig ) + # For multi-configuration generators (e.g., Visual Studio), prefer those + # configurations. + list ( PREPEND _config_types ${CMAKE_CONFIGURATION_TYPES} ) +else ( ) + # For single-configuration generators, prefer the current configuration. + list ( PREPEND _config_types ${CMAKE_BUILD_TYPE} ) +endif ( ) + +list ( REMOVE_DUPLICATES _config_types ) + +foreach ( _config ${_config_types} ) + string ( TOUPPER ${_config} _uc_config ) + if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} + IMPORTED_IMPLIB_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) + endif ( ) + if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} + IMPORTED_LOCATION_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) + endif ( ) + if ( TARGET ${_target_static} AND NOT ${_var_prefix}_STATIC ) + get_target_property ( _library_chk ${_target_static} + IMPORTED_LOCATION_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_STATIC ${_library_chk} ) + endif ( ) + endif ( ) +endforeach ( ) + +set ( RBIO_LIBRARIES ${RBIO_LIBRARY} ) + +macro ( suitesparse_check_exist _var _files ) + # ignore generator expressions + string ( GENEX_STRIP "${_files}" _files2 ) + + foreach ( _file ${_files2} ) + if ( NOT EXISTS "${_file}" ) + message ( FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist!" ) + endif ( ) + endforeach () +endmacro ( ) + +suitesparse_check_exist ( RBIO_INCLUDE_DIR ${RBIO_INCLUDE_DIR} ) +suitesparse_check_exist ( RBIO_LIBRARY ${RBIO_LIBRARY} ) + +message ( STATUS "RBio version: ${RBIO_VERSION}" ) +message ( STATUS "RBio include: ${RBIO_INCLUDE_DIR}") +message ( STATUS "RBio library: ${RBIO_LIBRARY}" ) +message ( STATUS "RBio static: ${RBIO_STATIC}" ) diff --git a/RBio/Demo/RBdemo.out b/RBio/Demo/RBdemo.out index 46724e6ea..40592c9f1 100644 --- a/RBio/Demo/RBdemo.out +++ b/RBio/Demo/RBdemo.out @@ -1,3 +1,87 @@ +( cd build && cmake .. && cmake --build . --config Release -j8 ) +-- Building RBIO version: v4.2.0 (Sept 8, 2023) +-- Source: /home/faculty/d/davis/dev2/SuiteSparse/RBio +-- Build: /home/faculty/d/davis/dev2/SuiteSparse/RBio/build +-- Install lib: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Install include: /home/faculty/d/davis/dev2/SuiteSparse/include +-- Install bin: /home/faculty/d/davis/dev2/SuiteSparse/bin +-- Install rpath: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Build rpath: /home/faculty/d/davis/dev2/SuiteSparse/RBio/build;/home/faculty/d/davis/dev2/SuiteSparse/lib +-- Build type: Release +-- Fortran: /usr/bin/f95 +-- CUDA: not enabled +-- SuiteSparse_config version: 7.2.0 +-- SuiteSparse_config include: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config +-- SuiteSparse_config library: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.so.7.2.0 +-- SuiteSparse_config static: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.a +-- Also compiling the demos in RBio/Demo +-- ------------------------------------------------------------------------ +-- SuiteSparse CMAKE report for: rbio +-- ------------------------------------------------------------------------ +-- inside common SuiteSparse root: true +-- install in SuiteSparse/lib and SuiteSparse/include: 1 +-- build type: Release +-- NSTATIC: false (build static library) +-- use OpenMP: no +-- C compiler: /usr/bin/cc +-- C flags: +-- C++ compiler: +-- C++ flags: +-- C Flags release: -O3 -DNDEBUG +-- C++ Flags release: +-- Fortran compiler: /usr/bin/f95 +-- compile definitions: +-- ------------------------------------------------------------------------ +-- Configuring done (0.0s) +-- Generating done (0.0s) +-- Build files have been written to: /home/faculty/d/davis/dev2/SuiteSparse/RBio/build +gmake[1]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/RBio/build' +[ 37%] Built target RBio +[ 75%] Built target RBio_static +[100%] Built target RBdemo +gmake[1]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/RBio/build' +( cd build && cmake -DDEMO=1 .. && cmake --build . --config Release -j8 ) +-- Building RBIO version: v4.2.0 (Sept 8, 2023) +-- Source: /home/faculty/d/davis/dev2/SuiteSparse/RBio +-- Build: /home/faculty/d/davis/dev2/SuiteSparse/RBio/build +-- Install lib: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Install include: /home/faculty/d/davis/dev2/SuiteSparse/include +-- Install bin: /home/faculty/d/davis/dev2/SuiteSparse/bin +-- Install rpath: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Build rpath: /home/faculty/d/davis/dev2/SuiteSparse/RBio/build;/home/faculty/d/davis/dev2/SuiteSparse/lib +-- Build type: Release +-- Fortran: /usr/bin/f95 +-- CUDA: not enabled +-- SuiteSparse_config version: 7.2.0 +-- SuiteSparse_config include: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config +-- SuiteSparse_config library: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.so.7.2.0 +-- SuiteSparse_config static: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.a +-- Also compiling the demos in RBio/Demo +-- ------------------------------------------------------------------------ +-- SuiteSparse CMAKE report for: rbio +-- ------------------------------------------------------------------------ +-- inside common SuiteSparse root: true +-- install in SuiteSparse/lib and SuiteSparse/include: 1 +-- build type: Release +-- NSTATIC: false (build static library) +-- use OpenMP: no +-- C compiler: /usr/bin/cc +-- C flags: +-- C++ compiler: +-- C++ flags: +-- C Flags release: -O3 -DNDEBUG +-- C++ Flags release: +-- Fortran compiler: /usr/bin/f95 +-- compile definitions: +-- ------------------------------------------------------------------------ +-- Configuring done (0.0s) +-- Generating done (0.0s) +-- Build files have been written to: /home/faculty/d/davis/dev2/SuiteSparse/RBio/build +gmake[1]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/RBio/build' +[ 37%] Built target RBio +[ 75%] Built target RBio_static +[100%] Built target RBdemo +gmake[1]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/RBio/build' ./build/RBdemo < ./RBio/private/west0479.rua =========================================================== @@ -17,4 +101,3 @@ mtype of pattern: [pua] mtype of tril(A): [rua] (L) RBok status 0 0 22 RBdemo OK - diff --git a/RBio/Doc/ChangeLog b/RBio/Doc/ChangeLog index 27bfcd40d..68bc216a9 100644 --- a/RBio/Doc/ChangeLog +++ b/RBio/Doc/ChangeLog @@ -1,3 +1,7 @@ +Sept 8, 2023: version 4.2.0 + + * cmake updates: SuiteSparse:: namespace by Markus Muetzel + June 16, 2023: version 4.0.0 * revised API: declaring many input parameters as const. This is a minor diff --git a/RBio/Include/RBio.h b/RBio/Include/RBio.h index b06f81636..542b506ad 100644 --- a/RBio/Include/RBio.h +++ b/RBio/Include/RBio.h @@ -79,9 +79,9 @@ extern "C" { #define RBIO_VALUE_IOERROR (-94) /* I/O error: numerical values */ #define RBIO_FILE_IOERROR (-95) /* I/O error: cannot read/write the file */ -#define RBIO_DATE "June 16, 2023" +#define RBIO_DATE "Sept 8, 2023" #define RBIO_MAIN_VERSION 4 -#define RBIO_SUB_VERSION 0 +#define RBIO_SUB_VERSION 2 #define RBIO_SUBSUB_VERSION 0 #define RBIO_VER_CODE(main,sub) ((main) * 1000 + (sub)) diff --git a/RBio/cmake_modules/FindRBio.cmake b/RBio/cmake_modules/FindRBio.cmake deleted file mode 100644 index f263ff6fe..000000000 --- a/RBio/cmake_modules/FindRBio.cmake +++ /dev/null @@ -1,134 +0,0 @@ -#------------------------------------------------------------------------------- -# SuiteSparse/RBio/cmake_modules/FindRBio.cmake -#------------------------------------------------------------------------------- - -# The following copyright and license applies to just this file only, not to -# the library itself: -# FindRBio.cmake, Copyright (c) 2022-2023, Timothy A. Davis. All Rights Reserved. -# SPDX-License-Identifier: BSD-3-clause - -#------------------------------------------------------------------------------- - -# Finds the RBio include file and compiled library and sets: - -# RBIO_INCLUDE_DIR - where to find RBio.h -# RBIO_LIBRARY - dynamic RBio library -# RBIO_STATIC - static RBio library -# RBIO_LIBRARIES - libraries when using RBio -# RBIO_FOUND - true if RBio found - -# set ``RBIO_ROOT`` or ``RBio_ROOT`` to a RBio installation root to -# tell this module where to look. - -# All the Find*.cmake files in SuiteSparse are installed by 'make install' into -# /usr/local/lib/cmake/SuiteSparse (where '/usr/local' is the -# ${CMAKE_INSTALL_PREFIX}). To access this file, place the following commands -# in your CMakeLists.txt file. See also SuiteSparse/Example/CMakeLists.txt: -# -# set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} -# ${CMAKE_INSTALL_PREFIX}/lib/cmake/SuiteSparse ) - -#------------------------------------------------------------------------------- - -# include files for RBio -find_path ( RBIO_INCLUDE_DIR - NAMES RBio.h - HINTS ${RBIO_ROOT} - HINTS ENV RBIO_ROOT - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/RBio - HINTS ${CMAKE_SOURCE_DIR}/../RBio - PATH_SUFFIXES include Include -) - -# dynamic RBio library (or static if no dynamic library was built) -find_library ( RBIO_LIBRARY - NAMES rbio rbio_static - HINTS ${RBIO_ROOT} - HINTS ENV RBIO_ROOT - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/RBio - HINTS ${CMAKE_SOURCE_DIR}/../RBio - PATH_SUFFIXES lib build build/Release build/Debug -) - -if ( MSVC ) - set ( STATIC_NAME rbio_static rbio ) -else ( ) - set ( STATIC_NAME rbio ) - set ( save ${CMAKE_FIND_LIBRARY_SUFFIXES} ) - set ( CMAKE_FIND_LIBRARY_SUFFIXES - ${CMAKE_STATIC_LIBRARY_SUFFIX} ${CMAKE_FIND_LIBRARY_SUFFIXES} ) -endif ( ) - -# static RBio library -find_library ( RBIO_STATIC - NAMES ${STATIC_NAME} - HINTS ${RBIO_ROOT} - HINTS ENV RBIO_ROOT - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/RBio - HINTS ${CMAKE_SOURCE_DIR}/../RBio - PATH_SUFFIXES lib build build/Release build/Debug -) - -if ( NOT MSVC ) - # restore the CMAKE_FIND_LIBRARY_SUFFIXES variable - set ( CMAKE_FIND_LIBRARY_SUFFIXES ${save} ) -endif ( ) - -# get version of the library from the dynamic library name -get_filename_component ( RBIO_LIBRARY ${RBIO_LIBRARY} REALPATH ) -get_filename_component ( RBIO_FILENAME ${RBIO_LIBRARY} NAME ) -string ( - REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" - RBIO_VERSION - ${RBIO_FILENAME} -) - -# set ( RBIO_VERSION "" ) -if ( EXISTS "${RBIO_INCLUDE_DIR}" AND NOT RBIO_VERSION ) - # if the version does not appear in the filename, read the include file - file ( STRINGS ${RBIO_INCLUDE_DIR}/RBio.h RBIO_MAJOR_STR - REGEX "define RBIO_MAIN_VERSION" ) - file ( STRINGS ${RBIO_INCLUDE_DIR}/RBio.h RBIO_MINOR_STR - REGEX "define RBIO_SUB_VERSION" ) - file ( STRINGS ${RBIO_INCLUDE_DIR}/RBio.h RBIO_PATCH_STR - REGEX "define RBIO_SUBSUB_VERSION" ) - message ( STATUS "major: ${RBIO_MAJOR_STR}" ) - message ( STATUS "minor: ${RBIO_MINOR_STR}" ) - message ( STATUS "patch: ${RBIO_PATCH_STR}" ) - string ( REGEX MATCH "[0-9]+" RBIO_MAJOR ${RBIO_MAJOR_STR} ) - string ( REGEX MATCH "[0-9]+" RBIO_MINOR ${RBIO_MINOR_STR} ) - string ( REGEX MATCH "[0-9]+" RBIO_PATCH ${RBIO_PATCH_STR} ) - set (RBIO_VERSION "${RBIO_MAJOR}.${RBIO_MINOR}.${RBIO_PATCH}") -endif ( ) -set ( RBIO_LIBRARIES ${RBIO_LIBRARY} ) - -include (FindPackageHandleStandardArgs) - -find_package_handle_standard_args ( RBio - REQUIRED_VARS RBIO_LIBRARY RBIO_INCLUDE_DIR - VERSION_VAR RBIO_VERSION -) - -mark_as_advanced ( - RBIO_INCLUDE_DIR - RBIO_LIBRARY - RBIO_STATIC - RBIO_LIBRARIES -) - -if ( RBIO_FOUND ) - message ( STATUS "RBio version: ${RBIO_VERSION}" ) - message ( STATUS "RBio include: ${RBIO_INCLUDE_DIR}") - message ( STATUS "RBio library: ${RBIO_LIBRARY}" ) - message ( STATUS "RBio static: ${RBIO_STATIC}" ) -else ( ) - message ( STATUS "RBio not found" ) - set ( RBIO_INCLUDE_DIR "" ) - set ( RBIO_LIBRARIES "" ) - set ( RBIO_LIBRARY "" ) - set ( RBIO_STATIC "" ) -endif ( ) - diff --git a/README.md b/README.md index 488bd6e61..06a717a2f 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ SuiteSparse: A Suite of Sparse matrix packages at http://suitesparse.com ----------------------------------------------------------------------------- -June 29, 2023, SuiteSparse VERSION 7.1.0 +Sept 8, 2023, SuiteSparse VERSION 7.2.0 SuiteSparse is a set of sparse-matrix-related packages written or co-authored by Tim Davis, available at https://github.com/DrTimothyAldenDavis/SuiteSparse . @@ -33,6 +33,34 @@ SuiteSparse branches * dev2: working branch. All submitted PRs should made to this branch. This branch might not always be in working order. +----------------------------------------------------------------------------- +For distro maintainers (Linux, homebrew, spack, R, Octave, Trilinos, ...): +----------------------------------------------------------------------------- + +Thanks for packaging SuiteSparse! Here are some suggestions: + + * GraphBLAS takes a long time to compile because it creates many fast + "FactoryKernels" at compile-time. If you want to reduce the compile + time and library size, enable the COMPACT mode, but keep the JIT + enabled. Then GraphBLAS will compile the kernels it needs at run-time, + via its JIT. Performance will be the same as the FactoryKernels once + the JIT kernels are compiled. User compiled kernels are placed in + ~/.SuiteSparse, by default. You do not need to distribute the source + for GraphBLAS to enable the JIT: just libgraphblas.so and GraphBLAS.h + is enough. + + * GraphBLAS needs OpenMP! It's fundamentally a parallel code so please + distribute it with OpenMP enabled. Performance will suffer + otherwise. + + * CUDA acceleration: CHOLMOD and SPQR can benefit from their CUDA + kernels. If you do not have CUDA or do not want to include it in + your distro, this version of SuiteSparse skips the building of + the CHOLMOD_CUDA and SPQR_CUDA libraries, and does not link + against the GPUQREngine and SuiteSparse_GPURuntime libraries. + The latter can be excluded from your distro (the "make" command + will build them, but they will be empty). + ----------------------------------------------------------------------------- How to cite the SuiteSparse meta-package and its component packages: ----------------------------------------------------------------------------- @@ -55,8 +83,9 @@ papers in ACM TOMS, for each package. T. Davis, Algorithm 10xx: SuiteSparse:GraphBLAS: parallel graph algorithms in the language of sparse linear algebra, ACM Trans on - Mathematical Software, to appear, 2023. See the pdf in - https://github.com/DrTimothyAldenDavis/GraphBLAS/tree/stable/Doc + Mathematical Software, just accepted, 2023. See the pdf in + https://github.com/DrTimothyAldenDavis/GraphBLAS/tree/stable/Doc . + https://doi.org/10.1145/3577195 T. Davis, Algorithm 1000: SuiteSparse:GraphBLAS: graph algorithms in the language of sparse linear algebra, ACM Trans on Mathematical @@ -260,9 +289,9 @@ strictly followed. If set to true, only a 64-bit BLAS library will be used. If false (the default), only a 32-bit BLAS library will be used. If no such BLAS is found, the build will fail. ------------------- -SuiteSparse/README ------------------- +----------------------------------------------------------------------------- +SuiteSparse Packages +----------------------------------------------------------------------------- Packages in SuiteSparse, and files in this directory: @@ -341,7 +370,7 @@ Packages in SuiteSparse, and files in this directory: lib 'make install' places shared libraries for each package here, after 'make local' - Makefile to compile all of SuiteSparse + Makefile optional, to compile all of SuiteSparse make compiles SuiteSparse libraries. Subsequent "make install" will install @@ -435,7 +464,7 @@ Packages in SuiteSparse, and files in this directory: Wissam Sid-Lakhdar, Sanjay Ranka GPUQREngine: GPU support package for SPQR - (not built into MATLAB, however) + Not needed if CUDA is not enabled. authors: Tim Davis, Nuri Yeralan, Sanjay Ranka, Wissam Sid-Lakhdar @@ -444,7 +473,7 @@ Packages in SuiteSparse, and files in this directory: author: Tim Davis SuiteSparse_GPURuntime GPU support package for SPQR and CHOLMOD - (not builtin to MATLAB, however). + Not needed if CUDA is not enabled. SuiteSparse_install.m install SuiteSparse for MATLAB SuiteSparse_paths.m set paths for SuiteSparse MATLAB mexFunctions @@ -469,7 +498,7 @@ the `CHOLMOD/SuiteSparse_metis/README.txt` file for details. Refer to each package for license, copyright, and author information. All codes are authored or co-authored by Timothy A. Davis (email: davis@tamu.edu), except for METIS (by George Karypis), GraphBLAS/cpu_features (by Google), -GraphBLAS/lz4 and zstd (by Yann Collet, now at Facebook), and +GraphBLAS/lz4, zstd, and xxHash (by Yann Collet, now at Facebook), and GraphBLAS/CUDA/jitify.hpp (by NVIDIA). Parts of GraphBLAS/CUDA are Copyright (c) by NVIDIA. Please refer to each of these licenses. @@ -481,9 +510,7 @@ the top-level LICENSE.txt file. QUICK START FOR MATLAB USERS (Linux or Mac): ----------------------------------------------------------------------------- -Uncompress the SuiteSparse.zip or SuiteSparse.tar.gz archive file (they contain -the same thing). Suppose you place SuiteSparse in the /home/me/SuiteSparse -folder. +Suppose you place SuiteSparse in the /home/me/SuiteSparse folder. Add the SuiteSparse/lib folder to your run-time library path. On Linux, add this to your ~/.bashrc script, assuming /home/me/SuiteSparse is the location of @@ -525,9 +552,9 @@ priviledge to do the `sudo make install`): make sudo make install -All libraries will be created and copied into SuiteSparse/lib and into -/usr/local/lib. All include files need by the applications that use -SuiteSparse are copied into SuiteSparse/include and into /usr/local/include. +All libraries will be created and copied into the default system-wide folder +(/usr/local/lib on Linux). All include files need by the applications that use +SuiteSparse are copied into /usr/local/include (on Linux). For Windows, import each `*/CMakeLists.txt` file into MS Visual Studio. A single top-level CMake script is being considered as a feature in the @@ -606,8 +633,8 @@ You can set specific options for CMake with the command (for example): CMAKE_OPTIONS="-DNPARTITION=1 -DNSTATIC=1 -DCMAKE_BUILD_TYPE=Debug" make That command will compile all of SuiteSparse except for CHOLMOD/Partition -Module. Debug mode will be used. The static libraries will not be built -(NSTATIC is true). +Module (because of -DNPARTITION=1). Debug mode will be used (the build type). +The static libraries will not be built (since -DNSTATIC=1 is set). CMAKE_BUILD_TYPE: Default: "Release", use "Debug" for debugging. @@ -621,6 +648,14 @@ Module. Debug mode will be used. The static libraries will not be built CMAKE_INSTALL_PREFIX). Default: false + CMAKE_INSTALL_PREFIX: defines the install location (default on Linux is + /usr/local). For example, this command in the top + level SuiteSparse folder will set the install directory + to "/stuff", used by the subsequent "sudo make install": + + CMAKE_OPTIONS="-DCMAKE_INSTALL_PREFIX=/stuff" make + sudo make install + NSTATIC: if true, static libraries are not built. Default: false, except for GraphBLAS, which takes a long time to compile so the default for @@ -683,6 +718,8 @@ SuiteSparse build system and how it works with various Linux / Python distros and other package managers. If you are a maintainer of a SuiteSparse packaging for a Linux distro, conda-forge, R, spack, brew, vcpkg, etc, please feel free to contact me if there's anything I can do to make your life easier. +I would also like to thank Raye Kimmerer for adding support for 32-bit +row/column indices in SPQR v4.2.0. See also the various Acknowledgements within each package. diff --git a/SPEX/CMakeLists.txt b/SPEX/CMakeLists.txt index 33318c07d..1f492b5c4 100644 --- a/SPEX/CMakeLists.txt +++ b/SPEX/CMakeLists.txt @@ -10,12 +10,12 @@ # get the version #------------------------------------------------------------------------------- -cmake_minimum_required ( VERSION 3.19 ) +cmake_minimum_required ( VERSION 3.20 ) -set ( SPEX_DATE "June 16, 2023" ) +set ( SPEX_DATE "Sept 8, 2023" ) set ( SPEX_VERSION_MAJOR 2 ) -set ( SPEX_VERSION_MINOR 0 ) -set ( SPEX_VERSION_SUB 4 ) +set ( SPEX_VERSION_MINOR 2 ) +set ( SPEX_VERSION_SUB 0 ) message ( STATUS "Building SPEX version: v" ${SPEX_VERSION_MAJOR}. @@ -28,8 +28,6 @@ message ( STATUS "Building SPEX version: v" set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake_modules - ${CMAKE_SOURCE_DIR}/../COLAMD/cmake_modules - ${CMAKE_SOURCE_DIR}/../AMD/cmake_modules ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/cmake_modules ) include ( SuiteSparsePolicy ) @@ -46,9 +44,24 @@ project ( spex # find library dependencies #------------------------------------------------------------------------------- -find_package ( SuiteSparse_config 7.1.0 REQUIRED ) -find_package ( COLAMD 3.0.4 REQUIRED ) -find_package ( AMD 3.0.4 REQUIRED ) +find_package ( SuiteSparse_config 7.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH ) +if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) + find_package ( SuiteSparse_config 7.2.0 REQUIRED ) +endif ( ) + +find_package ( COLAMD 3.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../COLAMD/build NO_DEFAULT_PATH ) +if ( NOT TARGET SuiteSparse::COLAMD ) + find_package ( COLAMD 3.2.0 REQUIRED ) +endif ( ) + +find_package ( AMD 3.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../AMD/build NO_DEFAULT_PATH ) +if ( NOT TARGET SuiteSparse::AMD ) + find_package ( AMD 3.2.0 REQUIRED ) +endif ( ) + find_package ( GMP 6.1.2 REQUIRED ) # from SPEX/cmake_modules find_package ( MPFR 4.0.2 REQUIRED ) # from SPEX/cmake_modules @@ -69,9 +82,7 @@ configure_file ( "Config/SPEX_version.tex.in" include_directories ( SPEX_Left_LU/Source SPEX_Util/Source Include SPEX_Left_LU/Demo - ${SUITESPARSE_CONFIG_INCLUDE_DIR} - ${GMP_INCLUDE_DIR} ${MPFR_INCLUDE_DIR} - ${AMD_INCLUDE_DIR} ${COLAMD_INCLUDE_DIR} ) + ${GMP_INCLUDE_DIR} ${MPFR_INCLUDE_DIR} ) #------------------------------------------------------------------------------- # dynamic spex library properties @@ -79,24 +90,29 @@ include_directories ( SPEX_Left_LU/Source SPEX_Util/Source Include file ( GLOB SPEX_SOURCES "SPEX*/Source/*.c" ) -add_library ( spex SHARED ${SPEX_SOURCES} ) +add_library ( SPEX SHARED ${SPEX_SOURCES} ) -set_target_properties ( spex PROPERTIES +set_target_properties ( SPEX PROPERTIES VERSION ${SPEX_VERSION_MAJOR}.${SPEX_VERSION_MINOR}.${SPEX_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON + OUTPUT_NAME spex SOVERSION ${SPEX_VERSION_MAJOR} PUBLIC_HEADER "Include/SPEX.h" WINDOWS_EXPORT_ALL_SYMBOLS ON ) +target_include_directories ( SPEX + INTERFACE $ + $ ) + #------------------------------------------------------------------------------- # static spex library properties #------------------------------------------------------------------------------- if ( NOT NSTATIC ) - add_library ( spex_static STATIC ${SPEX_SOURCES} ) + add_library ( SPEX_static STATIC ${SPEX_SOURCES} ) - set_target_properties ( spex_static PROPERTIES + set_target_properties ( SPEX_static PROPERTIES VERSION ${SPEX_VERSION_MAJOR}.${SPEX_VERSION_MINOR}.${SPEX_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON @@ -104,51 +120,73 @@ if ( NOT NSTATIC ) SOVERSION ${SPEX_VERSION_MAJOR} ) if ( MSVC ) - set_target_properties ( spex_static PROPERTIES + set_target_properties ( SPEX_static PROPERTIES OUTPUT_NAME spex_static ) endif ( ) + + target_include_directories ( SPEX_static + INTERFACE $ + $ ) + endif ( ) #------------------------------------------------------------------------------- # add the library dependencies #------------------------------------------------------------------------------- -# suitesparseconfig: -target_link_libraries ( spex PRIVATE ${SUITESPARSE_CONFIG_LIBRARIES} ) +# SuiteSparseConfig: +target_link_libraries ( SPEX PRIVATE SuiteSparse::SuiteSparseConfig ) +target_include_directories ( SPEX PUBLIC + "$" ) if ( NOT NSTATIC ) - target_link_libraries ( spex_static PUBLIC ${SUITESPARSE_CONFIG_STATIC} ) + if ( TARGET SuiteSparse::SuiteSparseConfig_static ) + target_link_libraries ( SPEX_static PUBLIC SuiteSparse::SuiteSparseConfig_static ) + else ( ) + target_link_libraries ( SPEX_static PUBLIC SuiteSparse::SuiteSparseConfig ) + endif ( ) endif ( ) # AMD: -target_link_libraries ( spex PRIVATE ${AMD_LIBRARIES} ) +target_link_libraries ( SPEX PRIVATE SuiteSparse::AMD ) if ( NOT NSTATIC ) - target_link_libraries ( spex_static PUBLIC ${AMD_STATIC} ) + if ( TARGET SuiteSparse::AMD_static ) + target_link_libraries ( SPEX_static PUBLIC SuiteSparse::AMD_static ) + else ( ) + target_link_libraries ( SPEX_static PUBLIC SuiteSparse::AMD ) + endif ( ) endif ( ) # COLAMD: -target_link_libraries ( spex PRIVATE ${COLAMD_LIBRARIES} ) +target_link_libraries ( SPEX PRIVATE SuiteSparse::COLAMD ) if ( NOT NSTATIC ) - target_link_libraries ( spex_static PUBLIC ${COLAMD_STATIC} ) + if ( TARGET SuiteSparse::COLAMD_static ) + target_link_libraries ( SPEX_static PUBLIC SuiteSparse::COLAMD_static ) + else ( ) + target_link_libraries ( SPEX_static PUBLIC SuiteSparse::COLAMD ) + endif ( ) endif ( ) # MPFR: -target_link_libraries ( spex PRIVATE ${MPFR_LIBRARIES} ) +target_link_libraries ( SPEX PRIVATE ${MPFR_LIBRARIES} ) if ( NOT NSTATIC ) - target_link_libraries ( spex_static PUBLIC ${MPFR_STATIC} ) + list ( APPEND SPEX_STATIC_LIBS ${MPFR_STATIC} ) + target_link_libraries ( SPEX_static PUBLIC ${MPFR_STATIC} ) endif ( ) # GMP: # must occur after MPFR -target_link_libraries ( spex PRIVATE ${GMP_LIBRARIES} ) +target_link_libraries ( SPEX PRIVATE ${GMP_LIBRARIES} ) if ( NOT NSTATIC ) - target_link_libraries ( spex_static PUBLIC ${GMP_STATIC} ) + list ( APPEND SPEX_STATIC_LIBS ${GMP_STATIC} ) + target_link_libraries ( SPEX_static PUBLIC ${GMP_STATIC} ) endif ( ) # libm: if ( NOT WIN32 ) - target_link_libraries ( spex PRIVATE m ) + target_link_libraries ( SPEX PRIVATE m ) if ( NOT NSTATIC ) - target_link_libraries ( spex_static PUBLIC m ) + list ( APPEND SPEX_STATIC_LIBS "m" ) + target_link_libraries ( SPEX_static PUBLIC m ) endif ( ) endif ( ) @@ -156,19 +194,96 @@ endif ( ) # SPEX installation location #------------------------------------------------------------------------------- -install ( TARGETS spex +include ( CMakePackageConfigHelpers ) + +install ( TARGETS SPEX + EXPORT SPEXTargets LIBRARY DESTINATION ${SUITESPARSE_LIBDIR} ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} RUNTIME DESTINATION ${SUITESPARSE_BINDIR} PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} ) -install ( FILES ${CMAKE_SOURCE_DIR}/cmake_modules/FindSPEX.cmake - DESTINATION ${SUITESPARSE_LIBDIR}/cmake/SuiteSparse - COMPONENT Development ) if ( NOT NSTATIC ) - install ( TARGETS spex_static + install ( TARGETS SPEX_static + EXPORT SPEXTargets ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} ) endif ( ) +# create (temporary) export target file during build +export ( EXPORT SPEXTargets + NAMESPACE SuiteSparse:: + FILE ${CMAKE_CURRENT_BINARY_DIR}/SPEXTargets.cmake ) + +# install export target, config and version files for find_package +install ( EXPORT SPEXTargets + NAMESPACE SuiteSparse:: + DESTINATION ${SUITESPARSE_LIBDIR}/cmake/SPEX ) + +configure_package_config_file ( + Config/SPEXConfig.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/SPEXConfig.cmake + INSTALL_DESTINATION ${SUITESPARSE_LIBDIR}/cmake/SPEX ) + +write_basic_package_version_file ( + ${CMAKE_CURRENT_BINARY_DIR}/SPEXConfigVersion.cmake + COMPATIBILITY SameMajorVersion ) + +install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/SPEXConfig.cmake + ${CMAKE_CURRENT_BINARY_DIR}/SPEXConfigVersion.cmake + DESTINATION ${SUITESPARSE_LIBDIR}/cmake/SPEX ) + +#------------------------------------------------------------------------------- +# create pkg-config file +#------------------------------------------------------------------------------- + +if ( NOT MSVC ) + # This might be something like: + # /usr/lib/libgomp.so;/usr/lib/libpthread.a;m + # convert to -l flags for pkg-config, i.e.: "-lgomp -lpthread -lm" + set ( SPEX_STATIC_LIBS_LIST ${SPEX_STATIC_LIBS} ) + set ( SPEX_STATIC_LIBS "" ) + foreach ( _lib ${SPEX_STATIC_LIBS_LIST} ) + string ( FIND ${_lib} "." _pos REVERSE ) + if ( ${_pos} EQUAL "-1" ) + set ( SPEX_STATIC_LIBS "${SPEX_STATIC_LIBS} -l${_lib}" ) + continue () + endif ( ) + foreach ( _kind IN ITEMS "IMPORT" "SHARED" "STATIC" ) + set ( _regex ".*\\/(lib)?([^\\.]*)(${CMAKE_${_kind}_LIBRARY_SUFFIX})" ) + if ( ${_lib} MATCHES ${_regex} ) + string ( REGEX REPLACE ${_regex} "\\2" _libname ${_lib} ) + if ( NOT "${_libname}" STREQUAL "" ) + set ( SPEX_STATIC_LIBS "${SPEX_STATIC_LIBS} -l${_libname}" ) + break () + endif ( ) + endif ( ) + endforeach ( ) + endforeach ( ) + + set ( prefix "${CMAKE_INSTALL_PREFIX}" ) + set ( exec_prefix "\${prefix}" ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) + if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) + set ( libdir "${SUITESPARSE_LIBDIR}") + else ( ) + set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") + endif ( ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) + if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) + set ( includedir "${SUITESPARSE_INCLUDEDIR}") + else ( ) + set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + endif ( ) + configure_file ( + Config/SPEX.pc.in + SPEX.pc + @ONLY + NEWLINE_STYLE LF ) + install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/SPEX.pc + DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) +endif ( ) + #------------------------------------------------------------------------------- # Demo library and programs #------------------------------------------------------------------------------- @@ -193,9 +308,9 @@ if ( DEMO ) "SPEX_Left_LU/Demo/demos.c" ) # Libraries required for Demo programs - target_link_libraries ( spexlu_demo PUBLIC spex ) - target_link_libraries ( example PUBLIC spex ) - target_link_libraries ( example2 PUBLIC spex ) + target_link_libraries ( spexlu_demo PUBLIC SPEX ) + target_link_libraries ( example PUBLIC SPEX ) + target_link_libraries ( example2 PUBLIC SPEX ) else ( ) diff --git a/SPEX/Config/SPEX.pc.in b/SPEX/Config/SPEX.pc.in new file mode 100644 index 000000000..4aaad7e04 --- /dev/null +++ b/SPEX/Config/SPEX.pc.in @@ -0,0 +1,17 @@ +# SPEX, Copyright (c) 1996-2023, Timothy A. Davis. +# All Rights Reserved. +# SPDX-License-Identifier: BSD-3-Clause + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: SPEX +URL: https://github.com/DrTimothyAldenDavis/SuiteSparse +Description: Software package for SParse EXact algebra in SuiteSparse +Version: @SPEX_VERSION_MAJOR@.@SPEX_VERSION_MINOR@.@SPEX_VERSION_SUB@ +Requires.private: SuiteSparse_config AMD COLAMD +Libs: -L${libdir} -lspex +Libs.private: @SPEX_STATIC_LIBS@ +Cflags: -I${includedir} diff --git a/SPEX/Config/SPEXConfig.cmake.in b/SPEX/Config/SPEXConfig.cmake.in new file mode 100644 index 000000000..0b4d92267 --- /dev/null +++ b/SPEX/Config/SPEXConfig.cmake.in @@ -0,0 +1,121 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/SPEX/cmake_modules/SPEXConfig.cmake +#------------------------------------------------------------------------------- + +# The following copyright and license applies to just this file only, not to +# the library itself: +# SPEXConfig.cmake, Copyright (c) 2023, Timothy A. Davis. All Rights Reserved. +# SPDX-License-Identifier: BSD-3-clause + +#------------------------------------------------------------------------------- + +# Finds the SPEX include file and compiled library. +# The following targets are defined: +# SuiteSparse::SPEX - for the shared library (if available) +# SuiteSparse::SPEX_static - for the static library (if available) + +# For backward compatibility the following variables are set: + +# SPEX_INCLUDE_DIR - where to find SPEX.h +# SPEX_LIBRARY - dynamic SPEX library +# SPEX_STATIC - static SPEX library +# SPEX_LIBRARIES - libraries when using SPEX +# SPEX_FOUND - true if SPEX found + +# Set ``CMAKE_MODULE_PATH`` to the parent folder where this module file is +# installed. + +#------------------------------------------------------------------------------- + +@PACKAGE_INIT@ + +set ( SPEX_DATE "@SPEX_DATE@" ) +set ( SPEX_VERSION_MAJOR @SPEX_VERSION_MAJOR@ ) +set ( SPEX_VERSION_MINOR @SPEX_VERSION_MINOR@ ) +set ( SPEX_VERSION_PATCH @SPEX_VERSION_SUB@ ) +set ( SPEX_VERSION "@SPEX_VERSION_MAJOR@.@SPEX_VERSION_MINOR@.@SPEX_VERSION_SUB@" ) + +include ( ${CMAKE_CURRENT_LIST_DIR}/SPEXTargets.cmake ) + +# The following is only for backward compatibility with FindSPEX. + +set ( _target_shared SuiteSparse::SPEX ) +set ( _target_static SuiteSparse::SPEX_static ) +set ( _var_prefix "SPEX" ) + +get_target_property ( ${_var_prefix}_INCLUDE_DIR ${_target_shared} INTERFACE_INCLUDE_DIRECTORIES ) +if ( ${_var_prefix}_INCLUDE_DIR ) + # First item in SuiteSparse targets contains the "main" header directory. + list ( GET ${_var_prefix}_INCLUDE_DIR 0 ${_var_prefix}_INCLUDE_DIR ) +endif ( ) +get_target_property ( ${_var_prefix}_LIBRARY ${_target_shared} IMPORTED_IMPLIB ) +if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} IMPORTED_LOCATION ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) +endif ( ) +if ( TARGET ${_target_static} ) + get_target_property ( ${_var_prefix}_STATIC ${_target_static} IMPORTED_LOCATION ) +endif ( ) + +# Check for most common build types +set ( _config_types "Debug" "Release" "RelWithDebInfo" "MinSizeRel" ) + +get_property ( _isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG ) +if ( _isMultiConfig ) + # For multi-configuration generators (e.g., Visual Studio), prefer those + # configurations. + list ( PREPEND _config_types ${CMAKE_CONFIGURATION_TYPES} ) +else ( ) + # For single-configuration generators, prefer the current configuration. + list ( PREPEND _config_types ${CMAKE_BUILD_TYPE} ) +endif ( ) + +list ( REMOVE_DUPLICATES _config_types ) + +foreach ( _config ${_config_types} ) + string ( TOUPPER ${_config} _uc_config ) + if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} + IMPORTED_IMPLIB_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) + endif ( ) + if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} + IMPORTED_LOCATION_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) + endif ( ) + if ( TARGET ${_target_static} AND NOT ${_var_prefix}_STATIC ) + get_target_property ( _library_chk ${_target_static} + IMPORTED_LOCATION_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_STATIC ${_library_chk} ) + endif ( ) + endif ( ) +endforeach ( ) + +set ( SPEX_LIBRARIES ${SPEX_LIBRARY} ) + +macro ( suitesparse_check_exist _var _files ) + # ignore generator expressions + string ( GENEX_STRIP "${_files}" _files2 ) + + foreach ( _file ${_files2} ) + if ( NOT EXISTS "${_file}" ) + message ( FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist!" ) + endif ( ) + endforeach () +endmacro ( ) + +suitesparse_check_exist ( SPEX_INCLUDE_DIR ${SPEX_INCLUDE_DIR} ) +suitesparse_check_exist ( SPEX_LIBRARY ${SPEX_LIBRARY} ) + +message ( STATUS "SPEX version: ${SPEX_VERSION}" ) +message ( STATUS "SPEX include: ${SPEX_INCLUDE_DIR}" ) +message ( STATUS "SPEX library: ${SPEX_LIBRARY}" ) +message ( STATUS "SPEX static: ${SPEX_STATIC}" ) diff --git a/SPEX/Doc/ChangeLog b/SPEX/Doc/ChangeLog index bb9e38527..85e590747 100644 --- a/SPEX/Doc/ChangeLog +++ b/SPEX/Doc/ChangeLog @@ -1,3 +1,7 @@ +Sept 8, 2023: version 2.2.0 + + * cmake updates: SuiteSparse:: namespace by Markus Muetzel + June 16, 2023: version 2.0.4 * cmake build system updates: update by Markus Muetzel. diff --git a/SPEX/Doc/SPEX_UserGuide.pdf b/SPEX/Doc/SPEX_UserGuide.pdf index 3ed9cae9c..b353b9b50 100644 Binary files a/SPEX/Doc/SPEX_UserGuide.pdf and b/SPEX/Doc/SPEX_UserGuide.pdf differ diff --git a/SPEX/Doc/SPEX_version.tex b/SPEX/Doc/SPEX_version.tex index 4f132cb48..08050661e 100644 --- a/SPEX/Doc/SPEX_version.tex +++ b/SPEX/Doc/SPEX_version.tex @@ -1,2 +1,2 @@ % version of SuiteSparse/SPEX -VERSION 2.0.4, June 16, 2023 +VERSION 2.2.0, Sept 8, 2023 diff --git a/SPEX/Include/SPEX.h b/SPEX/Include/SPEX.h index 243759931..5cdd829d3 100644 --- a/SPEX/Include/SPEX.h +++ b/SPEX/Include/SPEX.h @@ -265,11 +265,11 @@ // #define SPEX_UTIL_VERSION_MINOR 1 // #define SPEX_UTIL_VERSION_SUB 1 -#define SPEX_DATE "June 16, 2023" -#define SPEX_VERSION "2.0.4" +#define SPEX_DATE "Sept 8, 2023" +#define SPEX_VERSION "2.2.0" #define SPEX_VERSION_MAJOR 2 -#define SPEX_VERSION_MINOR 0 -#define SPEX_VERSION_SUB 4 +#define SPEX_VERSION_MINOR 2 +#define SPEX_VERSION_SUB 0 #if defined ( __cplusplus ) extern "C" diff --git a/SPEX/cmake_modules/FindSPEX.cmake b/SPEX/cmake_modules/FindSPEX.cmake deleted file mode 100644 index 6848fd0f3..000000000 --- a/SPEX/cmake_modules/FindSPEX.cmake +++ /dev/null @@ -1,129 +0,0 @@ -#------------------------------------------------------------------------------- -# SuiteSparse/SPEX/cmake_modules/FindSPEX.cmake -#------------------------------------------------------------------------------- - -# The following copyright and license applies to just this file only, not to -# the library itself: -# FindSPEX.cmake, Copyright (c) 2022-2023, Timothy A. Davis. All Rights Reserved. -# SPDX-License-Identifier: BSD-3-clause - -#------------------------------------------------------------------------------- - -# Finds the SPEX include file and compiled library and sets: - -# SPEX_INCLUDE_DIR - where to find SPEX.h -# SPEX_LIBRARY - dynamic SPEX library -# SPEX_STATIC - static SPEX library -# SPEX_LIBRARIES - libraries when using SPEX -# SPEX_FOUND - true if SPEX found - -# set ``SPEX_ROOT`` to a SPEX installation root to -# tell this module where to look. - -# All the Find*.cmake files in SuiteSparse are installed by 'make install' into -# /usr/local/lib/cmake/SuiteSparse (where '/usr/local' is the -# ${CMAKE_INSTALL_PREFIX}). To access this file, place the following commands -# in your CMakeLists.txt file. See also SuiteSparse/Example/CMakeLists.txt: -# -# set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} -# ${CMAKE_INSTALL_PREFIX}/lib/cmake/SuiteSparse ) - -#------------------------------------------------------------------------------- - -# include files for SPEX -find_path ( SPEX_INCLUDE_DIR - NAMES SPEX.h - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/SPEX - HINTS ${CMAKE_SOURCE_DIR}/../SPEX - PATH_SUFFIXES include Include -) - -# dynamic SPEX library (or static if no dynamic library was built) -find_library ( SPEX_LIBRARY - NAMES spex spex_static - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/SPEX - HINTS ${CMAKE_SOURCE_DIR}/../SPEX - PATH_SUFFIXES lib build build/Release build/Debug -) - -if ( MSVC ) - set ( STATIC_NAME spex_static spex ) -else ( ) - set ( STATIC_NAME spex ) - set ( save ${CMAKE_FIND_LIBRARY_SUFFIXES} ) - set ( CMAKE_FIND_LIBRARY_SUFFIXES - ${CMAKE_STATIC_LIBRARY_SUFFIX} ${CMAKE_FIND_LIBRARY_SUFFIXES} ) -endif ( ) - -# static SPEX library -find_library ( SPEX_STATIC - NAMES ${STATIC_NAME} - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/SPEX - HINTS ${CMAKE_SOURCE_DIR}/../SPEX - PATH_SUFFIXES lib build build/Release build/Debug -) - -if ( NOT MSVC ) - # restore the CMAKE_FIND_LIBRARY_SUFFIXES variable - set ( CMAKE_FIND_LIBRARY_SUFFIXES ${save} ) -endif ( ) - -# get version of the library from the dynamic library name -get_filename_component ( SPEX_LIBRARY ${SPEX_LIBRARY} REALPATH ) -get_filename_component ( SPEX_FILENAME ${SPEX_LIBRARY} NAME ) -string ( - REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" - SPEX_VERSION - ${SPEX_FILENAME} -) - -# set ( SPEX_VERSION "" ) -if ( EXISTS "${SPEX_INCLUDE_DIR}" AND NOT SPEX_VERSION ) - # if the version does not appear in the filename, read the include file - file ( STRINGS ${SPEX_INCLUDE_DIR}/SPEX.h SPEX_MAJOR_STR - REGEX "define SPEX_VERSION_MAJOR " ) - file ( STRINGS ${SPEX_INCLUDE_DIR}/SPEX.h SPEX_MINOR_STR - REGEX "define SPEX_VERSION_MINOR " ) - file ( STRINGS ${SPEX_INCLUDE_DIR}/SPEX.h SPEX_PATCH_STR - REGEX "define SPEX_VERSION_SUB " ) - message ( STATUS "major: ${SPEX_MAJOR_STR}" ) - message ( STATUS "minor: ${SPEX_MINOR_STR}" ) - message ( STATUS "patch: ${SPEX_PATCH_STR}" ) - string ( REGEX MATCH "[0-9]+" SPEX_MAJOR ${SPEX_MAJOR_STR} ) - string ( REGEX MATCH "[0-9]+" SPEX_MINOR ${SPEX_MINOR_STR} ) - string ( REGEX MATCH "[0-9]+" SPEX_PATCH ${SPEX_PATCH_STR} ) - set (SPEX_VERSION "${SPEX_MAJOR}.${SPEX_MINOR}.${SPEX_PATCH}") -endif ( ) - -set ( SPEX_LIBRARIES ${SPEX_LIBRARY} ) - -include (FindPackageHandleStandardArgs) - -find_package_handle_standard_args ( SPEX - REQUIRED_VARS SPEX_LIBRARY SPEX_INCLUDE_DIR - VERSION_VAR SPEX_VERSION -) - -mark_as_advanced ( - SPEX_INCLUDE_DIR - SPEX_LIBRARY - SPEX_STATIC - SPEX_LIBRARIES -) - -if ( SPEX_FOUND ) - message ( STATUS "SPEX version: ${SPEX_VERSION}" ) - message ( STATUS "SPEX include: ${SPEX_INCLUDE_DIR}" ) - message ( STATUS "SPEX library: ${SPEX_LIBRARY}" ) - message ( STATUS "SPEX static: ${SPEX_STATIC}" ) -else ( ) - message ( STATUS "SPEX not found" ) - set ( SPEX_INCLUDE_DIR "" ) - set ( SPEX_LIBRARIES "" ) - set ( SPEX_LIBRARY "" ) - set ( SPEX_STATIC "" ) -endif ( ) - diff --git a/SPQR/.gitignore b/SPQR/.gitignore index 0b4b3ef7a..87a5c5e9c 100644 --- a/SPQR/.gitignore +++ b/SPQR/.gitignore @@ -3,6 +3,8 @@ o_* A.mtx X.mtx gpu_results.txt +tfile +pfile # Do not ignore this file !.gitignore diff --git a/SPQR/CMakeLists.txt b/SPQR/CMakeLists.txt index 5d3d7c348..6b2594ed5 100644 --- a/SPQR/CMakeLists.txt +++ b/SPQR/CMakeLists.txt @@ -2,7 +2,7 @@ # SuiteSparse/SPQR/CMakeLists.txt: cmake for SuiteSparseQR (aka "SPQR") #------------------------------------------------------------------------------- -# SPQR (SuiteSparseQR), Copyright (c) 2008-2022, Timothy A Davis. +# SPQR (SuiteSparseQR), Copyright (c) 2008-2023, Timothy A Davis. # All Rights Reserved. # SPDX-License-Identifier: GPL-2.0+ @@ -13,10 +13,10 @@ # cmake 3.22 is required to find the BLAS in SuiteSparsePolicy.cmake cmake_minimum_required ( VERSION 3.22 ) -set ( SPQR_DATE "June 16, 2023" ) -set ( SPQR_VERSION_MAJOR 3 ) -set ( SPQR_VERSION_MINOR 0 ) -set ( SPQR_VERSION_SUB 4 ) +set ( SPQR_DATE "Sept 8, 2023" ) +set ( SPQR_VERSION_MAJOR 4 ) +set ( SPQR_VERSION_MINOR 2 ) +set ( SPQR_VERSION_SUB 0 ) message ( STATUS "Building SPQR version: v" ${SPQR_VERSION_MAJOR}. @@ -28,17 +28,9 @@ message ( STATUS "Building SPQR version: v" #------------------------------------------------------------------------------- set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} - ${CMAKE_SOURCE_DIR}/cmake_modules - ${CMAKE_SOURCE_DIR}/../COLAMD/cmake_modules - ${CMAKE_SOURCE_DIR}/../AMD/cmake_modules - ${CMAKE_SOURCE_DIR}/../CAMD/cmake_modules - ${CMAKE_SOURCE_DIR}/../CCOLAMD/cmake_modules - ${CMAKE_SOURCE_DIR}/../CHOLMOD/cmake_modules - ${CMAKE_SOURCE_DIR}/../GPUQREngine/cmake_modules - ${CMAKE_SOURCE_DIR}/../SuiteSparse_GPURuntime/cmake_modules ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/cmake_modules ) -option ( ENABLE_CUDA "Enable CUDA acceleration" on ) +option ( ENABLE_CUDA "Enable CUDA acceleration" ON ) include ( SuiteSparsePolicy ) @@ -46,25 +38,15 @@ include ( SuiteSparsePolicy ) # define the project #------------------------------------------------------------------------------- -if ( SUITESPARSE_CUDA ) - # SPQR with CUDA - project ( spqr - VERSION "${SPQR_VERSION_MAJOR}.${SPQR_VERSION_MINOR}.${SPQR_VERSION_SUB}" - LANGUAGES C CXX CUDA ) -else ( ) - # SPQR without CUDA - project ( spqr - VERSION "${SPQR_VERSION_MAJOR}.${SPQR_VERSION_MINOR}.${SPQR_VERSION_SUB}" - LANGUAGES C CXX ) -endif ( ) +project ( spqr + VERSION "${SPQR_VERSION_MAJOR}.${SPQR_VERSION_MINOR}.${SPQR_VERSION_SUB}" + LANGUAGES C CXX ) #------------------------------------------------------------------------------- # find library dependencies #------------------------------------------------------------------------------- -enable_language ( C ) - -option ( NOPENMP "ON: do not use OpenMP. OFF (default): use OpenMP" off ) +option ( NOPENMP "ON (default): do not use OpenMP. OFF: use OpenMP" ON ) if ( NOPENMP ) # OpenMP has been disabled set ( OPENMP_FOUND false ) @@ -72,31 +54,72 @@ else ( ) find_package ( OpenMP ) endif ( ) -find_package ( SuiteSparse_config 7.1.0 REQUIRED ) -find_package ( AMD 3.0.4 REQUIRED ) -find_package ( COLAMD 3.0.4 REQUIRED ) -find_package ( CHOLMOD 4.0.4 REQUIRED ) +find_package ( SuiteSparse_config 7.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH ) +if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) + find_package ( SuiteSparse_config 7.2.0 REQUIRED ) +endif ( ) + +find_package ( AMD 3.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../AMD/build NO_DEFAULT_PATH ) +if ( NOT TARGET SuiteSparse::AMD ) + find_package ( AMD 3.2.0 REQUIRED ) +endif ( ) + +find_package ( COLAMD 3.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../COLAMD/build NO_DEFAULT_PATH ) +if ( NOT TARGET SuiteSparse::COLAMD ) + find_package ( COLAMD 3.2.0 REQUIRED ) +endif ( ) + +# It would be nice if just checking for CHOLMOD would automatically pull in +# the targets for its dependencies. +find_package ( CHOLMOD 4.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../CHOLMOD/build NO_DEFAULT_PATH ) +if ( NOT TARGET SuiteSparse::CHOLMOD ) + find_package ( CHOLMOD 4.2.0 REQUIRED ) +endif ( ) + # look for CHOLMOD's dependencies: AMD and COLAMD are required. CAMD and # CCOLAMD are optional, but must be found if CHOLMOD was built with them. -find_package ( CAMD 3.0.4 ) -find_package ( CCOLAMD 3.0.4 ) +find_package ( CAMD 3.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../CAMD/build NO_DEFAULT_PATH ) +if ( NOT TARGET SuiteSparse::CAMD ) + find_package ( CAMD 3.2.0 ) +endif ( ) + +find_package ( CCOLAMD 3.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../CCOLAMD/build NO_DEFAULT_PATH ) +if ( NOT TARGET SuiteSparse::CCOLAMD ) + find_package ( CCOLAMD 3.2.0 ) +endif ( ) if ( SUITESPARSE_CUDA ) - find_package ( SuiteSparse_GPURuntime 2.0.4 REQUIRED ) - find_package ( GPUQREngine 2.0.4 REQUIRED ) - find_package ( CHOLMOD_CUDA 4.0.4 REQUIRED ) + find_package ( SuiteSparse_GPURuntime 3.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_GPURuntime/build NO_DEFAULT_PATH ) + if ( NOT TARGET SuiteSparse::GPURuntime ) + find_package ( SuiteSparse_GPURuntime 3.2.0 REQUIRED ) + endif ( ) + + find_package ( GPUQREngine 3.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../GPUQREngine/build NO_DEFAULT_PATH ) + if ( NOT TARGET SuiteSparse::GPUQREngine ) + find_package ( GPUQREngine 3.2.0 REQUIRED ) + endif ( ) + + find_package ( CHOLMOD_CUDA 4.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../CHOLMOD/build NO_DEFAULT_PATH ) + if ( NOT TARGET SuiteSparse::CHOLMOD_CUDA ) + find_package ( CHOLMOD_CUDA 4.2.0 REQUIRED ) + endif ( ) endif ( ) include ( SuiteSparseBLAS ) # requires cmake 3.22 include ( SuiteSparseLAPACK ) # requires cmake 3.22 -add_subdirectory ( SPQRGPU ) -set ( SPQR_CUDA spqr_cuda ${CUDA_LIBRARIES} ${GPUQRENGINE_LIBRARIES} ${SUITESPARSE_GPURUNTIME_LIBRARIES} ${CHOLMOD_CUDA_LIBRARIES} ) - if ( SUITESPARSE_CUDA ) # with CUDA - include_directories ( SPQRGPU ${CUDAToolkit_INCLUDE_DIRS} ) - link_directories ( "SPQRGPU" "${CUDA_LIBRARIES}" "/usr/local/cuda/lib64/stubs" "/usr/local/cuda/lib64" ) + add_subdirectory ( SPQRGPU ) endif ( ) #------------------------------------------------------------------------------- @@ -110,45 +133,37 @@ configure_file ( "Config/spqr_version.tex.in" "${PROJECT_SOURCE_DIR}/Doc/spqr_version.tex" NEWLINE_STYLE LF ) -#------------------------------------------------------------------------------- -# include directories -#------------------------------------------------------------------------------- - -include_directories ( Source Include ${SUITESPARSE_CONFIG_INCLUDE_DIR} - ${AMD_INCLUDE_DIR} ${COLAMD_INCLUDE_DIR} ${CHOLMOD_INCLUDE_DIR} - ${CMAKE_SOURCE_DIR}/../CHOLMOD/Include ) - -if ( SUITESPARSE_CUDA ) - include_directories ( - ${CMAKE_SOURCE_DIR}/../SuiteSparse_GPURuntime/Include - ${CMAKE_SOURCE_DIR}/../GPUQREngine/Include ) -endif ( ) - #------------------------------------------------------------------------------- # dynamic spqr library properties #------------------------------------------------------------------------------- file ( GLOB SPQR_SOURCES "Source/spqr_*.cpp" "Source/SuiteSparseQR*.cpp" ) -add_library ( spqr SHARED ${SPQR_SOURCES} ) +add_library ( SPQR SHARED ${SPQR_SOURCES} ) -set_target_properties ( spqr PROPERTIES +set_target_properties ( SPQR PROPERTIES VERSION ${SPQR_VERSION_MAJOR}.${SPQR_VERSION_MINOR}.${SPQR_VERSION_SUB} CXX_STANDARD 11 CXX_STANDARD_REQUIRED ON C_STANDARD 11 C_STANDARD_REQUIRED ON + OUTPUT_NAME spqr SOVERSION ${SPQR_VERSION_MAJOR} WINDOWS_EXPORT_ALL_SYMBOLS ON ) +target_include_directories ( SPQR + PRIVATE Source Include + INTERFACE $ + $ ) + #------------------------------------------------------------------------------- # static spqr library properties #------------------------------------------------------------------------------- if ( NOT NSTATIC ) - add_library ( spqr_static STATIC ${SPQR_SOURCES} ) + add_library ( SPQR_static STATIC ${SPQR_SOURCES} ) - set_target_properties ( spqr_static PROPERTIES + set_target_properties ( SPQR_static PROPERTIES VERSION ${SPQR_VERSION_MAJOR}.${SPQR_VERSION_MINOR}.${SPQR_VERSION_SUB} CXX_STANDARD 11 CXX_STANDARD_REQUIRED ON @@ -158,120 +173,229 @@ if ( NOT NSTATIC ) SOVERSION ${SPQR_VERSION_MAJOR} ) if ( MSVC ) - set_target_properties ( spqr_static PROPERTIES + set_target_properties ( SPQR_static PROPERTIES OUTPUT_NAME spqr_static ) endif ( ) + + target_include_directories ( SPQR_static + PRIVATE Source Include + INTERFACE $ + $ ) + endif ( ) #------------------------------------------------------------------------------- # add the library dependencies #------------------------------------------------------------------------------- -# suitesparseconfig: -target_link_libraries ( spqr PRIVATE ${SUITESPARSE_CONFIG_LIBRARIES} ) +# SuiteSparseConfig: +target_link_libraries ( SPQR PRIVATE SuiteSparse::SuiteSparseConfig ) if ( NOT NSTATIC ) - target_link_libraries ( spqr_static PUBLIC ${SUITESPARSE_CONFIG_STATIC} ) + if ( TARGET SuiteSparse::SuiteSparseConfig_static ) + target_link_libraries ( SPQR_static PUBLIC SuiteSparse::SuiteSparseConfig_static ) + else ( ) + target_link_libraries ( SPQR_static PUBLIC SuiteSparse::SuiteSparseConfig ) + endif ( ) endif ( ) # OpenMP: if ( OPENMP_FOUND ) - message ( STATUS "OpenMP C libraries: ${OpenMP_C_LIBRARIES} ") - message ( STATUS "OpenMP C include: ${OpenMP_C_INCLUDE_DIRS} ") - message ( STATUS "OpenMP C flags: ${OpenMP_C_FLAGS} ") - target_link_libraries ( spqr PRIVATE ${OpenMP_C_LIBRARIES} ) + target_link_libraries ( SPQR PRIVATE OpenMP::OpenMP_CXX ) if ( NOT NSTATIC ) - target_link_libraries ( spqr_static PUBLIC ${OpenMP_C_LIBRARIES} ) + target_link_libraries ( SPQR_static PUBLIC OpenMP::OpenMP_CXX ) + list ( APPEND SPQR_STATIC_LIBS ${OpenMP_CXX_LIBRARIES} ) endif ( ) - set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS} " ) - include_directories ( ${OpenMP_C_INCLUDE_DIRS} ) endif ( ) # libm: if ( NOT WIN32 ) - target_link_libraries ( spqr PRIVATE m ) + target_link_libraries ( SPQR PRIVATE m ) if ( NOT NSTATIC ) - target_link_libraries ( spqr_static PUBLIC m ) + list ( APPEND SPQR_STATIC_LIBS "m" ) + target_link_libraries ( SPQR_static PUBLIC m ) endif ( ) endif ( ) -# amd: -target_link_libraries ( spqr PRIVATE ${AMD_LIBRARIES} ) -if ( NOT NSTATIC ) - target_link_libraries ( spqr_static PUBLIC ${AMD_STATIC} ) -endif ( ) - -# colamd: -target_link_libraries ( spqr PRIVATE ${COLAMD_LIBRARIES} ) +# LAPACK: +message ( STATUS "LAPACK libraries: ${LAPACK_LIBRARIES} ") +message ( STATUS "LAPACK include: ${LAPACK_INCLUDE_DIRS} ") +message ( STATUS "LAPACK linker flags: ${LAPACK_LINKER_FLAGS} ") +target_link_libraries ( SPQR PRIVATE ${LAPACK_LIBRARIES} ) +target_include_directories ( SPQR PRIVATE ${LAPACK_INCLUDE_DIR} ) if ( NOT NSTATIC ) - target_link_libraries ( spqr_static PUBLIC ${COLAMD_STATIC} ) + list ( APPEND SPQR_STATIC_LIBS ${LAPACK_LIBRARIES} ) + target_link_libraries ( SPQR_static PUBLIC ${LAPACK_LIBRARIES} ) + target_include_directories ( SPQR_static PRIVATE ${LAPACK_INCLUDE_DIR} ) endif ( ) # BLAS: message ( STATUS "BLAS libraries: ${BLAS_LIBRARIES} ") message ( STATUS "BLAS include: ${BLAS_INCLUDE_DIRS} ") message ( STATUS "BLAS linker flags: ${BLAS_LINKER_FLAGS} ") -target_link_libraries ( spqr PRIVATE ${BLAS_LIBRARIES} ) +target_link_libraries ( SPQR PRIVATE ${BLAS_LIBRARIES} ) +target_include_directories ( SPQR PRIVATE ${BLAS_INCLUDE_DIRS} ) if ( NOT NSTATIC ) - target_link_libraries ( spqr_static PUBLIC ${BLAS_LIBRARIES} ) + list ( APPEND SPQR_STATIC_LIBS ${BLAS_LIBRARIES} ) + target_link_libraries ( SPQR_static PUBLIC ${BLAS_LIBRARIES} ) + target_include_directories ( SPQR_static PRIVATE ${BLAS_INCLUDE_DIRS} ) endif ( ) -include_directories ( ${BLAS_INCLUDE_DIRS} ) -# LAPACK: -message ( STATUS "LAPACK libraries: ${LAPACK_LIBRARIES} ") -message ( STATUS "LAPACK include: ${LAPACK_INCLUDE_DIRS} ") -message ( STATUS "LAPACK linker flags: ${LAPACK_LINKER_FLAGS} ") -target_link_libraries ( spqr PRIVATE ${LAPACK_LIBRARIES} ) +# CHOLMOD: +# link with CHOLMOD and its dependencies +target_link_libraries ( SPQR PRIVATE + SuiteSparse::CHOLMOD ) if ( NOT NSTATIC ) - target_link_libraries ( spqr_static PUBLIC ${LAPACK_LIBRARIES} ) -endif ( ) -include_directories ( ${LAPACK_INCLUDE_DIR} ) - -# cholmod: -# link with CHOLMOD and its dependencies, both required and optional -target_link_libraries ( spqr PRIVATE - ${CHOLMOD_LIBRARIES} ${CHOLMOD_CUDA_LIBRARIES} - ${AMD_LIBRARIES} ${COLAMD_LIBRARIES} - ${CAMD_LIBRARIES} ${CCOLAMD_LIBRARIES} ) -if ( NOT NSTATIC ) - target_link_libraries ( spqr_static PUBLIC - ${CHOLMOD_STATIC} ${CHOLMOD_CUDA_STATIC} - ${AMD_STATIC} ${COLAMD_STATIC} - ${CAMD_STATIC} ${CCOLAMD_STATIC} ) + if ( TARGET SuiteSparse::CHOLMOD_static ) + target_link_libraries ( SPQR_static PUBLIC SuiteSparse::CHOLMOD_static ) + else ( ) + target_link_libraries ( SPQR_static PUBLIC SuiteSparse::CHOLMOD ) + endif ( ) endif ( ) -# CUDA -message ( STATUS "SPQR cuda: ${SPQR_CUDA} " ) -target_link_libraries ( spqr PRIVATE ${SPQR_CUDA} ${CUDA_LIBRARIES} ) -if ( NOT NSTATIC ) -target_link_libraries ( spqr_static PUBLIC ${SPQR_CUDA} ${CUDA_LIBRARIES} ) +if ( SUITESPARSE_CUDA ) + # CUDA + target_link_libraries ( SPQR PRIVATE SuiteSparse::CHOLMOD_CUDA SPQR_CUDA ) + # SPQR includes files from the following targets that are not installed by + # them. That looks strange and will only work before they are installed. + # Maybe, those two targets aren't actually standalone libraries but should + # be part of the SPQR project? + target_link_libraries ( SPQR PRIVATE + SuiteSparse::GPUQREngine SuiteSparse::GPURuntime ) + target_compile_definitions ( SPQR PUBLIC "SUITESPARSE_CUDA" ) + set ( SPQR_CFLAGS "-DSUITESPARSE_CUDA" ) + if ( NOT NSTATIC ) + if ( TARGET SuiteSparse::CHOLMOD_CUDA_static ) + target_link_libraries ( SPQR_static PUBLIC SuiteSparse::CHOLMOD_CUDA_static ) + else ( ) + target_link_libraries ( SPQR_static PUBLIC SuiteSparse::CHOLMOD_CUDA ) + endif ( ) + target_link_libraries ( SPQR_static PUBLIC SPQR_CUDA_static ) + target_compile_definitions ( SPQR_static PUBLIC "SUITESPARSE_CUDA" ) + + if ( TARGET SuiteSparse::GPUQREngine_static ) + target_link_libraries ( SPQR_static PUBLIC SuiteSparse::GPUQREngine_static ) + else ( ) + target_link_libraries ( SPQR_static PUBLIC SuiteSparse::GPUQREngine ) + endif ( ) + if ( TARGET SuiteSparse::GPURuntime_static ) + target_link_libraries ( SPQR_static PUBLIC SuiteSparse::GPURuntime_static ) + else ( ) + target_link_libraries ( SPQR_static PUBLIC SuiteSparse::GPURuntime ) + endif ( ) + endif ( ) endif ( ) #------------------------------------------------------------------------------- # SPQR installation location #------------------------------------------------------------------------------- -install ( TARGETS spqr +include ( CMakePackageConfigHelpers ) + +install ( TARGETS SPQR + EXPORT SPQRTargets LIBRARY DESTINATION ${SUITESPARSE_LIBDIR} ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} RUNTIME DESTINATION ${SUITESPARSE_BINDIR} ) -install ( FILES - ${CMAKE_SOURCE_DIR}/cmake_modules/FindSPQR.cmake - ${CMAKE_SOURCE_DIR}/cmake_modules/FindSPQR_CUDA.cmake - DESTINATION ${SUITESPARSE_LIBDIR}/cmake/SuiteSparse - COMPONENT Development ) if ( NOT NSTATIC ) - install ( TARGETS spqr_static + install ( TARGETS SPQR_static + EXPORT SPQRTargets ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} ) - endif ( ) +endif ( ) + install ( FILES "Include/SuiteSparseQR_C.h" "Include/SuiteSparseQR_definitions.h" "Include/SuiteSparseQR.hpp" DESTINATION ${SUITESPARSE_INCLUDEDIR} ) +# create (temporary) export target file during build +export ( EXPORT SPQRTargets + NAMESPACE SuiteSparse:: + FILE ${CMAKE_CURRENT_BINARY_DIR}/SPQRTargets.cmake ) + +# install export target, config and version files for find_package +install ( EXPORT SPQRTargets + NAMESPACE SuiteSparse:: + DESTINATION ${SUITESPARSE_LIBDIR}/cmake/SPQR ) + +# generate config file to be used in common build tree +set ( SUITESPARSE_IN_BUILD_TREE on ) +configure_package_config_file ( + Config/SPQRConfig.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/SPQRConfig.cmake + INSTALL_DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/SPQRConfig.cmake ) + +# generate config file to be installed +set ( SUITESPARSE_IN_BUILD_TREE off ) +configure_package_config_file ( + Config/SPQRConfig.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/target/SPQRConfig.cmake + INSTALL_DESTINATION ${SUITESPARSE_LIBDIR}/cmake/SPQR ) + +write_basic_package_version_file ( + ${CMAKE_CURRENT_BINARY_DIR}/SPQRConfigVersion.cmake + COMPATIBILITY SameMajorVersion ) + +install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/target/SPQRConfig.cmake + ${CMAKE_CURRENT_BINARY_DIR}/SPQRConfigVersion.cmake + DESTINATION ${SUITESPARSE_LIBDIR}/cmake/SPQR ) + +#------------------------------------------------------------------------------- +# create pkg-config file +#------------------------------------------------------------------------------- + +if ( NOT MSVC ) + # This might be something like: + # /usr/lib/libgomp.so;/usr/lib/libpthread.a;m + # convert to -l flags for pkg-config, i.e.: "-lgomp -lpthread -lm" + set ( SPQR_STATIC_LIBS_LIST ${SPQR_STATIC_LIBS} ) + set ( SPQR_STATIC_LIBS "" ) + foreach ( _lib ${SPQR_STATIC_LIBS_LIST} ) + string ( FIND ${_lib} "." _pos REVERSE ) + if ( ${_pos} EQUAL "-1" ) + set ( SPQR_STATIC_LIBS "${SPQR_STATIC_LIBS} -l${_lib}" ) + continue () + endif ( ) + foreach ( _kind IN ITEMS "IMPORT" "SHARED" "STATIC" ) + set ( _regex ".*\\/(lib)?([^\\.]*)(${CMAKE_${_kind}_LIBRARY_SUFFIX})" ) + if ( ${_lib} MATCHES ${_regex} ) + string ( REGEX REPLACE ${_regex} "\\2" _libname ${_lib} ) + if ( NOT "${_libname}" STREQUAL "" ) + set ( SPQR_STATIC_LIBS "${SPQR_STATIC_LIBS} -l${_libname}" ) + break () + endif ( ) + endif ( ) + endforeach ( ) + endforeach ( ) + + set ( prefix "${CMAKE_INSTALL_PREFIX}" ) + set ( exec_prefix "\${prefix}" ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) + if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) + set ( libdir "${SUITESPARSE_LIBDIR}") + else ( ) + set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") + endif ( ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) + if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) + set ( includedir "${SUITESPARSE_INCLUDEDIR}") + else ( ) + set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + endif ( ) + configure_file ( + Config/SPQR.pc.in + SPQR.pc + @ONLY + NEWLINE_STYLE LF ) + install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/SPQR.pc + DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) +endif ( ) + #------------------------------------------------------------------------------- # Demo library and programs #------------------------------------------------------------------------------- -option ( DEMO "ON: Build the demo programs. OFF (default): do not build the demo programs." off ) +option ( DEMO "ON: Build the demo programs. OFF (default): do not build the demo programs." OFF ) if ( DEMO ) #--------------------------------------------------------------------------- @@ -289,6 +413,11 @@ if ( DEMO ) add_executable ( qrdemo "Demo/qrdemo.cpp" ) add_executable ( qrdemoc "Demo/qrdemoc.c" ) + add_executable ( qrsimplec_int32 "Demo/qrsimplec_int32.c" ) + add_executable ( qrdemo_int32 "Demo/qrdemo_int32.cpp" ) + add_executable ( qrdemoc_int32 "Demo/qrdemoc_int32.c" ) + + if ( SUITESPARSE_CUDA ) add_executable ( qrdemo_gpu "Demo/qrdemo_gpu.cpp" ) add_executable ( qrdemo_gpu2 "Demo/qrdemo_gpu2.cpp" ) @@ -296,19 +425,22 @@ if ( DEMO ) endif ( ) # Libraries required for Demo programs - target_link_libraries ( qrsimple PUBLIC spqr ${SPQR_CUDA} ${CHOLMOD_LIBRARIES} ) - target_link_libraries ( qrsimplec PUBLIC spqr ${SPQR_CUDA} ${CHOLMOD_LIBRARIES} ) - target_link_libraries ( qrdemo PUBLIC spqr ${SPQR_CUDA} ${CHOLMOD_LIBRARIES} ) - target_link_libraries ( qrdemoc PUBLIC spqr ${SPQR_CUDA} ${CHOLMOD_LIBRARIES} ) + target_link_libraries ( qrsimple PUBLIC SPQR SuiteSparse::CHOLMOD ) + target_link_libraries ( qrsimplec PUBLIC SPQR SuiteSparse::CHOLMOD ) + target_link_libraries ( qrdemo PUBLIC SPQR SuiteSparse::CHOLMOD ) + target_link_libraries ( qrdemoc PUBLIC SPQR SuiteSparse::CHOLMOD ) + target_link_libraries ( qrsimplec_int32 PUBLIC SPQR SuiteSparse::CHOLMOD ) + target_link_libraries ( qrdemoc_int32 PUBLIC SPQR SuiteSparse::CHOLMOD ) + target_link_libraries ( qrdemo_int32 PUBLIC SPQR SuiteSparse::CHOLMOD ) if ( SUITESPARSE_CUDA ) - target_link_libraries ( qrdemo_gpu PUBLIC spqr ${SPQR_CUDA} - ${CHOLMOD_LIBRARIES} ${SUITESPARSE_CONFIG_LIBRARIES} ) - target_link_libraries ( qrdemo_gpu2 PUBLIC spqr ${SPQR_CUDA} - ${CHOLMOD_LIBRARIES} ${SUITESPARSE_CONFIG_LIBRARIES} ) - target_link_libraries ( qrdemo_gpu3 PUBLIC spqr ${SPQR_CUDA} - ${CHOLMOD_LIBRARIES} ${SUITESPARSE_CONFIG_LIBRARIES} ) + target_link_libraries ( qrdemo_gpu PUBLIC SPQR SPQR_CUDA + SuiteSparse::CHOLMOD SuiteSparse::CHOLMOD_CUDA SuiteSparse::SuiteSparseConfig ) + target_link_libraries ( qrdemo_gpu2 PUBLIC SPQR SPQR_CUDA + SuiteSparse::CHOLMOD SuiteSparse::CHOLMOD_CUDA SuiteSparse::SuiteSparseConfig ) + target_link_libraries ( qrdemo_gpu3 PUBLIC SPQR SPQR_CUDA + SuiteSparse::CHOLMOD SuiteSparse::CHOLMOD_CUDA SuiteSparse::SuiteSparseConfig ) endif ( ) else ( ) diff --git a/SPQR/Config/SPQR.pc.in b/SPQR/Config/SPQR.pc.in new file mode 100644 index 000000000..65c8174e1 --- /dev/null +++ b/SPQR/Config/SPQR.pc.in @@ -0,0 +1,19 @@ +# SPQR, Copyright (c) 2008-2023, Timothy A. Davis. +# All Rights Reserved. +# SPDX-License-Identifier: GPL-2.0-or-later + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +# FIXME: Which flags do we need to statically link CUDA + +Name: SPQR +URL: https://github.com/DrTimothyAldenDavis/SuiteSparse +Description: Multithreaded, multifrontal, rank-revealing sparse QR factorization method in SuiteSparse +Version: @SPQR_VERSION_MAJOR@.@SPQR_VERSION_MINOR@.@SPQR_VERSION_SUB@ +Requires.private: SuiteSparse_config CHOLMOD +Libs: -L${libdir} -lspqr +Libs.private: @SPQR_STATIC_LIBS@ +Cflags: -I${includedir} @SPQR_CFLAGS@ diff --git a/SPQR/Config/SPQRConfig.cmake.in b/SPQR/Config/SPQRConfig.cmake.in new file mode 100644 index 000000000..fb943a1d7 --- /dev/null +++ b/SPQR/Config/SPQRConfig.cmake.in @@ -0,0 +1,137 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/SPQR/cmake_modules/SPQRConfig.cmake +#------------------------------------------------------------------------------- + +# The following copyright and license applies to just this file only, not to +# the library itself: +# SPQRConfig.cmake, Copyright (c) 2023, Timothy A. Davis. All Rights Reserved. +# SPDX-License-Identifier: BSD-3-clause + +#------------------------------------------------------------------------------- + +# Finds the SPQR include file and compiled library. +# The following targets are defined: +# SuiteSparse::SPQR - for the shared library (if available) +# SuiteSparse::SPQR_static - for the static library (if available) + +# For backward compatibility the following variables are set: + +# SPQR_INCLUDE_DIR - where to find SuiteSparseQR.hpp and other headers +# SPQR_LIBRARY - dynamic SPQR library +# SPQR_STATIC - static SPQR library +# SPQR_LIBRARIES - libraries when using SPQR +# SPQR_FOUND - true if SPQR found + +# Set ``CMAKE_MODULE_PATH`` to the parent folder where this module file is +# installed. + +#------------------------------------------------------------------------------- + +@PACKAGE_INIT@ + +set ( SPQR_DATE "@SPQR_DATE@" ) +set ( SPQR_VERSION_MAJOR @SPQR_VERSION_MAJOR@ ) +set ( SPQR_VERSION_MINOR @SPQR_VERSION_MINOR@ ) +set ( SPQR_VERSION_PATCH @SPQR_VERSION_SUB@ ) +set ( SPQR_VERSION "@SPQR_VERSION_MAJOR@.@SPQR_VERSION_MINOR@.@SPQR_VERSION_SUB@" ) + +if ( @SUITESPARSE_CUDA@ ) + # Look for imported targets of additional dependency if SPQR was built with CUDA + + if ( @SUITESPARSE_IN_BUILD_TREE@ ) + # First check in a common build tree + find_package ( SPQR_CUDA ${SPQR_VERSION} + PATHS ${CMAKE_SOURCE_DIR}/../SPQR/build NO_DEFAULT_PATH ) + # Then, check in the currently active CMAKE_MODULE_PATH + if ( NOT TARGET SPQR_CUDA ) + find_package ( SPQR_CUDA ${SPQR_VERSION} REQUIRED ) + endif ( ) + else ( ) + find_package ( SPQR_CUDA ${SPQR_VERSION} REQUIRED ) + endif ( ) +endif ( ) + +include ( ${CMAKE_CURRENT_LIST_DIR}/SPQRTargets.cmake ) + +# The following is only for backward compatibility with FindSPQR. + +set ( _target_shared SuiteSparse::SPQR ) +set ( _target_static SuiteSparse::SPQR_static ) +set ( _var_prefix "SPQR" ) + +get_target_property ( ${_var_prefix}_INCLUDE_DIR ${_target_shared} INTERFACE_INCLUDE_DIRECTORIES ) +if ( ${_var_prefix}_INCLUDE_DIR ) + # First item in SuiteSparse targets contains the "main" header directory. + list ( GET ${_var_prefix}_INCLUDE_DIR 0 ${_var_prefix}_INCLUDE_DIR ) +endif ( ) +get_target_property ( ${_var_prefix}_LIBRARY ${_target_shared} IMPORTED_IMPLIB ) +if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} IMPORTED_LOCATION ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) +endif ( ) +if ( TARGET ${_target_static} ) + get_target_property ( ${_var_prefix}_STATIC ${_target_static} IMPORTED_LOCATION ) +endif ( ) + +# Check for most common build types +set ( _config_types "Debug" "Release" "RelWithDebInfo" "MinSizeRel" ) + +get_property ( _isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG ) +if ( _isMultiConfig ) + # For multi-configuration generators (e.g., Visual Studio), prefer those + # configurations. + list ( PREPEND _config_types ${CMAKE_CONFIGURATION_TYPES} ) +else ( ) + # For single-configuration generators, prefer the current configuration. + list ( PREPEND _config_types ${CMAKE_BUILD_TYPE} ) +endif ( ) + +list ( REMOVE_DUPLICATES _config_types ) + +foreach ( _config ${_config_types} ) + string ( TOUPPER ${_config} _uc_config ) + if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} + IMPORTED_IMPLIB_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) + endif ( ) + if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} + IMPORTED_LOCATION_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) + endif ( ) + if ( TARGET ${_target_static} AND NOT ${_var_prefix}_STATIC ) + get_target_property ( _library_chk ${_target_static} + IMPORTED_LOCATION_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_STATIC ${_library_chk} ) + endif ( ) + endif ( ) +endforeach ( ) + +set ( SPQR_LIBRARIES ${SPQR_LIBRARY} ) + +macro ( suitesparse_check_exist _var _files ) + # ignore generator expressions + string ( GENEX_STRIP "${_files}" _files2 ) + + foreach ( _file ${_files2} ) + if ( NOT EXISTS "${_file}" ) + message ( FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist!" ) + endif ( ) + endforeach () +endmacro ( ) + +suitesparse_check_exist ( SPQR_INCLUDE_DIR ${SPQR_INCLUDE_DIR} ) +suitesparse_check_exist ( SPQR_LIBRARY ${SPQR_LIBRARY} ) + +message ( STATUS "SPQR version: ${SPQR_VERSION}" ) +message ( STATUS "SPQR include: ${SPQR_INCLUDE_DIR}" ) +message ( STATUS "SPQR library: ${SPQR_LIBRARY}" ) +message ( STATUS "SPQR static: ${SPQR_STATIC}" ) diff --git a/SPQR/Config/SPQR_CUDA.pc.in b/SPQR/Config/SPQR_CUDA.pc.in new file mode 100644 index 000000000..6617cbf9c --- /dev/null +++ b/SPQR/Config/SPQR_CUDA.pc.in @@ -0,0 +1,19 @@ +# SPQR_CUDA, Copyright (c) 2008-2023, Timothy A. Davis. +# All Rights Reserved. +# SPDX-License-Identifier: GPL-2.0-or-later + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +# FIXME: Which flags do we need to statically link CUDA + +Name: SPQR_CUDA +URL: https://github.com/DrTimothyAldenDavis/SuiteSparse +Description: GPU module for SPQR in SuiteSparse +Version: @SPQR_VERSION_MAJOR@.@SPQR_VERSION_MINOR@.@SPQR_VERSION_SUB@ +Requires.private: CHOLMOD +Libs: -L${libdir} -lspqr_cuda +Libs.private: @SPQR_STATIC_LIBS@ +Cflags: -I${includedir} diff --git a/SPQR/Config/SPQR_CUDAConfig.cmake.in b/SPQR/Config/SPQR_CUDAConfig.cmake.in new file mode 100644 index 000000000..e9c8cd304 --- /dev/null +++ b/SPQR/Config/SPQR_CUDAConfig.cmake.in @@ -0,0 +1,121 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/SPQR/cmake_modules/SPQR_CUDAConfig.cmake +#------------------------------------------------------------------------------- + +# The following copyright and license applies to just this file only, not to +# the library itself: +# SPQR_CUDAConfig.cmake, Copyright (c) 2023, Timothy A. Davis. All Rights Reserved. +# SPDX-License-Identifier: BSD-3-clause + +#------------------------------------------------------------------------------- + +# Finds the SPQR_CUDA include file and compiled library. +# The following targets are defined: +# SuiteSparse::SPQR_CUDA - for the shared library (if available) +# SuiteSparse::SPQR_CUDA_static - for the static library (if available) + +# For backward compatibility the following variables are set: + +# SPQR_CUDA_LIBRARY - dynamic SPQR_CUDA library +# SPQR_CUDA_STATIC - static SPQR_CUDA library +# SPQR_CUDA_LIBRARIES - libraries when using SPQR_CUDA +# SPQR_CUDA_FOUND - true if SPQR_CUDA found + +# Set ``CMAKE_MODULE_PATH`` to the parent folder where this module file is +# installed. + +#------------------------------------------------------------------------------- + +@PACKAGE_INIT@ + +set ( SPQR_CUDA_DATE "@SPQR_DATE@" ) +set ( SPQR_CUDA_VERSION_MAJOR @SPQR_VERSION_MAJOR@ ) +set ( SPQR_CUDA_VERSION_MINOR @SPQR_VERSION_MINOR@ ) +set ( SPQR_CUDA_VERSION_PATCH @SPQR_VERSION_SUB@ ) +set ( SPQR_CUDA_VERSION "@SPQR_VERSION_MAJOR@.@SPQR_VERSION_MINOR@.@SPQR_VERSION_SUB@" ) + +# Look for NVIDIA CUDA toolkit +find_package ( CUDAToolkit @CUDAToolkit_VERSION_MAJOR@ REQUIRED ) + +include ( ${CMAKE_CURRENT_LIST_DIR}/SPQR_CUDATargets.cmake ) + +# The following is only for backward compatibility with FindSPQR_CUDA. + +set ( _target_shared SuiteSparse::SPQR_CUDA ) +set ( _target_static SuiteSparse::SPQR_CUDA_static ) +set ( _var_prefix "SPQR_CUDA" ) + +get_target_property ( ${_var_prefix}_INCLUDE_DIR ${_target_shared} INTERFACE_INCLUDE_DIRECTORIES ) +if ( ${_var_prefix}_INCLUDE_DIR ) + # First item in SuiteSparse targets contains the "main" header directory. + list ( GET ${_var_prefix}_INCLUDE_DIR 0 ${_var_prefix}_INCLUDE_DIR ) +endif ( ) +get_target_property ( ${_var_prefix}_LIBRARY ${_target_shared} IMPORTED_IMPLIB ) +if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} IMPORTED_LOCATION ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) +endif ( ) +if ( TARGET ${_target_static} ) + get_target_property ( ${_var_prefix}_STATIC ${_target_static} IMPORTED_LOCATION ) +endif ( ) + +# Check for most common build types +set ( _config_types "Debug" "Release" "RelWithDebInfo" "MinSizeRel" ) + +get_property ( _isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG ) +if ( _isMultiConfig ) + # For multi-configuration generators (e.g., Visual Studio), prefer those + # configurations. + list ( PREPEND _config_types ${CMAKE_CONFIGURATION_TYPES} ) +else ( ) + # For single-configuration generators, prefer the current configuration. + list ( PREPEND _config_types ${CMAKE_BUILD_TYPE} ) +endif ( ) + +list ( REMOVE_DUPLICATES _config_types ) + +foreach ( _config ${_config_types} ) + string ( TOUPPER ${_config} _uc_config ) + if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} + IMPORTED_IMPLIB_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) + endif ( ) + if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} + IMPORTED_LOCATION_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) + endif ( ) + if ( TARGET ${_target_static} AND NOT ${_var_prefix}_STATIC ) + get_target_property ( _library_chk ${_target_static} + IMPORTED_LOCATION_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_STATIC ${_library_chk} ) + endif ( ) + endif ( ) +endforeach ( ) + +set ( SPQR_CUDA_LIBRARIES ${SPQR_CUDA_LIBRARY} ) + +macro ( suitesparse_check_exist _var _files ) + # ignore generator expressions + string ( GENEX_STRIP "${_files}" _files2 ) + + foreach ( _file ${_files2} ) + if ( NOT EXISTS "${_file}" ) + message ( FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist!" ) + endif ( ) + endforeach () +endmacro ( ) + +suitesparse_check_exist ( SPQR_CUDA_LIBRARY ${SPQR_CUDA_LIBRARY} ) + +message ( STATUS "SPQR_CUDA version: ${SPQR_CUDA_VERSION}" ) +message ( STATUS "SPQR_CUDA library: ${SPQR_CUDA_LIBRARY}" ) +message ( STATUS "SPQR_CUDA static: ${SPQR_CUDA_STATIC}" ) diff --git a/SPQR/Demo/qrdemo_int32.cpp b/SPQR/Demo/qrdemo_int32.cpp new file mode 100644 index 000000000..307b4e95e --- /dev/null +++ b/SPQR/Demo/qrdemo_int32.cpp @@ -0,0 +1,175 @@ +// ============================================================================= +// === qrdemo.cpp ============================================================== +// ============================================================================= + +// SPQR, Copyright (c) 2008-2022, Timothy A Davis. All Rights Reserved. +// SPDX-License-Identifier: GPL-2.0+ + +// A simple C++ demo of SuiteSparseQR. The comments give the MATLAB equivalent +// statements. See also qrdemo.m + +#include "SuiteSparseQR.hpp" +#include + +// ============================================================================= +// check_residual: print the relative residual, norm (A*x-b)/norm(x) +// ============================================================================= + +void check_residual +( + cholmod_sparse *A, + cholmod_dense *X, + cholmod_dense *B, + cholmod_common *cc +) +{ + int64_t m = A->nrow ; + int64_t n = A->ncol ; + int64_t rnk ; + double rnorm, anorm, xnorm, atrnorm ; + double one [2] = {1,0}, minusone [2] = {-1,0}, zero [2] = {0,0} ; + cholmod_dense *r, *atr ; + + // get the rank(A) estimate + rnk = cc->SPQR_istat [4] ; + +#ifndef NMATRIXOPS + // anorm = norm (A,1) ; + anorm = cholmod_norm_sparse (A, 1, cc) ; + + // rnorm = norm (A*X-B) + r = cholmod_copy_dense (B, cc) ; + cholmod_sdmult (A, 0, one, minusone, X, r, cc) ; + rnorm = cholmod_norm_dense (r, 2, cc) ; + + // xnorm = norm (X) + xnorm = cholmod_norm_dense (X, 2, cc) ; + + // atrnorm = norm (A'*r) + atr = cholmod_zeros (n, 1, r->xtype, cc) ; // atr = zeros (n,1) + cholmod_sdmult (A, 1, one, zero, r, atr, cc) ; // atr = A'*r + atrnorm = cholmod_norm_dense (atr, 2, cc) ; // atrnorm = norm (atr) + if (anorm > 0) atrnorm /= anorm ; + + if (m <= n && anorm > 0 && xnorm > 0) + { + // find the relative residual, except for least-squares systems + rnorm /= (anorm * xnorm) ; + } + printf ("relative norm(Ax-b): %8.1e rank: %6" PRId64 " " + "rel. norm(A'(Ax-b)) %8.1e\n", rnorm, rnk, atrnorm) ; + cholmod_free_dense (&r, cc) ; + cholmod_free_dense (&atr, cc) ; +#else + printf ("relative norm(Ax-b): not computed (requires CHOLMOD/MatrixOps)\n"); + printf ("rank: %6" PRId64 "\n", rnk) ; +#endif +} + +// ============================================================================= + +int main (int argc, char **argv) +{ + cholmod_common Common, *cc ; + cholmod_sparse *A ; + cholmod_dense *X, *B ; + int mtype ; + int64_t m, n ; + + // start CHOLMOD + cc = &Common ; + cholmod_start (cc) ; + + // A = mread (stdin) ; read in the sparse matrix A + A = (cholmod_sparse *) cholmod_read_matrix (stdin, 1, &mtype, cc) ; + if (mtype != CHOLMOD_SPARSE) + { + printf ("input matrix must be sparse\n") ; + exit (1) ; + } + + // [m n] = size (A) ; + m = A->nrow ; + n = A->ncol ; + + printf ("Matrix %6" PRId64 "-by-%-6" PRId64 " nnz: %6" PRId64 "\n", + m, n, cholmod_nnz (A, cc)) ; + + // B = ones (m,1), a dense right-hand-side of the same type as A + B = cholmod_ones (m, 1, A->xtype, cc) ; + + // X = A\B ; with default ordering and default column 2-norm tolerance + if (A->xtype == CHOLMOD_REAL) + { + // A, X, and B are all real + X = SuiteSparseQR + (SPQR_ORDERING_DEFAULT, SPQR_DEFAULT_TOL, A, B, cc) ; + } + else + { + // A, X, and B are all complex + X = SuiteSparseQR < std::complex, int32_t > + (SPQR_ORDERING_DEFAULT, SPQR_DEFAULT_TOL, A, B, cc) ; + } + + check_residual (A, X, B, cc) ; + cholmod_free_dense (&X, cc) ; + + // ------------------------------------------------------------------------- + // factorizing once then solving twice with different right-hand-sides + // ------------------------------------------------------------------------- + + // Just the real case. Complex case is essentially identical + if (A->xtype == CHOLMOD_REAL) + { + SuiteSparseQR_factorization *QR ; + cholmod_dense *Y ; + int64_t i ; + double *Bx ; + + // factorize once + QR = SuiteSparseQR_factorize + (SPQR_ORDERING_DEFAULT, SPQR_DEFAULT_TOL, A, cc) ; + + // solve Ax=b, using the same B as before + + // Y = Q'*B + Y = SuiteSparseQR_qmult (SPQR_QTX, QR, B, cc) ; + // X = R\(E*Y) + X = SuiteSparseQR_solve (SPQR_RETX_EQUALS_B, QR, Y, cc) ; + // check the results + check_residual (A, X, B, cc) ; + // free X and Y + cholmod_free_dense (&Y, cc) ; + cholmod_free_dense (&X, cc) ; + + // repeat with a different B + Bx = (double *) (B->x) ; + for (i = 0 ; i < m ; i++) + { + Bx [i] = i ; + } + + // Y = Q'*B + Y = SuiteSparseQR_qmult (SPQR_QTX, QR, B, cc) ; + // X = R\(E*Y) + X = SuiteSparseQR_solve (SPQR_RETX_EQUALS_B, QR, Y, cc) ; + // check the results + check_residual (A, X, B, cc) ; + // free X and Y + cholmod_free_dense (&Y, cc) ; + cholmod_free_dense (&X, cc) ; + + // free QR + SuiteSparseQR_free (&QR, cc) ; + } + + // ------------------------------------------------------------------------- + // free everything that remains + // ------------------------------------------------------------------------- + + cholmod_free_sparse (&A, cc) ; + cholmod_free_dense (&B, cc) ; + cholmod_finish (cc) ; + return (0) ; +} diff --git a/SPQR/Demo/qrdemoc_int32.c b/SPQR/Demo/qrdemoc_int32.c new file mode 100644 index 000000000..e00c2ead4 --- /dev/null +++ b/SPQR/Demo/qrdemoc_int32.c @@ -0,0 +1,79 @@ +/* ========================================================================== */ +/* === qrdemo.c ============================================================= */ +/* ========================================================================== */ + +// SPQR, Copyright (c) 2008-2022, Timothy A Davis. All Rights Reserved. +// SPDX-License-Identifier: GPL-2.0+ + +/* A simple C demo of SuiteSparseQR. The comments give the MATLAB equivalent + statements. See also qrdemo.m + */ + +#include "SuiteSparseQR_C.h" + +int main (int argc, char **argv) +{ + cholmod_common Common, *cc ; + cholmod_sparse *A ; + cholmod_dense *X, *B, *Residual ; + double anorm, xnorm, rnorm, one [2] = {1,0}, minusone [2] = {-1,0} ; + int mtype ; + int64_t m, n, rnk ; + + /* start CHOLMOD */ + cc = &Common ; + cholmod_start (cc) ; + + /* A = mread (stdin) ; read in the sparse matrix A */ + A = (cholmod_sparse *) cholmod_read_matrix (stdin, 1, &mtype, cc) ; + if (mtype != CHOLMOD_SPARSE) + { + printf ("input matrix must be sparse\n") ; + exit (1) ; + } + + /* [m n] = size (A) ; */ + m = A->nrow ; + n = A->ncol ; + + /* anorm = norm (A,1) ; */ + anorm = cholmod_norm_sparse (A, 1, cc) ; + + printf ("Matrix %6" PRId64 "-by-%-6" PRId64 " nnz: %6" PRId64 " ", + m, n, cholmod_nnz (A, cc)) ; + + /* B = ones (m,1), a dense right-hand-side of the same type as A */ + B = cholmod_ones (m, 1, A->xtype, cc) ; + // cholmod_print_dense(B, "B", cc) ; + + /* X = A\B ; with default ordering and default column 2-norm tolerance */ + X = SuiteSparseQR_C_backslash + (SPQR_ORDERING_DEFAULT, SPQR_DEFAULT_TOL, A, B, cc) ; + // cholmod_print_dense(X, "X", cc) ; + + /* get the rank(A) estimate */ + rnk = cc->SPQR_istat [4] ; + + /* rnorm = norm (A*X-B) */ + Residual = cholmod_copy_dense (B, cc) ; + cholmod_sdmult (A, 0, one, minusone, X, Residual, cc) ; + rnorm = cholmod_norm_dense (Residual, 2, cc) ; + + /* xnorm = norm (X) */ + xnorm = cholmod_norm_dense (X, 2, cc) ; + + if (m <= n && anorm > 0 && xnorm > 0) + { + /* find the relative residual, except for least-squares systems */ + rnorm /= (anorm * xnorm) ; + } + printf ("residual: %8.1e rank: %6" PRId64 "\n", rnorm, rnk) ; + + /* free everything */ + cholmod_free_dense (&Residual, cc) ; + cholmod_free_sparse (&A, cc) ; + cholmod_free_dense (&X, cc) ; + cholmod_free_dense (&B, cc) ; + cholmod_finish (cc) ; + return (0) ; +} diff --git a/SPQR/Demo/qrsimplec_int32.c b/SPQR/Demo/qrsimplec_int32.c new file mode 100644 index 000000000..92e1eb56f --- /dev/null +++ b/SPQR/Demo/qrsimplec_int32.c @@ -0,0 +1,52 @@ +/* ========================================================================== */ +/* === qrsimplec.c ========================================================== */ +/* ========================================================================== */ + +// SPQR, Copyright (c) 2008-2022, Timothy A Davis. All Rights Reserved. +// SPDX-License-Identifier: GPL-2.0+ + +/* A very simple example of the use of SuiteSparseQR by a C main program. + Usage: qrsimplec < Matrix_in_MatrixMarket_format */ + +#include "SuiteSparseQR_C.h" +int main (int argc, char **argv) +{ + cholmod_common Common, *cc ; + cholmod_sparse *A ; + cholmod_dense *X, *B, *Residual = NULL ; + double rnorm, one [2] = {1,0}, minusone [2] = {-1,0} ; + int mtype ; + + /* start CHOLMOD */ + cc = &Common ; + cholmod_start (cc) ; + + /* load A */ + A = (cholmod_sparse *) + cholmod_read_matrix (stdin, 1, &mtype, cc) ; + + /* B = ones (size (A,1),1) */ + B = cholmod_ones (A->nrow, 1, A->xtype, cc) ; + + /* X = A\B */ + X = SuiteSparseQR_C_backslash_default (A, B, cc) ; + +#ifndef NMATRIXOPS + /* rnorm = norm (B-A*X) */ + Residual = cholmod_copy_dense (B, cc) ; + cholmod_sdmult (A, 0, minusone, one, X, Residual, cc) ; + rnorm = cholmod_norm_dense (Residual, 2, cc) ; + printf ("2-norm of residual: %8.1e\n", rnorm) ; +#else + printf ("2-norm of residual: not computed (requires CHOLMOD/MatrixOps)\n") ; +#endif + printf ("rank %" PRId64 "\n", cc->SPQR_istat [4]) ; + + /* free everything and finish CHOLMOD */ + cholmod_free_dense (&Residual, cc) ; + cholmod_free_sparse (&A, cc) ; + cholmod_free_dense (&X, cc) ; + cholmod_free_dense (&B, cc) ; + cholmod_finish (cc) ; + return (0) ; +} diff --git a/SPQR/Demo/spqr_demo.out b/SPQR/Demo/spqr_demo.out index 0a93b5c50..4666a30b2 100644 --- a/SPQR/Demo/spqr_demo.out +++ b/SPQR/Demo/spqr_demo.out @@ -1,3 +1,264 @@ +( cd build && cmake .. && cmake --build . --config Release -j8 ) +-- Building SPQR version: v4.2.0 (Sept 8, 2023) +-- Source: /home/faculty/d/davis/dev2/SuiteSparse/SPQR +-- Build: /home/faculty/d/davis/dev2/SuiteSparse/SPQR/build +-- Install lib: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Install include: /home/faculty/d/davis/dev2/SuiteSparse/include +-- Install bin: /home/faculty/d/davis/dev2/SuiteSparse/bin +-- Install rpath: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Build rpath: /home/faculty/d/davis/dev2/SuiteSparse/SPQR/build;/home/faculty/d/davis/dev2/SuiteSparse/lib +-- Build type: Release +-- Fortran: /usr/bin/f95 +-- Looking for CUDA +-- Find CUDA tool kit: +-- CUDA toolkit found: TRUE +-- CUDA toolkit version: 11.7.99 +-- CUDA toolkit include: /usr/local/cuda/include +-- CUDA toolkit lib dir: /usr/local/cuda/lib64 +-- CUDA: enabled +-- SuiteSparse_config version: 7.2.0 +-- SuiteSparse_config include: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config +-- SuiteSparse_config library: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.so.7.2.0 +-- SuiteSparse_config static: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.a +-- AMD version: 3.2.0 +-- AMD include: /home/faculty/d/davis/dev2/SuiteSparse/AMD/Include +-- AMD library: /home/faculty/d/davis/dev2/SuiteSparse/AMD/build/libamd.so.3.2.0 +-- AMD static: /home/faculty/d/davis/dev2/SuiteSparse/AMD/build/libamd.a +-- COLAMD version: 3.2.0 +-- COLAMD include: /home/faculty/d/davis/dev2/SuiteSparse/COLAMD/Include +-- COLAMD library: /home/faculty/d/davis/dev2/SuiteSparse/COLAMD/build/libcolamd.so.3.2.0 +-- COLAMD static: /home/faculty/d/davis/dev2/SuiteSparse/COLAMD/build/libcolamd.a +-- Found CUDAToolkit: /usr/local/cuda/include (found suitable version "11.7.99", minimum required is "11") +-- CHOLMOD_CUDA version: 4.2.0 +-- CHOLMOD_CUDA library: /home/faculty/d/davis/dev2/SuiteSparse/CHOLMOD/build/GPU/libcholmod_cuda.so.4.2.0 +-- CHOLMOD_CUDA static: /home/faculty/d/davis/dev2/SuiteSparse/CHOLMOD/build/GPU/libcholmod_cuda.a +-- CHOLMOD version: 4.2.0 +-- CHOLMOD include: /home/faculty/d/davis/dev2/SuiteSparse/CHOLMOD/Include +-- CHOLMOD library: /home/faculty/d/davis/dev2/SuiteSparse/CHOLMOD/build/libcholmod.so.4.2.0 +-- CHOLMOD static: /home/faculty/d/davis/dev2/SuiteSparse/CHOLMOD/build/libcholmod.a +-- CAMD version: 3.2.0 +-- CAMD include: /home/faculty/d/davis/dev2/SuiteSparse/CAMD/Include +-- CAMD library: /home/faculty/d/davis/dev2/SuiteSparse/CAMD/build/libcamd.so.3.2.0 +-- CAMD static: /home/faculty/d/davis/dev2/SuiteSparse/CAMD/build/libcamd.a +-- CCOLAMD version: 3.2.0 +-- CCOLAMD include: /home/faculty/d/davis/dev2/SuiteSparse/CCOLAMD/Include +-- CCOLAMD library: /home/faculty/d/davis/dev2/SuiteSparse/CCOLAMD/build/libccolamd.so.3.2.0 +-- CCOLAMD static: /home/faculty/d/davis/dev2/SuiteSparse/CCOLAMD/build/libccolamd.a +-- SuiteSparse_GPURuntime version: 3.2.0 +-- SuiteSparse_GPURuntime include: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_GPURuntime/Include +-- SuiteSparse_GPURuntime library: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_GPURuntime/build/libsuitesparse_gpuruntime.so.3.2.0 +-- SuiteSparse_GPURuntime static: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_GPURuntime/build/libsuitesparse_gpuruntime.a +-- GPUQREngine version: 3.2.0 +-- GPUQREngine include: /home/faculty/d/davis/dev2/SuiteSparse/GPUQREngine/Include +-- GPUQREngine library: /home/faculty/d/davis/dev2/SuiteSparse/GPUQREngine/build/libgpuqrengine.so.3.2.0 +-- GPUQREngine static: /home/faculty/d/davis/dev2/SuiteSparse/GPUQREngine/build/libgpuqrengine.a +-- CHOLMOD_CUDA version: 4.2.0 +-- CHOLMOD_CUDA library: /home/faculty/d/davis/dev2/SuiteSparse/CHOLMOD/build/GPU/libcholmod_cuda.so.4.2.0 +-- CHOLMOD_CUDA static: /home/faculty/d/davis/dev2/SuiteSparse/CHOLMOD/build/GPU/libcholmod_cuda.a +-- Looking for Intel 32-bit BLAS +-- Found Intel10_64lp 32-bit BLAS +-- Building SPQR_CUDA version: v4.2.0 (Sept 8, 2023) +-- Source: /home/faculty/d/davis/dev2/SuiteSparse/SPQR +-- Build: /home/faculty/d/davis/dev2/SuiteSparse/SPQR/build +-- Install lib: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Install include: /home/faculty/d/davis/dev2/SuiteSparse/include +-- Install bin: /home/faculty/d/davis/dev2/SuiteSparse/bin +-- Install rpath: /home/faculty/d/davis/dev2/SuiteSparse/lib;/home/faculty/d/davis/dev2/SuiteSparse/lib +-- Build rpath: /home/faculty/d/davis/dev2/SuiteSparse/SPQR/build;/home/faculty/d/davis/dev2/SuiteSparse/lib;/home/faculty/d/davis/dev2/SuiteSparse/SPQR/build;/home/faculty/d/davis/dev2/SuiteSparse/lib +-- Build type: Release +-- Fortran: /usr/bin/f95 +-- Looking for CUDA +-- Find CUDA tool kit: +-- Found CUDAToolkit: /usr/local/cuda/include (found version "11.7.99") +-- CUDA toolkit found: TRUE +-- CUDA toolkit version: 11.7.99 +-- CUDA toolkit include: /usr/local/cuda/include +-- CUDA toolkit lib dir: /usr/local/cuda/lib64 +-- CUDA: enabled +-- C++ flags for CUDA: +-- LAPACK libraries: /usr/lib/x86_64-linux-gnu/libmkl_gf_lp64.so;/usr/lib/x86_64-linux-gnu/libmkl_gnu_thread.so;/usr/lib/x86_64-linux-gnu/libmkl_core.so;/usr/lib/gcc/x86_64-linux-gnu/9/libgomp.so;-lpthread;-lm;-ldl;-lpthread;-lm;-ldl +-- LAPACK include: +-- LAPACK linker flags: +-- BLAS libraries: /usr/lib/x86_64-linux-gnu/libmkl_gf_lp64.so;/usr/lib/x86_64-linux-gnu/libmkl_gnu_thread.so;/usr/lib/x86_64-linux-gnu/libmkl_core.so;/usr/lib/gcc/x86_64-linux-gnu/9/libgomp.so;-lpthread;-lm;-ldl +-- BLAS include: +-- BLAS linker flags: +-- Also compiling the demos in SPQR/Demo +-- ------------------------------------------------------------------------ +-- SuiteSparse CMAKE report for: spqr +-- ------------------------------------------------------------------------ +-- inside common SuiteSparse root: true +-- install in SuiteSparse/lib and SuiteSparse/include: 1 +-- build type: Release +-- NSTATIC: false (build static library) +-- use OpenMP: no +-- C compiler: /usr/bin/cc +-- C flags: +-- C++ compiler: /usr/bin/c++ +-- C++ flags: +-- C Flags release: -O3 -DNDEBUG +-- C++ Flags release: -O3 -DNDEBUG +-- Fortran compiler: /usr/bin/f95 +-- compile definitions: SUITESPARSE_CUDA;BLAS_Intel10_64lp +-- BLAS integer: int32_t +-- CUDA architectures: 52;75;80 +-- ------------------------------------------------------------------------ +-- Configuring done (0.6s) +-- Generating done (0.1s) +-- Build files have been written to: /home/faculty/d/davis/dev2/SuiteSparse/SPQR/build +gmake[1]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/SPQR/build' +[ 3%] Built target SPQR_CUDA +[ 7%] Built target SPQR_CUDA_static +[ 44%] Built target SPQR +[ 82%] Built target SPQR_static +[ 84%] Built target qrsimple +[ 86%] Built target qrdemoc_int32 +[ 88%] Built target qrdemo +[ 90%] Built target qrdemoc +[ 91%] Built target qrsimplec_int32 +[ 93%] Built target qrsimplec +[ 95%] Built target qrdemo_int32 +[ 96%] Built target qrdemo_gpu +[ 98%] Built target qrdemo_gpu3 +[100%] Built target qrdemo_gpu2 +gmake[1]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/SPQR/build' +( cd build && cmake -DDEMO=1 .. && cmake --build . --config Release -j8 ) +-- Building SPQR version: v4.2.0 (Sept 8, 2023) +-- Source: /home/faculty/d/davis/dev2/SuiteSparse/SPQR +-- Build: /home/faculty/d/davis/dev2/SuiteSparse/SPQR/build +-- Install lib: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Install include: /home/faculty/d/davis/dev2/SuiteSparse/include +-- Install bin: /home/faculty/d/davis/dev2/SuiteSparse/bin +-- Install rpath: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Build rpath: /home/faculty/d/davis/dev2/SuiteSparse/SPQR/build;/home/faculty/d/davis/dev2/SuiteSparse/lib +-- Build type: Release +-- Fortran: /usr/bin/f95 +-- Looking for CUDA +-- Find CUDA tool kit: +-- CUDA toolkit found: TRUE +-- CUDA toolkit version: 11.7.99 +-- CUDA toolkit include: /usr/local/cuda/include +-- CUDA toolkit lib dir: /usr/local/cuda/lib64 +-- CUDA: enabled +-- SuiteSparse_config version: 7.2.0 +-- SuiteSparse_config include: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config +-- SuiteSparse_config library: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.so.7.2.0 +-- SuiteSparse_config static: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.a +-- AMD version: 3.2.0 +-- AMD include: /home/faculty/d/davis/dev2/SuiteSparse/AMD/Include +-- AMD library: /home/faculty/d/davis/dev2/SuiteSparse/AMD/build/libamd.so.3.2.0 +-- AMD static: /home/faculty/d/davis/dev2/SuiteSparse/AMD/build/libamd.a +-- COLAMD version: 3.2.0 +-- COLAMD include: /home/faculty/d/davis/dev2/SuiteSparse/COLAMD/Include +-- COLAMD library: /home/faculty/d/davis/dev2/SuiteSparse/COLAMD/build/libcolamd.so.3.2.0 +-- COLAMD static: /home/faculty/d/davis/dev2/SuiteSparse/COLAMD/build/libcolamd.a +-- Found CUDAToolkit: /usr/local/cuda/include (found suitable version "11.7.99", minimum required is "11") +-- CHOLMOD_CUDA version: 4.2.0 +-- CHOLMOD_CUDA library: /home/faculty/d/davis/dev2/SuiteSparse/CHOLMOD/build/GPU/libcholmod_cuda.so.4.2.0 +-- CHOLMOD_CUDA static: /home/faculty/d/davis/dev2/SuiteSparse/CHOLMOD/build/GPU/libcholmod_cuda.a +-- CHOLMOD version: 4.2.0 +-- CHOLMOD include: /home/faculty/d/davis/dev2/SuiteSparse/CHOLMOD/Include +-- CHOLMOD library: /home/faculty/d/davis/dev2/SuiteSparse/CHOLMOD/build/libcholmod.so.4.2.0 +-- CHOLMOD static: /home/faculty/d/davis/dev2/SuiteSparse/CHOLMOD/build/libcholmod.a +-- CAMD version: 3.2.0 +-- CAMD include: /home/faculty/d/davis/dev2/SuiteSparse/CAMD/Include +-- CAMD library: /home/faculty/d/davis/dev2/SuiteSparse/CAMD/build/libcamd.so.3.2.0 +-- CAMD static: /home/faculty/d/davis/dev2/SuiteSparse/CAMD/build/libcamd.a +-- CCOLAMD version: 3.2.0 +-- CCOLAMD include: /home/faculty/d/davis/dev2/SuiteSparse/CCOLAMD/Include +-- CCOLAMD library: /home/faculty/d/davis/dev2/SuiteSparse/CCOLAMD/build/libccolamd.so.3.2.0 +-- CCOLAMD static: /home/faculty/d/davis/dev2/SuiteSparse/CCOLAMD/build/libccolamd.a +-- SuiteSparse_GPURuntime version: 3.2.0 +-- SuiteSparse_GPURuntime include: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_GPURuntime/Include +-- SuiteSparse_GPURuntime library: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_GPURuntime/build/libsuitesparse_gpuruntime.so.3.2.0 +-- SuiteSparse_GPURuntime static: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_GPURuntime/build/libsuitesparse_gpuruntime.a +-- GPUQREngine version: 3.2.0 +-- GPUQREngine include: /home/faculty/d/davis/dev2/SuiteSparse/GPUQREngine/Include +-- GPUQREngine library: /home/faculty/d/davis/dev2/SuiteSparse/GPUQREngine/build/libgpuqrengine.so.3.2.0 +-- GPUQREngine static: /home/faculty/d/davis/dev2/SuiteSparse/GPUQREngine/build/libgpuqrengine.a +-- CHOLMOD_CUDA version: 4.2.0 +-- CHOLMOD_CUDA library: /home/faculty/d/davis/dev2/SuiteSparse/CHOLMOD/build/GPU/libcholmod_cuda.so.4.2.0 +-- CHOLMOD_CUDA static: /home/faculty/d/davis/dev2/SuiteSparse/CHOLMOD/build/GPU/libcholmod_cuda.a +-- Looking for Intel 32-bit BLAS +-- Found Intel10_64lp 32-bit BLAS +-- Building SPQR_CUDA version: v4.2.0 (Sept 8, 2023) +-- Source: /home/faculty/d/davis/dev2/SuiteSparse/SPQR +-- Build: /home/faculty/d/davis/dev2/SuiteSparse/SPQR/build +-- Install lib: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Install include: /home/faculty/d/davis/dev2/SuiteSparse/include +-- Install bin: /home/faculty/d/davis/dev2/SuiteSparse/bin +-- Install rpath: /home/faculty/d/davis/dev2/SuiteSparse/lib;/home/faculty/d/davis/dev2/SuiteSparse/lib +-- Build rpath: /home/faculty/d/davis/dev2/SuiteSparse/SPQR/build;/home/faculty/d/davis/dev2/SuiteSparse/lib;/home/faculty/d/davis/dev2/SuiteSparse/SPQR/build;/home/faculty/d/davis/dev2/SuiteSparse/lib +-- Build type: Release +-- Fortran: /usr/bin/f95 +-- Looking for CUDA +-- Find CUDA tool kit: +-- Found CUDAToolkit: /usr/local/cuda/include (found version "11.7.99") +-- CUDA toolkit found: TRUE +-- CUDA toolkit version: 11.7.99 +-- CUDA toolkit include: /usr/local/cuda/include +-- CUDA toolkit lib dir: /usr/local/cuda/lib64 +-- CUDA: enabled +-- C++ flags for CUDA: +-- LAPACK libraries: /usr/lib/x86_64-linux-gnu/libmkl_gf_lp64.so;/usr/lib/x86_64-linux-gnu/libmkl_gnu_thread.so;/usr/lib/x86_64-linux-gnu/libmkl_core.so;/usr/lib/gcc/x86_64-linux-gnu/9/libgomp.so;-lpthread;-lm;-ldl;-lpthread;-lm;-ldl +-- LAPACK include: +-- LAPACK linker flags: +-- BLAS libraries: /usr/lib/x86_64-linux-gnu/libmkl_gf_lp64.so;/usr/lib/x86_64-linux-gnu/libmkl_gnu_thread.so;/usr/lib/x86_64-linux-gnu/libmkl_core.so;/usr/lib/gcc/x86_64-linux-gnu/9/libgomp.so;-lpthread;-lm;-ldl +-- BLAS include: +-- BLAS linker flags: +-- Also compiling the demos in SPQR/Demo +-- ------------------------------------------------------------------------ +-- SuiteSparse CMAKE report for: spqr +-- ------------------------------------------------------------------------ +-- inside common SuiteSparse root: true +-- install in SuiteSparse/lib and SuiteSparse/include: 1 +-- build type: Release +-- NSTATIC: false (build static library) +-- use OpenMP: no +-- C compiler: /usr/bin/cc +-- C flags: +-- C++ compiler: /usr/bin/c++ +-- C++ flags: +-- C Flags release: -O3 -DNDEBUG +-- C++ Flags release: -O3 -DNDEBUG +-- Fortran compiler: /usr/bin/f95 +-- compile definitions: SUITESPARSE_CUDA;BLAS_Intel10_64lp +-- BLAS integer: int32_t +-- CUDA architectures: 52;75;80 +-- ------------------------------------------------------------------------ +-- Configuring done (0.5s) +-- Generating done (0.1s) +-- Build files have been written to: /home/faculty/d/davis/dev2/SuiteSparse/SPQR/build +gmake[1]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/SPQR/build' +[ 3%] Built target SPQR_CUDA +[ 7%] Built target SPQR_CUDA_static +[ 45%] Built target SPQR_static +[ 82%] Built target SPQR +[ 83%] Built target qrdemoc +[ 85%] Built target qrsimplec +[ 87%] Built target qrsimplec_int32 +[ 89%] Built target qrsimple +[ 91%] Built target qrdemo +[ 92%] Built target qrdemo_gpu +[ 94%] Built target qrdemo_int32 +[ 96%] Built target qrdemoc_int32 +[ 98%] Built target qrdemo_gpu2 +[100%] Built target qrdemo_gpu3 +gmake[1]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/SPQR/build' +./build/qrdemo < Matrix/a00.mtx +Matrix 0-by-0 nnz: 0 +relative norm(Ax-b): 0.0e+00 rank: 0 rel. norm(A'(Ax-b)) 0.0e+00 +relative norm(Ax-b): 0.0e+00 rank: 0 rel. norm(A'(Ax-b)) 0.0e+00 +relative norm(Ax-b): 0.0e+00 rank: 0 rel. norm(A'(Ax-b)) 0.0e+00 +./build/qrdemo < Matrix/a01.mtx +Matrix 0-by-1 nnz: 0 +relative norm(Ax-b): 0.0e+00 rank: 0 rel. norm(A'(Ax-b)) 0.0e+00 +relative norm(Ax-b): 0.0e+00 rank: 0 rel. norm(A'(Ax-b)) 0.0e+00 +relative norm(Ax-b): 0.0e+00 rank: 0 rel. norm(A'(Ax-b)) 0.0e+00 +./build/qrdemo < Matrix/a10.mtx +Matrix 1-by-0 nnz: 0 +relative norm(Ax-b): 1.0e+00 rank: 0 rel. norm(A'(Ax-b)) 0.0e+00 +relative norm(Ax-b): 1.0e+00 rank: 0 rel. norm(A'(Ax-b)) 0.0e+00 +relative norm(Ax-b): 0.0e+00 rank: 0 rel. norm(A'(Ax-b)) 0.0e+00 ./build/qrsimple < Matrix/ash219.mtx 2-norm of residual: 3.5e-15 rank 85 @@ -200,3 +461,337 @@ Matrix 24-by-24 nnz: 81 residual: 2.1e-02 rank: 18 Matrix 841-by-841 nnz: 4089 residual: 1.8e-16 rank: 841 ./build/qrdemoc < Matrix/lp_e226_transposed.mtx Matrix 472-by-223 nnz: 2768 residual: 9.2e+00 rank: 223 +( cd build && cmake -DDEMO=1 .. && cmake --build . --config Release -j8 ) +-- Building SPQR version: v4.2.0 (Sept 8, 2023) +-- Source: /home/faculty/d/davis/dev2/SuiteSparse/SPQR +-- Build: /home/faculty/d/davis/dev2/SuiteSparse/SPQR/build +-- Install lib: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Install include: /home/faculty/d/davis/dev2/SuiteSparse/include +-- Install bin: /home/faculty/d/davis/dev2/SuiteSparse/bin +-- Install rpath: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Build rpath: /home/faculty/d/davis/dev2/SuiteSparse/SPQR/build;/home/faculty/d/davis/dev2/SuiteSparse/lib +-- Build type: Release +-- Fortran: /usr/bin/f95 +-- Looking for CUDA +-- Find CUDA tool kit: +-- CUDA toolkit found: TRUE +-- CUDA toolkit version: 11.7.99 +-- CUDA toolkit include: /usr/local/cuda/include +-- CUDA toolkit lib dir: /usr/local/cuda/lib64 +-- CUDA: enabled +-- SuiteSparse_config version: 7.2.0 +-- SuiteSparse_config include: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config +-- SuiteSparse_config library: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.so.7.2.0 +-- SuiteSparse_config static: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_config/build/libsuitesparseconfig.a +-- AMD version: 3.2.0 +-- AMD include: /home/faculty/d/davis/dev2/SuiteSparse/AMD/Include +-- AMD library: /home/faculty/d/davis/dev2/SuiteSparse/AMD/build/libamd.so.3.2.0 +-- AMD static: /home/faculty/d/davis/dev2/SuiteSparse/AMD/build/libamd.a +-- COLAMD version: 3.2.0 +-- COLAMD include: /home/faculty/d/davis/dev2/SuiteSparse/COLAMD/Include +-- COLAMD library: /home/faculty/d/davis/dev2/SuiteSparse/COLAMD/build/libcolamd.so.3.2.0 +-- COLAMD static: /home/faculty/d/davis/dev2/SuiteSparse/COLAMD/build/libcolamd.a +-- Found CUDAToolkit: /usr/local/cuda/include (found suitable version "11.7.99", minimum required is "11") +-- CHOLMOD_CUDA version: 4.2.0 +-- CHOLMOD_CUDA library: /home/faculty/d/davis/dev2/SuiteSparse/CHOLMOD/build/GPU/libcholmod_cuda.so.4.2.0 +-- CHOLMOD_CUDA static: /home/faculty/d/davis/dev2/SuiteSparse/CHOLMOD/build/GPU/libcholmod_cuda.a +-- CHOLMOD version: 4.2.0 +-- CHOLMOD include: /home/faculty/d/davis/dev2/SuiteSparse/CHOLMOD/Include +-- CHOLMOD library: /home/faculty/d/davis/dev2/SuiteSparse/CHOLMOD/build/libcholmod.so.4.2.0 +-- CHOLMOD static: /home/faculty/d/davis/dev2/SuiteSparse/CHOLMOD/build/libcholmod.a +-- CAMD version: 3.2.0 +-- CAMD include: /home/faculty/d/davis/dev2/SuiteSparse/CAMD/Include +-- CAMD library: /home/faculty/d/davis/dev2/SuiteSparse/CAMD/build/libcamd.so.3.2.0 +-- CAMD static: /home/faculty/d/davis/dev2/SuiteSparse/CAMD/build/libcamd.a +-- CCOLAMD version: 3.2.0 +-- CCOLAMD include: /home/faculty/d/davis/dev2/SuiteSparse/CCOLAMD/Include +-- CCOLAMD library: /home/faculty/d/davis/dev2/SuiteSparse/CCOLAMD/build/libccolamd.so.3.2.0 +-- CCOLAMD static: /home/faculty/d/davis/dev2/SuiteSparse/CCOLAMD/build/libccolamd.a +-- SuiteSparse_GPURuntime version: 3.2.0 +-- SuiteSparse_GPURuntime include: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_GPURuntime/Include +-- SuiteSparse_GPURuntime library: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_GPURuntime/build/libsuitesparse_gpuruntime.so.3.2.0 +-- SuiteSparse_GPURuntime static: /home/faculty/d/davis/dev2/SuiteSparse/SuiteSparse_GPURuntime/build/libsuitesparse_gpuruntime.a +-- GPUQREngine version: 3.2.0 +-- GPUQREngine include: /home/faculty/d/davis/dev2/SuiteSparse/GPUQREngine/Include +-- GPUQREngine library: /home/faculty/d/davis/dev2/SuiteSparse/GPUQREngine/build/libgpuqrengine.so.3.2.0 +-- GPUQREngine static: /home/faculty/d/davis/dev2/SuiteSparse/GPUQREngine/build/libgpuqrengine.a +-- CHOLMOD_CUDA version: 4.2.0 +-- CHOLMOD_CUDA library: /home/faculty/d/davis/dev2/SuiteSparse/CHOLMOD/build/GPU/libcholmod_cuda.so.4.2.0 +-- CHOLMOD_CUDA static: /home/faculty/d/davis/dev2/SuiteSparse/CHOLMOD/build/GPU/libcholmod_cuda.a +-- Looking for Intel 32-bit BLAS +-- Found Intel10_64lp 32-bit BLAS +-- Building SPQR_CUDA version: v4.2.0 (Sept 8, 2023) +-- Source: /home/faculty/d/davis/dev2/SuiteSparse/SPQR +-- Build: /home/faculty/d/davis/dev2/SuiteSparse/SPQR/build +-- Install lib: /home/faculty/d/davis/dev2/SuiteSparse/lib +-- Install include: /home/faculty/d/davis/dev2/SuiteSparse/include +-- Install bin: /home/faculty/d/davis/dev2/SuiteSparse/bin +-- Install rpath: /home/faculty/d/davis/dev2/SuiteSparse/lib;/home/faculty/d/davis/dev2/SuiteSparse/lib +-- Build rpath: /home/faculty/d/davis/dev2/SuiteSparse/SPQR/build;/home/faculty/d/davis/dev2/SuiteSparse/lib;/home/faculty/d/davis/dev2/SuiteSparse/SPQR/build;/home/faculty/d/davis/dev2/SuiteSparse/lib +-- Build type: Release +-- Fortran: /usr/bin/f95 +-- Looking for CUDA +-- Find CUDA tool kit: +-- Found CUDAToolkit: /usr/local/cuda/include (found version "11.7.99") +-- CUDA toolkit found: TRUE +-- CUDA toolkit version: 11.7.99 +-- CUDA toolkit include: /usr/local/cuda/include +-- CUDA toolkit lib dir: /usr/local/cuda/lib64 +-- CUDA: enabled +-- C++ flags for CUDA: +-- LAPACK libraries: /usr/lib/x86_64-linux-gnu/libmkl_gf_lp64.so;/usr/lib/x86_64-linux-gnu/libmkl_gnu_thread.so;/usr/lib/x86_64-linux-gnu/libmkl_core.so;/usr/lib/gcc/x86_64-linux-gnu/9/libgomp.so;-lpthread;-lm;-ldl;-lpthread;-lm;-ldl +-- LAPACK include: +-- LAPACK linker flags: +-- BLAS libraries: /usr/lib/x86_64-linux-gnu/libmkl_gf_lp64.so;/usr/lib/x86_64-linux-gnu/libmkl_gnu_thread.so;/usr/lib/x86_64-linux-gnu/libmkl_core.so;/usr/lib/gcc/x86_64-linux-gnu/9/libgomp.so;-lpthread;-lm;-ldl +-- BLAS include: +-- BLAS linker flags: +-- Also compiling the demos in SPQR/Demo +-- ------------------------------------------------------------------------ +-- SuiteSparse CMAKE report for: spqr +-- ------------------------------------------------------------------------ +-- inside common SuiteSparse root: true +-- install in SuiteSparse/lib and SuiteSparse/include: 1 +-- build type: Release +-- NSTATIC: false (build static library) +-- use OpenMP: no +-- C compiler: /usr/bin/cc +-- C flags: +-- C++ compiler: /usr/bin/c++ +-- C++ flags: +-- C Flags release: -O3 -DNDEBUG +-- C++ Flags release: -O3 -DNDEBUG +-- Fortran compiler: /usr/bin/f95 +-- compile definitions: SUITESPARSE_CUDA;BLAS_Intel10_64lp +-- BLAS integer: int32_t +-- CUDA architectures: 52;75;80 +-- ------------------------------------------------------------------------ +-- Configuring done (0.5s) +-- Generating done (0.1s) +-- Build files have been written to: /home/faculty/d/davis/dev2/SuiteSparse/SPQR/build +gmake[1]: Entering directory '/home/faculty/d/davis/dev2/SuiteSparse/SPQR/build' +[ 4%] Built target SPQR_CUDA_static +[ 7%] Built target SPQR_CUDA +[ 80%] Built target SPQR +[ 82%] Built target SPQR_static +[ 83%] Built target qrdemoc +[ 85%] Built target qrsimple +[ 86%] Built target qrdemo_gpu +[ 88%] Built target qrsimplec +[ 90%] Built target qrsimplec_int32 +[ 92%] Built target qrdemo_int32 +[ 94%] Built target qrdemo +[ 96%] Built target qrdemoc_int32 +[ 98%] Built target qrdemo_gpu2 +[100%] Built target qrdemo_gpu3 +gmake[1]: Leaving directory '/home/faculty/d/davis/dev2/SuiteSparse/SPQR/build' +./build/qrdemo_int32 < Matrix/a00.mtx +Matrix 0-by-0 nnz: 0 +relative norm(Ax-b): 0.0e+00 rank: 0 rel. norm(A'(Ax-b)) 0.0e+00 +relative norm(Ax-b): 0.0e+00 rank: 0 rel. norm(A'(Ax-b)) 0.0e+00 +relative norm(Ax-b): 0.0e+00 rank: 0 rel. norm(A'(Ax-b)) 0.0e+00 +./build/qrdemo_int32 < Matrix/a01.mtx +Matrix 0-by-1 nnz: 0 +relative norm(Ax-b): 0.0e+00 rank: 0 rel. norm(A'(Ax-b)) 0.0e+00 +relative norm(Ax-b): 0.0e+00 rank: 0 rel. norm(A'(Ax-b)) 0.0e+00 +relative norm(Ax-b): 0.0e+00 rank: 0 rel. norm(A'(Ax-b)) 0.0e+00 +./build/qrdemo_int32 < Matrix/a10.mtx +Matrix 1-by-0 nnz: 0 +relative norm(Ax-b): 1.0e+00 rank: 0 rel. norm(A'(Ax-b)) 0.0e+00 +relative norm(Ax-b): 1.0e+00 rank: 0 rel. norm(A'(Ax-b)) 0.0e+00 +relative norm(Ax-b): 0.0e+00 rank: 0 rel. norm(A'(Ax-b)) 0.0e+00 +./build/qrsimplec_int32 < Matrix/ash219.mtx +2-norm of residual: 3.5e-15 +rank 85 +./build/qrsimplec_int32 < Matrix/west0067.mtx +2-norm of residual: 1.0e-14 +rank 67 +./build/qrdemo_int32 < Matrix/a2.mtx +Matrix 2-by-2 nnz: 3 +relative norm(Ax-b): 0.0e+00 rank: 2 rel. norm(A'(Ax-b)) 0.0e+00 +relative norm(Ax-b): 0.0e+00 rank: 2 rel. norm(A'(Ax-b)) 0.0e+00 +relative norm(Ax-b): 0.0e+00 rank: 2 rel. norm(A'(Ax-b)) 0.0e+00 +./build/qrdemo_int32 < Matrix/r2.mtx +Matrix 2-by-3 nnz: 4 +relative norm(Ax-b): 0.0e+00 rank: 2 rel. norm(A'(Ax-b)) 0.0e+00 +relative norm(Ax-b): 0.0e+00 rank: 2 rel. norm(A'(Ax-b)) 0.0e+00 +relative norm(Ax-b): 0.0e+00 rank: 2 rel. norm(A'(Ax-b)) 0.0e+00 +./build/qrdemo_int32 < Matrix/a04.mtx +Matrix 0-by-4 nnz: 0 +relative norm(Ax-b): 0.0e+00 rank: 0 rel. norm(A'(Ax-b)) 0.0e+00 +relative norm(Ax-b): 0.0e+00 rank: 0 rel. norm(A'(Ax-b)) 0.0e+00 +relative norm(Ax-b): 0.0e+00 rank: 0 rel. norm(A'(Ax-b)) 0.0e+00 +./build/qrdemo_int32 < Matrix/a2.mtx +Matrix 2-by-2 nnz: 3 +relative norm(Ax-b): 0.0e+00 rank: 2 rel. norm(A'(Ax-b)) 0.0e+00 +relative norm(Ax-b): 0.0e+00 rank: 2 rel. norm(A'(Ax-b)) 0.0e+00 +relative norm(Ax-b): 0.0e+00 rank: 2 rel. norm(A'(Ax-b)) 0.0e+00 +./build/qrdemo_int32 < Matrix/west0067.mtx +Matrix 67-by-67 nnz: 294 +relative norm(Ax-b): 6.3e-17 rank: 67 rel. norm(A'(Ax-b)) 2.5e-15 +relative norm(Ax-b): 5.8e-17 rank: 67 rel. norm(A'(Ax-b)) 2.2e-15 +relative norm(Ax-b): 4.4e-17 rank: 67 rel. norm(A'(Ax-b)) 1.0e-13 +./build/qrdemo_int32 < Matrix/c2.mtx +Matrix 2-by-2 nnz: 4 +relative norm(Ax-b): 1.7e-16 rank: 2 rel. norm(A'(Ax-b)) 8.1e-15 +./build/qrdemo_int32 < Matrix/a0.mtx +Matrix 0-by-0 nnz: 0 +relative norm(Ax-b): 0.0e+00 rank: 0 rel. norm(A'(Ax-b)) 0.0e+00 +relative norm(Ax-b): 0.0e+00 rank: 0 rel. norm(A'(Ax-b)) 0.0e+00 +relative norm(Ax-b): 0.0e+00 rank: 0 rel. norm(A'(Ax-b)) 0.0e+00 +./build/qrdemo_int32 < Matrix/lfat5b.mtx +Matrix 14-by-14 nnz: 46 +relative norm(Ax-b): 8.3e-17 rank: 14 rel. norm(A'(Ax-b)) 2.6e-16 +relative norm(Ax-b): 1.1e-16 rank: 14 rel. norm(A'(Ax-b)) 2.9e-16 +relative norm(Ax-b): 4.1e-17 rank: 14 rel. norm(A'(Ax-b)) 4.7e-15 +./build/qrdemo_int32 < Matrix/bfwa62.mtx +Matrix 62-by-62 nnz: 450 +relative norm(Ax-b): 5.4e-17 rank: 62 rel. norm(A'(Ax-b)) 3.7e-14 +relative norm(Ax-b): 5.9e-17 rank: 62 rel. norm(A'(Ax-b)) 4.3e-14 +relative norm(Ax-b): 5.3e-17 rank: 62 rel. norm(A'(Ax-b)) 8.7e-13 +./build/qrdemo_int32 < Matrix/LFAT5.mtx +Matrix 14-by-14 nnz: 46 +relative norm(Ax-b): 4.9e-22 rank: 14 rel. norm(A'(Ax-b)) 6.6e-16 +relative norm(Ax-b): 5.0e-22 rank: 14 rel. norm(A'(Ax-b)) 6.6e-16 +relative norm(Ax-b): 3.4e-21 rank: 14 rel. norm(A'(Ax-b)) 1.9e-15 +./build/qrdemo_int32 < Matrix/b1_ss.mtx +Matrix 7-by-7 nnz: 15 +relative norm(Ax-b): 8.3e-18 rank: 7 rel. norm(A'(Ax-b)) 1.4e-15 +relative norm(Ax-b): 1.0e-17 rank: 7 rel. norm(A'(Ax-b)) 1.9e-15 +relative norm(Ax-b): 5.1e-17 rank: 7 rel. norm(A'(Ax-b)) 3.1e-15 +./build/qrdemo_int32 < Matrix/bcspwr01.mtx +Matrix 39-by-39 nnz: 131 +relative norm(Ax-b): 4.8e-17 rank: 39 rel. norm(A'(Ax-b)) 4.4e-16 +relative norm(Ax-b): 7.4e-17 rank: 39 rel. norm(A'(Ax-b)) 6.8e-16 +relative norm(Ax-b): 7.1e-17 rank: 39 rel. norm(A'(Ax-b)) 3.3e-14 +./build/qrdemo_int32 < Matrix/lpi_galenet.mtx +Matrix 8-by-14 nnz: 22 +relative norm(Ax-b): 0.0e+00 rank: 8 rel. norm(A'(Ax-b)) 0.0e+00 +relative norm(Ax-b): 0.0e+00 rank: 8 rel. norm(A'(Ax-b)) 0.0e+00 +relative norm(Ax-b): 0.0e+00 rank: 8 rel. norm(A'(Ax-b)) 0.0e+00 +./build/qrdemo_int32 < Matrix/lpi_itest6.mtx +Matrix 11-by-17 nnz: 29 +relative norm(Ax-b): 0.0e+00 rank: 11 rel. norm(A'(Ax-b)) 0.0e+00 +relative norm(Ax-b): 0.0e+00 rank: 11 rel. norm(A'(Ax-b)) 0.0e+00 +relative norm(Ax-b): 0.0e+00 rank: 11 rel. norm(A'(Ax-b)) 0.0e+00 +./build/qrdemo_int32 < Matrix/ash219.mtx +Matrix 219-by-85 nnz: 438 +relative norm(Ax-b): 3.5e-15 rank: 85 rel. norm(A'(Ax-b)) 9.4e-16 +relative norm(Ax-b): 4.4e-15 rank: 85 rel. norm(A'(Ax-b)) 1.2e-15 +relative norm(Ax-b): 1.7e+02 rank: 85 rel. norm(A'(Ax-b)) 1.4e-13 +./build/qrdemo_int32 < Matrix/a4.mtx +Matrix 4-by-2 nnz: 4 +relative norm(Ax-b): 1.4e+00 rank: 2 rel. norm(A'(Ax-b)) 2.6e-16 +relative norm(Ax-b): 1.4e+00 rank: 2 rel. norm(A'(Ax-b)) 2.6e-16 +relative norm(Ax-b): 3.6e+00 rank: 2 rel. norm(A'(Ax-b)) 2.1e-16 +./build/qrdemo_int32 < Matrix/s32.mtx +Matrix 3-by-2 nnz: 6 +relative norm(Ax-b): 1.1e-02 rank: 2 rel. norm(A'(Ax-b)) 8.7e-17 +relative norm(Ax-b): 1.1e-02 rank: 2 rel. norm(A'(Ax-b)) 8.7e-17 +relative norm(Ax-b): 1.4e-02 rank: 2 rel. norm(A'(Ax-b)) 3.0e-16 +./build/qrdemo_int32 < Matrix/c32.mtx +Matrix 3-by-2 nnz: 6 +relative norm(Ax-b): 1.9e-01 rank: 2 rel. norm(A'(Ax-b)) 6.5e-16 +./build/qrdemo_int32 < Matrix/lp_share1b.mtx +Matrix 117-by-253 nnz: 1179 +relative norm(Ax-b): 1.1e-19 rank: 117 rel. norm(A'(Ax-b)) 9.8e-12 +relative norm(Ax-b): 1.1e-19 rank: 117 rel. norm(A'(Ax-b)) 1.0e-11 +relative norm(Ax-b): 1.2e-19 rank: 117 rel. norm(A'(Ax-b)) 2.3e-10 +./build/qrdemo_int32 < Matrix/a1.mtx +Matrix 4-by-4 nnz: 7 +relative norm(Ax-b): 6.1e-01 rank: 2 rel. norm(A'(Ax-b)) 0.0e+00 +relative norm(Ax-b): 6.1e-01 rank: 2 rel. norm(A'(Ax-b)) 0.0e+00 +relative norm(Ax-b): 1.4e+00 rank: 2 rel. norm(A'(Ax-b)) 0.0e+00 +./build/qrdemo_int32 < Matrix/GD06_theory.mtx +Matrix 101-by-101 nnz: 380 +relative norm(Ax-b): 7.2e-02 rank: 20 rel. norm(A'(Ax-b)) 5.3e-16 +relative norm(Ax-b): 7.2e-02 rank: 20 rel. norm(A'(Ax-b)) 5.2e-16 +relative norm(Ax-b): 7.3e-02 rank: 20 rel. norm(A'(Ax-b)) 3.0e-14 +./build/qrdemo_int32 < Matrix/GD01_b.mtx +Matrix 18-by-18 nnz: 37 +relative norm(Ax-b): 7.1e-17 rank: 17 rel. norm(A'(Ax-b)) 2.6e-16 +relative norm(Ax-b): 1.3e-16 rank: 17 rel. norm(A'(Ax-b)) 4.1e-16 +relative norm(Ax-b): 9.9e-03 rank: 17 rel. norm(A'(Ax-b)) 4.0e-15 +./build/qrdemo_int32 < Matrix/Tina_AskCal_perm.mtx +Matrix 11-by-11 nnz: 29 +relative norm(Ax-b): 7.9e-18 rank: 9 rel. norm(A'(Ax-b)) 4.5e-17 +relative norm(Ax-b): 2.2e-17 rank: 9 rel. norm(A'(Ax-b)) 9.0e-17 +relative norm(Ax-b): 1.7e-02 rank: 9 rel. norm(A'(Ax-b)) 0.0e+00 +./build/qrdemo_int32 < Matrix/Tina_AskCal.mtx +Matrix 11-by-11 nnz: 29 +relative norm(Ax-b): 5.6e-18 rank: 9 rel. norm(A'(Ax-b)) 2.2e-17 +relative norm(Ax-b): 2.2e-17 rank: 9 rel. norm(A'(Ax-b)) 9.0e-17 +relative norm(Ax-b): 3.1e-02 rank: 9 rel. norm(A'(Ax-b)) 3.5e-16 +./build/qrdemo_int32 < Matrix/GD98_a.mtx +Matrix 38-by-38 nnz: 50 +relative norm(Ax-b): 2.4e-01 rank: 14 rel. norm(A'(Ax-b)) 3.2e-17 +relative norm(Ax-b): 2.4e-01 rank: 14 rel. norm(A'(Ax-b)) 3.2e-17 +relative norm(Ax-b): 2.2e-01 rank: 14 rel. norm(A'(Ax-b)) 1.6e-15 +./build/qrdemo_int32 < Matrix/Ragusa16.mtx +Matrix 24-by-24 nnz: 81 +relative norm(Ax-b): 2.1e-02 rank: 18 rel. norm(A'(Ax-b)) 1.5e-16 +relative norm(Ax-b): 2.1e-02 rank: 18 rel. norm(A'(Ax-b)) 1.2e-16 +relative norm(Ax-b): 1.5e-02 rank: 18 rel. norm(A'(Ax-b)) 4.3e-15 +./build/qrdemo_int32 < Matrix/young1c.mtx +Matrix 841-by-841 nnz: 4089 +relative norm(Ax-b): 1.8e-16 rank: 841 rel. norm(A'(Ax-b)) 7.1e-14 +./build/qrdemo_int32 < Matrix/lp_e226_transposed.mtx +Matrix 472-by-223 nnz: 2768 +relative norm(Ax-b): 9.2e+00 rank: 223 rel. norm(A'(Ax-b)) 1.5e-13 +relative norm(Ax-b): 9.2e+00 rank: 223 rel. norm(A'(Ax-b)) 1.5e-13 +relative norm(Ax-b): 2.0e+03 rank: 223 rel. norm(A'(Ax-b)) 2.1e-11 +./build/qrdemoc_int32 < Matrix/a2.mtx +Matrix 2-by-2 nnz: 3 residual: 0.0e+00 rank: 2 +./build/qrdemoc_int32 < Matrix/r2.mtx +Matrix 2-by-3 nnz: 4 residual: 0.0e+00 rank: 2 +./build/qrdemoc_int32 < Matrix/a04.mtx +Matrix 0-by-4 nnz: 0 residual: 0.0e+00 rank: 0 +./build/qrdemoc_int32 < Matrix/a2.mtx +Matrix 2-by-2 nnz: 3 residual: 0.0e+00 rank: 2 +./build/qrdemoc_int32 < Matrix/west0067.mtx +Matrix 67-by-67 nnz: 294 residual: 6.3e-17 rank: 67 +./build/qrdemoc_int32 < Matrix/c2.mtx +Matrix 2-by-2 nnz: 4 residual: 1.7e-16 rank: 2 +./build/qrdemoc_int32 < Matrix/a0.mtx +Matrix 0-by-0 nnz: 0 residual: 0.0e+00 rank: 0 +./build/qrdemoc_int32 < Matrix/lfat5b.mtx +Matrix 14-by-14 nnz: 46 residual: 8.3e-17 rank: 14 +./build/qrdemoc_int32 < Matrix/bfwa62.mtx +Matrix 62-by-62 nnz: 450 residual: 5.4e-17 rank: 62 +./build/qrdemoc_int32 < Matrix/LFAT5.mtx +Matrix 14-by-14 nnz: 46 residual: 4.9e-22 rank: 14 +./build/qrdemoc_int32 < Matrix/b1_ss.mtx +Matrix 7-by-7 nnz: 15 residual: 8.3e-18 rank: 7 +./build/qrdemoc_int32 < Matrix/bcspwr01.mtx +Matrix 39-by-39 nnz: 131 residual: 4.8e-17 rank: 39 +./build/qrdemoc_int32 < Matrix/lpi_galenet.mtx +Matrix 8-by-14 nnz: 22 residual: 0.0e+00 rank: 8 +./build/qrdemoc_int32 < Matrix/lpi_itest6.mtx +Matrix 11-by-17 nnz: 29 residual: 0.0e+00 rank: 11 +./build/qrdemoc_int32 < Matrix/ash219.mtx +Matrix 219-by-85 nnz: 438 residual: 3.5e-15 rank: 85 +./build/qrdemoc_int32 < Matrix/a4.mtx +Matrix 4-by-2 nnz: 4 residual: 1.4e+00 rank: 2 +./build/qrdemoc_int32 < Matrix/s32.mtx +Matrix 3-by-2 nnz: 6 residual: 1.1e-02 rank: 2 +./build/qrdemoc_int32 < Matrix/c32.mtx +Matrix 3-by-2 nnz: 6 residual: 1.9e-01 rank: 2 +./build/qrdemoc_int32 < Matrix/lp_share1b.mtx +Matrix 117-by-253 nnz: 1179 residual: 1.1e-19 rank: 117 +./build/qrdemoc_int32 < Matrix/a1.mtx +Matrix 4-by-4 nnz: 7 residual: 6.1e-01 rank: 2 +./build/qrdemoc_int32 < Matrix/GD06_theory.mtx +Matrix 101-by-101 nnz: 380 residual: 7.2e-02 rank: 20 +./build/qrdemoc_int32 < Matrix/GD01_b.mtx +Matrix 18-by-18 nnz: 37 residual: 7.1e-17 rank: 17 +./build/qrdemoc_int32 < Matrix/Tina_AskCal_perm.mtx +Matrix 11-by-11 nnz: 29 residual: 7.9e-18 rank: 9 +./build/qrdemoc_int32 < Matrix/Tina_AskCal.mtx +Matrix 11-by-11 nnz: 29 residual: 5.6e-18 rank: 9 +./build/qrdemoc_int32 < Matrix/GD98_a.mtx +Matrix 38-by-38 nnz: 50 residual: 2.4e-01 rank: 14 +./build/qrdemoc_int32 < Matrix/Ragusa16.mtx +Matrix 24-by-24 nnz: 81 residual: 2.1e-02 rank: 18 +./build/qrdemoc_int32 < Matrix/young1c.mtx +Matrix 841-by-841 nnz: 4089 residual: 1.8e-16 rank: 841 +./build/qrdemoc_int32 < Matrix/lp_e226_transposed.mtx +Matrix 472-by-223 nnz: 2768 residual: 9.2e+00 rank: 223 diff --git a/SPQR/Doc/ChangeLog b/SPQR/Doc/ChangeLog index 9d5fd0970..ae6891114 100644 --- a/SPQR/Doc/ChangeLog +++ b/SPQR/Doc/ChangeLog @@ -1,3 +1,8 @@ +Sept 8, 2023: version 4.2.0 + + * cmake updates: SuiteSparse:: namespace by Markus Muetzel + * 32-bit version added: by Raye Kimmerer + June 16, 2023: version 3.0.4 * build system updates: updates from Markus Muetzel diff --git a/SPQR/Doc/spqr_user_guide.pdf b/SPQR/Doc/spqr_user_guide.pdf index dfd28889c..407e5855e 100644 Binary files a/SPQR/Doc/spqr_user_guide.pdf and b/SPQR/Doc/spqr_user_guide.pdf differ diff --git a/SPQR/Doc/spqr_user_guide.tex b/SPQR/Doc/spqr_user_guide.tex index 94d793c98..6a9c02a32 100644 --- a/SPQR/Doc/spqr_user_guide.tex +++ b/SPQR/Doc/spqr_user_guide.tex @@ -61,13 +61,13 @@ \section{Introduction} \cite{Davis08b}. This document gives detailed information on the installation and use of SuiteSparseQR. -SPQR, Copyright (c) 2008-2022, Timothy A Davis. All Rights Reserved. +SPQR, Copyright (c) 2008-2023, Timothy A Davis. All Rights Reserved. SPDX-License-Identifier: GPL-2.0+ The GPU modules in SPQRGPU are under a different copyright: - SPQRGPU, Copyright (c) 2008-2022, Timothy A Davis, Sanjay Ranka, + SPQRGPU, Copyright (c) 2008-2023, Timothy A Davis, Sanjay Ranka, Sencer Nuri Yeralan, and Wissam Sid-Lakhdar, All Rights Reserved. %------------------------------------------------------------------------------- @@ -433,7 +433,8 @@ \subsection{C/C++ Example} \end{verbatim} } -Below is a simple C++ program that illustrates the use of SuiteSparseQR. The +Below is a simple C++ program that illustrates the use of SuiteSparseQR +(with 64-bit integer indices). The program reads in a least-squares problem from \verb'stdin' in MatrixMarket format \cite{BoisvertPozoRemingtonBarrettDongarra97}, solves it, and prints the norm of the residual and the estimated rank of \verb'A'. The comments reflect @@ -483,6 +484,16 @@ \subsection{C/C++ Example} \end{verbatim} } +To use SuiteSparseQR with 32-bit integer indices in all of its matrices, +simply replace all \verb'cholmod_l_*' calls abovce to \verb'cholmod_*', +and use this for SPQR: + +{\footnotesize +\begin{verbatim} + X = SuiteSparseQR (A, B, cc) ; +\end{verbatim} +} + %------------------------------------------------------------------------------- \subsection{C++ Syntax} %------------------------------------------------------------------------------- @@ -558,15 +569,17 @@ \subsection{Details of the C/C++ Syntax} \end{enumerate} -Most of the packages in SuiteSparse come in multiple versions with different -sized integers: \verb'int32_t' and \verb'int64_t'. -By contrast, SuiteSparseQR only provides a \verb'int64_t' version. +Version 4.0 of SuiteSparseQR adds a 32-bit version, where the indices of its +sparse matrices are all \verb'int32_t', contributed by Raye Kimmerer. To use +this version, add \verb'int32_t' as the second template parameter to all C++ +methods, and use the \verb'cholmod_*' methods instead of \verb'cholmod_l_*' +to create and access its input/output matrices. The C/C++ options corresponding to the MATLAB \verb'opts' parameters and the contents of the optional \verb'info' output of \verb'spqr_solve' are described below. Let \verb'cc' be the CHOLMOD \verb'Common' object, containing parameter settings and statistics. All are of type \verb'double', except for -\verb'SPQR_istat' which is \verb'inte64_t', +\verb'SPQR_istat' which is \verb'int64_t', \verb'cc->memory_usage' which is \verb'size_t', and \verb'cc->SPQR_nthreads' which is \verb'int'. Parameters include: diff --git a/SPQR/Doc/spqr_version.tex b/SPQR/Doc/spqr_version.tex index 749eb297a..a9068b56f 100644 --- a/SPQR/Doc/spqr_version.tex +++ b/SPQR/Doc/spqr_version.tex @@ -1,2 +1,2 @@ % version of SuiteSparse/SPQR -\date{VERSION 3.0.4, June 16, 2023} +\date{VERSION 4.2.0, Sept 8, 2023} diff --git a/SPQR/Include/SuiteSparseQR.hpp b/SPQR/Include/SuiteSparseQR.hpp index 5f3b2575e..cae89825f 100644 --- a/SPQR/Include/SuiteSparseQR.hpp +++ b/SPQR/Include/SuiteSparseQR.hpp @@ -25,29 +25,38 @@ extern "C" } #undef SUITESPARSE_GPU_EXTERN_ON +#include +typedef std::complex Complex ; + // ============================================================================= // === spqr_gpu ================================================================ // ============================================================================= -struct spqr_gpu +template struct spqr_gpu_impl { - int64_t *RimapOffsets; // Stores front offsets into Rimap - int64_t RimapSize; // Allocated space for in Rimap + Int *RimapOffsets; // Stores front offsets into Rimap + Int RimapSize; // Allocated space for in Rimap - int64_t *RjmapOffsets; // Stores front offsets into Rjmap - int64_t RjmapSize; // Allocated space for Rjmap + Int *RjmapOffsets; // Stores front offsets into Rjmap + Int RjmapSize; // Allocated space for Rjmap - int64_t numStages; // # of Stages required to factorize - int64_t *Stagingp; // Pointers into Post for boundaries - int64_t *StageMap; // Mapping of front to stage # + Int numStages; // # of Stages required to factorize + Int *Stagingp; // Pointers into Post for boundaries + Int *StageMap; // Mapping of front to stage # size_t *FSize; // Total size of fronts in a stage size_t *RSize; // Total size of R+C for a stage size_t *SSize; // Total size of S for a stage - int64_t *FOffsets; // F Offsets relative to a base - int64_t *ROffsets; // R Offsets relative to a base - int64_t *SOffsets; // S Offsets relative to a base + Int *FOffsets; // F Offsets relative to a base + Int *ROffsets; // R Offsets relative to a base + Int *SOffsets; // S Offsets relative to a base }; +extern template struct spqr_gpu_impl ; +extern template struct spqr_gpu_impl ; + +typedef spqr_gpu_impl spqr_int_gpu ; +typedef spqr_gpu_impl spqr_gpu ; + // ============================================================================= // === spqr_symbolic =========================================================== // ============================================================================= @@ -64,7 +73,7 @@ struct spqr_gpu // number of column indices used to represent the supernodal form of R (one // int64_t per non-pivotal column index in the leading row of each block of R). -struct spqr_symbolic +template struct spqr_symbolic { // ------------------------------------------------------------------------- @@ -79,20 +88,20 @@ struct spqr_symbolic // indices in each row of S are in strictly ascending order, even though // the input matrix A need not be sorted. - int64_t m, n, anz ; // S is m-by-n with anz entries + Int m, n, anz ; // S is m-by-n with anz entries - int64_t *Sp ; // size m+1, row pointers of S + Int *Sp ; // size m+1, row pointers of S - int64_t *Sj ; // size anz = Sp [n], column indices of S + Int *Sj ; // size anz = Sp [n], column indices of S - int64_t *Qfill ; // size n, fill-reducing column permutation. + Int *Qfill ; // size n, fill-reducing column permutation. // Qfill [k] = j if column k of A is column j of S. - int64_t *PLinv ; // size m, inverse row permutation that places + Int *PLinv ; // size m, inverse row permutation that places // S=A(P,Q) in increasing order of leftmost column // index. PLinv [i] = k if row i of A is row k of S. - int64_t *Sleft ; // size n+2. The list of rows of S whose + Int *Sleft ; // size n+2. The list of rows of S whose // leftmost column index is j is given by // Sleft [j] ... Sleft [j+1]-1. This can be empty (that is, Sleft // [j] can equal Sleft [j+1]). Sleft [n] is the number of @@ -112,13 +121,13 @@ struct spqr_symbolic // vectors are kept, the row indices are computed dynamically during // numerical factorization. - int64_t nf ; // number of frontal matrices; nf <= MIN (m,n) - int64_t maxfn ; // max # of columns in any front + Int nf ; // number of frontal matrices; nf <= MIN (m,n) + Int maxfn ; // max # of columns in any front // parent, child, and childp define the row merge tree or etree (A'A) - int64_t *Parent ; // size nf+1 - int64_t *Child ; // size nf+1 - int64_t *Childp ; // size nf+2 + Int *Parent ; // size nf+1 + Int *Child ; // size nf+1 + Int *Childp ; // size nf+2 // The parent of a front f is Parent [f], or EMPTY if f=nf. // A list of children of f can be obtained in the list @@ -129,29 +138,29 @@ struct spqr_symbolic // placeholder node nf as their parent. Thus, the tree of nodes 0:nf is // truly a tree, with just one parent (node nf). - int64_t *Super ; // size nf+1. Super [f] gives the first + Int *Super ; // size nf+1. Super [f] gives the first // pivot column in the front F. This refers to a column of S. The // number of expected pivot columns in F is thus // Super [f+1] - Super [f]. - int64_t *Rp ; // size nf+1 - int64_t *Rj ; // size rjsize; compressed supernodal form of R + Int *Rp ; // size nf+1 + Int *Rj ; // size rjsize; compressed supernodal form of R - int64_t *Post ; // size nf+1, post ordering of frontal tree. + Int *Post ; // size nf+1, post ordering of frontal tree. // f=Post[k] gives the kth node in the postordered tree - int64_t rjsize ; // size of Rj + Int rjsize ; // size of Rj - int64_t do_rank_detection ; // TRUE: allow for tol >= 0. + Int do_rank_detection ; // TRUE: allow for tol >= 0. // FALSE: ignore tol // the rest depends on whether or not rank-detection is allowed: - int64_t maxstack ; // max stack size (sequential case) - int64_t hisize ; // size of Hii + Int maxstack ; // max stack size (sequential case) + Int hisize ; // size of Hii - int64_t keepH ; // TRUE if H is present + Int keepH ; // TRUE if H is present - int64_t *Hip ; // size nf+1. If H is kept, the row indices + Int *Hip ; // size nf+1. If H is kept, the row indices // of frontal matrix f are in Hii [Hip [f] ... Hip [f] + Hm [f]], // where Hii and Hm are stored in the numeric object. @@ -164,39 +173,39 @@ struct spqr_symbolic // The number of columns in the contribution block C is always // cn = fn - fp, where fn = Rp [f+1] - Rp [f]. - int64_t ntasks ; // number of tasks in task graph - int64_t ns ; // number of stacks + Int ntasks ; // number of tasks in task graph + Int ns ; // number of stacks // ------------------------------------------------------------------------- // the rest of the QR symbolic object is present only if ntasks > 1 // ------------------------------------------------------------------------- // Task tree (nodes 0:ntasks), including placeholder node - int64_t *TaskChildp ; // size ntasks+2 - int64_t *TaskChild ; // size ntasks+1 + Int *TaskChildp ; // size ntasks+2 + Int *TaskChild ; // size ntasks+1 - int64_t *TaskStack ; // size ntasks+1 + Int *TaskStack ; // size ntasks+1 // list of fronts for each task - int64_t *TaskFront ; // size nf+1 - int64_t *TaskFrontp ; // size ntasks+2 + Int *TaskFront ; // size nf+1 + Int *TaskFrontp ; // size ntasks+2 - int64_t *On_stack ; // size nf+1, front f is on + Int *On_stack ; // size nf+1, front f is on // stack On_stack [f] // size of each stack - int64_t *Stack_maxstack ; // size ns+2 + Int *Stack_maxstack ; // size ns+2 // number of rows for each front - int64_t *Fm ; // size nf+1 + Int *Fm ; // size nf+1 // number of rows in the contribution block of each front - int64_t *Cm ; // size nf+1 + Int *Cm ; // size nf+1 // from CHOLMOD's supernodal analysis, needed for GPU factorization size_t maxcsize ; size_t maxesize ; - int64_t *ColCount ; + Int *ColCount ; // int64_t *px ; // ------------------------------------------------------------------------- @@ -208,7 +217,7 @@ struct spqr_symbolic // are requested or if rank detection is requested, then the GPU is // disabled. - spqr_gpu *QRgpu ; + spqr_gpu_impl *QRgpu ; } ; @@ -221,7 +230,7 @@ struct spqr_symbolic // trapezoidal factor R, and optionally the Householder vectors H if they // are kept. -template struct spqr_numeric +template struct spqr_numeric { // ------------------------------------------------------------------------- @@ -240,17 +249,17 @@ template struct spqr_numeric // factorization is complete, only the R and H part at // the head of each stack is left. - int64_t *Stack_size ; // size ns; Stack_size [s] is the size + Int *Stack_size ; // size ns; Stack_size [s] is the size // of Stacks [s] - int64_t hisize ; // size of Hii + Int hisize ; // size of Hii - int64_t n ; // A is m-by-n - int64_t m ; - int64_t nf ; // number of frontal matrices - int64_t ntasks ; // # of tasks in task graph actually used - int64_t ns ; // number of stacks actually used - int64_t maxstack ; // size of sequential stack, if used + Int n ; // A is m-by-n + Int m ; + Int nf ; // number of frontal matrices + Int ntasks ; // # of tasks in task graph actually used + Int ns ; // number of stacks actually used + Int maxstack ; // size of sequential stack, if used // ------------------------------------------------------------------------- // for rank detection and m < n case @@ -261,11 +270,11 @@ template struct spqr_numeric // this is NULL. If m < n, then at least m-n columns // will be dead. - int64_t rank ; // number of live pivot columns - int64_t rank1 ; // number of live pivot columns in first ntol + Int rank ; // number of live pivot columns + Int rank1 ; // number of live pivot columns in first ntol // columns of A - int64_t maxfrank ; // max number of rows in any R block + Int maxfrank ; // max number of rows in any R block double norm_E_fro ; // 2-norm of w, the vector of dead column 2-norms @@ -277,30 +286,34 @@ template struct spqr_numeric // where P_H is the permutation HPinv, and H_1, ... H_s are the Householder // vectors (s = rjsize). - int64_t keepH ; // TRUE if H is present + Int keepH ; // TRUE if H is present - int64_t rjsize ; // size of Hstair and HTau + Int rjsize ; // size of Hstair and HTau - int64_t *HStair ; // size rjsize. The list Hstair [Rp [f] ... + Int *HStair ; // size rjsize. The list Hstair [Rp [f] ... // Rp [f+1]-1] gives the staircase for front F Entry *HTau ; // size rjsize. The list HTau [Rp [f] ... Rp [f+1]-1] // gives the Householder coefficients for front F - int64_t *Hii ; // size hisize, row indices of H. + Int *Hii ; // size hisize, row indices of H. - int64_t *HPinv ; // size m. HPinv [i] = k if row i of A and H + Int *HPinv ; // size m. HPinv [i] = k if row i of A and H // is row k of R. This permutation includes // QRsym->PLinv, and the permutation constructed via // pivotal row ordering during factorization. - int64_t *Hm ; // size nf, Hm [f] = # of rows in front F - int64_t *Hr ; // size nf, Hr [f] = # of rows in R block of + Int *Hm ; // size nf, Hm [f] = # of rows in front F + Int *Hr ; // size nf, Hr [f] = # of rows in R block of // front F - int64_t maxfm ; // max (Hm [0:nf-1]), computed only if H kept + Int maxfm ; // max (Hm [0:nf-1]), computed only if H kept } ; +extern template struct spqr_numeric ; +extern template struct spqr_numeric ; +extern template struct spqr_numeric ; +extern template struct spqr_numeric ; // ============================================================================= // === SuiteSparseQR_factorization ============================================= @@ -309,41 +322,41 @@ template struct spqr_numeric // A combined symbolic+numeric QR factorization of A or [A B], // with singletons -template struct SuiteSparseQR_factorization +template struct SuiteSparseQR_factorization { // QR factorization of A or [A Binput] after singletons have been removed double tol ; // tol used - spqr_symbolic *QRsym ; - spqr_numeric *QRnum ; + spqr_symbolic *QRsym ; + spqr_numeric *QRnum ; // singletons, in compressed-row form; R is n1rows-by-n - int64_t *R1p ; // size n1rows+1 - int64_t *R1j ; + Int *R1p ; // size n1rows+1 + Int *R1j ; Entry *R1x ; - int64_t r1nz ; // nnz (R1) + Int r1nz ; // nnz (R1) // combined singleton and fill-reducing permutation - int64_t *Q1fill ; - int64_t *P1inv ; - int64_t *HP1inv ; // NULL if n1cols == 0, in which case + Int *Q1fill ; + Int *P1inv ; + Int *HP1inv ; // NULL if n1cols == 0, in which case // QRnum->HPinv serves in its place. // Rmap and RmapInv are NULL if QR->rank == A->ncol - int64_t *Rmap ; // size n. Rmap [j] = k if column j of R is + Int *Rmap ; // size n. Rmap [j] = k if column j of R is // the kth live column and where k < QR->rank; // otherwise, if j is a dead column, then // k >= QR->rank. - int64_t *RmapInv ; + Int *RmapInv ; - int64_t n1rows ; // number of singleton rows of [A B] - int64_t n1cols ; // number of singleton columns of [A B] + Int n1rows ; // number of singleton rows of [A B] + Int n1cols ; // number of singleton columns of [A B] - int64_t narows ; // number of rows of A - int64_t nacols ; // number of columns of A - int64_t bncols ; // number of columns of B - int64_t rank ; // rank estimate of A (n1rows + QRnum->rank1), + Int narows ; // number of rows of A + Int nacols ; // number of columns of A + Int bncols ; // number of columns of B + Int rank ; // rank estimate of A (n1rows + QRnum->rank1), // ranges from 0 to min(m,n) int allow_tol ; // if TRUE, do rank detection @@ -358,13 +371,13 @@ template struct SuiteSparseQR_factorization // SuiteSparseQR_qmult Q'*X, Q*X, X*Q', or X*Q for X full or sparse // returns rank(A) estimate, or EMPTY on failure -template int64_t SuiteSparseQR +template Int SuiteSparseQR ( // inputs, not modified int ordering, // all, except 3:given treated as 0:fixed double tol, // only accept singletons above tol - int64_t econ, // number of rows of C and R to return; a value + Int econ, // number of rows of C and R to return; a value // less than the rank r of A is treated as r, and // a value greater than m is treated as m. @@ -386,9 +399,9 @@ template int64_t SuiteSparseQR cholmod_sparse **Zsparse, cholmod_dense **Zdense, cholmod_sparse **R, // the R factor - int64_t **E, // size n; fill-reducing ordering of A. + Int **E, // size n; fill-reducing ordering of A. cholmod_sparse **H, // the Householder vectors (m-by-nh) - int64_t **HPinv,// size m; row permutation for H + Int **HPinv,// size m; row permutation for H cholmod_dense **HTau, // size nh, Householder coefficients // workspace and parameters @@ -396,7 +409,7 @@ template int64_t SuiteSparseQR ) ; // X = A\dense(B) -template cholmod_dense *SuiteSparseQR +template cholmod_dense *SuiteSparseQR ( int ordering, // all, except 3:given treated as 0:fixed double tol, @@ -406,7 +419,7 @@ template cholmod_dense *SuiteSparseQR ) ; // X = A\dense(B) using default ordering and tolerance -template cholmod_dense *SuiteSparseQR +template cholmod_dense *SuiteSparseQR ( cholmod_sparse *A, // m-by-n sparse matrix cholmod_dense *B, // m-by-nrhs @@ -414,7 +427,7 @@ template cholmod_dense *SuiteSparseQR ) ; // X = A\sparse(B) -template cholmod_sparse *SuiteSparseQR +template cholmod_sparse *SuiteSparseQR ( int ordering, // all, except 3:given treated as 0:fixed double tol, @@ -424,79 +437,79 @@ template cholmod_sparse *SuiteSparseQR ) ; // [Q,R,E] = qr(A), returning Q as a sparse matrix -template int64_t SuiteSparseQR +template Int SuiteSparseQR // returns rank(A) estimate ( int ordering, // all, except 3:given treated as 0:fixed double tol, - int64_t econ, + Int econ, cholmod_sparse *A, // m-by-n sparse matrix // outputs cholmod_sparse **Q, // m-by-e sparse matrix where e=max(econ,rank(A)) cholmod_sparse **R, // e-by-n sparse matrix - int64_t **E, // permutation of 0:n-1, NULL if identity + Int **E, // permutation of 0:n-1, NULL if identity cholmod_common *cc // workspace and parameters ) ; // [Q,R,E] = qr(A), discarding Q -template int64_t SuiteSparseQR +template Int SuiteSparseQR // returns rank(A) estimate ( int ordering, // all, except 3:given treated as 0:fixed double tol, - int64_t econ, + Int econ, cholmod_sparse *A, // m-by-n sparse matrix // outputs cholmod_sparse **R, // e-by-n sparse matrix - int64_t **E, // permutation of 0:n-1, NULL if identity + Int **E, // permutation of 0:n-1, NULL if identity cholmod_common *cc // workspace and parameters ) ; // [C,R,E] = qr(A,B), where C and B are dense -template int64_t SuiteSparseQR +template Int SuiteSparseQR ( // inputs, not modified int ordering, // all, except 3:given treated as 0:fixed double tol, // only accept singletons above tol - int64_t econ, // number of rows of C and R to return + Int econ, // number of rows of C and R to return cholmod_sparse *A, // m-by-n sparse matrix cholmod_dense *B, // m-by-nrhs dense matrix // outputs cholmod_dense **C, // C = Q'*B, an e-by-nrhs dense matrix cholmod_sparse **R, // e-by-n sparse matrix where e=max(econ,rank(A)) - int64_t **E, // permutation of 0:n-1, NULL if identity + Int **E, // permutation of 0:n-1, NULL if identity cholmod_common *cc // workspace and parameters ) ; // [C,R,E] = qr(A,B), where C and B are sparse -template int64_t SuiteSparseQR +template Int SuiteSparseQR ( // inputs, not modified int ordering, // all, except 3:given treated as 0:fixed double tol, // only accept singletons above tol - int64_t econ, // number of rows of C and R to return + Int econ, // number of rows of C and R to return cholmod_sparse *A, // m-by-n sparse matrix cholmod_sparse *B, // m-by-nrhs sparse matrix // outputs cholmod_sparse **C, // C = Q'*B, an e-by-nrhs sparse matrix cholmod_sparse **R, // e-by-n sparse matrix where e=max(econ,rank(A)) - int64_t **E, // permutation of 0:n-1, NULL if identity + Int **E, // permutation of 0:n-1, NULL if identity cholmod_common *cc // workspace and parameters ) ; // [Q,R,E] = qr(A) where Q is returned in Householder form -template int64_t SuiteSparseQR +template Int SuiteSparseQR ( // inputs, not modified int ordering, // all, except 3:given treated as 0:fixed double tol, // only accept singletons above tol - int64_t econ, // number of rows of C and R to return + Int econ, // number of rows of C and R to return cholmod_sparse *A, // m-by-n sparse matrix // outputs cholmod_sparse **R, // the R factor - int64_t **E, // permutation of 0:n-1, NULL if identity + Int **E, // permutation of 0:n-1, NULL if identity cholmod_sparse **H, // the Householder vectors (m-by-nh) - int64_t **HPinv,// size m; row permutation for H + Int **HPinv,// size m; row permutation for H cholmod_dense **HTau, // size nh, Householder coefficients cholmod_common *cc // workspace and parameters ) ; @@ -509,26 +522,26 @@ template int64_t SuiteSparseQR // by SuiteSparseQR (... H, HPinv, HTau, cc) above. // returns Y of size m-by-n (NULL on failure) -template cholmod_dense *SuiteSparseQR_qmult +template cholmod_dense *SuiteSparseQR_qmult ( // inputs, no modified int method, // 0,1,2,3 cholmod_sparse *H, // either m-by-nh or n-by-nh cholmod_dense *HTau, // size 1-by-nh - int64_t *HPinv,// size mh + Int *HPinv,// size mh cholmod_dense *Xdense, // size m-by-n // workspace and parameters cholmod_common *cc ) ; -template cholmod_sparse *SuiteSparseQR_qmult +template cholmod_sparse *SuiteSparseQR_qmult ( // inputs, no modified int method, // 0,1,2,3 cholmod_sparse *H, // either m-by-nh or n-by-nh cholmod_dense *HTau, // size 1-by-nh - int64_t *HPinv,// size mh + Int *HPinv,// size mh cholmod_sparse *X, // workspace and parameters @@ -545,8 +558,8 @@ template cholmod_sparse *SuiteSparseQR_qmult // factorization for different right-hand-sides. They also allow the user to // find the minimum 2-norm solution to an undertermined system of equations. -template -SuiteSparseQR_factorization *SuiteSparseQR_factorize +template +SuiteSparseQR_factorization *SuiteSparseQR_factorize ( // inputs, not modified: int ordering, // all, except 3:given treated as 0:fixed @@ -556,57 +569,57 @@ SuiteSparseQR_factorization *SuiteSparseQR_factorize cholmod_common *cc ) ; -template cholmod_dense *SuiteSparseQR_solve // returns X +template cholmod_dense *SuiteSparseQR_solve // returns X ( // inputs, not modified: int system, // which system to solve - SuiteSparseQR_factorization *QR, // of an m-by-n sparse matrix A + SuiteSparseQR_factorization *QR, // of an m-by-n sparse matrix A cholmod_dense *B, // right-hand-side, m-by-nrhs or n-by-nrhs // workspace and parameters cholmod_common *cc ) ; -template cholmod_sparse *SuiteSparseQR_solve // returns X +template cholmod_sparse *SuiteSparseQR_solve // returns X ( // inputs, not modified: int system, // which system to solve (0,1,2,3) - SuiteSparseQR_factorization *QR, // of an m-by-n sparse matrix A + SuiteSparseQR_factorization *QR, // of an m-by-n sparse matrix A cholmod_sparse *Bsparse, // right-hand-side, m-by-nrhs or n-by-nrhs // workspace and parameters cholmod_common *cc ) ; // returns Y of size m-by-n, or NULL on failure -template cholmod_dense *SuiteSparseQR_qmult +template cholmod_dense *SuiteSparseQR_qmult ( // inputs, not modified int method, // 0,1,2,3 (same as SuiteSparseQR_qmult) - SuiteSparseQR_factorization *QR, // of an m-by-n sparse matrix A + SuiteSparseQR_factorization *QR, // of an m-by-n sparse matrix A cholmod_dense *Xdense, // size m-by-n with leading dimension ldx // workspace and parameters cholmod_common *cc ) ; // returns Y of size m-by-n, or NULL on failure -template cholmod_sparse *SuiteSparseQR_qmult +template cholmod_sparse *SuiteSparseQR_qmult ( // inputs, not modified int method, // 0,1,2,3 - SuiteSparseQR_factorization *QR, // of an m-by-n sparse matrix A + SuiteSparseQR_factorization *QR, // of an m-by-n sparse matrix A cholmod_sparse *Xsparse, // size m-by-n // workspace and parameters cholmod_common *cc ) ; // free the QR object -template int SuiteSparseQR_free +template int SuiteSparseQR_free ( - SuiteSparseQR_factorization **QR, // of an m-by-n sparse matrix A + SuiteSparseQR_factorization **QR, // of an m-by-n sparse matrix A cholmod_common *cc ) ; // find the min 2-norm solution to a sparse linear system -template cholmod_dense *SuiteSparseQR_min2norm +template cholmod_dense *SuiteSparseQR_min2norm ( int ordering, // all, except 3:given treated as 0:fixed double tol, @@ -615,7 +628,7 @@ template cholmod_dense *SuiteSparseQR_min2norm cholmod_common *cc ) ; -template cholmod_sparse *SuiteSparseQR_min2norm +template cholmod_sparse *SuiteSparseQR_min2norm ( int ordering, // all, except 3:given treated as 0:fixed double tol, @@ -625,8 +638,8 @@ template cholmod_sparse *SuiteSparseQR_min2norm ) ; // symbolic QR factorization; no singletons exploited -template -SuiteSparseQR_factorization *SuiteSparseQR_symbolic +template +SuiteSparseQR_factorization *SuiteSparseQR_symbolic ( // inputs: int ordering, // all, except 3:given treated as 0:fixed @@ -637,16 +650,53 @@ SuiteSparseQR_factorization *SuiteSparseQR_symbolic ) ; // numeric QR factorization; -template int SuiteSparseQR_numeric +template int SuiteSparseQR_numeric +( + // inputs: + double tol, // treat columns with 2-norm <= tol as zero + cholmod_sparse *A, // sparse matrix to factorize + // input/output + SuiteSparseQR_factorization *QR, + cholmod_common *cc // workspace and parameters +) ; +extern template int SuiteSparseQR_numeric +( + // inputs: + double tol, // treat columns with 2-norm <= tol as zero + cholmod_sparse *A, // sparse matrix to factorize + // input/output + SuiteSparseQR_factorization *QR, + cholmod_common *cc // workspace and parameters +) ; + +extern template int SuiteSparseQR_numeric +( + // inputs: + double tol, // treat columns with 2-norm <= tol as zero + cholmod_sparse *A, // sparse matrix to factorize + // input/output + SuiteSparseQR_factorization *QR, + cholmod_common *cc // workspace and parameters +) ; +extern template int SuiteSparseQR_numeric ( // inputs: double tol, // treat columns with 2-norm <= tol as zero cholmod_sparse *A, // sparse matrix to factorize // input/output - SuiteSparseQR_factorization *QR, + SuiteSparseQR_factorization *QR, cholmod_common *cc // workspace and parameters ) ; +extern template int SuiteSparseQR_numeric +( + // inputs: + double tol, // treat columns with 2-norm <= tol as zero + cholmod_sparse *A, // sparse matrix to factorize + // input/output + SuiteSparseQR_factorization *QR, + cholmod_common *cc // workspace and parameters +) ; #endif #endif diff --git a/SPQR/Include/SuiteSparseQR_C.h b/SPQR/Include/SuiteSparseQR_C.h index 3baf00828..df8559474 100644 --- a/SPQR/Include/SuiteSparseQR_C.h +++ b/SPQR/Include/SuiteSparseQR_C.h @@ -10,21 +10,11 @@ #ifndef SUITESPARSEQR_C_H #define SUITESPARSEQR_C_H -#ifdef __cplusplus -/* If included by a C++ program, the Complex type is std::complex */ -#include -#define Complex std::complex -extern "C" { -#endif - #include "cholmod.h" #include "SuiteSparseQR_definitions.h" -#ifndef __cplusplus -/* The C++ functions will return a pointer to a std::complex array of - size n, which the C code must then interpret as double array of size 2*n, - with real and imaginary parts interleaved. */ -#define Complex double +#ifdef __cplusplus +extern "C" { #endif /* ========================================================================== */ @@ -36,7 +26,7 @@ int64_t SuiteSparseQR_C /* returns rank(A) estimate, (-1) if failure */ /* inputs: */ int ordering, /* all, except 3:given treated as 0:fixed */ double tol, /* columns with 2-norm <= tol treated as 0 */ - int64_t econ, /* e = max(min(m,econ),rank(A)) */ + int64_t econ, /* e = max(min(m,econ),rank(A)) */ int getCTX, /* 0: Z=C (e-by-k), 1: Z=C', 2: Z=X (e-by-k) */ cholmod_sparse *A, /* m-by-n sparse matrix to factorize */ cholmod_sparse *Bsparse, /* sparse m-by-k B */ @@ -45,9 +35,30 @@ int64_t SuiteSparseQR_C /* returns rank(A) estimate, (-1) if failure */ cholmod_sparse **Zsparse, /* sparse Z */ cholmod_dense **Zdense, /* dense Z */ cholmod_sparse **R, /* e-by-n sparse matrix */ - int64_t **E, /* size n column perm, NULL if identity */ + int64_t **E, /* size n column perm, NULL if identity */ cholmod_sparse **H, /* m-by-nh Householder vectors */ - int64_t **HPinv, /* size m row permutation */ + int64_t **HPinv, /* size m row permutation */ + cholmod_dense **HTau, /* 1-by-nh Householder coefficients */ + cholmod_common *cc /* workspace and parameters */ +) ; + +int32_t SuiteSparseQR_i_C /* returns rank(A) estimate, (-1) if failure */ +( + /* inputs: */ + int ordering, /* all, except 3:given treated as 0:fixed */ + double tol, /* columns with 2-norm <= tol treated as 0 */ + int32_t econ, /* e = max(min(m,econ),rank(A)) */ + int getCTX, /* 0: Z=C (e-by-k), 1: Z=C', 2: Z=X (e-by-k) */ + cholmod_sparse *A, /* m-by-n sparse matrix to factorize */ + cholmod_sparse *Bsparse, /* sparse m-by-k B */ + cholmod_dense *Bdense, /* dense m-by-k B */ + /* outputs: */ + cholmod_sparse **Zsparse, /* sparse Z */ + cholmod_dense **Zdense, /* dense Z */ + cholmod_sparse **R, /* e-by-n sparse matrix */ + int32_t **E, /* size n column perm, NULL if identity */ + cholmod_sparse **H, /* m-by-nh Householder vectors */ + int32_t **HPinv, /* size m row permutation */ cholmod_dense **HTau, /* 1-by-nh Householder coefficients */ cholmod_common *cc /* workspace and parameters */ ) ; @@ -62,15 +73,29 @@ int64_t SuiteSparseQR_C_QR /* returns rank(A) est., (-1) if failure */ /* inputs: */ int ordering, /* all, except 3:given treated as 0:fixed */ double tol, /* columns with 2-norm <= tol treated as 0 */ - int64_t econ, /* e = max(min(m,econ),rank(A)) */ + int64_t econ, /* e = max(min(m,econ),rank(A)) */ cholmod_sparse *A, /* m-by-n sparse matrix to factorize */ /* outputs: */ cholmod_sparse **Q, /* m-by-e sparse matrix */ cholmod_sparse **R, /* e-by-n sparse matrix */ - int64_t **E, /* size n column perm, NULL if identity */ + int64_t **E, /* size n column perm, NULL if identity */ cholmod_common *cc /* workspace and parameters */ ) ; +int32_t SuiteSparseQR_i_C_QR // returns rank(A) estimate, (-1) if failure +( + // inputs: + int ordering, // all, except 3:given treated as 0:fixed + double tol, // columns with 2-norm <= tol are treated as 0 + int32_t econ, // e = max(min(m,econ),rank(A)) + cholmod_sparse *A, // m-by-n sparse matrix to factorize + // outputs: + cholmod_sparse **Q, // m-by-e sparse matrix + cholmod_sparse **R, // e-by-n sparse matrix + int32_t **E, // size n column permutation, NULL if identity + cholmod_common *cc // workspace and parameters +); + /* ========================================================================== */ /* === SuiteSparseQR_C_backslash ============================================ */ /* ========================================================================== */ @@ -122,6 +147,7 @@ cholmod_sparse *SuiteSparseQR_C_backslash_sparse /* returns X, or NULL */ typedef struct SuiteSparseQR_C_factorization_struct { int xtype ; /* CHOLMOD_REAL or CHOLMOD_COMPLEX */ + int itype ; void *factors ; /* from SuiteSparseQR_factorize or SuiteSparseQR_factorize */ diff --git a/SPQR/Include/SuiteSparseQR_definitions.h b/SPQR/Include/SuiteSparseQR_definitions.h index 990cbea29..442b04dad 100644 --- a/SPQR/Include/SuiteSparseQR_definitions.h +++ b/SPQR/Include/SuiteSparseQR_definitions.h @@ -62,10 +62,10 @@ #endif */ -#define SPQR_DATE "June 16, 2023" -#define SPQR_MAIN_VERSION 3 -#define SPQR_SUB_VERSION 0 -#define SPQR_SUBSUB_VERSION 4 +#define SPQR_DATE "Sept 8, 2023" +#define SPQR_MAIN_VERSION 4 +#define SPQR_SUB_VERSION 2 +#define SPQR_SUBSUB_VERSION 0 #define SPQR_VER_CODE(main,sub) ((main) * 1000 + (sub)) #define SPQR_VERSION SPQR_VER_CODE(SPQR_MAIN_VERSION,SPQR_SUB_VERSION) diff --git a/SPQR/Include/spqr.hpp b/SPQR/Include/spqr.hpp index 48852ac51..5b62502d9 100644 --- a/SPQR/Include/spqr.hpp +++ b/SPQR/Include/spqr.hpp @@ -17,15 +17,13 @@ #define SUITESPARSE_BLAS_DEFINITIONS #include "SuiteSparseQR.hpp" +#include "spqr_cholmod_wrappers.hpp" #include #include #include #include #include -#include -typedef std::complex Complex ; - // ----------------------------------------------------------------------------- // debugging and printing control // ----------------------------------------------------------------------------- @@ -120,7 +118,7 @@ typedef std::complex Complex ; { \ return (result) ; \ } \ - if (cc->itype != ITYPE || cc->dtype != DTYPE) \ + if (cc->dtype != DTYPE) \ { \ cc->status = CHOLMOD_INVALID ; \ return (result) ; \ @@ -200,25 +198,26 @@ typedef std::complex Complex ; // For counting flops // ----------------------------------------------------------------------------- -#define FLOP_COUNT(f) { if (cc->SPQR_grain <= 1) cc->SPQR_flopcount += (f) ; } +#define FLOP_COUNT(f) { if (cc->SPQR_grain <= 1) cc->SPQR_flopcount += ((double) (f)) ; } +#define FLOP_COUNT2(f1,f2) FLOP_COUNT(((double) (f1)) * ((double) (f2))) // ============================================================================= // === spqr_work =============================================================== // ============================================================================= // workspace required for each stack in spqr_factorize and spqr_kernel -template struct spqr_work +template struct spqr_work { - int64_t *Stair1 ; // size maxfn if H not kept - int64_t *Cmap ; // size maxfn - int64_t *Fmap ; // size n + Int *Stair1 ; // size maxfn if H not kept + Int *Cmap ; // size maxfn + Int *Fmap ; // size n Entry *WTwork ; // size (fchunk + (keepH ? 0:1)) * maxfn Entry *Stack_head ; // head of Stack Entry *Stack_top ; // top of Stack - int64_t sumfrank ; // sum of ranks of the fronts in this stack - int64_t maxfrank ; // largest rank of fronts in this stack + Int sumfrank ; // sum of ranks of the fronts in this stack + Int maxfrank ; // largest rank of fronts in this stack // for computing the 2-norm of w, the vector of the dead column norms double wscale ; // scale factor for norm (w (of this stack)) @@ -232,17 +231,17 @@ template struct spqr_work // The spqr_blob is a collection of objects that the spqr_kernel requires. -template struct spqr_blob +template struct spqr_blob { double tol ; - spqr_symbolic *QRsym ; - spqr_numeric *QRnum ; - spqr_work *Work ; - int64_t *Cm ; + spqr_symbolic *QRsym ; + spqr_numeric *QRnum ; + spqr_work *Work ; + Int *Cm ; Entry **Cblock ; Entry *Sx ; - int64_t ntol ; - int64_t fchunk ; + Int ntol ; + Int fchunk ; cholmod_common *cc ; } ; @@ -251,12 +250,12 @@ template struct spqr_blob // === SuiteSparseQR non-user-callable functions =============================== // ============================================================================= -spqr_symbolic *spqr_analyze +template spqr_symbolic *spqr_analyze ( // inputs, not modified cholmod_sparse *A, int ordering, // all ordering options available - int64_t *Quser, // user provided ordering, if given (may be NULL) + Int *Quser, // user provided ordering, if given (may be NULL) int do_rank_detection, // if TRUE, then rank deficient matrices may be // considered during numerical factorization, @@ -270,23 +269,23 @@ spqr_symbolic *spqr_analyze cholmod_common *cc ) ; -template spqr_numeric *spqr_factorize +template spqr_numeric *spqr_factorize ( // input, optionally freed on output cholmod_sparse **Ahandle, // inputs, not modified - int64_t freeA, // if TRUE, free A on output + Int freeA, // if TRUE, free A on output double tol, // for rank detection - int64_t ntol, // apply tol only to first ntol columns - spqr_symbolic *QRsym, + Int ntol, // apply tol only to first ntol columns + spqr_symbolic *QRsym, // workspace and parameters cholmod_common *cc ) ; // returns tol (-1 if error) -template double spqr_tol +template double spqr_tol ( // inputs, not modified cholmod_sparse *A, @@ -295,7 +294,7 @@ template double spqr_tol cholmod_common *cc ) ; -template double spqr_maxcolnorm +template double spqr_maxcolnorm ( // inputs, not modified cholmod_sparse *A, @@ -304,57 +303,57 @@ template double spqr_maxcolnorm cholmod_common *cc ) ; -template void spqr_kernel +template void spqr_kernel ( - int64_t task, - spqr_blob *Blob + Int task, + spqr_blob *Blob ) ; -template void spqr_parallel +template void spqr_parallel ( - int64_t ntasks, + Int ntasks, int nthreads, - spqr_blob *Blob + spqr_blob *Blob ) ; -void spqr_freesym +template void spqr_freesym ( - spqr_symbolic **QRsym_handle, + spqr_symbolic **QRsym_handle, // workspace and parameters cholmod_common *cc ) ; -template void spqr_freenum +template void spqr_freenum ( - spqr_numeric **QRnum_handle, + spqr_numeric **QRnum_handle, // workspace and parameters cholmod_common *cc ) ; -template void spqr_freefac +template void spqr_freefac ( - SuiteSparseQR_factorization **QR_handle, + SuiteSparseQR_factorization **QR_handle, // workspace and parameters cholmod_common *cc ) ; -void spqr_stranspose1 +template void spqr_stranspose1 ( // input, not modified cholmod_sparse *A, // m-by-n - int64_t *Qfill, // size n, fill-reducing column permutation; + Int *Qfill, // size n, fill-reducing column permutation; // Qfill [k] = j if the kth column of S is the jth // column of A. Identity permutation is used if // Qfill is NULL. // output, contents not defined on input - int64_t *Sp, // size m+1, row pointers of S - int64_t *Sj, // size nz, column indices of S - int64_t *PLinv, // size m, inverse row permutation, PLinv [i] = k - int64_t *Sleft, // size n+2, Sleft [j] ... Sleft [j+1]-1 is the list of + Int *Sp, // size m+1, row pointers of S + Int *Sj, // size nz, column indices of S + Int *PLinv, // size m, inverse row permutation, PLinv [i] = k + Int *Sleft, // size n+2, Sleft [j] ... Sleft [j+1]-1 is the list of // rows of S whose leftmost column index is j. The list // can be empty (that is, Sleft [j] == Sleft [j+1]). // Sleft [n] is the number of non-empty rows of S, and @@ -362,27 +361,27 @@ void spqr_stranspose1 // Sleft [n+1]-1 gives the empty rows of S. // workspace, not defined on input or output - int64_t *W // size m + Int *W // size m ) ; -template void spqr_stranspose2 +template void spqr_stranspose2 ( // input, not modified cholmod_sparse *A, // m-by-n - int64_t *Qfill, // size n, fill-reducing column permutation; + Int *Qfill, // size n, fill-reducing column permutation; // Qfill [k] = j // if the kth column of S is the jth column of A. // Identity permutation is used if Qfill is NULL. - int64_t *Sp, // size m+1, row pointers of S - int64_t *PLinv, // size m, inverse row permutation, PLinv [i] = k + Int *Sp, // size m+1, row pointers of S + Int *PLinv, // size m, inverse row permutation, PLinv [i] = k // output, contents not defined on input Entry *Sx, // size nz, numerical values of S // workspace, not defined on input or output - int64_t *W // size m + Int *W // size m ) ; @@ -390,113 +389,114 @@ template void spqr_stranspose2 #ifndef NDEBUG -template void spqrDebug_dumpdense +template void spqrDebug_dumpdense ( Entry *A, - int64_t m, - int64_t n, - int64_t lda, + Int m, + Int n, + Int lda, cholmod_common *cc ) ; -template void spqrDebug_dumpsparse +template void spqrDebug_dumpsparse ( - int64_t *Ap, - int64_t *Ai, + Int *Ap, + Int *Ai, Entry *Ax, - int64_t m, - int64_t n, + Int m, + Int n, cholmod_common *cc ) ; void spqrDebug_print (double x) ; void spqrDebug_print (Complex x) ; -void spqrDebug_dump_Parent (int64_t n, int64_t *Parent, const char *filename) ; +template +void spqrDebug_dump_Parent (Int n, Int *Parent, const char *filename) ; -int64_t spqrDebug_rhsize // returns # of entries in R+H block +template Int spqrDebug_rhsize // returns # of entries in R+H block ( // input, not modified - int64_t m, // # of rows in F - int64_t n, // # of columns in F - int64_t npiv, // number of pivotal columns in F - int64_t *Stair, // size n; column j is dead if Stair [j] == 0. + Int m, // # of rows in F + Int n, // # of columns in F + Int npiv, // number of pivotal columns in F + Int *Stair, // size n; column j is dead if Stair [j] == 0. // Only the first npiv columns can be dead. cholmod_common *cc ) ; #endif #ifdef DEBUG_EXPENSIVE -int64_t spqrDebug_listcount +template Int spqrDebug_listcount ( - int64_t x, int64_t *List, int64_t len, int64_t what, + Int x, Int *List, Int len, Int what, cholmod_common *cc ) ; #endif // ============================================================================= -int64_t spqr_fsize // returns # of rows of F +template Int spqr_fsize // returns # of rows of F ( // inputs, not modified - int64_t f, - int64_t *Super, // size nf, from QRsym - int64_t *Rp, // size nf, from QRsym - int64_t *Rj, // size rjsize, from QRsym - int64_t *Sleft, // size n+2, from QRsym - int64_t *Child, // size nf, from QRsym - int64_t *Childp, // size nf+1, from QRsym - int64_t *Cm, // size nf, from QRwork + Int f, + Int *Super, // size nf, from QRsym + Int *Rp, // size nf, from QRsym + Int *Rj, // size rjsize, from QRsym + Int *Sleft, // size n+2, from QRsym + Int *Child, // size nf, from QRsym + Int *Childp, // size nf+1, from QRsym + Int *Cm, // size nf, from QRwork // outputs, not defined on input - int64_t *Fmap, // size n, from QRwork - int64_t *Stair // size fn, from QRwork + Int *Fmap, // size n, from QRwork + Int *Stair // size fn, from QRwork ) ; -template void spqr_assemble +template void spqr_assemble ( // inputs, not modified - int64_t f, // front to assemble F - int64_t fm, // number of rows of F + Int f, // front to assemble F + Int fm, // number of rows of F int keepH, // if TRUE, then construct row pattern of H - int64_t *Super, - int64_t *Rp, - int64_t *Rj, - int64_t *Sp, - int64_t *Sj, - int64_t *Sleft, - int64_t *Child, - int64_t *Childp, + Int *Super, + Int *Rp, + Int *Rj, + Int *Sp, + Int *Sj, + Int *Sleft, + Int *Child, + Int *Childp, Entry *Sx, - int64_t *Fmap, - int64_t *Cm, + Int *Fmap, + Int *Cm, Entry **Cblock, #ifndef NDEBUG char *Rdead, #endif - int64_t *Hr, + Int *Hr, // input/output - int64_t *Stair, - int64_t *Hii, // if keepH, construct list of row indices for F + Int *Stair, + Int *Hii, // if keepH, construct list of row indices for F // input only - int64_t *Hip, + Int *Hip, // outputs, not defined on input Entry *F, // workspace, not defined on input or output - int64_t *Cmap + Int *Cmap ) ; -template int64_t spqr_cpack // returns # of rows in C +template Int spqr_cpack // returns # of rows in C ( // input, not modified - int64_t m, // # of rows in F - int64_t n, // # of columns in F - int64_t npiv, // number of pivotal columns in F - int64_t g, // the C block starts at F (g,npiv) + Int m, // # of rows in F + Int n, // # of columns in F + Int npiv, // number of pivotal columns in F + Int g, // the C block starts at F (g,npiv) // input, not modified unless the pack occurs in-place Entry *F, // m-by-n frontal matrix in column-major order @@ -506,69 +506,69 @@ template int64_t spqr_cpack // returns # of rows in C // trapezoidal form. ) ; -int64_t spqr_fcsize // returns # of entries in C of current front F +template Int spqr_fcsize // returns # of entries in C of current front F ( // input, not modified - int64_t m, // # of rows in F - int64_t n, // # of columns in F - int64_t npiv, // number of pivotal columns in F - int64_t g // the C block starts at F (g,npiv) + Int m, // # of rows in F + Int n, // # of columns in F + Int npiv, // number of pivotal columns in F + Int g // the C block starts at F (g,npiv) ) ; -int64_t spqr_csize // returns # of entries in C of a child +template Int spqr_csize // returns # of entries in C of a child ( // input, not modified - int64_t c, // child c - int64_t *Rp, // size nf+1, pointers for pattern of R - int64_t *Cm, // size nf, Cm [c] = # of rows in child C - int64_t *Super // size nf, pivotal columns in each front + Int c, // child c + Int *Rp, // size nf+1, pointers for pattern of R + Int *Cm, // size nf, Cm [c] = # of rows in child C + Int *Super // size nf, pivotal columns in each front ) ; -template void spqr_rcount +template void spqr_rcount ( // inputs, not modified - spqr_symbolic *QRsym, - spqr_numeric *QRnum, + spqr_symbolic *QRsym, + spqr_numeric *QRnum, - int64_t n1rows, // added to each row index of Ra and Rb - int64_t econ, // only get entries in rows n1rows to econ-1 - int64_t n2, // Ra = R (:,0:n2-1), Rb = R (:,n2:n-1) + Int n1rows, // added to each row index of Ra and Rb + Int econ, // only get entries in rows n1rows to econ-1 + Int n2, // Ra = R (:,0:n2-1), Rb = R (:,n2:n-1) int getT, // if true, count Rb' instead of Rb // input/output - int64_t *Ra, // size n2; Ra [j] += nnz (R (:,j)) if j < n2 - int64_t *Rb, // If getT is false: size n-n2 and + Int *Ra, // size n2; Ra [j] += nnz (R (:,j)) if j < n2 + Int *Rb, // If getT is false: size n-n2 and // Rb [j-n2] += nnz (R (:,j)) if j >= n2. // If getT is true: size econ, and // Rb [i] += nnz (R (i, n2:n-1)) - int64_t *Hp, // size rjsize+1. Column pointers for H. + Int *Hp, // size rjsize+1. Column pointers for H. // Only computed if H was kept during factorization. // Only Hp [0..nh] is used. - int64_t *p_nh // number of Householder vectors (nh <= rjsize) + Int *p_nh // number of Householder vectors (nh <= rjsize) ) ; -template void spqr_rconvert +template void spqr_rconvert ( // inputs, not modified - spqr_symbolic *QRsym, - spqr_numeric *QRnum, + spqr_symbolic *QRsym, + spqr_numeric *QRnum, - int64_t n1rows, // added to each row index of Ra, Rb, and H - int64_t econ, // only get entries in rows n1rows to econ-1 - int64_t n2, // Ra = R (:,0:n2-1), Rb = R (:,n2:n-1) + Int n1rows, // added to each row index of Ra, Rb, and H + Int econ, // only get entries in rows n1rows to econ-1 + Int n2, // Ra = R (:,0:n2-1), Rb = R (:,n2:n-1) int getT, // if true, get Rb' instead of Rb // input/output - int64_t *Rap, // size n2+1; on input, Rap [j] is the column pointer + Int *Rap, // size n2+1; on input, Rap [j] is the column pointer // for Ra. Incremented on output by the number of // entries added to column j of Ra. // output, not defined on input - int64_t *Rai, // size rnz1 = nnz(Ra); row indices of Ra + Int *Rai, // size rnz1 = nnz(Ra); row indices of Ra Entry *Rax, // size rnz; numerical values of Ra // input/output - int64_t *Rbp, // if getT is false: + Int *Rbp, // if getT is false: // size (n-n2)+1; on input, Rbp [j] is the column // pointer for Rb. Incremented on output by the number // of entries added to column j of Rb. @@ -578,28 +578,28 @@ template void spqr_rconvert // of entries added to row i of Rb. // output, not defined on input - int64_t *Rbi, // size rnz2 = nnz(Rb); indices of Rb + Int *Rbi, // size rnz2 = nnz(Rb); indices of Rb Entry *Rbx, // size rnz2; numerical values of Rb // input - int64_t *H2p, // size nh+1; H2p [j] is the column pointer for H. + Int *H2p, // size nh+1; H2p [j] is the column pointer for H. // H2p, H2i, and H2x are ignored if H was not kept // during factorization. nh computed by rcount // output, not defined on input - int64_t *H2i, // size hnz = nnz(H); indices of H + Int *H2i, // size hnz = nnz(H); indices of H Entry *H2x, // size hnz; numerical values of H Entry *H2Tau // size nh; Householder coefficients ) ; -template int64_t spqr_rhpack // returns # of entries in R+H +template Int spqr_rhpack // returns # of entries in R+H ( // input, not modified int keepH, // if true, then H is packed - int64_t m, // # of rows in F - int64_t n, // # of columns in F - int64_t npiv, // number of pivotal columns in F - int64_t *Stair, // size npiv; column j is dead if Stair [j] == 0. + Int m, // # of rows in F + Int n, // # of columns in F + Int npiv, // number of pivotal columns in F + Int *Stair, // size npiv; column j is dead if Stair [j] == 0. // Only the first npiv columns can be dead. // input, not modified (unless the pack occurs in-place) @@ -607,36 +607,36 @@ template int64_t spqr_rhpack // returns # of entries in R+H // output, contents not defined on input Entry *R, // packed columns of R+H - int64_t *p_rm // number of rows in R block + Int *p_rm // number of rows in R block ) ; -template void spqr_hpinv +template void spqr_hpinv ( // input - spqr_symbolic *QRsym, + spqr_symbolic *QRsym, // input/output - spqr_numeric *QRnum, + spqr_numeric *QRnum, // workspace - int64_t *W // size QRnum->m + Int *W // size QRnum->m ) ; -template int spqr_1colamd +template int spqr_1colamd ( // inputs, not modified int ordering, // all available, except 0:fixed and 3:given // treated as 1:natural double tol, // only accept singletons above tol - int64_t bncols, // number of columns of B + Int bncols, // number of columns of B cholmod_sparse *A, // m-by-n sparse matrix // output arrays, neither allocated nor defined on input. - int64_t **p_Q1fill, // size n+bncols, fill-reducing + Int **p_Q1fill, // size n+bncols, fill-reducing // or natural ordering - int64_t **p_R1p, // size n1rows+1, R1p [k] = # of nonzeros in kth + Int **p_R1p, // size n1rows+1, R1p [k] = # of nonzeros in kth // row of R1. NULL if n1cols == 0. - int64_t **p_P1inv, // size m, singleton row inverse permutation. + Int **p_P1inv, // size m, singleton row inverse permutation. // If row i of A is the kth singleton row, then // P1inv [i] = k. NULL if n1cols is zero. @@ -645,25 +645,25 @@ template int spqr_1colamd // Y = [A B] or Y = [A2 B2]. If B is empty and // there are no column singletons, Y is NULL - int64_t *p_n1cols, // number of column singletons found - int64_t *p_n1rows, // number of corresponding rows found + Int *p_n1cols, // number of column singletons found + Int *p_n1rows, // number of corresponding rows found // workspace and parameters cholmod_common *cc ) ; -template int spqr_1fixed +template int spqr_1fixed ( // inputs, not modified double tol, // only accept singletons above tol - int64_t bncols, // number of columns of B + Int bncols, // number of columns of B cholmod_sparse *A, // m-by-n sparse matrix // output arrays, neither allocated nor defined on input. - int64_t **p_R1p, // size n1rows+1, R1p [k] = # of nonzeros in kth + Int **p_R1p, // size n1rows+1, R1p [k] = # of nonzeros in kth // row of R1. NULL if n1cols == 0. - int64_t **p_P1inv, // size m, singleton row inverse permutation. + Int **p_P1inv, // size m, singleton row inverse permutation. // If row i of A is the kth singleton row, then // P1inv [i] = k. NULL if n1cols is zero. @@ -672,59 +672,60 @@ template int spqr_1fixed // Y = [A B] or Y = [A2 B2]. If B is empty and // there are no column singletons, Y is NULL - int64_t *p_n1cols, // number of column singletons found - int64_t *p_n1rows, // number of corresponding rows found + Int *p_n1cols, // number of column singletons found + Int *p_n1rows, // number of corresponding rows found // workspace and parameters cholmod_common *cc ) ; -template SuiteSparseQR_factorization *spqr_1factor +template +SuiteSparseQR_factorization *spqr_1factor ( // inputs, not modified int ordering, // all ordering options available double tol, // only accept singletons above tol - int64_t bncols, // number of columns of B + Int bncols, // number of columns of B int keepH, // if TRUE, keep the Householder vectors cholmod_sparse *A, // m-by-n sparse matrix - int64_t ldb, // leading dimension of B, if dense - int64_t *Bp, // size bncols+1, column pointers of B - int64_t *Bi, // size bnz = Bp [bncols], row indices of B + Int ldb, // leading dimension of B, if dense + Int *Bp, // size bncols+1, column pointers of B + Int *Bi, // size bnz = Bp [bncols], row indices of B Entry *Bx, // size bnz, numerical values of B // workspace and parameters cholmod_common *cc ) ; -int64_t spqr_cumsum // returns total sum +template Int spqr_cumsum // returns total sum ( // input, not modified - int64_t n, + Int n, // input/output - int64_t *X // size n+1. X = cumsum ([0 X]) + Int *X // size n+1. X = cumsum ([0 X]) ) ; -void spqr_shift +template void spqr_shift ( // input, not modified - int64_t n, + Int n, // input/output - int64_t *X // size n+1 + Int *X // size n+1 ) ; -template void spqr_larftb +template void spqr_larftb ( // inputs, not modified (V is modified and then restored on output) int method, // 0,1,2,3 - int64_t m, // C is m-by-n - int64_t n, - int64_t k, // V is v-by-k + Int m, // C is m-by-n + Int n, + Int k, // V is v-by-k // for methods 0 and 1, v = m, // for methods 2 and 3, v = n - int64_t ldc, // leading dimension of C - int64_t ldv, // leading dimension of V + Int ldc, // leading dimension of C + Int ldv, // leading dimension of V Entry *V, // V is v-by-k, unit lower triangular (diag not stored) Entry *Tau, // size k, the k Householder coefficients @@ -737,36 +738,36 @@ template void spqr_larftb cholmod_common *cc ) ; -int spqr_happly_work +template int spqr_happly_work ( // input int method, // 0,1,2,3 - int64_t m, // X is m-by-n - int64_t n, + Int m, // X is m-by-n + Int n, // FUTURE : make H cholmod_sparse: - int64_t nh, // number of Householder vectors - int64_t *Hp, // size nh+1, column pointers for H - int64_t hchunk, + Int nh, // number of Householder vectors + Int *Hp, // size nh+1, column pointers for H + Int hchunk, // outputs; sizes of workspaces needed - int64_t *p_vmax, - int64_t *p_vsize, - int64_t *p_csize + Int *p_vmax, + Int *p_vsize, + Int *p_csize ) ; -template void spqr_happly +template void spqr_happly ( // input int method, // 0,1,2,3 - int64_t m, // X is m-by-n - int64_t n, + Int m, // X is m-by-n + Int n, - int64_t nh, // number of Householder vectors - int64_t *Hp, // size nh+1, column pointers for H - int64_t *Hi, // size hnz = Hp [nh], row indices of H + Int nh, // number of Householder vectors + Int *Hp, // size nh+1, column pointers for H + Int *Hi, // size hnz = Hp [nh], row indices of H Entry *Hx, // size hnz, Householder values. Note that the first // entry in each column must be equal to 1.0 @@ -776,27 +777,27 @@ template void spqr_happly Entry *X, // size m-by-n with leading dimension m // workspace - int64_t vmax, - int64_t hchunk, - int64_t *Wi, // size vmax - int64_t *Wmap, // size MAX(mh,1) where H is mh-by-nh + Int vmax, + Int hchunk, + Int *Wi, // size vmax + Int *Wmap, // size MAX(mh,1) where H is mh-by-nh Entry *C, // size csize Entry *V, // size vsize cholmod_common *cc ) ; -template void spqr_panel +template void spqr_panel ( // input int method, - int64_t m, - int64_t n, - int64_t v, - int64_t h, // number of Householder vectors in the panel - int64_t *Vi, // Vi [0:v-1] defines the pattern of the panel + Int m, + Int n, + Int v, + Int h, // number of Householder vectors in the panel + Int *Vi, // Vi [0:v-1] defines the pattern of the panel Entry *V, // v-by-h, panel of Householder vectors Entry *Tau, // size h, Householder coefficients for the panel - int64_t ldx, + Int ldx, // input/output Entry *X, // m-by-n with leading dimension ldx @@ -808,33 +809,33 @@ template void spqr_panel cholmod_common *cc ) ; -template int spqr_append // TRUE if OK, FALSE otherwise +template int spqr_append // TRUE if OK, FALSE otherwise ( // inputs, not modified Entry *X, // size m-by-1 - int64_t *P, // size m, or NULL; permutation to apply to X. + Int *P, // size m, or NULL; permutation to apply to X. // P [k] = i if row k of A is row i of X // input/output cholmod_sparse *A, // size m-by-n2 where n2 > n - int64_t *p_n, // number of columns of A; increased by one + Int *p_n, // number of columns of A; increased by one // workspace and parameters cholmod_common *cc ) ; -template int64_t spqr_trapezoidal // rank of R, or EMPTY +template Int spqr_trapezoidal // rank of R, or EMPTY ( // inputs, not modified - int64_t n, // R is m-by-n (m is not needed here; can be economy R) - int64_t *Rp, // size n+1, column pointers of R - int64_t *Ri, // size rnz = Rp [n], row indices of R + Int n, // R is m-by-n (m is not needed here; can be economy R) + Int *Rp, // size n+1, column pointers of R + Int *Ri, // size rnz = Rp [n], row indices of R Entry *Rx, // size rnz, numerical values of R - int64_t bncols, // number of columns of B + Int bncols, // number of columns of B - int64_t *Qfill, // size n+bncols, fill-reducing ordering. Qfill [k] = j if + Int *Qfill, // size n+bncols, fill-reducing ordering. Qfill [k] = j if // the jth column of A is the kth column of R. If Qfill is // NULL, then it is assumed to be the identity // permutation. @@ -844,11 +845,11 @@ template int64_t spqr_trapezoidal // rank of R, or EMPTY // the matrix T is not created. // outputs, not allocated on input - int64_t **p_Tp, // size n+1, column pointers of T - int64_t **p_Ti, // size rnz, row indices of T + Int **p_Tp, // size n+1, column pointers of T + Int **p_Ti, // size rnz, row indices of T Entry **p_Tx, // size rnz, numerical values of T - int64_t **p_Qtrap, // size n+bncols, modified Qfill + Int **p_Qtrap, // size n+bncols, modified Qfill // workspace and parameters cholmod_common *cc @@ -856,14 +857,175 @@ template int64_t spqr_trapezoidal // rank of R, or EMPTY template int spqr_type (void) ; -template void spqr_rsolve +template void *spqr_malloc (size_t n, size_t size, cholmod_common *Common) ; +template void *spqr_calloc (size_t n, size_t size, cholmod_common *Common) ; +template void *spqr_free (size_t n, size_t size, void *p, cholmod_common *Common) ; + +template void *spqr_realloc /* returns pointer to reallocated block */ +( + /* ---- input ---- */ + size_t nnew, /* requested # of items in reallocated block */ + size_t size, /* size of each item */ + /* ---- in/out --- */ + void *p, /* block of memory to realloc */ + size_t *n, /* current size on input, nnew on output if successful*/ + /* --------------- */ + cholmod_common *Common +) ; + +template cholmod_sparse *spqr_allocate_sparse +( + /* ---- input ---- */ + size_t nrow, /* # of rows of A */ + size_t ncol, /* # of columns of A */ + size_t nzmax, /* max # of nonzeros of A */ + int sorted, /* TRUE if columns of A sorted, FALSE otherwise */ + int packed, /* TRUE if A will be packed, FALSE otherwise */ + int stype, /* stype of A */ + int xtype, /* CHOLMOD_PATTERN, _REAL, _COMPLEX, or _ZOMPLEX */ + /* --------------- */ + cholmod_common *Common +) ; + +template int spqr_free_sparse +( + /* ---- in/out --- */ + cholmod_sparse **A, /* matrix to deallocate, NULL on output */ + /* --------------- */ + cholmod_common *Common +) ; + +template int spqr_reallocate_sparse +( + /* ---- input ---- */ + size_t nznew, /* new # of entries in A */ + /* ---- in/out --- */ + cholmod_sparse *A, /* matrix to reallocate */ + /* --------------- */ + cholmod_common *Common +) ; + +template cholmod_sparse *spqr_speye +( + /* ---- input ---- */ + size_t nrow, /* # of rows of A */ + size_t ncol, /* # of columns of A */ + int xtype, /* CHOLMOD_PATTERN, _REAL, _COMPLEX, or _ZOMPLEX */ + /* --------------- */ + cholmod_common *Common +) ; + +template cholmod_dense *spqr_allocate_dense +( + /* ---- input ---- */ + size_t nrow, /* # of rows of matrix */ + size_t ncol, /* # of columns of matrix */ + size_t d, /* leading dimension */ + int xtype, /* CHOLMOD_REAL, _COMPLEX, or _ZOMPLEX */ + /* --------------- */ + cholmod_common *Common +) ; + +template int spqr_free_dense +( + /* ---- in/out --- */ + cholmod_dense **X, /* dense matrix to deallocate, NULL on output */ + /* --------------- */ + cholmod_common *Common +) ; + +template cholmod_factor *spqr_allocate_factor +( + /* ---- input ---- */ + size_t n, /* L is n-by-n */ + /* --------------- */ + cholmod_common *Common +) ; + +template int spqr_free_factor +( + /* ---- in/out --- */ + cholmod_factor **L, /* factor to free, NULL on output */ + /* --------------- */ + cholmod_common *Common +) ; + +template int spqr_allocate_work +( + /* ---- input ---- */ + size_t nrow, /* size: Common->Flag (nrow), Common->Head (nrow+1) */ + size_t iworksize, /* size of Common->Iwork */ + size_t xworksize, /* size of Common->Xwork */ + /* --------------- */ + cholmod_common *Common +) ; + +template +int spqr_amd(cholmod_sparse *A, Int *fset, size_t fsize, Int *Perm, cholmod_common *Common) ; + +template +int spqr_metis(cholmod_sparse *A, Int *fset, size_t fsize, int postorder, Int *Perm, cholmod_common *Common) ; + + +template +cholmod_sparse *spqr_transpose(cholmod_sparse *A, int values, cholmod_common *Common) ; + +template +cholmod_factor *spqr_analyze_p2 +( + /* ---- input ---- */ + int for_whom, /* FOR_SPQR (0): for SPQR but not GPU-accelerated + FOR_CHOLESKY (1): for Cholesky (GPU or not) + FOR_SPQRGPU (2): for SPQR with GPU acceleration */ + cholmod_sparse *A, /* matrix to order and analyze */ + Int *UserPerm, /* user-provided permutation, size A->nrow */ + Int *fset, /* subset of 0:(A->ncol)-1 */ + size_t fsize, /* size of fset */ + /* --------------- */ + cholmod_common *Common +) ; + +template +int spqr_colamd +( + /* ---- input ---- */ + cholmod_sparse *A, /* matrix to order */ + Int *fset, /* subset of 0:(A->ncol)-1 */ + size_t fsize, /* size of fset */ + int postorder, /* if TRUE, follow with a coletree postorder */ + /* ---- output --- */ + Int *Perm, /* size A->nrow, output permutation */ + /* --------------- */ + cholmod_common *Common +) ; + +template +int64_t spqr_nnz +( + cholmod_sparse *A, + cholmod_common *Common +) ; + +template Int spqr_postorder /* return # of nodes postordered */ +( + /* ---- input ---- */ + Int *Parent, /* size n. Parent [j] = p if p is the parent of j */ + size_t n, + Int *Weight_p, /* size n, optional. Weight [j] is weight of node j */ + /* ---- output --- */ + Int *Post, /* size n. Post [k] = j is kth in postordered tree */ + /* --------------- */ + cholmod_common *Common +) ; + +template void spqr_rsolve ( // inputs - SuiteSparseQR_factorization *QR, + SuiteSparseQR_factorization *QR, int use_Q1fill, - int64_t nrhs, // number of columns of B - int64_t ldb, // leading dimension of B + Int nrhs, // number of columns of B + Int ldb, // leading dimension of B Entry *B, // size m-by-nrhs with leading dimesion ldb // output @@ -871,27 +1033,27 @@ template void spqr_rsolve // workspace Entry **Rcolp, - int64_t *Rlive, + Int *Rlive, Entry *W, cholmod_common *cc ) ; // returns rank of F, or 0 on error -template int64_t spqr_front +template Int spqr_front ( // input, not modified - int64_t m, // F is m-by-n with leading dimension m - int64_t n, - int64_t npiv, // number of pivot columns + Int m, // F is m-by-n with leading dimension m + Int n, + Int npiv, // number of pivot columns double tol, // a column is flagged as dead if its norm is <= tol - int64_t ntol, // apply tol only to first ntol pivot columns - int64_t fchunk, // block size for compact WY Householder reflections, + Int ntol, // apply tol only to first ntol pivot columns + Int fchunk, // block size for compact WY Householder reflections, // treated as 1 if fchunk <= 1 // input/output Entry *F, // frontal matrix F of size m-by-n - int64_t *Stair, // size n, entries F (Stair[k]:m-1, k) are all zero, + Int *Stair, // size n, entries F (Stair[k]:m-1, k) are all zero, // and remain zero on output. char *Rdead, // size npiv; all zero on input. If k is dead, // Rdead [k] is set to 1 @@ -909,9 +1071,25 @@ template int64_t spqr_front cholmod_common *cc ) ; -template int spqr_rmap +template cholmod_sparse *spqr_dense_to_sparse ( - SuiteSparseQR_factorization *QR, + /* ---- input ---- */ + cholmod_dense *X, /* matrix to copy */ + int values, /* TRUE if values to be copied, FALSE otherwise */ + /* --------------- */ + cholmod_common *Common +) ; +template cholmod_dense *spqr_sparse_to_dense +( + /* ---- input ---- */ + cholmod_sparse *A, /* matrix to copy */ + /* --------------- */ + cholmod_common *Common +) ; + +template int spqr_rmap +( + SuiteSparseQR_factorization *QR, cholmod_common *cc ) ; @@ -975,12 +1153,12 @@ inline Complex spqr_divide (Complex a, Complex b, cholmod_common *cc) // === spqr_add ================================================================ // ============================================================================= -// Add two non-negative int64_t's, and return the result. Checks for int64_t +// Add two non-negative Int's, and return the result. Checks for Int // overflow and sets ok to FALSE if it occurs. -inline int64_t spqr_add (int64_t a, int64_t b, int *ok) +template inline Int spqr_add (Int a, Int b, int *ok) { - int64_t c = a + b ; + Int c = a + b ; if (c < 0) { (*ok) = FALSE ; @@ -994,12 +1172,12 @@ inline int64_t spqr_add (int64_t a, int64_t b, int *ok) // === spqr_mult =============================================================== // ============================================================================= -// Multiply two positive int64_t's, and return the result. Checks for int64_t +// Multiply two positive Int's, and return the result. Checks for Int // overflow and sets ok to FALSE if it occurs. -inline int64_t spqr_mult (int64_t a, int64_t b, int *ok) +template inline Int spqr_mult (Int a, Int b, int *ok) { - int64_t c = a * b ; + Int c = a * b ; if (((double) c) != ((double) a) * ((double) b)) { (*ok) = FALSE ; @@ -1056,6 +1234,5 @@ inline int64_t spqr_mult (int64_t a, int64_t b, int *ok) #define TEST_COVERAGE_RESUME #endif - #endif diff --git a/SPQR/Include/spqr_cholmod_wrappers.hpp b/SPQR/Include/spqr_cholmod_wrappers.hpp new file mode 100644 index 000000000..4daf71cd4 --- /dev/null +++ b/SPQR/Include/spqr_cholmod_wrappers.hpp @@ -0,0 +1,922 @@ +#include "spqr.hpp" + +template int spqr_start +( + cholmod_common *Common +) ; + +template <> int spqr_start +( + cholmod_common *Common +) ; + +template <> int spqr_start +( + cholmod_common *Common +) ; + +template int spqr_finish +( + cholmod_common *Common +) ; + +template <> int spqr_finish +( + cholmod_common *Common +) ; + +template <> int spqr_finish +( + cholmod_common *Common +) ; + +template void *spqr_malloc (size_t n, size_t size, cholmod_common *Common) ; +template <> void *spqr_malloc (size_t n, size_t size, cholmod_common *Common) ; +template <> void *spqr_malloc (size_t n, size_t size, cholmod_common *Common) ; + +template void *spqr_calloc (size_t n, size_t size, cholmod_common *Common) ; +template <> void *spqr_calloc (size_t n, size_t size, cholmod_common *Common) ; +template <> void *spqr_calloc (size_t n, size_t size, cholmod_common *Common) ; + +template void *spqr_free (size_t n, size_t size, void *p, cholmod_common *Common) ; +template <> void *spqr_free (size_t n, size_t size, void *p, cholmod_common *Common) ; +template <> void *spqr_free (size_t n, size_t size, void *p, cholmod_common *Common) ; + +template void *spqr_realloc /* returns pointer to reallocated block */ +( + /* ---- input ---- */ + size_t nnew, /* requested # of items in reallocated block */ + size_t size, /* size of each item */ + /* ---- in/out --- */ + void *p, /* block of memory to realloc */ + size_t *n, /* current size on input, nnew on output if successful*/ + /* --------------- */ + cholmod_common *Common +) ; +template <> void *spqr_realloc /* returns pointer to reallocated block */ +( + /* ---- input ---- */ + size_t nnew, /* requested # of items in reallocated block */ + size_t size, /* size of each item */ + /* ---- in/out --- */ + void *p, /* block of memory to realloc */ + size_t *n, /* current size on input, nnew on output if successful*/ + /* --------------- */ + cholmod_common *Common +) ; +template <> void *spqr_realloc /* returns pointer to reallocated block */ +( + /* ---- input ---- */ + size_t nnew, /* requested # of items in reallocated block */ + size_t size, /* size of each item */ + /* ---- in/out --- */ + void *p, /* block of memory to realloc */ + size_t *n, /* current size on input, nnew on output if successful*/ + /* --------------- */ + cholmod_common *Common +) ; + +template cholmod_sparse *spqr_allocate_sparse +( + /* ---- input ---- */ + size_t nrow, /* # of rows of A */ + size_t ncol, /* # of columns of A */ + size_t nzmax, /* max # of nonzeros of A */ + int sorted, /* TRUE if columns of A sorted, FALSE otherwise */ + int packed, /* TRUE if A will be packed, FALSE otherwise */ + int stype, /* stype of A */ + int xtype, /* CHOLMOD_PATTERN, _REAL, _COMPLEX, or _ZOMPLEX */ + /* --------------- */ + cholmod_common *Common +) ; +template <> cholmod_sparse *spqr_allocate_sparse +( + /* ---- input ---- */ + size_t nrow, /* # of rows of A */ + size_t ncol, /* # of columns of A */ + size_t nzmax, /* max # of nonzeros of A */ + int sorted, /* TRUE if columns of A sorted, FALSE otherwise */ + int packed, /* TRUE if A will be packed, FALSE otherwise */ + int stype, /* stype of A */ + int xtype, /* CHOLMOD_PATTERN, _REAL, _COMPLEX, or _ZOMPLEX */ + /* --------------- */ + cholmod_common *Common +) ; +template <> cholmod_sparse *spqr_allocate_sparse +( + /* ---- input ---- */ + size_t nrow, /* # of rows of A */ + size_t ncol, /* # of columns of A */ + size_t nzmax, /* max # of nonzeros of A */ + int sorted, /* TRUE if columns of A sorted, FALSE otherwise */ + int packed, /* TRUE if A will be packed, FALSE otherwise */ + int stype, /* stype of A */ + int xtype, /* CHOLMOD_PATTERN, _REAL, _COMPLEX, or _ZOMPLEX */ + /* --------------- */ + cholmod_common *Common +) ; + +template int spqr_free_sparse +( + /* ---- in/out --- */ + cholmod_sparse **A, /* matrix to deallocate, NULL on output */ + /* --------------- */ + cholmod_common *Common +) ; +template <> int spqr_free_sparse +( + /* ---- in/out --- */ + cholmod_sparse **A, /* matrix to deallocate, NULL on output */ + /* --------------- */ + cholmod_common *Common +) ; +template <> int spqr_free_sparse +( + /* ---- in/out --- */ + cholmod_sparse **A, /* matrix to deallocate, NULL on output */ + /* --------------- */ + cholmod_common *Common +) ; + +template int spqr_reallocate_sparse +( + /* ---- input ---- */ + size_t nznew, /* new # of entries in A */ + /* ---- in/out --- */ + cholmod_sparse *A, /* matrix to reallocate */ + /* --------------- */ + cholmod_common *Common +) ; +template <> int spqr_reallocate_sparse +( + /* ---- input ---- */ + size_t nznew, /* new # of entries in A */ + /* ---- in/out --- */ + cholmod_sparse *A, /* matrix to reallocate */ + /* --------------- */ + cholmod_common *Common +) ; +template <> int spqr_reallocate_sparse +( + /* ---- input ---- */ + size_t nznew, /* new # of entries in A */ + /* ---- in/out --- */ + cholmod_sparse *A, /* matrix to reallocate */ + /* --------------- */ + cholmod_common *Common +) ; + +template cholmod_dense *spqr_allocate_dense +( + /* ---- input ---- */ + size_t nrow, /* # of rows of matrix */ + size_t ncol, /* # of columns of matrix */ + size_t d, /* leading dimension */ + int xtype, /* CHOLMOD_REAL, _COMPLEX, or _ZOMPLEX */ + /* --------------- */ + cholmod_common *Common +) ; +template <> cholmod_dense *spqr_allocate_dense +( + /* ---- input ---- */ + size_t nrow, /* # of rows of matrix */ + size_t ncol, /* # of columns of matrix */ + size_t d, /* leading dimension */ + int xtype, /* CHOLMOD_REAL, _COMPLEX, or _ZOMPLEX */ + /* --------------- */ + cholmod_common *Common +) ; + +template <> cholmod_dense *spqr_allocate_dense +( + /* ---- input ---- */ + size_t nrow, /* # of rows of matrix */ + size_t ncol, /* # of columns of matrix */ + size_t d, /* leading dimension */ + int xtype, /* CHOLMOD_REAL, _COMPLEX, or _ZOMPLEX */ + /* --------------- */ + cholmod_common *Common +) ; + +template int spqr_free_dense +( + /* ---- in/out --- */ + cholmod_dense **X, /* dense matrix to deallocate, NULL on output */ + /* --------------- */ + cholmod_common *Common +) ; +template <> int spqr_free_dense +( + /* ---- in/out --- */ + cholmod_dense **X, /* dense matrix to deallocate, NULL on output */ + /* --------------- */ + cholmod_common *Common +) ; +template <> int spqr_free_dense +( + /* ---- in/out --- */ + cholmod_dense **X, /* dense matrix to deallocate, NULL on output */ + /* --------------- */ + cholmod_common *Common +) ; + +template cholmod_factor *spqr_allocate_factor +( + /* ---- input ---- */ + size_t n, /* L is n-by-n */ + /* --------------- */ + cholmod_common *Common +) ; +template <> cholmod_factor *spqr_allocate_factor +( + /* ---- input ---- */ + size_t n, /* L is n-by-n */ + /* --------------- */ + cholmod_common *Common +) ; +template <> cholmod_factor *spqr_allocate_factor +( + /* ---- input ---- */ + size_t n, /* L is n-by-n */ + /* --------------- */ + cholmod_common *Common +) ; + +template int spqr_free_factor +( + /* ---- in/out --- */ + cholmod_factor **L, /* factor to free, NULL on output */ + /* --------------- */ + cholmod_common *Common +) ; +template <> int spqr_free_factor +( + /* ---- in/out --- */ + cholmod_factor **L, /* factor to free, NULL on output */ + /* --------------- */ + cholmod_common *Common +) ; +template <> int spqr_free_factor +( + /* ---- in/out --- */ + cholmod_factor **L, /* factor to free, NULL on output */ + /* --------------- */ + cholmod_common *Common +) ; + +template int spqr_allocate_work +( + /* ---- input ---- */ + size_t nrow, /* size: Common->Flag (nrow), Common->Head (nrow+1) */ + size_t iworksize, /* size of Common->Iwork */ + size_t xworksize, /* size of Common->Xwork */ + /* --------------- */ + cholmod_common *Common +) ; +template <> int spqr_allocate_work +( + /* ---- input ---- */ + size_t nrow, /* size: Common->Flag (nrow), Common->Head (nrow+1) */ + size_t iworksize, /* size of Common->Iwork */ + size_t xworksize, /* size of Common->Xwork */ + /* --------------- */ + cholmod_common *Common +) ; +template <> int spqr_allocate_work +( + /* ---- input ---- */ + size_t nrow, /* size: Common->Flag (nrow), Common->Head (nrow+1) */ + size_t iworksize, /* size of Common->Iwork */ + size_t xworksize, /* size of Common->Xwork */ + /* --------------- */ + cholmod_common *Common +) ; + +template int spqr_amd +( + cholmod_sparse *A, Int *fset, size_t fsize, Int *Perm, cholmod_common *Common +) ; +template <> int spqr_amd +( + cholmod_sparse *A, int64_t *fset, size_t fsize, int64_t *Perm, cholmod_common *Common +) ; +template <> int spqr_amd +( + cholmod_sparse *A, int32_t *fset, size_t fsize, int32_t *Perm, cholmod_common *Common +) ; + +template int spqr_metis +( + cholmod_sparse *A, Int *fset, size_t fsize, int postorder, Int *Perm, cholmod_common *Common +) ; +template <> int spqr_metis +( + cholmod_sparse *A, int64_t *fset, size_t fsize, int postorder, int64_t *Perm, cholmod_common *Common +); + +template <> int spqr_metis +( + cholmod_sparse *A, int32_t *fset, size_t fsize, int postorder, int32_t *Perm, cholmod_common *Common +); + +template cholmod_sparse *spqr_transpose +( + cholmod_sparse *A, int values, cholmod_common *Common +) ; +template <> cholmod_sparse *spqr_transpose +( + cholmod_sparse *A, int values, cholmod_common *Common +) ; +template <> cholmod_sparse *spqr_transpose +( + cholmod_sparse *A, int values, cholmod_common *Common +) ; + +template +cholmod_factor *spqr_analyze_p2 +( + /* ---- input ---- */ + int for_whom, /* FOR_SPQR (0): for SPQR but not GPU-accelerated + FOR_CHOLESKY (1): for Cholesky (GPU or not) + FOR_SPQRGPU (2): for SPQR with GPU acceleration */ + cholmod_sparse *A, /* matrix to order and analyze */ + Int *UserPerm, /* user-provided permutation, size A->nrow */ + Int *fset, /* subset of 0:(A->ncol)-1 */ + size_t fsize, /* size of fset */ + /* --------------- */ + cholmod_common *Common +) ; +template <> +cholmod_factor *spqr_analyze_p2 +( + /* ---- input ---- */ + int for_whom, /* FOR_SPQR (0): for SPQR but not GPU-accelerated + FOR_CHOLESKY (1): for Cholesky (GPU or not) + FOR_SPQRGPU (2): for SPQR with GPU acceleration */ + cholmod_sparse *A, /* matrix to order and analyze */ + int32_t *UserPerm, /* user-provided permutation, size A->nrow */ + int32_t *fset, /* subset of 0:(A->ncol)-1 */ + size_t fsize, /* size of fset */ + /* --------------- */ + cholmod_common *Common +) ; +template <> +cholmod_factor *spqr_analyze_p2 +( + /* ---- input ---- */ + int for_whom, /* FOR_SPQR (0): for SPQR but not GPU-accelerated + FOR_CHOLESKY (1): for Cholesky (GPU or not) + FOR_SPQRGPU (2): for SPQR with GPU acceleration */ + cholmod_sparse *A, /* matrix to order and analyze */ + int64_t *UserPerm, /* user-provided permutation, size A->nrow */ + int64_t *fset, /* subset of 0:(A->ncol)-1 */ + size_t fsize, /* size of fset */ + /* --------------- */ + cholmod_common *Common +) ; + +template int spqr_colamd +( + /* ---- input ---- */ + cholmod_sparse *A, /* matrix to order */ + Int *fset, /* subset of 0:(A->ncol)-1 */ + size_t fsize, /* size of fset */ + int postorder, /* if TRUE, follow with a coletree postorder */ + /* ---- output --- */ + Int *Perm, /* size A->nrow, output permutation */ + /* --------------- */ + cholmod_common *Common +) ; +template <> int spqr_colamd +( + /* ---- input ---- */ + cholmod_sparse *A, /* matrix to order */ + int32_t *fset, /* subset of 0:(A->ncol)-1 */ + size_t fsize, /* size of fset */ + int postorder, /* if TRUE, follow with a coletree postorder */ + /* ---- output --- */ + int32_t *Perm, /* size A->nrow, output permutation */ + /* --------------- */ + cholmod_common *Common +) ; +template <> int spqr_colamd +( + /* ---- input ---- */ + cholmod_sparse *A, /* matrix to order */ + int64_t *fset, /* subset of 0:(A->ncol)-1 */ + size_t fsize, /* size of fset */ + int postorder, /* if TRUE, follow with a coletree postorder */ + /* ---- output --- */ + int64_t *Perm, /* size A->nrow, output permutation */ + /* --------------- */ + cholmod_common *Common +) ; + +template Int spqr_postorder /* return # of nodes postordered */ +( + /* ---- input ---- */ + Int *Parent, /* size n. Parent [j] = p if p is the parent of j */ + size_t n, + Int *Weight_p, /* size n, optional. Weight [j] is weight of node j */ + /* ---- output --- */ + Int *Post, /* size n. Post [k] = j is kth in postordered tree */ + /* --------------- */ + cholmod_common *Common +) ; +template <> int32_t spqr_postorder /* return # of nodes postordered */ +( + /* ---- input ---- */ + int32_t *Parent, /* size n. Parent [j] = p if p is the parent of j */ + size_t n, + int32_t *Weight_p, /* size n, optional. Weight [j] is weight of node j */ + /* ---- output --- */ + int32_t *Post, /* size n. Post [k] = j is kth in postordered tree */ + /* --------------- */ + cholmod_common *Common +) ; +template <> int64_t spqr_postorder /* return # of nodes postordered */ +( + /* ---- input ---- */ + int64_t *Parent, /* size n. Parent [j] = p if p is the parent of j */ + size_t n, + int64_t *Weight_p, /* size n, optional. Weight [j] is weight of node j */ + /* ---- output --- */ + int64_t *Post, /* size n. Post [k] = j is kth in postordered tree */ + /* --------------- */ + cholmod_common *Common +) ; + +template int64_t spqr_nnz +( + cholmod_sparse *A, + cholmod_common *Common +) ; +template <> int64_t spqr_nnz +( + cholmod_sparse *A, + cholmod_common *Common +) ; +template <> int64_t spqr_nnz +( + cholmod_sparse *A, + cholmod_common *Common +) ; + +template cholmod_sparse *spqr_dense_to_sparse +( + /* ---- input ---- */ + cholmod_dense *X, /* matrix to copy */ + int values, /* TRUE if values to be copied, FALSE otherwise */ + /* --------------- */ + cholmod_common *Common +) ; +template <> cholmod_sparse *spqr_dense_to_sparse +( + /* ---- input ---- */ + cholmod_dense *X, /* matrix to copy */ + int values, /* TRUE if values to be copied, FALSE otherwise */ + /* --------------- */ + cholmod_common *Common +) ; +template <> cholmod_sparse *spqr_dense_to_sparse +( + /* ---- input ---- */ + cholmod_dense *X, /* matrix to copy */ + int values, /* TRUE if values to be copied, FALSE otherwise */ + /* --------------- */ + cholmod_common *Common +) ; + +template cholmod_dense *spqr_sparse_to_dense +( + /* ---- input ---- */ + cholmod_sparse *A, /* matrix to copy */ + /* --------------- */ + cholmod_common *Common +) ; +template <> cholmod_dense *spqr_sparse_to_dense +( + /* ---- input ---- */ + cholmod_sparse *A, /* matrix to copy */ + /* --------------- */ + cholmod_common *Common +) ; +template <> cholmod_dense *spqr_sparse_to_dense +( + /* ---- input ---- */ + cholmod_sparse *A, /* matrix to copy */ + /* --------------- */ + cholmod_common *Common +) ; + +template cholmod_sparse *spqr_speye +( + /* ---- input ---- */ + size_t nrow, /* # of rows of A */ + size_t ncol, /* # of columns of A */ + int xtype, /* CHOLMOD_PATTERN, _REAL, _COMPLEX, or _ZOMPLEX */ + /* --------------- */ + cholmod_common *Common +) ; +template <> cholmod_sparse *spqr_speye +( + /* ---- input ---- */ + size_t nrow, /* # of rows of A */ + size_t ncol, /* # of columns of A */ + int xtype, /* CHOLMOD_PATTERN, _REAL, _COMPLEX, or _ZOMPLEX */ + /* --------------- */ + cholmod_common *Common +) ; +template <> cholmod_sparse *spqr_speye +( + /* ---- input ---- */ + size_t nrow, /* # of rows of A */ + size_t ncol, /* # of columns of A */ + int xtype, /* CHOLMOD_PATTERN, _REAL, _COMPLEX, or _ZOMPLEX */ + /* --------------- */ + cholmod_common *Common +) ; + + +template int spqr_free_work +( + cholmod_common *Common +) ; + +template <> int spqr_free_work +( + cholmod_common *Common +) ; + +template <> int spqr_free_work +( + cholmod_common *Common +) ; + +template cholmod_dense *spqr_zeros +( + /* ---- input ---- */ + size_t nrow, /* # of rows of matrix */ + size_t ncol, /* # of columns of matrix */ + int xtype, /* CHOLMOD_REAL, _COMPLEX, or _ZOMPLEX */ + /* --------------- */ + cholmod_common *Common +) ; + +template <> cholmod_dense *spqr_zeros +( + /* ---- input ---- */ + size_t nrow, /* # of rows of matrix */ + size_t ncol, /* # of columns of matrix */ + int xtype, /* CHOLMOD_REAL, _COMPLEX, or _ZOMPLEX */ + /* --------------- */ + cholmod_common *Common +) ; + +template <> cholmod_dense *spqr_zeros +( + /* ---- input ---- */ + size_t nrow, /* # of rows of matrix */ + size_t ncol, /* # of columns of matrix */ + int xtype, /* CHOLMOD_REAL, _COMPLEX, or _ZOMPLEX */ + /* --------------- */ + cholmod_common *Common +) ; + +template cholmod_dense *spqr_ones +( + /* ---- input ---- */ + size_t nrow, /* # of rows of matrix */ + size_t ncol, /* # of columns of matrix */ + int xtype, /* CHOLMOD_REAL, _COMPLEX, or _ZOMPLEX */ + /* --------------- */ + cholmod_common *Common +) ; + +template <> cholmod_dense *spqr_ones +( + /* ---- input ---- */ + size_t nrow, /* # of rows of matrix */ + size_t ncol, /* # of columns of matrix */ + int xtype, /* CHOLMOD_REAL, _COMPLEX, or _ZOMPLEX */ + /* --------------- */ + cholmod_common *Common +) ; + +template <> cholmod_dense *spqr_ones +( + /* ---- input ---- */ + size_t nrow, /* # of rows of matrix */ + size_t ncol, /* # of columns of matrix */ + int xtype, /* CHOLMOD_REAL, _COMPLEX, or _ZOMPLEX */ + /* --------------- */ + cholmod_common *Common +) ; + +template cholmod_sparse *spqr_ssmult +( + /* ---- input ---- */ + cholmod_sparse *A, /* left matrix to multiply */ + cholmod_sparse *B, /* right matrix to multiply */ + int stype, /* requested stype of C */ + int values, /* TRUE: do numerical values, FALSE: pattern only */ + int sorted, /* if TRUE then return C with sorted columns */ + /* --------------- */ + cholmod_common *Common +) ; + +template <> cholmod_sparse *spqr_ssmult +( + /* ---- input ---- */ + cholmod_sparse *A, /* left matrix to multiply */ + cholmod_sparse *B, /* right matrix to multiply */ + int stype, /* requested stype of C */ + int values, /* TRUE: do numerical values, FALSE: pattern only */ + int sorted, /* if TRUE then return C with sorted columns */ + /* --------------- */ + cholmod_common *Common +) ; + +template <> cholmod_sparse *spqr_ssmult +( + /* ---- input ---- */ + cholmod_sparse *A, /* left matrix to multiply */ + cholmod_sparse *B, /* right matrix to multiply */ + int stype, /* requested stype of C */ + int values, /* TRUE: do numerical values, FALSE: pattern only */ + int sorted, /* if TRUE then return C with sorted columns */ + /* --------------- */ + cholmod_common *Common +) ; + + +template cholmod_sparse *spqr_ssadd +( + /* ---- input ---- */ + cholmod_sparse *A, /* matrix to add */ + cholmod_sparse *B, /* matrix to add */ + double alpha [2], /* scale factor for A */ + double beta [2], /* scale factor for B */ + int values, /* if TRUE compute the numerical values of C */ + int sorted, /* if TRUE, sort columns of C */ + /* --------------- */ + cholmod_common *Common +) ; + +template <> cholmod_sparse *spqr_ssadd +( + /* ---- input ---- */ + cholmod_sparse *A, /* matrix to add */ + cholmod_sparse *B, /* matrix to add */ + double alpha [2], /* scale factor for A */ + double beta [2], /* scale factor for B */ + int values, /* if TRUE compute the numerical values of C */ + int sorted, /* if TRUE, sort columns of C */ + /* --------------- */ + cholmod_common *Common +) ; + +template <> cholmod_sparse *spqr_ssadd +( + /* ---- input ---- */ + cholmod_sparse *A, /* matrix to add */ + cholmod_sparse *B, /* matrix to add */ + double alpha [2], /* scale factor for A */ + double beta [2], /* scale factor for B */ + int values, /* if TRUE compute the numerical values of C */ + int sorted, /* if TRUE, sort columns of C */ + /* --------------- */ + cholmod_common *Common +) ; + + +template int spqr_sdmult +( + /* ---- input ---- */ + cholmod_sparse *A, /* sparse matrix to multiply */ + int transpose, /* use A if 0, or A' otherwise */ + double alpha [2], /* scale factor for A */ + double beta [2], /* scale factor for Y */ + cholmod_dense *X, /* dense matrix to multiply */ + /* ---- in/out --- */ + cholmod_dense *Y, /* resulting dense matrix */ + /* --------------- */ + cholmod_common *Common +) ; + +template <> int spqr_sdmult +( + /* ---- input ---- */ + cholmod_sparse *A, /* sparse matrix to multiply */ + int transpose, /* use A if 0, or A' otherwise */ + double alpha [2], /* scale factor for A */ + double beta [2], /* scale factor for Y */ + cholmod_dense *X, /* dense matrix to multiply */ + /* ---- in/out --- */ + cholmod_dense *Y, /* resulting dense matrix */ + /* --------------- */ + cholmod_common *Common +) ; + +template <> int spqr_sdmult +( + /* ---- input ---- */ + cholmod_sparse *A, /* sparse matrix to multiply */ + int transpose, /* use A if 0, or A' otherwise */ + double alpha [2], /* scale factor for A */ + double beta [2], /* scale factor for Y */ + cholmod_dense *X, /* dense matrix to multiply */ + /* ---- in/out --- */ + cholmod_dense *Y, /* resulting dense matrix */ + /* --------------- */ + cholmod_common *Common +) ; + + + +template double spqr_norm_sparse +( + /* ---- input ---- */ + cholmod_sparse *A, /* matrix to compute the norm of */ + int norm, /* type of norm: 0: inf. norm, 1: 1-norm */ + /* --------------- */ + cholmod_common *Common +) ; + +template <> double spqr_norm_sparse +( + /* ---- input ---- */ + cholmod_sparse *A, /* matrix to compute the norm of */ + int norm, /* type of norm: 0: inf. norm, 1: 1-norm */ + /* --------------- */ + cholmod_common *Common +) ; + +template <> double spqr_norm_sparse +( + /* ---- input ---- */ + cholmod_sparse *A, /* matrix to compute the norm of */ + int norm, /* type of norm: 0: inf. norm, 1: 1-norm */ + /* --------------- */ + cholmod_common *Common +) ; + + +template double spqr_norm_dense +( + /* ---- input ---- */ + cholmod_dense *X, /* matrix to compute the norm of */ + int norm, /* type of norm: 0: inf. norm, 1: 1-norm, 2: 2-norm */ + /* --------------- */ + cholmod_common *Common +) ; + +template <> double spqr_norm_dense +( + /* ---- input ---- */ + cholmod_dense *X, /* matrix to compute the norm of */ + int norm, /* type of norm: 0: inf. norm, 1: 1-norm, 2: 2-norm */ + /* --------------- */ + cholmod_common *Common +) ; + +template <> double spqr_norm_dense +( + /* ---- input ---- */ + cholmod_dense *X, /* matrix to compute the norm of */ + int norm, /* type of norm: 0: inf. norm, 1: 1-norm, 2: 2-norm */ + /* --------------- */ + cholmod_common *Common +) ; + + +template cholmod_dense *spqr_copy_dense +( + /* ---- input ---- */ + cholmod_dense *X, /* matrix to copy */ + /* --------------- */ + cholmod_common *Common +) ; + +template <> cholmod_dense *spqr_copy_dense +( + /* ---- input ---- */ + cholmod_dense *X, /* matrix to copy */ + /* --------------- */ + cholmod_common *Common +) ; + +template <> cholmod_dense *spqr_copy_dense +( + /* ---- input ---- */ + cholmod_dense *X, /* matrix to copy */ + /* --------------- */ + cholmod_common *Common +) ; + +template cholmod_sparse *spqr_copy +( + /* ---- input ---- */ + cholmod_sparse *A, /* matrix to copy */ + int stype, /* requested stype of C */ + int mode, /* >0: numerical, 0: pattern, <0: pattern (no diag) */ + /* --------------- */ + cholmod_common *Common +) ; + +template <> cholmod_sparse *spqr_copy +( + /* ---- input ---- */ + cholmod_sparse *A, /* matrix to copy */ + int stype, /* requested stype of C */ + int mode, /* >0: numerical, 0: pattern, <0: pattern (no diag) */ + /* --------------- */ + cholmod_common *Common +) ; + +template <> cholmod_sparse *spqr_copy +( + /* ---- input ---- */ + cholmod_sparse *A, /* matrix to copy */ + int stype, /* requested stype of C */ + int mode, /* >0: numerical, 0: pattern, <0: pattern (no diag) */ + /* --------------- */ + cholmod_common *Common +) ; + +template int spqr_sparse_xtype +( + /* ---- input ---- */ + int to_xtype, /* requested xtype (pattern, real, complex, zomplex) */ + /* ---- in/out --- */ + cholmod_sparse *A, /* sparse matrix to change */ + /* --------------- */ + cholmod_common *Common +) ; + +template <> int spqr_sparse_xtype +( + /* ---- input ---- */ + int to_xtype, /* requested xtype (pattern, real, complex, zomplex) */ + /* ---- in/out --- */ + cholmod_sparse *A, /* sparse matrix to change */ + /* --------------- */ + cholmod_common *Common +) ; + +template <> int spqr_sparse_xtype +( + /* ---- input ---- */ + int to_xtype, /* requested xtype (pattern, real, complex, zomplex) */ + /* ---- in/out --- */ + cholmod_sparse *A, /* sparse matrix to change */ + /* --------------- */ + cholmod_common *Common +) ; + +template int spqr_gpu_memorysize +( + size_t *total_mem, + size_t *available_mem, + cholmod_common *Common +) ; + +template <> int spqr_gpu_memorysize +( + size_t *total_mem, + size_t *available_mem, + cholmod_common *Common +) ; + +template <> int spqr_gpu_memorysize +( + size_t *total_mem, + size_t *available_mem, + cholmod_common *Common +) ; + + +template cholmod_sparse *spqr_read_sparse +( + /* ---- input ---- */ + FILE *f, /* file to read from, must already be open */ + /* --------------- */ + cholmod_common *Common +) ; + +template <> cholmod_sparse *spqr_read_sparse +( + /* ---- input ---- */ + FILE *f, /* file to read from, must already be open */ + /* --------------- */ + cholmod_common *Common +) ; + +template <> cholmod_sparse *spqr_read_sparse +( + /* ---- input ---- */ + FILE *f, /* file to read from, must already be open */ + /* --------------- */ + cholmod_common *Common +) ; + diff --git a/SPQR/Include/spqrgpu.hpp b/SPQR/Include/spqrgpu.hpp index ca262c29d..3512eb8ea 100644 --- a/SPQR/Include/spqrgpu.hpp +++ b/SPQR/Include/spqrgpu.hpp @@ -12,78 +12,82 @@ #include "GPUQREngine_SuiteSparse.hpp" -void spqrgpu_kernel +template void spqrgpu_kernel ( - spqr_blob *Blob // contains the entire problem input/output + spqr_blob *Blob // contains the entire problem input/output ) ; -void spqrgpu_kernel // placeholder, since complex case not supported + +template +void spqrgpu_kernel ( - spqr_blob *Blob + spqr_blob *Blob ) ; +template void spqrgpu_computeFrontStaging ( // inputs, not modified on output - int64_t numFronts, // total number of fronts (nf in caller) - int64_t *Parent, // size nf+1, assembly tree (f=nf is placeholder) - int64_t *Childp, // size nf+2, children of f are + Int numFronts, // total number of fronts (nf in caller) + Int *Parent, // size nf+1, assembly tree (f=nf is placeholder) + Int *Childp, // size nf+2, children of f are // Child [Childp [f] ... Childp [f+1]-1] - int64_t *Child, // size nf+1. + Int *Child, // size nf+1. - int64_t *Fm, // size nf+1, front f has Fm [f] rows - int64_t *Cm, // size nf+1, front f has Cm [f] rows in contrib - int64_t *Rp, // size nf+1, Rj[Rp[f]...Rp[f+1]-1] are the cols in f - int64_t *Sp, // size m+1, row pointers for sparse matrix S - int64_t *Sleft, // size n+2, see spqr_stranspose for description - int64_t *Super, // size nf+1, front f pivotal cols are + Int *Fm, // size nf+1, front f has Fm [f] rows + Int *Cm, // size nf+1, front f has Cm [f] rows in contrib + Int *Rp, // size nf+1, Rj[Rp[f]...Rp[f+1]-1] are the cols in f + Int *Sp, // size m+1, row pointers for sparse matrix S + Int *Sleft, // size n+2, see spqr_stranspose for description + Int *Super, // size nf+1, front f pivotal cols are // Super[f]..Super[f+1]-1 - int64_t *Post, // size nf+1, front f is kth, if f = Post [k] + Int *Post, // size nf+1, front f is kth, if f = Post [k] - int64_t RimapSize, // scalar, size of Rimap on the GPU (# of int's) - int64_t RjmapSize, // scalar, size of Rjmap on the GPU (# of int's) + Int RimapSize, // scalar, size of Rimap on the GPU (# of int's) + Int RjmapSize, // scalar, size of Rjmap on the GPU (# of int's) // output, not defined on input: bool *feasible, // scalar, true if feasible, false if GPU memory too low - int64_t *numStages, // scalar, number of stages - int64_t *Stagingp, // size nf+2, fronts are in the list + Int *numStages, // scalar, number of stages + Int *Stagingp, // size nf+2, fronts are in the list // Post [Stagingp [stage]...Stagingp[stage+1]-1] - int64_t *StageMap, // size nf, front f is in stage StageMap [f] + Int *StageMap, // size nf, front f is in stage StageMap [f] size_t *FSize, // size nf+1, FSize[stage]: size in bytes of MongoF size_t *RSize, // size nf+1, Rsize[stage]: size in bytes of MongoR size_t *SSize, // size nf+1, Ssize[stage]: size in bytes of S - int64_t *FOffsets, // size nf, front f in MondoF [FOffsets[f]...] on GPU - int64_t *ROffsets, // size nf, R block in MondoR [Roffsets[f]...] on CPU - int64_t *SOffsets, // size nf, S entries for front f are in + Int *FOffsets, // size nf, front f in MondoF [FOffsets[f]...] on GPU + Int *ROffsets, // size nf, R block in MondoR [Roffsets[f]...] on CPU + Int *SOffsets, // size nf, S entries for front f are in // wsS [SOffsets[f]...] // input/output: cholmod_common *cc ); +template void spqrgpu_buildAssemblyMaps ( - int64_t numFronts, - int64_t n, - int64_t *Fmap, - int64_t *Post, - int64_t *Super, - int64_t *Rp, - int64_t *Rj, - int64_t *Sleft, - int64_t *Sp, - int64_t *Sj, + Int numFronts, + Int n, + Int *Fmap, + Int *Post, + Int *Super, + Int *Rp, + Int *Rj, + Int *Sleft, + Int *Sp, + Int *Sj, double *Sx, - int64_t *Fm, - int64_t *Cm, - int64_t *Childp, - int64_t *Child, - int64_t *CompleteStair, + Int *Fm, + Int *Cm, + Int *Childp, + Int *Child, + Int *CompleteStair, int *CompleteRjmap, - int64_t *RjmapOffsets, + Int *RjmapOffsets, int *CompleteRimap, - int64_t *RimapOffsets, + Int *RimapOffsets, SEntry *cpuS ); diff --git a/SPQR/Makefile b/SPQR/Makefile index 39183aa3c..b438532f3 100644 --- a/SPQR/Makefile +++ b/SPQR/Makefile @@ -58,8 +58,13 @@ debug: all: library -demos: library +demos: demos64 demos32 + +demos64: library ( cd build && cmake $(CMAKE_OPTIONS) -DDEMO=1 .. && cmake --build . --config Release -j${JOBS} ) + - ./build/qrdemo < Matrix/a00.mtx + - ./build/qrdemo < Matrix/a01.mtx + - ./build/qrdemo < Matrix/a10.mtx - ./build/qrsimple < Matrix/ash219.mtx - ./build/qrsimplec < Matrix/ash219.mtx - ./build/qrsimple < Matrix/west0067.mtx @@ -121,6 +126,70 @@ demos: library - ./build/qrdemoc < Matrix/young1c.mtx - ./build/qrdemoc < Matrix/lp_e226_transposed.mtx +demos32: library + ( cd build && cmake $(CMAKE_OPTIONS) -DDEMO=1 .. && cmake --build . --config Release -j${JOBS} ) + - ./build/qrdemo_int32 < Matrix/a00.mtx + - ./build/qrdemo_int32 < Matrix/a01.mtx + - ./build/qrdemo_int32 < Matrix/a10.mtx + - ./build/qrsimplec_int32 < Matrix/ash219.mtx + - ./build/qrsimplec_int32 < Matrix/west0067.mtx + - ./build/qrdemo_int32 < Matrix/a2.mtx + - ./build/qrdemo_int32 < Matrix/r2.mtx + - ./build/qrdemo_int32 < Matrix/a04.mtx + - ./build/qrdemo_int32 < Matrix/a2.mtx + - ./build/qrdemo_int32 < Matrix/west0067.mtx + - ./build/qrdemo_int32 < Matrix/c2.mtx + - ./build/qrdemo_int32 < Matrix/a0.mtx + - ./build/qrdemo_int32 < Matrix/lfat5b.mtx + - ./build/qrdemo_int32 < Matrix/bfwa62.mtx + - ./build/qrdemo_int32 < Matrix/LFAT5.mtx + - ./build/qrdemo_int32 < Matrix/b1_ss.mtx + - ./build/qrdemo_int32 < Matrix/bcspwr01.mtx + - ./build/qrdemo_int32 < Matrix/lpi_galenet.mtx + - ./build/qrdemo_int32 < Matrix/lpi_itest6.mtx + - ./build/qrdemo_int32 < Matrix/ash219.mtx + - ./build/qrdemo_int32 < Matrix/a4.mtx + - ./build/qrdemo_int32 < Matrix/s32.mtx + - ./build/qrdemo_int32 < Matrix/c32.mtx + - ./build/qrdemo_int32 < Matrix/lp_share1b.mtx + - ./build/qrdemo_int32 < Matrix/a1.mtx + - ./build/qrdemo_int32 < Matrix/GD06_theory.mtx + - ./build/qrdemo_int32 < Matrix/GD01_b.mtx + - ./build/qrdemo_int32 < Matrix/Tina_AskCal_perm.mtx + - ./build/qrdemo_int32 < Matrix/Tina_AskCal.mtx + - ./build/qrdemo_int32 < Matrix/GD98_a.mtx + - ./build/qrdemo_int32 < Matrix/Ragusa16.mtx + - ./build/qrdemo_int32 < Matrix/young1c.mtx + - ./build/qrdemo_int32 < Matrix/lp_e226_transposed.mtx + - ./build/qrdemoc_int32 < Matrix/a2.mtx + - ./build/qrdemoc_int32 < Matrix/r2.mtx + - ./build/qrdemoc_int32 < Matrix/a04.mtx + - ./build/qrdemoc_int32 < Matrix/a2.mtx + - ./build/qrdemoc_int32 < Matrix/west0067.mtx + - ./build/qrdemoc_int32 < Matrix/c2.mtx + - ./build/qrdemoc_int32 < Matrix/a0.mtx + - ./build/qrdemoc_int32 < Matrix/lfat5b.mtx + - ./build/qrdemoc_int32 < Matrix/bfwa62.mtx + - ./build/qrdemoc_int32 < Matrix/LFAT5.mtx + - ./build/qrdemoc_int32 < Matrix/b1_ss.mtx + - ./build/qrdemoc_int32 < Matrix/bcspwr01.mtx + - ./build/qrdemoc_int32 < Matrix/lpi_galenet.mtx + - ./build/qrdemoc_int32 < Matrix/lpi_itest6.mtx + - ./build/qrdemoc_int32 < Matrix/ash219.mtx + - ./build/qrdemoc_int32 < Matrix/a4.mtx + - ./build/qrdemoc_int32 < Matrix/s32.mtx + - ./build/qrdemoc_int32 < Matrix/c32.mtx + - ./build/qrdemoc_int32 < Matrix/lp_share1b.mtx + - ./build/qrdemoc_int32 < Matrix/a1.mtx + - ./build/qrdemoc_int32 < Matrix/GD06_theory.mtx + - ./build/qrdemoc_int32 < Matrix/GD01_b.mtx + - ./build/qrdemoc_int32 < Matrix/Tina_AskCal_perm.mtx + - ./build/qrdemoc_int32 < Matrix/Tina_AskCal.mtx + - ./build/qrdemoc_int32 < Matrix/GD98_a.mtx + - ./build/qrdemoc_int32 < Matrix/Ragusa16.mtx + - ./build/qrdemoc_int32 < Matrix/young1c.mtx + - ./build/qrdemoc_int32 < Matrix/lp_e226_transposed.mtx + cov: ( cd Tcov && $(MAKE) ) diff --git a/SPQR/Matrix/a00.mtx b/SPQR/Matrix/a00.mtx new file mode 100644 index 000000000..a57283899 --- /dev/null +++ b/SPQR/Matrix/a00.mtx @@ -0,0 +1,2 @@ +%%MatrixMarket matrix coordinate pattern general +0 0 0 diff --git a/SPQR/Matrix/a01.mtx b/SPQR/Matrix/a01.mtx new file mode 100644 index 000000000..36bea2d6d --- /dev/null +++ b/SPQR/Matrix/a01.mtx @@ -0,0 +1,2 @@ +%%MatrixMarket matrix coordinate pattern general +0 1 0 diff --git a/SPQR/Matrix/a10.mtx b/SPQR/Matrix/a10.mtx new file mode 100644 index 000000000..8c10b7a06 --- /dev/null +++ b/SPQR/Matrix/a10.mtx @@ -0,0 +1,2 @@ +%%MatrixMarket matrix coordinate pattern general +1 0 0 diff --git a/SPQR/SPQRGPU/CMakeLists.txt b/SPQR/SPQRGPU/CMakeLists.txt index 353a82b60..4b4ec76a8 100644 --- a/SPQR/SPQRGPU/CMakeLists.txt +++ b/SPQR/SPQRGPU/CMakeLists.txt @@ -11,7 +11,7 @@ #------------------------------------------------------------------------------- # cmake 3.22 is required to find the BLAS/LAPACK -cmake_minimum_required ( VERSION 3.19 ) +cmake_minimum_required ( VERSION 3.20 ) message ( STATUS "Building SPQR_CUDA version: v" ${SPQR_VERSION_MAJOR}. @@ -20,36 +20,28 @@ message ( STATUS "Building SPQR_CUDA version: v" include ( SuiteSparsePolicy ) -if ( SUITESPARSE_CUDA ) - project ( spqr_cuda - VERSION "${SPQR_VERSION_MAJOR}.${SPQR_VERSION_MINOR}.${SPQR_VERSION_SUB}" - LANGUAGES C CXX CUDA ) - set ( CMAKE_CUDA_FLAGS "-cudart=static -lineinfo -DSUITESPARSE_CUDA" ) - set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSUITESPARSE_CUDA" ) - message ( STATUS "C++ flags for CUDA: ${CMAKE_CXX_FLAGS}" ) - message ( STATUS "nvcc flags for CUDA: ${CMAKE_CUDA_FLAGS}" ) -else ( ) - project ( spqr_cuda - VERSION "${SPQR_VERSION_MAJOR}.${SPQR_VERSION_MINOR}.${SPQR_VERSION_SUB}" - LANGUAGES C CXX ) -endif ( ) +project ( spqr_cuda + VERSION "${SPQR_VERSION_MAJOR}.${SPQR_VERSION_MINOR}.${SPQR_VERSION_SUB}" + LANGUAGES CXX ) +message ( STATUS "C++ flags for CUDA: ${CMAKE_CXX_FLAGS}" ) file ( GLOB SPQR_CUDA_SOURCES "spqrgpu_*.cpp" ) -add_library ( spqr_cuda SHARED ${SPQR_CUDA_SOURCES} ) +add_library ( SPQR_CUDA SHARED ${SPQR_CUDA_SOURCES} ) -set_target_properties ( spqr_cuda PROPERTIES +set_target_properties ( SPQR_CUDA PROPERTIES VERSION ${SPQR_VERSION_MAJOR}.${SPQR_VERSION_MINOR}.${SPQR_VERSION_SUB} CXX_STANDARD_REQUIRED ON CXX_STANDARD 17 C_STANDARD_REQUIRED ON C_STANDARD 11 + OUTPUT_NAME spqr_cuda SOVERSION ${SPQR_VERSION_MAJOR} ) if ( NOT NSTATIC ) - add_library ( spqr_cuda_static STATIC ${SPQR_CUDA_SOURCES} ) + add_library ( SPQR_CUDA_static STATIC ${SPQR_CUDA_SOURCES} ) - set_target_properties ( spqr_cuda_static PROPERTIES + set_target_properties ( SPQR_CUDA_static PROPERTIES VERSION ${SPQR_VERSION_MAJOR}.${SPQR_VERSION_MINOR}.${SPQR_VERSION_SUB} CXX_STANDARD_REQUIRED ON CXX_STANDARD 17 @@ -59,54 +51,128 @@ if ( NOT NSTATIC ) SOVERSION ${SPQR_VERSION_MAJOR} ) if ( MSVC ) - set_target_properties ( spqr_cuda_static PROPERTIES - OUTPUT_NAME spqr_cuda_static ) + set_target_properties ( SPQR_CUDA_static PROPERTIES + OUTPUT_NAME SPQR_CUDA_static ) endif ( ) endif ( ) -set ( SPQR_CUDA_INCLUDES - ../../GPUQREngine/Include - ../../SuiteSparse_GPURuntime/Include - ../../SuiteSparse_config - ../../CHOLMOD/Include - ../Include ) +set ( SPQR_CUDA_INCLUDES ../Include ) + +if ( TARGET SuiteSparse::GPUQREngine ) + target_include_directories ( SPQR_CUDA PRIVATE + "$" ) + target_include_directories ( SPQR_CUDA_static PRIVATE + "$" ) +endif ( ) -include_directories ( ${SPQR_CUDA_INCLUDES} ${CUDAToolkit_INCLUDE_DIRS} ) +if ( TARGET SuiteSparse::GPURuntime ) + target_include_directories ( SPQR_CUDA PRIVATE + "$" ) + target_include_directories ( SPQR_CUDA_static PRIVATE + "$" ) +endif ( ) -target_include_directories ( spqr_cuda PUBLIC +target_include_directories ( SPQR_CUDA PRIVATE ${CUDAToolkit_INCLUDE_DIRS} - ${SPQR_CUDA_INCLUDES} ) -set_target_properties ( spqr_cuda PROPERTIES POSITION_INDEPENDENT_CODE ON ) -set_target_properties ( spqr_cuda PROPERTIES CUDA_SEPARABLE_COMPILATION ON ) + ${SPQR_CUDA_INCLUDES} + "$" ) +set_target_properties ( SPQR_CUDA PROPERTIES POSITION_INDEPENDENT_CODE ON ) +set_target_properties ( SPQR_CUDA PROPERTIES CUDA_SEPARABLE_COMPILATION ON ) +target_compile_definitions ( SPQR_CUDA PRIVATE "SUITESPARSE_CUDA" ) if ( NOT NSTATIC ) - target_include_directories ( spqr_cuda_static PUBLIC - ${CUDAToolkit_INCLUDE_DIRS} - ${SPQR_CUDA_INCLUDES} ) - set_target_properties ( spqr_cuda_static PROPERTIES CUDA_SEPARABLE_COMPILATION on ) - set_target_properties ( spqr_cuda_static PROPERTIES POSITION_INDEPENDENT_CODE on ) - target_link_libraries ( spqr_cuda_static PUBLIC ${CHOLMOD_LIBRARIES} ) + target_include_directories ( SPQR_CUDA_static PRIVATE + ${CUDAToolkit_INCLUDE_DIRS} + ${SPQR_CUDA_INCLUDES} + "$" ) + set_target_properties ( SPQR_CUDA_static PROPERTIES CUDA_SEPARABLE_COMPILATION ON ) + set_target_properties ( SPQR_CUDA_static PROPERTIES POSITION_INDEPENDENT_CODE ON ) + target_compile_definitions ( SPQR_CUDA_static PRIVATE "SUITESPARSE_CUDA" ) + + + if ( TARGET SuiteSparse::CHOLMOD_static ) + target_link_libraries ( SPQR_CUDA_static PUBLIC SuiteSparse::CHOLMOD_static ) + else ( ) + target_link_libraries ( SPQR_CUDA_static PUBLIC SuiteSparse::CHOLMOD ) + endif ( ) endif ( ) -target_link_libraries ( spqr_cuda PRIVATE ${CHOLMOD_LIBRARIES} ) -if ( SUITESPARSE_CUDA ) - target_link_libraries ( spqr_cuda PRIVATE CUDA::nvrtc CUDA::cudart_static +target_link_libraries ( SPQR_CUDA PRIVATE SuiteSparse::CHOLMOD ) + +target_link_libraries ( SPQR_CUDA PRIVATE CUDA::nvrtc CUDA::cudart_static + CUDA::nvToolsExt CUDA::cublas ) +if ( NOT NSTATIC ) + target_link_libraries ( SPQR_CUDA_static PUBLIC CUDA::nvrtc CUDA::cudart_static CUDA::nvToolsExt CUDA::cublas ) - if ( NOT NSTATIC ) - target_link_libraries ( spqr_cuda_static PUBLIC CUDA::nvrtc CUDA::cudart_static - CUDA::nvToolsExt CUDA::cublas ) - endif ( ) endif ( ) #------------------------------------------------------------------------------- # installation location #------------------------------------------------------------------------------- -install ( TARGETS spqr_cuda +include ( CMakePackageConfigHelpers ) + +install ( TARGETS SPQR_CUDA + EXPORT SPQR_CUDATargets LIBRARY DESTINATION ${SUITESPARSE_LIBDIR} ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} RUNTIME DESTINATION ${SUITESPARSE_BINDIR} ) + if ( NOT NSTATIC ) - install ( TARGETS spqr_cuda_static - ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} ) +install ( TARGETS SPQR_CUDA_static + EXPORT SPQR_CUDATargets + ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} ) +endif ( ) + +# create (temporary) export target file during build +export ( EXPORT SPQR_CUDATargets + NAMESPACE SuiteSparse:: + FILE ${CMAKE_CURRENT_BINARY_DIR}/../SPQR_CUDATargets.cmake ) + +# install export target, config and version files for find_package +install ( EXPORT SPQR_CUDATargets + NAMESPACE SuiteSparse:: + DESTINATION ${SUITESPARSE_LIBDIR}/cmake/SPQR_CUDA ) + +configure_package_config_file ( + ../Config/SPQR_CUDAConfig.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/../SPQR_CUDAConfig.cmake + INSTALL_DESTINATION ${SUITESPARSE_LIBDIR}/cmake/SPQR_CUDA ) + +write_basic_package_version_file ( + ${CMAKE_CURRENT_BINARY_DIR}/../SPQR_CUDAConfigVersion.cmake + COMPATIBILITY SameMajorVersion ) + +install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/../SPQR_CUDAConfig.cmake + ${CMAKE_CURRENT_BINARY_DIR}/../SPQR_CUDAConfigVersion.cmake + DESTINATION ${SUITESPARSE_LIBDIR}/cmake/SPQR_CUDA ) + +#------------------------------------------------------------------------------- +# create pkg-config file +#------------------------------------------------------------------------------- + +if ( NOT MSVC ) + set ( prefix "${CMAKE_INSTALL_PREFIX}" ) + set ( exec_prefix "\${prefix}" ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) + if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) + set ( libdir "${SUITESPARSE_LIBDIR}") + else ( ) + set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") + endif ( ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) + if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) + set ( includedir "${SUITESPARSE_INCLUDEDIR}") + else ( ) + set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + endif ( ) + configure_file ( + ../Config/SPQR_CUDA.pc.in + SPQR_CUDA.pc + @ONLY + NEWLINE_STYLE LF ) + install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/SPQR_CUDA.pc + DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) endif ( ) diff --git a/SPQR/SPQRGPU/spqrgpu_buildAssemblyMaps.cpp b/SPQR/SPQRGPU/spqrgpu_buildAssemblyMaps.cpp index f8298d043..857b4f9c9 100644 --- a/SPQR/SPQRGPU/spqrgpu_buildAssemblyMaps.cpp +++ b/SPQR/SPQRGPU/spqrgpu_buildAssemblyMaps.cpp @@ -13,28 +13,29 @@ #ifdef SUITESPARSE_CUDA +template void spqrgpu_buildAssemblyMaps ( - int64_t numFronts, - int64_t n, - int64_t *Fmap, - int64_t *Post, - int64_t *Super, - int64_t *Rp, - int64_t *Rj, - int64_t *Sleft, - int64_t *Sp, - int64_t *Sj, + Int numFronts, + Int n, + Int *Fmap, + Int *Post, + Int *Super, + Int *Rp, + Int *Rj, + Int *Sleft, + Int *Sp, + Int *Sj, double *Sx, - int64_t *Fm, - int64_t *Cm, - int64_t *Childp, - int64_t *Child, - int64_t *CompleteStair, + Int *Fm, + Int *Cm, + Int *Childp, + Int *Child, + Int *CompleteStair, int *CompleteRjmap, - int64_t *RjmapOffsets, + Int *RjmapOffsets, int *CompleteRimap, - int64_t *RimapOffsets, + Int *RimapOffsets, SEntry *cpuS ) { @@ -42,64 +43,64 @@ void spqrgpu_buildAssemblyMaps PR (("GPU: building assembly maps:\n")) ; /* Use Fmap and Stair to map a front's local rows to global rows. */ - int64_t sindex = 0; + Int sindex = 0; - for(int64_t pf=0; pf= 0 && c < f) ; int *Rjmap = CompleteRjmap + RjmapOffsets[c]; - int64_t pc = Rp [c] ; - int64_t pcend = Rp [c+1] ; - int64_t fnc = pcend - pc ; // total # cols in child F - int64_t fpc = Super [c+1] - Super [c] ; // # of pivot cols in child - int64_t cm = Cm [c] ; // # of rows in child C - int64_t cn = fnc - fpc ; // # of cols in child C + Int pc = Rp [c] ; + Int pcend = Rp [c+1] ; + Int fnc = pcend - pc ; // total # cols in child F + Int fpc = Super [c+1] - Super [c] ; // # of pivot cols in child + Int cm = Cm [c] ; // # of rows in child C + Int cn = fnc - fpc ; // # of cols in child C // Create the relative column indices of the child's contributions // to the parent. The global column 'col' in the child is a // contribution to the jth column of its parent front. j is // a relative column index. - for (int64_t pp=0 ; pp= 0 && j < fn) ; Stair[j]++ ; // add this row to jth staircase @@ -123,10 +124,10 @@ void spqrgpu_buildAssemblyMaps // replace Stair with cumsum ([0 Stair]), and find # rows of F // --------------------------------------------------------------------- - int64_t fm = 0 ; - for (int64_t j = 0 ; j < fn ; j++) + Int fm = 0 ; + for (Int j = 0 ; j < fn ; j++) { - int64_t t = fm ; + Int t = fm ; fm += Stair[j] ; Stair[j] = t ; } @@ -136,24 +137,24 @@ void spqrgpu_buildAssemblyMaps // pack all the S values into the cpuS workspace & advance scalar stair // --------------------------------------------------------------------- - int64_t Scount = MAX(0, Sp[Sleft[Super[f+1]]] - Sp[Sleft[Super[f]]]); + Int Scount = MAX(0, Sp[Sleft[Super[f+1]]] - Sp[Sleft[Super[f]]]); if(Scount > 0) { - for(int64_t k=0 ; k= 0 && cm <= cn) ; pc += fpc ; // pointer to column indices in C // ASSERT (pc + cn == Rp [c+1]) ; @@ -186,15 +187,65 @@ void spqrgpu_buildAssemblyMaps /* construct the Rimap */ /* -------------------------------------------------------------- */ - for (int64_t ci = 0 ; ci < cm ; ci++) + for (Int ci = 0 ; ci < cm ; ci++) { - int64_t j = Rjmap[ci] ; // global col is jth col of F + Int j = Rjmap[ci] ; // global col is jth col of F ASSERT (j >= 0 && j < fn) ; - int64_t i = Stair[j]++ ; // add row F(i,:) to jth staircase + Int i = Stair[j]++ ; // add row F(i,:) to jth staircase ASSERT (i >= 0 && i < fm) ; Rimap[ci] = i ; // keep track of the mapping } } } } + +template void spqrgpu_buildAssemblyMaps +( + int32_t numFronts, + int32_t n, + int32_t *Fmap, + int32_t *Post, + int32_t *Super, + int32_t *Rp, + int32_t *Rj, + int32_t *Sleft, + int32_t *Sp, + int32_t *Sj, + double *Sx, + int32_t *Fm, + int32_t *Cm, + int32_t *Childp, + int32_t *Child, + int32_t *CompleteStair, + int *CompleteRjmap, + int32_t *RjmapOffsets, + int *CompleteRimap, + int32_t *RimapOffsets, + SEntry *cpuS +) ; + +template void spqrgpu_buildAssemblyMaps +( + int64_t numFronts, + int64_t n, + int64_t *Fmap, + int64_t *Post, + int64_t *Super, + int64_t *Rp, + int64_t *Rj, + int64_t *Sleft, + int64_t *Sp, + int64_t *Sj, + double *Sx, + int64_t *Fm, + int64_t *Cm, + int64_t *Childp, + int64_t *Child, + int64_t *CompleteStair, + int *CompleteRjmap, + int64_t *RjmapOffsets, + int *CompleteRimap, + int64_t *RimapOffsets, + SEntry *cpuS +) ; #endif diff --git a/SPQR/SPQRGPU/spqrgpu_computeFrontStaging.cpp b/SPQR/SPQRGPU/spqrgpu_computeFrontStaging.cpp index 71538ede5..4266d8e4e 100644 --- a/SPQR/SPQRGPU/spqrgpu_computeFrontStaging.cpp +++ b/SPQR/SPQRGPU/spqrgpu_computeFrontStaging.cpp @@ -17,40 +17,41 @@ #ifdef SUITESPARSE_CUDA #include "GPUQREngine_Scheduler.hpp" +template void spqrgpu_computeFrontStaging ( // inputs, not modified on output - int64_t numFronts, // total number of fronts (nf in caller) - int64_t *Parent, // size nf+1, assembly tree (f=nf is placeholder) - int64_t *Childp, // size nf+2, children of f are + Int numFronts, // total number of fronts (nf in caller) + Int *Parent, // size nf+1, assembly tree (f=nf is placeholder) + Int *Childp, // size nf+2, children of f are // Child [Childp [f] ... Childp [f+1]-1] - int64_t *Child, // size nf+1. - - int64_t *Fm, // size nf+1, front f has Fm [f] rows - int64_t *Cm, // size nf+1, front f has Cm [f] rows in contrib - int64_t *Rp, // size nf+1, Rj[Rp[f]...Rp[f+1]-1] are the cols in f - int64_t *Sp, // size m+1, row pointers for sparse matrix S - int64_t *Sleft, // size n+2, see spqr_stranspose for description - int64_t *Super, // size nf+1, front f pivotal cols are + Int *Child, // size nf+1. + + Int *Fm, // size nf+1, front f has Fm [f] rows + Int *Cm, // size nf+1, front f has Cm [f] rows in contrib + Int *Rp, // size nf+1, Rj[Rp[f]...Rp[f+1]-1] are the cols in f + Int *Sp, // size m+1, row pointers for sparse matrix S + Int *Sleft, // size n+2, see spqr_stranspose for description + Int *Super, // size nf+1, front f pivotal cols are // Super[f]..Super[f+1]-1 - int64_t *Post, // size nf+1, front f is kth, if f = Post [k] + Int *Post, // size nf+1, front f is kth, if f = Post [k] - int64_t RimapSize, // scalar, size of Rimap on the GPU (# of int's) - int64_t RjmapSize, // scalar, size of Rimap on the GPU (# of int's) + Int RimapSize, // scalar, size of Rimap on the GPU (# of int's) + Int RjmapSize, // scalar, size of Rimap on the GPU (# of int's) // output, not defined on input: bool *feasible, // scalar, true if feasible, false if GPU memory too low - int64_t *numStages, // scalar, number of stages - int64_t *Stagingp, // size nf+2, fronts are in the list + Int *numStages, // scalar, number of stages + Int *Stagingp, // size nf+2, fronts are in the list // Post [Stagingp [stage]...Stagingp[stage+1]-1] - int64_t *StageMap, // size nf, front f is in stage StageMap [f] + Int *StageMap, // size nf, front f is in stage StageMap [f] size_t *FSize, // size nf+1, FSize[stage]: size in bytes of MongoF size_t *RSize, // size nf+1, Rsize[stage]: size in bytes of MongoR size_t *SSize, // size nf+1, Ssize[stage]: size in bytes of S - int64_t *FOffsets, // size nf, front f in MondoF [FOffsets[f]...] on GPU - int64_t *ROffsets, // size nf, R block in MondoR [Roffsets[f]...] on CPU - int64_t *SOffsets, // size nf, S entries for front f are in + Int *FOffsets, // size nf, front f in MondoF [FOffsets[f]...] on GPU + Int *ROffsets, // size nf, R block in MondoR [Roffsets[f]...] on CPU + Int *SOffsets, // size nf, S entries for front f are in // wsS [SOffsets[f]...] // input/output: @@ -128,18 +129,18 @@ void spqrgpu_computeFrontStaging /* VTMem is the amount of memory required for the VT blocks. */ size_t VTMem = 0; - int64_t stage = 0; + Int stage = 0; Stagingp[0] = 0; - for(int64_t p=0; p void numfronts_in_stage ( // input, not modified - int64_t stage, // count the # of fronts in this stage - int64_t *Stagingp, // fronts are in the list + Int stage, // count the # of fronts in this stage + Int *Stagingp, // fronts are in the list // Post [Stagingp [stage]...Stagingp[stage+1]-1] - int64_t *StageMap, // front f is in stage StageMap [f] - int64_t *Post, // array of size nf (# of fronts) - int64_t *Child, // list of children for each front is - int64_t *Childp, // in Child [Childp [f] ... Childp [f+1]-1] + Int *StageMap, // front f is in stage StageMap [f] + Int *Post, // array of size nf (# of fronts) + Int *Child, // list of children for each front is + Int *Childp, // in Child [Childp [f] ... Childp [f+1]-1] // output, not defined on input - int64_t *p_numFronts, // number of fronts in stage (a scalar) - int64_t *p_leftoverChildren // number of leftover children (a scalar) + Int *p_numFronts, // number of fronts in stage (a scalar) + Int *p_leftoverChildren // number of leftover children (a scalar) ) { // the # of fronts at this stage is given by the Stagingp workspace // plus any children within the stage that must still be assembled - int64_t sStart = Stagingp[stage]; - int64_t sEnd = Stagingp[stage+1]; - int64_t numFronts = (sEnd - sStart); - int64_t leftoverChildren = 0; - for(int64_t p=sStart; p void spqrgpu_kernel ( - spqr_blob *Blob + spqr_blob *Blob ) { @@ -89,31 +89,31 @@ void spqrgpu_kernel // get the Blob // ------------------------------------------------------------------------- - spqr_symbolic *QRsym = Blob->QRsym ; - spqr_numeric *QRnum = Blob->QRnum ; - spqr_work *Work = Blob->Work ; + spqr_symbolic *QRsym = Blob->QRsym ; + spqr_numeric *QRnum = Blob->QRnum ; + spqr_work *Work = Blob->Work ; double *Sx = Blob->Sx ; -// int64_t ntol = Blob->ntol ; // no rank detection on the GPU +// Int ntol = Blob->ntol ; // no rank detection on the GPU // ------------------------------------------------------------------------- // get the contents of the QR symbolic object // ------------------------------------------------------------------------- - int64_t * Super = QRsym->Super ; // size nf+1, gives pivot columns in F - int64_t * Rp = QRsym->Rp ; // size nf+1, pointers for pattern of R - int64_t * Rj = QRsym->Rj ; // size QRsym->rjsize, col indices of R - int64_t * Sleft = QRsym->Sleft ; // size n+2, leftmost column sets - int64_t * Sp = QRsym->Sp ; // size m+1, row pointers for S - int64_t * Sj = QRsym->Sj ; // size anz, column indices for S - int64_t * Parent = QRsym->Parent ; // size nf, for parent index - int64_t * Child = QRsym->Child ; // size nf, for lists of children - int64_t * Childp = QRsym->Childp ; // size nf+1, for lists of children - int64_t * Fm = QRsym->Fm ; // number of rows in F - int64_t * Cm = QRsym->Cm ; // # of rows in contribution blocks - int64_t nf = QRsym->nf ; // number of fronts - int64_t n = QRsym->n ; // number of columns - int64_t m = QRsym->m ; // number of rows - int64_t * Post = QRsym->Post ; // size nf + Int * Super = QRsym->Super ; // size nf+1, gives pivot columns in F + Int * Rp = QRsym->Rp ; // size nf+1, pointers for pattern of R + Int * Rj = QRsym->Rj ; // size QRsym->rjsize, col indices of R + Int * Sleft = QRsym->Sleft ; // size n+2, leftmost column sets + Int * Sp = QRsym->Sp ; // size m+1, row pointers for S + Int * Sj = QRsym->Sj ; // size anz, column indices for S + Int * Parent = QRsym->Parent ; // size nf, for parent index + Int * Child = QRsym->Child ; // size nf, for lists of children + Int * Childp = QRsym->Childp ; // size nf+1, for lists of children + Int * Fm = QRsym->Fm ; // number of rows in F + Int * Cm = QRsym->Cm ; // # of rows in contribution blocks + Int nf = QRsym->nf ; // number of fronts + Int n = QRsym->n ; // number of columns + Int m = QRsym->m ; // number of rows + Int * Post = QRsym->Post ; // size nf // ------------------------------------------------------------------------- // get the contents of the QR numeric object @@ -126,37 +126,37 @@ void spqrgpu_kernel // get the stack for this task and the head/top pointers // ------------------------------------------------------------------------- - int64_t stack = 0 ; // no mixing of GPU and TBB parallelism + Int stack = 0 ; // no mixing of GPU and TBB parallelism ASSERT (QRnum->ntasks == 1) ; double * Stack_top = Work [stack].Stack_top ; double * Stack_head = Work [stack].Stack_head ; - int64_t sumfrank = Work [stack].sumfrank ; - int64_t maxfrank = Work [stack].maxfrank ; + Int sumfrank = Work [stack].sumfrank ; + Int maxfrank = Work [stack].maxfrank ; // ------------------------------------------------------------------------- // get the SPQR GPU members from symbolic analysis // ------------------------------------------------------------------------- - spqr_gpu *QRgpu = QRsym->QRgpu; + spqr_gpu_impl *QRgpu = QRsym->QRgpu; // assembly metadata - int64_t *RjmapOffsets = QRgpu->RjmapOffsets; - int64_t *RimapOffsets = QRgpu->RimapOffsets; - int64_t RjmapSize = MAX(1, QRgpu->RjmapSize); - int64_t RimapSize = MAX(1, QRgpu->RimapSize); + Int *RjmapOffsets = QRgpu->RjmapOffsets; + Int *RimapOffsets = QRgpu->RimapOffsets; + Int RjmapSize = MAX(1, QRgpu->RjmapSize); + Int RimapSize = MAX(1, QRgpu->RimapSize); // staging metadata - int64_t numStages = QRgpu->numStages; - int64_t *Stagingp = QRgpu->Stagingp; - int64_t *StageMap = QRgpu->StageMap; + Int numStages = QRgpu->numStages; + Int *Stagingp = QRgpu->Stagingp; + Int *StageMap = QRgpu->StageMap; size_t *FSize = QRgpu->FSize; size_t *RSize = QRgpu->RSize; size_t *SSize = QRgpu->SSize; - int64_t *FOffsets = QRgpu->FOffsets; - int64_t *ROffsets = QRgpu->ROffsets; - int64_t *SOffsets = QRgpu->SOffsets; + Int *FOffsets = QRgpu->FOffsets; + Int *ROffsets = QRgpu->ROffsets; + Int *SOffsets = QRgpu->SOffsets; // gpu parameters size_t gpuMemorySize = cc->gpuMemorySize; @@ -177,8 +177,8 @@ void spqrgpu_kernel // use one mongo Stair for the entire problem // ------------------------------------------------------------------------- - int64_t stairsize = Rp [nf] ; - int64_t *Stair = (int64_t*) cholmod_l_malloc (stairsize, sizeof(int64_t), cc); + Int stairsize = Rp [nf] ; + Int *Stair = (Int*) spqr_malloc (stairsize, sizeof(Int), cc); // ------------------------------------------------------------------------- // use a workspace directory to store contribution blocks, if needed @@ -186,7 +186,7 @@ void spqrgpu_kernel // ------------------------------------------------------------------------- Workspace **LimboDirectory = - (Workspace**) cholmod_l_calloc (nf, sizeof(Workspace*), cc); + (Workspace**) spqr_calloc (nf, sizeof(Workspace*), cc); // ------------------------------------------------------------------------- // allocate, construct, and ship S, Rimap, and Rjmap for the entire problem @@ -202,24 +202,24 @@ void spqrgpu_kernel Workspace *wsRjmap = Workspace::allocate (RjmapSize, // CPU and GPU sizeof(int), false, true, true, false) ; - // use shared int64_t workspace (Iwork) for Fmap and InvPost [ [ + // use shared Int workspace (Iwork) for Fmap and InvPost [ [ // Note that Iwork (0:nf-1) is already in use for Blob.Cm (size nf) - // was: int64_t *Fmap = (int64_t*) cholmod_l_malloc (n, sizeof(int64_t), cc); - cholmod_l_allocate_work (0, 2*nf + n + 1, 0, cc) ; - int64_t *Wi = (int64_t *) cc->Iwork ; // Cm is size nf, already in use - int64_t *InvPost = Wi + nf ; // InvPost is size nf+1 - int64_t *Fmap = Wi + (nf+1) ; // Fmap is size n - - int64_t numFronts = 0 ; - Front *fronts = NULL ; + // was: Int *Fmap = (Int*) cholmod_l_malloc (n, sizeof(Int), cc); + spqr_allocate_work (0, 2*nf + n + 1, 0, cc) ; + Int *Wi = (Int *) cc->Iwork ; // Cm is size nf, already in use + Int *InvPost = Wi + nf ; // InvPost is size nf+1 + Int *Fmap = Wi + (nf+1) ; // Fmap is size n + + Int numFronts = 0 ; + Front *fronts = NULL ; Workspace *wsMondoF = NULL ; Workspace *wsMondoR = NULL ; Workspace *wsS = NULL ; - int64_t wsMondoF_size = 0 ; - int64_t wsMondoR_size = 0 ; - int64_t wsS_size = 0 ; - int64_t maxfronts_in_stage = 0 ; + Int wsMondoF_size = 0 ; + Int wsMondoR_size = 0 ; + Int wsS_size = 0 ; + Int maxfronts_in_stage = 0 ; // ------------------------------------------------------------------------- // check if out of memory @@ -228,10 +228,10 @@ void spqrgpu_kernel #define FREE_ALL_WORKSPACE \ cudaStreamDestroy(memoryStreamH2D); \ memoryStreamH2D = NULL ; \ - Stair = (int64_t*) cholmod_l_free (stairsize, sizeof(int64_t), Stair, cc) ; \ + Stair = (Int*) spqr_free (stairsize, sizeof(Int), Stair, cc) ; \ if (LimboDirectory != NULL) \ { \ - for (int64_t f2 = 0 ; f2 < nf ; f2++) \ + for (Int f2 = 0 ; f2 < nf ; f2++) \ { \ Workspace *wsLimbo2 = LimboDirectory[f2]; \ if (wsLimbo2 != NULL) \ @@ -242,18 +242,18 @@ void spqrgpu_kernel } \ } \ LimboDirectory = (Workspace**) \ - cholmod_l_free (nf, sizeof(Workspace*), LimboDirectory, cc); \ + spqr_free (nf, sizeof(Workspace*), LimboDirectory, cc); \ wsMondoS = Workspace::destroy(wsMondoS); \ wsRjmap = Workspace::destroy(wsRjmap); \ wsRimap = Workspace::destroy(wsRimap); \ - fronts = (Front*) \ - cholmod_l_free (maxfronts_in_stage, sizeof(Front), fronts, cc) ; \ + fronts = (Front *) \ + spqr_free (maxfronts_in_stage, sizeof(Front ), fronts, cc) ; \ wsMondoF = Workspace::destroy(wsMondoF); \ wsMondoR = Workspace::destroy(wsMondoR); \ if (wsS != NULL) wsS->assign(NULL, wsS->gpu()); \ wsS = Workspace::destroy(wsS); - // was: Fmap = (int64_t*) cholmod_l_free (n, sizeof(int64_t), Fmap, cc); + // was: Fmap = (Int*) cholmod_l_free (n, sizeof(Int), Fmap, cc); if (cc->status < CHOLMOD_OK // ensures Fmap and InvPost are allocated || !Stair || !LimboDirectory || !wsMondoS || !wsRimap || !wsRjmap) @@ -286,7 +286,7 @@ void spqrgpu_kernel ) ; // done using Iwork for Fmap ] - // Fmap = (int64_t*) cholmod_l_free (n, sizeof(int64_t), Fmap, cc); + // Fmap = (Int*) cholmod_l_free (n, sizeof(Int), Fmap, cc); // ------------------------------------------------------------------------- // ship the assembly maps asynchronously along the H2D memory stream. @@ -296,16 +296,16 @@ void spqrgpu_kernel wsRimap->transfer(cudaMemcpyHostToDevice, false, memoryStreamH2D); // Keep track of where we are in MondoS - int64_t SOffset = 0; + Int SOffset = 0; // ------------------------------------------------------------------------- // allocate workspace for all stages // ------------------------------------------------------------------------- - for(int64_t stage=0; stage*) spqr_malloc (maxfronts_in_stage, sizeof(Front ),cc) ; // This allocate is done once for each stage, but we still need // to set the first FSize[stage] entries in wsMondoF to zero, for each @@ -344,9 +344,9 @@ void spqrgpu_kernel // construct InvPost, the inverse postordering // ------------------------------------------------------------------------- - for (int64_t k = 0 ; k < nf ; k++) + for (Int k = 0 ; k < nf ; k++) { - int64_t f = Post [k] ; // front f is the kth front in the postoder + Int f = Post [k] ; // front f is the kth front in the postoder ASSERT (f >= 0 && f < nf) ; InvPost [f] = k ; // record the same info in InvPost } @@ -356,18 +356,18 @@ void spqrgpu_kernel // iterate over the staging schedule and factorize each stage // ------------------------------------------------------------------------- - for(int64_t stage=0; stage *front = new (&fronts[frelp]) Front(frelp, prelp, fm, fn); front->fidg = f; front->pidg = pid; @@ -435,7 +435,7 @@ void spqrgpu_kernel meta->nc = Childp[f+1] - Childp[f]; // S assembly - int64_t pSStart, pSEnd; + Int pSStart, pSEnd; pSStart = Sp[Sleft[Super[f]]]; pSEnd = Sp[Sleft[Super[f+1]]]; meta->Scount = MAX(0, pSEnd - pSStart); @@ -462,23 +462,23 @@ void spqrgpu_kernel // build any lingering children // the memory for the child fronts is at the end of its parent // the Front metadata resides at the beginning of the frontList - int64_t ChildOffset = FOffsets[f] + fm*fn; - for(int64_t cp=Childp[f]; cp *child = new (&fronts[pNextChild]) Front(pNextChild, frelp, ccm, ccn); child->fidg = c; child->pidg = f; @@ -519,12 +519,12 @@ void spqrgpu_kernel cudaStreamSynchronize(memoryStreamH2D); // now we can free limbo children - for(int64_t p=sStart; passign(wsLimbo->cpu(), NULL); @@ -539,7 +539,7 @@ void spqrgpu_kernel INIT_TIME(engine); TIC(engine); - QREngineStats stats; + QREngineStats stats; GPUQREngine(gpuMemorySize, fronts, numFronts, Parent, Childp, Child, &stats); cc->gpuKernelTime += stats.kernelTime; @@ -549,15 +549,15 @@ void spqrgpu_kernel PR (("%f engine time\n", engine)); #ifndef NDEBUG - for(int64_t p=sStart; pcpuR; PR (("\n --- Front factorized, front %ld fm %ld fn %ld fp %ld frank %ld", @@ -565,10 +565,10 @@ void spqrgpu_kernel PR ((" : rows %ld to %ld of R (1-based)\n", 1+ Super [f], 1+ Super [f+1]-1)) ; PR ((" Printing just R part, stored by row:\n")) ; - for (int64_t j = 0 ; j < fn ; j++) + for (Int j = 0 ; j < fn ; j++) { PR ((" --- column %ld of %ld\n", j, fn)) ; - for (int64_t i = 0 ; i < frank ; i++) + for (Int i = 0 ; i < frank ; i++) { if (i == j) PR ((" [ diag: ")) ; else PR ((" row %4ld ", i)) ; @@ -585,15 +585,15 @@ void spqrgpu_kernel // Pack R from each front onto the Davis Stack. // --------------------------------------------------------------------- - for(int64_t p=sStart; pcpuR; // cpuF for frontal matrix f has been factorized on the GPU and @@ -606,19 +606,19 @@ void spqrgpu_kernel Rblock [f] = Stack_head ; // copy the leading upper triangular part from cpuF to R - for (int64_t j = 0 ; j < frank ; j++) + for (Int j = 0 ; j < frank ; j++) { // copy column j of the front from cpuF to R - for (int64_t i = 0 ; i <= j ; i++) + for (Int i = 0 ; i <= j ; i++) { (*Stack_head++) = cpuF [fn*i+j] ; } } // copy the rectangular part from cpuF to R - for (int64_t j = frank ; j < fn ; j++) + for (Int j = frank ; j < fn ; j++) { // copy column j of the front from cpuF to R - for (int64_t i = 0 ; i < frank ; i++) + for (Int i = 0 ; i < frank ; i++) { (*Stack_head++) = cpuF [fn*i+j] ; } @@ -659,9 +659,9 @@ void spqrgpu_kernel double *L = CPU_REFERENCE(wsLimbo, double*); // copy from C into Limbo - for(int64_t i=0; i *front = (&fronts[f]); front->~Front(); } #endif @@ -701,14 +701,14 @@ void spqrgpu_kernel Work [stack].Stack_top = Stack_top ; // Compute sumfrank and maxfrank in a last-minute manner, and find Rdead - for(int64_t f=0; f void spqrgpu_kernel ( - spqr_blob *Blob + spqr_blob *Blob ) { // complex case not yet supported on the GPU @@ -749,3 +750,8 @@ void spqrgpu_kernel return ; } +template void spqrgpu_kernel (spqr_blob *Blob) ; +template void spqrgpu_kernel (spqr_blob *Blob) ; + +template void spqrgpu_kernel (spqr_blob *Blob) ; +template void spqrgpu_kernel (spqr_blob *Blob) ; diff --git a/SPQR/Source/SuiteSparseQR.cpp b/SPQR/Source/SuiteSparseQR.cpp index ef4bc5de3..02e01d45a 100644 --- a/SPQR/Source/SuiteSparseQR.cpp +++ b/SPQR/Source/SuiteSparseQR.cpp @@ -38,35 +38,257 @@ // E is a permutation vector represention of the column permutation, for // the factorization Q*R=A*E. - #include "spqr.hpp" #define XCHUNK 4 // FUTURE: make this a parameter #define FREE_ALL \ spqr_freefac (&QR, cc) ; \ - cholmod_l_free (rjsize+1, sizeof (int64_t), H2p, cc) ; \ - cholmod_l_free_dense (&HTau, cc) ; \ - cholmod_l_free_sparse (&H, cc) ; \ - cholmod_l_free_sparse (&R, cc) ; \ - cholmod_l_free_sparse (&Xsparse, cc) ; \ - cholmod_l_free_sparse (&Zsparse, cc) ; \ - cholmod_l_free_dense (&Zdense, cc) ; \ - cholmod_l_free (xsize, sizeof (Entry), Xwork, cc) ; \ - cholmod_l_free (csize, sizeof (Entry), C, cc) ; \ - cholmod_l_free (wsize, sizeof (Entry), W, cc) ; \ - cholmod_l_free (maxfrank, sizeof (int64_t), Rlive, cc) ; \ - cholmod_l_free (maxfrank, sizeof (Entry *), Rcolp, cc) ; \ - cholmod_l_free (n+bncols, sizeof (int64_t), E, cc) ; \ - cholmod_l_free (m, sizeof (int64_t), HP1inv, cc) ; + spqr_free (rjsize+1, sizeof (Int), H2p, cc) ; \ + spqr_free_dense (&HTau, cc) ; \ + spqr_free_sparse (&H, cc) ; \ + spqr_free_sparse (&R, cc) ; \ + spqr_free_sparse (&Xsparse, cc) ; \ + spqr_free_sparse (&Zsparse, cc) ; \ + spqr_free_dense (&Zdense, cc) ; \ + spqr_free (xsize, sizeof (Entry), Xwork, cc) ; \ + spqr_free (csize, sizeof (Entry), C, cc) ; \ + spqr_free (wsize, sizeof (Entry), W, cc) ; \ + spqr_free (maxfrank, sizeof (Int), Rlive, cc) ; \ + spqr_free (maxfrank, sizeof (Entry *), Rcolp, cc) ; \ + spqr_free (n+bncols, sizeof (Int), E, cc) ; \ + spqr_free (m, sizeof (Int), HP1inv, cc) ; + +extern template SuiteSparseQR_factorization *spqr_1factor +( + // inputs, not modified + int ordering, // all, except 3:given treated as 0:fixed + double tol, // only accept singletons above tol. If tol <= -2, + // then use the default tolerance + int32_t bncols, // number of columns of B + int keepH, // if TRUE, keep the Householder vectors + cholmod_sparse *A, // m-by-n sparse matrix + int32_t ldb, // if dense, the leading dimension of B + int32_t *Bp, // size bncols+1, column pointers of B + int32_t *Bi, // size bnz = Bp [bncols], row indices of B + Complex *Bx, // size bnz, numerical values of B + + // workspace and parameters + cholmod_common *cc +) ; + + +extern template SuiteSparseQR_factorization *spqr_1factor +( + // inputs, not modified + int ordering, // all, except 3:given treated as 0:fixed + double tol, // only accept singletons above tol. If tol <= -2, + // then use the default tolerance + int32_t bncols, // number of columns of B + int keepH, // if TRUE, keep the Householder vectors + cholmod_sparse *A, // m-by-n sparse matrix + int32_t ldb, // if dense, the leading dimension of B + int32_t *Bp, // size bncols+1, column pointers of B + int32_t *Bi, // size bnz = Bp [bncols], row indices of B + double *Bx, // size bnz, numerical values of B + + // workspace and parameters + cholmod_common *cc +) ; + +extern template SuiteSparseQR_factorization *spqr_1factor +( + // inputs, not modified + int ordering, // all, except 3:given treated as 0:fixed + double tol, // only accept singletons above tol. If tol <= -2, + // then use the default tolerance + int64_t bncols, // number of columns of B + int keepH, // if TRUE, keep the Householder vectors + cholmod_sparse *A, // m-by-n sparse matrix + int64_t ldb, // if dense, the leading dimension of B + int64_t *Bp, // size bncols+1, column pointers of B + int64_t *Bi, // size bnz = Bp [bncols], row indices of B + Complex *Bx, // size bnz, numerical values of B + + // workspace and parameters + cholmod_common *cc +) ; + +extern template int spqr_1fixed +( + // inputs, not modified + double tol, // only accept singletons above tol + int32_t bncols, // number of columns of B + cholmod_sparse *A, // m-by-n sparse matrix + + // output arrays, neither allocated nor defined on input. + + int32_t **p_R1p, // size n1rows+1, R1p [k] = # of nonzeros in kth + // row of R1. NULL if n1cols == 0. + int32_t **p_P1inv, // size m, singleton row inverse permutation. + // If row i of A is the kth singleton row, then + // P1inv [i] = k. NULL if n1cols is zero. + + cholmod_sparse **p_Y, // on output, only the first n-n1cols+1 entries of + // Y->p are defined (if Y is not NULL), where + // Y = [A B] or Y = [A2 B2]. If B is empty and + // there are no column singletons, Y is NULL + + int32_t *p_n1cols, // number of column singletons found + int32_t *p_n1rows, // number of corresponding rows found + + // workspace and parameters + cholmod_common *cc +) ; +extern template int spqr_1fixed +( + // inputs, not modified + double tol, // only accept singletons above tol + int64_t bncols, // number of columns of B + cholmod_sparse *A, // m-by-n sparse matrix + + // output arrays, neither allocated nor defined on input. + + int64_t **p_R1p, // size n1rows+1, R1p [k] = # of nonzeros in kth + // row of R1. NULL if n1cols == 0. + int64_t **p_P1inv, // size m, singleton row inverse permutation. + // If row i of A is the kth singleton row, then + // P1inv [i] = k. NULL if n1cols is zero. + + cholmod_sparse **p_Y, // on output, only the first n-n1cols+1 entries of + // Y->p are defined (if Y is not NULL), where + // Y = [A B] or Y = [A2 B2]. If B is empty and + // there are no column singletons, Y is NULL + + int64_t *p_n1cols, // number of column singletons found + int64_t *p_n1rows, // number of corresponding rows found + + // workspace and parameters + cholmod_common *cc +) ; + +extern template int spqr_1fixed +( + // inputs, not modified + double tol, // only accept singletons above tol + int32_t bncols, // number of columns of B + cholmod_sparse *A, // m-by-n sparse matrix + + // output arrays, neither allocated nor defined on input. + + int32_t **p_R1p, // size n1rows+1, R1p [k] = # of nonzeros in kth + // row of R1. NULL if n1cols == 0. + int32_t **p_P1inv, // size m, singleton row inverse permutation. + // If row i of A is the kth singleton row, then + // P1inv [i] = k. NULL if n1cols is zero. + + cholmod_sparse **p_Y, // on output, only the first n-n1cols+1 entries of + // Y->p are defined (if Y is not NULL), where + // Y = [A B] or Y = [A2 B2]. If B is empty and + // there are no column singletons, Y is NULL + + int32_t *p_n1cols, // number of column singletons found + int32_t *p_n1rows, // number of corresponding rows found + + // workspace and parameters + cholmod_common *cc +) ; +extern template int spqr_1fixed +( + // inputs, not modified + double tol, // only accept singletons above tol + int64_t bncols, // number of columns of B + cholmod_sparse *A, // m-by-n sparse matrix + + // output arrays, neither allocated nor defined on input. + + int64_t **p_R1p, // size n1rows+1, R1p [k] = # of nonzeros in kth + // row of R1. NULL if n1cols == 0. + int64_t **p_P1inv, // size m, singleton row inverse permutation. + // If row i of A is the kth singleton row, then + // P1inv [i] = k. NULL if n1cols is zero. + + cholmod_sparse **p_Y, // on output, only the first n-n1cols+1 entries of + // Y->p are defined (if Y is not NULL), where + // Y = [A B] or Y = [A2 B2]. If B is empty and + // there are no column singletons, Y is NULL + + int64_t *p_n1cols, // number of column singletons found + int64_t *p_n1rows, // number of corresponding rows found + + // workspace and parameters + cholmod_common *cc +) ; + +extern template SuiteSparseQR_factorization *spqr_1factor +( + // inputs, not modified + int ordering, // all, except 3:given treated as 0:fixed + double tol, // only accept singletons above tol. If tol <= -2, + // then use the default tolerance + int64_t bncols, // number of columns of B + int keepH, // if TRUE, keep the Householder vectors + cholmod_sparse *A, // m-by-n sparse matrix + int64_t ldb, // if dense, the leading dimension of B + int64_t *Bp, // size bncols+1, column pointers of B + int64_t *Bi, // size bnz = Bp [bncols], row indices of B + double *Bx, // size bnz, numerical values of B + + // workspace and parameters + cholmod_common *cc +) ; + +extern template spqr_symbolic *spqr_analyze +( + // inputs, not modified + cholmod_sparse *A, + int ordering, // all options available + int32_t *Quser, // user provided ordering, if given (may be NULL) + + int do_rank_detection, // if TRUE, then rank deficient matrices may be + // considered during numerical factorization, + // with tol >= 0 (tol < 0 is also allowed). If FALSE, then the tol + // parameter is ignored by the numerical factorization, and no rank + // detection is performed. Ignored when using GPU acceleration + // (no rank detection is performed in that case). + + int keepH, // if TRUE, keep the Householder vectors + + // workspace and parameters + cholmod_common *cc +) ; + +extern template spqr_symbolic *spqr_analyze +( + // inputs, not modified + cholmod_sparse *A, + int ordering, // all options available + int64_t *Quser, // user provided ordering, if given (may be NULL) + + int do_rank_detection, // if TRUE, then rank deficient matrices may be + // considered during numerical factorization, + // with tol >= 0 (tol < 0 is also allowed). If FALSE, then the tol + // parameter is ignored by the numerical factorization, and no rank + // detection is performed. Ignored when using GPU acceleration + // (no rank detection is performed in that case). + + int keepH, // if TRUE, keep the Householder vectors + + // workspace and parameters + cholmod_common *cc +) ; + +// ============================================================================= +// === SuiteSparseQR overloaded functions ====================================== +// ============================================================================= // returns rank(A) estimate if successful, EMPTY otherwise -template int64_t SuiteSparseQR +template Int SuiteSparseQR ( // inputs, not modified int ordering, // all, except 3:given treated as 0:fixed double tol, // columns with 2-norm <= tol are treated as zero - int64_t econ, // number of rows of C and R to return; a value + Int econ, // number of rows of C and R to return; a value // less than the rank r of A is treated as r, and // a value greater than m is treated as m. // That is, e = max(min(m,econ),rank(A)) gives the @@ -94,27 +316,27 @@ template int64_t SuiteSparseQR cholmod_dense **p_Zdense, cholmod_sparse **p_R, // the R factor - int64_t **p_E, // size n; fill-reducing ordering of A. + Int **p_E, // size n; fill-reducing ordering of A. cholmod_sparse **p_H, // the Householder vectors (m-by-nh) - int64_t **p_HPinv, // size m; row permutation for H + Int **p_HPinv, // size m; row permutation for H cholmod_dense **p_HTau, // size 1-by-nh, Householder coefficients // workspace and parameters cholmod_common *cc ) { - int64_t *Q1fill, *R1p, *R1j, *P1inv, *Zp, *Zi, *Rp, *Ri, *Rap, *Hp, *H2p, + Int *Q1fill, *R1p, *R1j, *P1inv, *Zp, *Zi, *Rp, *Ri, *Rap, *Hp, *H2p, *Hi, *HP1inv, // *Ap, *Ai, *Rlive, *E, *Bp, *Bi ; Entry *R1x, *B, *Zx, *Rx, *X2, *C, *Hx, *C1, *X1, *Xwork, // *Ax, *W, **Rcolp, *Bx ; - int64_t i, j, k, p, p2, n1cols, n1rows, B_is_sparse, Z_is_sparse, getC, + Int i, j, k, p, p2, n1cols, n1rows, B_is_sparse, Z_is_sparse, getC, getR, getH, getE, getX, getZ, iold, inew, rank, n2, rnz, znz, zn, zm, pr, xsize, getT, nh, k1, k2, xchunk, xncol, m, n, csize, wsize, ldb, maxfrank, rjsize, bncols, bnrows ; - spqr_symbolic *QRsym ; - spqr_numeric *QRnum ; - SuiteSparseQR_factorization *QR ; + spqr_symbolic *QRsym ; + spqr_numeric *QRnum ; + SuiteSparseQR_factorization *QR ; cholmod_sparse *Xsparse, *Zsparse, *R, *H ; cholmod_dense *Zdense, *HTau ; @@ -136,7 +358,7 @@ template int64_t SuiteSparseQR RETURN_IF_NULL_COMMON (EMPTY) ; RETURN_IF_NULL (A, EMPTY) ; - int64_t xtype = spqr_type ( ) ; + Int xtype = spqr_type ( ) ; RETURN_IF_XTYPE_INVALID (A, EMPTY) ; if (Bsparse != NULL) RETURN_IF_XTYPE_INVALID (Bsparse, EMPTY) ; if (Bdense != NULL) RETURN_IF_XTYPE_INVALID (Bdense, EMPTY) ; @@ -186,8 +408,8 @@ template int64_t SuiteSparseQR m = A->nrow ; n = A->ncol ; - // Ap = (int64_t *) A->p ; - // Ai = (int64_t *) A->i ; + // Ap = (Int *) A->p ; + // Ai = (Int *) A->i ; // Ax = (Entry *) A->x ; // B is an optional input. It can be sparse or dense @@ -197,8 +419,8 @@ template int64_t SuiteSparseQR // B is sparse bncols = Bsparse->ncol ; bnrows = Bsparse->nrow ; - Bp = (int64_t *) Bsparse->p ; - Bi = (int64_t *) Bsparse->i ; + Bp = (Int *) Bsparse->p ; + Bi = (Int *) Bsparse->i ; Bx = (Entry *) Bsparse->x ; ldb = 0 ; // unused } @@ -320,17 +542,17 @@ template int64_t SuiteSparseQR if (getZ) { // Zsparse is zm-by-zn, but with no entries so far - Zsparse = cholmod_l_allocate_sparse (zm, zn, 0, TRUE, TRUE, 0, xtype, + Zsparse = spqr_allocate_sparse (zm, zn, 0, TRUE, TRUE, 0, xtype, cc) ; - Zp = Zsparse ? ((int64_t *) Zsparse->p) : NULL ; + Zp = Zsparse ? ((Int *) Zsparse->p) : NULL ; PR (("Z is zm %ld by zn %ld\n", zm, zn)) ; } if (getR) { // R is econ-by-n, but with no entries so far - R = cholmod_l_allocate_sparse (econ, n, 0, TRUE, TRUE, 0, xtype, cc) ; - Rp = R ? ((int64_t *) R->p) : NULL ; + R = spqr_allocate_sparse (econ, n, 0, TRUE, TRUE, 0, xtype, cc) ; + Rp = R ? ((Int *) R->p) : NULL ; Rap = Rp + n1cols ; } @@ -338,7 +560,7 @@ template int64_t SuiteSparseQR if (getH) { - H2p = (int64_t *) cholmod_l_malloc (rjsize+1, sizeof (int64_t), cc) ; + H2p = (Int *) spqr_malloc (rjsize+1, sizeof (Int), cc) ; } if (cc->status < CHOLMOD_OK) @@ -442,7 +664,7 @@ template int64_t SuiteSparseQR // compute the Rp and Zp column pointers (skip if NULL) // ------------------------------------------------------------------------- - // no int64_t overflow can occur + // no Int overflow can occur rnz = spqr_cumsum (n, Rp) ; // Rp = cumsum ([0 Rp]) znz = spqr_cumsum (zn, Zp) ; // Zp = cumsum ([0 Zp]) @@ -453,29 +675,29 @@ template int64_t SuiteSparseQR if (getR) { // R now has space for rnz entries - cholmod_l_reallocate_sparse (rnz, R, cc) ; - Ri = (int64_t *) R->i ; + spqr_reallocate_sparse (rnz, R, cc) ; + Ri = (Int *) R->i ; Rx = (Entry *) R->x ; } if (getZ) { // Zsparse now has space for znz entries - cholmod_l_reallocate_sparse (znz, Zsparse, cc) ; - Zi = (int64_t *) Zsparse->i ; + spqr_reallocate_sparse (znz, Zsparse, cc) ; + Zi = (Int *) Zsparse->i ; Zx = (Entry *) Zsparse->x ; } if (getH) { // H is m-by-nh with hnz entries, where nh <= rjsize - int64_t hnz = H2p [nh] ; - H = cholmod_l_allocate_sparse (m, nh, hnz, TRUE, TRUE, 0, xtype, cc) ; + Int hnz = H2p [nh] ; + H = spqr_allocate_sparse (m, nh, hnz, TRUE, TRUE, 0, xtype, cc) ; // copy the column pointers from H2p to Hp if (cc->status == CHOLMOD_OK) { - Hp = (int64_t *) H->p ; - Hi = (int64_t *) H->i ; + Hp = (Int *) H->p ; + Hi = (Int *) H->i ; Hx = (Entry *) H->x ; for (k = 0 ; k <= nh ; k++) { @@ -483,9 +705,9 @@ template int64_t SuiteSparseQR } } // free the H2p workspace, and allocate HTau - cholmod_l_free (rjsize+1, sizeof (int64_t), H2p, cc) ; + spqr_free (rjsize+1, sizeof (Int), H2p, cc) ; H2p = NULL ; - HTau = cholmod_l_allocate_dense (1, nh, 1, xtype, cc) ; + HTau = spqr_allocate_dense (1, nh, 1, xtype, cc) ; } if (cc->status < CHOLMOD_OK) @@ -618,7 +840,7 @@ template int64_t SuiteSparseQR // ----------------------------------------------------------------- // ask for space for n+1 entries; this is increased later if needed - Xsparse = cholmod_l_allocate_sparse (n, bncols, n+1, TRUE, TRUE, 0, + Xsparse = spqr_allocate_sparse (n, bncols, n+1, TRUE, TRUE, 0, xtype, cc) ; xncol = 0 ; @@ -643,9 +865,9 @@ template int64_t SuiteSparseQR if (ok) { - Xwork = (Entry *) cholmod_l_malloc (xsize, sizeof (Entry), cc) ; - C = (Entry *) cholmod_l_calloc (csize, sizeof (Entry), cc) ; - W = (Entry *) cholmod_l_malloc (wsize, sizeof (Entry), cc) ; + Xwork = (Entry *) spqr_malloc (xsize, sizeof (Entry), cc) ; + C = (Entry *) spqr_calloc (csize, sizeof (Entry), cc) ; + W = (Entry *) spqr_malloc (wsize, sizeof (Entry), cc) ; } // ----------------------------------------------------------------- @@ -657,16 +879,16 @@ template int64_t SuiteSparseQR // PUNT: out of memory; try again with xchunk = 1 cc->status = CHOLMOD_OK ; ok = TRUE ; - cholmod_l_free (xsize, sizeof (Entry), Xwork, cc) ; - cholmod_l_free (csize, sizeof (Entry), C, cc) ; - cholmod_l_free (wsize, sizeof (Entry), W, cc) ; + spqr_free (xsize, sizeof (Entry), Xwork, cc) ; + spqr_free (csize, sizeof (Entry), C, cc) ; + spqr_free (wsize, sizeof (Entry), W, cc) ; xchunk = 1 ; xsize = n ; csize = rank ; wsize = maxfrank ; - Xwork = (Entry *) cholmod_l_malloc (xsize, sizeof (Entry), cc) ; - C = (Entry *) cholmod_l_calloc (csize, sizeof (Entry), cc) ; - W = (Entry *) cholmod_l_malloc (wsize, sizeof (Entry), cc) ; + Xwork = (Entry *) spqr_malloc (xsize, sizeof (Entry), cc) ; + C = (Entry *) spqr_calloc (csize, sizeof (Entry), cc) ; + W = (Entry *) spqr_malloc (wsize, sizeof (Entry), cc) ; } // ----------------------------------------------------------------- @@ -693,17 +915,17 @@ template int64_t SuiteSparseQR if (ok) { - C = (Entry *) cholmod_l_calloc (csize, sizeof (Entry), cc) ; - W = (Entry *) cholmod_l_malloc (wsize, sizeof (Entry), cc) ; + C = (Entry *) spqr_calloc (csize, sizeof (Entry), cc) ; + W = (Entry *) spqr_malloc (wsize, sizeof (Entry), cc) ; } // allocate the dense X and use it for the solve - Zdense = cholmod_l_allocate_dense (n, bncols, n, xtype, cc) ; + Zdense = spqr_allocate_dense (n, bncols, n, xtype, cc) ; X2 = Zdense ? ((Entry *) Zdense->x) : NULL ; } - Rlive = (int64_t *) cholmod_l_malloc (maxfrank, sizeof (int64_t), cc) ; - Rcolp = (Entry **) cholmod_l_malloc (maxfrank, sizeof (Entry *), cc) ; + Rlive = (Int *) spqr_malloc (maxfrank, sizeof (Int), cc) ; + Rcolp = (Entry **) spqr_malloc (maxfrank, sizeof (Entry *), cc) ; if (!ok || cc->status < CHOLMOD_OK) { @@ -787,7 +1009,7 @@ template int64_t SuiteSparseQR X1 = X2 ; for (k = 0 ; k < k2-k1 ; k++) { - spqr_append (X1, NULL, Xsparse, &xncol, cc) ; + spqr_append (X1, NULL, Xsparse, &xncol, cc) ; X1 += n ; if (cc->status < CHOLMOD_OK) { @@ -803,17 +1025,17 @@ template int64_t SuiteSparseQR // free workspace // --------------------------------------------------------------------- - C = (Entry *) cholmod_l_free (csize, sizeof (Entry), C, cc) ; - W = (Entry *) cholmod_l_free (wsize, sizeof (Entry), W, cc) ; - Rlive = (int64_t *) cholmod_l_free (maxfrank, sizeof (int64_t), Rlive, cc); - Rcolp = (Entry **) cholmod_l_free (maxfrank, sizeof (Entry *), Rcolp, + C = (Entry *) spqr_free (csize, sizeof (Entry), C, cc) ; + W = (Entry *) spqr_free (wsize, sizeof (Entry), W, cc) ; + Rlive = (Int *) spqr_free (maxfrank, sizeof (Int), Rlive, cc); + Rcolp = (Entry **) spqr_free (maxfrank, sizeof (Entry *), Rcolp, cc) ; // --------------------------------------------------------------------- // free the sparse Z // --------------------------------------------------------------------- - cholmod_l_free_sparse (&Zsparse, cc) ; + spqr_free_sparse (&Zsparse, cc) ; // --------------------------------------------------------------------- // finalize the sparse X @@ -826,8 +1048,8 @@ template int64_t SuiteSparseQR // reduce X in size so that nnz(X) == nzmax(X) // ----------------------------------------------------------------- - znz = cholmod_l_nnz (Xsparse, cc) ; - cholmod_l_reallocate_sparse (znz, Xsparse, cc) ; + znz = spqr_nnz (Xsparse, cc) ; + spqr_reallocate_sparse (znz, Xsparse, cc) ; ASSERT (cc->status == CHOLMOD_OK) ; // ----------------------------------------------------------------- @@ -841,7 +1063,7 @@ template int64_t SuiteSparseQR // free the dense Xwork // ----------------------------------------------------------------- - cholmod_l_free (xsize, sizeof (Entry), Xwork, cc) ; + spqr_free (xsize, sizeof (Entry), Xwork, cc) ; Xwork = NULL ; xsize = 0 ; } @@ -854,8 +1076,8 @@ template int64_t SuiteSparseQR // convert C or C' to full // --------------------------------------------------------------------- - Zdense = cholmod_l_sparse_to_dense (Zsparse, cc) ; - cholmod_l_free_sparse (&Zsparse, cc) ; + Zdense = spqr_sparse_to_dense (Zsparse, cc) ; + spqr_free_sparse (&Zsparse, cc) ; if (cc->status < CHOLMOD_OK) { @@ -907,7 +1129,7 @@ template int64_t SuiteSparseQR if (getR && ordering != SPQR_ORDERING_FIXED && rank < n && tol >= 0) { - int64_t *Rtrapp, *Rtrapi, *Qtrap ; + Int *Rtrapp, *Rtrapi, *Qtrap ; Entry *Rtrapx ; // find Rtrap and Qtrap. This may fail if tol < 0 and the matrix @@ -933,10 +1155,10 @@ template int64_t SuiteSparseQR // trapezoidal form) // free the old R and Q1fill - cholmod_l_free (n+1, sizeof (int64_t), Rp, cc) ; - cholmod_l_free (rnz, sizeof (int64_t), Ri, cc) ; - cholmod_l_free (rnz, sizeof (Entry), Rx, cc) ; - cholmod_l_free (n+bncols, sizeof (int64_t), E, cc) ; + spqr_free (n+1, sizeof (Int), Rp, cc) ; + spqr_free (rnz, sizeof (Int), Ri, cc) ; + spqr_free (rnz, sizeof (Entry), Rx, cc) ; + spqr_free (n+bncols, sizeof (Int), E, cc) ; // replace R and Q1fill with Rtrap and Qtrap R->p = Rtrapp ; @@ -991,8 +1213,39 @@ template int64_t SuiteSparseQR return (rank) ; } +template int32_t SuiteSparseQR +( + // inputs, not modified + int ordering, // all, except 3:given treated as 0:fixed + double tol, // columns with 2-norm <= tol are treated as zero + int32_t econ, // number of rows of C and R to return; a value + // less than the rank r of A is treated as r, and + // a value greater than m is treated as m. + + int getCTX, // if 0: return Z = C of size econ-by-bncols + // if 1: return Z = C' of size bncols-by-econ + // if 2: return Z = X of size econ-by-bncols + + cholmod_sparse *A, // m-by-n sparse matrix + cholmod_sparse *Bsparse, + cholmod_dense *Bdense, -template int64_t SuiteSparseQR + // output arrays, neither allocated nor defined on input. + + // Z is the matrix C, C', or X + cholmod_sparse **p_Zsparse, + cholmod_dense **p_Zdense, + cholmod_sparse **p_R, // the R factor + int32_t **p_E, // size n; fill-reducing ordering of A. + cholmod_sparse **p_H, // the Householder vectors (m-by-nh) + int32_t **p_HPinv, // size m; row permutation for H + cholmod_dense **p_HTau, // size 1-by-nh, Householder coefficients + + // workspace and parameters + cholmod_common *cc +) ; + +template int64_t SuiteSparseQR ( // inputs, not modified int ordering, // all, except 3:given treated as 0:fixed @@ -1024,7 +1277,39 @@ template int64_t SuiteSparseQR cholmod_common *cc ) ; -template int64_t SuiteSparseQR +template int32_t SuiteSparseQR +( + // inputs, not modified + int ordering, // all, except 3:given treated as 0:fixed + double tol, // columns with 2-norm <= tol are treated as zero + int32_t econ, // number of rows of C and R to return; a value + // less than the rank r of A is treated as r, and + // a value greater than m is treated as m. + + int getCTX, // if 0: return Z = C of size econ-by-bncols + // if 1: return Z = C' of size bncols-by-econ + // if 2: return Z = X of size econ-by-bncols + + cholmod_sparse *A, // m-by-n sparse matrix + cholmod_sparse *Bsparse, + cholmod_dense *Bdense, + + // output arrays, neither allocated nor defined on input. + + // Z is the matrix C, C', or X + cholmod_sparse **p_Zsparse, + cholmod_dense **p_Zdense, + cholmod_sparse **p_R, // the R factor + int32_t **p_E, // size n; fill-reducing ordering of A. + cholmod_sparse **p_H, // the Householder vectors (m-by-nh) + int32_t **p_HPinv, // size m; row permutation for H + cholmod_dense **p_HTau, // size 1-by-nh, Householder coefficients + + // workspace and parameters + cholmod_common *cc +) ; + +template int64_t SuiteSparseQR ( // inputs, not modified int ordering, // all, except 3:given treated as 0:fixed @@ -1056,16 +1341,10 @@ template int64_t SuiteSparseQR cholmod_common *cc ) ; - -// ============================================================================= -// === SuiteSparseQR overloaded functions ====================================== -// ============================================================================= - // ----------------------------------------------------------------------------- // X=A\B where X and B are dense // ----------------------------------------------------------------------------- - -template cholmod_dense *SuiteSparseQR +template cholmod_dense *SuiteSparseQR ( int ordering, // all, except 3:given treated as 0:fixed double tol, // columns with 2-norm <= tol are treated as zero @@ -1075,12 +1354,20 @@ template cholmod_dense *SuiteSparseQR ) { cholmod_dense *X ; - SuiteSparseQR (ordering, tol, 0, 2, A, + SuiteSparseQR (ordering, tol, 0, 2, A, NULL, B, NULL, &X, NULL, NULL, NULL, NULL, NULL, cc) ; return (X) ; } -template cholmod_dense *SuiteSparseQR +template cholmod_dense *SuiteSparseQR +( + int ordering, // all, except 3:given treated as 0:fixed + double tol, // columns with 2-norm <= tol are treated as zero + cholmod_sparse *A, // m-by-n sparse matrix + cholmod_dense *B, // m-by-nrhs + cholmod_common *cc // workspace and parameters +) ; +template cholmod_dense *SuiteSparseQR ( int ordering, // all, except 3:given treated as 0:fixed double tol, // columns with 2-norm <= tol are treated as zero @@ -1089,7 +1376,15 @@ template cholmod_dense *SuiteSparseQR cholmod_common *cc // workspace and parameters ) ; -template cholmod_dense *SuiteSparseQR +template cholmod_dense *SuiteSparseQR +( + int ordering, // all, except 3:given treated as 0:fixed + double tol, // columns with 2-norm <= tol are treated as zero + cholmod_sparse *A, // m-by-n sparse matrix + cholmod_dense *B, // m-by-nrhs + cholmod_common *cc // workspace and parameters +) ; +template cholmod_dense *SuiteSparseQR ( int ordering, // all, except 3:given treated as 0:fixed double tol, // columns with 2-norm <= tol are treated as zero @@ -1101,8 +1396,7 @@ template cholmod_dense *SuiteSparseQR // ----------------------------------------------------------------------------- // X=A\B where X and B are dense, default ordering and tol // ----------------------------------------------------------------------------- - -template cholmod_dense *SuiteSparseQR +template cholmod_dense *SuiteSparseQR ( cholmod_sparse *A, // m-by-n sparse matrix cholmod_dense *B, // m-by-nrhs @@ -1110,31 +1404,41 @@ template cholmod_dense *SuiteSparseQR ) { cholmod_dense *X ; - SuiteSparseQR (SPQR_ORDERING_DEFAULT, SPQR_DEFAULT_TOL, 0, 2, A, + SuiteSparseQR (SPQR_ORDERING_DEFAULT, SPQR_DEFAULT_TOL, 0, 2, A, NULL, B, NULL, &X, NULL, NULL, NULL, NULL, NULL, cc) ; return (X) ; } -template cholmod_dense *SuiteSparseQR +template cholmod_dense *SuiteSparseQR ( cholmod_sparse *A, // m-by-n sparse matrix cholmod_dense *B, // m-by-nrhs cholmod_common *cc // workspace and parameters ) ; - -template cholmod_dense *SuiteSparseQR +template cholmod_dense *SuiteSparseQR ( cholmod_sparse *A, // m-by-n sparse matrix cholmod_dense *B, // m-by-nrhs cholmod_common *cc // workspace and parameters ) ; +template cholmod_dense *SuiteSparseQR +( + cholmod_sparse *A, // m-by-n sparse matrix + cholmod_dense *B, // m-by-nrhs + cholmod_common *cc // workspace and parameters +) ; +template cholmod_dense *SuiteSparseQR +( + cholmod_sparse *A, // m-by-n sparse matrix + cholmod_dense *B, // m-by-nrhs + cholmod_common *cc // workspace and parameters +) ; // ----------------------------------------------------------------------------- // X=A\B where X and B are sparse // ----------------------------------------------------------------------------- - -template cholmod_sparse *SuiteSparseQR +template cholmod_sparse *SuiteSparseQR ( int ordering, // all, except 3:given treated as 0:fixed double tol, // columns with 2-norm <= tol are treated as zero @@ -1145,13 +1449,22 @@ template cholmod_sparse *SuiteSparseQR { cholmod_sparse *X ; - SuiteSparseQR (ordering, tol, 0, 2, A, + SuiteSparseQR (ordering, tol, 0, 2, A, B, NULL, &X, NULL, NULL, NULL, NULL, NULL, NULL, cc) ; return (X) ; } -template cholmod_sparse *SuiteSparseQR +template cholmod_sparse *SuiteSparseQR +( + int ordering, // all, except 3:given treated as 0:fixed + double tol, // columns with 2-norm <= tol are treated as zero + cholmod_sparse *A, // m-by-n sparse matrix + cholmod_sparse *B, // m-by-nrhs + cholmod_common *cc // workspace and parameters +) ; + +template cholmod_sparse *SuiteSparseQR ( int ordering, // all, except 3:given treated as 0:fixed double tol, // columns with 2-norm <= tol are treated as zero @@ -1160,7 +1473,7 @@ template cholmod_sparse *SuiteSparseQR cholmod_common *cc // workspace and parameters ) ; -template cholmod_sparse *SuiteSparseQR +template cholmod_sparse *SuiteSparseQR ( int ordering, // all, except 3:given treated as 0:fixed double tol, // columns with 2-norm <= tol are treated as zero @@ -1169,37 +1482,56 @@ template cholmod_sparse *SuiteSparseQR cholmod_common *cc // workspace and parameters ) ; +template cholmod_sparse *SuiteSparseQR +( + int ordering, // all, except 3:given treated as 0:fixed + double tol, // columns with 2-norm <= tol are treated as zero + cholmod_sparse *A, // m-by-n sparse matrix + cholmod_sparse *B, // m-by-nrhs + cholmod_common *cc // workspace and parameters +) ; // ----------------------------------------------------------------------------- // [Q,R,E] = qr(A), returning Q as a sparse matrix // ----------------------------------------------------------------------------- -template int64_t SuiteSparseQR // returns rank(A) estimate +template Int SuiteSparseQR // returns rank(A) estimate ( int ordering, // all, except 3:given treated as 0:fixed double tol, // columns with 2-norm <= tol are treated as zero - int64_t econ, // e = max(min(m,econ),rank(A)) + Int econ, // e = max(min(m,econ),rank(A)) cholmod_sparse *A, // m-by-n sparse matrix // outputs cholmod_sparse **Q, // m-by-e sparse matrix cholmod_sparse **R, // e-by-n sparse matrix - int64_t **E, // permutation of 0:n-1, NULL if identity + Int **E, // permutation of 0:n-1, NULL if identity cholmod_common *cc // workspace and parameters ) { cholmod_sparse *I ; - int64_t xtype = spqr_type ( ) ; + Int xtype = spqr_type ( ) ; RETURN_IF_NULL_COMMON (EMPTY) ; RETURN_IF_NULL (A, EMPTY) ; - int64_t m = A->nrow ; - I = cholmod_l_speye (m, m, xtype, cc) ; - int64_t rank = (I == NULL) ? EMPTY : SuiteSparseQR (ordering, tol, + Int m = A->nrow ; + I = spqr_speye (m, m, xtype, cc) ; + Int rank = (I == NULL) ? EMPTY : SuiteSparseQR (ordering, tol, econ, 1, A, I, NULL, Q, NULL, R, E, NULL, NULL, NULL, cc) ; - cholmod_l_free_sparse (&I, cc) ; + spqr_free_sparse (&I, cc) ; return (rank) ; } - -template int64_t SuiteSparseQR // returns rank(A) estimate +template int32_t SuiteSparseQR // returns rank(A) estimate +( + int ordering, // all, except 3:given treated as 0:fixed + double tol, // columns with 2-norm <= tol are treated as zero + int32_t econ, // e = max(min(m,econ),rank(A)) + cholmod_sparse *A, // m-by-n sparse matrix + // outputs + cholmod_sparse **Q, // m-by-e sparse matrix + cholmod_sparse **R, // e-by-n sparse matrix + int32_t **E, // permutation of 0:n-1 + cholmod_common *cc // workspace and parameters +) ; +template int64_t SuiteSparseQR // returns rank(A) estimate ( int ordering, // all, except 3:given treated as 0:fixed double tol, // columns with 2-norm <= tol are treated as zero @@ -1212,7 +1544,19 @@ template int64_t SuiteSparseQR // returns rank(A) estimate cholmod_common *cc // workspace and parameters ) ; -template int64_t SuiteSparseQR // returns rank(A) estimate +template int32_t SuiteSparseQR // returns rank(A) estimate +( + int ordering, // all, except 3:given treated as 0:fixed + double tol, // columns with 2-norm <= tol are treated as zero + int32_t econ, // e = max(min(m,econ),rank(A)) + cholmod_sparse *A, // m-by-n sparse matrix + // outputs + cholmod_sparse **Q, // m-by-e sparse matrix where e=max(econ,rank(A)) + cholmod_sparse **R, // e-by-n sparse matrix + int32_t **E, // permutation of 0:n-1 + cholmod_common *cc // workspace and parameters +) ; +template int64_t SuiteSparseQR // returns rank(A) estimate ( int ordering, // all, except 3:given treated as 0:fixed double tol, // columns with 2-norm <= tol are treated as zero @@ -1229,23 +1573,33 @@ template int64_t SuiteSparseQR // returns rank(A) estimate // [Q,R,E] = qr(A), discarding Q // ----------------------------------------------------------------------------- -template int64_t SuiteSparseQR // returns rank(A) estimate +template Int SuiteSparseQR // returns rank(A) estimate ( int ordering, // all, except 3:given treated as 0:fixed double tol, // columns with 2-norm <= tol are treated as zero - int64_t econ, // e = max(min(m,econ),rank(A)) + Int econ, // e = max(min(m,econ),rank(A)) cholmod_sparse *A, // m-by-n sparse matrix // outputs cholmod_sparse **R, // e-by-n sparse matrix - int64_t **E, // permutation of 0:n-1, NULL if identity + Int **E, // permutation of 0:n-1, NULL if identity cholmod_common *cc // workspace and parameters ) { - return (SuiteSparseQR (ordering, tol, econ, 1, A, + return (SuiteSparseQR (ordering, tol, econ, 1, A, NULL, NULL, NULL, NULL, R, E, NULL, NULL, NULL, cc)) ; } - -template int64_t SuiteSparseQR // returns rank(A) estimate +template int32_t SuiteSparseQR // returns rank(A) estimate +( + int ordering, // all, except 3:given treated as 0:fixed + double tol, // columns with 2-norm <= tol are treated as zero + int32_t econ, // e = max(min(m,econ),rank(A)) + cholmod_sparse *A, // m-by-n sparse matrix + // outputs + cholmod_sparse **R, // e-by-n sparse matrix + int32_t **E, // permutation of 0:n-1, NULL if identity + cholmod_common *cc // workspace and parameters +) ; +template int64_t SuiteSparseQR // returns rank(A) estimate ( int ordering, // all, except 3:given treated as 0:fixed double tol, // columns with 2-norm <= tol are treated as zero @@ -1257,7 +1611,18 @@ template int64_t SuiteSparseQR // returns rank(A) estimate cholmod_common *cc // workspace and parameters ) ; -template int64_t SuiteSparseQR // returns rank(A) estimate +template int32_t SuiteSparseQR // returns rank(A) estimate +( + int ordering, // all, except 3:given treated as 0:fixed + double tol, // columns with 2-norm <= tol are treated as zero + int32_t econ, // e = max(min(m,econ),rank(A)) + cholmod_sparse *A, // m-by-n sparse matrix + // outputs + cholmod_sparse **R, // e-by-n sparse matrix + int32_t **E, // permutation of 0:n-1, NULL if identity + cholmod_common *cc // workspace and parameters +) ; +template int64_t SuiteSparseQR // returns rank(A) estimate ( int ordering, // all, except 3:given treated as 0:fixed double tol, // columns with 2-norm <= tol are treated as zero @@ -1274,26 +1639,40 @@ template int64_t SuiteSparseQR // returns rank(A) estimate // ----------------------------------------------------------------------------- // returns rank(A) estimate if successful, EMPTY otherwise -template int64_t SuiteSparseQR +template Int SuiteSparseQR ( // inputs, not modified int ordering, // all, except 3:given treated as 0:fixed double tol, // columns with 2-norm <= tol are treated as zero - int64_t econ, // e = max(min(m,econ),rank(A)) + Int econ, // e = max(min(m,econ),rank(A)) cholmod_sparse *A, // m-by-n sparse matrix cholmod_dense *B, // m-by-nrhs dense matrix // outputs cholmod_dense **C, // C = Q'*B, an e-by-nrhs dense matrix cholmod_sparse **R, // e-by-n sparse matrix where e=max(econ,rank(A)) - int64_t **E, // permutation of 0:n-1, NULL if identity + Int **E, // permutation of 0:n-1, NULL if identity cholmod_common *cc // workspace and parameters ) { - return (SuiteSparseQR (ordering, tol, econ, 0, A, NULL, B, + return (SuiteSparseQR (ordering, tol, econ, 0, A, NULL, B, NULL, C, R, E, NULL, NULL, NULL, cc)) ; } -template int64_t SuiteSparseQR +template int32_t SuiteSparseQR +( + // inputs, not modified + int ordering, // all, except 3:given treated as 0:fixed + double tol, // columns with 2-norm <= tol are treated as zero + int32_t econ, // e = max(min(m,econ),rank(A)) + cholmod_sparse *A, // m-by-n sparse matrix + cholmod_dense *B, // m-by-nrhs dense matrix + // outputs + cholmod_dense **C, // C = Q'*B, an e-by-nrhs dense matrix + cholmod_sparse **R, // e-by-n sparse matrix where e=max(econ,rank(A)) + int32_t **E, // permutation of 0:n-1, NULL if identity + cholmod_common *cc // workspace and parameters +) ; +template int64_t SuiteSparseQR ( // inputs, not modified int ordering, // all, except 3:given treated as 0:fixed @@ -1308,8 +1687,21 @@ template int64_t SuiteSparseQR cholmod_common *cc // workspace and parameters ) ; - -template int64_t SuiteSparseQR +template int32_t SuiteSparseQR +( + // inputs, not modified + int ordering, // all, except 3:given treated as 0:fixed + double tol, // columns with 2-norm <= tol are treated as zero + int32_t econ, // e = max(min(m,econ),rank(A)) + cholmod_sparse *A, // m-by-n sparse matrix + cholmod_dense *B, // m-by-nrhs dense matrix + // outputs + cholmod_dense **C, // C = Q'*B, an e-by-nrhs dense matrix + cholmod_sparse **R, // e-by-n sparse matrix where e=max(econ,rank(A)) + int32_t **E, // permutation of 0:n-1, NULL if identity + cholmod_common *cc // workspace and parameters +) ; +template int64_t SuiteSparseQR ( // inputs, not modified int ordering, // all, except 3:given treated as 0:fixed @@ -1324,32 +1716,45 @@ template int64_t SuiteSparseQR cholmod_common *cc // workspace and parameters ) ; - // ----------------------------------------------------------------------------- // [C,R,E] = qr(A,B) where C and B are both sparse // ----------------------------------------------------------------------------- // returns rank(A) estimate if successful, EMPTY otherwise -template int64_t SuiteSparseQR +template Int SuiteSparseQR ( // inputs, not modified int ordering, // all, except 3:given treated as 0:fixed double tol, // columns with 2-norm <= tol are treated as zero - int64_t econ, // e = max(min(m,econ),rank(A)) + Int econ, // e = max(min(m,econ),rank(A)) cholmod_sparse *A, // m-by-n sparse matrix cholmod_sparse *B, // m-by-nrhs sparse matrix // outputs cholmod_sparse **C, // C = Q'*B, an e-by-nrhs sparse matrix cholmod_sparse **R, // e-by-n sparse matrix where e=max(econ,rank(A)) - int64_t **E, // permutation of 0:n-1, NULL if identity + Int **E, // permutation of 0:n-1, NULL if identity cholmod_common *cc // workspace and parameters ) { - return (SuiteSparseQR (ordering, tol, econ, 0, A, B, NULL, + return (SuiteSparseQR (ordering, tol, econ, 0, A, B, NULL, C, NULL, R, E, NULL, NULL, NULL, cc)) ; } -template int64_t SuiteSparseQR +template int32_t SuiteSparseQR +( + // inputs, not modified + int ordering, // all, except 3:given treated as 0:fixed + double tol, // columns with 2-norm <= tol are treated as zero + int32_t econ, // e = max(min(m,econ),rank(A)) + cholmod_sparse *A, // m-by-n sparse matrix + cholmod_sparse *B, // m-by-nrhs sparse matrix + // outputs + cholmod_sparse **C, // C = Q'*B, an e-by-nrhs sparse matrix + cholmod_sparse **R, // e-by-n sparse matrix where e=max(econ,rank(A)) + int32_t **E, // permutation of 0:n-1, NULL if identity + cholmod_common *cc // workspace and parameters +) ; +template int64_t SuiteSparseQR ( // inputs, not modified int ordering, // all, except 3:given treated as 0:fixed @@ -1365,7 +1770,21 @@ template int64_t SuiteSparseQR ) ; -template int64_t SuiteSparseQR +template int32_t SuiteSparseQR +( + // inputs, not modified + int ordering, // all, except 3:given treated as 0:fixed + double tol, // columns with 2-norm <= tol are treated as zero + int32_t econ, // e = max(min(m,econ),rank(A)) + cholmod_sparse *A, // m-by-n sparse matrix + cholmod_sparse *B, // m-by-nrhs sparse matrix + // outputs + cholmod_sparse **C, // C = Q'*B, an e-by-nrhs sparse matrix + cholmod_sparse **R, // e-by-n sparse matrix where e=max(econ,rank(A)) + int32_t **E, // permutation of 0:n-1, NULL if identity + cholmod_common *cc // workspace and parameters +) ; +template int64_t SuiteSparseQR ( // inputs, not modified int ordering, // all, except 3:given treated as 0:fixed @@ -1385,27 +1804,43 @@ template int64_t SuiteSparseQR // ----------------------------------------------------------------------------- // returns rank(A) estimate if successful, EMPTY otherwise -template int64_t SuiteSparseQR +template Int SuiteSparseQR ( // inputs, not modified int ordering, // all, except 3:given treated as 0:fixed double tol, // columns with 2-norm <= tol are treated as zero - int64_t econ, // e = max(min(m,econ),rank(A)) + Int econ, // e = max(min(m,econ),rank(A)) cholmod_sparse *A, // m-by-n sparse matrix // outputs cholmod_sparse **R, // the R factor - int64_t **E, // permutation of 0:n-1, NULL if identity + Int **E, // permutation of 0:n-1, NULL if identity cholmod_sparse **H, // the Householder vectors (m-by-nh) - int64_t **HPinv, // size m; row permutation for H + Int **HPinv, // size m; row permutation for H cholmod_dense **HTau, // size 1-by-nh, Householder coefficients cholmod_common *cc // workspace and parameters ) { - return (SuiteSparseQR (ordering, tol, econ, EMPTY, A, + return (SuiteSparseQR (ordering, tol, econ, EMPTY, A, NULL, NULL, NULL, NULL, R, E, H, HPinv, HTau, cc)) ; } -template int64_t SuiteSparseQR +template int32_t SuiteSparseQR +( + // inputs, not modified + int ordering, // all, except 3:given treated as 0:fixed + double tol, // columns with 2-norm <= tol are treated as zero + int32_t econ, // e = max(min(m,econ),rank(A)) + cholmod_sparse *A, // m-by-n sparse matrix + // outputs + cholmod_sparse **R, // the R factor + int32_t **E, // permutation of 0:n-1, NULL if identity + cholmod_sparse **H, // the Householder vectors (m-by-nh) + int32_t **HPinv, // size m; row permutation for H + cholmod_dense **HTau, // size 1-by-nh, Householder coefficients + cholmod_common *cc // workspace and parameters +) ; + +template int64_t SuiteSparseQR ( // inputs, not modified int ordering, // all, except 3:given treated as 0:fixed @@ -1421,7 +1856,23 @@ template int64_t SuiteSparseQR cholmod_common *cc // workspace and parameters ) ; -template int64_t SuiteSparseQR +template int32_t SuiteSparseQR +( + // inputs, not modified + int ordering, // all, except 3:given treated as 0:fixed + double tol, // columns with 2-norm <= tol are treated as zero + int32_t econ, // e = max(min(m,econ),rank(A)) + cholmod_sparse *A, // m-by-n sparse matrix + // outputs + cholmod_sparse **R, // the R factor + int32_t **E, // permutation of 0:n-1, NULL if identity + cholmod_sparse **H, // the Householder vectors (m-by-nh) + int32_t **HPinv, // size m; row permutation for H + cholmod_dense **HTau, // size 1-by-nh, Householder coefficients + cholmod_common *cc // workspace and parameters +) ; + +template int64_t SuiteSparseQR ( // inputs, not modified int ordering, // all, except 3:given treated as 0:fixed @@ -1436,3 +1887,9 @@ template int64_t SuiteSparseQR cholmod_dense **HTau, // size 1-by-nh, Householder coefficients cholmod_common *cc // workspace and parameters ) ; + +template struct spqr_numeric ; +template struct spqr_numeric ; + +template struct spqr_numeric ; +template struct spqr_numeric ; diff --git a/SPQR/Source/SuiteSparseQR_C.cpp b/SPQR/Source/SuiteSparseQR_C.cpp index 6c09e4ec9..c373e0e71 100644 --- a/SPQR/Source/SuiteSparseQR_C.cpp +++ b/SPQR/Source/SuiteSparseQR_C.cpp @@ -57,9 +57,41 @@ int64_t SuiteSparseQR_C // returns rank(A) estimate, (-1) if failure cc->status = CHOLMOD_OK ; return ((A->xtype == CHOLMOD_REAL) ? - SuiteSparseQR (ordering, tol, econ, getCTX, A, Bsparse, + SuiteSparseQR (ordering, tol, econ, getCTX, A, Bsparse, Bdense, Zsparse, Zdense, R, E, H, HPinv, HTau, cc) : - SuiteSparseQR (ordering, tol, econ, getCTX, A, Bsparse, + SuiteSparseQR (ordering, tol, econ, getCTX, A, Bsparse, + Bdense, Zsparse, Zdense, R, E, H, HPinv, HTau, cc)) ; +} + +int32_t SuiteSparseQR_i_C // returns rank(A) estimate, (-1) if failure +( + // inputs: + int ordering, // all, except 3:given treated as 0:fixed + double tol, // columns with 2-norm <= tol are treated as 0 + int32_t econ, // e = max(min(m,econ),rank(A)) + int getCTX, // 0: Z=C (e-by-k), 1: Z=C', 2: Z=X (e-by-k) + cholmod_sparse *A, // m-by-n sparse matrix to factorize + cholmod_sparse *Bsparse,// sparse m-by-k B + cholmod_dense *Bdense, // dense m-by-k B + // outputs: + cholmod_sparse **Zsparse, // sparse Z + cholmod_dense **Zdense, // dense Z + cholmod_sparse **R, // R factor, e-by-n + int32_t **E, // size n column permutation, NULL if identity + cholmod_sparse **H, // m-by-nh Householder vectors + int32_t **HPinv, // size m row permutation + cholmod_dense **HTau, // 1-by-nh Householder coefficients + cholmod_common *cc // workspace and parameters +) +{ + RETURN_IF_NULL_COMMON (EMPTY) ; + RETURN_IF_NULL (A, EMPTY) ; + cc->status = CHOLMOD_OK ; + + return ((A->xtype == CHOLMOD_REAL) ? + SuiteSparseQR (ordering, tol, econ, getCTX, A, Bsparse, + Bdense, Zsparse, Zdense, R, E, H, HPinv, HTau, cc) : + SuiteSparseQR (ordering, tol, econ, getCTX, A, Bsparse, Bdense, Zsparse, Zdense, R, E, H, HPinv, HTau, cc)) ; } @@ -92,6 +124,28 @@ int64_t SuiteSparseQR_C_QR // returns rank(A) estimate, (-1) if failure SuiteSparseQR (ordering, tol, econ, A, Q, R, E, cc)) ; } +int32_t SuiteSparseQR_i_C_QR // returns rank(A) estimate, (-1) if failure +( + // inputs: + int ordering, // all, except 3:given treated as 0:fixed + double tol, // columns with 2-norm <= tol are treated as 0 + int32_t econ, // e = max(min(m,econ),rank(A)) + cholmod_sparse *A, // m-by-n sparse matrix to factorize + // outputs: + cholmod_sparse **Q, // m-by-e sparse matrix + cholmod_sparse **R, // e-by-n sparse matrix + int32_t **E, // size n column permutation, NULL if identity + cholmod_common *cc // workspace and parameters +) +{ + RETURN_IF_NULL_COMMON (EMPTY) ; + RETURN_IF_NULL (A, EMPTY) ; + cc->status = CHOLMOD_OK ; + + return ((A->xtype == CHOLMOD_REAL) ? + SuiteSparseQR (ordering, tol, econ, A, Q, R, E, cc) : + SuiteSparseQR (ordering, tol, econ, A, Q, R, E, cc)) ; +} // ============================================================================= // === SuiteSparseQR_C_backslash =============================================== // ============================================================================= @@ -111,12 +165,21 @@ cholmod_dense *SuiteSparseQR_C_backslash // returns X, NULL if failure RETURN_IF_NULL (A, NULL) ; RETURN_IF_NULL (B, NULL) ; cc->status = CHOLMOD_OK ; - - return ((A->xtype == CHOLMOD_REAL) ? - SuiteSparseQR (ordering, tol, A, B, cc) : - SuiteSparseQR (ordering, tol, A, B, cc)) ; + if (A->itype == CHOLMOD_INT) + { + return ((A->xtype == CHOLMOD_REAL) ? + SuiteSparseQR (ordering, tol, A, B, cc) : + SuiteSparseQR (ordering, tol, A, B, cc)) ; + } + else + { + return ((A->xtype == CHOLMOD_REAL) ? + SuiteSparseQR (ordering, tol, A, B, cc) : + SuiteSparseQR (ordering, tol, A, B, cc)) ; + } } + // ============================================================================= // === SuiteSparseQR_C_backslash_default ======================================= // ============================================================================= @@ -153,10 +216,18 @@ cholmod_sparse *SuiteSparseQR_C_backslash_sparse // returns X, NULL if failure RETURN_IF_NULL (A, NULL) ; RETURN_IF_NULL (B, NULL) ; cc->status = CHOLMOD_OK ; - - return ((A->xtype == CHOLMOD_REAL) ? - SuiteSparseQR (ordering, tol, A, B, cc) : - SuiteSparseQR (ordering, tol, A, B, cc)) ; + if (A->itype == CHOLMOD_INT) + { + return ((A->xtype == CHOLMOD_REAL) ? + SuiteSparseQR (ordering, tol, A, B, cc) : + SuiteSparseQR (ordering, tol, A, B, cc)) ; + } + else + { + return ((A->xtype == CHOLMOD_REAL) ? + SuiteSparseQR (ordering, tol, A, B, cc) : + SuiteSparseQR (ordering, tol, A, B, cc)) ; + } } #ifndef NEXPERT @@ -183,16 +254,30 @@ SuiteSparseQR_C_factorization *SuiteSparseQR_C_factorize cc->status = CHOLMOD_OK ; SuiteSparseQR_C_factorization *QR ; - QR = (SuiteSparseQR_C_factorization *) - cholmod_l_malloc (1, sizeof (SuiteSparseQR_C_factorization), cc) ; + QR = (SuiteSparseQR_C_factorization *) (A->itype == CHOLMOD_INT ? + spqr_malloc (1, sizeof (SuiteSparseQR_C_factorization), cc) : + spqr_malloc (1, sizeof (SuiteSparseQR_C_factorization), cc)) ; + if (cc->status < CHOLMOD_OK) { return (NULL) ; } QR->xtype = A->xtype ; - QR->factors = (A->xtype == CHOLMOD_REAL) ? - ((void *) SuiteSparseQR_factorize (ordering, tol, A, cc)) : - ((void *) SuiteSparseQR_factorize (ordering, tol, A, cc)) ; + QR->itype = A->itype ; + + if (A->itype == CHOLMOD_INT) + { + QR->factors = (A->xtype == CHOLMOD_REAL) ? + ((void *) SuiteSparseQR_factorize (ordering, tol, A, cc)) : + ((void *) SuiteSparseQR_factorize (ordering, tol, A, cc)) ; + } + else + { + QR->factors = (A->xtype == CHOLMOD_REAL) ? + ((void *) SuiteSparseQR_factorize (ordering, tol, A, cc)) : + ((void *) SuiteSparseQR_factorize (ordering, tol, A, cc)) ; + } + if (cc->status < CHOLMOD_OK) { SuiteSparseQR_C_free (&QR, cc) ; @@ -219,17 +304,28 @@ SuiteSparseQR_C_factorization *SuiteSparseQR_C_symbolic cc->status = CHOLMOD_OK ; SuiteSparseQR_C_factorization *QR ; - QR = (SuiteSparseQR_C_factorization *) - cholmod_l_malloc (1, sizeof (SuiteSparseQR_C_factorization), cc) ; + QR = (SuiteSparseQR_C_factorization *) (A->itype == CHOLMOD_INT ? + spqr_malloc (1, sizeof (SuiteSparseQR_C_factorization), cc) : + spqr_malloc (1, sizeof (SuiteSparseQR_C_factorization), cc)) ; if (cc->status < CHOLMOD_OK) { // out of memory return (NULL) ; } QR->xtype = A->xtype ; - QR->factors = (A->xtype == CHOLMOD_REAL) ? - ((void *) SuiteSparseQR_symbolic (ordering, allow_tol, A,cc)): - ((void *) SuiteSparseQR_symbolic (ordering, allow_tol, A,cc)); + QR->itype = A->itype ; + if (A->itype == CHOLMOD_INT) + { + QR->factors = (A->xtype == CHOLMOD_REAL) ? + ((void *) SuiteSparseQR_symbolic (ordering, allow_tol, A, cc)) : + ((void *) SuiteSparseQR_symbolic (ordering, allow_tol, A, cc)) ; + } + else + { + QR->factors = (A->xtype == CHOLMOD_REAL) ? + ((void *) SuiteSparseQR_symbolic (ordering, allow_tol, A, cc)) : + ((void *) SuiteSparseQR_symbolic (ordering, allow_tol, A, cc)) ; + } if (cc->status < CHOLMOD_OK) { // out of memory @@ -262,15 +358,33 @@ int SuiteSparseQR_C_numeric // returns TRUE if successful, FALSE otherwise if (QR->xtype == CHOLMOD_REAL) { - SuiteSparseQR_factorization *QR2 ; - QR2 = (SuiteSparseQR_factorization *) (QR->factors) ; - SuiteSparseQR_numeric (tol, A, QR2, cc) ; + if (QR->itype == CHOLMOD_INT) + { + SuiteSparseQR_factorization *QR2 ; + QR2 = (SuiteSparseQR_factorization *) (QR->factors) ; + SuiteSparseQR_numeric (tol, A, QR2, cc) ; + } + else + { + SuiteSparseQR_factorization *QR2 ; + QR2 = (SuiteSparseQR_factorization *) (QR->factors) ; + SuiteSparseQR_numeric (tol, A, QR2, cc) ; + } } else { - SuiteSparseQR_factorization *QR2 ; - QR2 = (SuiteSparseQR_factorization *) (QR->factors) ; - SuiteSparseQR_numeric (tol, A, QR2, cc) ; + if (QR->itype == CHOLMOD_INT) + { + SuiteSparseQR_factorization *QR2 ; + QR2 = (SuiteSparseQR_factorization *) (QR->factors) ; + SuiteSparseQR_numeric (tol, A, QR2, cc) ; + } + else + { + SuiteSparseQR_factorization *QR2 ; + QR2 = (SuiteSparseQR_factorization *) (QR->factors) ; + SuiteSparseQR_numeric (tol, A, QR2, cc) ; + } } return (TRUE) ; } @@ -293,17 +407,42 @@ int SuiteSparseQR_C_free QR = *QR_handle ; if (QR->xtype == CHOLMOD_REAL) { - SuiteSparseQR_factorization *QR2 ; - QR2 = (SuiteSparseQR_factorization *) (QR->factors) ; - spqr_freefac (&QR2, cc) ; + if (QR->itype == CHOLMOD_INT) + { + SuiteSparseQR_factorization *QR2 ; + QR2 = (SuiteSparseQR_factorization *) (QR->factors) ; + spqr_freefac (&QR2, cc) ; + } + else + { + SuiteSparseQR_factorization *QR2 ; + QR2 = (SuiteSparseQR_factorization *) (QR->factors) ; + spqr_freefac (&QR2, cc) ; + } } else { - SuiteSparseQR_factorization *QR2 ; - QR2 = (SuiteSparseQR_factorization *) (QR->factors) ; - spqr_freefac (&QR2, cc) ; + if (QR->itype == CHOLMOD_INT) + { + SuiteSparseQR_factorization *QR2 ; + QR2 = (SuiteSparseQR_factorization *) (QR->factors) ; + spqr_freefac (&QR2, cc) ; + } + else + { + SuiteSparseQR_factorization *QR2 ; + QR2 = (SuiteSparseQR_factorization *) (QR->factors) ; + spqr_freefac (&QR2, cc) ; + } + } + if (QR->itype == CHOLMOD_INT) + { + spqr_free (1, sizeof (SuiteSparseQR_C_factorization), QR, cc) ; + } + else + { + spqr_free (1, sizeof (SuiteSparseQR_C_factorization), QR, cc) ; } - cholmod_l_free (1, sizeof (SuiteSparseQR_C_factorization), QR, cc) ; *QR_handle = NULL ; return (TRUE) ; } @@ -329,11 +468,32 @@ cholmod_dense* SuiteSparseQR_C_solve // returnx X, or NULL if failure ) { RETURN_IF_NULL (QR, NULL) ; - return ((QR->xtype == CHOLMOD_REAL) ? - SuiteSparseQR_solve (system, - (SuiteSparseQR_factorization *) QR->factors, B, cc) : - SuiteSparseQR_solve (system, - (SuiteSparseQR_factorization *) QR->factors, B, cc)) ; + if (QR->xtype == CHOLMOD_REAL) + { + if (QR->itype == CHOLMOD_INT) + { + return SuiteSparseQR_solve (system, + (SuiteSparseQR_factorization *) QR->factors, B, cc) ; + } + else + { + return SuiteSparseQR_solve (system, + (SuiteSparseQR_factorization *) QR->factors, B, cc) ; + } + } + else + { + if (QR->itype == CHOLMOD_INT) + { + return SuiteSparseQR_solve (system, + (SuiteSparseQR_factorization *) QR->factors, B, cc) ; + } + else + { + return SuiteSparseQR_solve (system, + (SuiteSparseQR_factorization *) QR->factors, B, cc) ; + } + } } // ============================================================================= @@ -359,11 +519,32 @@ cholmod_dense *SuiteSparseQR_C_qmult ) { RETURN_IF_NULL (QR, NULL) ; - return ((QR->xtype == CHOLMOD_REAL) ? - SuiteSparseQR_qmult (method, - (SuiteSparseQR_factorization *) QR->factors, X, cc) : - SuiteSparseQR_qmult (method, - (SuiteSparseQR_factorization *) QR->factors, X, cc)) ; + if (QR->xtype == CHOLMOD_REAL) + { + if (QR->itype == CHOLMOD_INT) + { + return SuiteSparseQR_qmult (method, + (SuiteSparseQR_factorization *) QR->factors, X, cc) ; + } + else + { + return SuiteSparseQR_qmult (method, + (SuiteSparseQR_factorization *) QR->factors, X, cc) ; + } + } + else + { + if (QR->itype == CHOLMOD_INT) + { + return SuiteSparseQR_qmult (method, + (SuiteSparseQR_factorization *) QR->factors, X, cc) ; + } + else + { + return SuiteSparseQR_qmult (method, + (SuiteSparseQR_factorization *) QR->factors, X, cc) ; + } + } } #endif diff --git a/SPQR/Source/SuiteSparseQR_expert.cpp b/SPQR/Source/SuiteSparseQR_expert.cpp index 721851437..cbd4b55b2 100644 --- a/SPQR/Source/SuiteSparseQR_expert.cpp +++ b/SPQR/Source/SuiteSparseQR_expert.cpp @@ -49,8 +49,8 @@ // This returns a QR factorization object with a NULL numeric part. It must // be followed by a numeric factorization, by SuiteSparseQR_numeric. -template -SuiteSparseQR_factorization *SuiteSparseQR_symbolic +template +SuiteSparseQR_factorization *SuiteSparseQR_symbolic ( // inputs: int ordering, // all, except 3:given treated as 0:fixed @@ -72,11 +72,11 @@ SuiteSparseQR_factorization *SuiteSparseQR_symbolic // get inputs and allocate result // ------------------------------------------------------------------------- - SuiteSparseQR_factorization *QR ; - spqr_symbolic *QRsym ; + SuiteSparseQR_factorization *QR ; + spqr_symbolic *QRsym ; - QR = (SuiteSparseQR_factorization *) - cholmod_l_malloc (1, sizeof (SuiteSparseQR_factorization ), cc) ; + QR = (SuiteSparseQR_factorization *) + spqr_malloc (1, sizeof (SuiteSparseQR_factorization ), cc) ; if (cc->status < CHOLMOD_OK) { @@ -91,7 +91,7 @@ SuiteSparseQR_factorization *SuiteSparseQR_symbolic // Using SuiteSparseQR_symbolic followed by SuiteSparseQR_numeric requires // that the Householder vectors be kept, and thus the GPU will not be used. int keepH = TRUE ; - QR->QRsym = QRsym = spqr_analyze (A, ordering, NULL, allow_tol, keepH, cc) ; + QR->QRsym = QRsym = spqr_analyze (A, ordering, NULL, allow_tol, keepH, cc) ; QR->QRnum = NULL ; // allocated later, by numeric factorization @@ -132,10 +132,10 @@ SuiteSparseQR_factorization *SuiteSparseQR_symbolic if (QRsym->Qfill != NULL) { - int64_t n, k, *Qfill, *Q1fill ; + Int n, k, *Qfill, *Q1fill ; Qfill = QRsym->Qfill ; n = A->ncol ; - Q1fill = (int64_t *) cholmod_l_malloc (n, sizeof (int64_t), cc) ; + Q1fill = (Int *) spqr_malloc (n, sizeof (Int), cc) ; QR->Q1fill = Q1fill ; if (cc->status < CHOLMOD_OK) { @@ -156,7 +156,7 @@ SuiteSparseQR_factorization *SuiteSparseQR_symbolic } template -SuiteSparseQR_factorization *SuiteSparseQR_symbolic +SuiteSparseQR_factorization *SuiteSparseQR_symbolic ( // inputs: int ordering, // all, except 3:given treated as 0:fixed @@ -167,7 +167,28 @@ SuiteSparseQR_factorization *SuiteSparseQR_symbolic ) ; template -SuiteSparseQR_factorization *SuiteSparseQR_symbolic +SuiteSparseQR_factorization *SuiteSparseQR_symbolic +( + // inputs: + int ordering, // all, except 3:given treated as 0:fixed + int allow_tol, // if FALSE, tol is ignored by the numeric + // factorization, and no rank detection is performed + cholmod_sparse *A, // sparse matrix to factorize (A->x ignored) + cholmod_common *cc // workspace and parameters +) ; +template +SuiteSparseQR_factorization *SuiteSparseQR_symbolic +( + // inputs: + int ordering, // all, except 3:given treated as 0:fixed + int allow_tol, // if FALSE, tol is ignored by the numeric + // factorization, and no rank detection is performed + cholmod_sparse *A, // sparse matrix to factorize (A->x ignored) + cholmod_common *cc // workspace and parameters +) ; + +template +SuiteSparseQR_factorization *SuiteSparseQR_symbolic ( // inputs: int ordering, // all, except 3:given treated as 0:fixed @@ -191,13 +212,13 @@ SuiteSparseQR_factorization *SuiteSparseQR_symbolic // The GPU is not used by this function, since it requires the Householder // vectors to be kept. -template int SuiteSparseQR_numeric +template int SuiteSparseQR_numeric ( // inputs: double tol, // treat columns with 2-norm <= tol as zero cholmod_sparse *A, // sparse matrix to factorize // input/output - SuiteSparseQR_factorization *QR, + SuiteSparseQR_factorization *QR, cholmod_common *cc // workspace and parameters ) { @@ -229,7 +250,7 @@ template int SuiteSparseQR_numeric // compute default tol, if requested if (tol <= SPQR_DEFAULT_TOL) { - tol = spqr_tol (A, cc) ; + tol = spqr_tol (A, cc) ; } } else @@ -247,7 +268,7 @@ template int SuiteSparseQR_numeric spqr_freenum (&(QR->QRnum), cc) ; // compute the new factorization - QR->QRnum = spqr_factorize (&A, FALSE, tol, n, QR->QRsym, cc) ; + QR->QRnum = spqr_factorize (&A, FALSE, tol, n, QR->QRsym, cc) ; if (cc->status < CHOLMOD_OK) { @@ -282,26 +303,44 @@ template int SuiteSparseQR_numeric return (TRUE) ; } -template int SuiteSparseQR_numeric +template int SuiteSparseQR_numeric ( // inputs: double tol, // treat columns with 2-norm <= tol as zero cholmod_sparse *A, // sparse matrix to factorize // input/output - SuiteSparseQR_factorization *QR, + SuiteSparseQR_factorization *QR, cholmod_common *cc // workspace and parameters ) ; -template int SuiteSparseQR_numeric +template int SuiteSparseQR_numeric ( // inputs: double tol, // treat columns with 2-norm <= tol as zero cholmod_sparse *A, // sparse matrix to factorize // input/output - SuiteSparseQR_factorization *QR, + SuiteSparseQR_factorization *QR, + cholmod_common *cc // workspace and parameters +) ; +template int SuiteSparseQR_numeric +( + // inputs: + double tol, // treat columns with 2-norm <= tol as zero + cholmod_sparse *A, // sparse matrix to factorize + // input/output + SuiteSparseQR_factorization *QR, cholmod_common *cc // workspace and parameters ) ; +template int SuiteSparseQR_numeric +( + // inputs: + double tol, // treat columns with 2-norm <= tol as zero + cholmod_sparse *A, // sparse matrix to factorize + // input/output + SuiteSparseQR_factorization *QR, + cholmod_common *cc // workspace and parameters +) ; // ============================================================================= // === SuiteSparseQR_factorize ================================================= // ============================================================================= @@ -326,8 +365,8 @@ template int SuiteSparseQR_numeric // // The GPU is not used because the Householder vectors are always kept. -template -SuiteSparseQR_factorization *SuiteSparseQR_factorize +template +SuiteSparseQR_factorization *SuiteSparseQR_factorize ( // inputs, not modified: int ordering, // all, except 3:given treated as 0:fixed @@ -343,11 +382,11 @@ SuiteSparseQR_factorization *SuiteSparseQR_factorize cc->status = CHOLMOD_OK ; // B is not present, and always keep H: int keepH = TRUE ; - return (spqr_1factor (ordering, tol, 0, keepH, A, + return (spqr_1factor (ordering, tol, 0, keepH, A, 0, NULL, NULL, NULL, cc)) ; } -template SuiteSparseQR_factorization *SuiteSparseQR_factorize +template SuiteSparseQR_factorization *SuiteSparseQR_factorize ( // inputs, not modified: int ordering, // all, except 3:given treated as 0:fixed @@ -357,7 +396,16 @@ template SuiteSparseQR_factorization *SuiteSparseQR_factorize cholmod_common *cc ) ; -template SuiteSparseQR_factorization *SuiteSparseQR_factorize +template SuiteSparseQR_factorization *SuiteSparseQR_factorize +( + // inputs, not modified: + int ordering, // all, except 3:given treated as 0:fixed + double tol, // treat columns with 2-norm <= tol as zero + cholmod_sparse *A, // sparse matrix to factorize + // workspace and parameters + cholmod_common *cc +) ; +template SuiteSparseQR_factorization *SuiteSparseQR_factorize ( // inputs, not modified: int ordering, // all, except 3:given treated as 0:fixed @@ -367,6 +415,15 @@ template SuiteSparseQR_factorization *SuiteSparseQR_factorize cholmod_common *cc ) ; +template SuiteSparseQR_factorization *SuiteSparseQR_factorize +( + // inputs, not modified: + int ordering, // all, except 3:given treated as 0:fixed + double tol, // treat columns with 2-norm <= tol as zero + cholmod_sparse *A, // sparse matrix to factorize + // workspace and parameters + cholmod_common *cc +) ; // ============================================================================= // === spqr_private_rtsolve ==================================================== @@ -376,14 +433,14 @@ template SuiteSparseQR_factorization *SuiteSparseQR_factorize // or SuiteSparseQR_factorize (including the singleton-row R and the // multifrontal R). A is m-by-n. B is n-by-nrhs, and X is m-by-nrhs. -template void spqr_private_rtsolve +template void spqr_private_rtsolve ( // inputs - SuiteSparseQR_factorization *QR, + SuiteSparseQR_factorization *QR, int use_Q1fill, - int64_t nrhs, // number of columns of B - int64_t ldb, // leading dimension of B + Int nrhs, // number of columns of B + Int ldb, // leading dimension of B Entry *B, // size n-by-nrhs with leading dimension ldb // output, contents undefined on input @@ -393,13 +450,13 @@ template void spqr_private_rtsolve ) { Entry xi ; - spqr_symbolic *QRsym ; - spqr_numeric *QRnum ; - int64_t *R1p, *R1j, *Rmap, *Rp, *Rj, *Super, *HStair, *Hm, *Stair, *Q1fill, + spqr_symbolic *QRsym ; + spqr_numeric *QRnum ; + Int *R1p, *R1j, *Rmap, *Rp, *Rj, *Super, *HStair, *Hm, *Stair, *Q1fill, *RmapInv ; Entry *R1x, **Rblock, *R, *X1, *X2 ; char *Rdead ; - int64_t i, j, k, m, n, p, kk, n1rows, n1cols, rank, nf, f, col1, col2, fp, pr, + Int i, j, k, m, n, p, kk, n1rows, n1cols, rank, nf, f, col1, col2, fp, pr, fn, rm, row1, keepH, fm, h, t, live, jj ; // ------------------------------------------------------------------------- @@ -475,7 +532,7 @@ template void spqr_private_rtsolve { k = RmapInv [i] ; ASSERT (k >= 0 && k < n) ; - int64_t knew = Q1fill ? Q1fill [k] : k ; + Int knew = Q1fill ? Q1fill [k] : k ; ASSERT (knew >= 0 && knew < n) ; X1 [i] = B [knew] ; } @@ -630,7 +687,7 @@ template void spqr_private_rtsolve jj = j + n1cols ; if (jj >= n) break ; // in case [A Binput] was factorized - int64_t ii = Rmap ? Rmap [jj] : jj ; + Int ii = Rmap ? Rmap [jj] : jj ; ASSERT (ii >= n1rows && ii < n) ; if (ii < rank) { @@ -687,11 +744,11 @@ template void spqr_private_rtsolve // Both X and B are dense matrices. Only the first r rows and columns of R are // used, where r is the rank estimate of A found by SuiteSparseQR_factorize. -template cholmod_dense *SuiteSparseQR_solve // returns X +template cholmod_dense *SuiteSparseQR_solve // returns X ( // inputs, not modified: int system, // which system to solve (0,1,2,3) - SuiteSparseQR_factorization *QR, // of an m-by-n sparse matrix A + SuiteSparseQR_factorization *QR, // of an m-by-n sparse matrix A cholmod_dense *B, // right-hand-side, m-by-nrhs or n-by-nrhs // workspace and parameters cholmod_common *cc @@ -699,7 +756,7 @@ template cholmod_dense *SuiteSparseQR_solve // returns X { Entry *Bx ; cholmod_dense *W, *X ; - int64_t m, n, nrhs, ldb, ok ; + Int m, n, nrhs, ldb, ok ; // ------------------------------------------------------------------------- // get inputs @@ -718,7 +775,7 @@ template cholmod_dense *SuiteSparseQR_solve // returns X } m = QR->narows ; n = QR->nacols ; - if ((int64_t) B->nrow != ((system <= SPQR_RETX_EQUALS_B) ? m : n)) + if ((Int) B->nrow != ((system <= SPQR_RETX_EQUALS_B) ? m : n)) { ERROR (CHOLMOD_INVALID, "invalid dimensions") ; return (NULL) ; @@ -739,22 +796,22 @@ template cholmod_dense *SuiteSparseQR_solve // returns X // X = E*(R\B) or X=R\B // --------------------------------------------------------------------- - int64_t *Rlive ; + Int *Rlive ; Entry **Rcolp ; - X = cholmod_l_allocate_dense (n, nrhs, n, xtype, cc) ; - int64_t maxfrank = QR->QRnum->maxfrank ; - W = cholmod_l_allocate_dense (maxfrank, nrhs, maxfrank, xtype, cc) ; - Rlive = (int64_t *) cholmod_l_malloc (maxfrank, sizeof (int64_t), cc) ; - Rcolp = (Entry **) cholmod_l_malloc (maxfrank, sizeof (Entry *), cc) ; + X = spqr_allocate_dense (n, nrhs, n, xtype, cc) ; + Int maxfrank = QR->QRnum->maxfrank ; + W = spqr_allocate_dense (maxfrank, nrhs, maxfrank, xtype, cc) ; + Rlive = (Int *) spqr_malloc (maxfrank, sizeof (Int), cc) ; + Rcolp = (Entry **) spqr_malloc (maxfrank, sizeof (Entry *), cc) ; ok = (X != NULL) && (W != NULL) && (cc->status == CHOLMOD_OK) ; if (ok) { spqr_rsolve (QR, system == SPQR_RETX_EQUALS_B, nrhs, ldb, Bx, (Entry *) X->x, Rcolp, Rlive, (Entry *) W->x, cc) ; } - cholmod_l_free (maxfrank, sizeof (int64_t), Rlive, cc) ; - cholmod_l_free (maxfrank, sizeof (Entry *), Rcolp, cc) ; - cholmod_l_free_dense (&W, cc) ; + spqr_free (maxfrank, sizeof (Int), Rlive, cc) ; + spqr_free (maxfrank, sizeof (Entry *), Rcolp, cc) ; + spqr_free_dense (&W, cc) ; } else @@ -764,7 +821,7 @@ template cholmod_dense *SuiteSparseQR_solve // returns X // X = R'\(E'*B) or R'\B // --------------------------------------------------------------------- - X = cholmod_l_allocate_dense (m, nrhs, m, xtype, cc) ; + X = spqr_allocate_dense (m, nrhs, m, xtype, cc) ; ok = (X != NULL) ; if (ok) { @@ -777,7 +834,7 @@ template cholmod_dense *SuiteSparseQR_solve // returns X { // out of memory ERROR (CHOLMOD_OUT_OF_MEMORY, "out of memory") ; - cholmod_l_free_dense (&X, cc) ; + spqr_free_dense (&X, cc) ; return (NULL) ; } @@ -785,36 +842,54 @@ template cholmod_dense *SuiteSparseQR_solve // returns X } -template cholmod_dense *SuiteSparseQR_solve +template cholmod_dense *SuiteSparseQR_solve ( // inputs, not modified: int system, // which system to solve - SuiteSparseQR_factorization *QR, // of an m-by-n sparse matrix A + SuiteSparseQR_factorization *QR, // of an m-by-n sparse matrix A cholmod_dense *B, // right-hand-side, m-by-nrhs or n-by-nrhs // workspace and parameters cholmod_common *cc ) ; -template cholmod_dense *SuiteSparseQR_solve +template cholmod_dense *SuiteSparseQR_solve ( // inputs, not modified: int system, // which system to solve - SuiteSparseQR_factorization *QR, // of an m-by-n sparse matrix A + SuiteSparseQR_factorization *QR, // of an m-by-n sparse matrix A cholmod_dense *B, // right-hand-side, m-by-nrhs or n-by-nrhs // workspace and parameters cholmod_common *cc ) ; +template cholmod_dense *SuiteSparseQR_solve +( + // inputs, not modified: + int system, // which system to solve + SuiteSparseQR_factorization *QR, // of an m-by-n sparse matrix A + cholmod_dense *B, // right-hand-side, m-by-nrhs or n-by-nrhs + // workspace and parameters + cholmod_common *cc +) ; +template cholmod_dense *SuiteSparseQR_solve +( + // inputs, not modified: + int system, // which system to solve + SuiteSparseQR_factorization *QR, // of an m-by-n sparse matrix A + cholmod_dense *B, // right-hand-side, m-by-nrhs or n-by-nrhs + // workspace and parameters + cholmod_common *cc +) ; // ============================================================================= // === SuiteSparseQR_solve (sparse case) ======================================= // ============================================================================= -template cholmod_sparse *SuiteSparseQR_solve // returns X +template cholmod_sparse *SuiteSparseQR_solve // returns X ( // inputs, not modified: int system, // which system to solve (0,1,2,3) - SuiteSparseQR_factorization *QR, // of an m-by-n sparse matrix A + SuiteSparseQR_factorization *QR, // of an m-by-n sparse matrix A cholmod_sparse *Bsparse, // right-hand-side, m-by-nrhs or n-by-nrhs // workspace and parameters cholmod_common *cc @@ -829,11 +904,11 @@ template cholmod_sparse *SuiteSparseQR_solve // returns X RETURN_IF_XTYPE_INVALID (Bsparse, NULL) ; cc->status = CHOLMOD_OK ; - Bdense = cholmod_l_sparse_to_dense (Bsparse, cc) ; - Xdense = SuiteSparseQR_solve (system, QR, Bdense, cc) ; - cholmod_l_free_dense (&Bdense, cc) ; - Xsparse = cholmod_l_dense_to_sparse (Xdense, TRUE, cc) ; - cholmod_l_free_dense (&Xdense, cc) ; + Bdense = spqr_sparse_to_dense (Bsparse, cc) ; + Xdense = SuiteSparseQR_solve (system, QR, Bdense, cc) ; + spqr_free_dense (&Bdense, cc) ; + Xsparse = spqr_dense_to_sparse (Xdense, TRUE, cc) ; + spqr_free_dense (&Xdense, cc) ; if (Xsparse == NULL) { @@ -842,26 +917,43 @@ template cholmod_sparse *SuiteSparseQR_solve // returns X return (Xsparse) ; } -template cholmod_sparse *SuiteSparseQR_solve +template cholmod_sparse *SuiteSparseQR_solve ( // inputs, not modified: int system, // which system to solve (0,1,2,3) - SuiteSparseQR_factorization *QR, // of an m-by-n sparse matrix A + SuiteSparseQR_factorization *QR, // of an m-by-n sparse matrix A cholmod_sparse *Bsparse, // right-hand-side, m-by-nrhs or n-by-nrhs // workspace and parameters cholmod_common *cc ) ; - -template cholmod_sparse *SuiteSparseQR_solve +template cholmod_sparse *SuiteSparseQR_solve ( // inputs, not modified: int system, // which system to solve (0,1,2,3) - SuiteSparseQR_factorization *QR, // of an m-by-n sparse matrix A + SuiteSparseQR_factorization *QR, // of an m-by-n sparse matrix A cholmod_sparse *Bsparse, // right-hand-side, m-by-nrhs or n-by-nrhs // workspace and parameters cholmod_common *cc ) ; +template cholmod_sparse *SuiteSparseQR_solve +( + // inputs, not modified: + int system, // which system to solve (0,1,2,3) + SuiteSparseQR_factorization *QR, // of an m-by-n sparse matrix A + cholmod_sparse *Bsparse, // right-hand-side, m-by-nrhs or n-by-nrhs + // workspace and parameters + cholmod_common *cc +) ; +template cholmod_sparse *SuiteSparseQR_solve +( + // inputs, not modified: + int system, // which system to solve (0,1,2,3) + SuiteSparseQR_factorization *QR, // of an m-by-n sparse matrix A + cholmod_sparse *Bsparse, // right-hand-side, m-by-nrhs or n-by-nrhs + // workspace and parameters + cholmod_common *cc +) ; // ============================================================================= // === spqr_private_get_H_vectors ============================================== @@ -870,24 +962,24 @@ template cholmod_sparse *SuiteSparseQR_solve // Get pointers to the Householder vectors in a single front. // Returns # Householder vectors in F. -template int64_t spqr_private_get_H_vectors +template Int spqr_private_get_H_vectors ( // inputs - int64_t f, // front to operate on - SuiteSparseQR_factorization *QR, + Int f, // front to operate on + SuiteSparseQR_factorization *QR, // outputs Entry *H_Tau, // size QRsym->maxfn - int64_t *H_start, // size QRsym->maxfn - int64_t *H_end, // size QRsym->maxfn + Int *H_start, // size QRsym->maxfn + Int *H_end, // size QRsym->maxfn cholmod_common *cc ) { - spqr_symbolic *QRsym ; - spqr_numeric *QRnum ; + spqr_symbolic *QRsym ; + spqr_numeric *QRnum ; Entry *Tau ; - int64_t *Rj, *Stair ; - int64_t col1, col2, fp, pr, fn, fm, h, nh, p, rm, k, j, t, n1cols, n ; + Int *Rj, *Stair ; + Int col1, col2, fp, pr, fn, fm, h, nh, p, rm, k, j, t, n1cols, n ; // ------------------------------------------------------------------------- // get the R block for front F @@ -969,13 +1061,13 @@ template int64_t spqr_private_get_H_vectors // Load Householder vectors h1:h2-1 into the panel V. Return # of rows in V. -template int64_t spqr_private_load_H_vectors +template Int spqr_private_load_H_vectors ( // input - int64_t h1, // load vectors h1 to h2-1 - int64_t h2, - int64_t *H_start, // vector h starts at R [H_start [h]] - int64_t *H_end, // vector h ends at R [H_end [h]-1] + Int h1, // load vectors h1 to h2-1 + Int h2, + Int *H_start, // vector h starts at R [H_start [h]] + Int *H_end, // vector h ends at R [H_end [h]-1] Entry *R, // Rblock [f] // output Entry *V, // V is v-by-(h2-h1) and lower triangular @@ -983,16 +1075,16 @@ template int64_t spqr_private_load_H_vectors ) { // v = length of last H vector - int64_t v = H_end [h2-1] - H_start [h2-1] + (h2-h1) ; + Int v = H_end [h2-1] - H_start [h2-1] + (h2-h1) ; Entry *V1 = V ; - for (int64_t h = h1 ; h < h2 ; h++) + for (Int h = h1 ; h < h2 ; h++) { - int64_t i ; + Int i ; // This part of V is not accessed, for testing only: // for (i = 0 ; i < h-h1 ; i++) V1 [i] = 0 ; i = h-h1 ; V1 [i++] = 1 ; - for (int64_t p = H_start [h] ; p < H_end [h] ; p++) + for (Int p = H_start [h] ; p < H_end [h] ; p++) { V1 [i++] = R [p] ; } @@ -1013,23 +1105,23 @@ template int64_t spqr_private_load_H_vectors // Given a QR factorization from spqr_1factor, apply the Householder vectors // to a dense matrix X. -template void spqr_private_Happly +template void spqr_private_Happly ( // inputs int method, // 0,1,2,3 - SuiteSparseQR_factorization *QR, - int64_t hchunk, // apply hchunk Householder vectors at a time + SuiteSparseQR_factorization *QR, + Int hchunk, // apply hchunk Householder vectors at a time // input/output - int64_t m, - int64_t n, + Int m, + Int n, Entry *X, // size m-by-n with leading dimension m; only // X (n1rows:m-1,:) or X (:,n1rows:n-1) is modified // workspace, not defined on input or output Entry *H_Tau, // size QRsym->maxfn - int64_t *H_start, // size QRsym->maxfn - int64_t *H_end, // size QRsym->maxfn + Int *H_start, // size QRsym->maxfn + Int *H_end, // size QRsym->maxfn Entry *V, // size v-by-hchunk, where v = QRnum->maxfm Entry *C, // size: method 0,1: v*n, method 2,3: m*v Entry *W, // size: method 0,1: h*h+n*h, method 2,3: h*h+m*h @@ -1038,11 +1130,11 @@ template void spqr_private_Happly ) { - spqr_symbolic *QRsym ; - spqr_numeric *QRnum ; + spqr_symbolic *QRsym ; + spqr_numeric *QRnum ; Entry **Rblock, *R, *X2 ; - int64_t *Hii, *Hip, *Hi ; - int64_t nf, f, nh, h1, h2, v, n1rows, m2, n2 ; + Int *Hii, *Hip, *Hi ; + Int nf, f, nh, h1, h2, v, n1rows, m2, n2 ; // ------------------------------------------------------------------------- // get the contents of the QR factorization @@ -1158,21 +1250,21 @@ template void spqr_private_Happly #define FREE_WORK \ { \ - cholmod_l_free_dense (&Zdense, cc) ; \ - cholmod_l_free_dense (&Vdense, cc) ; \ - cholmod_l_free_dense (&Wdense, cc) ; \ - cholmod_l_free_dense (&Cdense, cc) ; \ - cholmod_l_free (maxfn, sizeof (Entry), H_Tau, cc) ; \ - cholmod_l_free (maxfn, sizeof (int64_t), H_start, cc) ; \ - cholmod_l_free (maxfn, sizeof (int64_t), H_end, cc) ; \ + spqr_free_dense (&Zdense, cc) ; \ + spqr_free_dense (&Vdense, cc) ; \ + spqr_free_dense (&Wdense, cc) ; \ + spqr_free_dense (&Cdense, cc) ; \ + spqr_free (maxfn, sizeof (Entry), H_Tau, cc) ; \ + spqr_free (maxfn, sizeof (Int), H_start, cc) ; \ + spqr_free (maxfn, sizeof (Int), H_end, cc) ; \ } // returns Y of size m-by-n, or NULL on failure -template cholmod_dense *SuiteSparseQR_qmult +template cholmod_dense *SuiteSparseQR_qmult ( // inputs, not modified int method, // 0,1,2,3 - SuiteSparseQR_factorization *QR, + SuiteSparseQR_factorization *QR, cholmod_dense *Xdense, // size m-by-n with leading dimension ldx // workspace and parameters @@ -1181,8 +1273,8 @@ template cholmod_dense *SuiteSparseQR_qmult { cholmod_dense *Ydense, *Cdense, *Vdense, *Wdense, *Zdense ; Entry *X, *Y, *X1, *Y1, *Z1, *C, *V, *Z, *W, *H_Tau ; - int64_t *HPinv, *H_start, *H_end ; - int64_t i, k, mh, v, hchunk, ldx, m, n, maxfn, ok ; + Int *HPinv, *H_start, *H_end ; + Int i, k, mh, v, hchunk, ldx, m, n, maxfn, ok ; // ------------------------------------------------------------------------- // get inputs @@ -1238,7 +1330,7 @@ template cholmod_dense *SuiteSparseQR_qmult // allocate result Y // ------------------------------------------------------------------------- - Ydense = cholmod_l_allocate_dense (m, n, m, xtype, cc) ; + Ydense = spqr_allocate_dense (m, n, m, xtype, cc) ; if (cc->status < CHOLMOD_OK) { // out of memory @@ -1262,7 +1354,7 @@ template cholmod_dense *SuiteSparseQR_qmult if (method == SPQR_QX || method == SPQR_XQT) { // Z of size m-by-n is needed only for Q*X and X*Q' - Zdense = cholmod_l_allocate_dense (m, n, m, xtype, cc) ; + Zdense = spqr_allocate_dense (m, n, m, xtype, cc) ; ok = (Zdense != NULL) ; } @@ -1270,20 +1362,20 @@ template cholmod_dense *SuiteSparseQR_qmult ASSERT (v <= mh) ; // C is workspace of size v-by-n or m-by-v - Cdense = cholmod_l_allocate_dense (v, (method <= SPQR_QX) ? n : m, + Cdense = spqr_allocate_dense (v, (method <= SPQR_QX) ? n : m, v, xtype, cc) ; Vdense = NULL ; Wdense = NULL ; - H_Tau = (Entry *) cholmod_l_malloc (maxfn, sizeof (Entry), cc) ; - H_start = (int64_t *) cholmod_l_malloc (maxfn, sizeof (int64_t), cc) ; - H_end = (int64_t *) cholmod_l_malloc (maxfn, sizeof (int64_t), cc) ; + H_Tau = (Entry *) spqr_malloc (maxfn, sizeof (Entry), cc) ; + H_start = (Int *) spqr_malloc (maxfn, sizeof (Int), cc) ; + H_end = (Int *) spqr_malloc (maxfn, sizeof (Int), cc) ; if (!ok || Cdense == NULL || cc->status < CHOLMOD_OK) { // out of memory; free workspace and result Y ERROR (CHOLMOD_OUT_OF_MEMORY, "out of memory") ; - cholmod_l_free_dense (&Ydense, cc) ; + spqr_free_dense (&Ydense, cc) ; FREE_WORK ; return (NULL) ; } @@ -1314,10 +1406,10 @@ template cholmod_dense *SuiteSparseQR_qmult // ------------------------------------------------------------------------- // V is workspace of size v-by-hchunk - Vdense = cholmod_l_allocate_dense (v, hchunk, v, xtype, cc) ; + Vdense = spqr_allocate_dense (v, hchunk, v, xtype, cc) ; // W is workspace of size h*h+n*h or h*h+m*h where h = hchunk - Wdense = cholmod_l_allocate_dense (hchunk, + Wdense = spqr_allocate_dense (hchunk, hchunk + ((method <= SPQR_QX) ? n : m), hchunk, xtype, cc) ; // ------------------------------------------------------------------------- @@ -1330,18 +1422,18 @@ template cholmod_dense *SuiteSparseQR_qmult cc->status = CHOLMOD_OK ; hchunk = 1 ; - cholmod_l_free_dense (&Vdense, cc) ; - cholmod_l_free_dense (&Wdense, cc) ; + spqr_free_dense (&Vdense, cc) ; + spqr_free_dense (&Wdense, cc) ; - Vdense = cholmod_l_allocate_dense (v, hchunk, v, xtype, cc) ; - Wdense = cholmod_l_allocate_dense (hchunk, + Vdense = spqr_allocate_dense (v, hchunk, v, xtype, cc) ; + Wdense = spqr_allocate_dense (hchunk, hchunk + ((method <= SPQR_QX) ? n : m), hchunk, xtype, cc) ; if (Vdense == NULL || Wdense == NULL) { // out of memory; free workspace and result Y ERROR (CHOLMOD_OUT_OF_MEMORY, "out of memory") ; - cholmod_l_free_dense (&Ydense, cc) ; + spqr_free_dense (&Ydense, cc) ; FREE_WORK ; return (NULL) ; } @@ -1464,10 +1556,10 @@ template cholmod_dense *SuiteSparseQR_qmult FREE_WORK ; - if (sizeof (SUITESPARSE_BLAS_INT) < sizeof (int64_t) && !cc->blas_ok) + if (sizeof (SUITESPARSE_BLAS_INT) < sizeof (size_t) && !cc->blas_ok) { ERROR (CHOLMOD_INVALID, "problem too large for the BLAS") ; - cholmod_l_free_dense (&Ydense, cc) ; + spqr_free_dense (&Ydense, cc) ; return (NULL) ; } @@ -1475,40 +1567,58 @@ template cholmod_dense *SuiteSparseQR_qmult } -template cholmod_dense *SuiteSparseQR_qmult +template cholmod_dense *SuiteSparseQR_qmult ( // inputs, not modified int method, // 0,1,2,3 - SuiteSparseQR_factorization *QR, + SuiteSparseQR_factorization *QR, cholmod_dense *Xdense, // size m-by-n with leading dimension ldx // workspace and parameters cholmod_common *cc ) ; +template cholmod_dense *SuiteSparseQR_qmult +( + // inputs, not modified + int method, // 0,1,2,3 + SuiteSparseQR_factorization *QR, + cholmod_dense *Xdense, // size m-by-n with leading dimension ldx + // workspace and parameters + cholmod_common *cc +) ; -template cholmod_dense *SuiteSparseQR_qmult +template cholmod_dense *SuiteSparseQR_qmult ( // inputs, not modified int method, // 0,1,2,3 - SuiteSparseQR_factorization *QR, + SuiteSparseQR_factorization *QR, cholmod_dense *Xdense, // size m-by-n with leading dimension ldx // workspace and parameters cholmod_common *cc ) ; +template cholmod_dense *SuiteSparseQR_qmult +( + // inputs, not modified + int method, // 0,1,2,3 + SuiteSparseQR_factorization *QR, + cholmod_dense *Xdense, // size m-by-n with leading dimension ldx + // workspace and parameters + cholmod_common *cc +) ; // ============================================================================= // === SuiteSparseQR_qmult (sparse case) ======================================= // ============================================================================= // returns Y of size m-by-n, or NULL on failure -template cholmod_sparse *SuiteSparseQR_qmult +template cholmod_sparse *SuiteSparseQR_qmult ( // inputs, not modified int method, // 0,1,2,3 - SuiteSparseQR_factorization *QR, + SuiteSparseQR_factorization *QR, cholmod_sparse *Xsparse, // size m-by-n // workspace and parameters cholmod_common *cc @@ -1523,11 +1633,11 @@ template cholmod_sparse *SuiteSparseQR_qmult RETURN_IF_XTYPE_INVALID (Xsparse, NULL) ; cc->status = CHOLMOD_OK ; - Xdense = cholmod_l_sparse_to_dense (Xsparse, cc) ; - Ydense = SuiteSparseQR_qmult (method, QR, Xdense, cc) ; - cholmod_l_free_dense (&Xdense, cc) ; - Ysparse = cholmod_l_dense_to_sparse (Ydense, TRUE, cc) ; - cholmod_l_free_dense (&Ydense, cc) ; + Xdense = spqr_sparse_to_dense (Xsparse, cc) ; + Ydense = SuiteSparseQR_qmult (method, QR, Xdense, cc) ; + spqr_free_dense (&Xdense, cc) ; + Ysparse = spqr_dense_to_sparse (Ydense, TRUE, cc) ; + spqr_free_dense (&Ydense, cc) ; if (Ysparse == NULL) { @@ -1536,26 +1646,43 @@ template cholmod_sparse *SuiteSparseQR_qmult return (Ysparse) ; } -template cholmod_sparse *SuiteSparseQR_qmult +template cholmod_sparse *SuiteSparseQR_qmult ( // inputs, not modified int method, // 0,1,2,3 - SuiteSparseQR_factorization *QR, + SuiteSparseQR_factorization *QR, cholmod_sparse *Xsparse, // size m-by-n // workspace and parameters cholmod_common *cc ) ; - -template cholmod_sparse *SuiteSparseQR_qmult +template cholmod_sparse *SuiteSparseQR_qmult ( // inputs, not modified int method, // 0,1,2,3 - SuiteSparseQR_factorization *QR, + SuiteSparseQR_factorization *QR, cholmod_sparse *Xsparse, // size m-by-n // workspace and parameters cholmod_common *cc ) ; +template cholmod_sparse *SuiteSparseQR_qmult +( + // inputs, not modified + int method, // 0,1,2,3 + SuiteSparseQR_factorization *QR, + cholmod_sparse *Xsparse, // size m-by-n + // workspace and parameters + cholmod_common *cc +) ; +template cholmod_sparse *SuiteSparseQR_qmult +( + // inputs, not modified + int method, // 0,1,2,3 + SuiteSparseQR_factorization *QR, + cholmod_sparse *Xsparse, // size m-by-n + // workspace and parameters + cholmod_common *cc +) ; // ============================================================================= // === SuiteSparseQR_free ====================================================== @@ -1563,29 +1690,38 @@ template cholmod_sparse *SuiteSparseQR_qmult // Free the QR object; this is just a user-callable wrapper for spqr_freefac. -template int SuiteSparseQR_free +template int SuiteSparseQR_free ( - SuiteSparseQR_factorization **QR, + SuiteSparseQR_factorization **QR, cholmod_common *cc ) { RETURN_IF_NULL_COMMON (FALSE) ; - spqr_freefac (QR, cc) ; + spqr_freefac (QR, cc) ; return (TRUE) ; } -template int SuiteSparseQR_free +template int SuiteSparseQR_free ( - SuiteSparseQR_factorization **QR, + SuiteSparseQR_factorization **QR, cholmod_common *cc ) ; - -template int SuiteSparseQR_free +template int SuiteSparseQR_free ( - SuiteSparseQR_factorization **QR, + SuiteSparseQR_factorization **QR, cholmod_common *cc ) ; +template int SuiteSparseQR_free +( + SuiteSparseQR_factorization **QR, + cholmod_common *cc +) ; +template int SuiteSparseQR_free +( + SuiteSparseQR_factorization **QR, + cholmod_common *cc +) ; // ============================================================================= // === SuiteSparseQR_min2norm ================================================== @@ -1594,7 +1730,7 @@ template int SuiteSparseQR_free // Find the min 2-norm solution for underdetermined systems (A is m-by-n with // m cholmod_dense *SuiteSparseQR_min2norm +template cholmod_dense *SuiteSparseQR_min2norm ( int ordering, // all, except 3:given treated as 0:fixed double tol, @@ -1618,18 +1754,18 @@ template cholmod_dense *SuiteSparseQR_min2norm double t0 = SuiteSparse_time ( ) ; // x=A\B, using a QR factorization of A' - SuiteSparseQR_factorization *QR ; + SuiteSparseQR_factorization *QR ; cholmod_sparse *AT ; cholmod_dense *Y ; // [Q,R,E] = qr (A') - AT = cholmod_l_transpose (A, 2, cc) ; - QR = SuiteSparseQR_factorize (ordering, tol, AT, cc); - cholmod_l_free_sparse (&AT, cc) ; + AT = spqr_transpose (A, 2, cc) ; + QR = SuiteSparseQR_factorize (ordering, tol, AT, cc); + spqr_free_sparse (&AT, cc) ; // solve Y = R'\(E'*B) Y = SuiteSparseQR_solve (SPQR_RTX_EQUALS_ETB, QR, B, cc) ; // X = Q*Y X = SuiteSparseQR_qmult (SPQR_QX, QR, Y, cc) ; - cholmod_l_free_dense (&Y, cc) ; + spqr_free_dense (&Y, cc) ; spqr_freefac (&QR, cc) ; double t3 = SuiteSparse_time ( ) ; @@ -1641,7 +1777,7 @@ template cholmod_dense *SuiteSparseQR_min2norm else { // x=A\B, using a QR factorization of A - SuiteSparseQR (ordering, tol, 0, 2, A, NULL, B, NULL, &X, + SuiteSparseQR (ordering, tol, 0, 2, A, NULL, B, NULL, &X, NULL, NULL, NULL, NULL, NULL, cc) ; } @@ -1658,7 +1794,7 @@ template cholmod_dense *SuiteSparseQR_min2norm return (X) ; } -template cholmod_dense *SuiteSparseQR_min2norm +template cholmod_dense *SuiteSparseQR_min2norm ( int ordering, // all, except 3:given treated as 0:fixed double tol, @@ -1666,8 +1802,7 @@ template cholmod_dense *SuiteSparseQR_min2norm cholmod_dense *B, cholmod_common *cc ) ; - -template cholmod_dense *SuiteSparseQR_min2norm +template cholmod_dense *SuiteSparseQR_min2norm ( int ordering, // all, except 3:given treated as 0:fixed double tol, @@ -1676,12 +1811,28 @@ template cholmod_dense *SuiteSparseQR_min2norm cholmod_common *cc ) ; +template cholmod_dense *SuiteSparseQR_min2norm +( + int ordering, // all, except 3:given treated as 0:fixed + double tol, + cholmod_sparse *A, + cholmod_dense *B, + cholmod_common *cc +) ; +template cholmod_dense *SuiteSparseQR_min2norm +( + int ordering, // all, except 3:given treated as 0:fixed + double tol, + cholmod_sparse *A, + cholmod_dense *B, + cholmod_common *cc +) ; // ============================================================================= // === SuiteSparseQR_min2norm (sparse case) ==================================== // ============================================================================= -template cholmod_sparse *SuiteSparseQR_min2norm // returns X +template cholmod_sparse *SuiteSparseQR_min2norm // returns X ( int ordering, // all, except 3:given treated as 0:fixed double tol, @@ -1702,11 +1853,11 @@ template cholmod_sparse *SuiteSparseQR_min2norm // returns X RETURN_IF_XTYPE_INVALID (Bsparse, NULL) ; cc->status = CHOLMOD_OK ; - Bdense = cholmod_l_sparse_to_dense (Bsparse, cc) ; - Xdense = SuiteSparseQR_min2norm (ordering, tol, A, Bdense, cc) ; - cholmod_l_free_dense (&Bdense, cc) ; - Xsparse = cholmod_l_dense_to_sparse (Xdense, TRUE, cc) ; - cholmod_l_free_dense (&Xdense, cc) ; + Bdense = spqr_sparse_to_dense (Bsparse, cc) ; + Xdense = SuiteSparseQR_min2norm (ordering, tol, A, Bdense, cc) ; + spqr_free_dense (&Bdense, cc) ; + Xsparse = spqr_dense_to_sparse (Xdense, TRUE, cc) ; + spqr_free_dense (&Xdense, cc) ; if (Xsparse == NULL) { @@ -1721,7 +1872,15 @@ template cholmod_sparse *SuiteSparseQR_min2norm // returns X return (Xsparse) ; } -template cholmod_sparse *SuiteSparseQR_min2norm +template cholmod_sparse *SuiteSparseQR_min2norm +( + int ordering, // all, except 3:given treated as 0:fixed + double tol, + cholmod_sparse *A, + cholmod_sparse *Bsparse, + cholmod_common *cc +) ; +template cholmod_sparse *SuiteSparseQR_min2norm ( int ordering, // all, except 3:given treated as 0:fixed double tol, @@ -1730,7 +1889,7 @@ template cholmod_sparse *SuiteSparseQR_min2norm cholmod_common *cc ) ; -template cholmod_sparse *SuiteSparseQR_min2norm +template cholmod_sparse *SuiteSparseQR_min2norm ( int ordering, // all, except 3:given treated as 0:fixed double tol, @@ -1738,4 +1897,13 @@ template cholmod_sparse *SuiteSparseQR_min2norm cholmod_sparse *Bsparse, cholmod_common *cc ) ; +template cholmod_sparse *SuiteSparseQR_min2norm +( + int ordering, // all, except 3:given treated as 0:fixed + double tol, + cholmod_sparse *A, + cholmod_sparse *Bsparse, + cholmod_common *cc +) ; + #endif diff --git a/SPQR/Source/SuiteSparseQR_qmult.cpp b/SPQR/Source/SuiteSparseQR_qmult.cpp index 161f57129..90adbd08a 100644 --- a/SPQR/Source/SuiteSparseQR_qmult.cpp +++ b/SPQR/Source/SuiteSparseQR_qmult.cpp @@ -33,13 +33,13 @@ #define HCHUNK_DENSE 32 // FUTURE: make this an input parameter // returns Y of size m-by-n, or NULL on failure -template cholmod_dense *SuiteSparseQR_qmult +template cholmod_dense *SuiteSparseQR_qmult ( // inputs, not modified int method, // 0,1,2,3 cholmod_sparse *H, // either m-by-nh or n-by-nh cholmod_dense *HTau, // size 1-by-nh - int64_t *HPinv, // size mh, identity permutation if NULL + Int *HPinv, // size mh, identity permutation if NULL cholmod_dense *Xdense, // size m-by-n with leading dimension ldx // workspace and parameters @@ -48,8 +48,8 @@ template cholmod_dense *SuiteSparseQR_qmult { cholmod_dense *Ydense ; Entry *X, *Y, *X1, *Y1, *Z1, *Hx, *C, *V, *Z, *CV, *Tau ; - int64_t *Hp, *Hi, *Wi, *Wmap ; - int64_t i, k, zsize, nh, mh, vmax, hchunk, vsize, csize, cvsize, wisize, ldx, + Int *Hp, *Hi, *Wi, *Wmap ; + Int i, k, zsize, nh, mh, vmax, hchunk, vsize, csize, cvsize, wisize, ldx, m, n ; int ok = TRUE ; @@ -61,14 +61,14 @@ template cholmod_dense *SuiteSparseQR_qmult RETURN_IF_NULL (H, NULL) ; RETURN_IF_NULL (HTau, NULL) ; RETURN_IF_NULL (Xdense, NULL) ; - int64_t xtype = spqr_type ( ) ; + int xtype = spqr_type ( ) ; RETURN_IF_XTYPE_INVALID (H, NULL) ; RETURN_IF_XTYPE_INVALID (HTau, NULL) ; RETURN_IF_XTYPE_INVALID (Xdense, NULL) ; cc->status = CHOLMOD_OK ; - Hp = (int64_t *) H->p ; - Hi = (int64_t *) H->i ; + Hp = (Int *) H->p ; + Hi = (Int *) H->i ; Hx = (Entry *) H->x ; nh = H->ncol ; mh = H->nrow ; @@ -107,7 +107,7 @@ template cholmod_dense *SuiteSparseQR_qmult // allocate result Y // ------------------------------------------------------------------------- - Ydense = cholmod_l_allocate_dense (m, n, m, xtype, cc) ; + Ydense = spqr_allocate_dense (m, n, m, xtype, cc) ; if (cc->status < CHOLMOD_OK) { // out of memory @@ -130,7 +130,7 @@ template cholmod_dense *SuiteSparseQR_qmult if (method == SPQR_QX || method == SPQR_XQT) { // Z is needed only for methods SPQR_QX and SPQR_XQT - Z = (Entry *) cholmod_l_malloc (zsize, sizeof (Entry), cc) ; + Z = (Entry *) spqr_malloc (zsize, sizeof (Entry), cc) ; } hchunk = MIN (HCHUNK_DENSE, nh) ; @@ -139,15 +139,15 @@ template cholmod_dense *SuiteSparseQR_qmult ASSERT (vmax <= mh) ; wisize = mh + vmax ; - Wi = (int64_t *) cholmod_l_malloc (wisize, sizeof (int64_t), cc) ; + Wi = (Int *) spqr_malloc (wisize, sizeof (Int), cc) ; Wmap = Wi + vmax ; // Wmap is of size mh, Wi of size vmax if (cc->status < CHOLMOD_OK) { // out of memory; free workspace and result Y - cholmod_l_free_dense (&Ydense, cc) ; - cholmod_l_free (zsize, sizeof (Entry), Z, cc) ; - cholmod_l_free (wisize, sizeof (int64_t), Wi, cc) ; + spqr_free_dense (&Ydense, cc) ; + spqr_free (zsize, sizeof (Entry), Z, cc) ; + spqr_free (wisize, sizeof (Int), Wi, cc) ; return (NULL) ; } @@ -182,7 +182,7 @@ template cholmod_dense *SuiteSparseQR_qmult if (ok) { - CV = (Entry *) cholmod_l_malloc (cvsize, sizeof (Entry), cc) ; + CV = (Entry *) spqr_malloc (cvsize, sizeof (Entry), cc) ; } // ------------------------------------------------------------------------- @@ -202,14 +202,14 @@ template cholmod_dense *SuiteSparseQR_qmult cvsize = spqr_add (csize, vsize, &ok) ; if (ok) { - CV = (Entry *) cholmod_l_malloc (cvsize, sizeof (Entry), cc) ; + CV = (Entry *) spqr_malloc (cvsize, sizeof (Entry), cc) ; } if (!ok || cc->status < CHOLMOD_OK) { // out of memory (or problem too large); free workspace and result Y - cholmod_l_free_dense (&Ydense, cc) ; - cholmod_l_free (zsize, sizeof (Entry), Z, cc) ; - cholmod_l_free (wisize, sizeof (int64_t), Wi, cc) ; + spqr_free_dense (&Ydense, cc) ; + spqr_free (zsize, sizeof (Entry), Z, cc) ; + spqr_free (wisize, sizeof (Int), Wi, cc) ; ERROR (CHOLMOD_OUT_OF_MEMORY, "out of memory") ; return (NULL) ; } @@ -337,14 +337,14 @@ template cholmod_dense *SuiteSparseQR_qmult // free workspace and return Y // ------------------------------------------------------------------------- - cholmod_l_free (cvsize, sizeof (Entry), CV, cc) ; - cholmod_l_free (zsize, sizeof (Entry), Z, cc) ; - cholmod_l_free (wisize, sizeof (int64_t), Wi, cc) ; + spqr_free (cvsize, sizeof (Entry), CV, cc) ; + spqr_free (zsize, sizeof (Entry), Z, cc) ; + spqr_free (wisize, sizeof (Int), Wi, cc) ; - if (sizeof (SUITESPARSE_BLAS_INT) < sizeof (int64_t) && !cc->blas_ok) + if (sizeof (SUITESPARSE_BLAS_INT) < sizeof (Int) && !cc->blas_ok) { ERROR (CHOLMOD_INVALID, "problem too large for the BLAS") ; - cholmod_l_free_dense (&Ydense, cc) ; + spqr_free_dense (&Ydense, cc) ; return (NULL) ; } @@ -354,7 +354,7 @@ template cholmod_dense *SuiteSparseQR_qmult // ============================================================================= -template cholmod_dense *SuiteSparseQR_qmult +template cholmod_dense *SuiteSparseQR_qmult ( // inputs, not modified int method, // 0,1,2,3 @@ -366,10 +366,22 @@ template cholmod_dense *SuiteSparseQR_qmult // workspace and parameters cholmod_common *cc ) ; +template cholmod_dense *SuiteSparseQR_qmult +( + // inputs, not modified + int method, // 0,1,2,3 + cholmod_sparse *H, // either m-by-nh or n-by-nh + cholmod_dense *HTau, // size 1-by-nh + int32_t *HPinv, // size mh + cholmod_dense *Xdense, // size m-by-n with leading dimension ldx + + // workspace and parameters + cholmod_common *cc +) ; // ============================================================================= -template cholmod_dense *SuiteSparseQR_qmult +template cholmod_dense *SuiteSparseQR_qmult ( // inputs, not modified int method, // 0,1,2,3 @@ -381,7 +393,18 @@ template cholmod_dense *SuiteSparseQR_qmult // workspace and parameters cholmod_common *cc ) ; +template cholmod_dense *SuiteSparseQR_qmult +( + // inputs, not modified + int method, // 0,1,2,3 + cholmod_sparse *H, // either m-by-nh or n-by-nh + cholmod_dense *HTau, // size 1-by-nh + int32_t *HPinv, // size mh + cholmod_dense *Xdense, // size m-by-n with leading dimension ldx + // workspace and parameters + cholmod_common *cc +) ; // ============================================================================= // === SuiteSparseQR_qmult (sparse) ============================================ @@ -392,13 +415,13 @@ template cholmod_dense *SuiteSparseQR_qmult #define XCHUNK 4 // FUTURE: make a parameter #define HCHUNK_SPARSE 4 // FUTURE: make a parameter -template cholmod_sparse *SuiteSparseQR_qmult +template cholmod_sparse *SuiteSparseQR_qmult ( // inputs, not modified int method, // 0,1,2,3 cholmod_sparse *H, // size m-by-nh or n-by-nh cholmod_dense *HTau, // size 1-by-nh - int64_t *HPinv, // size mh, identity permutation if NULL + Int *HPinv, // size mh, identity permutation if NULL cholmod_sparse *Xsparse, // workspace and parameters @@ -407,8 +430,8 @@ template cholmod_sparse *SuiteSparseQR_qmult { cholmod_sparse *Ysparse ; Entry *W, *W1, *Hx, *Xx, *C, *V, *CVW, *Tau ; - int64_t *Hp, *Hi, *Xp, *Xi, *Wi, *Wmap ; - int64_t i, k, ny, k1, xchunk, p, k2, m, n, nh, vmax, hchunk, vsize, + Int *Hp, *Hi, *Xp, *Xi, *Wi, *Wmap ; + Int i, k, ny, k1, xchunk, p, k2, m, n, nh, vmax, hchunk, vsize, csize, cvwsize, wsize, wisize ; int ok = TRUE ; @@ -420,7 +443,7 @@ template cholmod_sparse *SuiteSparseQR_qmult RETURN_IF_NULL (H, NULL) ; RETURN_IF_NULL (HTau, NULL) ; RETURN_IF_NULL (Xsparse, NULL) ; - int64_t xtype = spqr_type ( ) ; + Int xtype = spqr_type ( ) ; RETURN_IF_XTYPE_INVALID (H, NULL) ; RETURN_IF_XTYPE_INVALID (HTau, NULL) ; RETURN_IF_XTYPE_INVALID (Xsparse, NULL) ; @@ -457,12 +480,12 @@ template cholmod_sparse *SuiteSparseQR_qmult if (method == SPQR_XQT || method == SPQR_XQ) { cholmod_sparse *XT, *YT ; - XT = cholmod_l_transpose (Xsparse, 2, cc) ; + XT = spqr_transpose (Xsparse, 2, cc) ; YT = SuiteSparseQR_qmult ((method == SPQR_XQT) ? SPQR_QX : SPQR_QTX, H, HTau, HPinv, XT, cc); - cholmod_l_free_sparse (&XT, cc) ; - Ysparse = cholmod_l_transpose (YT, 2, cc) ; - cholmod_l_free_sparse (&YT, cc) ; + spqr_free_sparse (&XT, cc) ; + Ysparse = spqr_transpose (YT, 2, cc) ; + spqr_free_sparse (&YT, cc) ; return (Ysparse) ; } @@ -470,21 +493,21 @@ template cholmod_sparse *SuiteSparseQR_qmult // get H and X // ------------------------------------------------------------------------- - Hp = (int64_t *) H->p ; - Hi = (int64_t *) H->i ; + Hp = (Int *) H->p ; + Hi = (Int *) H->i ; Hx = (Entry *) H->x ; m = H->nrow ; nh = H->ncol ; - Xp = (int64_t *) Xsparse->p ; - Xi = (int64_t *) Xsparse->i ; + Xp = (Int *) Xsparse->p ; + Xi = (Int *) Xsparse->i ; Xx = (Entry *) Xsparse->x ; n = Xsparse->ncol ; Tau = (Entry *) HTau->x ; // ------------------------------------------------------------------------- - // allocate int64_t workspace + // allocate Int workspace // ------------------------------------------------------------------------- xchunk = MIN (XCHUNK, n) ; @@ -494,7 +517,7 @@ template cholmod_sparse *SuiteSparseQR_qmult &vmax, &vsize, &csize) ; wisize = m + vmax ; - Wi = (int64_t *) cholmod_l_malloc (wisize, sizeof (int64_t), cc) ; + Wi = (Int *) spqr_malloc (wisize, sizeof (Int), cc) ; Wmap = Wi + vmax ; // Wmap is of size m, Wi is of size vmax if (cc->status < CHOLMOD_OK) @@ -522,7 +545,7 @@ template cholmod_sparse *SuiteSparseQR_qmult if (ok) { - CVW = (Entry *) cholmod_l_malloc (cvwsize, sizeof (Entry), cc) ; + CVW = (Entry *) spqr_malloc (cvwsize, sizeof (Entry), cc) ; } // ------------------------------------------------------------------------- @@ -544,13 +567,13 @@ template cholmod_sparse *SuiteSparseQR_qmult cvwsize = spqr_add (cvwsize, vsize, &ok) ; if (ok) { - CVW = (Entry *) cholmod_l_malloc (cvwsize, sizeof (Entry), cc) ; + CVW = (Entry *) spqr_malloc (cvwsize, sizeof (Entry), cc) ; } if (!ok || cc->status < CHOLMOD_OK) { // still out of memory (or problem too large) ERROR (CHOLMOD_OUT_OF_MEMORY, "out of memory") ; - cholmod_l_free (wisize, sizeof (int64_t), Wi, cc) ; + spqr_free (wisize, sizeof (Int), Wi, cc) ; return (NULL) ; } } @@ -568,12 +591,12 @@ template cholmod_sparse *SuiteSparseQR_qmult // ------------------------------------------------------------------------- // Y is a sparse matrix of size m-ny-n with space for m+1 entries - Ysparse = cholmod_l_allocate_sparse (m, n, m+1, TRUE, TRUE, 0, xtype, cc) ; + Ysparse = spqr_allocate_sparse (m, n, m+1, TRUE, TRUE, 0, xtype, cc) ; if (cc->status < CHOLMOD_OK) { // out of memory - cholmod_l_free (cvwsize, sizeof (Entry), CVW, cc) ; - cholmod_l_free (wisize, sizeof (int64_t), Wi, cc) ; + spqr_free (cvwsize, sizeof (Entry), CVW, cc) ; + spqr_free (wisize, sizeof (Int), Wi, cc) ; return (NULL) ; } ny = 0 ; @@ -619,14 +642,14 @@ template cholmod_sparse *SuiteSparseQR_qmult W1 = W ; for (k = k1 ; k < k2 ; k++) { - spqr_append (W1, NULL, Ysparse, &ny, cc) ; + spqr_append (W1, NULL, Ysparse, &ny, cc) ; if (cc->status < CHOLMOD_OK) { // out of memory - cholmod_l_free_sparse (&Ysparse, cc) ; - cholmod_l_free (cvwsize, sizeof (Entry), CVW, cc) ; - cholmod_l_free (wisize, sizeof (int64_t), Wi, cc) ; + spqr_free_sparse (&Ysparse, cc) ; + spqr_free (cvwsize, sizeof (Entry), CVW, cc) ; + spqr_free (wisize, sizeof (Int), Wi, cc) ; return (NULL) ; } @@ -675,9 +698,9 @@ template cholmod_sparse *SuiteSparseQR_qmult if (cc->status < CHOLMOD_OK) { // out of memory - cholmod_l_free_sparse (&Ysparse, cc) ; - cholmod_l_free (cvwsize, sizeof (Entry), CVW, cc) ; - cholmod_l_free (wisize, sizeof (int64_t), Wi, cc) ; + spqr_free_sparse (&Ysparse, cc) ; + spqr_free (cvwsize, sizeof (Entry), CVW, cc) ; + spqr_free (wisize, sizeof (Int), Wi, cc) ; return (NULL) ; } W1 += m ; @@ -689,14 +712,14 @@ template cholmod_sparse *SuiteSparseQR_qmult // free workspace and reduce Y in size so that nnz (Y) == nzmax (Y) // ------------------------------------------------------------------------- - cholmod_l_free (cvwsize, sizeof (Entry), CVW, cc) ; - cholmod_l_free (wisize, sizeof (int64_t), Wi, cc) ; - cholmod_l_reallocate_sparse (cholmod_l_nnz (Ysparse,cc), Ysparse, cc) ; + spqr_free (cvwsize, sizeof (Entry), CVW, cc) ; + spqr_free (wisize, sizeof (Int), Wi, cc) ; + spqr_reallocate_sparse (spqr_nnz (Ysparse,cc), Ysparse, cc) ; - if (sizeof (SUITESPARSE_BLAS_INT) < sizeof (int64_t) && !cc->blas_ok) + if (sizeof (SUITESPARSE_BLAS_INT) < sizeof (Int) && !cc->blas_ok) { ERROR (CHOLMOD_INVALID, "problem too large for the BLAS") ; - cholmod_l_free_sparse (&Ysparse, cc) ; + spqr_free_sparse (&Ysparse, cc) ; return (NULL) ; } @@ -706,7 +729,19 @@ template cholmod_sparse *SuiteSparseQR_qmult // ============================================================================= -template cholmod_sparse *SuiteSparseQR_qmult +template cholmod_sparse *SuiteSparseQR_qmult +( + // inputs, not modified + int method, // 0,1,2,3 + cholmod_sparse *H, // size m-by-nh or n-by-nh + cholmod_dense *HTau, // size 1-by-nh + int32_t *HPinv, // size mh + cholmod_sparse *Xsparse, + + // workspace and parameters + cholmod_common *cc +) ; +template cholmod_sparse *SuiteSparseQR_qmult ( // inputs, not modified int method, // 0,1,2,3 @@ -721,7 +756,19 @@ template cholmod_sparse *SuiteSparseQR_qmult // ============================================================================= -template cholmod_sparse *SuiteSparseQR_qmult +template cholmod_sparse *SuiteSparseQR_qmult +( + // inputs, not modified + int method, // 0,1,2,3 + cholmod_sparse *H, // size m-by-nh or n-by-nh + cholmod_dense *HTau, // size 1-by-nh + int32_t *HPinv, // size mh + cholmod_sparse *Xsparse, + + // workspace and parameters + cholmod_common *cc +) ; +template cholmod_sparse *SuiteSparseQR_qmult ( // inputs, not modified int method, // 0,1,2,3 diff --git a/SPQR/Source/spqr_1colamd.cpp b/SPQR/Source/spqr_1colamd.cpp index a60805347..f3b1d09ac 100644 --- a/SPQR/Source/spqr_1colamd.cpp +++ b/SPQR/Source/spqr_1colamd.cpp @@ -17,26 +17,25 @@ // but no values. Y has n-n1cols+bncols columns, and m-n1rows rows. B is // empty and no singletons are found, Y is NULL. - #include "spqr.hpp" -template int spqr_1colamd // TRUE if OK, FALSE otherwise +template int spqr_1colamd // TRUE if OK, FALSE otherwise ( // inputs, not modified int ordering, // all available, except 0:fixed and 3:given // treated as 1:natural double tol, // only accept singletons above tol - int64_t bncols, // number of columns of B + Int bncols, // number of columns of B cholmod_sparse *A, // m-by-n sparse matrix // outputs, neither allocated nor defined on input - int64_t **p_Q1fill, // size n+bncols, fill-reducing + Int **p_Q1fill, // size n+bncols, fill-reducing // or natural ordering - int64_t **p_R1p, // size n1rows+1, R1p [k] = # of nonzeros in kth + Int **p_R1p, // size n1rows+1, R1p [k] = # of nonzeros in kth // row of R1. NULL if n1cols == 0. - int64_t **p_P1inv, // size m, singleton row inverse permutation. + Int **p_P1inv, // size m, singleton row inverse permutation. // If row i of A is the kth singleton row, then // P1inv [i] = k. NULL if n1cols is zero. @@ -45,17 +44,17 @@ template int spqr_1colamd // TRUE if OK, FALSE otherwise // Y = [A B] or Y = [A2 B2]. If B is empty and // there are no column singletons, Y is NULL - int64_t *p_n1cols, // number of column singletons found - int64_t *p_n1rows, // number of corresponding rows found + Int *p_n1cols, // number of column singletons found + Int *p_n1rows, // number of corresponding rows found // workspace and parameters cholmod_common *cc ) { - int64_t *Q1fill, *Degree, *Qrows, *W, *Winv, *ATp, *ATj, *R1p, *P1inv, *Yp, + Int *Q1fill, *Degree, *Qrows, *W, *Winv, *ATp, *ATj, *R1p, *P1inv, *Yp, *Ap, *Ai, *Work ; Entry *Ax ; - int64_t p, d, j, i, k, n1cols, n1rows, row, pend, n2rows, n2cols = EMPTY, + Int p, d, j, i, k, n1cols, n1rows, row, pend, n2rows, n2cols = EMPTY, nz2, kk, p2, col2, ynz, fill_reducing_ordering, m, n, xtype, worksize ; cholmod_sparse *AT, *Y ; @@ -67,8 +66,8 @@ template int spqr_1colamd // TRUE if OK, FALSE otherwise m = A->nrow ; n = A->ncol ; - Ap = (int64_t *) A->p ; - Ai = (int64_t *) A->i ; + Ap = (Int *) A->p ; + Ai = (Int *) A->i ; Ax = (Entry *) A->x ; // set outputs to NULL in case of early return @@ -83,7 +82,7 @@ template int spqr_1colamd // TRUE if OK, FALSE otherwise // allocate result Q1fill (Y, R1p, P1inv allocated later) // ------------------------------------------------------------------------- - Q1fill = (int64_t *) cholmod_l_malloc (n+bncols, sizeof (int64_t), cc) ; + Q1fill = (Int *) spqr_malloc (n+bncols, sizeof (Int), cc) ; // ------------------------------------------------------------------------- // allocate workspace @@ -96,7 +95,7 @@ template int spqr_1colamd // TRUE if OK, FALSE otherwise worksize = ((fill_reducing_ordering) ? 3:2) * n ; - Work = (int64_t *) cholmod_l_malloc (worksize, sizeof (int64_t), cc) ; + Work = (Int *) spqr_malloc (worksize, sizeof (Int), cc) ; Degree = Work ; // size n Qrows = Work + n ; // size n Winv = Qrows ; // Winv and Qrows not needed at the same time @@ -105,8 +104,8 @@ template int spqr_1colamd // TRUE if OK, FALSE otherwise if (cc->status < CHOLMOD_OK) { // out of memory; free everything and return - cholmod_l_free (worksize, sizeof (int64_t), Work, cc) ; - cholmod_l_free (n+bncols, sizeof (int64_t), Q1fill, cc) ; + spqr_free (worksize, sizeof (Int), Work, cc) ; + spqr_free (n+bncols, sizeof (Int), Q1fill, cc) ; return (FALSE) ; } @@ -153,18 +152,18 @@ template int spqr_1colamd // TRUE if OK, FALSE otherwise // create AT = spones (A') // ------------------------------------------------------------------------- - AT = cholmod_l_transpose (A, 0, cc) ; // [ + AT = spqr_transpose (A, 0, cc) ; // [ if (cc->status < CHOLMOD_OK) { // out of memory; free everything and return - cholmod_l_free (worksize, sizeof (int64_t), Work, cc) ; - cholmod_l_free (n+bncols, sizeof (int64_t), Q1fill, cc) ; + spqr_free (worksize, sizeof (Int), Work, cc) ; + spqr_free (n+bncols, sizeof (Int), Q1fill, cc) ; return (FALSE) ; } - ATp = (int64_t *) AT->p ; - ATj = (int64_t *) AT->i ; + ATp = (Int *) AT->p ; + ATj = (Int *) AT->i ; // ------------------------------------------------------------------------- // remove column singletons via breadth-first-search @@ -177,7 +176,7 @@ template int spqr_1colamd // TRUE if OK, FALSE otherwise // get a new singleton from the queue // --------------------------------------------------------------------- - // int64_t col = Q1fill [k] ; unused variable, for debugging + // Int col = Q1fill [k] ; unused variable, for debugging #define col (Q1fill [k]) row = Qrows [k] ; @@ -276,7 +275,7 @@ template int spqr_1colamd // TRUE if OK, FALSE otherwise ASSERT (k == n - n1cols) ; for (k = 0 ; k < n1cols ; k++) { - int64_t col = Q1fill [k] ; + Int col = Q1fill [k] ; ASSERT (Degree [col] <= 0) ; } k = 0 ; @@ -316,17 +315,17 @@ template int spqr_1colamd // TRUE if OK, FALSE otherwise // --------------------------------------------------------------------- // allocate result arrays R1p and P1inv - R1p = (int64_t *) cholmod_l_malloc (n1rows+1, sizeof (int64_t), cc) ; - P1inv = (int64_t *) cholmod_l_malloc (m, sizeof (int64_t), cc) ; + R1p = (Int *) spqr_malloc (n1rows+1, sizeof (Int), cc) ; + P1inv = (Int *) spqr_malloc (m, sizeof (Int), cc) ; if (cc->status < CHOLMOD_OK) { // out of memory; free everything and return - cholmod_l_free_sparse (&AT, cc) ; - cholmod_l_free (worksize, sizeof (int64_t), Work, cc) ; - cholmod_l_free (n+bncols, sizeof (int64_t), Q1fill, cc) ; - cholmod_l_free (n1rows+1, sizeof (int64_t), R1p, cc) ; - cholmod_l_free (m, sizeof (int64_t), P1inv, cc) ; + spqr_free_sparse (&AT, cc) ; + spqr_free (worksize, sizeof (Int), Work, cc) ; + spqr_free (n+bncols, sizeof (Int), Q1fill, cc) ; + spqr_free (n1rows+1, sizeof (Int), R1p, cc) ; + spqr_free (m, sizeof (Int), P1inv, cc) ; return (FALSE) ; } @@ -486,14 +485,14 @@ template int spqr_1colamd // TRUE if OK, FALSE otherwise PR (("n1cols %ld n1rows %ld n2cols %ld n2rows %ld\n", n1cols, n1rows, n2cols, n2rows)) ; - ASSERT ((int64_t) AT->nrow == n) ; - ASSERT ((int64_t) AT->ncol == m) ; + ASSERT ((Int) AT->nrow == n) ; + ASSERT ((Int) AT->ncol == m) ; AT->nrow = n2cols ; AT->ncol = n2rows ; // save the current CHOLMOD settings - int64_t save [6] ; + Int save [6] ; save [0] = cc->supernodal ; save [1] = cc->nmethods ; save [2] = cc->postorder ; @@ -533,14 +532,14 @@ template int spqr_1colamd // TRUE if OK, FALSE otherwise if (ordering == SPQR_ORDERING_AMD) { // use CHOLMOD's interface to AMD to order A'*A - cholmod_l_amd (AT, NULL, 0, (int64_t *) (Q1fill + n1cols), cc) ; + spqr_amd (AT, NULL, 0, (Int *) (Q1fill + n1cols), cc) ; } else if (ordering == SPQR_ORDERING_METIS) { // use CHOLMOD's interface to METIS to order A'*A (if installed) TEST_COVERAGE_PAUSE ; - cholmod_l_metis (AT, NULL, 0, TRUE, - (int64_t *) (Q1fill + n1cols), cc) ; + spqr_metis (AT, NULL, 0, TRUE, + (Int *) (Q1fill + n1cols), cc) ; TEST_COVERAGE_RESUME ; } else if (ordering == SPQR_ORDERING_CHOLMOD) @@ -551,12 +550,12 @@ template int spqr_1colamd // TRUE if OK, FALSE otherwise cc->postorder = TRUE ; cholmod_factor *Sc ; TEST_COVERAGE_PAUSE ; - Sc = cholmod_l_analyze_p2 (FALSE, AT, NULL, NULL, 0, cc) ; + Sc = spqr_analyze_p2 (FALSE, AT, NULL, NULL, 0, cc) ; TEST_COVERAGE_RESUME ; if (Sc != NULL) { // copy perm from Sc->Perm [0:n2cols-1] to Q1fill (n1cols:n) - int64_t *Sc_perm = (int64_t *) Sc->Perm ; + Int *Sc_perm = (Int *) Sc->Perm ; for (k = 0 ; k < n2cols ; k++) { Q1fill [k + n1cols] = Sc_perm [k] ; @@ -569,7 +568,7 @@ template int spqr_1colamd // TRUE if OK, FALSE otherwise case CHOLMOD_METIS: ordering = SPQR_ORDERING_METIS ;break; } } - cholmod_l_free_factor (&Sc, cc) ; + spqr_free_factor (&Sc, cc) ; PR (("CHOLMOD used method %d : ordering: %d\n", cc->selected, cc->method [cc->selected].ordering)) ; } @@ -577,8 +576,8 @@ template int spqr_1colamd // TRUE if OK, FALSE otherwise { // use CHOLMOD's interface to COLAMD to order AT ordering = SPQR_ORDERING_COLAMD ; - cholmod_l_colamd (AT, NULL, 0, TRUE, - (int64_t *) (Q1fill + n1cols), cc) ; + spqr_colamd (AT, NULL, 0, TRUE, + (Int *) (Q1fill + n1cols), cc) ; } cc->SPQR_istat [7] = ordering ; @@ -599,7 +598,7 @@ template int spqr_1colamd // TRUE if OK, FALSE otherwise // free AT // ------------------------------------------------------------------------- - cholmod_l_free_sparse (&AT, cc) ; // ] + spqr_free_sparse (&AT, cc) ; // ] // ------------------------------------------------------------------------- // check if the method succeeded @@ -608,10 +607,10 @@ template int spqr_1colamd // TRUE if OK, FALSE otherwise if (cc->status < CHOLMOD_OK) { // out of memory; free everything and return - cholmod_l_free (worksize, sizeof (int64_t), Work, cc) ; - cholmod_l_free (n+bncols, sizeof (int64_t), Q1fill, cc) ; - cholmod_l_free (n1rows+1, sizeof (int64_t), R1p, cc) ; - cholmod_l_free (m, sizeof (int64_t), P1inv, cc) ; + spqr_free (worksize, sizeof (Int), Work, cc) ; + spqr_free (n+bncols, sizeof (Int), Q1fill, cc) ; + spqr_free (n1rows+1, sizeof (Int), R1p, cc) ; + spqr_free (m, sizeof (Int), P1inv, cc) ; return (FALSE) ; } @@ -672,20 +671,20 @@ template int spqr_1colamd // TRUE if OK, FALSE otherwise else { // Y has no entries yet; nnz(Y) will be determined later - Y = cholmod_l_allocate_sparse (m-n1rows, n-n1cols+bncols, 0, + Y = spqr_allocate_sparse (m-n1rows, n-n1cols+bncols, 0, FALSE, TRUE, 0, xtype, cc) ; if (cc->status < CHOLMOD_OK) { // out of memory; free everything and return - cholmod_l_free (worksize, sizeof (int64_t), Work, cc) ; - cholmod_l_free (n+bncols, sizeof (int64_t), Q1fill, cc) ; - cholmod_l_free (n1rows+1, sizeof (int64_t), R1p, cc) ; - cholmod_l_free (m, sizeof (int64_t), P1inv, cc) ; + spqr_free (worksize, sizeof (Int), Work, cc) ; + spqr_free (n+bncols, sizeof (Int), Q1fill, cc) ; + spqr_free (n1rows+1, sizeof (Int), R1p, cc) ; + spqr_free (m, sizeof (Int), P1inv, cc) ; return (FALSE) ; } - Yp = (int64_t *) Y->p ; + Yp = (Int *) Y->p ; ynz = 0 ; PR (("1c wrapup: n1cols %ld n %ld\n", n1cols, n)) ; @@ -704,7 +703,7 @@ template int spqr_1colamd // TRUE if OK, FALSE otherwise // free workspace and return results // ------------------------------------------------------------------------- - cholmod_l_free (worksize, sizeof (int64_t), Work, cc) ; + spqr_free (worksize, sizeof (Int), Work, cc) ; *p_Q1fill = Q1fill ; *p_R1p = R1p ; @@ -715,10 +714,71 @@ template int spqr_1colamd // TRUE if OK, FALSE otherwise return (TRUE) ; } +template int spqr_1colamd // TRUE if OK, FALSE otherwise +( + // inputs, not modified + int ordering, // all available, except 0:fixed and 3:given + // treated as 1:natural + double tol, // only accept singletons above tol + int32_t bncols, // number of columns of B + cholmod_sparse *A, // m-by-n sparse matrix -// ============================================================================= + // outputs, neither allocated nor defined on input + + int32_t **p_Q1fill, // size n+bncols, fill-reducing + // or natural ordering + + int32_t **p_R1p, // size n1rows+1, R1p [k] = # of nonzeros in kth + // row of R1. NULL if n1cols == 0. + int32_t **p_P1inv, // size m, singleton row inverse permutation. + // If row i of A is the kth singleton row, then + // P1inv [i] = k. NULL if n1cols is zero. + + cholmod_sparse **p_Y, // on output, only the first n-n1cols+1 entries of + // Y->p are defined (if Y is not NULL), where + // Y = [A B] or Y = [A2 B2]. If B is empty and + // there are no column singletons, Y is NULL + + int32_t *p_n1cols, // number of column singletons found + int32_t *p_n1rows, // number of corresponding rows found + + // workspace and parameters + cholmod_common *cc +) ; + +template int spqr_1colamd // TRUE if OK, FALSE otherwise +( + // inputs, not modified + int ordering, // all available, except 0:fixed and 3:given + // treated as 1:natural + double tol, // only accept singletons above tol + int32_t bncols, // number of columns of B + cholmod_sparse *A, // m-by-n sparse matrix + + // outputs, neither allocated nor defined on input + + int32_t **p_Q1fill, // size n+bncols, fill-reducing + // or natural ordering + + int32_t **p_R1p, // size n1rows+1, R1p [k] = # of nonzeros in kth + // row of R1. NULL if n1cols == 0. + int32_t **p_P1inv, // size m, singleton row inverse permutation. + // If row i of A is the kth singleton row, then + // P1inv [i] = k. NULL if n1cols is zero. + + cholmod_sparse **p_Y, // on output, only the first n-n1cols+1 entries of + // Y->p are defined (if Y is not NULL), where + // Y = [A B] or Y = [A2 B2]. If B is empty and + // there are no column singletons, Y is NULL -template int spqr_1colamd + int32_t *p_n1cols, // number of column singletons found + int32_t *p_n1rows, // number of corresponding rows found + + // workspace and parameters + cholmod_common *cc +) ; + +template int spqr_1colamd // TRUE if OK, FALSE otherwise ( // inputs, not modified int ordering, // all available, except 0:fixed and 3:given @@ -727,7 +787,7 @@ template int spqr_1colamd int64_t bncols, // number of columns of B cholmod_sparse *A, // m-by-n sparse matrix - // output arrays, neither allocated nor defined on input. + // outputs, neither allocated nor defined on input int64_t **p_Q1fill, // size n+bncols, fill-reducing // or natural ordering @@ -750,9 +810,7 @@ template int spqr_1colamd cholmod_common *cc ) ; -// ============================================================================= - -template int spqr_1colamd +template int spqr_1colamd // TRUE if OK, FALSE otherwise ( // inputs, not modified int ordering, // all available, except 0:fixed and 3:given @@ -761,7 +819,7 @@ template int spqr_1colamd int64_t bncols, // number of columns of B cholmod_sparse *A, // m-by-n sparse matrix - // output arrays, neither allocated nor defined on input. + // outputs, neither allocated nor defined on input int64_t **p_Q1fill, // size n+bncols, fill-reducing // or natural ordering diff --git a/SPQR/Source/spqr_1factor.cpp b/SPQR/Source/spqr_1factor.cpp index 37b5c4b06..b9a4b11ca 100644 --- a/SPQR/Source/spqr_1factor.cpp +++ b/SPQR/Source/spqr_1factor.cpp @@ -84,33 +84,32 @@ any columns in S2 with just one entry have a 2-norm less than tol. Note that the rows of Y are permuted according to the singleton rows. */ - #include "spqr.hpp" -template SuiteSparseQR_factorization *spqr_1factor +template SuiteSparseQR_factorization *spqr_1factor ( // inputs, not modified int ordering, // all, except 3:given treated as 0:fixed double tol, // only accept singletons above tol. If tol <= -2, // then use the default tolerance - int64_t bncols, // number of columns of B + Int bncols, // number of columns of B int keepH, // if TRUE, keep the Householder vectors cholmod_sparse *A, // m-by-n sparse matrix - int64_t ldb, // if dense, the leading dimension of B - int64_t *Bp, // size bncols+1, column pointers of B - int64_t *Bi, // size bnz = Bp [bncols], row indices of B + Int ldb, // if dense, the leading dimension of B + Int *Bp, // size bncols+1, column pointers of B + Int *Bi, // size bnz = Bp [bncols], row indices of B Entry *Bx, // size bnz, numerical values of B // workspace and parameters cholmod_common *cc ) { - spqr_symbolic *QRsym ; - spqr_numeric *QRnum ; - SuiteSparseQR_factorization *QR ; - int64_t *Yp, *Yi, *Q1fill, *R1p, *R1j, *P1inv, *Ap, *Ai ; + spqr_symbolic *QRsym ; + spqr_numeric *QRnum ; + SuiteSparseQR_factorization *QR ; + Int *Yp, *Yi, *Q1fill, *R1p, *R1j, *P1inv, *Ap, *Ai ; Entry *Yx, *R1x, *Ax ; - int64_t noY, anz, a2nz, r1nz, ynz, i, j, k, p, p2, bnz, py, n1rows, + Int noY, anz, a2nz, r1nz, ynz, i, j, k, p, p2, bnz, py, n1rows, n1cols, n2, Bsparse, d, iold, inew, m, n ; cholmod_sparse *Y = NULL ; @@ -123,12 +122,12 @@ template SuiteSparseQR_factorization *spqr_1factor m = A->nrow ; n = A->ncol ; - Ap = (int64_t *) A->p ; - Ai = (int64_t *) A->i ; + Ap = (Int *) A->p ; + Ai = (Int *) A->i ; Ax = (Entry *) A->x ; - QR = (SuiteSparseQR_factorization *) - cholmod_l_malloc (1, sizeof (SuiteSparseQR_factorization ), cc) ; + QR = (SuiteSparseQR_factorization *) + spqr_malloc (1, sizeof (SuiteSparseQR_factorization ), cc) ; if (cc->status < CHOLMOD_OK) { @@ -172,7 +171,7 @@ template SuiteSparseQR_factorization *spqr_1factor if (tol <= SPQR_DEFAULT_TOL) { - tol = spqr_tol (A, cc) ; + tol = spqr_tol (A, cc) ; } if (tol < 0) { @@ -192,7 +191,7 @@ template SuiteSparseQR_factorization *spqr_1factor // These return R1p, P1inv, and Y; but they are all NULL if out of memory. // Note that only Y->p is allocated (Y->i and Y->x are dummy placeholders - // of one int64_t and one Entry, each, actually). The entries of Y are + // of one Int and one Entry, each, actually). The entries of Y are // allocated later, below. if (ordering == SPQR_ORDERING_GIVEN) @@ -204,7 +203,7 @@ template SuiteSparseQR_factorization *spqr_1factor { // fixed ordering: find column singletons without permuting columns Q1fill = NULL ; - spqr_1fixed (tol, bncols, A, + spqr_1fixed (tol, bncols, A, &R1p, &P1inv, &Y, &n1cols, &n1rows, cc) ; } else @@ -212,7 +211,7 @@ template SuiteSparseQR_factorization *spqr_1factor // natural or fill-reducing ordering: find column singletons with // column permutations allowed, then permute the pruned submatrix with // a fill-reducing ordering if ordering is not SPQR_ORDERING_NATURAL. - spqr_1colamd (ordering, tol, bncols, A, &Q1fill, + spqr_1colamd (ordering, tol, bncols, A, &Q1fill, &R1p, &P1inv, &Y, &n1cols, &n1rows, cc) ; ordering = cc->SPQR_istat [7] ; } @@ -232,14 +231,14 @@ template SuiteSparseQR_factorization *spqr_1factor noY = (Y == NULL) ; // A will be factorized, not Y ASSERT (noY == (n1cols == 0 && bncols == 0)) ; - Yp = noY ? NULL : (int64_t *) Y->p ; + Yp = noY ? NULL : (Int *) Y->p ; anz = Ap [n] ; // nonzeros in A a2nz = noY ? anz : Yp [n-n1cols] ; // nonzeros in S2 n2 = n - n1cols ; // number of columns of S2 // Y is NULL, or of size (m-n1rows)-by-(n-n1cols+bncols) - ASSERT (IMPLIES (Y != NULL, ((int64_t) Y->nrow == m-n1rows))) ; - ASSERT (IMPLIES (Y != NULL, ((int64_t) Y->ncol == n-n1cols+bncols))) ; + ASSERT (IMPLIES (Y != NULL, ((Int) Y->nrow == m-n1rows))) ; + ASSERT (IMPLIES (Y != NULL, ((Int) Y->ncol == n-n1cols+bncols))) ; // Y, if allocated, has no space for any entries yet ynz = 0 ; @@ -376,8 +375,8 @@ template SuiteSparseQR_factorization *spqr_1factor } else { - cholmod_l_reallocate_sparse (ynz, Y, cc) ; - Yi = (int64_t *) Y->i ; + spqr_reallocate_sparse (ynz, Y, cc) ; + Yi = (Int *) Y->i ; Yx = (Entry *) Y->x ; } @@ -385,7 +384,7 @@ template SuiteSparseQR_factorization *spqr_1factor { // out of memory spqr_freefac (&QR, cc) ; - cholmod_l_free_sparse (&Y, cc) ; + spqr_free_sparse (&Y, cc) ; return (NULL) ; } @@ -484,15 +483,15 @@ template SuiteSparseQR_factorization *spqr_1factor // R1p = cumsum ([0 R1p]) // --------------------------------------------------------------------- - r1nz = spqr_cumsum (n1rows, R1p) ; // int64_t overflow cannot occur + r1nz = spqr_cumsum (n1rows, R1p) ; // Int overflow cannot occur PR (("total nonzeros in R1: %ld\n", r1nz)) ; // --------------------------------------------------------------------- // allocate R1 // --------------------------------------------------------------------- - R1j = (int64_t *) cholmod_l_malloc (r1nz, sizeof (int64_t ), cc) ; - R1x = (Entry *) cholmod_l_malloc (r1nz, sizeof (Entry), cc) ; + R1j = (Int *) spqr_malloc (r1nz, sizeof (Int ), cc) ; + R1x = (Entry *) spqr_malloc (r1nz, sizeof (Entry), cc) ; QR->R1j = R1j ; QR->R1x = R1x ; QR->r1nz = r1nz ; @@ -501,7 +500,7 @@ template SuiteSparseQR_factorization *spqr_1factor { // out of memory spqr_freefac (&QR, cc) ; - cholmod_l_free_sparse (&Y, cc) ; + spqr_free_sparse (&Y, cc) ; return (NULL) ; } @@ -510,7 +509,7 @@ template SuiteSparseQR_factorization *spqr_1factor // --------------------------------------------------------------------- // At this point, R1p [i] points to the start of row i: - // for (int64_t t = 0 ; t <= n1rows ; t++) Rsave [t] = R1p [t] ; + // for (Int t = 0 ; t <= n1rows ; t++) Rsave [t] = R1p [t] ; for (k = 0 ; k < n1cols ; k++) { @@ -570,7 +569,7 @@ template SuiteSparseQR_factorization *spqr_1factor spqr_shift (n1rows, R1p) ; // the row pointers are back to what they were: - // for (int64_t t = 0 ; t <= n1rows ; t++) ASSERT (Rsave [t] == R1p [t]) ; + // for (Int t = 0 ; t <= n1rows ; t++) ASSERT (Rsave [t] == R1p [t]) ; // --------------------------------------------------------------------- // construct the B2 part of Y = [S2 B2] @@ -634,15 +633,15 @@ template SuiteSparseQR_factorization *spqr_1factor QRsym = spqr_analyze (A, SPQR_ORDERING_GIVEN, Q1fill, tol >= 0, keepH, cc) ; t1 = SuiteSparse_time ( ) ; - QRnum = spqr_factorize (&A, FALSE, tol, n, QRsym, cc) ; + QRnum = spqr_factorize (&A, FALSE, tol, n, QRsym, cc) ; } else { // fill-reducing ordering is already applied to Y; free Y when loaded - QRsym = spqr_analyze (Y, SPQR_ORDERING_FIXED, NULL, + QRsym = spqr_analyze (Y, SPQR_ORDERING_FIXED, NULL, tol >= 0, keepH, cc) ; t1 = SuiteSparse_time ( ) ; - QRnum = spqr_factorize (&Y, TRUE, tol, n2, QRsym, cc) ; + QRnum = spqr_factorize (&Y, TRUE, tol, n2, QRsym, cc) ; // Y has been freed ASSERT (Y == NULL) ; } @@ -693,9 +692,9 @@ template SuiteSparseQR_factorization *spqr_1factor // row of R2 = QRnum->HPinv (row of Y). Combine these two into // HP1inv, where a global row of R = HP1inv (a row of A) - int64_t kk ; - int64_t *HP1inv, *HPinv ; - QR->HP1inv = HP1inv = (int64_t *) cholmod_l_malloc (m, sizeof (int64_t), cc) ; + Int kk ; + Int *HP1inv, *HPinv ; + QR->HP1inv = HP1inv = (Int *) spqr_malloc (m, sizeof (Int), cc) ; HPinv = QRnum->HPinv ; if (cc->status < CHOLMOD_OK) @@ -732,7 +731,7 @@ template SuiteSparseQR_factorization *spqr_1factor // find the mapping for the squeezed R, if A is rank deficient // ------------------------------------------------------------------------- - if (QR->rank < n && !spqr_rmap (QR, cc)) + if (QR->rank < n && !spqr_rmap (QR, cc)) { // out of memory spqr_freefac (&QR, cc) ; @@ -758,37 +757,75 @@ template SuiteSparseQR_factorization *spqr_1factor // ============================================================================= -template SuiteSparseQR_factorization *spqr_1factor +template SuiteSparseQR_factorization *spqr_1factor +( + // inputs, not modified + int ordering, // all, except 3:given treated as 0:fixed + double tol, // only accept singletons above tol. If tol <= -2, + // then use the default tolerance + int32_t bncols, // number of columns of B + int keepH, // if TRUE, keep the Householder vectors + cholmod_sparse *A, // m-by-n sparse matrix + int32_t ldb, // if dense, the leading dimension of B + int32_t *Bp, // size bncols+1, column pointers of B + int32_t *Bi, // size bnz = Bp [bncols], row indices of B + Complex *Bx, // size bnz, numerical values of B + + // workspace and parameters + cholmod_common *cc +) ; + + +template SuiteSparseQR_factorization *spqr_1factor ( // inputs, not modified int ordering, // all, except 3:given treated as 0:fixed - double tol, // only accept singletons above tol + double tol, // only accept singletons above tol. If tol <= -2, + // then use the default tolerance + int32_t bncols, // number of columns of B + int keepH, // if TRUE, keep the Householder vectors + cholmod_sparse *A, // m-by-n sparse matrix + int32_t ldb, // if dense, the leading dimension of B + int32_t *Bp, // size bncols+1, column pointers of B + int32_t *Bi, // size bnz = Bp [bncols], row indices of B + double *Bx, // size bnz, numerical values of B + + // workspace and parameters + cholmod_common *cc +) ; + +template SuiteSparseQR_factorization *spqr_1factor +( + // inputs, not modified + int ordering, // all, except 3:given treated as 0:fixed + double tol, // only accept singletons above tol. If tol <= -2, + // then use the default tolerance int64_t bncols, // number of columns of B int keepH, // if TRUE, keep the Householder vectors cholmod_sparse *A, // m-by-n sparse matrix int64_t ldb, // if dense, the leading dimension of B int64_t *Bp, // size bncols+1, column pointers of B int64_t *Bi, // size bnz = Bp [bncols], row indices of B - double *Bx, // size bnz, numerical values of B + Complex *Bx, // size bnz, numerical values of B // workspace and parameters cholmod_common *cc ) ; -// ============================================================================= -template SuiteSparseQR_factorization *spqr_1factor +template SuiteSparseQR_factorization *spqr_1factor ( // inputs, not modified int ordering, // all, except 3:given treated as 0:fixed - double tol, // only accept singletons above tol + double tol, // only accept singletons above tol. If tol <= -2, + // then use the default tolerance int64_t bncols, // number of columns of B int keepH, // if TRUE, keep the Householder vectors cholmod_sparse *A, // m-by-n sparse matrix int64_t ldb, // if dense, the leading dimension of B int64_t *Bp, // size bncols+1, column pointers of B int64_t *Bi, // size bnz = Bp [bncols], row indices of B - Complex *Bx, // size bnz, numerical values of B + double *Bx, // size bnz, numerical values of B // workspace and parameters cholmod_common *cc diff --git a/SPQR/Source/spqr_1fixed.cpp b/SPQR/Source/spqr_1fixed.cpp index 470a11c3c..8f2fdb910 100644 --- a/SPQR/Source/spqr_1fixed.cpp +++ b/SPQR/Source/spqr_1fixed.cpp @@ -17,18 +17,18 @@ #include "spqr.hpp" -template int spqr_1fixed +template int spqr_1fixed ( // inputs, not modified double tol, // only accept singletons above tol - int64_t bncols, // number of columns of B + Int bncols, // number of columns of B cholmod_sparse *A, // m-by-n sparse matrix // output arrays, neither allocated nor defined on input. - int64_t **p_R1p, // size n1rows+1, R1p [k] = # of nonzeros in kth + Int **p_R1p, // size n1rows+1, R1p [k] = # of nonzeros in kth // row of R1. NULL if n1cols == 0. - int64_t **p_P1inv, // size m, singleton row inverse permutation. + Int **p_P1inv, // size m, singleton row inverse permutation. // If row i of A is the kth singleton row, then // P1inv [i] = k. NULL if n1cols is zero. @@ -37,18 +37,18 @@ template int spqr_1fixed // Y = [A B] or Y = [A2 B2]. If B is empty and // there are no column singletons, Y is NULL - int64_t *p_n1cols, // number of column singletons found - int64_t *p_n1rows, // number of corresponding rows found + Int *p_n1cols, // number of column singletons found + Int *p_n1rows, // number of corresponding rows found // workspace and parameters cholmod_common *cc ) { cholmod_sparse *Y ; - int64_t *P1inv, *R1p, *Yp, *Qrows, *Ap, *Ai ; + Int *P1inv, *R1p, *Yp, *Qrows, *Ap, *Ai ; char *Mark ; Entry *Ax ; - int64_t i, j, k, p, d, row, n1rows, n1cols, ynz, iold, inew, kk, m, n, xtype ; + Int i, j, k, p, d, row, n1rows, n1cols, ynz, iold, inew, kk, m, n, xtype ; // ------------------------------------------------------------------------- // get inputs @@ -58,8 +58,8 @@ template int spqr_1fixed m = A->nrow ; n = A->ncol ; - Ap = (int64_t *) A->p ; - Ai = (int64_t *) A->i ; + Ap = (Int *) A->p ; + Ai = (Int *) A->i ; Ax = (Entry *) A->x ; // set outputs to NULL in case of early return @@ -73,14 +73,14 @@ template int spqr_1fixed // allocate workspace // ------------------------------------------------------------------------- - Mark = (char *) cholmod_l_calloc (m, sizeof (char), cc) ; - Qrows = (int64_t *) cholmod_l_malloc (n, sizeof (int64_t), cc) ; + Mark = (char *) spqr_calloc (m, sizeof (char), cc) ; + Qrows = (Int *) spqr_malloc (n, sizeof (Int), cc) ; if (cc->status < CHOLMOD_OK) { // out of memory - cholmod_l_free (m, sizeof (char), Mark, cc) ; - cholmod_l_free (n, sizeof (int64_t), Qrows, cc) ; + spqr_free (m, sizeof (char), Mark, cc) ; + spqr_free (n, sizeof (Int), Qrows, cc) ; return (FALSE) ; } @@ -155,18 +155,18 @@ template int spqr_1fixed // --------------------------------------------------------------------- // Y has no entries yet; nnz(Y) will be determined later - Y = cholmod_l_allocate_sparse (m, n+bncols, 0, + Y = spqr_allocate_sparse (m, n+bncols, 0, FALSE, TRUE, 0, xtype, cc) ; if (cc->status < CHOLMOD_OK) { // out of memory - cholmod_l_free (m, sizeof (char), Mark, cc) ; - cholmod_l_free (n, sizeof (int64_t), Qrows, cc) ; + spqr_free (m, sizeof (char), Mark, cc) ; + spqr_free (n, sizeof (Int), Qrows, cc) ; return (FALSE) ; } - Yp = (int64_t *) Y->p ; + Yp = (Int *) Y->p ; ASSERT (n1rows == 0) ; P1inv = NULL ; @@ -191,23 +191,23 @@ template int spqr_1fixed // --------------------------------------------------------------------- // Y has no entries yet; nnz(Y) will be determined later - Y = cholmod_l_allocate_sparse (m-n1rows, n-n1cols+bncols, 0, + Y = spqr_allocate_sparse (m-n1rows, n-n1cols+bncols, 0, TRUE, TRUE, 0, xtype, cc) ; - P1inv = (int64_t *) cholmod_l_malloc (m, sizeof (int64_t), cc) ; - R1p = (int64_t *) cholmod_l_calloc (n1rows+1, sizeof (int64_t), cc) ; + P1inv = (Int *) spqr_malloc (m, sizeof (Int), cc) ; + R1p = (Int *) spqr_calloc (n1rows+1, sizeof (Int), cc) ; if (cc->status < CHOLMOD_OK) { // out of memory - cholmod_l_free_sparse (&Y, cc) ; - cholmod_l_free (m, sizeof (int64_t), P1inv, cc) ; - cholmod_l_free (n1rows+1, sizeof (int64_t), R1p, cc) ; - cholmod_l_free (m, sizeof (char), Mark, cc) ; - cholmod_l_free (n, sizeof (int64_t), Qrows, cc) ; + spqr_free_sparse (&Y, cc) ; + spqr_free (m, sizeof (Int), P1inv, cc) ; + spqr_free (n1rows+1, sizeof (Int), R1p, cc) ; + spqr_free (m, sizeof (char), Mark, cc) ; + spqr_free (n, sizeof (Int), Qrows, cc) ; return (FALSE) ; } - Yp = (int64_t *) Y->p ; + Yp = (Int *) Y->p ; #ifndef NDEBUG for (i = 0 ; i < m ; i++) P1inv [i] = EMPTY ; @@ -291,8 +291,8 @@ template int spqr_1fixed // free workspace and return results // ------------------------------------------------------------------------- - cholmod_l_free (n, sizeof (int64_t), Qrows, cc) ; - cholmod_l_free (m, sizeof (char), Mark, cc) ; + spqr_free (n, sizeof (Int), Qrows, cc) ; + spqr_free (m, sizeof (char), Mark, cc) ; *p_R1p = R1p ; *p_P1inv = P1inv ; @@ -306,7 +306,33 @@ template int spqr_1fixed // ============================================================================= -template int spqr_1fixed +template int spqr_1fixed +( + // inputs, not modified + double tol, // only accept singletons above tol + int32_t bncols, // number of columns of B + cholmod_sparse *A, // m-by-n sparse matrix + + // output arrays, neither allocated nor defined on input. + + int32_t **p_R1p, // size n1rows+1, R1p [k] = # of nonzeros in kth + // row of R1. NULL if n1cols == 0. + int32_t **p_P1inv, // size m, singleton row inverse permutation. + // If row i of A is the kth singleton row, then + // P1inv [i] = k. NULL if n1cols is zero. + + cholmod_sparse **p_Y, // on output, only the first n-n1cols+1 entries of + // Y->p are defined (if Y is not NULL), where + // Y = [A B] or Y = [A2 B2]. If B is empty and + // there are no column singletons, Y is NULL + + int32_t *p_n1cols, // number of column singletons found + int32_t *p_n1rows, // number of corresponding rows found + + // workspace and parameters + cholmod_common *cc +) ; +template int spqr_1fixed ( // inputs, not modified double tol, // only accept singletons above tol @@ -333,9 +359,33 @@ template int spqr_1fixed cholmod_common *cc ) ; -// ============================================================================= +template int spqr_1fixed +( + // inputs, not modified + double tol, // only accept singletons above tol + int32_t bncols, // number of columns of B + cholmod_sparse *A, // m-by-n sparse matrix + + // output arrays, neither allocated nor defined on input. + + int32_t **p_R1p, // size n1rows+1, R1p [k] = # of nonzeros in kth + // row of R1. NULL if n1cols == 0. + int32_t **p_P1inv, // size m, singleton row inverse permutation. + // If row i of A is the kth singleton row, then + // P1inv [i] = k. NULL if n1cols is zero. -template int spqr_1fixed + cholmod_sparse **p_Y, // on output, only the first n-n1cols+1 entries of + // Y->p are defined (if Y is not NULL), where + // Y = [A B] or Y = [A2 B2]. If B is empty and + // there are no column singletons, Y is NULL + + int32_t *p_n1cols, // number of column singletons found + int32_t *p_n1rows, // number of corresponding rows found + + // workspace and parameters + cholmod_common *cc +) ; +template int spqr_1fixed ( // inputs, not modified double tol, // only accept singletons above tol diff --git a/SPQR/Source/spqr_analyze.cpp b/SPQR/Source/spqr_analyze.cpp index 427d1c8bf..4239e1183 100644 --- a/SPQR/Source/spqr_analyze.cpp +++ b/SPQR/Source/spqr_analyze.cpp @@ -16,26 +16,24 @@ #ifdef NSUPERNODAL #error "SuiteSparseQR requires the CHOLMOD/Supernodal module" #endif - // ============================================================================= -#define FREE_WORK \ - cholmod_l_free_factor (&Sc, cc) ; \ - cholmod_l_free (2*(nf+1), sizeof (double), Flops, cc) ; \ - cholmod_l_free (ns+2, sizeof (int64_t), Stack_stack, cc) ; \ - cholmod_l_free (nf, sizeof (int64_t), Rh, cc) ; \ - cholmod_l_free (ntasks, sizeof (int64_t), TaskParent, cc) ; +#define FREE_WORK_ANALYZE \ + spqr_free_factor (&Sc, cc) ; \ + spqr_free (2*(nf+1), sizeof (double), Flops, cc) ; \ + spqr_free (ns+2, sizeof (Int), Stack_stack, cc) ; \ + spqr_free (nf, sizeof (Int), Rh, cc) ; \ + spqr_free (ntasks, sizeof (Int), TaskParent, cc) ; // ============================================================================= // === spqr_analyze ============================================================ // ============================================================================= - -spqr_symbolic *spqr_analyze +template spqr_symbolic *spqr_analyze ( // inputs, not modified cholmod_sparse *A, int ordering, // all options available - int64_t *Quser, // user provided ordering, if given (may be NULL) + Int *Quser, // user provided ordering, if given (may be NULL) int do_rank_detection, // if TRUE, then rank deficient matrices may be // considered during numerical factorization, @@ -50,13 +48,13 @@ spqr_symbolic *spqr_analyze cholmod_common *cc ) { - spqr_symbolic *QRsym ; - int64_t *Parent, *Child, *Childp, *W, *Rj, *Rp, *Super, *Stair, *Fmap, *Sleft, + spqr_symbolic *QRsym ; + Int *Parent, *Child, *Childp, *W, *Rj, *Rp, *Super, *Stair, *Fmap, *Sleft, *Post, *Ap, *Weight, *On_stack, *Task, *TaskParent, *TaskChildp, *TaskChild, *Fm, *Cm, *TaskFront, *TaskFrontp, *Rh, *Stack_stack, *Stack_maxstack, *Hip, *TaskStack, *InvPost ; - int64_t nf, f, j, col1, col2, p, p1, p2, t, parent, anz, fp, csize_max, + Int nf, f, j, col1, col2, p, p1, p2, t, parent, anz, fp, csize_max, fmc, fnc, fpc, cm, cn, ci, fm, fn, cm_min, cm_max, csize_min, kf, rm, rn, col, c, pc, rsize, maxfn, csize, m, n, klast, stack, maxstack, rxsize, hisize, @@ -66,14 +64,14 @@ spqr_symbolic *spqr_analyze int ok = TRUE, do_parallel_analysis ; double total_flops = 0 ; double *Flops, *Flops_subtree ; - int64_t *Sp, *Sj; + Int *Sp, *Sj; #ifdef SUITESPARSE_CUDA - spqr_gpu *QRgpu ; - int64_t *RjmapOffsets, *RimapOffsets ; - int64_t RjmapSize, RimapSize; - int64_t numStages; // staging - int64_t *Stagingp, *StageMap, *FOffsets, *ROffsets, *SOffsets; + spqr_gpu_impl *QRgpu ; + Int *RjmapOffsets, *RimapOffsets ; + Int RjmapSize, RimapSize; + Int numStages; // staging + Int *Stagingp, *StageMap, *FOffsets, *ROffsets, *SOffsets; size_t *FSize, *RSize, *SSize; #endif @@ -89,8 +87,8 @@ spqr_symbolic *spqr_analyze m = A->nrow ; n = A->ncol ; - Ap = (int64_t *) A->p ; - // Ai = (int64_t *) A->i ; + Ap = (Int *) A->p ; + // Ai = (Int *) A->i ; anz = Ap [n] ; do_parallel_analysis = (cc->SPQR_grain > 1) ; @@ -156,7 +154,7 @@ spqr_symbolic *spqr_analyze nf = n ; // just a placeholder; will be changed later to some nf <= n - cholmod_l_allocate_work (n+1, MAX (m, 2*(n+1) + 2*(nf+2)) + 1, 0, cc) ; + spqr_allocate_work (n+1, MAX (m, 2*(n+1) + 2*(nf+2)) + 1, 0, cc) ; // workspace allocated later: Rh = NULL ; @@ -171,7 +169,7 @@ spqr_symbolic *spqr_analyze if (cc->status < CHOLMOD_OK) { // out of memory - FREE_WORK ; + FREE_WORK_ANALYZE ; return (NULL) ; } @@ -179,10 +177,10 @@ spqr_symbolic *spqr_analyze // supernodal Cholesky ordering and analysis of A'A // ------------------------------------------------------------------------- - AT = cholmod_l_transpose (A, 0, cc) ; // AT = spones (A') [ + AT = spqr_transpose (A, 0, cc) ; // AT = spones (A') [ // save the current CHOLMOD settings - int64_t save [6] ; + Int save [6] ; save [0] = cc->supernodal ; save [1] = cc->nmethods ; save [2] = cc->postorder ; @@ -283,9 +281,9 @@ spqr_symbolic *spqr_analyze // multifrontal QR ordering and analysis. // The GPU-accelerated SPQR requires additional supernodal analysis. TEST_COVERAGE_PAUSE ; - Sc = cholmod_l_analyze_p2 ( + Sc = spqr_analyze_p2 ( useGPU ? CHOLMOD_ANALYZE_FOR_SPQRGPU : CHOLMOD_ANALYZE_FOR_SPQR, - AT, (int64_t *) Quser, NULL, 0, cc) ; + AT, (Int *) Quser, NULL, 0, cc) ; TEST_COVERAGE_RESUME ; // record the actual ordering used @@ -311,19 +309,19 @@ spqr_symbolic *spqr_analyze cc->method [1].ordering = save [4] ; cc->method [2].ordering = save [5] ; - cholmod_l_free_sparse (&AT, cc) ; // ] + spqr_free_sparse (&AT, cc) ; // ] if (cc->status < CHOLMOD_OK) { // out of memory - FREE_WORK ; + FREE_WORK_ANALYZE ; return (NULL) ; } if (Sc == NULL || !(Sc->is_super) || !(Sc->is_ll)) { - cholmod_l_free_factor (&Sc, cc) ; - FREE_WORK ; + spqr_free_factor (&Sc, cc) ; + FREE_WORK_ANALYZE ; ERROR (CHOLMOD_INVALID, "SuiteSparseQR requires the CHOLMOD/Supernodal module") ; return (NULL) ; @@ -335,12 +333,12 @@ spqr_symbolic *spqr_analyze // extract the contents of CHOLMOD's supernodal factorization // ------------------------------------------------------------------------- - QRsym = (spqr_symbolic *) cholmod_l_malloc (1, sizeof (spqr_symbolic), cc) ; + QRsym = (spqr_symbolic *) spqr_malloc (1, sizeof (spqr_symbolic ), cc) ; if (cc->status < CHOLMOD_OK) { // out of memory - FREE_WORK ; + FREE_WORK_ANALYZE ; return (NULL) ; } @@ -354,43 +352,43 @@ spqr_symbolic *spqr_analyze QRsym->maxcsize = Sc->maxcsize; QRsym->maxesize = Sc->maxesize; - QRsym->Qfill = (int64_t *) Sc->Perm ; // size n column perm + QRsym->Qfill = (Int *) Sc->Perm ; // size n column perm Sc->Perm = NULL ; - QRsym->Super = Super = (int64_t *) Sc->super ; // Super is size nf+1 + QRsym->Super = Super = (Int *) Sc->super ; // Super is size nf+1 Sc->super = NULL ; - QRsym->Rp = Rp = (int64_t *) Sc->pi ; // Rp is size nf+1 + QRsym->Rp = Rp = (Int *) Sc->pi ; // Rp is size nf+1 Sc->pi = NULL ; - QRsym->Rj = Rj = (int64_t *) Sc->s ; // Rj is size rjsize + QRsym->Rj = Rj = (Int *) Sc->s ; // Rj is size rjsize Sc->s = NULL ; // ColCount is required for the GPU factorization - QRsym->ColCount = (int64_t *) Sc->ColCount ; + QRsym->ColCount = (Int *) Sc->ColCount ; Sc->ColCount = NULL ; - cholmod_l_free_factor (&Sc, cc) ; + spqr_free_factor (&Sc, cc) ; // ------------------------------------------------------------------------- // allocate the rest of QRsym // ------------------------------------------------------------------------- ASSERT (nf <= n) ; - QRsym->Parent = Parent = (int64_t *) cholmod_l_malloc (nf+1, sizeof(int64_t), cc); - QRsym->Childp = Childp = (int64_t *) cholmod_l_calloc (nf+2, sizeof(int64_t), cc); - QRsym->Child = Child = (int64_t *) cholmod_l_calloc (nf+1, sizeof(int64_t), cc); - QRsym->Post = Post = (int64_t *) cholmod_l_malloc (nf+1, sizeof(int64_t), cc); - QRsym->PLinv = (int64_t *) cholmod_l_malloc (m, sizeof(int64_t), cc); - QRsym->Sleft = Sleft = (int64_t *) cholmod_l_malloc (n+2, sizeof(int64_t), cc); - QRsym->Sp = Sp = (int64_t *) cholmod_l_malloc (m+1, sizeof(int64_t), cc); - QRsym->Sj = Sj = (int64_t *) cholmod_l_malloc (anz, sizeof(int64_t), cc); - QRsym->Fm = (int64_t *) cholmod_l_malloc (nf+1, sizeof(int64_t), cc); - QRsym->Cm = (int64_t *) cholmod_l_malloc (nf+1, sizeof(int64_t), cc); + QRsym->Parent = Parent = (Int *) spqr_malloc (nf+1, sizeof(Int), cc); + QRsym->Childp = Childp = (Int *) spqr_calloc (nf+2, sizeof(Int), cc); + QRsym->Child = Child = (Int *) spqr_calloc (nf+1, sizeof(Int), cc); + QRsym->Post = Post = (Int *) spqr_malloc (nf+1, sizeof(Int), cc); + QRsym->PLinv = (Int *) spqr_malloc (m, sizeof(Int), cc); + QRsym->Sleft = Sleft = (Int *) spqr_malloc (n+2, sizeof(Int), cc); + QRsym->Sp = Sp = (Int *) spqr_malloc (m+1, sizeof(Int), cc); + QRsym->Sj = Sj = (Int *) spqr_malloc (anz, sizeof(Int), cc); + QRsym->Fm = (Int *) spqr_malloc (nf+1, sizeof(Int), cc); + QRsym->Cm = (Int *) spqr_malloc (nf+1, sizeof(Int), cc); if (keepH) { - QRsym->Hip = Hip = (int64_t *) cholmod_l_malloc (nf+1, sizeof (int64_t), cc) ; + QRsym->Hip = Hip = (Int *) spqr_malloc (nf+1, sizeof (Int), cc) ; } else { @@ -431,33 +429,33 @@ spqr_symbolic *spqr_analyze if (useGPU) { // use calloc so that the pointers inside are all NULL - QRgpu = (spqr_gpu *) cholmod_l_calloc (1, sizeof(spqr_gpu), cc) ; + QRgpu = (spqr_gpu_impl *) spqr_calloc (1, sizeof(spqr_gpu_impl ), cc) ; QRsym->QRgpu = QRgpu ; if(QRgpu) { - RimapOffsets = (int64_t*) cholmod_l_malloc(nf, sizeof(int64_t), cc) ; + RimapOffsets = (Int*) spqr_malloc (nf, sizeof(Int), cc) ; QRgpu->RimapOffsets = RimapOffsets ; - RjmapOffsets = (int64_t*) cholmod_l_malloc(nf, sizeof(int64_t), cc) ; + RjmapOffsets = (Int*) spqr_malloc (nf, sizeof(Int), cc) ; QRgpu->RjmapOffsets = RjmapOffsets ; // allocated later QRgpu->numStages = 0 ; - QRgpu->Stagingp = (int64_t*) NULL ; - QRgpu->StageMap = (int64_t*) NULL ; + QRgpu->Stagingp = (Int*) NULL ; + QRgpu->StageMap = (Int*) NULL ; QRgpu->FSize = (size_t*) NULL ; QRgpu->RSize = (size_t*) NULL ; QRgpu->SSize = (size_t*) NULL ; - QRgpu->FOffsets = (int64_t*) NULL ; - QRgpu->ROffsets = (int64_t*) NULL ; - QRgpu->SOffsets = (int64_t*) NULL ; + QRgpu->FOffsets = (Int*) NULL ; + QRgpu->ROffsets = (Int*) NULL ; + QRgpu->SOffsets = (Int*) NULL ; } if (cc->status < CHOLMOD_OK) { // out of memory spqr_freesym (&QRsym, cc) ; - FREE_WORK ; + FREE_WORK_ANALYZE ; return (NULL) ; } } @@ -473,12 +471,12 @@ spqr_symbolic *spqr_analyze if (do_parallel_analysis) { // allocate Flops and Flops_subtree, each of size nf+1 - Flops = (double *) cholmod_l_malloc (2*(nf+1), sizeof (double), cc) ; + Flops = (double *) spqr_malloc (2*(nf+1), sizeof (double), cc) ; Flops_subtree = Flops + (nf+1) ; if (keepH) { // Rh, size nf; Rh [f] is the size of R and H for front f - Rh = (int64_t *) cholmod_l_malloc (nf, sizeof (int64_t), cc) ; + Rh = (Int *) spqr_malloc (nf, sizeof (Int), cc) ; } } @@ -486,7 +484,7 @@ spqr_symbolic *spqr_analyze { // out of memory spqr_freesym (&QRsym, cc) ; - FREE_WORK ; + FREE_WORK_ANALYZE ; return (NULL) ; } @@ -501,7 +499,7 @@ spqr_symbolic *spqr_analyze // children in order of increasing row count of R, so that bigger children // come later, and the biggest child of front f is front f-1. - W = (int64_t *) cc->Iwork ; + W = (Int *) cc->Iwork ; // use W [0:n-1] for SuperMap [ @@ -565,8 +563,8 @@ spqr_symbolic *spqr_analyze // uses CHOLMOD workspace: Head (nf+1), Iwork (2*(nf+1)). Guaranteed // to succeed since enough workspace has already been allocated above. - cholmod_l_postorder ((int64_t *) Parent, nf+1, - (int64_t *) Weight, (int64_t *) Post, cc) ; + spqr_postorder ((Int *) Parent, nf+1, + (Int *) Weight, (Int *) Post, cc) ; ASSERT (cc->status == CHOLMOD_OK) ; ASSERT (Post [nf] == nf) ; // placeholder is last @@ -703,7 +701,7 @@ spqr_symbolic *spqr_analyze col = j + col1 ; Stair [j] = Sleft [col+1] - Sleft [col] ; #ifndef NDEBUG - for (int64_t row = Sleft [col] ; row < Sleft [col+1] ; row++) + for (Int row = Sleft [col] ; row < Sleft [col+1] ; row++) { PR (("Assemble row %ld into stair [%ld] col %ld\n", row,j, col)) ; @@ -742,7 +740,7 @@ spqr_symbolic *spqr_analyze { // with no pivot failures // fmc is the exact # of rows in child F - int64_t rc = MIN (fmc, fpc) ; // exact # of rows in child R + Int rc = MIN (fmc, fpc) ; // exact # of rows in child R cm = MAX (fmc - rc, 0) ; cm = MIN (cm, cn) ; // exact # rows in C } @@ -769,7 +767,7 @@ spqr_symbolic *spqr_analyze // Keep track of total sizes of C blocks of all children. The // C block of this child has at most cm rows, and always has - // (fnc-fpc) columns. int64_t overflow cannot occur because csize + // (fnc-fpc) columns. Int overflow cannot occur because csize // < fsize of the child and fsize has already been checked. csize = cm*(cm+1)/2 + cm*(cn-cm) ; ctot += csize ; @@ -820,7 +818,7 @@ spqr_symbolic *spqr_analyze ASSERT (rm <= rn) ; ASSERT (rm >= 0) ; ASSERT (rm <= fm) ; - rsize = rm*(rm+1)/2 + rm*(rn-rm) ; // int64_t overflow cannot occur + rsize = rm*(rm+1)/2 + rm*(rn-rm) ; // Int overflow cannot occur ASSERT (rsize >= 0 && rsize <= fsize) ; rxsize += rsize ; PR ((" rm %ld rn %ld rsize %ld\n", rm, rn, rsize)) ; @@ -840,7 +838,7 @@ spqr_symbolic *spqr_analyze cm_min = MAX (fm - rm, 0) ; cm_min = MIN (cm_min, cn) ; // exact # rows in C block - // int64_t overflow cannot occur: + // Int overflow cannot occur: csize_max = cm_max*(cm_max+1)/2 + cm_max*(cn-cm_max) ; csize_min = cm_min*(cm_min+1)/2 + cm_min*(cn-cm_min) ; csize = do_rank_detection ? csize_max : csize_min ; @@ -870,12 +868,12 @@ spqr_symbolic *spqr_analyze RimapSize += Cm[f]; // # rows of C // Munge Sj to cut down on assembly time. - for(int64_t k=0 ; k j) { double h = (t-j) ; // length of Householder vector @@ -998,7 +996,7 @@ spqr_symbolic *spqr_analyze } // ------------------------------------------------------------------------- - // check for int64_t overflow + // check for Int overflow // ------------------------------------------------------------------------- PR (("stack %ld\n", stack)) ; @@ -1009,9 +1007,9 @@ spqr_symbolic *spqr_analyze if (!ok) { - // int64_t overflow has occured + // Int overflow has occured spqr_freesym (&QRsym, cc) ; - FREE_WORK ; + FREE_WORK_ANALYZE ; ERROR (CHOLMOD_TOO_LARGE, "problem too large") ; return (NULL) ; } @@ -1062,7 +1060,7 @@ spqr_symbolic *spqr_analyze cc->SPQR_istat [3] = 1 ; // ntasks, for now DEBUG (spqrDebug_dump_Parent (nf+1, Parent, "pfile")) ; - DEBUG (spqrDebug_dump_Parent (1, NULL, "tfile")) ; + DEBUG (spqrDebug_dump_Parent ((Int) 1, (Int *) NULL, "tfile")) ; PR (("flops %g\n", total_flops)) ; @@ -1075,14 +1073,14 @@ spqr_symbolic *spqr_analyze if(useGPU) { /* Compute a schedule based on memory requirements. */ - QRgpu->Stagingp = (int64_t*) cholmod_l_malloc(nf+2, sizeof(int64_t), cc); - QRgpu->StageMap = (int64_t*) cholmod_l_malloc(nf, sizeof(int64_t), cc); - QRgpu->FSize = (size_t*) cholmod_l_malloc(nf+1, sizeof(size_t), cc); - QRgpu->RSize = (size_t*) cholmod_l_malloc(nf+1, sizeof(size_t), cc); - QRgpu->SSize = (size_t*) cholmod_l_malloc(nf+1, sizeof(size_t), cc); - QRgpu->FOffsets = (int64_t*) cholmod_l_malloc(nf, sizeof(int64_t), cc); - QRgpu->ROffsets = (int64_t*) cholmod_l_malloc(nf, sizeof(int64_t), cc); - QRgpu->SOffsets = (int64_t*) cholmod_l_malloc(nf, sizeof(int64_t), cc); + QRgpu->Stagingp = (Int*) spqr_malloc (nf+2, sizeof(Int), cc); + QRgpu->StageMap = (Int*) spqr_malloc (nf, sizeof(Int), cc); + QRgpu->FSize = (size_t*) spqr_malloc (nf+1, sizeof(size_t), cc); + QRgpu->RSize = (size_t*) spqr_malloc (nf+1, sizeof(size_t), cc); + QRgpu->SSize = (size_t*) spqr_malloc (nf+1, sizeof(size_t), cc); + QRgpu->FOffsets = (Int*) spqr_malloc (nf, sizeof(Int), cc); + QRgpu->ROffsets = (Int*) spqr_malloc (nf, sizeof(Int), cc); + QRgpu->SOffsets = (Int*) spqr_malloc (nf, sizeof(Int), cc); Stagingp = QRgpu->Stagingp ; StageMap = QRgpu->StageMap ; @@ -1098,7 +1096,7 @@ spqr_symbolic *spqr_analyze { // out of memory spqr_freesym (&QRsym, cc) ; - FREE_WORK ; + FREE_WORK_ANALYZE ; return (NULL) ; } @@ -1119,7 +1117,7 @@ spqr_symbolic *spqr_analyze if(!feasible) { spqr_freesym (&QRsym, cc) ; - FREE_WORK ; + FREE_WORK_ANALYZE ; return (NULL) ; } @@ -1138,7 +1136,7 @@ spqr_symbolic *spqr_analyze // turn off parallelism and return the QRsym result QRsym->ntasks = 1 ; QRsym->ns = 1 ; - FREE_WORK ; + FREE_WORK_ANALYZE ; return (QRsym) ; } @@ -1167,7 +1165,7 @@ spqr_symbolic *spqr_analyze Task = W ; // size nf+1 [ InvPost = Task + (nf+1) ; // size nf+1 [ - for (int64_t k = 0 ; k <= nf ; k++) + for (Int k = 0 ; k <= nf ; k++) { f = Post [k] ; InvPost [f] = k ; @@ -1220,7 +1218,7 @@ spqr_symbolic *spqr_analyze for (kf = 0 ; kf < nf ; kf++) { - int64_t fstart = Post [kf] ; + Int fstart = Post [kf] ; if (Task [fstart] != EMPTY) { // fstart is already assigned to a task, or it's a pending big @@ -1246,7 +1244,7 @@ spqr_symbolic *spqr_analyze ASSERT (!TASK_IS_PENDING (f)) ; } - int64_t flast = f ; + Int flast = f ; parent = Parent [flast] ; PR ((" >>> flast is %ld flops: %g parent: %ld\n", flast, @@ -1306,7 +1304,7 @@ spqr_symbolic *spqr_analyze // --------------------------------------------------------------------- klast = InvPost [flast] ; - for (int64_t k = kf ; k <= klast ; k++) + for (Int k = kf ; k <= klast ; k++) { f = Post [k] ; PR ((" assign %ld to %ld\n", f, task)) ; @@ -1383,7 +1381,7 @@ spqr_symbolic *spqr_analyze // No parallelism found QRsym->ntasks = 1 ; QRsym->ns = 1 ; - FREE_WORK ; + FREE_WORK_ANALYZE ; return (QRsym) ; } @@ -1425,7 +1423,7 @@ spqr_symbolic *spqr_analyze #endif // Flops no longer needed - cholmod_l_free (2*(nf+1), sizeof (double), Flops, cc) ; + spqr_free (2*(nf+1), sizeof (double), Flops, cc) ; Flops = NULL ; Flops_subtree = NULL ; @@ -1446,14 +1444,14 @@ spqr_symbolic *spqr_analyze // During factorization, just get On_stack [f] for first f in the task. // TaskParent is temporary workspace: - TaskParent = (int64_t *) cholmod_l_malloc (ntasks, sizeof (int64_t), cc) ; + TaskParent = (Int *) spqr_malloc (ntasks, sizeof (Int), cc) ; - TaskChildp = (int64_t *) cholmod_l_calloc (ntasks+2, sizeof (int64_t), cc) ; - TaskChild = (int64_t *) cholmod_l_calloc (ntasks+1, sizeof (int64_t), cc) ; - TaskFront = (int64_t *) cholmod_l_malloc (nf+1, sizeof (int64_t), cc) ; - TaskFrontp = (int64_t *) cholmod_l_calloc (ntasks+2, sizeof (int64_t), cc) ; - TaskStack = (int64_t *) cholmod_l_malloc (ntasks+1, sizeof (int64_t), cc) ; - On_stack = (int64_t *) cholmod_l_malloc (nf+1, sizeof (int64_t), cc) ; + TaskChildp = (Int *) spqr_calloc (ntasks+2, sizeof (Int), cc) ; + TaskChild = (Int *) spqr_calloc (ntasks+1, sizeof (Int), cc) ; + TaskFront = (Int *) spqr_malloc (nf+1, sizeof (Int), cc) ; + TaskFrontp = (Int *) spqr_calloc (ntasks+2, sizeof (Int), cc) ; + TaskStack = (Int *) spqr_malloc (ntasks+1, sizeof (Int), cc) ; + On_stack = (Int *) spqr_malloc (nf+1, sizeof (Int), cc) ; QRsym->TaskFront = TaskFront ; QRsym->TaskFrontp = TaskFrontp ; @@ -1466,7 +1464,7 @@ spqr_symbolic *spqr_analyze { // out of memory spqr_freesym (&QRsym, cc) ; - FREE_WORK ; + FREE_WORK_ANALYZE ; return (NULL) ; } @@ -1481,8 +1479,8 @@ spqr_symbolic *spqr_analyze for (f = 0 ; f < nf ; f++) { - int64_t my_task = Task [f] ; - int64_t parent_task = Task [Parent [f]] ; + Int my_task = Task [f] ; + Int parent_task = Task [Parent [f]] ; PR (("f %ld Task %ld parent %ld, Task of parent %ld\n", f, my_task, Parent [f], Task [Parent [f]])) ; if (my_task != parent_task) @@ -1507,7 +1505,7 @@ spqr_symbolic *spqr_analyze spqr_cumsum (ntasks, TaskChildp) ; // create the child lists - for (int64_t child_task = 0 ; child_task < ntasks ; child_task++) + for (Int child_task = 0 ; child_task < ntasks ; child_task++) { // place the child c in the list of its parent parent = TaskParent [child_task] ; @@ -1566,12 +1564,12 @@ spqr_symbolic *spqr_analyze TaskStack [task] = EMPTY ; } - for (int64_t task_start = 0 ; task_start < ntasks ; task_start++) + for (Int task_start = 0 ; task_start < ntasks ; task_start++) { if (TaskStack [task_start] == EMPTY) { // start a new stack - int64_t s = ns++ ; + Int s = ns++ ; for (task = task_start ; task != EMPTY && TaskStack [task] == EMPTY ; task = TaskParent [task]) @@ -1593,7 +1591,7 @@ spqr_symbolic *spqr_analyze for (task = 0 ; task < ntasks ; task++) { - int64_t s = TaskStack [task] ; + Int s = TaskStack [task] ; PR (("\nTask %ld children:\n", task)) ; for (p = TaskChildp [task] ; p < TaskChildp [task+1] ; p++) { @@ -1615,11 +1613,11 @@ spqr_symbolic *spqr_analyze // temporary workspace: // Stack_stack (s): current stack usage - Stack_stack = (int64_t *) cholmod_l_calloc (ns+2, sizeof (int64_t), cc) ; + Stack_stack = (Int *) spqr_calloc (ns+2, sizeof (Int), cc) ; // permanent part of QRsym: // Stack_maxstack (s): peak stack usage if H not kept - Stack_maxstack = (int64_t *) cholmod_l_calloc (ns+2, sizeof (int64_t), cc) ; + Stack_maxstack = (Int *) spqr_calloc (ns+2, sizeof (Int), cc) ; // FUTURE: keep track of maxfn for each stack @@ -1629,7 +1627,7 @@ spqr_symbolic *spqr_analyze { // out of memory spqr_freesym (&QRsym, cc) ; - FREE_WORK ; + FREE_WORK_ANALYZE ; return (NULL) ; } @@ -1645,7 +1643,7 @@ spqr_symbolic *spqr_analyze // --------------------------------------------------------------------- f = Post [kf] ; - int64_t s = On_stack [f] ; + Int s = On_stack [f] ; PR (("\n----------------------- front: %ld on stack %ld\n", f, s)) ; ASSERT (f >= 0 && f < nf) ; ASSERT (s >= 0 && s < ns) ; @@ -1725,7 +1723,7 @@ spqr_symbolic *spqr_analyze cm_min = MAX (fm - rm, 0) ; cm_min = MIN (cm_min, cn) ; // exact # rows in C block - // int64_t overflow cannot occur: + // Int overflow cannot occur: csize_max = cm_max*(cm_max+1)/2 + cm_max*(cn-cm_max) ; csize_min = cm_min*(cm_min+1)/2 + cm_min*(cn-cm_min) ; csize = do_rank_detection ? csize_max : csize_min ; @@ -1755,8 +1753,8 @@ spqr_symbolic *spqr_analyze // estimate stack usage for parallel case // --------------------------------------------------------------------- - int64_t ss = Stack_stack [s] ; // current size of stack - int64_t sm = Stack_maxstack [s] ; // max size of stack + Int ss = Stack_stack [s] ; // current size of stack + Int sm = Stack_maxstack [s] ; // max size of stack PR (("current ss: %ld fsize %ld ctot %ld csize %ld rsize %ld\n", ss, fsize, ctot, csize, rsize)) ; @@ -1798,6 +1796,46 @@ spqr_symbolic *spqr_analyze // free workspace and return result // ------------------------------------------------------------------------- - FREE_WORK ; + FREE_WORK_ANALYZE ; return (QRsym) ; } + +template spqr_symbolic *spqr_analyze +( + // inputs, not modified + cholmod_sparse *A, + int ordering, // all options available + int32_t *Quser, // user provided ordering, if given (may be NULL) + + int do_rank_detection, // if TRUE, then rank deficient matrices may be + // considered during numerical factorization, + // with tol >= 0 (tol < 0 is also allowed). If FALSE, then the tol + // parameter is ignored by the numerical factorization, and no rank + // detection is performed. Ignored when using GPU acceleration + // (no rank detection is performed in that case). + + int keepH, // if TRUE, keep the Householder vectors + + // workspace and parameters + cholmod_common *cc +) ; + +template spqr_symbolic *spqr_analyze +( + // inputs, not modified + cholmod_sparse *A, + int ordering, // all options available + int64_t *Quser, // user provided ordering, if given (may be NULL) + + int do_rank_detection, // if TRUE, then rank deficient matrices may be + // considered during numerical factorization, + // with tol >= 0 (tol < 0 is also allowed). If FALSE, then the tol + // parameter is ignored by the numerical factorization, and no rank + // detection is performed. Ignored when using GPU acceleration + // (no rank detection is performed in that case). + + int keepH, // if TRUE, keep the Householder vectors + + // workspace and parameters + cholmod_common *cc +) ; diff --git a/SPQR/Source/spqr_append.cpp b/SPQR/Source/spqr_append.cpp index 429ab0118..944ac7fd8 100644 --- a/SPQR/Source/spqr_append.cpp +++ b/SPQR/Source/spqr_append.cpp @@ -7,30 +7,30 @@ //------------------------------------------------------------------------------ +#include "spqr.hpp" + // Appends a dense column X onto a sparse matrix A, increasing nnzmax(A) as // needed. The column pointer array is not modified; it must be large enough // to accomodate the new column. -#include "spqr.hpp" - -template int spqr_append // TRUE/FALSE if OK or not +template int spqr_append // TRUE/FALSE if OK or not ( // inputs, not modified Entry *X, // size m-by-1 - int64_t *P, // size m, or NULL; permutation to apply to X. + Int *P, // size m, or NULL; permutation to apply to X. // P [k] = i if row k of A is row i of X // input/output cholmod_sparse *A, // size m-by-(A->ncol) where A->ncol > n must hold - int64_t *p_n, // n = # of columns of A so far; increased one + Int *p_n, // n = # of columns of A so far; increased one // workspace and parameters cholmod_common *cc ) { Entry *Ax ; - int64_t *Ai, *Ap ; - int64_t nzmax, nz, i, k, nznew, n, m, nz2 ; + Int *Ai, *Ap ; + Int nzmax, nz, i, k, nznew, n, m, nz2 ; int ok = TRUE ; // ------------------------------------------------------------------------- @@ -39,7 +39,7 @@ template int spqr_append // TRUE/FALSE if OK or not m = A->nrow ; n = *p_n ; - Ap = (int64_t *) A->p ; + Ap = (Int *) A->p ; if (m == 0) { @@ -50,7 +50,7 @@ template int spqr_append // TRUE/FALSE if OK or not return (TRUE) ; } - Ai = (int64_t *) A->i ; + Ai = (Int *) A->i ; Ax = (Entry *) A->x ; nzmax = A->nzmax ; // current nzmax(A) nz = Ap [n] ; // current nnz(A) @@ -98,16 +98,16 @@ template int spqr_append // TRUE/FALSE if OK or not { // Ai and Ax are not big enough; increase their size. // nznew = 2*nzmax + m ; - nznew = spqr_mult (2, nzmax, &ok) ; + nznew = spqr_mult (2, nzmax, &ok) ; nznew = spqr_add (nznew, m, &ok) ; - if (!ok || !cholmod_l_reallocate_sparse (nznew, A, cc)) + if (!ok || !spqr_reallocate_sparse (nznew, A, cc)) { // out of memory ERROR (CHOLMOD_OUT_OF_MEMORY, "out of memory") ; return (FALSE) ; } // Ai and Ax have moved, reaquire the pointers - Ai = (int64_t *) A->i ; + Ai = (Int *) A->i ; Ax = (Entry *) A->x ; PR (("reallocated from %ld to %ld\n", nzmax, nznew)) ; nzmax = nznew ; @@ -134,36 +134,61 @@ template int spqr_append // TRUE/FALSE if OK or not return (TRUE) ; } +template int spqr_append // TRUE/FALSE if OK or not +( + // inputs, not modified + double *X, // size m-by-1 + int32_t *P, // size m, or NULL; permutation to apply to X. + // P [k] = i if row k of A is row i of X + + // input/output + cholmod_sparse *A, // size m-by-(A->ncol) where A->ncol > n must hold + int32_t *p_n, // n = # of columns of A so far; increased one -// ============================================================================= + // workspace and parameters + cholmod_common *cc +) ; -template int spqr_append +template int spqr_append // TRUE/FALSE if OK or not ( // inputs, not modified - double *X, // size m-by-1 - int64_t *P, // size m, or NULL; permutation to apply to X. - // P [k] = i if row k of A is row i of X + Complex *X, // size m-by-1 + int32_t *P, // size m, or NULL; permutation to apply to X. + // P [k] = i if row k of A is row i of X // input/output - cholmod_sparse *A, // size m-by-n2 where n2 > n - int64_t *p_n, // number of columns of A; increased by one + cholmod_sparse *A, // size m-by-(A->ncol) where A->ncol > n must hold + int32_t *p_n, // n = # of columns of A so far; increased one // workspace and parameters cholmod_common *cc ) ; -// ============================================================================= +template int spqr_append // TRUE/FALSE if OK or not +( + // inputs, not modified + double *X, // size m-by-1 + int64_t *P, // size m, or NULL; permutation to apply to X. + // P [k] = i if row k of A is row i of X + + // input/output + cholmod_sparse *A, // size m-by-(A->ncol) where A->ncol > n must hold + int64_t *p_n, // n = # of columns of A so far; increased one -template int spqr_append + // workspace and parameters + cholmod_common *cc +) ; + +template int spqr_append // TRUE/FALSE if OK or not ( // inputs, not modified - Complex *X, // size m-by-1 - int64_t *P, // size m, or NULL; permutation to apply to X. - // P [k] = i if row k of A is row i of X + Complex *X, // size m-by-1 + int64_t *P, // size m, or NULL; permutation to apply to X. + // P [k] = i if row k of A is row i of X // input/output - cholmod_sparse *A, // size m-by-n2 where n2 > n - int64_t *p_n, // number of columns of A; increased by one + cholmod_sparse *A, // size m-by-(A->ncol) where A->ncol > n must hold + int64_t *p_n, // n = # of columns of A so far; increased one // workspace and parameters cholmod_common *cc diff --git a/SPQR/Source/spqr_assemble.cpp b/SPQR/Source/spqr_assemble.cpp index 5c6ac2e6d..99a7182d2 100644 --- a/SPQR/Source/spqr_assemble.cpp +++ b/SPQR/Source/spqr_assemble.cpp @@ -229,46 +229,46 @@ #include "spqr.hpp" -template void spqr_assemble +template void spqr_assemble ( /* inputs, not modified */ - int64_t f, /* front to assemble F */ - int64_t fm, /* number of rows of F */ + Int f, /* front to assemble F */ + Int fm, /* number of rows of F */ int keepH, /* if TRUE, then construct row pattern of H */ - int64_t *Super, - int64_t *Rp, - int64_t *Rj, - int64_t *Sp, - int64_t *Sj, - int64_t *Sleft, - int64_t *Child, - int64_t *Childp, + Int *Super, + Int *Rp, + Int *Rj, + Int *Sp, + Int *Sj, + Int *Sleft, + Int *Child, + Int *Childp, Entry *Sx, - int64_t *Fmap, - int64_t *Cm, + Int *Fmap, + Int *Cm, Entry **Cblock, #ifndef NDEBUG char *Rdead, #endif - int64_t *Hr, + Int *Hr, /* input/output */ - int64_t *Stair, - int64_t *Hii, /* if keepH, construct list of row indices for F */ + Int *Stair, + Int *Hii, /* if keepH, construct list of row indices for F */ // input only - int64_t *Hip, + Int *Hip, /* outputs, not defined on input */ Entry *F, /* workspace, not defined on input or output */ - int64_t *Cmap + Int *Cmap ) { Entry *Fi, *Fj, *C ; - int64_t k, fsize, fn, col1, col2, p, p1, p2, fp, j, leftcol, row, col, i, + Int k, fsize, fn, col1, col2, p, p1, p2, fp, j, leftcol, row, col, i, cm, cn, ci, cj, c, pc, fnc, fpc, rmc ; - int64_t *Hi = NULL, *Hichild = NULL ; + Int *Hi = NULL, *Hichild = NULL ; /* ---------------------------------------------------------------------- */ /* get the front F */ @@ -365,7 +365,7 @@ template void spqr_assemble rmc = Hr [c] ; #ifndef NDEBUG { - int64_t rmc2 = 0 ; + Int rmc2 = 0 ; for (j = Super [c] ; j < Super [c+1] ; j++) { if (!Rdead [j]) @@ -445,11 +445,77 @@ template void spqr_assemble /* the Stair is now complete */ ASSERT (Stair [fn-1] == fm) ; } +template void spqr_assemble +( + /* inputs, not modified */ + int32_t f, /* front to assemble F */ + int32_t fm, /* number of rows of F */ + int keepH, /* if TRUE, then construct row pattern of H */ + int32_t *Super, + int32_t *Rp, + int32_t *Rj, + int32_t *Sp, + int32_t *Sj, + int32_t *Sleft, + int32_t *Child, + int32_t *Childp, + double *Sx, + int32_t *Fmap, + int32_t *Cm, + double **Cblock, +#ifndef NDEBUG + char *Rdead, +#endif + int32_t *Hr, + /* input/output */ + int32_t *Stair, + int32_t *Hii, /* if keepH, construct list of row indices for F */ + // input only + int32_t *Hip, -/* ========================================================================== */ + /* outputs, not defined on input */ + double *F, -template void spqr_assemble + /* workspace, not defined on input or output */ + int32_t *Cmap +) ; +template void spqr_assemble +( + /* inputs, not modified */ + int32_t f, /* front to assemble F */ + int32_t fm, /* number of rows of F */ + int keepH, /* if TRUE, then construct row pattern of H */ + int32_t *Super, + int32_t *Rp, + int32_t *Rj, + int32_t *Sp, + int32_t *Sj, + int32_t *Sleft, + int32_t *Child, + int32_t *Childp, + Complex *Sx, + int32_t *Fmap, + int32_t *Cm, + Complex **Cblock, +#ifndef NDEBUG + char *Rdead, +#endif + int32_t *Hr, + + /* input/output */ + int32_t *Stair, + int32_t *Hii, /* if keepH, construct list of row indices for F */ + // input only + int32_t *Hip, + + /* outputs, not defined on input */ + Complex *F, + + /* workspace, not defined on input or output */ + int32_t *Cmap +) ; +template void spqr_assemble ( /* inputs, not modified */ int64_t f, /* front to assemble F */ @@ -484,10 +550,7 @@ template void spqr_assemble /* workspace, not defined on input or output */ int64_t *Cmap ) ; - -/* ========================================================================== */ - -template void spqr_assemble +template void spqr_assemble ( /* inputs, not modified */ int64_t f, /* front to assemble F */ diff --git a/SPQR/Source/spqr_cholmod_wrappers.cpp b/SPQR/Source/spqr_cholmod_wrappers.cpp new file mode 100644 index 000000000..37761c9b8 --- /dev/null +++ b/SPQR/Source/spqr_cholmod_wrappers.cpp @@ -0,0 +1,1004 @@ +// ============================================================================= +// === spqr_cholmod_wrappers =================================================== +// ============================================================================= + +// SPQR, Copyright (c) 2008-2023, Timothy A Davis. All Rights Reserved. +// SPDX-License-Identifier: GPL-2.0+ + +//------------------------------------------------------------------------------ +// wrappers for calling CHOLMOD methods +//------------------------------------------------------------------------------ + +#include "spqr.hpp" + +//------------------------------------------------------------------------------ +// spqr_start +//------------------------------------------------------------------------------ + +template <> int spqr_start +( + cholmod_common *Common +) +{ + return cholmod_start (Common) ; +} + +template <> int spqr_start +( + cholmod_common *Common +) +{ + return cholmod_l_start (Common) ; +} + +//------------------------------------------------------------------------------ +// spqr_finish +//------------------------------------------------------------------------------ + +template <> int spqr_finish +( + cholmod_common *Common +) +{ + return cholmod_finish (Common) ; +} + +template <> int spqr_finish +( + cholmod_common *Common +) +{ + return cholmod_l_finish (Common) ; +} + +//------------------------------------------------------------------------------ +// spqr_malloc +//------------------------------------------------------------------------------ + +template <> void *spqr_malloc (size_t n, size_t size, cholmod_common *Common) +{ + return cholmod_l_malloc (n, size, Common) ; +} +template <> void *spqr_malloc (size_t n, size_t size, cholmod_common *Common) +{ + return cholmod_malloc (n, size, Common) ; +} + +//------------------------------------------------------------------------------ +// spqr_calloc +//------------------------------------------------------------------------------ + +template <> void *spqr_calloc (size_t n, size_t size, cholmod_common *Common) +{ + return cholmod_l_calloc (n, size, Common) ; +} +template <> void *spqr_calloc (size_t n, size_t size, cholmod_common *Common) +{ + return cholmod_calloc (n, size, Common) ; +} + +//------------------------------------------------------------------------------ +// spqr_free +//------------------------------------------------------------------------------ + +template <> void *spqr_free (size_t n, size_t size, void *p, cholmod_common *Common) +{ + return cholmod_l_free (n, size, p, Common) ; +} +template <> void *spqr_free (size_t n, size_t size, void *p, cholmod_common *Common) +{ + return cholmod_free (n, size, p, Common) ; +} + +//------------------------------------------------------------------------------ +// spqr_realloc +//------------------------------------------------------------------------------ + +template <> void *spqr_realloc /* returns pointer to reallocated block */ +( + /* ---- input ---- */ + size_t nnew, /* requested # of items in reallocated block */ + size_t size, /* size of each item */ + /* ---- in/out --- */ + void *p, /* block of memory to realloc */ + size_t *n, /* current size on input, nnew on output if successful*/ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_realloc (nnew, size, p, n, Common) ; +} +template <> void *spqr_realloc /* returns pointer to reallocated block */ +( + /* ---- input ---- */ + size_t nnew, /* requested # of items in reallocated block */ + size_t size, /* size of each item */ + /* ---- in/out --- */ + void *p, /* block of memory to realloc */ + size_t *n, /* current size on input, nnew on output if successful*/ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_l_realloc (nnew, size, p, n, Common) ; +} + +//------------------------------------------------------------------------------ +// spqr_allocate_sparse +//------------------------------------------------------------------------------ + +template <> cholmod_sparse *spqr_allocate_sparse +( + /* ---- input ---- */ + size_t nrow, /* # of rows of A */ + size_t ncol, /* # of columns of A */ + size_t nzmax, /* max # of nonzeros of A */ + int sorted, /* TRUE if columns of A sorted, FALSE otherwise */ + int packed, /* TRUE if A will be packed, FALSE otherwise */ + int stype, /* stype of A */ + int xtype, /* CHOLMOD_PATTERN, _REAL, _COMPLEX, or _ZOMPLEX */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_allocate_sparse (nrow, ncol, nzmax, sorted, packed, stype, xtype, Common) ; +} +template <> cholmod_sparse *spqr_allocate_sparse +( + /* ---- input ---- */ + size_t nrow, /* # of rows of A */ + size_t ncol, /* # of columns of A */ + size_t nzmax, /* max # of nonzeros of A */ + int sorted, /* TRUE if columns of A sorted, FALSE otherwise */ + int packed, /* TRUE if A will be packed, FALSE otherwise */ + int stype, /* stype of A */ + int xtype, /* CHOLMOD_PATTERN, _REAL, _COMPLEX, or _ZOMPLEX */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_l_allocate_sparse (nrow, ncol, nzmax, sorted, packed, stype, xtype, Common) ; +} + +//------------------------------------------------------------------------------ +// spqr_free_sparse +//------------------------------------------------------------------------------ + +template <> int spqr_free_sparse +( + /* ---- in/out --- */ + cholmod_sparse **A, /* matrix to deallocate, NULL on output */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_free_sparse (A, Common) ; +} + +template <> int spqr_free_sparse +( + /* ---- in/out --- */ + cholmod_sparse **A, /* matrix to deallocate, NULL on output */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_l_free_sparse (A, Common) ; +} + +//------------------------------------------------------------------------------ +// spqr_reallocate_sparse +//------------------------------------------------------------------------------ + +template <> int spqr_reallocate_sparse +( + /* ---- input ---- */ + size_t nznew, /* new # of entries in A */ + /* ---- in/out --- */ + cholmod_sparse *A, /* matrix to reallocate */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_reallocate_sparse (nznew, A, Common) ; +} +template <> int spqr_reallocate_sparse +( + /* ---- input ---- */ + size_t nznew, /* new # of entries in A */ + /* ---- in/out --- */ + cholmod_sparse *A, /* matrix to reallocate */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_l_reallocate_sparse (nznew, A, Common) ; +} + +//------------------------------------------------------------------------------ +// spqr_allocate_dense +//------------------------------------------------------------------------------ + +template <> cholmod_dense *spqr_allocate_dense +( + /* ---- input ---- */ + size_t nrow, /* # of rows of matrix */ + size_t ncol, /* # of columns of matrix */ + size_t d, /* leading dimension */ + int xtype, /* CHOLMOD_REAL, _COMPLEX, or _ZOMPLEX */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_allocate_dense (nrow, ncol, d, xtype, Common) ; +} + +template <> cholmod_dense *spqr_allocate_dense +( + /* ---- input ---- */ + size_t nrow, /* # of rows of matrix */ + size_t ncol, /* # of columns of matrix */ + size_t d, /* leading dimension */ + int xtype, /* CHOLMOD_REAL, _COMPLEX, or _ZOMPLEX */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_l_allocate_dense (nrow, ncol, d, xtype, Common) ; +} + +//------------------------------------------------------------------------------ +// spqr_free_dense +//------------------------------------------------------------------------------ + +template <> int spqr_free_dense +( + /* ---- in/out --- */ + cholmod_dense **X, /* dense matrix to deallocate, NULL on output */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_free_dense (X, Common) ; +} +template <> int spqr_free_dense +( + /* ---- in/out --- */ + cholmod_dense **X, /* dense matrix to deallocate, NULL on output */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_l_free_dense (X, Common) ; +} + +//------------------------------------------------------------------------------ +// spqr_allocate_factor +//------------------------------------------------------------------------------ + +template <> cholmod_factor *spqr_allocate_factor +( + /* ---- input ---- */ + size_t n, /* L is n-by-n */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_allocate_factor (n, Common) ; +} +template <> cholmod_factor *spqr_allocate_factor +( + /* ---- input ---- */ + size_t n, /* L is n-by-n */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_l_allocate_factor (n, Common) ; +} + +//------------------------------------------------------------------------------ +// spqr_free_factor +//------------------------------------------------------------------------------ + +template <> int spqr_free_factor +( + /* ---- in/out --- */ + cholmod_factor **L, /* factor to free, NULL on output */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_free_factor (L, Common) ; +} +template <> int spqr_free_factor +( + /* ---- in/out --- */ + cholmod_factor **L, /* factor to free, NULL on output */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_l_free_factor (L, Common) ; +} + +//------------------------------------------------------------------------------ +// spqr_allocate_work +//------------------------------------------------------------------------------ + +template <> int spqr_allocate_work +( + /* ---- input ---- */ + size_t nrow, /* size: Common->Flag (nrow), Common->Head (nrow+1) */ + size_t iworksize, /* size of Common->Iwork */ + size_t xworksize, /* size of Common->Xwork */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_allocate_work (nrow, iworksize, xworksize, Common) ; +} +template <> int spqr_allocate_work +( + /* ---- input ---- */ + size_t nrow, /* size: Common->Flag (nrow), Common->Head (nrow+1) */ + size_t iworksize, /* size of Common->Iwork */ + size_t xworksize, /* size of Common->Xwork */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_l_allocate_work (nrow, iworksize, xworksize, Common) ; +} + +//------------------------------------------------------------------------------ +// spqr_amd +//------------------------------------------------------------------------------ + +template <> int spqr_amd +( + cholmod_sparse *A, int64_t *fset, size_t fsize, int64_t *Perm, cholmod_common *Common +) +{ + return cholmod_l_amd (A, fset, fsize, Perm, Common) ; +} +template <> int spqr_amd +( + cholmod_sparse *A, int32_t *fset, size_t fsize, int32_t *Perm, cholmod_common *Common +) +{ + return cholmod_amd (A, fset, fsize, Perm, Common) ; +} + +//------------------------------------------------------------------------------ +// spqr_metis +//------------------------------------------------------------------------------ + +template <> int spqr_metis +( + cholmod_sparse *A, int64_t *fset, size_t fsize, int postorder, int64_t *Perm, cholmod_common *Common +) +{ + return cholmod_l_metis (A, fset, fsize, postorder, Perm, Common) ; +} + +template <> int spqr_metis +( + cholmod_sparse *A, int32_t *fset, size_t fsize, int postorder, int32_t *Perm, cholmod_common *Common +) +{ + return cholmod_metis (A, fset, fsize, postorder, Perm, Common) ; +} + +//------------------------------------------------------------------------------ +// spqr_transpose +//------------------------------------------------------------------------------ + +template <> cholmod_sparse *spqr_transpose +( + cholmod_sparse *A, int values, cholmod_common *Common +) +{ + return cholmod_l_transpose (A, values, Common) ; +} +template <> cholmod_sparse *spqr_transpose +( + cholmod_sparse *A, int values, cholmod_common *Common +) +{ + return cholmod_transpose (A, values, Common) ; +} + +//------------------------------------------------------------------------------ +// spqr_analyze_p2 +//------------------------------------------------------------------------------ + +template <> +cholmod_factor *spqr_analyze_p2 +( + /* ---- input ---- */ + int for_whom, /* FOR_SPQR (0): for SPQR but not GPU-accelerated + FOR_CHOLESKY (1): for Cholesky (GPU or not) + FOR_SPQRGPU (2): for SPQR with GPU acceleration */ + cholmod_sparse *A, /* matrix to order and analyze */ + int32_t *UserPerm, /* user-provided permutation, size A->nrow */ + int32_t *fset, /* subset of 0:(A->ncol)-1 */ + size_t fsize, /* size of fset */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_analyze_p2 (for_whom, A, UserPerm, fset, fsize, Common) ; +} +template <> +cholmod_factor *spqr_analyze_p2 +( + /* ---- input ---- */ + int for_whom, /* FOR_SPQR (0): for SPQR but not GPU-accelerated + FOR_CHOLESKY (1): for Cholesky (GPU or not) + FOR_SPQRGPU (2): for SPQR with GPU acceleration */ + cholmod_sparse *A, /* matrix to order and analyze */ + int64_t *UserPerm, /* user-provided permutation, size A->nrow */ + int64_t *fset, /* subset of 0:(A->ncol)-1 */ + size_t fsize, /* size of fset */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_l_analyze_p2 (for_whom, A, UserPerm, fset, fsize, Common) ; +} + +//------------------------------------------------------------------------------ +// spqr_colamd +//------------------------------------------------------------------------------ + +template <> int spqr_colamd +( + /* ---- input ---- */ + cholmod_sparse *A, /* matrix to order */ + int32_t *fset, /* subset of 0:(A->ncol)-1 */ + size_t fsize, /* size of fset */ + int postorder, /* if TRUE, follow with a coletree postorder */ + /* ---- output --- */ + int32_t *Perm, /* size A->nrow, output permutation */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_colamd (A, fset, fsize, postorder, Perm, Common) ; +} +template <> int spqr_colamd +( + /* ---- input ---- */ + cholmod_sparse *A, /* matrix to order */ + int64_t *fset, /* subset of 0:(A->ncol)-1 */ + size_t fsize, /* size of fset */ + int postorder, /* if TRUE, follow with a coletree postorder */ + /* ---- output --- */ + int64_t *Perm, /* size A->nrow, output permutation */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_l_colamd (A, fset, fsize, postorder, Perm, Common) ; +} + +//------------------------------------------------------------------------------ +// spqr_postorder +//------------------------------------------------------------------------------ + +template <> int32_t spqr_postorder /* return # of nodes postordered */ +( + /* ---- input ---- */ + int32_t *Parent, /* size n. Parent [j] = p if p is the parent of j */ + size_t n, + int32_t *Weight_p, /* size n, optional. Weight [j] is weight of node j */ + /* ---- output --- */ + int32_t *Post, /* size n. Post [k] = j is kth in postordered tree */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_postorder (Parent, n, Weight_p, Post, Common) ; +} +template <> int64_t spqr_postorder /* return # of nodes postordered */ +( + /* ---- input ---- */ + int64_t *Parent, /* size n. Parent [j] = p if p is the parent of j */ + size_t n, + int64_t *Weight_p, /* size n, optional. Weight [j] is weight of node j */ + /* ---- output --- */ + int64_t *Post, /* size n. Post [k] = j is kth in postordered tree */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_l_postorder (Parent, n, Weight_p, Post, Common) ; +} + +//------------------------------------------------------------------------------ +// spqr_nnz +//------------------------------------------------------------------------------ + +template <> int64_t spqr_nnz +( + cholmod_sparse *A, + cholmod_common *Common +) +{ + return cholmod_l_nnz(A, Common) ; +} +template <> int64_t spqr_nnz +( + cholmod_sparse *A, + cholmod_common *Common +) +{ + return cholmod_nnz(A, Common) ; +} + +//------------------------------------------------------------------------------ +// spqr_dense_to_sparse +//------------------------------------------------------------------------------ + +template <> cholmod_sparse *spqr_dense_to_sparse +( + /* ---- input ---- */ + cholmod_dense *X, /* matrix to copy */ + int values, /* TRUE if values to be copied, FALSE otherwise */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_dense_to_sparse(X, values, Common) ; +} +template <> cholmod_sparse *spqr_dense_to_sparse +( + /* ---- input ---- */ + cholmod_dense *X, /* matrix to copy */ + int values, /* TRUE if values to be copied, FALSE otherwise */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_l_dense_to_sparse(X, values, Common) ; +} + +//------------------------------------------------------------------------------ +// spqr_sparse_to_dense +//------------------------------------------------------------------------------ + +template <> cholmod_dense *spqr_sparse_to_dense +( + /* ---- input ---- */ + cholmod_sparse *A, /* matrix to copy */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_sparse_to_dense (A, Common) ; +} +template <> cholmod_dense *spqr_sparse_to_dense +( + /* ---- input ---- */ + cholmod_sparse *A, /* matrix to copy */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_l_sparse_to_dense (A, Common) ; +} + +//------------------------------------------------------------------------------ +// spqr_speye +//------------------------------------------------------------------------------ + +template <> cholmod_sparse *spqr_speye +( + /* ---- input ---- */ + size_t nrow, /* # of rows of A */ + size_t ncol, /* # of columns of A */ + int xtype, /* CHOLMOD_PATTERN, _REAL, _COMPLEX, or _ZOMPLEX */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_l_speye(nrow, ncol, xtype, Common) ; +} +template <> cholmod_sparse *spqr_speye +( + /* ---- input ---- */ + size_t nrow, /* # of rows of A */ + size_t ncol, /* # of columns of A */ + int xtype, /* CHOLMOD_PATTERN, _REAL, _COMPLEX, or _ZOMPLEX */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_speye(nrow, ncol, xtype, Common) ; +} + +//------------------------------------------------------------------------------ +// spqr_free_work +//------------------------------------------------------------------------------ + +template <> int spqr_free_work +( + cholmod_common *Common +) +{ + return cholmod_free_work (Common) ; +} + +template <> int spqr_free_work +( + cholmod_common *Common +) +{ + return cholmod_l_free_work (Common) ; +} + +//------------------------------------------------------------------------------ +// spqr_zeros +//------------------------------------------------------------------------------ + +template <> cholmod_dense *spqr_zeros +( + /* ---- input ---- */ + size_t nrow, /* # of rows of matrix */ + size_t ncol, /* # of columns of matrix */ + int xtype, /* CHOLMOD_REAL, _COMPLEX, or _ZOMPLEX */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_zeros (nrow, ncol, xtype, Common) ; +} + +template <> cholmod_dense *spqr_zeros +( + /* ---- input ---- */ + size_t nrow, /* # of rows of matrix */ + size_t ncol, /* # of columns of matrix */ + int xtype, /* CHOLMOD_REAL, _COMPLEX, or _ZOMPLEX */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_l_zeros (nrow, ncol, xtype, Common) ; +} + +//------------------------------------------------------------------------------ +// spqr_ones +//------------------------------------------------------------------------------ + +template <> cholmod_dense *spqr_ones +( + /* ---- input ---- */ + size_t nrow, /* # of rows of matrix */ + size_t ncol, /* # of columns of matrix */ + int xtype, /* CHOLMOD_REAL, _COMPLEX, or _ZOMPLEX */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_ones (nrow, ncol, xtype, Common) ; +} + +template <> cholmod_dense *spqr_ones +( + /* ---- input ---- */ + size_t nrow, /* # of rows of matrix */ + size_t ncol, /* # of columns of matrix */ + int xtype, /* CHOLMOD_REAL, _COMPLEX, or _ZOMPLEX */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_l_ones (nrow, ncol, xtype, Common) ; +} + +//------------------------------------------------------------------------------ +// spqr_ssmult +//------------------------------------------------------------------------------ + +template <> cholmod_sparse *spqr_ssmult +( + /* ---- input ---- */ + cholmod_sparse *A, /* left matrix to multiply */ + cholmod_sparse *B, /* right matrix to multiply */ + int stype, /* requested stype of C */ + int values, /* TRUE: do numerical values, FALSE: pattern only */ + int sorted, /* if TRUE then return C with sorted columns */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_ssmult (A, B, stype, values, sorted, Common) ; +} + +template <> cholmod_sparse *spqr_ssmult +( + /* ---- input ---- */ + cholmod_sparse *A, /* left matrix to multiply */ + cholmod_sparse *B, /* right matrix to multiply */ + int stype, /* requested stype of C */ + int values, /* TRUE: do numerical values, FALSE: pattern only */ + int sorted, /* if TRUE then return C with sorted columns */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_l_ssmult (A, B, stype, values, sorted, Common) ; +} + +//------------------------------------------------------------------------------ +// spqr_ssadd +//------------------------------------------------------------------------------ + +template <> cholmod_sparse *spqr_ssadd +( + /* ---- input ---- */ + cholmod_sparse *A, /* matrix to add */ + cholmod_sparse *B, /* matrix to add */ + double alpha [2], /* scale factor for A */ + double beta [2], /* scale factor for B */ + int values, /* if TRUE compute the numerical values of C */ + int sorted, /* if TRUE, sort columns of C */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_add (A, B, alpha, beta, values, sorted, Common) ; +} + +template <> cholmod_sparse *spqr_ssadd +( + /* ---- input ---- */ + cholmod_sparse *A, /* matrix to add */ + cholmod_sparse *B, /* matrix to add */ + double alpha [2], /* scale factor for A */ + double beta [2], /* scale factor for B */ + int values, /* if TRUE compute the numerical values of C */ + int sorted, /* if TRUE, sort columns of C */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_l_add (A, B, alpha, beta, values, sorted, Common) ; +} + +//------------------------------------------------------------------------------ +// spqr_sdmult +//------------------------------------------------------------------------------ + +template <> int spqr_sdmult +( + /* ---- input ---- */ + cholmod_sparse *A, /* sparse matrix to multiply */ + int transpose, /* use A if 0, or A' otherwise */ + double alpha [2], /* scale factor for A */ + double beta [2], /* scale factor for Y */ + cholmod_dense *X, /* dense matrix to multiply */ + /* ---- in/out --- */ + cholmod_dense *Y, /* resulting dense matrix */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_sdmult (A, transpose, alpha, beta, X, Y, Common) ; +} + +template <> int spqr_sdmult +( + /* ---- input ---- */ + cholmod_sparse *A, /* sparse matrix to multiply */ + int transpose, /* use A if 0, or A' otherwise */ + double alpha [2], /* scale factor for A */ + double beta [2], /* scale factor for Y */ + cholmod_dense *X, /* dense matrix to multiply */ + /* ---- in/out --- */ + cholmod_dense *Y, /* resulting dense matrix */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_l_sdmult (A, transpose, alpha, beta, X, Y, Common) ; +} + +//------------------------------------------------------------------------------ +// spqr_norm_sparse +//------------------------------------------------------------------------------ + +template <> double spqr_norm_sparse +( + /* ---- input ---- */ + cholmod_sparse *A, /* matrix to compute the norm of */ + int norm, /* type of norm: 0: inf. norm, 1: 1-norm */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_norm_sparse (A, norm, Common) ; +} + + +template <> double spqr_norm_sparse +( + /* ---- input ---- */ + cholmod_sparse *A, /* matrix to compute the norm of */ + int norm, /* type of norm: 0: inf. norm, 1: 1-norm */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_l_norm_sparse (A, norm, Common) ; +} + +//------------------------------------------------------------------------------ +// spqr_norm_dense +//------------------------------------------------------------------------------ + +template <> double spqr_norm_dense +( + /* ---- input ---- */ + cholmod_dense *X, /* matrix to compute the norm of */ + int norm, /* type of norm: 0: inf. norm, 1: 1-norm, 2: 2-norm */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_norm_dense (X, norm, Common) ; +} + +template <> double spqr_norm_dense +( + /* ---- input ---- */ + cholmod_dense *X, /* matrix to compute the norm of */ + int norm, /* type of norm: 0: inf. norm, 1: 1-norm, 2: 2-norm */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_l_norm_dense (X, norm, Common) ; +} + +//------------------------------------------------------------------------------ +// spqr_copy_dense +//------------------------------------------------------------------------------ + +template <> cholmod_dense *spqr_copy_dense +( + /* ---- input ---- */ + cholmod_dense *X, /* matrix to copy */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_copy_dense (X, Common) ; +} + +template <> cholmod_dense *spqr_copy_dense +( + /* ---- input ---- */ + cholmod_dense *X, /* matrix to copy */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_l_copy_dense (X, Common) ; +} + +//------------------------------------------------------------------------------ +// spqr_copy +//------------------------------------------------------------------------------ + +template <> cholmod_sparse *spqr_copy +( + /* ---- input ---- */ + cholmod_sparse *A, /* matrix to copy */ + int stype, /* requested stype of C */ + int mode, /* >0: numerical, 0: pattern, <0: pattern (no diag) */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_copy (A, stype, mode, Common) ; +} + +template <> cholmod_sparse *spqr_copy +( + /* ---- input ---- */ + cholmod_sparse *A, /* matrix to copy */ + int stype, /* requested stype of C */ + int mode, /* >0: numerical, 0: pattern, <0: pattern (no diag) */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_l_copy (A, stype, mode, Common) ; +} + +//------------------------------------------------------------------------------ +// spqr_xtype +//------------------------------------------------------------------------------ + +template <> int spqr_sparse_xtype +( + /* ---- input ---- */ + int to_xtype, /* requested xtype (pattern, real, complex, zomplex) */ + /* ---- in/out --- */ + cholmod_sparse *A, /* sparse matrix to change */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_sparse_xtype (to_xtype, A, Common) ; +} + +template <> int spqr_sparse_xtype +( + /* ---- input ---- */ + int to_xtype, /* requested xtype (pattern, real, complex, zomplex) */ + /* ---- in/out --- */ + cholmod_sparse *A, /* sparse matrix to change */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_l_sparse_xtype (to_xtype, A, Common) ; +} + +//------------------------------------------------------------------------------ +// spqr_gpu_memorysize +//------------------------------------------------------------------------------ + +#ifdef SUITESPARSE_CUDA +template <> int spqr_gpu_memorysize +( + size_t *total_mem, + size_t *available_mem, + cholmod_common *Common +) +{ + return cholmod_gpu_memorysize (total_mem, available_mem, Common) ; +} + +template <> int spqr_gpu_memorysize +( + size_t *total_mem, + size_t *available_mem, + cholmod_common *Common +) +{ + return cholmod_l_gpu_memorysize (total_mem, available_mem, Common) ; +} +#endif + +//------------------------------------------------------------------------------ +// spqr_read_sparse +//------------------------------------------------------------------------------ + +template <> cholmod_sparse *spqr_read_sparse +( + /* ---- input ---- */ + FILE *f, /* file to read from, must already be open */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_read_sparse (f, Common) ; +} + +template <> cholmod_sparse *spqr_read_sparse +( + /* ---- input ---- */ + FILE *f, /* file to read from, must already be open */ + /* --------------- */ + cholmod_common *Common +) +{ + return cholmod_l_read_sparse (f, Common) ; +} + + diff --git a/SPQR/Source/spqr_cpack.cpp b/SPQR/Source/spqr_cpack.cpp index 06fd3d698..3b9960228 100644 --- a/SPQR/Source/spqr_cpack.cpp +++ b/SPQR/Source/spqr_cpack.cpp @@ -36,13 +36,13 @@ #include "spqr.hpp" -template int64_t spqr_cpack // returns # of rows in C +template Int spqr_cpack // returns # of rows in C ( // input, not modified - int64_t m, // # of rows in F - int64_t n, // # of columns in F - int64_t npiv, // number of pivotal columns in F - int64_t rank, // the C block starts at F (rank,npiv) + Int m, // # of rows in F + Int n, // # of columns in F + Int npiv, // number of pivotal columns in F + Int rank, // the C block starts at F (rank,npiv) // input, not modified unless the pack occurs in-place Entry *F, // m-by-n frontal matrix in column-major order @@ -52,7 +52,7 @@ template int64_t spqr_cpack // returns # of rows in C // trapezoidal form. ) { - int64_t i, k, cm, cn ; + Int i, k, cm, cn ; // ------------------------------------------------------------------------- // get inputs @@ -106,11 +106,37 @@ template int64_t spqr_cpack // returns # of rows in C PR (("Cpack rank %ld cm %ld cn %ld\n", rank, cm, cn)) ; return (cm) ; // return # of rows in C } +template int32_t spqr_cpack // returns # of rows in C +( + // input, not modified + int32_t m, // # of rows in F + int32_t n, // # of columns in F + int32_t npiv, // number of pivotal columns in F + int32_t rank, // the C block starts at F (rank,npiv) + // input, not modified unless the pack occurs in-place + double *F, // m-by-n frontal matrix in column-major order -// ============================================================================= + // output, contents not defined on input + double *C // packed columns of C, of size cm-by-cn in upper + // trapezoidal form. +) ; +template int32_t spqr_cpack // returns # of rows in C +( + // input, not modified + int32_t m, // # of rows in F + int32_t n, // # of columns in F + int32_t npiv, // number of pivotal columns in F + int32_t rank, // the C block starts at F (rank,npiv) -template int64_t spqr_cpack // returns # of rows in C + // input, not modified unless the pack occurs in-place + Complex *F, // m-by-n frontal matrix in column-major order + + // output, contents not defined on input + Complex *C // packed columns of C, of size cm-by-cn in upper + // trapezoidal form. +) ; +template int64_t spqr_cpack // returns # of rows in C ( // input, not modified int64_t m, // # of rows in F @@ -119,16 +145,13 @@ template int64_t spqr_cpack // returns # of rows in C int64_t rank, // the C block starts at F (rank,npiv) // input, not modified unless the pack occurs in-place - double *F, // m-by-n frontal matrix in column-major order + double *F, // m-by-n frontal matrix in column-major order // output, contents not defined on input - double *C // packed columns of C, of size cm-by-cn in upper + double *C // packed columns of C, of size cm-by-cn in upper // trapezoidal form. ) ; - -// ============================================================================= - -template int64_t spqr_cpack // returns # of rows in C +template int64_t spqr_cpack // returns # of rows in C ( // input, not modified int64_t m, // # of rows in F @@ -137,9 +160,9 @@ template int64_t spqr_cpack // returns # of rows in C int64_t rank, // the C block starts at F (rank,npiv) // input, not modified unless the pack occurs in-place - Complex *F, // m-by-n frontal matrix in column-major order + Complex *F, // m-by-n frontal matrix in column-major order // output, contents not defined on input - Complex *C // packed columns of C, of size cm-by-cn in upper + Complex *C // packed columns of C, of size cm-by-cn in upper // trapezoidal form. ) ; diff --git a/SPQR/Source/spqr_csize.cpp b/SPQR/Source/spqr_csize.cpp index a6ff89b19..123203d72 100644 --- a/SPQR/Source/spqr_csize.cpp +++ b/SPQR/Source/spqr_csize.cpp @@ -9,16 +9,16 @@ #include "spqr.hpp" -int64_t spqr_csize // returns # of entries in C of a child +template Int spqr_csize // returns # of entries in C of a child ( // input, not modified - int64_t c, // child c - int64_t *Rp, // size nf+1, pointers for pattern of R - int64_t *Cm, // size nf, Cm [c] = # of rows in child C - int64_t *Super // size nf, pivotal columns in each front + Int c, // child c + Int *Rp, // size nf+1, pointers for pattern of R + Int *Cm, // size nf, Cm [c] = # of rows in child C + Int *Super // size nf, pivotal columns in each front ) { - int64_t pc, cm, fnc, fpc, cn, csize ; + Int pc, cm, fnc, fpc, cn, csize ; pc = Rp [c] ; // get the pattern of child R cm = Cm [c] ; // # of rows in child C @@ -32,3 +32,19 @@ int64_t spqr_csize // returns # of entries in C of a child return (csize) ; } +template int32_t spqr_csize // returns # of entries in C of a child +( + // input, not modified + int32_t c, // child c + int32_t *Rp, // size nf+1, pointers for pattern of R + int32_t *Cm, // size nf, Cm [c] = # of rows in child C + int32_t *Super // size nf, pivotal columns in each front +) ; +template int64_t spqr_csize // returns # of entries in C of a child +( + // input, not modified + int64_t c, // child c + int64_t *Rp, // size nf+1, pointers for pattern of R + int64_t *Cm, // size nf, Cm [c] = # of rows in child C + int64_t *Super // size nf, pivotal columns in each front +) ; diff --git a/SPQR/Source/spqr_cumsum.cpp b/SPQR/Source/spqr_cumsum.cpp index e031e21ea..d27439e78 100644 --- a/SPQR/Source/spqr_cumsum.cpp +++ b/SPQR/Source/spqr_cumsum.cpp @@ -7,24 +7,24 @@ //------------------------------------------------------------------------------ -#include "spqr.hpp" - // Overwrite a vector of length n with its cumulative sum of length n+1. // On input, X [0:n-1] contains the counts. On output, X [k] is replaced with // the sum of the input counts X [0:k-1]. No work is done if n < 0 or if // X is NULL. int64_t overflow is not checked (SuiteSparseQR doesn't need it; // it has already been checked whereever this function is used). -int64_t spqr_cumsum +#include "spqr.hpp" + +template Int spqr_cumsum ( // input, not modified - int64_t n, + Int n, // input/output - int64_t *X // size n+1. X = cumsum ([0 X]) + Int *X // size n+1. X = cumsum ([0 X]) ) { - int64_t itot, t, x, k ; + Int itot, t, x, k ; // ------------------------------------------------------------------------- // X = cumsum ([0 X]) @@ -45,3 +45,20 @@ int64_t spqr_cumsum return (itot) ; } + +template int32_t spqr_cumsum +( + // input, not modified + int32_t n, + + // input/output + int32_t *X // size n+1. X = cumsum ([0 X]) +) ; +template int64_t spqr_cumsum +( + // input, not modified + int64_t n, + + // input/output + int64_t *X // size n+1. X = cumsum ([0 X]) +) ; diff --git a/SPQR/Source/spqr_debug.cpp b/SPQR/Source/spqr_debug.cpp index 466c2cbe2..a471b251b 100644 --- a/SPQR/Source/spqr_debug.cpp +++ b/SPQR/Source/spqr_debug.cpp @@ -12,8 +12,6 @@ // ============================================================================= // This file is for debugging only. // ============================================================================= - - #ifndef NDEBUG #ifndef NPRINT @@ -42,16 +40,16 @@ void spqrDebug_print // === spqrDebug_dumpdense ===================================================== // ============================================================================= -template void spqrDebug_dumpdense +template void spqrDebug_dumpdense ( Entry *A, - int64_t m, - int64_t n, - int64_t lda, + Int m, + Int n, + Int lda, cholmod_common *cc ) { - int64_t i, j ; + Int i, j ; if (cc == NULL) return ; PR (("Dense: m %ld n %ld lda %ld p %p\n", m, n, lda, A)) ; if (m < 0 || n < 0 || lda < m || A == NULL) @@ -96,39 +94,21 @@ template void spqrDebug_dumpdense } -template void spqrDebug_dumpdense -( - double *A, - int64_t m, - int64_t n, - int64_t lda, - cholmod_common *cc -) ; - -template void spqrDebug_dumpdense -( - Complex *A, - int64_t m, - int64_t n, - int64_t lda, - cholmod_common *cc -) ; - // ============================================================================= // === spqrDebug_dumpsparse ==================================================== // ============================================================================= -template void spqrDebug_dumpsparse +template void spqrDebug_dumpsparse ( - int64_t *Ap, - int64_t *Ai, + Int *Ap, + Int *Ai, Entry *Ax, - int64_t m, - int64_t n, + Int m, + Int n, cholmod_common *cc ) { - int64_t p, i, j ; + Int p, i, j ; if (cc == NULL) return ; PR (("\nSparse: m %ld n %ld nz %ld Ap %p Ai %p Ax %p\n", m, n, Ap [n], Ap, Ai,Ax)) ; @@ -147,26 +127,6 @@ template void spqrDebug_dumpsparse } } -template void spqrDebug_dumpsparse -( - int64_t *Ap, - int64_t *Ai, - double *Ax, - int64_t m, - int64_t n, - cholmod_common *cc -) ; - -template void spqrDebug_dumpsparse -( - int64_t *Ap, - int64_t *Ai, - Complex *Ax, - int64_t m, - int64_t n, - cholmod_common *cc -) ; - #endif // ============================================================================= @@ -176,13 +136,13 @@ template void spqrDebug_dumpsparse #ifdef DEBUG_EXPENSIVE // returns # of times x is in the List [0..len-1] -int64_t spqrDebug_listcount +template Int spqrDebug_listcount ( - int64_t x, int64_t *List, int64_t len, int64_t what, + Int x, Int *List, Int len, Int what, cholmod_common *cc ) { - int64_t k, nfound = 0 ; + Int k, nfound = 0 ; if (cc == NULL) return (EMPTY) ; if (what == 0) { @@ -210,18 +170,18 @@ int64_t spqrDebug_listcount // Count the number of entries in the R+H block for a single front. -int64_t spqrDebug_rhsize // returns # of entries in R+H +template Int spqrDebug_rhsize // returns # of entries in R+H ( // input, not modified - int64_t m, // # of rows in F - int64_t n, // # of columns in F - int64_t npiv, // number of pivotal columns in F - int64_t *Stair, // size n; column j is dead if Stair [j] == 0. + Int m, // # of rows in F + Int n, // # of columns in F + Int npiv, // number of pivotal columns in F + Int *Stair, // size n; column j is dead if Stair [j] == 0. // Only the first npiv columns can be dead. cholmod_common *cc ) { - int64_t k, h, t, rm, rhsize = 0 ; + Int k, h, t, rm, rhsize = 0 ; ASSERT (m >= 0 && n >= 0 && npiv <= n && npiv >= 0) ; @@ -274,11 +234,33 @@ int64_t spqrDebug_rhsize // returns # of entries in R+H } +template int32_t spqrDebug_rhsize // returns # of entries in R+H +( + // input, not modified + int32_t m, // # of rows in F + int32_t n, // # of columns in F + int32_t npiv, // number of pivotal columns in F + int32_t *Stair, // size n; column j is dead if Stair [j] == 0. + // Only the first npiv columns can be dead. + cholmod_common *cc +) ; + +template int64_t spqrDebug_rhsize // returns # of entries in R+H +( + // input, not modified + int64_t m, // # of rows in F + int64_t n, // # of columns in F + int64_t npiv, // number of pivotal columns in F + int64_t *Stair, // size n; column j is dead if Stair [j] == 0. + // Only the first npiv columns can be dead. + cholmod_common *cc +) ; + // ============================================================================= // === spqrDebug_dump_Parent =================================================== // ============================================================================= -void spqrDebug_dump_Parent (int64_t n, int64_t *Parent, const char *filename) +template void spqrDebug_dump_Parent (Int n, Int *Parent, const char *filename) { FILE *pfile = fopen (filename, "w") ; if (Parent == NULL) @@ -287,11 +269,16 @@ void spqrDebug_dump_Parent (int64_t n, int64_t *Parent, const char *filename) } else { - for (int64_t f = 0 ; f < n ; f++) + for (Int f = 0 ; f < n ; f++) { fprintf (pfile, "%ld\n", 1+Parent [f]) ; } } fclose (pfile) ; } + +template void spqrDebug_dump_Parent (int32_t n, int32_t *Parent, const char *filename) ; + +template void spqrDebug_dump_Parent (int64_t n, int64_t *Parent, const char *filename) ; + #endif diff --git a/SPQR/Source/spqr_factorize.cpp b/SPQR/Source/spqr_factorize.cpp index 0d2afc92d..73e6065e9 100644 --- a/SPQR/Source/spqr_factorize.cpp +++ b/SPQR/Source/spqr_factorize.cpp @@ -42,23 +42,23 @@ // Free Sx, A, and all of Work except the Work [0:ns-1] array itself #define FREE_WORK_PART1 \ { \ - free_Work (Work, ns, n, maxfn, wtsize, cc) ; \ - if (freeA) cholmod_l_free_sparse (Ahandle, cc) ; \ - cholmod_l_free (anz, sizeof (Entry), Sx, cc) ; \ + free_Work (Work, ns, n, maxfn, wtsize, cc) ; \ + if (freeA) spqr_free_sparse (Ahandle, cc) ; \ + spqr_free (anz, sizeof (Entry), Sx, cc) ; \ Sx = NULL ; \ } // Free Cblock and the Work array itself #define FREE_WORK_PART2 \ { \ - cholmod_l_free (ns, sizeof (spqr_work ), Work, cc) ; \ + spqr_free (ns, sizeof (spqr_work ), Work, cc) ; \ Work = NULL ; \ - cholmod_l_free (nf+1, sizeof (Entry *), Cblock, cc) ; \ + spqr_free (nf+1, sizeof (Entry *), Cblock, cc) ; \ Cblock = NULL ; \ } // Free all workspace -#define FREE_WORK \ +#define FREE_WORK_FACTORIZE \ { \ FREE_WORK_PART1 ; \ FREE_WORK_PART2 ; \ @@ -72,40 +72,40 @@ // Allocate the Work object, which is an array of structs. The entry Work [s] // contains workspace for the Stack s, for each Stack 0 to ns-1. -template spqr_work *get_Work +template spqr_work *get_Work ( - int64_t ns, // number of stacks - int64_t n, // number of columns of A - int64_t maxfn, // largest number of columns in any front - int64_t keepH, // if true, H is kept - int64_t fchunk, - int64_t *p_wtsize, // size of WTwork for each + Int ns, // number of stacks + Int n, // number of columns of A + Int maxfn, // largest number of columns in any front + Int keepH, // if true, H is kept + Int fchunk, + Int *p_wtsize, // size of WTwork for each cholmod_common *cc ) { int ok = TRUE ; - spqr_work *Work ; - int64_t wtsize ; + spqr_work *Work ; + Int wtsize ; *p_wtsize = 0 ; // wtsize = (fchunk + (keepH ? 0:1)) * maxfn ; wtsize = spqr_mult (fchunk + (keepH ? 0:1), maxfn, &ok) ; - Work = (spqr_work *) - cholmod_l_malloc (ns, sizeof (spqr_work ), cc) ; + Work = (spqr_work *) + spqr_malloc (ns, sizeof (spqr_work ), cc) ; if (!ok || cc->status < CHOLMOD_OK) { - // out of memory or int64_t overflow - cholmod_l_free (ns, sizeof (spqr_work ), Work, cc) ; + // out of memory or Int overflow + spqr_free (ns, sizeof (spqr_work ), Work, cc) ; ERROR (CHOLMOD_OUT_OF_MEMORY, "out of memory") ; return (NULL) ; } - for (int64_t stack = 0 ; stack < ns ; stack++) + for (Int stack = 0 ; stack < ns ; stack++) { - Work [stack].Fmap = (int64_t *) cholmod_l_malloc (n, sizeof (int64_t), cc) ; - Work [stack].Cmap = (int64_t *) cholmod_l_malloc (maxfn, sizeof(int64_t), cc); + Work [stack].Fmap = (Int *) spqr_malloc (n, sizeof (Int), cc) ; + Work [stack].Cmap = (Int *) spqr_malloc (maxfn, sizeof(Int), cc); if (keepH) { // Staircase is a permanent part of H @@ -115,10 +115,10 @@ template spqr_work *get_Work { // Staircase workspace reused for each front Work [stack].Stair1 = - (int64_t *) cholmod_l_malloc (maxfn, sizeof (int64_t), cc) ; + (Int *) spqr_malloc (maxfn, sizeof (Int), cc) ; } Work [stack].WTwork = - (Entry *) cholmod_l_malloc (wtsize, sizeof (Entry), cc) ; + (Entry *) spqr_malloc (wtsize, sizeof (Entry), cc) ; Work [stack].sumfrank = 0 ; Work [stack].maxfrank = 0 ; @@ -137,24 +137,24 @@ template spqr_work *get_Work // Free the contents of Work, but not the Work array itself -template void free_Work +template void free_Work ( - spqr_work *Work, - int64_t ns, // number of stacks - int64_t n, // number of columns of A - int64_t maxfn, // largest number of columns in any front - int64_t wtsize, // size of WTwork array for each Stack + spqr_work *Work, + Int ns, // number of stacks + Int n, // number of columns of A + Int maxfn, // largest number of columns in any front + Int wtsize, // size of WTwork array for each Stack cholmod_common *cc ) { if (Work != NULL) { - for (int64_t stack = 0 ; stack < ns ; stack++) + for (Int stack = 0 ; stack < ns ; stack++) { - cholmod_l_free (n, sizeof (int64_t), Work [stack].Fmap, cc) ; - cholmod_l_free (maxfn, sizeof (int64_t), Work [stack].Cmap, cc) ; - cholmod_l_free (maxfn, sizeof (int64_t), Work [stack].Stair1, cc) ; - cholmod_l_free (wtsize, sizeof (Entry), Work [stack].WTwork, cc) ; + spqr_free (n, sizeof (Int), Work [stack].Fmap, cc) ; + spqr_free (maxfn, sizeof (Int), Work [stack].Cmap, cc) ; + spqr_free (maxfn, sizeof (Int), Work [stack].Stair1, cc) ; + spqr_free (wtsize, sizeof (Entry), Work [stack].WTwork, cc) ; Work [stack].Fmap = NULL ; Work [stack].Cmap = NULL ; Work [stack].Stair1 = NULL ; @@ -168,30 +168,30 @@ template void free_Work // === spqr_factorize ========================================================== // ============================================================================= -template spqr_numeric *spqr_factorize +template spqr_numeric *spqr_factorize ( // input, optionally freed on output cholmod_sparse **Ahandle, // inputs, not modified - int64_t freeA, // if TRUE, free A on output + Int freeA, // if TRUE, free A on output double tol, // for rank detection - int64_t ntol, // apply tol only to first ntol columns - spqr_symbolic *QRsym, + Int ntol, // apply tol only to first ntol columns + spqr_symbolic *QRsym, // workspace and parameters cholmod_common *cc ) { - int64_t *Wi, *Qfill, *PLinv, *Cm, *Sp, *Stack_size, + Int *Wi, *Qfill, *PLinv, *Cm, *Sp, *Stack_size, *TaskFront, *TaskFrontp, *TaskStack, *Stack_maxstack ; Entry *Sx, **Rblock, **Cblock, **Stacks ; - spqr_numeric *QRnum ; - int64_t nf, m, n, anz, fchunk, maxfn, rank, maxfrank, rjsize, rank1, + spqr_numeric *QRnum ; + Int nf, m, n, anz, fchunk, maxfn, rank, maxfrank, rjsize, rank1, maxstack,j, wtsize, stack, ns, ntasks, keepH, hisize ; char *Rdead ; cholmod_sparse *A ; - spqr_work *Work ; + spqr_work *Work ; // ------------------------------------------------------------------------- // get inputs and contents of symbolic object @@ -203,7 +203,7 @@ template spqr_numeric *spqr_factorize if (freeA) { // if freeA is true, A must always be freed, even on error - cholmod_l_free_sparse (Ahandle, cc) ; + spqr_free_sparse (Ahandle, cc) ; } return (NULL) ; } @@ -256,14 +256,14 @@ template spqr_numeric *spqr_factorize // allocate workspace // ------------------------------------------------------------------------- - cholmod_l_allocate_work (0, MAX (m,nf), 0, cc) ; + spqr_allocate_work (0, MAX (m,nf), 0, cc) ; - // shared int64_t workspace - Wi = (int64_t *) cc->Iwork ; // size m, aliased with the rest of Iwork + // shared Int workspace + Wi = (Int *) cc->Iwork ; // size m, aliased with the rest of Iwork Cm = Wi ; // size nf // Cblock is workspace shared by all threads - Cblock = (Entry **) cholmod_l_malloc (nf+1, sizeof (Entry *), cc) ; + Cblock = (Entry **) spqr_malloc (nf+1, sizeof (Entry *), cc) ; Work = NULL ; // Work and its contents not yet allocated fchunk = MIN (m, FCHUNK) ; @@ -274,7 +274,7 @@ template spqr_numeric *spqr_factorize // ------------------------------------------------------------------------- // create numeric values of S = A(p,q) in row-form in Sx - Sx = (Entry *) cholmod_l_malloc (anz, sizeof (Entry), cc) ; + Sx = (Entry *) spqr_malloc (anz, sizeof (Entry), cc) ; if (cc->status == CHOLMOD_OK) { @@ -292,7 +292,7 @@ template spqr_numeric *spqr_factorize if (freeA) { // this is done even if out of memory, above - cholmod_l_free_sparse (Ahandle, cc) ; + spqr_free_sparse (Ahandle, cc) ; ASSERT (*Ahandle == NULL) ; } PR (("in spqr_factorize, freed A, status %d\n", cc->status)) ; @@ -301,7 +301,7 @@ template spqr_numeric *spqr_factorize { PR (("in spqr_factorize, failure %d\n", cc->status)) ; // out of memory - FREE_WORK ; + FREE_WORK_FACTORIZE ; return (NULL) ; } @@ -309,23 +309,23 @@ template spqr_numeric *spqr_factorize // allocate numeric object // ------------------------------------------------------------------------- - QRnum = (spqr_numeric *) - cholmod_l_malloc (1, sizeof (spqr_numeric), cc) ; + QRnum = (spqr_numeric *) + spqr_malloc (1, sizeof (spqr_numeric), cc) ; PR (("after allocating numeric object header, status %d\n", cc->status)) ; if (cc->status < CHOLMOD_OK) { // out of memory - FREE_WORK ; + FREE_WORK_FACTORIZE ; return (NULL) ; } - Rblock = (Entry **) cholmod_l_malloc (nf, sizeof (Entry *), cc) ; - Rdead = (char *) cholmod_l_calloc (n, sizeof (char), cc) ; + Rblock = (Entry **) spqr_malloc (nf, sizeof (Entry *), cc) ; + Rdead = (char *) spqr_calloc (n, sizeof (char), cc) ; // these may be revised (with ns=1) if we run out of memory - Stacks = (Entry **) cholmod_l_calloc (ns, sizeof (Entry *), cc) ; - Stack_size = (int64_t *) cholmod_l_calloc (ns, sizeof (int64_t), cc) ; + Stacks = (Entry **) spqr_calloc (ns, sizeof (Entry *), cc) ; + Stack_size = (Int *) spqr_calloc (ns, sizeof (Int), cc) ; QRnum->Rblock = Rblock ; QRnum->Rdead = Rdead ; @@ -335,12 +335,12 @@ template spqr_numeric *spqr_factorize if (keepH) { // allocate permanent space for Stair, Tau, Hii for each front - QRnum->HStair= (int64_t *) cholmod_l_malloc (rjsize, sizeof (int64_t), cc) ; - QRnum->HTau = (Entry *) cholmod_l_malloc (rjsize, sizeof (Entry), cc) ; - QRnum->Hii = (int64_t *) cholmod_l_malloc (hisize, sizeof (int64_t), cc) ; - QRnum->Hm = (int64_t *) cholmod_l_malloc (nf, sizeof (int64_t), cc) ; - QRnum->Hr = (int64_t *) cholmod_l_malloc (nf, sizeof (int64_t), cc) ; - QRnum->HPinv = (int64_t *) cholmod_l_malloc (m, sizeof (int64_t), cc) ; + QRnum->HStair= (Int *) spqr_malloc (rjsize, sizeof (Int), cc) ; + QRnum->HTau = (Entry *) spqr_malloc (rjsize, sizeof (Entry), cc) ; + QRnum->Hii = (Int *) spqr_malloc (hisize, sizeof (Int), cc) ; + QRnum->Hm = (Int *) spqr_malloc (nf, sizeof (Int), cc) ; + QRnum->Hr = (Int *) spqr_malloc (nf, sizeof (Int), cc) ; + QRnum->HPinv = (Int *) spqr_malloc (m, sizeof (Int), cc) ; } else { @@ -368,7 +368,7 @@ template spqr_numeric *spqr_factorize { // out of memory spqr_freenum (&QRnum, cc) ; - FREE_WORK ; + FREE_WORK_FACTORIZE ; return (NULL) ; } @@ -378,7 +378,7 @@ template spqr_numeric *spqr_factorize // allocate workspace // ------------------------------------------------------------------------- - Work = get_Work (ns, n, maxfn, keepH, fchunk, &wtsize, cc) ; + Work = get_Work (ns, n, maxfn, keepH, fchunk, &wtsize, cc) ; PR (("after allocating work, status %d\n", cc->status)) ; // ------------------------------------------------------------------------- @@ -393,7 +393,7 @@ template spqr_numeric *spqr_factorize size_t stacksize = (ntasks == 1) ? maxstack : Stack_maxstack [stack] ; Stack_size [stack] = stacksize ; - Stack = (Entry *) cholmod_l_malloc (stacksize, sizeof (Entry), cc) ; + Stack = (Entry *) spqr_malloc (stacksize, sizeof (Entry), cc) ; Stacks [stack] = Stack ; Work [stack].Stack_head = Stack ; Work [stack].Stack_top = Stack + stacksize ; @@ -416,31 +416,31 @@ template spqr_numeric *spqr_factorize { size_t stacksize = (ntasks == 1) ? maxstack : Stack_maxstack [stack] ; - cholmod_l_free (stacksize, sizeof (Entry), Stacks [stack], cc) ; + spqr_free (stacksize, sizeof (Entry), Stacks [stack], cc) ; } } - cholmod_l_free (ns, sizeof (Entry *), Stacks, cc) ; - cholmod_l_free (ns, sizeof (int64_t), Stack_size, cc) ; + spqr_free (ns, sizeof (Entry *), Stacks, cc) ; + spqr_free (ns, sizeof (Int), Stack_size, cc) ; // free the contents of Work, and the Work array itself - free_Work (Work, ns, n, maxfn, wtsize, cc) ; - cholmod_l_free (ns, sizeof (spqr_work ), Work, cc) ; + free_Work (Work, ns, n, maxfn, wtsize, cc) ; + spqr_free (ns, sizeof (spqr_work ), Work, cc) ; // punt to a single stack, a single task, and fchunk of 1 ns = 1 ; ntasks = 1 ; fchunk = 1 ; cc->status = CHOLMOD_OK ; - Work = get_Work (ns, n, maxfn, keepH, fchunk, &wtsize, cc) ; - Stacks = (Entry **) cholmod_l_calloc (ns, sizeof (Entry *), cc) ; - Stack_size = (int64_t *) cholmod_l_calloc (ns, sizeof (int64_t), cc) ; + Work = get_Work (ns, n, maxfn, keepH, fchunk, &wtsize, cc) ; + Stacks = (Entry **) spqr_calloc (ns, sizeof (Entry *), cc) ; + Stack_size = (Int *) spqr_calloc (ns, sizeof (Int), cc) ; QRnum->Stacks = Stacks ; QRnum->Stack_size = Stack_size ; if (cc->status == CHOLMOD_OK) { Entry *Stack ; Stack_size [0] = maxstack ; - Stack = (Entry *) cholmod_l_malloc (maxstack, sizeof (Entry), cc) ; + Stack = (Entry *) spqr_malloc (maxstack, sizeof (Entry), cc) ; Stacks [0] = Stack ; Work [0].Stack_head = Stack ; Work [0].Stack_top = Stack + maxstack ; @@ -458,19 +458,19 @@ template spqr_numeric *spqr_factorize if (cc->status < CHOLMOD_OK) { spqr_freenum (&QRnum, cc) ; - FREE_WORK ; + FREE_WORK_FACTORIZE ; return (NULL) ; } // At this point, the factorization is guaranteed to succeed, unless sizeof - // (SUITESPARSE_BLAS_INT) < sizeof (int64_t), in which case, you really + // (SUITESPARSE_BLAS_INT) < sizeof (Int), in which case, you really // should get a 64-bit BLAS. // ------------------------------------------------------------------------- // create the Blob : everything the numeric factorization kernel needs // ------------------------------------------------------------------------- - spqr_blob Blob ; + spqr_blob Blob ; Blob.QRsym = QRsym ; Blob.QRnum = QRnum ; Blob.tol = tol ; @@ -497,7 +497,7 @@ template spqr_numeric *spqr_factorize if (ntasks == 1) { // Just one task, with or without TBB installed: don't use TBB - spqr_kernel (0, &Blob) ; // sequential case + spqr_kernel (0, &Blob) ; // sequential case } else { @@ -508,7 +508,7 @@ template spqr_numeric *spqr_factorize #else // TBB not installed, but the work is still split into multiple tasks. // do tasks 0 to ntasks-2 (skip the placeholder root task id = ntasks-1) - for (int64_t id = 0 ; id < ntasks-1 ; id++) + for (Int id = 0 ; id < ntasks-1 ; id++) { spqr_kernel (id, &Blob) ; } @@ -518,19 +518,19 @@ template spqr_numeric *spqr_factorize PR (("] did the kernel\n")) ; // ------------------------------------------------------------------------- - // check for BLAS int64_t overflow on the CPU, or GPU failure + // check for BLAS Int overflow on the CPU, or GPU failure // ------------------------------------------------------------------------- if (cc->status < CHOLMOD_OK) { // On the CPU, this case can only occur if the problem is too large for // the BLAS. This can only occur if, for example you're on a 64-bit - // platform (with sizeof (int64_t) == 8) and using a 32-bit BLAS (with + // platform (with sizeof (Int) == 8) and using a 32-bit BLAS (with // sizeof (SUITESPARSE_BLAS_INT) == 4). On the GPU, this case can more // easily occur, if we run out of memory in spqrgpu_kernel, or if we // fail to communicate with the GPU. spqr_freenum (&QRnum, cc) ; - FREE_WORK ; + FREE_WORK_FACTORIZE ; return (NULL) ; } @@ -597,7 +597,7 @@ template spqr_numeric *spqr_factorize // This option is mainly meant for testing, not production use. // It should be left at 1 for production use. - int64_t any_moved = FALSE ; + Int any_moved = FALSE ; int shrink = cc->SPQR_shrink ; @@ -619,7 +619,7 @@ template spqr_numeric *spqr_factorize { // force the block to move by malloc'ing a new one; // this option is mainly for testing only. - Cblock [stack] = (Entry *) cholmod_l_malloc (newstacksize, + Cblock [stack] = (Entry *) spqr_malloc (newstacksize, sizeof (Entry), cc) ; if (Cblock [stack] == NULL) { @@ -634,7 +634,7 @@ template spqr_numeric *spqr_factorize { // malloc is OK; copy the block over and free the old one memcpy (Cblock [stack], Stack, newstacksize*sizeof(Entry)) ; - cholmod_l_free (stacksize, sizeof (Entry), Stack, cc) ; + spqr_free (stacksize, sizeof (Entry), Stack, cc) ; } // the Stack has been shrunk to the new size stacksize = newstacksize ; @@ -645,7 +645,7 @@ template spqr_numeric *spqr_factorize PR (("Normal shrink of the stack: %ld to %ld\n", stacksize, newstacksize)) ; Cblock [stack] = // pointer to the new Stack - (Entry *) cholmod_l_realloc ( + (Entry *) spqr_realloc ( newstacksize, // requested size of Stack, in # of Entries sizeof (Entry), // size of each Entry in the Stack Stack, // pointer to the old Stack @@ -666,9 +666,9 @@ template spqr_numeric *spqr_factorize if (any_moved) { // at least one Stack has moved; check all fronts and adjust them - for (int64_t task = 0 ; task < ntasks ; task++) + for (Int task = 0 ; task < ntasks ; task++) { - int64_t kfirst, klast ; + Int kfirst, klast ; if (ntasks == 1) { // sequential case @@ -687,9 +687,9 @@ template spqr_numeric *spqr_factorize Entry *New_Stack = Cblock [stack] ; if (New_Stack != Old_Stack) { - for (int64_t kf = kfirst ; kf < klast ; kf++) + for (Int kf = kfirst ; kf < klast ; kf++) { - int64_t f = (ntasks == 1) ? kf : TaskFront [kf] ; + Int f = (ntasks == 1) ? kf : TaskFront [kf] ; Rblock [f] = New_Stack + (Rblock [f] - Old_Stack) ; } } @@ -747,27 +747,49 @@ template spqr_numeric *spqr_factorize return (QRnum) ; } +template spqr_numeric *spqr_factorize +( + // input, optionally freed on output + cholmod_sparse **Ahandle, -// ============================================================================= + // inputs, not modified + int32_t freeA, // if TRUE, free A on output + double tol, // for rank detection + int32_t ntol, // apply tol only to first ntol columns + spqr_symbolic *QRsym, -template spqr_numeric *spqr_factorize + // workspace and parameters + cholmod_common *cc +) ; +template spqr_numeric *spqr_factorize ( // input, optionally freed on output cholmod_sparse **Ahandle, // inputs, not modified - int64_t freeA, // if TRUE, free A on output + int32_t freeA, // if TRUE, free A on output double tol, // for rank detection - int64_t ntol, // apply tol only to first ntol columns - spqr_symbolic *QRsym, + int32_t ntol, // apply tol only to first ntol columns + spqr_symbolic *QRsym, // workspace and parameters cholmod_common *cc ) ; +template spqr_numeric *spqr_factorize +( + // input, optionally freed on output + cholmod_sparse **Ahandle, -// ============================================================================= + // inputs, not modified + int64_t freeA, // if TRUE, free A on output + double tol, // for rank detection + int64_t ntol, // apply tol only to first ntol columns + spqr_symbolic *QRsym, -template spqr_numeric *spqr_factorize + // workspace and parameters + cholmod_common *cc +) ; +template spqr_numeric *spqr_factorize ( // input, optionally freed on output cholmod_sparse **Ahandle, @@ -776,7 +798,7 @@ template spqr_numeric *spqr_factorize int64_t freeA, // if TRUE, free A on output double tol, // for rank detection int64_t ntol, // apply tol only to first ntol columns - spqr_symbolic *QRsym, + spqr_symbolic *QRsym, // workspace and parameters cholmod_common *cc diff --git a/SPQR/Source/spqr_fcsize.cpp b/SPQR/Source/spqr_fcsize.cpp index 827d90834..0f5f716bd 100644 --- a/SPQR/Source/spqr_fcsize.cpp +++ b/SPQR/Source/spqr_fcsize.cpp @@ -9,16 +9,16 @@ #include "spqr.hpp" -int64_t spqr_fcsize // returns # of entries in C of current front F +template Int spqr_fcsize // returns # of entries in C of current front F ( // input, not modified - int64_t m, // # of rows in F - int64_t n, // # of columns in F - int64_t npiv, // number of pivotal columns in F - int64_t rank // the C block starts at F (rank,npiv) + Int m, // # of rows in F + Int n, // # of columns in F + Int npiv, // number of pivotal columns in F + Int rank // the C block starts at F (rank,npiv) ) { - int64_t cm, cn, csize ; + Int cm, cn, csize ; ASSERT (m >= 0 && n >= 0 && npiv >= 0 && npiv <= n) ; ASSERT (rank >= 0 && rank <= MIN (m,npiv)) ; cn = n - npiv ; // number of columns of C @@ -28,3 +28,20 @@ int64_t spqr_fcsize // returns # of entries in C of current front F csize = (cm * (cm+1)) / 2 + cm * (cn - cm) ; return (csize) ; // return # of entries in C } + +template int32_t spqr_fcsize // returns # of entries in C of current front F +( + // input, not modified + int32_t m, // # of rows in F + int32_t n, // # of columns in F + int32_t npiv, // number of pivotal columns in F + int32_t rank // the C block starts at F (rank,npiv) +) ; +template int64_t spqr_fcsize // returns # of entries in C of current front F +( + // input, not modified + int64_t m, // # of rows in F + int64_t n, // # of columns in F + int64_t npiv, // number of pivotal columns in F + int64_t rank // the C block starts at F (rank,npiv) +) ; diff --git a/SPQR/Source/spqr_freefac.cpp b/SPQR/Source/spqr_freefac.cpp index 9dfe0a3c1..47d970019 100644 --- a/SPQR/Source/spqr_freefac.cpp +++ b/SPQR/Source/spqr_freefac.cpp @@ -7,21 +7,20 @@ //------------------------------------------------------------------------------ -// Frees the contents of the QR factor object. - #include "spqr.hpp" -template void spqr_freefac +// Frees the contents of the QR factor object. + +template void spqr_freefac ( - SuiteSparseQR_factorization **QR_handle, + SuiteSparseQR_factorization **QR_handle, // workspace and parameters cholmod_common *cc ) - { - SuiteSparseQR_factorization *QR ; - int64_t n, m, bncols, n1rows, r1nz ; + SuiteSparseQR_factorization *QR ; + Int n, m, bncols, n1rows, r1nz ; if (QR_handle == NULL || *QR_handle == NULL) { @@ -39,34 +38,44 @@ template void spqr_freefac spqr_freenum (& (QR->QRnum), cc) ; spqr_freesym (& (QR->QRsym), cc) ; - cholmod_l_free (n+bncols, sizeof (int64_t), QR->Q1fill, cc) ; - cholmod_l_free (m, sizeof (int64_t), QR->P1inv, cc) ; - cholmod_l_free (m, sizeof (int64_t), QR->HP1inv, cc) ; - cholmod_l_free (n1rows+1, sizeof (int64_t), QR->R1p, cc) ; - cholmod_l_free (r1nz, sizeof (int64_t), QR->R1j, cc) ; - cholmod_l_free (r1nz, sizeof (Entry), QR->R1x, cc) ; - cholmod_l_free (n, sizeof (int64_t), QR->Rmap, cc) ; - cholmod_l_free (n, sizeof (int64_t), QR->RmapInv, cc) ; + spqr_free (n+bncols, sizeof (Int), QR->Q1fill, cc) ; + spqr_free (m, sizeof (Int), QR->P1inv, cc) ; + spqr_free (m, sizeof (Int), QR->HP1inv, cc) ; + spqr_free (n1rows+1, sizeof (Int), QR->R1p, cc) ; + spqr_free (r1nz, sizeof (Int), QR->R1j, cc) ; + spqr_free (r1nz, sizeof (Entry), QR->R1x, cc) ; + spqr_free (n, sizeof (Int), QR->Rmap, cc) ; + spqr_free (n, sizeof (Int), QR->RmapInv, cc) ; - cholmod_l_free (1, sizeof (SuiteSparseQR_factorization ), QR, cc) ; + spqr_free (1, sizeof (SuiteSparseQR_factorization ), QR, cc) ; *QR_handle = NULL ; } // ============================================================================= - -template void spqr_freefac +template void spqr_freefac ( - SuiteSparseQR_factorization **QR_handle, + SuiteSparseQR_factorization **QR_handle, // workspace and parameters cholmod_common *cc ) ; +template void spqr_freefac +( + SuiteSparseQR_factorization **QR_handle, -// ============================================================================= + // workspace and parameters + cholmod_common *cc +) ; +template void spqr_freefac +( + SuiteSparseQR_factorization **QR_handle, -template void spqr_freefac + // workspace and parameters + cholmod_common *cc +) ; +template void spqr_freefac ( - SuiteSparseQR_factorization **QR_handle, + SuiteSparseQR_factorization **QR_handle, // workspace and parameters cholmod_common *cc diff --git a/SPQR/Source/spqr_freenum.cpp b/SPQR/Source/spqr_freenum.cpp index 1f0ff124d..f3b439203 100644 --- a/SPQR/Source/spqr_freenum.cpp +++ b/SPQR/Source/spqr_freenum.cpp @@ -7,20 +7,20 @@ //------------------------------------------------------------------------------ -// Frees the contents of the QR Numeric object - #include "spqr.hpp" -template void spqr_freenum +// Frees the contents of the QR Numeric object + +template void spqr_freenum ( - spqr_numeric **QRnum_handle, + spqr_numeric **QRnum_handle, // workspace and parameters cholmod_common *cc ) { - spqr_numeric *QRnum ; - int64_t nf, n, m, rjsize, hisize, ns, stack, maxstack ; + spqr_numeric *QRnum ; + Int nf, n, m, rjsize, hisize, ns, stack, maxstack ; if (QRnum_handle == NULL || *QRnum_handle == NULL) { @@ -37,53 +37,63 @@ template void spqr_freenum ns = QRnum->ns ; maxstack = QRnum->maxstack ; - cholmod_l_free (nf, sizeof (Entry *), QRnum->Rblock, cc) ; - cholmod_l_free (n, sizeof (char), QRnum->Rdead, cc) ; + spqr_free (nf, sizeof (Entry *), QRnum->Rblock, cc) ; + spqr_free (n, sizeof (char), QRnum->Rdead, cc) ; if (QRnum->keepH) { // QRnum->H* items are present only if H is kept - cholmod_l_free (rjsize, sizeof (int64_t), QRnum->HStair, cc) ; - cholmod_l_free (rjsize, sizeof (Entry), QRnum->HTau, cc) ; - cholmod_l_free (nf, sizeof (int64_t), QRnum->Hm, cc) ; - cholmod_l_free (nf, sizeof (int64_t), QRnum->Hr, cc) ; - cholmod_l_free (hisize, sizeof (int64_t), QRnum->Hii, cc) ; - cholmod_l_free (m, sizeof (int64_t), QRnum->HPinv, cc) ; + spqr_free (rjsize, sizeof (Int), QRnum->HStair, cc) ; + spqr_free (rjsize, sizeof (Entry), QRnum->HTau, cc) ; + spqr_free (nf, sizeof (Int), QRnum->Hm, cc) ; + spqr_free (nf, sizeof (Int), QRnum->Hr, cc) ; + spqr_free (hisize, sizeof (Int), QRnum->Hii, cc) ; + spqr_free (m, sizeof (Int), QRnum->HPinv, cc) ; } // free each stack if (QRnum->Stacks != NULL) { - int64_t *Stack_size = QRnum->Stack_size ; + Int *Stack_size = QRnum->Stack_size ; for (stack = 0 ; stack < ns ; stack++) { size_t s = Stack_size ? (Stack_size [stack]) : maxstack ; - cholmod_l_free (s, sizeof (Entry), QRnum->Stacks [stack], cc) ; + spqr_free (s, sizeof (Entry), QRnum->Stacks [stack], cc) ; } } - cholmod_l_free (ns, sizeof (Entry *), QRnum->Stacks, cc) ; - cholmod_l_free (ns, sizeof (int64_t), QRnum->Stack_size, cc) ; + spqr_free (ns, sizeof (Entry *), QRnum->Stacks, cc) ; + spqr_free (ns, sizeof (Int), QRnum->Stack_size, cc) ; - cholmod_l_free (1, sizeof (spqr_numeric), QRnum, cc) ; + spqr_free (1, sizeof (spqr_numeric), QRnum, cc) ; *QRnum_handle = NULL ; } -// ============================================================================= - -template void spqr_freenum +template void spqr_freenum ( - spqr_numeric **QRnum_handle, + spqr_numeric **QRnum_handle, // workspace and parameters cholmod_common *cc ) ; +template void spqr_freenum +( + spqr_numeric **QRnum_handle, -// ============================================================================= + // workspace and parameters + cholmod_common *cc +) ; +template void spqr_freenum +( + spqr_numeric **QRnum_handle, -template void spqr_freenum + // workspace and parameters + cholmod_common *cc +) ; +template void spqr_freenum ( - spqr_numeric **QRnum_handle, + spqr_numeric **QRnum_handle, // workspace and parameters cholmod_common *cc ) ; +// ============================================================================= diff --git a/SPQR/Source/spqr_freesym.cpp b/SPQR/Source/spqr_freesym.cpp index 85cd0eaa1..093589f9c 100644 --- a/SPQR/Source/spqr_freesym.cpp +++ b/SPQR/Source/spqr_freesym.cpp @@ -11,17 +11,17 @@ #include "spqr.hpp" -void spqr_freesym +template void spqr_freesym ( - spqr_symbolic **QRsym_handle, + spqr_symbolic **QRsym_handle, // workspace and parameters cholmod_common *cc ) { - spqr_symbolic *QRsym ; - spqr_gpu *QRgpu ; - int64_t m, n, anz, nf, rjsize, ns, ntasks ; + spqr_symbolic *QRsym ; + spqr_gpu_impl *QRgpu ; + Int m, n, anz, nf, rjsize, ns, ntasks ; if (QRsym_handle == NULL || *QRsym_handle == NULL) { @@ -36,57 +36,72 @@ void spqr_freesym anz = QRsym->anz ; rjsize = QRsym->rjsize ; - cholmod_l_free (n, sizeof (int64_t), QRsym->Qfill, cc) ; - cholmod_l_free (nf+1, sizeof (int64_t), QRsym->Super, cc) ; - cholmod_l_free (nf+1, sizeof (int64_t), QRsym->Rp, cc) ; - cholmod_l_free (rjsize, sizeof (int64_t), QRsym->Rj, cc) ; - cholmod_l_free (nf+1, sizeof (int64_t), QRsym->Parent, cc) ; - cholmod_l_free (nf+2, sizeof (int64_t), QRsym->Childp, cc) ; - cholmod_l_free (nf+1, sizeof (int64_t), QRsym->Child, cc) ; - cholmod_l_free (nf+1, sizeof (int64_t), QRsym->Post, cc) ; - cholmod_l_free (m, sizeof (int64_t), QRsym->PLinv, cc) ; - cholmod_l_free (n+2, sizeof (int64_t), QRsym->Sleft, cc) ; - cholmod_l_free (m+1, sizeof (int64_t), QRsym->Sp, cc) ; - cholmod_l_free (anz, sizeof (int64_t), QRsym->Sj, cc) ; + spqr_free (n, sizeof (Int), QRsym->Qfill, cc) ; + spqr_free (nf+1, sizeof (Int), QRsym->Super, cc) ; + spqr_free (nf+1, sizeof (Int), QRsym->Rp, cc) ; + spqr_free (rjsize, sizeof (Int), QRsym->Rj, cc) ; + spqr_free (nf+1, sizeof (Int), QRsym->Parent, cc) ; + spqr_free (nf+2, sizeof (Int), QRsym->Childp, cc) ; + spqr_free (nf+1, sizeof (Int), QRsym->Child, cc) ; + spqr_free (nf+1, sizeof (Int), QRsym->Post, cc) ; + spqr_free (m, sizeof (Int), QRsym->PLinv, cc) ; + spqr_free (n+2, sizeof (Int), QRsym->Sleft, cc) ; + spqr_free (m+1, sizeof (Int), QRsym->Sp, cc) ; + spqr_free (anz, sizeof (Int), QRsym->Sj, cc) ; - cholmod_l_free (nf+1, sizeof (int64_t), QRsym->Hip, cc) ; + spqr_free (nf+1, sizeof (Int), QRsym->Hip, cc) ; - cholmod_l_free (nf+1, sizeof (int64_t), QRsym->Fm, cc) ; - cholmod_l_free (nf+1, sizeof (int64_t), QRsym->Cm, cc) ; + spqr_free (nf+1, sizeof (Int), QRsym->Fm, cc) ; + spqr_free (nf+1, sizeof (Int), QRsym->Cm, cc) ; - cholmod_l_free (n, sizeof (int64_t), QRsym->ColCount, cc) ; + spqr_free (n, sizeof (Int), QRsym->ColCount, cc) ; // gpu metadata QRgpu = QRsym->QRgpu; if(QRgpu) { - cholmod_l_free (nf, sizeof (int64_t), QRgpu->RimapOffsets, cc) ; - cholmod_l_free (nf, sizeof (int64_t), QRgpu->RjmapOffsets, cc) ; - cholmod_l_free (nf+2, sizeof (int64_t), QRgpu->Stagingp, cc) ; - cholmod_l_free (nf, sizeof (int64_t), QRgpu->StageMap, cc) ; - cholmod_l_free (nf+1, sizeof (size_t), QRgpu->FSize, cc) ; - cholmod_l_free (nf+1, sizeof (size_t), QRgpu->RSize, cc) ; - cholmod_l_free (nf+1, sizeof (size_t), QRgpu->SSize, cc) ; - cholmod_l_free (nf, sizeof (int64_t), QRgpu->FOffsets, cc) ; - cholmod_l_free (nf, sizeof (int64_t), QRgpu->ROffsets, cc) ; - cholmod_l_free (nf, sizeof (int64_t), QRgpu->SOffsets, cc) ; - - cholmod_l_free (1, sizeof (spqr_gpu), QRgpu, cc) ; + spqr_free (nf, sizeof (Int), QRgpu->RimapOffsets, cc) ; + spqr_free (nf, sizeof (Int), QRgpu->RjmapOffsets, cc) ; + spqr_free (nf+2, sizeof (Int), QRgpu->Stagingp, cc) ; + spqr_free (nf, sizeof (Int), QRgpu->StageMap, cc) ; + spqr_free (nf+1, sizeof (size_t), QRgpu->FSize, cc) ; + spqr_free (nf+1, sizeof (size_t), QRgpu->RSize, cc) ; + spqr_free (nf+1, sizeof (size_t), QRgpu->SSize, cc) ; + spqr_free (nf, sizeof (Int), QRgpu->FOffsets, cc) ; + spqr_free (nf, sizeof (Int), QRgpu->ROffsets, cc) ; + spqr_free (nf, sizeof (Int), QRgpu->SOffsets, cc) ; + + spqr_free (1, sizeof (spqr_gpu), QRgpu, cc) ; } // parallel analysis ntasks = QRsym->ntasks ; - cholmod_l_free (ntasks+2, sizeof (int64_t), QRsym->TaskChildp, cc) ; - cholmod_l_free (ntasks+1, sizeof (int64_t), QRsym->TaskChild, cc) ; - cholmod_l_free (nf+1, sizeof (int64_t), QRsym->TaskFront, cc) ; - cholmod_l_free (ntasks+2, sizeof (int64_t), QRsym->TaskFrontp, cc) ; - cholmod_l_free (ntasks+1, sizeof (int64_t), QRsym->TaskStack, cc) ; - cholmod_l_free (nf+1, sizeof (int64_t), QRsym->On_stack, cc) ; + spqr_free (ntasks+2, sizeof (Int), QRsym->TaskChildp, cc) ; + spqr_free (ntasks+1, sizeof (Int), QRsym->TaskChild, cc) ; + spqr_free (nf+1, sizeof (Int), QRsym->TaskFront, cc) ; + spqr_free (ntasks+2, sizeof (Int), QRsym->TaskFrontp, cc) ; + spqr_free (ntasks+1, sizeof (Int), QRsym->TaskStack, cc) ; + spqr_free (nf+1, sizeof (Int), QRsym->On_stack, cc) ; ns = QRsym->ns ; - cholmod_l_free (ns+2, sizeof (int64_t), QRsym->Stack_maxstack, cc) ; + spqr_free (ns+2, sizeof (Int), QRsym->Stack_maxstack, cc) ; - cholmod_l_free (1, sizeof (spqr_symbolic), QRsym, cc) ; + spqr_free (1, sizeof (spqr_symbolic ), QRsym, cc) ; *QRsym_handle = NULL ; } + +template void spqr_freesym +( + spqr_symbolic **QRsym_handle, + + // workspace and parameters + cholmod_common *cc +) ; +template void spqr_freesym +( + spqr_symbolic **QRsym_handle, + + // workspace and parameters + cholmod_common *cc +) ; diff --git a/SPQR/Source/spqr_front.cpp b/SPQR/Source/spqr_front.cpp index 9ea989e0c..4bad6ad45 100644 --- a/SPQR/Source/spqr_front.cpp +++ b/SPQR/Source/spqr_front.cpp @@ -109,8 +109,8 @@ memory and passes NULL pointers, this function will segfault. */ -#include "spqr.hpp" +#include "spqr.hpp" #define SMALL 5000 #define MINCHUNK 4 #define MINCHUNK_RATIO 4 @@ -149,7 +149,12 @@ inline double spqr_private_larfg (int64_t n, double *X, cholmod_common *cc) SUITESPARSE_LAPACK_dlarfg (n, X, X + 1, 1, &tau, cc->blas_ok) ; return (tau) ; } - +inline double spqr_private_larfg (int32_t n, double *X, cholmod_common *cc) +{ + double tau = 0 ; + SUITESPARSE_LAPACK_dlarfg (n, X, X + 1, 1, &tau, cc->blas_ok) ; + return (tau) ; +} inline Complex spqr_private_larfg (int64_t n, Complex *X, cholmod_common *cc) { @@ -157,12 +162,17 @@ inline Complex spqr_private_larfg (int64_t n, Complex *X, cholmod_common *cc) SUITESPARSE_LAPACK_zlarfg (n, X, X + 1, 1, &tau, cc->blas_ok) ; return (tau) ; } +inline Complex spqr_private_larfg (int32_t n, Complex *X, cholmod_common *cc) +{ + Complex tau = 0 ; + SUITESPARSE_LAPACK_zlarfg (n, X, X + 1, 1, &tau, cc->blas_ok) ; + return (tau) ; +} - -template Entry spqr_private_house // returns tau +template Entry spqr_private_house // returns tau ( // inputs, not modified - int64_t n, + Int n, // input/output Entry *X, // size n @@ -199,6 +209,12 @@ inline void spqr_private_larf (int64_t m, int64_t n, double *V, double tau, char left = 'L' ; SUITESPARSE_LAPACK_dlarf (&left, m, n, V, 1, &tau, C, ldc, W, cc->blas_ok) ; } +inline void spqr_private_larf (int32_t m, int32_t n, double *V, double tau, + double *C, int32_t ldc, double *W, cholmod_common *cc) +{ + char left = 'L' ; + SUITESPARSE_LAPACK_dlarf (&left, m, n, V, 1, &tau, C, ldc, W, cc->blas_ok) ; +} inline void spqr_private_larf (int64_t m, int64_t n, Complex *V, Complex tau, Complex *C, int64_t ldc, Complex *W, cholmod_common *cc) @@ -208,14 +224,21 @@ inline void spqr_private_larf (int64_t m, int64_t n, Complex *V, Complex tau, SUITESPARSE_LAPACK_zlarf (&left, m, n, V, 1, &conj_tau, C, ldc, W, cc->blas_ok) ; } +inline void spqr_private_larf (int32_t m, int32_t n, Complex *V, Complex tau, + Complex *C, int32_t ldc, Complex *W, cholmod_common *cc) +{ + char left = 'L' ; + Complex conj_tau = spqr_conj (tau) ; + SUITESPARSE_LAPACK_zlarf (&left, m, n, V, 1, &conj_tau, C, ldc, W, + cc->blas_ok) ; +} - -template void spqr_private_apply1 +template void spqr_private_apply1 ( // inputs, not modified - int64_t m, // C is m-by-n - int64_t n, - int64_t ldc, // leading dimension of C + Int m, // C is m-by-n + Int n, + Int ldc, // leading dimension of C Entry *V, // size m, Householder vector V Entry tau, // Householder coefficient @@ -250,20 +273,20 @@ template void spqr_private_apply1 // rank that indicates the first entry in C, which is F (rank,npiv), or 0 // on error. -template int64_t spqr_front +template Int spqr_front ( // input, not modified - int64_t m, // F is m-by-n with leading dimension m - int64_t n, - int64_t npiv, // number of pivot columns + Int m, // F is m-by-n with leading dimension m + Int n, + Int npiv, // number of pivot columns double tol, // a column is flagged as dead if its norm is <= tol - int64_t ntol, // apply tol only to first ntol pivot columns - int64_t fchunk, // block size for compact WY Householder reflections, + Int ntol, // apply tol only to first ntol pivot columns + Int fchunk, // block size for compact WY Householder reflections, // treated as 1 if fchunk <= 1 // input/output Entry *F, // frontal matrix F of size m-by-n - int64_t *Stair, // size n, entries F (Stair[k]:m-1, k) are all zero, + Int *Stair, // size n, entries F (Stair[k]:m-1, k) are all zero, // for each k = 0:n-1, and remain zero on output. char *Rdead, // size npiv; all zero on input. If k is dead, // Rdead [k] is set to 1 @@ -284,7 +307,7 @@ template int64_t spqr_front Entry tau ; double wk ; Entry *V ; - int64_t k, t, g, g1, nv, k1, k2, i, t0, vzeros, mleft, nleft, vsize, minchunk, + Int k, t, g, g1, nv, k1, k2, i, t0, vzeros, mleft, nleft, vsize, minchunk, rank ; // NOTE: inputs are not checked for NULL (except if debugging enabled) @@ -493,7 +516,7 @@ template int64_t spqr_front // k+1:n-1, or n-k-1 columns). Applying the Householder reflection // to just one column takes 4*(t-g) flops. - FLOP_COUNT ((t-g) * (3 + 4 * (n-k-1))) ; + FLOP_COUNT2 ((t-g) , (3 + 4 * (n-k-1))) ; // ----------------------------------------------------------------- // apply the kth Householder reflection to the current panel @@ -553,10 +576,67 @@ template int64_t spqr_front return (rank) ; } +template int32_t spqr_front +( + // input, not modified + int32_t m, // F is m-by-n with leading dimension m + int32_t n, + int32_t npiv, // number of pivot columns + double tol, // a column is flagged as dead if its norm is <= tol + int32_t ntol, // apply tol only to first ntol pivot columns + int32_t fchunk, // block size for compact WY Householder reflections, + // treated as 1 if fchunk <= 1 -// ============================================================================= + // input/output + double *F, // frontal matrix F of size m-by-n + int32_t *Stair, // size n, entries F (Stair[k]:m-1, k) are all zero, + // for each k = 0:n-1, and remain zero on output. + char *Rdead, // size npiv; all zero on input. If k is dead, + // Rdead [k] is set to 1 + + // output, not defined on input + double *Tau, // size n, Householder coefficients + + // workspace, undefined on input and output + double *W, // size b*n, where b = min (fchunk,n,m) + + // input/output + double *wscale, + double *wssq, -template int64_t spqr_front + cholmod_common *cc +) ; +template int32_t spqr_front +( + // input, not modified + int32_t m, // F is m-by-n with leading dimension m + int32_t n, + int32_t npiv, // number of pivot columns + double tol, // a column is flagged as dead if its norm is <= tol + int32_t ntol, // apply tol only to first ntol pivot columns + int32_t fchunk, // block size for compact WY Householder reflections, + // treated as 1 if fchunk <= 1 + + // input/output + Complex *F, // frontal matrix F of size m-by-n + int32_t *Stair, // size n, entries F (Stair[k]:m-1, k) are all zero, + // for each k = 0:n-1, and remain zero on output. + char *Rdead, // size npiv; all zero on input. If k is dead, + // Rdead [k] is set to 1 + + // output, not defined on input + Complex *Tau, // size n, Householder coefficients + + // workspace, undefined on input and output + Complex *W, // size b*n, where b = min (fchunk,n,m) + + // input/output + double *wscale, + double *wssq, + + cholmod_common *cc +) ; +template int64_t spqr_front ( // input, not modified int64_t m, // F is m-by-n with leading dimension m @@ -565,21 +645,20 @@ template int64_t spqr_front double tol, // a column is flagged as dead if its norm is <= tol int64_t ntol, // apply tol only to first ntol pivot columns int64_t fchunk, // block size for compact WY Householder reflections, - // treated as 1 if fchunk <= 1 (in which case the - // unblocked code is used). + // treated as 1 if fchunk <= 1 // input/output - double *F, // frontal matrix F of size m-by-n + double *F, // frontal matrix F of size m-by-n int64_t *Stair, // size n, entries F (Stair[k]:m-1, k) are all zero, - // and remain zero on output. + // for each k = 0:n-1, and remain zero on output. char *Rdead, // size npiv; all zero on input. If k is dead, // Rdead [k] is set to 1 // output, not defined on input - double *Tau, // size n, Householder coefficients + double *Tau, // size n, Householder coefficients // workspace, undefined on input and output - double *W, // size b*n, where b = min (fchunk,n,m) + double *W, // size b*n, where b = min (fchunk,n,m) // input/output double *wscale, @@ -587,10 +666,7 @@ template int64_t spqr_front cholmod_common *cc ) ; - -// ============================================================================= - -template int64_t spqr_front +template int64_t spqr_front ( // input, not modified int64_t m, // F is m-by-n with leading dimension m @@ -599,21 +675,20 @@ template int64_t spqr_front double tol, // a column is flagged as dead if its norm is <= tol int64_t ntol, // apply tol only to first ntol pivot columns int64_t fchunk, // block size for compact WY Householder reflections, - // treated as 1 if fchunk <= 1 (in which case the - // unblocked code is used). + // treated as 1 if fchunk <= 1 // input/output - Complex *F, // frontal matrix F of size m-by-n + Complex *F, // frontal matrix F of size m-by-n int64_t *Stair, // size n, entries F (Stair[k]:m-1, k) are all zero, - // and remain zero on output. + // for each k = 0:n-1, and remain zero on output. char *Rdead, // size npiv; all zero on input. If k is dead, // Rdead [k] is set to 1 // output, not defined on input - Complex *Tau, // size n, Householder coefficients + Complex *Tau, // size n, Householder coefficients // workspace, undefined on input and output - Complex *W, // size b*n, where b = min (fchunk,n,m) + Complex *W, // size b*n, where b = min (fchunk,n,m) // input/output double *wscale, diff --git a/SPQR/Source/spqr_fsize.cpp b/SPQR/Source/spqr_fsize.cpp index 25b8bcf06..99c03bd3c 100644 --- a/SPQR/Source/spqr_fsize.cpp +++ b/SPQR/Source/spqr_fsize.cpp @@ -12,24 +12,24 @@ #include "spqr.hpp" -int64_t spqr_fsize // returns # of rows of F +template Int spqr_fsize // returns # of rows of F ( // inputs, not modified - int64_t f, - int64_t *Super, // size nf, from QRsym - int64_t *Rp, // size nf, from QRsym - int64_t *Rj, // size rjsize, from QRsym - int64_t *Sleft, // size n+2, from QRsym - int64_t *Child, // size nf, from QRsym - int64_t *Childp, // size nf+1, from QRsym - int64_t *Cm, // size nf + Int f, + Int *Super, // size nf, from QRsym + Int *Rp, // size nf, from QRsym + Int *Rj, // size rjsize, from QRsym + Int *Sleft, // size n+2, from QRsym + Int *Child, // size nf, from QRsym + Int *Childp, // size nf+1, from QRsym + Int *Cm, // size nf // outputs, not defined on input - int64_t *Fmap, // size n - int64_t *Stair // size fn + Int *Fmap, // size n + Int *Stair // size fn ) { - int64_t col1, col2, p1, p2, fp, fn, fm, col, p, j, c, pc, cm, ci, t, fpc ; + Int col1, col2, p1, p2, fp, fn, fm, col, p, j, c, pc, cm, ci, t, fpc ; // ------------------------------------------------------------------------- // get the front F @@ -133,3 +133,35 @@ int64_t spqr_fsize // returns # of rows of F return (fm) ; } +template int32_t spqr_fsize // returns # of rows of F +( + // inputs, not modified + int32_t f, + int32_t *Super, // size nf, from QRsym + int32_t *Rp, // size nf, from QRsym + int32_t *Rj, // size rjsize, from QRsym + int32_t *Sleft, // size n+2, from QRsym + int32_t *Child, // size nf, from QRsym + int32_t *Childp, // size nf+1, from QRsym + int32_t *Cm, // size nf + + // outputs, not defined on input + int32_t *Fmap, // size n + int32_t *Stair // size fn +) ; +template int64_t spqr_fsize // returns # of rows of F +( + // inputs, not modified + int64_t f, + int64_t *Super, // size nf, from QRsym + int64_t *Rp, // size nf, from QRsym + int64_t *Rj, // size rjsize, from QRsym + int64_t *Sleft, // size n+2, from QRsym + int64_t *Child, // size nf, from QRsym + int64_t *Childp, // size nf+1, from QRsym + int64_t *Cm, // size nf + + // outputs, not defined on input + int64_t *Fmap, // size n + int64_t *Stair // size fn +) ; diff --git a/SPQR/Source/spqr_happly.cpp b/SPQR/Source/spqr_happly.cpp index 28d71c668..82a3f1d26 100644 --- a/SPQR/Source/spqr_happly.cpp +++ b/SPQR/Source/spqr_happly.cpp @@ -35,26 +35,26 @@ // Loads V with a panel of Householder vectors and applies them to X -template void spqr_private_do_panel +template void spqr_private_do_panel ( // inputs, not modified int method, // which method to use (0,1,2,3) - int64_t m, - int64_t n, - int64_t v, // number of Householder vectors in the panel - int64_t *Wi, // Wi [0:v-1] defines the pattern of the panel - int64_t h1, // load H (h1) to H (h2-1) into V - int64_t h2, + Int m, + Int n, + Int v, // number of Householder vectors in the panel + Int *Wi, // Wi [0:v-1] defines the pattern of the panel + Int h1, // load H (h1) to H (h2-1) into V + Int h2, // FUTURE : make H cholmod_sparse: - int64_t *Hp, // Householder vectors: mh-by-nh sparse matrix - int64_t *Hi, + Int *Hp, // Householder vectors: mh-by-nh sparse matrix + Int *Hi, Entry *Hx, Entry *Tau, // Householder coefficients (size nh) // input/output - int64_t *Wmap, // inverse of Wi on input, set to all EMPTY on output + Int *Wmap, // inverse of Wi on input, set to all EMPTY on output Entry *X, // m-by-n with leading dimension m // workspace, undefined on input and output @@ -65,7 +65,7 @@ template void spqr_private_do_panel ) { Entry *V1 ; - int64_t h, k, p, i ; + Int h, k, p, i ; // ------------------------------------------------------------------------- // load the panel with Householder vectors h1 ... h2-1 @@ -117,18 +117,18 @@ template void spqr_private_do_panel // === spqr_happly ============================================================= // ============================================================================= -template void spqr_happly +template void spqr_happly ( // input int method, // 0,1,2,3 - int64_t m, // X is m-by-n with leading dimension m - int64_t n, + Int m, // X is m-by-n with leading dimension m + Int n, // FUTURE : make H cholmod_sparse: - int64_t nh, // number of Householder vectors - int64_t *Hp, // size nh+1, column pointers for H - int64_t *Hi, // size hnz = Hp [nh], row indices of H + Int nh, // number of Householder vectors + Int *Hp, // size nh+1, column pointers for H + Int *Hi, // size hnz = Hp [nh], row indices of H Entry *Hx, // size hnz, Householder values. Note that the first // entry in each column must be equal to 1.0 @@ -138,17 +138,17 @@ template void spqr_happly Entry *X, // size m-by-n with leading dimension m // workspace - int64_t vmax, - int64_t hchunk, - int64_t *Wi, // size vmax - int64_t *Wmap, // size MAX(mh,1) where H is mh-by-nh; all EMPTY + Int vmax, + Int hchunk, + Int *Wi, // size vmax + Int *Wmap, // size MAX(mh,1) where H is mh-by-nh; all EMPTY Entry *C, // size csize Entry *V, // size vsize cholmod_common *cc ) { Entry *W ; - int64_t h, h1, h2, i, k, hmax, hmin, v, v1, p, done, v2, mh ; + Int h, h1, h2, i, k, hmax, hmin, v, v1, p, done, v2, mh ; // ------------------------------------------------------------------------- // get inputs @@ -198,7 +198,7 @@ template void spqr_happly Wi [v] = i ; v++ ; } - int64_t this_vmax = 2*v + 8 ; // max # rows in this panel + Int this_vmax = 2*v + 8 ; // max # rows in this panel this_vmax = MIN (this_vmax, mh) ; ASSERT (this_vmax <= vmax) ; @@ -290,7 +290,7 @@ template void spqr_happly Wmap [i] = v ; // this will be shifted later Wi [v] = i ; } - int64_t this_vmin = v - 32 ; + Int this_vmin = v - 32 ; this_vmin = MAX (this_vmin, 0) ; // ----------------------------------------------------------------- @@ -308,7 +308,7 @@ template void spqr_happly p = Hp [h1] ; // check to see that this vector fits in the lower triangle - int64_t hlen = Hp [h1+1] - p ; + Int hlen = Hp [h1+1] - p ; if (hlen > 1 && Hi [p+1] != Wi [v]) { // h1 will not be part of this panel @@ -384,65 +384,234 @@ template void spqr_happly } } +template void spqr_private_do_panel +( + // inputs, not modified + int method, // which method to use (0,1,2,3) + int32_t m, + int32_t n, + int32_t v, // number of Householder vectors in the panel + int32_t *Wi, // Wi [0:v-1] defines the pattern of the panel + int32_t h1, // load H (h1) to H (h2-1) into V + int32_t h2, + + // FUTURE : make H cholmod_sparse: + int32_t *Hp, // Householder vectors: mh-by-nh sparse matrix + int32_t *Hi, + double *Hx, -// ============================================================================= + double *Tau, // Householder coefficients (size nh) + + // input/output + int32_t *Wmap, // inverse of Wi on input, set to all EMPTY on output + double *X, // m-by-n with leading dimension m + + // workspace, undefined on input and output + double *V, // dense panel + double *C, // workspace + double *W, // workspace + cholmod_common *cc +) ; + +template void spqr_private_do_panel +( + // inputs, not modified + int method, // which method to use (0,1,2,3) + int64_t m, + int64_t n, + int64_t v, // number of Householder vectors in the panel + int64_t *Wi, // Wi [0:v-1] defines the pattern of the panel + int64_t h1, // load H (h1) to H (h2-1) into V + int64_t h2, + + // FUTURE : make H cholmod_sparse: + int64_t *Hp, // Householder vectors: mh-by-nh sparse matrix + int64_t *Hi, + double *Hx, + + double *Tau, // Householder coefficients (size nh) -template void spqr_happly + // input/output + int64_t *Wmap, // inverse of Wi on input, set to all EMPTY on output + double *X, // m-by-n with leading dimension m + + // workspace, undefined on input and output + double *V, // dense panel + double *C, // workspace + double *W, // workspace + cholmod_common *cc +) ; + +template void spqr_private_do_panel +( + // inputs, not modified + int method, // which method to use (0,1,2,3) + int32_t m, + int32_t n, + int32_t v, // number of Householder vectors in the panel + int32_t *Wi, // Wi [0:v-1] defines the pattern of the panel + int32_t h1, // load H (h1) to H (h2-1) into V + int32_t h2, + + // FUTURE : make H cholmod_sparse: + int32_t *Hp, // Householder vectors: mh-by-nh sparse matrix + int32_t *Hi, + Complex *Hx, + + Complex *Tau, // Householder coefficients (size nh) + + // input/output + int32_t *Wmap, // inverse of Wi on input, set to all EMPTY on output + Complex *X, // m-by-n with leading dimension m + + // workspace, undefined on input and output + Complex *V, // dense panel + Complex *C, // workspace + Complex *W, // workspace + cholmod_common *cc +) ; + +template void spqr_private_do_panel +( + // inputs, not modified + int method, // which method to use (0,1,2,3) + int64_t m, + int64_t n, + int64_t v, // number of Householder vectors in the panel + int64_t *Wi, // Wi [0:v-1] defines the pattern of the panel + int64_t h1, // load H (h1) to H (h2-1) into V + int64_t h2, + + // FUTURE : make H cholmod_sparse: + int64_t *Hp, // Householder vectors: mh-by-nh sparse matrix + int64_t *Hi, + Complex *Hx, + + Complex *Tau, // Householder coefficients (size nh) + + // input/output + int64_t *Wmap, // inverse of Wi on input, set to all EMPTY on output + Complex *X, // m-by-n with leading dimension m + + // workspace, undefined on input and output + Complex *V, // dense panel + Complex *C, // workspace + Complex *W, // workspace + cholmod_common *cc +) ; +template void spqr_happly ( // input int method, // 0,1,2,3 - int64_t m, // X is m-by-n + int32_t m, // X is m-by-n with leading dimension m + int32_t n, + + // FUTURE : make H cholmod_sparse: + int32_t nh, // number of Householder vectors + int32_t *Hp, // size nh+1, column pointers for H + int32_t *Hi, // size hnz = Hp [nh], row indices of H + double *Hx, // size hnz, Householder values. Note that the first + // entry in each column must be equal to 1.0 + + double *Tau, // size nh + + // input/output + double *X, // size m-by-n with leading dimension m + + // workspace + int32_t vmax, + int32_t hchunk, + int32_t *Wi, // size vmax + int32_t *Wmap, // size MAX(mh,1) where H is mh-by-nh; all EMPTY + double *C, // size csize + double *V, // size vsize + cholmod_common *cc +) ; +template void spqr_happly +( + // input + int method, // 0,1,2,3 + + int32_t m, // X is m-by-n with leading dimension m + int32_t n, + + // FUTURE : make H cholmod_sparse: + int32_t nh, // number of Householder vectors + int32_t *Hp, // size nh+1, column pointers for H + int32_t *Hi, // size hnz = Hp [nh], row indices of H + Complex *Hx, // size hnz, Householder values. Note that the first + // entry in each column must be equal to 1.0 + + Complex *Tau, // size nh + + // input/output + Complex *X, // size m-by-n with leading dimension m + + // workspace + int32_t vmax, + int32_t hchunk, + int32_t *Wi, // size vmax + int32_t *Wmap, // size MAX(mh,1) where H is mh-by-nh; all EMPTY + Complex *C, // size csize + Complex *V, // size vsize + cholmod_common *cc +) ; +template void spqr_happly +( + // input + int method, // 0,1,2,3 + + int64_t m, // X is m-by-n with leading dimension m int64_t n, + // FUTURE : make H cholmod_sparse: int64_t nh, // number of Householder vectors int64_t *Hp, // size nh+1, column pointers for H int64_t *Hi, // size hnz = Hp [nh], row indices of H - double *Hx, // size hnz, Householder values. Note that the first + double *Hx, // size hnz, Householder values. Note that the first // entry in each column must be equal to 1.0 - double *Tau, // size nh + double *Tau, // size nh // input/output - double *X, // size m-by-n with leading dimension m + double *X, // size m-by-n with leading dimension m // workspace int64_t vmax, int64_t hchunk, int64_t *Wi, // size vmax - int64_t *Wmap, // size MAX(mh,1) where H is mh-by-nh - double *C, // size csize - double *V, // size vsize + int64_t *Wmap, // size MAX(mh,1) where H is mh-by-nh; all EMPTY + double *C, // size csize + double *V, // size vsize cholmod_common *cc ) ; - -// ============================================================================= - -template void spqr_happly +template void spqr_happly ( // input int method, // 0,1,2,3 - int64_t m, // X is m-by-n + int64_t m, // X is m-by-n with leading dimension m int64_t n, + // FUTURE : make H cholmod_sparse: int64_t nh, // number of Householder vectors int64_t *Hp, // size nh+1, column pointers for H int64_t *Hi, // size hnz = Hp [nh], row indices of H - Complex *Hx, // size hnz, Householder values. Note that the first + Complex *Hx, // size hnz, Householder values. Note that the first // entry in each column must be equal to 1.0 - Complex *Tau, // size nh + Complex *Tau, // size nh // input/output - Complex *X, // size m-by-n with leading dimension m + Complex *X, // size m-by-n with leading dimension m // workspace int64_t vmax, int64_t hchunk, int64_t *Wi, // size vmax - int64_t *Wmap, // size MAX(mh,1) where H is mh-by-nh - Complex *C, // size csize - Complex *V, // size vsize + int64_t *Wmap, // size MAX(mh,1) where H is mh-by-nh; all EMPTY + Complex *C, // size csize + Complex *V, // size vsize cholmod_common *cc ) ; diff --git a/SPQR/Source/spqr_happly_work.cpp b/SPQR/Source/spqr_happly_work.cpp index 40f1b4dca..3523229c9 100644 --- a/SPQR/Source/spqr_happly_work.cpp +++ b/SPQR/Source/spqr_happly_work.cpp @@ -11,26 +11,26 @@ #include "spqr.hpp" -int spqr_happly_work +template int spqr_happly_work ( // input int method, // 0,1,2,3 - int64_t m, // X is m-by-n - int64_t n, + Int m, // X is m-by-n + Int n, // FUTURE : make H cholmod_sparse: - int64_t nh, // number of Householder vectors - int64_t *Hp, // size nh+1, column pointers for H - int64_t hchunk, + Int nh, // number of Householder vectors + Int *Hp, // size nh+1, column pointers for H + Int hchunk, // outputs; sizes of workspaces needed - int64_t *p_vmax, - int64_t *p_vsize, - int64_t *p_csize + Int *p_vmax, + Int *p_vsize, + Int *p_csize ) { - int64_t maxhlen, h, hlen, vmax, mh, vsize, csize, vsize1, vsize2 ; + Int maxhlen, h, hlen, vmax, mh, vsize, csize, vsize1, vsize2 ; int ok = TRUE ; // ------------------------------------------------------------------------- @@ -65,7 +65,7 @@ int spqr_happly_work // determine workspace sizes // ------------------------------------------------------------------------- - // int64_t overflow cannot occur with vmax since H is already allocated + // Int overflow cannot occur with vmax since H is already allocated if (method == 0 || method == 3) { // apply H in the forward direction; H(0) first, H(nh-1) last @@ -99,3 +99,40 @@ int spqr_happly_work *p_csize = csize ; return (ok) ; } + +template int spqr_happly_work +( + // input + int method, // 0,1,2,3 + + int32_t m, // X is m-by-n + int32_t n, + + // FUTURE : make H cholmod_sparse: + int32_t nh, // number of Householder vectors + int32_t *Hp, // size nh+1, column pointers for H + int32_t hchunk, + + // outputs; sizes of workspaces needed + int32_t *p_vmax, + int32_t *p_vsize, + int32_t *p_csize +) ; +template int spqr_happly_work +( + // input + int method, // 0,1,2,3 + + int64_t m, // X is m-by-n + int64_t n, + + // FUTURE : make H cholmod_sparse: + int64_t nh, // number of Householder vectors + int64_t *Hp, // size nh+1, column pointers for H + int64_t hchunk, + + // outputs; sizes of workspaces needed + int64_t *p_vmax, + int64_t *p_vsize, + int64_t *p_csize +) ; diff --git a/SPQR/Source/spqr_hpinv.cpp b/SPQR/Source/spqr_hpinv.cpp index 115338ea4..9d4ea2a2f 100644 --- a/SPQR/Source/spqr_hpinv.cpp +++ b/SPQR/Source/spqr_hpinv.cpp @@ -13,18 +13,18 @@ #include "spqr.hpp" -template void spqr_hpinv +template void spqr_hpinv ( // input - spqr_symbolic *QRsym, + spqr_symbolic *QRsym, // input/output - spqr_numeric *QRnum, + spqr_numeric *QRnum, // workspace - int64_t *W // size QRnum->m + Int *W // size QRnum->m ) { - int64_t *Hi, *Hii, *Hip, *HPinv, *Hr, *Super, *Rp, *Hm, *Sleft, *PLinv ; - int64_t nf, m, n, f, rm, i, row1, row2, fm, fn, fp, cm, cn, maxfm ; + Int *Hi, *Hii, *Hip, *HPinv, *Hr, *Super, *Rp, *Hm, *Sleft, *PLinv ; + Int nf, m, n, f, rm, i, row1, row2, fm, fn, fp, cm, cn, maxfm ; // ------------------------------------------------------------------------- // get the contents of the QRsym and QRnum objects @@ -50,7 +50,7 @@ template void spqr_hpinv #ifndef NDEBUG for (f = 0 ; f < nf ; f++) { - int64_t j ; + Int j ; rm = 0 ; for (j = Super [f] ; j < Super [f+1] ; j++) { @@ -168,27 +168,39 @@ template void spqr_hpinv } } - -// ============================================================================= - -template void spqr_hpinv +template void spqr_hpinv +( + // input + spqr_symbolic *QRsym, + // input/output + spqr_numeric *QRnum, + // workspace + int32_t *W // size QRnum->m +) ; +template void spqr_hpinv ( // input - spqr_symbolic *QRsym, + spqr_symbolic *QRsym, // input/output - spqr_numeric *QRnum, + spqr_numeric *QRnum, + // workspace + int32_t *W // size QRnum->m +) ; +template void spqr_hpinv +( + // input + spqr_symbolic *QRsym, + // input/output + spqr_numeric *QRnum, // workspace int64_t *W // size QRnum->m ) ; - -// ============================================================================= - -template void spqr_hpinv +template void spqr_hpinv ( // input - spqr_symbolic *QRsym, + spqr_symbolic *QRsym, // input/output - spqr_numeric *QRnum, + spqr_numeric *QRnum, // workspace int64_t *W // size QRnum->m ) ; diff --git a/SPQR/Source/spqr_kernel.cpp b/SPQR/Source/spqr_kernel.cpp index c62239d56..39ce948a3 100644 --- a/SPQR/Source/spqr_kernel.cpp +++ b/SPQR/Source/spqr_kernel.cpp @@ -11,10 +11,10 @@ #include "spqr.hpp" -template void spqr_kernel // _worker +template void spqr_kernel // _worker ( - int64_t task, - spqr_blob *Blob + Int task, + spqr_blob *Blob ) { @@ -22,13 +22,13 @@ template void spqr_kernel // _worker // get the Blob // ------------------------------------------------------------------------- - spqr_symbolic * QRsym = Blob->QRsym ; - spqr_numeric * QRnum = Blob->QRnum ; + spqr_symbolic * QRsym = Blob->QRsym ; + spqr_numeric * QRnum = Blob->QRnum ; double tol = Blob->tol ; - int64_t ntol = Blob->ntol ; - int64_t fchunk = Blob->fchunk ; - spqr_work * Work = Blob->Work ; - int64_t * Cm = Blob->Cm ; + Int ntol = Blob->ntol ; + Int fchunk = Blob->fchunk ; + spqr_work * Work = Blob->Work ; + Int * Cm = Blob->Cm ; Entry ** Cblock = Blob->Cblock ; Entry * Sx = Blob->Sx ; cholmod_common * cc = Blob->cc ; @@ -50,27 +50,27 @@ template void spqr_kernel // _worker // get the contents of the QR symbolic object // ------------------------------------------------------------------------- - int64_t * Super = QRsym->Super ; // size nf+1, gives pivot columns in F - int64_t * Rp = QRsym->Rp ; // size nf+1, pointers for pattern of R - int64_t * Rj = QRsym->Rj ; // size QRsym->rjsize, col indices of R - int64_t * Sleft = QRsym->Sleft ; // size n+2, leftmost column sets - int64_t * Sp = QRsym->Sp ; // size m+1, row pointers for S - int64_t * Sj = QRsym->Sj ; // size anz, column indices for S - int64_t * Child = QRsym->Child ; // size nf, for lists of children - int64_t * Childp = QRsym->Childp ; // size nf+1, for lists of children - int64_t maxfn = QRsym->maxfn ; // max # of columns in any front - int64_t nf = QRsym->nf ; // number of fronts + Int * Super = QRsym->Super ; // size nf+1, gives pivot columns in F + Int * Rp = QRsym->Rp ; // size nf+1, pointers for pattern of R + Int * Rj = QRsym->Rj ; // size QRsym->rjsize, col indices of R + Int * Sleft = QRsym->Sleft ; // size n+2, leftmost column sets + Int * Sp = QRsym->Sp ; // size m+1, row pointers for S + Int * Sj = QRsym->Sj ; // size anz, column indices for S + Int * Child = QRsym->Child ; // size nf, for lists of children + Int * Childp = QRsym->Childp ; // size nf+1, for lists of children + Int maxfn = QRsym->maxfn ; // max # of columns in any front + Int nf = QRsym->nf ; // number of fronts - int64_t * Hip = QRsym->Hip ; // only used if H is kept + Int * Hip = QRsym->Hip ; // only used if H is kept // these arrays are all NULL if QRsym->ntasks: - int64_t * TaskFront = QRsym->TaskFront ; // size nf+1 - int64_t * TaskFrontp = QRsym->TaskFrontp ; // size ntasks+1 - int64_t * TaskStack = QRsym->TaskStack ; // size ntasks+1 - int64_t * On_stack = QRsym->On_stack ; // size nf+1 + Int * TaskFront = QRsym->TaskFront ; // size nf+1 + Int * TaskFrontp = QRsym->TaskFrontp ; // size ntasks+1 + Int * TaskStack = QRsym->TaskStack ; // size ntasks+1 + Int * On_stack = QRsym->On_stack ; // size nf+1 // used for sequential case (when QRnum->ntasks == 1) - int64_t * Post = QRsym->Post ; // size nf + Int * Post = QRsym->Post ; // size nf // ------------------------------------------------------------------------- // get the contents of the QR numeric object @@ -78,19 +78,19 @@ template void spqr_kernel // _worker Entry ** Rblock = QRnum->Rblock ; char * Rdead = QRnum->Rdead ; - int64_t * HStair = QRnum->HStair ; + Int * HStair = QRnum->HStair ; Entry * HTau = QRnum->HTau ; - int64_t * Hii = QRnum->Hii ; // only used if H is kept - int64_t * Hm = QRnum->Hm ; - int64_t * Hr = QRnum->Hr ; - int64_t keepH = QRnum->keepH ; - int64_t ntasks = QRnum->ntasks ; // number of tasks + Int * Hii = QRnum->Hii ; // only used if H is kept + Int * Hm = QRnum->Hm ; + Int * Hr = QRnum->Hr ; + Int keepH = QRnum->keepH ; + Int ntasks = QRnum->ntasks ; // number of tasks // ------------------------------------------------------------------------- // get the stack for this task and the head/top pointers // ------------------------------------------------------------------------- - int64_t stack, kfirst, klast ; + Int stack, kfirst, klast ; if (ntasks == 1) { @@ -112,21 +112,21 @@ template void spqr_kernel // _worker #ifndef NDEBUG Entry **Stacks = QRnum->Stacks ; Entry *Stack = Stacks [stack] ; // stack being used - int64_t stacksize = (ntasks == 1) ? + Int stacksize = (ntasks == 1) ? QRsym->maxstack : QRsym->Stack_maxstack [stack] ; #endif // if H kept, Tau and Stair will point to permanent space in QRnum Entry * Tau = keepH ? NULL : Work [stack].WTwork ; - int64_t * Stair = keepH ? NULL : Work [stack].Stair1 ; + Int * Stair = keepH ? NULL : Work [stack].Stair1 ; Entry * W = Work [stack].WTwork + (keepH ? 0 : maxfn) ; - int64_t * Fmap = Work [stack].Fmap ; - int64_t * Cmap = Work [stack].Cmap ; + Int * Fmap = Work [stack].Fmap ; + Int * Cmap = Work [stack].Cmap ; - int64_t sumfrank = Work [stack].sumfrank ; - int64_t maxfrank = Work [stack].maxfrank ; + Int sumfrank = Work [stack].sumfrank ; + Int maxfrank = Work [stack].maxfrank ; // for keeping track of norm(w) for dead column 2-norms double wscale = Work [stack].wscale ; @@ -136,18 +136,18 @@ template void spqr_kernel // _worker // factorize all the fronts in this task // ------------------------------------------------------------------------- - for (int64_t kf = kfirst ; kf < klast ; kf++) + for (Int kf = kfirst ; kf < klast ; kf++) { // --------------------------------------------------------------------- // factorize front F // --------------------------------------------------------------------- - int64_t f = (ntasks == 1) ? Post [kf] : TaskFront [kf] ; + Int f = (ntasks == 1) ? Post [kf] : TaskFront [kf] ; #ifndef NDEBUG ASSERT (f >= 0 && f < QRsym->nf) ; - for (int64_t col = 0 ; col < QRsym->n ; col++) Fmap [col] = EMPTY ; + for (Int col = 0 ; col < QRsym->n ; col++) Fmap [col] = EMPTY ; #endif if (keepH) @@ -161,12 +161,12 @@ template void spqr_kernel // _worker // determine the size of F, its staircase, and its Fmap // --------------------------------------------------------------------- - int64_t fm = spqr_fsize (f, Super, Rp, Rj, Sleft, Child, Childp, Cm, + Int fm = spqr_fsize (f, Super, Rp, Rj, Sleft, Child, Childp, Cm, Fmap, Stair) ; - int64_t fn = Rp [f+1] - Rp [f] ; // F is fm-by-fn - int64_t col1 = Super [f] ; // first global pivot column in F - int64_t fp = Super [f+1] - col1 ; // with fp pivot columns - int64_t fsize = fm * fn ; + Int fn = Rp [f+1] - Rp [f] ; // F is fm-by-fn + Int col1 = Super [f] ; // first global pivot column in F + Int fp = Super [f+1] - col1 ; // with fp pivot columns + Int fsize = fm * fn ; if (keepH) { Hm [f] = fm ; @@ -188,8 +188,8 @@ template void spqr_kernel // _worker #ifndef NDEBUG PR (("Stack head %ld top %ld total %ld stacksize %ld\n", - (int64_t) (Stack_head - Stack), - (int64_t) (Stack_top - Stack), + (Int) (Stack_head - Stack), + (Int) (Stack_top - Stack), (Stack_head - Stack) + stacksize - (Stack_top - Stack), stacksize)) ; @@ -220,15 +220,15 @@ template void spqr_kernel // _worker // free the C blocks of the children of F // --------------------------------------------------------------------- - for (int64_t p = Childp [f] ; p < Childp [f+1] ; p++) + for (Int p = Childp [f] ; p < Childp [f+1] ; p++) { - int64_t c = Child [p] ; + Int c = Child [p] ; ASSERT (c >= 0 && c < f) ; PR ((" child %ld on stack %ld\n", c, (ntasks == 1) ? 0 : On_stack [c])) ; if (ntasks == 1 || On_stack [c] == stack) { - int64_t ccsize = spqr_csize (c, Rp, Cm, Super) ; + Int ccsize = spqr_csize (c, Rp, Cm, Super) ; Stack_top = MAX (Stack_top, Cblock [c] + ccsize) ; } } @@ -240,14 +240,14 @@ template void spqr_kernel // _worker // factorize the front F // --------------------------------------------------------------------- - int64_t frank = spqr_front (fm, fn, fp, tol, ntol - col1, + Int frank = spqr_front (fm, fn, fp, tol, ntol - col1, fchunk, F, Stair, Rdead + col1, Tau, W, &wscale, &wssq, cc) ; #ifndef NDEBUG #ifndef NPRINT PR (("\n F factorized: f %ld fp %ld frank %ld \n", f, fp, frank)) ; - for (int64_t jj = col1 ; jj < Super [f+1] ; jj++) + for (Int jj = col1 ; jj < Super [f+1] ; jj++) PR (("Rdead [%ld] = %d\n", jj, Rdead [jj])) ; PR (("\n ::: Front factorized:\n")) ; spqrDebug_dumpdense (F, fm, fn, fm, cc) ; @@ -265,14 +265,14 @@ template void spqr_kernel // _worker // pack the C block of front F on stack // --------------------------------------------------------------------- - int64_t csize = spqr_fcsize (fm, fn, fp, frank) ; + Int csize = spqr_fcsize (fm, fn, fp, frank) ; Stack_top -= csize ; #ifndef NDEBUG PR (("Front f %ld csize %ld piv rank %ld\n", f, csize, frank)) ; PR (("Stack head %ld top %ld total %ld stacksize %ld\n", - (int64_t) (Stack_head - Stack), - (int64_t) (Stack_top - Stack), + (Int) (Stack_head - Stack), + (Int) (Stack_top - Stack), (Stack_head - Stack) + stacksize - (Stack_top - Stack), stacksize)) ; @@ -286,8 +286,8 @@ template void spqr_kernel // _worker // pack R or RH of front F in place // --------------------------------------------------------------------- - int64_t rm ; - int64_t rsize = spqr_rhpack (keepH, fm, fn, fp, Stair, F, F, &rm) ; + Int rm ; + Int rsize = spqr_rhpack (keepH, fm, fn, fp, Stair, F, F, &rm) ; if (keepH) { Hr [f] = rm ; @@ -339,16 +339,23 @@ template void spqr_kernel // _worker Work [stack].wssq = wssq ; } -// ============================================================================= - -template void spqr_kernel +template void spqr_kernel // _worker +( + int32_t task, + spqr_blob *Blob +) ; +template void spqr_kernel // _worker +( + int32_t task, + spqr_blob *Blob +) ; +template void spqr_kernel // _worker ( int64_t task, - spqr_blob *Blob + spqr_blob *Blob ) ; - -template void spqr_kernel +template void spqr_kernel // _worker ( int64_t task, - spqr_blob *Blob + spqr_blob *Blob ) ; diff --git a/SPQR/Source/spqr_larftb.cpp b/SPQR/Source/spqr_larftb.cpp index 07a3619b5..ae4b4afc9 100644 --- a/SPQR/Source/spqr_larftb.cpp +++ b/SPQR/Source/spqr_larftb.cpp @@ -39,16 +39,16 @@ #include "spqr.hpp" -inline void spqr_private_larft (char direct, char storev, int64_t n, int64_t k, - double *V, int64_t ldv, double *Tau, double *T, int64_t ldt, +template inline void spqr_private_larft (char direct, char storev, Int n, Int k, + double *V, Int ldv, double *Tau, double *T, Int ldt, cholmod_common *cc) { SUITESPARSE_LAPACK_dlarft (&direct, &storev, n, k, V, ldv, Tau, T, ldt, cc->blas_ok) ; } -inline void spqr_private_larft (char direct, char storev, int64_t n, int64_t k, - Complex *V, int64_t ldv, Complex *Tau, Complex *T, int64_t ldt, +template inline void spqr_private_larft (char direct, char storev, Int n, Int k, + Complex *V, Int ldv, Complex *Tau, Complex *T, Int ldt, cholmod_common *cc) { SUITESPARSE_LAPACK_zlarft (&direct, &storev, n, k, V, ldv, Tau, T, ldt, @@ -56,9 +56,9 @@ inline void spqr_private_larft (char direct, char storev, int64_t n, int64_t k, } -inline void spqr_private_larfb (char side, char trans, char direct, char storev, - int64_t m, int64_t n, int64_t k, double *V, int64_t ldv, double *T, - int64_t ldt, double *C, int64_t ldc, double *Work, int64_t ldwork, +template inline void spqr_private_larfb (char side, char trans, char direct, char storev, + Int m, Int n, Int k, double *V, Int ldv, double *T, + Int ldt, double *C, Int ldc, double *Work, Int ldwork, cholmod_common *cc) { SUITESPARSE_LAPACK_dlarfb (&side, &trans, &direct, &storev, m, n, k, @@ -66,9 +66,9 @@ inline void spqr_private_larfb (char side, char trans, char direct, char storev, } -inline void spqr_private_larfb (char side, char trans, char direct, char storev, - int64_t m, int64_t n, int64_t k, Complex *V, int64_t ldv, Complex *T, - int64_t ldt, Complex *C, int64_t ldc, Complex *Work, int64_t ldwork, +template inline void spqr_private_larfb (char side, char trans, char direct, char storev, + Int m, Int n, Int k, Complex *V, Int ldv, Complex *T, + Int ldt, Complex *C, Int ldc, Complex *Work, Int ldwork, cholmod_common *cc) { char tr = (trans == 'T') ? 'C' : 'N' ; // change T to C @@ -79,17 +79,17 @@ inline void spqr_private_larfb (char side, char trans, char direct, char storev, // ============================================================================= -template void spqr_larftb +template void spqr_larftb ( // inputs, not modified (V is modified and then restored on output) int method, // 0,1,2,3 - int64_t m, // C is m-by-n - int64_t n, - int64_t k, // V is v-by-k + Int m, // C is m-by-n + Int n, + Int k, // V is v-by-k // for methods 0 and 1, v = m, // for methods 2 and 3, v = n - int64_t ldc, // leading dimension of C - int64_t ldv, // leading dimension of V + Int ldc, // leading dimension of C + Int ldv, // leading dimension of V Entry *V, // V is v-by-k, unit lower triangular (diag not stored) Entry *Tau, // size k, the k Householder coefficients @@ -156,9 +156,51 @@ template void spqr_larftb } } -// ============================================================================= +template void spqr_larftb +( + // inputs, not modified (V is modified and then restored on output) + int method, // 0,1,2,3 + int32_t m, // C is m-by-n + int32_t n, + int32_t k, // V is v-by-k + // for methods 0 and 1, v = m, + // for methods 2 and 3, v = n + int32_t ldc, // leading dimension of C + int32_t ldv, // leading dimension of V + double *V, // V is v-by-k, unit lower triangular (diag not stored) + double *Tau, // size k, the k Householder coefficients + + // input/output + double *C, // C is m-by-n, with leading dimension ldc + + // workspace, not defined on input or output + double *W, // for methods 0,1: size k*k + n*k + // for methods 2,3: size k*k + m*k + cholmod_common *cc +) ; +template void spqr_larftb +( + // inputs, not modified (V is modified and then restored on output) + int method, // 0,1,2,3 + int32_t m, // C is m-by-n + int32_t n, + int32_t k, // V is v-by-k + // for methods 0 and 1, v = m, + // for methods 2 and 3, v = n + int32_t ldc, // leading dimension of C + int32_t ldv, // leading dimension of V + Complex *V, // V is v-by-k, unit lower triangular (diag not stored) + Complex *Tau, // size k, the k Householder coefficients + + // input/output + Complex *C, // C is m-by-n, with leading dimension ldc -template void spqr_larftb + // workspace, not defined on input or output + Complex *W, // for methods 0,1: size k*k + n*k + // for methods 2,3: size k*k + m*k + cholmod_common *cc +) ; +template void spqr_larftb ( // inputs, not modified (V is modified and then restored on output) int method, // 0,1,2,3 @@ -169,21 +211,18 @@ template void spqr_larftb // for methods 2 and 3, v = n int64_t ldc, // leading dimension of C int64_t ldv, // leading dimension of V - double *V, // V is v-by-k, unit lower triangular (diag not stored) - double *Tau, // size k, the k Householder coefficients + double *V, // V is v-by-k, unit lower triangular (diag not stored) + double *Tau, // size k, the k Householder coefficients // input/output - double *C, // C is m-by-n, with leading dimension ldc + double *C, // C is m-by-n, with leading dimension ldc // workspace, not defined on input or output - double *W, // for methods 0,1: size k*k + n*k + double *W, // for methods 0,1: size k*k + n*k // for methods 2,3: size k*k + m*k cholmod_common *cc ) ; - -// ============================================================================= - -template void spqr_larftb +template void spqr_larftb ( // inputs, not modified (V is modified and then restored on output) int method, // 0,1,2,3 @@ -194,14 +233,14 @@ template void spqr_larftb // for methods 2 and 3, v = n int64_t ldc, // leading dimension of C int64_t ldv, // leading dimension of V - Complex *V, // V is v-by-k, unit lower triangular (diag not stored) - Complex *Tau, // size k, the k Householder coefficients + Complex *V, // V is v-by-k, unit lower triangular (diag not stored) + Complex *Tau, // size k, the k Householder coefficients // input/output - Complex *C, // C is m-by-n, with leading dimension ldc + Complex *C, // C is m-by-n, with leading dimension ldc // workspace, not defined on input or output - Complex *W, // for methods 0,1: size k*k + n*k + Complex *W, // for methods 0,1: size k*k + n*k // for methods 2,3: size k*k + m*k cholmod_common *cc ) ; diff --git a/SPQR/Source/spqr_maxcolnorm.cpp b/SPQR/Source/spqr_maxcolnorm.cpp index 8702b06d7..e77231928 100644 --- a/SPQR/Source/spqr_maxcolnorm.cpp +++ b/SPQR/Source/spqr_maxcolnorm.cpp @@ -11,14 +11,14 @@ #include "spqr.hpp" -inline double spqr_private_nrm2 (int64_t n, double *X, cholmod_common *cc) +template inline double spqr_private_nrm2 (Int n, double *X, cholmod_common *cc) { double norm ; SUITESPARSE_BLAS_dnrm2 (norm, n, X, 1, cc->blas_ok) ; return (norm) ; } -inline double spqr_private_nrm2 (int64_t n, Complex *X, cholmod_common *cc) +template inline double spqr_private_nrm2 (Int n, Complex *X, cholmod_common *cc) { double norm ; SUITESPARSE_BLAS_dznrm2 (norm, n, X, 1, cc->blas_ok) ; @@ -30,7 +30,7 @@ inline double spqr_private_nrm2 (int64_t n, Complex *X, cholmod_common *cc) // === spqr_maxcolnorm ========================================================= // ============================================================================= -template double spqr_maxcolnorm +template double spqr_maxcolnorm ( // inputs, not modified cholmod_sparse *A, @@ -40,7 +40,7 @@ template double spqr_maxcolnorm ) { double norm, maxnorm ; - int64_t j, p, len, n, *Ap ; + Int j, p, len, n, *Ap ; Entry *Ax ; RETURN_IF_NULL_COMMON (EMPTY) ; @@ -48,7 +48,7 @@ template double spqr_maxcolnorm cc->blas_ok = TRUE ; n = A->ncol ; - Ap = (int64_t *) A->p ; + Ap = (Int *) A->p ; Ax = (Entry *) A->x ; maxnorm = 0 ; @@ -60,7 +60,7 @@ template double spqr_maxcolnorm maxnorm = MAX (maxnorm, norm) ; } - if (sizeof (SUITESPARSE_BLAS_INT) < sizeof (int64_t) && !cc->blas_ok) + if (sizeof (SUITESPARSE_BLAS_INT) < sizeof (Int) && !cc->blas_ok) { ERROR (CHOLMOD_INVALID, "problem too large for the BLAS") ; return (EMPTY) ; @@ -69,9 +69,15 @@ template double spqr_maxcolnorm return (maxnorm) ; } -// ============================================================================= +template double spqr_maxcolnorm +( + // inputs, not modified + cholmod_sparse *A, -template double spqr_maxcolnorm + // workspace and parameters + cholmod_common *cc +) ; +template double spqr_maxcolnorm ( // inputs, not modified cholmod_sparse *A, @@ -79,8 +85,15 @@ template double spqr_maxcolnorm // workspace and parameters cholmod_common *cc ) ; +template double spqr_maxcolnorm +( + // inputs, not modified + cholmod_sparse *A, -template double spqr_maxcolnorm + // workspace and parameters + cholmod_common *cc +) ; +template double spqr_maxcolnorm ( // inputs, not modified cholmod_sparse *A, diff --git a/SPQR/Source/spqr_panel.cpp b/SPQR/Source/spqr_panel.cpp index 46a56f937..69ec4eb07 100644 --- a/SPQR/Source/spqr_panel.cpp +++ b/SPQR/Source/spqr_panel.cpp @@ -35,18 +35,18 @@ #include "spqr.hpp" -template void spqr_panel +template void spqr_panel ( // input int method, // 0,1,2,3 - int64_t m, - int64_t n, - int64_t v, // length of the first vector in V - int64_t h, // number of Householder vectors in the panel - int64_t *Vi, // Vi [0:v-1] defines the pattern of the panel + Int m, + Int n, + Int v, // length of the first vector in V + Int h, // number of Householder vectors in the panel + Int *Vi, // Vi [0:v-1] defines the pattern of the panel Entry *V, // v-by-h, panel of Householder vectors Entry *Tau, // size h, Householder coefficients for the panel - int64_t ldx, + Int ldx, // input/output Entry *X, // m-by-n with leading dimension ldx @@ -59,7 +59,7 @@ template void spqr_panel ) { Entry *C1, *X1 ; - int64_t k, p, i ; + Int k, p, i ; // ------------------------------------------------------------------------- // gather X into workspace C @@ -147,51 +147,94 @@ template void spqr_panel } } +template void spqr_panel +( + // input + int method, // 0,1,2,3 + int32_t m, + int32_t n, + int32_t v, // length of the first vector in V + int32_t h, // number of Householder vectors in the panel + int32_t *Vi, // Vi [0:v-1] defines the pattern of the panel + Complex *V, // v-by-h, panel of Householder vectors + Complex *Tau, // size h, Householder coefficients for the panel + int32_t ldx, + + // input/output + Complex *X, // m-by-n with leading dimension ldx -// ============================================================================= + // workspace + Complex *C, // method 0,1: v-by-n; method 2,3: m-by-v + Complex *W, // method 0,1: h*h+n*h; method 2,3: h*h+m*h + + cholmod_common *cc +) ; -template void spqr_panel +template void spqr_panel ( // input - int method, + int method, // 0,1,2,3 int64_t m, int64_t n, - int64_t v, + int64_t v, // length of the first vector in V int64_t h, // number of Householder vectors in the panel int64_t *Vi, // Vi [0:v-1] defines the pattern of the panel - double *V, // v-by-h, panel of Householder vectors - double *Tau, // size h, Householder coefficients for the panel + Complex *V, // v-by-h, panel of Householder vectors + Complex *Tau, // size h, Householder coefficients for the panel int64_t ldx, // input/output - double *X, // m-by-n with leading dimension m + Complex *X, // m-by-n with leading dimension ldx // workspace - double *C, // method 0,1: v-by-n; method 2,3: m-by-v - double *W, // method 0,1: k*k+n*k; method 2,3: k*k+m*k + Complex *C, // method 0,1: v-by-n; method 2,3: m-by-v + Complex *W, // method 0,1: h*h+n*h; method 2,3: h*h+m*h cholmod_common *cc ) ; -template void spqr_panel +template void spqr_panel ( // input - int method, + int method, // 0,1,2,3 + int32_t m, + int32_t n, + int32_t v, // length of the first vector in V + int32_t h, // number of Householder vectors in the panel + int32_t *Vi, // Vi [0:v-1] defines the pattern of the panel + double *V, // v-by-h, panel of Householder vectors + double *Tau, // size h, Householder coefficients for the panel + int32_t ldx, + + // input/output + double *X, // m-by-n with leading dimension ldx + + // workspace + double *C, // method 0,1: v-by-n; method 2,3: m-by-v + double *W, // method 0,1: h*h+n*h; method 2,3: h*h+m*h + + cholmod_common *cc +) ; + +template void spqr_panel +( + // input + int method, // 0,1,2,3 int64_t m, int64_t n, - int64_t v, + int64_t v, // length of the first vector in V int64_t h, // number of Householder vectors in the panel int64_t *Vi, // Vi [0:v-1] defines the pattern of the panel - Complex *V, // v-by-h, panel of Householder vectors - Complex *Tau, // size h, Householder coefficients for the panel + double *V, // v-by-h, panel of Householder vectors + double *Tau, // size h, Householder coefficients for the panel int64_t ldx, // input/output - Complex *X, // m-by-n with leading dimension m + double *X, // m-by-n with leading dimension ldx // workspace - Complex *C, // method 0,1: v-by-n; method 2,3: m-by-v - Complex *W, // method 0,1: k*k+n*k; method 2,3: k*k+m*k + double *C, // method 0,1: v-by-n; method 2,3: m-by-v + double *W, // method 0,1: h*h+n*h; method 2,3: h*h+m*h cholmod_common *cc ) ; diff --git a/SPQR/Source/spqr_parallel.cpp b/SPQR/Source/spqr_parallel.cpp index 1ab8aa4c3..d41405b78 100644 --- a/SPQR/Source/spqr_parallel.cpp +++ b/SPQR/Source/spqr_parallel.cpp @@ -21,7 +21,7 @@ using namespace tbb ; // === spqr_zippy ============================================================== // ============================================================================= -template class spqr_zippy: public task +template class spqr_zippy: public task { public: @@ -29,14 +29,14 @@ template class spqr_zippy: public task // spqr_zippy state // ------------------------------------------------------------------------- - const int64_t id ; + const Int id ; spqr_blob *Blob ; // ------------------------------------------------------------------------- // spqr_zippy constructor // ------------------------------------------------------------------------- - spqr_zippy (int64_t id_, spqr_blob *Blob_) : id (id_), Blob (Blob_) { } + spqr_zippy (Int id_, spqr_blob *Blob_) : id (id_), Blob (Blob_) { } // ------------------------------------------------------------------------- // spqr_zippy task @@ -49,19 +49,19 @@ template class spqr_zippy: public task // spawn my children // --------------------------------------------------------------------- - int64_t *TaskChildp = Blob->QRsym->TaskChildp ; - int64_t *TaskChild = Blob->QRsym->TaskChild ; - int64_t pfirst = TaskChildp [id] ; - int64_t plast = TaskChildp [id+1] ; - int64_t nchildren = plast - pfirst ; + Int *TaskChildp = Blob->QRsym->TaskChildp ; + Int *TaskChild = Blob->QRsym->TaskChild ; + Int pfirst = TaskChildp [id] ; + Int plast = TaskChildp [id+1] ; + Int nchildren = plast - pfirst ; if (nchildren > 0) { // create a list of TBB tasks, one for each child task_list TasksToDo ; - for (int64_t i = 0 ; i < nchildren ; i++) + for (Int i = 0 ; i < nchildren ; i++) { - int64_t child = TaskChild [pfirst+i] ; + Int child = TaskChild [pfirst+i] ; TasksToDo.push_back (*new (allocate_child ( )) spqr_zippy (child, Blob)) ; } @@ -85,35 +85,42 @@ template class spqr_zippy: public task // === spqr_parallel =========================================================== // ============================================================================= -template void spqr_parallel +template void spqr_parallel ( - int64_t ntasks, + Int ntasks, int nthreads, - spqr_blob *Blob + spqr_blob *Blob ) { // fire up TBB on the task tree, starting at the root id = ntasks-1 task_scheduler_init init (nthreads <= 0 ? (task_scheduler_init::automatic) : nthreads) ; spqr_zippy & a = *new (task::allocate_root ( )) - spqr_zippy (ntasks-1, Blob) ; + spqr_zippy (ntasks-1, Blob) ; task::spawn_root_and_wait (a) ; } - -// ============================================================================= - -template void spqr_parallel +template void spqr_parallel +( + int32_t ntasks, + int nthreads, + spqr_blob *Blob +) ; +template void spqr_parallel +( + int32_t ntasks, + int nthreads, + spqr_blob *Blob +) ; +template void spqr_parallel ( int64_t ntasks, int nthreads, - spqr_blob *Blob + spqr_blob *Blob ) ; - -template void spqr_parallel +template void spqr_parallel ( int64_t ntasks, int nthreads, - spqr_blob *Blob + spqr_blob *Blob ) ; - #endif diff --git a/SPQR/Source/spqr_rconvert.cpp b/SPQR/Source/spqr_rconvert.cpp index 91cb7075a..3961def04 100644 --- a/SPQR/Source/spqr_rconvert.cpp +++ b/SPQR/Source/spqr_rconvert.cpp @@ -14,29 +14,29 @@ #include "spqr.hpp" -template void spqr_rconvert +template void spqr_rconvert ( // inputs, not modified - spqr_symbolic *QRsym, - spqr_numeric *QRnum, + spqr_symbolic *QRsym, + spqr_numeric *QRnum, - int64_t n1rows, // added to each row index of Ra, Rb, and H - int64_t econ, // only get entries in rows n1rows to econ-1 - int64_t n2, // Ra = R (:,0:n2-1), Rb = R (:,n2:n-1) + Int n1rows, // added to each row index of Ra, Rb, and H + Int econ, // only get entries in rows n1rows to econ-1 + Int n2, // Ra = R (:,0:n2-1), Rb = R (:,n2:n-1) int getT, // if true, get Rb' instead of Rb // input/output // FUTURE : make Ra, Rb, H2 cholmod_sparse: - int64_t *Rap, // size n2+1; on input, Rap [j] is the column pointer + Int *Rap, // size n2+1; on input, Rap [j] is the column pointer // for Ra. Incremented on output by the number of // entries added to column j of Ra. // output, not defined on input - int64_t *Rai, // size rnz1 = nnz(Ra); row indices of Ra + Int *Rai, // size rnz1 = nnz(Ra); row indices of Ra Entry *Rax, // size rnz; numerical values of Ra // input/output - int64_t *Rbp, // if getT is false: + Int *Rbp, // if getT is false: // size (n-n2)+1; on input, Rbp [j] is the column // pointer for Rb. Incremented on output by the number // of entries added to column j of Rb. @@ -46,16 +46,16 @@ template void spqr_rconvert // of entries added to row i of Rb. // output, not defined on input - int64_t *Rbi, // size rnz2 = nnz(Rb); indices of Rb + Int *Rbi, // size rnz2 = nnz(Rb); indices of Rb Entry *Rbx, // size rnz2; numerical values of Rb // input - int64_t *H2p, // size nh+1; H2p [j] is the column pointer for H. + Int *H2p, // size nh+1; H2p [j] is the column pointer for H. // H2p, H2i, and H2x are ignored if H was not kept // during factorization. nh computed by rcount // output, not defined on input - int64_t *H2i, // size hnz = nnz(H); indices of H + Int *H2i, // size hnz = nnz(H); indices of H Entry *H2x, // size hnz; numerical values of H Entry *H2Tau // size nh; Householder coefficients @@ -63,9 +63,9 @@ template void spqr_rconvert { Entry rij, hij ; Entry **Rblock, *R, *Tau, *HTau ; - int64_t *Rp, *Rj, *Super, *HStair, *Hii, *Stair, *Hip, *Hm, *Hi ; + Int *Rp, *Rj, *Super, *HStair, *Hii, *Stair, *Hip, *Hm, *Hi ; char *Rdead ; - int64_t nf, j, f, col1, fp, pr, fn, rm, k, i, p, getRa, getRb, row1, fm, + Int nf, j, f, col1, fp, pr, fn, rm, k, i, p, getRa, getRb, row1, fm, // n, rjsize, h, getH, keepH, ph, t, nh ; @@ -94,8 +94,8 @@ template void spqr_rconvert } if (getRb) { - int64_t n = QRsym->n ; - int64_t zn = getT ? econ : n-n2 ; + Int n = QRsym->n ; + Int zn = getT ? econ : n-n2 ; for (k = 0 ; k <= zn ; k++) { PR (("Rbp [%ld] = %ld on input\n", k, Rbp [k])) ; @@ -304,15 +304,103 @@ template void spqr_rconvert row1 += rm ; // count the squeezed rows of R } } +template void spqr_rconvert +( + // inputs, not modified + spqr_symbolic *QRsym, + spqr_numeric *QRnum, + int32_t n1rows, // added to each row index of Ra, Rb, and H + int32_t econ, // only get entries in rows n1rows to econ-1 + int32_t n2, // Ra = R (:,0:n2-1), Rb = R (:,n2:n-1) + int getT, // if true, get Rb' instead of Rb -// ============================================================================= + // input/output + // FUTURE : make Ra, Rb, H2 cholmod_sparse: + int32_t *Rap, // size n2+1; on input, Rap [j] is the column pointer + // for Ra. Incremented on output by the number of + // entries added to column j of Ra. + + // output, not defined on input + int32_t *Rai, // size rnz1 = nnz(Ra); row indices of Ra + double *Rax, // size rnz; numerical values of Ra + + // input/output + int32_t *Rbp, // if getT is false: + // size (n-n2)+1; on input, Rbp [j] is the column + // pointer for Rb. Incremented on output by the number + // of entries added to column j of Rb. + // if getT is true: + // size econ+1; on input, Rbp [i] is the row + // pointer for Rb. Incremented on output by the number + // of entries added to row i of Rb. + + // output, not defined on input + int32_t *Rbi, // size rnz2 = nnz(Rb); indices of Rb + double *Rbx, // size rnz2; numerical values of Rb + + // input + int32_t *H2p, // size nh+1; H2p [j] is the column pointer for H. + // H2p, H2i, and H2x are ignored if H was not kept + // during factorization. nh computed by rcount + + // output, not defined on input + int32_t *H2i, // size hnz = nnz(H); indices of H + double *H2x, // size hnz; numerical values of H + + double *H2Tau // size nh; Householder coefficients +) ; +template void spqr_rconvert +( + // inputs, not modified + spqr_symbolic *QRsym, + spqr_numeric *QRnum, + + int32_t n1rows, // added to each row index of Ra, Rb, and H + int32_t econ, // only get entries in rows n1rows to econ-1 + int32_t n2, // Ra = R (:,0:n2-1), Rb = R (:,n2:n-1) + int getT, // if true, get Rb' instead of Rb + + // input/output + // FUTURE : make Ra, Rb, H2 cholmod_sparse: + int32_t *Rap, // size n2+1; on input, Rap [j] is the column pointer + // for Ra. Incremented on output by the number of + // entries added to column j of Ra. + + // output, not defined on input + int32_t *Rai, // size rnz1 = nnz(Ra); row indices of Ra + Complex *Rax, // size rnz; numerical values of Ra + + // input/output + int32_t *Rbp, // if getT is false: + // size (n-n2)+1; on input, Rbp [j] is the column + // pointer for Rb. Incremented on output by the number + // of entries added to column j of Rb. + // if getT is true: + // size econ+1; on input, Rbp [i] is the row + // pointer for Rb. Incremented on output by the number + // of entries added to row i of Rb. + + // output, not defined on input + int32_t *Rbi, // size rnz2 = nnz(Rb); indices of Rb + Complex *Rbx, // size rnz2; numerical values of Rb + + // input + int32_t *H2p, // size nh+1; H2p [j] is the column pointer for H. + // H2p, H2i, and H2x are ignored if H was not kept + // during factorization. nh computed by rcount -template void spqr_rconvert + // output, not defined on input + int32_t *H2i, // size hnz = nnz(H); indices of H + Complex *H2x, // size hnz; numerical values of H + + Complex *H2Tau // size nh; Householder coefficients +) ; +template void spqr_rconvert ( // inputs, not modified - spqr_symbolic *QRsym, - spqr_numeric *QRnum, + spqr_symbolic *QRsym, + spqr_numeric *QRnum, int64_t n1rows, // added to each row index of Ra, Rb, and H int64_t econ, // only get entries in rows n1rows to econ-1 @@ -320,20 +408,20 @@ template void spqr_rconvert int getT, // if true, get Rb' instead of Rb // input/output + // FUTURE : make Ra, Rb, H2 cholmod_sparse: int64_t *Rap, // size n2+1; on input, Rap [j] is the column pointer // for Ra. Incremented on output by the number of // entries added to column j of Ra. // output, not defined on input int64_t *Rai, // size rnz1 = nnz(Ra); row indices of Ra - double *Rax, // size rnz; numerical values of Ra + double *Rax, // size rnz; numerical values of Ra // input/output int64_t *Rbp, // if getT is false: // size (n-n2)+1; on input, Rbp [j] is the column // pointer for Rb. Incremented on output by the number // of entries added to column j of Rb. - // if getT is true: // size econ+1; on input, Rbp [i] is the row // pointer for Rb. Incremented on output by the number @@ -341,7 +429,7 @@ template void spqr_rconvert // output, not defined on input int64_t *Rbi, // size rnz2 = nnz(Rb); indices of Rb - double *Rbx, // size rnz2; numerical values of Rb + double *Rbx, // size rnz2; numerical values of Rb // input int64_t *H2p, // size nh+1; H2p [j] is the column pointer for H. @@ -350,17 +438,15 @@ template void spqr_rconvert // output, not defined on input int64_t *H2i, // size hnz = nnz(H); indices of H - double *H2x, // size hnz; numerical values of H - double *H2Tau // size nh; Householder coefficients -) ; - -// ============================================================================= + double *H2x, // size hnz; numerical values of H -template void spqr_rconvert + double *H2Tau // size nh; Householder coefficients +) ; +template void spqr_rconvert ( // inputs, not modified - spqr_symbolic *QRsym, - spqr_numeric *QRnum, + spqr_symbolic *QRsym, + spqr_numeric *QRnum, int64_t n1rows, // added to each row index of Ra, Rb, and H int64_t econ, // only get entries in rows n1rows to econ-1 @@ -368,20 +454,20 @@ template void spqr_rconvert int getT, // if true, get Rb' instead of Rb // input/output + // FUTURE : make Ra, Rb, H2 cholmod_sparse: int64_t *Rap, // size n2+1; on input, Rap [j] is the column pointer // for Ra. Incremented on output by the number of // entries added to column j of Ra. // output, not defined on input int64_t *Rai, // size rnz1 = nnz(Ra); row indices of Ra - Complex *Rax, // size rnz; numerical values of Ra + Complex *Rax, // size rnz; numerical values of Ra // input/output int64_t *Rbp, // if getT is false: // size (n-n2)+1; on input, Rbp [j] is the column // pointer for Rb. Incremented on output by the number // of entries added to column j of Rb. - // if getT is true: // size econ+1; on input, Rbp [i] is the row // pointer for Rb. Incremented on output by the number @@ -389,7 +475,7 @@ template void spqr_rconvert // output, not defined on input int64_t *Rbi, // size rnz2 = nnz(Rb); indices of Rb - Complex *Rbx, // size rnz2; numerical values of Rb + Complex *Rbx, // size rnz2; numerical values of Rb // input int64_t *H2p, // size nh+1; H2p [j] is the column pointer for H. @@ -398,6 +484,7 @@ template void spqr_rconvert // output, not defined on input int64_t *H2i, // size hnz = nnz(H); indices of H - Complex *H2x, // size hnz; numerical values of H - Complex *H2Tau // size nh; Householder coefficients + Complex *H2x, // size hnz; numerical values of H + + Complex *H2Tau // size nh; Householder coefficients ) ; diff --git a/SPQR/Source/spqr_rcount.cpp b/SPQR/Source/spqr_rcount.cpp index 356a30b30..d26fbc44f 100644 --- a/SPQR/Source/spqr_rcount.cpp +++ b/SPQR/Source/spqr_rcount.cpp @@ -12,34 +12,34 @@ #include "spqr.hpp" -template void spqr_rcount +template void spqr_rcount ( // inputs, not modified - spqr_symbolic *QRsym, - spqr_numeric *QRnum, + spqr_symbolic *QRsym, + spqr_numeric *QRnum, - int64_t n1rows, // added to each row index of Ra and Rb - int64_t econ, // only get entries in rows n1rows to econ-1 - int64_t n2, // Ra = R (:,0:n2-1), Rb = R (:,n2:n-1) + Int n1rows, // added to each row index of Ra and Rb + Int econ, // only get entries in rows n1rows to econ-1 + Int n2, // Ra = R (:,0:n2-1), Rb = R (:,n2:n-1) int getT, // if true, count Rb' instead of Rb // input/output // FUTURE : make Ra, Rb, H2 cholmod_sparse - int64_t *Ra, // size n2; Ra [j] += nnz (R (:,j)) if j < n2 - int64_t *Rb, // If getT is false: size n-n2 and + Int *Ra, // size n2; Ra [j] += nnz (R (:,j)) if j < n2 + Int *Rb, // If getT is false: size n-n2 and // Rb [j-n2] += nnz (R (:,j)) if j >= n2. // If getT is true: size econ, and // Rb [i] += nnz (R (i, n2:n-1)) - int64_t *H2p, // size rjsize+1. Column pointers for H. + Int *H2p, // size rjsize+1. Column pointers for H. // Only computed if H was kept during factorization. // Only H2p [0..nh] is used. - int64_t *p_nh // number of Householder vectors (nh <= rjsize) + Int *p_nh // number of Householder vectors (nh <= rjsize) ) { Entry **Rblock, *R, *Tau, *HTau ; - int64_t *Rp, *Rj, *Super, *HStair, *Stair, *Hm ; + Int *Rp, *Rj, *Super, *HStair, *Stair, *Hm ; char *Rdead ; - int64_t nf, j, f, col1, fp, pr, fn, rm, k, i, t, fm, h, getRa, getRb, nh, + Int nf, j, f, col1, fp, pr, fn, rm, k, i, t, fm, h, getRa, getRb, nh, row1, keepH, getH, hnz ; // ------------------------------------------------------------------------- @@ -219,14 +219,57 @@ template void spqr_rcount } } +template void spqr_rcount +( + // inputs, not modified + spqr_symbolic *QRsym, + spqr_numeric *QRnum, -// ============================================================================= + int32_t n1rows, // added to each row index of Ra and Rb + int32_t econ, // only get entries in rows n1rows to econ-1 + int32_t n2, // Ra = R (:,0:n2-1), Rb = R (:,n2:n-1) + int getT, // if true, count Rb' instead of Rb -template void spqr_rcount + // input/output + // FUTURE : make Ra, Rb, H2 cholmod_sparse + int32_t *Ra, // size n2; Ra [j] += nnz (R (:,j)) if j < n2 + int32_t *Rb, // If getT is false: size n-n2 and + // Rb [j-n2] += nnz (R (:,j)) if j >= n2. + // If getT is true: size econ, and + // Rb [i] += nnz (R (i, n2:n-1)) + int32_t *H2p, // size rjsize+1. Column pointers for H. + // Only computed if H was kept during factorization. + // Only H2p [0..nh] is used. + int32_t *p_nh // number of Householder vectors (nh <= rjsize) +) ; +template void spqr_rcount ( // inputs, not modified - spqr_symbolic *QRsym, - spqr_numeric *QRnum, + spqr_symbolic *QRsym, + spqr_numeric *QRnum, + + int32_t n1rows, // added to each row index of Ra and Rb + int32_t econ, // only get entries in rows n1rows to econ-1 + int32_t n2, // Ra = R (:,0:n2-1), Rb = R (:,n2:n-1) + int getT, // if true, count Rb' instead of Rb + + // input/output + // FUTURE : make Ra, Rb, H2 cholmod_sparse + int32_t *Ra, // size n2; Ra [j] += nnz (R (:,j)) if j < n2 + int32_t *Rb, // If getT is false: size n-n2 and + // Rb [j-n2] += nnz (R (:,j)) if j >= n2. + // If getT is true: size econ, and + // Rb [i] += nnz (R (i, n2:n-1)) + int32_t *H2p, // size rjsize+1. Column pointers for H. + // Only computed if H was kept during factorization. + // Only H2p [0..nh] is used. + int32_t *p_nh // number of Householder vectors (nh <= rjsize) +) ; +template void spqr_rcount +( + // inputs, not modified + spqr_symbolic *QRsym, + spqr_numeric *QRnum, int64_t n1rows, // added to each row index of Ra and Rb int64_t econ, // only get entries in rows n1rows to econ-1 @@ -234,6 +277,7 @@ template void spqr_rcount int getT, // if true, count Rb' instead of Rb // input/output + // FUTURE : make Ra, Rb, H2 cholmod_sparse int64_t *Ra, // size n2; Ra [j] += nnz (R (:,j)) if j < n2 int64_t *Rb, // If getT is false: size n-n2 and // Rb [j-n2] += nnz (R (:,j)) if j >= n2. @@ -244,14 +288,11 @@ template void spqr_rcount // Only H2p [0..nh] is used. int64_t *p_nh // number of Householder vectors (nh <= rjsize) ) ; - -// ============================================================================= - -template void spqr_rcount +template void spqr_rcount ( // inputs, not modified - spqr_symbolic *QRsym, - spqr_numeric *QRnum, + spqr_symbolic *QRsym, + spqr_numeric *QRnum, int64_t n1rows, // added to each row index of Ra and Rb int64_t econ, // only get entries in rows n1rows to econ-1 @@ -259,6 +300,7 @@ template void spqr_rcount int getT, // if true, count Rb' instead of Rb // input/output + // FUTURE : make Ra, Rb, H2 cholmod_sparse int64_t *Ra, // size n2; Ra [j] += nnz (R (:,j)) if j < n2 int64_t *Rb, // If getT is false: size n-n2 and // Rb [j-n2] += nnz (R (:,j)) if j >= n2. diff --git a/SPQR/Source/spqr_rhpack.cpp b/SPQR/Source/spqr_rhpack.cpp index f170e3aab..c6b8e5cc4 100644 --- a/SPQR/Source/spqr_rhpack.cpp +++ b/SPQR/Source/spqr_rhpack.cpp @@ -37,14 +37,14 @@ #include "spqr.hpp" -template int64_t spqr_rhpack // returns # of entries in R+H +template Int spqr_rhpack // returns # of entries in R+H ( // input, not modified int keepH, // if true, then H is packed - int64_t m, // # of rows in F - int64_t n, // # of columns in F - int64_t npiv, // number of pivotal columns in F - int64_t *Stair, // size npiv; column j is dead if Stair [j] == 0. + Int m, // # of rows in F + Int n, // # of columns in F + Int npiv, // number of pivotal columns in F + Int *Stair, // size npiv; column j is dead if Stair [j] == 0. // Only the first npiv columns can be dead. // input, not modified (unless the pack occurs in-place) @@ -52,11 +52,11 @@ template int64_t spqr_rhpack // returns # of entries in R+H // output, contents not defined on input Entry *R, // packed columns of R+H - int64_t *p_rm // number of rows in R block + Int *p_rm // number of rows in R block ) { Entry *R0 = R ; - int64_t i, k, h, t, rm ; + Int i, k, h, t, rm ; // ------------------------------------------------------------------------- // get inputs @@ -144,10 +144,43 @@ template int64_t spqr_rhpack // returns # of entries in R+H return (R-R0) ; // return # of packed entries } +template int32_t spqr_rhpack // returns # of entries in R+H +( + // input, not modified + int keepH, // if true, then H is packed + int32_t m, // # of rows in F + int32_t n, // # of columns in F + int32_t npiv, // number of pivotal columns in F + int32_t *Stair, // size npiv; column j is dead if Stair [j] == 0. + // Only the first npiv columns can be dead. -// ============================================================================= + // input, not modified (unless the pack occurs in-place) + double *F, // m-by-n frontal matrix in column-major order + + // output, contents not defined on input + double *R, // packed columns of R+H + int32_t *p_rm // number of rows in R block +) ; -template int64_t spqr_rhpack // returns # of entries in R+H +template int32_t spqr_rhpack // returns # of entries in R+H +( + // input, not modified + int keepH, // if true, then H is packed + int32_t m, // # of rows in F + int32_t n, // # of columns in F + int32_t npiv, // number of pivotal columns in F + int32_t *Stair, // size npiv; column j is dead if Stair [j] == 0. + // Only the first npiv columns can be dead. + + // input, not modified (unless the pack occurs in-place) + Complex *F, // m-by-n frontal matrix in column-major order + + // output, contents not defined on input + Complex *R, // packed columns of R+H + int32_t *p_rm // number of rows in R block +) ; + +template int64_t spqr_rhpack // returns # of entries in R+H ( // input, not modified int keepH, // if true, then H is packed @@ -158,16 +191,14 @@ template int64_t spqr_rhpack // returns # of entries in R+H // Only the first npiv columns can be dead. // input, not modified (unless the pack occurs in-place) - double *F, // m-by-n frontal matrix in column-major order + double *F, // m-by-n frontal matrix in column-major order // output, contents not defined on input - double *R, // packed columns of R+H + double *R, // packed columns of R+H int64_t *p_rm // number of rows in R block ) ; -// ============================================================================= - -template int64_t spqr_rhpack // returns # of entries in R+H +template int64_t spqr_rhpack // returns # of entries in R+H ( // input, not modified int keepH, // if true, then H is packed @@ -178,9 +209,9 @@ template int64_t spqr_rhpack // returns # of entries in R+H // Only the first npiv columns can be dead. // input, not modified (unless the pack occurs in-place) - Complex *F, // m-by-n frontal matrix in column-major order + Complex *F, // m-by-n frontal matrix in column-major order // output, contents not defined on input - Complex *R, // packed columns of R+H + Complex *R, // packed columns of R+H int64_t *p_rm // number of rows in R block ) ; diff --git a/SPQR/Source/spqr_rmap.cpp b/SPQR/Source/spqr_rmap.cpp index f6d2eccf2..3b8f2995a 100644 --- a/SPQR/Source/spqr_rmap.cpp +++ b/SPQR/Source/spqr_rmap.cpp @@ -33,14 +33,14 @@ #include "spqr.hpp" -template int spqr_rmap +template int spqr_rmap ( - SuiteSparseQR_factorization *QR, + SuiteSparseQR_factorization *QR, cholmod_common *cc ) { - int64_t n, j, i, p, n1rows, n1cols ; - int64_t *Rmap, *RmapInv, *R1p, *R1j ; + Int n, j, i, p, n1rows, n1cols ; + Int *Rmap, *RmapInv, *R1p, *R1j ; n = QR->nacols ; Rmap = QR->Rmap ; @@ -49,8 +49,8 @@ template int spqr_rmap if (Rmap == NULL) { ASSERT (RmapInv == NULL) ; - QR->Rmap = Rmap = (int64_t *) cholmod_l_malloc (n, sizeof(int64_t), cc); - QR->RmapInv = RmapInv = (int64_t *) cholmod_l_malloc (n, sizeof(int64_t), cc); + QR->Rmap = Rmap = (Int *) spqr_malloc (n, sizeof(Int), cc); + QR->RmapInv = RmapInv = (Int *) spqr_malloc (n, sizeof(Int), cc); if (cc->status < CHOLMOD_OK) { // out of memory @@ -113,14 +113,24 @@ template int spqr_rmap return (TRUE) ; } -template int spqr_rmap +template int spqr_rmap ( - SuiteSparseQR_factorization *QR, + SuiteSparseQR_factorization *QR, + cholmod_common *cc +) ; +template int spqr_rmap +( + SuiteSparseQR_factorization *QR, cholmod_common *cc ) ; -template int spqr_rmap +template int spqr_rmap +( + SuiteSparseQR_factorization *QR, + cholmod_common *cc +) ; +template int spqr_rmap ( - SuiteSparseQR_factorization *QR, + SuiteSparseQR_factorization *QR, cholmod_common *cc ) ; diff --git a/SPQR/Source/spqr_rsolve.cpp b/SPQR/Source/spqr_rsolve.cpp index 3d7ed9718..875dd7b19 100644 --- a/SPQR/Source/spqr_rsolve.cpp +++ b/SPQR/Source/spqr_rsolve.cpp @@ -61,14 +61,14 @@ #include "spqr.hpp" -template void spqr_rsolve +template void spqr_rsolve ( // inputs - SuiteSparseQR_factorization *QR, + SuiteSparseQR_factorization *QR, int use_Q1fill, // if TRUE, do X=E*(R\B), otherwise do X=R\B - int64_t nrhs, // number of columns of B - int64_t ldb, // leading dimension of B + Int nrhs, // number of columns of B + Int ldb, // leading dimension of B Entry *B, // size m-by-nrhs with leading dimesion ldb // output @@ -76,23 +76,23 @@ template void spqr_rsolve // workspace Entry **Rcolp, // size QRnum->maxfrank - int64_t *Rlive, // size QRnum->maxfrank + Int *Rlive, // size QRnum->maxfrank Entry *W, // size QRnum->maxfrank * nrhs cholmod_common *cc ) { - spqr_symbolic *QRsym ; - spqr_numeric *QRnum ; - int64_t n1rows, n1cols, n ; - int64_t *Q1fill, *R1p, *R1j ; + spqr_symbolic *QRsym ; + spqr_numeric *QRnum ; + Int n1rows, n1cols, n ; + Int *Q1fill, *R1p, *R1j ; Entry *R1x ; Entry xi ; Entry **Rblock, *R, *W1, *B1, *X1 ; - int64_t *Rp, *Rj, *Super, *HStair, *Hm, *Stair ; + Int *Rp, *Rj, *Super, *HStair, *Hm, *Stair ; char *Rdead ; - int64_t nf, // m, + Int nf, // m, rank, j, f, col1, col2, fp, pr, fn, rm, k, i, row1, row2, ii, keepH, fm, h, t, live, kk ; @@ -347,8 +347,12 @@ template void spqr_rsolve // === solve with the singleton rows of R ================================== // ========================================================================= - FLOP_COUNT ((n1rows <= 0) ? 0 : - nrhs * (n1rows + (2 * (R1p [n1rows] - n1rows)))) ; + if (n1rows > 0) + { + FLOP_COUNT2 ( + ((n1rows <= 0) ? 0 : nrhs) , + (n1rows + (2 * (R1p [n1rows] - n1rows)))) ; + } for (kk = 0 ; kk < nrhs ; kk++) { @@ -357,18 +361,18 @@ template void spqr_rsolve // get the right-hand side for this ith singleton row Entry x = B [i] ; // solve with the "off-diagonal" entries, x = x-R(i,:)*x2 - for (int64_t p = R1p [i] + 1 ; p < R1p [i+1] ; p++) + for (Int p = R1p [i] + 1 ; p < R1p [i+1] ; p++) { - int64_t jnew = R1j [p] ; + Int jnew = R1j [p] ; ASSERT (jnew >= i && jnew < n) ; - int64_t jold = Q1fill ? Q1fill [jnew] : jnew ; + Int jold = Q1fill ? Q1fill [jnew] : jnew ; ASSERT (jold >= 0 && jold < n) ; x -= R1x [p] * X [jold] ; } // divide by the "diagonal" (the singleton entry itself) - int64_t p = R1p [i] ; - int64_t jnew = R1j [p] ; - int64_t jold = Q1fill ? Q1fill [jnew] : jnew ; + Int p = R1p [i] ; + Int jnew = R1j [p] ; + Int jold = Q1fill ? Q1fill [jnew] : jnew ; ASSERT (jold >= 0 && jold < n) ; // X [jold] = x / R1x [p] ; using cc->complex_divide X [jold] = spqr_divide (x, R1x [p], cc) ; @@ -378,48 +382,84 @@ template void spqr_rsolve } } -// ============================================================================= - -template void spqr_rsolve +template void spqr_rsolve ( // inputs - SuiteSparseQR_factorization *QR, - int use_Q1fill, + SuiteSparseQR_factorization *QR, + int use_Q1fill, // if TRUE, do X=E*(R\B), otherwise do X=R\B - int64_t nrhs, // number of columns of B - int64_t ldb, // leading dimension of B - double *B, // size m-by-nrhs with leading dimesion ldb + int32_t nrhs, // number of columns of B + int32_t ldb, // leading dimension of B + double *B, // size m-by-nrhs with leading dimesion ldb // output - double *X, // size n-by-nrhs with leading dimension n + double *X, // size n-by-nrhs with leading dimension n // workspace - double **Rcolp, - int64_t *Rlive, - double *W, + double **Rcolp, // size QRnum->maxfrank + int32_t *Rlive, // size QRnum->maxfrank + double *W, // size QRnum->maxfrank * nrhs cholmod_common *cc ) ; +template void spqr_rsolve +( + // inputs + SuiteSparseQR_factorization *QR, + int use_Q1fill, // if TRUE, do X=E*(R\B), otherwise do X=R\B + int32_t nrhs, // number of columns of B + int32_t ldb, // leading dimension of B + Complex *B, // size m-by-nrhs with leading dimesion ldb -template void spqr_rsolve + // output + Complex *X, // size n-by-nrhs with leading dimension n + + // workspace + Complex **Rcolp, // size QRnum->maxfrank + int32_t *Rlive, // size QRnum->maxfrank + Complex *W, // size QRnum->maxfrank * nrhs + + cholmod_common *cc +) ; + +template void spqr_rsolve ( // inputs - SuiteSparseQR_factorization *QR, - int use_Q1fill, + SuiteSparseQR_factorization *QR, + int use_Q1fill, // if TRUE, do X=E*(R\B), otherwise do X=R\B int64_t nrhs, // number of columns of B int64_t ldb, // leading dimension of B - Complex *B, // size m-by-nrhs with leading dimesion ldb + double *B, // size m-by-nrhs with leading dimesion ldb // output - Complex *X, // size n-by-nrhs with leading dimension n + double *X, // size n-by-nrhs with leading dimension n // workspace - Complex **Rcolp, - int64_t *Rlive, - Complex *W, + double **Rcolp, // size QRnum->maxfrank + int64_t *Rlive, // size QRnum->maxfrank + double *W, // size QRnum->maxfrank * nrhs cholmod_common *cc ) ; +template void spqr_rsolve +( + // inputs + SuiteSparseQR_factorization *QR, + int use_Q1fill, // if TRUE, do X=E*(R\B), otherwise do X=R\B + int64_t nrhs, // number of columns of B + int64_t ldb, // leading dimension of B + Complex *B, // size m-by-nrhs with leading dimesion ldb + + // output + Complex *X, // size n-by-nrhs with leading dimension n + + // workspace + Complex **Rcolp, // size QRnum->maxfrank + int64_t *Rlive, // size QRnum->maxfrank + Complex *W, // size QRnum->maxfrank * nrhs + + cholmod_common *cc +) ; diff --git a/SPQR/Source/spqr_shift.cpp b/SPQR/Source/spqr_shift.cpp index 3c318b9c1..ad01083c3 100644 --- a/SPQR/Source/spqr_shift.cpp +++ b/SPQR/Source/spqr_shift.cpp @@ -12,16 +12,16 @@ #include "spqr.hpp" -void spqr_shift +template void spqr_shift ( // input, not modified - int64_t n, + Int n, // input/output - int64_t *X // size n+1 + Int *X // size n+1 ) { - int64_t k ; + Int k ; if (X != NULL) { for (k = n ; k >= 1 ; k--) @@ -31,3 +31,20 @@ void spqr_shift X [0] = 0 ; } } + +template void spqr_shift +( + // input, not modified + int32_t n, + + // input/output + int32_t *X // size n+1 +) ; +template void spqr_shift +( + // input, not modified + int64_t n, + + // input/output + int64_t *X // size n+1 +) ; diff --git a/SPQR/Source/spqr_stranspose1.cpp b/SPQR/Source/spqr_stranspose1.cpp index 3b5c04376..349e7a833 100644 --- a/SPQR/Source/spqr_stranspose1.cpp +++ b/SPQR/Source/spqr_stranspose1.cpp @@ -20,21 +20,21 @@ #include "spqr.hpp" -void spqr_stranspose1 +template void spqr_stranspose1 ( // input, not modified cholmod_sparse *A, // m-by-n - int64_t *Qfill, // size n, fill-reducing column permutation; + Int *Qfill, // size n, fill-reducing column permutation; // Qfill [k] = j // if the kth column of S is the jth column of A. // Identity permutation is used if Qfill is NULL. // output, contents not defined on input // FUTURE : make S cholmod_sparse - int64_t *Sp, // size m+1, row pointers of S - int64_t *Sj, // size nz, column indices of S - int64_t *PLinv, // size m, inverse row permutation, PLinv [i] = k - int64_t *Sleft, // size n+2, Sleft [j] ... Sleft [j+1]-1 is the list of + Int *Sp, // size m+1, row pointers of S + Int *Sj, // size nz, column indices of S + Int *PLinv, // size m, inverse row permutation, PLinv [i] = k + Int *Sleft, // size n+2, Sleft [j] ... Sleft [j+1]-1 is the list of // rows of S whose leftmost column index is j. The list // can be empty (that is, Sleft [j] == Sleft [j+1]). // Sleft [n] is the number of non-empty rows of S, and @@ -42,10 +42,10 @@ void spqr_stranspose1 // Sleft [n+1]-1 gives the empty rows of S. // workspace, not defined on input or output - int64_t *W // size m + Int *W // size m ) { - int64_t i, j, p, pend, t, k, row, col, kstart, s, m, n, *Ap, *Ai ; + Int i, j, p, pend, t, k, row, col, kstart, s, m, n, *Ap, *Ai ; // ------------------------------------------------------------------------- // get inputs @@ -53,8 +53,8 @@ void spqr_stranspose1 m = A->nrow ; n = A->ncol ; - Ap = (int64_t *) A->p ; - Ai = (int64_t *) A->i ; + Ap = (Int *) A->p ; + Ai = (Int *) A->i ; // ------------------------------------------------------------------------- // clear the inverse permutation @@ -163,3 +163,53 @@ void spqr_stranspose1 } } } + +template void spqr_stranspose1 +( + // input, not modified + cholmod_sparse *A, // m-by-n + int32_t *Qfill, // size n, fill-reducing column permutation; + // Qfill [k] = j + // if the kth column of S is the jth column of A. + // Identity permutation is used if Qfill is NULL. + + // output, contents not defined on input + // FUTURE : make S cholmod_sparse + int32_t *Sp, // size m+1, row pointers of S + int32_t *Sj, // size nz, column indices of S + int32_t *PLinv, // size m, inverse row permutation, PLinv [i] = k + int32_t *Sleft, // size n+2, Sleft [j] ... Sleft [j+1]-1 is the list of + // rows of S whose leftmost column index is j. The list + // can be empty (that is, Sleft [j] == Sleft [j+1]). + // Sleft [n] is the number of non-empty rows of S, and + // Sleft [n+1] is always m. That is, Sleft [n] ... + // Sleft [n+1]-1 gives the empty rows of S. + + // workspace, not defined on input or output + int32_t *W // size m +) ; + +template void spqr_stranspose1 +( + // input, not modified + cholmod_sparse *A, // m-by-n + int64_t *Qfill, // size n, fill-reducing column permutation; + // Qfill [k] = j + // if the kth column of S is the jth column of A. + // Identity permutation is used if Qfill is NULL. + + // output, contents not defined on input + // FUTURE : make S cholmod_sparse + int64_t *Sp, // size m+1, row pointers of S + int64_t *Sj, // size nz, column indices of S + int64_t *PLinv, // size m, inverse row permutation, PLinv [i] = k + int64_t *Sleft, // size n+2, Sleft [j] ... Sleft [j+1]-1 is the list of + // rows of S whose leftmost column index is j. The list + // can be empty (that is, Sleft [j] == Sleft [j+1]). + // Sleft [n] is the number of non-empty rows of S, and + // Sleft [n+1] is always m. That is, Sleft [n] ... + // Sleft [n+1]-1 gives the empty rows of S. + + // workspace, not defined on input or output + int64_t *W // size m +) ; diff --git a/SPQR/Source/spqr_stranspose2.cpp b/SPQR/Source/spqr_stranspose2.cpp index 9f8870722..e7c257846 100644 --- a/SPQR/Source/spqr_stranspose2.cpp +++ b/SPQR/Source/spqr_stranspose2.cpp @@ -11,26 +11,26 @@ #include "spqr.hpp" -template void spqr_stranspose2 +template void spqr_stranspose2 ( // input, not modified cholmod_sparse *A, // m-by-n - int64_t *Qfill, // size n, fill-reducing column permutation; + Int *Qfill, // size n, fill-reducing column permutation; // Qfill [k] = j // if the kth column of S is the jth column of A. // Identity permutation is used if Qfill is NULL. - int64_t *Sp, // size m+1, row pointers of S - int64_t *PLinv, // size m, inverse row permutation, PLinv [i] = k + Int *Sp, // size m+1, row pointers of S + Int *PLinv, // size m, inverse row permutation, PLinv [i] = k // output, contents not defined on input Entry *Sx, // size nz, numerical values of S // workspace, not defined on input or output - int64_t *W // size m + Int *W // size m ) { - int64_t i, j, p, pend, row, col, s, m, n, *Ap, *Ai ; + Int i, j, p, pend, row, col, s, m, n, *Ap, *Ai ; Entry *Ax ; // ------------------------------------------------------------------------- @@ -39,8 +39,8 @@ template void spqr_stranspose2 m = A->nrow ; n = A->ncol ; - Ap = (int64_t *) A->p ; - Ai = (int64_t *) A->i ; + Ap = (Int *) A->p ; + Ai = (Int *) A->i ; Ax = (Entry *) A->x ; // ------------------------------------------------------------------------- @@ -66,10 +66,44 @@ template void spqr_stranspose2 } } +template void spqr_stranspose2 +( + // input, not modified + cholmod_sparse *A, // m-by-n + int32_t *Qfill, // size n, fill-reducing column permutation; + // Qfill [k] = j + // if the kth column of S is the jth column of A. + // Identity permutation is used if Qfill is NULL. + + int32_t *Sp, // size m+1, row pointers of S + int32_t *PLinv, // size m, inverse row permutation, PLinv [i] = k -// ============================================================================= + // output, contents not defined on input + double *Sx, // size nz, numerical values of S + + // workspace, not defined on input or output + int32_t *W // size m +) ; +template void spqr_stranspose2 +( + // input, not modified + cholmod_sparse *A, // m-by-n + int32_t *Qfill, // size n, fill-reducing column permutation; + // Qfill [k] = j + // if the kth column of S is the jth column of A. + // Identity permutation is used if Qfill is NULL. + + int32_t *Sp, // size m+1, row pointers of S + int32_t *PLinv, // size m, inverse row permutation, PLinv [i] = k + + // output, contents not defined on input + Complex *Sx, // size nz, numerical values of S + + // workspace, not defined on input or output + int32_t *W // size m +) ; -template void spqr_stranspose2 +template void spqr_stranspose2 ( // input, not modified cholmod_sparse *A, // m-by-n @@ -82,15 +116,12 @@ template void spqr_stranspose2 int64_t *PLinv, // size m, inverse row permutation, PLinv [i] = k // output, contents not defined on input - double *Sx, // size nz, numerical values of S + double *Sx, // size nz, numerical values of S // workspace, not defined on input or output int64_t *W // size m ) ; - -// ============================================================================= - -template void spqr_stranspose2 +template void spqr_stranspose2 ( // input, not modified cholmod_sparse *A, // m-by-n @@ -103,9 +134,8 @@ template void spqr_stranspose2 int64_t *PLinv, // size m, inverse row permutation, PLinv [i] = k // output, contents not defined on input - Complex *Sx, // size nz, numerical values of S + Complex *Sx, // size nz, numerical values of S // workspace, not defined on input or output int64_t *W // size m ) ; - diff --git a/SPQR/Source/spqr_tol.cpp b/SPQR/Source/spqr_tol.cpp index 0959c9a9c..31a77f8ed 100644 --- a/SPQR/Source/spqr_tol.cpp +++ b/SPQR/Source/spqr_tol.cpp @@ -9,12 +9,13 @@ // Return the default column 2-norm tolerance -#include "spqr.hpp" + #include #include +#include "spqr.hpp" // return the default tol (-1 if error) -template double spqr_tol +template double spqr_tol ( // inputs, not modified cholmod_sparse *A, @@ -26,7 +27,7 @@ template double spqr_tol RETURN_IF_NULL_COMMON (EMPTY) ; RETURN_IF_NULL (A, EMPTY) ; double tol = (20 * ((double) A->nrow + (double) A->ncol) * DBL_EPSILON * - spqr_maxcolnorm (A, cc)); + spqr_maxcolnorm (A, cc)); // MathWorks modification: if the tolerance becomes Inf, replace it with // realmax; otherwise, we may end up with an all-zero matrix R // (see g1284493) @@ -35,7 +36,15 @@ template double spqr_tol return (tol) ; } -template double spqr_tol // return the default tol +template double spqr_tol +( + // inputs, not modified + cholmod_sparse *A, + + // workspace and parameters + cholmod_common *cc +) ; +template double spqr_tol ( // inputs, not modified cholmod_sparse *A, @@ -44,7 +53,7 @@ template double spqr_tol // return the default tol cholmod_common *cc ) ; -template double spqr_tol // return the default tol +template double spqr_tol ( // inputs, not modified cholmod_sparse *A, @@ -52,4 +61,11 @@ template double spqr_tol // return the default tol // workspace and parameters cholmod_common *cc ) ; +template double spqr_tol +( + // inputs, not modified + cholmod_sparse *A, + // workspace and parameters + cholmod_common *cc +) ; diff --git a/SPQR/Source/spqr_trapezoidal.cpp b/SPQR/Source/spqr_trapezoidal.cpp index 65bb9bf2c..68e589a13 100644 --- a/SPQR/Source/spqr_trapezoidal.cpp +++ b/SPQR/Source/spqr_trapezoidal.cpp @@ -17,19 +17,19 @@ #include "spqr.hpp" -template int64_t spqr_trapezoidal // rank of R; EMPTY on failure +template Int spqr_trapezoidal // rank of R; EMPTY on failure ( // inputs, not modified // FUTURE : make R and T cholmod_sparse: - int64_t n, // R is m-by-n (m is not needed here; can be economy R) - int64_t *Rp, // size n+1, column pointers of R - int64_t *Ri, // size rnz = Rp [n], row indices of R + Int n, // R is m-by-n (m is not needed here; can be economy R) + Int *Rp, // size n+1, column pointers of R + Int *Ri, // size rnz = Rp [n], row indices of R Entry *Rx, // size rnz, numerical values of R - int64_t bncols, // number of columns of B + Int bncols, // number of columns of B - int64_t *Qfill, // size n+bncols, fill-reducing ordering. Qfill [k] = j if + Int *Qfill, // size n+bncols, fill-reducing ordering. Qfill [k] = j if // the jth column of A is the kth column of R. If Qfill is // NULL, then it is assumed to be the identity // permutation. @@ -39,19 +39,19 @@ template int64_t spqr_trapezoidal // rank of R; EMPTY on failur // the matrix T is not created. // outputs, not allocated on input - int64_t **p_Tp, // size n+1, column pointers of T - int64_t **p_Ti, // size rnz, row indices of T + Int **p_Tp, // size n+1, column pointers of T + Int **p_Ti, // size rnz, row indices of T Entry **p_Tx, // size rnz, numerical values of T - int64_t **p_Qtrap, // size n+bncols, modified Qfill + Int **p_Qtrap, // size n+bncols, modified Qfill // workspace and parameters cholmod_common *cc ) { Entry *Tx ; - int64_t *Tp, *Ti, *Qtrap ; - int64_t rnz, i, rank, k, p, pend, len, t1nz, t2nz, k1, k2, p1, p2, found_dead, + Int *Tp, *Ti, *Qtrap ; + Int rnz, i, rank, k, p, pend, len, t1nz, t2nz, k1, k2, p1, p2, found_dead, is_trapezoidal ; // ------------------------------------------------------------------------- @@ -127,18 +127,18 @@ template int64_t spqr_trapezoidal // rank of R; EMPTY on failur rnz = Rp [n] ; - Tp = (int64_t *) cholmod_l_malloc (n+1, sizeof (int64_t), cc) ; - Ti = (int64_t *) cholmod_l_malloc (rnz, sizeof (int64_t), cc) ; - Tx = (Entry *) cholmod_l_malloc (rnz, sizeof (Entry), cc) ; - Qtrap = (int64_t *) cholmod_l_malloc (n+bncols, sizeof (int64_t), cc) ; + Tp = (Int *) spqr_malloc (n+1, sizeof (Int), cc) ; + Ti = (Int *) spqr_malloc (rnz, sizeof (Int), cc) ; + Tx = (Entry *) spqr_malloc (rnz, sizeof (Entry), cc) ; + Qtrap = (Int *) spqr_malloc (n+bncols, sizeof (Int), cc) ; if (cc->status < CHOLMOD_OK) { // out of memory - cholmod_l_free (n+1, sizeof (int64_t), Tp, cc) ; - cholmod_l_free (rnz, sizeof (int64_t), Ti, cc) ; - cholmod_l_free (rnz, sizeof (Entry), Tx, cc) ; - cholmod_l_free (n+bncols, sizeof (int64_t), Qtrap, cc) ; + spqr_free (n+1, sizeof (Int), Tp, cc) ; + spqr_free (rnz, sizeof (Int), Ti, cc) ; + spqr_free (rnz, sizeof (Entry), Tx, cc) ; + spqr_free (n+bncols, sizeof (Int), Qtrap, cc) ; return (EMPTY) ; } @@ -214,17 +214,79 @@ template int64_t spqr_trapezoidal // rank of R; EMPTY on failur return (rank) ; } +template int32_t spqr_trapezoidal // rank of R; EMPTY on failure +( + // inputs, not modified -// ============================================================================= + // FUTURE : make R and T cholmod_sparse: + int32_t n, // R is m-by-n (m is not needed here; can be economy R) + int32_t *Rp, // size n+1, column pointers of R + int32_t *Ri, // size rnz = Rp [n], row indices of R + double *Rx, // size rnz, numerical values of R + + int32_t bncols, // number of columns of B + + int32_t *Qfill, // size n+bncols, fill-reducing ordering. Qfill [k] = j if + // the jth column of A is the kth column of R. If Qfill is + // NULL, then it is assumed to be the identity + // permutation. + + int skip_if_trapezoidal, // if R is already in trapezoidal form, + // and skip_if_trapezoidal is TRUE, then + // the matrix T is not created. + + // outputs, not allocated on input + int32_t **p_Tp, // size n+1, column pointers of T + int32_t **p_Ti, // size rnz, row indices of T + double **p_Tx, // size rnz, numerical values of T + + int32_t **p_Qtrap, // size n+bncols, modified Qfill + + // workspace and parameters + cholmod_common *cc +) ; -template int64_t spqr_trapezoidal // rank of R, or EMPTY on failure +template int32_t spqr_trapezoidal // rank of R; EMPTY on failure ( // inputs, not modified + // FUTURE : make R and T cholmod_sparse: + int32_t n, // R is m-by-n (m is not needed here; can be economy R) + int32_t *Rp, // size n+1, column pointers of R + int32_t *Ri, // size rnz = Rp [n], row indices of R + Complex *Rx, // size rnz, numerical values of R + + int32_t bncols, // number of columns of B + + int32_t *Qfill, // size n+bncols, fill-reducing ordering. Qfill [k] = j if + // the jth column of A is the kth column of R. If Qfill is + // NULL, then it is assumed to be the identity + // permutation. + + int skip_if_trapezoidal, // if R is already in trapezoidal form, + // and skip_if_trapezoidal is TRUE, then + // the matrix T is not created. + + // outputs, not allocated on input + int32_t **p_Tp, // size n+1, column pointers of T + int32_t **p_Ti, // size rnz, row indices of T + Complex **p_Tx, // size rnz, numerical values of T + + int32_t **p_Qtrap, // size n+bncols, modified Qfill + + // workspace and parameters + cholmod_common *cc +) ; + +template int64_t spqr_trapezoidal // rank of R; EMPTY on failure +( + // inputs, not modified + + // FUTURE : make R and T cholmod_sparse: int64_t n, // R is m-by-n (m is not needed here; can be economy R) int64_t *Rp, // size n+1, column pointers of R int64_t *Ri, // size rnz = Rp [n], row indices of R - double *Rx, // size rnz, numerical values of R + double *Rx, // size rnz, numerical values of R int64_t bncols, // number of columns of B @@ -240,7 +302,7 @@ template int64_t spqr_trapezoidal // rank of R, or EMPTY on failur // outputs, not allocated on input int64_t **p_Tp, // size n+1, column pointers of T int64_t **p_Ti, // size rnz, row indices of T - double **p_Tx, // size rnz, numerical values of T + double **p_Tx, // size rnz, numerical values of T int64_t **p_Qtrap, // size n+bncols, modified Qfill @@ -248,16 +310,15 @@ template int64_t spqr_trapezoidal // rank of R, or EMPTY on failur cholmod_common *cc ) ; -// ============================================================================= - -template int64_t spqr_trapezoidal // rank of R, or EMPTY on failure +template int64_t spqr_trapezoidal // rank of R; EMPTY on failure ( // inputs, not modified + // FUTURE : make R and T cholmod_sparse: int64_t n, // R is m-by-n (m is not needed here; can be economy R) int64_t *Rp, // size n+1, column pointers of R int64_t *Ri, // size rnz = Rp [n], row indices of R - Complex *Rx, // size rnz, numerical values of R + Complex *Rx, // size rnz, numerical values of R int64_t bncols, // number of columns of B @@ -273,9 +334,9 @@ template int64_t spqr_trapezoidal // rank of R, or EMPTY on failur // outputs, not allocated on input int64_t **p_Tp, // size n+1, column pointers of T int64_t **p_Ti, // size rnz, row indices of T - Complex **p_Tx, // size rnz, numerical values of T + Complex **p_Tx, // size rnz, numerical values of T - int64_t **p_Qtrap, // size n+bncols, modified Qfill + int64_t **p_Qtrap, // size n+bncols, modified Qfill // workspace and parameters cholmod_common *cc diff --git a/SPQR/Tcov/Makefile b/SPQR/Tcov/Makefile index 32ff280b1..248fc86dd 100644 --- a/SPQR/Tcov/Makefile +++ b/SPQR/Tcov/Makefile @@ -60,15 +60,16 @@ NVCC = /usr/local/cuda/bin/nvcc -g --profile --generate-line-info $(NV20) \ CLIB = -lsuitesparseconfig -lcholmod -lamd -lcolamd -lccolamd -lcamd -all: qrtest gpudemo qrdemo_gpu +all: qrtest qrtest32 gpudemo qrdemo_gpu -library: qrtest gpudemo +library: qrtest qrtest32 gpudemo purge: distclean distclean: clean - - $(RM) qrtest qrtest_out.txt pfile tfile cov.out qrtest_out1.txt + - $(RM) qrtest qrtest32 qrtest_out.txt pfile tfile cov.out - $(RM) gpuqrengine_demo troll.m qrdemo_gpu gpu_results.txt X.mtx + - $(RM) qrtest_out32.txt qrtest_out1.txt - $(RM) -r $(PURGE) clean: @@ -76,7 +77,7 @@ clean: INC = ../Include/spqr.hpp ../Include/SuiteSparseQR_C.h \ ../Include/SuiteSparseQR_definitions.h \ - ../Include/SuiteSparseQR.hpp + ../Include/SuiteSparseQR.hpp qrtest_template.hpp OBJ = \ spqr_rmap.o \ @@ -119,6 +120,7 @@ OBJ = \ spqr_append.o \ spqr_type.o \ spqr_tol.o \ + spqr_cholmod_wrappers.o \ qrtestc.o ifneq ($(GPU_CONFIG),) @@ -179,6 +181,9 @@ qrtestc.o: qrtestc.c $(INC) qrtest: qrtest.cpp $(INC) $(OBJ) $(C) qrtest.cpp -o qrtest $(OBJ) $(LIBS) -lm +qrtest32: qrtest.cpp $(INC) $(OBJ) + $(C) -DINT32=1 qrtest.cpp -o qrtest32 $(OBJ) $(LIBS) -lm + ifneq ($(GPU_CONFIG),) gpu: gpuqrengine_demo qrdemo_gpu - ./gpuqrengine_demo @@ -201,21 +206,24 @@ ifneq ($(GPU_CONFIG),) $(C) ../Demo/qrdemo_gpu.cpp -o qrdemo_gpu $(OBJ) $(LIBS) endif -go: qrtest gpu qrdemo_gpu +go: qrtest qrtest32 gpu qrdemo_gpu + - ./qrtest32 matrixlist.txt > qrtest_out32.txt - ./qrtest matrixlist.txt > qrtest_out.txt - ./cov -go1: qrtest +go1: qrtest qrtest32 - ./qrtest matrix1.txt > qrtest_out1.txt + - ./qrtest32 matrix1.txt > qrtest_out1.txt - ./cov -vgo1: qrtest +vgo1: qrtest qrtest32 - valgrind ./qrtest matrix1.txt > qrtest_out1.txt - # - valgrind --leak-check=full --show-reachable=yes ./qrtest matrix1.txt > qrtest_out1.txt + - valgrind ./qrtest32 matrix1.txt > qrtest_out1.txt - ./cov -vgo: qrtest - - valgrind --leak-check=full --show-reachable=yes ./qrtest matrixlist.txt > qrtest_out.txt +vgo: qrtest qrtest32 + - valgrind --leak-check=full --show-reachable=yes ./qrtest matrixlist.txt > qrtest_out32.txt + - valgrind --leak-check=full --show-reachable=yes ./qrtest32 matrixlist.txt > qrtest_out.txt - ./cov spqr_1colamd.o: ../Source/spqr_1colamd.cpp @@ -314,6 +322,9 @@ spqr_trapezoidal.o: ../Source/spqr_trapezoidal.cpp spqr_type.o: ../Source/spqr_type.cpp $(C) -c $< +spqr_cholmod_wrappers.o: ../Source/spqr_cholmod_wrappers.cpp + $(C) -c $< + spqr_front.o: ../Source/spqr_front.cpp $(C) -c $< diff --git a/SPQR/Tcov/README.txt b/SPQR/Tcov/README.txt index 1f9cfacf5..4e3ac962c 100644 --- a/SPQR/Tcov/README.txt +++ b/SPQR/Tcov/README.txt @@ -1,6 +1,6 @@ SuiteSparseQR exhaustive statement coverage tests. -SPQR, Copyright (c) 2008-2022, Timothy A Davis. All Rights Reserved. +SPQR, Copyright (c) 2008-2023, Timothy A Davis. All Rights Reserved. SPDX-License-Identifier: GPL-2.0+ This test exercises all of SuiteSparseQR and checks its results. On a 32-bit diff --git a/SPQR/Tcov/matrixlist.txt b/SPQR/Tcov/matrixlist.txt index 297d5d125..03c6bb3d6 100644 --- a/SPQR/Tcov/matrixlist.txt +++ b/SPQR/Tcov/matrixlist.txt @@ -1,3 +1,6 @@ +0 ../Matrix/a00.mtx +0 ../Matrix/a10.mtx +0 ../Matrix/a01.mtx 0 ../Matrix/west0067.mtx 0 ../Matrix/r2.mtx 0 ../Matrix/a04.mtx diff --git a/SPQR/Tcov/qrtest.cpp b/SPQR/Tcov/qrtest.cpp index 02519eaf5..84f1afca5 100644 --- a/SPQR/Tcov/qrtest.cpp +++ b/SPQR/Tcov/qrtest.cpp @@ -40,7 +40,7 @@ double yy = 0 ; // ============================================================================= extern "C" { -void qrtest_C +void qrtest_C // handles both int32_t and int64_t versions ( cholmod_sparse *A, double anorm, @@ -121,7 +121,19 @@ void normal_memory_handler (cholmod_common *cc, bool free_work) SuiteSparse_config_free_func_set (free) ; cc->error_handler = my_handler ; - if (free_work) cholmod_l_free_work (cc) ; + + if (free_work) + { + if (cc->itype == CHOLMOD_LONG) + { + spqr_free_work (cc) ; + } + else + { + spqr_free_work (cc) ; + } + } + my_tries = -2 ; my_punt = FALSE ; } @@ -135,2643 +147,38 @@ void test_memory_handler (cholmod_common *cc, bool free_work) SuiteSparse_config_free_func_set (my_free) ; cc->error_handler = NULL ; - if (free_work) cholmod_l_free_work (cc) ; - my_tries = -2 ; - my_punt = FALSE ; -} - - -// ============================================================================= -// === SPQR_qmult ============================================================== -// ============================================================================= - -// wrapper for SuiteSparseQR_qmult (dense), optionally testing memory alloc. - -template cholmod_dense *SPQR_qmult -( - // arguments for SuiteSparseQR_qmult: - int64_t method, - cholmod_sparse *H, - cholmod_dense *Tau, - int64_t *HPinv, - cholmod_dense *X, - cholmod_common *cc, - - // malloc control - int64_t memory_test, // if TRUE, test malloc error handling - int64_t memory_punt // if TRUE, test punt case -) -{ - cholmod_dense *Y = NULL ; - if (!memory_test) - { - // just call the method directly; no memory testing - Y = SuiteSparseQR_qmult (method, H, Tau, HPinv, X, cc) ; - } - else - { - // test malloc error handling - int64_t tries ; - test_memory_handler (cc, true) ; - my_punt = memory_punt ; - for (tries = 0 ; my_tries < 0 ; tries++) - { - my_tries = tries ; - Y = SuiteSparseQR_qmult (method, H, Tau, HPinv, X, cc) ; - if (cc->status == CHOLMOD_OK) break ; - } - normal_memory_handler (cc, true) ; - } - return (Y) ; -} - - -// ============================================================================= -// === SPQR_qmult_sparse ======================================================= -// ============================================================================= - -// wrapper for SuiteSparseQR_qmult (sparse), optionally testing memory alloc. - -template cholmod_sparse *SPQR_qmult -( - // arguments for SuiteSparseQR_qmult: - int64_t method, - cholmod_sparse *H, - cholmod_dense *Tau, - int64_t *HPinv, - cholmod_sparse *X, - cholmod_common *cc, - - // malloc control - int64_t memory_test, // if TRUE, test malloc error handling - int64_t memory_punt // if TRUE, test punt case -) -{ - cholmod_sparse *Y = NULL ; - if (!memory_test) - { - // just call the method directly; no memory testing - Y = SuiteSparseQR_qmult (method, H, Tau, HPinv, X, cc) ; - } - else - { - // test malloc error handling - int64_t tries ; - test_memory_handler (cc, true) ; - my_punt = memory_punt ; - for (tries = 0 ; my_tries < 0 ; tries++) - { - my_tries = tries ; - Y = SuiteSparseQR_qmult (method, H, Tau, HPinv, X, cc); - if (cc->status == CHOLMOD_OK) break ; - } - normal_memory_handler (cc, true) ; - } - return (Y) ; -} - -#ifndef NEXPERT - -// ============================================================================= -// === SPQR_qmult (dense case) ================================================= -// ============================================================================= - -// wrapper for SuiteSparseQR_qmult (dense), optionally testing memory alloc. - -template cholmod_dense *SPQR_qmult -( - // arguments for SuiteSparseQR_qmult: - int64_t method, - SuiteSparseQR_factorization *QR, - cholmod_dense *X, - cholmod_common *cc, - - // malloc control - int64_t memory_test, // if TRUE, test malloc error handling - int64_t memory_punt // if TRUE, test punt case -) -{ - cholmod_dense *Y = NULL ; - if (!memory_test) - { - // just call the method directly; no memory testing - Y = SuiteSparseQR_qmult (method, QR, X, cc) ; - } - else - { - // test malloc error handling - int64_t tries ; - test_memory_handler (cc, true) ; - my_punt = memory_punt ; - for (tries = 0 ; my_tries < 0 ; tries++) - { - my_tries = tries ; - Y = SuiteSparseQR_qmult (method, QR, X, cc) ; - if (cc->status == CHOLMOD_OK) break ; - } - normal_memory_handler (cc, true) ; - } - return (Y) ; -} - -// ============================================================================= -// === SPQR_qmult (sparse case) ================================================ -// ============================================================================= - -// wrapper for SuiteSparseQR_qmult (sparse), optionally testing memory alloc. - -template cholmod_sparse *SPQR_qmult -( - // arguments for SuiteSparseQR_qmult: - int64_t method, - SuiteSparseQR_factorization *QR, - cholmod_sparse *X, - cholmod_common *cc, - - // malloc control - int64_t memory_test, // if TRUE, test malloc error handling - int64_t memory_punt // if TRUE, test punt case -) -{ - cholmod_sparse *Y = NULL ; - if (!memory_test) - { - // just call the method directly; no memory testing - Y = SuiteSparseQR_qmult (method, QR, X, cc) ; - } - else - { - // test malloc error handling - int64_t tries ; - test_memory_handler (cc, true) ; - my_punt = memory_punt ; - for (tries = 0 ; my_tries < 0 ; tries++) - { - my_tries = tries ; - Y = SuiteSparseQR_qmult (method, QR, X, cc) ; - if (cc->status == CHOLMOD_OK) break ; - } - normal_memory_handler (cc, true) ; - } - return (Y) ; -} - - -// ============================================================================= -// === SPQR_solve (dense case) ================================================= -// ============================================================================= - -// Wrapper for testing SuiteSparseQR_solve - -template cholmod_dense *SPQR_solve -( - // arguments for SuiteSparseQR_solve: - int64_t system, - SuiteSparseQR_factorization *QR, - cholmod_dense *B, - cholmod_common *cc, - - // malloc control - int64_t memory_test, // if TRUE, test malloc error handling - int64_t memory_punt // if TRUE, test punt case -) -{ - cholmod_dense *X = NULL ; - if (!memory_test) - { - // just call the method directly; no memory testing - X = SuiteSparseQR_solve (system, QR, B, cc) ; - } - else - { - // test malloc error handling - int64_t tries ; - test_memory_handler (cc, true) ; - my_punt = memory_punt ; - for (tries = 0 ; my_tries < 0 ; tries++) - { - my_tries = tries ; - X = SuiteSparseQR_solve (system, QR, B, cc) ; - if (cc->status == CHOLMOD_OK) break ; - } - normal_memory_handler (cc, true) ; - } - return (X) ; -} - - -// ============================================================================= -// === SPQR_solve (sparse case) ================================================ -// ============================================================================= - -// Wrapper for testing SuiteSparseQR_solve - -template cholmod_sparse *SPQR_solve -( - // arguments for SuiteSparseQR_solve: - int64_t system, - SuiteSparseQR_factorization *QR, - cholmod_sparse *B, - cholmod_common *cc, - - // malloc control - int64_t memory_test, // if TRUE, test malloc error handling - int64_t memory_punt // if TRUE, test punt case -) -{ - cholmod_sparse *X = NULL ; - if (!memory_test) - { - // just call the method directly; no memory testing - X = SuiteSparseQR_solve (system, QR, B, cc) ; - } - else - { - // test malloc error handling - int64_t tries ; - test_memory_handler (cc, true) ; - my_punt = memory_punt ; - for (tries = 0 ; my_tries < 0 ; tries++) - { - my_tries = tries ; - X = SuiteSparseQR_solve (system, QR, B, cc) ; - if (cc->status == CHOLMOD_OK) break ; - } - normal_memory_handler (cc, true) ; - } - return (X) ; -} - - -// ============================================================================= -// === SPQR_min2norm (dense case) ============================================== -// ============================================================================= - -// Wrapper for testing SuiteSparseQR_min2norm - -template cholmod_dense *SPQR_min2norm -( - // arguments for SuiteSparseQR_min2norm: - int ordering, - double tol, - cholmod_sparse *A, - cholmod_dense *B, - cholmod_common *cc, - - // malloc control - int64_t memory_test, // if TRUE, test malloc error handling - int64_t memory_punt // if TRUE, test punt case -) -{ - cholmod_dense *X = NULL ; - if (!memory_test) - { - // just call the method directly; no memory testing - X = SuiteSparseQR_min2norm (ordering, tol, A, B, cc) ; - } - else - { - // test malloc error handling - int64_t tries ; - test_memory_handler (cc, true) ; - my_punt = memory_punt ; - for (tries = 0 ; my_tries < 0 ; tries++) - { - my_tries = tries ; - X = SuiteSparseQR_min2norm (ordering, tol, A, B, cc) ; - if (cc->status == CHOLMOD_OK) break ; - } - normal_memory_handler (cc, true) ; - } - return (X) ; -} - -// ============================================================================= -// === SPQR_min2norm (sparse case) ============================================= -// ============================================================================= - -// Wrapper for testing SuiteSparseQR_min2norm - -template cholmod_sparse *SPQR_min2norm -( - // arguments for SuiteSparseQR_min2norm: - int ordering, - double tol, - cholmod_sparse *A, - cholmod_sparse *B, - cholmod_common *cc, - - // malloc control - int64_t memory_test, // if TRUE, test malloc error handling - int64_t memory_punt // if TRUE, test punt case -) -{ - cholmod_sparse *X = NULL ; - if (!memory_test) - { - // just call the method directly; no memory testing - X = SuiteSparseQR_min2norm (ordering, tol, A, B, cc) ; - } - else - { - // test malloc error handling - int64_t tries ; - test_memory_handler (cc, true) ; - my_punt = memory_punt ; - for (tries = 0 ; my_tries < 0 ; tries++) - { - my_tries = tries ; - X = SuiteSparseQR_min2norm (ordering, tol, A, B, cc) ; - if (cc->status == CHOLMOD_OK) break ; - } - normal_memory_handler (cc, true) ; - } - return (X) ; -} - -// ============================================================================= -// === SPQR_factorize ========================================================== -// ============================================================================= - -// Wrapper for testing SuiteSparseQR_factorize or -// SuiteSparseQR_symbolic and SuiteSparseQR_numeric -template SuiteSparseQR_factorization *SPQR_factorize -( - // arguments for SuiteSparseQR_factorize: - int ordering, - double tol, - cholmod_sparse *A, - cholmod_common *cc, - - // method to use - int split, // if 1 use SuiteSparseQR_symbolic followed by - // SuiteSparseQR_numeric, if 0 use - // SuiteSparseQR_factorize, if 2, do the - // numeric factorization twice, just for testing. - // if 3 use SuiteSparseQR_C_factorize - // if 3 use SuiteSparseQR_C_symbolic / _C_numeric - - // malloc control - int64_t memory_test, // if TRUE, test malloc error handling - int64_t memory_punt // if TRUE, test punt case -) -{ - SuiteSparseQR_factorization *QR ; - SuiteSparseQR_C_factorization *C_QR ; - if (!memory_test) + if (free_work) { - // just call the method directly; no memory testing - - if (split == 4) - { - - C_QR = SuiteSparseQR_C_symbolic (ordering, tol >= 0, A, cc) ; - SuiteSparseQR_C_numeric (tol, A, C_QR, cc) ; - if (C_QR == NULL) - { - cc->status = CHOLMOD_OUT_OF_MEMORY ; - QR = NULL ; - } - else - { - QR = (SuiteSparseQR_factorization *) - (C_QR->factors) ; - if (QR == NULL || QR->QRnum == NULL) - { - cc->status = CHOLMOD_OUT_OF_MEMORY ; - QR = NULL ; - } - else - { - // QR itself will be kept; free the C wrapper - C_QR->factors = NULL ; - cc->status = CHOLMOD_OK ; - if (QR == NULL) printf ("Hey!\n") ; - } - } - SuiteSparseQR_C_free (&C_QR, cc) ; - - } - else if (split == 3) - { - - C_QR = SuiteSparseQR_C_factorize (ordering, tol, A, cc) ; - int save = cc->status ; - if (C_QR == NULL) - { - QR = NULL ; - } - else - { - QR = (SuiteSparseQR_factorization *) (C_QR->factors) ; - C_QR->factors = NULL ; - SuiteSparseQR_C_free (&C_QR, cc) ; - } - cc->status = save ; - - } - else if (split == 2) - { - QR = SuiteSparseQR_symbolic (ordering, - tol >= 0 || tol <= SPQR_DEFAULT_TOL, A, cc) ; - ASSERT (QR != NULL) ; - SuiteSparseQR_numeric (tol, A, QR, cc) ; - // just for testing - SuiteSparseQR_numeric (tol, A, QR, cc) ; - } - else if (split == 1) + if (cc->itype == CHOLMOD_LONG) { - // split symbolic/numeric, no singletons exploited - QR = SuiteSparseQR_symbolic (ordering, - tol >= 0 || tol <= SPQR_DEFAULT_TOL, A, cc) ; - ASSERT (QR != NULL) ; - SuiteSparseQR_numeric (tol, A, QR, cc) ; + spqr_free_work (cc) ; } else { - QR = SuiteSparseQR_factorize (ordering, tol, A, cc) ; - } - - } - else - { - // test malloc error handling - int64_t tries ; - test_memory_handler (cc, true) ; - my_punt = memory_punt ; - for (tries = 0 ; my_tries < 0 ; tries++) - { - my_tries = tries ; - - if (split == 4) - { - - C_QR = SuiteSparseQR_C_symbolic (ordering, tol >= 0, A, cc) ; - SuiteSparseQR_C_numeric (tol, A, C_QR, cc) ; - if (C_QR == NULL) - { - cc->status = CHOLMOD_OUT_OF_MEMORY ; - QR = NULL ; - } - else - { - QR = (SuiteSparseQR_factorization *) - (C_QR->factors) ; - if (QR == NULL || QR->QRnum == NULL) - { - cc->status = CHOLMOD_OUT_OF_MEMORY ; - QR = NULL ; - } - else - { - // QR itself will be kept; free the C wrapper - C_QR->factors = NULL ; - cc->status = CHOLMOD_OK ; - if (QR == NULL) printf ("Hey!!\n") ; - } - } - SuiteSparseQR_C_free (&C_QR, cc) ; - - - } - else if (split == 3) - { - - C_QR = SuiteSparseQR_C_factorize (ordering, tol, A, cc) ; - int save = cc->status ; - if (C_QR == NULL) - { - QR = NULL ; - } - else - { - QR = (SuiteSparseQR_factorization *) C_QR->factors ; - C_QR->factors = NULL ; - SuiteSparseQR_C_free (&C_QR, cc) ; - } - cc->status = save ; - - } - else if (split == 1 || split == 2) - { - // split symbolic/numeric, no singletons exploited - QR = SuiteSparseQR_symbolic (ordering, - tol >= 0 || tol <= SPQR_DEFAULT_TOL, A, cc) ; - if (cc->status < CHOLMOD_OK) - { - continue ; - } - ASSERT (QR != NULL) ; - SuiteSparseQR_numeric (tol, A, QR, cc) ; - if (cc->status < CHOLMOD_OK) - { - SuiteSparseQR_free (&QR, cc) ; - } - } - else - { - QR = SuiteSparseQR_factorize (ordering, tol, A, cc) ; - } - - if (cc->status == CHOLMOD_OK) break ; + spqr_free_work (cc) ; } - normal_memory_handler (cc, true) ; } - if (QR == NULL) printf ("huh?? split: %d ordering %d tol %g\n", split, - ordering, tol) ; - return (QR) ; + my_tries = -2 ; + my_punt = FALSE ; } - -#endif - // ============================================================================= -// === SPQR_qr ================================================================= +// === qrest_template ========================================================== // ============================================================================= -// wrapper for SuiteSparseQR, optionally testing memory allocation - -template int64_t SPQR_qr -( - // arguments for SuiteSparseQR: - int ordering, - double tol, - int64_t econ, - int64_t getCTX, - cholmod_sparse *A, - cholmod_sparse *Bsparse, - cholmod_dense *Bdense, - cholmod_sparse **Zsparse, - cholmod_dense **Zdense, - cholmod_sparse **R, - int64_t **E, - cholmod_sparse **H, - int64_t **HPinv, - cholmod_dense **HTau, - cholmod_common *cc, - - // which version to use (C or C++) - int use_c_version, // if TRUE use C version, otherwise use C++ - - // malloc control - int64_t memory_test, // if TRUE, test malloc error handling - int64_t memory_punt // if TRUE, test punt case -) -{ - int64_t rank ; - if (!memory_test) - { - // just call the method directly; no memory testing - if (use_c_version) - { - rank = SuiteSparseQR_C (ordering, tol, econ, getCTX, A, - Bsparse, Bdense, Zsparse, Zdense, R, E, H, HPinv, HTau, cc) ; - } - else - { - rank = SuiteSparseQR (ordering, tol, econ, getCTX, A, - Bsparse, Bdense, Zsparse, Zdense, R, E, H, HPinv, HTau, cc) ; - } - } - else - { - // test malloc error handling - int64_t tries ; - test_memory_handler (cc, true) ; - my_punt = memory_punt ; - for (tries = 0 ; my_tries < 0 ; tries++) - { - my_tries = tries ; - if (use_c_version) - { - rank = SuiteSparseQR_C (ordering, tol, econ, getCTX, A, - Bsparse, Bdense, Zsparse, Zdense, R, E, H, HPinv, HTau, cc); - } - else - { - rank = SuiteSparseQR (ordering, tol, econ, getCTX, A, - Bsparse, Bdense, Zsparse, Zdense, R, E, H, HPinv, HTau, cc); - } - if (cc->status == CHOLMOD_OK) - { - break ; - } - } - normal_memory_handler (cc, true) ; - } - return (rank) ; -} - +#include "qrtest_template.hpp" // ============================================================================= -// === my_rand ================================================================= +// === qrtest main ============================================================= // ============================================================================= -// The POSIX example of rand, duplicated here so that the same sequence will -// be generated on different machines. - -static unsigned long next = 1 ; - -#define MY_RAND_MAX 32767 - -// RAND_MAX assumed to be 32767 -int64_t my_rand (void) -{ - next = next * 1103515245 + 12345 ; - return ((unsigned)(next/65536) % (MY_RAND_MAX + 1)) ; -} - -void my_srand (unsigned seed) -{ - next = seed ; -} - -unsigned long my_seed (void) -{ - return (next) ; -} - -int64_t nrand (int64_t n) // return a random int64_t between 0 and n-1 -{ - return ((n <= 0) ? 0 : (my_rand ( ) % n)) ; -} - -double xrand ( ) // return a random double between -1 and 1 -{ - double x = ((double) my_rand ( )) / MY_RAND_MAX ; - return (2*x-1) ; -} - -double erand (double range) -{ - return (range * xrand ( )) ; -} - -Complex erand (Complex range) -{ - /* - Complex x ; - x.real ( ) = xrand ( ) ; - x.imag ( ) = xrand ( ) ; - return (range * x) ; - */ - Complex i = Complex (0,1) ; - return (range * (xrand ( ) + i * xrand ( ))) ; -} - - -// ============================================================================= -// === getreal ================================================================= -// ============================================================================= - -// return real part of a scalar x - -inline double getreal (double x) -{ - return (x) ; -} - -inline double getreal (Complex x) -{ - return (x.real ( )) ; -} - -// ============================================================================= -// === getimag ================================================================= -// ============================================================================= - -// return imaginary part of a scalar x -inline double getimag (double x) // x is an unused parameter -{ - return (0) ; -} - -inline double getimag (Complex x) -{ - return (x.imag ( )) ; -} - - -// ============================================================================= -// === dense_wrapper =========================================================== -// ============================================================================= - -// place a column-oriented matrix in a cholmod_dense wrapper - -template cholmod_dense *dense_wrapper -( - cholmod_dense *X, - int64_t nrow, - int64_t ncol, - Entry *Xx -) -{ - X->xtype = spqr_type ( ) ; - X->nrow = nrow ; - X->ncol = ncol ; - X->d = nrow ; // leading dimension = nrow - X->nzmax = nrow * ncol ; - X->x = Xx ; - X->z = NULL ; // ZOMPLEX case not supported - X->dtype = CHOLMOD_DOUBLE ; - return (X) ; -} - -// ============================================================================= -// === sparse_split ============================================================ -// ============================================================================= - -// Return the real or imaginary part of a packed complex sparse matrix - -cholmod_sparse *sparse_split -( - cholmod_sparse *A, - int64_t part, - cholmod_common *cc -) -{ - cholmod_sparse *C ; - if (!A || A->xtype != CHOLMOD_COMPLEX || A->nz != NULL) return (NULL) ; - if (! (part == 0 || part == 1)) return (NULL) ; - - int64_t nz = cholmod_l_nnz (A, cc) ; - C = cholmod_l_allocate_sparse (A->nrow, A->ncol, nz, TRUE, TRUE, 0, - CHOLMOD_REAL, cc) ; - - int64_t *Ap = (int64_t *) A->p ; - int64_t *Ai = (int64_t *) A->i ; - double *Ax = (double *) A->x ; - - int64_t *Cp = (int64_t *) C->p ; - int64_t *Ci = (int64_t *) C->i ; - double *Cx = (double *) C->x ; - - int64_t n = A->ncol ; - - for (int64_t k = 0 ; k < n+1 ; k++) - { - Cp [k] = Ap [k] ; - } - - for (int64_t k = 0 ; k < nz ; k++) - { - Ci [k] = Ai [k] ; - } - - for (int64_t k = 0 ; k < nz ; k++) - { - Cx [k] = Ax [2*k + part] ; - } - - return (C) ; -} - -cholmod_sparse *sparse_real (cholmod_sparse *A, cholmod_common *cc) -{ - return (sparse_split (A, 0, cc)) ; -} - -cholmod_sparse *sparse_imag (cholmod_sparse *A, cholmod_common *cc) -{ - return (sparse_split (A, 1, cc)) ; -} - -// ============================================================================= -// === sparse_merge ============================================================ -// ============================================================================= - -// Add the real and imaginary parts of a matrix (both stored in real form) -// into a single matrix. The two parts must have the same nonzero pattern. -// A is CHOLMOD_REAL on input and holds the real part, it is CHOLMOD_COMPLEX -// on output. A_imag is CHOLMOD_REAL on input; it holds the imaginary part -// of A as a real matrix. - -int sparse_merge -( - cholmod_sparse *A, // input/output - cholmod_sparse *A_imag, // input only - cholmod_common *cc -) -{ - if (A == NULL || A_imag == NULL) - { - return (FALSE) ; - } - int64_t nz1 = cholmod_l_nnz (A, cc) ; - int64_t nz2 = cholmod_l_nnz (A_imag, cc) ; - if (A->xtype != CHOLMOD_REAL || A_imag->xtype != CHOLMOD_REAL || nz1 != nz2) - { - return (FALSE) ; - } - - // change A from real to complex - cholmod_l_sparse_xtype (CHOLMOD_COMPLEX, A, cc) ; - - double *Ax = (double *) A->x ; - double *Az = (double *) A_imag->x ; - - // merge in the imaginary part from A_imag into A - for (int64_t k = 0 ; k < nz1 ; k++) - { - Ax [2*k+1] = Az [k] ; - } - return (TRUE) ; -} - - -// ============================================================================= -// === sparse_diff ============================================================= -// ============================================================================= - -// Compute C = A-B where A and B are either both real, or both complex - -template cholmod_sparse *sparse_diff -( - cholmod_sparse *A, - cholmod_sparse *B, - cholmod_common *cc -) -{ - cholmod_sparse *C ; - double one [2] = {1,0}, minusone [2] = {-1,0} ; - - if (spqr_type ( ) == CHOLMOD_REAL) - { - // C = A - B - C = cholmod_l_add (A, B, one, minusone, TRUE, TRUE, cc) ; - } - else - { - cholmod_sparse *A_real, *A_imag, *B_real, *B_imag, *C_imag ; - - A_real = sparse_real (A, cc) ; - A_imag = sparse_imag (A, cc) ; - - B_real = sparse_real (B, cc) ; - B_imag = sparse_imag (B, cc) ; - - // real(C) = real(A) - real (B) - C = cholmod_l_add (A_real, B_real, one, minusone, TRUE, TRUE, cc) ; - - // imag(C) = imag(A) - imag (B) - C_imag = cholmod_l_add (A_imag, B_imag, one, minusone, TRUE, TRUE, cc) ; - - // C = real(C) + 1i*imag(C) - sparse_merge (C, C_imag, cc) ; - cholmod_l_free_sparse (&C_imag, cc) ; - - cholmod_l_free_sparse (&A_real, cc) ; - cholmod_l_free_sparse (&A_imag, cc) ; - cholmod_l_free_sparse (&B_real, cc) ; - cholmod_l_free_sparse (&B_imag, cc) ; - } - - return (C) ; -} - - -// ============================================================================= -// === permute_columns ========================================================= -// ============================================================================= - -// compute A(:,P) - -template cholmod_sparse *permute_columns -( - cholmod_sparse *A, - int64_t *P, - cholmod_common *cc -) -{ - int64_t m = A->nrow ; - int64_t n = A->ncol ; - int64_t nz = cholmod_l_nnz (A, cc) ; - int64_t xtype = spqr_type ( ) ; - int64_t *Ap = (int64_t *) A->p ; - int64_t *Ai = (int64_t *) A->i ; - Entry *Ax = (Entry *) A->x ; - cholmod_sparse *C ; - - // allocate empty matrix C with space for nz entries - C = cholmod_l_allocate_sparse (m, n, nz, TRUE, TRUE, 0, xtype, cc) ; - int64_t *Cp = (int64_t *) C->p ; - int64_t *Ci = (int64_t *) C->i ; - Entry *Cx = (Entry *) C->x ; - - // construct column pointers for C - for (int64_t k = 0 ; k < n ; k++) - { - // column j of A becomes column k of C - int64_t j = P ? P [k] : k ; - Cp [k] = Ap [j+1] - Ap [j] ; - } - spqr_cumsum (n, Cp) ; - - // copy columns from A to C - for (int64_t k = 0 ; k < n ; k++) - { - // copy column k of A into column j of C - int64_t j = P ? P [k] : k ; - int64_t pdest = Cp [k] ; - int64_t psrc = Ap [j] ; - int64_t len = Ap [j+1] - Ap [j] ; - for (int64_t t = 0 ; t < len ; t++) - { - Ci [pdest + t] = Ai [psrc + t] ; - Cx [pdest + t] = Ax [psrc + t] ; - } - } - - return (C) ; -} - - -// ============================================================================= -// === sparse_multiply ========================================================= -// ============================================================================= - -// compute A*B where A and B can be both real or both complex - -template cholmod_sparse *sparse_multiply -( - cholmod_sparse *A, - cholmod_sparse *B, - cholmod_common *cc -) -{ - cholmod_sparse *C ; - - if (spqr_type ( ) == CHOLMOD_REAL) - { - // C = A*B - C = cholmod_l_ssmult (A, B, 0, TRUE, TRUE, cc) ; - } - else - { - // cholmod_ssmult and cholmod_add only work for real matrices - cholmod_sparse *A_real, *A_imag, *B_real, *B_imag, *C_imag, *T1, *T2 ; - double one [2] = {1,0}, minusone [2] = {-1,0} ; - - A_real = sparse_real (A, cc) ; - A_imag = sparse_imag (A, cc) ; - - B_real = sparse_real (B, cc) ; - B_imag = sparse_imag (B, cc) ; - - // real(C) = real(A)*real(B) - imag(A)*imag(B) - T1 = cholmod_l_ssmult (A_real, B_real, 0, TRUE, TRUE, cc) ; - T2 = cholmod_l_ssmult (A_imag, B_imag, 0, TRUE, TRUE, cc) ; - C = cholmod_l_add (T1, T2, one, minusone, TRUE, TRUE, cc) ; - cholmod_l_free_sparse (&T1, cc) ; - cholmod_l_free_sparse (&T2, cc) ; - - // imag(C) = imag(A)*real(B) + real(A)*imag(B) - T1 = cholmod_l_ssmult (A_imag, B_real, 0, TRUE, TRUE, cc) ; - T2 = cholmod_l_ssmult (A_real, B_imag, 0, TRUE, TRUE, cc) ; - C_imag = cholmod_l_add (T1, T2, one, one, TRUE, TRUE, cc) ; - cholmod_l_free_sparse (&T1, cc) ; - cholmod_l_free_sparse (&T2, cc) ; - - // C = real(C) + 1i*imag(C) - sparse_merge (C, C_imag, cc) ; - cholmod_l_free_sparse (&C_imag, cc) ; - - cholmod_l_free_sparse (&A_real, cc) ; - cholmod_l_free_sparse (&A_imag, cc) ; - cholmod_l_free_sparse (&B_real, cc) ; - cholmod_l_free_sparse (&B_imag, cc) ; - } - - return (C) ; -} - - -// ============================================================================= -// === sparse_resid ============================================================ -// ============================================================================= - -// compute norm (A*x-b,1) for A,x, and b all sparse - -template double sparse_resid -( - cholmod_sparse *A, - double anorm, - cholmod_sparse *X, - cholmod_sparse *B, - cholmod_common *cc -) -{ - cholmod_sparse *AX, *Resid ; - // AX = A*X - AX = sparse_multiply (A, X, cc) ; - // Resid = AX - B - Resid = sparse_diff (AX, B, cc) ; - // resid = norm (Resid,1) - double resid = cholmod_l_norm_sparse (Resid, 1, cc) ; - resid = CHECK_NAN (resid) ; - cholmod_l_free_sparse (&AX, cc) ; - cholmod_l_free_sparse (&Resid, cc) ; - return (CHECK_NAN (resid / anorm)) ; -} - - -// ============================================================================= -// === dense_resid ============================================================= -// ============================================================================= - -// compute norm (A*x-b,1) for A sparse, x and b dense - -template double dense_resid -( - cholmod_sparse *A, - double anorm, - cholmod_dense *X, - int64_t nb, - Entry *Bx, - cholmod_common *cc -) -{ - cholmod_dense *B, Bmatrix, *Resid ; - double one [2] = {1,0}, minusone [2] = {-1,0} ; - - B = dense_wrapper (&Bmatrix, A->nrow, nb, Bx) ; - // Resid = B - Resid = cholmod_l_copy_dense (B, cc) ; - - // Resid = A*X - Resid - cholmod_l_sdmult (A, FALSE, one, minusone, X, Resid, cc) ; - - // resid = norm (Resid,1) - double resid = cholmod_l_norm_dense (Resid, 1, cc) ; - resid = CHECK_NAN (resid) ; - cholmod_l_free_dense (&Resid, cc) ; - return (CHECK_NAN (resid / anorm)) ; -} - -// ============================================================================= -// === check_r_factor ========================================================== -// ============================================================================= - -// compute norm (R'*R - (A(:,P))'*(A(:,P)), 1) / norm (A'*A,1) - -template double check_r_factor -( - cholmod_sparse *R, - cholmod_sparse *A, - int64_t *P, - cholmod_common *cc -) -{ - cholmod_sparse *RTR, *RT, *C, *CT, *CTC, *D ; - - // RTR = R'*R - RT = cholmod_l_transpose (R, 2, cc) ; - RTR = sparse_multiply (RT, R, cc) ; - cholmod_l_free_sparse (&RT, cc) ; - - // C = A(:,P) - C = permute_columns (A, P, cc) ; - - // CTC = C'*C - CT = cholmod_l_transpose (C, 2, cc) ; - CTC = sparse_multiply (CT, C, cc) ; - cholmod_l_free_sparse (&CT, cc) ; - cholmod_l_free_sparse (&C, cc) ; - - double ctcnorm = cholmod_l_norm_sparse (CTC, 1, cc) ; - if (ctcnorm == 0) ctcnorm = 1 ; - ctcnorm = CHECK_NAN (ctcnorm) ; - - // D = RTR - CTC - D = sparse_diff (RTR, CTC, cc) ; - cholmod_l_free_sparse (&CTC, cc) ; - cholmod_l_free_sparse (&RTR, cc) ; - - // err = norm (D,1) - double err = cholmod_l_norm_sparse (D, 1, cc) / ctcnorm ; - err = CHECK_NAN (err) ; - - cholmod_l_free_sparse (&D, cc) ; - return (CHECK_NAN (err)) ; -} - - -// ============================================================================= -// === check_qr ================================================================ -// ============================================================================= - -// compute norm (Q*R - A(:,P)) / norm (A) - -template double check_qr -( - cholmod_sparse *Q, - cholmod_sparse *R, - cholmod_sparse *A, - int64_t *P, - double anorm, - cholmod_common *cc -) -{ - cholmod_sparse *QR, *C, *D ; - - // C = A(:,P) - C = permute_columns (A, P, cc) ; - - // QR = Q*R - QR = sparse_multiply (Q, R, cc) ; - - // D = RTR - CTC - D = sparse_diff (QR, C, cc) ; - cholmod_l_free_sparse (&QR, cc) ; - cholmod_l_free_sparse (&C, cc) ; - - // err = norm (D,1) - double err = cholmod_l_norm_sparse (D, 1, cc) / anorm ; - err = CHECK_NAN (err) ; - - cholmod_l_free_sparse (&D, cc) ; - return (CHECK_NAN (err)) ; -} - - -// ============================================================================= -// === Rsolve ================================================================== -// ============================================================================= - -template int Rsolve -( - // R is n-by-n, upper triangular with zero-free diagonal - int64_t n, - cholmod_sparse *R, - Entry *X, // X is n-by-nx, leading dimension n, overwritten with soln - int64_t nx, - cholmod_common *cc -) -{ - // int64_t n = R->n ; - int64_t *Rp = (int64_t *) R->p ; - int64_t *Ri = (int64_t *) R->i ; - Entry *Rx = (Entry *) R->x ; - - // check the diagonal - for (int64_t j = 0 ; j < n ; j++) - { - if (Rp [j] == Rp [j+1] || Ri [Rp [j+1]-1] != j) - { - printf ("Rsolve: R not upper triangular w/ zero-free diagonal\n") ; - return (FALSE) ; - } - } - - // do the backsolve - for (int64_t k = 0 ; k < nx ; k++) - { - for (int64_t j = n-1 ; j >= 0 ; j--) - { - Entry rjj = Rx [Rp [j+1]-1] ; - if (rjj == (Entry) 0) - { - printf ("Rsolve: R has an explicit zero on the diagonal\n") ; - return (FALSE) ; - } - X [j] /= rjj ; - for (int64_t p = Rp [j] ; p < Rp [j+1]-1 ; p++) - { - X [Ri [p]] -= Rx [p] * X [j] ; - } - } - X += n ; - } - - return (TRUE) ; -} - - -// ============================================================================= -// === create_Q ================================================================ -// ============================================================================= - -// create a sparse Q -template cholmod_sparse *create_Q -( - cholmod_sparse *H, - cholmod_dense *HTau, - int64_t *HPinv, - cholmod_common *cc -) -{ - cholmod_sparse *Q, *I ; - int64_t m = H->nrow ; - int64_t xtype = spqr_type ( ) ; - I = cholmod_l_speye (m, m, xtype, cc) ; - Q = SPQR_qmult (1, H, HTau, HPinv, I, cc, m<300, nrand (2)) ; - cholmod_l_free_sparse (&I, cc) ; - return (Q) ; -} - - -// ============================================================================= -// === QRsolve ================================================================= -// ============================================================================= - -// solve Ax=b using H, R, and E - -template double QRsolve -( - cholmod_sparse *A, - double anorm, - int64_t rank, - int64_t method, - cholmod_sparse *H, - cholmod_dense *HTau, - int64_t *HPinv, - cholmod_sparse *R, - int64_t *Qfill, - cholmod_dense *Bdense, - cholmod_common *cc -) -{ - double one [2] = {1,0}, zero [2] = {0,0}, resid = EMPTY ; - int64_t xtype = spqr_type ( ) ; - int64_t n = A->ncol ; - int64_t m = A->nrow ; - int64_t nrhs = Bdense->ncol ; - Entry *X, *Y = NULL, *B ; - cholmod_dense *Ydense = NULL ; - cholmod_dense *Xdense ; - - B = (Entry *) Bdense->x ; - Xdense = cholmod_l_zeros (n, nrhs, xtype, cc) ; - X = (Entry *) Xdense->x ; - - if (method == 0) - { - // solve Ax=b using H, R, and E - // Y = Q'*B - Ydense = SPQR_qmult (0, H, HTau, HPinv, Bdense, cc, - m < 300, nrand (2)) ; - } - else - { - cholmod_sparse *Q, *QT ; - // solve using Q instead of qmult - Q = create_Q (H, HTau, HPinv, cc) ; - QT = cholmod_l_transpose (Q, 2, cc) ; - // Y = Q'*B - Ydense = cholmod_l_zeros (m, nrhs, xtype, cc) ; - cholmod_l_sdmult (QT, FALSE, one, zero, Bdense, Ydense, cc) ; - cholmod_l_free_sparse (&Q, cc) ; - cholmod_l_free_sparse (&QT, cc) ; - } - - // Y (1:rank) = R (1:rank,1:rank) \ Y (1:rank) - Y = (Entry *) Ydense->x ; - int64_t ok = Rsolve (rank, R, Y, nrhs, cc) ; - // X = E*Y - if (ok) - { - for (int64_t kk = 0 ; kk < nrhs ; kk++) - { - for (int64_t k = 0 ; k < rank ; k++) - { - int64_t j = Qfill ? Qfill [k] : k ; - X [j] = Y [k] ; - } - X += n ; - Y += m ; - } - // check norm (A*x-b), x and b dense - resid = dense_resid (A, anorm, Xdense, nrhs, B, cc) ; - } - - cholmod_l_free_dense (&Ydense, cc) ; - cholmod_l_free_dense (&Xdense, cc) ; - return (CHECK_NAN (resid)) ; -} - - -// ============================================================================= -// === check_qmult ============================================================= -// ============================================================================= - -// Test qmult - -template double check_qmult -( - cholmod_sparse *H, - cholmod_dense *HTau, - int64_t *HPinv, - int64_t test_errors, - cholmod_common *cc -) -{ - cholmod_sparse *Q, *QT, *Xsparse, *Ssparse, *Zsparse ; - cholmod_dense *Xdense, *Zdense, *Sdense, *Ydense ; - int64_t xtype = spqr_type ( ) ; - Entry *X, *Y, *Z, *S ; - double err, maxerr = 0 ; - double one [2] = {1,0}, zero [2] = {0,0} ; - Entry range = (Entry) 1.0 ; - int64_t k ; - - int64_t m = H->nrow ; - Q = create_Q (H, HTau, HPinv, cc) ; // construct Q from H - - QT = cholmod_l_transpose (Q, 2, cc) ; // QT = Q' - - // compare Q with qmult for sparse and dense X - for (int64_t nx = 0 ; nx < 5 ; nx++) // # of columns of X - { - int64_t xsize = m * nx ; // size of X - for (int64_t nz = 1 ; nz <= xsize+1 ; nz *= 16) // # of nonzeros in X - { - - // ----------------------------------------------------------------- - // create X as m-by-nx, both sparse and dense - // ----------------------------------------------------------------- - - Xdense = cholmod_l_zeros (m, nx, xtype, cc) ; - X = (Entry *) Xdense->x ; - for (k = 0 ; k < nz ; k++) - { - X [nrand (xsize)] += erand (range) ; - } - Xsparse = cholmod_l_dense_to_sparse (Xdense, TRUE, cc) ; - - // ----------------------------------------------------------------- - // Y = Q'*X for method 0, Y = Q*X for method 1 - // ----------------------------------------------------------------- - - for (int method = 0 ; method <= 1 ; method++) - { - // Y = Q'*X or Q*X - Ydense = SPQR_qmult (method, H, HTau, HPinv, Xdense, cc, - m < 300, nrand (2)) ; - Y = (Entry *) Ydense->x ; - - Zdense = cholmod_l_zeros (m, nx, xtype, cc) ; - cholmod_l_sdmult (Q, (method == 0), one, zero, - Xdense, Zdense, cc) ; - Z = (Entry *) Zdense->x ; - - for (err = 0, k = 0 ; k < xsize ; k++) - { - double e1 = spqr_abs (Y [k] - Z [k], cc) ; - e1 = CHECK_NAN (e1) ; - err = MAX (err, e1) ; - } - maxerr = MAX (maxerr, err) ; - - // S = Q'*Xsparse or Q*Xsparse - Ssparse = SPQR_qmult ( - method, H, HTau, HPinv, Xsparse, cc, m < 300, nrand (2)) ; - Sdense = cholmod_l_sparse_to_dense (Ssparse, cc) ; - S = (Entry *) Sdense->x ; - - for (err = 0, k = 0 ; k < xsize ; k++) - { - double e1 = spqr_abs (S [k] - Y [k], cc) ; - e1 = CHECK_NAN (e1) ; - err = MAX (err, e1) ; - } - maxerr = MAX (maxerr, err) ; - - cholmod_l_free_dense (&Ydense, cc) ; - cholmod_l_free_dense (&Zdense, cc) ; - cholmod_l_free_sparse (&Ssparse, cc) ; - cholmod_l_free_dense (&Sdense, cc) ; - } - - cholmod_l_free_dense (&Xdense, cc) ; - cholmod_l_free_sparse (&Xsparse, cc) ; - - // ----------------------------------------------------------------- - // create X as nx-by-m, both sparse and dense - // ----------------------------------------------------------------- - - Xdense = cholmod_l_zeros (nx, m, xtype, cc) ; - X = (Entry *) Xdense->x ; - for (k = 0 ; k < nz ; k++) - { - X [nrand (xsize)] += erand (range) ; - } - Xsparse = cholmod_l_dense_to_sparse (Xdense, TRUE, cc) ; - - // ----------------------------------------------------------------- - // Y = X*Q' for method 2, Y = X*Q for method 3 - // ----------------------------------------------------------------- - - for (int method = 2 ; method <= 3 ; method++) - { - // Y = X*Q' or X*Q - Ydense = SPQR_qmult (method, H, HTau, HPinv, Xdense, cc, - m < 300, nrand (2)) ; - Y = (Entry *) Ydense->x ; - - if (method == 2) - { - // Zsparse = (X*Q') - Zsparse = sparse_multiply (Xsparse, QT, cc) ; - } - else - { - // Zsparse = (X*Q) - Zsparse = sparse_multiply (Xsparse, Q, cc) ; - } - Zdense = cholmod_l_sparse_to_dense (Zsparse, cc) ; - - Z = (Entry *) Zdense->x ; - - for (err = 0, k = 0 ; k < xsize ; k++) - { - double e1 = spqr_abs (Y [k] - Z [k], cc) ; - e1 = CHECK_NAN (e1) ; - err = MAX (err, e1) ; - } - maxerr = MAX (maxerr, err) ; - - // S = X*Q' or X*Q - Ssparse = SPQR_qmult ( - method, H, HTau, HPinv, Xsparse, cc, m < 300, nrand (2)) ; - Sdense = cholmod_l_sparse_to_dense (Ssparse, cc) ; - S = (Entry *) Sdense->x ; - - for (err = 0, k = 0 ; k < xsize ; k++) - { - double e1 = spqr_abs (S [k] - Y [k], cc) ; - e1 = CHECK_NAN (e1) ; - err = MAX (err, e1) ; - } - maxerr = MAX (maxerr, err) ; - - cholmod_l_free_dense (&Ydense, cc) ; - cholmod_l_free_dense (&Zdense, cc) ; - cholmod_l_free_sparse (&Ssparse, cc) ; - cholmod_l_free_sparse (&Zsparse, cc) ; - cholmod_l_free_dense (&Sdense, cc) ; - } - - cholmod_l_free_dense (&Xdense, cc) ; - cholmod_l_free_sparse (&Xsparse, cc) ; - - } - } - cholmod_l_free_sparse (&Q, cc) ; - cholmod_l_free_sparse (&QT, cc) ; - - // ------------------------------------------------------------------------- - // qmult error conditions - // ------------------------------------------------------------------------- - - // These should fail; expect 6 error messages in the output - - if (test_errors) - { - err = 0 ; - printf ("The following six errors are expected:\n") ; - Xdense = cholmod_l_zeros (m+1, 1, xtype,cc) ; - Ydense = SuiteSparseQR_qmult (0, H, HTau, HPinv, Xdense, cc) ; - if (Ydense != NULL || cc->status != CHOLMOD_INVALID) err++ ; - cholmod_l_free_dense (&Xdense, cc) ; - - Xdense = cholmod_l_zeros (1, m+1, xtype,cc) ; - Ydense = SuiteSparseQR_qmult (2, H, HTau, HPinv, Xdense, cc) ; - if (Ydense != NULL || cc->status != CHOLMOD_INVALID) err++ ; - Ydense = SuiteSparseQR_qmult (42, H, HTau, HPinv, Xdense, cc) ; - if (Ydense != NULL || cc->status != CHOLMOD_INVALID) err++ ; - cholmod_l_free_dense (&Xdense, cc) ; - - Xsparse = cholmod_l_speye (m+1, m+1, xtype, cc) ; - - Q = SuiteSparseQR_qmult (0, H, HTau, HPinv, Xsparse, cc); - if (Q != NULL || cc->status != CHOLMOD_INVALID) err++ ; - Q = SuiteSparseQR_qmult (2, H, HTau, HPinv, Xsparse, cc); - if (Q != NULL || cc->status != CHOLMOD_INVALID) err++ ; - Q = SuiteSparseQR_qmult (9, H, HTau, HPinv, Xsparse, cc); - if (Q != NULL || cc->status != CHOLMOD_INVALID) err++ ; - - printf (" ... error handling done\n\n") ; - cholmod_l_free_sparse (&Xsparse, cc) ; - - maxerr = MAX (maxerr, err) ; - } - - return (CHECK_NAN (maxerr)) ; -} - - -// ============================================================================= -// === check_rc ================================================================ -// ============================================================================= - -// X = Q'*B has been done, continue with C=R\C and - -template double check_rc -( - int64_t rank, - cholmod_sparse *R, - cholmod_sparse *A, - Entry *B, - cholmod_dense *X, - int64_t nrhs, - double anorm, - int64_t *Qfill, - cholmod_common *cc -) -{ - double resid = EMPTY ; - int64_t xtype = spqr_type ( ) ; - cholmod_dense *W ; - int64_t n, ok ; - Entry *W1, *X1 ; - if (!R || !X) - { - ok = 0 ; - } - else - { - n = X->nrow ; - X1 = (Entry *) X->x ; - // solve X = R\X, overwriting X with solution - ok = Rsolve (rank, R, X1, nrhs, cc) ; - } - if (ok) - { - // W = E*X - // W = (Entry *) cholmod_l_calloc (A->ncol * nrhs, sizeof (Entry), cc) ; - W = cholmod_l_zeros (A->ncol, nrhs, xtype, cc) ; - W1 = (Entry *) W->x ; - for (int64_t col = 0 ; col < nrhs ; col++) - { - for (int64_t k = 0 ; k < rank ; k++) - { - int64_t j = Qfill ? Qfill [k] : k ; - if (j < (int64_t) A->ncol) W1 [j] = X1 [k] ; - } - W1 += A->ncol ; - X1 += n ; - } - // check norm (A*x-b), x and b dense - resid = dense_resid (A, anorm, W, nrhs, B, cc) ; - // cholmod_l_free (A->ncol * nrhs, sizeof (Entry), W, cc) ; - cholmod_l_free_dense (&W, cc) ; - } - return (CHECK_NAN (resid)) ; -} - - -// ============================================================================= -// === transpose =============================================================== -// ============================================================================= - -// Transpose a dense matrix. - -template cholmod_dense *transpose -( - cholmod_dense *Xdense, - cholmod_common *cc -) -{ - Entry *X, *Y ; - cholmod_dense *Ydense ; - if (Xdense == NULL) - { - printf ("transpose failed!\n") ; - return (NULL) ; - } - int64_t m = Xdense->nrow ; - int64_t n = Xdense->ncol ; - int64_t ldx = Xdense->d ; - int64_t xtype = spqr_type ( ) ; - Ydense = cholmod_l_allocate_dense (n, m, n, xtype, cc) ; - X = (Entry *) Xdense->x ; - Y = (Entry *) Ydense->x ; - for (int64_t i = 0 ; i < m ; i++) - { - for (int64_t j = 0 ; j < n ; j++) - { - Y [j+i*n] = spqr_conj (X [i+j*ldx]) ; - } - } - return (Ydense) ; -} - -// ============================================================================= -// === qrtest ================================================================== -// ============================================================================= - -template void qrtest -( - cholmod_sparse *A, - double errs [5], - cholmod_common *cc -) -{ - cholmod_sparse *H, *I, *R, *Q, *Csparse, *Xsparse, *AT, *Bsparse ; - cholmod_dense *Cdense, *Xdense, *Bdense, *HTau ; ; - double tol = DBL_EPSILON, err, resid, maxerr, maxresid [2][2] ; - double tols [ ] = { SPQR_DEFAULT_TOL, -1, 0, DBL_EPSILON } ; - int64_t n, m, nz, *HPinv, ntol, *Ai, *Ap, k, *Qfill, rank, nb, *Cp, *Ci, econ, - which ; - Entry *B, *Ax, *Cx ; - int64_t xtype = spqr_type ( ) ; - int ordering ; - Entry range = (Entry) 1.0 ; - - errs [0] = EMPTY ; - errs [1] = EMPTY ; - errs [2] = EMPTY ; - errs [3] = EMPTY ; - errs [4] = EMPTY ; - if (A == NULL) - { - fprintf (stderr, "qrtest: no input matrix\n") ; - return ; - } - - m = A->nrow ; - n = A->ncol ; - Ap = (int64_t *) A->p ; - Ai = (int64_t *) A->i ; - Ax = (Entry *) A->x ; - double anorm = cholmod_l_norm_sparse (A, 1, cc) ; - anorm = CHECK_NAN (anorm) ; - printf ("\n===========================================================\n") ; - printf ("Matrix: %ld by %ld, nnz(A) = %ld, norm(A,1) = %g\n", - m, n, cholmod_l_nnz (A, cc), anorm) ; - printf ( "===========================================================\n") ; - - if (anorm == 0) anorm = 1 ; - - // these should all be zero, no matter what the matrix - maxerr = 0 ; - - // residuals for well-determined or under-determined systems. If - // not rank deficient, these should be zero - maxresid [0][0] = 0 ; // for m <= n, default tol, ordering not fixed - maxresid [0][1] = 0 ; // for m <= n, all other cases - - // residuals for least-squares systems (these will not be zero) - maxresid [1][0] = 0 ; // for m > n, default tol, ordering not fixed - maxresid [1][1] = 0 ; // for m > n, all other cases - - my_srand (m+n) ; - - if (m > 45000) - { - // The only thing returned are the statistics (rank, etc) - printf ("\n=== QR huge (expect int overflow):\n") ; - rank = SPQR_qr ( - 0, 0, 0, 0, A, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - cc, FALSE, FALSE, FALSE) ; - return ; - } - - if (MAX (m,n) >= 300) fprintf (stderr, "please wait ... ") ; - - AT = cholmod_l_transpose (A, 2, cc) ; - - // ------------------------------------------------------------------------- - // test QR routines - // ------------------------------------------------------------------------- - - econ = m ; - - for (ordering = 0 ; ordering <= 9 ; ordering++) - { - - // skip SPQR_ORDERING_GIVEN, unless the matrix is tiny - if (ordering == SPQR_ORDERING_GIVEN && MAX (m,n) > 10) continue ; - - for (ntol = 0 ; ntol < NTOL ; ntol++) - { - - tol = tols [ntol] ; - if // (ntol == 0) // this old test is fragile ... - (tol == SPQR_DEFAULT_TOL) // use this instead - { - // with default tolerance, the fixed ordering can sometimes - // fail if the matrix is rank deficient (R cannot be permuted - // to upper trapezoidal form). - which = (ordering == 0) ; - } - else - { - // with non-default tolerance, the solution can sometimes be - // poor; this is expected. - which = 1 ; - } - printf ("\n=== QR with ordering %d tol %g:\n", ordering, tol) ; - - // ----------------------------------------------------------------- - // create dense and sparse right-hand-sides - // ----------------------------------------------------------------- - - nb = 5 ; - Bdense = cholmod_l_zeros (m, nb, xtype, cc) ; - B = (Entry *) Bdense->x ; - for (k = 0 ; k < m*nb ; k++) - { - B [k] = ((double) (my_rand ( ) % 2)) * erand (range) ; - } - Bsparse = cholmod_l_dense_to_sparse (Bdense, TRUE, cc) ; - - // ----------------------------------------------------------------- - // X = qrsolve(A,B) where X and B are dense - // ----------------------------------------------------------------- - - // X = A\B - if (ordering == SPQR_ORDERING_DEFAULT && tol == SPQR_DEFAULT_TOL) - { - printf ("[ backslach, A and B and X dense: defaults\n") ; - Xdense = SuiteSparseQR (A, Bdense, cc) ; - printf ("] done backslach, A and B and X dense: defaults\n") ; - } - else - { - printf ("[ backslach, A and B and X dense: tol %g order %d\n", - tol, ordering) ; - Xdense = SuiteSparseQR (ordering, tol, A, Bdense, cc) ; - printf ("] done backslach, A B X dense: tol %g order %d\n", - tol, ordering) ; - } - - // check norm (A*x-b), x and b dense - resid = dense_resid (A, anorm, Xdense, nb, B, cc) ; - maxresid [m>n][which] = MAX (maxresid [m>n][which], resid) ; - printf ("Resid0b %d %ld %d : %g\n", m>n, ntol, ordering, resid) ; - - cholmod_l_free_dense (&Xdense, cc) ; - - if (cc->useGPU) - { - // error testing for infeasible GPU memory - int64_t save = cc->gpuMemorySize ; - cc->gpuMemorySize = 1 ; - printf ("[ Pretend GPU memory is too small:\n") ; - Xdense = SuiteSparseQR (ordering, tol, A, Bdense, cc) ; - cc->gpuMemorySize = save ; - printf ("] test done infeasible GPU, status %2d, useGPU: %d\n", - cc->status, cc->useGPU) ; - cholmod_l_free_dense (&Xdense, cc) ; - } - - cholmod_l_free_dense (&Bdense, cc) ; - - // ----------------------------------------------------------------- - // X = qrsolve(A,B) where X and B are sparse - // ----------------------------------------------------------------- - - // X = A\B - printf ("[ backslash with sparse B: tol %g\n", tol) ; - Xsparse = SuiteSparseQR (ordering, tol, A, Bsparse, cc) ; - printf ("] did tol %g\n", tol) ; - - // check norm (A*x-b), x and b sparse - resid = sparse_resid (A, anorm, Xsparse, Bsparse, cc) ; - maxresid [m>n][which] = MAX (maxresid [m>n][which], resid) ; - printf ("Resid0 %d %ld %d : %g\n", m>n, ntol, ordering, resid) ; - - cholmod_l_free_sparse (&Xsparse, cc) ; - cholmod_l_free_sparse (&Bsparse, cc) ; - - // ----------------------------------------------------------------- - // X = qrsolve (A,B) where X and B are sparse, with memory test - // ----------------------------------------------------------------- - - // use B = A and solve AX=B where X is sparse - cc->SPQR_shrink = 0 ; // shrink = 0 ; - rank = SPQR_qr ( - ordering, tol, econ, 2, A, - A, NULL, &Xsparse, NULL, NULL, &Qfill, NULL, NULL, NULL, - cc, TRUE, m < 300, nrand (2)) ; - cc->SPQR_shrink = 1 ; // restore default shrink = 1 ; - - if // (ntol == 0) // old test is fragile ... - (tol == SPQR_DEFAULT_TOL) // use this instead. - { - printf ("using default tol: %g\n", cc->SPQR_tol_used) ; - } - - // check norm (A*x-b), x and b sparse - resid = sparse_resid (A, anorm, Xsparse, A, cc) ; - maxresid [m>n][which] = MAX (maxresid [m>n][which], resid) ; - printf ("Resid1 %d %ld %d : %g\n", m>n, ntol, ordering, resid) ; - - cholmod_l_free_sparse (&Xsparse, cc) ; - cholmod_l_free (n+n, sizeof (int64_t), Qfill, cc) ; - - // ----------------------------------------------------------------- - // X = qrsolve (A,B) where X and B are dense, with memory test - // ----------------------------------------------------------------- - - // use B = dense m-by-2 matrix with some zeros - nb = 5 ; - Bdense = cholmod_l_zeros (m, nb, xtype, cc) ; - B = (Entry *) Bdense->x ; - for (k = 0 ; k < m*nb ; k++) - { - B [k] = (k+1) % 7 ; - } - - rank = SPQR_qr ( - ordering, tol, econ, 2, A, - NULL, Bdense, NULL, &Xdense, NULL, &Qfill, NULL, NULL, NULL, - cc, FALSE, m < 300, nrand (2)) ; - - // check norm (A*x-b), x and b dense - resid = dense_resid (A, anorm, Xdense, nb, B, cc) ; - maxresid [m>n][which] = MAX (maxresid [m>n][which], resid) ; - printf ("Resid2 %d %ld %d : %g\n", m>n, ntol, ordering, resid) ; - - cholmod_l_free_dense (&Xdense, cc) ; - cholmod_l_free (n+nb, sizeof (int64_t), Qfill, cc) ; - - // ----------------------------------------------------------------- - // X = qrsolve (A,B) where X and B are full and H is kept - // ----------------------------------------------------------------- - - cc->SPQR_shrink = 2 ; // shrink = 2 ; - rank = SPQR_qr ( - ordering, tol, econ, 2, A, - NULL, Bdense, NULL, &Xdense, NULL, &Qfill, &H, &HPinv, &HTau, - cc, FALSE, m < 300, nrand (2)) ; - cc->SPQR_shrink = 1 ; // restore default shrink = 1 ; - - cholmod_l_free_dense (&HTau, cc) ; - cholmod_l_free (m, sizeof (int64_t), HPinv, cc) ; - cholmod_l_free_sparse (&H, cc) ; - - // check norm (A*x-b), x and b dense - resid = dense_resid (A, anorm, Xdense, nb, B, cc) ; - maxresid [m>n][which] = MAX (maxresid [m>n][which], resid) ; - printf ("Resid3 %d %ld %d : %g\n", m>n, ntol, ordering, resid) ; - - cholmod_l_free_dense (&Xdense, cc) ; - cholmod_l_free (n+nb, sizeof (int64_t), Qfill, cc) ; - - // ----------------------------------------------------------------- - // [C,R,E] = qr (A,B) where C is sparse and B is full - // ----------------------------------------------------------------- - - cc->SPQR_shrink = 2 ; // shrink = 2 ; - rank = SPQR_qr ( - ordering, tol, econ, 0, A, - NULL, Bdense, &Csparse, NULL, &R, &Qfill, NULL, NULL, NULL, - cc, FALSE, m < 300, nrand (2)) ; - cc->SPQR_shrink = 1 ; // restore default shrink = 1 ; - - // compute x=R\C and check norm (A*x-b) - Cdense = cholmod_l_sparse_to_dense (Csparse, cc) ; - resid = check_rc (rank, R, A, B, Cdense, nb, anorm, Qfill, cc) ; - maxresid [m>n][which] = MAX (maxresid [m>n][which], resid) ; - printf ("Resid4 %d %ld %d : %g\n", m>n, ntol, ordering, resid) ; - cholmod_l_free_dense (&Cdense, cc) ; - - // check that R'*R = (A*E)'*(A*E) - err = check_r_factor (R, A, Qfill, cc) ; - printf ("order %d : R'R-(A*E)'*(A*E), Err1: %g\n", ordering, err) ; - maxerr = MAX (maxerr, err) ; - - cholmod_l_free_sparse (&Csparse, cc) ; - cholmod_l_free_sparse (&R, cc) ; - cholmod_l_free (n+nb, sizeof (int64_t), Qfill, cc) ; - - // ----------------------------------------------------------------- - // [C,R,E] = qr (A,B) where C and B are full - // ----------------------------------------------------------------- - - cc->SPQR_shrink = 0 ; // shrink = 0 ; - rank = SPQR_qr ( - ordering, tol, econ, 0, A, - NULL, Bdense, NULL, &Cdense, &R, &Qfill, NULL, NULL, NULL, - cc, FALSE, m < 300, nrand (2)) ; - cc->SPQR_shrink = 1 ; // restore default shrink = 1 ; - - // check that R'*R = (A*E)'*(A*E) - err = check_r_factor (R, A, Qfill, cc) ; - printf ("order %d : R'R-(A*E)'*(A*E), Err2: %g\n", ordering, err) ; - maxerr = MAX (maxerr, err) ; - - cholmod_l_free_dense (&Cdense, cc) ; - cholmod_l_free_sparse (&R, cc) ; - cholmod_l_free (n+nb, sizeof (int64_t), Qfill, cc) ; - - // ----------------------------------------------------------------- - // [C,R,E] = qr (A,B) where C and B are full, simple wrapper - // ----------------------------------------------------------------- - - SuiteSparseQR (ordering, tol, econ, A, Bdense, - &Cdense, &R, &Qfill, cc) ; - - // check that R'*R = (A*E)'*(A*E) - err = check_r_factor (R, A, Qfill, cc) ; - printf ("order %d : R'R-(A*E)'*(A*E), Err3: %g\n", ordering, err) ; - maxerr = MAX (maxerr, err) ; - - cholmod_l_free_dense (&Cdense, cc) ; - cholmod_l_free_sparse (&R, cc) ; - cholmod_l_free (n+nb, sizeof (int64_t), Qfill, cc) ; - - // ----------------------------------------------------------------- - // [C,R,E] = qr (A,B) where C and B are sparse, simple wrapper - // ----------------------------------------------------------------- - - Bsparse = cholmod_l_dense_to_sparse (Bdense, TRUE, cc) ; - - SuiteSparseQR (ordering, tol, econ, A, Bsparse, - &Csparse, &R, &Qfill, cc) ; - - // check that R'*R = (A*E)'*(A*E) - err = check_r_factor (R, A, Qfill, cc) ; - printf ("order %d : R'R-(A*E)'*(A*E), Err4: %g\n", ordering, err) ; - maxerr = MAX (maxerr, err) ; - - cholmod_l_free_sparse (&Csparse, cc) ; - cholmod_l_free_sparse (&Bsparse, cc) ; - cholmod_l_free_sparse (&R, cc) ; - cholmod_l_free (n+nb, sizeof (int64_t), Qfill, cc) ; - - // ----------------------------------------------------------------- - // [CT,R,E] = qr (A,B), but do not return R - // ----------------------------------------------------------------- - - rank = SPQR_qr ( - ordering, tol, econ, 1, A, - NULL, Bdense, &Csparse, NULL, NULL, &Qfill, NULL, NULL, NULL, - cc, FALSE, m < 300, nrand (2)) ; - - cholmod_l_free_sparse (&Csparse, cc) ; - cholmod_l_free (n+nb, sizeof (int64_t), Qfill, cc) ; - - // ----------------------------------------------------------------- - // [Q,R,E] = qr (A), Q in Householder form - // ----------------------------------------------------------------- - - rank = SPQR_qr ( - ordering, tol, econ, -1, A, - NULL, NULL, NULL, NULL, &R, &Qfill, &H, &HPinv, &HTau, - cc, FALSE, m < 300, nrand (2)) ; - - // check that R'*R = (A*E)'*(A*E) - err = check_r_factor (R, A, Qfill, cc) ; - printf ("order %d : R'R-(A*E)'*(A*E), Err5: %g\n", ordering, err) ; - maxerr = MAX (maxerr, err) ; - - // solve Ax=b using Householder form - resid = QRsolve (A, anorm, rank, 0, H, HTau, HPinv, R, - Qfill, Bdense, cc) ; - maxresid [m>n][which] = MAX (maxresid [m>n][which], resid) ; - printf ("Resid5 %d %ld %d : %g\n", m>n, ntol, ordering, resid) ; - - // solve Ax=b using Q matrix form - resid = QRsolve (A, anorm, rank, 1, H, HTau, HPinv, R, - Qfill, Bdense, cc) ; - maxresid [m>n][which] = MAX (maxresid [m>n][which], resid) ; - printf ("Resid6 %d %ld %d : %g\n", m>n, ntol, ordering, resid) ; - - cholmod_l_free_dense (&HTau, cc) ; - cholmod_l_free_sparse (&H, cc) ; - cholmod_l_free (m, sizeof (int64_t), HPinv, cc) ; - cholmod_l_free (n, sizeof (int64_t), Qfill, cc) ; - cholmod_l_free_sparse (&R, cc) ; - - // ----------------------------------------------------------------- - // [Q,R,E] = qr (A), non-economy - // ----------------------------------------------------------------- - - cc->SPQR_shrink = 0 ; // shrink = 0 ; - I = cholmod_l_speye (m, m, xtype, cc) ; - rank = SPQR_qr ( - ordering, tol, m, 1, A, - I, NULL, &Q, NULL, &R, &Qfill, NULL, NULL, NULL, - cc, FALSE, m<300, nrand (2)) ; - cc->SPQR_shrink = 1 ; // restore default shrink = 1 ; - - // ensure norm (Q*R - A*E) is small - err = check_qr (Q, R, A, Qfill, anorm, cc) ; - printf ("order %d : Q*R-A*E Err6: %g\n", ordering, err) ; - maxerr = MAX (maxerr, err) ; - - cholmod_l_free_sparse (&I, cc) ; - cholmod_l_free_sparse (&R, cc) ; - cholmod_l_free_sparse (&Q, cc) ; - cholmod_l_free (n+m, sizeof (int64_t), Qfill, cc) ; - - // ----------------------------------------------------------------- - // [Q,R,E] = qr (A), non-economy, using simple wrapper - // ----------------------------------------------------------------- - - if (nrand (2)) - { - // use C version - SuiteSparseQR_C_QR (ordering, tol, m, A, &Q, &R, &Qfill, cc) ; - } - else - { - // use C++ version - SuiteSparseQR (ordering, tol, m, A, &Q, &R, &Qfill, cc); - } - - // ensure norm (Q*R - A*E) is small - err = check_qr (Q, R, A, Qfill, anorm, cc) ; - printf ("order %d : Q*R-A*E Err7: %g\n", ordering, err) ; - maxerr = MAX (maxerr, err) ; - - cholmod_l_free_sparse (&R, cc) ; - cholmod_l_free_sparse (&Q, cc) ; - cholmod_l_free (n+m, sizeof (int64_t), Qfill, cc) ; - - // ----------------------------------------------------------------- - // [R,E] = qr (A) - // ----------------------------------------------------------------- - - rank = SPQR_qr ( - ordering, tol, econ, 0, A, - NULL, NULL, NULL, NULL, &R, &Qfill, NULL, NULL, NULL, - cc, FALSE, m < 300, nrand (2)) ; - - // check that R'*R = (A*E)'*(A*E) - err = check_r_factor (R, A, Qfill, cc) ; - printf ("order %d : R'R-(A*E)'*(A*E), Err8: %g\n", ordering, err) ; - maxerr = MAX (maxerr, err) ; - int64_t rank1 = rank ; - - cholmod_l_free_sparse (&R, cc) ; - cholmod_l_free (n, sizeof (int64_t), Qfill, cc) ; - - // ----------------------------------------------------------------- - // [R,E] = qr (A) using simple wrapper - // ----------------------------------------------------------------- - - SuiteSparseQR (ordering, tol, econ, A, &R, &Qfill, cc) ; - - // check that R'*R = (A*E)'*(A*E) - err = check_r_factor (R, A, Qfill, cc) ; - printf ("order %d : R'R-(A*E)'*(A*E), Err9: %g\n", ordering, err) ; - maxerr = MAX (maxerr, err) ; - - cholmod_l_free_sparse (&R, cc) ; - cholmod_l_free (n, sizeof (int64_t), Qfill, cc) ; - - // ----------------------------------------------------------------- - // [ ] = qr (A) - // ----------------------------------------------------------------- - - // The only thing returned are the statistics (rank, etc) - cc->SPQR_shrink = 0 ; // shrink = 0 ; - rank = SPQR_qr ( - ordering, tol, econ, 0, A, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - cc, FALSE, m < 300, nrand (2)) ; - cc->SPQR_shrink = 1 ; // restore default shrink = 1 ; - - err = (rank != rank1) ; - printf ("order %d : rank %6ld %6ld Err10: %g\n", ordering, - rank, rank1, err) ; - maxerr = MAX (maxerr, err) ; - - // ----------------------------------------------------------------- - // [C,H,R,E] = qr (A) - // ----------------------------------------------------------------- - - rank = SPQR_qr ( - ordering, tol, econ, 0, A, - NULL, Bdense, &Csparse, NULL, &R, &Qfill, &H, &HPinv, &HTau, - cc, FALSE, m < 300, nrand (2)) ; - - // compute x=R\C and check norm (A*x-b) - Cdense = cholmod_l_sparse_to_dense (Csparse, cc) ; - resid = check_rc (rank, R, A, B, Cdense, nb, anorm, Qfill, cc) ; - maxresid [m>n][which] = MAX (maxresid [m>n][which], resid) ; - printf ("Resid7 %d %ld %d : %g\n", m>n, ntol, ordering, resid) ; - cholmod_l_free_dense (&Cdense, cc) ; - - // check that R'*R = (A*E)'*(A*E) - err = check_r_factor (R, A, Qfill, cc) ; - printf ("order %d : R'R-(A*E)'*(A*E), Err11: %g\n", ordering, err) ; - maxerr = MAX (maxerr, err) ; - - cholmod_l_free_sparse (&Csparse, cc) ; - cholmod_l_free_sparse (&R, cc) ; - - // compare Q with qmult - err = check_qmult (H, HTau, HPinv, - ordering == 2 && /* ntol == 0 */ tol == SPQR_DEFAULT_TOL, cc) ; - printf ("order %d : check qmult Err12: %g\n", ordering, err) ; - maxerr = MAX (maxerr, err) ; - - cholmod_l_free_dense (&HTau, cc) ; - cholmod_l_free_sparse (&H, cc) ; - cholmod_l_free (m, sizeof (int64_t), HPinv, cc) ; - cholmod_l_free (n+nb, sizeof (int64_t), Qfill, cc) ; - cholmod_l_free_dense (&Bdense, cc) ; - - // ----------------------------------------------------------------- - // [H,R,E] = qr (A), simple wrapper - // ----------------------------------------------------------------- - - SuiteSparseQR (ordering, tol, econ, A, - &R, &Qfill, &H, &HPinv, &HTau, cc) ; - - // check that R'*R = (A*E)'*(A*E) - err = check_r_factor (R, A, Qfill, cc) ; - printf ("order %d : R'R-(A*E)'*(A*E), Err13: %g\n", ordering, err) ; - maxerr = MAX (maxerr, err) ; - - // compare Q with qmult - err = check_qmult (H, HTau, HPinv, FALSE, cc) ; - printf ("order %d : check qmult Err14: %g\n", ordering, err) ; - maxerr = MAX (maxerr, err) ; - - cholmod_l_free_sparse (&R, cc) ; - cholmod_l_free_dense (&HTau, cc) ; - cholmod_l_free_sparse (&H, cc) ; - cholmod_l_free (m, sizeof (int64_t), HPinv, cc) ; - cholmod_l_free (n, sizeof (int64_t), Qfill, cc) ; - -#ifndef NEXPERT - - // ================================================================= - // === expert routines ============================================= - // ================================================================= - - SuiteSparseQR_factorization *QR ; - cholmod_dense *XT, *Zdense, *BT, *Ydense ; - cholmod_sparse *Ysparse ; - - // ----------------------------------------------------------------- - // QR = qr (A), then solve - // ----------------------------------------------------------------- - - for (int split = 0 ; split <= 4 ; split++) - { - - QR = SPQR_factorize (ordering, tol, A, cc, - split, m < 300, nrand (2)) ; - - // split == 4 does not use singletons, so it can fail if - // rank < n - int wh = which || (split == 4) ; - - // solve Ax=b - nb = 5 ; - Bdense = cholmod_l_zeros (m, nb, xtype, cc) ; - B = (Entry *) Bdense->x ; - for (k = 0 ; k < m*nb ; k++) - { - B [k] = erand (range) ; - } - - // Y = Q'*B - Ydense = SPQR_qmult (SPQR_QTX, QR, Bdense, cc, - m < 300, nrand (2)) ; - - // X = R\(E*Y) - Xdense = SPQR_solve (SPQR_RETX_EQUALS_B, QR, Ydense, cc, - m < 300, nrand (2)) ; - // check norm (A*x-b), x and b dense - resid = dense_resid (A, anorm, Xdense, nb, B, cc) ; - maxresid [m>n][wh] = MAX (maxresid [m>n][wh], resid) ; - printf ("Resid8_%d %d %ld %d : %g (%d) tol %g\n", - split, m>n, ntol, ordering, resid, wh, tol) ; - cholmod_l_free_dense (&Xdense, cc) ; - cholmod_l_free_dense (&Ydense, cc) ; - - // Y = (B'*Q)' - BT = transpose (Bdense, cc) ; - XT = SPQR_qmult (SPQR_XQ, QR, BT, cc, - m < 300, nrand (2)) ; - - Ydense = transpose (XT, cc) ; - cholmod_l_free_dense (&XT, cc) ; - cholmod_l_free_dense (&BT, cc) ; - - // X = R\(E*Y) - Xdense = SPQR_solve (SPQR_RETX_EQUALS_B, QR, Ydense, cc, - m < 300, nrand (2)) ; - // check norm (A*x-b), x and b dense - resid = dense_resid (A, anorm, Xdense, nb, B, cc) ; - maxresid [m>n][wh] = MAX (maxresid [m>n][wh], resid) ; - printf ("Resid9_%d %d %ld %d : %g (%d) tol %g\n", - split, m>n, ntol, ordering, resid, wh, tol) ; - cholmod_l_free_dense (&Xdense, cc) ; - cholmod_l_free_dense (&Ydense, cc) ; - - // ------------------------------------------------------------- - // error testing - // ------------------------------------------------------------- - - if (ordering == 0 && /* ntol == 0 */ tol == SPQR_DEFAULT_TOL) - { - printf ("Error handling ... expect 3 error messages: \n") ; - err = (SuiteSparseQR_qmult (-1, QR, Bdense, cc) - != NULL) ; - cholmod_l_free_dense (&Bdense, cc) ; - Bdense = cholmod_l_zeros (m+1, 1, xtype, cc) ; - err += (SuiteSparseQR_qmult (SPQR_QX,QR,Bdense,cc) - != NULL); - cholmod_l_free_dense (&Bdense, cc) ; - Bdense = cholmod_l_zeros (1, m+1, xtype, cc) ; - err += (SuiteSparseQR_qmult (SPQR_XQ,QR,Bdense,cc) - != NULL); - if (QR->n1cols > 0) - { - // this will fail; cannot refactorize with singletons - printf ("Error handling ... expect error message:\n") ; - err += (SuiteSparseQR_numeric (tol, A, QR, cc) - != FALSE) ; - } - printf ("order %d : error handling Err15: %g\n", - ordering, err) ; - maxerr = MAX (maxerr, err) ; - printf (" ... error handling done\n\n") ; - } - - cholmod_l_free_dense (&Bdense, cc) ; - - // ------------------------------------------------------------- - - // solve A'x=b - nb = 5 ; - Bdense = cholmod_l_zeros (n, nb, xtype, cc) ; - B = (Entry *) Bdense->x ; - for (k = 0 ; k < n*nb ; k++) - { - B [k] = erand (range) ; - } - // Y = R'\(E'*B) - Ydense = SPQR_solve (SPQR_RTX_EQUALS_ETB, QR, Bdense, cc, - m < 300, nrand (2)) ; - // X = Q*Y - Xdense = SPQR_qmult (SPQR_QX, QR, Ydense, cc, - m < 300, nrand (2)) ; - // check norm (A'*x-b), x and b dense - resid = dense_resid (AT, anorm, Xdense, nb, B, cc) ; - maxresid [m (-1, QR, Bdense, cc) - != NULL) ; - cholmod_l_free_dense (&Bdense, cc) ; - err += (SuiteSparseQR_solve (SPQR_RTX_EQUALS_ETB, - QR, Bdense, cc) != NULL) ; - Bdense = cholmod_l_zeros (n+1, 1, xtype, cc) ; - err += (SuiteSparseQR_solve (SPQR_RTX_EQUALS_ETB, - QR, Bdense, cc) != NULL) ; - printf ("order %d : error handling Err16: %g\n", - ordering, err) ; - maxerr = MAX (maxerr, err) ; - printf (" ... error handling done\n\n") ; - } - - SuiteSparseQR_free (&QR, cc) ; - cholmod_l_free_dense (&Bdense, cc) ; - } - - // ----------------------------------------------------------------- - // QR = qr (A'), then solve - // ----------------------------------------------------------------- - - // use qmult to solve min-2-norm problem - QR = SuiteSparseQR_factorize (ordering, tol, AT, cc) ; - - nb = 5 ; - Bdense = cholmod_l_zeros (m, nb, xtype, cc) ; - B = (Entry *) Bdense->x ; - for (k = 0 ; k < m*nb ; k++) - { - B [k] = erand (range) ; - } - - // solve X = R'\B - Xdense = SPQR_solve (SPQR_RTX_EQUALS_B, QR, Bdense, cc, - m < 300, nrand (2)) ; - cholmod_l_free_dense (&Xdense, cc) ; - - // solve X = R'\(E'*B) - Xdense = SPQR_solve (SPQR_RTX_EQUALS_ETB, QR, Bdense, cc, - m < 300, nrand (2)) ; - - // Y = Q*X - Ydense = SPQR_qmult (SPQR_QX, QR, Xdense, cc, - m < 300, nrand (2)) ; - - // check norm (A*y-b), y and b dense - resid = dense_resid (A, anorm, Ydense, nb, B, cc) ; - maxresid [m>n][which] = MAX (maxresid [m>n][which], resid) ; - printf ("ResidB %d %ld %d : %g\n", m>n, ntol, ordering, resid) ; - cholmod_l_free_dense (&Ydense, cc) ; - - // Y = (X'*Q')' - XT = transpose (Xdense, cc) ; - Zdense = SPQR_qmult (SPQR_XQT, QR, XT, cc, - m < 300, nrand (2)) ; - Ydense = transpose (Zdense, cc) ; - cholmod_l_free_dense (&XT, cc) ; - cholmod_l_free_dense (&Zdense, cc) ; - - // check norm (A*y-b), y and b dense - resid = dense_resid (A, anorm, Ydense, nb, B, cc) ; - maxresid [m>n][which] = MAX (maxresid [m>n][which], resid) ; - printf ("ResidC %d %ld %d : %g\n", m>n, ntol, ordering, resid) ; - cholmod_l_free_dense (&Ydense, cc) ; - cholmod_l_free_dense (&Xdense, cc) ; - - // ----------------------------------------------------------------- - // min 2-norm solution using min2norm - // ----------------------------------------------------------------- - - Xdense = SPQR_min2norm (ordering, tol, A, Bdense, cc, - m < 300, nrand (2)) ; - - // check norm (A*x-b), y and b dense - resid = dense_resid (A, anorm, Xdense, nb, B, cc) ; - maxresid [m>n][which] = MAX (maxresid [m>n][which], resid) ; - printf ("ResidD %d %ld %d : %g\n", m>n, ntol, ordering, resid) ; - cholmod_l_free_dense (&Xdense, cc) ; - - cholmod_l_free_dense (&Bdense, cc) ; - - // ----------------------------------------------------------------- - // sparse case - // ----------------------------------------------------------------- - - nb = 5 ; - Bdense = cholmod_l_zeros (m, nb, xtype, cc) ; - B = (Entry *) Bdense->x ; - for (k = 0 ; k < m*nb ; k++) - { - B [k] = ((double) (my_rand ( ) % 2)) * erand (range) ; - } - Bsparse = cholmod_l_dense_to_sparse (Bdense, TRUE, cc) ; - cholmod_l_free_dense (&Bdense, cc) ; - - // solve X = R'\(E'*B) - Xsparse = NULL ; - Xsparse = SPQR_solve (SPQR_RTX_EQUALS_ETB, QR, Bsparse, cc, - m < 300, nrand (2)) ; - - // Y = Q*X - Ysparse = NULL ; - Ysparse = SPQR_qmult (SPQR_QX, QR, Xsparse, cc, - m < 300, nrand (2)) ; - - // check norm (A*y-b), y and b sparse - resid = sparse_resid (A, anorm, Ysparse, Bsparse, cc) ; - maxresid [m>n][which] = MAX (maxresid [m>n][which], resid) ; - printf ("ResidE %d %ld %d : %g\n", m>n, ntol, ordering, resid) ; - - cholmod_l_free_sparse (&Xsparse, cc) ; - cholmod_l_free_sparse (&Ysparse, cc) ; - - Xsparse = SPQR_min2norm (ordering, tol, A, Bsparse, cc, - m < 300, nrand (2)) ; - - // check norm (A*x-b), x and b sparse - resid = sparse_resid (A, anorm, Xsparse, Bsparse, cc) ; - maxresid [m>n][which] = MAX (maxresid [m>n][which], resid) ; - printf ("ResidF %d %ld %d : %g\n", m>n, ntol, ordering, resid) ; - - cholmod_l_free_sparse (&Xsparse, cc) ; - cholmod_l_free_sparse (&Bsparse, cc) ; - - SuiteSparseQR_free (&QR, cc) ; +#ifdef INT32 +#define Int int32_t +#else +#define Int int64_t #endif - } - } - - // ------------------------------------------------------------------------- - // check error handling - // ------------------------------------------------------------------------- - - printf ("Check error handling, one error message is expected:\n") ; - cholmod_dense *Bgunk = cholmod_l_ones (m+1, 1, xtype, cc) ; - rank = SuiteSparseQR ( - 0, 0, econ, -1, A, - NULL, Bgunk, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - cc) ; - cholmod_l_free_dense (&Bgunk, cc) ; - err = (rank != EMPTY) ; - maxerr = MAX (maxerr, err) ; // rank should be EMPTY - printf (" ... error handling done\n\n") ; - - // ------------------------------------------------------------------------- - // test non-user callable functions - // ------------------------------------------------------------------------- - - // attempt to permute A to upper triangular form - int64_t *Qtrap ; - rank = spqr_trapezoidal (n, Ap, Ai, Ax, 0, NULL, FALSE, &Cp, &Ci, &Cx, - &Qtrap, cc) ; - printf ("Rank of A, if A*P permutable to upper trapezoidal: %ld\n", rank) ; - if (Cp != NULL) - { - nz = Cp [n] ; - cholmod_l_free (n+1, sizeof (int64_t), Cp, cc) ; - cholmod_l_free (nz, sizeof (int64_t), Ci, cc) ; - cholmod_l_free (nz, sizeof (Entry), Cx, cc) ; - cholmod_l_free (n, sizeof (int64_t), Qtrap, cc) ; - } - cholmod_l_free_sparse (&AT, cc) ; - - // ------------------------------------------------------------------------- - // test the C API - // ------------------------------------------------------------------------- - - qrtest_C (A, anorm, errs, maxresid, cc) ; - - // ------------------------------------------------------------------------- - // final results - // ------------------------------------------------------------------------- - - errs [0] = CHECK_NAN (maxerr) ; - errs [1] = CHECK_NAN (maxresid [0][0]) ; - errs [2] = CHECK_NAN (maxresid [0][1]) ; - errs [3] = CHECK_NAN (maxresid [1][0]) ; - errs [4] = CHECK_NAN (maxresid [1][1]) ; -} - - -// ============================================================================= -// === do_matrix =============================================================== -// ============================================================================= - -// Read in a matrix, and use it to test SuiteSparseQR -// If kind == 0, then the first two residuals should be low. - -int do_matrix2 (int kind, cholmod_sparse *A, cholmod_common *cc) ; - -int do_matrix (int kind, FILE *file, cholmod_common *cc) -{ - cholmod_sparse *A ; - - int nfail0 = 0 ; - int nfail1 = 0 ; - int nfail2 = 0 ; - int nfail3 = 0 ; - - // ------------------------------------------------------------------------- - // read in the matrix - // ------------------------------------------------------------------------- - - A = cholmod_l_read_sparse (file, cc) ; - if (A == NULL) - { - fprintf (stderr, "Unable to read matrix\n") ; - return (1) ; - } - int64_t m = A->nrow ; - int64_t n = A->ncol ; - fprintf (stderr, "%5ld by %5ld : ", m, n) ; - if (sizeof (int64_t) > sizeof (int) && (m > 10000 || n > 10000)) - { - fprintf (stderr, "(test skipped on 64-bit systems)\n") ; - cholmod_l_free_sparse (&A, cc) ; - return (0) ; - } - - // defaults - cc->SPQR_grain = 1 ; // no parallel analysis - printf ("\nBeginning CPU tests [\n") ; - fprintf (stderr, " CPU ") ; - nfail0 = do_matrix2 (kind, A, cc) ; - - // non-defaults (will not use the GPU) - cc->SPQR_grain = 4 ; // grain size relative to total work - nfail2 = do_matrix2 (kind, A, cc) ; - cc->SPQR_grain = 1 ; // no parallel analysis - printf ("\nCPU tests done ]\n") ; - - // test the GPU, if installed - #ifdef SUITESPARSE_CUDA - cc->useGPU = TRUE ; - // was 3.5 * ((size_t) 1024 * 1024 * 1024) ; - size_t totmem, availmem ; - double t = SuiteSparse_time ( ) ; - cholmod_l_gpu_memorysize (&totmem, &availmem, cc) ; - t = SuiteSparse_time ( ) - t ; - cc->gpuMemorySize = availmem ; - printf ("\nBeginning GPU tests, GPU memory %g MB warmup time %g[\n", - (double) (cc->gpuMemorySize) / (1024*1024), t) ; - fprintf (stderr, " GPU ") ; - nfail1 = do_matrix2 (kind, A, cc) ; - printf ("\nGPU tests done ]\n") ; - if (m > 200) - { - // try with a tiny GPU memory size, but only for a few matrices - // in the test set. Each front will go in its own stage. - printf ("\nBeginning GPU tests with tiny GPU memory [\n") ; - cc->gpuMemorySize = 0 ; - nfail3 = do_matrix2 (kind, A, cc) ; - // restore defaults - cc->useGPU = FALSE ; - printf ("\nGPU tests done (tiny memory) ]\n") ; - } - #endif - - cholmod_l_free_sparse (&A, cc) ; - - printf ("\n") ; - fprintf (stderr, "\n") ; - return (nfail0 + nfail1 + nfail2 + nfail3) ; -} - - - -int do_matrix2 (int kind, cholmod_sparse *A, cholmod_common *cc) -{ - double errs [5] = {0,0,0,0,0} ; - int64_t m = A->nrow ; - int64_t n = A->ncol ; - - // ------------------------------------------------------------------------- - // use it to test SuiteSparseQR - // ------------------------------------------------------------------------- - - if (A->xtype == CHOLMOD_COMPLEX && A->stype == 0) - { - qrtest (A, errs, cc) ; - } - else if (A->xtype == CHOLMOD_REAL) - { - if (A->stype != 0) - { - cholmod_sparse *A1 ; - A1 = cholmod_l_copy (A, 0, 1, cc) ; - qrtest (A1, errs, cc) ; - cholmod_l_free_sparse (&A1, cc) ; - } - else - { - qrtest (A, errs, cc) ; - } - } - else - { - // cannot handle ZOMPLEX, PATTERN, or symmetric/Hermitian COMPLEX - fprintf (stderr, "invalid matrix\n") ; - errs [0] = 1 ; - } - - // ------------------------------------------------------------------------- - // report the results - // ------------------------------------------------------------------------- - - if (kind == 0) - { - printf ("First Resid and ") ; - } - printf ("Err should be low:\n") ; - printf ("RESULT: Err %8.1e Resid %8.1e %8.1e", errs [0], - errs [1], errs [2]) ; - if (m == n) - { - printf (" ") ; - } - else - { - printf (" %8.1e %8.1e", errs [3], errs [4]) ; - } - - if (errs [0] > 1e-10) - { - printf (" : FAIL\n") ; - fprintf (stderr, "Error: %g FAIL\n", errs [0]) ; - return (1) ; - } - - // if kind == 0, then this full-rank matrix should have low residual - if (kind == 0 && (errs [1] > 1e-10)) - { - printf (" : FAIL\n") ; - fprintf (stderr, "error: %g FAIL\n", errs [1]) ; - return (1) ; - } - - printf (" : OK.") ; - fprintf (stderr, "OK.") ; - return (0) ; -} - - -// ============================================================================= -// === qrtest main ============================================================= -// ============================================================================= #define LEN 200 @@ -2786,7 +193,7 @@ int main (int argc, char **argv) // ------------------------------------------------------------------------- cc = &Common ; - cholmod_l_start (cc) ; + spqr_start (cc) ; normal_memory_handler (cc, true) ; if (argc == 1) @@ -2796,7 +203,7 @@ int main (int argc, char **argv) // Usage: qrtest < input.mtx // --------------------------------------------------------------------- - nfail += do_matrix (1, stdin, cc) ; + nfail += do_matrix (1, stdin, cc) ; } else { @@ -2829,7 +236,7 @@ int main (int argc, char **argv) fprintf (stderr, "Unable to open %s\n", matrix_name) ; nfail++ ; } - nfail += do_matrix (kind, matrix, cc) ; + nfail += do_matrix (kind, matrix, cc) ; fclose (matrix) ; } @@ -2840,7 +247,7 @@ int main (int argc, char **argv) // report the results // ------------------------------------------------------------------------- - cholmod_l_finish (cc) ; + spqr_finish (cc) ; if (cc->malloc_count != 0) { diff --git a/SPQR/Tcov/qrtest_template.hpp b/SPQR/Tcov/qrtest_template.hpp new file mode 100644 index 000000000..35ff71a83 --- /dev/null +++ b/SPQR/Tcov/qrtest_template.hpp @@ -0,0 +1,2686 @@ +// ============================================================================= +// === qrest_template.hpp ====================================================== +// ============================================================================= + + + +// ============================================================================= +// === SPQR_qmult ============================================================== +// ============================================================================= + +// wrapper for SuiteSparseQR_qmult (dense), optionally testing memory alloc. + +template cholmod_dense *SPQR_qmult +( + // arguments for SuiteSparseQR_qmult: + int method, + cholmod_sparse *H, + cholmod_dense *Tau, + Int *HPinv, + cholmod_dense *X, + cholmod_common *cc, + + // malloc control + int memory_test, // if TRUE, test malloc error handling + int memory_punt // if TRUE, test punt case +) +{ + cholmod_dense *Y = NULL ; + if (!memory_test) + { + // just call the method directly; no memory testing + Y = SuiteSparseQR_qmult (method, H, Tau, HPinv, X, cc) ; + } + else + { + // test malloc error handling + int64_t tries ; + test_memory_handler (cc, true) ; + my_punt = memory_punt ; + for (tries = 0 ; my_tries < 0 ; tries++) + { + my_tries = tries ; + Y = SuiteSparseQR_qmult (method, H, Tau, HPinv, X, cc) ; + if (cc->status == CHOLMOD_OK) break ; + } + normal_memory_handler (cc, true) ; + } + return (Y) ; +} + + +// ============================================================================= +// === SPQR_qmult_sparse ======================================================= +// ============================================================================= + +// wrapper for SuiteSparseQR_qmult (sparse), optionally testing memory alloc. + +template cholmod_sparse *SPQR_qmult +( + // arguments for SuiteSparseQR_qmult: + int method, + cholmod_sparse *H, + cholmod_dense *Tau, + Int *HPinv, + cholmod_sparse *X, + cholmod_common *cc, + + // malloc control + int memory_test, // if TRUE, test malloc error handling + int memory_punt // if TRUE, test punt case +) +{ + cholmod_sparse *Y = NULL ; + if (!memory_test) + { + // just call the method directly; no memory testing + Y = SuiteSparseQR_qmult (method, H, Tau, HPinv, X, cc) ; + } + else + { + // test malloc error handling + int64_t tries ; + test_memory_handler (cc, true) ; + my_punt = memory_punt ; + for (tries = 0 ; my_tries < 0 ; tries++) + { + my_tries = tries ; + Y = SuiteSparseQR_qmult (method, H, Tau, HPinv, X, cc); + if (cc->status == CHOLMOD_OK) break ; + } + normal_memory_handler (cc, true) ; + } + return (Y) ; +} + +#ifndef NEXPERT + +// ============================================================================= +// === SPQR_qmult (dense case) ================================================= +// ============================================================================= + +// wrapper for SuiteSparseQR_qmult (dense), optionally testing memory alloc. + +template cholmod_dense *SPQR_qmult +( + // arguments for SuiteSparseQR_qmult: + int method, + SuiteSparseQR_factorization *QR, + cholmod_dense *X, + cholmod_common *cc, + + // malloc control + int memory_test, // if TRUE, test malloc error handling + int memory_punt // if TRUE, test punt case +) +{ + cholmod_dense *Y = NULL ; + if (!memory_test) + { + // just call the method directly; no memory testing + Y = SuiteSparseQR_qmult (method, QR, X, cc) ; + } + else + { + // test malloc error handling + int64_t tries ; + test_memory_handler (cc, true) ; + my_punt = memory_punt ; + for (tries = 0 ; my_tries < 0 ; tries++) + { + my_tries = tries ; + Y = SuiteSparseQR_qmult (method, QR, X, cc) ; + if (cc->status == CHOLMOD_OK) break ; + } + normal_memory_handler (cc, true) ; + } + return (Y) ; +} + +// ============================================================================= +// === SPQR_qmult (sparse case) ================================================ +// ============================================================================= + +// wrapper for SuiteSparseQR_qmult (sparse), optionally testing memory alloc. + +template cholmod_sparse *SPQR_qmult +( + // arguments for SuiteSparseQR_qmult: + int method, + SuiteSparseQR_factorization *QR, + cholmod_sparse *X, + cholmod_common *cc, + + // malloc control + int memory_test, // if TRUE, test malloc error handling + int memory_punt // if TRUE, test punt case +) +{ + cholmod_sparse *Y = NULL ; + if (!memory_test) + { + // just call the method directly; no memory testing + Y = SuiteSparseQR_qmult (method, QR, X, cc) ; + } + else + { + // test malloc error handling + int64_t tries ; + test_memory_handler (cc, true) ; + my_punt = memory_punt ; + for (tries = 0 ; my_tries < 0 ; tries++) + { + my_tries = tries ; + Y = SuiteSparseQR_qmult (method, QR, X, cc) ; + if (cc->status == CHOLMOD_OK) break ; + } + normal_memory_handler (cc, true) ; + } + return (Y) ; +} + + +// ============================================================================= +// === SPQR_solve (dense case) ================================================= +// ============================================================================= + +// Wrapper for testing SuiteSparseQR_solve + +template cholmod_dense *SPQR_solve +( + // arguments for SuiteSparseQR_solve: + int system, + SuiteSparseQR_factorization *QR, + cholmod_dense *B, + cholmod_common *cc, + + // malloc control + int memory_test, // if TRUE, test malloc error handling + int memory_punt // if TRUE, test punt case +) +{ + cholmod_dense *X = NULL ; + if (!memory_test) + { + // just call the method directly; no memory testing + X = SuiteSparseQR_solve (system, QR, B, cc) ; + } + else + { + // test malloc error handling + int64_t tries ; + test_memory_handler (cc, true) ; + my_punt = memory_punt ; + for (tries = 0 ; my_tries < 0 ; tries++) + { + my_tries = tries ; + X = SuiteSparseQR_solve (system, QR, B, cc) ; + if (cc->status == CHOLMOD_OK) break ; + } + normal_memory_handler (cc, true) ; + } + return (X) ; +} + + +// ============================================================================= +// === SPQR_solve (sparse case) ================================================ +// ============================================================================= + +// Wrapper for testing SuiteSparseQR_solve + +template cholmod_sparse *SPQR_solve +( + // arguments for SuiteSparseQR_solve: + int system, + SuiteSparseQR_factorization *QR, + cholmod_sparse *B, + cholmod_common *cc, + + // malloc control + int memory_test, // if TRUE, test malloc error handling + int memory_punt // if TRUE, test punt case +) +{ + cholmod_sparse *X = NULL ; + if (!memory_test) + { + // just call the method directly; no memory testing + X = SuiteSparseQR_solve (system, QR, B, cc) ; + } + else + { + // test malloc error handling + int64_t tries ; + test_memory_handler (cc, true) ; + my_punt = memory_punt ; + for (tries = 0 ; my_tries < 0 ; tries++) + { + my_tries = tries ; + X = SuiteSparseQR_solve (system, QR, B, cc) ; + if (cc->status == CHOLMOD_OK) break ; + } + normal_memory_handler (cc, true) ; + } + return (X) ; +} + + +// ============================================================================= +// === SPQR_min2norm (dense case) ============================================== +// ============================================================================= + +// Wrapper for testing SuiteSparseQR_min2norm + +template cholmod_dense *SPQR_min2norm +( + // arguments for SuiteSparseQR_min2norm: + int ordering, + double tol, + cholmod_sparse *A, + cholmod_dense *B, + cholmod_common *cc, + + // malloc control + int memory_test, // if TRUE, test malloc error handling + int memory_punt // if TRUE, test punt case +) +{ + cholmod_dense *X = NULL ; + if (!memory_test) + { + // just call the method directly; no memory testing + X = SuiteSparseQR_min2norm (ordering, tol, A, B, cc) ; + } + else + { + // test malloc error handling + int64_t tries ; + test_memory_handler (cc, true) ; + my_punt = memory_punt ; + for (tries = 0 ; my_tries < 0 ; tries++) + { + my_tries = tries ; + X = SuiteSparseQR_min2norm (ordering, tol, A, B, cc) ; + if (cc->status == CHOLMOD_OK) break ; + } + normal_memory_handler (cc, true) ; + } + return (X) ; +} + +// ============================================================================= +// === SPQR_min2norm (sparse case) ============================================= +// ============================================================================= + +// Wrapper for testing SuiteSparseQR_min2norm + +template cholmod_sparse *SPQR_min2norm +( + // arguments for SuiteSparseQR_min2norm: + int ordering, + double tol, + cholmod_sparse *A, + cholmod_sparse *B, + cholmod_common *cc, + + // malloc control + int memory_test, // if TRUE, test malloc error handling + int memory_punt // if TRUE, test punt case +) +{ + cholmod_sparse *X = NULL ; + if (!memory_test) + { + // just call the method directly; no memory testing + X = SuiteSparseQR_min2norm (ordering, tol, A, B, cc) ; + } + else + { + // test malloc error handling + int64_t tries ; + test_memory_handler (cc, true) ; + my_punt = memory_punt ; + for (tries = 0 ; my_tries < 0 ; tries++) + { + my_tries = tries ; + X = SuiteSparseQR_min2norm (ordering, tol, A, B, cc) ; + if (cc->status == CHOLMOD_OK) break ; + } + normal_memory_handler (cc, true) ; + } + return (X) ; +} + +// ============================================================================= +// === SPQR_factorize ========================================================== +// ============================================================================= + +// Wrapper for testing SuiteSparseQR_factorize or +// SuiteSparseQR_symbolic and SuiteSparseQR_numeric + +template +SuiteSparseQR_factorization *SPQR_factorize +( + // arguments for SuiteSparseQR_factorize: + int ordering, + double tol, + cholmod_sparse *A, + cholmod_common *cc, + + // method to use + int split, // if 1 use SuiteSparseQR_symbolic followed by + // SuiteSparseQR_numeric, if 0 use + // SuiteSparseQR_factorize, if 2, do the + // numeric factorization twice, just for testing. + // if 3 use SuiteSparseQR_C_factorize + // if 3 use SuiteSparseQR_C_symbolic / _C_numeric + + // malloc control + int memory_test, // if TRUE, test malloc error handling + int memory_punt // if TRUE, test punt case +) +{ + SuiteSparseQR_factorization *QR ; + SuiteSparseQR_C_factorization *C_QR ; + if (!memory_test) + { + // just call the method directly; no memory testing + + if (split == 4) + { + + C_QR = SuiteSparseQR_C_symbolic (ordering, tol >= 0, A, cc) ; + SuiteSparseQR_C_numeric (tol, A, C_QR, cc) ; + if (C_QR == NULL) + { + cc->status = CHOLMOD_OUT_OF_MEMORY ; + QR = NULL ; + } + else + { + QR = (SuiteSparseQR_factorization *) + (C_QR->factors) ; + if (QR == NULL || QR->QRnum == NULL) + { + cc->status = CHOLMOD_OUT_OF_MEMORY ; + QR = NULL ; + } + else + { + // QR itself will be kept; free the C wrapper + C_QR->factors = NULL ; + cc->status = CHOLMOD_OK ; + if (QR == NULL) printf ("Hey!\n") ; + } + } + SuiteSparseQR_C_free (&C_QR, cc) ; + + } + else if (split == 3) + { + + C_QR = SuiteSparseQR_C_factorize (ordering, tol, A, cc) ; + int save = cc->status ; + if (C_QR == NULL) + { + QR = NULL ; + } + else + { + QR = (SuiteSparseQR_factorization *) + (C_QR->factors) ; + C_QR->factors = NULL ; + SuiteSparseQR_C_free (&C_QR, cc) ; + } + cc->status = save ; + + } + else if (split == 2) + { + QR = SuiteSparseQR_symbolic (ordering, + tol >= 0 || tol <= SPQR_DEFAULT_TOL, A, cc) ; + ASSERT (QR != NULL) ; + SuiteSparseQR_numeric (tol, A, QR, cc) ; + // just for testing + SuiteSparseQR_numeric (tol, A, QR, cc) ; + } + else if (split == 1) + { + // split symbolic/numeric, no singletons exploited + QR = SuiteSparseQR_symbolic (ordering, + tol >= 0 || tol <= SPQR_DEFAULT_TOL, A, cc) ; + ASSERT (QR != NULL) ; + SuiteSparseQR_numeric (tol, A, QR, cc) ; + } + else + { + QR = SuiteSparseQR_factorize (ordering, tol, A, cc) ; + } + + } + else + { + // test malloc error handling + int64_t tries ; + test_memory_handler (cc, true) ; + my_punt = memory_punt ; + for (tries = 0 ; my_tries < 0 ; tries++) + { + my_tries = tries ; + + if (split == 4) + { + + C_QR = SuiteSparseQR_C_symbolic (ordering, tol >= 0, A, cc) ; + SuiteSparseQR_C_numeric (tol, A, C_QR, cc) ; + if (C_QR == NULL) + { + cc->status = CHOLMOD_OUT_OF_MEMORY ; + QR = NULL ; + } + else + { + QR = (SuiteSparseQR_factorization *) + (C_QR->factors) ; + if (QR == NULL || QR->QRnum == NULL) + { + cc->status = CHOLMOD_OUT_OF_MEMORY ; + QR = NULL ; + } + else + { + // QR itself will be kept; free the C wrapper + C_QR->factors = NULL ; + cc->status = CHOLMOD_OK ; + if (QR == NULL) printf ("Hey!!\n") ; + } + } + SuiteSparseQR_C_free (&C_QR, cc) ; + + + } + else if (split == 3) + { + + C_QR = SuiteSparseQR_C_factorize (ordering, tol, A, cc) ; + int save = cc->status ; + if (C_QR == NULL) + { + QR = NULL ; + } + else + { + QR = (SuiteSparseQR_factorization *) + (C_QR->factors) ; + C_QR->factors = NULL ; + SuiteSparseQR_C_free (&C_QR, cc) ; + } + cc->status = save ; + + } + else if (split == 1 || split == 2) + { + // split symbolic/numeric, no singletons exploited + QR = SuiteSparseQR_symbolic (ordering, + tol >= 0 || tol <= SPQR_DEFAULT_TOL, A, cc) ; + if (cc->status < CHOLMOD_OK) + { + continue ; + } + ASSERT (QR != NULL) ; + SuiteSparseQR_numeric (tol, A, QR, cc) ; + if (cc->status < CHOLMOD_OK) + { + SuiteSparseQR_free (&QR, cc) ; + } + } + else + { + QR = SuiteSparseQR_factorize (ordering, tol, A, cc) ; + } + + if (cc->status == CHOLMOD_OK) break ; + } + normal_memory_handler (cc, true) ; + } + + if (QR == NULL) printf ("huh?? split: %d ordering %d tol %g\n", split, + ordering, tol) ; + return (QR) ; +} + + +#endif + +// ============================================================================= +// === SPQR_qr ================================================================= +// ============================================================================= + +// wrapper for SuiteSparseQR, optionally testing memory allocation + +template Int SPQR_qr +( + // arguments for SuiteSparseQR: + int ordering, + double tol, + Int econ, + int getCTX, + cholmod_sparse *A, + cholmod_sparse *Bsparse, + cholmod_dense *Bdense, + cholmod_sparse **Zsparse, + cholmod_dense **Zdense, + cholmod_sparse **R, + Int **E, + cholmod_sparse **H, + Int **HPinv, + cholmod_dense **HTau, + cholmod_common *cc, + + // which version to use (C or C++) + int use_c_version, // if TRUE use C version, otherwise use C++ + + // malloc control + int memory_test, // if TRUE, test malloc error handling + int memory_punt // if TRUE, test punt case +) +{ + Int rank ; + if (!memory_test) + { + // just call the method directly; no memory testing + if (use_c_version) + { + if (sizeof (Int) == sizeof (int64_t)) + { + rank = SuiteSparseQR_C (ordering, tol, econ, getCTX, A, + Bsparse, Bdense, Zsparse, Zdense, R, + (int64_t **) E, H, (int64_t **) HPinv, HTau, cc) ; + } + else + { + rank = SuiteSparseQR_i_C (ordering, tol, econ, getCTX, A, + Bsparse, Bdense, Zsparse, Zdense, R, + (int32_t **) E, H, (int32_t **) HPinv, HTau, cc) ; + } + } + else + { + rank = SuiteSparseQR (ordering, tol, econ, getCTX, A, + Bsparse, Bdense, Zsparse, Zdense, R, E, H, HPinv, HTau, cc) ; + } + } + else + { + // test malloc error handling + int64_t tries ; + test_memory_handler (cc, true) ; + my_punt = memory_punt ; + for (tries = 0 ; my_tries < 0 ; tries++) + { + my_tries = tries ; + if (use_c_version) + { + if (sizeof (Int) == sizeof (int64_t)) + { + rank = SuiteSparseQR_C (ordering, tol, econ, getCTX, A, + Bsparse, Bdense, Zsparse, Zdense, R, + (int64_t **) E, H, (int64_t **) HPinv, HTau, cc) ; + } + else + { + rank = SuiteSparseQR_i_C (ordering, tol, econ, getCTX, A, + Bsparse, Bdense, Zsparse, Zdense, R, + (int32_t **) E, H, (int32_t **) HPinv, HTau, cc) ; + } + } + else + { + rank = SuiteSparseQR (ordering, tol, econ, + getCTX, A, Bsparse, Bdense, Zsparse, Zdense, R, + E, H, HPinv, HTau, cc); + } + if (cc->status == CHOLMOD_OK) + { + break ; + } + } + normal_memory_handler (cc, true) ; + } + return (rank) ; +} + + +// ============================================================================= +// === my_rand ================================================================= +// ============================================================================= + +// The POSIX example of rand, duplicated here so that the same sequence will +// be generated on different machines. + +static unsigned long next = 1 ; + +#define MY_RAND_MAX 32767 + +// RAND_MAX assumed to be 32767 +int64_t my_rand (void) +{ + next = next * 1103515245 + 12345 ; + return ((unsigned)(next/65536) % (MY_RAND_MAX + 1)) ; +} + +void my_srand (unsigned seed) +{ + next = seed ; +} + +unsigned long my_seed (void) +{ + return (next) ; +} + +int64_t nrand (int64_t n) // return a random int64_t between 0 and n-1 +{ + return ((n <= 0) ? 0 : (my_rand ( ) % n)) ; +} + +double xrand ( ) // return a random double between -1 and 1 +{ + double x = ((double) my_rand ( )) / MY_RAND_MAX ; + return (2*x-1) ; +} + +double erand (double range) +{ + return (range * xrand ( )) ; +} + +Complex erand (Complex range) +{ + /* + Complex x ; + x.real ( ) = xrand ( ) ; + x.imag ( ) = xrand ( ) ; + return (range * x) ; + */ + Complex i = Complex (0,1) ; + return (range * (xrand ( ) + i * xrand ( ))) ; +} + + +// ============================================================================= +// === getreal ================================================================= +// ============================================================================= + +// return real part of a scalar x + +inline double getreal (double x) +{ + return (x) ; +} + +inline double getreal (Complex x) +{ + return (x.real ( )) ; +} + +// ============================================================================= +// === getimag ================================================================= +// ============================================================================= + +// return imaginary part of a scalar x +inline double getimag (double x) // x is an unused parameter +{ + return (0) ; +} + +inline double getimag (Complex x) +{ + return (x.imag ( )) ; +} + + +// ============================================================================= +// === dense_wrapper =========================================================== +// ============================================================================= + +// place a column-oriented matrix in a cholmod_dense wrapper + +template cholmod_dense *dense_wrapper +( + cholmod_dense *X, + Int nrow, + Int ncol, + Entry *Xx +) +{ + X->xtype = spqr_type ( ) ; + X->nrow = nrow ; + X->ncol = ncol ; + X->d = nrow ; // leading dimension = nrow + X->nzmax = nrow * ncol ; + X->x = Xx ; + X->z = NULL ; // ZOMPLEX case not supported + X->dtype = CHOLMOD_DOUBLE ; + return (X) ; +} + +// ============================================================================= +// === sparse_split ============================================================ +// ============================================================================= + +// Return the real or imaginary part of a packed complex sparse matrix + +template +cholmod_sparse *sparse_split +( + cholmod_sparse *A, + int part, + cholmod_common *cc +) +{ + cholmod_sparse *C ; + if (!A || A->xtype != CHOLMOD_COMPLEX || A->nz != NULL) return (NULL) ; + if (! (part == 0 || part == 1)) return (NULL) ; + + int64_t nz = spqr_nnz (A, cc) ; + C = spqr_allocate_sparse (A->nrow, A->ncol, nz, TRUE, TRUE, 0, + CHOLMOD_REAL, cc) ; + + Int *Ap = (Int *) A->p ; + Int *Ai = (Int *) A->i ; + double *Ax = (double *) A->x ; + + Int *Cp = (Int *) C->p ; + Int *Ci = (Int *) C->i ; + double *Cx = (double *) C->x ; + + Int n = A->ncol ; + + for (Int k = 0 ; k < n+1 ; k++) + { + Cp [k] = Ap [k] ; + } + + for (int64_t k = 0 ; k < nz ; k++) + { + Ci [k] = Ai [k] ; + } + + for (Int k = 0 ; k < nz ; k++) + { + Cx [k] = Ax [2*k + part] ; + } + + return (C) ; +} + +template +cholmod_sparse *sparse_real (cholmod_sparse *A, cholmod_common *cc) +{ + return (sparse_split (A, 0, cc)) ; +} + +template +cholmod_sparse *sparse_imag (cholmod_sparse *A, cholmod_common *cc) +{ + return (sparse_split (A, 1, cc)) ; +} + +// ============================================================================= +// === sparse_merge ============================================================ +// ============================================================================= + +// Add the real and imaginary parts of a matrix (both stored in real form) +// into a single matrix. The two parts must have the same nonzero pattern. +// A is CHOLMOD_REAL on input and holds the real part, it is CHOLMOD_COMPLEX +// on output. A_imag is CHOLMOD_REAL on input; it holds the imaginary part +// of A as a real matrix. + +template int sparse_merge +( + cholmod_sparse *A, // input/output + cholmod_sparse *A_imag, // input only + cholmod_common *cc +) +{ + if (A == NULL || A_imag == NULL) + { + return (FALSE) ; + } + int64_t nz1 = spqr_nnz (A, cc) ; + int64_t nz2 = spqr_nnz (A_imag, cc) ; + if (A->xtype != CHOLMOD_REAL || A_imag->xtype != CHOLMOD_REAL || nz1 != nz2) + { + return (FALSE) ; + } + + // change A from real to complex + spqr_sparse_xtype (CHOLMOD_COMPLEX, A, cc) ; + + double *Ax = (double *) A->x ; + double *Az = (double *) A_imag->x ; + + // merge in the imaginary part from A_imag into A + for (int64_t k = 0 ; k < nz1 ; k++) + { + Ax [2*k+1] = Az [k] ; + } + return (TRUE) ; +} + +// ============================================================================= +// === sparse_diff ============================================================= +// ============================================================================= + +// Compute C = A-B where A and B are either both real, or both complex + +template cholmod_sparse *sparse_diff +( + cholmod_sparse *A, + cholmod_sparse *B, + cholmod_common *cc +) +{ + cholmod_sparse *C ; + double one [2] = {1,0}, minusone [2] = {-1,0} ; + + if (spqr_type ( ) == CHOLMOD_REAL) + { + // C = A - B + C = spqr_ssadd (A, B, one, minusone, TRUE, TRUE, cc) ; + } + else + { + cholmod_sparse *A_real, *A_imag, *B_real, *B_imag, *C_imag ; + + A_real = sparse_real (A, cc) ; + A_imag = sparse_imag (A, cc) ; + + B_real = sparse_real (B, cc) ; + B_imag = sparse_imag (B, cc) ; + + // real(C) = real(A) - real (B) + C = spqr_ssadd (A_real, B_real, one, minusone, TRUE, TRUE, cc) ; + + // imag(C) = imag(A) - imag (B) + C_imag = spqr_ssadd (A_imag, B_imag, one, minusone, TRUE, TRUE, cc); + + // C = real(C) + 1i*imag(C) + sparse_merge (C, C_imag, cc) ; + spqr_free_sparse (&C_imag, cc) ; + + spqr_free_sparse (&A_real, cc) ; + spqr_free_sparse (&A_imag, cc) ; + spqr_free_sparse (&B_real, cc) ; + spqr_free_sparse (&B_imag, cc) ; + } + + return (C) ; +} + + +// ============================================================================= +// === permute_columns ========================================================= +// ============================================================================= + +// compute A(:,P) + +template cholmod_sparse *permute_columns +( + cholmod_sparse *A, + Int *P, + cholmod_common *cc +) +{ + Int m = A->nrow ; + Int n = A->ncol ; + Int nz = spqr_nnz (A, cc) ; + int xtype = spqr_type ( ) ; + Int *Ap = (Int *) A->p ; + Int *Ai = (Int *) A->i ; + Entry *Ax = (Entry *) A->x ; + cholmod_sparse *C ; + + // allocate empty matrix C with space for nz entries + C = spqr_allocate_sparse (m, n, nz, TRUE, TRUE, 0, xtype, cc) ; + Int *Cp = (Int *) C->p ; + Int *Ci = (Int *) C->i ; + Entry *Cx = (Entry *) C->x ; + + // construct column pointers for C + for (Int k = 0 ; k < n ; k++) + { + // column j of A becomes column k of C + Int j = P ? P [k] : k ; + Cp [k] = Ap [j+1] - Ap [j] ; + } + spqr_cumsum (n, Cp) ; + + // copy columns from A to C + for (Int k = 0 ; k < n ; k++) + { + // copy column k of A into column j of C + Int j = P ? P [k] : k ; + Int pdest = Cp [k] ; + Int psrc = Ap [j] ; + Int len = Ap [j+1] - Ap [j] ; + for (Int t = 0 ; t < len ; t++) + { + Ci [pdest + t] = Ai [psrc + t] ; + Cx [pdest + t] = Ax [psrc + t] ; + } + } + + return (C) ; +} + + +// ============================================================================= +// === sparse_multiply ========================================================= +// ============================================================================= + +// compute A*B where A and B can be both real or both complex + +template cholmod_sparse *sparse_multiply +( + cholmod_sparse *A, + cholmod_sparse *B, + cholmod_common *cc +) +{ + cholmod_sparse *C ; + + if (spqr_type ( ) == CHOLMOD_REAL) + { + // C = A*B + C = spqr_ssmult (A, B, 0, TRUE, TRUE, cc) ; + } + else + { + // cholmod_ssmult and cholmod_add only work for real matrices + cholmod_sparse *A_real, *A_imag, *B_real, *B_imag, *C_imag, *T1, *T2 ; + double one [2] = {1,0}, minusone [2] = {-1,0} ; + + A_real = sparse_real (A, cc) ; + A_imag = sparse_imag (A, cc) ; + + B_real = sparse_real (B, cc) ; + B_imag = sparse_imag (B, cc) ; + + // real(C) = real(A)*real(B) - imag(A)*imag(B) + T1 = spqr_ssmult (A_real, B_real, 0, TRUE, TRUE, cc) ; + T2 = spqr_ssmult (A_imag, B_imag, 0, TRUE, TRUE, cc) ; + C = spqr_ssadd (T1, T2, one, minusone, TRUE, TRUE, cc) ; + spqr_free_sparse (&T1, cc) ; + spqr_free_sparse (&T2, cc) ; + + // imag(C) = imag(A)*real(B) + real(A)*imag(B) + T1 = spqr_ssmult (A_imag, B_real, 0, TRUE, TRUE, cc) ; + T2 = spqr_ssmult (A_real, B_imag, 0, TRUE, TRUE, cc) ; + C_imag = spqr_ssadd (T1, T2, one, one, TRUE, TRUE, cc) ; + spqr_free_sparse (&T1, cc) ; + spqr_free_sparse (&T2, cc) ; + + // C = real(C) + 1i*imag(C) + sparse_merge (C, C_imag, cc) ; + spqr_free_sparse (&C_imag, cc) ; + + spqr_free_sparse (&A_real, cc) ; + spqr_free_sparse (&A_imag, cc) ; + spqr_free_sparse (&B_real, cc) ; + spqr_free_sparse (&B_imag, cc) ; + } + + return (C) ; +} + + +// ============================================================================= +// === sparse_resid ============================================================ +// ============================================================================= + +// compute norm (A*x-b,1) for A,x, and b all sparse + +template double sparse_resid +( + cholmod_sparse *A, + double anorm, + cholmod_sparse *X, + cholmod_sparse *B, + cholmod_common *cc +) +{ + cholmod_sparse *AX, *Resid ; + // AX = A*X + AX = sparse_multiply (A, X, cc) ; + // Resid = AX - B + Resid = sparse_diff (AX, B, cc) ; + // resid = norm (Resid,1) + double resid = spqr_norm_sparse (Resid, 1, cc) ; + resid = CHECK_NAN (resid) ; + spqr_free_sparse (&AX, cc) ; + spqr_free_sparse (&Resid, cc) ; + return (CHECK_NAN (resid / anorm)) ; +} + +// ============================================================================= +// === dense_resid ============================================================= +// ============================================================================= + +// compute norm (A*x-b,1) for A sparse, x and b dense + +template double dense_resid +( + cholmod_sparse *A, + double anorm, + cholmod_dense *X, + Int nb, + Entry *Bx, + cholmod_common *cc +) +{ + cholmod_dense *B, Bmatrix, *Resid ; + double one [2] = {1,0}, minusone [2] = {-1,0} ; + + B = dense_wrapper (&Bmatrix, A->nrow, nb, Bx) ; + // Resid = B + Resid = spqr_copy_dense (B, cc) ; + + // Resid = A*X - Resid + spqr_sdmult (A, FALSE, one, minusone, X, Resid, cc) ; + + // resid = norm (Resid,1) + double resid = spqr_norm_dense (Resid, 1, cc) ; + resid = CHECK_NAN (resid) ; + spqr_free_dense (&Resid, cc) ; + return (CHECK_NAN (resid / anorm)) ; +} + +// ============================================================================= +// === check_r_factor ========================================================== +// ============================================================================= + +// compute norm (R'*R - (A(:,P))'*(A(:,P)), 1) / norm (A'*A,1) + +template double check_r_factor +( + cholmod_sparse *R, + cholmod_sparse *A, + Int *P, + cholmod_common *cc +) +{ + cholmod_sparse *RTR, *RT, *C, *CT, *CTC, *D ; + + // RTR = R'*R + RT = spqr_transpose (R, 2, cc) ; + RTR = sparse_multiply (RT, R, cc) ; + spqr_free_sparse (&RT, cc) ; + + // C = A(:,P) + C = permute_columns (A, P, cc) ; + + // CTC = C'*C + CT = spqr_transpose (C, 2, cc) ; + CTC = sparse_multiply (CT, C, cc) ; + spqr_free_sparse (&CT, cc) ; + spqr_free_sparse (&C, cc) ; + + double ctcnorm = spqr_norm_sparse (CTC, 1, cc) ; + if (ctcnorm == 0) ctcnorm = 1 ; + ctcnorm = CHECK_NAN (ctcnorm) ; + + // D = RTR - CTC + D = sparse_diff (RTR, CTC, cc) ; + spqr_free_sparse (&CTC, cc) ; + spqr_free_sparse (&RTR, cc) ; + + // err = norm (D,1) + double err = spqr_norm_sparse (D, 1, cc) / ctcnorm ; + err = CHECK_NAN (err) ; + + spqr_free_sparse (&D, cc) ; + return (CHECK_NAN (err)) ; +} + + +// ============================================================================= +// === check_qr ================================================================ +// ============================================================================= + +// compute norm (Q*R - A(:,P)) / norm (A) + +template double check_qr +( + cholmod_sparse *Q, + cholmod_sparse *R, + cholmod_sparse *A, + Int *P, + double anorm, + cholmod_common *cc +) +{ + cholmod_sparse *QR, *C, *D ; + + // C = A(:,P) + C = permute_columns (A, P, cc) ; + + // QR = Q*R + QR = sparse_multiply (Q, R, cc) ; + + // D = RTR - CTC + D = sparse_diff (QR, C, cc) ; + spqr_free_sparse (&QR, cc) ; + spqr_free_sparse (&C, cc) ; + + // err = norm (D,1) + double err = spqr_norm_sparse (D, 1, cc) / anorm ; + err = CHECK_NAN (err) ; + + spqr_free_sparse (&D, cc) ; + return (CHECK_NAN (err)) ; +} + +// ============================================================================= +// === Rsolve ================================================================== +// ============================================================================= + +template int Rsolve +( + // R is n-by-n, upper triangular with zero-free diagonal + Int n, + cholmod_sparse *R, + Entry *X, // X is n-by-nx, leading dimension n, overwritten with soln + Int nx, + cholmod_common *cc +) +{ + // Int n = R->n ; + Int *Rp = (Int *) R->p ; + Int *Ri = (Int *) R->i ; + Entry *Rx = (Entry *) R->x ; + + // check the diagonal + for (Int j = 0 ; j < n ; j++) + { + if (Rp [j] == Rp [j+1] || Ri [Rp [j+1]-1] != j) + { + printf ("Rsolve: R not upper triangular w/ zero-free diagonal\n") ; + return (FALSE) ; + } + } + + // do the backsolve + for (Int k = 0 ; k < nx ; k++) + { + for (Int j = n-1 ; j >= 0 ; j--) + { + Entry rjj = Rx [Rp [j+1]-1] ; + if (rjj == (Entry) 0) + { + printf ("Rsolve: R has an explicit zero on the diagonal\n") ; + return (FALSE) ; + } + X [j] /= rjj ; + for (Int p = Rp [j] ; p < Rp [j+1]-1 ; p++) + { + X [Ri [p]] -= Rx [p] * X [j] ; + } + } + X += n ; + } + + return (TRUE) ; +} + + +// ============================================================================= +// === create_Q ================================================================ +// ============================================================================= + +// create a sparse Q +template cholmod_sparse *create_Q +( + cholmod_sparse *H, + cholmod_dense *HTau, + Int *HPinv, + cholmod_common *cc +) +{ + cholmod_sparse *Q, *I ; + Int m = H->nrow ; + int xtype = spqr_type ( ) ; + I = spqr_speye (m, m, xtype, cc) ; + Q = SPQR_qmult (1, H, HTau, HPinv, I, cc, m<300, nrand (2)) ; + spqr_free_sparse (&I, cc) ; + return (Q) ; +} + + +// ============================================================================= +// === QRsolve ================================================================= +// ============================================================================= + +// solve Ax=b using H, R, and E + +template double QRsolve +( + cholmod_sparse *A, + double anorm, + Int rank, + int method, + cholmod_sparse *H, + cholmod_dense *HTau, + Int *HPinv, + cholmod_sparse *R, + Int *Qfill, + cholmod_dense *Bdense, + cholmod_common *cc +) +{ + double one [2] = {1,0}, zero [2] = {0,0}, resid = EMPTY ; + int xtype = spqr_type ( ) ; + Int n = A->ncol ; + Int m = A->nrow ; + Int nrhs = Bdense->ncol ; + Entry *X, *Y = NULL, *B ; + cholmod_dense *Ydense = NULL ; + cholmod_dense *Xdense ; + + B = (Entry *) Bdense->x ; + Xdense = spqr_zeros (n, nrhs, xtype, cc) ; + X = (Entry *) Xdense->x ; + + if (method == 0) + { + // solve Ax=b using H, R, and E + // Y = Q'*B + Ydense = SPQR_qmult (0, H, HTau, HPinv, Bdense, cc, + m < 300, nrand (2)) ; + } + else + { + cholmod_sparse *Q, *QT ; + // solve using Q instead of qmult + Q = create_Q (H, HTau, HPinv, cc) ; + QT = spqr_transpose (Q, 2, cc) ; + // Y = Q'*B + Ydense = spqr_zeros (m, nrhs, xtype, cc) ; + spqr_sdmult (QT, FALSE, one, zero, Bdense, Ydense, cc) ; + spqr_free_sparse (&Q, cc) ; + spqr_free_sparse (&QT, cc) ; + } + + // Y (1:rank) = R (1:rank,1:rank) \ Y (1:rank) + Y = (Entry *) Ydense->x ; + Int ok = Rsolve (rank, R, Y, nrhs, cc) ; + // X = E*Y + if (ok) + { + for (Int kk = 0 ; kk < nrhs ; kk++) + { + for (Int k = 0 ; k < rank ; k++) + { + Int j = Qfill ? Qfill [k] : k ; + X [j] = Y [k] ; + } + X += n ; + Y += m ; + } + // check norm (A*x-b), x and b dense + resid = dense_resid (A, anorm, Xdense, nrhs, B, cc) ; + } + + spqr_free_dense (&Ydense, cc) ; + spqr_free_dense (&Xdense, cc) ; + return (CHECK_NAN (resid)) ; +} + +// ============================================================================= +// === check_qmult ============================================================= +// ============================================================================= + +// Test qmult + +template double check_qmult +( + cholmod_sparse *H, + cholmod_dense *HTau, + Int *HPinv, + int test_errors, + cholmod_common *cc +) +{ + cholmod_sparse *Q, *QT, *Xsparse, *Ssparse, *Zsparse ; + cholmod_dense *Xdense, *Zdense, *Sdense, *Ydense ; + int xtype = spqr_type ( ) ; + Entry *X, *Y, *Z, *S ; + double err, maxerr = 0 ; + double one [2] = {1,0}, zero [2] = {0,0} ; + Entry range = (Entry) 1.0 ; + Int k ; + + Int m = H->nrow ; + Q = create_Q (H, HTau, HPinv, cc) ; // construct Q from H + + QT = spqr_transpose (Q, 2, cc) ; // QT = Q' + + // compare Q with qmult for sparse and dense X + for (Int nx = 0 ; nx < 5 ; nx++) // # of columns of X + { + Int xsize = m * nx ; // size of X + for (Int nz = 1 ; nz <= xsize+1 ; nz *= 16) // # of nonzeros in X + { + + // ----------------------------------------------------------------- + // create X as m-by-nx, both sparse and dense + // ----------------------------------------------------------------- + + Xdense = spqr_zeros (m, nx, xtype, cc) ; + X = (Entry *) Xdense->x ; + for (k = 0 ; k < nz ; k++) + { + X [nrand (xsize)] += erand (range) ; + } + Xsparse = spqr_dense_to_sparse (Xdense, TRUE, cc) ; + + // ----------------------------------------------------------------- + // Y = Q'*X for method 0, Y = Q*X for method 1 + // ----------------------------------------------------------------- + + for (int method = 0 ; method <= 1 ; method++) + { + // Y = Q'*X or Q*X + Ydense = SPQR_qmult (method, H, HTau, HPinv, + Xdense, cc, m < 300, nrand (2)) ; + Y = (Entry *) Ydense->x ; + + Zdense = spqr_zeros (m, nx, xtype, cc) ; + spqr_sdmult (Q, (method == 0), one, zero, + Xdense, Zdense, cc) ; + Z = (Entry *) Zdense->x ; + + for (err = 0, k = 0 ; k < xsize ; k++) + { + double e1 = spqr_abs (Y [k] - Z [k], cc) ; + e1 = CHECK_NAN (e1) ; + err = MAX (err, e1) ; + } + maxerr = MAX (maxerr, err) ; + + // S = Q'*Xsparse or Q*Xsparse + Ssparse = SPQR_qmult ( + method, H, HTau, HPinv, Xsparse, cc, m < 300, nrand (2)) ; + Sdense = spqr_sparse_to_dense (Ssparse, cc) ; + S = (Entry *) Sdense->x ; + + for (err = 0, k = 0 ; k < xsize ; k++) + { + double e1 = spqr_abs (S [k] - Y [k], cc) ; + e1 = CHECK_NAN (e1) ; + err = MAX (err, e1) ; + } + maxerr = MAX (maxerr, err) ; + + spqr_free_dense (&Ydense, cc) ; + spqr_free_dense (&Zdense, cc) ; + spqr_free_sparse (&Ssparse, cc) ; + spqr_free_dense (&Sdense, cc) ; + } + + spqr_free_dense (&Xdense, cc) ; + spqr_free_sparse (&Xsparse, cc) ; + + // ----------------------------------------------------------------- + // create X as nx-by-m, both sparse and dense + // ----------------------------------------------------------------- + + Xdense = spqr_zeros (nx, m, xtype, cc) ; + X = (Entry *) Xdense->x ; + for (k = 0 ; k < nz ; k++) + { + X [nrand (xsize)] += erand (range) ; + } + Xsparse = spqr_dense_to_sparse (Xdense, TRUE, cc) ; + + // ----------------------------------------------------------------- + // Y = X*Q' for method 2, Y = X*Q for method 3 + // ----------------------------------------------------------------- + + for (int method = 2 ; method <= 3 ; method++) + { + // Y = X*Q' or X*Q + Ydense = SPQR_qmult (method, H, HTau, HPinv, + Xdense, cc, m < 300, nrand (2)) ; + Y = (Entry *) Ydense->x ; + + if (method == 2) + { + // Zsparse = (X*Q') + Zsparse = sparse_multiply (Xsparse, QT, cc) ; + } + else + { + // Zsparse = (X*Q) + Zsparse = sparse_multiply (Xsparse, Q, cc) ; + } + Zdense = spqr_sparse_to_dense (Zsparse, cc) ; + + Z = (Entry *) Zdense->x ; + + for (err = 0, k = 0 ; k < xsize ; k++) + { + double e1 = spqr_abs (Y [k] - Z [k], cc) ; + e1 = CHECK_NAN (e1) ; + err = MAX (err, e1) ; + } + maxerr = MAX (maxerr, err) ; + + // S = X*Q' or X*Q + Ssparse = SPQR_qmult ( + method, H, HTau, HPinv, Xsparse, cc, m < 300, nrand (2)) ; + Sdense = spqr_sparse_to_dense (Ssparse, cc) ; + S = (Entry *) Sdense->x ; + + for (err = 0, k = 0 ; k < xsize ; k++) + { + double e1 = spqr_abs (S [k] - Y [k], cc) ; + e1 = CHECK_NAN (e1) ; + err = MAX (err, e1) ; + } + maxerr = MAX (maxerr, err) ; + + spqr_free_dense (&Ydense, cc) ; + spqr_free_dense (&Zdense, cc) ; + spqr_free_sparse (&Ssparse, cc) ; + spqr_free_sparse (&Zsparse, cc) ; + spqr_free_dense (&Sdense, cc) ; + } + + spqr_free_dense (&Xdense, cc) ; + spqr_free_sparse (&Xsparse, cc) ; + + } + } + spqr_free_sparse (&Q, cc) ; + spqr_free_sparse (&QT, cc) ; + + // ------------------------------------------------------------------------- + // qmult error conditions + // ------------------------------------------------------------------------- + + // These should fail; expect 6 error messages in the output + + if (test_errors) + { + err = 0 ; + printf ("The following six errors are expected:\n") ; + Xdense = spqr_zeros (m+1, 1, xtype,cc) ; + Ydense = SuiteSparseQR_qmult (0, H, HTau, HPinv, Xdense, cc) ; + if (Ydense != NULL || cc->status != CHOLMOD_INVALID) err++ ; + spqr_free_dense (&Xdense, cc) ; + + Xdense = spqr_zeros (1, m+1, xtype,cc) ; + Ydense = SuiteSparseQR_qmult (2, H, HTau, HPinv, Xdense, cc) ; + if (Ydense != NULL || cc->status != CHOLMOD_INVALID) err++ ; + Ydense = SuiteSparseQR_qmult (42, H, HTau, HPinv, Xdense, cc) ; + if (Ydense != NULL || cc->status != CHOLMOD_INVALID) err++ ; + spqr_free_dense (&Xdense, cc) ; + + Xsparse = spqr_speye (m+1, m+1, xtype, cc) ; + + Q = SuiteSparseQR_qmult (0, H, HTau, HPinv, Xsparse, cc); + if (Q != NULL || cc->status != CHOLMOD_INVALID) err++ ; + Q = SuiteSparseQR_qmult (2, H, HTau, HPinv, Xsparse, cc); + if (Q != NULL || cc->status != CHOLMOD_INVALID) err++ ; + Q = SuiteSparseQR_qmult (9, H, HTau, HPinv, Xsparse, cc); + if (Q != NULL || cc->status != CHOLMOD_INVALID) err++ ; + + printf (" ... error handling done\n\n") ; + spqr_free_sparse (&Xsparse, cc) ; + + maxerr = MAX (maxerr, err) ; + } + + return (CHECK_NAN (maxerr)) ; +} + + +// ============================================================================= +// === check_rc ================================================================ +// ============================================================================= + +// X = Q'*B has been done, continue with C=R\C and + +template double check_rc +( + Int rank, + cholmod_sparse *R, + cholmod_sparse *A, + Entry *B, + cholmod_dense *X, + Int nrhs, + double anorm, + Int *Qfill, + cholmod_common *cc +) +{ + double resid = EMPTY ; + int xtype = spqr_type ( ) ; + cholmod_dense *W ; + Int n ; + int ok ; + Entry *W1, *X1 ; + if (!R || !X) + { + ok = 0 ; + } + else + { + n = X->nrow ; + X1 = (Entry *) X->x ; + // solve X = R\X, overwriting X with solution + ok = Rsolve (rank, R, X1, nrhs, cc) ; + } + if (ok) + { + // W = E*X + // W = (Entry *) spqr_calloc (A->ncol * nrhs, sizeof (Entry), cc); + W = spqr_zeros (A->ncol, nrhs, xtype, cc) ; + W1 = (Entry *) W->x ; + for (Int col = 0 ; col < nrhs ; col++) + { + for (Int k = 0 ; k < rank ; k++) + { + Int j = Qfill ? Qfill [k] : k ; + if (j < (Int) A->ncol) W1 [j] = X1 [k] ; + } + W1 += A->ncol ; + X1 += n ; + } + // check norm (A*x-b), x and b dense + resid = dense_resid (A, anorm, W, nrhs, B, cc) ; + // spqr_free (A->ncol * nrhs, sizeof (Entry), W, cc) ; + spqr_free_dense (&W, cc) ; + } + return (CHECK_NAN (resid)) ; +} + + +// ============================================================================= +// === transpose =============================================================== +// ============================================================================= + +// Transpose a dense matrix. + +template cholmod_dense *transpose +( + cholmod_dense *Xdense, + cholmod_common *cc +) +{ + Entry *X, *Y ; + cholmod_dense *Ydense ; + if (Xdense == NULL) + { + printf ("transpose failed!\n") ; + return (NULL) ; + } + Int m = Xdense->nrow ; + Int n = Xdense->ncol ; + Int ldx = Xdense->d ; + int xtype = spqr_type ( ) ; + Ydense = spqr_allocate_dense (n, m, n, xtype, cc) ; + X = (Entry *) Xdense->x ; + Y = (Entry *) Ydense->x ; + for (Int i = 0 ; i < m ; i++) + { + for (Int j = 0 ; j < n ; j++) + { + Y [j+i*n] = spqr_conj (X [i+j*ldx]) ; + } + } + return (Ydense) ; +} + +// ============================================================================= +// === qrtest ================================================================== +// ============================================================================= + +template void qrtest +( + cholmod_sparse *A, + double errs [5], + cholmod_common *cc +) +{ + cholmod_sparse *H, *I, *R, *Q, *Csparse, *Xsparse, *AT, *Bsparse ; + cholmod_dense *Cdense, *Xdense, *Bdense, *HTau ; ; + double tol = DBL_EPSILON, err, resid, maxerr, maxresid [2][2] ; + double tols [ ] = { SPQR_DEFAULT_TOL, -1, 0, DBL_EPSILON } ; + Int n, m, nz, *HPinv, ntol, *Ai, *Ap, k, *Qfill, rank, nb, *Cp, *Ci, econ ; + int which ; + Entry *B, *Ax, *Cx ; + int xtype = spqr_type ( ) ; + int ordering ; + Entry range = (Entry) 1.0 ; + + errs [0] = EMPTY ; + errs [1] = EMPTY ; + errs [2] = EMPTY ; + errs [3] = EMPTY ; + errs [4] = EMPTY ; + if (A == NULL) + { + fprintf (stderr, "qrtest: no input matrix\n") ; + return ; + } + + m = A->nrow ; + n = A->ncol ; + Ap = (Int *) A->p ; + Ai = (Int *) A->i ; + Ax = (Entry *) A->x ; + double anorm = spqr_norm_sparse (A, 1, cc) ; + anorm = CHECK_NAN (anorm) ; + printf ("\n===========================================================\n") ; + printf ("Matrix: %d by %d, nnz(A) = %ld, norm(A,1) = %g\n", + (int) m, (int) n, spqr_nnz (A, cc), anorm) ; + printf ( "===========================================================\n") ; + + if (anorm == 0) anorm = 1 ; + + // these should all be zero, no matter what the matrix + maxerr = 0 ; + + // residuals for well-determined or under-determined systems. If + // not rank deficient, these should be zero + maxresid [0][0] = 0 ; // for m <= n, default tol, ordering not fixed + maxresid [0][1] = 0 ; // for m <= n, all other cases + + // residuals for least-squares systems (these will not be zero) + maxresid [1][0] = 0 ; // for m > n, default tol, ordering not fixed + maxresid [1][1] = 0 ; // for m > n, all other cases + + my_srand (m+n) ; + + if (m > 45000) + { + // The only thing returned are the statistics (rank, etc) + printf ("\n=== QR huge (expect int overflow):\n") ; + rank = SPQR_qr ( + 0, 0, 0, 0, A, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + cc, FALSE, FALSE, FALSE) ; + return ; + } + + if (MAX (m,n) >= 300) fprintf (stderr, "please wait ... ") ; + + AT = spqr_transpose (A, 2, cc) ; + + // ------------------------------------------------------------------------- + // test QR routines + // ------------------------------------------------------------------------- + + econ = m ; + + for (ordering = 0 ; ordering <= 9 ; ordering++) + { + + // skip SPQR_ORDERING_GIVEN, unless the matrix is tiny + if (ordering == SPQR_ORDERING_GIVEN && MAX (m,n) > 10) continue ; + + for (ntol = 0 ; ntol < NTOL ; ntol++) + { + + tol = tols [ntol] ; + if // (ntol == 0) // this old test is fragile ... + (tol == SPQR_DEFAULT_TOL) // use this instead + { + // with default tolerance, the fixed ordering can sometimes + // fail if the matrix is rank deficient (R cannot be permuted + // to upper trapezoidal form). + which = (ordering == 0) ; + } + else + { + // with non-default tolerance, the solution can sometimes be + // poor; this is expected. + which = 1 ; + } + printf ("\n=== QR with ordering %d tol %g:\n", ordering, tol) ; + + // ----------------------------------------------------------------- + // create dense and sparse right-hand-sides + // ----------------------------------------------------------------- + + nb = 5 ; + Bdense = spqr_zeros (m, nb, xtype, cc) ; + B = (Entry *) Bdense->x ; + for (k = 0 ; k < m*nb ; k++) + { + B [k] = ((double) (my_rand ( ) % 2)) * erand (range) ; + } + Bsparse = spqr_dense_to_sparse (Bdense, TRUE, cc) ; + + // ----------------------------------------------------------------- + // X = qrsolve(A,B) where X and B are dense + // ----------------------------------------------------------------- + + // X = A\B + if (ordering == SPQR_ORDERING_DEFAULT && tol == SPQR_DEFAULT_TOL) + { + printf ("[ backslach, A and B and X dense: defaults\n") ; + Xdense = SuiteSparseQR (A, Bdense, cc) ; + printf ("] done backslach, A and B and X dense: defaults\n") ; + } + else + { + printf ("[ backslach, A and B and X dense: tol %g order %d\n", + tol, ordering) ; + Xdense = SuiteSparseQR (ordering, tol, A, Bdense, cc) ; + printf ("] done backslach, A B X dense: tol %g order %d\n", + tol, ordering) ; + } + + // check norm (A*x-b), x and b dense + resid = dense_resid (A, anorm, Xdense, nb, B, cc) ; + maxresid [m>n][which] = MAX (maxresid [m>n][which], resid) ; + printf ("Resid0b %d %d %d : %g\n", m>n, (int) ntol, + ordering, resid) ; + + spqr_free_dense (&Xdense, cc) ; + + if (cc->useGPU) + { + // error testing for infeasible GPU memory + size_t save = cc->gpuMemorySize ; + cc->gpuMemorySize = 1 ; + printf ("[ Pretend GPU memory is too small:\n") ; + Xdense = SuiteSparseQR (ordering, tol, A, Bdense, cc) ; + cc->gpuMemorySize = save ; + printf ("] test done infeasible GPU, status %2d, useGPU: %d\n", + cc->status, cc->useGPU) ; + spqr_free_dense (&Xdense, cc) ; + } + + spqr_free_dense (&Bdense, cc) ; + + // ----------------------------------------------------------------- + // X = qrsolve(A,B) where X and B are sparse + // ----------------------------------------------------------------- + + // X = A\B + printf ("[ backslash with sparse B: tol %g\n", tol) ; + Xsparse = SuiteSparseQR (ordering, tol, A, Bsparse, cc) ; + printf ("] did tol %g\n", tol) ; + + // check norm (A*x-b), x and b sparse + resid = sparse_resid (A, anorm, Xsparse, Bsparse, cc) ; + maxresid [m>n][which] = MAX (maxresid [m>n][which], resid) ; + printf ("Resid0 %d %d %d : %g\n", m>n, (int) ntol, + ordering, resid) ; + + spqr_free_sparse (&Xsparse, cc) ; + spqr_free_sparse (&Bsparse, cc) ; + + // ----------------------------------------------------------------- + // X = qrsolve (A,B) where X and B are sparse, with memory test + // ----------------------------------------------------------------- + + // use B = A and solve AX=B where X is sparse + cc->SPQR_shrink = 0 ; // shrink = 0 ; + rank = SPQR_qr ( + ordering, tol, econ, 2, A, + A, NULL, &Xsparse, NULL, NULL, &Qfill, NULL, NULL, NULL, + cc, TRUE, m < 300, nrand (2)) ; + cc->SPQR_shrink = 1 ; // restore default shrink = 1 ; + + if // (ntol == 0) // old test is fragile ... + (tol == SPQR_DEFAULT_TOL) // use this instead. + { + printf ("using default tol: %g\n", cc->SPQR_tol_used) ; + } + + // check norm (A*x-b), x and b sparse + resid = sparse_resid (A, anorm, Xsparse, A, cc) ; + maxresid [m>n][which] = MAX (maxresid [m>n][which], resid) ; + printf ("Resid1 %d %d %d : %g\n", m>n, (int) ntol, + ordering, resid) ; + + spqr_free_sparse (&Xsparse, cc) ; + spqr_free (n+n, sizeof (Int), Qfill, cc) ; + + // ----------------------------------------------------------------- + // X = qrsolve (A,B) where X and B are dense, with memory test + // ----------------------------------------------------------------- + + // use B = dense m-by-2 matrix with some zeros + nb = 5 ; + Bdense = spqr_zeros (m, nb, xtype, cc) ; + B = (Entry *) Bdense->x ; + for (k = 0 ; k < m*nb ; k++) + { + B [k] = (k+1) % 7 ; + } + + rank = SPQR_qr ( + ordering, tol, econ, 2, A, + NULL, Bdense, NULL, &Xdense, NULL, &Qfill, NULL, NULL, NULL, + cc, FALSE, m < 300, nrand (2)) ; + + // check norm (A*x-b), x and b dense + resid = dense_resid (A, anorm, Xdense, nb, B, cc) ; + maxresid [m>n][which] = MAX (maxresid [m>n][which], resid) ; + printf ("Resid2 %d %d %d : %g\n", m>n, (int) ntol, + ordering, resid) ; + + spqr_free_dense (&Xdense, cc) ; + spqr_free (n+nb, sizeof (Int), Qfill, cc) ; + + // ----------------------------------------------------------------- + // X = qrsolve (A,B) where X and B are full and H is kept + // ----------------------------------------------------------------- + + cc->SPQR_shrink = 2 ; // shrink = 2 ; + rank = SPQR_qr ( + ordering, tol, econ, 2, A, + NULL, Bdense, NULL, &Xdense, NULL, &Qfill, &H, &HPinv, &HTau, + cc, FALSE, m < 300, nrand (2)) ; + cc->SPQR_shrink = 1 ; // restore default shrink = 1 ; + + spqr_free_dense (&HTau, cc) ; + spqr_free (m, sizeof (Int), HPinv, cc) ; + spqr_free_sparse (&H, cc) ; + + // check norm (A*x-b), x and b dense + resid = dense_resid (A, anorm, Xdense, nb, B, cc) ; + maxresid [m>n][which] = MAX (maxresid [m>n][which], resid) ; + printf ("Resid3 %d %d %d : %g\n", m>n, (int) ntol, + ordering, resid) ; + + spqr_free_dense (&Xdense, cc) ; + spqr_free (n+nb, sizeof (Int), Qfill, cc) ; + + // ----------------------------------------------------------------- + // [C,R,E] = qr (A,B) where C is sparse and B is full + // ----------------------------------------------------------------- + + cc->SPQR_shrink = 2 ; // shrink = 2 ; + rank = SPQR_qr ( + ordering, tol, econ, 0, A, + NULL, Bdense, &Csparse, NULL, &R, &Qfill, NULL, NULL, NULL, + cc, FALSE, m < 300, nrand (2)) ; + cc->SPQR_shrink = 1 ; // restore default shrink = 1 ; + + // compute x=R\C and check norm (A*x-b) + Cdense = spqr_sparse_to_dense (Csparse, cc) ; + resid = check_rc (rank, R, A, B, Cdense, nb, anorm, Qfill, cc) ; + maxresid [m>n][which] = MAX (maxresid [m>n][which], resid) ; + printf ("Resid4 %d %d %d : %g\n", m>n, (int) ntol, + ordering, resid) ; + spqr_free_dense (&Cdense, cc) ; + + // check that R'*R = (A*E)'*(A*E) + err = check_r_factor (R, A, Qfill, cc) ; + printf ("order %d : R'R-(A*E)'*(A*E), Err1: %g\n", ordering, err) ; + maxerr = MAX (maxerr, err) ; + + spqr_free_sparse (&Csparse, cc) ; + spqr_free_sparse (&R, cc) ; + spqr_free (n+nb, sizeof (Int), Qfill, cc) ; + + // ----------------------------------------------------------------- + // [C,R,E] = qr (A,B) where C and B are full + // ----------------------------------------------------------------- + + cc->SPQR_shrink = 0 ; // shrink = 0 ; + rank = SPQR_qr ( + ordering, tol, econ, 0, A, + NULL, Bdense, NULL, &Cdense, &R, &Qfill, NULL, NULL, NULL, + cc, FALSE, m < 300, nrand (2)) ; + cc->SPQR_shrink = 1 ; // restore default shrink = 1 ; + + // check that R'*R = (A*E)'*(A*E) + err = check_r_factor (R, A, Qfill, cc) ; + printf ("order %d : R'R-(A*E)'*(A*E), Err2: %g\n", ordering, err) ; + maxerr = MAX (maxerr, err) ; + + spqr_free_dense (&Cdense, cc) ; + spqr_free_sparse (&R, cc) ; + spqr_free (n+nb, sizeof (Int), Qfill, cc) ; + + // ----------------------------------------------------------------- + // [C,R,E] = qr (A,B) where C and B are full, simple wrapper + // ----------------------------------------------------------------- + + SuiteSparseQR (ordering, tol, econ, A, Bdense, + &Cdense, &R, &Qfill, cc) ; + + // check that R'*R = (A*E)'*(A*E) + err = check_r_factor (R, A, Qfill, cc) ; + printf ("order %d : R'R-(A*E)'*(A*E), Err3: %g\n", ordering, err) ; + maxerr = MAX (maxerr, err) ; + + spqr_free_dense (&Cdense, cc) ; + spqr_free_sparse (&R, cc) ; + spqr_free (n+nb, sizeof (Int), Qfill, cc) ; + + // ----------------------------------------------------------------- + // [C,R,E] = qr (A,B) where C and B are sparse, simple wrapper + // ----------------------------------------------------------------- + + Bsparse = spqr_dense_to_sparse (Bdense, TRUE, cc) ; + + SuiteSparseQR (ordering, tol, econ, A, Bsparse, + &Csparse, &R, &Qfill, cc) ; + + // check that R'*R = (A*E)'*(A*E) + err = check_r_factor (R, A, Qfill, cc) ; + printf ("order %d : R'R-(A*E)'*(A*E), Err4: %g\n", ordering, err) ; + maxerr = MAX (maxerr, err) ; + + spqr_free_sparse (&Csparse, cc) ; + spqr_free_sparse (&Bsparse, cc) ; + spqr_free_sparse (&R, cc) ; + spqr_free (n+nb, sizeof (Int), Qfill, cc) ; + + // ----------------------------------------------------------------- + // [CT,R,E] = qr (A,B), but do not return R + // ----------------------------------------------------------------- + + rank = SPQR_qr ( + ordering, tol, econ, 1, A, + NULL, Bdense, &Csparse, NULL, NULL, &Qfill, NULL, NULL, NULL, + cc, FALSE, m < 300, nrand (2)) ; + + spqr_free_sparse (&Csparse, cc) ; + spqr_free (n+nb, sizeof (Int), Qfill, cc) ; + + // ----------------------------------------------------------------- + // [Q,R,E] = qr (A), Q in Householder form + // ----------------------------------------------------------------- + + rank = SPQR_qr ( + ordering, tol, econ, -1, A, + NULL, NULL, NULL, NULL, &R, &Qfill, &H, &HPinv, &HTau, + cc, FALSE, m < 300, nrand (2)) ; + + // check that R'*R = (A*E)'*(A*E) + err = check_r_factor (R, A, Qfill, cc) ; + printf ("order %d : R'R-(A*E)'*(A*E), Err5: %g\n", ordering, err) ; + maxerr = MAX (maxerr, err) ; + + // solve Ax=b using Householder form + resid = QRsolve (A, anorm, rank, 0, H, HTau, HPinv, R, + Qfill, Bdense, cc) ; + maxresid [m>n][which] = MAX (maxresid [m>n][which], resid) ; + printf ("Resid5 %d %d %d : %g\n", m>n, (int) ntol, + ordering, resid) ; + + // solve Ax=b using Q matrix form + resid = QRsolve (A, anorm, rank, 1, H, HTau, HPinv, R, + Qfill, Bdense, cc) ; + maxresid [m>n][which] = MAX (maxresid [m>n][which], resid) ; + printf ("Resid6 %d %d %d : %g\n", m>n, (int) ntol, + ordering, resid) ; + + spqr_free_dense (&HTau, cc) ; + spqr_free_sparse (&H, cc) ; + spqr_free (m, sizeof (Int), HPinv, cc) ; + spqr_free (n, sizeof (Int), Qfill, cc) ; + spqr_free_sparse (&R, cc) ; + + // ----------------------------------------------------------------- + // [Q,R,E] = qr (A), non-economy + // ----------------------------------------------------------------- + + cc->SPQR_shrink = 0 ; // shrink = 0 ; + I = spqr_speye (m, m, xtype, cc) ; + rank = SPQR_qr ( + ordering, tol, m, 1, A, + I, NULL, &Q, NULL, &R, &Qfill, NULL, NULL, NULL, + cc, FALSE, m<300, nrand (2)) ; + cc->SPQR_shrink = 1 ; // restore default shrink = 1 ; + + // ensure norm (Q*R - A*E) is small + err = check_qr (Q, R, A, Qfill, anorm, cc) ; + printf ("order %d : Q*R-A*E Err6: %g\n", ordering, err) ; + maxerr = MAX (maxerr, err) ; + + spqr_free_sparse (&I, cc) ; + spqr_free_sparse (&R, cc) ; + spqr_free_sparse (&Q, cc) ; + spqr_free (n+m, sizeof (Int), Qfill, cc) ; + + // ----------------------------------------------------------------- + // [Q,R,E] = qr (A), non-economy, using simple wrapper + // ----------------------------------------------------------------- + + if (nrand (2)) + { + // use C version + if (sizeof (Int) == sizeof (int64_t)) + { + SuiteSparseQR_C_QR (ordering, tol, m, A, &Q, &R, + (int64_t **) &Qfill, cc) ; + } + else + { + SuiteSparseQR_i_C_QR (ordering, tol, m, A, &Q, &R, + (int32_t **) &Qfill, cc) ; + } + } + else + { + // use C++ version + SuiteSparseQR (ordering, tol, m, A, &Q, &R, + &Qfill, cc) ; + } + + // ensure norm (Q*R - A*E) is small + err = check_qr (Q, R, A, Qfill, anorm, cc) ; + printf ("order %d : Q*R-A*E Err7: %g\n", ordering, err) ; + maxerr = MAX (maxerr, err) ; + + spqr_free_sparse (&R, cc) ; + spqr_free_sparse (&Q, cc) ; + spqr_free (n+m, sizeof (Int), Qfill, cc) ; + + // ----------------------------------------------------------------- + // [R,E] = qr (A) + // ----------------------------------------------------------------- + + rank = SPQR_qr ( + ordering, tol, econ, 0, A, + NULL, NULL, NULL, NULL, &R, &Qfill, NULL, NULL, NULL, + cc, FALSE, m < 300, nrand (2)) ; + + // check that R'*R = (A*E)'*(A*E) + err = check_r_factor (R, A, Qfill, cc) ; + printf ("order %d : R'R-(A*E)'*(A*E), Err8: %g\n", ordering, err) ; + maxerr = MAX (maxerr, err) ; + Int rank1 = rank ; + + spqr_free_sparse (&R, cc) ; + spqr_free (n, sizeof (Int), Qfill, cc) ; + + // ----------------------------------------------------------------- + // [R,E] = qr (A) using simple wrapper + // ----------------------------------------------------------------- + + SuiteSparseQR (ordering, tol, econ, A, &R, &Qfill, cc) ; + + // check that R'*R = (A*E)'*(A*E) + err = check_r_factor (R, A, Qfill, cc) ; + printf ("order %d : R'R-(A*E)'*(A*E), Err9: %g\n", ordering, err) ; + maxerr = MAX (maxerr, err) ; + + spqr_free_sparse (&R, cc) ; + spqr_free (n, sizeof (Int), Qfill, cc) ; + + // ----------------------------------------------------------------- + // [ ] = qr (A) + // ----------------------------------------------------------------- + + // The only thing returned are the statistics (rank, etc) + cc->SPQR_shrink = 0 ; // shrink = 0 ; + rank = SPQR_qr ( + ordering, tol, econ, 0, A, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + cc, FALSE, m < 300, nrand (2)) ; + cc->SPQR_shrink = 1 ; // restore default shrink = 1 ; + + err = (rank != rank1) ; + printf ("order %d : rank %6d %6d Err10: %g\n", ordering, + (int) rank, (int) rank1, err) ; + maxerr = MAX (maxerr, err) ; + + // ----------------------------------------------------------------- + // [C,H,R,E] = qr (A) + // ----------------------------------------------------------------- + + rank = SPQR_qr ( + ordering, tol, econ, 0, A, + NULL, Bdense, &Csparse, NULL, &R, &Qfill, &H, &HPinv, &HTau, + cc, FALSE, m < 300, nrand (2)) ; + + // compute x=R\C and check norm (A*x-b) + Cdense = spqr_sparse_to_dense (Csparse, cc) ; + resid = check_rc (rank, R, A, B, Cdense, nb, anorm, Qfill, cc) ; + maxresid [m>n][which] = MAX (maxresid [m>n][which], resid) ; + printf ("Resid7 %d %d %d : %g\n", m>n, (int) ntol, + ordering, resid) ; + spqr_free_dense (&Cdense, cc) ; + + // check that R'*R = (A*E)'*(A*E) + err = check_r_factor (R, A, Qfill, cc) ; + printf ("order %d : R'R-(A*E)'*(A*E), Err11: %g\n", ordering, err) ; + maxerr = MAX (maxerr, err) ; + + spqr_free_sparse (&Csparse, cc) ; + spqr_free_sparse (&R, cc) ; + + // compare Q with qmult + err = check_qmult (H, HTau, HPinv, + ordering == 2 && /* ntol == 0 */ tol == SPQR_DEFAULT_TOL, cc) ; + printf ("order %d : check qmult Err12: %g\n", ordering, err) ; + maxerr = MAX (maxerr, err) ; + + spqr_free_dense (&HTau, cc) ; + spqr_free_sparse (&H, cc) ; + spqr_free (m, sizeof (Int), HPinv, cc) ; + spqr_free (n+nb, sizeof (Int), Qfill, cc) ; + spqr_free_dense (&Bdense, cc) ; + + // ----------------------------------------------------------------- + // [H,R,E] = qr (A), simple wrapper + // ----------------------------------------------------------------- + + SuiteSparseQR (ordering, tol, econ, A, + &R, &Qfill, &H, &HPinv, &HTau, cc) ; + + // check that R'*R = (A*E)'*(A*E) + err = check_r_factor (R, A, Qfill, cc) ; + printf ("order %d : R'R-(A*E)'*(A*E), Err13: %g\n", ordering, err) ; + maxerr = MAX (maxerr, err) ; + + // compare Q with qmult + err = check_qmult (H, HTau, HPinv, FALSE, cc) ; + printf ("order %d : check qmult Err14: %g\n", ordering, err) ; + maxerr = MAX (maxerr, err) ; + + spqr_free_sparse (&R, cc) ; + spqr_free_dense (&HTau, cc) ; + spqr_free_sparse (&H, cc) ; + spqr_free (m, sizeof (Int), HPinv, cc) ; + spqr_free (n, sizeof (Int), Qfill, cc) ; + +#ifndef NEXPERT + + // ================================================================= + // === expert routines ============================================= + // ================================================================= + + SuiteSparseQR_factorization *QR ; + cholmod_dense *XT, *Zdense, *BT, *Ydense ; + cholmod_sparse *Ysparse ; + + // ----------------------------------------------------------------- + // QR = qr (A), then solve + // ----------------------------------------------------------------- + + for (int split = 0 ; split <= 4 ; split++) + { + + QR = SPQR_factorize (ordering, tol, A, cc, + split, m < 300, nrand (2)) ; + + // split == 4 does not use singletons, so it can fail if + // rank < n + int wh = which || (split == 4) ; + + // solve Ax=b + nb = 5 ; + Bdense = spqr_zeros (m, nb, xtype, cc) ; + B = (Entry *) Bdense->x ; + for (k = 0 ; k < m*nb ; k++) + { + B [k] = erand (range) ; + } + + // Y = Q'*B + Ydense = SPQR_qmult (SPQR_QTX, QR, Bdense, cc, + m < 300, nrand (2)) ; + + // X = R\(E*Y) + Xdense = SPQR_solve (SPQR_RETX_EQUALS_B, QR, + Ydense, cc, m < 300, nrand (2)) ; + // check norm (A*x-b), x and b dense + resid = dense_resid (A, anorm, Xdense, nb, B, cc) ; + maxresid [m>n][wh] = MAX (maxresid [m>n][wh], resid) ; + printf ("Resid8_%d %d %d %d : %g (%d) tol %g\n", + split, m>n, (int) ntol, ordering, resid, wh, tol) ; + spqr_free_dense (&Xdense, cc) ; + spqr_free_dense (&Ydense, cc) ; + + // Y = (B'*Q)' + BT = transpose (Bdense, cc) ; + XT = SPQR_qmult (SPQR_XQ, QR, BT, cc, + m < 300, nrand (2)) ; + + Ydense = transpose (XT, cc) ; + spqr_free_dense (&XT, cc) ; + spqr_free_dense (&BT, cc) ; + + // X = R\(E*Y) + Xdense = SPQR_solve (SPQR_RETX_EQUALS_B, QR, + Ydense, cc, m < 300, nrand (2)) ; + // check norm (A*x-b), x and b dense + resid = dense_resid (A, anorm, Xdense, nb, B, cc) ; + maxresid [m>n][wh] = MAX (maxresid [m>n][wh], resid) ; + printf ("Resid9_%d %d %d %d : %g (%d) tol %g\n", + split, m>n, (int) ntol, ordering, resid, wh, tol) ; + spqr_free_dense (&Xdense, cc) ; + spqr_free_dense (&Ydense, cc) ; + + // ------------------------------------------------------------- + // error testing + // ------------------------------------------------------------- + + if (ordering == 0 && /* ntol == 0 */ tol == SPQR_DEFAULT_TOL) + { + printf ("Error handling ... expect 3 error messages: \n") ; + err = (SuiteSparseQR_qmult (-1, QR, Bdense, cc) + != NULL) ; + spqr_free_dense (&Bdense, cc) ; + Bdense = spqr_zeros (m+1, 1, xtype, cc) ; + err += (SuiteSparseQR_qmult (SPQR_QX,QR,Bdense,cc) + != NULL); + spqr_free_dense (&Bdense, cc) ; + Bdense = spqr_zeros (1, m+1, xtype, cc) ; + err += (SuiteSparseQR_qmult (SPQR_XQ,QR,Bdense,cc) + != NULL); + if (QR->n1cols > 0) + { + // this will fail; cannot refactorize with singletons + printf ("Error handling ... expect error message:\n") ; + err += (SuiteSparseQR_numeric + (tol, A, QR, cc) != FALSE) ; + } + printf ("order %d : error handling Err15: %g\n", + ordering, err) ; + maxerr = MAX (maxerr, err) ; + printf (" ... error handling done\n\n") ; + } + + spqr_free_dense (&Bdense, cc) ; + + // ------------------------------------------------------------- + + // solve A'x=b + nb = 5 ; + Bdense = spqr_zeros (n, nb, xtype, cc) ; + B = (Entry *) Bdense->x ; + for (k = 0 ; k < n*nb ; k++) + { + B [k] = erand (range) ; + } + // Y = R'\(E'*B) + Ydense = SPQR_solve (SPQR_RTX_EQUALS_ETB, QR, + Bdense, cc, m < 300, nrand (2)) ; + // X = Q*Y + Xdense = SPQR_qmult (SPQR_QX, QR, Ydense, cc, + m < 300, nrand (2)) ; + // check norm (A'*x-b), x and b dense + resid = dense_resid (AT, anorm, Xdense, nb, B, cc) ; + maxresid [m (&Xdense, cc) ; + spqr_free_dense (&Ydense, cc) ; + + // ------------------------------------------------------------- + // error testing + // ------------------------------------------------------------- + + if (!split && ordering == 0 && /* ntol == 0 */ + tol == SPQR_DEFAULT_TOL) + { + printf ("Error testing ... expect 3 error messages:\n") ; + err = (SuiteSparseQR_solve (-1, QR, Bdense, cc) + != NULL) ; + spqr_free_dense (&Bdense, cc) ; + err += (SuiteSparseQR_solve + (SPQR_RTX_EQUALS_ETB, QR, Bdense, cc) != NULL) ; + Bdense = spqr_zeros (n+1, 1, xtype, cc) ; + err += (SuiteSparseQR_solve (SPQR_RTX_EQUALS_ETB, + QR, Bdense, cc) != NULL) ; + printf ("order %d : error handling Err16: %g\n", + ordering, err) ; + maxerr = MAX (maxerr, err) ; + printf (" ... error handling done\n\n") ; + } + + SuiteSparseQR_free (&QR, cc) ; + spqr_free_dense (&Bdense, cc) ; + } + + // ----------------------------------------------------------------- + // QR = qr (A'), then solve + // ----------------------------------------------------------------- + + // use qmult to solve min-2-norm problem + QR = SuiteSparseQR_factorize (ordering, tol, AT, cc) ; + + nb = 5 ; + Bdense = spqr_zeros (m, nb, xtype, cc) ; + B = (Entry *) Bdense->x ; + for (k = 0 ; k < m*nb ; k++) + { + B [k] = erand (range) ; + } + + // solve X = R'\B + Xdense = SPQR_solve (SPQR_RTX_EQUALS_B, QR, Bdense, cc, + m < 300, nrand (2)) ; + spqr_free_dense (&Xdense, cc) ; + + // solve X = R'\(E'*B) + Xdense = SPQR_solve (SPQR_RTX_EQUALS_ETB, QR, Bdense, + cc, m < 300, nrand (2)) ; + + // Y = Q*X + Ydense = SPQR_qmult (SPQR_QX, QR, Xdense, cc, + m < 300, nrand (2)) ; + + // check norm (A*y-b), y and b dense + resid = dense_resid (A, anorm, Ydense, nb, B, cc) ; + maxresid [m>n][which] = MAX (maxresid [m>n][which], resid) ; + printf ("ResidB %d %d %d : %g\n", m>n, (int) ntol, + ordering, resid) ; + spqr_free_dense (&Ydense, cc) ; + + // Y = (X'*Q')' + XT = transpose (Xdense, cc) ; + Zdense = SPQR_qmult (SPQR_XQT, QR, XT, cc, + m < 300, nrand (2)) ; + Ydense = transpose (Zdense, cc) ; + spqr_free_dense (&XT, cc) ; + spqr_free_dense (&Zdense, cc) ; + + // check norm (A*y-b), y and b dense + resid = dense_resid (A, anorm, Ydense, nb, B, cc) ; + maxresid [m>n][which] = MAX (maxresid [m>n][which], resid) ; + printf ("ResidC %d %d %d : %g\n", m>n, (int) ntol, + ordering, resid) ; + spqr_free_dense (&Ydense, cc) ; + spqr_free_dense (&Xdense, cc) ; + + // ----------------------------------------------------------------- + // min 2-norm solution using min2norm + // ----------------------------------------------------------------- + + Xdense = SPQR_min2norm (ordering, tol, A, Bdense, cc, + m < 300, nrand (2)) ; + + // check norm (A*x-b), y and b dense + resid = dense_resid (A, anorm, Xdense, nb, B, cc) ; + maxresid [m>n][which] = MAX (maxresid [m>n][which], resid) ; + printf ("ResidD %d %d %d : %g\n", m>n, (int) ntol, + ordering, resid) ; + spqr_free_dense (&Xdense, cc) ; + + spqr_free_dense (&Bdense, cc) ; + + // ----------------------------------------------------------------- + // sparse case + // ----------------------------------------------------------------- + + nb = 5 ; + Bdense = spqr_zeros (m, nb, xtype, cc) ; + B = (Entry *) Bdense->x ; + for (k = 0 ; k < m*nb ; k++) + { + B [k] = ((double) (my_rand ( ) % 2)) * erand (range) ; + } + Bsparse = spqr_dense_to_sparse (Bdense, TRUE, cc) ; + spqr_free_dense (&Bdense, cc) ; + + // solve X = R'\(E'*B) + Xsparse = NULL ; + Xsparse = SPQR_solve (SPQR_RTX_EQUALS_ETB, QR, + Bsparse, cc, m < 300, nrand (2)) ; + + // Y = Q*X + Ysparse = NULL ; + Ysparse = SPQR_qmult (SPQR_QX, QR, Xsparse, cc, + m < 300, nrand (2)) ; + + // check norm (A*y-b), y and b sparse + resid = sparse_resid (A, anorm, Ysparse, Bsparse, cc) ; + maxresid [m>n][which] = MAX (maxresid [m>n][which], resid) ; + printf ("ResidE %d %d %d : %g\n", m>n, (int) ntol, + ordering, resid) ; + + spqr_free_sparse (&Xsparse, cc) ; + spqr_free_sparse (&Ysparse, cc) ; + + Xsparse = SPQR_min2norm (ordering, tol, A, Bsparse, cc, + m < 300, nrand (2)) ; + + // check norm (A*x-b), x and b sparse + resid = sparse_resid (A, anorm, Xsparse, Bsparse, cc) ; + maxresid [m>n][which] = MAX (maxresid [m>n][which], resid) ; + printf ("ResidF %d %d %d : %g\n", m>n, (int) ntol, + ordering, resid) ; + + spqr_free_sparse (&Xsparse, cc) ; + spqr_free_sparse (&Bsparse, cc) ; + + SuiteSparseQR_free (&QR, cc) ; +#endif + } + } + + // ------------------------------------------------------------------------- + // check error handling + // ------------------------------------------------------------------------- + + printf ("Check error handling, one error message is expected:\n") ; + cholmod_dense *Bgunk = spqr_ones (m+1, 1, xtype, cc) ; + rank = SuiteSparseQR ( + 0, 0, econ, -1, A, + NULL, Bgunk, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + cc) ; + spqr_free_dense (&Bgunk, cc) ; + err = (rank != EMPTY) ; + maxerr = MAX (maxerr, err) ; // rank should be EMPTY + printf (" ... error handling done\n\n") ; + + // ------------------------------------------------------------------------- + // test non-user callable functions + // ------------------------------------------------------------------------- + + // attempt to permute A to upper triangular form + Int *Qtrap ; + rank = spqr_trapezoidal (n, Ap, Ai, Ax, 0, NULL, FALSE, &Cp, &Ci, &Cx, + &Qtrap, cc) ; + printf ("Rank of A, if A*P permutable to upper trapezoidal: %d\n", + (int) rank) ; + if (Cp != NULL) + { + nz = Cp [n] ; + spqr_free (n+1, sizeof (Int), Cp, cc) ; + spqr_free (nz, sizeof (Int), Ci, cc) ; + spqr_free (nz, sizeof (Entry), Cx, cc) ; + spqr_free (n, sizeof (Int), Qtrap, cc) ; + } + spqr_free_sparse (&AT, cc) ; + + // ------------------------------------------------------------------------- + // test the C API + // ------------------------------------------------------------------------- + + qrtest_C (A, anorm, errs, maxresid, cc) ; + + // ------------------------------------------------------------------------- + // final results + // ------------------------------------------------------------------------- + + errs [0] = CHECK_NAN (maxerr) ; + errs [1] = CHECK_NAN (maxresid [0][0]) ; + errs [2] = CHECK_NAN (maxresid [0][1]) ; + errs [3] = CHECK_NAN (maxresid [1][0]) ; + errs [4] = CHECK_NAN (maxresid [1][1]) ; +} + +// ============================================================================= +// === do_matrix2 ============================================================== +// ============================================================================= + +// Read in a matrix, and use it to test SuiteSparseQR +// If kind == 0, then the first two residuals should be low. + +template +int do_matrix2 (int kind, cholmod_sparse *A, cholmod_common *cc) +{ + double errs [5] = {0,0,0,0,0} ; + Int m = A->nrow ; + Int n = A->ncol ; + + // ------------------------------------------------------------------------- + // use it to test SuiteSparseQR + // ------------------------------------------------------------------------- + + if (A->xtype == CHOLMOD_COMPLEX && A->stype == 0) + { + qrtest (A, errs, cc) ; + } + else if (A->xtype == CHOLMOD_REAL) + { + if (A->stype != 0) + { + cholmod_sparse *A1 ; + A1 = spqr_copy (A, 0, 1, cc) ; + qrtest (A1, errs, cc) ; + spqr_free_sparse (&A1, cc) ; + } + else + { + qrtest (A, errs, cc) ; + } + } + else + { + // cannot handle ZOMPLEX, PATTERN, or symmetric/Hermitian COMPLEX + fprintf (stderr, "invalid matrix\n") ; + errs [0] = 1 ; + } + + // ------------------------------------------------------------------------- + // report the results + // ------------------------------------------------------------------------- + + if (kind == 0) + { + printf ("First Resid and ") ; + } + printf ("Err should be low:\n") ; + printf ("RESULT: Err %8.1e Resid %8.1e %8.1e", errs [0], + errs [1], errs [2]) ; + if (m == n) + { + printf (" ") ; + } + else + { + printf (" %8.1e %8.1e", errs [3], errs [4]) ; + } + + if (errs [0] > 1e-10) + { + printf (" : FAIL\n") ; + fprintf (stderr, "Error: %g FAIL\n", errs [0]) ; + return (1) ; + } + + // if kind == 0, then this full-rank matrix should have low residual + if (kind == 0 && (errs [1] > 1e-10)) + { + printf (" : FAIL\n") ; + fprintf (stderr, "error: %g FAIL\n", errs [1]) ; + return (1) ; + } + + printf (" : OK.") ; + fprintf (stderr, "OK.") ; + return (0) ; +} + +// ============================================================================= +// === do_matrix =============================================================== +// ============================================================================= + +// Read in a matrix, and use it to test SuiteSparseQR +// If kind == 0, then the first two residuals should be low. + +template +int do_matrix (int kind, FILE *file, cholmod_common *cc) +{ + cholmod_sparse *A ; + + int nfail0 = 0 ; + int nfail1 = 0 ; + int nfail2 = 0 ; + int nfail3 = 0 ; + + // ------------------------------------------------------------------------- + // read in the matrix + // ------------------------------------------------------------------------- + + A = spqr_read_sparse (file, cc) ; + if (A == NULL) + { + fprintf (stderr, "Unable to read matrix\n") ; + return (1) ; + } + Int m = A->nrow ; + Int n = A->ncol ; + fprintf (stderr, "%5d by %5d : ", (int) m, (int) n) ; + if (sizeof (int64_t) > sizeof (int) && (m > 10000 || n > 10000)) + { + fprintf (stderr, "(test skipped on 64-bit systems)\n") ; + spqr_free_sparse (&A, cc) ; + return (0) ; + } + + // defaults + cc->SPQR_grain = 1 ; // no parallel analysis + printf ("\nBeginning CPU tests [\n") ; + fprintf (stderr, " CPU ") ; + nfail0 = do_matrix2 (kind, A, cc) ; + + // non-defaults (will not use the GPU) + cc->SPQR_grain = 4 ; // grain size relative to total work + nfail2 = do_matrix2 (kind, A, cc) ; + cc->SPQR_grain = 1 ; // no parallel analysis + printf ("\nCPU tests done ]\n") ; + + // test the GPU, if installed + #ifdef SUITESPARSE_CUDA + cc->useGPU = TRUE ; + // was 3.5 * ((size_t) 1024 * 1024 * 1024) ; + size_t totmem, availmem ; + double t = SuiteSparse_time ( ) ; + spqr_gpu_memorysize (&totmem, &availmem, cc) ; + t = SuiteSparse_time ( ) - t ; + cc->gpuMemorySize = availmem ; + printf ("\nBeginning GPU tests, GPU memory %g MB warmup time %g[\n", + (double) (cc->gpuMemorySize) / (1024*1024), t) ; + fprintf (stderr, " GPU ") ; + nfail1 = do_matrix2 (kind, A, cc) ; + printf ("\nGPU tests done ]\n") ; + if (m > 200) + { + // try with a tiny GPU memory size, but only for a few matrices + // in the test set. Each front will go in its own stage. + printf ("\nBeginning GPU tests with tiny GPU memory [\n") ; + cc->gpuMemorySize = 0 ; + nfail3 = do_matrix2 (kind, A, cc) ; + // restore defaults + cc->useGPU = FALSE ; + printf ("\nGPU tests done (tiny memory) ]\n") ; + } + #endif + + spqr_free_sparse (&A, cc) ; + + printf ("\n") ; + fprintf (stderr, "\n") ; + return (nfail0 + nfail1 + nfail2 + nfail3) ; +} + diff --git a/SPQR/Tcov/qrtestc.c b/SPQR/Tcov/qrtestc.c index 33377bcdb..7e1a95bfd 100644 --- a/SPQR/Tcov/qrtestc.c +++ b/SPQR/Tcov/qrtestc.c @@ -13,6 +13,28 @@ #define MAX(a,b) (((a) > (b)) ? (a) : (b)) +//------------------------------------------------------------------------------ +// qrtest_c64: int64_t version +//------------------------------------------------------------------------------ + +#define DLONG +#define QRTESTC qrtest_c64 +#include "qrtestc_template.c" +#undef DLONG +#undef QRTESTC + +//------------------------------------------------------------------------------ +// qrtest_c32: int32_t version +//------------------------------------------------------------------------------ + +#define DINT +#define QRTESTC qrtest_c32 +#include "qrtestc_template.c" + +//------------------------------------------------------------------------------ +// qrtest_C: handles both int32_t and int64_t versions (both double, not float) +//------------------------------------------------------------------------------ + void qrtest_C ( cholmod_sparse *A, @@ -22,96 +44,13 @@ void qrtest_C cholmod_common *cc ) { - cholmod_dense *B, *X, *Resid ; - cholmod_sparse *Bsparse, *Xsparse ; - SuiteSparseQR_C_factorization *QR ; - double resid, one [2] = {1,0}, minusone [2] = {-1,0} ; - int64_t m, n ; -#ifndef NEXPERT - cholmod_dense *Y ; - int split ; -#endif - - m = A->nrow ; - n = A->ncol ; - - B = cholmod_l_ones (m, 1, A->xtype, cc) ; - - /* X = A\B */ - X = SuiteSparseQR_C_backslash_default (A, B, cc) ; - - /* Resid = A*X - B */ - Resid = cholmod_l_copy_dense (B, cc) ; - cholmod_l_sdmult (A, 0, one, minusone, X, Resid, cc) ; - - /* resid = norm (Resid,1) */ - resid = cholmod_l_norm_dense (Resid, 1, cc) / MAX (anorm, 1) ; - resid = (resid < 0 || resid != resid) ? 9e99 : resid ; - cholmod_l_free_dense (&Resid, cc) ; - cholmod_l_free_dense (&X, cc) ; - - maxresid [m>n][0] = MAX (maxresid [m>n][0], resid) ; - printf ("Resid_C1 %d : %g\n", m>n, resid) ; - - /* X = A\B */ - Bsparse = cholmod_l_dense_to_sparse (B, 1, cc) ; - Xsparse = SuiteSparseQR_C_backslash_sparse (2, -2, A, Bsparse, cc) ; - X = cholmod_l_sparse_to_dense (Xsparse, cc) ; - cholmod_l_free_sparse (&Bsparse, cc) ; - cholmod_l_free_sparse (&Xsparse, cc) ; - - /* Resid = A*X - B */ - Resid = cholmod_l_copy_dense (B, cc) ; - cholmod_l_sdmult (A, 0, one, minusone, X, Resid, cc) ; - - /* resid = norm (Resid,1) */ - resid = cholmod_l_norm_dense (Resid, 1, cc) / MAX (anorm, 1) ; - resid = (resid < 0 || resid != resid) ? 9e99 : resid ; - cholmod_l_free_dense (&Resid, cc) ; - cholmod_l_free_dense (&X, cc) ; - - maxresid [m>n][0] = MAX (maxresid [m>n][0], resid) ; - printf ("Resid_C2 %d : %g\n", m>n, resid) ; - -#ifndef NEXPERT - - for (split = 0 ; split <= 1 ; split++) + if (A->itype == CHOLMOD_INT) { - if (split) - { - /* split symbolic/numeric QR factorization */ - QR = SuiteSparseQR_C_symbolic (2, 1, A, cc) ; - SuiteSparseQR_C_numeric (-2, A, QR, cc) ; - } - else - { - /* QR factorization, single pass */ - QR = SuiteSparseQR_C_factorize (2, -2, A, cc) ; - } - - /* Y = Q'*B */ - Y = SuiteSparseQR_C_qmult (0, QR, B, cc) ; - - /* X = E*(R\Y) */ - X = SuiteSparseQR_C_solve (1, QR, Y, cc) ; - - /* Resid = A*X - B */ - Resid = cholmod_l_copy_dense (B, cc) ; - cholmod_l_sdmult (A, 0, one, minusone, X, Resid, cc) ; - - /* resid = norm (Resid,1) */ - resid = cholmod_l_norm_dense (Resid, 1, cc) / MAX (anorm, 1) ; - resid = (resid < 0 || resid != resid) ? 9e99 : resid ; - cholmod_l_free_dense (&Resid, cc) ; - cholmod_l_free_dense (&X, cc) ; - - maxresid [m>n][0] = MAX (maxresid [m>n][0], resid) ; - printf ("Resid_C3 %d : %g\n", m>n, resid) ; - - cholmod_l_free_dense (&Y, cc) ; - SuiteSparseQR_C_free (&QR, cc) ; + qrtest_c32 (A, anorm, errs, maxresid, cc) ; + } + else + { + qrtest_c64 (A, anorm, errs, maxresid, cc) ; } -#endif - - cholmod_l_free_dense (&B, cc) ; } + diff --git a/SPQR/Tcov/qrtestc_template.c b/SPQR/Tcov/qrtestc_template.c new file mode 100644 index 000000000..b88d12bce --- /dev/null +++ b/SPQR/Tcov/qrtestc_template.c @@ -0,0 +1,127 @@ +/* ========================================================================== */ +/* === qrtestc_template ===================================================== */ +/* ========================================================================== */ + +// SPQR, Copyright (c) 2008-2023, Timothy A Davis. All Rights Reserved. +// SPDX-License-Identifier: GPL-2.0+ + +//------------------------------------------------------------------------------ +// QRTESTC: test the SPQR C API +//------------------------------------------------------------------------------ + +// The #include'ing file must define the following macros: +// QRTEST: the name of the function + +// and one of: +// SINT: float (and float complex), int32 +// SLONG: float (and float complex), int64 +// DINT: double (and double complex), int32 +// DLONG: double (and double complex), int64 + +// the SINT and SLONG cases are not yet used. + +#include "cholmod_types.h" + +static void QRTESTC +( + cholmod_sparse *A, + Real anorm, + Real errs [5], + Real maxresid [2][2], + cholmod_common *cc +) +{ + cholmod_dense *B, *X, *Resid ; + cholmod_sparse *Bsparse, *Xsparse ; + SuiteSparseQR_C_factorization *QR ; + Real resid, one [2] = {1,0}, minusone [2] = {-1,0} ; + Int m, n ; +#ifndef NEXPERT + cholmod_dense *Y ; + int split ; +#endif + + m = A->nrow ; + n = A->ncol ; + + B = CHOLMOD (ones (m, 1, A->xtype, cc)) ; + + /* X = A\B */ + X = SuiteSparseQR_C_backslash_default (A, B, cc) ; + + /* Resid = A*X - B */ + Resid = CHOLMOD (copy_dense (B, cc)) ; + CHOLMOD (sdmult (A, 0, one, minusone, X, Resid, cc)) ; + + /* resid = norm (Resid,1) */ + resid = CHOLMOD (norm_dense (Resid, 1, cc)) / MAX (anorm, 1) ; + resid = (resid < 0 || resid != resid) ? 9e99 : resid ; + CHOLMOD (free_dense (&Resid, cc)) ; + CHOLMOD (free_dense (&X, cc)) ; + + maxresid [m>n][0] = MAX (maxresid [m>n][0], resid) ; + printf ("Resid_C1 %d : %g\n", m>n, resid) ; + + /* X = A\B */ + Bsparse = CHOLMOD (dense_to_sparse (B, 1, cc)) ; + Xsparse = SuiteSparseQR_C_backslash_sparse (2, -2, A, Bsparse, cc) ; + X = CHOLMOD (sparse_to_dense (Xsparse, cc)) ; + CHOLMOD (free_sparse (&Bsparse, cc)) ; + CHOLMOD (free_sparse (&Xsparse, cc)) ; + + /* Resid = A*X - B */ + Resid = CHOLMOD (copy_dense (B, cc)) ; + CHOLMOD (sdmult (A, 0, one, minusone, X, Resid, cc)) ; + + /* resid = norm (Resid,1) */ + resid = CHOLMOD (norm_dense (Resid, 1, cc)) / MAX (anorm, 1) ; + resid = (resid < 0 || resid != resid) ? 9e99 : resid ; + CHOLMOD (free_dense (&Resid, cc)) ; + CHOLMOD (free_dense (&X, cc)) ; + + maxresid [m>n][0] = MAX (maxresid [m>n][0], resid) ; + printf ("Resid_C2 %d : %g\n", m>n, resid) ; + +#ifndef NEXPERT + + for (split = 0 ; split <= 1 ; split++) + { + if (split) + { + /* split symbolic/numeric QR factorization */ + QR = SuiteSparseQR_C_symbolic (2, 1, A, cc) ; + SuiteSparseQR_C_numeric (-2, A, QR, cc) ; + } + else + { + /* QR factorization, single pass */ + QR = SuiteSparseQR_C_factorize (2, -2, A, cc) ; + } + + /* Y = Q'*B */ + Y = SuiteSparseQR_C_qmult (0, QR, B, cc) ; + + /* X = E*(R\Y) */ + X = SuiteSparseQR_C_solve (1, QR, Y, cc) ; + + /* Resid = A*X - B */ + Resid = CHOLMOD (copy_dense (B, cc)) ; + CHOLMOD (sdmult (A, 0, one, minusone, X, Resid, cc)) ; + + /* resid = norm (Resid,1) */ + resid = CHOLMOD (norm_dense (Resid, 1, cc)) / MAX (anorm, 1) ; + resid = (resid < 0 || resid != resid) ? 9e99 : resid ; + CHOLMOD (free_dense (&Resid, cc)) ; + CHOLMOD (free_dense (&X, cc)) ; + + maxresid [m>n][0] = MAX (maxresid [m>n][0], resid) ; + printf ("Resid_C3 %d : %g\n", m>n, resid) ; + + CHOLMOD (free_dense (&Y, cc)) ; + SuiteSparseQR_C_free (&QR, cc) ; + } +#endif + + CHOLMOD (free_dense (&B, cc)) ; +} + diff --git a/SPQR/cmake_modules/FindSPQR.cmake b/SPQR/cmake_modules/FindSPQR.cmake deleted file mode 100644 index 9d4e1bf2c..000000000 --- a/SPQR/cmake_modules/FindSPQR.cmake +++ /dev/null @@ -1,129 +0,0 @@ -#------------------------------------------------------------------------------- -# SuiteSparse/SPQR/cmake_modules/FindSPQR.cmake -#------------------------------------------------------------------------------- - -# The following copyright and license applies to just this file only, not to -# the library itself: -# FindSPQR.cmake, Copyright (c) 2022-2023, Timothy A. Davis. All Rights Reserved. -# SPDX-License-Identifier: BSD-3-clause - -#------------------------------------------------------------------------------- - -# Finds the SPQR include file and compiled library and sets: - -# SPQR_INCLUDE_DIR - where to find SuiteSparseQR.hpp and other headers -# SPQR_LIBRARY - dynamic SPQR library -# SPQR_STATIC - static SPQR library -# SPQR_LIBRARIES - libraries when using SPQR -# SPQR_FOUND - true if SPQR found - -# set ``SPQR_ROOT`` to a SPQR installation root to -# tell this module where to look. - -# All the Find*.cmake files in SuiteSparse are installed by 'make install' into -# /usr/local/lib/cmake/SuiteSparse (where '/usr/local' is the -# ${CMAKE_INSTALL_PREFIX}). To access this file, place the following commands -# in your CMakeLists.txt file. See also SuiteSparse/Example/CMakeLists.txt: -# -# set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} -# ${CMAKE_INSTALL_PREFIX}/lib/cmake/SuiteSparse ) - -#------------------------------------------------------------------------------- - -# include files for SPQR -find_path ( SPQR_INCLUDE_DIR - NAMES SuiteSparseQR.hpp - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/SPQR - HINTS ${CMAKE_SOURCE_DIR}/../SPQR - PATH_SUFFIXES include Include -) - -# dynamic SPQR library (or static if no dynamic library was built) -find_library ( SPQR_LIBRARY - NAMES spqr spqr_static - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/SPQR - HINTS ${CMAKE_SOURCE_DIR}/../SPQR - PATH_SUFFIXES lib build build/Release build/Debug -) - -if ( MSVC ) - set ( STATIC_NAME spqr_static spqr ) -else ( ) - set ( STATIC_NAME spqr ) - set ( save ${CMAKE_FIND_LIBRARY_SUFFIXES} ) - set ( CMAKE_FIND_LIBRARY_SUFFIXES - ${CMAKE_STATIC_LIBRARY_SUFFIX} ${CMAKE_FIND_LIBRARY_SUFFIXES} ) -endif ( ) - -# static SPQR library -find_library ( SPQR_STATIC - NAMES ${STATIC_NAME} - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/SPQR - HINTS ${CMAKE_SOURCE_DIR}/../SPQR - PATH_SUFFIXES lib build build/Release build/Debug -) - -if ( NOT MSVC ) - # restore the CMAKE_FIND_LIBRARY_SUFFIXES variable - set ( CMAKE_FIND_LIBRARY_SUFFIXES ${save} ) -endif ( ) - -# get version of the library from the dynamic library name -get_filename_component ( SPQR_LIBRARY ${SPQR_LIBRARY} REALPATH ) -get_filename_component ( SPQR_FILENAME ${SPQR_LIBRARY} NAME ) -string ( - REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" - SPQR_VERSION - ${SPQR_FILENAME} -) - -# set ( SPQR_VERSION "" ) -if ( EXISTS "${SPQR_INCLUDE_DIR}" AND NOT SPQR_VERSION ) - # if the version does not appear in the filename, read the include file - file ( STRINGS ${SPQR_INCLUDE_DIR}/SuiteSparseQR_definitions.h SPQR_MAJOR_STR - REGEX "define SPQR_MAIN_VERSION" ) - file ( STRINGS ${SPQR_INCLUDE_DIR}/SuiteSparseQR_definitions.h SPQR_MINOR_STR - REGEX "define SPQR_SUB_VERSION" ) - file ( STRINGS ${SPQR_INCLUDE_DIR}/SuiteSparseQR_definitions.h SPQR_PATCH_STR - REGEX "define SPQR_SUBSUB_VERSION" ) - message ( STATUS "major: ${SPQR_MAJOR_STR}" ) - message ( STATUS "minor: ${SPQR_MINOR_STR}" ) - message ( STATUS "patch: ${SPQR_PATCH_STR}" ) - string ( REGEX MATCH "[0-9]+" SPQR_MAJOR ${SPQR_MAJOR_STR} ) - string ( REGEX MATCH "[0-9]+" SPQR_MINOR ${SPQR_MINOR_STR} ) - string ( REGEX MATCH "[0-9]+" SPQR_PATCH ${SPQR_PATCH_STR} ) - set (SPQR_VERSION "${SPQR_MAJOR}.${SPQR_MINOR}.${SPQR_PATCH}") -endif ( ) - -set ( SPQR_LIBRARIES ${SPQR_LIBRARY} ) - -include (FindPackageHandleStandardArgs) - -find_package_handle_standard_args ( SPQR - REQUIRED_VARS SPQR_LIBRARY SPQR_INCLUDE_DIR - VERSION_VAR SPQR_VERSION -) - -mark_as_advanced ( - SPQR_INCLUDE_DIR - SPQR_LIBRARY - SPQR_STATIC - SPQR_LIBRARIES -) - -if ( SPQR_FOUND ) - message ( STATUS "SPQR version: ${SPQR_VERSION}" ) - message ( STATUS "SPQR include: ${SPQR_INCLUDE_DIR}" ) - message ( STATUS "SPQR library: ${SPQR_LIBRARY}" ) - message ( STATUS "SPQR static: ${SPQR_STATIC}" ) -else ( ) - message ( STATUS "SPQR not found" ) - set ( SPQR_INCLUDE_DIR "" ) - set ( SPQR_LIBRARIES "" ) - set ( SPQR_LIBRARY "" ) - set ( SPQR_STATIC "" ) -endif ( ) - diff --git a/SPQR/cmake_modules/FindSPQR_CUDA.cmake b/SPQR/cmake_modules/FindSPQR_CUDA.cmake deleted file mode 100644 index 328b7c9a1..000000000 --- a/SPQR/cmake_modules/FindSPQR_CUDA.cmake +++ /dev/null @@ -1,106 +0,0 @@ -#------------------------------------------------------------------------------- -# SuiteSparse/SPQR/cmake_modules/FindSPQR_CUDA.cmake -#------------------------------------------------------------------------------- - -# The following copyright and license applies to just this file only, not to -# the library itself: -# FindSPQR_CUDA.cmake, Copyright (c) 2022-2023, Timothy A. Davis. All Rights Reserved. -# SPDX-License-Identifier: BSD-3-clause - -#------------------------------------------------------------------------------- - -# Finds the SPQR_CUDA compiled library and sets: - -# SPQR_CUDA_LIBRARIES - libraries when using SPQR_CUDA -# SPQR_CUDA_LIBRARY - dynamic SPQR_CUDA library -# SPQR_CUDA_STATIC - static SPQR_CUDA library -# SPQR_CUDA_FOUND - true if SPQR_CUDA found - -# set ``SPQR_CUDA_ROOT`` to a SPQR_CUDA installation root to -# tell this module where to look. - -# All the Find*.cmake files in SuiteSparse are installed by 'make install' into -# /usr/local/lib/cmake/SuiteSparse (where '/usr/local' is the -# ${CMAKE_INSTALL_PREFIX}). To access this file, place the following commands -# in your CMakeLists.txt file. See also SuiteSparse/Example/CMakeLists.txt: -# -# set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} -# ${CMAKE_INSTALL_PREFIX}/lib/cmake/SuiteSparse ) - -#------------------------------------------------------------------------------- - -# dynamic SPQR_CUDA library (or static if no dynamic library was built) -find_library ( SPQR_CUDA_LIBRARY - NAMES spqr_cuda spqr_cuda_static - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse - HINTS ${CMAKE_SOURCE_DIR}/../SPQR/ - HINTS ${CMAKE_SOURCE_DIR}/../SPQR/build/SPQRGPU - PATH_SUFFIXES lib build build/Release build/Debug -) - -if ( MSVC ) - set ( STATIC_NAME spqr_cuda_static spqr_cuda ) -else ( ) - set ( STATIC_NAME spqr_cuda ) - set ( save ${CMAKE_FIND_LIBRARY_SUFFIXES} ) - set ( CMAKE_FIND_LIBRARY_SUFFIXES - ${CMAKE_STATIC_LIBRARY_SUFFIX} ${CMAKE_FIND_LIBRARY_SUFFIXES} ) -endif ( ) - -# static SPQR_CUDA library -find_library ( SPQR_CUDA_STATIC - NAMES ${STATIC_NAME} - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse - HINTS ${CMAKE_SOURCE_DIR}/../SPQR/ - HINTS ${CMAKE_SOURCE_DIR}/../SPQR/build/SPQRGPU - PATH_SUFFIXES lib build build/Release build/Debug -) - -if ( NOT MSVC ) - # restore the CMAKE_FIND_LIBRARY_SUFFIXES variable - set ( CMAKE_FIND_LIBRARY_SUFFIXES ${save} ) -endif ( ) - -# get version of the library from the dynamic library name -get_filename_component ( SPQR_CUDA_LIBRARY ${SPQR_CUDA_LIBRARY} REALPATH ) -get_filename_component ( SPQR_CUDA_FILENAME ${SPQR_CUDA_LIBRARY} NAME ) -string ( - REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" - SPQR_CUDA_VERSION - ${SPQR_CUDA_FILENAME} -) - -if ( NOT SPQR_CUDA_VERSION ) - # get version of the library from SPQR - find_package ( SPQR ) - set ( SPQR_CUDA_VERSION "${SPQR_VERSION}" ) -endif ( ) - -set ( SPQR_CUDA_LIBRARIES ${SPQR_CUDA_LIBRARY} ) - -include (FindPackageHandleStandardArgs) - -find_package_handle_standard_args ( SPQR_CUDA - REQUIRED_VARS SPQR_CUDA_LIBRARY - VERSION_VAR SPQR_CUDA_VERSION -) - -mark_as_advanced ( - SPQR_CUDA_LIBRARY - SPQR_CUDA_STATIC - SPQR_CUDA_LIBRARIES -) - -if ( SPQR_CUDA_FOUND ) - message ( STATUS "SPQR_CUDA version: ${SPQR_CUDA_VERSION}" ) - message ( STATUS "SPQR_CUDA library: ${SPQR_CUDA_LIBRARY}" ) - message ( STATUS "SPQR_CUDA static: ${SPQR_CUDA_STATIC}" ) -else ( ) - message ( STATUS "SPQR_CUDA not found" ) - set ( SPQR_CUDA_LIBRARIES "" ) - set ( SPQR_CUDA_LIBRARY "" ) - set ( SPQR_CUDA_STATIC "" ) -endif ( ) - diff --git a/SuiteSparse_GPURuntime/CMakeLists.txt b/SuiteSparse_GPURuntime/CMakeLists.txt index 7d3a99803..5e6e55c4c 100644 --- a/SuiteSparse_GPURuntime/CMakeLists.txt +++ b/SuiteSparse_GPURuntime/CMakeLists.txt @@ -10,12 +10,12 @@ # get the version #------------------------------------------------------------------------------- -cmake_minimum_required ( VERSION 3.19 ) +cmake_minimum_required ( VERSION 3.20 ) -set ( SUITESPARSE_GPURUNTIME_DATE "June 16, 2023" ) -set ( SUITESPARSE_GPURUNTIME_VERSION_MAJOR 2 ) -set ( SUITESPARSE_GPURUNTIME_VERSION_MINOR 0 ) -set ( SUITESPARSE_GPURUNTIME_VERSION_SUB 4 ) +set ( SUITESPARSE_GPURUNTIME_DATE "Sept 8, 2023" ) +set ( SUITESPARSE_GPURUNTIME_VERSION_MAJOR 3 ) +set ( SUITESPARSE_GPURUNTIME_VERSION_MINOR 2 ) +set ( SUITESPARSE_GPURUNTIME_VERSION_SUB 0 ) message ( STATUS "Building SUITESPARSE_GPURUNTIME version: v" ${SUITESPARSE_GPURUNTIME_VERSION_MAJOR}. @@ -27,7 +27,6 @@ message ( STATUS "Building SUITESPARSE_GPURUNTIME version: v" #------------------------------------------------------------------------------- set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} - ${CMAKE_SOURCE_DIR}/cmake_modules ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/cmake_modules ) option ( ENABLE_CUDA "Enable CUDA acceleration" on ) @@ -54,7 +53,11 @@ endif ( ) # find library dependencies #------------------------------------------------------------------------------- -find_package ( SuiteSparse_config 7.1.0 REQUIRED ) +find_package ( SuiteSparse_config 7.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH ) +if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) + find_package ( SuiteSparse_config 7.2.0 REQUIRED ) +endif ( ) #------------------------------------------------------------------------------- # configure files @@ -75,8 +78,7 @@ endif ( ) file ( GLOB SUITESPARSE_GPURUNTIME_SOURCES "Source/*.cpp" ) -set ( SUITESPARSE_GPURUNTIME_INCLUDES Include - ${SUITESPARSE_CONFIG_INCLUDE_DIR} ) +set ( SUITESPARSE_GPURUNTIME_INCLUDES Include ) include_directories ( ${SUITESPARSE_GPURUNTIME_INCLUDES} ${CUDAToolkit_INCLUDE_DIRS} ) @@ -84,35 +86,41 @@ include_directories ( ${SUITESPARSE_GPURUNTIME_INCLUDES} ${CUDAToolkit_INCLUDE_D # dynamic suitesparse_gpuruntime library properties #------------------------------------------------------------------------------- -add_library ( suitesparse_gpuruntime SHARED ${SUITESPARSE_GPURUNTIME_SOURCES} ) +add_library ( GPURuntime SHARED ${SUITESPARSE_GPURUNTIME_SOURCES} ) -set_target_properties ( suitesparse_gpuruntime PROPERTIES +set_target_properties ( GPURuntime PROPERTIES VERSION ${SUITESPARSE_GPURUNTIME_VERSION_MAJOR}.${SUITESPARSE_GPURUNTIME_VERSION_MINOR}.${SUITESPARSE_GPURUNTIME_VERSION_SUB} CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON + OUTPUT_NAME suitesparse_gpuruntime SOVERSION ${SUITESPARSE_GPURUNTIME_VERSION_MAJOR} PUBLIC_HEADER "Include/SuiteSparse_GPURuntime.hpp" WINDOWS_EXPORT_ALL_SYMBOLS ON ) -target_include_directories ( suitesparse_gpuruntime PUBLIC - ${CUDAToolkit_INCLUDE_DIRS} - ${SUITESPARSE_GPURUNTIME_INCLUDES} ) +target_include_directories ( GPURuntime PRIVATE + ${CUDAToolkit_INCLUDE_DIRS} + ${SUITESPARSE_GPURUNTIME_INCLUDES} + $ ) if ( SUITESPARSE_CUDA ) - set_target_properties ( suitesparse_gpuruntime PROPERTIES POSITION_INDEPENDENT_CODE ON ) - set_target_properties ( suitesparse_gpuruntime PROPERTIES CUDA_SEPARABLE_COMPILATION ON ) - target_link_libraries ( suitesparse_gpuruntime PRIVATE CUDA::nvrtc CUDA::cudart_static + set_target_properties ( GPURuntime PROPERTIES POSITION_INDEPENDENT_CODE ON ) + set_target_properties ( GPURuntime PROPERTIES CUDA_SEPARABLE_COMPILATION ON ) + target_link_libraries ( GPURuntime PRIVATE CUDA::nvrtc CUDA::cudart_static CUDA::nvToolsExt CUDA::cublas ) endif ( ) +target_include_directories ( GPURuntime + INTERFACE $ + $ ) + #------------------------------------------------------------------------------- # static suitesparse_gpuruntime library properties #------------------------------------------------------------------------------- if ( NOT NSTATIC ) - add_library ( suitesparse_gpuruntime_static STATIC ${SUITESPARSE_GPURUNTIME_SOURCES} ) + add_library ( GPURuntime_static STATIC ${SUITESPARSE_GPURUNTIME_SOURCES} ) - set_target_properties ( suitesparse_gpuruntime_static PROPERTIES + set_target_properties ( GPURuntime_static PROPERTIES VERSION ${SUITESPARSE_GPURUNTIME_VERSION_MAJOR}.${SUITESPARSE_GPURUNTIME_VERSION_MINOR}.${SUITESPARSE_GPURUNTIME_VERSION_SUB} CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON @@ -120,40 +128,99 @@ if ( NOT NSTATIC ) SOVERSION ${SUITESPARSE_GPURUNTIME_VERSION_MAJOR} ) if ( MSVC ) - set_target_properties ( suitesparse_gpuruntime_static PROPERTIES + set_target_properties ( GPURuntime_static PROPERTIES OUTPUT_NAME suitesparse_gpuruntime_static ) endif ( ) - target_include_directories ( suitesparse_gpuruntime_static PUBLIC - ${CUDAToolkit_INCLUDE_DIRS} - ${SUITESPARSE_GPURUNTIME_INCLUDES} ) + target_include_directories ( GPURuntime_static PRIVATE + ${CUDAToolkit_INCLUDE_DIRS} + ${SUITESPARSE_GPURUNTIME_INCLUDES} + $ ) if ( SUITESPARSE_CUDA ) - set_target_properties ( suitesparse_gpuruntime_static PROPERTIES CUDA_SEPARABLE_COMPILATION on ) - set_target_properties ( suitesparse_gpuruntime_static PROPERTIES POSITION_INDEPENDENT_CODE on ) - target_link_libraries ( suitesparse_gpuruntime_static PUBLIC CUDA::nvrtc CUDA::cudart_static + set_target_properties ( GPURuntime_static PROPERTIES CUDA_SEPARABLE_COMPILATION on ) + set_target_properties ( GPURuntime_static PROPERTIES POSITION_INDEPENDENT_CODE on ) + target_link_libraries ( GPURuntime_static PUBLIC CUDA::nvrtc CUDA::cudart_static CUDA::nvToolsExt CUDA::cublas ) endif ( ) + + target_include_directories ( GPURuntime_static + INTERFACE $ + $ ) + endif ( ) #------------------------------------------------------------------------------- # SuiteSparse_GPURuntime installation location #------------------------------------------------------------------------------- -install ( TARGETS suitesparse_gpuruntime +include ( CMakePackageConfigHelpers ) + +install ( TARGETS GPURuntime + EXPORT SuiteSparse_GPURuntimeTargets LIBRARY DESTINATION ${SUITESPARSE_LIBDIR} ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} RUNTIME DESTINATION ${SUITESPARSE_BINDIR} PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} ) -install ( FILES - ${CMAKE_SOURCE_DIR}/cmake_modules/FindSuiteSparse_GPURuntime.cmake - DESTINATION ${SUITESPARSE_LIBDIR}/cmake/SuiteSparse - COMPONENT Development ) if ( NOT NSTATIC ) - install ( TARGETS suitesparse_gpuruntime_static + install ( TARGETS GPURuntime_static + EXPORT SuiteSparse_GPURuntimeTargets ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} ) endif ( ) +# create (temporary) export target file during build +export ( EXPORT SuiteSparse_GPURuntimeTargets + NAMESPACE SuiteSparse:: + FILE ${CMAKE_CURRENT_BINARY_DIR}/SuiteSparse_GPURuntimeTargets.cmake ) + +# install export target, config and version files for find_package +install ( EXPORT SuiteSparse_GPURuntimeTargets + NAMESPACE SuiteSparse:: + DESTINATION ${SUITESPARSE_LIBDIR}/cmake/SuiteSparse_GPURuntime ) + +configure_package_config_file ( + Config/SuiteSparse_GPURuntimeConfig.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/SuiteSparse_GPURuntimeConfig.cmake + INSTALL_DESTINATION ${SUITESPARSE_LIBDIR}/cmake/SuiteSparse_GPURuntime ) + +write_basic_package_version_file ( + ${CMAKE_CURRENT_BINARY_DIR}/SuiteSparse_GPURuntimeConfigVersion.cmake + COMPATIBILITY SameMajorVersion ) + +install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/SuiteSparse_GPURuntimeConfig.cmake + ${CMAKE_CURRENT_BINARY_DIR}/SuiteSparse_GPURuntimeConfigVersion.cmake + DESTINATION ${SUITESPARSE_LIBDIR}/cmake/SuiteSparse_GPURuntime ) + +#------------------------------------------------------------------------------- +# create pkg-config file +#------------------------------------------------------------------------------- + +if ( NOT MSVC ) + set ( prefix "${CMAKE_INSTALL_PREFIX}" ) + set ( exec_prefix "\${prefix}" ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) + if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) + set ( libdir "${SUITESPARSE_LIBDIR}") + else ( ) + set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") + endif ( ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) + if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) + set ( includedir "${SUITESPARSE_INCLUDEDIR}") + else ( ) + set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + endif ( ) + configure_file ( + Config/SuiteSparse_GPURuntime.pc.in + SuiteSparse_GPURuntime.pc + @ONLY + NEWLINE_STYLE LF ) + install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/SuiteSparse_GPURuntime.pc + DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) +endif ( ) + #------------------------------------------------------------------------------- # report status #------------------------------------------------------------------------------- diff --git a/SuiteSparse_GPURuntime/Config/SuiteSparse_GPURuntime.pc.in b/SuiteSparse_GPURuntime/Config/SuiteSparse_GPURuntime.pc.in new file mode 100644 index 000000000..dd172b92e --- /dev/null +++ b/SuiteSparse_GPURuntime/Config/SuiteSparse_GPURuntime.pc.in @@ -0,0 +1,18 @@ +# SuiteSparse_GPURuntime, Copyright (c) 2013-2023, Timothy A. Davis. +# All Rights Reserved. +# SPDX-License-Identifier: GPL-2.0-or-later + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +# FIXME: Which flags do we need to statically link CUDA + +Name: SuiteSparse_GPURuntime +URL: https://github.com/DrTimothyAldenDavis/SuiteSparse +Description: Helper functions for the GPU in SuiteSparse +Version: @SUITESPARSE_GPURUNTIME_VERSION_MAJOR@.@SUITESPARSE_GPURUNTIME_VERSION_MINOR@.@SUITESPARSE_GPURUNTIME_VERSION_SUB@ +Requires.private: SuiteSparse_config +Libs: -L${libdir} -lsuitesparse_gpuruntime +Cflags: -I${includedir} diff --git a/SuiteSparse_GPURuntime/Config/SuiteSparse_GPURuntimeConfig.cmake.in b/SuiteSparse_GPURuntime/Config/SuiteSparse_GPURuntimeConfig.cmake.in new file mode 100644 index 000000000..fa6234140 --- /dev/null +++ b/SuiteSparse_GPURuntime/Config/SuiteSparse_GPURuntimeConfig.cmake.in @@ -0,0 +1,121 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/SuiteSparse_GPURuntime/cmake_modules/SuiteSparse_GPURuntimeConfig.cmake +#------------------------------------------------------------------------------- + +# The following copyright and license applies to just this file only, not to +# the library itself: +# SuiteSparse_GPURuntimeConfig.cmake, Copyright (c) 2023, Timothy A. Davis. All Rights Reserved. +# SPDX-License-Identifier: BSD-3-clause + +#------------------------------------------------------------------------------- + +# Finds the SuiteSparse_GPURuntime include file and compiled library. +# The following targets are defined: +# SuiteSparse::GPURuntime - for the shared library (if available) +# SuiteSparse::GPURuntime_static - for the static library (if available) + +# For backward compatibility the following variables are set: + +# SUITESPARSE_GPURUNTIME_INCLUDE_DIR - include directory for SuiteSparse_GPURuntime +# SUITESPARSE_GPURUNTIME_LIBRARY - dynamic SuiteSparse_GPURuntime library +# SUITESPARSE_GPURUNTIME_STATIC - static SuiteSparse_GPURuntime library +# SUITESPARSE_GPURUNTIME_LIBRARIES - libraries when using SuiteSparse_GPURuntime +# SUITESPARSE_GPURUNTIME_FOUND - true if SuiteSparse_GPURuntime found + +# Set ``CMAKE_MODULE_PATH`` to the parent folder where this module file is +# installed. + +#------------------------------------------------------------------------------- + +@PACKAGE_INIT@ + +set ( SUITESPARSE_GPURUNTIME_DATE "@SUITESPARSE_GPURUNTIME_DATE@" ) +set ( SUITESPARSE_GPURUNTIME_VERSION_MAJOR @SUITESPARSE_GPURUNTIME_VERSION_MAJOR@ ) +set ( SUITESPARSE_GPURUNTIME_VERSION_MINOR @SUITESPARSE_GPURUNTIME_VERSION_MINOR@ ) +set ( SUITESPARSE_GPURUNTIME_VERSION_PATCH @SUITESPARSE_GPURUNTIME_VERSION_SUB@ ) +set ( SUITESPARSE_GPURUNTIME_VERSION "@SUITESPARSE_GPURUNTIME_VERSION_MAJOR@.@SUITESPARSE_GPURUNTIME_VERSION_MINOR@.@SUITESPARSE_GPURUNTIME_VERSION_SUB@" ) + +include ( ${CMAKE_CURRENT_LIST_DIR}/SuiteSparse_GPURuntimeTargets.cmake ) + +# The following is only for backward compatibility with FindSuiteSparse_GPURuntime. + +set ( _target_shared SuiteSparse::GPURuntime ) +set ( _target_static SuiteSparse::GPURuntime_static ) +set ( _var_prefix "SUITESPARSE_GPURUNTIME" ) + +get_target_property ( ${_var_prefix}_INCLUDE_DIR ${_target_shared} INTERFACE_INCLUDE_DIRECTORIES ) +if ( ${_var_prefix}_INCLUDE_DIR ) + # First item in SuiteSparse targets contains the "main" header directory. + list ( GET ${_var_prefix}_INCLUDE_DIR 0 ${_var_prefix}_INCLUDE_DIR ) +endif ( ) +get_target_property ( ${_var_prefix}_LIBRARY ${_target_shared} IMPORTED_IMPLIB ) +if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} IMPORTED_LOCATION ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) +endif ( ) +if ( TARGET ${_target_static} ) + get_target_property ( ${_var_prefix}_STATIC ${_target_static} IMPORTED_LOCATION ) +endif ( ) + +# Check for most common build types +set ( _config_types "Debug" "Release" "RelWithDebInfo" "MinSizeRel" ) + +get_property ( _isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG ) +if ( _isMultiConfig ) + # For multi-configuration generators (e.g., Visual Studio), prefer those + # configurations. + list ( PREPEND _config_types ${CMAKE_CONFIGURATION_TYPES} ) +else ( ) + # For single-configuration generators, prefer the current configuration. + list ( PREPEND _config_types ${CMAKE_BUILD_TYPE} ) +endif ( ) + +list ( REMOVE_DUPLICATES _config_types ) + +foreach ( _config ${_config_types} ) + string ( TOUPPER ${_config} _uc_config ) + if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} + IMPORTED_IMPLIB_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) + endif ( ) + if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} + IMPORTED_LOCATION_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) + endif ( ) + if ( TARGET ${_target_static} AND NOT ${_var_prefix}_STATIC ) + get_target_property ( _library_chk ${_target_static} + IMPORTED_LOCATION_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_STATIC ${_library_chk} ) + endif ( ) + endif ( ) +endforeach ( ) + +set ( SUITESPARSE_GPURUNTIME_LIBRARIES ${SUITESPARSE_GPURUNTIME_LIBRARY} ) + +macro ( suitesparse_check_exist _var _files ) + # ignore generator expressions + string ( GENEX_STRIP "${_files}" _files2 ) + + foreach ( _file ${_files2} ) + if ( NOT EXISTS "${_file}" ) + message ( FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist!" ) + endif ( ) + endforeach () +endmacro ( ) + +suitesparse_check_exist ( SUITESPARSE_GPURUNTIME_INCLUDE_DIR ${SUITESPARSE_GPURUNTIME_INCLUDE_DIR} ) +suitesparse_check_exist ( SUITESPARSE_GPURUNTIME_LIBRARY ${SUITESPARSE_GPURUNTIME_LIBRARY} ) + +message ( STATUS "SuiteSparse_GPURuntime version: ${SUITESPARSE_GPURUNTIME_VERSION}" ) +message ( STATUS "SuiteSparse_GPURuntime include: ${SUITESPARSE_GPURUNTIME_INCLUDE_DIR}" ) +message ( STATUS "SuiteSparse_GPURuntime library: ${SUITESPARSE_GPURUNTIME_LIBRARY}" ) +message ( STATUS "SuiteSparse_GPURuntime static: ${SUITESPARSE_GPURUNTIME_STATIC}" ) diff --git a/SuiteSparse_GPURuntime/Doc/ChangeLog b/SuiteSparse_GPURuntime/Doc/ChangeLog index 61cc11da3..ccda857d9 100644 --- a/SuiteSparse_GPURuntime/Doc/ChangeLog +++ b/SuiteSparse_GPURuntime/Doc/ChangeLog @@ -1,3 +1,7 @@ +Sept 8, 2023: version 3.2.0 + + * cmake updates: SuiteSparse:: namespace by Markus Muetzel + June 16, 2023: version 2.0.4 * cmake build system updates: update by Markus Muetzel diff --git a/SuiteSparse_GPURuntime/Include/SuiteSparse_GPURuntime.hpp b/SuiteSparse_GPURuntime/Include/SuiteSparse_GPURuntime.hpp index 1906d7c39..566664920 100644 --- a/SuiteSparse_GPURuntime/Include/SuiteSparse_GPURuntime.hpp +++ b/SuiteSparse_GPURuntime/Include/SuiteSparse_GPURuntime.hpp @@ -12,10 +12,10 @@ #define SUITESPARSE_GPURUNTIME_HPP // Version information: -#define SUITESPARSE_GPURUNTIME_DATE "June 16, 2023" -#define SUITESPARSE_GPURUNTIME_MAIN_VERSION 2 -#define SUITESPARSE_GPURUNTIME_SUB_VERSION 0 -#define SUITESPARSE_GPURUNTIME_SUBSUB_VERSION 4 +#define SUITESPARSE_GPURUNTIME_DATE "Sept 8, 2023" +#define SUITESPARSE_GPURUNTIME_MAIN_VERSION 3 +#define SUITESPARSE_GPURUNTIME_SUB_VERSION 2 +#define SUITESPARSE_GPURUNTIME_SUBSUB_VERSION 0 #define SUITESPARSE_GPURUNTIME_VER_CODE(main,sub) ((main) * 1000 + (sub)) #define SUITESPARSE_GPURUNTIME_VERSION \ diff --git a/SuiteSparse_GPURuntime/cmake_modules/FindSuiteSparse_GPURuntime.cmake b/SuiteSparse_GPURuntime/cmake_modules/FindSuiteSparse_GPURuntime.cmake deleted file mode 100644 index 762585d84..000000000 --- a/SuiteSparse_GPURuntime/cmake_modules/FindSuiteSparse_GPURuntime.cmake +++ /dev/null @@ -1,133 +0,0 @@ -#------------------------------------------------------------------------------- -# SuiteSparse_GPURuntime/cmake_modules/FindSuiteSparse_GPURuntime.cmake -#------------------------------------------------------------------------------- - -# The following copyright and license applies to just this file only, not to -# the library itself: -# FindSuiteSparse_GPURuntime.cmake, Copyright (c) 2022-2023, Timothy A. Davis. All Rights Reserved. -# SPDX-License-Identifier: BSD-3-clause - -#------------------------------------------------------------------------------- - -# Finds the SuiteSparse_GPURuntime compiled library and sets: - -# SUITESPARSE_GPURUNTIME_INCLUDE_DIR - include directory for SuiteSparse_GPURuntime -# SUITESPARSE_GPURUNTIME_LIBRARIES - libraries when using SuiteSparse_GPURuntime -# SUITESPARSE_GPURUNTIME_LIBRARY - dynamic SuiteSparse_GPURuntime library -# SUITESPARSE_GPURUNTIME_STATIC - static SuiteSparse_GPURuntime library -# SUITESPARSE_GPURUNTIME_FOUND - true if SuiteSparse_GPURuntime found - -# set ``SUITESPARSE_GPURUNTIME_ROOT`` or ``SuiteSparse_GPURuntime_ROOT`` to a -# SuiteSparse_GPURuntime installation root to tell this module where to look. - -# All the Find*.cmake files in SuiteSparse are installed by 'make install' into -# /usr/local/lib/cmake/SuiteSparse (where '/usr/local' is the -# ${CMAKE_INSTALL_PREFIX}). To access this file, place the following commands -# in your CMakeLists.txt file. See also SuiteSparse/Example/CMakeLists.txt: -# -# set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} -# ${CMAKE_INSTALL_PREFIX}/lib/cmake/SuiteSparse ) - -#------------------------------------------------------------------------------- - -# include files for SuiteSparse_GPURuntime -find_path ( SUITESPARSE_GPURUNTIME_INCLUDE_DIR - NAMES SuiteSparse_GPURuntime.hpp - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/SuiteSparse_GPURuntime - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse_GPURuntime - PATH_SUFFIXES include Include -) - -# dynamic SuiteSparse_GPURuntime library (or static if no dynamic library was built) -find_library ( SUITESPARSE_GPURUNTIME_LIBRARY - NAMES suitesparse_gpuruntime suitesparse_gpuruntime_static - HINTS ${SUITESPARSE_GPURUNTIME_ROOT} - HINTS ENV SUITESPARSE_GPURUNTIME_ROOT - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/SuiteSparse_GPURuntime - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse_GPURuntime - PATH_SUFFIXES lib build build/Release build/Debug -) - -if ( MSVC ) - set ( STATIC_NAME suitesparse_gpuruntime_static suitesparse_gpuruntime ) -else ( ) - set ( STATIC_NAME suitesparse_gpuruntime ) - set ( save ${CMAKE_FIND_LIBRARY_SUFFIXES} ) - set ( CMAKE_FIND_LIBRARY_SUFFIXES - ${CMAKE_STATIC_LIBRARY_SUFFIX} ${CMAKE_FIND_LIBRARY_SUFFIXES} ) -endif ( ) - -# static SuiteSparse_GPURuntime library -find_library ( SUITESPARSE_GPURUNTIME_STATIC - NAMES ${STATIC_NAME} - HINTS ${SUITESPARSE_GPURUNTIME_ROOT} - HINTS ENV SUITESPARSE_GPURUNTIME_ROOT - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/SuiteSparse_GPURuntime - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse_GPURuntime - PATH_SUFFIXES lib build build/Release build/Debug -) - -if ( NOT MSVC ) - # restore the CMAKE_FIND_LIBRARY_SUFFIXES variable - set ( CMAKE_FIND_LIBRARY_SUFFIXES ${save} ) -endif ( ) - -# get version of the library from the dynamic library name -get_filename_component ( SUITESPARSE_GPURUNTIME_LIBRARY ${SUITESPARSE_GPURUNTIME_LIBRARY} REALPATH ) -get_filename_component ( SUITESPARSE_GPURUNTIME_FILENAME ${SUITESPARSE_GPURUNTIME_LIBRARY} NAME ) -string ( - REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" - SUITESPARSE_GPURUNTIME_VERSION - ${SUITESPARSE_GPURUNTIME_FILENAME} -) - -# set ( SUITESPARSE_GPURUNTIME_VERSION "" ) -if ( EXISTS "${SUITESPARSE_GPURUNTIME_INCLUDE_DIR}" AND NOT SUITESPARSE_GPURUNTIME_VERSION ) - # if the version does not appear in the filename, read the include file - file ( STRINGS ${SUITESPARSE_GPURUNTIME_INCLUDE_DIR}/SuiteSparse_GPURuntime.hpp SUITESPARSE_GPURUNTIME_MAJOR_STR - REGEX "define SUITESPARSE_GPURUNTIME_MAIN_VERSION" ) - file ( STRINGS ${SUITESPARSE_GPURUNTIME_INCLUDE_DIR}/SuiteSparse_GPURuntime.hpp SUITESPARSE_GPURUNTIME_MINOR_STR - REGEX "define SUITESPARSE_GPURUNTIME_SUB_VERSION" ) - file ( STRINGS ${SUITESPARSE_GPURUNTIME_INCLUDE_DIR}/SuiteSparse_GPURuntime.hpp SUITESPARSE_GPURUNTIME_PATCH_STR - REGEX "define SUITESPARSE_GPURUNTIME_SUBSUB_VERSION" ) - message ( STATUS "major: ${SUITESPARSE_GPURUNTIME_MAJOR_STR}" ) - message ( STATUS "minor: ${SUITESPARSE_GPURUNTIME_MINOR_STR}" ) - message ( STATUS "patch: ${SUITESPARSE_GPURUNTIME_PATCH_STR}" ) - string ( REGEX MATCH "[0-9]+" SUITESPARSE_GPURUNTIME_MAJOR ${SUITESPARSE_GPURUNTIME_MAJOR_STR} ) - string ( REGEX MATCH "[0-9]+" SUITESPARSE_GPURUNTIME_MINOR ${SUITESPARSE_GPURUNTIME_MINOR_STR} ) - string ( REGEX MATCH "[0-9]+" SUITESPARSE_GPURUNTIME_PATCH ${SUITESPARSE_GPURUNTIME_PATCH_STR} ) - set (SUITESPARSE_GPURUNTIME_VERSION "${SUITESPARSE_GPURUNTIME_MAJOR}.${SUITESPARSE_GPURUNTIME_MINOR}.${SUITESPARSE_GPURUNTIME_PATCH}") -endif ( ) - -set ( SUITESPARSE_GPURUNTIME_LIBRARIES ${SUITESPARSE_GPURUNTIME_LIBRARY} ) - -include (FindPackageHandleStandardArgs) - -find_package_handle_standard_args ( SuiteSparse_GPURuntime - REQUIRED_VARS SUITESPARSE_GPURUNTIME_LIBRARY - VERSION_VAR SUITESPARSE_GPURUNTIME_VERSION -) - -mark_as_advanced ( - SUITESPARSE_GPURUNTIME_INCLUDE_DIR - SUITESPARSE_GPURUNTIME_LIBRARY - SUITESPARSE_GPURUNTIME_STATIC - SUITESPARSE_GPURUNTIME_LIBRARIES -) - -if ( SUITESPARSE_GPURUNTIME_FOUND ) - message ( STATUS "SuiteSparse_GPURuntime version: ${SUITESPARSE_GPURUNTIME_VERSION}" ) - message ( STATUS "SuiteSparse_GPURuntime include: ${SUITESPARSE_GPURUNTIME_INCLUDE_DIR}" ) - message ( STATUS "SuiteSparse_GPURuntime library: ${SUITESPARSE_GPURUNTIME_LIBRARY}" ) - message ( STATUS "SuiteSparse_GPURuntime static: ${SUITESPARSE_GPURUNTIME_STATIC}" ) -else ( ) - message ( STATUS "SuiteSparse_GPURuntime not found" ) - set ( SUITESPARSE_GPURUNTIME_INCLUDE_DIR "" ) - set ( SUITESPARSE_GPURUNTIME_LIBRARIES "" ) - set ( SUITESPARSE_GPURUNTIME_LIBRARY "" ) - set ( SUITESPARSE_GPURUNTIME_STATIC "" ) -endif ( ) - diff --git a/SuiteSparse_config/CMakeLists.txt b/SuiteSparse_config/CMakeLists.txt index ba9cff73e..efc1e6400 100644 --- a/SuiteSparse_config/CMakeLists.txt +++ b/SuiteSparse_config/CMakeLists.txt @@ -14,9 +14,9 @@ cmake_minimum_required ( VERSION 3.22 ) # version of both SuiteSparse and SuiteSparse_config -set ( SUITESPARSE_DATE "June 29, 2023" ) +set ( SUITESPARSE_DATE "Sept 8, 2023" ) set ( SUITESPARSE_VERSION_MAJOR 7 ) -set ( SUITESPARSE_VERSION_MINOR 1 ) +set ( SUITESPARSE_VERSION_MINOR 2 ) set ( SUITESPARSE_VERSION_SUB 0 ) message ( STATUS "Building SuiteSparse_config version: v" @@ -45,7 +45,7 @@ endif ( ) # define the project #------------------------------------------------------------------------------- -project ( suitesparseconfig +project ( SuiteSparseConfig VERSION "${SUITESPARSE_VERSION_MAJOR}.${SUITESPARSE_VERSION_MINOR}.${SUITESPARSE_VERSION_SUB}" LANGUAGES C ) @@ -77,28 +77,33 @@ configure_file ( "Config/README.md.in" NEWLINE_STYLE LF ) #------------------------------------------------------------------------------- -# dynamic suitesparseconfig library properties +# dynamic SuiteSparseConfig library properties #------------------------------------------------------------------------------- file ( GLOB SUITESPARSECONFIG_SOURCES "*.c" ) -add_library ( suitesparseconfig SHARED ${SUITESPARSECONFIG_SOURCES} ) -set_target_properties ( suitesparseconfig PROPERTIES +add_library ( SuiteSparseConfig SHARED ${SUITESPARSECONFIG_SOURCES} ) +set_target_properties ( SuiteSparseConfig PROPERTIES VERSION ${SUITESPARSE_VERSION_MAJOR}.${SUITESPARSE_VERSION_MINOR}.${SUITESPARSE_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON + OUTPUT_NAME suitesparseconfig SOVERSION ${SUITESPARSE_VERSION_MAJOR} PUBLIC_HEADER "SuiteSparse_config.h" WINDOWS_EXPORT_ALL_SYMBOLS ON ) +target_include_directories ( SuiteSparseConfig + INTERFACE $ + $ ) + #------------------------------------------------------------------------------- -# static suitesparseconfig library properties +# static SuiteSparseConfig library properties #------------------------------------------------------------------------------- if ( NOT NSTATIC ) - add_library ( suitesparseconfig_static STATIC ${SUITESPARSECONFIG_SOURCES} ) + add_library ( SuiteSparseConfig_static STATIC ${SUITESPARSECONFIG_SOURCES} ) - set_target_properties ( suitesparseconfig_static PROPERTIES + set_target_properties ( SuiteSparseConfig_static PROPERTIES VERSION ${SUITESPARSE_VERSION_MAJOR}.${SUITESPARSE_VERSION_MINOR}.${SUITESPARSE_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON @@ -106,9 +111,13 @@ if ( NOT NSTATIC ) SOVERSION ${SUITESPARSE_VERSION_MAJOR} ) if ( MSVC ) - set_target_properties ( suitesparseconfig_static PROPERTIES + set_target_properties ( SuiteSparseConfig_static PROPERTIES OUTPUT_NAME suitesparseconfig_static ) endif ( ) + + target_include_directories ( SuiteSparseConfig_static + INTERFACE $ + $ ) endif ( ) #------------------------------------------------------------------------------- @@ -117,9 +126,9 @@ endif ( ) # libm: if ( NOT WIN32 ) - target_link_libraries ( suitesparseconfig PRIVATE m ) + target_link_libraries ( SuiteSparseConfig PRIVATE m ) if ( NOT NSTATIC ) - target_link_libraries ( suitesparseconfig_static PUBLIC m ) + target_link_libraries ( SuiteSparseConfig_static PUBLIC m ) endif ( ) endif ( ) @@ -128,9 +137,9 @@ if ( OPENMP_FOUND ) message ( STATUS "OpenMP C libraries: ${OpenMP_C_LIBRARIES} ") message ( STATUS "OpenMP C include: ${OpenMP_C_INCLUDE_DIRS} ") message ( STATUS "OpenMP C flags: ${OpenMP_C_FLAGS} ") - target_link_libraries ( suitesparseconfig PRIVATE ${OpenMP_C_LIBRARIES} ) + target_link_libraries ( SuiteSparseConfig PRIVATE ${OpenMP_C_LIBRARIES} ) if ( NOT NSTATIC ) - target_link_libraries ( suitesparseconfig_static PUBLIC ${OpenMP_C_LIBRARIES} ) + target_link_libraries ( SuiteSparseConfig_static PUBLIC ${OpenMP_C_LIBRARIES} ) endif ( ) set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS} " ) include_directories ( ${OpenMP_C_INCLUDE_DIRS} ) @@ -147,12 +156,15 @@ if ( BLAS_FOUND ) endif ( ) #------------------------------------------------------------------------------- -# suitesparseconfig installation location +# SuiteSparseConfig installation location #------------------------------------------------------------------------------- +include ( CMakePackageConfigHelpers ) + file ( GLOB SUITESPARSE_CMAKE_MODULES "cmake_modules/*" ) -install ( TARGETS suitesparseconfig +install ( TARGETS SuiteSparseConfig + EXPORT SuiteSparse_configTargets LIBRARY DESTINATION ${SUITESPARSE_LIBDIR} ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} RUNTIME DESTINATION ${SUITESPARSE_BINDIR} @@ -162,8 +174,64 @@ install ( FILES DESTINATION ${SUITESPARSE_LIBDIR}/cmake/SuiteSparse COMPONENT Development ) if ( NOT NSTATIC ) - install ( TARGETS suitesparseconfig_static + install ( TARGETS SuiteSparseConfig_static + EXPORT SuiteSparse_configTargets ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} ) endif ( ) +# create (temporary) export target file during build +export ( EXPORT SuiteSparse_configTargets + NAMESPACE SuiteSparse:: + FILE ${CMAKE_CURRENT_BINARY_DIR}/SuiteSparse_configTargets.cmake ) + +# install export target and config for find_package +install ( EXPORT SuiteSparse_configTargets + NAMESPACE SuiteSparse:: + DESTINATION ${SUITESPARSE_LIBDIR}/cmake/SuiteSparse_config ) + +configure_package_config_file ( + Config/SuiteSparse_configConfig.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/SuiteSparse_configConfig.cmake + INSTALL_DESTINATION ${SUITESPARSE_LIBDIR}/cmake/SuiteSparse_config ) + +write_basic_package_version_file ( + ${CMAKE_CURRENT_BINARY_DIR}/SuiteSparse_configConfigVersion.cmake + COMPATIBILITY SameMajorVersion ) + +install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/SuiteSparse_configConfig.cmake + ${CMAKE_CURRENT_BINARY_DIR}/SuiteSparse_configConfigVersion.cmake + DESTINATION ${SUITESPARSE_LIBDIR}/cmake/SuiteSparse_config ) + +#------------------------------------------------------------------------------- +# create pkg-config file +#------------------------------------------------------------------------------- + +if ( NOT MSVC ) + set ( prefix "${CMAKE_INSTALL_PREFIX}" ) + set ( exec_prefix "\${prefix}" ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) + if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) + set ( libdir "${SUITESPARSE_LIBDIR}") + else ( ) + set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") + endif ( ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) + if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) + set ( includedir "${SUITESPARSE_INCLUDEDIR}") + else ( ) + set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + endif ( ) + configure_file ( + Config/SuiteSparse_config.pc.in + SuiteSparse_config.pc + @ONLY + NEWLINE_STYLE LF ) + install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/SuiteSparse_config.pc + DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) +endif ( ) + +#------------------------------------------------------------------------------- + include ( SuiteSparseReport ) diff --git a/SuiteSparse_config/Config/README.md.in b/SuiteSparse_config/Config/README.md.in index 9fbae9ae8..996adc159 100644 --- a/SuiteSparse_config/Config/README.md.in +++ b/SuiteSparse_config/Config/README.md.in @@ -33,6 +33,34 @@ SuiteSparse branches * dev2: working branch. All submitted PRs should made to this branch. This branch might not always be in working order. +----------------------------------------------------------------------------- +For distro maintainers (Linux, homebrew, spack, R, Octave, Trilinos, ...): +----------------------------------------------------------------------------- + +Thanks for packaging SuiteSparse! Here are some suggestions: + + * GraphBLAS takes a long time to compile because it creates many fast + "FactoryKernels" at compile-time. If you want to reduce the compile + time and library size, enable the COMPACT mode, but keep the JIT + enabled. Then GraphBLAS will compile the kernels it needs at run-time, + via its JIT. Performance will be the same as the FactoryKernels once + the JIT kernels are compiled. User compiled kernels are placed in + ~/.SuiteSparse, by default. You do not need to distribute the source + for GraphBLAS to enable the JIT: just libgraphblas.so and GraphBLAS.h + is enough. + + * GraphBLAS needs OpenMP! It's fundamentally a parallel code so please + distribute it with OpenMP enabled. Performance will suffer + otherwise. + + * CUDA acceleration: CHOLMOD and SPQR can benefit from their CUDA + kernels. If you do not have CUDA or do not want to include it in + your distro, this version of SuiteSparse skips the building of + the CHOLMOD_CUDA and SPQR_CUDA libraries, and does not link + against the GPUQREngine and SuiteSparse_GPURuntime libraries. + The latter can be excluded from your distro (the "make" command + will build them, but they will be empty). + ----------------------------------------------------------------------------- How to cite the SuiteSparse meta-package and its component packages: ----------------------------------------------------------------------------- @@ -55,8 +83,9 @@ papers in ACM TOMS, for each package. T. Davis, Algorithm 10xx: SuiteSparse:GraphBLAS: parallel graph algorithms in the language of sparse linear algebra, ACM Trans on - Mathematical Software, to appear, 2023. See the pdf in - https://github.com/DrTimothyAldenDavis/GraphBLAS/tree/stable/Doc + Mathematical Software, just accepted, 2023. See the pdf in + https://github.com/DrTimothyAldenDavis/GraphBLAS/tree/stable/Doc . + https://doi.org/10.1145/3577195 T. Davis, Algorithm 1000: SuiteSparse:GraphBLAS: graph algorithms in the language of sparse linear algebra, ACM Trans on Mathematical @@ -260,9 +289,9 @@ strictly followed. If set to true, only a 64-bit BLAS library will be used. If false (the default), only a 32-bit BLAS library will be used. If no such BLAS is found, the build will fail. ------------------- -SuiteSparse/README ------------------- +----------------------------------------------------------------------------- +SuiteSparse Packages +----------------------------------------------------------------------------- Packages in SuiteSparse, and files in this directory: @@ -341,7 +370,7 @@ Packages in SuiteSparse, and files in this directory: lib 'make install' places shared libraries for each package here, after 'make local' - Makefile to compile all of SuiteSparse + Makefile optional, to compile all of SuiteSparse make compiles SuiteSparse libraries. Subsequent "make install" will install @@ -435,7 +464,7 @@ Packages in SuiteSparse, and files in this directory: Wissam Sid-Lakhdar, Sanjay Ranka GPUQREngine: GPU support package for SPQR - (not built into MATLAB, however) + Not needed if CUDA is not enabled. authors: Tim Davis, Nuri Yeralan, Sanjay Ranka, Wissam Sid-Lakhdar @@ -444,7 +473,7 @@ Packages in SuiteSparse, and files in this directory: author: Tim Davis SuiteSparse_GPURuntime GPU support package for SPQR and CHOLMOD - (not builtin to MATLAB, however). + Not needed if CUDA is not enabled. SuiteSparse_install.m install SuiteSparse for MATLAB SuiteSparse_paths.m set paths for SuiteSparse MATLAB mexFunctions @@ -469,7 +498,7 @@ the `CHOLMOD/SuiteSparse_metis/README.txt` file for details. Refer to each package for license, copyright, and author information. All codes are authored or co-authored by Timothy A. Davis (email: davis@tamu.edu), except for METIS (by George Karypis), GraphBLAS/cpu_features (by Google), -GraphBLAS/lz4 and zstd (by Yann Collet, now at Facebook), and +GraphBLAS/lz4, zstd, and xxHash (by Yann Collet, now at Facebook), and GraphBLAS/CUDA/jitify.hpp (by NVIDIA). Parts of GraphBLAS/CUDA are Copyright (c) by NVIDIA. Please refer to each of these licenses. @@ -481,9 +510,7 @@ the top-level LICENSE.txt file. QUICK START FOR MATLAB USERS (Linux or Mac): ----------------------------------------------------------------------------- -Uncompress the SuiteSparse.zip or SuiteSparse.tar.gz archive file (they contain -the same thing). Suppose you place SuiteSparse in the /home/me/SuiteSparse -folder. +Suppose you place SuiteSparse in the /home/me/SuiteSparse folder. Add the SuiteSparse/lib folder to your run-time library path. On Linux, add this to your ~/.bashrc script, assuming /home/me/SuiteSparse is the location of @@ -525,9 +552,9 @@ priviledge to do the `sudo make install`): make sudo make install -All libraries will be created and copied into SuiteSparse/lib and into -/usr/local/lib. All include files need by the applications that use -SuiteSparse are copied into SuiteSparse/include and into /usr/local/include. +All libraries will be created and copied into the default system-wide folder +(/usr/local/lib on Linux). All include files need by the applications that use +SuiteSparse are copied into /usr/local/include (on Linux). For Windows, import each `*/CMakeLists.txt` file into MS Visual Studio. A single top-level CMake script is being considered as a feature in the @@ -606,8 +633,8 @@ You can set specific options for CMake with the command (for example): CMAKE_OPTIONS="-DNPARTITION=1 -DNSTATIC=1 -DCMAKE_BUILD_TYPE=Debug" make That command will compile all of SuiteSparse except for CHOLMOD/Partition -Module. Debug mode will be used. The static libraries will not be built -(NSTATIC is true). +Module (because of -DNPARTITION=1). Debug mode will be used (the build type). +The static libraries will not be built (since -DNSTATIC=1 is set). CMAKE_BUILD_TYPE: Default: "Release", use "Debug" for debugging. @@ -621,6 +648,14 @@ Module. Debug mode will be used. The static libraries will not be built CMAKE_INSTALL_PREFIX). Default: false + CMAKE_INSTALL_PREFIX: defines the install location (default on Linux is + /usr/local). For example, this command in the top + level SuiteSparse folder will set the install directory + to "/stuff", used by the subsequent "sudo make install": + + CMAKE_OPTIONS="-DCMAKE_INSTALL_PREFIX=/stuff" make + sudo make install + NSTATIC: if true, static libraries are not built. Default: false, except for GraphBLAS, which takes a long time to compile so the default for @@ -683,6 +718,8 @@ SuiteSparse build system and how it works with various Linux / Python distros and other package managers. If you are a maintainer of a SuiteSparse packaging for a Linux distro, conda-forge, R, spack, brew, vcpkg, etc, please feel free to contact me if there's anything I can do to make your life easier. +I would also like to thank Raye Kimmerer for adding support for 32-bit +row/column indices in SPQR v4.2.0. See also the various Acknowledgements within each package. diff --git a/SuiteSparse_config/Config/SuiteSparse_config.pc.in b/SuiteSparse_config/Config/SuiteSparse_config.pc.in new file mode 100644 index 000000000..af7543c5f --- /dev/null +++ b/SuiteSparse_config/Config/SuiteSparse_config.pc.in @@ -0,0 +1,15 @@ +# SuiteSparse_config, Copyright (c) 2012-2023, Timothy A. Davis. +# All Rights Reserved. +# SPDX-License-Identifier: BSD-3-clause + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: SuiteSparseConfig +URL: https://github.com/DrTimothyAldenDavis/SuiteSparse +Description: Configuration for SuiteSparse +Version: @SUITESPARSE_VERSION_MAJOR@.@SUITESPARSE_VERSION_MINOR@.@SUITESPARSE_VERSION_SUB@ +Libs: -L${libdir} -lsuitesparseconfig +Cflags: -I${includedir} diff --git a/SuiteSparse_config/Config/SuiteSparse_configConfig.cmake.in b/SuiteSparse_config/Config/SuiteSparse_configConfig.cmake.in new file mode 100644 index 000000000..c16ffd80d --- /dev/null +++ b/SuiteSparse_config/Config/SuiteSparse_configConfig.cmake.in @@ -0,0 +1,121 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/SuiteSparse_config/cmake_modules/SuiteSparse_configConfig.cmake +#------------------------------------------------------------------------------- + +# The following copyright and license applies to just this file only, not to +# the library itself: +# SuiteSparse_configConfig.cmake, Copyright (c) 2023, Timothy A. Davis. All Rights Reserved. +# SPDX-License-Identifier: BSD-3-clause + +#------------------------------------------------------------------------------- + +# Finds the SuiteSparse_config include file and compiled library. +# The following targets are defined: +# SuiteSparseConfig - for the shared library (if available) +# SuiteSparseConfig_static - for the static library (if available) + +# For backward compatibility the following variables are set: + +# SUITESPARSE_CONFIG_INCLUDE_DIR - where to find SuiteSparse_config.h +# SUITESPARSE_CONFIG_LIBRARY - dynamic SuiteSparse_config library +# SUITESPARSE_CONFIG_STATIC - static SuiteSparse_config library +# SUITESPARSE_CONFIG_LIBRARIES - libraries when using SuiteSparse_config +# SUITESPARSE_CONFIG_FOUND - true if SuiteSparse_config found + +# Set ``CMAKE_MODULE_PATH`` to the parent folder where this module file is +# installed. + +#------------------------------------------------------------------------------- + +@PACKAGE_INIT@ + +set ( SUITESPARSE_DATE "@SUITESPARSE_DATE@" ) +set ( SUITESPARSE_CONFIG_VERSION_MAJOR @SUITESPARSE_VERSION_MAJOR@ ) +set ( SUITESPARSE_CONFIG_VERSION_MINOR @SUITESPARSE_VERSION_MINOR@ ) +set ( SUITESPARSE_CONFIG_VERSION_PATCH @SUITESPARSE_VERSION_SUB@ ) +set ( SUITESPARSE_CONFIG_VERSION "@SUITESPARSE_VERSION_MAJOR@.@SUITESPARSE_VERSION_MINOR@.@SUITESPARSE_VERSION_SUB@" ) + +include ( ${CMAKE_CURRENT_LIST_DIR}/SuiteSparse_configTargets.cmake ) + +# The following is only for backward compatibility with FindSuiteSparse_config. + +set ( _target_shared SuiteSparse::SuiteSparseConfig ) +set ( _target_static SuiteSparse::SuiteSparseConfig_static ) +set ( _var_prefix "SUITESPARSE_CONFIG" ) + +get_target_property ( ${_var_prefix}_INCLUDE_DIR ${_target_shared} INTERFACE_INCLUDE_DIRECTORIES ) +if ( ${_var_prefix}_INCLUDE_DIR ) + # First item in SuiteSparse targets contains the "main" header directory. + list ( GET ${_var_prefix}_INCLUDE_DIR 0 ${_var_prefix}_INCLUDE_DIR ) +endif ( ) +get_target_property ( ${_var_prefix}_LIBRARY ${_target_shared} IMPORTED_IMPLIB ) +if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} IMPORTED_LOCATION ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) +endif ( ) +if ( TARGET ${_target_static} ) + get_target_property ( ${_var_prefix}_STATIC ${_target_static} IMPORTED_LOCATION ) +endif ( ) + +# Check for most common build types +set ( _config_types "Debug" "Release" "RelWithDebInfo" "MinSizeRel" ) + +get_property ( _isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG ) +if ( _isMultiConfig ) + # For multi-configuration generators (e.g., Visual Studio), prefer those + # configurations. + list ( PREPEND _config_types ${CMAKE_CONFIGURATION_TYPES} ) +else ( ) + # For single-configuration generators, prefer the current configuration. + list ( PREPEND _config_types ${CMAKE_BUILD_TYPE} ) +endif ( ) + +list ( REMOVE_DUPLICATES _config_types ) + +foreach ( _config ${_config_types} ) + string ( TOUPPER ${_config} _uc_config ) + if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} + IMPORTED_IMPLIB_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) + endif ( ) + if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} + IMPORTED_LOCATION_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) + endif ( ) + if ( TARGET ${_target_static} AND NOT ${_var_prefix}_STATIC ) + get_target_property ( _library_chk ${_target_static} + IMPORTED_LOCATION_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_STATIC ${_library_chk} ) + endif ( ) + endif ( ) +endforeach ( ) + +set ( SUITESPARSE_CONFIG_LIBRARIES ${SUITESPARSE_CONFIG_LIBRARY} ) + +macro ( suitesparse_check_exist _var _files ) + # ignore generator expressions + string ( GENEX_STRIP "${_files}" _files2 ) + + foreach ( _file ${_files2} ) + if ( NOT EXISTS "${_file}" ) + message ( FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist!" ) + endif ( ) + endforeach () +endmacro ( ) + +suitesparse_check_exist ( SUITESPARSE_CONFIG_INCLUDE_DIR ${SUITESPARSE_CONFIG_INCLUDE_DIR} ) +suitesparse_check_exist ( SUITESPARSE_CONFIG_LIBRARY ${SUITESPARSE_CONFIG_LIBRARY} ) + +message ( STATUS "SuiteSparse_config version: ${SUITESPARSE_CONFIG_VERSION}" ) +message ( STATUS "SuiteSparse_config include: ${SUITESPARSE_CONFIG_INCLUDE_DIR}" ) +message ( STATUS "SuiteSparse_config library: ${SUITESPARSE_CONFIG_LIBRARY}" ) +message ( STATUS "SuiteSparse_config static: ${SUITESPARSE_CONFIG_STATIC}" ) diff --git a/SuiteSparse_config/SuiteSparse__thread.cmake b/SuiteSparse_config/SuiteSparse__thread.cmake new file mode 100644 index 000000000..75c5cb61d --- /dev/null +++ b/SuiteSparse_config/SuiteSparse__thread.cmake @@ -0,0 +1,72 @@ +#------------------------------------------------------------------------------- +# GraphBLAS/cmake_modules/SuiteSparse__thread.cmake +#------------------------------------------------------------------------------- + +# Copyright (c) 2017-2023, Timothy A. Davis. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + +#------------------------------------------------------------------------------- + +# determine if the __thread keyword is available, which is an extension by +# gcc but supported by many compilers, to indicate thread-local-storage. + +include ( CheckCSourceRuns ) + +set ( thread_src +" #include + __thread int x = 1 ; + int main (void) + { + x = 0 ; + return (x) ; + } +" ) + +set ( declspec_thread_src +" #include + __declspec ( thread ) int x = 1 ; + int main (void) + { + x = 0 ; + return (x) ; + } +" ) + +set ( thread_local_src +" #include + #include + _Thread_local int x = 1 ; + int main (void) + { + x = 0 ; + return (x) ; + } +" ) + +check_c_source_runs ( "${declspec_thread_src}" HAVE_KEYWORD__DECLSPEC_THREAD ) + +check_c_source_runs ( "${thread_src}" HAVE_KEYWORD__THREAD ) + +check_c_source_runs ( "${thread_local_src}" HAVE_KEYWORD__THREAD_LOCAL ) + +if ( HAVE_KEYWORD__DECLSPEC_THREAD ) + add_compile_definitions ( HAVE_KEYWORD__DECLSPEC_THREAD ) + message ( STATUS "__declspec(thread) keyword: available" ) +else ( ) + message ( STATUS "__declspec(thread) keyword: not available" ) +endif ( ) + +if ( HAVE_KEYWORD__THREAD ) + add_compile_definitions ( HAVE_KEYWORD__THREAD ) + message ( STATUS "__thread keyword: available" ) +else ( ) + message ( STATUS "__thread keyword: not available" ) +endif ( ) + +if ( HAVE_KEYWORD__THREAD_LOCAL ) + add_compile_definitions ( HAVE_KEYWORD__THREAD_LOCAL ) + message ( STATUS "_Thread_local keyword: available" ) +else ( ) + message ( STATUS "_Thread_local_thread keyword: not available" ) +endif ( ) + diff --git a/SuiteSparse_config/SuiteSparse_config.h b/SuiteSparse_config/SuiteSparse_config.h index 05c07678a..e28fd0989 100644 --- a/SuiteSparse_config/SuiteSparse_config.h +++ b/SuiteSparse_config/SuiteSparse_config.h @@ -409,9 +409,9 @@ int SuiteSparse_version // returns SUITESPARSE_VERSION #define SUITESPARSE_HAS_VERSION_FUNCTION -#define SUITESPARSE_DATE "June 29, 2023" +#define SUITESPARSE_DATE "Sept 8, 2023" #define SUITESPARSE_MAIN_VERSION 7 -#define SUITESPARSE_SUB_VERSION 1 +#define SUITESPARSE_SUB_VERSION 2 #define SUITESPARSE_SUBSUB_VERSION 0 #define SUITESPARSE_VER_CODE(main,sub) ((main) * 1000 + (sub)) diff --git a/SuiteSparse_config/cmake_modules/FindSuiteSparse_config.cmake b/SuiteSparse_config/cmake_modules/FindSuiteSparse_config.cmake deleted file mode 100644 index b9859150a..000000000 --- a/SuiteSparse_config/cmake_modules/FindSuiteSparse_config.cmake +++ /dev/null @@ -1,141 +0,0 @@ -#------------------------------------------------------------------------------- -# SuiteSparse/SuiteSparse_config/cmake_modules/FindSuiteSparse_config.cmake -#------------------------------------------------------------------------------- - -# The following copyright and license applies to just this file only, not to -# the library itself: -# FindSuiteSparse_config.cmake, Copyright (c) 2022-2023, Timothy A. Davis. All Rights Reserved. -# SPDX-License-Identifier: BSD-3-clause - -#------------------------------------------------------------------------------- - -# Finds the SuiteSparse_config include file and compiled library and sets: - -# SUITESPARSE_CONFIG_INCLUDE_DIR - where to find SuiteSparse_config.h -# SUITESPARSE_CONFIG_LIBRARY - dynamic SuiteSparse_config library -# SUITESPARSE_CONFIG_STATIC - static SuiteSparse_config library -# SUITESPARSE_CONFIG_LIBRARIES - libraries when using SuiteSparse_config -# SUITESPARSE_CONFIG_FOUND - true if SuiteSparse_config found - -# set ``SUITESPARSE_CONFIG_ROOT`` or ``SuiteSparse_config_ROOT`` to a -# SuiteSparse_config installation root to tell this module where to look. - -# All the Find*.cmake files in SuiteSparse are installed by 'make install' into -# /usr/local/lib/cmake/SuiteSparse (where '/usr/local' is the -# ${CMAKE_INSTALL_PREFIX}). To access this file, place the following commands -# in your CMakeLists.txt file. See also SuiteSparse/Example/CMakeLists.txt: -# -# set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} -# ${CMAKE_INSTALL_PREFIX}/lib/cmake/SuiteSparse ) - -#------------------------------------------------------------------------------- - -# include files for SuiteSparse_config -find_path ( SUITESPARSE_CONFIG_INCLUDE_DIR - NAMES SuiteSparse_config.h - HINTS ${SUITESPARSE_CONFIG_ROOT} - HINTS ENV SUITESPARSE_CONFIG_ROOT - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/SuiteSparse_config - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config - PATH_SUFFIXES include Include -) - -# dynamic SuiteSparse_config (or static if no dynamic library was built) -find_library ( SUITESPARSE_CONFIG_LIBRARY - NAMES suitesparseconfig suitesparseconfig_static - HINTS ${SUITESPARSE_CONFIG_ROOT} - HINTS ENV SUITESPARSE_CONFIG_ROOT - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/SuiteSparse_config - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config - PATH_SUFFIXES lib build build/Release build/Debug -) - -if ( MSVC ) - set ( STATIC_NAME suitesparseconfig_static suitesparseconfig ) -else ( ) - set ( STATIC_NAME suitesparseconfig ) - set ( save ${CMAKE_FIND_LIBRARY_SUFFIXES} ) - message ( STATUS "original library suffixes: ${CMAKE_FIND_LIBRARY_SUFFIXES}" ) - set ( CMAKE_FIND_LIBRARY_SUFFIXES - ${CMAKE_STATIC_LIBRARY_SUFFIX} ${CMAKE_FIND_LIBRARY_SUFFIXES} ) - message ( STATUS "revised for static search: ${CMAKE_FIND_LIBRARY_SUFFIXES}" ) -endif ( ) - -# static libraries for SuiteSparse_config -find_library ( SUITESPARSE_CONFIG_STATIC - NAMES ${STATIC_NAME} - HINTS ${SUITESPARSE_CONFIG_ROOT} - HINTS ENV SUITESPARSE_CONFIG_ROOT - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/SuiteSparse_config - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config - PATH_SUFFIXES lib build build/Release build/Debug -) - -if ( NOT MSVC ) - # restore the CMAKE_FIND_LIBRARY_SUFFIXES variable - set ( CMAKE_FIND_LIBRARY_SUFFIXES ${save} ) -endif ( ) - -# get version of the library from the dynamic library filename, if present -get_filename_component ( SUITESPARSE_CONFIG_LIBRARY ${SUITESPARSE_CONFIG_LIBRARY} REALPATH ) -get_filename_component ( SUITESPARSE_CONFIG_FILENAME ${SUITESPARSE_CONFIG_LIBRARY} NAME ) -string ( - REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" - SUITESPARSE_CONFIG_VERSION - ${SUITESPARSE_CONFIG_FILENAME} -) - -# set ( SUITESPARSE_CONFIG_VERSION "" ) -if ( EXISTS "${SUITESPARSE_CONFIG_INCLUDE_DIR}" AND NOT SUITESPARSE_CONFIG_VERSION ) - # if the version does not appear in the filename, read the include file - file ( STRINGS ${SUITESPARSE_CONFIG_INCLUDE_DIR}/SuiteSparse_config.h SUITESPARSE_CONFIG_MAJOR_STR - REGEX "define SUITESPARSE_MAIN_VERSION" ) - file ( STRINGS ${SUITESPARSE_CONFIG_INCLUDE_DIR}/SuiteSparse_config.h SUITESPARSE_CONFIG_MINOR_STR - REGEX "define SUITESPARSE_SUB_VERSION" ) - file ( STRINGS ${SUITESPARSE_CONFIG_INCLUDE_DIR}/SuiteSparse_config.h SUITESPARSE_CONFIG_PATCH_STR - REGEX "define SUITESPARSE_SUBSUB_VERSION" ) - message ( STATUS "major: ${SUITESPARSE_CONFIG_MAJOR_STR}" ) - message ( STATUS "minor: ${SUITESPARSE_CONFIG_MINOR_STR}" ) - message ( STATUS "patch: ${SUITESPARSE_CONFIG_PATCH_STR}" ) - string ( REGEX MATCH "[0-9]+" SUITESPARSE_CONFIG_MAJOR ${SUITESPARSE_CONFIG_MAJOR_STR} ) - string ( REGEX MATCH "[0-9]+" SUITESPARSE_CONFIG_MINOR ${SUITESPARSE_CONFIG_MINOR_STR} ) - string ( REGEX MATCH "[0-9]+" SUITESPARSE_CONFIG_PATCH ${SUITESPARSE_CONFIG_PATCH_STR} ) - set (SUITESPARSE_CONFIG_VERSION "${SUITESPARSE_CONFIG_MAJOR}.${SUITESPARSE_CONFIG_MINOR}.${SUITESPARSE_CONFIG_PATCH}") -endif ( ) - -# libaries when using SuiteSparse_config -set (SUITESPARSE_CONFIG_LIBRARIES ${SUITESPARSE_CONFIG_LIBRARY}) - -include ( FindPackageHandleStandardArgs ) - -find_package_handle_standard_args ( SuiteSparse_config - REQUIRED_VARS SUITESPARSE_CONFIG_LIBRARY SUITESPARSE_CONFIG_INCLUDE_DIR - VERSION_VAR SUITESPARSE_CONFIG_VERSION - REASON_FAILURE_MESSAGE result -) - -message (STATUS "result: ${result}") - -mark_as_advanced ( - SUITESPARSE_CONFIG_INCLUDE_DIR - SUITESPARSE_CONFIG_LIBRARY - SUITESPARSE_CONFIG_STATIC - SUITESPARSE_CONFIG_LIBRARIES -) - -if ( SUITESPARSE_CONFIG_FOUND ) - message ( STATUS "SuiteSparse_config version: ${SUITESPARSE_CONFIG_VERSION}" ) - message ( STATUS "SuiteSparse_config include: ${SUITESPARSE_CONFIG_INCLUDE_DIR}" ) - message ( STATUS "SuiteSparse_config library: ${SUITESPARSE_CONFIG_LIBRARY}" ) - message ( STATUS "SuiteSparse_config static: ${SUITESPARSE_CONFIG_STATIC}" ) -else ( ) - message ( STATUS "SuiteSparse_config not found" ) - set ( SUITESPARSE_CONFIG_INCLUDE_DIR "" ) - set ( SUITESPARSE_CONFIG_LIBRARIES "" ) - set ( SUITESPARSE_CONFIG_LIBRARY "" ) - set ( SUITESPARSE_CONFIG_STATIC "" ) -endif ( ) - diff --git a/SuiteSparse_config/cmake_modules/SuiteSparse_ssize_t.cmake b/SuiteSparse_config/cmake_modules/SuiteSparse_ssize_t.cmake deleted file mode 100644 index 2b74bae83..000000000 --- a/SuiteSparse_config/cmake_modules/SuiteSparse_ssize_t.cmake +++ /dev/null @@ -1,32 +0,0 @@ -#------------------------------------------------------------------------------- -# SuiteSparse/cmake_modules/SuiteSparse_ssize_t.cmake -#------------------------------------------------------------------------------- - -# Copyright (c) 2023, Timothy A. Davis. All Rights Reserved. -# SPDX-License-Identifier: BSD-3-clause - -#------------------------------------------------------------------------------- - -# determine if the compiler defines ssize_t - -include ( CheckCSourceCompiles ) - -set ( ssize_t_source -" #include - int main (void) - { - ssize_t x = 0 ; - return (0) ; - } -" ) - -check_c_source_compiles ( "${ssize_t_source}" TEST_FOR_SSIZE_T ) - -if ( TEST_FOR_SSIZE_T ) - set ( HAVE_SSIZE_T true ) - message ( STATUS "#include and ssize_t: OK" ) -else ( ) - set ( HAVE_SSIZE_T false ) - message ( STATUS "#include and ssize_t: not found" ) -endif ( ) - diff --git a/UMFPACK/CMakeLists.txt b/UMFPACK/CMakeLists.txt index 9008efe6a..0374ceae9 100644 --- a/UMFPACK/CMakeLists.txt +++ b/UMFPACK/CMakeLists.txt @@ -12,10 +12,10 @@ # cmake 3.22 is required to find the BLAS in SuiteSparse_config cmake_minimum_required ( VERSION 3.22 ) -set ( UMFPACK_DATE "June 16, 2023" ) +set ( UMFPACK_DATE "Sept 8, 2023" ) set ( UMFPACK_VERSION_MAJOR 6 ) -set ( UMFPACK_VERSION_MINOR 1 ) -set ( UMFPACK_VERSION_SUB 1 ) +set ( UMFPACK_VERSION_MINOR 2 ) +set ( UMFPACK_VERSION_SUB 0 ) message ( STATUS "Building UMFPACK version: v" ${UMFPACK_VERSION_MAJOR}. @@ -27,23 +27,27 @@ message ( STATUS "Building UMFPACK version: v" #------------------------------------------------------------------------------- set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} - ${CMAKE_SOURCE_DIR}/cmake_modules - ${CMAKE_SOURCE_DIR}/../AMD/cmake_modules - ${CMAKE_SOURCE_DIR}/../COLAMD/cmake_modules - ${CMAKE_SOURCE_DIR}/../CAMD/cmake_modules - ${CMAKE_SOURCE_DIR}/../CCOLAMD/cmake_modules ${CMAKE_SOURCE_DIR}/../CHOLMOD/cmake_modules ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/cmake_modules ) +option ( ENABLE_CUDA "Enable CUDA acceleration" on ) + include ( SuiteSparsePolicy ) #------------------------------------------------------------------------------- # define the project #------------------------------------------------------------------------------- -project ( umfpack - VERSION "${UMFPACK_VERSION_MAJOR}.${UMFPACK_VERSION_MINOR}.${UMFPACK_VERSION_SUB}" - LANGUAGES C ) +if ( SUITESPARSE_CUDA ) + # UMFPACK with CHOLMOD (which can use CUDA) + project ( umfpack + VERSION "${UMFPACK_VERSION_MAJOR}.${UMFPACK_VERSION_MINOR}.${UMFPACK_VERSION_SUB}" + LANGUAGES C CXX CUDA ) +else ( ) + project ( umfpack + VERSION "${UMFPACK_VERSION_MAJOR}.${UMFPACK_VERSION_MINOR}.${UMFPACK_VERSION_SUB}" + LANGUAGES C ) +endif ( ) #------------------------------------------------------------------------------- # find library dependencies @@ -57,25 +61,63 @@ else ( ) find_package ( OpenMP ) endif ( ) -find_package ( SuiteSparse_config 7.1.0 REQUIRED ) -find_package ( AMD 3.0.4 REQUIRED ) +find_package ( SuiteSparse_config 7.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../SuiteSparse_config/build NO_DEFAULT_PATH ) +if ( NOT TARGET SuiteSparse::SuiteSparseConfig ) + find_package ( SuiteSparse_config 7.2.0 REQUIRED ) +endif ( ) +find_package ( AMD 3.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../AMD/build NO_DEFAULT_PATH ) +if ( NOT TARGET SuiteSparse::AMD ) + find_package ( AMD 3.2.0 REQUIRED ) +endif ( ) include ( SuiteSparseBLAS ) # requires cmake 3.22 option ( NCHOLMOD "ON: do not use CHOLMOD. OFF (default): use CHOLMOD" off ) if ( NOT NCHOLMOD ) # look for CHOLMOD (optional fill-reducing orderings) - find_package ( CHOLMOD 4.0.4 ) - find_package ( CHOLMOD_CUDA 4.0.4 ) + find_package ( CHOLMOD 4.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../CHOLMOD/build NO_DEFAULT_PATH ) + if ( NOT TARGET SuiteSparse::CHOLMOD ) + find_package ( CHOLMOD 4.2.0 ) + endif ( ) + + if ( SUITESPARSE_CUDA ) + find_package ( CHOLMOD_CUDA 4.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../CHOLMOD/build NO_DEFAULT_PATH ) + if ( NOT TARGET SuiteSparse::CHOLMOD_CUDA ) + find_package ( CHOLMOD_CUDA 4.2.0 ) + endif ( ) + endif ( ) + # look for CHOLMOD's dependencies: AMD and COLAMD are required. CAMD and # CCOLAMD are optional, but must be found if CHOLMOD was built with them. - find_package ( COLAMD 3.0.4 ) - find_package ( CAMD 3.0.4 ) - find_package ( CCOLAMD 3.0.4 ) + find_package ( COLAMD 3.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../COLAMD/build NO_DEFAULT_PATH ) + if ( NOT TARGET SuiteSparse::COLAMD ) + find_package ( COLAMD 3.2.0 ) + endif ( ) + + find_package ( CAMD 3.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../CAMD/build NO_DEFAULT_PATH ) + if ( NOT TARGET SuiteSparse::CAMD ) + find_package ( CAMD 3.2.0 ) + endif ( ) + + find_package ( CCOLAMD 3.2.0 + PATHS ${CMAKE_SOURCE_DIR}/../CCOLAMD/build NO_DEFAULT_PATH ) + if ( NOT TARGET SuiteSparse::CCOLAMD ) + find_package ( CCOLAMD 3.2.0 ) + endif ( ) + if ( NOT CHOLMOD_FOUND OR NOT AMD_FOUND OR NOT COLAMD_FOUND ) # CHOLMOD not found so disable it set ( NCHOLMOD true ) endif ( ) + if ( SUITESPARSE_CUDA AND NOT CHOLMOD_CUDA_FOUND ) + set ( NCHOLMOD true ) + endif ( ) endif ( ) if ( NCHOLMOD ) @@ -101,9 +143,7 @@ configure_file ( "Config/umfpack_version.tex.in" # include directories #------------------------------------------------------------------------------- -include_directories ( Source Include ${SUITESPARSE_CONFIG_INCLUDE_DIR} - ${AMD_INCLUDE_DIR} ${CHOLMOD_INCLUDE_DIR} - ${CMAKE_SOURCE_DIR}/../AMD/Include ) +include_directories ( Source Include ) #------------------------------------------------------------------------------- # dynamic umfpack library properties @@ -111,24 +151,29 @@ include_directories ( Source Include ${SUITESPARSE_CONFIG_INCLUDE_DIR} file ( GLOB UMFPACK_SOURCES "Source2/*.c" ) -add_library ( umfpack SHARED ${UMFPACK_SOURCES} ) +add_library ( UMFPACK SHARED ${UMFPACK_SOURCES} ) -set_target_properties ( umfpack PROPERTIES +set_target_properties ( UMFPACK PROPERTIES VERSION ${UMFPACK_VERSION_MAJOR}.${UMFPACK_VERSION_MINOR}.${UMFPACK_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON + OUTPUT_NAME umfpack SOVERSION ${UMFPACK_VERSION_MAJOR} PUBLIC_HEADER "Include/umfpack.h" WINDOWS_EXPORT_ALL_SYMBOLS ON ) +target_include_directories ( UMFPACK + INTERFACE $ + $ ) + #------------------------------------------------------------------------------- # static umfpack library properties #------------------------------------------------------------------------------- if ( NOT NSTATIC ) - add_library ( umfpack_static STATIC ${UMFPACK_SOURCES} ) + add_library ( UMFPACK_static STATIC ${UMFPACK_SOURCES} ) - set_target_properties ( umfpack_static PROPERTIES + set_target_properties ( UMFPACK_static PROPERTIES VERSION ${UMFPACK_VERSION_MAJOR}.${UMFPACK_VERSION_MINOR}.${UMFPACK_VERSION_SUB} C_STANDARD 11 C_STANDARD_REQUIRED ON @@ -136,19 +181,29 @@ if ( NOT NSTATIC ) SOVERSION ${UMFPACK_VERSION_MAJOR} ) if ( MSVC ) - set_target_properties ( umfpack_static PROPERTIES + set_target_properties ( UMFPACK_static PROPERTIES OUTPUT_NAME umfpack_static ) endif ( ) + + target_include_directories ( UMFPACK_static + INTERFACE $ + $ ) + endif ( ) #------------------------------------------------------------------------------- # add the library dependencies #------------------------------------------------------------------------------- -# suitesparseconfig: -target_link_libraries ( umfpack PRIVATE ${SUITESPARSE_CONFIG_LIBRARIES} ) +# SuiteSparseConfig: +target_link_libraries ( UMFPACK PRIVATE SuiteSparse::SuiteSparseConfig ) +target_include_directories ( UMFPACK PUBLIC "$" ) if ( NOT NSTATIC ) - target_link_libraries ( umfpack_static PUBLIC ${SUITESPARSE_CONFIG_STATIC} ) + if ( TARGET SuiteSparse::SuiteSparseConfig_static ) + target_link_libraries ( UMFPACK_static PUBLIC SuiteSparse::SuiteSparseConfig_static ) + else ( ) + target_link_libraries ( UMFPACK_static PUBLIC SuiteSparse::SuiteSparseConfig ) + endif ( ) endif ( ) # OpenMP: @@ -156,9 +211,10 @@ if ( OPENMP_FOUND ) message ( STATUS "OpenMP C libraries: ${OpenMP_C_LIBRARIES} ") message ( STATUS "OpenMP C include: ${OpenMP_C_INCLUDE_DIRS} ") message ( STATUS "OpenMP C flags: ${OpenMP_C_FLAGS} ") - target_link_libraries ( umfpack PRIVATE ${OpenMP_C_LIBRARIES} ) + target_link_libraries ( UMFPACK PRIVATE ${OpenMP_C_LIBRARIES} ) if ( NOT NSTATIC ) - target_link_libraries ( umfpack_static PUBLIC ${OpenMP_C_LIBRARIES} ) + target_link_libraries ( UMFPACK_static PUBLIC ${OpenMP_C_LIBRARIES} ) + list ( APPEND UMFPACK_STATIC_LIBS ${OpenMP_C_LIBRARIES} ) endif ( ) set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS} " ) include_directories ( ${OpenMP_C_INCLUDE_DIRS} ) @@ -166,60 +222,149 @@ endif ( ) # libm: if ( NOT WIN32 ) - target_link_libraries ( umfpack PRIVATE m ) + target_link_libraries ( UMFPACK PRIVATE m ) if ( NOT NSTATIC ) - target_link_libraries ( umfpack_static PUBLIC m ) + list ( APPEND UMFPACK_STATIC_LIBS "m" ) + target_link_libraries ( UMFPACK_static PUBLIC m ) endif ( ) endif ( ) -# amd: -target_link_libraries ( umfpack PRIVATE ${AMD_LIBRARIES} ) +# AMD: +target_link_libraries ( UMFPACK PRIVATE SuiteSparse::AMD ) +target_include_directories ( UMFPACK PUBLIC + "$" ) if ( NOT NSTATIC ) - target_link_libraries ( umfpack_static PUBLIC ${AMD_STATIC} ) + if ( TARGET SuiteSparse::AMD_static ) + target_link_libraries ( UMFPACK_static PUBLIC SuiteSparse::AMD_static ) + else ( ) + target_link_libraries ( UMFPACK_static PUBLIC SuiteSparse::AMD ) + endif ( ) endif ( ) # BLAS: message ( STATUS "BLAS libraries: ${BLAS_LIBRARIES} ") message ( STATUS "BLAS include: ${BLAS_INCLUDE_DIRS} ") message ( STATUS "BLAS linker flags: ${BLAS_LINKER_FLAGS} ") -target_link_libraries ( umfpack PRIVATE ${BLAS_LIBRARIES} ) +target_link_libraries ( UMFPACK PRIVATE ${BLAS_LIBRARIES} ) if ( NOT NSTATIC ) - target_link_libraries ( umfpack_static PUBLIC ${BLAS_LIBRARIES} ) + list ( APPEND UMFPACK_STATIC_LIBS ${BLAS_LIBRARIES} ) + target_link_libraries ( UMFPACK_static PUBLIC ${BLAS_LIBRARIES} ) endif ( ) include_directories ( ${BLAS_INCLUDE_DIRS} ) -# cholmod: +# CHOLMOD: if ( NOT NCHOLMOD ) # link with CHOLMOD and its dependencies, both required and optional - target_link_libraries ( umfpack PRIVATE - ${CHOLMOD_LIBRARIES} ${CHOLMOD_CUDA_LIBRARIES} - ${AMD_LIBRARIES} ${COLAMD_LIBRARIES} - ${CAMD_LIBRARIES} ${CCOLAMD_LIBRARIES} ) + message ( STATUS "CHOLMOD cuda libraries: " ${CHOLMOD_CUDA_LIBRARIES} ) + target_link_libraries ( UMFPACK PRIVATE + SuiteSparse::CHOLMOD ${CHOLMOD_CUDA_LIBRARIES} ) if ( NOT NSTATIC ) - target_link_libraries ( umfpack_static PUBLIC - ${CHOLMOD_STATIC} ${CHOLMOD_CUDA_STATIC} - ${AMD_STATIC} ${COLAMD_STATIC} - ${CAMD_STATIC} ${CCOLAMD_STATIC} ) + set ( UMFPACK_STATIC_MODULES "${UMFPACK_STATIC_MODULES} CHOLMOD CHOLMOD_CUDA" ) + target_link_libraries ( UMFPACK_static PUBLIC + ${CHOLMOD_CUDA_STATIC} ) + if ( TARGET SuiteSparse::CHOLMOD_static ) + target_link_libraries ( UMFPACK_static PUBLIC SuiteSparse::CHOLMOD_static ) + else ( ) + target_link_libraries ( UMFPACK_static PUBLIC SuiteSparse::CHOLMOD ) + endif ( ) endif ( ) + endif ( ) #------------------------------------------------------------------------------- # UMFPACK installation location #------------------------------------------------------------------------------- -install ( TARGETS umfpack +include ( CMakePackageConfigHelpers ) + +install ( TARGETS UMFPACK + EXPORT UMFPACKTargets LIBRARY DESTINATION ${SUITESPARSE_LIBDIR} ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} RUNTIME DESTINATION ${SUITESPARSE_BINDIR} PUBLIC_HEADER DESTINATION ${SUITESPARSE_INCLUDEDIR} ) -install ( FILES ${CMAKE_SOURCE_DIR}/cmake_modules/FindUMFPACK.cmake - DESTINATION ${SUITESPARSE_LIBDIR}/cmake/SuiteSparse - COMPONENT Development ) if ( NOT NSTATIC ) - install ( TARGETS umfpack_static + install ( TARGETS UMFPACK_static + EXPORT UMFPACKTargets ARCHIVE DESTINATION ${SUITESPARSE_LIBDIR} ) endif ( ) +# create (temporary) export target file during build +export ( EXPORT UMFPACKTargets + NAMESPACE SuiteSparse:: + FILE ${CMAKE_CURRENT_BINARY_DIR}/UMFPACKTargets.cmake ) + +# install export target, config and version files for find_package +install ( EXPORT UMFPACKTargets + NAMESPACE SuiteSparse:: + DESTINATION ${SUITESPARSE_LIBDIR}/cmake/UMFPACK ) + +configure_package_config_file ( + Config/UMFPACKConfig.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/UMFPACKConfig.cmake + INSTALL_DESTINATION ${SUITESPARSE_LIBDIR}/cmake/UMFPACK ) + +write_basic_package_version_file ( + ${CMAKE_CURRENT_BINARY_DIR}/UMFPACKConfigVersion.cmake + COMPATIBILITY SameMajorVersion ) + +install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/UMFPACKConfig.cmake + ${CMAKE_CURRENT_BINARY_DIR}/UMFPACKConfigVersion.cmake + DESTINATION ${SUITESPARSE_LIBDIR}/cmake/UMFPACK ) + +#------------------------------------------------------------------------------- +# create pkg-config file +#------------------------------------------------------------------------------- + +if ( NOT MSVC ) + # This might be something like: + # /usr/lib/libgomp.so;/usr/lib/libpthread.a;m + # convert to -l flags for pkg-config, i.e.: "-lgomp -lpthread -lm" + set ( UMFPACK_STATIC_LIBS_LIST ${UMFPACK_STATIC_LIBS} ) + set ( UMFPACK_STATIC_LIBS "" ) + foreach ( _lib ${UMFPACK_STATIC_LIBS_LIST} ) + string ( FIND ${_lib} "." _pos REVERSE ) + if ( ${_pos} EQUAL "-1" ) + set ( UMFPACK_STATIC_LIBS "${UMFPACK_STATIC_LIBS} -l${_lib}" ) + continue () + endif ( ) + foreach ( _kind IN ITEMS "IMPORT" "SHARED" "STATIC" ) + set ( _regex ".*\\/(lib)?([^\\.]*)(${CMAKE_${_kind}_LIBRARY_SUFFIX})" ) + if ( ${_lib} MATCHES ${_regex} ) + string ( REGEX REPLACE ${_regex} "\\2" _libname ${_lib} ) + if ( NOT "${_libname}" STREQUAL "" ) + set ( UMFPACK_STATIC_LIBS "${UMFPACK_STATIC_LIBS} -l${_libname}" ) + break () + endif ( ) + endif ( ) + endforeach ( ) + endforeach ( ) + + set ( prefix "${CMAKE_INSTALL_PREFIX}" ) + set ( exec_prefix "\${prefix}" ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_LIBDIR SUITESPARSE_LIBDIR_IS_ABSOLUTE ) + if (SUITESPARSE_LIBDIR_IS_ABSOLUTE) + set ( libdir "${SUITESPARSE_LIBDIR}") + else ( ) + set ( libdir "\${exec_prefix}/${SUITESPARSE_LIBDIR}") + endif ( ) + cmake_path ( IS_ABSOLUTE SUITESPARSE_INCLUDEDIR SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE ) + if (SUITESPARSE_INCLUDEDIR_IS_ABSOLUTE) + set ( includedir "${SUITESPARSE_INCLUDEDIR}") + else ( ) + set ( includedir "\${prefix}/${SUITESPARSE_INCLUDEDIR}") + endif ( ) + configure_file ( + Config/UMFPACK.pc.in + UMFPACK.pc + @ONLY + NEWLINE_STYLE LF ) + install ( FILES + ${CMAKE_CURRENT_BINARY_DIR}/UMFPACK.pc + DESTINATION ${SUITESPARSE_LIBDIR}/pkgconfig ) +endif ( ) + #------------------------------------------------------------------------------- # Demo library and programs #------------------------------------------------------------------------------- @@ -260,42 +405,42 @@ if ( DEMO ) endif ( ) # Libraries required for Demo programs - target_link_libraries ( umfpack_simple PUBLIC umfpack ${SUITESPARSE_CONFIG_LIBRARIES} ) - target_link_libraries ( umfpack_di_demo PUBLIC umfpack ) - target_link_libraries ( umfpack_dl_demo PUBLIC umfpack ) - target_link_libraries ( umfpack_zi_demo PUBLIC umfpack ) - target_link_libraries ( umfpack_zl_demo PUBLIC umfpack ) + target_link_libraries ( umfpack_simple PUBLIC UMFPACK SuiteSparse::SuiteSparseConfig ) + target_link_libraries ( umfpack_di_demo PUBLIC UMFPACK ) + target_link_libraries ( umfpack_dl_demo PUBLIC UMFPACK ) + target_link_libraries ( umfpack_zi_demo PUBLIC UMFPACK ) + target_link_libraries ( umfpack_zl_demo PUBLIC UMFPACK ) if ( NOT WIN32 ) # This is only needed because the demos might be linked before those # libraries are installed. Would it be better to set the rpath instead? target_link_libraries ( umfpack_di_demo PUBLIC - ${COLAMD_LIBRARIES} ${CAMD_LIBRARIES} ${CCOLAMD_LIBRARIES} ) + SuiteSparse::COLAMD SuiteSparse::CAMD SuiteSparse::CCOLAMD ) target_link_libraries ( umfpack_dl_demo PUBLIC - ${COLAMD_LIBRARIES} ${CAMD_LIBRARIES} ${CCOLAMD_LIBRARIES} ) + SuiteSparse::COLAMD SuiteSparse::CAMD SuiteSparse::CCOLAMD ) target_link_libraries ( umfpack_zi_demo PUBLIC - ${COLAMD_LIBRARIES} ${CAMD_LIBRARIES} ${CCOLAMD_LIBRARIES} ) + SuiteSparse::COLAMD SuiteSparse::CAMD SuiteSparse::CCOLAMD ) target_link_libraries ( umfpack_zl_demo PUBLIC - ${COLAMD_LIBRARIES} ${CAMD_LIBRARIES} ${CCOLAMD_LIBRARIES} ) + SuiteSparse::COLAMD SuiteSparse::CAMD SuiteSparse::CCOLAMD ) endif ( ) if ( NOT NFORTRAN ) # Fortran demos - target_link_libraries ( umf4 PUBLIC umfpack ${AMD_LIBRARIES} ) - target_link_libraries ( umf4hb PUBLIC umfpack ) - target_link_libraries ( umf4zhb PUBLIC umfpack ) - target_link_libraries ( umf4hb64 PUBLIC umfpack ) - target_link_libraries ( umf4zhb64 PUBLIC umfpack ) + target_link_libraries ( umf4 PUBLIC UMFPACK SuiteSparse::AMD ) + target_link_libraries ( umf4hb PUBLIC UMFPACK ) + target_link_libraries ( umf4zhb PUBLIC UMFPACK ) + target_link_libraries ( umf4hb64 PUBLIC UMFPACK ) + target_link_libraries ( umf4zhb64 PUBLIC UMFPACK ) if ( NOT WIN32 ) # This is only needed because the demos might be linked before # those libraries are installed. Would it be better to set the # rpath instead? target_link_libraries ( umf4hb PUBLIC - ${COLAMD_LIBRARIES} ${CAMD_LIBRARIES} ${CCOLAMD_LIBRARIES} ) + SuiteSparse::COLAMD SuiteSparse::CAMD SuiteSparse::CCOLAMD ) target_link_libraries ( umf4zhb PUBLIC - ${COLAMD_LIBRARIES} ${CAMD_LIBRARIES} ${CCOLAMD_LIBRARIES} ) + SuiteSparse::COLAMD SuiteSparse::CAMD SuiteSparse::CCOLAMD ) target_link_libraries ( umf4hb64 PUBLIC - ${COLAMD_LIBRARIES} ${CAMD_LIBRARIES} ${CCOLAMD_LIBRARIES} ) + SuiteSparse::COLAMD SuiteSparse::CAMD SuiteSparse::CCOLAMD ) target_link_libraries ( umf4zhb64 PUBLIC - ${COLAMD_LIBRARIES} ${CAMD_LIBRARIES} ${CCOLAMD_LIBRARIES} ) + SuiteSparse::COLAMD SuiteSparse::CAMD SuiteSparse::CCOLAMD ) endif ( ) endif ( ) diff --git a/UMFPACK/Config/UMFPACK.pc.in b/UMFPACK/Config/UMFPACK.pc.in new file mode 100644 index 000000000..ebe4778a9 --- /dev/null +++ b/UMFPACK/Config/UMFPACK.pc.in @@ -0,0 +1,17 @@ +# UMFPACK, Copyright (c) 1995-2023, Timothy A. Davis. +# All Rights Reserved. +# SPDX-License-Identifier: GPL-2.0-or-later + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: UMFPACK +URL: https://github.com/DrTimothyAldenDavis/SuiteSparse +Description: Routines solving sparse linear systems via LU factorization in SuiteSparse +Version: @UMFPACK_VERSION_MAJOR@.@UMFPACK_VERSION_MINOR@.@UMFPACK_VERSION_SUB@ +Requires.private: SuiteSparse_config AMD @UMFPACK_STATIC_MODULES@ +Libs: -L${libdir} -lumfpack +Libs.private: @UMFPACK_STATIC_LIBS@ +Cflags: -I${includedir} diff --git a/UMFPACK/Config/UMFPACKConfig.cmake.in b/UMFPACK/Config/UMFPACKConfig.cmake.in new file mode 100644 index 000000000..0fd7f87e2 --- /dev/null +++ b/UMFPACK/Config/UMFPACKConfig.cmake.in @@ -0,0 +1,121 @@ +#------------------------------------------------------------------------------- +# SuiteSparse/UMFPACK/cmake_modules/UMFPACKConfig.cmake +#------------------------------------------------------------------------------- + +# The following copyright and license applies to just this file only, not to +# the library itself: +# UMFPACKConfig.cmake, Copyright (c) 2023, Timothy A. Davis. All Rights Reserved. +# SPDX-License-Identifier: BSD-3-clause + +#------------------------------------------------------------------------------- + +# Finds the UMFPACK include file and compiled library. +# The following targets are defined: +# SuiteSparse::UMFPACK - for the shared library (if available) +# SuiteSparse::UMFPACK_static - for the static library (if available) + +# For backward compatibility the following variables are set: + +# UMFPACK_INCLUDE_DIR - where to find umfpack.h +# UMFPACK_LIBRARY - dynamic UMFPACK library +# UMFPACK_STATIC - static UMFPACK library +# UMFPACK_LIBRARIES - libraries when using UMFPACK +# UMFPACK_FOUND - true if UMFPACK found + +# Set ``CMAKE_MODULE_PATH`` to the parent folder where this module file is +# installed. + +#------------------------------------------------------------------------------- + +@PACKAGE_INIT@ + +set ( UMFPACK_DATE "@UMFPACK_DATE@" ) +set ( UMFPACK_VERSION_MAJOR @UMFPACK_VERSION_MAJOR@ ) +set ( UMFPACK_VERSION_MINOR @UMFPACK_VERSION_MINOR@ ) +set ( UMFPACK_VERSION_PATCH @UMFPACK_VERSION_SUB@ ) +set ( UMFPACK_VERSION "@UMFPACK_VERSION_MAJOR@.@UMFPACK_VERSION_MINOR@.@UMFPACK_VERSION_SUB@" ) + +include ( ${CMAKE_CURRENT_LIST_DIR}/UMFPACKTargets.cmake ) + +# The following is only for backward compatibility with FindUMFPACK. + +set ( _target_shared SuiteSparse::UMFPACK ) +set ( _target_static SuiteSparse::UMFPACK_static ) +set ( _var_prefix "UMFPACK" ) + +get_target_property ( ${_var_prefix}_INCLUDE_DIR ${_target_shared} INTERFACE_INCLUDE_DIRECTORIES ) +if ( ${_var_prefix}_INCLUDE_DIR ) + # First item in SuiteSparse targets contains the "main" header directory. + list ( GET ${_var_prefix}_INCLUDE_DIR 0 ${_var_prefix}_INCLUDE_DIR ) +endif ( ) +get_target_property ( ${_var_prefix}_LIBRARY ${_target_shared} IMPORTED_IMPLIB ) +if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} IMPORTED_LOCATION ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) +endif ( ) +if ( TARGET ${_target_static} ) + get_target_property ( ${_var_prefix}_STATIC ${_target_static} IMPORTED_LOCATION ) +endif ( ) + +# Check for most common build types +set ( _config_types "Debug" "Release" "RelWithDebInfo" "MinSizeRel" ) + +get_property ( _isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG ) +if ( _isMultiConfig ) + # For multi-configuration generators (e.g., Visual Studio), prefer those + # configurations. + list ( PREPEND _config_types ${CMAKE_CONFIGURATION_TYPES} ) +else ( ) + # For single-configuration generators, prefer the current configuration. + list ( PREPEND _config_types ${CMAKE_BUILD_TYPE} ) +endif ( ) + +list ( REMOVE_DUPLICATES _config_types ) + +foreach ( _config ${_config_types} ) + string ( TOUPPER ${_config} _uc_config ) + if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} + IMPORTED_IMPLIB_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) + endif ( ) + if ( NOT ${_var_prefix}_LIBRARY ) + get_target_property ( _library_chk ${_target_shared} + IMPORTED_LOCATION_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_LIBRARY ${_library_chk} ) + endif ( ) + endif ( ) + if ( TARGET ${_target_static} AND NOT ${_var_prefix}_STATIC ) + get_target_property ( _library_chk ${_target_static} + IMPORTED_LOCATION_${_uc_config} ) + if ( EXISTS ${_library_chk} ) + set ( ${_var_prefix}_STATIC ${_library_chk} ) + endif ( ) + endif ( ) +endforeach ( ) + +set ( UMFPACK_LIBRARIES ${UMFPACK_LIBRARY} ) + +macro ( suitesparse_check_exist _var _files ) + # ignore generator expressions + string ( GENEX_STRIP "${_files}" _files2 ) + + foreach ( _file ${_files2} ) + if ( NOT EXISTS "${_file}" ) + message ( FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist!" ) + endif ( ) + endforeach () +endmacro ( ) + +suitesparse_check_exist ( UMFPACK_INCLUDE_DIR ${UMFPACK_INCLUDE_DIR} ) +suitesparse_check_exist ( UMFPACK_LIBRARY ${UMFPACK_LIBRARY} ) + +message ( STATUS "UMFPACK version: ${UMFPACK_VERSION}" ) +message ( STATUS "UMFPACK include: ${UMFPACK_INCLUDE_DIR}" ) +message ( STATUS "UMFPACK library: ${UMFPACK_LIBRARY}" ) +message ( STATUS "UMFPACK static: ${UMFPACK_STATIC}" ) diff --git a/UMFPACK/Demo/umf4hb.out b/UMFPACK/Demo/umf4hb.out index 0df66a436..3846d7db7 100644 --- a/UMFPACK/Demo/umf4hb.out +++ b/UMFPACK/Demo/umf4hb.out @@ -1,4 +1,4 @@ -UMFPACK V6.1.0 (Jan 17, 2023), Control: +UMFPACK V6.2.0 (Sept 8, 2023), Control: Matrix entry defined as: double Int (generic integer) defined as: int32_t @@ -38,7 +38,7 @@ UMFPACK V6.1.0 (Jan 17, 2023), Control: computer/operating system: Linux size of int32_t: 4 int64_t: 8 Int: 4 pointer: 8 double: 8 Entry: 8 (in bytes) -UMFPACK V6.1.0 (Jan 17, 2023), Info: +UMFPACK V6.2.0 (Sept 8, 2023), Info: matrix entry defined as: double Int (generic integer) defined as: int32_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 @@ -106,8 +106,8 @@ UMFPACK V6.1.0 (Jan 17, 2023), Info: numeric factorization defragmentations: 1 numeric factorization reallocations: 1 costly numeric factorization reallocations: 1 - numeric factorization wallclock time (sec): 0.01 - numeric factorization mflops (wallclock): 0.18 + numeric factorization wallclock time (sec): 0.02 + numeric factorization mflops (wallclock): 0.10 solve flops: 1.20800e+03 iterative refinement steps taken: 0 @@ -119,7 +119,7 @@ UMFPACK V6.1.0 (Jan 17, 2023), Info: Matrix key: WEST0067 symbolic analysis: status: 0. - time: 0.12E-03 (sec) + time: 0.10E-03 (sec) estimates (upper bound) for numeric LU: size of LU: 0.02 (MB) memory needed: 0.06 (MB) @@ -128,7 +128,7 @@ symbolic analysis: nnz (U): 902. numeric factorization: status: 0. - time: 0.15E-01 + time: 0.25E-01 actual numeric LU statistics: size of LU: 0.01 (MB) memory needed: 0.04 (MB) @@ -136,5 +136,5 @@ numeric factorization: nnz (L): 331. nnz (U): 340. norm (A*x-b): 1.7763568394002505E-015 - norm (A*x-b): 1.5099033134902129E-014 - norm (A*x-b): 1.5099033134902129E-014 + norm (A*x-b): 1.1546319456101628E-014 + norm (A*x-b): 1.1546319456101628E-014 diff --git a/UMFPACK/Demo/umf4hb64.out b/UMFPACK/Demo/umf4hb64.out index 9c65ba43a..498b5910e 100644 --- a/UMFPACK/Demo/umf4hb64.out +++ b/UMFPACK/Demo/umf4hb64.out @@ -1,4 +1,4 @@ -UMFPACK V6.1.0 (Jan 17, 2023), Control: +UMFPACK V6.2.0 (Sept 8, 2023), Control: Matrix entry defined as: double Int (generic integer) defined as: int64_t @@ -38,7 +38,7 @@ UMFPACK V6.1.0 (Jan 17, 2023), Control: computer/operating system: Linux size of int32_t: 4 int64_t: 8 Int: 8 pointer: 8 double: 8 Entry: 8 (in bytes) -UMFPACK V6.1.0 (Jan 17, 2023), Info: +UMFPACK V6.2.0 (Sept 8, 2023), Info: matrix entry defined as: double Int (generic integer) defined as: int64_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 @@ -106,8 +106,8 @@ UMFPACK V6.1.0 (Jan 17, 2023), Info: numeric factorization defragmentations: 1 numeric factorization reallocations: 1 costly numeric factorization reallocations: 1 - numeric factorization wallclock time (sec): 0.01 - numeric factorization mflops (wallclock): 0.19 + numeric factorization wallclock time (sec): 0.03 + numeric factorization mflops (wallclock): 0.10 solve flops: 1.20800e+03 iterative refinement steps taken: 0 @@ -119,7 +119,7 @@ UMFPACK V6.1.0 (Jan 17, 2023), Info: Matrix key: WEST0067 symbolic analysis: status: 0. - time: 0.14E-03 (sec) + time: 0.11E-03 (sec) estimates (upper bound) for numeric LU: size of LU: 0.02 (MB) memory needed: 0.08 (MB) @@ -128,7 +128,7 @@ symbolic analysis: nnz (U): 902. numeric factorization: status: 0. - time: 0.14E-01 + time: 0.27E-01 actual numeric LU statistics: size of LU: 0.01 (MB) memory needed: 0.06 (MB) diff --git a/UMFPACK/Demo/umf4zhb.out b/UMFPACK/Demo/umf4zhb.out index 064d999ea..e7b57f10a 100644 --- a/UMFPACK/Demo/umf4zhb.out +++ b/UMFPACK/Demo/umf4zhb.out @@ -1,4 +1,4 @@ -UMFPACK V6.1.0 (Jan 17, 2023), Control: +UMFPACK V6.2.0 (Sept 8, 2023), Control: Matrix entry defined as: double complex Int (generic integer) defined as: int32_t @@ -38,7 +38,7 @@ UMFPACK V6.1.0 (Jan 17, 2023), Control: computer/operating system: Linux size of int32_t: 4 int64_t: 8 Int: 4 pointer: 8 double: 8 Entry: 16 (in bytes) -UMFPACK V6.1.0 (Jan 17, 2023), Info: +UMFPACK V6.2.0 (Sept 8, 2023), Info: matrix entry defined as: double complex Int (generic integer) defined as: int32_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 @@ -119,10 +119,10 @@ UMFPACK V6.1.0 (Jan 17, 2023), Info: numeric factorization defragmentations: 0 numeric factorization reallocations: 0 costly numeric factorization reallocations: 0 - numeric factorization wallclock time (sec): 0.58 - numeric factorization mflops (wallclock): 24.89 - symbolic + numeric wall clock time (sec): 0.58 - symbolic + numeric mflops (wall clock): 24.78 + numeric factorization wallclock time (sec): 0.02 + numeric factorization mflops (wallclock): 796.37 + symbolic + numeric wall clock time (sec): 0.02 + symbolic + numeric mflops (wall clock): 721.98 solve flops: 3.70332e+05 iterative refinement steps taken: 0 @@ -134,7 +134,7 @@ UMFPACK V6.1.0 (Jan 17, 2023), Info: Matrix key: QC324 symbolic analysis: status: 0. - time: 0.26E-02 (sec) + time: 0.19E-02 (sec) estimates (upper bound) for numeric LU: size of LU: 1.17 (MB) memory needed: 2.40 (MB) @@ -143,7 +143,7 @@ symbolic analysis: nnz (U): 39609. numeric factorization: status: 0. - time: 0.58E+00 + time: 0.18E-01 actual numeric LU statistics: size of LU: 0.72 (MB) memory needed: 1.14 (MB) diff --git a/UMFPACK/Demo/umf4zhb64.out b/UMFPACK/Demo/umf4zhb64.out index c4ff05475..ae6ad0ae0 100644 --- a/UMFPACK/Demo/umf4zhb64.out +++ b/UMFPACK/Demo/umf4zhb64.out @@ -1,4 +1,4 @@ -UMFPACK V6.1.0 (Jan 17, 2023), Control: +UMFPACK V6.2.0 (Sept 8, 2023), Control: Matrix entry defined as: double complex Int (generic integer) defined as: int64_t @@ -38,7 +38,7 @@ UMFPACK V6.1.0 (Jan 17, 2023), Control: computer/operating system: Linux size of int32_t: 4 int64_t: 8 Int: 8 pointer: 8 double: 8 Entry: 16 (in bytes) -UMFPACK V6.1.0 (Jan 17, 2023), Info: +UMFPACK V6.2.0 (Sept 8, 2023), Info: matrix entry defined as: double complex Int (generic integer) defined as: int64_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 @@ -119,10 +119,10 @@ UMFPACK V6.1.0 (Jan 17, 2023), Info: numeric factorization defragmentations: 0 numeric factorization reallocations: 0 costly numeric factorization reallocations: 0 - numeric factorization wallclock time (sec): 0.51 - numeric factorization mflops (wallclock): 28.25 - symbolic + numeric wall clock time (sec): 0.51 - symbolic + numeric mflops (wall clock): 28.10 + numeric factorization wallclock time (sec): 0.04 + numeric factorization mflops (wallclock): 407.98 + symbolic + numeric wall clock time (sec): 0.04 + symbolic + numeric mflops (wall clock): 383.46 solve flops: 3.70332e+05 iterative refinement steps taken: 0 @@ -134,7 +134,7 @@ UMFPACK V6.1.0 (Jan 17, 2023), Info: Matrix key: QC324 symbolic analysis: status: 0. - time: 0.29E-02 (sec) + time: 0.22E-02 (sec) estimates (upper bound) for numeric LU: size of LU: 1.37 (MB) memory needed: 2.97 (MB) @@ -143,7 +143,7 @@ symbolic analysis: nnz (U): 39609. numeric factorization: status: 0. - time: 0.51E+00 + time: 0.35E-01 actual numeric LU statistics: size of LU: 0.74 (MB) memory needed: 1.38 (MB) diff --git a/UMFPACK/Demo/umfpack_di_demo.out b/UMFPACK/Demo/umfpack_di_demo.out index 2a06bad30..6df673a35 100644 --- a/UMFPACK/Demo/umfpack_di_demo.out +++ b/UMFPACK/Demo/umfpack_di_demo.out @@ -1,5 +1,5 @@ -UMFPACK V6.1 (June 16, 2023) demo: _di_ version +UMFPACK V6.2 (Sept 8, 2023) demo: _di_ version UMFPACK: Copyright (c) 2005-2023 by Timothy A. Davis. All Rights Reserved. @@ -10,9 +10,9 @@ UMFPACK License: SPDX-License-Identifier: GPL-2.0+ Availability: http://www.suitesparse.com -UMFPACK V6.1.1 (June 16, 2023): OK +UMFPACK V6.2.0 (Sept 8, 2023): OK -UMFPACK V6.1.1 (June 16, 2023), Control: +UMFPACK V6.2.0 (Sept 8, 2023), Control: Matrix entry defined as: double Int (generic integer) defined as: int32_t @@ -257,7 +257,7 @@ diagonal of U: dense vector, n = 5. Numeric object: OK -UMFPACK V6.1.1 (June 16, 2023), Info: +UMFPACK V6.2.0 (Sept 8, 2023), Info: matrix entry defined as: double Int (generic integer) defined as: int32_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 @@ -346,7 +346,7 @@ UMFPACK V6.1.1 (June 16, 2023), Info: UMFPACK: Copyright (c) 2005-2023 by Timothy A. Davis. All Rights Reserved. -UMFPACK V6.1.1 (June 16, 2023): OK +UMFPACK V6.2.0 (Sept 8, 2023): OK x (solution of Ax=b): dense vector, n = 5. @@ -362,7 +362,7 @@ maxnorm of residual: 1.06581e-14 UMFPACK: Copyright (c) 2005-2023 by Timothy A. Davis. All Rights Reserved. -UMFPACK V6.1.1 (June 16, 2023): OK +UMFPACK V6.2.0 (Sept 8, 2023): OK determinant: (1.14) * 10^(2) @@ -376,7 +376,7 @@ x (solution of Ax=b, solve is split into 3 steps): dense vector, n = 5. maxnorm of residual: 1.06581e-14 -UMFPACK V6.1.1 (June 16, 2023), Info: +UMFPACK V6.2.0 (Sept 8, 2023), Info: matrix entry defined as: double Int (generic integer) defined as: int32_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 @@ -605,7 +605,7 @@ diagonal of U: dense vector, n = 5. Numeric object: OK -UMFPACK V6.1.1 (June 16, 2023), Info: +UMFPACK V6.2.0 (Sept 8, 2023), Info: matrix entry defined as: double Int (generic integer) defined as: int32_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 @@ -852,7 +852,7 @@ diagonal of U: dense vector, n = 5. Numeric object: OK -UMFPACK V6.1.1 (June 16, 2023), Info: +UMFPACK V6.2.0 (Sept 8, 2023), Info: matrix entry defined as: double Int (generic integer) defined as: int32_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 @@ -1300,7 +1300,7 @@ Freeing numeric object: Loading numeric object: Done loading numeric object -UMFPACK V6.1.1 (June 16, 2023), Info: +UMFPACK V6.2.0 (Sept 8, 2023), Info: matrix entry defined as: double Int (generic integer) defined as: int32_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 @@ -1509,7 +1509,7 @@ Done copying numeric object Numeric blob size: 752 Done serialize/deserialize of numeric object -UMFPACK V6.1.1 (June 16, 2023), Info: +UMFPACK V6.2.0 (Sept 8, 2023), Info: matrix entry defined as: double Int (generic integer) defined as: int32_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 @@ -1607,7 +1607,7 @@ maxnorm of residual: 3.55271e-15 Solving C'x=b again, using umfpack_di_wsolve instead: -UMFPACK V6.1.1 (June 16, 2023), Info: +UMFPACK V6.2.0 (Sept 8, 2023), Info: matrix entry defined as: double Int (generic integer) defined as: int32_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 @@ -1705,4 +1705,4 @@ maxnorm of residual: 3.55271e-15 umfpack_di_demo complete. -Total time: 0.01 seconds (CPU time), 0.01 seconds (wallclock time) +Total time: 0.00 seconds (CPU time), 0.00 seconds (wallclock time) diff --git a/UMFPACK/Demo/umfpack_dl_demo.out b/UMFPACK/Demo/umfpack_dl_demo.out index c6eb99a82..60e209f5d 100644 --- a/UMFPACK/Demo/umfpack_dl_demo.out +++ b/UMFPACK/Demo/umfpack_dl_demo.out @@ -1,5 +1,5 @@ -UMFPACK V6.1 (June 16, 2023) demo: _dl_ version +UMFPACK V6.2 (Sept 8, 2023) demo: _dl_ version UMFPACK: Copyright (c) 2005-2023 by Timothy A. Davis. All Rights Reserved. @@ -10,9 +10,9 @@ UMFPACK License: SPDX-License-Identifier: GPL-2.0+ Availability: http://www.suitesparse.com -UMFPACK V6.1.1 (June 16, 2023): OK +UMFPACK V6.2.0 (Sept 8, 2023): OK -UMFPACK V6.1.1 (June 16, 2023), Control: +UMFPACK V6.2.0 (Sept 8, 2023), Control: Matrix entry defined as: double Int (generic integer) defined as: int64_t @@ -257,7 +257,7 @@ diagonal of U: dense vector, n = 5. Numeric object: OK -UMFPACK V6.1.1 (June 16, 2023), Info: +UMFPACK V6.2.0 (Sept 8, 2023), Info: matrix entry defined as: double Int (generic integer) defined as: int64_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 @@ -346,7 +346,7 @@ UMFPACK V6.1.1 (June 16, 2023), Info: UMFPACK: Copyright (c) 2005-2023 by Timothy A. Davis. All Rights Reserved. -UMFPACK V6.1.1 (June 16, 2023): OK +UMFPACK V6.2.0 (Sept 8, 2023): OK x (solution of Ax=b): dense vector, n = 5. @@ -362,7 +362,7 @@ maxnorm of residual: 1.06581e-14 UMFPACK: Copyright (c) 2005-2023 by Timothy A. Davis. All Rights Reserved. -UMFPACK V6.1.1 (June 16, 2023): OK +UMFPACK V6.2.0 (Sept 8, 2023): OK determinant: (1.14) * 10^(2) @@ -376,7 +376,7 @@ x (solution of Ax=b, solve is split into 3 steps): dense vector, n = 5. maxnorm of residual: 1.06581e-14 -UMFPACK V6.1.1 (June 16, 2023), Info: +UMFPACK V6.2.0 (Sept 8, 2023), Info: matrix entry defined as: double Int (generic integer) defined as: int64_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 @@ -605,7 +605,7 @@ diagonal of U: dense vector, n = 5. Numeric object: OK -UMFPACK V6.1.1 (June 16, 2023), Info: +UMFPACK V6.2.0 (Sept 8, 2023), Info: matrix entry defined as: double Int (generic integer) defined as: int64_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 @@ -852,7 +852,7 @@ diagonal of U: dense vector, n = 5. Numeric object: OK -UMFPACK V6.1.1 (June 16, 2023), Info: +UMFPACK V6.2.0 (Sept 8, 2023), Info: matrix entry defined as: double Int (generic integer) defined as: int64_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 @@ -1300,7 +1300,7 @@ Freeing numeric object: Loading numeric object: Done loading numeric object -UMFPACK V6.1.1 (June 16, 2023), Info: +UMFPACK V6.2.0 (Sept 8, 2023), Info: matrix entry defined as: double Int (generic integer) defined as: int64_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 @@ -1509,7 +1509,7 @@ Done copying numeric object Numeric blob size: 1144 Done serialize/deserialize of numeric object -UMFPACK V6.1.1 (June 16, 2023), Info: +UMFPACK V6.2.0 (Sept 8, 2023), Info: matrix entry defined as: double Int (generic integer) defined as: int64_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 @@ -1607,7 +1607,7 @@ maxnorm of residual: 3.55271e-15 Solving C'x=b again, using umfpack_dl_wsolve instead: -UMFPACK V6.1.1 (June 16, 2023), Info: +UMFPACK V6.2.0 (Sept 8, 2023), Info: matrix entry defined as: double Int (generic integer) defined as: int64_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 @@ -1705,4 +1705,4 @@ maxnorm of residual: 3.55271e-15 umfpack_dl_demo complete. -Total time: 0.01 seconds (CPU time), 0.01 seconds (wallclock time) +Total time: 0.00 seconds (CPU time), 0.00 seconds (wallclock time) diff --git a/UMFPACK/Demo/umfpack_simple.out b/UMFPACK/Demo/umfpack_simple.out index 81551892e..a069d0155 100644 --- a/UMFPACK/Demo/umfpack_simple.out +++ b/UMFPACK/Demo/umfpack_simple.out @@ -1,5 +1,5 @@ -UMFPACK V6.0.0 (Nov 12, 2022) -UMFPACK: Copyright (c) 2005-2022 by Timothy A. Davis. All Rights Reserved. +UMFPACK V6.2.0 (Sept 8, 2023) +UMFPACK: Copyright (c) 2005-2023 by Timothy A. Davis. All Rights Reserved. UMFPACK License: SPDX-License-Identifier: GPL-2.0+ UMFPACK is available under alternate licenses, diff --git a/UMFPACK/Demo/umfpack_zi_demo.out b/UMFPACK/Demo/umfpack_zi_demo.out index 94d3cc99c..da79c43ab 100644 --- a/UMFPACK/Demo/umfpack_zi_demo.out +++ b/UMFPACK/Demo/umfpack_zi_demo.out @@ -1,5 +1,5 @@ -UMFPACK V6.1 (June 16, 2023) demo: _zi_ version +UMFPACK V6.2 (Sept 8, 2023) demo: _zi_ version UMFPACK: Copyright (c) 2005-2023 by Timothy A. Davis. All Rights Reserved. @@ -10,9 +10,9 @@ UMFPACK License: SPDX-License-Identifier: GPL-2.0+ Availability: http://www.suitesparse.com -UMFPACK V6.1.1 (June 16, 2023): OK +UMFPACK V6.2.0 (Sept 8, 2023): OK -UMFPACK V6.1.1 (June 16, 2023), Control: +UMFPACK V6.2.0 (Sept 8, 2023), Control: Matrix entry defined as: double complex Int (generic integer) defined as: int32_t @@ -257,7 +257,7 @@ diagonal of U: dense vector, n = 5. Numeric object: OK -UMFPACK V6.1.1 (June 16, 2023), Info: +UMFPACK V6.2.0 (Sept 8, 2023), Info: matrix entry defined as: double complex Int (generic integer) defined as: int32_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 @@ -331,8 +331,8 @@ UMFPACK V6.1.1 (June 16, 2023), Info: numeric factorization defragmentations: 1 numeric factorization reallocations: 1 costly numeric factorization reallocations: 0 - numeric factorization wallclock time (sec): 0.01 - numeric factorization mflops (wallclock): 0.00 + numeric factorization wallclock time (sec): 0.00 + numeric factorization mflops (wallclock): 0.01 solve flops: 1.02800e+03 iterative refinement steps taken: 1 @@ -346,7 +346,7 @@ UMFPACK V6.1.1 (June 16, 2023), Info: UMFPACK: Copyright (c) 2005-2023 by Timothy A. Davis. All Rights Reserved. -UMFPACK V6.1.1 (June 16, 2023): OK +UMFPACK V6.2.0 (Sept 8, 2023): OK x (solution of Ax=b): dense vector, n = 5. @@ -362,7 +362,7 @@ maxnorm of residual: 1.77636e-15 UMFPACK: Copyright (c) 2005-2023 by Timothy A. Davis. All Rights Reserved. -UMFPACK V6.1.1 (June 16, 2023): OK +UMFPACK V6.2.0 (Sept 8, 2023): OK determinant: (-1.7814+ (2.3784)i) * 10^(2) @@ -376,7 +376,7 @@ x (solution of Ax=b, solve is split into 3 steps): dense vector, n = 5. maxnorm of residual: 1.77636e-14 -UMFPACK V6.1.1 (June 16, 2023), Info: +UMFPACK V6.2.0 (Sept 8, 2023), Info: matrix entry defined as: double complex Int (generic integer) defined as: int32_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 @@ -450,8 +450,8 @@ UMFPACK V6.1.1 (June 16, 2023), Info: numeric factorization defragmentations: 1 numeric factorization reallocations: 1 costly numeric factorization reallocations: 0 - numeric factorization wallclock time (sec): 0.01 - numeric factorization mflops (wallclock): 0.00 + numeric factorization wallclock time (sec): 0.00 + numeric factorization mflops (wallclock): 0.01 solve flops: 4.80000e+02 iterative refinement steps taken: 0 @@ -605,7 +605,7 @@ diagonal of U: dense vector, n = 5. Numeric object: OK -UMFPACK V6.1.1 (June 16, 2023), Info: +UMFPACK V6.2.0 (Sept 8, 2023), Info: matrix entry defined as: double complex Int (generic integer) defined as: int32_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 @@ -852,7 +852,7 @@ diagonal of U: dense vector, n = 5. Numeric object: OK -UMFPACK V6.1.1 (June 16, 2023), Info: +UMFPACK V6.2.0 (Sept 8, 2023), Info: matrix entry defined as: double complex Int (generic integer) defined as: int32_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 @@ -1300,7 +1300,7 @@ Freeing numeric object: Loading numeric object: Done loading numeric object -UMFPACK V6.1.1 (June 16, 2023), Info: +UMFPACK V6.2.0 (Sept 8, 2023), Info: matrix entry defined as: double complex Int (generic integer) defined as: int32_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 @@ -1509,7 +1509,7 @@ Done copying numeric object Numeric blob size: 864 Done serialize/deserialize of numeric object -UMFPACK V6.1.1 (June 16, 2023), Info: +UMFPACK V6.2.0 (Sept 8, 2023), Info: matrix entry defined as: double complex Int (generic integer) defined as: int32_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 @@ -1607,7 +1607,7 @@ maxnorm of residual: 4.88498e-15 Solving C'x=b again, using umfpack_zi_wsolve instead: -UMFPACK V6.1.1 (June 16, 2023), Info: +UMFPACK V6.2.0 (Sept 8, 2023), Info: matrix entry defined as: double complex Int (generic integer) defined as: int32_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 @@ -1705,4 +1705,4 @@ maxnorm of residual: 4.88498e-15 umfpack_zi_demo complete. -Total time: 0.01 seconds (CPU time), 0.01 seconds (wallclock time) +Total time: 0.00 seconds (CPU time), 0.00 seconds (wallclock time) diff --git a/UMFPACK/Demo/umfpack_zl_demo.out b/UMFPACK/Demo/umfpack_zl_demo.out index 0f2e6336f..c3c58fc39 100644 --- a/UMFPACK/Demo/umfpack_zl_demo.out +++ b/UMFPACK/Demo/umfpack_zl_demo.out @@ -1,5 +1,5 @@ -UMFPACK V6.1 (June 16, 2023) demo: _zl_ version +UMFPACK V6.2 (Sept 8, 2023) demo: _zl_ version UMFPACK: Copyright (c) 2005-2023 by Timothy A. Davis. All Rights Reserved. @@ -10,9 +10,9 @@ UMFPACK License: SPDX-License-Identifier: GPL-2.0+ Availability: http://www.suitesparse.com -UMFPACK V6.1.1 (June 16, 2023): OK +UMFPACK V6.2.0 (Sept 8, 2023): OK -UMFPACK V6.1.1 (June 16, 2023), Control: +UMFPACK V6.2.0 (Sept 8, 2023), Control: Matrix entry defined as: double complex Int (generic integer) defined as: int64_t @@ -257,7 +257,7 @@ diagonal of U: dense vector, n = 5. Numeric object: OK -UMFPACK V6.1.1 (June 16, 2023), Info: +UMFPACK V6.2.0 (Sept 8, 2023), Info: matrix entry defined as: double complex Int (generic integer) defined as: int64_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 @@ -346,7 +346,7 @@ UMFPACK V6.1.1 (June 16, 2023), Info: UMFPACK: Copyright (c) 2005-2023 by Timothy A. Davis. All Rights Reserved. -UMFPACK V6.1.1 (June 16, 2023): OK +UMFPACK V6.2.0 (Sept 8, 2023): OK x (solution of Ax=b): dense vector, n = 5. @@ -362,7 +362,7 @@ maxnorm of residual: 1.77636e-15 UMFPACK: Copyright (c) 2005-2023 by Timothy A. Davis. All Rights Reserved. -UMFPACK V6.1.1 (June 16, 2023): OK +UMFPACK V6.2.0 (Sept 8, 2023): OK determinant: (-1.7814+ (2.3784)i) * 10^(2) @@ -376,7 +376,7 @@ x (solution of Ax=b, solve is split into 3 steps): dense vector, n = 5. maxnorm of residual: 1.77636e-14 -UMFPACK V6.1.1 (June 16, 2023), Info: +UMFPACK V6.2.0 (Sept 8, 2023), Info: matrix entry defined as: double complex Int (generic integer) defined as: int64_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 @@ -605,7 +605,7 @@ diagonal of U: dense vector, n = 5. Numeric object: OK -UMFPACK V6.1.1 (June 16, 2023), Info: +UMFPACK V6.2.0 (Sept 8, 2023), Info: matrix entry defined as: double complex Int (generic integer) defined as: int64_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 @@ -852,7 +852,7 @@ diagonal of U: dense vector, n = 5. Numeric object: OK -UMFPACK V6.1.1 (June 16, 2023), Info: +UMFPACK V6.2.0 (Sept 8, 2023), Info: matrix entry defined as: double complex Int (generic integer) defined as: int64_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 @@ -1300,7 +1300,7 @@ Freeing numeric object: Loading numeric object: Done loading numeric object -UMFPACK V6.1.1 (June 16, 2023), Info: +UMFPACK V6.2.0 (Sept 8, 2023), Info: matrix entry defined as: double complex Int (generic integer) defined as: int64_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 @@ -1509,7 +1509,7 @@ Done copying numeric object Numeric blob size: 1208 Done serialize/deserialize of numeric object -UMFPACK V6.1.1 (June 16, 2023), Info: +UMFPACK V6.2.0 (Sept 8, 2023), Info: matrix entry defined as: double complex Int (generic integer) defined as: int64_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 @@ -1607,7 +1607,7 @@ maxnorm of residual: 4.88498e-15 Solving C'x=b again, using umfpack_zl_wsolve instead: -UMFPACK V6.1.1 (June 16, 2023), Info: +UMFPACK V6.2.0 (Sept 8, 2023), Info: matrix entry defined as: double complex Int (generic integer) defined as: int64_t BLAS library used: Intel MKL 64lp BLAS (32-bit integers). size of BLAS integer: 4 @@ -1705,4 +1705,4 @@ maxnorm of residual: 4.88498e-15 umfpack_zl_demo complete. -Total time: 0.01 seconds (CPU time), 0.01 seconds (wallclock time) +Total time: 0.00 seconds (CPU time), 0.00 seconds (wallclock time) diff --git a/UMFPACK/Doc/ChangeLog b/UMFPACK/Doc/ChangeLog index 3b38e0cc1..8f80454ae 100644 --- a/UMFPACK/Doc/ChangeLog +++ b/UMFPACK/Doc/ChangeLog @@ -1,3 +1,7 @@ +Sept 8, 2023: version 6.2.0 + + * cmake updates: SuiteSparse:: namespace by Markus Muetzel + June 16, 2023: version 6.1.1 * cmake build system updates: update by Markus Muetzel diff --git a/UMFPACK/Doc/UMFPACK_QuickStart.pdf b/UMFPACK/Doc/UMFPACK_QuickStart.pdf index f50c094f4..2b277f3e9 100644 Binary files a/UMFPACK/Doc/UMFPACK_QuickStart.pdf and b/UMFPACK/Doc/UMFPACK_QuickStart.pdf differ diff --git a/UMFPACK/Doc/UMFPACK_UserGuide.pdf b/UMFPACK/Doc/UMFPACK_UserGuide.pdf index 85f47ff68..7ed49e85f 100644 Binary files a/UMFPACK/Doc/UMFPACK_UserGuide.pdf and b/UMFPACK/Doc/UMFPACK_UserGuide.pdf differ diff --git a/UMFPACK/Doc/umfpack_version.tex b/UMFPACK/Doc/umfpack_version.tex index 174a02f6d..8b56ef294 100644 --- a/UMFPACK/Doc/umfpack_version.tex +++ b/UMFPACK/Doc/umfpack_version.tex @@ -1,2 +1,2 @@ % version of SuiteSparse/UMFPACK -\date{VERSION 6.1.1, June 16, 2023} +\date{VERSION 6.2.0, Sept 8, 2023} diff --git a/UMFPACK/Include/umfpack.h b/UMFPACK/Include/umfpack.h index 6b44c3790..c8e632135 100644 --- a/UMFPACK/Include/umfpack.h +++ b/UMFPACK/Include/umfpack.h @@ -82,10 +82,10 @@ extern "C" { * below. */ -#define UMFPACK_DATE "June 16, 2023" +#define UMFPACK_DATE "Sept 8, 2023" #define UMFPACK_MAIN_VERSION 6 -#define UMFPACK_SUB_VERSION 1 -#define UMFPACK_SUBSUB_VERSION 1 +#define UMFPACK_SUB_VERSION 2 +#define UMFPACK_SUBSUB_VERSION 0 #define UMFPACK_VER_CODE(main,sub) ((main) * 1000 + (sub)) #define UMFPACK_VER UMFPACK_VER_CODE(UMFPACK_MAIN_VERSION,UMFPACK_SUB_VERSION) diff --git a/UMFPACK/cmake_modules/FindUMFPACK.cmake b/UMFPACK/cmake_modules/FindUMFPACK.cmake deleted file mode 100644 index ee2b2ba4a..000000000 --- a/UMFPACK/cmake_modules/FindUMFPACK.cmake +++ /dev/null @@ -1,130 +0,0 @@ -#------------------------------------------------------------------------------- -# SuiteSparse/UMFPACK/cmake_modules/FindUMFPACK.cmake -#------------------------------------------------------------------------------- - -# The following copyright and license applies to just this file only, not to -# the library itself: -# FindUMFPACK.cmake, Copyright (c) 2022-2023, Timothy A. Davis. All Rights Reserved. -# SPDX-License-Identifier: BSD-3-clause - -#------------------------------------------------------------------------------- - -# Finds the UMFPACK include file and compiled library and sets: - -# UMFPACK_INCLUDE_DIR - where to find umfpack.h -# UMFPACK_LIBRARY - dynamic UMFPACK library -# UMFPACK_STATIC - static UMFPACK library -# UMFPACK_LIBRARIES - libraries when using UMFPACK -# UMFPACK_FOUND - true if UMFPACK found - -# set ``UMFPACK_ROOT`` to an UMFPACK installation root to tell this module -# where to look (this can be done as a cmake variable or as an evironment -# variable). - -# All the Find*.cmake files in SuiteSparse are installed by 'make install' into -# /usr/local/lib/cmake/SuiteSparse (where '/usr/local' is the -# ${CMAKE_INSTALL_PREFIX}). To access this file, place the following commands -# in your CMakeLists.txt file. See also SuiteSparse/Example/CMakeLists.txt: -# -# set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} -# ${CMAKE_INSTALL_PREFIX}/lib/cmake/SuiteSparse ) - -#------------------------------------------------------------------------------- - -# include files for UMFPACK -find_path ( UMFPACK_INCLUDE_DIR - NAMES umfpack.h - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/UMFPACK - HINTS ${CMAKE_SOURCE_DIR}/../UMFPACK - PATH_SUFFIXES include Include -) - -# dynamic UMFPACK library (or static if no dynamic library was built) -find_library ( UMFPACK_LIBRARY - NAMES umfpack umfpack_static - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/UMFPACK - HINTS ${CMAKE_SOURCE_DIR}/../UMFPACK - PATH_SUFFIXES lib build build/Release build/Debug -) - -if ( MSVC ) - set ( STATIC_NAME umfpack_static umfpack ) -else ( ) - set ( STATIC_NAME umfpack ) - set ( save ${CMAKE_FIND_LIBRARY_SUFFIXES} ) - set ( CMAKE_FIND_LIBRARY_SUFFIXES - ${CMAKE_STATIC_LIBRARY_SUFFIX} ${CMAKE_FIND_LIBRARY_SUFFIXES} ) -endif ( ) - -# static UMFPACK library -find_library ( UMFPACK_STATIC - NAMES ${STATIC_NAME} - HINTS ${CMAKE_SOURCE_DIR}/.. - HINTS ${CMAKE_SOURCE_DIR}/../SuiteSparse/UMFPACK - HINTS ${CMAKE_SOURCE_DIR}/../UMFPACK - PATH_SUFFIXES lib build build/Release build/Debug -) - -if ( NOT MSVC ) - # restore the CMAKE_FIND_LIBRARY_SUFFIXES variable - set ( CMAKE_FIND_LIBRARY_SUFFIXES ${save} ) -endif ( ) - -# get version of the library from the dynamic library name -get_filename_component ( UMFPACK_LIBRARY ${UMFPACK_LIBRARY} REALPATH ) -get_filename_component ( UMFPACK_FILENAME ${UMFPACK_LIBRARY} NAME ) -string ( - REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" - UMFPACK_VERSION - ${UMFPACK_FILENAME} -) - -# set ( UMFPACK_VERSION "" ) -if ( EXISTS "${UMFPACK_INCLUDE_DIR}" AND NOT UMFPACK_VERSION ) - # if the version does not appear in the filename, read the include file - file ( STRINGS ${UMFPACK_INCLUDE_DIR}/umfpack.h UMFPACK_MAJOR_STR - REGEX "define UMFPACK_MAIN_VERSION" ) - file ( STRINGS ${UMFPACK_INCLUDE_DIR}/umfpack.h UMFPACK_MINOR_STR - REGEX "define UMFPACK_SUB_VERSION" ) - file ( STRINGS ${UMFPACK_INCLUDE_DIR}/umfpack.h UMFPACK_PATCH_STR - REGEX "define UMFPACK_SUBSUB_VERSION" ) - message ( STATUS "major: ${UMFPACK_MAJOR_STR}" ) - message ( STATUS "minor: ${UMFPACK_MINOR_STR}" ) - message ( STATUS "patch: ${UMFPACK_PATCH_STR}" ) - string ( REGEX MATCH "[0-9]+" UMFPACK_MAJOR ${UMFPACK_MAJOR_STR} ) - string ( REGEX MATCH "[0-9]+" UMFPACK_MINOR ${UMFPACK_MINOR_STR} ) - string ( REGEX MATCH "[0-9]+" UMFPACK_PATCH ${UMFPACK_PATCH_STR} ) - set (UMFPACK_VERSION "${UMFPACK_MAJOR}.${UMFPACK_MINOR}.${UMFPACK_PATCH}") -endif ( ) - -set ( UMFPACK_LIBRARIES ${UMFPACK_LIBRARY} ) - -include (FindPackageHandleStandardArgs) - -find_package_handle_standard_args ( UMFPACK - REQUIRED_VARS UMFPACK_LIBRARY UMFPACK_INCLUDE_DIR - VERSION_VAR UMFPACK_VERSION -) - -mark_as_advanced ( - UMFPACK_INCLUDE_DIR - UMFPACK_LIBRARY - UMFPACK_STATIC - UMFPACK_LIBRARIES -) - -if ( UMFPACK_FOUND ) - message ( STATUS "UMFPACK version: ${UMFPACK_VERSION}" ) - message ( STATUS "UMFPACK include: ${UMFPACK_INCLUDE_DIR}" ) - message ( STATUS "UMFPACK library: ${UMFPACK_LIBRARY}" ) - message ( STATUS "UMFPACK static: ${UMFPACK_STATIC}" ) -else ( ) - message ( STATUS "UMFPACK not found" ) - set ( UMFPACK_INCLUDE_DIR "" ) - set ( UMFPACK_LIBRARIES "" ) - set ( UMFPACK_LIBRARY "" ) - set ( UMFPACK_STATIC "" ) -endif ( ) -